From: Timothy J. H. <tim...@ma...> - 2004-06-16 22:29:17
|
On Jun 16, 2004, at 4:50 PM, Ken Anderson wrote: > This is good! Is it easier to do #{ #} rather than the more > "synmetric" > #{ ... }#? The idea was to use # to prefix new tokens. We could however have used #{ and }# for strong quasi-strings and used [# and #] for escapes from strong quasi-strings. With this other alternative the example would be as follows: > > (define (prog version) > #{ > public class Test { > int [] a = new int[] { 1,2,3,4,5}; > String version = "[#version#]"; > > public static void main(String[] args) {;} > } > }# > ) > (lambda prog (version)...) I guess my feeling was that it might get confusing for people to remember whether we were using #{... }# or {#....#} and if we escaped with #[...]# or [#...#] So having a simple HASH-SYMBOL syntax for each delimiter makes it somewhat easier to remember... ---Tim--- > I'd prefer the second form if it isn't too hard, but i guess your way > might be slightly faster if there are lots of } in the string. > > k > At 04:30 PM 6/16/2004 -0400, you wrote: >> I've fixed the modulo bug in the latest CVS. >> >> Also, I've added hash-quasi-strings which I'll describe in more >> detail later tonight. >> The idea is that you use #{ and #} to indicate a hash-quasi-string >> and then you >> can escape into scheme using #[ and #] >> >> This will allow us to easily quote general strings. >> >> The advantage here is that the hash-quasi-string can contain curly >> braces and square braces >> and double quotes, without needing to "quote" them, thus you can use >> it go generate C or CSS >> >> >> e.g. this can be used as follows to generate a string representing a >> Java class with >> a user-supplied version string... >> >>>> (define (prog version) >>> #{ >>> public class Test { >>> int [] a = new int[] { 1,2,3,4,5}; >>> String version = "#[version#]"; >>> >>> public static void main(String[] args) {;} >>> } >>> #} >>> ) >>> (lambda prog (version)...) >> >>>> (prog "abc 6/16/04") >>> "\n public class Test {\n int [] a = new int[] { >>> 1,2,3,4,5};\n String version = \"abc 6/16/04\";\n \n >>> public static void main(String[] args) {;}\n }\n " >> >>>> (begin (display (prog "abc 6/16/04")) (newline) (newline) 'yes) >>> >>> public class Test { >>> int [] a = new int[] { 1,2,3,4,5}; >>> String version = "abc 6/16/04"; >>> >>> public static void main(String[] args) {;} >>> } >>> >>> >>> yes >> >> ---Tim--- >> >> P.S. if this breaks any code please tell me. >> It shouldn't have any effect unless you use #{ #} #[ #] somewhere >> in your code.... >> >> >> On Jun 16, 2004, at 4:15 PM, Borislav Iordanov wrote: >> >>> Hmm, I'm not sure. It seems % is the same as "remainder"... >>> >>> Thanks, >>> Borislav >>> >>> | -----Original Message----- >>> | From: jsc...@li... >>> | [mailto:jsc...@li...] On Behalf >>> | Of Ken Anderson >>> | Sent: Wednesday, June 16, 2004 3:54 PM >>> | To: Borislav Iordanov >>> | Cc: jsc...@li... >>> | Subject: Re: [Jscheme-user] Modulo function >>> | >>> | >>> | Yes, its broken. For now use >>> | > (% 0 5) >>> | 0 >>> | > (% 7 5) >>> | 2 >>> | > >>> | At 03:33 PM 6/16/2004 -0400, Borislav Iordanov wrote: >>> | >Hi, >>> | > >>> | >I noticed in Jscheme that: >>> | > >>> | >(modulo 0 5) => 5 >>> | > >>> | >Is this normal behavior? >>> | > >>> | >Thanks, >>> | >Borislav >>> | > >>> | > >>> | > >>> | >------------------------------------------------------- >>> | >This SF.Net email is sponsored by The 2004 JavaOne(SM) >>> | Conference Learn >>> | >from the experts at JavaOne(SM), Sun's Worldwide Java Developer >>> | >Conference, June 28 - July 1 at the Moscone Center in San >>> | Francisco, CA >>> | >REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code >>> | >NWMGYKND _______________________________________________ >>> | >Jscheme-user mailing list >>> | >Jsc...@li... >>> | >https://lists.sourceforge.net/lists/listinfo/jscheme-user >>> | >>> | >>> | >>> | ------------------------------------------------------- >>> | This SF.Net email is sponsored by The 2004 JavaOne(SM) >>> | Conference Learn from the experts at JavaOne(SM), Sun's >>> | Worldwide Java Developer Conference, June 28 - July 1 at the >>> | Moscone Center in San Francisco, CA REGISTER AND SAVE! >>> | http://java.sun.com/javaone/sf Priority | Code NWMGYKND >>> | _______________________________________________ >>> | Jscheme-user mailing list >>> | Jsc...@li... >>> | https://lists.sourceforge.net/lists/listinfo/jscheme-user >>> | >>> >>> >>> >>> ------------------------------------------------------- >>> This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference >>> Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer >>> Conference, June 28 - July 1 at the Moscone Center in San Francisco, >>> CA >>> REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code >>> NWMGYKND >>> _______________________________________________ >>> Jscheme-user mailing list >>> Jsc...@li... >>> https://lists.sourceforge.net/lists/listinfo/jscheme-user >> >> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference >> Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer >> Conference, June 28 - July 1 at the Moscone Center in San Francisco, >> CA >> REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code >> NWMGYKND >> _______________________________________________ >> Jscheme-user mailing list >> Jsc...@li... >> https://lists.sourceforge.net/lists/listinfo/jscheme-user > |