From: Timothy J. H. <ti...@cs...> - 2004-06-16 20:31:37
|
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 |