From charliesmith001 at gmail.com Sun Nov 1 01:07:12 2009 From: charliesmith001 at gmail.com (Charlie Smith) Date: Sun Nov 1 01:07:31 2009 Subject: [plt-scheme] getting all regex matches for a pattern Message-ID: Hi all, I'm new to plt-scheme and i'd like to know whether there is an option to get all the matches for a given regex pattern. The function (regex-match #rx"some regex pattern" target-string) seems to get only the first match. I've browsed the manuals but haven't come upon anything yet. I'd appreciate any help. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091101/1af1a7e8/attachment.htm From eli at barzilay.org Sun Nov 1 01:10:59 2009 From: eli at barzilay.org (Eli Barzilay) Date: Sun Nov 1 01:11:19 2009 Subject: [plt-scheme] getting all regex matches for a pattern In-Reply-To: References: Message-ID: <19181.6243.154212.416487@winooski.ccs.neu.edu> On Nov 1, Charlie Smith wrote: > (regex-match #rx"some regex pattern" target-string) > > seems to get only the first match. > (regexp-match #rx"fo*" "ffoo fo") ("f") > (regexp-match* #rx"fo*" "ffoo fo") ("f" "foo" "fo") -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From newton at mit.edu Sun Nov 1 16:02:14 2009 From: newton at mit.edu (Ryan Newton) Date: Sun Nov 1 16:02:54 2009 Subject: [plt-scheme] plt-r6rs --compile | Any way to get a parallel build? Message-ID: The automatic dependency based compilation of r6rs code in PLT is great. But it sure would be nice to have a "make -j" style parallel build functionality as well. Whenever I'm editing a file that's near the root of my dependency tree (and have to do a full recompile each time) I start wishing for this... Is this on the drawing board at all? Or (wishful thinking) available but not documented? Cheers, -Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091101/be848676/attachment.htm From mark.engelberg at gmail.com Sun Nov 1 15:58:59 2009 From: mark.engelberg at gmail.com (Mark Engelberg) Date: Sun Nov 1 16:05:48 2009 Subject: [plt-scheme] Delay/force printing behavior in advanced student language Message-ID: Compare the printing behavior of delays in student languages versus the module language by executing the following code: (define a (delay 2)) (force a) a In the module language: # In the advanced student language: (delay ...) Note that the way it prints in module language gives you information about the contents of the promise once it has been forced. It seems like the advanced student language should give at least as good information as the module language. Therefore, I would like to see it print as: (delay ...) before it is forced and (delay 2) once it has been forced. Any particular reason it doesn't do this? From robby at eecs.northwestern.edu Sun Nov 1 16:38:34 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Sun Nov 1 16:38:56 2009 Subject: [plt-scheme] Delay/force printing behavior in advanced student language In-Reply-To: References: Message-ID: <932b2f1f0911011338h10017947ud676f5a1c07ad842@mail.gmail.com> I don't think that there is any particular reason. The relevant library is pconvert.ss, if you wanted to sort out how to change it. Robby On Sun, Nov 1, 2009 at 2:58 PM, Mark Engelberg wrote: > Compare the printing behavior of delays in student languages versus > the module language by executing the following code: > > (define a (delay 2)) > (force a) > a > > In the module language: > # > > In the advanced student language: > (delay ...) > > Note that the way it prints in module language gives you information > about the contents of the promise once it has been forced. > It seems like the advanced student language should give at least as > good information as the module language. > Therefore, I would like to see it print as: > (delay ...) before it is forced and > (delay 2) once it has been forced. > > Any particular reason it doesn't do this? > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From robby at eecs.northwestern.edu Sun Nov 1 16:39:36 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Sun Nov 1 16:39:57 2009 Subject: [plt-scheme] plt-r6rs --compile | Any way to get a parallel build? In-Reply-To: References: Message-ID: <932b2f1f0911011339j4e2ff2f1m5bd4d5232b65a442@mail.gmail.com> On the drawing board at best. Kevin Tew may be able to tell us more. Robby On Sun, Nov 1, 2009 at 3:02 PM, Ryan Newton wrote: > The automatic dependency based compilation of r6rs code in PLT is great. > But it sure would be nice to have a "make -j" style parallel build > functionality as well.? Whenever I'm editing a file that's near the root of > my dependency tree (and have to do a full recompile each time) I start > wishing for this... > > Is this on the drawing board at all?? Or (wishful thinking) available but > not documented? > > Cheers, > -Ryan > > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From mark.engelberg at gmail.com Sun Nov 1 17:10:14 2009 From: mark.engelberg at gmail.com (Mark Engelberg) Date: Sun Nov 1 17:10:36 2009 Subject: [plt-scheme] Delay/force printing behavior in advanced student language In-Reply-To: <932b2f1f0911011338h10017947ud676f5a1c07ad842@mail.gmail.com> References: <932b2f1f0911011338h10017947ud676f5a1c07ad842@mail.gmail.com> Message-ID: It was pretty obvious how to change it, but now when I run advanced student language, I get: require: namespace mismatch; reference (phase 0) to a module "C:\Program Files\PLT\collects\scheme\private\kw.ss" that is not available (phase level 0) When I change the file back to the way it was, I get the same problem. So I'm thinking somehow I corrupted the various dependencies or compilation process. How do I rebuild everything to incorporate the changed file? Thanks, Mark On Sun, Nov 1, 2009 at 1:38 PM, Robby Findler wrote: > I don't think that there is any particular reason. The relevant > library is pconvert.ss, if you wanted to sort out how to change it. > > Robby > > On Sun, Nov 1, 2009 at 2:58 PM, Mark Engelberg wrote: >> Compare the printing behavior of delays in student languages versus >> the module language by executing the following code: >> >> (define a (delay 2)) >> (force a) >> a >> >> In the module language: >> # >> >> In the advanced student language: >> (delay ...) >> >> Note that the way it prints in module language gives you information >> about the contents of the promise once it has been forced. >> It seems like the advanced student language should give at least as >> good information as the module language. >> Therefore, I would like to see it print as: >> (delay ...) before it is forced and >> (delay 2) once it has been forced. >> >> Any particular reason it doesn't do this? >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > From robby at eecs.northwestern.edu Sun Nov 1 17:18:50 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Sun Nov 1 17:19:12 2009 Subject: [plt-scheme] Delay/force printing behavior in advanced student language In-Reply-To: References: <932b2f1f0911011338h10017947ud676f5a1c07ad842@mail.gmail.com> Message-ID: <932b2f1f0911011418y3f93dd81vfed43ffa4eca9fd@mail.gmail.com> Run setup-plt. Robby On Sun, Nov 1, 2009 at 4:10 PM, Mark Engelberg wrote: > It was pretty obvious how to change it, but now when I run advanced > student language, I get: > require: namespace mismatch; reference (phase 0) to a module > "C:\Program Files\PLT\collects\scheme\private\kw.ss" that is not > available (phase level 0) > > When I change the file back to the way it was, I get the same problem. > ?So I'm thinking somehow I corrupted the various dependencies or > compilation process. > > How do I rebuild everything to incorporate the changed file? > > Thanks, > > Mark > > On Sun, Nov 1, 2009 at 1:38 PM, Robby Findler > wrote: >> I don't think that there is any particular reason. The relevant >> library is pconvert.ss, if you wanted to sort out how to change it. >> >> Robby >> >> On Sun, Nov 1, 2009 at 2:58 PM, Mark Engelberg wrote: >>> Compare the printing behavior of delays in student languages versus >>> the module language by executing the following code: >>> >>> (define a (delay 2)) >>> (force a) >>> a >>> >>> In the module language: >>> # >>> >>> In the advanced student language: >>> (delay ...) >>> >>> Note that the way it prints in module language gives you information >>> about the contents of the promise once it has been forced. >>> It seems like the advanced student language should give at least as >>> good information as the module language. >>> Therefore, I would like to see it print as: >>> (delay ...) before it is forced and >>> (delay 2) once it has been forced. >>> >>> Any particular reason it doesn't do this? >>> _________________________________________________ >>> ?For list-related administrative tasks: >>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>> >> > From winkllj at acm.org Sun Nov 1 16:59:14 2009 From: winkllj at acm.org (Lawrence J Winkler) Date: Sun Nov 1 17:59:54 2009 Subject: [plt-scheme] plot/extend (zgrid ....) not consistent with documentation Message-ID: The zgrid procedure is documented as (zgrid f xs ys) ? (listof (listof real?)) f : (real? real? . -> . real?) xs : (listof real?) ys : (listof real?) Given a function that consumes x and y to produce z, a list of xs, and a list of ys, produces a list of z column values. But errors out indicating the procedure takes 4 parameters It is defined in renderer-helpers.ss as ; zgrid : (number number -> number) listof-number listof-number -> listof-listof number (define (zgrid func x-vals y-vals samples) (map (lambda (x) (map (lambda (y) (func x y)) y-vals)) x-vals)) The 'samples' parameter is not referenced in the body. How should the definition or use be corrected? Thanks ------------------------------- Lawrence J. Winkler, M.S., J.D. 5306 Loruth Ter Madison Wisconsin 53711 Phone: 608-274-0414 Mobile: 608-345-0627 Email: winkllj@acm.org -------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091101/c63f258f/attachment-0001.htm From matthias at ccs.neu.edu Sun Nov 1 19:09:24 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Sun Nov 1 19:10:02 2009 Subject: [plt-scheme] Delay/force printing behavior in advanced student language In-Reply-To: References: <932b2f1f0911011338h10017947ud676f5a1c07ad842@mail.gmail.com> Message-ID: <345572A8-C6A7-4BE9-A7AA-6A35B4130D9F@ccs.neu.edu> This is PLT's friendliest way (as far as I know) of telling you that you changed something in the code base w/o re-running setup-plt. I know I know ... but I have no clue why this error message is like it is. $ setup-plt -l lang On Nov 1, 2009, at 5:10 PM, Mark Engelberg wrote: > It was pretty obvious how to change it, but now when I run advanced > student language, I get: > require: namespace mismatch; reference (phase 0) to a module > "C:\Program Files\PLT\collects\scheme\private\kw.ss" that is not > available (phase level 0) > > When I change the file back to the way it was, I get the same problem. > So I'm thinking somehow I corrupted the various dependencies or > compilation process. > > How do I rebuild everything to incorporate the changed file? > > Thanks, > > Mark > > On Sun, Nov 1, 2009 at 1:38 PM, Robby Findler > wrote: >> I don't think that there is any particular reason. The relevant >> library is pconvert.ss, if you wanted to sort out how to change it. >> >> Robby >> >> On Sun, Nov 1, 2009 at 2:58 PM, Mark Engelberg > > wrote: >>> Compare the printing behavior of delays in student languages versus >>> the module language by executing the following code: >>> >>> (define a (delay 2)) >>> (force a) >>> a >>> >>> In the module language: >>> # >>> >>> In the advanced student language: >>> (delay ...) >>> >>> Note that the way it prints in module language gives you information >>> about the contents of the promise once it has been forced. >>> It seems like the advanced student language should give at least as >>> good information as the module language. >>> Therefore, I would like to see it print as: >>> (delay ...) before it is forced and >>> (delay 2) once it has been forced. >>> >>> Any particular reason it doesn't do this? >>> _________________________________________________ >>> For list-related administrative tasks: >>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>> >> > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From toddobryan at gmail.com Sun Nov 1 19:29:12 2009 From: toddobryan at gmail.com (Todd O'Bryan) Date: Sun Nov 1 19:29:33 2009 Subject: [plt-scheme] Delay/force printing behavior in advanced student language In-Reply-To: <345572A8-C6A7-4BE9-A7AA-6A35B4130D9F@ccs.neu.edu> References: <932b2f1f0911011338h10017947ud676f5a1c07ad842@mail.gmail.com> <345572A8-C6A7-4BE9-A7AA-6A35B4130D9F@ccs.neu.edu> Message-ID: <904774730911011629p146fa3v9ef358aee3d91d07@mail.gmail.com> The non-friendly way involves a shock from the keyboard, your printer exploding, and several nasty emails being sent to your colleagues and immediate supervisor. Doesn't that make this error message seem so much better? :-) Todd On Sun, Nov 1, 2009 at 8:09 PM, Matthias Felleisen wrote: > > This is PLT's friendliest way (as far as I know) of telling you that you > changed something in the code base w/o re-running setup-plt. I know I know > ... but I have no clue why this error message is like it is. > > ?$ setup-plt -l lang > > > On Nov 1, 2009, at 5:10 PM, Mark Engelberg wrote: > >> It was pretty obvious how to change it, but now when I run advanced >> student language, I get: >> require: namespace mismatch; reference (phase 0) to a module >> "C:\Program Files\PLT\collects\scheme\private\kw.ss" that is not >> available (phase level 0) >> >> When I change the file back to the way it was, I get the same problem. >> So I'm thinking somehow I corrupted the various dependencies or >> compilation process. >> >> How do I rebuild everything to incorporate the changed file? >> >> Thanks, >> >> Mark >> >> On Sun, Nov 1, 2009 at 1:38 PM, Robby Findler >> wrote: >>> >>> I don't think that there is any particular reason. The relevant >>> library is pconvert.ss, if you wanted to sort out how to change it. >>> >>> Robby >>> >>> On Sun, Nov 1, 2009 at 2:58 PM, Mark Engelberg >>> wrote: >>>> >>>> Compare the printing behavior of delays in student languages versus >>>> the module language by executing the following code: >>>> >>>> (define a (delay 2)) >>>> (force a) >>>> a >>>> >>>> In the module language: >>>> # >>>> >>>> In the advanced student language: >>>> (delay ...) >>>> >>>> Note that the way it prints in module language gives you information >>>> about the contents of the promise once it has been forced. >>>> It seems like the advanced student language should give at least as >>>> good information as the module language. >>>> Therefore, I would like to see it print as: >>>> (delay ...) before it is forced and >>>> (delay 2) once it has been forced. >>>> >>>> Any particular reason it doesn't do this? >>>> _________________________________________________ >>>> ?For list-related administrative tasks: >>>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>>> >>> >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From mark.engelberg at gmail.com Sun Nov 1 20:06:47 2009 From: mark.engelberg at gmail.com (Mark Engelberg) Date: Sun Nov 1 20:07:04 2009 Subject: [plt-scheme] Delay/force printing behavior in advanced student language In-Reply-To: <932b2f1f0911011418y3f93dd81vfed43ffa4eca9fd@mail.gmail.com> References: <932b2f1f0911011338h10017947ud676f5a1c07ad842@mail.gmail.com> <932b2f1f0911011418y3f93dd81vfed43ffa4eca9fd@mail.gmail.com> Message-ID: Yeah, I forgot to run setup-plt. Thanks, Mark From mark.engelberg at gmail.com Sun Nov 1 21:37:30 2009 From: mark.engelberg at gmail.com (Mark Engelberg) Date: Sun Nov 1 21:37:49 2009 Subject: [plt-scheme] Installing Datalog Message-ID: In 4.2.2, I've run #lang scheme (require (planet jaymccarthy/datalog:1:1)) and Datalog is not appearing in my list of Experimental Languages. I've tried uninstalling and reinstalling Scheme and repeating the above steps, but to no avail. Anyone know what I'm doing wrong? Thanks, Mark From carl.eastlund at gmail.com Sun Nov 1 21:41:58 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Sun Nov 1 21:42:36 2009 Subject: [plt-scheme] Installing Datalog In-Reply-To: References: Message-ID: <990e0c030911011841m55626edbw4f204cd2d24e2500@mail.gmail.com> Mark, You must restart DrScheme after installing a planet package for any changes in the Language menu to show up. You might consider closing DrScheme and installing with this command line: planet install jaymccarthy datalog.plt 1 1 Then start DrScheme and try the language menu. If you have been restarting DrScheme, I don't know what's wrong. But it definitely won't update while it's running. Carl Eastlund On Sun, Nov 1, 2009 at 9:37 PM, Mark Engelberg wrote: > In 4.2.2, I've run > #lang scheme > (require (planet jaymccarthy/datalog:1:1)) > > and Datalog is not appearing in my list of Experimental Languages. > I've tried uninstalling and reinstalling Scheme and repeating the > above steps, but to no avail. > > Anyone know what I'm doing wrong? > > Thanks, > > Mark From mark.engelberg at gmail.com Sun Nov 1 21:59:54 2009 From: mark.engelberg at gmail.com (Mark Engelberg) Date: Sun Nov 1 22:00:12 2009 Subject: [plt-scheme] Installing Datalog In-Reply-To: <990e0c030911011841m55626edbw4f204cd2d24e2500@mail.gmail.com> References: <990e0c030911011841m55626edbw4f204cd2d24e2500@mail.gmail.com> Message-ID: Yes, I've restarted DrScheme several times since installing datalog. My laptop went into standby in the middle of the first time I installed it, so I'm wondering if the interruption left it in a state where the language is in the cache, but it didn't complete the change to the language menu. That's why I uninstalled and reinstalled Scheme. But it didn't make a difference. (Does the cache persist between uninstalling and reinstalling? If so, is there a way to explicitly flush the planet cache?) On Sun, Nov 1, 2009 at 6:41 PM, Carl Eastlund wrote: > Mark, > > You must restart DrScheme after installing a planet package for any > changes in the Language menu to show up. ?You might consider closing > DrScheme and installing with this command line: > > planet install jaymccarthy datalog.plt 1 1 > > Then start DrScheme and try the language menu. > > If you have been restarting DrScheme, I don't know what's wrong. ?But > it definitely won't update while it's running. > > Carl Eastlund > > On Sun, Nov 1, 2009 at 9:37 PM, Mark Engelberg wrote: >> In 4.2.2, I've run >> #lang scheme >> (require (planet jaymccarthy/datalog:1:1)) >> >> and Datalog is not appearing in my list of Experimental Languages. >> I've tried uninstalling and reinstalling Scheme and repeating the >> above steps, but to no avail. >> >> Anyone know what I'm doing wrong? >> >> Thanks, >> >> Mark > From carl.eastlund at gmail.com Sun Nov 1 22:03:25 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Sun Nov 1 22:04:04 2009 Subject: [plt-scheme] Installing Datalog In-Reply-To: References: <990e0c030911011841m55626edbw4f204cd2d24e2500@mail.gmail.com> Message-ID: <990e0c030911011903g27d4097bue5c78717b37f195b@mail.gmail.com> Ah. Yes, the cache persists. Run: planet show Check the version of datalog.plt you have, then run the following, updating the major and minor version numbers if necessary: planet remove jaymccarthy datalog.plt 1 1 Then run "planet show" again to make sure it's gone. Now install again: planet install jaymccarthy datalog.plt 1 2 Good luck! --Carl On Sun, Nov 1, 2009 at 9:59 PM, Mark Engelberg wrote: > Yes, I've restarted DrScheme several times since installing datalog. > > My laptop went into standby in the middle of the first time I > installed it, so I'm wondering if the interruption left it in a state > where the language is in the cache, but it didn't complete the change > to the language menu. ?That's why I uninstalled and reinstalled > Scheme. ?But it didn't make a difference. ?(Does the cache persist > between uninstalling and reinstalling? ?If so, is there a way to > explicitly flush the planet cache?) > > On Sun, Nov 1, 2009 at 6:41 PM, Carl Eastlund wrote: >> Mark, >> >> You must restart DrScheme after installing a planet package for any >> changes in the Language menu to show up. ?You might consider closing >> DrScheme and installing with this command line: >> >> planet install jaymccarthy datalog.plt 1 1 >> >> Then start DrScheme and try the language menu. >> >> If you have been restarting DrScheme, I don't know what's wrong. ?But >> it definitely won't update while it's running. >> >> Carl Eastlund >> >> On Sun, Nov 1, 2009 at 9:37 PM, Mark Engelberg wrote: >>> In 4.2.2, I've run >>> #lang scheme >>> (require (planet jaymccarthy/datalog:1:1)) >>> >>> and Datalog is not appearing in my list of Experimental Languages. >>> I've tried uninstalling and reinstalling Scheme and repeating the >>> above steps, but to no avail. >>> >>> Anyone know what I'm doing wrong? >>> >>> Thanks, >>> >>> Mark >> > From mark.engelberg at gmail.com Sun Nov 1 22:13:01 2009 From: mark.engelberg at gmail.com (Mark Engelberg) Date: Sun Nov 1 22:13:20 2009 Subject: [plt-scheme] Installing Datalog In-Reply-To: <990e0c030911011903g27d4097bue5c78717b37f195b@mail.gmail.com> References: <990e0c030911011841m55626edbw4f204cd2d24e2500@mail.gmail.com> <990e0c030911011903g27d4097bue5c78717b37f195b@mail.gmail.com> Message-ID: That did the trick. Thanks! On Sun, Nov 1, 2009 at 7:03 PM, Carl Eastlund wrote: > Ah. ?Yes, the cache persists. ?Run: > > planet show > > Check the version of datalog.plt you have, then run the following, > updating the major and minor version numbers if necessary: > > planet remove jaymccarthy datalog.plt 1 1 > > Then run "planet show" again to make sure it's gone. ?Now install again: > > planet install jaymccarthy datalog.plt 1 2 > > Good luck! > > --Carl > > On Sun, Nov 1, 2009 at 9:59 PM, Mark Engelberg wrote: >> Yes, I've restarted DrScheme several times since installing datalog. >> >> My laptop went into standby in the middle of the first time I >> installed it, so I'm wondering if the interruption left it in a state >> where the language is in the cache, but it didn't complete the change >> to the language menu. ?That's why I uninstalled and reinstalled >> Scheme. ?But it didn't make a difference. ?(Does the cache persist >> between uninstalling and reinstalling? ?If so, is there a way to >> explicitly flush the planet cache?) >> >> On Sun, Nov 1, 2009 at 6:41 PM, Carl Eastlund wrote: >>> Mark, >>> >>> You must restart DrScheme after installing a planet package for any >>> changes in the Language menu to show up. ?You might consider closing >>> DrScheme and installing with this command line: >>> >>> planet install jaymccarthy datalog.plt 1 1 >>> >>> Then start DrScheme and try the language menu. >>> >>> If you have been restarting DrScheme, I don't know what's wrong. ?But >>> it definitely won't update while it's running. >>> >>> Carl Eastlund >>> >>> On Sun, Nov 1, 2009 at 9:37 PM, Mark Engelberg wrote: >>>> In 4.2.2, I've run >>>> #lang scheme >>>> (require (planet jaymccarthy/datalog:1:1)) >>>> >>>> and Datalog is not appearing in my list of Experimental Languages. >>>> I've tried uninstalling and reinstalling Scheme and repeating the >>>> above steps, but to no avail. >>>> >>>> Anyone know what I'm doing wrong? >>>> >>>> Thanks, >>>> >>>> Mark >>> >> > From scott at adrenaline.com Mon Nov 2 01:17:20 2009 From: scott at adrenaline.com (Scott McLoughlin) Date: Mon Nov 2 01:18:08 2009 Subject: [plt-scheme] More fun with typed scheme: attempt to write vector-join and a minor rant Message-ID: <4AEE7970.2040606@adrenaline.com> Or vector-append - but in any case, just a function that creates a single (Vectorof a) out a bunch of other (Vectorof a) arguments passed as rest arguments. So the signature is. (define: (a) (vector-join . [vecs : (Vectorof a) *]) : (Vectorof a) A blow by blow of the type errors is impossible at this point (unless Dr. Scheme has a logging feature of which I'm not aware.) But futzing around, (1) I first recalled from previous emails that some vector routines weren't "type-schemed" yet, so I wrote my own vector->list called tvector->list. Lovely routine, but that didn't do the trick. Then I recalled reading the cool paper on the typed-scheme type system and how it handled, with near pure genius, higher order variable arity routines such as "map." So, hmmm, I thought, and wrote my own nicely type-schemed "map1" which just did the job for a single list and nothing else fancy. That works lovely too, as it well should. ;;; tvector->list isn't a challenge (tvector->list #(2 3)) (2 3) ;;; No general problem with map1 (map1 string->symbol (list "ffdsaf" "d")) (ffdsaf d) Nevertheless, combining map or map1 with vector->list or tvector->list give nearly identical error messages. ;;; Original map type check error (map vector->list (list #(2) #(1))) typecheck: Polymorphic function map could not be applied to arguments: Domain: (a b ... b -> c) (Listof a) (Listof b) ... b Arguments: (All (a) ((Vectorof a) -> (Listof a))) (List (Vectorof Integer) (Vectorof Integer)) in: (#%app map vector->list (#%app list (quote #(2)) (quote #(1)))) ;;; My map1 type check error, this type using tvector->list (map1 vector->list (list #(2) #(1))) typecheck: Polymorphic function map1 could not be applied to arguments: Domain: (a -> b) (Listof a) Arguments: (All (a) ((Vectorof a) -> (Listof a))) (List (Vectorof Integer) (Vectorof Integer)) in: (#%app map1 tvector->list (#%app list (quote #(2)) (quote #(1)))) So anyway, imagine lots of futzing and testing, breaking down each little part, of an already really short function to begin with, and making sure it works. But alas, unless I'm terribly distracted by Next Iron Chef, I think there's some other reason I'm coming up empty handed. So any guidance, greatly appreciated. OH OH OH OH - One last little thing that actually does tick off my normally serene demeanor. As I understand it, (List a b c) is basically a tuple and (Listof a) is a list of type a. Well, unless I'm missing something, and yes, I certainly might be, the error messages you'll see above report rest arguments as if they were tuples: (List (Vec...) (Vec...)). Maybe there's some great reason for this, but it's yet another "undocumented feature" of typed-scheme that caused untold amounts of unnecessary staring at the screen and drooling on the keyboard on my part. Anyway, I LOVE the idea of typed scheme, and could even imagine loving WORKING with it, but given that nearly every time I've touched it I've had to post to this list and retrieved a response akin to, "Oh yeah, sorry, that's not really 100% yet," maybe it would be kinder to those whose time is actually worth something to actually pull the plug on the beloved feature until it gets the 1000's of test cases, ~50 pages of introductory tutorial and ~200+ pages of detailed documentation that the (otherwise nifty) language deserves. I don't mean to be bitchy, just logical. How many pages is R6RS and with what care was that documentation written? Hate the "big scheme"? Ok, heck, just take R5RS as an example if one prefers and count up its written pages along with the tons and tons and tons of person-hours of deliberation in its making. And neither of *those* teeny weeny tiny little languages have typed-scheme's complex manifest type system to fully describe, shine blindingly bright illumination on every corner case, and so on and so forth. Anyway, I'd MUCH rather just have typed-scheme work 95++ % of the time or at least see a carefully constructed and published road map regarding both HOW and WHEN type-scheme might finally achieve this level of ready for "prime time" status. Scott p.s. Yeah, part of my past experience has been as both a project mgmt puke, and worse, as a CEO - so if I sound like one, sue me :-) p.p.s. The reason I give a hoot at all is because I'm really hoping to use typed scheme to write non-trivial parts of a compiler, including a CPS style back end, and going back to the drawing board on the tools selection front of the project isn't really inviting. From noelwelsh at gmail.com Mon Nov 2 03:20:11 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Mon Nov 2 03:20:34 2009 Subject: [plt-scheme] More fun with typed scheme: attempt to write vector-join and a minor rant In-Reply-To: <4AEE7970.2040606@adrenaline.com> References: <4AEE7970.2040606@adrenaline.com> Message-ID: On Mon, Nov 2, 2009 at 6:17 AM, Scott McLoughlin wrote: > Anyway, I LOVE the idea of typed scheme, and could even imagine loving > WORKING with it, but given > that nearly every time I've touched it I've had to post to this list and > retrieved a response akin > to, "Oh yeah, sorry, that's not really 100% yet," maybe it would be kinder > to those whose > time is actually worth something to actually pull the plug on the beloved > feature until it gets > the 1000's of test cases, ~50 pages of introductory tutorial and ~200+ pages > of detailed > documentation that the (otherwise nifty) language deserves. Typed Scheme is still an "experimental" language -- if you use you should expect to run into problems. Basically, you're a beta tester. Furthermore, my experience is that Typed Scheme's support of vectors is quite lacking compared to its support of, say, lists. I think your use is exposing many flaws that you wouldn't run into if you weren't dealing with vectors. You can get useful work done in Typed Scheme. I use the library here: http://github.com/noelwelsh/numeric/tree/master/bonfire/ almost every day. You need to accept some pain (err... learning) though. You'll see that bonfire is a mix of typed and untyped code -- necessary to work around current limitations in Typed Scheme's type system. N. From martindemello at gmail.com Mon Nov 2 05:18:05 2009 From: martindemello at gmail.com (Martin DeMello) Date: Mon Nov 2 05:18:24 2009 Subject: [plt-scheme] could we have a git-svn mirror of the repository? Message-ID: Pretty please? :) I tried checking it out myself but it was huge and died halfway, and I didn't think it right to waste the server's bandwidth by trying again. If there were an official read-only git-svn mirror maintained on the same server, it would just require a rebase script every time something got checked into svn. Would make life a lot more convenient for people wanting to hack on the codebase. martin From jos.koot at telefonica.net Mon Nov 2 06:24:21 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Mon Nov 2 06:25:45 2009 Subject: [plt-scheme] Delay/force printing behavior in advanced studentlanguage References: Message-ID: I find: #lang scheme (define a (delay 2)) (force a) a Welcome to DrScheme, version 4.2.2.4-svn27oct2009 [3m]. Language: Module custom; memory limit: 800 megabytes. 2 # > Jos ----- Original Message ----- From: "Mark Engelberg" To: "PLT-Scheme List" Sent: Sunday, November 01, 2009 9:58 PM Subject: [plt-scheme] Delay/force printing behavior in advanced studentlanguage > Compare the printing behavior of delays in student languages versus > the module language by executing the following code: > > (define a (delay 2)) > (force a) > a > > In the module language: > # > > In the advanced student language: > (delay ...) > > Note that the way it prints in module language gives you information > about the contents of the promise once it has been forced. > It seems like the advanced student language should give at least as > good information as the module language. > Therefore, I would like to see it print as: > (delay ...) before it is forced and > (delay 2) once it has been forced. > > Any particular reason it doesn't do this? > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From robby at eecs.northwestern.edu Mon Nov 2 07:01:33 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Mon Nov 2 07:01:51 2009 Subject: [plt-scheme] More fun with typed scheme: attempt to write vector-join and a minor rant In-Reply-To: <4AEE7970.2040606@adrenaline.com> References: <4AEE7970.2040606@adrenaline.com> Message-ID: <932b2f1f0911020401w66cefb0pbb3f01ddcb2e3add@mail.gmail.com> On Mon, Nov 2, 2009 at 12:17 AM, Scott McLoughlin wrote: > Anyway, I LOVE the idea of typed scheme, and could even imagine loving > WORKING with it, but given > that nearly every time I've touched it I've had to post to this list and > retrieved a response akin > to, "Oh yeah, sorry, that's not really 100% yet," maybe it would be kinder > to those whose > time is actually worth something to actually pull the plug on the beloved > feature until it gets > the 1000's of test cases, ~50 pages of introductory tutorial and ~200+ pages > of detailed > documentation that the (otherwise nifty) language deserves. Partly to echo Noel's sentiments, but also to add a little, let me suggest that maybe you aren't ready for Typed Scheme. Building a typed language with the goals that Typed Scheme has is an ambitious project and, IMO, we should reward Sam with encouragement, understanding, and clear, concise bug reports, rather than rants. (Pile on the bug reports, in fact.) Meanwhile, I think Sam should continue to release it as he has been, getting it out there with the understanding that it is a growing product. Our (CS's) history is rife with stories where worse is better --- PLT itself is one such example. Early on, if Matthew had not pushed the release-what-we've-got-and-keep-making-it-better-as-best-we-can over others' natural lets-leave-it-in-a-cave-and-only-go-into-the-daylight-when-it-is-perfect instincts, we would not be where we are today (wherever that is...). Robby From eli at barzilay.org Mon Nov 2 07:22:09 2009 From: eli at barzilay.org (Eli Barzilay) Date: Mon Nov 2 07:22:49 2009 Subject: [plt-scheme] could we have a git-svn mirror of the repository? In-Reply-To: References: Message-ID: <19182.52977.971236.466927@winooski.ccs.neu.edu> On Nov 2, Martin DeMello wrote: > Pretty please? :) I tried checking it out myself but it was huge and > died halfway, and I didn't think it right to waste the server's > bandwidth by trying again. If there were an official read-only > git-svn mirror maintained on the same server, it would just require > a rebase script every time something got checked into svn. Would > make life a lot more convenient for people wanting to hack on the > codebase. Yes, I can definitely do that, provided that: * Someone can provide me with child-proof instructions on how to do so (my experience with git wasn't too great). * It is enough to serve the result over plain http somehow -- so I don't need to install new apache modules or open up new ports or whatever. In fact, if this can be used to provide patches for the plt repository, then I'll take back the second bullet and will invest in doing whatever's needed to install it -- including whatever hooks are needed to keep it in sync with the svn repository, and include the links on the svn.plt-scheme.org repository page. Notes: * Feel free to contact me off-list if you can provide the above child-proof instructions. * All of this applies for other distributed systems too. * Out of curiosity (and no flames intended): if this can be used to have people use git and send back patch sets, then does that mean that there's no need for our repository to ever move to a distributed tool? (The thing is that I looked into it, and none of the systems look nearly as robust as svn does.) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From troelskn at gmail.com Mon Nov 2 07:30:56 2009 From: troelskn at gmail.com (troels knak-nielsen) Date: Mon Nov 2 07:39:10 2009 Subject: [plt-scheme] could we have a git-svn mirror of the repository? In-Reply-To: <19182.52977.971236.466927@winooski.ccs.neu.edu> References: <19182.52977.971236.466927@winooski.ccs.neu.edu> Message-ID: <98b8086f0911020430i309330fdw12c7e1384b5bdafa@mail.gmail.com> On Mon, Nov 2, 2009 at 1:22 PM, Eli Barzilay wrote: > * Out of curiosity (and no flames intended): if this can be used to > ?have people use git and send back patch sets, then does that mean > ?that there's no need for our repository to ever move to a > ?distributed tool? ?(The thing is that I looked into it, and none of > ?the systems look nearly as robust as svn does.) Synchronising two-way between svn and git is *possible*, but tricky. I'm not exactly an expert on git, but I tried to do this for a project and had it sort-of-working for a while, before it blew up. I think it's possible to handle if you know both git and svn well, but I think it requires that. So if you're willing to invest the time in becoming an expert on git, you can keep svn ;) -- troels From samth at ccs.neu.edu Mon Nov 2 08:18:31 2009 From: samth at ccs.neu.edu (Sam TH) Date: Mon Nov 2 08:19:09 2009 Subject: [plt-scheme] More fun with typed scheme: attempt to write vector-join and a minor rant In-Reply-To: <4AEE7970.2040606@adrenaline.com> References: <4AEE7970.2040606@adrenaline.com> Message-ID: <63bb19ae0911020518y2b154748nef833b258d280e02@mail.gmail.com> On Mon, Nov 2, 2009 at 1:17 AM, Scott McLoughlin wrote: > Or vector-append - but in any case, just a function that creates > a single (Vectorof a) out a bunch of other (Vectorof a) arguments > passed as rest arguments. Like I said, I'll have better support for vectors in Typed Scheme, hopefully today or tomorrow. > So the signature is. > > (define: (a) (vector-join . [vecs : (Vectorof a) *]) : (Vectorof a) > > A blow by blow of the type errors is impossible at this point (unless Dr. > Scheme has a logging feature of which I'm not aware.) > > But futzing around, (1) I first recalled from previous emails that some > vector routines weren't "type-schemed" yet, so I wrote my own vector->list > called tvector->list. Lovely routine, but that didn't do the trick. `vector->list' has a type in Typed Scheme, so your function shouldn't be necessary. > Then I recalled reading the cool paper on the typed-scheme type system > and how it handled, with near pure genius, higher order variable arity > routines such as "map." ?So, hmmm, I thought, and wrote my own nicely > type-schemed "map1" which just did the job for a single list and nothing > else fancy. That works lovely too, as it well should. > > ;;; tvector->list isn't a challenge > (tvector->list #(2 3)) > (2 3) > > > ;;; No general problem with map1 > (map1 string->symbol (list "ffdsaf" "d")) > (ffdsaf d) > > Nevertheless, combining map or map1 with vector->list or tvector->list give > nearly > identical error messages. > > ;;; Original map type check error > (map vector->list ? (list #(2) #(1))) > typecheck: Polymorphic function map could not be applied to arguments: > Domain: (a b ... b -> c) (Listof a) (Listof b) ... b > Arguments: (All (a) ((Vectorof a) -> (Listof a))) (List (Vectorof Integer) > (Vectorof Integer)) > in: (#%app map vector->list (#%app list (quote #(2)) (quote #(1)))) > > ;;; My map1 type check error, this type using tvector->list > (map1 vector->list ? (list #(2) #(1))) > typecheck: Polymorphic function map1 could not be applied to arguments: > Domain: (a -> b) (Listof a) > Arguments: (All (a) ((Vectorof a) -> (Listof a))) (List (Vectorof Integer) > (Vectorof Integer)) > in: (#%app map1 tvector->list (#%app list (quote #(2)) (quote #(1)))) This is because Typed Scheme, in general, can't infer the types when you apply a polymorphic function (like `map') to a polymorphic argument (like `vector->list'). I will improve the error message so this is clear. > So anyway, imagine lots of futzing and testing, breaking down each little > part, of an already really short function to begin with, and making sure it > works. ?But alas, unless I'm terribly distracted by Next Iron Chef, I think > there's > some other reason I'm coming up empty handed. > > So any guidance, greatly appreciated. Here's a solution: (map #{vector->list @ Integer} (list #(1) #(2))) What that funny syntax does is explicitly instantiate the `vector->list' function at the type Integer, so it no longer runs into the problem described above. If you don't like funny syntax, you can also write this: (map (inst vector->list Integer) (list #(1) #(2))) which does the same thing. > > OH OH OH OH - One last little thing that actually does tick off my normally > serene demeanor. ?As I understand it, (List a b c) is basically a tuple and > (Listof a) is a list of type a. > Well, unless I'm missing something, and yes, I certainly might be, the error > messages > you'll see above report rest arguments as if they were tuples: (List > (Vec...) (Vec...)). > > Maybe there's some great reason for this, but it's yet another "undocumented > feature" > of typed-scheme that caused untold amounts of unnecessary staring at the > screen and drooling > on the keyboard on my part. This isn't particular to rest arguments. Typed Scheme knows that an expression like (list #(2) #(1)) produces a fixed length list, and so it reports that type in the expression. There's really not much difference between the two, so I'm not sure what caused your confusion. Can you clarify? > Anyway, I LOVE the idea of typed scheme, and could even imagine loving > WORKING with it, but given > that nearly every time I've touched it I've had to post to this list and > retrieved a response akin > to, "Oh yeah, sorry, that's not really 100% yet," maybe it would be kinder > to those whose > time is actually worth something to actually pull the plug on the beloved > feature until it gets > the 1000's of test cases, ~50 pages of introductory tutorial and ~200+ pages > of detailed > documentation that the (otherwise nifty) language deserves. First, people are using Typed Scheme for real. We've used it even in undergraduate classes here at Northeastern. But we could never have the success we've had in PLT of making academic research software useful to real people if we never showed it to anyone before it was completely polished. Even apart from academia, that isn't how any free software project works. > And neither of *those* teeny weeny tiny little languages have typed-scheme's > complex manifest type > system to fully describe, shine blindingly bright illumination on every > corner case, and so on and > so forth. > Anyway, I'd MUCH rather just have typed-scheme work 95++ % of the time or at > least see a > carefully constructed and published road map regarding both HOW and WHEN > type-scheme might > finally achieve this level of ready for "prime time" status. There's a few answers as to when. First, it is, as the Beatles say, getting better all the time. Second, it gets better when people use it, and complain about things they don't like, as you're doing, and more help is always appreciated [1]. But the real answer is that Typed Scheme is still a research project, and it would be foolish to try to predict the schedule on which research will be successful. That doesn't mean that more documentation and libraries and such won't happen sooner, but problems like the one you describe in this email are open research areas. -- sam th samth@ccs.neu.edu From matthias at ccs.neu.edu Mon Nov 2 08:26:11 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Mon Nov 2 08:26:59 2009 Subject: [plt-scheme] More fun with typed scheme: attempt to write vector-join and a minor rant In-Reply-To: <4AEE7970.2040606@adrenaline.com> References: <4AEE7970.2040606@adrenaline.com> Message-ID: Scott, as I said in a private email, please by all means submit bug reports and feature requests for Typed Scheme. We have reached our first goal -- a typed variant for "list Scheme" that accommodates many of the existing idioms -- and we're far from the full goal -- support all of Scheme with a truly accommodating type system. There are many ways in which we are 'stuck': 1. Sam has to wrap up his PhD and transition to a real job. 2. Just in case he ends up sweeping floors at Sun, I have brought Stevie in for the second round so that there is a second person on the project. (I don't really count.) Plus two or three maintainers is always better than one. 3. My long term goal is to turn Typed Scheme into a full fledge language BUT I am sure we canNOT reach the true long term goal. So I will always have something to do :-) 4. Technically: we are missing a few pieces of core Scheme semantics. Sam wrote to you that he is working on vectors. We are missing classes and units. Especially the first are critical for our code base, which is our guidance system for the development of Typed Scheme. Ideally, we should create a macro system that allows the addition of types. Until we know what we need (explore before you abstract!) we will develop these two "by hand". That's Stevie's job. Otherwise we will use real bug reports and real feature requests as our 'guidance system'. -- Matthias On Nov 2, 2009, at 1:17 AM, Scott McLoughlin wrote: > Or vector-append - but in any case, just a function that creates > a single (Vectorof a) out a bunch of other (Vectorof a) arguments > passed as rest arguments. > > So the signature is. > > (define: (a) (vector-join . [vecs : (Vectorof a) *]) : (Vectorof a) > > A blow by blow of the type errors is impossible at this point > (unless Dr. > Scheme has a logging feature of which I'm not aware.) > > But futzing around, (1) I first recalled from previous emails that > some > vector routines weren't "type-schemed" yet, so I wrote my own vector- > >list > called tvector->list. Lovely routine, but that didn't do the trick. > > Then I recalled reading the cool paper on the typed-scheme type system > and how it handled, with near pure genius, higher order variable arity > routines such as "map." So, hmmm, I thought, and wrote my own nicely > type-schemed "map1" which just did the job for a single list and > nothing > else fancy. That works lovely too, as it well should. > > ;;; tvector->list isn't a challenge > (tvector->list #(2 3)) > (2 3) > > > ;;; No general problem with map1 > (map1 string->symbol (list "ffdsaf" "d")) > (ffdsaf d) > > Nevertheless, combining map or map1 with vector->list or tvector- > >list give nearly > identical error messages. > ;;; Original map type check error > (map vector->list (list #(2) #(1))) > typecheck: Polymorphic function map could not be applied to arguments: > Domain: (a b ... b -> c) (Listof a) (Listof b) ... b > Arguments: (All (a) ((Vectorof a) -> (Listof a))) (List (Vectorof > Integer) (Vectorof Integer)) > in: (#%app map vector->list (#%app list (quote #(2)) (quote #(1)))) > > ;;; My map1 type check error, this type using tvector->list > (map1 vector->list (list #(2) #(1))) > typecheck: Polymorphic function map1 could not be applied to > arguments: > Domain: (a -> b) (Listof a) > Arguments: (All (a) ((Vectorof a) -> (Listof a))) (List (Vectorof > Integer) (Vectorof Integer)) > in: (#%app map1 tvector->list (#%app list (quote #(2)) (quote #(1)))) > > > So anyway, imagine lots of futzing and testing, breaking down each > little > part, of an already really short function to begin with, and making > sure it > works. But alas, unless I'm terribly distracted by Next Iron Chef, > I think there's > some other reason I'm coming up empty handed. > > So any guidance, greatly appreciated. > > OH OH OH OH - One last little thing that actually does tick off my > normally > serene demeanor. As I understand it, (List a b c) is basically a > tuple and > (Listof a) is a list of type a. > Well, unless I'm missing something, and yes, I certainly might be, > the error messages > you'll see above report rest arguments as if they were tuples: (List > (Vec...) (Vec...)). > > Maybe there's some great reason for this, but it's yet another > "undocumented feature" > of typed-scheme that caused untold amounts of unnecessary staring at > the screen and drooling > on the keyboard on my part. > > Anyway, I LOVE the idea of typed scheme, and could even imagine > loving WORKING with it, but given > that nearly every time I've touched it I've had to post to this list > and retrieved a response akin > to, "Oh yeah, sorry, that's not really 100% yet," maybe it would be > kinder to those whose > time is actually worth something to actually pull the plug on the > beloved feature until it gets > the 1000's of test cases, ~50 pages of introductory tutorial and > ~200+ pages of detailed > documentation that the (otherwise nifty) language deserves. > I don't mean to be bitchy, just logical. How many pages is R6RS and > with what care was that > documentation written? Hate the "big scheme"? Ok, heck, just take > R5RS as an example if one > prefers and count up its written pages along with the tons and tons > and tons of person-hours > of deliberation in its making. > > And neither of *those* teeny weeny tiny little languages have typed- > scheme's complex manifest type > system to fully describe, shine blindingly bright illumination on > every corner case, and so on and > so forth. > Anyway, I'd MUCH rather just have typed-scheme work 95++ % of the > time or at least see a > carefully constructed and published road map regarding both HOW and > WHEN type-scheme might > finally achieve this level of ready for "prime time" status. > > Scott > > p.s. Yeah, part of my past experience has been as both a project > mgmt puke, and worse, as a CEO - > so if I sound like one, sue me :-) > > p.p.s. The reason I give a hoot at all is because I'm really hoping > to use typed scheme to write > non-trivial parts of a compiler, including a CPS style back end, and > going back to the drawing > board on the tools selection front of the project isn't really > inviting. > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From samth at ccs.neu.edu Mon Nov 2 08:37:05 2009 From: samth at ccs.neu.edu (Sam TH) Date: Mon Nov 2 08:37:46 2009 Subject: [plt-scheme] More fun with typed scheme: attempt to write vector-join and a minor rant In-Reply-To: <63bb19ae0911020518y2b154748nef833b258d280e02@mail.gmail.com> References: <4AEE7970.2040606@adrenaline.com> <63bb19ae0911020518y2b154748nef833b258d280e02@mail.gmail.com> Message-ID: <63bb19ae0911020537q2c5ceb37h528b0eff057c6f1d@mail.gmail.com> I missed this footnote: On Mon, Nov 2, 2009 at 8:18 AM, Sam TH wrote: > more help is always appreciated [1]. [1] http://blog.plt-scheme.org/2009/02/call-for-participation-writing-typed.html -- sam th samth@ccs.neu.edu From eli at barzilay.org Mon Nov 2 08:43:35 2009 From: eli at barzilay.org (Eli Barzilay) Date: Mon Nov 2 08:43:57 2009 Subject: [plt-scheme] could we have a git-svn mirror of the repository? In-Reply-To: <98b8086f0911020430i309330fdw12c7e1384b5bdafa@mail.gmail.com> References: <19182.52977.971236.466927@winooski.ccs.neu.edu> <98b8086f0911020430i309330fdw12c7e1384b5bdafa@mail.gmail.com> Message-ID: <19182.57863.810286.410727@winooski.ccs.neu.edu> On Nov 2, troels knak-nielsen wrote: > On Mon, Nov 2, 2009 at 1:22 PM, Eli Barzilay wrote: > > * Out of curiosity (and no flames intended): if this can be used > > ? to have people use git and send back patch sets, then does that > > ? mean that there's no need for our repository to ever move to a > > ? distributed tool? ?(The thing is that I looked into it, and none > > ? of the systems look nearly as robust as svn does.) > > Synchronising two-way between svn and git is *possible*, but tricky. > I'm not exactly an expert on git, but I tried to do this for a > project and had it sort-of-working for a while, before it blew up. I > think it's possible to handle if you know both git and svn well, but > I think it requires that. So if you're willing to invest the time in > becoming an expert on git, you can keep svn ;) My hope is (was?) that things are simple if all I want is to replay a bunch of patches. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From troelskn at gmail.com Mon Nov 2 08:51:04 2009 From: troelskn at gmail.com (troels knak-nielsen) Date: Mon Nov 2 08:51:22 2009 Subject: [plt-scheme] could we have a git-svn mirror of the repository? In-Reply-To: <19182.57863.810286.410727@winooski.ccs.neu.edu> References: <19182.52977.971236.466927@winooski.ccs.neu.edu> <98b8086f0911020430i309330fdw12c7e1384b5bdafa@mail.gmail.com> <19182.57863.810286.410727@winooski.ccs.neu.edu> Message-ID: <98b8086f0911020551m17ef7c4aua419ea58af4c3daa@mail.gmail.com> On Mon, Nov 2, 2009 at 2:43 PM, Eli Barzilay wrote: > My hope is (was?) that things are simple if all I want is to replay a > bunch of patches. > As long as it's one-way only, it is simple enough. The tricky part is when you want to be able to make changes in both the svn and the git repo and have them synchronised. I'm sure it's possible to do, but it isn't trivial. At least, that's my experience. -- troels From scott at adrenaline.com Mon Nov 2 09:07:20 2009 From: scott at adrenaline.com (Scott McLoughlin) Date: Mon Nov 2 09:08:00 2009 Subject: [plt-scheme] More fun with typed scheme: attempt to write vector-join and a minor rant In-Reply-To: References: <4AEE7970.2040606@adrenaline.com> Message-ID: <4AEEE798.8070800@adrenaline.com> Matthias, Is there a bug tracking system with a section for typed-scheme of which I'm unaware? I know it's not in the list of goals stated below, but it would be wicked cool if typed-scheme could generate byte codes/JIT code that completely bypassed now no longer necessary type checking on functions/primitives/etc. :-) Scott Matthias Felleisen wrote: > > Scott, as I said in a private email, please by all means > submit bug reports and feature requests for Typed Scheme. > > We have reached our first goal -- a typed variant for > "list Scheme" that accommodates many of the existing > idioms -- and we're far from the full goal -- support > all of Scheme with a truly accommodating type system. > > There are many ways in which we are 'stuck': > > 1. Sam has to wrap up his PhD and transition to a real job. > > 2. Just in case he ends up sweeping floors at Sun, I > have brought Stevie in for the second round so that there > is a second person on the project. (I don't really count.) > Plus two or three maintainers is always better than one. > > 3. My long term goal is to turn Typed Scheme into a full > fledge language BUT I am sure we canNOT reach the true > long term goal. So I will always have something to do :-) > > 4. Technically: we are missing a few pieces of core Scheme > semantics. Sam wrote to you that he is working on vectors. > > We are missing classes and units. Especially the first > are critical for our code base, which is our guidance > system for the development of Typed Scheme. > > Ideally, we should create a macro system that allows the > addition of types. Until we know what we need (explore > before you abstract!) we will develop these two "by hand". > That's Stevie's job. > > Otherwise we will use real bug reports and real feature > requests as our 'guidance system'. > > -- Matthias > > > > > > > > > > > > > > > > > On Nov 2, 2009, at 1:17 AM, Scott McLoughlin wrote: > >> Or vector-append - but in any case, just a function that creates >> a single (Vectorof a) out a bunch of other (Vectorof a) arguments >> passed as rest arguments. >> >> So the signature is. >> >> (define: (a) (vector-join . [vecs : (Vectorof a) *]) : (Vectorof a) >> >> A blow by blow of the type errors is impossible at this point (unless >> Dr. >> Scheme has a logging feature of which I'm not aware.) >> >> But futzing around, (1) I first recalled from previous emails that some >> vector routines weren't "type-schemed" yet, so I wrote my own >> vector->list >> called tvector->list. Lovely routine, but that didn't do the trick. >> >> Then I recalled reading the cool paper on the typed-scheme type system >> and how it handled, with near pure genius, higher order variable arity >> routines such as "map." So, hmmm, I thought, and wrote my own nicely >> type-schemed "map1" which just did the job for a single list and nothing >> else fancy. That works lovely too, as it well should. >> >> ;;; tvector->list isn't a challenge >> (tvector->list #(2 3)) >> (2 3) >> >> >> ;;; No general problem with map1 >> (map1 string->symbol (list "ffdsaf" "d")) >> (ffdsaf d) >> >> Nevertheless, combining map or map1 with vector->list or >> tvector->list give nearly >> identical error messages. >> ;;; Original map type check error >> (map vector->list (list #(2) #(1))) >> typecheck: Polymorphic function map could not be applied to arguments: >> Domain: (a b ... b -> c) (Listof a) (Listof b) ... b >> Arguments: (All (a) ((Vectorof a) -> (Listof a))) (List (Vectorof >> Integer) (Vectorof Integer)) >> in: (#%app map vector->list (#%app list (quote #(2)) (quote #(1)))) >> >> ;;; My map1 type check error, this type using tvector->list >> (map1 vector->list (list #(2) #(1))) >> typecheck: Polymorphic function map1 could not be applied to arguments: >> Domain: (a -> b) (Listof a) >> Arguments: (All (a) ((Vectorof a) -> (Listof a))) (List (Vectorof >> Integer) (Vectorof Integer)) >> in: (#%app map1 tvector->list (#%app list (quote #(2)) (quote #(1)))) >> >> >> So anyway, imagine lots of futzing and testing, breaking down each >> little >> part, of an already really short function to begin with, and making >> sure it >> works. But alas, unless I'm terribly distracted by Next Iron Chef, I >> think there's >> some other reason I'm coming up empty handed. >> >> So any guidance, greatly appreciated. >> >> OH OH OH OH - One last little thing that actually does tick off my >> normally >> serene demeanor. As I understand it, (List a b c) is basically a >> tuple and >> (Listof a) is a list of type a. >> Well, unless I'm missing something, and yes, I certainly might be, >> the error messages >> you'll see above report rest arguments as if they were tuples: (List >> (Vec...) (Vec...)). >> >> Maybe there's some great reason for this, but it's yet another >> "undocumented feature" >> of typed-scheme that caused untold amounts of unnecessary staring at >> the screen and drooling >> on the keyboard on my part. >> >> Anyway, I LOVE the idea of typed scheme, and could even imagine >> loving WORKING with it, but given >> that nearly every time I've touched it I've had to post to this list >> and retrieved a response akin >> to, "Oh yeah, sorry, that's not really 100% yet," maybe it would be >> kinder to those whose >> time is actually worth something to actually pull the plug on the >> beloved feature until it gets >> the 1000's of test cases, ~50 pages of introductory tutorial and >> ~200+ pages of detailed >> documentation that the (otherwise nifty) language deserves. >> I don't mean to be bitchy, just logical. How many pages is R6RS and >> with what care was that >> documentation written? Hate the "big scheme"? Ok, heck, just take >> R5RS as an example if one >> prefers and count up its written pages along with the tons and tons >> and tons of person-hours >> of deliberation in its making. >> >> And neither of *those* teeny weeny tiny little languages have >> typed-scheme's complex manifest type >> system to fully describe, shine blindingly bright illumination on >> every corner case, and so on and >> so forth. >> Anyway, I'd MUCH rather just have typed-scheme work 95++ % of the >> time or at least see a >> carefully constructed and published road map regarding both HOW and >> WHEN type-scheme might >> finally achieve this level of ready for "prime time" status. >> >> Scott >> >> p.s. Yeah, part of my past experience has been as both a project >> mgmt puke, and worse, as a CEO - >> so if I sound like one, sue me :-) >> >> p.p.s. The reason I give a hoot at all is because I'm really hoping >> to use typed scheme to write >> non-trivial parts of a compiler, including a CPS style back end, and >> going back to the drawing >> board on the tools selection front of the project isn't really inviting. >> >> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > > From laurent.orseau at gmail.com Mon Nov 2 09:28:19 2009 From: laurent.orseau at gmail.com (Laurent) Date: Mon Nov 2 09:29:01 2009 Subject: [plt-scheme] Wishes for the PLaneT In-Reply-To: <4AE9D356.1000200@cs.utah.edu> References: <4AE9D356.1000200@cs.utah.edu> Message-ID: On Thu, Oct 29, 2009 at 18:39, Jon Rafkind wrote: > Laurent wrote: > >> Hi all, >> >> PLaneT really is a great thing, but I find browsing the package list a bit >> difficult. >> If your looking for something special, it is not a trivial matter to find >> it >> (at least there should be a table of contents at the top of the page). >> It just looks like a repository, not a front-end to easily find what you >> need. >> I know you guys don't have much time, and that may not be a priority, but >> providing tools to the world is great only if the world knows they exist, >> or >> can find them easily. >> >> If I can formulate some wishes for the PLaneT service, I'd like: >> - more keywords for packages, even user-defined keywords? >> - # downloads in the main list >> - recently updated packages >> - new packages (like the RSS filter, but in the main list page) >> - sortable items (by author, by #download, by keywords, by date, etc.) >> - search box (filters) >> >> >> > > I hoped to eventually support some of these things with my planet-manager > (on planet). Using the GUI api was a little painful so I thought I would > wait for the GUI rewrite before I did any more work on it. Of course if > someone beats me to it thats fine too. > Nice. I look forward to it. Also, I've recently discovered the unavoidable MrEd Designer through a link in this mailing list, and I suspect there are many other usefulities like this in the wild. Therefore I add a wish to my list: - a section with links toward unlisted PLT tools websites. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091102/8fa40e04/attachment-0001.htm From matthias at ccs.neu.edu Mon Nov 2 09:35:33 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Mon Nov 2 09:36:04 2009 Subject: [plt-scheme] More fun with typed scheme: attempt to write vector-join and a minor rant In-Reply-To: <4AEEE798.8070800@adrenaline.com> References: <4AEE7970.2040606@adrenaline.com> <4AEEE798.8070800@adrenaline.com> Message-ID: <9E95910E-317C-44CD-A4E3-8FC280D80B7A@ccs.neu.edu> Nope, that's a very long term goal possibly better suited for Matthew's or Robby's group than mine. But Sam and Stevie will push the type system so that the compiler can take advantage of it when Matthew knows how to do so -- Matthias p.s. Currently we use the PLT bug/feature management system to track Typed Scheme bugs and feature requests. Changing the compiler to accommodate the type system does not fall in this category however. On Nov 2, 2009, at 9:07 AM, Scott McLoughlin wrote: > Matthias, > > Is there a bug tracking system with a section for typed-scheme of > which I'm > unaware? > > I know it's not in the list of goals stated below, but it would be > wicked cool > if typed-scheme could generate byte codes/JIT code that completely > bypassed > now no longer necessary type checking on functions/primitives/ > etc. :-) > > Scott > > > Matthias Felleisen wrote: >> >> Scott, as I said in a private email, please by all means >> submit bug reports and feature requests for Typed Scheme. >> >> We have reached our first goal -- a typed variant for >> "list Scheme" that accommodates many of the existing >> idioms -- and we're far from the full goal -- support >> all of Scheme with a truly accommodating type system. >> >> There are many ways in which we are 'stuck': >> >> 1. Sam has to wrap up his PhD and transition to a real job. >> >> 2. Just in case he ends up sweeping floors at Sun, I >> have brought Stevie in for the second round so that there >> is a second person on the project. (I don't really count.) >> Plus two or three maintainers is always better than one. >> >> 3. My long term goal is to turn Typed Scheme into a full >> fledge language BUT I am sure we canNOT reach the true >> long term goal. So I will always have something to do :-) >> >> 4. Technically: we are missing a few pieces of core Scheme >> semantics. Sam wrote to you that he is working on vectors. >> >> We are missing classes and units. Especially the first >> are critical for our code base, which is our guidance >> system for the development of Typed Scheme. >> >> Ideally, we should create a macro system that allows the >> addition of types. Until we know what we need (explore >> before you abstract!) we will develop these two "by hand". >> That's Stevie's job. >> >> Otherwise we will use real bug reports and real feature >> requests as our 'guidance system'. >> >> -- Matthias >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> On Nov 2, 2009, at 1:17 AM, Scott McLoughlin wrote: >> >>> Or vector-append - but in any case, just a function that creates >>> a single (Vectorof a) out a bunch of other (Vectorof a) arguments >>> passed as rest arguments. >>> >>> So the signature is. >>> >>> (define: (a) (vector-join . [vecs : (Vectorof a) *]) : (Vectorof a) >>> >>> A blow by blow of the type errors is impossible at this point >>> (unless Dr. >>> Scheme has a logging feature of which I'm not aware.) >>> >>> But futzing around, (1) I first recalled from previous emails that >>> some >>> vector routines weren't "type-schemed" yet, so I wrote my own >>> vector->list >>> called tvector->list. Lovely routine, but that didn't do the trick. >>> >>> Then I recalled reading the cool paper on the typed-scheme type >>> system >>> and how it handled, with near pure genius, higher order variable >>> arity >>> routines such as "map." So, hmmm, I thought, and wrote my own >>> nicely >>> type-schemed "map1" which just did the job for a single list and >>> nothing >>> else fancy. That works lovely too, as it well should. >>> >>> ;;; tvector->list isn't a challenge >>> (tvector->list #(2 3)) >>> (2 3) >>> >>> >>> ;;; No general problem with map1 >>> (map1 string->symbol (list "ffdsaf" "d")) >>> (ffdsaf d) >>> >>> Nevertheless, combining map or map1 with vector->list or tvector- >>> >list give nearly >>> identical error messages. >>> ;;; Original map type check error >>> (map vector->list (list #(2) #(1))) >>> typecheck: Polymorphic function map could not be applied to >>> arguments: >>> Domain: (a b ... b -> c) (Listof a) (Listof b) ... b >>> Arguments: (All (a) ((Vectorof a) -> (Listof a))) (List (Vectorof >>> Integer) (Vectorof Integer)) >>> in: (#%app map vector->list (#%app list (quote #(2)) (quote #(1)))) >>> >>> ;;; My map1 type check error, this type using tvector->list >>> (map1 vector->list (list #(2) #(1))) >>> typecheck: Polymorphic function map1 could not be applied to >>> arguments: >>> Domain: (a -> b) (Listof a) >>> Arguments: (All (a) ((Vectorof a) -> (Listof a))) (List (Vectorof >>> Integer) (Vectorof Integer)) >>> in: (#%app map1 tvector->list (#%app list (quote #(2)) (quote >>> #(1)))) >>> >>> >>> So anyway, imagine lots of futzing and testing, breaking down each >>> little >>> part, of an already really short function to begin with, and >>> making sure it >>> works. But alas, unless I'm terribly distracted by Next Iron >>> Chef, I think there's >>> some other reason I'm coming up empty handed. >>> >>> So any guidance, greatly appreciated. >>> >>> OH OH OH OH - One last little thing that actually does tick off my >>> normally >>> serene demeanor. As I understand it, (List a b c) is basically a >>> tuple and >>> (Listof a) is a list of type a. >>> Well, unless I'm missing something, and yes, I certainly might be, >>> the error messages >>> you'll see above report rest arguments as if they were tuples: >>> (List (Vec...) (Vec...)). >>> >>> Maybe there's some great reason for this, but it's yet another >>> "undocumented feature" >>> of typed-scheme that caused untold amounts of unnecessary staring >>> at the screen and drooling >>> on the keyboard on my part. >>> >>> Anyway, I LOVE the idea of typed scheme, and could even imagine >>> loving WORKING with it, but given >>> that nearly every time I've touched it I've had to post to this >>> list and retrieved a response akin >>> to, "Oh yeah, sorry, that's not really 100% yet," maybe it would >>> be kinder to those whose >>> time is actually worth something to actually pull the plug on the >>> beloved feature until it gets >>> the 1000's of test cases, ~50 pages of introductory tutorial and >>> ~200+ pages of detailed >>> documentation that the (otherwise nifty) language deserves. >>> I don't mean to be bitchy, just logical. How many pages is R6RS >>> and with what care was that >>> documentation written? Hate the "big scheme"? Ok, heck, just take >>> R5RS as an example if one >>> prefers and count up its written pages along with the tons and >>> tons and tons of person-hours >>> of deliberation in its making. >>> >>> And neither of *those* teeny weeny tiny little languages have >>> typed-scheme's complex manifest type >>> system to fully describe, shine blindingly bright illumination on >>> every corner case, and so on and >>> so forth. >>> Anyway, I'd MUCH rather just have typed-scheme work 95++ % of the >>> time or at least see a >>> carefully constructed and published road map regarding both HOW >>> and WHEN type-scheme might >>> finally achieve this level of ready for "prime time" status. >>> >>> Scott >>> >>> p.s. Yeah, part of my past experience has been as both a project >>> mgmt puke, and worse, as a CEO - >>> so if I sound like one, sue me :-) >>> >>> p.p.s. The reason I give a hoot at all is because I'm really >>> hoping to use typed scheme to write >>> non-trivial parts of a compiler, including a CPS style back end, >>> and going back to the drawing >>> board on the tools selection front of the project isn't really >>> inviting. >>> >>> >>> _________________________________________________ >>> For list-related administrative tasks: >>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> >> > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From samth at ccs.neu.edu Mon Nov 2 09:47:46 2009 From: samth at ccs.neu.edu (Sam TH) Date: Mon Nov 2 09:48:28 2009 Subject: [plt-scheme] More fun with typed scheme: attempt to write vector-join and a minor rant In-Reply-To: <9E95910E-317C-44CD-A4E3-8FC280D80B7A@ccs.neu.edu> References: <4AEE7970.2040606@adrenaline.com> <4AEEE798.8070800@adrenaline.com> <9E95910E-317C-44CD-A4E3-8FC280D80B7A@ccs.neu.edu> Message-ID: <63bb19ae0911020647q2187a4e8k669a1230fa92e23c@mail.gmail.com> On Mon, Nov 2, 2009 at 10:35 AM, Matthias Felleisen wrote: > p.s. Currently we use the PLT bug/feature management system > to track Typed Scheme bugs and feature requests. Changing the > compiler to accommodate the type system does not fall in this > category however. For which the URL is http://bugs.plt-scheme.org/ -- sam th samth@ccs.neu.edu From eli at barzilay.org Mon Nov 2 10:27:24 2009 From: eli at barzilay.org (Eli Barzilay) Date: Mon Nov 2 10:27:55 2009 Subject: [plt-scheme] could we have a git-svn mirror of the repository? In-Reply-To: <98b8086f0911020551m17ef7c4aua419ea58af4c3daa@mail.gmail.com> References: <19182.52977.971236.466927@winooski.ccs.neu.edu> <98b8086f0911020430i309330fdw12c7e1384b5bdafa@mail.gmail.com> <19182.57863.810286.410727@winooski.ccs.neu.edu> <98b8086f0911020551m17ef7c4aua419ea58af4c3daa@mail.gmail.com> Message-ID: <19182.64092.751984.599276@winooski.ccs.neu.edu> On Nov 2, troels knak-nielsen wrote: > On Mon, Nov 2, 2009 at 2:43 PM, Eli Barzilay wrote: > > My hope is (was?) that things are simple if all I want is to > > replay a bunch of patches. > > As long as it's one-way only, it is simple enough. The tricky part > is when you want to be able to make changes in both the svn and the > git repo and have them synchronised. I'm sure it's possible to do, > but it isn't trivial. At least, that's my experience. OK, to rephrase my original question: what if we're using svn as usual, and allow one-way merges from git (or whatever) in, and to make it easy to work with git we keep that git-svn thing updated to the svn trunk? Does this mean that we get the benefits of distributed work but also keep the advantages of svn? -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From acowley at seas.upenn.edu Mon Nov 2 11:27:32 2009 From: acowley at seas.upenn.edu (Anthony Cowley) Date: Mon Nov 2 11:28:09 2009 Subject: [plt-scheme] could we have a git-svn mirror of the repository? In-Reply-To: <19182.64092.751984.599276@winooski.ccs.neu.edu> References: <19182.52977.971236.466927@winooski.ccs.neu.edu> <98b8086f0911020430i309330fdw12c7e1384b5bdafa@mail.gmail.com> <19182.57863.810286.410727@winooski.ccs.neu.edu> <98b8086f0911020551m17ef7c4aua419ea58af4c3daa@mail.gmail.com> <19182.64092.751984.599276@winooski.ccs.neu.edu> Message-ID: <81addec70911020827x64d61eb1n97ae3f65817c722a@mail.gmail.com> On Mon, Nov 2, 2009 at 11:27 AM, Eli Barzilay wrote: > On Nov ?2, troels knak-nielsen wrote: >> On Mon, Nov 2, 2009 at 2:43 PM, Eli Barzilay wrote: >> > My hope is (was?) that things are simple if all I want is to >> > replay a bunch of patches. > OK, to rephrase my original question: what if we're using svn as > usual, and allow one-way merges from git (or whatever) in, and to make > it easy to work with git we keep that git-svn thing updated to the svn > trunk? ?Does this mean that we get the benefits of distributed work > but also keep the advantages of svn? git-svn is bidirectional out of the box. Since most projects I work on use git these days, I've used git-svn in the past to pull SVN-based projects into my workflow, but that was always near the start of the project. That may be significant because git-svn initialization involves pulling all revisions from the SVN repository, which sounds rather daunting in PLT's case. This page covers the basics of setting things up for clients, , but doesn't address how to have a publicly available git mirror of the SVN repository that is automatically updated. The usual style for users of the repository is, git checkout -b NewFeature ...do lots of work... git commit -a git checkout master git svn rebase git merge NewFeature git svn dcommit which creates a new branch for a new feature, commits changes, pulls updates from SVN, merges local changes, and pushes to the SVN repository. The manual for git-svn mentions setting up a git repository local to the SVN repository so you don't have a bunch of users pulling every revision: I think those will be the instructions most relevant for a PLT mirror. Anthony From martindemello at gmail.com Mon Nov 2 11:46:08 2009 From: martindemello at gmail.com (Martin DeMello) Date: Mon Nov 2 11:52:24 2009 Subject: [plt-scheme] could we have a git-svn mirror of the repository? In-Reply-To: <19182.52977.971236.466927@winooski.ccs.neu.edu> References: <19182.52977.971236.466927@winooski.ccs.neu.edu> Message-ID: On Mon, Nov 2, 2009 at 5:52 PM, Eli Barzilay wrote: > Yes, I can definitely do that, provided that: > > * Someone can provide me with child-proof instructions on how to do so > ?(my experience with git wasn't too great). I'll put together a document if someone with more experience doesn't step up - I've used git-svn to mirror projects locally, but not autosynced on the svn server itself. > * It is enough to serve the result over plain http somehow -- so I > ?don't need to install new apache modules or open up new ports or > ?whatever. That should be fine. > In fact, if this can be used to provide patches for the plt > repository, then I'll take back the second bullet and will invest in > doing whatever's needed to install it -- including whatever hooks are > needed to keep it in sync with the svn repository, and include the > links on the svn.plt-scheme.org repository page. Yes, git-svn's model is you basically pull from svn into git, make changes locally, then rebase your changes, that is, when svn updates, it runs an svn update and then attempts to convert your local work into a set of patches against the new svn head. If it can't, it has you fix any conflicts that emerge. > * Out of curiosity (and no flames intended): if this can be used to > ?have people use git and send back patch sets, then does that mean > ?that there's no need for our repository to ever move to a > ?distributed tool? ?(The thing is that I looked into it, and none of > ?the systems look nearly as robust as svn does.) In my personal experience, yes, that works fine. Git can easily generate patches against the current svn head. martin From hendrik at topoi.pooq.com Mon Nov 2 13:03:35 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Mon Nov 2 13:03:55 2009 Subject: [plt-scheme] More fun with typed scheme: attempt to write vector-join and a minor rant In-Reply-To: <4AEEE798.8070800@adrenaline.com> References: <4AEE7970.2040606@adrenaline.com> <4AEEE798.8070800@adrenaline.com> Message-ID: <20091102180334.GG20043@topoi.pooq.com> On Mon, Nov 02, 2009 at 09:07:20AM -0500, Scott McLoughlin wrote: > > I know it's not in the list of goals stated below, but it would be > wicked cool > if typed-scheme could generate byte codes/JIT code that completely bypassed > now no longer necessary type checking on functions/primitives/etc. :-) Yeah! That fits my dream that Scheme should be written in TypedScheme, rather than the other way around! -- hendrik From plt at synx.us.to Mon Nov 2 13:13:59 2009 From: plt at synx.us.to (Synx) Date: Mon Nov 2 13:14:37 2009 Subject: [plt-scheme] let-require Message-ID: <4AEF2167.9030709@synx.us.to> You know what would be awesome? A syntax that lets you require a module but limits the lexical scope of its provided names. Something like: --- (define (make-weird-list a b c) (let-require (srfi/1) (circular-list a b c))) (define (circular-list . args) (error "Never gets here")) (make-weird-list 1 2 3) --- or one thing I was thinking is to allow multiple modules in one file, yet only the one named according to the file name is available from external files. weird-list.ss --- (module backstage scheme/base (require srfi/1) (define (make-thing a b c) (circular-list a b c)) (provide make-thing)) (module weird-list scheme/base (require backstage) (define (main) (make-thing 1 2 3)) (provide main)) --- I like the let-require idea better though. Is there a reason that require must introduce names at the module's lexical scope? Or is there a way to do it already that I don't know about? From carl.eastlund at gmail.com Mon Nov 2 13:24:54 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Mon Nov 2 13:25:35 2009 Subject: [plt-scheme] let-require In-Reply-To: <4AEF2167.9030709@synx.us.to> References: <4AEF2167.9030709@synx.us.to> Message-ID: <990e0c030911021024rc65338ck6cd9a22b1920f4b2@mail.gmail.com> I provide this in a planet package: -- #lang scheme (require (planet cce/scheme:6)) (define (make-weird-list a b c) (local-require srfi/1) (circular-list a b c)) (define (circular-list . args) (error "Never gets here")) (make-weird-list 1 2 3) -- Carl Eastlund On Mon, Nov 2, 2009 at 1:13 PM, Synx wrote: > > You know what would be awesome? A syntax that lets you require a module > but limits the lexical scope of its provided names. Something like: > > --- > (define (make-weird-list a b c) > ?(let-require (srfi/1) > ? ?(circular-list a b c))) > > (define (circular-list . args) > ?(error "Never gets here")) > > (make-weird-list 1 2 3) > --- > > or one thing I was thinking is to allow multiple modules in one file, > yet only the one named according to the file name is available from > external files. > > weird-list.ss > --- > (module backstage scheme/base > ?(require srfi/1) > ?(define (make-thing a b c) > ? ?(circular-list a b c)) > ?(provide make-thing)) > > (module weird-list scheme/base > ?(require backstage) > ?(define (main) > ? ?(make-thing 1 2 3)) > ?(provide main)) > --- > > I like the let-require idea better though. Is there a reason that > require must introduce names at the module's lexical scope? Or is there > a way to do it already that I don't know about? From dherman at ccs.neu.edu Mon Nov 2 13:37:13 2009 From: dherman at ccs.neu.edu (Dave Herman) Date: Mon Nov 2 13:37:42 2009 Subject: [plt-scheme] let-require In-Reply-To: <990e0c030911021024rc65338ck6cd9a22b1920f4b2@mail.gmail.com> References: <4AEF2167.9030709@synx.us.to> <990e0c030911021024rc65338ck6cd9a22b1920f4b2@mail.gmail.com> Message-ID: <4AEF26D9.1090801@ccs.neu.edu> > I provide this in a planet package: That's a pretty cool trick-- how'd you do it? Lifting + (require (prefix-in ...))? Dave From carl.eastlund at gmail.com Mon Nov 2 13:40:33 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Mon Nov 2 13:41:12 2009 Subject: [plt-scheme] let-require In-Reply-To: <4AEF26D9.1090801@ccs.neu.edu> References: <4AEF2167.9030709@synx.us.to> <990e0c030911021024rc65338ck6cd9a22b1920f4b2@mail.gmail.com> <4AEF26D9.1090801@ccs.neu.edu> Message-ID: <990e0c030911021040r5d60ec1ave7af6a9e9815cadc@mail.gmail.com> On Mon, Nov 2, 2009 at 1:37 PM, Dave Herman wrote: >> I provide this in a planet package: > > That's a pretty cool trick-- how'd you do it? Lifting + (require (prefix-in > ...))? > > Dave No prefix, as you can see. The main tricks are lifting, binding to temporary names, and rename transformers (to bind back to the names you want in the local scope). There is some deep, arcane macro hackery to make it all work right, though, including a workaround for a bug in generate-temporaries. (The bug may since have been fixed.) I had to exchange a lot of emails with Matthew to get this working right. --Carl From grettke at acm.org Mon Nov 2 14:16:29 2009 From: grettke at acm.org (Grant Rettke) Date: Mon Nov 2 14:16:54 2009 Subject: [plt-scheme] let-require In-Reply-To: <990e0c030911021024rc65338ck6cd9a22b1920f4b2@mail.gmail.com> References: <4AEF2167.9030709@synx.us.to> <990e0c030911021024rc65338ck6cd9a22b1920f4b2@mail.gmail.com> Message-ID: <756daca50911021116na418c28qc55348d8563545fa@mail.gmail.com> PLaneT is an underutilized treasure trove. The model makes it easy for great contributions; but who knows about them? On Mon, Nov 2, 2009 at 12:24 PM, Carl Eastlund wrote: > I provide this in a planet package: > > -- > #lang scheme > > (require (planet cce/scheme:6)) > > (define (make-weird-list a b c) > ?(local-require srfi/1) > ?(circular-list a b c)) > > (define (circular-list . args) > ?(error "Never gets here")) > > (make-weird-list 1 2 3) > -- > > Carl Eastlund > > On Mon, Nov 2, 2009 at 1:13 PM, Synx wrote: >> >> You know what would be awesome? A syntax that lets you require a module >> but limits the lexical scope of its provided names. Something like: >> >> --- >> (define (make-weird-list a b c) >> ?(let-require (srfi/1) >> ? ?(circular-list a b c))) >> >> (define (circular-list . args) >> ?(error "Never gets here")) >> >> (make-weird-list 1 2 3) >> --- >> >> or one thing I was thinking is to allow multiple modules in one file, >> yet only the one named according to the file name is available from >> external files. >> >> weird-list.ss >> --- >> (module backstage scheme/base >> ?(require srfi/1) >> ?(define (make-thing a b c) >> ? ?(circular-list a b c)) >> ?(provide make-thing)) >> >> (module weird-list scheme/base >> ?(require backstage) >> ?(define (main) >> ? ?(make-thing 1 2 3)) >> ?(provide main)) >> --- >> >> I like the let-require idea better though. Is there a reason that >> require must introduce names at the module's lexical scope? Or is there >> a way to do it already that I don't know about? > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- http://www.wisdomandwonder.com/ From grettke at acm.org Mon Nov 2 14:17:42 2009 From: grettke at acm.org (Grant Rettke) Date: Mon Nov 2 14:18:00 2009 Subject: [plt-scheme] More fun with typed scheme: attempt to write vector-join and a minor rant In-Reply-To: <20091102180334.GG20043@topoi.pooq.com> References: <4AEE7970.2040606@adrenaline.com> <4AEEE798.8070800@adrenaline.com> <20091102180334.GG20043@topoi.pooq.com> Message-ID: <756daca50911021117o52b81efds13b1ac0f9d04b0e7@mail.gmail.com> On Mon, Nov 2, 2009 at 12:03 PM, wrote: > On Mon, Nov 02, 2009 at 09:07:20AM -0500, Scott McLoughlin wrote: >> >> I know it's not in the list of goals stated below, but it would be >> wicked cool >> if typed-scheme could generate byte codes/JIT code that completely bypassed >> now no longer necessary type checking ?on functions/primitives/etc. :-) > > Yeah! ?That fits my dream that Scheme should be written in > TypedScheme, rather than the other way around! I believe that Matthias said that this would happen once the NSF sponsors their research on a time machine. From jay.mccarthy at gmail.com Mon Nov 2 14:46:15 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Mon Nov 2 14:46:38 2009 Subject: [plt-scheme] let-require In-Reply-To: <756daca50911021116na418c28qc55348d8563545fa@mail.gmail.com> References: <4AEF2167.9030709@synx.us.to> <990e0c030911021024rc65338ck6cd9a22b1920f4b2@mail.gmail.com> <756daca50911021116na418c28qc55348d8563545fa@mail.gmail.com> Message-ID: Amen On Mon, Nov 2, 2009 at 12:16 PM, Grant Rettke wrote: > PLaneT is an underutilized treasure trove. The model makes it easy for > great contributions; but who knows about them? > > On Mon, Nov 2, 2009 at 12:24 PM, Carl Eastlund wrote: >> I provide this in a planet package: >> >> -- >> #lang scheme >> >> (require (planet cce/scheme:6)) >> >> (define (make-weird-list a b c) >> ?(local-require srfi/1) >> ?(circular-list a b c)) >> >> (define (circular-list . args) >> ?(error "Never gets here")) >> >> (make-weird-list 1 2 3) >> -- >> >> Carl Eastlund >> >> On Mon, Nov 2, 2009 at 1:13 PM, Synx wrote: >>> >>> You know what would be awesome? A syntax that lets you require a module >>> but limits the lexical scope of its provided names. Something like: >>> >>> --- >>> (define (make-weird-list a b c) >>> ?(let-require (srfi/1) >>> ? ?(circular-list a b c))) >>> >>> (define (circular-list . args) >>> ?(error "Never gets here")) >>> >>> (make-weird-list 1 2 3) >>> --- >>> >>> or one thing I was thinking is to allow multiple modules in one file, >>> yet only the one named according to the file name is available from >>> external files. >>> >>> weird-list.ss >>> --- >>> (module backstage scheme/base >>> ?(require srfi/1) >>> ?(define (make-thing a b c) >>> ? ?(circular-list a b c)) >>> ?(provide make-thing)) >>> >>> (module weird-list scheme/base >>> ?(require backstage) >>> ?(define (main) >>> ? ?(make-thing 1 2 3)) >>> ?(provide main)) >>> --- >>> >>> I like the let-require idea better though. Is there a reason that >>> require must introduce names at the module's lexical scope? Or is there >>> a way to do it already that I don't know about? >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > > > > -- > http://www.wisdomandwonder.com/ > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From ntoronto at cs.byu.edu Mon Nov 2 14:51:31 2009 From: ntoronto at cs.byu.edu (Neil Toronto) Date: Mon Nov 2 14:50:37 2009 Subject: [plt-scheme] Re: Drscheme icon In-Reply-To: <19180.46674.307363.222495@winooski.ccs.neu.edu> References: <595b9ab20910230524ydafb7fdx7c902acd0aa156f1@mail.gmail.com> <20091024233927.2eac1379@halmanfloyd.lan.local> <595b9ab20910241727u534be9d1ue42a492b32d2179c@mail.gmail.com> <19171.40354.809912.556891@winooski.ccs.neu.edu> <4AEB55C4.8080109@cs.byu.edu> <1256937619.395.3.camel@turing> <4AEBC3D4.2000801@cs.byu.edu> <4AEBBCF7.1050501@neilvandyke.org> <4AEC9BBE.3010202@cs.byu.edu> <4AECA079.20309@neilvandyke.org> <19180.46674.307363.222495@winooski.ccs.neu.edu> Message-ID: <4AEF3843.6020409@cs.byu.edu> This has got to be the last revision or my advisor will kill me and dance about on my grave singing "Hallelujah!" The icons are here: http://axon.cs.byu.edu/~neil/plt-logo-red.zip Per Eli's suggestions (which seem to be a good middle ground), I've made four versions of the red/blue with the traditional lambda. In order of decreasing bling, they are: plt-logo-red-shiny.svg plt-logo-red-diffuse.svg plt-logo-red-gradient.svg plt-logo-red-flat.svg At least one of these should satisfy anyone from the iPhone generation all the way back to the Upper Paleolithic. (Though I'm certain Cro-Magnon would prefer the shiny one.) The zip file also includes 256x256 renders in PNG format for computers that choke on rendering SVGs with blur, like my laptop. Please redirect all further suggestions to your favorite vector graphics editor. :) Neil From jay.mccarthy at gmail.com Mon Nov 2 14:51:42 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Mon Nov 2 14:52:04 2009 Subject: [plt-scheme] [ANN] OpenCL Binding Message-ID: The first release of my OpenCL binding is available. http://planet.plt-scheme.org/display.ss?package=opencl.plt&owner=jaymccarthy If you have a Mac with Snow Leopard, running (require (planet jaymccarthy/opencl/tests/test)) Should print out lots of information about your devices and run a simple program. The documentation http://planet.plt-scheme.org/package-source/jaymccarthy/opencl.plt/1/0/planet-docs/opencl/index.html talks about what is broken about it and what you can help with if you want. Jay -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From david.storrs at gmail.com Mon Nov 2 15:23:55 2009 From: david.storrs at gmail.com (David Storrs) Date: Mon Nov 2 15:24:14 2009 Subject: [plt-scheme] Wishes for the PLaneT In-Reply-To: References: <4AE9D356.1000200@cs.utah.edu> Message-ID: On Mon, Nov 2, 2009 at 10:28 AM, Laurent wrote: > Also, I've recently discovered the unavoidable MrEd Designer through a link > in this mailing list, and I suspect there are many other usefulities like > this in the wild. > Therefore I add a wish to my list: > - a section with links toward unlisted PLT tools websites. > > So...that would be a list of unlisted items? ;> Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091102/eda7bbb0/attachment.htm From jensaxel at soegaard.net Mon Nov 2 17:14:11 2009 From: jensaxel at soegaard.net (=?UTF-8?Q?Jens_Axel_S=C3=B8gaard?=) Date: Mon Nov 2 17:14:30 2009 Subject: [plt-scheme] let-require In-Reply-To: <756daca50911021116na418c28qc55348d8563545fa@mail.gmail.com> References: <4AEF2167.9030709@synx.us.to> <990e0c030911021024rc65338ck6cd9a22b1920f4b2@mail.gmail.com> <756daca50911021116na418c28qc55348d8563545fa@mail.gmail.com> Message-ID: <4072c51f0911021414t5b06d588k8c60797831cb7474@mail.gmail.com> 2009/11/2 Grant Rettke : > PLaneT is an underutilized treasure trove. The model makes it easy for > great contributions; but who knows about them? The PLT Blog is a nice place to write about new PLaneT packages. Preferably with some small, easy to understand code examples. To get a blog post on PLT Scheme, send me a mail, and we'll discuss the details. -- Jens Axel S?gaard From plt at synx.us.to Mon Nov 2 18:31:35 2009 From: plt at synx.us.to (Synx) Date: Mon Nov 2 18:32:04 2009 Subject: [plt-scheme] multiple units with identical signatures Message-ID: <4AEF6BD7.4030502@synx.us.to> Supposing there's a type of module that produces a "responder" procedure for a servlet let's say (web-server/dispatch is what I was thinking). I'll end up having some sort of "top" unit that imports all the other units (with prefix) and exports a way to start them all up as a web-server. Seems sensible, but when I try to implement it I have insufferable difficulty. If two units have the same signature, I don't see how I could import them both. If two units have identical signatures, by different names, that seems to work, but it fails on linkage. So I'll have like: page-sig.ss ---------------- #lang scheme/signature respond ---------------- info-sig.ss ---------------- #lang scheme/signature respond ---------------- top-sig.ss ---------------- #lang scheme/signature run ---------------- top-unit.ss ---------------- ... (import (prefix page: page^) (prefix info: info) ...) (define (run) ... (dispatch-rules (("~page" (integer-arg)) page:respond) (("~info" (integer-arg)) info:respond)) ... ---------------- main.ss ---------------- ... (define-compound-unit/infer together@ (import) (export top^) (link page@ info@ top@)) (define (main) (define-values/invoke-unit/infer together@) (run)) (provide main) ---------------- When I call main, and invoke the together@ unit, it errors out with the mysterious message: "context expected 1 value, received 2 values: # #" How do I do this sort of thing, where a number of different units all follow the same pattern and export the same symbols? From acowley at seas.upenn.edu Mon Nov 2 19:15:55 2009 From: acowley at seas.upenn.edu (Anthony Cowley) Date: Mon Nov 2 19:16:15 2009 Subject: [plt-scheme] multiple units with identical signatures In-Reply-To: <4AEF6BD7.4030502@synx.us.to> References: <4AEF6BD7.4030502@synx.us.to> Message-ID: <81addec70911021615m3ffd239fpf2dadb2e547e734c@mail.gmail.com> On Mon, Nov 2, 2009 at 6:31 PM, Synx wrote: > If two units have the same signature, I don't see how I could import > them both. If two units have identical signatures, by different names, > that seems to work, but it fails on linkage. How's this, ---------------- #lang scheme (define-signature page^ (respond)) (define-unit page@ (import) (export page^) (define (respond) "I'm a page!")) (define-signature info^ (respond)) (define-unit info@ (import) (export info^) (define (respond) "I'm informative!")) (define-signature top^ (run)) (define-unit top@ (import (prefix page: page^) (prefix info: info^)) (export top^) (define (run x) (cond ((string=? x "~page") (page:respond)) ((string=? x "~info") (info:respond)) (else (error "Couldn't dispatch" x))))) (define-compound-unit together@ (import) (export T) (link (((P : page^)) page@) (((I : info^)) info@) (((T : top^)) top@ P I))) (define (main) (define-values/invoke-unit/infer together@) (cons (run "~page") (run "~info"))) ---------------- Anthony From pocmatos at gmail.com Mon Nov 2 19:27:32 2009 From: pocmatos at gmail.com (Paulo J. Matos) Date: Mon Nov 2 19:27:55 2009 Subject: [plt-scheme] Refs for creating non-lispy DSLs Message-ID: <1257208052.14462.2.camel@turing> Hi all, I am interested on references about creating DSLs using PLT-Scheme whose final syntax do not resemble lispy-languages (with parenthesis all over the place and possibly prefix notation. I guess one example of this might be scribble, right? Are there any others I should look at? Any docs/papers specific to the design and implementation of DSLs like this? Cheers, -- Paulo Jorge Matos - pocmatos at gmail.com Webpage: http://www.pmatos.net From robby at eecs.northwestern.edu Mon Nov 2 20:18:39 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Mon Nov 2 20:19:03 2009 Subject: [plt-scheme] Refs for creating non-lispy DSLs In-Reply-To: <1257208052.14462.2.camel@turing> References: <1257208052.14462.2.camel@turing> Message-ID: <932b2f1f0911021718s2152e131q1d3c38c6906e9e6a@mail.gmail.com> I have one more example that's pretty self contained if you'd like. See the file rca-hdl.ss as an example use of the language. Sorry, no docs, but feel free to ask me questions if you can't figure anything out. It is a (mini) hardware description language. The one in the example file just evaluates the program. Switch it to "mini-hdl-gc.ss" to see it do some gate counting. In that language you can also leave off some of the inputs (remove the "= " part of the declaration) and it will compute the gate counts for all possible inputs. hth, Robby On Mon, Nov 2, 2009 at 6:27 PM, Paulo J. Matos wrote: > Hi all, > > I am interested on references about creating DSLs using PLT-Scheme whose > final syntax do not resemble lispy-languages (with parenthesis all over > the place and possibly prefix notation. > > I guess one example of this might be scribble, right? > Are there any others I should look at? Any docs/papers specific to the > design and implementation of DSLs like this? > > Cheers, > > -- > Paulo Jorge Matos - pocmatos at gmail.com > Webpage: http://www.pmatos.net > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -------------- next part -------------- A non-text attachment was scrubbed... Name: hdl.tar.gz Type: application/x-gzip Size: 3516 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091102/c4ac3fc6/hdl.tar-0001.bin From jay.mccarthy at gmail.com Mon Nov 2 20:46:52 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Mon Nov 2 20:47:15 2009 Subject: [plt-scheme] Refs for creating non-lispy DSLs In-Reply-To: <1257208052.14462.2.camel@turing> References: <1257208052.14462.2.camel@turing> Message-ID: Check out my Datalog package on PLaneT. Also, look at the Javascript language level by Dave. Jay On Mon, Nov 2, 2009 at 5:27 PM, Paulo J. Matos wrote: > Hi all, > > I am interested on references about creating DSLs using PLT-Scheme whose > final syntax do not resemble lispy-languages (with parenthesis all over > the place and possibly prefix notation. > > I guess one example of this might be scribble, right? > Are there any others I should look at? Any docs/papers specific to the > design and implementation of DSLs like this? > > Cheers, > > -- > Paulo Jorge Matos - pocmatos at gmail.com > Webpage: http://www.pmatos.net > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From ebellani at gmail.com Mon Nov 2 21:11:29 2009 From: ebellani at gmail.com (Eduardo Bellani) Date: Mon Nov 2 21:11:51 2009 Subject: [plt-scheme] Equivalent to captures for regexp Message-ID: <184222e50911021811o384878eeyfcbe0035e575fbad@mail.gmail.com> Hey PLT folk I'm building something similar to gedit's snap-open for DrScheme using James Buck fuzzy finder as a template for the finder library. Problem is, I'm lacking a function that would give me the equivalent of captures[1] so I can calculate the score or weight of the match. I've searched the docs about regex, but to no avail. Anyone care to help out? [1] http://www.ruby-doc.org/core/classes/MatchData.html#M001278 -- Eduardo Bellani www.cnxs.com.br I object to doing things that computers can do. - Olin Shivers From eli at barzilay.org Mon Nov 2 21:17:11 2009 From: eli at barzilay.org (Eli Barzilay) Date: Mon Nov 2 21:17:32 2009 Subject: [plt-scheme] Equivalent to captures for regexp In-Reply-To: <184222e50911021811o384878eeyfcbe0035e575fbad@mail.gmail.com> References: <184222e50911021811o384878eeyfcbe0035e575fbad@mail.gmail.com> Message-ID: <19183.37543.965834.662227@winooski.ccs.neu.edu> On Nov 3, Eduardo Bellani wrote: > Hey PLT folk > > I'm building something similar to gedit's snap-open for DrScheme using > James Buck fuzzy finder > as a template for the finder library. Problem is, I'm lacking a > function that would give me the > equivalent of captures[1] so I can calculate the score or weight of > the match. I've searched the docs about regex, but to no avail. > > Anyone care to help out? Looks like that's the output of `regexp-match'. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From rafkind at cs.utah.edu Mon Nov 2 22:48:19 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Mon Nov 2 22:51:34 2009 Subject: [plt-scheme] debugging ellipses Message-ID: <4AEFA803.6070606@cs.utah.edu> This is just an FYI email in case other people try to debug the same problem. I didn't realize that I had to export the ellipses binding `...' with (for-syntax) for ellipses to be used properly in macros. At first I thought that just exporting `...' in phase 0 would have worked but syntax-case expects `...' to be bound in the phase that it is matching (usually phase 1). So for anyone that tries to write their own language with the module system (#lang my-lang) and you export a facility for writing macros, you will also have to export `...' with (for-syntax ...). This is true for non-language-modules, but if you stick with #lang scheme/base or #lang scheme you probably won't have this issue. Here is a small example. This is a simple language that exports some primitive stuff, +, and a way to define syntaxes. ;; start #lang scheme (provide my-macro #%module-begin + #%app #%datum #%top) ;; uncomment for things to work!! ;; (provide (for-syntax ...)) ;; comment the next line because it is wrong (provide ...) (define-syntax (my-macro stx) (syntax-case stx () [(_ (literals ...) (name pattern ...) (template ...)) #'(define-syntax (name stx) (syntax-case stx (literals ...) [(_ pattern ...) #'(template ...)]))])) ;; end If that file was f.ss and is used in another file as #lang f then without (provide (for-syntax ...)) you will get "bad syntax" after trying to use `my-macro' because syntax-case thought ... was just another identifier and not the real ellipses. That is (my-macro (qq) (foo x ... qq) (+ x ...)) (foo 1 2 3 qq) Will fail to match because the macro that was generated expects to match 3 things: one expression for 'x', one expression for '...' and the literal `qq'. One defense against accidentally using syntax literals in other contexts is to raise an error when the identifier is not used as part of a macro. `...' is defined this way in collects/scheme/private/ellipses.ss: (define-syntaxes (...) (lambda (stx) (raise-syntax-error #f "ellipses not allowed as an expression" stx))) But this defense mechanism did not activate because I wasn't using `...' as an expression, I expected `...' to have an affect in a syntax pattern. Of course I used the macro stepper to debug this but when I clicked on the `...' in the usage of my macro it said the identifier came from f.ss module. After I realized my mistake and changed the provide to (for-syntax ...), I went back to the macro stepper and saw that the syntax property for `...' now showed it coming from ellipses.ss instead of just f.ss. From plt at synx.us.to Mon Nov 2 23:07:40 2009 From: plt at synx.us.to (Synx) Date: Mon Nov 2 23:08:03 2009 Subject: [plt-scheme] multiple units with identical signatures In-Reply-To: <81addec70911021615m3ffd239fpf2dadb2e547e734c@mail.gmail.com> References: <4AEF6BD7.4030502@synx.us.to> <81addec70911021615m3ffd239fpf2dadb2e547e734c@mail.gmail.com> Message-ID: <4AEFAC8C.1090102@synx.us.to> Anthony Cowley wrote: > (define-compound-unit together@ > (import) > (export T) > (link (((P : page^)) page@) > (((I : info^)) info@) > (((T : top^)) top@ P I))) Woah! You know how to do that associative symbol unit linking thingy? That's not even correct in the docs! Okay I think I can work with that, thanks. From samth at ccs.neu.edu Mon Nov 2 23:14:20 2009 From: samth at ccs.neu.edu (Sam TH) Date: Mon Nov 2 23:14:58 2009 Subject: [plt-scheme] multiple units with identical signatures In-Reply-To: <4AEFAC8C.1090102@synx.us.to> References: <4AEF6BD7.4030502@synx.us.to> <81addec70911021615m3ffd239fpf2dadb2e547e734c@mail.gmail.com> <4AEFAC8C.1090102@synx.us.to> Message-ID: <63bb19ae0911022014s5f89fb1bnefe880b96f666f18@mail.gmail.com> On Mon, Nov 2, 2009 at 11:07 PM, Synx wrote: > Anthony Cowley wrote: >> (define-compound-unit together@ >> ? (import) >> ? (export T) >> ? (link (((P : page^)) page@) >> ? ? ? ? (((I : info^)) info@) >> ? ? ? ? (((T : top^)) top@ P I))) > > Woah! You know how to do that associative symbol unit linking thingy? > That's not even correct in the docs! Okay I think I can work with that, > thanks. Or, get rid of the compound unit entirely, and just link like this: (define (main) (define-values/invoke-unit/infer (export top^) (link page@ info@ top@)) (cons (run "~page") (run "~info"))) -- sam th samth@ccs.neu.edu From plt at synx.us.to Mon Nov 2 23:23:11 2009 From: plt at synx.us.to (Synx) Date: Mon Nov 2 23:23:34 2009 Subject: [plt-scheme] multiple units with identical signatures In-Reply-To: <81addec70911021615m3ffd239fpf2dadb2e547e734c@mail.gmail.com> References: <4AEF6BD7.4030502@synx.us.to> <81addec70911021615m3ffd239fpf2dadb2e547e734c@mail.gmail.com> Message-ID: <4AEFB02F.3000302@synx.us.to> Whoops! Unfortunately this example works fine: ---------------- #lang scheme/base (require scheme/unit) (define-signature page^ (respond)) (define-unit page@ (import) (export page^) (define (respond) "I'm a page!")) (define-signature info^ (respond)) (define-unit info@ (import) (export info^) (define (respond) "I'm informative!")) (define-signature top^ (run)) (define-unit top@ (import (prefix page: page^) (prefix info: info^)) (export top^) (define (run x) (cond ((string=? x "~page") (page:respond)) ((string=? x "~info") (info:respond)) (else (error "Couldn't dispatch" x))))) (define-compound-unit/infer together@ (import) (export top^) (link page@ info@ top@)) (define (main) (define-values/invoke-unit/infer together@) (cons (run "~page") (run "~info"))) ---------------- So my problem is decisively not with the units being unable to infer each other's signature, identical or not. I should have tested that before posting, sorry. I think it had something to do with... meh, not sure. All I know is when I invoke the compound unit I get the error {context expected 1 value, received 2 values: # #"} with no stack trace. Something about... parameters maybe? I know I've run across this before, it's so familiar... From jay.mccarthy at gmail.com Tue Nov 3 00:29:42 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Tue Nov 3 00:30:03 2009 Subject: [plt-scheme] Re: [ANN] OpenCL Binding In-Reply-To: References: Message-ID: I just released a new version where I've modified my macros to generate reams of documentation. This is just a start, of course, but it will help any early adopters. Here's the link: http://planet.plt-scheme.org/package-source/jaymccarthy/opencl.plt/1/1/planet-docs/opencl/API_Reference.html Jay On Mon, Nov 2, 2009 at 12:51 PM, Jay McCarthy wrote: > The first release of my OpenCL binding is available. > > http://planet.plt-scheme.org/display.ss?package=opencl.plt&owner=jaymccarthy > > If you have a Mac with Snow Leopard, > > running > > (require (planet jaymccarthy/opencl/tests/test)) > > Should print out lots of information about your devices and run a > simple program. > > The documentation > > http://planet.plt-scheme.org/package-source/jaymccarthy/opencl.plt/1/0/planet-docs/opencl/index.html > > talks about what is broken about it and what you can help with if you want. > > Jay > > -- > Jay McCarthy > Assistant Professor / Brigham Young University > http://teammccarthy.org/jay > > "The glory of God is Intelligence" - D&C 93 > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From plt at synx.us.to Tue Nov 3 00:30:18 2009 From: plt at synx.us.to (Synx) Date: Tue Nov 3 00:30:41 2009 Subject: [plt-scheme] multiple units with identical signatures In-Reply-To: <4AEFB02F.3000302@synx.us.to> References: <4AEF6BD7.4030502@synx.us.to> <81addec70911021615m3ffd239fpf2dadb2e547e734c@mail.gmail.com> <4AEFB02F.3000302@synx.us.to> Message-ID: <4AEFBFEA.1010906@synx.us.to> GOT IT dangit... I was using (define-values (a b) ...) for something that returned 2 values, but putting a procedure in the way, on the unit invocation level. (define-values (a b) (some-wrapper (return-two-values ...))) --> context expected 1 value, received 2 values: # # ...with no stack trace, no indication where the values were being improperly returned. From neil at neilvandyke.org Tue Nov 3 02:52:57 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Tue Nov 3 02:53:37 2009 Subject: [plt-scheme] let-require In-Reply-To: <4072c51f0911021414t5b06d588k8c60797831cb7474@mail.gmail.com> References: <4AEF2167.9030709@synx.us.to> <990e0c030911021024rc65338ck6cd9a22b1920f4b2@mail.gmail.com> <756daca50911021116na418c28qc55348d8563545fa@mail.gmail.com> <4072c51f0911021414t5b06d588k8c60797831cb7474@mail.gmail.com> Message-ID: <4AEFE159.80102@neilvandyke.org> Jens Axel S?gaard wrote at 11/02/2009 05:14 PM: > 2009/11/2 Grant Rettke : > >> PLaneT is an underutilized treasure trove. The model makes it easy for >> great contributions; but who knows about them? >> > > The PLT Blog is a nice place to write about new PLaneT packages. > An author of a new PLaneT package could post an announcement to the "plt-scheme" list. They could also post an announcement after releasing a new version with major improvements. I have no objection to this info also being in some blog, but, speaking as someone who is currently trying to at least skim the "plt-scheme" and "plt-dev" lists, I certainly don't want to have to monitor yet another medium to get this relatively useful info about PLaneT goodies. -- http://www.neilvandyke.org/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091103/1ff38046/attachment.htm From laurent.orseau at gmail.com Tue Nov 3 03:15:43 2009 From: laurent.orseau at gmail.com (Laurent) Date: Tue Nov 3 03:16:22 2009 Subject: [plt-scheme] Wishes for the PLaneT In-Reply-To: References: <4AE9D356.1000200@cs.utah.edu> Message-ID: On Mon, Nov 2, 2009 at 21:23, David Storrs wrote: > > > On Mon, Nov 2, 2009 at 10:28 AM, Laurent wrote: > >> Also, I've recently discovered the unavoidable MrEd Designer through a >> link in this mailing list, and I suspect there are many other usefulities >> like this in the wild. >> Therefore I add a wish to my list: >> - a section with links toward unlisted PLT tools websites. >> >> > So...that would be a list of unlisted items? ;> > To implement this, I asked for some help to friends of mine, Bertrand and Kurt, but they told me they had better things to do (in fact I think it's too difficult for them, but don't tell them). However, Alan said that they forgot about the time dimension, so in fact what would be unlisted at first wouldn't be afterwards, so that should get easy. He said he had better things to do too, though... ;) Laurent -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091103/b5625e55/attachment.htm From ebellani at gmail.com Tue Nov 3 11:38:56 2009 From: ebellani at gmail.com (Eduardo Bellani) Date: Tue Nov 3 11:39:18 2009 Subject: [plt-scheme] Equivalent to captures for regexp In-Reply-To: <19183.37543.965834.662227@winooski.ccs.neu.edu> References: <184222e50911021811o384878eeyfcbe0035e575fbad@mail.gmail.com> <19183.37543.965834.662227@winooski.ccs.neu.edu> Message-ID: <184222e50911030838v261b3364s2a6f465fc541e65a@mail.gmail.com> Thanks. My bug was that I was using (regexp-match #rx"(.)(.)(\\d+)(\\d)" "THX1138") instead of (regexp-match #px"(.)(.)(\\d+)(\\d)" "THX1138") Big difference for my purposes. -- Eduardo Bellani www.cnxs.com.br I object to doing things that computers can do. - Olin Shivers From rafkind at cs.utah.edu Tue Nov 3 12:18:30 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Tue Nov 3 12:21:35 2009 Subject: [plt-scheme] Re: [ANN] Lazy Scribble Documentator and Packager In-Reply-To: References: <4AE874D3.5050507@cs.utah.edu> <4AE88C2B.2080105@cs.utah.edu> Message-ID: <4AF065E6.5070308@cs.utah.edu> Laurent wrote: > I've uploaded a new version that uses 'run-file and solves the username > problem for Unix. > If that doesn't work I'll consider using make-planet-archive. > > This version worked for me. All I had to do was call (planet-build). From rafkind at cs.utah.edu Tue Nov 3 16:16:23 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Tue Nov 3 16:19:35 2009 Subject: [plt-scheme] hide "welcome to drscheme" Message-ID: <4AF09DA7.6010401@cs.utah.edu> Is there an existing way to hide the "welcome to drscheme ..., language is currenly blah.." text in the interaction pane? Welcome to DrScheme, version 4.2.2.5-svn3nov2009 [3m]. Language: Module; memory limit: 128 megabytes. From robby at eecs.northwestern.edu Tue Nov 3 16:46:26 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Tue Nov 3 16:46:48 2009 Subject: [plt-scheme] hide "welcome to drscheme" In-Reply-To: <4AF09DA7.6010401@cs.utah.edu> References: <4AF09DA7.6010401@cs.utah.edu> Message-ID: <932b2f1f0911031346i4b3836bfm704f5aa9f142a446@mail.gmail.com> In a tool you can probably make it go away with various tricks. What is the larger context? Robby On Tue, Nov 3, 2009 at 3:16 PM, Jon Rafkind wrote: > Is there an existing way to hide the "welcome to drscheme ..., language is > currenly blah.." text in the interaction pane? > > Welcome to DrScheme, version 4.2.2.5-svn3nov2009 [3m]. > Language: Module; memory limit: 128 megabytes. > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From rafkind at cs.utah.edu Tue Nov 3 16:50:09 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Tue Nov 3 16:53:14 2009 Subject: [plt-scheme] hide "welcome to drscheme" In-Reply-To: <932b2f1f0911031346i4b3836bfm704f5aa9f142a446@mail.gmail.com> References: <4AF09DA7.6010401@cs.utah.edu> <932b2f1f0911031346i4b3836bfm704f5aa9f142a446@mail.gmail.com> Message-ID: <4AF0A591.9000502@cs.utah.edu> Robby Findler wrote: > In a tool you can probably make it go away with various tricks. What > is the larger context? > > my screen is small, when an error occurs I dislike having to scroll the window to read them. From geoff at knauth.org Tue Nov 3 18:37:46 2009 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Tue Nov 3 18:38:04 2009 Subject: [plt-scheme] Refs for creating non-lispy DSLs In-Reply-To: <932b2f1f0911021718s2152e131q1d3c38c6906e9e6a@mail.gmail.com> References: <1257208052.14462.2.camel@turing> <932b2f1f0911021718s2152e131q1d3c38c6906e9e6a@mail.gmail.com> Message-ID: Thanks! I'm teaching a computer architecture class, and the students would get this. On Nov 2, 2009, at 20:18, Robby Findler wrote: > I have one more example that's pretty self contained if you'd like. > See the file rca-hdl.ss as an example use of the language. Sorry, no > docs, but feel free to ask me questions if you can't figure anything > out. > > It is a (mini) hardware description language. The one in the example > file just evaluates the program. Switch it to "mini-hdl-gc.ss" to see > it do some gate counting. In that language you can also leave off some > of the inputs (remove the "= " part of the declaration) and it > will compute the gate counts for all possible inputs. > > hth, > Robby > > From robby at eecs.northwestern.edu Tue Nov 3 18:46:49 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Tue Nov 3 18:47:08 2009 Subject: [plt-scheme] Refs for creating non-lispy DSLs In-Reply-To: References: <1257208052.14462.2.camel@turing> <932b2f1f0911021718s2152e131q1d3c38c6906e9e6a@mail.gmail.com> Message-ID: <932b2f1f0911031546x29ca6513w6d972871724bc53e@mail.gmail.com> Well it doesn't count transistors (so XOR and OR both count the same) and it doesn't consider layout so do take it with a grain of salt. I had fun making it tho. :) Robby On Tuesday, November 3, 2009, Geoffrey S. Knauth wrote: > Thanks! ?I'm teaching a computer architecture class, and the students would get this. > > On Nov 2, 2009, at 20:18, Robby Findler wrote: > > > I have one more example that's pretty self contained if you'd like. > See the file rca-hdl.ss as an example use of the language. Sorry, no > docs, but feel free to ask me questions if you can't figure anything > out. > > It is a (mini) hardware description language. The one in the example > file just evaluates the program. Switch it to "mini-hdl-gc.ss" to see > it do some gate counting. In that language you can also leave off some > of the inputs (remove the "= " part of the declaration) and it > will compute the gate counts for all possible inputs. > > hth, > Robby > > > > From ixmatus at gmail.com Tue Nov 3 19:20:06 2009 From: ixmatus at gmail.com (Parnell Springmeyer) Date: Tue Nov 3 19:20:32 2009 Subject: [plt-scheme] Help: Question about require and include Message-ID: <4AF0C8B6.20108@gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'm a Scheme noob and have had trouble trying to figure out why this code does not work: (define base-module-path "/home/user/modules/") (require (string-append base-module-path "user-agent.ss")) I know I'm missing something basic as to why it doesn't work... Any enlightenment would be nice! - -- Parnell "Ixmatus" Springmeyer (http://ixmat.us) -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.12 (Darwin) iQEcBAEBAgAGBQJK8Mi2AAoJEPvtlbpI1POL/GIH/03sUGMxatMRpSPK2Ds1UEi0 rZfdoUCW5ZfLI0THFld65TbT+QSWEgu+hLwCPd4ChEWNKSleuDXaxCTALW8vBtNV x5WSk17ICBuC4gyJIv59jaJ3U7Z0+ej5RO7vPiEUGnS/OQo2VeoMBsaK68Z8bCgf cF34HgKXrATfd2jEHCdyiVMhKKMFAasXJwSr+bTYD12PuUhCQTaek8cNeDrySF3X pfj4DFiNUEnS232l4kKdsRwBk8BI4d2UAGhQc1sBCEUOHTrC4S6WiXo/BDW20std dUtewV3q6yWPGGQExmc3ZUEW+hNlXXQhH/G1QDDhRuP4dcoB3V+bUZszO0sb9Hw= =i8rr -----END PGP SIGNATURE----- From jmj at fellowhuman.com Tue Nov 3 19:25:11 2009 From: jmj at fellowhuman.com (Jordan Johnson) Date: Tue Nov 3 19:25:48 2009 Subject: [plt-scheme] Universe and network Message-ID: <4DA4EBCE-F59D-49E7-B719-81B74A59667B@fellowhuman.com> Hi all, What port(s) does the universe teachpack rely on the availability of? I need them so I can ask my net admin to poke the appropriate holes in the firewalls on my lab machines... Best, Jordan From czhu at cs.utah.edu Tue Nov 3 19:31:42 2009 From: czhu at cs.utah.edu (Chongkai Zhu) Date: Tue Nov 3 19:32:11 2009 Subject: [plt-scheme] Help: Question about require and include In-Reply-To: <4AF0C8B6.20108@gmail.com> References: <4AF0C8B6.20108@gmail.com> Message-ID: <4AF0CB6E.7010603@cs.utah.edu> This doesn't work because "require" is a syntactic form instead of a function. Basically you need to learn the difference between macros and normal values(function calls). There is ways to do what you want, by introducing a macro that call the "string-append" at compile time, but I doubt whether it is what you want. Chongkai Parnell Springmeyer wrote: > I'm a Scheme noob and have had trouble trying to figure out why this > code does not work: > > (define base-module-path "/home/user/modules/") > (require (string-append base-module-path "user-agent.ss")) > > I know I'm missing something basic as to why it doesn't work... Any > enlightenment would be nice! > > - -- > Parnell "Ixmatus" Springmeyer (http://ixmat.us) > From chengchangwu at yahoo.com Tue Nov 3 20:19:15 2009 From: chengchangwu at yahoo.com (Cheng-Chang Wu) Date: Tue Nov 3 20:19:36 2009 Subject: [plt-scheme] How to make a setter out of an identifier Message-ID: <908291.23353.qm@web51409.mail.re2.yahoo.com> Hi,=0A=0AI am new to the brave scheme world, and trying hard to understand = the secrets of macro.=0A=0AI want to do the following: take an identifier a= nd make a setter out of the identifier.=0A=0AFor example,=0A=0A(define kk 0= )=0A(make-setter kk)=0A=0Ashould give me a set-kk! which can be used to set= the value of kk.=0A=0AThe best macro I can image is =0A=0A(define-syntax m= ake-setter=0A (lambda (x)=0A (syntax-case x ()=0A ((make-setter = id)=0A (with-syntax=0A ((def=0A (datum->= syntax=0A (syntax k)=0A `(define (,(string-= >symbol (string-append "set-" (symbol->string 'id) "!")) a-value) (set! id = a-value)))))=0A (syntax def))))))=0A=0A=0A_______________________= ____________________________ =0A =B1z=AA=BA=A5=CD=AC=A1=A7Y=AE=C9=B3q =A1= =D0 =B7=BE=B3q=A1B=AET=BC=D6=A1B=A5=CD=AC=A1=A1B=A4u=A7@=A4@=A6=B8=B7d=A9w= =A1I =0A http://messenger.yahoo.com.tw/ From robby at eecs.northwestern.edu Tue Nov 3 20:34:57 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Tue Nov 3 20:35:18 2009 Subject: [plt-scheme] How to make a setter out of an identifier In-Reply-To: <908291.23353.qm@web51409.mail.re2.yahoo.com> References: <908291.23353.qm@web51409.mail.re2.yahoo.com> Message-ID: <932b2f1f0911031734u10023956ief9ba482372cab28@mail.gmail.com> How about this: (define-syntax-rule (make-setter kk) (lambda (x) (set! kk x))) Robby 2009/11/3 Cheng-Chang Wu : > Hi, > > I am new to the brave scheme world, and trying hard to understand the secrets of macro. > > I want to do the following: take an identifier and make a setter out of the identifier. > > For example, > > (define kk 0) > (make-setter kk) > > should give me a set-kk! which can be used to set the value of kk. > > The best macro I can image is > > (define-syntax make-setter > ?(lambda (x) > ? ?(syntax-case x () > ? ? ? ?((make-setter id) > ? ? ? ? (with-syntax > ? ? ? ? ? ? ((def > ? ? ? ? ? ? ? ?(datum->syntax > ? ? ? ? ? ? ? ? (syntax k) > ? ? ? ? ? ? ? ? `(define (,(string->symbol (string-append "set-" (symbol->string 'id) "!")) a-value) (set! id a-value))))) > ? ? ? ? ? (syntax def)))))) > > > ___________________________________________________ > ???????? ? ???????????????? > ?http://messenger.yahoo.com.tw/ > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From jos.koot at telefonica.net Tue Nov 3 20:42:49 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Tue Nov 3 20:43:55 2009 Subject: [plt-scheme] How to make a setter out of an identifier References: <908291.23353.qm@web51409.mail.re2.yahoo.com> Message-ID: <67405B0F6EE84720B2800A2F90DA27F0@uw2b2dff239c4d> This may be what you are looking for: #lang scheme (define kk 0) (define-syntax (make-setter stx) (syntax-case stx () ((_ id) (with-syntax ((setter (datum->syntax stx ; specify context (string->symbol ; we have no symbol-append, therefore use string-append. (string-append "set-" (symbol->string (syntax->datum #'id)) "!"))))) #'(define-syntax setter (syntax-rules () ((_ v) (set! id v)))))))) (make-setter kk) (set-kk! 3) kk ; --> 3 You have to use datum->syntax in order to introduce identifiers within their appropriate context. Good luck, Jos ----- Original Message ----- From: "Cheng-Chang Wu" To: Sent: Wednesday, November 04, 2009 2:19 AM Subject: [plt-scheme] How to make a setter out of an identifier Hi, I am new to the brave scheme world, and trying hard to understand the secrets of macro. I want to do the following: take an identifier and make a setter out of the identifier. For example, (define kk 0) (make-setter kk) should give me a set-kk! which can be used to set the value of kk. The best macro I can image is (define-syntax make-setter (lambda (x) (syntax-case x () ((make-setter id) (with-syntax ((def (datum->syntax (syntax k) `(define (,(string->symbol (string-append "set-" (symbol->string 'id) "!")) a-value) (set! id a-value))))) (syntax def)))))) ___________________________________________________ ±zªº¥Í¬¡§Y®É³q ¡Ð ·¾³q¡B®T¼Ö¡B¥Í¬¡¡B¤u§@¤@¦¸·d©w¡I http://messenger.yahoo.com.tw/ _________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-scheme From jos.koot at telefonica.net Tue Nov 3 20:45:03 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Tue Nov 3 20:46:08 2009 Subject: [plt-scheme] How to make a setter out of an identifier References: <908291.23353.qm@web51409.mail.re2.yahoo.com> <932b2f1f0911031734u10023956ief9ba482372cab28@mail.gmail.com> Message-ID: <6116C43B204D4305B68D311AC31392D8@uw2b2dff239c4d> That's much simpler than I suggested ): Jos ----- Original Message ----- From: "Robby Findler" To: "Cheng-Chang Wu" Cc: Sent: Wednesday, November 04, 2009 2:34 AM Subject: Re: [plt-scheme] How to make a setter out of an identifier How about this: (define-syntax-rule (make-setter kk) (lambda (x) (set! kk x))) Robby 2009/11/3 Cheng-Chang Wu : > Hi, > > I am new to the brave scheme world, and trying hard to understand the secrets of macro. > > I want to do the following: take an identifier and make a setter out of the identifier. > > For example, > > (define kk 0) > (make-setter kk) > > should give me a set-kk! which can be used to set the value of kk. > > The best macro I can image is > > (define-syntax make-setter > (lambda (x) > (syntax-case x () > ((make-setter id) > (with-syntax > ((def > (datum->syntax > (syntax k) > `(define (,(string->symbol (string-append "set-" (symbol->string 'id) "!")) a-value) (set! id a-value))))) > (syntax def)))))) > > > ___________________________________________________ > ??????? ? ???????????????? > http://messenger.yahoo.com.tw/ > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > _________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-scheme From robby at eecs.northwestern.edu Tue Nov 3 21:02:50 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Tue Nov 3 21:03:12 2009 Subject: [plt-scheme] How to make a setter out of an identifier In-Reply-To: <6116C43B204D4305B68D311AC31392D8@uw2b2dff239c4d> References: <908291.23353.qm@web51409.mail.re2.yahoo.com> <932b2f1f0911031734u10023956ief9ba482372cab28@mail.gmail.com> <6116C43B204D4305B68D311AC31392D8@uw2b2dff239c4d> Message-ID: <932b2f1f0911031802v1ee0b0f3o676d91a1bb10ee96@mail.gmail.com> But yours does more! Robby On Tue, Nov 3, 2009 at 7:45 PM, Jos Koot wrote: > That's much simpler than I suggested ): > Jos > > > ----- Original Message ----- From: "Robby Findler" > > To: "Cheng-Chang Wu" > Cc: > Sent: Wednesday, November 04, 2009 2:34 AM > Subject: Re: [plt-scheme] How to make a setter out of an identifier > > > How about this: > > (define-syntax-rule (make-setter kk) (lambda (x) (set! kk x))) > > Robby > > 2009/11/3 Cheng-Chang Wu : >> >> Hi, >> >> I am new to the brave scheme world, and trying hard to understand the >> secrets of macro. >> >> I want to do the following: take an identifier and make a setter out of >> the identifier. >> >> For example, >> >> (define kk 0) >> (make-setter kk) >> >> should give me a set-kk! which can be used to set the value of kk. >> >> The best macro I can image is >> >> (define-syntax make-setter >> (lambda (x) >> (syntax-case x () >> ((make-setter id) >> (with-syntax >> ((def >> (datum->syntax >> (syntax k) >> `(define (,(string->symbol (string-append "set-" (symbol->string 'id) >> "!")) a-value) (set! id a-value))))) >> (syntax def)))))) >> >> >> ___________________________________________________ >> ??????? ? ???????????????? >> http://messenger.yahoo.com.tw/ >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > > From ccwu660601 at gmail.com Tue Nov 3 21:17:54 2009 From: ccwu660601 at gmail.com (ccwu) Date: Tue Nov 3 21:18:11 2009 Subject: [plt-scheme] Re: How to make a setter out of an identifier In-Reply-To: <67405B0F6EE84720B2800A2F90DA27F0@uw2b2dff239c4d> References: <908291.23353.qm@web51409.mail.re2.yahoo.com> <67405B0F6EE84720B2800A2F90DA27F0@uw2b2dff239c4d> Message-ID: Thanks! That's exactly what I want. Now it's time to understand why I cannot come up with the solution myself;) On 11=A4=EB4=A4=E9, =A4W=A4=C89=AE=C942=A4=C0, "Jos Koot" wrote: > This may be what you are looking for: > From morazanm at gmail.com Tue Nov 3 22:17:03 2009 From: morazanm at gmail.com (Marco Morazan) Date: Tue Nov 3 22:17:22 2009 Subject: [plt-scheme] error loading file.... Message-ID: <9b1fff280911031917w55c0c17ey6bf0c6433376d42d@mail.gmail.com> Is there a way to recuperate from the error below wihout losing the work done? The .bak file does not contain all the done work. insert-file in text%: error loading the file === context === C:\Program Files\PLT\collects\mred\private\wxme\text.ss:2538:2: do-insert-file method in text% C:\Program Files\PLT\collects\mred\private\editor.ss:177:35 C:\Program Files\PLT\collects\mred\private\editor.ss:171:29 C:\Program Files\PLT\collects\framework\private\frame.ss:1007:2 C:\Program Files\PLT\collects\scheme\private\class-internal.ss:2694:2: continue-make-object C:\Program Files\PLT\collects\scheme\private\class-internal.ss:2694:2: continue-make-object C:\Program Files\PLT\collects\scheme\private\class-internal.ss:2694:2: continue-make-object C:\Program Files\PLT\collects\framework\private\frame.ss:493:2 C:\Program Files\PLT\collects\scheme\private\class-internal.ss:2694:2: continue-make-object C:\Program Files\PLT\collects\scheme\private\class-internal.ss:2694:2: continue-make-object C:\Program Files\PLT\collects\framework\private\frame.ss:1566:2 C:\Program Files\PLT\collects\scheme\private\class-internal.ss:2694:2: continue-make-object C:\Program Files\PLT\collects\framework\private\frame.ss:749:2 C:\Program Files\PLT\collects\scheme\private\class-internal.ss:2694:2: continue-make-object C:\Program Files\PLT\collects\scheme\private\class-internal.ss:2694:2: continue-make-object C:\Program Files\PLT\collects\scheme\private\class-internal.ss:2694:2: continue-make-object ... -- Cheers, Marco From nadeem at acm.org Tue Nov 3 22:22:24 2009 From: nadeem at acm.org (Nadeem Abdul Hamid) Date: Tue Nov 3 22:22:47 2009 Subject: [plt-scheme] error loading file.... In-Reply-To: <9b1fff280911031917w55c0c17ey6bf0c6433376d42d@mail.gmail.com> References: <9b1fff280911031917w55c0c17ey6bf0c6433376d42d@mail.gmail.com> Message-ID: <47CA7198-7A2A-449E-B96D-3204D0F46160@acm.org> Try upgrading to the latest DrScheme (4.2.2)? See this thread: http://list.cs.brown.edu/mailman/private/plt-edu/2009-October/004777.html --- nadeem On Nov 3, 2009, at 10:17 PM, Marco Morazan wrote: > Is there a way to recuperate from the error below wihout losing the > work done? The .bak file does not contain all the done work. > > > > insert-file in text%: error loading the file > > === context === > C:\Program Files\PLT\collects\mred\private\wxme\text.ss:2538:2: > do-insert-file method in text% > C:\Program Files\PLT\collects\mred\private\editor.ss:177:35 > C:\Program Files\PLT\collects\mred\private\editor.ss:171:29 > C:\Program Files\PLT\collects\framework\private\frame.ss:1007:2 > C:\Program Files\PLT\collects\scheme\private\class-internal.ss:2694:2: > continue-make-object > C:\Program Files\PLT\collects\scheme\private\class-internal.ss:2694:2: > continue-make-object > C:\Program Files\PLT\collects\scheme\private\class-internal.ss:2694:2: > continue-make-object > C:\Program Files\PLT\collects\framework\private\frame.ss:493:2 > C:\Program Files\PLT\collects\scheme\private\class-internal.ss:2694:2: > continue-make-object > C:\Program Files\PLT\collects\scheme\private\class-internal.ss:2694:2: > continue-make-object > C:\Program Files\PLT\collects\framework\private\frame.ss:1566:2 > C:\Program Files\PLT\collects\scheme\private\class-internal.ss:2694:2: > continue-make-object > C:\Program Files\PLT\collects\framework\private\frame.ss:749:2 > C:\Program Files\PLT\collects\scheme\private\class-internal.ss:2694:2: > continue-make-object > C:\Program Files\PLT\collects\scheme\private\class-internal.ss:2694:2: > continue-make-object > C:\Program Files\PLT\collects\scheme\private\class-internal.ss:2694:2: > continue-make-object > ... > > > > -- > > Cheers, > > Marco > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From grettke at acm.org Tue Nov 3 22:31:36 2009 From: grettke at acm.org (Grant Rettke) Date: Tue Nov 3 22:31:54 2009 Subject: [plt-scheme] Help: Question about require and include In-Reply-To: <4AF0C8B6.20108@gmail.com> References: <4AF0C8B6.20108@gmail.com> Message-ID: <756daca50911031931g799b4c01n46776689e94b77dd@mail.gmail.com> On Tue, Nov 3, 2009 at 6:20 PM, Parnell Springmeyer wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > I'm a Scheme noob and have had trouble trying to figure out why this > code does not work: > > (define base-module-path "/home/user/modules/") > (require (string-append base-module-path "user-agent.ss")) > > I know I'm missing something basic as to why it doesn't work... Any > enlightenment would be nice! Did you want to accomplish something specific or are you just studying how things work? From ixmatus at gmail.com Tue Nov 3 23:49:55 2009 From: ixmatus at gmail.com (Parnell Springmeyer) Date: Tue Nov 3 23:50:28 2009 Subject: [plt-scheme] Help: Question about require and include In-Reply-To: <756daca50911031931g799b4c01n46776689e94b77dd@mail.gmail.com> References: <4AF0C8B6.20108@gmail.com> <756daca50911031931g799b4c01n46776689e94b77dd@mail.gmail.com> Message-ID: <4AF107F3.4040807@gmail.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I made the error of replying to the last responder without "Reply All". Grant, I am trying to accomplish something specific, here's what I wrote to the last replier: Might I ask what the proper idiom would be for creating a user defined path to, say, a module directory in a configuration file and then prefixing a module filename with that value at require time? Am I conceiving of it completely wrong? I would love to know what other more advanced programmers do. Grant Rettke wrote: > On Tue, Nov 3, 2009 at 6:20 PM, Parnell Springmeyer wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> I'm a Scheme noob and have had trouble trying to figure out why this >> code does not work: >> >> (define base-module-path "/home/user/modules/") >> (require (string-append base-module-path "user-agent.ss")) >> >> I know I'm missing something basic as to why it doesn't work... Any >> enlightenment would be nice! > > Did you want to accomplish something specific or are you just studying > how things work? > - -- Parnell "Ixmatus" Springmeyer (http://ixmat.us) -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.12 (Darwin) iQEcBAEBAgAGBQJK8QfzAAoJEPvtlbpI1POL0SYIALZwERaNZnvDa7Ek83KjudsD uH5RcfvR0yZ2pTnsVd70MGVTL+3AkoMLwn2SK5tCKBxKbz8wNLskYc3CU8For2cW 8DJ9W39w5f/9/FJF5xd2twQnqOR7LnWNHsynHyUVdamlJTcgO2q9Iopqwdm1xTmd AsN45X6uGlVYwylOk3JnXgdlqAEdRqUFkj9zS+7yKjGW6/E/I5lVVX/4y8W2tW48 U2wDzLrMIiTK2njyYrSZcRYOE04mMp4JFC4wkzgB6nGrDjTGWfJDmj7gBK89N1wv /0gzOU41P7tSPutaVWM3JnzfehGzYFPM/7R3U6m3zaxVXsZTY2y183Z91Bkn6es= =0rdx -----END PGP SIGNATURE----- From mflatt at cs.utah.edu Wed Nov 4 07:11:21 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Wed Nov 4 07:11:46 2009 Subject: [plt-scheme] error loading file.... In-Reply-To: <9b1fff280911031917w55c0c17ey6bf0c6433376d42d@mail.gmail.com> References: <9b1fff280911031917w55c0c17ey6bf0c6433376d42d@mail.gmail.com> Message-ID: <20091104121122.AB713650064@mail-svr1.cs.utah.edu> In version 4.2, there is a bug in saving text files that contain images. The bug was fixed in alter versions, and later versions also know how to work around the problem in files that were incorrectly saved by version 4.2. So, if the file was saved in version 4.2, then opening and saving the file in 4.2.1 or later will most likely repair it. At Tue, 3 Nov 2009 22:17:03 -0500, Marco Morazan wrote: > Is there a way to recuperate from the error below wihout losing the > work done? The .bak file does not contain all the done work. > > > > insert-file in text%: error loading the file > > === context === > C:\Program Files\PLT\collects\mred\private\wxme\text.ss:2538:2: > do-insert-file method in text% > C:\Program Files\PLT\collects\mred\private\editor.ss:177:35 > C:\Program Files\PLT\collects\mred\private\editor.ss:171:29 > C:\Program Files\PLT\collects\framework\private\frame.ss:1007:2 > C:\Program Files\PLT\collects\scheme\private\class-internal.ss:2694:2: > continue-make-object > C:\Program Files\PLT\collects\scheme\private\class-internal.ss:2694:2: > continue-make-object > C:\Program Files\PLT\collects\scheme\private\class-internal.ss:2694:2: > continue-make-object > C:\Program Files\PLT\collects\framework\private\frame.ss:493:2 > C:\Program Files\PLT\collects\scheme\private\class-internal.ss:2694:2: > continue-make-object > C:\Program Files\PLT\collects\scheme\private\class-internal.ss:2694:2: > continue-make-object > C:\Program Files\PLT\collects\framework\private\frame.ss:1566:2 > C:\Program Files\PLT\collects\scheme\private\class-internal.ss:2694:2: > continue-make-object > C:\Program Files\PLT\collects\framework\private\frame.ss:749:2 > C:\Program Files\PLT\collects\scheme\private\class-internal.ss:2694:2: > continue-make-object > C:\Program Files\PLT\collects\scheme\private\class-internal.ss:2694:2: > continue-make-object > C:\Program Files\PLT\collects\scheme\private\class-internal.ss:2694:2: > continue-make-object > ... > > > > -- > > Cheers, > > Marco > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From jensaxel at soegaard.net Wed Nov 4 07:46:00 2009 From: jensaxel at soegaard.net (=?UTF-8?Q?Jens_Axel_S=C3=B8gaard?=) Date: Wed Nov 4 07:46:20 2009 Subject: [plt-scheme] hide "welcome to drscheme" In-Reply-To: <4AF0A591.9000502@cs.utah.edu> References: <4AF09DA7.6010401@cs.utah.edu> <932b2f1f0911031346i4b3836bfm704f5aa9f142a446@mail.gmail.com> <4AF0A591.9000502@cs.utah.edu> Message-ID: <4072c51f0911040446u2852495fi8047c8306047d7d8@mail.gmail.com> 2009/11/3 Jon Rafkind : > my screen is small, when an error occurs I dislike having to scroll the > window to read them. Just in case you missed the option in preferences: Somewhere in preferences you can move the buttons to the left side of the screen, thus saving precious horisontal space. -- Jens Axel S?gaard From laurent.orseau at gmail.com Wed Nov 4 07:54:24 2009 From: laurent.orseau at gmail.com (Laurent) Date: Wed Nov 4 07:55:06 2009 Subject: [plt-scheme] hide "welcome to drscheme" In-Reply-To: <4072c51f0911040446u2852495fi8047c8306047d7d8@mail.gmail.com> References: <4AF09DA7.6010401@cs.utah.edu> <932b2f1f0911031346i4b3836bfm704f5aa9f142a446@mail.gmail.com> <4AF0A591.9000502@cs.utah.edu> <4072c51f0911040446u2852495fi8047c8306047d7d8@mail.gmail.com> Message-ID: Just in case too: The interaction window can be placed on the right (side to side) of the definition window also. I don't like having the interaction below the definition, I can't read my code and I can't read the output. On Wed, Nov 4, 2009 at 13:46, Jens Axel S?gaard wrote: > 2009/11/3 Jon Rafkind : > > > my screen is small, when an error occurs I dislike having to scroll the > > window to read them. > > Just in case you missed the option in preferences: > Somewhere in preferences you can move the buttons to the left > side of the screen, thus saving precious horisontal space. > > -- > Jens Axel S?gaard > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091104/2dbf3278/attachment.htm From robby at eecs.northwestern.edu Wed Nov 4 08:06:09 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Wed Nov 4 08:06:26 2009 Subject: [plt-scheme] hide "welcome to drscheme" In-Reply-To: <4072c51f0911040446u2852495fi8047c8306047d7d8@mail.gmail.com> References: <4AF09DA7.6010401@cs.utah.edu> <932b2f1f0911031346i4b3836bfm704f5aa9f142a446@mail.gmail.com> <4AF0A591.9000502@cs.utah.edu> <4072c51f0911040446u2852495fi8047c8306047d7d8@mail.gmail.com> Message-ID: <932b2f1f0911040506i115c4367s768cdc0406899af2@mail.gmail.com> That one's in the view menu. Robby On Wednesday, November 4, 2009, Jens Axel S?gaard wrote: > 2009/11/3 Jon Rafkind : > >> my screen is small, when an error occurs I dislike having to scroll the >> window to read them. > > Just in case you missed the option in preferences: > ? Somewhere in preferences you can move the buttons to the left > ? side of the screen, thus saving precious horisontal space. > > -- > Jens Axel S?gaard > From matthias at ccs.neu.edu Wed Nov 4 09:30:56 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Wed Nov 4 09:31:28 2009 Subject: [plt-scheme] Universe and network In-Reply-To: <4DA4EBCE-F59D-49E7-B719-81B74A59667B@fellowhuman.com> References: <4DA4EBCE-F59D-49E7-B719-81B74A59667B@fellowhuman.com> Message-ID: <95F2EAB7-9871-42FB-8BD4-9628F5E65679@ccs.neu.edu> 4567. I could make this configurable if it helps. -- Matthias On Nov 3, 2009, at 7:25 PM, Jordan Johnson wrote: > Hi all, > > What port(s) does the universe teachpack rely on the availability of? > > I need them so I can ask my net admin to poke the appropriate holes > in the firewalls on my lab machines... > > Best, > Jordan > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From stephen.degabrielle at acm.org Wed Nov 4 11:24:15 2009 From: stephen.degabrielle at acm.org (Stephen De Gabrielle) Date: Wed Nov 4 11:24:39 2009 Subject: [plt-scheme] hide "welcome to drscheme" In-Reply-To: <932b2f1f0911040506i115c4367s768cdc0406899af2@mail.gmail.com> References: <4AF09DA7.6010401@cs.utah.edu> <932b2f1f0911031346i4b3836bfm704f5aa9f142a446@mail.gmail.com> <4AF0A591.9000502@cs.utah.edu> <4072c51f0911040446u2852495fi8047c8306047d7d8@mail.gmail.com> <932b2f1f0911040506i115c4367s768cdc0406899af2@mail.gmail.com> Message-ID: <595b9ab20911040824r22f908e1ib7f59660f01303bb@mail.gmail.com> I have a small screen too- I sometimes change the font and font-size too. The worst thing is the file and function dropdown menus, along with the preferences dialog window which is just too big for the screen. Cheers, Stephen PS too be fair the screen is only 800x480 and I think some blame is probably with the window manager(gnome). On Wednesday, November 4, 2009, Robby Findler wrote: > That one's in the view menu. > > Robby > > On Wednesday, November 4, 2009, Jens Axel S?gaard wrote: >> 2009/11/3 Jon Rafkind : >> >>> my screen is small, when an error occurs I dislike having to scroll the >>> window to read them. >> >> Just in case you missed the option in preferences: >> ?? Somewhere in preferences you can move the buttons to the left >> ?? side of the screen, thus saving precious horisontal space. >> >> -- >> Jens Axel S?gaard >> > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- -- Stephen De Gabrielle stephen.degabrielle@acm.org Telephone +44 (0)20 85670911 Mobile +44 (0)79 85189045 http://www.degabrielle.name/stephen From robby at eecs.northwestern.edu Wed Nov 4 11:34:16 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Wed Nov 4 11:34:37 2009 Subject: [plt-scheme] hide "welcome to drscheme" In-Reply-To: <595b9ab20911040824r22f908e1ib7f59660f01303bb@mail.gmail.com> References: <4AF09DA7.6010401@cs.utah.edu> <932b2f1f0911031346i4b3836bfm704f5aa9f142a446@mail.gmail.com> <4AF0A591.9000502@cs.utah.edu> <4072c51f0911040446u2852495fi8047c8306047d7d8@mail.gmail.com> <932b2f1f0911040506i115c4367s768cdc0406899af2@mail.gmail.com> <595b9ab20911040824r22f908e1ib7f59660f01303bb@mail.gmail.com> Message-ID: <932b2f1f0911040834w5acf1569le160866ef8c56ed@mail.gmail.com> On Wed, Nov 4, 2009 at 10:24 AM, Stephen De Gabrielle wrote: > I have a small screen too- I sometimes change the font and font-size > too. The worst thing is the file and function dropdown menus, If you put your toolbar on the right (or left) they go away. Does that help? (In the view menu). > along > with the preferences dialog window which is just too big for the > screen. I did some work to make this smaller; is there just one or two panels that are too big, by chance? If you could send a screenshot of the big ones, I might see something easy to change. Robby > Cheers, > Stephen > > PS too be fair the screen is only 800x480 and I think some blame is > probably with the window manager(gnome). > > On Wednesday, November 4, 2009, Robby Findler > wrote: >> That one's in the view menu. >> >> Robby >> >> On Wednesday, November 4, 2009, Jens Axel S?gaard wrote: >>> 2009/11/3 Jon Rafkind : >>> >>>> my screen is small, when an error occurs I dislike having to scroll the >>>> window to read them. >>> >>> Just in case you missed the option in preferences: >>> ?? Somewhere in preferences you can move the buttons to the left >>> ?? side of the screen, thus saving precious horisontal space. >>> >>> -- >>> Jens Axel S?gaard >>> >> _________________________________________________ >> ??For list-related administrative tasks: >> ??http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > > -- > > -- > Stephen De Gabrielle > stephen.degabrielle@acm.org > Telephone +44 (0)20 85670911 > Mobile ? ? ? ?+44 (0)79 85189045 > http://www.degabrielle.name/stephen > From mflatt at cs.utah.edu Wed Nov 4 14:28:52 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Wed Nov 4 14:29:13 2009 Subject: [plt-scheme] change to `scheme/foreign' Message-ID: <20091104192853.141156500C7@mail-svr1.cs.utah.edu> As of v4.2.2.6 (now in SVN), the `_pointer' type in the FFI has changed to mean "pointer to an address that is *not* managed by the GC". A new `_gcpointer' type takes over the old meaning of `_pointer', which was "pointer to an address that may or may not be managed by the GC". This change could break some existing uses of the FFI, but I think it's likely to repair many more existing uses than it breaks. At first glance, `_gcpointer' is more convenient than `_pointer'. The GC can just look at the address in a `_gcpointer' wrapper and decide whether the address is within one of the pages of memory that the GC manages. Also, given our past reliance on conservative GC, defining `_pointer' to allow references to GCable memory seemed like the obvious choice. The problem is that a memory page used by one allocator, such as malloc()/free(), can sometimes be released by that allocator and picked up by another allocator, such as the GC. For example, suppose that `make-encrypted-in', `make-encrypted', and `close-encrypted' are supplied by a foreign library: (define-struct connection (in out)) .... (let ([c (make-connection (make-encrypted-in ....) (make-encrypted-out ....))]) .... (close-encrypted (connection-in c)) (close-encrypted (connection-out c))) It's likely that `make-encrypted' allocates its result with malloc() and `close-encrypted' releases its argument with free(). In that case, on some platforms, the above program is broken. It could happen that 1. `(close-encrypted (connection-in c))' frees memory with free(); 2. free() releases the page that uses to contain the address referenced by `(connection-in c)'; 3. before continuing with `(close-encrypted (connection-out c))', athread Scheme thread swaps in; 4. the other thread allocates enough that the GC looks for a new page of memory, and get takes the one just released by free(); 5. the other thread continues to allocate and forces a GC; and 6. the GC crashes, because the pointer in `(connection-in c)' still refers to the address of memory that was free()ed, and now that address points into the middle of a GC-managed block of memory. The problem could be fixed with (let ([c (make-connection (make-encrypted-in ....) (make-encrypted-out ....))]) .... (let ([in (connection-in c)] [out (connection-out c)]) (close-encrypted in) (close-encrypted out))) This works because space safety ensures that `c' and `in' are no longer referenced by the time `close-encrypted' is called. But this fine-grained level of reachability is obviously difficult to reason about. The new meaning of `_pointer' avoids the above problem. The GC ignores the address stored in the Scheme representation of the pointer. Meanwhile, it seems that `_gcpointer' is rarely needed. When getting a pointer back from a foreign library, it almost never refers to GCable memory, because the GC would not have been able to track the pointer (and update it when data is moved by the GC) within the foreign library. In those cases, then, plain `_pointer' works. For pointer values going the other direction --- from Scheme to a foreign library --- `_pointer' and `_gcpointer' are the same. There is an implicit use of `_gcpointer' when calling the `make-' procedure bound by a `define-cstruct'. Since that's implicit, though, no existing code must change to use it. Similarly, there's an implicit use of `_gcpointer' when allocating data with `malloc' in modes other than 'raw. Again, the use is implicit, so no conversion is necessary. Another change to `malloc' is that the mode now defaults to 'atomic when a type based on `_pointer' is provided. The 'nonatomic mode is used only when a given type is based on `_gcpointer' or `_scheme'. For all of those reasons, I'm pretty sure that the change to `_pointer' is a good idea, but let me know if it causes any trouble. From erenguven at cs.bilgi.edu.tr Wed Nov 4 14:49:32 2009 From: erenguven at cs.bilgi.edu.tr (Eren =?UTF-8?Q?G=C3=BCven?=) Date: Wed Nov 4 15:20:46 2009 Subject: [plt-scheme] plt - tuio - htdp Message-ID: Hi all, I am a 2nd year student in Istanbul Bilgi University, Computer Science Department. We also use PLT Scheme and follow HtDP in 1st year. For those who are interested in 'tangible interfaces', 'tuio', 'reacTIVision' or related subjects, below is a link to a TUIO Client library I have written. It is written in DrScheme to be used in -but not necessarily limited to- DrScheme together with 2htdp/universe.ss teachpack. It is currently hosted at Google Code. http://code.google.com/p/scheme-tuio/ Regards Eren G?ven Istanbul Bilgi University, Computer Science Department From yinso.chen at gmail.com Wed Nov 4 19:52:15 2009 From: yinso.chen at gmail.com (YC) Date: Wed Nov 4 19:52:37 2009 Subject: [plt-scheme] bzlib/dbi error trying to insert a null value In-Reply-To: <779bf2730910011747x6d256776wc1bc04fd1f1b718a@mail.gmail.com> References: <901561.83262.qm@web62503.mail.re1.yahoo.com> <7622cdaf0910011457u5a92ebc4m1586144641b08913@mail.gmail.com> <779bf2730910011717w5cdffa26o84e51e9ed02b6313@mail.gmail.com> <7622cdaf0910011736h73c20aeve3382852980110bc@mail.gmail.com> <779bf2730910011747x6d256776wc1bc04fd1f1b718a@mail.gmail.com> Message-ID: <779bf2730911041652i20721a07nc025fadfb95c1957@mail.gmail.com> Okay - after some seriously thinking about the issue of last-insert-id & side effects, below are my ideas and would love some feedbacks: *Side Effect Data Structure * There are 3 options here: 1. return the underlying side-effect (and re-export the necessary bindings) for each of the drivers 2. provide my own unified side-effect object and convert the underling side-effect object onto the first one 3. convert the side effect into a record set structure (so you do not need to test whether it's a side effect struct) The first option's advantage is that if you already have extensive side effect testing code you do not have to change much. The drawback is that you'll have more headache/effort to switch between the databases. The second option's advantage is the reverse of the first one - you'll break current code, but you reduce one effort to switch between databases. The third option unifies the split between record set & side effects. Its advantage is that it removes your need to test the type of the return, but the disadvantage is the access of the result is a bit harder. I can of course provide all 3 approaches, but would be nice to reduce it down. Any thoughts on which one is the best? My personal thought is #2 or #3 (I love the unification aspect of #3 but know this is not generally how it is done). *Last Inserted ID * There are some general issues with last-inserted-id 1. it doesn't work for multiple record inserts at the database level 1. all databases only return a single value even if you insert multiple records into a table at once 2. mysql returns the id for the first record inserted in such case (this feels incorrect) 3. sqlite returns the id for the last record inserted in such case 2. postgresql is difficult requires you to know the name of the particular sequence object to get the value Although it does not always work, the fact that single record insert is the majority of the usage makes it useful, and in that case, I think the design employed by jaz/mysql is the correct one - i.e. *return the value as part of the side effect*, regardless which particular options chosen above. Both jaz/mysql & jaymccarthy/sqlite provides the api to allow this, but not schematics/spgsql. This is for the reason stated above that you'll need to know (or derive the sequence) the sequence name in order to determine the value, and that this needs to be done with a separate query (which can slow things down if you do not need the id). My question here: should I provide the last-inserted-id for spgsql given the constraints? Or just jazmysql & jsqlite? I plan on making the changes by next week - so any feedback prior to that would be welcome. Thanks, yc On Thu, Oct 1, 2009 at 5:47 PM, YC wrote: > > On Thu, Oct 1, 2009 at 5:36 PM, Jon Zeppieri wrote: > >> I'll have to think about how to approach this since each database returns >> different side effects. If anyone have thoughts into this matter please let >> me know - I would love to hear it. >> >>> >>> Both Perl's DBI and Java's JDBC have DB-neutral mechanisms for this, but >> they're very different. >> >> Perl DBI: http://search.cpan.org/~timb/DBI/DBI.pm#last_insert_id >> JDBC: http://www.ibm.com/developerworks/java/library/j-jdbcnew/#keys >> > > Thanks Jon for the links - I'll take a look at them. > > yc > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091104/9d0d35e8/attachment.htm From toddobryan at gmail.com Wed Nov 4 20:20:36 2009 From: toddobryan at gmail.com (Todd O'Bryan) Date: Wed Nov 4 20:20:56 2009 Subject: [plt-scheme] session info in web server applications Message-ID: <904774730911041720x5d79b88du5323c075110304a5@mail.gmail.com> After a user logs in, I'd like to keep track of who the user is and be able to get that information from somewhere. In other frameworks I've used, I'd save the user in a session and access it from there. How would I do such a thing naturally in the web app framework? I suspect that I'm not sufficiently comfortable with the idea of continuations... Todd From brauer at nordakademie.de Tue Nov 3 05:10:39 2009 From: brauer at nordakademie.de (Johannes Brauer) Date: Wed Nov 4 21:42:24 2009 Subject: [plt-scheme] version 4 (4.1.3) newbie question Message-ID: <86FC6AE2-23BE-4A3C-A0DF-3187CDBDDF26@nordakademie.de> Hi, if I put #lang scheme (list? (cons 1 '())) (filter (lambda (x) (> x 5)) '(3 5 6 7)) in the definition pane of DrScheme I get in the interaction pane: #t (6 7) Fine! But putting #lang scheme (require r5rs/init) (list? (cons 1 '())) (filter (lambda (x) (> x 5)) '(3 5 6 7)) in the definition pane I get an error message: filter: expected argument of type ; given (3 5 6 7) Can anyone explain me that? Thanks Johannes Staatlich anerkannte private Fachhochschule NORDAKADEMIE Gemeinn?tzige Aktiengesellschaft K?llner Chaussee 11 25337 Elmshorn Vorstand: Prof. Dr. Georg Plate (Vorsitzender), Dipl.-Ing. J?rg Meier (stellv. Vorstand) Vorsitzender des Aufsichtsrats: Dr. h.c. Hans-Heinrich Bruns Sitz: Elmshorn, Amtsgericht Elmshorn, HRB 1682 From jasper.maes at gmail.com Tue Nov 3 14:10:43 2009 From: jasper.maes at gmail.com (Japus) Date: Wed Nov 4 21:42:34 2009 Subject: [plt-scheme] Restart Web-server Message-ID: Hello I'm imlementing an online game, Stratego and for that I use the PLT web-server. Everything goes well but I'm stuck trying to find out how I can force the browser to reload the servlet. An example: Player 1 is able to move a pawn and in the meanwhile Player 2 can't (which is obvious) When Player 1 is done, Player 2 can make a move but before he can do that he has to manually reload his browser. And that's what I'm trying to do automatically using some kind of variable and a controlling procedure that determines which browser should be refreshed. Thanks Jasper From stephen.degabrielle at acm.org Wed Nov 4 18:59:44 2009 From: stephen.degabrielle at acm.org (Stephen De Gabrielle) Date: Wed Nov 4 21:42:42 2009 Subject: [plt-scheme] hide "welcome to drscheme" In-Reply-To: <932b2f1f0911040834w5acf1569le160866ef8c56ed@mail.gmail.com> References: <4AF09DA7.6010401@cs.utah.edu> <932b2f1f0911031346i4b3836bfm704f5aa9f142a446@mail.gmail.com> <4AF0A591.9000502@cs.utah.edu> <4072c51f0911040446u2852495fi8047c8306047d7d8@mail.gmail.com> <932b2f1f0911040506i115c4367s768cdc0406899af2@mail.gmail.com> <595b9ab20911040824r22f908e1ib7f59660f01303bb@mail.gmail.com> <932b2f1f0911040834w5acf1569le160866ef8c56ed@mail.gmail.com> Message-ID: <595b9ab20911041559j334c5d5ei8d6a000c876860c1@mail.gmail.com> Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: Screenshot.png Type: image/png Size: 96680 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091104/213e05de/Screenshot-0001.png From yinso.chen at gmail.com Wed Nov 4 22:52:17 2009 From: yinso.chen at gmail.com (YC) Date: Wed Nov 4 22:52:38 2009 Subject: [plt-scheme] Restart Web-server In-Reply-To: References: Message-ID: <779bf2730911041952j327333cby1b983e324b731811@mail.gmail.com> Hi Jasper - I think you mean auto/event-driven browser refresh rather than restart the web server. There is something called the World framework in PLT that appears to handle such needs - IIRC it works with Flash, but I never used it and don't know how it works - others would have to chime in. To do this on your own you can use either use the meta refresh technique, or you can use some sort of ajax/comet to have the server notify the client to refresh the pages. http://en.wikipedia.org/wiki/Meta_refresh - although this is considered obsolete by standards it is supported by all major browsers. The meta refresh happens with or without events occuring on the server-side. http://en.wikipedia.org/wiki/Comet_%28programming%29 - this occurs only when an event happened, but there is a lot more work involved. You can also do this with Flash/Flex, which has its own dev model. Cheers, yc On Tue, Nov 3, 2009 at 11:10 AM, Japus wrote: > Hello > > I'm imlementing an online game, Stratego and for that I use the PLT > web-server. Everything goes well but I'm stuck trying to find out how > I can force the browser to reload the servlet. > An example: > Player 1 is able to move a pawn and in the meanwhile Player 2 can't > (which is obvious) > When Player 1 is done, Player 2 can make a move but before he can do > that he has to manually reload his browser. And that's what I'm trying > to do automatically using some kind of variable and a controlling > procedure that determines which browser should be refreshed. > > Thanks > > Jasper > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091104/e0098a56/attachment.htm From czhu at cs.utah.edu Wed Nov 4 23:00:15 2009 From: czhu at cs.utah.edu (Chongkai Zhu) Date: Wed Nov 4 23:00:41 2009 Subject: [plt-scheme] version 4 (4.1.3) newbie question In-Reply-To: <86FC6AE2-23BE-4A3C-A0DF-3187CDBDDF26@nordakademie.de> References: <86FC6AE2-23BE-4A3C-A0DF-3187CDBDDF26@nordakademie.de> Message-ID: <4AF24DCF.9020100@cs.utah.edu> http://blog.plt-scheme.org/2007/11/getting-rid-of-set-car-and-set-cdr.html "Of course, PLT Scheme v4.0 will support an R5RS language where cons is mcons, and so on, so many old programs can still run easily in the new version. The difference is that interoperability between R5RS libraries and PLT Scheme libraries will be less direct than before." Chongkai Johannes Brauer wrote: > Hi, > if I put > > #lang scheme > > (list? (cons 1 '())) > (filter (lambda (x) (> x 5)) '(3 5 6 7)) > > in the definition pane of DrScheme I get in the interaction pane: > #t > (6 7) > > Fine! But putting > #lang scheme > (require r5rs/init) > > (list? (cons 1 '())) > (filter (lambda (x) (> x 5)) '(3 5 6 7)) > > in the definition pane I get an error message: > > filter: expected argument of type ; given (3 5 6 7) > > Can anyone explain me that? > > Thanks > Johannes > > > > > Staatlich anerkannte private Fachhochschule > NORDAKADEMIE > Gemeinn?tzige Aktiengesellschaft > K?llner Chaussee 11 > 25337 Elmshorn > > Vorstand: > Prof. Dr. Georg Plate (Vorsitzender), Dipl.-Ing. J?rg Meier (stellv. > Vorstand) > > Vorsitzender des Aufsichtsrats: > Dr. h.c. Hans-Heinrich Bruns > > Sitz: > Elmshorn, Amtsgericht Elmshorn, HRB 1682 > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From jay.mccarthy at gmail.com Thu Nov 5 00:06:01 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Nov 5 00:06:33 2009 Subject: [plt-scheme] session info in web server applications In-Reply-To: <904774730911041720x5d79b88du5323c075110304a5@mail.gmail.com> References: <904774730911041720x5d79b88du5323c075110304a5@mail.gmail.com> Message-ID: The standard thing is to use a parameter that the continuation captures (in the URL) and a cookie that the browser holds as an authenticator. In the FAQ I link to something that talks about doing cookies as authenticators correctly. Jay On Thu, Nov 5, 2009 at 2:20 AM, Todd O'Bryan wrote: > After a user logs in, I'd like to keep track of who the user is and be > able to get that information from somewhere. In other frameworks I've > used, I'd save the user in a session and access it from there. > > How would I do such a thing naturally in the web app framework? I > suspect that I'm not sufficiently comfortable with the idea of > continuations... > > Todd > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From laurent.orseau at gmail.com Thu Nov 5 02:40:55 2009 From: laurent.orseau at gmail.com (Laurent) Date: Thu Nov 5 02:41:37 2009 Subject: [plt-scheme] hide "welcome to drscheme" In-Reply-To: <595b9ab20911041559j334c5d5ei8d6a000c876860c1@mail.gmail.com> References: <4AF09DA7.6010401@cs.utah.edu> <932b2f1f0911031346i4b3836bfm704f5aa9f142a446@mail.gmail.com> <4AF0A591.9000502@cs.utah.edu> <4072c51f0911040446u2852495fi8047c8306047d7d8@mail.gmail.com> <932b2f1f0911040506i115c4367s768cdc0406899af2@mail.gmail.com> <595b9ab20911040824r22f908e1ib7f59660f01303bb@mail.gmail.com> <932b2f1f0911040834w5acf1569le160866ef8c56ed@mail.gmail.com> <595b9ab20911041559j334c5d5ei8d6a000c876860c1@mail.gmail.com> Message-ID: Just an idea: If you're looking for space, maybe the best possibility is too provide a fullscreen view, with only definitions and interactions, no border, no menu, no button, etc. As for mobiles, I'd be happy to show off with a pretty DrScheme on my phone ;) (though I don't think I'd use it often, but who knows?) Laurent On Thu, Nov 5, 2009 at 00:59, Stephen De Gabrielle < stephen.degabrielle@acm.org> wrote: > Hi, > > Don't take this too seriously - 7 inch800x480 screens are unlikely to be a > common any time soon... > > On Wed, Nov 4, 2009 at 4:34 PM, Robby Findler > wrote: > >> On Wed, Nov 4, 2009 at 10:24 AM, Stephen De Gabrielle >> wrote: >> > I have a small screen too- I sometimes change the font and font-size >> > too. The worst thing is the file and function dropdown menus, >> >> If you put your toolbar on the right (or left) they go away. Does that >> help? (In the view menu). >> > > Good tip for a bit of extra vertical space -thanks > > Though I wasn't clear - I meant the File (as is File, Edit View Language > Scheme, Insert Help) Menu goes off screen - it should scroll - but doesn't. > I believe that is a gnome problem -rather than a drscheme problem, though > MS Word has less items in its menus. > > > along >> > with the preferences dialog window which is just too big for the >> > screen. >> >> I did some work to make this smaller; is there just one or two panels >> that are too big, by chance? If you could send a screenshot of the big >> ones, I might see something easy to change. >> >> > there is a empty panel at the top in mine that doesn't help -see attached > > Thanks for taking the time to look at this, but I wouldn't worry about it > too much (unless DrScheme is ported to mobile phones), and I can't imagine > jedit or bluej or eclipse doing any better. > > Cheers, > > Stephen > > > > > > > >> Robby >> >> > Cheers, >> > Stephen >> > >> > PS too be fair the screen is only 800x480 and I think some blame is >> > probably with the window manager(gnome). >> > >> > On Wednesday, November 4, 2009, Robby Findler >> > wrote: >> >> That one's in the view menu. >> >> >> >> Robby >> >> >> >> On Wednesday, November 4, 2009, Jens Axel S?gaard < >> jensaxel@soegaard.net> wrote: >> >>> 2009/11/3 Jon Rafkind : >> >>> >> >>>> my screen is small, when an error occurs I dislike having to scroll >> the >> >>>> window to read them. >> >>> >> >>> Just in case you missed the option in preferences: >> >>> Somewhere in preferences you can move the buttons to the left >> >>> side of the screen, thus saving precious horisontal space. >> >>> >> >>> -- >> >>> Jens Axel S?gaard >> >>> >> >> _________________________________________________ >> >> For list-related administrative tasks: >> >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> >> > >> > -- >> > >> > -- >> > Stephen De Gabrielle >> > stephen.degabrielle@acm.org >> > Telephone +44 (0)20 85670911 >> > Mobile +44 (0)79 85189045 >> > http://www.degabrielle.name/stephen >> > >> > > > > -- > > -- > Stephen De Gabrielle > stephen.degabrielle@acm.org > Telephone +44 (0)20 85670911 > Mobile +44 (0)79 85189045 > http://www.degabrielle.name/stephen > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091105/e7c18857/attachment.htm From jmj at fellowhuman.com Thu Nov 5 03:24:37 2009 From: jmj at fellowhuman.com (Jordan Johnson) Date: Thu Nov 5 03:25:02 2009 Subject: [plt-scheme] Wishes for the PLaneT In-Reply-To: References: <4AE9D356.1000200@cs.utah.edu> Message-ID: On Nov 2, 2009, at 12:23 PM, David Storrs wrote: > Therefore I add a wish to my list: > - a section with links toward unlisted PLT tools websites. > > > So...that would be a list of unlisted items? ;> ;; A list-of-unlisted-items (LOUI) is either ;; - empty, or ;; - (do-not-cons item LOUI) ?? jmj From martindemello at gmail.com Thu Nov 5 05:46:02 2009 From: martindemello at gmail.com (Martin DeMello) Date: Thu Nov 5 05:46:22 2009 Subject: [plt-scheme] Wishes for the PLaneT In-Reply-To: References: <4AE9D356.1000200@cs.utah.edu> Message-ID: On Tue, Nov 3, 2009 at 1:53 AM, David Storrs wrote: > > So...that would be a list of unlisted items?? ;> http://www.amazon.com/Uncollected-Wodehouse-P-G/dp/1558821198 amused me when it first came out :) martin From jos.koot at telefonica.net Thu Nov 5 06:04:22 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Nov 5 06:04:55 2009 Subject: [plt-scheme] order of magnitude Message-ID: <3835C661C42741E8826015E46A483E43@uw2b2dff239c4d> Some browsing did not lead me to finding a function that accepts an exact positive rational number and returns its order of magnitude (an exact integer number) Something like: (define log10 (inexact->exact (log 10))) (define (order-of-magnitude q) (floor (/ (inexact->exact (log q)) log10))) However, due to inexactness of function log we find: (/ (inexact->exact (log #e1000e1000000)) log10) --> close to but sligtly less than 1000003 and hence: (order-of-magnitude #e1000e1000000) ; --> 1000002 The wanted answer is 1000003. So I did the following: (define order-of-magnitude (let* ((log10 (inexact->exact (log 10))) (10log (? (q) (/ (inexact->exact (log q)) log10)))) (? (q) (unless (and (rational? q) (exact? q) (positive? q)) (raise-type-error 'magnitude "positive exact rational number" q)) (let* ((m (floor (10log q))) (k (expt 10 m))) ; From now on all arithmetic operations and their operands are exact. (let loop ((m m) (lower (* k 1/10)) (middle k) (upper (* k 10))) (cond ((<= q lower) (loop (sub1 m) (* lower 1/10) lower middle)) ((>= q upper) (loop (add1 m) middle upper (* upper 10))) (else m))))))) (order-of-magnitude #e1000e1000000) ; --> 1000003 However, this seems rather complicated. Does someone have or know of a simpler and faster function for this purpose? Thanks, Jos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091105/628a6920/attachment.htm From jensaxel at soegaard.net Thu Nov 5 07:12:22 2009 From: jensaxel at soegaard.net (=?UTF-8?Q?Jens_Axel_S=C3=B8gaard?=) Date: Thu Nov 5 07:12:44 2009 Subject: [plt-scheme] order of magnitude In-Reply-To: <3835C661C42741E8826015E46A483E43@uw2b2dff239c4d> References: <3835C661C42741E8826015E46A483E43@uw2b2dff239c4d> Message-ID: <4072c51f0911050412m5b857051x302a65e45caf6a23@mail.gmail.com> 2009/11/5 Jos Koot : > Some browsing did not lead me to finding a function that accepts an exact > positive rational number and returns its order of magnitude (an exact > integer number) Something like: > > (define log10 (inexact->exact (log 10))) > (define (order-of-magnitude q) (floor (/ (inexact->exact (log q)) log10))) > > However, due to inexactness of function log we find: > > (/ (inexact->exact (log #e1000e1000000)) log10) --> close to but sligtly > less than 1000003 > > and hence: > > (order-of-magnitude #e1000e1000000) ; --> 1000002 > > The wanted answer is 1000003. So I did the following: > > (define order-of-magnitude > ?(let* > ? ((log10 (inexact->exact (log 10))) > ?? (10log (? (q) (/ (inexact->exact (log q)) log10)))) > ? (? (q) > ?? (unless (and (rational? q) (exact? q) (positive? q)) > ??? (raise-type-error 'magnitude "positive exact rational number" q)) > ?? (let* ((m (floor (10log q))) (k (expt 10 m))) > ??? ; From now on all arithmetic operations and their operands are exact. > ??? (let loop ((m m) (lower (* k 1/10)) (middle k) (upper (* k 10))) > ???? (cond > ????? ((<= q lower) (loop (sub1 m) (* lower 1/10) lower middle)) > ????? ((>= q upper) (loop (add1 m) middle upper (* upper 10))) > ????? (else m))))))) > > (order-of-magnitude #e1000e1000000) ; --> 1000003 > > However, this seems rather complicated. Does someone have or know of a > simpler and faster function for this purpose? I might be missing something, but what about this? (define (order n) (inexact->exact (floor (+ 1 (/ (log n) (log 10)))))) Note: It returns the same numbers as used in: http://en.wikipedia.org/wiki/Order_of_magnitude so it gives slightly different results than your function. -- Jens Axel S?gaard From jensaxel at soegaard.net Thu Nov 5 07:24:35 2009 From: jensaxel at soegaard.net (=?UTF-8?Q?Jens_Axel_S=C3=B8gaard?=) Date: Thu Nov 5 07:24:54 2009 Subject: [plt-scheme] version 4 (4.1.3) newbie question In-Reply-To: <86FC6AE2-23BE-4A3C-A0DF-3187CDBDDF26@nordakademie.de> References: <86FC6AE2-23BE-4A3C-A0DF-3187CDBDDF26@nordakademie.de> Message-ID: <4072c51f0911050424i44a2170em798820a90a053ff4@mail.gmail.com> 2009/11/3 Johannes Brauer : There are two different kinds of lists. The ones made with (good old) mutable cons-cells the new ones which are immutable. > #lang scheme This says that ' should produce the kind of lists used in the the "scheme" language. That ' produces immutable cons cells. The filter in "scheme" expects immutable cells so this ought to work fine. > (require r5rs/init) But here you import the filter function from the language "r5rs/init". This filter function expects mutable cons-cells. > (list? (cons 1 '())) > (filter (lambda (x) (> x 5)) '(3 5 6 7)) Here filter (the one expecting mutable cons-cells) is called with a list consisting of immutable cons-cells giving an error. That is, the functions in "scheme" and "r5rs" is difficult to mix. The easiest way to fix your program is to find out which PLT library where equivalent of the functions in r5rs/init you need is defined. For most functions, just search for the function name in the Help Desk. -- Jens Axel S?gaard From jos.koot at telefonica.net Thu Nov 5 07:27:04 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Nov 5 07:27:30 2009 Subject: [plt-scheme] order of magnitude References: <3835C661C42741E8826015E46A483E43@uw2b2dff239c4d> <4072c51f0911050412m5b857051x302a65e45caf6a23@mail.gmail.com> Message-ID: <4E05A96006124271B1657C082811C62E@uw2b2dff239c4d> Your example assumes that (/ (log n) (log 10)) always is too small, which cannot be trusted to be always true, I think. Jos ----- Original Message ----- From: "Jens Axel S?gaard" To: "Jos Koot" Cc: Sent: Thursday, November 05, 2009 1:12 PM Subject: Re: [plt-scheme] order of magnitude 2009/11/5 Jos Koot : > Some browsing did not lead me to finding a function that accepts an exact > positive rational number and returns its order of magnitude (an exact > integer number) Something like: > snip > However, this seems rather complicated. Does someone have or know of a > simpler and faster function for this purpose? I might be missing something, but what about this? (define (order n) (inexact->exact (floor (+ 1 (/ (log n) (log 10)))))) Note: It returns the same numbers as used in: http://en.wikipedia.org/wiki/Order_of_magnitude so it gives slightly different results than your function. -- Jens Axel S?gaard From jensaxel at soegaard.net Thu Nov 5 07:29:29 2009 From: jensaxel at soegaard.net (=?UTF-8?Q?Jens_Axel_S=C3=B8gaard?=) Date: Thu Nov 5 07:29:47 2009 Subject: [plt-scheme] order of magnitude In-Reply-To: <4E05A96006124271B1657C082811C62E@uw2b2dff239c4d> References: <3835C661C42741E8826015E46A483E43@uw2b2dff239c4d> <4072c51f0911050412m5b857051x302a65e45caf6a23@mail.gmail.com> <4E05A96006124271B1657C082811C62E@uw2b2dff239c4d> Message-ID: <4072c51f0911050429l5e0dc838x59de9bae6ee95a5f@mail.gmail.com> 2009/11/5 Jos Koot : > Your example assumes that (/ (log n) (log 10)) always is too small, which > cannot be trusted to be always true, I think. How is order(n) defined mathematically? -- Jens Axel From robby at eecs.northwestern.edu Thu Nov 5 07:43:12 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Nov 5 07:43:54 2009 Subject: [plt-scheme] hide "welcome to drscheme" In-Reply-To: References: <4AF09DA7.6010401@cs.utah.edu> <932b2f1f0911031346i4b3836bfm704f5aa9f142a446@mail.gmail.com> <4AF0A591.9000502@cs.utah.edu> <4072c51f0911040446u2852495fi8047c8306047d7d8@mail.gmail.com> <932b2f1f0911040506i115c4367s768cdc0406899af2@mail.gmail.com> <595b9ab20911040824r22f908e1ib7f59660f01303bb@mail.gmail.com> <932b2f1f0911040834w5acf1569le160866ef8c56ed@mail.gmail.com> <595b9ab20911041559j334c5d5ei8d6a000c876860c1@mail.gmail.com> Message-ID: <932b2f1f0911050443q7a8a419dhb5095cea53baf82d@mail.gmail.com> I have contemplated adding such a thing (I use a netbook regularly 1024x576), but didn't really think that it would end up saving all that much useful space (at least on my netbook). Firefox has that kind of a mode which is quite useful for some web pages, but not for others (google calendar: critical, gmail: not really much different). Robby On Thu, Nov 5, 2009 at 1:40 AM, Laurent wrote: > Just an idea: If you're looking for space, maybe the best possibility is too > provide a fullscreen view, with only definitions and interactions, no > border, no menu, no button, etc. > > As for mobiles, I'd be happy to show off with a pretty DrScheme on my phone > ;) > (though I don't think I'd use it often, but who knows?) > > Laurent > > On Thu, Nov 5, 2009 at 00:59, Stephen De Gabrielle > wrote: >> >> Hi, >> >> Don't take this too seriously - 7 inch800x480 screens are unlikely to be a >> common any time soon... >> >> On Wed, Nov 4, 2009 at 4:34 PM, Robby Findler >> wrote: >>> >>> On Wed, Nov 4, 2009 at 10:24 AM, Stephen De Gabrielle >>> wrote: >>> > I have a small screen too- I sometimes change the font and font-size >>> > too. The worst thing is the file and function dropdown menus, >>> >>> If you put your toolbar on the right (or left) they go away. Does that >>> help? (In the view menu). >> >> Good tip for a bit of extra vertical space -thanks >> >> Though I wasn't clear - I meant the File (as is File, Edit View Language >> Scheme, Insert Help) Menu goes off screen - it should scroll - but doesn't. >> I believe that is a gnome? problem -rather than a drscheme problem, though >> MS Word has less items in its menus. >> >>> > along >>> > with the preferences dialog window which is just too big for the >>> > screen. >>> >>> I did some work to make this smaller; is there just one or two panels >>> that are too big, by chance? If you could send a screenshot of the big >>> ones, I might see something easy to change. >>> >> >> there is a empty panel at the top in mine that doesn't help -see attached >> >> Thanks for taking the time to look at this, but I wouldn't worry about it >> too much (unless DrScheme is ported to mobile phones), and I can't imagine >> jedit or bluej or eclipse doing any better. >> >> Cheers, >> >> Stephen >> >> >> >> >> >> >>> >>> Robby >>> >>> > Cheers, >>> > Stephen >>> > >>> > PS too be fair the screen is only 800x480 and I think some blame is >>> > probably with the window manager(gnome). >>> > >>> > On Wednesday, November 4, 2009, Robby Findler >>> > wrote: >>> >> That one's in the view menu. >>> >> >>> >> Robby >>> >> >>> >> On Wednesday, November 4, 2009, Jens Axel S?gaard >>> >> wrote: >>> >>> 2009/11/3 Jon Rafkind : >>> >>> >>> >>>> my screen is small, when an error occurs I dislike having to scroll >>> >>>> the >>> >>>> window to read them. >>> >>> >>> >>> Just in case you missed the option in preferences: >>> >>> ?? Somewhere in preferences you can move the buttons to the left >>> >>> ?? side of the screen, thus saving precious horisontal space. >>> >>> >>> >>> -- >>> >>> Jens Axel S?gaard >>> >>> >>> >> _________________________________________________ >>> >> ??For list-related administrative tasks: >>> >> ??http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>> >> >>> > >>> > -- >>> > >>> > -- >>> > Stephen De Gabrielle >>> > stephen.degabrielle@acm.org >>> > Telephone +44 (0)20 85670911 >>> > Mobile ? ? ? ?+44 (0)79 85189045 >>> > http://www.degabrielle.name/stephen >>> > >> >> >> >> -- >> >> -- >> Stephen De Gabrielle >> stephen.degabrielle@acm.org >> Telephone +44 (0)20 85670911 >> Mobile ? ? ? ?+44 (0)79 85189045 >> http://www.degabrielle.name/stephen >> >> >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > > From neil at neilvandyke.org Thu Nov 5 07:52:32 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Nov 5 07:52:53 2009 Subject: [plt-scheme] hide "welcome to drscheme" In-Reply-To: References: <4AF09DA7.6010401@cs.utah.edu> <932b2f1f0911031346i4b3836bfm704f5aa9f142a446@mail.gmail.com> <4AF0A591.9000502@cs.utah.edu> <4072c51f0911040446u2852495fi8047c8306047d7d8@mail.gmail.com> <932b2f1f0911040506i115c4367s768cdc0406899af2@mail.gmail.com> <595b9ab20911040824r22f908e1ib7f59660f01303bb@mail.gmail.com> <932b2f1f0911040834w5acf1569le160866ef8c56ed@mail.gmail.com> <595b9ab20911041559j334c5d5ei8d6a000c876860c1@mail.gmail.com> Message-ID: <4AF2CA90.4020704@neilvandyke.org> Laurent wrote at 11/05/2009 02:40 AM: > Just an idea: If you're looking for space, maybe the best possibility > is too provide a fullscreen view, with only definitions and > interactions, no border, no menu, no button, etc. I'd like to have an option to get rid of the menu bar and toolbar. I think that this would involve making sure that the toolbar functions also had menu items, and that all the menu items were accessible via pop-up context menus. -- http://www.neilvandyke.org/ From laurent.orseau at gmail.com Thu Nov 5 07:54:25 2009 From: laurent.orseau at gmail.com (Laurent) Date: Thu Nov 5 07:55:07 2009 Subject: [plt-scheme] hide "welcome to drscheme" In-Reply-To: <4AF2CA90.4020704@neilvandyke.org> References: <4AF09DA7.6010401@cs.utah.edu> <932b2f1f0911031346i4b3836bfm704f5aa9f142a446@mail.gmail.com> <4AF0A591.9000502@cs.utah.edu> <4072c51f0911040446u2852495fi8047c8306047d7d8@mail.gmail.com> <932b2f1f0911040506i115c4367s768cdc0406899af2@mail.gmail.com> <595b9ab20911040824r22f908e1ib7f59660f01303bb@mail.gmail.com> <932b2f1f0911040834w5acf1569le160866ef8c56ed@mail.gmail.com> <595b9ab20911041559j334c5d5ei8d6a000c876860c1@mail.gmail.com> <4AF2CA90.4020704@neilvandyke.org> Message-ID: On Thu, Nov 5, 2009 at 13:52, Neil Van Dyke wrote: > Laurent wrote at 11/05/2009 02:40 AM: > > Just an idea: If you're looking for space, maybe the best possibility is >> too provide a fullscreen view, with only definitions and interactions, no >> border, no menu, no button, etc. >> > > I'd like to have an option to get rid of the menu bar and toolbar. > > I think that this would involve making sure that the toolbar functions also > had menu items, and that all the menu items were accessible via pop-up > context menus. > > or keyboard shortcuts? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091105/c681e890/attachment.htm From d.j.gurnell at gmail.com Thu Nov 5 08:21:07 2009 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Thu Nov 5 08:21:29 2009 Subject: [plt-scheme] hide "welcome to drscheme" In-Reply-To: References: <4AF09DA7.6010401@cs.utah.edu> <932b2f1f0911031346i4b3836bfm704f5aa9f142a446@mail.gmail.com> <4AF0A591.9000502@cs.utah.edu> <4072c51f0911040446u2852495fi8047c8306047d7d8@mail.gmail.com> <932b2f1f0911040506i115c4367s768cdc0406899af2@mail.gmail.com> <595b9ab20911040824r22f908e1ib7f59660f01303bb@mail.gmail.com> <932b2f1f0911040834w5acf1569le160866ef8c56ed@mail.gmail.com> <595b9ab20911041559j334c5d5ei8d6a000c876860c1@mail.gmail.com> <4AF2CA90.4020704@neilvandyke.org> Message-ID: > On Thu, Nov 5, 2009 at 13:52, Neil Van Dyke > wrote: > Laurent wrote at 11/05/2009 02:40 AM: > > Just an idea: If you're looking for space, maybe the best > possibility is too provide a fullscreen view, with only definitions > and interactions, no border, no menu, no button, etc. > > I'd like to have an option to get rid of the menu bar and toolbar. > > I think that this would involve making sure that the toolbar > functions also had menu items, and that all the menu items were > accessible via pop-up context menus. > > or keyboard shortcuts? My 2 cents: - proper, complete menus are a must; - keyboard shortcuts > context menus (except in check syntax mode); - toolbars not so useful. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091105/a90f771d/attachment.htm From neil at neilvandyke.org Thu Nov 5 08:26:03 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Nov 5 08:26:29 2009 Subject: [plt-scheme] hide "welcome to drscheme" In-Reply-To: References: <4AF09DA7.6010401@cs.utah.edu> <932b2f1f0911031346i4b3836bfm704f5aa9f142a446@mail.gmail.com> <4AF0A591.9000502@cs.utah.edu> <4072c51f0911040446u2852495fi8047c8306047d7d8@mail.gmail.com> <932b2f1f0911040506i115c4367s768cdc0406899af2@mail.gmail.com> <595b9ab20911040824r22f908e1ib7f59660f01303bb@mail.gmail.com> <932b2f1f0911040834w5acf1569le160866ef8c56ed@mail.gmail.com> <595b9ab20911041559j334c5d5ei8d6a000c876860c1@mail.gmail.com> <4AF2CA90.4020704@neilvandyke.org> Message-ID: <4AF2D26B.4000704@neilvandyke.org> Dave Gurnell wrote at 11/05/2009 08:21 AM: > > My 2 cents: > - proper, complete menus are a must; > - keyboard shortcuts > context menus (except in check syntax mode); > - toolbars not so useful. Agreed on all points, for the way I prefer to work. I'd add that toolbars are good for intro students, and no doubt are also good for the way *some* experienced people prefer to work. -- http://www.neilvandyke.org/ From d.j.gurnell at gmail.com Thu Nov 5 08:35:17 2009 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Thu Nov 5 08:35:39 2009 Subject: [plt-scheme] hide "welcome to drscheme" In-Reply-To: <4AF2D26B.4000704@neilvandyke.org> References: <4AF09DA7.6010401@cs.utah.edu> <932b2f1f0911031346i4b3836bfm704f5aa9f142a446@mail.gmail.com> <4AF0A591.9000502@cs.utah.edu> <4072c51f0911040446u2852495fi8047c8306047d7d8@mail.gmail.com> <932b2f1f0911040506i115c4367s768cdc0406899af2@mail.gmail.com> <595b9ab20911040824r22f908e1ib7f59660f01303bb@mail.gmail.com> <932b2f1f0911040834w5acf1569le160866ef8c56ed@mail.gmail.com> <595b9ab20911041559j334c5d5ei8d6a000c876860c1@mail.gmail.com> <4AF2CA90.4020704@neilvandyke.org> <4AF2D26B.4000704@neilvandyke.org> Message-ID: <888616BF-8DC5-4EBA-89BB-F490590562DD@gmail.com> >> My 2 cents: >> - proper, complete menus are a must; >> - keyboard shortcuts > context menus (except in check syntax mode); >> - toolbars not so useful. > > Agreed on all points, for the way I prefer to work. I'd add that > toolbars are good for intro students, and no doubt are also good for > the way *some* experienced people prefer to work. Yes sorry. I meant to indicate that these were only personal preferences. From jos.koot at telefonica.net Thu Nov 5 08:36:26 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Nov 5 08:37:14 2009 Subject: [plt-scheme] order of magnitude References: <3835C661C42741E8826015E46A483E43@uw2b2dff239c4d> <4072c51f0911050412m5b857051x302a65e45caf6a23@mail.gmail.com> <4E05A96006124271B1657C082811C62E@uw2b2dff239c4d> <4072c51f0911050429l5e0dc838x59de9bae6ee95a5f@mail.gmail.com> Message-ID: <5453527134174413AB4C055E7D8A1436@uw2b2dff239c4d> Let q be a positive rational (or real) number. I am looking for the greatest integer number m such that: (<= (expt 10 m) q) Jos ----- Original Message ----- From: "Jens Axel S?gaard" To: "Jos Koot" Cc: Sent: Thursday, November 05, 2009 1:29 PM Subject: Re: [plt-scheme] order of magnitude > 2009/11/5 Jos Koot : >> Your example assumes that (/ (log n) (log 10)) always is too small, which >> cannot be trusted to be always true, I think. > > How is order(n) defined mathematically? > > -- > Jens Axel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091105/25215e79/attachment.htm From robby at eecs.northwestern.edu Thu Nov 5 08:42:07 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Nov 5 08:42:30 2009 Subject: [plt-scheme] hide "welcome to drscheme" In-Reply-To: <4AF2D26B.4000704@neilvandyke.org> References: <4AF09DA7.6010401@cs.utah.edu> <932b2f1f0911040506i115c4367s768cdc0406899af2@mail.gmail.com> <595b9ab20911040824r22f908e1ib7f59660f01303bb@mail.gmail.com> <932b2f1f0911040834w5acf1569le160866ef8c56ed@mail.gmail.com> <595b9ab20911041559j334c5d5ei8d6a000c876860c1@mail.gmail.com> <4AF2CA90.4020704@neilvandyke.org> <4AF2D26B.4000704@neilvandyke.org> Message-ID: <932b2f1f0911050542i5704e72q74240b75736ce562@mail.gmail.com> Sounds like you want to the View|Toolbar|Toolbar Hidden menu item. Robby On Thursday, November 5, 2009, Neil Van Dyke wrote: > Dave Gurnell wrote at 11/05/2009 08:21 AM: > > > My 2 cents: > ?- proper, complete menus are a must; > ?- keyboard shortcuts > context menus (except in check syntax mode); > ?- toolbars not so useful. > > > Agreed on all points, for the way I prefer to work. ?I'd add that toolbars are good for intro students, and no doubt are also good for the way *some* experienced people prefer to work. > > -- > http://www.neilvandyke.org/ > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From jensaxel at soegaard.net Thu Nov 5 08:58:56 2009 From: jensaxel at soegaard.net (=?UTF-8?Q?Jens_Axel_S=C3=B8gaard?=) Date: Thu Nov 5 08:59:15 2009 Subject: [plt-scheme] order of magnitude In-Reply-To: <5453527134174413AB4C055E7D8A1436@uw2b2dff239c4d> References: <3835C661C42741E8826015E46A483E43@uw2b2dff239c4d> <4072c51f0911050412m5b857051x302a65e45caf6a23@mail.gmail.com> <4E05A96006124271B1657C082811C62E@uw2b2dff239c4d> <4072c51f0911050429l5e0dc838x59de9bae6ee95a5f@mail.gmail.com> <5453527134174413AB4C055E7D8A1436@uw2b2dff239c4d> Message-ID: <4072c51f0911050558n7bf686ffkf375b8e940fabbff@mail.gmail.com> 2009/11/5 Jos Koot : > Let q be a positive rational (or real) number. > I am looking for the greatest integer number m such that: > (<= (expt 10 m) q) I get: greatest integer m s.t.: 10^m <= q greatest integer m s.t.: log(10^m) <= log(q) greatest integer m s.t.: m*log(10) <= log(q) greatest integer m s.t.: m <= log(q)/log(10) m = floor(log(q)/log(10)) -- Jens Axel S?gaard From jos.koot at telefonica.net Thu Nov 5 09:29:10 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Nov 5 09:29:34 2009 Subject: [plt-scheme] order of magnitude References: <3835C661C42741E8826015E46A483E43@uw2b2dff239c4d> <4072c51f0911050412m5b857051x302a65e45caf6a23@mail.gmail.com> <4E05A96006124271B1657C082811C62E@uw2b2dff239c4d> <4072c51f0911050429l5e0dc838x59de9bae6ee95a5f@mail.gmail.com> <5453527134174413AB4C055E7D8A1436@uw2b2dff239c4d> <4072c51f0911050558n7bf686ffkf375b8e940fabbff@mail.gmail.com> Message-ID: Mathematically your derivation is correct, but computationally it may be incorrect. The problem is that in an actual computation, e.g. in Scheme, (expt 10 (/ (log q) (log 10))) may be slightly less than q or exactly equal to q or slightly greater than q. This holds even when q is exact, for log is not required to and often even cannot produce an exact result. In fact I do not even trust that the absolute error of (/ (log q) (log 10)) is allways less than one, where absolute error is the difference between mathematical value and actually computed value. As another axample: (- 2 (sqr (sqrt 2))) ; --> -4.440892098500626e-016 and hence: (zero? (- 2 (sqr (sqrt 2)))) --> #f Jos ----- Original Message ----- From: "Jens Axel S?gaard" To: "Jos Koot" Cc: Sent: Thursday, November 05, 2009 2:58 PM Subject: Re: [plt-scheme] order of magnitude 2009/11/5 Jos Koot : > Let q be a positive rational (or real) number. > I am looking for the greatest integer number m such that: > (<= (expt 10 m) q) I get: greatest integer m s.t.: 10^m <= q greatest integer m s.t.: log(10^m) <= log(q) greatest integer m s.t.: m*log(10) <= log(q) greatest integer m s.t.: m <= log(q)/log(10) m = floor(log(q)/log(10)) -- Jens Axel S?gaard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091105/e0612ef9/attachment.htm From neil at neilvandyke.org Thu Nov 5 09:39:37 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Nov 5 09:39:58 2009 Subject: [plt-scheme] hide "welcome to drscheme" In-Reply-To: <932b2f1f0911050542i5704e72q74240b75736ce562@mail.gmail.com> References: <4AF09DA7.6010401@cs.utah.edu> <932b2f1f0911040506i115c4367s768cdc0406899af2@mail.gmail.com> <595b9ab20911040824r22f908e1ib7f59660f01303bb@mail.gmail.com> <932b2f1f0911040834w5acf1569le160866ef8c56ed@mail.gmail.com> <595b9ab20911041559j334c5d5ei8d6a000c876860c1@mail.gmail.com> <4AF2CA90.4020704@neilvandyke.org> <4AF2D26B.4000704@neilvandyke.org> <932b2f1f0911050542i5704e72q74240b75736ce562@mail.gmail.com> Message-ID: <4AF2E3A9.5040002@neilvandyke.org> Robby Findler wrote at 11/05/2009 08:42 AM: > Sounds like you want to the View|Toolbar|Toolbar Hidden menu item. > Once the functions of the toolbar are available on menu items. -- http://www.neilvandyke.org/ From robby at eecs.northwestern.edu Thu Nov 5 09:58:54 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Nov 5 09:59:13 2009 Subject: [plt-scheme] hide "welcome to drscheme" In-Reply-To: <4AF2E3A9.5040002@neilvandyke.org> References: <4AF09DA7.6010401@cs.utah.edu> <932b2f1f0911040834w5acf1569le160866ef8c56ed@mail.gmail.com> <595b9ab20911041559j334c5d5ei8d6a000c876860c1@mail.gmail.com> <4AF2CA90.4020704@neilvandyke.org> <4AF2D26B.4000704@neilvandyke.org> <932b2f1f0911050542i5704e72q74240b75736ce562@mail.gmail.com> <4AF2E3A9.5040002@neilvandyke.org> Message-ID: <932b2f1f0911050658t6cae3ec0t12c0b08a37de288c@mail.gmail.com> On Thu, Nov 5, 2009 at 8:39 AM, Neil Van Dyke wrote: > Robby Findler wrote at 11/05/2009 08:42 AM: >> >> Sounds like you want to the View|Toolbar|Toolbar Hidden menu item. >> > > Once the functions of the toolbar are available on menu items. Most of the buttons are. Run is -t, Stop is -b (or -k), Check Syntax is control-c control-c or one of the function keys (depending on your platform). I'm not sure about the Macro Stepper and the Debugger, but their authors can certainly add menu items and/or key bindings. Were there others you were missing? Robby From pbewig at gmail.com Thu Nov 5 10:02:54 2009 From: pbewig at gmail.com (Phil Bewig) Date: Thu Nov 5 10:03:17 2009 Subject: [plt-scheme] order of magnitude In-Reply-To: <3835C661C42741E8826015E46A483E43@uw2b2dff239c4d> References: <3835C661C42741E8826015E46A483E43@uw2b2dff239c4d> Message-ID: (define (ilog b n) (let loop ((n n) (i -1)) (if (zero? n) i (loop (quotient n b) (+ i 1))))) (ilog 10 #e1000e1000000) => 1000003 It does take a while.... On Thu, Nov 5, 2009 at 5:04 AM, Jos Koot wrote: > Some browsing did not lead me to finding a function that accepts an exact > positive rational number and returns its order of magnitude (an exact > integer number) Something like: > > (define log10 (inexact->exact (log 10))) > (define (order-of-magnitude q) (floor (/ (inexact->exact (log q)) log10))) > > However, due to inexactness of function log we find: > > (/ (inexact->exact (log #e1000e1000000)) log10) --> close to but sligtly > less than 1000003 > > and hence: > > (order-of-magnitude #e1000e1000000) ; --> 1000002 > > The wanted answer is 1000003. So I did the following: > > (define order-of-magnitude > (let* > ((log10 (inexact->exact (log 10))) > (10log (? (q) (/ (inexact->exact (log q)) log10)))) > (? (q) > (unless (and (rational? q) (exact? q) (positive? q)) > (raise-type-error 'magnitude "positive exact rational number" q)) > (let* ((m (floor (10log q))) (k (expt 10 m))) > ; From now on all arithmetic operations and their operands are exact. > (let loop ((m m) (lower (* k 1/10)) (middle k) (upper (* k 10))) > (cond > ((<= q lower) (loop (sub1 m) (* lower 1/10) lower middle)) > ((>= q upper) (loop (add1 m) middle upper (* upper 10))) > (else m))))))) > > (order-of-magnitude #e1000e1000000) ; --> 1000003 > > However, this seems rather complicated. Does someone have or know of a > simpler and faster function for this purpose? > > Thanks, Jos > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091105/f6912c42/attachment.htm From david.storrs at gmail.com Thu Nov 5 10:08:53 2009 From: david.storrs at gmail.com (David Storrs) Date: Thu Nov 5 10:09:17 2009 Subject: [plt-scheme] Restart Web-server In-Reply-To: References: Message-ID: On Tue, Nov 3, 2009 at 7:10 PM, Japus wrote: > Hello > > I'm imlementing an online game, Stratego and for that I use the PLT > web-server. Everything goes well but I'm stuck trying to find out how > I can force the browser to reload the servlet. > An example: > Player 1 is able to move a pawn and in the meanwhile Player 2 can't > (which is obvious) > When Player 1 is done, Player 2 can make a move but before he can do > that he has to manually reload his browser. And that's what I'm trying > to do automatically using some kind of variable and a controlling > procedure that determines which browser should be refreshed. > > Thanks > > Jasper > Sounds to me like you just want to update the *page*, not the servlet...after all, the code hasn't changed, right? If that's the case, look into jquery http://jquery.com/ Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091105/72e5790b/attachment-0001.htm From jos.koot at telefonica.net Thu Nov 5 10:26:04 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Nov 5 10:26:31 2009 Subject: [plt-scheme] order of magnitude References: <3835C661C42741E8826015E46A483E43@uw2b2dff239c4d> Message-ID: <61575FB2B1014E5598BA440A910641F4@uw2b2dff239c4d> Hi Phil, Yes, that is an exact method (provided b is exact) and the code is straight forward indeed. As you say, it takes a while. That's why I try to use primitive log. In fact I use a method that computes the logarithms (base 10) of the numerator and nominator of rationals separately such as to avoid -inf.0 for (positive) rational numbers very close to zero (not shown in my example) We have something like integer-sqrt/remainder for square roots. It would be nice to have something like (integer-log-base-10/remainder n) --> p r such that (+ (expt 10 p) r) exactly equals n, where n, p and r are positive exact integer numbers and p is computed to be maximal. Jos ----- Original Message ----- From: Phil Bewig To: Jos Koot Cc: plt-scheme@list.cs.brown.edu Sent: Thursday, November 05, 2009 4:02 PM Subject: Re: [plt-scheme] order of magnitude (define (ilog b n) ? (let loop ((n n) (i -1)) ? ? ? (if (zero? n) i ? ? ? ? ? (loop (quotient n b) (+ i 1))))) (ilog 10 #e1000e1000000) => 1000003 It does take a while.... On Thu, Nov 5, 2009 at 5:04 AM, Jos Koot wrote: Some browsing did not lead me to finding a function that accepts an exact positive rational number and returns its order of magnitude (an exact integer number) Something like: (define log10 (inexact->exact (log 10))) (define (order-of-magnitude q) (floor (/ (inexact->exact (log q)) log10))) However, due to inexactness of function log we find: (/ (inexact->exact (log #e1000e1000000)) log10) --> close to but sligtly less than 1000003 and hence: (order-of-magnitude #e1000e1000000) ; --> 1000002 The wanted answer is 1000003. So I did the following: (define order-of-magnitude ? (let* ? ((log10 (inexact->exact (log 10))) ? ? (10log (?? (q) (/ (inexact->exact (log q)) log10)))) ? (?? (q) ? ? (unless (and (rational? q) (exact? q) (positive? q)) ? ? ? (raise-type-error 'magnitude "positive exact rational number" q)) ? ? (let* ((m (floor (10log q))) (k (expt 10 m))) ? ? ? ; From now on all arithmetic operations and their operands are exact. ? ? ? (let loop ((m m) (lower (* k 1/10)) (middle k) (upper (* k 10))) ? ? ? ? (cond ? ? ? ? ? ((<= q lower) (loop (sub1 m) (* lower 1/10) lower middle)) ? ? ? ? ? ((>= q upper) (loop (add1 m) middle upper (* upper 10))) ? ? ? ? ? (else m))))))) (order-of-magnitude #e1000e1000000) ; --> 1000003 However, this seems rather complicated. Does someone have or know of a simpler and faster function for this purpose? Thanks, Jos _________________________________________________ ? For list-related administrative tasks: ? http://list.cs.brown.edu/mailman/listinfo/plt-scheme -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091105/5e999f83/attachment.htm From ebellani at gmail.com Thu Nov 5 10:37:15 2009 From: ebellani at gmail.com (Eduardo Bellani) Date: Thu Nov 5 10:37:37 2009 Subject: [plt-scheme] hide "welcome to drscheme" In-Reply-To: <932b2f1f0911050658t6cae3ec0t12c0b08a37de288c@mail.gmail.com> References: <4AF09DA7.6010401@cs.utah.edu> <595b9ab20911041559j334c5d5ei8d6a000c876860c1@mail.gmail.com> <4AF2CA90.4020704@neilvandyke.org> <4AF2D26B.4000704@neilvandyke.org> <932b2f1f0911050542i5704e72q74240b75736ce562@mail.gmail.com> <4AF2E3A9.5040002@neilvandyke.org> <932b2f1f0911050658t6cae3ec0t12c0b08a37de288c@mail.gmail.com> Message-ID: <184222e50911050737v58ed4057hb80d233c88cb853c@mail.gmail.com> > Were there others you were missing? For me is not so much the shorcuts, but the line numbers. Those are very important to me for testing and other purposes. I would prefer something like vim (my editor for all things non schemy) where the line numbers are in in a left column, or at least that info could be displayed independently of the toolbar. -- Eduardo Bellani www.cnxs.com.br I object to doing things that computers can do. - Olin Shivers From laurent.orseau at gmail.com Thu Nov 5 10:39:01 2009 From: laurent.orseau at gmail.com (Laurent) Date: Thu Nov 5 10:39:43 2009 Subject: [plt-scheme] order of magnitude In-Reply-To: <61575FB2B1014E5598BA440A910641F4@uw2b2dff239c4d> References: <3835C661C42741E8826015E46A483E43@uw2b2dff239c4d> <61575FB2B1014E5598BA440A910641F4@uw2b2dff239c4d> Message-ID: Would it be possible to use the log method as a first approximation, take the number that is 1 or 2 orders lower, then use the iteration method on only the last few iterations? Laurent 2009/11/5 Jos Koot > Hi Phil, > > Yes, that is an exact method (provided b is exact) and the code is straight > forward indeed. As you say, it takes a while. That's why I try to use > primitive log. In fact I use a method that computes the logarithms (base > 10) of the numerator and nominator of rationals separately such as to avoid > -inf.0 for (positive) rational numbers very close to zero (not shown in my > example) > > We have something like integer-sqrt/remainder for square roots. It would > be nice to have something like (integer-log-base-10/remainder n) --> p r such > that (+ (expt 10 p) r) exactly equals n, where n, p and r are positive exact > integer numbers and p is computed to be maximal. > > Jos > > ----- Original Message ----- > *From:* Phil Bewig > *To:* Jos Koot > *Cc:* plt-scheme@list.cs.brown.edu > *Sent:* Thursday, November 05, 2009 4:02 PM > *Subject:* Re: [plt-scheme] order of magnitude > > (define (ilog b n) > ? (let loop ((n n) (i -1)) > ? ? ? (if (zero? n) i > ? ? ? ? ? (loop (quotient n b) (+ i 1))))) > > (ilog 10 #e1000e1000000) => 1000003 > > It does take a while.... > > On Thu, Nov 5, 2009 at 5:04 AM, Jos Koot wrote: > >> Some browsing did not lead me to finding a function that accepts an exact >> positive rational number and returns its order of magnitude (an exact >> integer number) Something like: >> >> (define log10 (inexact->exact (log 10))) >> (define (order-of-magnitude q) (floor (/ (inexact->exact (log q)) log10))) >> >> However, due to inexactness of function log we find: >> >> (/ (inexact->exact (log #e1000e1000000)) log10) --> close to but sligtly >> less than 1000003 >> >> and hence: >> >> (order-of-magnitude #e1000e1000000) ; --> 1000002 >> >> The wanted answer is 1000003. So I did the following: >> >> (define order-of-magnitude >> ? (let* >> ? ((log10 (inexact->exact (log 10))) >> ? ? (10log (?? (q) (/ (inexact->exact (log q)) log10)))) >> ? (?? (q) >> ? ? (unless (and (rational? q) (exact? q) (positive? q)) >> ? ? ? (raise-type-error 'magnitude "positive exact rational number" q)) >> ? ? (let* ((m (floor (10log q))) (k (expt 10 m))) >> ? ? ? ; >From now on all arithmetic operations and their operands are >> exact. >> ? ? ? (let loop ((m m) (lower (* k 1/10)) (middle k) (upper (* k 10))) >> ? ? ? ? (cond >> ? ? ? ? ? ((<= q lower) (loop (sub1 m) (* lower 1/10) lower middle)) >> ? ? ? ? ? ((>= q upper) (loop (add1 m) middle upper (* upper 10))) >> ? ? ? ? ? (else m))))))) >> >> >> (order-of-magnitude #e1000e1000000) ; --> 1000003 >> >> However, this seems rather complicated. Does someone have or know of a >> simpler and faster function for this purpose? >> >> Thanks, Jos >> >> _________________________________________________ >> ? For list-related administrative tasks: >> ? http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091105/0da64856/attachment.htm From jensaxel at soegaard.net Thu Nov 5 11:11:25 2009 From: jensaxel at soegaard.net (=?UTF-8?Q?Jens_Axel_S=C3=B8gaard?=) Date: Thu Nov 5 11:17:41 2009 Subject: [plt-scheme] order of magnitude In-Reply-To: References: <3835C661C42741E8826015E46A483E43@uw2b2dff239c4d> <4072c51f0911050412m5b857051x302a65e45caf6a23@mail.gmail.com> <4E05A96006124271B1657C082811C62E@uw2b2dff239c4d> <4072c51f0911050429l5e0dc838x59de9bae6ee95a5f@mail.gmail.com> <5453527134174413AB4C055E7D8A1436@uw2b2dff239c4d> <4072c51f0911050558n7bf686ffkf375b8e940fabbff@mail.gmail.com> Message-ID: <4072c51f0911050811y18ac103br71676844b01817c0@mail.gmail.com> 2009/11/5 Jos Koot : > Mathematically your derivation is correct, but computationally it may be > incorrect. The problem is that in an actual computation, e.g. in Scheme, > > (expt 10 (/ (log q) (log 10))) > > may be > slightly ?less than q > or exactly equal to q > or slightly greater than q. > > This holds even when q is exact, for log is not required to and often even > cannot produce an exact result. In fact I do not even trust that the > absolute error of (/ (log q) (log 10)) is allways less than one, where > absolute error is the difference between mathematical value and actually > computed value. Now I see what you were worried about. The following solution uses nothing but exact computations. The time complexity is the same as your solution. (define (order q) (define (bisection-search m 10^m n 10^n) (cond [(= m n) m] [(= (+ m 1) n) (if (> 10^n q) m n)] [else (let* ([t (quotient (+ m n) 2)] [10^t (* 10^m (expt 10 (- t m)))]) (if (> 10^t q) (bisection-search m 10^m t 10^t) (bisection-search t 10^t n 10^n)))])) (define (find-upper-limit m 10^m) (let ([10^2m (* 10^m 10^m)]) (if (> 10^2m q) (bisection-search m 10^m (* 2 m) 10^2m) (find-upper-limit (* 2 m) 10^2m)))) (find-upper-limit 1 10)) NB: I was toying with integer-length to start the search, but it made very little difference. From robby at eecs.northwestern.edu Thu Nov 5 11:21:54 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Nov 5 11:22:15 2009 Subject: [plt-scheme] hide "welcome to drscheme" In-Reply-To: <184222e50911050737v58ed4057hb80d233c88cb853c@mail.gmail.com> References: <4AF09DA7.6010401@cs.utah.edu> <4AF2CA90.4020704@neilvandyke.org> <4AF2D26B.4000704@neilvandyke.org> <932b2f1f0911050542i5704e72q74240b75736ce562@mail.gmail.com> <4AF2E3A9.5040002@neilvandyke.org> <932b2f1f0911050658t6cae3ec0t12c0b08a37de288c@mail.gmail.com> <184222e50911050737v58ed4057hb80d233c88cb853c@mail.gmail.com> Message-ID: <932b2f1f0911050821l5b8401a4v82ff56f902b16eb2@mail.gmail.com> Yes, that one has been asked for before, but with our current gui toolkit, it's not trivial. If you wanted to design a text% mixin that did that, I'd put it into drscheme. Robby On Thu, Nov 5, 2009 at 9:37 AM, Eduardo Bellani wrote: >> Were there others you were missing? > > For me is not so much the shorcuts, but the line numbers. Those are > very important > to me for testing and other purposes. I would prefer something like > vim (my editor for > all things non schemy) where the line numbers are in in a left column, > or at least that > info could be displayed independently of the toolbar. > > -- > Eduardo Bellani > > www.cnxs.com.br > > I object to doing things that computers can do. > - Olin Shivers > From jos.koot at telefonica.net Thu Nov 5 10:51:19 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Nov 5 11:40:30 2009 Subject: [plt-scheme] order of magnitude References: <3835C661C42741E8826015E46A483E43@uw2b2dff239c4d> <61575FB2B1014E5598BA440A910641F4@uw2b2dff239c4d> Message-ID: I guess that's exactly what I showed in my first post in this thread. However, notice that in my post to Phil, I reduced the problem to taking floors of base 10 logarithms of exact positive integers. For a positive exact rational, take the difference between the floors of the base 10 logarithms of the numerator and denominator, and subsequently iterate in order to overcome inaccuracy. However, these iterations, few as they may be, may require exact computations on very large integer numbers. That makes them slow. I have a method that works and can be proven to be correct. I started this thread, because I wondered whether or not it is possible to do the computation in a more efficient way. Jos ----- Original Message ----- From: Laurent To: Jos Koot Cc: Phil Bewig ; plt-scheme@list.cs.brown.edu Sent: Thursday, November 05, 2009 4:39 PM Subject: Re: [plt-scheme] order of magnitude Would it be possible to use the log method as a first approximation, take the number that is 1 or 2 orders lower, then use the iteration method on only the last few iterations? Laurent 2009/11/5 Jos Koot Hi Phil, Yes, that is an exact method (provided b is exact) and the code is straight forward indeed. As you say, it takes a while. That's why I try to use primitive log. In fact I use a method that computes the logarithms (base 10) of the numerator and nominator of rationals separately such as to avoid -inf.0 for (positive) rational numbers very close to zero (not shown in my example) We have something like integer-sqrt/remainder for square roots. It would be nice to have something like (integer-log-base-10/remainder n) --> p r such that (+ (expt 10 p) r) exactly equals n, where n, p and r are positive exact integer numbers and p is computed to be maximal. Jos ----- Original Message ----- From: Phil Bewig To: Jos Koot Cc: plt-scheme@list.cs.brown.edu Sent: Thursday, November 05, 2009 4:02 PM Subject: Re: [plt-scheme] order of magnitude (define (ilog b n) ? (let loop ((n n) (i -1)) ? ? ? (if (zero? n) i ? ? ? ? ? (loop (quotient n b) (+ i 1))))) (ilog 10 #e1000e1000000) => 1000003 It does take a while.... On Thu, Nov 5, 2009 at 5:04 AM, Jos Koot wrote: Some browsing did not lead me to finding a function that accepts an exact positive rational number and returns its order of magnitude (an exact integer number) Something like: (define log10 (inexact->exact (log 10))) (define (order-of-magnitude q) (floor (/ (inexact->exact (log q)) log10))) However, due to inexactness of function log we find: (/ (inexact->exact (log #e1000e1000000)) log10) --> close to but sligtly less than 1000003 and hence: (order-of-magnitude #e1000e1000000) ; --> 1000002 The wanted answer is 1000003. So I did the following: (define order-of-magnitude ? (let* ? ((log10 (inexact->exact (log 10))) ? ? (10log (?? (q) (/ (inexact->exact (log q)) log10)))) ? (?? (q) ? ? (unless (and (rational? q) (exact? q) (positive? q)) ? ? ? (raise-type-error 'magnitude "positive exact rational number" q)) ? ? (let* ((m (floor (10log q))) (k (expt 10 m))) ? ? ? ; >From now on all arithmetic operations and their operands are exact. ? ? ? (let loop ((m m) (lower (* k 1/10)) (middle k) (upper (* k 10))) ? ? ? ? (cond ? ? ? ? ? ((<= q lower) (loop (sub1 m) (* lower 1/10) lower middle)) ? ? ? ? ? ((>= q upper) (loop (add1 m) middle upper (* upper 10))) ? ? ? ? ? (else m))))))) (order-of-magnitude #e1000e1000000) ; --> 1000003 However, this seems rather complicated. Does someone have or know of a simpler and faster function for this purpose? Thanks, Jos _________________________________________________ ? For list-related administrative tasks: ? http://list.cs.brown.edu/mailman/listinfo/plt-scheme _________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-scheme -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091105/a56e8328/attachment.htm From david.storrs at gmail.com Thu Nov 5 11:47:17 2009 From: david.storrs at gmail.com (David Storrs) Date: Thu Nov 5 11:47:36 2009 Subject: [plt-scheme] session info in web server applications In-Reply-To: References: <904774730911041720x5d79b88du5323c075110304a5@mail.gmail.com> Message-ID: On Thu, Nov 5, 2009 at 5:06 AM, Jay McCarthy wrote: > The standard thing [for sessions] is to use a parameter that the > continuation > captures (in the URL) and a cookie that the browser holds as an > authenticator. In the FAQ I link to something that talks about doing > cookies as authenticators correctly. > > Jay > This is enough of a FAQ that it should probably be a standard web-server module. I can take a look at our code base and see if the auth / session parts can be easily packaged up and contributed back to core, or if they are too wound into our business logic. Assuming they can be broken out, what's the best way to get the code to you, Jay? Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091105/c0b99309/attachment.htm From clements at brinckerhoff.org Thu Nov 5 12:51:59 2009 From: clements at brinckerhoff.org (John Clements) Date: Thu Nov 5 12:52:20 2009 Subject: Twee English Literature (was: Re: [plt-scheme] Wishes for the PLaneT) In-Reply-To: References: <4AE9D356.1000200@cs.utah.edu> Message-ID: On Nov 5, 2009, at 2:46 AM, Martin DeMello wrote: > On Tue, Nov 3, 2009 at 1:53 AM, David Storrs > wrote: >> >> So...that would be a list of unlisted items? ;> > > http://www.amazon.com/Uncollected-Wodehouse-P-G/dp/1558821198 amused > me when it first came out :) Just how many Wodehouse fans do we *have* around here? Anyone else here tormenting their children with Arthur Ransome books? Totally off-topic, sorry. John Clements -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2484 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091105/744525ae/smime.bin From jay.mccarthy at gmail.com Thu Nov 5 13:19:40 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Nov 5 13:27:31 2009 Subject: [plt-scheme] session info in web server applications In-Reply-To: References: <904774730911041720x5d79b88du5323c075110304a5@mail.gmail.com> Message-ID: Email =) Jay On Thu, Nov 5, 2009 at 5:47 PM, David Storrs wrote: > > > On Thu, Nov 5, 2009 at 5:06 AM, Jay McCarthy wrote: >> >> The standard thing [for sessions] is to use a parameter that the >> continuation >> captures (in the URL) and a cookie that the browser holds as an >> authenticator. In the FAQ I link to something that talks about doing >> cookies as authenticators correctly. >> >> Jay > > This is enough of a FAQ that it should probably be a standard web-server > module.? I can take a look at our code base and see if the auth / session > parts can be easily packaged up and contributed back to core, or if they are > too wound into our business logic.? Assuming they can be broken out, what's > the best way to get the code to you, Jay? > > Dave > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From brauer at nordakademie.de Thu Nov 5 14:37:30 2009 From: brauer at nordakademie.de (Dr. Johannes Brauer) Date: Thu Nov 5 14:37:49 2009 Subject: [plt-scheme] version 4 (4.1.3) newbie question In-Reply-To: <4072c51f0911050424i44a2170em798820a90a053ff4@mail.gmail.com> References: <86FC6AE2-23BE-4A3C-A0DF-3187CDBDDF26@nordakademie.de> <4072c51f0911050424i44a2170em798820a90a053ff4@mail.gmail.com> Message-ID: <152C0DBE-0604-4640-93D9-5A2419FF5A6D@nordakademie.de> thanks for the elaborate explamations, some issues I figured out myself in the meantime but ... Am 05.11.2009 um 13:24 schrieb Jens Axel S?gaard: > 2009/11/3 Johannes Brauer : > > There are two different kinds of lists. > The ones made with (good old) mutable cons-cells > the new ones which are immutable. > >> #lang scheme > This says that ' should produce the kind of lists > used in the the "scheme" language. That ' produces > immutable cons cells. > > The filter in "scheme" expects immutable cells > so this ought to work fine. > >> (require r5rs/init) > > But here you import the filter function from the language "r5rs/init". > This filter function expects mutable cons-cells. > >> (list? (cons 1 '())) >> (filter (lambda (x) (> x 5)) '(3 5 6 7)) > > Here filter (the one expecting mutable cons-cells) > is called with a list consisting of immutable cons-cells > giving an error. > > That is, the functions in "scheme" and "r5rs" is difficult to mix. > > The easiest way to fix your program is to find out which PLT > library where equivalent of the functions in r5rs/init you need is > defined. For most functions, just search for the function name > in the Help Desk. ...until now I could not found a "configuration" which makes my little 3.7-application running. It uses set-car!, set-cdr!, assoc, filter, one of them is complaining, however. Johannes Staatlich anerkannte private Fachhochschule NORDAKADEMIE Gemeinn?tzige Aktiengesellschaft K?llner Chaussee 11 25337 Elmshorn Vorstand: Prof. Dr. Georg Plate (Vorsitzender), Dipl.-Ing. J?rg Meier (stellv. Vorstand) Vorsitzender des Aufsichtsrats: Dr. h.c. Hans-Heinrich Bruns Sitz: Elmshorn, Amtsgericht Elmshorn, HRB 1682 From jos.koot at telefonica.net Thu Nov 5 18:23:47 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Nov 5 19:42:19 2009 Subject: [plt-scheme] order of magnitude References: <3835C661C42741E8826015E46A483E43@uw2b2dff239c4d> <4072c51f0911050412m5b857051x302a65e45caf6a23@mail.gmail.com> <4E05A96006124271B1657C082811C62E@uw2b2dff239c4d> <4072c51f0911050429l5e0dc838x59de9bae6ee95a5f@mail.gmail.com> <5453527134174413AB4C055E7D8A1436@uw2b2dff239c4d> <4072c51f0911050558n7bf686ffkf375b8e940fabbff@mail.gmail.com> <4072c51f0911050811y18ac103br71676844b01817c0@mail.gmail.com> Message-ID: <5CF67DE1904D4676BED5CAC91E22F046@uw2b2dff239c4d> Jens, Interesting, but as time complexity is the same, I prefer to use the difference between the base 10 logarithm of the numerator and denominator as a first guess. In this way I use the wisdom of the mathematicians/programmers of the log function for a fast first guess. My experience is that this first guess seldomly has an absolute error greater than 1 (in fact I never encountered a greater error in PLT (provided the argument is exact)) This means I need (only counting operations on or producing possibly very big cq very small positive numbers) 1 time numerator/denominator 2 times log 1 time expt 2 to 4 times <= cq >= 2 to 3 times * At first sight it seems to me that your method works for q>=10 only (e.g with your function (order 1/1000) --> 1, which should be -3 and (order 1) --> 1, which should be 0 and (order #e9.99999999999999999) --> 1, which should be 0 too) Jos Robby A proposal is coming up soon. I have to extract it from a more specialized piece of code. And BTW, you certainly are not a PITA :) Jos All Thanks to all who replied or otherwise showed interest to my question. Jos ----- Original Message ----- From: "Jens Axel S?gaard" To: "Jos Koot" Cc: Sent: Thursday, November 05, 2009 5:11 PM Subject: Re: [plt-scheme] order of magnitude 2009/11/5 Jos Koot : > Mathematically your derivation is correct, but computationally it may be > incorrect. The problem is that in an actual computation, e.g. in Scheme, > > (expt 10 (/ (log q) (log 10))) > > may be > slightly less than q > or exactly equal to q > or slightly greater than q. > > This holds even when q is exact, for log is not required to and often even > cannot produce an exact result. In fact I do not even trust that the > absolute error of (/ (log q) (log 10)) is allways less than one, where > absolute error is the difference between mathematical value and actually > computed value. Now I see what you were worried about. The following solution uses nothing but exact computations. The time complexity is the same as your solution. (define (order q) (define (bisection-search m 10^m n 10^n) (cond [(= m n) m] [(= (+ m 1) n) (if (> 10^n q) m n)] [else (let* ([t (quotient (+ m n) 2)] [10^t (* 10^m (expt 10 (- t m)))]) (if (> 10^t q) (bisection-search m 10^m t 10^t) (bisection-search t 10^t n 10^n)))])) (define (find-upper-limit m 10^m) (let ([10^2m (* 10^m 10^m)]) (if (> 10^2m q) (bisection-search m 10^m (* 2 m) 10^2m) (find-upper-limit (* 2 m) 10^2m)))) (find-upper-limit 1 10)) NB: I was toying with integer-length to start the search, but it made very little difference. ----- Original Message ----- From: "Robby Findler" To: "Jos Koot" Cc: "Matthew Flatt" ; "Eli Barzilay" ; "Matthias Felleisen" Sent: Thursday, November 05, 2009 5:20 PM Subject: Re: [plt-scheme] order of magnitude Not to be a PITA, but I guess that you, Jos, would probably be one of the best equipped people to write such a function and I'm sure we could get it put into scheme/math if you were to. Robby From ccwu660601 at gmail.com Fri Nov 6 00:25:35 2009 From: ccwu660601 at gmail.com (ccwu) Date: Fri Nov 6 00:25:53 2009 Subject: [plt-scheme] Why is (require (planet untyped/snooze:2) so slow? Message-ID: <7089fbea-f6dd-4718-b970-4ec604cc9bc2@y28g2000prd.googlegroups.com> Hi, I noticed that (require (planet untyped/snooze:2)) is slow. Is it always trying to get codes from internet? Or is it compiling itself every times? How can I reduce the loading time of (require (planet... Thank in advance. From carl.eastlund at gmail.com Fri Nov 6 01:00:29 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Fri Nov 6 01:01:07 2009 Subject: [plt-scheme] Why is (require (planet untyped/snooze:2) so slow? In-Reply-To: <7089fbea-f6dd-4718-b970-4ec604cc9bc2@y28g2000prd.googlegroups.com> References: <7089fbea-f6dd-4718-b970-4ec604cc9bc2@y28g2000prd.googlegroups.com> Message-ID: <990e0c030911052200h44cbe240peffadeb5d3effde8@mail.gmail.com> On Fri, Nov 6, 2009 at 12:25 AM, ccwu wrote: > Hi, > > I noticed that (require (planet untyped/snooze:2)) is slow. Is it > always trying to get codes from internet? Or is it compiling itself > every times? > > How can I reduce the loading time of (require (planet... > > Thank in advance. It's not slow for me, after the package is installed. It takes about a second, maybe two, to run in DrScheme. But the first time you run it, on a particular version of DrScheme and a particular computer, it will have to download, install, and compile the package. That can take several minutes. Make sure that you let it install all the way, too. If you stop it in the middle, Planet can get stuck in an inconsistent state where it doesn't compile all the way, and has to recompile every time you run. If you think you're stuck in this state, there's two things to try. One, run 'setup-plt' at the command line. Then start DrScheme up again and see if the require runs faster. Two, if that doesn't work, run 'planet remove untyped snooze.plt 2 <#>' (where <#> is the minor version number of your snooze.plt package), then 'planet install untyped snooze.plt 2 0' to install it again. (Don't worry about the 0 there, it'll grab the highest 2.X available.) Good luck! --Carl From yinso.chen at gmail.com Fri Nov 6 02:12:37 2009 From: yinso.chen at gmail.com (YC) Date: Fri Nov 6 02:13:00 2009 Subject: bzlib/dbi updated ==> Re: [plt-scheme] bzlib/dbi error trying to insert a null value Message-ID: <779bf2730911052312y5bb1c7c4w7bba0ae46e790ad4@mail.gmail.com> Hi all - I have incorporate unifying side effects & last inserted id into bzlib/dbi for spgsql, jsqlite, and jazmysql, and make the changes available via planet. You can find the details at http://weblambda.blogspot.com/2009/11/latest-dbiplt-available-handling-last.html- enjoy. Cheers, yc On Wed, Nov 4, 2009 at 4:52 PM, YC wrote: > Okay - after some seriously thinking about the issue of last-insert-id & > side effects, below are my ideas and would love some feedbacks: > > *Side Effect Data Structure > * > There are 3 options here: > > 1. return the underlying side-effect (and re-export the necessary > bindings) for each of the drivers > 2. provide my own unified side-effect object and convert the underling > side-effect object onto the first one > 3. convert the side effect into a record set structure (so you do not > need to test whether it's a side effect struct) > > The first option's advantage is that if you already have extensive side > effect testing code you do not have to change much. The drawback is that > you'll have more headache/effort to switch between the databases. > > The second option's advantage is the reverse of the first one - you'll > break current code, but you reduce one effort to switch between databases. > > The third option unifies the split between record set & side effects. Its > advantage is that it removes your need to test the type of the return, but > the disadvantage is the access of the result is a bit harder. > > I can of course provide all 3 approaches, but would be nice to reduce it > down. Any thoughts on which one is the best? My personal thought is #2 or > #3 (I love the unification aspect of #3 but know this is not generally how > it is done). > > *Last Inserted ID > * > There are some general issues with last-inserted-id > > 1. it doesn't work for multiple record inserts at the database level > 1. all databases only return a single value even if you insert multiple > records into a table at once > 2. mysql returns the id for the first record inserted in such case > (this feels incorrect) > 3. sqlite returns the id for the last record inserted in such case > 2. postgresql is difficult requires you to know the name of the > particular sequence object to get the value > > Although it does not always work, the fact that single record insert is the > majority of the usage makes it useful, and in that case, I think the design > employed by jaz/mysql is the correct one - i.e. *return the value as part > of the side effect*, regardless which particular options chosen above. > > Both jaz/mysql & jaymccarthy/sqlite provides the api to allow this, but not > schematics/spgsql. This is for the reason stated above that you'll need to > know (or derive the sequence) the sequence name in order to determine the > value, and that this needs to be done with a separate query (which can slow > things down if you do not need the id). > > My question here: should I provide the last-inserted-id for spgsql given > the constraints? Or just jazmysql & jsqlite? > > I plan on making the changes by next week - so any feedback prior to that > would be welcome. > > Thanks, > yc > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091105/d6b7ea1c/attachment-0001.htm From eric at swenson.org Fri Nov 6 02:15:04 2009 From: eric at swenson.org (Eric Swenson) Date: Fri Nov 6 02:22:19 2009 Subject: [plt-scheme] new rotate function in 2htdp/image Message-ID: I'd like to be able to use the new "rotate" function in 2htdp/image in a big-bang simulation. So far, I've been unable to figure out how to do this. If I simply use #lang scheme (require 2htdp/universe) I can successfully use big-bang but the new "rotate" is not available (this, despite the fact that it seems like universe causes the private/image-more.ss module to get loaded). If I try to do this: #lang scheme (require 2htdp/universe) (require 2htdp/image) I get this error: module: identifier already imported from a different source in: rectangle 2htdp/image 2htdp/universe If I do this: #lang scheme (require 2htdp/image) then "rotate" is available and works fine, but "big-bang" is not available. I can't seem to get the combination of "universe" and the new additions to "image" to work together. Can anyone offer a hand? Thanks. -- Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091105/31c0818c/attachment.htm From martindemello at gmail.com Fri Nov 6 04:22:19 2009 From: martindemello at gmail.com (Martin DeMello) Date: Fri Nov 6 04:22:37 2009 Subject: Twee English Literature (was: Re: [plt-scheme] Wishes for the PLaneT) In-Reply-To: References: <4AE9D356.1000200@cs.utah.edu> Message-ID: On Thu, Nov 5, 2009 at 11:21 PM, John Clements wrote: > > > Just how many Wodehouse fans do we *have* around here? > > Anyone else here tormenting their children with Arthur Ransome books? > > Totally off-topic, sorry. I'll grant you Ransome, though I still enjoy his stuff, but I take exception to Wodehouse being called twee! Parentheses at ten paces, bring your seconds^H^H^H^H^H^H^Hcadrs! m. From d.j.gurnell at gmail.com Fri Nov 6 04:48:07 2009 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Fri Nov 6 04:48:30 2009 Subject: [plt-scheme] session info in web server applications In-Reply-To: References: <904774730911041720x5d79b88du5323c075110304a5@mail.gmail.com> Message-ID: <0FD5FECE-A181-43EF-9BF6-BEBEF87A8125@gmail.com> FWIW: We've put together a simple little library for this called "session cells": - cookie stores a random "session ID"; - each session cell is a struct with a "cell ID" in it; - there's a global hash table of session IDs to "session tables"; - a session table is a hash of cell IDs to values. I like this solution for the simplicity of the interface and the consistency with web cells. Two things that require careful thought: - setting up the session cookie (a dispatcher stage would be good for this); - garbage collection (we use a several hour timeout... there may be a better approach). Our code is all rolled up as part of a larger web toolkit but it wouldn't take long to extract if you're interested. -- Dave Jay McCarthy wrote: > Email =) > > Jay > > On Thu, Nov 5, 2009 at 5:47 PM, David Storrs > wrote: >> >> >> On Thu, Nov 5, 2009 at 5:06 AM, Jay McCarthy >> wrote: >>> >>> The standard thing [for sessions] is to use a parameter that the >>> continuation >>> captures (in the URL) and a cookie that the browser holds as an >>> authenticator. In the FAQ I link to something that talks about doing >>> cookies as authenticators correctly. >>> >>> Jay >> >> This is enough of a FAQ that it should probably be a standard web- >> server >> module. I can take a look at our code base and see if the auth / >> session >> parts can be easily packaged up and contributed back to core, or if >> they are >> too wound into our business logic. Assuming they can be broken >> out, what's >> the best way to get the code to you, Jay? >> >> Dave >> > > > > -- > Jay McCarthy > Assistant Professor / Brigham Young University > http://teammccarthy.org/jay > > "The glory of God is Intelligence" - D&C 93 > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From robby at eecs.northwestern.edu Fri Nov 6 07:08:17 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Fri Nov 6 07:08:38 2009 Subject: [plt-scheme] new rotate function in 2htdp/image In-Reply-To: References: Message-ID: <932b2f1f0911060408o6d5ad85fmaa6fb2316456e5f8@mail.gmail.com> The current 2htdp/universe does not use 2htdp/image (it instead uses htdp/image). The 2htdp/image library is still pretty new and missing lots of image primitives. I hope to get more of them going soon and probably after that 2htdp/universe will switch over to using 2htdp/image. In the meantime, if all you want to do is program with images (but not use the world or universe stuff), you can just require 2htdp/image by itself. hth, Robby On Fri, Nov 6, 2009 at 1:15 AM, Eric Swenson wrote: > I'd like to be able to use the new "rotate" function in 2htdp/image in a > big-bang simulation. So far, I've been unable to figure out how to do this. > ?If I simply use > #lang scheme > (require 2htdp/universe) > I can successfully use big-bang but the new "rotate" is not available (this, > despite the fact that it seems like universe causes the > private/image-more.ss module to get loaded). > If I try to do this: > #lang scheme > (require 2htdp/universe) > (require 2htdp/image) > I get this error: > ?module: identifier already imported from a different source in: > ??rectangle > ??2htdp/image > ??2htdp/universe > If I do this: > #lang scheme > (require 2htdp/image) > then "rotate" is available and works fine, but "big-bang" is not available. > ?I can't seem to get the combination of "universe" and the new additions to > "image" to work together. > Can anyone offer a hand? > Thanks. -- Eric > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From ebzzry at gmail.com Fri Nov 6 08:00:47 2009 From: ebzzry at gmail.com (Rommel M. Martinez) Date: Fri Nov 6 08:01:33 2009 Subject: [plt-scheme] Cookie handling Message-ID: <391934950911060500o1a8a9090h2b9315f9d7016bad@mail.gmail.com> Aside from what's available in the base PLT distribution, are there other cookie handling facilities (preferably higher-level than what's in base) available? I'm looking for something that would easily integrate with the existing servlet-based mechanisms. -- Rommel M. Martinez http://www.bespin.org/~ebzzry From david.storrs at gmail.com Fri Nov 6 08:08:00 2009 From: david.storrs at gmail.com (David Storrs) Date: Fri Nov 6 08:08:21 2009 Subject: [plt-scheme] session info in web server applications In-Reply-To: <0FD5FECE-A181-43EF-9BF6-BEBEF87A8125@gmail.com> References: <904774730911041720x5d79b88du5323c075110304a5@mail.gmail.com> <0FD5FECE-A181-43EF-9BF6-BEBEF87A8125@gmail.com> Message-ID: On Fri, Nov 6, 2009 at 9:48 AM, Dave Gurnell wrote: > FWIW: We've put together a simple little library for this called "session > cells": > > - cookie stores a random "session ID"; > - each session cell is a struct with a "cell ID" in it; > > - there's a global hash table of session IDs to "session tables"; > - a session table is a hash of cell IDs to values. > > I like this solution for the simplicity of the interface and the > consistency with web cells. > Two things that require careful thought: > > - setting up the session cookie (a dispatcher stage would be good for > this); > - garbage collection (we use a several hour timeout... there may be a > better approach). > > Our code is all rolled up as part of a larger web toolkit but it wouldn't > take long to extract > if you're interested. > > -- Dave > Sounds good; quite possibly better than our solution. If you have time to extract / package / submit it, I'll gladly leave pride of place to you. We're an unfunded startup, so finding even a couple of hours is a bit of a scramble. Dave K -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091106/847cd6e4/attachment.htm From toddobryan at gmail.com Fri Nov 6 09:03:48 2009 From: toddobryan at gmail.com (Todd O'Bryan) Date: Fri Nov 6 09:04:11 2009 Subject: [plt-scheme] session info in web server applications In-Reply-To: <0FD5FECE-A181-43EF-9BF6-BEBEF87A8125@gmail.com> References: <904774730911041720x5d79b88du5323c075110304a5@mail.gmail.com> <0FD5FECE-A181-43EF-9BF6-BEBEF87A8125@gmail.com> Message-ID: <904774730911060603s497d8b39veb9d822b001a46f5@mail.gmail.com> Something like this would be lovely. If you have time to make it available, that would be great. I feel like I spend all my time asking this group for help without providing much back, but every time I get a chance to start writing code again, I get distracted by writing a test, or grading a test, or writing a project, or grading a project, or ... you get the picture. Todd On Fri, Nov 6, 2009 at 4:48 AM, Dave Gurnell wrote: > FWIW: We've put together a simple little library for this called "session > cells": > > ?- cookie stores a random "session ID"; > ?- each session cell is a struct with a "cell ID" in it; > > ?- there's a global hash table of session IDs to "session tables"; > ?- a session table is a hash of cell IDs to values. > > I like this solution for the simplicity of the interface and the consistency > with web cells. > Two things that require careful thought: > > ?- setting up the session cookie (a dispatcher stage would be good for > this); > ?- garbage collection (we use a several hour timeout... there may be a > better approach). > > Our code is all rolled up as part of a larger web toolkit but it wouldn't > take long to extract > if you're interested. > > -- Dave > > Jay McCarthy wrote: > >> Email =) >> >> Jay >> >> On Thu, Nov 5, 2009 at 5:47 PM, David Storrs >> wrote: >>> >>> >>> On Thu, Nov 5, 2009 at 5:06 AM, Jay McCarthy >>> wrote: >>>> >>>> The standard thing [for sessions] is to use a parameter that the >>>> continuation >>>> captures (in the URL) and a cookie that the browser holds as an >>>> authenticator. In the FAQ I link to something that talks about doing >>>> cookies as authenticators correctly. >>>> >>>> Jay >>> >>> This is enough of a FAQ that it should probably be a standard web-server >>> module. ?I can take a look at our code base and see if the auth / session >>> parts can be easily packaged up and contributed back to core, or if they >>> are >>> too wound into our business logic. ?Assuming they can be broken out, >>> what's >>> the best way to get the code to you, Jay? >>> >>> Dave >>> >> >> >> >> -- >> Jay McCarthy >> Assistant Professor / Brigham Young University >> http://teammccarthy.org/jay >> >> "The glory of God is Intelligence" - D&C 93 >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From jay.mccarthy at gmail.com Fri Nov 6 09:34:46 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Fri Nov 6 09:35:13 2009 Subject: [plt-scheme] Cookie handling In-Reply-To: <391934950911060500o1a8a9090h2b9315f9d7016bad@mail.gmail.com> References: <391934950911060500o1a8a9090h2b9315f9d7016bad@mail.gmail.com> Message-ID: There is just http://docs.plt-scheme.org/web-server/http.html#(part._cookie) A slight wrapper around send/suspend and friends will do everything you want, I think. But patches/suggestions/requests/etc welcome. Jay On Fri, Nov 6, 2009 at 2:00 PM, Rommel M. Martinez wrote: > Aside from what's available in the base PLT distribution, are there other > cookie handling facilities (preferably higher-level than what's in base) > available? > > I'm looking for something that would easily integrate with the existing > servlet-based mechanisms. > > -- > Rommel M. Martinez > http://www.bespin.org/~ebzzry > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From d.j.gurnell at gmail.com Fri Nov 6 10:17:46 2009 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Fri Nov 6 10:18:08 2009 Subject: [plt-scheme] session info in web server applications In-Reply-To: <904774730911060603s497d8b39veb9d822b001a46f5@mail.gmail.com> References: <904774730911041720x5d79b88du5323c075110304a5@mail.gmail.com> <0FD5FECE-A181-43EF-9BF6-BEBEF87A8125@gmail.com> <904774730911060603s497d8b39veb9d822b001a46f5@mail.gmail.com> Message-ID: <8C66066F-3CC2-412A-8809-04D44D30794F@gmail.com> Todd O'Bryan wrote: > Something like this would be lovely. If you have time to make it > available, that would be great. > > I feel like I spend all my time asking this group for help without > providing much back, but every time I get a chance to start writing > code again, I get distracted by writing a test, or grading a test, or > writing a project, or grading a project, or ... you get the picture. > > Todd I'll package our stuff up this weekend and put it in our public SVN for people to critique. Link forthcoming. Cheers, -- Dave From david.storrs at gmail.com Fri Nov 6 10:28:57 2009 From: david.storrs at gmail.com (David Storrs) Date: Fri Nov 6 10:29:18 2009 Subject: [plt-scheme] session info in web server applications In-Reply-To: <8C66066F-3CC2-412A-8809-04D44D30794F@gmail.com> References: <904774730911041720x5d79b88du5323c075110304a5@mail.gmail.com> <0FD5FECE-A181-43EF-9BF6-BEBEF87A8125@gmail.com> <904774730911060603s497d8b39veb9d822b001a46f5@mail.gmail.com> <8C66066F-3CC2-412A-8809-04D44D30794F@gmail.com> Message-ID: On Fri, Nov 6, 2009 at 3:17 PM, Dave Gurnell wrote: > Todd O'Bryan wrote: > >> Something like this would be lovely. If you have time to make it >> available, that would be great. >> >> I feel like I spend all my time asking this group for help without >> providing much back, but every time I get a chance to start writing >> code again, I get distracted by writing a test, or grading a test, or >> writing a project, or grading a project, or ... you get the picture. >> >> Todd >> > > I'll package our stuff up this weekend and put it in our public SVN for > people to critique. > > Link forthcoming. > > Cheers, > > -- Dave Many thanks, OtherDave. :> Dave K -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091106/eac8c3f5/attachment.htm From david.storrs at gmail.com Fri Nov 6 10:30:49 2009 From: david.storrs at gmail.com (David Storrs) Date: Fri Nov 6 10:31:09 2009 Subject: [plt-scheme] session info in web server applications In-Reply-To: <904774730911060603s497d8b39veb9d822b001a46f5@mail.gmail.com> References: <904774730911041720x5d79b88du5323c075110304a5@mail.gmail.com> <0FD5FECE-A181-43EF-9BF6-BEBEF87A8125@gmail.com> <904774730911060603s497d8b39veb9d822b001a46f5@mail.gmail.com> Message-ID: On Fri, Nov 6, 2009 at 2:03 PM, Todd O'Bryan wrote: > Something like this would be lovely. If you have time to make it > available, that would be great. > > I feel like I spend all my time asking this group for help without > providing much back, but every time I get a chance to start writing > code again, I get distracted by writing a test, or grading a test, or > writing a project, or grading a project, or ... you get the picture. > > Todd I hear you. That feeling is why I originally volunteered to do it. OTOH, I seem to have just discovered a successful tactic: volunteer to produce something so as to induce someone else to produce something better. You get all the warm fuzzies of having helped out without having to do any actual work. :> Dave K -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091106/e327a177/attachment.htm From jmj at fellowhuman.com Fri Nov 6 16:14:21 2009 From: jmj at fellowhuman.com (Jordan Johnson) Date: Fri Nov 6 16:15:41 2009 Subject: [plt-scheme] new rotate function in 2htdp/image In-Reply-To: <932b2f1f0911060408o6d5ad85fmaa6fb2316456e5f8@mail.gmail.com> References: <932b2f1f0911060408o6d5ad85fmaa6fb2316456e5f8@mail.gmail.com> Message-ID: <15191EC3-F8A8-451B-A793-FEAB0D2C7187@fellowhuman.com> Is there any reason (aside from that it's a hassle) not to use except- in and only-in when requiring the image and universe libraries? I haven't tried it, but it seems like that's one possible temp solution for Eric's problem... Best, Jordan On Nov 6, 2009, at 4:08 AM, Robby Findler wrote: > The current 2htdp/universe does not use 2htdp/image (it instead uses > htdp/image). The 2htdp/image library is still pretty new and missing > lots of image primitives. I hope to get more of them going soon and > probably after that 2htdp/universe will switch over to using > 2htdp/image. > > In the meantime, if all you want to do is program with images (but not > use the world or universe stuff), you can just require 2htdp/image by > itself. > > hth, > Robby > > On Fri, Nov 6, 2009 at 1:15 AM, Eric Swenson wrote: >> I'd like to be able to use the new "rotate" function in 2htdp/image >> in a >> big-bang simulation. So far, I've been unable to figure out how to >> do this. >> If I simply use >> #lang scheme >> (require 2htdp/universe) >> I can successfully use big-bang but the new "rotate" is not >> available (this, >> despite the fact that it seems like universe causes the >> private/image-more.ss module to get loaded). >> If I try to do this: >> #lang scheme >> (require 2htdp/universe) >> (require 2htdp/image) >> I get this error: >> module: identifier already imported from a different source in: >> rectangle >> 2htdp/image >> 2htdp/universe >> If I do this: >> #lang scheme >> (require 2htdp/image) >> then "rotate" is available and works fine, but "big-bang" is not >> available. >> I can't seem to get the combination of "universe" and the new >> additions to >> "image" to work together. >> Can anyone offer a hand? >> Thanks. -- Eric >> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From robby at eecs.northwestern.edu Fri Nov 6 20:30:53 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Fri Nov 6 20:31:14 2009 Subject: [plt-scheme] new rotate function in 2htdp/image In-Reply-To: <15191EC3-F8A8-451B-A793-FEAB0D2C7187@fellowhuman.com> References: <932b2f1f0911060408o6d5ad85fmaa6fb2316456e5f8@mail.gmail.com> <15191EC3-F8A8-451B-A793-FEAB0D2C7187@fellowhuman.com> Message-ID: <932b2f1f0911061730n75a095a3i806a5d4e2899dfa4@mail.gmail.com> That won't work. The two image-width functions are not compatible (the one universe uses will fail on the images provided from 2htdp/image), for example. Robby On Fri, Nov 6, 2009 at 3:14 PM, Jordan Johnson wrote: > Is there any reason (aside from that it's a hassle) not to use except-in and > only-in when requiring the image and universe libraries? ?I haven't tried > it, but it seems like that's one possible temp solution for Eric's > problem... > > Best, > Jordan > > > On Nov 6, 2009, at 4:08 AM, Robby Findler > wrote: > >> The current 2htdp/universe does not use 2htdp/image (it instead uses >> htdp/image). The 2htdp/image library is still pretty new and missing >> lots of image primitives. I hope to get more of them going soon and >> probably after that 2htdp/universe will switch over to using >> 2htdp/image. >> >> In the meantime, if all you want to do is program with images (but not >> use the world or universe stuff), you can just require 2htdp/image by >> itself. >> >> hth, >> Robby >> >> On Fri, Nov 6, 2009 at 1:15 AM, Eric Swenson wrote: >>> >>> I'd like to be able to use the new "rotate" function in 2htdp/image in a >>> big-bang simulation. So far, I've been unable to figure out how to do >>> this. >>> ?If I simply use >>> #lang scheme >>> (require 2htdp/universe) >>> I can successfully use big-bang but the new "rotate" is not available >>> (this, >>> despite the fact that it seems like universe causes the >>> private/image-more.ss module to get loaded). >>> If I try to do this: >>> #lang scheme >>> (require 2htdp/universe) >>> (require 2htdp/image) >>> I get this error: >>> ?module: identifier already imported from a different source in: >>> ?rectangle >>> ?2htdp/image >>> ?2htdp/universe >>> If I do this: >>> #lang scheme >>> (require 2htdp/image) >>> then "rotate" is available and works fine, but "big-bang" is not >>> available. >>> ?I can't seem to get the combination of "universe" and the new additions >>> to >>> "image" to work together. >>> Can anyone offer a hand? >>> Thanks. -- Eric >>> >>> _________________________________________________ >>> ?For list-related administrative tasks: >>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>> >>> >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From jasper.maes at gmail.com Thu Nov 5 03:24:14 2009 From: jasper.maes at gmail.com (Japus) Date: Sat Nov 7 08:23:03 2009 Subject: [plt-scheme] Re: Restart Web-server In-Reply-To: <779bf2730911041952j327333cby1b983e324b731811@mail.gmail.com> References: <779bf2730911041952j327333cby1b983e324b731811@mail.gmail.com> Message-ID: <75455381-3af6-4195-9aa0-fea4d91f0236@15g2000yqy.googlegroups.com> I already tried the meta-refresh technique and javascript too but the problem with those is that when I use a variable in it, it reads it's value when the code is generated and based on that it decides how long it takes to reload but it should reload when the value of that variable changes. So it should constantly check the variable and see if the variable has changed and when it has, instantly reload. If it hasn't changed, nothing should happen. Jasper On 5 nov, 04:52, YC wrote: > Hi Jasper - > > I think you mean auto/event-driven browser refresh rather than restart the > web server. > > There is something called the World framework in PLT that appears to handle > such needs - IIRC it works with Flash, but I never used it and don't know > how it works - others would have to chime in. > > To do this on your own you can use either use the meta refresh technique, or > you can use some sort of ajax/comet to have the server notify the client to > refresh the pages. > > http://en.wikipedia.org/wiki/Meta_refresh- although this is considered > obsolete by standards it is supported by all major browsers. ?The meta > refresh happens with or without events occuring on the server-side. > > http://en.wikipedia.org/wiki/Comet_%28programming%29- this occurs only when > an event happened, but there is a lot more work involved. > > You can also do this with Flash/Flex, which has its own dev model. > > Cheers, > ycOn Tue, Nov 3, 2009 at 11:10 AM, Japus wrote: > > Hello > > > I'm imlementing an online game, Stratego and for that I use the PLT > > web-server. Everything goes well but I'm stuck trying to find out how > > I can force the browser to reload the servlet. > > An example: > > Player 1 is able to move a pawn and in the meanwhile Player 2 can't > > (which is obvious) > > When Player 1 is done, Player 2 can make a move but before he can do > > that he has to manually reload his browser. And that's what I'm trying > > to do automatically using some kind of variable and a controlling > > procedure that determines which browser should be refreshed. > > > Thanks > > > Jasper > > _________________________________________________ > > ?For list-related administrative tasks: > > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme From bloch at adelphi.edu Fri Nov 6 10:19:31 2009 From: bloch at adelphi.edu (Stephen Bloch) Date: Sat Nov 7 08:23:14 2009 Subject: [BULK] Re: [plt-scheme] new rotate function in 2htdp/image In-Reply-To: <932b2f1f0911060408o6d5ad85fmaa6fb2316456e5f8@mail.gmail.com> References: <932b2f1f0911060408o6d5ad85fmaa6fb2316456e5f8@mail.gmail.com> Message-ID: <68A3BB29-DA72-4192-ADFB-2C1C35014DA5@adelphi.edu> On Nov 6, 2009, at 7:08 AM, Robby Findler wrote: > The current 2htdp/universe does not use 2htdp/image (it instead uses > htdp/image). The 2htdp/image library is still pretty new and missing > lots of image primitives. I hope to get more of them going soon and > probably after that 2htdp/universe will switch over to using > 2htdp/image. Do we have an ETA on any of this stuff? It affects my textbook- writing :-) Steve Bloch From scott at adrenaline.com Sat Nov 7 09:04:53 2009 From: scott at adrenaline.com (Scott McLoughlin) Date: Sat Nov 7 09:05:34 2009 Subject: [plt-scheme] Re: plt-scheme Digest, Vol 51, Issue 16 In-Reply-To: <20091105024221.D3F9C402C2@qua.cs.brown.edu> References: <20091105024221.D3F9C402C2@qua.cs.brown.edu> Message-ID: <4AF57E85.3040603@adrenaline.com> Just trying to understand what's happening, but is _pointer essentially giving a "pinned" address or even "pinned" page? Scott > Message: 1 > Date: Wed, 4 Nov 2009 12:28:52 -0700 > From: Matthew Flatt > Subject: [plt-scheme] change to `scheme/foreign' > To: plt-scheme@list.cs.brown.edu > Message-ID: <20091104192853.141156500C7@mail-svr1.cs.utah.edu> > Content-Type: text/plain; charset=UTF-8 > > As of v4.2.2.6 (now in SVN), the `_pointer' type in the FFI has changed > to mean "pointer to an address that is *not* managed by the GC". A new > `_gcpointer' type takes over the old meaning of `_pointer', which was > "pointer to an address that may or may not be managed by the GC". > > This change could break some existing uses of the FFI, but I think it's > likely to repair many more existing uses than it breaks. > > > At first glance, `_gcpointer' is more convenient than `_pointer'. The > GC can just look at the address in a `_gcpointer' wrapper and decide > whether the address is within one of the pages of memory that the GC > manages. Also, given our past reliance on conservative GC, defining > `_pointer' to allow references to GCable memory seemed like the obvious > choice. > > The problem is that a memory page used by one allocator, such as > malloc()/free(), can sometimes be released by that allocator and picked > up by another allocator, such as the GC. For example, suppose that > `make-encrypted-in', `make-encrypted', and `close-encrypted' are > supplied by a foreign library: > > (define-struct connection (in out)) > > .... > (let ([c (make-connection (make-encrypted-in ....) > (make-encrypted-out ....))]) > .... > (close-encrypted (connection-in c)) > (close-encrypted (connection-out c))) > > It's likely that `make-encrypted' allocates its result with malloc() > and `close-encrypted' releases its argument with free(). In that case, > on some platforms, the above program is broken. It could happen that > > 1. `(close-encrypted (connection-in c))' frees memory with free(); > > 2. free() releases the page that uses to contain the address > referenced by `(connection-in c)'; > > 3. before continuing with `(close-encrypted (connection-out c))', > athread Scheme thread swaps in; > > 4. the other thread allocates enough that the GC looks for a new > page of memory, and get takes the one just released by free(); > > 5. the other thread continues to allocate and forces a GC; and > > 6. the GC crashes, because the pointer in `(connection-in c)' still > refers to the address of memory that was free()ed, and now that > address points into the middle of a GC-managed block of memory. > > The problem could be fixed with > > (let ([c (make-connection (make-encrypted-in ....) > (make-encrypted-out ....))]) > .... > (let ([in (connection-in c)] > [out (connection-out c)]) > (close-encrypted in) > (close-encrypted out))) > > This works because space safety ensures that `c' and `in' are no longer > referenced by the time `close-encrypted' is called. But this > fine-grained level of reachability is obviously difficult to reason > about. > > The new meaning of `_pointer' avoids the above problem. The GC ignores > the address stored in the Scheme representation of the pointer. > > > Meanwhile, it seems that `_gcpointer' is rarely needed. When getting a > pointer back from a foreign library, it almost never refers to GCable > memory, because the GC would not have been able to track the pointer > (and update it when data is moved by the GC) within the foreign > library. In those cases, then, plain `_pointer' works. For pointer > values going the other direction --- from Scheme to a foreign library > --- `_pointer' and `_gcpointer' are the same. > > There is an implicit use of `_gcpointer' when calling the `make-' > procedure bound by a `define-cstruct'. Since that's implicit, though, > no existing code must change to use it. > > Similarly, there's an implicit use of `_gcpointer' when allocating data > with `malloc' in modes other than 'raw. Again, the use is implicit, so > no conversion is necessary. > > Another change to `malloc' is that the mode now defaults to 'atomic > when a type based on `_pointer' is provided. The 'nonatomic mode is > used only when a given type is based on `_gcpointer' or `_scheme'. > > > For all of those reasons, I'm pretty sure that the change to `_pointer' > is a good idea, but let me know if it causes any trouble. > From czhu at cs.utah.edu Sat Nov 7 09:41:45 2009 From: czhu at cs.utah.edu (Chongkai Zhu) Date: Sat Nov 7 09:42:07 2009 Subject: [plt-scheme] Re: plt-scheme Digest, Vol 51, Issue 16 In-Reply-To: <4AF57E85.3040603@adrenaline.com> References: <20091105024221.D3F9C402C2@qua.cs.brown.edu> <4AF57E85.3040603@adrenaline.com> Message-ID: <4AF58729.5010405@cs.utah.edu> Look at the FFI document. Basically it encapsulate a C pointer (i.e. any data type you define with a * in C) in a Scheme object. Also useful if you want to get the address of a Scheme_object. Chongkai Scott McLoughlin wrote: > Just trying to understand what's happening, but is _pointer > essentially giving > a "pinned" address or even "pinned" page? > > Scott From jay.mccarthy at gmail.com Sat Nov 7 12:50:06 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Sat Nov 7 12:50:26 2009 Subject: [plt-scheme] [ANN] SuperC 2.0 --- Now with more evil Message-ID: A new version of SuperC is available: http://planet.plt-scheme.org/display.ss?package=superc.plt&owner=jaymccarthy Here's an example: #lang planet jaymccarthy/superc @c{ #include #include } (define-for-syntax y 6) @c{ int main(void) { printf("The Scheme program contains: @|y|\n"); return cos(M_PI); } } (define main (get-ffi-obj-from-this 'main (_fun -> _int))) (printf "The C program returned: ~a~n" (main)) It outputs: The Scheme program contains: 6 The C program returned: -1 -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From yinso.chen at gmail.com Sat Nov 7 13:22:11 2009 From: yinso.chen at gmail.com (YC) Date: Sat Nov 7 13:22:40 2009 Subject: [plt-scheme] Re: Restart Web-server In-Reply-To: <75455381-3af6-4195-9aa0-fea4d91f0236@15g2000yqy.googlegroups.com> References: <779bf2730911041952j327333cby1b983e324b731811@mail.gmail.com> <75455381-3af6-4195-9aa0-fea4d91f0236@15g2000yqy.googlegroups.com> Message-ID: <779bf2730911071022l6721136dya0e4143c44ca2315@mail.gmail.com> On Thu, Nov 5, 2009 at 12:24 AM, Japus wrote: > I already tried the meta-refresh technique and javascript too but the > problem with those is that when I use a variable in it, it reads it's > value when the code is generated and based on that it decides how long > it takes to reload but it should reload when the value of that > variable changes. Jasper - Meta-refresh gets you half way there with almost no work, but the remaining half way is a major undertaking if you haven't done it before, so that's why I mentioned meta-refresh as an option unless you are ready to go all the way. Assuming you are ready to go all the way - you'll have to get familiarized with ajax & http comet, as they are the solution to your question. There are abundant information on these topics on the web and books. The techniques are server independent, so you can use them with plt web-server. > > So it should constantly check the variable and see > if the variable has changed and when it has, instantly reload. If it > hasn't changed, nothing should happen. > The $64K question here is: since the variable exists on the server, and you need to "constantly" check it from the client, how do you do so without a "reload"? Again - look at ajax & comet - they are designed specifically to answer this question. HTH. Cheers. yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091107/7693fbfb/attachment.htm From pivanyi at freemail.hu Sat Nov 7 13:45:18 2009 From: pivanyi at freemail.hu (Ivanyi Peter) Date: Sat Nov 7 13:52:32 2009 Subject: [plt-scheme] parser tools Message-ID: Hi, Is it possible to create a lexer and parser dynamically? I would like to create an application, which, for example, reads in a file which contains what the separator character is and after that the program can read in another file, but considers the separator character. Somehow I could not manage to create a variable, which then can be used in a lexer. Any way to do this? Thanks for any help. Best regards, Peter Ivanyi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091107/a8755f69/attachment.htm From d.j.gurnell at gmail.com Sat Nov 7 14:00:39 2009 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Sat Nov 7 14:01:07 2009 Subject: [plt-scheme] session info in web server applications In-Reply-To: References: <904774730911041720x5d79b88du5323c075110304a5@mail.gmail.com> <0FD5FECE-A181-43EF-9BF6-BEBEF87A8125@gmail.com> <904774730911060603s497d8b39veb9d822b001a46f5@mail.gmail.com> Message-ID: Hi all, I've extracted the cookie/session parts of our code and put them here for comment: http://svn.untyped.com/session/trunk/src There's no documentation but the code is really short and there's tests in there to show how it works. The README gives a brief overview and lists some outstanding issues. Feel free to take a peek, pull it apart, and post your concerns here. The key issue I'm aware of is that the session data is stored in a global hash table with no memory management. Over time, the table will grow and grow until the server runs out of memory. At Untyped we use sessions exclusively to store usernames. These are so small we've never had a problem so I've never been motivated to come up with a better solution. I spoke to Jay about this and he recommended an alternative approach using md5-stuffers to write the session information out to disk. I'll implement that when I get a chance, and I'll take contributions by email if anyone else fancies jumping in. I'm not sure about thread safety but we've never had any problems. Also, this is an adaptation of code from other Untyped libraries, and I've tweaked some things without adding 100% test coverage. Please don't treat this as reliable code to be deployed in production! Cheers, -- Dave From yinso.chen at gmail.com Sat Nov 7 15:57:53 2009 From: yinso.chen at gmail.com (YC) Date: Sat Nov 7 15:58:15 2009 Subject: [plt-scheme] session info in web server applications In-Reply-To: References: <904774730911041720x5d79b88du5323c075110304a5@mail.gmail.com> <0FD5FECE-A181-43EF-9BF6-BEBEF87A8125@gmail.com> <904774730911060603s497d8b39veb9d822b001a46f5@mail.gmail.com> Message-ID: <779bf2730911071257k12f8bd65n308627db301bd7cb@mail.gmail.com> Dave - this is cool. I am in the process of building a persistent session store on top of my dbi collection, and perhaps that'll help with the storage needs indicated below. Once I have it I'll publish it onto planet and announce as usual. Cheers, yc On Sat, Nov 7, 2009 at 11:00 AM, Dave Gurnell wrote: > Hi all, > > I've extracted the cookie/session parts of our code and put them here for > comment: > > http://svn.untyped.com/session/trunk/src > > There's no documentation but the code is really short and there's tests in > there to show how it works. The README gives a brief overview and lists some > outstanding issues. Feel free to take a peek, pull it apart, and post your > concerns here. > > The key issue I'm aware of is that the session data is stored in a global > hash table with no memory management. Over time, the table will grow and > grow until the server runs out of memory. At Untyped we use sessions > exclusively to store usernames. These are so small we've never had a problem > so I've never been motivated to come up with a better solution. > > I spoke to Jay about this and he recommended an alternative approach using > md5-stuffers to write the session information out to disk. I'll implement > that when I get a chance, and I'll take contributions by email if anyone > else fancies jumping in. > > I'm not sure about thread safety but we've never had any problems. > > Also, this is an adaptation of code from other Untyped libraries, and I've > tweaked some things without adding 100% test coverage. Please don't treat > this as reliable code to be deployed in production! > > Cheers, > > -- Dave > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091107/2dd569e2/attachment.htm From grettke at acm.org Sun Nov 8 00:15:21 2009 From: grettke at acm.org (Grant Rettke) Date: Sun Nov 8 00:15:55 2009 Subject: [plt-scheme] Help: Question about require and include In-Reply-To: <4AF107F3.4040807@gmail.com> References: <4AF0C8B6.20108@gmail.com> <756daca50911031931g799b4c01n46776689e94b77dd@mail.gmail.com> <4AF107F3.4040807@gmail.com> Message-ID: <756daca50911072115o47e1758mc651cac36cf1b440@mail.gmail.com> Hi Parnell, On Tue, Nov 3, 2009 at 10:49 PM, Parnell Springmeyer wrote: > -----BEGIN PGP SIGNED MESSAGE----- > I made the error of replying to the last responder without "Reply All". > Grant, I am trying to accomplish something specific, here's what I wrote > to the last replier: Might I ask what the proper idiom would be for > creating a user defined path to, say, a module directory in a > configuration file and then prefixing a module filename with that value > at require time? You would like the location of the library that gets used to be defined at runtime? Perhaps uou might specify the PLTCOLLECTS dir: http://download.plt-scheme.org/doc/html/reference/collects.html#(idx._(gentag._399._(lib._scribblings/reference/reference..scrbl))) Or use dynamic-require: http://download.plt-scheme.org/doc/html/reference/Module_Names_and_Loading.html#(def._((quote._~23~25kernel)._dynamic-require)) Not sure that is exactly what you are looking for. From krhari at ccs.neu.edu Sun Nov 8 02:41:55 2009 From: krhari at ccs.neu.edu (krhari@ccs.neu.edu) Date: Sun Nov 8 02:42:19 2009 Subject: [plt-scheme] How to get tokenize a string? In-Reply-To: <25047229.261391257666047558.JavaMail.root@zimbra> Message-ID: <16305555.261411257666115654.JavaMail.root@zimbra> Hi, I have a file which contains data like this 2.5500000e-002 3.6238983e-002 2.5500000e-002 3.6238638e-002 2.5500000e-002 3.6237603e-002 ... I am working on a small animation I need these numbers to calculate some things there... I am using 2htdp/universe teachpack... I actually found string->tokenize function in SRFI doc... Can I use it? If yes can anyone guide me how to use SRFI? If no is there any other way out other than converting the file into a string then using sting->list and doing it in brute force way? If I use file->string, I get a string like this " 2.5500000e-002 3.6238983e-002\r\n 2.5500000e-002 3.6238638e-002\r\n 2.5500000e-002 3.6237603e-002\r\n" Please help me out... Thanks Hari From laurent.orseau at gmail.com Sun Nov 8 03:59:34 2009 From: laurent.orseau at gmail.com (Laurent) Date: Sun Nov 8 04:00:17 2009 Subject: [plt-scheme] How to get tokenize a string? In-Reply-To: <16305555.261411257666115654.JavaMail.root@zimbra> References: <25047229.261391257666047558.JavaMail.root@zimbra> <16305555.261411257666115654.JavaMail.root@zimbra> Message-ID: Hi, You might not need a tokenizer. Probably something like that should do it: (with-input-from-file "my-file.txt" #:mode 'text (lambda () (let loop ([numbers '()] [line (read-line)]) (if (eof-object? line) (reverse numbers) (loop (cons (filter (lambda(x)x) (map string->number (regexp-split #px"\\s+" line))) numbers) (read-line)))))) Lines are read one by one, and each line is split on spaces with regexp-split, then empty values are removed (with filter), strings are turned into numbers with string->number, and all the values are consed into a list of list of numbers. Hope this helps, Laurent On Sun, Nov 8, 2009 at 08:41, wrote: > Hi, > I have a file which contains data like this > > 2.5500000e-002 3.6238983e-002 > 2.5500000e-002 3.6238638e-002 > 2.5500000e-002 3.6237603e-002 > ... > > I am working on a small animation I need these numbers to calculate some > things there... I am using 2htdp/universe teachpack... > > I actually found string->tokenize function in SRFI doc... Can I use it? If > yes can anyone guide me how to use SRFI? If no is there any other way out > other than converting the file into a string then using sting->list and > doing it in brute force way? > > If I use file->string, I get a string like this > " 2.5500000e-002 3.6238983e-002\r\n 2.5500000e-002 3.6238638e-002\r\n > 2.5500000e-002 3.6237603e-002\r\n" > > Please help me out... > > Thanks > Hari > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091108/00cbd0cb/attachment.htm From jos.koot at telefonica.net Sun Nov 8 04:02:26 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Sun Nov 8 04:02:51 2009 Subject: [plt-scheme] How to get tokenize a string? References: <16305555.261411257666115654.JavaMail.root@zimbra> Message-ID: <392446263AEE4B4490C2BC4C358DDEEE@uw2b2dff239c4d> Why not using just read? For the first read you would find: (read port) --> 2.5500000e-002 If your file contains numers only: ; read a file containing numbers and return the list of these numbers. (define (read-file-of-numbers port) ; unchecked code! (let ((item (read port))) (if (eof-object item) '( ) (cons item (read-file-of-numbers port))))) In fact the above routine can be used for any file that contains a sequence of sexprs and would return a list of the sexprs. Jos ----- Original Message ----- From: To: "plt-scheme" Sent: Sunday, November 08, 2009 8:41 AM Subject: [plt-scheme] How to get tokenize a string? > Hi, > I have a file which contains data like this > > 2.5500000e-002 3.6238983e-002 > 2.5500000e-002 3.6238638e-002 > 2.5500000e-002 3.6237603e-002 > ... > > I am working on a small animation I need these numbers to calculate some things there... I am using 2htdp/universe teachpack... > > I actually found string->tokenize function in SRFI doc... Can I use it? If yes can anyone guide me how to use SRFI? If no is there > any other way out other than converting the file into a string then using sting->list and doing it in brute force way? > > If I use file->string, I get a string like this > " 2.5500000e-002 3.6238983e-002\r\n 2.5500000e-002 3.6238638e-002\r\n 2.5500000e-002 3.6237603e-002\r\n" > > Please help me out... > > Thanks > Hari > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From asau at inbox.ru Sun Nov 8 04:06:41 2009 From: asau at inbox.ru (Aleksej Saushev) Date: Sun Nov 8 04:07:30 2009 Subject: [plt-scheme] Re: How to get tokenize a string? References: <25047229.261391257666047558.JavaMail.root@zimbra> <16305555.261411257666115654.JavaMail.root@zimbra> Message-ID: <87k4y1s7vi.fsf@inbox.ru> Hello! krhari@ccs.neu.edu writes: > I have a file which contains data like this > > 2.5500000e-002 3.6238983e-002 > 2.5500000e-002 3.6238638e-002 > 2.5500000e-002 3.6237603e-002 > ... > > I am working on a small animation I need these numbers to calculate some things there... I am using 2htdp/universe teachpack... > > I actually found string->tokenize function in SRFI doc... Can I use it? If yes can anyone guide me how to use SRFI? If no is there any other way out other than converting the file into a string then using sting->list and doing it in brute force way? > > If I use file->string, I get a string like this > " 2.5500000e-002 3.6238983e-002\r\n 2.5500000e-002 3.6238638e-002\r\n 2.5500000e-002 3.6237603e-002\r\n" > > Please help me out... Stupid question: why don't you just read data from it?? -- HE CE3OH... From laurent.orseau at gmail.com Sun Nov 8 04:24:57 2009 From: laurent.orseau at gmail.com (Laurent) Date: Sun Nov 8 04:25:39 2009 Subject: [plt-scheme] How to get tokenize a string? In-Reply-To: <392446263AEE4B4490C2BC4C358DDEEE@uw2b2dff239c4d> References: <16305555.261411257666115654.JavaMail.root@zimbra> <392446263AEE4B4490C2BC4C358DDEEE@uw2b2dff239c4d> Message-ID: that is simpler, indeed :) On Sun, Nov 8, 2009 at 10:02, Jos Koot wrote: > Why not using just read? For the first read you would find: > (read port) --> 2.5500000e-002 > If your file contains numers only: > > ; read a file containing numbers and return the list of these numbers. > (define (read-file-of-numbers port) ; unchecked code! > (let ((item (read port))) > (if (eof-object item) '( ) > (cons item (read-file-of-numbers port))))) > > In fact the above routine can be used for any file that contains a sequence > of sexprs and would return a list of the sexprs. > > Jos > > ----- Original Message ----- From: > To: "plt-scheme" > Sent: Sunday, November 08, 2009 8:41 AM > Subject: [plt-scheme] How to get tokenize a string? > > > > Hi, >> I have a file which contains data like this >> >> 2.5500000e-002 3.6238983e-002 >> 2.5500000e-002 3.6238638e-002 >> 2.5500000e-002 3.6237603e-002 >> ... >> >> I am working on a small animation I need these numbers to calculate some >> things there... I am using 2htdp/universe teachpack... >> >> I actually found string->tokenize function in SRFI doc... Can I use it? If >> yes can anyone guide me how to use SRFI? If no is there any other way out >> other than converting the file into a string then using sting->list and >> doing it in brute force way? >> >> If I use file->string, I get a string like this >> " 2.5500000e-002 3.6238983e-002\r\n 2.5500000e-002 3.6238638e-002\r\n >> 2.5500000e-002 3.6237603e-002\r\n" >> >> Please help me out... >> >> Thanks >> Hari >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091108/30e80bdd/attachment.htm From krhari at ccs.neu.edu Sun Nov 8 05:12:25 2009 From: krhari at ccs.neu.edu (Hari Prashanth K R) Date: Sun Nov 8 05:12:55 2009 Subject: [plt-scheme] How to get tokenize a string? In-Reply-To: Message-ID: <32097453.261511257675145047.JavaMail.root@zimbra> Thanks Laurent... Thanks Jos it helped... ----- Original Message ----- From: "Laurent" To: "Jos Koot" Cc: krhari@ccs.neu.edu, "plt-scheme" Sent: Sunday, November 8, 2009 4:24:57 AM GMT -05:00 US/Canada Eastern Subject: Re: [plt-scheme] How to get tokenize a string? that is simpler, indeed :) On Sun, Nov 8, 2009 at 10:02, Jos Koot < jos.koot@telefonica.net > wrote: Why not using just read? For the first read you would find: (read port) --> 2.5500000e-002 If your file contains numers only: ; read a file containing numbers and return the list of these numbers. (define (read-file-of-numbers port) ; unchecked code! (let ((item (read port))) (if (eof-object item) '( ) (cons item (read-file-of-numbers port))))) In fact the above routine can be used for any file that contains a sequence of sexprs and would return a list of the sexprs. Jos ----- Original Message ----- From: < krhari@ccs.neu.edu > To: "plt-scheme" < plt-scheme@list.cs.brown.edu > Sent: Sunday, November 08, 2009 8:41 AM Subject: [plt-scheme] How to get tokenize a string? Hi, I have a file which contains data like this 2.5500000e-002 3.6238983e-002 2.5500000e-002 3.6238638e-002 2.5500000e-002 3.6237603e-002 ... I am working on a small animation I need these numbers to calculate some things there... I am using 2htdp/universe teachpack... I actually found string->tokenize function in SRFI doc... Can I use it? If yes can anyone guide me how to use SRFI? If no is there any other way out other than converting the file into a string then using sting->list and doing it in brute force way? If I use file->string, I get a string like this " 2.5500000e-002 3.6238983e-002\r\n 2.5500000e-002 3.6238638e-002\r\n 2.5500000e-002 3.6237603e-002\r\n" Please help me out... Thanks Hari _________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-scheme _________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-scheme From neil at neilvandyke.org Sun Nov 8 08:22:40 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Sun Nov 8 08:22:59 2009 Subject: [plt-scheme] significant HtmlPrag parsing behavior change Message-ID: <4AF6C620.90801@neilvandyke.org> For anyone using HtmlPrag for HTML parsing... The new version in PLaneT changes parsing behavior for certain invalid HTML. Example: "< x>" now parses as text rather than as an "x" element. This new behavior matches contemporary Firefox, and arguably is the way it should've been done in 2001. In the unlikely event that this change breaks some system of yours, please let me know. http://www.neilvandyke.org/htmlprag/ From martindemello at gmail.com Sun Nov 8 08:53:22 2009 From: martindemello at gmail.com (Martin DeMello) Date: Sun Nov 8 08:53:40 2009 Subject: [plt-scheme] could we have a git-svn mirror of the repository? In-Reply-To: <19182.52977.971236.466927@winooski.ccs.neu.edu> References: <19182.52977.971236.466927@winooski.ccs.neu.edu> Message-ID: Github has support for importing of an existing public svn repository. Seems like the best way to go - they have an excellent setup for managing git repositories, and are one of the default open source project sites these days. I asked on stackoverflow how I might do such a thing myself and both responses I got said 'just use github'. The best workflow I can think of is: 1. Let github do the import 2. Do a local checkout of the github repo 3. Have an svn post-commit hook to rebase your local repo and then push it to github martin p.s. keeping this on list so that other people can chime in with possible better suggestions From neil at neilvandyke.org Sun Nov 8 10:15:09 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Sun Nov 8 10:15:26 2009 Subject: [plt-scheme] Scheme productivity data point Message-ID: <4AF6E07D.1050901@neilvandyke.org> FYI, a small Scheme productivity data point that I just blogged... > Scheme Is Likely Fast Enough for You > > I needed to process a corpus of HTML files, which involved a bunch of > parsing, XPath-ing, simple pattern-matching, a little regexp-ing, and > HTML generation. > > Using PLT Scheme, Oleg Kiselyov's and Kirill Lisovsky's SXPath, Jim > Bender's sxml-match, HtmlPrag, and WebScraperHelper, I banged it > together in a day for a sample of the data, then spent another day > tweaking it to run through the entire corpus. Most of the second day > was due to some strangely bad HTML buried in some of the 40,000+ > files, and having to juggle remote computers. > > Afterwards, half tongue-in-cheek, I played fanboy for the benefit of a > colleague who still wants to do symbolic processing in C++, laboriously... > >> [...] The output files take less than 7% the space of the input files. >> >> And, for people who think Scheme is slow... Wall clock time for the >> conversion (which was doing lots of parsing, XPath, simple >> pattern-matching, and a little regexp-ing) was only a little more >> than twice the wall clock time of "dd" doing comparable file I/O [to >> local disk on a fast machine]. I didn't bother to optimize the Scheme >> algorithms, nor compile it to native code. I used PLT Scheme, which >> isn't a particularly fast Scheme. At the end of a week, when I >> imagine that a Java or C++ programmer would finish coding, I suspect >> you'd find that the Scheme runtime performance compares favorably. :) > > I don't do much advocacy, but capturing even loose anecdotal evidence > of productivity boosts as they happen can be helpful. From rafkind at cs.utah.edu Sun Nov 8 12:38:55 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Sun Nov 8 12:42:03 2009 Subject: [plt-scheme] Scheme productivity data point In-Reply-To: <4AF6E07D.1050901@neilvandyke.org> References: <4AF6E07D.1050901@neilvandyke.org> Message-ID: <4AF7022F.9010905@cs.utah.edu> Neil Van Dyke wrote: > FYI, a small Scheme productivity data point that I just blogged... > >> Scheme Is Likely Fast Enough for You >> >> I needed to process a corpus of HTML files, which involved a bunch of >> parsing, XPath-ing, simple pattern-matching, a little regexp-ing, and >> HTML generation. >> >> Using PLT Scheme, Oleg Kiselyov's and Kirill Lisovsky's SXPath, Jim >> Bender's sxml-match, HtmlPrag, and WebScraperHelper, I banged it >> together in a day for a sample of the data, then spent another day >> tweaking it to run through the entire corpus. Most of the second day >> was due to some strangely bad HTML buried in some of the 40,000+ >> files, and having to juggle remote computers. >> >> Afterwards, half tongue-in-cheek, I played fanboy for the benefit of >> a colleague who still wants to do symbolic processing in C++, >> laboriously... >> >>> [...] The output files take less than 7% the space of the input files. >>> The input files were HTML and the output files were something.. but does that have anything to do with the fact that you used scheme? I don't see how the engine is a factor here, unless I missed something. From toddobryan at gmail.com Sun Nov 8 14:47:32 2009 From: toddobryan at gmail.com (Todd O'Bryan) Date: Sun Nov 8 14:47:54 2009 Subject: [plt-scheme] session info in web server applications In-Reply-To: References: <904774730911041720x5d79b88du5323c075110304a5@mail.gmail.com> <0FD5FECE-A181-43EF-9BF6-BEBEF87A8125@gmail.com> <904774730911060603s497d8b39veb9d822b001a46f5@mail.gmail.com> Message-ID: <904774730911081147s189721f2k27b149704daee956@mail.gmail.com> Thanks. I have some high school students who are playing with this, so we'll undoubtedly come up with questions and confusion. We may even come up with some code to contribute back--who knows? Todd On Sat, Nov 7, 2009 at 2:00 PM, Dave Gurnell wrote: > Hi all, > > I've extracted the cookie/session parts of our code and put them here for > comment: > > ? ?http://svn.untyped.com/session/trunk/src > > There's no documentation but the code is really short and there's tests in > there to show how it works. The README gives a brief overview and lists some > outstanding issues. Feel free to take a peek, pull it apart, and post your > concerns here. > > The key issue I'm aware of is that the session data is stored in a global > hash table with no memory management. Over time, the table will grow and > grow until the server runs out of memory. At Untyped we use sessions > exclusively to store usernames. These are so small we've never had a problem > so I've never been motivated to come up with a better solution. > > I spoke to Jay about this and he recommended an alternative approach using > md5-stuffers to write the session information out to disk. I'll implement > that when I get a chance, and I'll take contributions by email if anyone > else fancies jumping in. > > I'm not sure about thread safety but we've never had any problems. > > Also, this is an adaptation of code from other Untyped libraries, and I've > tweaked some things without adding 100% test coverage. Please don't treat > this as reliable code to be deployed in production! > > Cheers, > > -- Dave > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From noelwelsh at gmail.com Sun Nov 8 15:43:58 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Sun Nov 8 15:49:58 2009 Subject: [plt-scheme] Scheme productivity data point In-Reply-To: <4AF7022F.9010905@cs.utah.edu> References: <4AF6E07D.1050901@neilvandyke.org> <4AF7022F.9010905@cs.utah.edu> Message-ID: On Sun, Nov 8, 2009 at 5:38 PM, Jon Rafkind wrote: > The input files were HTML and the output files were something.. but does > that have anything to do with the fact that you used scheme? I don't see how > the engine is a factor here, unless I missed something. The issue is total time to complete the job. Neil is saying that w/ Scheme 1. The Scheme program was on ~2x slower than the time taken to just shift the bytes. I.e. runtime overhead was low 2. More importantly, development time was only 2 days. With C++ dev. time might well have been a week for very little performance improvement. N. From matthias at ccs.neu.edu Sun Nov 8 16:28:21 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Sun Nov 8 16:28:56 2009 Subject: [plt-scheme] Scheme productivity data point In-Reply-To: References: <4AF6E07D.1050901@neilvandyke.org> <4AF7022F.9010905@cs.utah.edu> Message-ID: <7561645D-C04B-4AA0-A838-A2C482941DDC@ccs.neu.edu> Plus he may have needed the conversion once and only once. So who cares about the performance. Here is a similar story from a scientific computation group at Cornell, working Boeing. (Zippel is my source.) They developed a Lisp-based framework for transforming continuous mathematics for wings into discrete and then into Fortran programs. They reduced the development time for Cray Fortran programs from a year to a month. Then they ran the program, which took another month (and a bit less). Then they had the results and could throw away the program. Sounds like a winner? Sadly a month of Cray time was more expensive in 1992 than 11 month of Fortran programmer time. They had lost -- Matthias On Nov 8, 2009, at 3:43 PM, Noel Welsh wrote: > On Sun, Nov 8, 2009 at 5:38 PM, Jon Rafkind > wrote: >> The input files were HTML and the output files were something.. but >> does >> that have anything to do with the fact that you used scheme? I >> don't see how >> the engine is a factor here, unless I missed something. > > The issue is total time to complete the job. Neil is saying that w/ > Scheme > > 1. The Scheme program was on ~2x slower than the time taken to just > shift the bytes. I.e. runtime overhead was low > 2. More importantly, development time was only 2 days. With C++ dev. > time might well have been a week for very little performance > improvement. > > N. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From wmfarr at gmail.com Sun Nov 8 18:30:59 2009 From: wmfarr at gmail.com (Will M. Farr) Date: Sun Nov 8 18:31:20 2009 Subject: [plt-scheme] Macros that expand to (define ...) and "reference to an identifier before its definition" errors Message-ID: <52F2F9B0-42BF-45EE-A21B-C11B60DD376F@gmail.com> Hello all, I'm puzzled by a "reference to an identifier before its definition" error that I keep getting in some code I'm working on. Here is a small example that shows the same behavior: ---------- define-pointer-type.ss: #lang scheme (require scheme/foreign (rename-in scheme (-> ->/c))) (provide define-pointer-type) (unsafe!) (define-syntax define-pointer-type (syntax-rules () ((define-pointer-type name pred?) (define-values (name pred?) (let* ((tag (gensym name)) (name (_cpointer tag)) (pred? (lambda (obj) (and (cpointer? obj) (cpointer-has-tag? obj tag))))) (values name pred?)))))) ---------------------- test.ss: #lang scheme (require "define-pointer-type.ss" scheme/foreign) (define-pointer-type _my-pointer my-pointer?) (provide/contract (_my-pointer ctype?)) Trying to require "test.ss" gives: reference to an identifier before its definition: _my-pointer in module: "/private/tmp/test.ss" The same thing happens if I use the value _my-pointer directly in any part of the test.ss module. (For example, if I try to pull values out of a foreign library using a type like (_fun _my-pointer ...) things explode in the same way.) It seems to me that this ought to work, though. Is there something I'm missing, or is this a bug with the module system? Thanks, Will From ryanc at ccs.neu.edu Sun Nov 8 19:05:47 2009 From: ryanc at ccs.neu.edu (Ryan Culpepper) Date: Sun Nov 8 19:06:13 2009 Subject: [plt-scheme] Macros that expand to (define ...) and "reference to an identifier before its definition" errors In-Reply-To: <52F2F9B0-42BF-45EE-A21B-C11B60DD376F@gmail.com> References: <52F2F9B0-42BF-45EE-A21B-C11B60DD376F@gmail.com> Message-ID: <4AF75CDB.5020306@ccs.neu.edu> Will M. Farr wrote: > Hello all, > > I'm puzzled by a "reference to an identifier before its definition" > error that I keep getting in some code I'm working on. Here is a small > example that shows the same behavior: > > ---------- define-pointer-type.ss: > #lang scheme > > (require scheme/foreign > (rename-in scheme (-> ->/c))) > > (provide define-pointer-type) > > (unsafe!) > > (define-syntax define-pointer-type > (syntax-rules () > ((define-pointer-type name pred?) > (define-values (name pred?) > (let* ((tag (gensym name)) > (name (_cpointer tag)) > (pred? (lambda (obj) > (and (cpointer? obj) > (cpointer-has-tag? obj tag))))) > (values name pred?)))))) You forgot to quote the name in the call to gensym: (let* ((tag (gensym 'name)) ___) ___) Unfortunately, the macro stepper doesn't help, because this isn't an expansion-time error; it's a run-time error. The clue is that neither the macro stepper or Check Syntax trigger the error. For that kind of error, the best debugging tip I can think of is to try manually expanding your macro once, either using 'expand-once' or the macro stepper. Then see if you get more precise error information that way. (In this case, you would.) Ryan From samth at ccs.neu.edu Sun Nov 8 21:23:14 2009 From: samth at ccs.neu.edu (Sam TH) Date: Sun Nov 8 21:23:51 2009 Subject: [plt-scheme] New vector library Message-ID: <63bb19ae0911081823l2dc606baic6ca1c57342bbe9c@mail.gmail.com> There is now a library of many useful procedures for vectors, available in `scheme' and `scheme/vector'. It is modeled on SRFI 43 and the `scheme/list' library. If any additional functions would be useful, please let me know, and I'll add them. Documentation is in the usual place. In addition, all of the vector-handling procedures in `scheme' now have appropriate types in Typed Scheme. -- sam th samth@ccs.neu.edu From ccwu660601 at gmail.com Sun Nov 8 21:52:13 2009 From: ccwu660601 at gmail.com (ccwu) Date: Sun Nov 8 21:52:34 2009 Subject: [plt-scheme] Re: Why is (require (planet untyped/snooze:2) so slow? In-Reply-To: <990e0c030911052200h44cbe240peffadeb5d3effde8@mail.gmail.com> References: <7089fbea-f6dd-4718-b970-4ec604cc9bc2@y28g2000prd.googlegroups.com> <990e0c030911052200h44cbe240peffadeb5d3effde8@mail.gmail.com> Message-ID: Carl, Thanks, setup-plt solved the problem. On 11?6?, ??2?00?, Carl Eastlund wrote: > On Fri, Nov 6, 2009 at 12:25 AM, ccwu wrote: > > Hi, > > > I noticed that (require (planet untyped/snooze:2)) is slow. Is it > > always trying to get codes from internet? Or is it compiling itself > > every times? > > > How can I reduce the loading time of (require (planet... > > > Thank in advance. > > It's not slow for me, after the package is installed. ?It takes about > a second, maybe two, to run in DrScheme. ?But the first time you run > it, on a particular version of DrScheme and a particular computer, it > will have to download, install, and compile the package. ?That can > take several minutes. > > Make sure that you let it install all the way, too. ?If you stop it in > the middle, Planet can get stuck in an inconsistent state where it > doesn't compile all the way, and has to recompile every time you run. > If you think you're stuck in this state, there's two things to try. > One, run 'setup-plt' at the command line. ?Then start DrScheme up > again and see if the require runs faster. ?Two, if that doesn't work, > run 'planet remove untyped snooze.plt 2 <#>' (where <#> is the minor > version number of your snooze.plt package), then 'planet install > untyped snooze.plt 2 0' to install it again. ?(Don't worry about the 0 > there, it'll grab the highest 2.X available.) > > Good luck! > > --Carl > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme From jasper.maes at gmail.com Sun Nov 8 16:48:56 2009 From: jasper.maes at gmail.com (Japus) Date: Sun Nov 8 21:55:39 2009 Subject: [plt-scheme] Re: Restart Web-server In-Reply-To: <779bf2730911071022l6721136dya0e4143c44ca2315@mail.gmail.com> References: <779bf2730911041952j327333cby1b983e324b731811@mail.gmail.com> <75455381-3af6-4195-9aa0-fea4d91f0236@15g2000yqy.googlegroups.com> <779bf2730911071022l6721136dya0e4143c44ca2315@mail.gmail.com> Message-ID: <9e6db062-ff49-47b8-9d83-b54bd691d87e@n35g2000yqm.googlegroups.com> I've looked at Ajax and am able to get the variable value but it always stays the same. When I can resolve that issue I'm done. Now, I put a hidden textbox in the servlet and set the value to the value of the variable. When I use Ajax and I want to renew the value of the textbox on the document with the value out of the XMLHttpRequest it's still the same as before although I know it has changed. I'm pretty new at the HTML-Javascript thing and it might be a stupid question but what do I do wrong? Thanks for all the replies, Jasper On 7 nov, 19:22, YC wrote: > On Thu, Nov 5, 2009 at 12:24 AM, Japus wrote: > > I already tried the meta-refresh technique and javascript too but the > > problem with those is that when I use a variable in it, it reads it's > > value when the code is generated and based on that it decides how long > > it takes to reload but it should reload when the value of that > > variable changes. > > Jasper - > > Meta-refresh gets you half way there with almost no work, but the remaining > half way is a major undertaking if you haven't done it before, so that's why > I mentioned meta-refresh as an option unless you are ready to go all the > way. > > Assuming you are ready to go all the way - you'll have to get familiarized > with ajax & http comet, as they are the solution to your question. ?There > are abundant information on these topics on the web and books. ?The > techniques are server independent, so you can use them with plt web-server. > > > > > So it should constantly check the variable and see > > if the variable has changed and when it has, instantly reload. If it > > hasn't changed, nothing should happen. > > The $64K question here is: since the variable exists on the server, and you > need to "constantly" check it from the client, how do you do so without a > "reload"? > > Again - look at ajax & comet - they are designed specifically to answer this > question. > > HTH. ?Cheers. > yc > > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme From neil at neilvandyke.org Mon Nov 9 03:27:44 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Mon Nov 9 03:28:03 2009 Subject: [plt-scheme] Scheme productivity data point In-Reply-To: References: <4AF6E07D.1050901@neilvandyke.org> <4AF7022F.9010905@cs.utah.edu> Message-ID: <4AF7D280.9070007@neilvandyke.org> Noel Welsh wrote at 11/08/2009 03:43 PM: > The issue is total time to complete the job. Neil is saying that w/ Scheme > What Noel said. Disregard the non sequitur about the about the size of the output files; that was quoted to help support the validity of my file I/O comparisons, but then I decided I didn't need to support those in a blog post, yet accidentally neglected to remove that part from the quote. The nature of the work done, however, is relevant, since not all tools are necessarily good at all tasks. PLT Scheme happens to be a good general-purpose toolset, IMHO, but my anecdote alone doesn't go far to supporting that. From laurent.orseau at gmail.com Mon Nov 9 04:39:36 2009 From: laurent.orseau at gmail.com (Laurent) Date: Mon Nov 9 04:40:17 2009 Subject: [plt-scheme] parser tools In-Reply-To: References: Message-ID: Hi, I don't know much about the parser tools, so I can't help you on that. But I recently made a simple quick-and-dirty text parser tool: http://planet.plt-scheme.org/package-source/orseau/lazy-doc.plt/1/6/planet-docs/manual/simple-parser.html It does not make any difference between lexing and parsing, so you can mix both easily. It can also be controlled dynamically so you should be able to modify the separator on the fly. If you're interested I can provide some more help. For larger applications than quick-and-dirty, I would certainly recommend the integrated parsing tools, though. Although if all you need is separate data with a given string, then using a lexer and a parser might be a bit overkill... Maybe using just regexp-split would be enough. Laurent 2009/11/7 Ivanyi Peter > Hi, > > Is it possible to create a lexer and parser dynamically? > I would like to create an application, which, for example, reads in a file > which contains what the separator character is and after that > the program can read in another file, but considers the separator > character. Somehow I could not manage to create a variable, which > then can be used in a lexer. Any way to do this? > > Thanks for any help. > > Best regards, > > Peter Ivanyi > > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091109/7e7e4d96/attachment.htm From stephen.degabrielle at acm.org Mon Nov 9 04:54:46 2009 From: stephen.degabrielle at acm.org (Stephen De Gabrielle) Date: Mon Nov 9 04:55:08 2009 Subject: [plt-scheme] Changing the draw behaviour of a selected editor snip Message-ID: <595b9ab20911090154iaf2587fxb004dfa677bc4cc1@mail.gmail.com> Hi, I'm trying to Change the draw behaviour of a selected editor snip in a pasteboard%. I am making a datagrid editor on top of pasteboard and editor-snip because I don't want to duplicate functionality. My problem is how I can determine where the 'compass point' square dots that are used to show an editor snip is selected are drawn- so I can override with my own draw method(invert). Any pointers gratefully accepted. Thanks, Stephen ps code http://code.google.com/p/projects-project/source/browse/trunk/gui/DataGrid.ss -- -- Stephen De Gabrielle stephen.degabrielle@acm.org Telephone +44 (0)20 85670911 Mobile +44 (0)79 85189045 http://www.degabrielle.name/stephen From yinso.chen at gmail.com Mon Nov 9 05:18:28 2009 From: yinso.chen at gmail.com (YC) Date: Mon Nov 9 05:18:47 2009 Subject: [plt-scheme] PLT's version number rules Message-ID: <779bf2730911090218w23ccc904n84af339bd68b1ebf@mail.gmail.com> Hi all - I am wondering if anyone knows the rules governing the PLT's version number? I am interested in comparing and ordering PLT's version numbers. Below are what I am aware of: - before v4, the version numbers are a single integer (300 = version 3.0, 372 = version 3.72) - since v4, the version numbers are .., like 4.2.2, where all are numbers; and presumably this will be the case for a while Are there other rules? For example - what would be the rules for pre or svn builds? Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091109/59665fd3/attachment.htm From robby at eecs.northwestern.edu Mon Nov 9 06:37:18 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Mon Nov 9 06:37:45 2009 Subject: [plt-scheme] parser tools In-Reply-To: References: Message-ID: <932b2f1f0911090337l147ad39dp521010da555a7964@mail.gmail.com> You can write a lexer that just just directly looks at the port to find the separator, or turn it into the eof token to just read multiple programs from the port. Does that help? Robby 2009/11/7 Ivanyi Peter : > Hi, > > Is it possible to create a lexer and parser dynamically? > I would like to create an application, which, for example, reads in a file > which contains what the separator character is and after that > the program can read in another file, but considers the separator > character. Somehow I could not manage to create a variable, which > then can be used in a lexer. Any way to do this? > > Thanks for any help. > > Best regards, > > Peter Ivanyi > > > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From robby at eecs.northwestern.edu Mon Nov 9 06:44:25 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Mon Nov 9 06:44:47 2009 Subject: [plt-scheme] PLT's version number rules In-Reply-To: <779bf2730911090218w23ccc904n84af339bd68b1ebf@mail.gmail.com> References: <779bf2730911090218w23ccc904n84af339bd68b1ebf@mail.gmail.com> Message-ID: <932b2f1f0911090344ubb0662fr5c5e5087d2c4a9f0@mail.gmail.com> Check out the version/utils library. Robby On Mon, Nov 9, 2009 at 4:18 AM, YC wrote: > Hi all - > > I am wondering if anyone knows the rules governing the PLT's version > number?? I am interested in comparing and ordering PLT's version numbers. > Below are what I am aware of: > > before v4, the version numbers are a single integer (300 = version 3.0, 372 > = version 3.72) > since v4, the version numbers are .., like 4.2.2, > where all are numbers; and presumably this will be the case for a while > > Are there other rules?? For example - what would be the rules for pre or svn > builds? > > Thanks, > yc > > > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From mflatt at cs.utah.edu Mon Nov 9 07:54:48 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Mon Nov 9 07:55:16 2009 Subject: [plt-scheme] Changing the draw behaviour of a selected editor snip In-Reply-To: <595b9ab20911090154iaf2587fxb004dfa677bc4cc1@mail.gmail.com> References: <595b9ab20911090154iaf2587fxb004dfa677bc4cc1@mail.gmail.com> Message-ID: <20091109125448.2B33F6500C3@mail-svr1.cs.utah.edu> The way that a selection is drawn is currently not an overrideable method. It's built into the `draw' method in "collects/mred/private/wxme/pasteboard.ss". If you'd like to change "pasteboard.ss" to add a method, I'd be willing to apply a patch. More generally, if you think it would be easier to work at the same level as "pasteboard.ss" and "text.ss" (reusing part of the "pasteboard.ss" implementation, but not all of it), I think it would make sense to add "grid.ss" as a third kind of built-in `editor<%>'. At Mon, 9 Nov 2009 09:54:46 +0000, Stephen De Gabrielle wrote: > Hi, > I'm trying to Change the draw behaviour of a selected editor snip in a > pasteboard%. > > I am making a datagrid editor on top of pasteboard and editor-snip > because I don't want to duplicate functionality. > > My problem is how I can determine where the 'compass point' square > dots that are used to show an editor snip is selected are drawn- so I > can override with my own draw method(invert). > > Any pointers gratefully accepted. > > Thanks, Stephen > > ps code > http://code.google.com/p/projects-project/source/browse/trunk/gui/DataGrid.ss > > -- > > -- > Stephen De Gabrielle > stephen.degabrielle@acm.org > Telephone +44 (0)20 85670911 > Mobile +44 (0)79 85189045 > http://www.degabrielle.name/stephen > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From stephen.degabrielle at acm.org Mon Nov 9 08:06:58 2009 From: stephen.degabrielle at acm.org (Stephen De Gabrielle) Date: Mon Nov 9 08:07:21 2009 Subject: [plt-scheme] Re: Changing the draw behaviour of a selected editor snip In-Reply-To: <20091109125448.2B33F6500C3@mail-svr1.cs.utah.edu> References: <595b9ab20911090154iaf2587fxb004dfa677bc4cc1@mail.gmail.com> <20091109125448.2B33F6500C3@mail-svr1.cs.utah.edu> Message-ID: <595b9ab20911090506j20920fe6rfc14624a2634ec5f@mail.gmail.com> Thank I'll take a look. How do you do testing when working at this level. Is it just a matter of lots of edit rebuild restart (rollback), repeat? Cheers, Stephen On Monday, November 9, 2009, Matthew Flatt wrote: > The way that a selection is drawn is currently not an overrideable > method. It's built into the `draw' method in > "collects/mred/private/wxme/pasteboard.ss". > > If you'd like to change "pasteboard.ss" to add a method, I'd be willing > to apply a patch. > > More generally, if you think it would be easier to work at the same > level as "pasteboard.ss" and "text.ss" (reusing part of the > "pasteboard.ss" implementation, but not all of it), I think it would > make sense to add "grid.ss" as a third kind of built-in `editor<%>'. > > At Mon, 9 Nov 2009 09:54:46 +0000, Stephen De Gabrielle wrote: >> Hi, >> I'm trying to Change the draw behaviour of a selected editor snip in a >> pasteboard%. >> >> I am making a datagrid editor on top of pasteboard and editor-snip >> because I don't want to duplicate functionality. >> >> My problem is how I can determine where the 'compass point' square >> dots that are used to show an editor snip is selected are drawn- so I >> can override with my own draw method(invert). >> >> Any pointers gratefully accepted. >> >> Thanks, Stephen >> >> ps code >> ?http://code.google.com/p/projects-project/source/browse/trunk/gui/DataGrid.ss >> >> -- >> >> -- >> Stephen De Gabrielle >> stephen.degabrielle@acm.org >> Telephone +44 (0)20 85670911 >> Mobile ? ? ? ?+44 (0)79 85189045 >> http://www.degabrielle.name/stephen >> _________________________________________________ >> ? For list-related administrative tasks: >> ? http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- -- Stephen De Gabrielle stephen.degabrielle@acm.org Telephone +44 (0)20 85670911 Mobile +44 (0)79 85189045 http://www.degabrielle.name/stephen From stephen.degabrielle at acm.org Mon Nov 9 08:24:21 2009 From: stephen.degabrielle at acm.org (Stephen De Gabrielle) Date: Mon Nov 9 08:24:42 2009 Subject: [plt-scheme] Re: Changing the draw behaviour of a selected editor snip In-Reply-To: <20091109125448.2B33F6500C3@mail-svr1.cs.utah.edu> References: <595b9ab20911090154iaf2587fxb004dfa677bc4cc1@mail.gmail.com> <20091109125448.2B33F6500C3@mail-svr1.cs.utah.edu> Message-ID: <595b9ab20911090524n3ee0a980x9110b29145661443@mail.gmail.com> Hi Matthew, It occurs to me that I'll need to duplicate pasteboard to make the changes anyway! I'll see what I can do. Thanks again, Stephen On Monday, November 9, 2009, Matthew Flatt wrote: > The way that a selection is drawn is currently not an overrideable > method. It's built into the `draw' method in > "collects/mred/private/wxme/pasteboard.ss". > > If you'd like to change "pasteboard.ss" to add a method, I'd be willing > to apply a patch. > > More generally, if you think it would be easier to work at the same > level as "pasteboard.ss" and "text.ss" (reusing part of the > "pasteboard.ss" implementation, but not all of it), I think it would > make sense to add "grid.ss" as a third kind of built-in `editor<%>'. > > At Mon, 9 Nov 2009 09:54:46 +0000, Stephen De Gabrielle wrote: >> Hi, >> I'm trying to Change the draw behaviour of a selected editor snip in a >> pasteboard%. >> >> I am making a datagrid editor on top of pasteboard and editor-snip >> because I don't want to duplicate functionality. >> >> My problem is how I can determine where the 'compass point' square >> dots that are used to show an editor snip is selected are drawn- so I >> can override with my own draw method(invert). >> >> Any pointers gratefully accepted. >> >> Thanks, Stephen >> >> ps code >> ?http://code.google.com/p/projects-project/source/browse/trunk/gui/DataGrid.ss >> >> -- >> >> -- >> Stephen De Gabrielle >> stephen.degabrielle@acm.org >> Telephone +44 (0)20 85670911 >> Mobile ? ? ? ?+44 (0)79 85189045 >> http://www.degabrielle.name/stephen >> _________________________________________________ >> ? For list-related administrative tasks: >> ? http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- -- Stephen De Gabrielle stephen.degabrielle@acm.org Telephone +44 (0)20 85670911 Mobile +44 (0)79 85189045 http://www.degabrielle.name/stephen From stephen.degabrielle at acm.org Mon Nov 9 08:56:57 2009 From: stephen.degabrielle at acm.org (Stephen De Gabrielle) Date: Mon Nov 9 09:05:28 2009 Subject: [plt-scheme] Speed up check-syntax Message-ID: <595b9ab20911090556u5115e7dfpfdd863588ea3fb34@mail.gmail.com> Hi, I'm refactoring some mred code, and I'm finding check syntax has got painfully slow. Does anyone else experience this and what strategies do you use to avoid the problem? I don't think this is a mred specific issue- just an issue for code with lots of dependencies. Thanks, Stephen -- -- Stephen De Gabrielle stephen.degabrielle@acm.org Telephone +44 (0)20 85670911 Mobile +44 (0)79 85189045 http://www.degabrielle.name/stephen From matthias at ccs.neu.edu Mon Nov 9 09:23:55 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Mon Nov 9 09:24:23 2009 Subject: [plt-scheme] Speed up check-syntax In-Reply-To: <595b9ab20911090556u5115e7dfpfdd863588ea3fb34@mail.gmail.com> References: <595b9ab20911090556u5115e7dfpfdd863588ea3fb34@mail.gmail.com> Message-ID: I have noticed this too. The first time around check syntax is indeed painfully slow. The second time+ it is as fast as it used to be. On Nov 9, 2009, at 8:56 AM, Stephen De Gabrielle wrote: > Hi, I'm refactoring some mred code, and I'm finding check syntax has > got painfully slow. > Does anyone else experience this and what strategies do you use to > avoid the problem? > > I don't think this is a mred specific issue- just an issue for code > with lots of dependencies. > > Thanks, > > Stephen > > -- > > -- > Stephen De Gabrielle > stephen.degabrielle@acm.org > Telephone +44 (0)20 85670911 > Mobile +44 (0)79 85189045 > http://www.degabrielle.name/stephen > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From wookiz at hotmail.com Mon Nov 9 09:41:02 2009 From: wookiz at hotmail.com (wooks) Date: Mon Nov 9 09:41:19 2009 Subject: [plt-scheme] Poacher turned gamekeeper Message-ID: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> I will be teaching software development to the uninitiated at a private college and they have agreed to let me use HTDP. I have a week to prepare and would be grateful for pointers to any resources aside from the obvious (book and DrScheme). From nadeem at acm.org Mon Nov 9 09:48:17 2009 From: nadeem at acm.org (Nadeem Abdul Hamid) Date: Mon Nov 9 09:49:07 2009 Subject: [plt-scheme] Poacher turned gamekeeper In-Reply-To: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> References: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> Message-ID: Look at Kathy Fisler's and Matthew Flatt's course materials -- linked off their respective websites. They are, among the other HTDP-based course sites you can find on Google, extremely helpful as far as pacing the material, getting ideas for assignments and labs, etc. (Thank you, Kathy and Matthew!) Also, have a look at HTDP/2e linked off Matthias' website to get an idea of techniques/methods that have changed or been introduced since the book was written, such as the new functional-based world.ss/ universe.ss teachpacks (instead of the draw.ss teachpack in the book -- don't use that or any of the exercises based on draw.ss in the book -- use world.ss instead; it's much cooler), and the check-expect style of writing examples/test cases. --- nadeem On Nov 9, 2009, at 9:41 AM, wooks wrote: > I will be teaching software development to the uninitiated at a > private college and they have agreed to let me use HTDP. > > I have a week to prepare and would be grateful for pointers to any > resources aside from the obvious (book and DrScheme). > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From matthias at ccs.neu.edu Mon Nov 9 09:50:40 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Mon Nov 9 09:51:09 2009 Subject: [plt-scheme] Poacher turned gamekeeper In-Reply-To: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> References: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> Message-ID: <39BE9753-0F4B-4E46-84D4-D7E5186150B4@ccs.neu.edu> 1. Use HtDP/2e to get started. Then switch. 2. Diagnose first like this. Unless this is a first semester course, ask students to design some function/method in their favorite language (C, C++, Python, ...). Use a simple recursion data type, e.g., geom-shape = circle | square | on-top-of(geom-shape,geom-shape) plus an in? function, which consumes a cartesian point and a shape and determines whether the point is within the shape. 3. Assuming that the majority can't solve it, proceed with 'in decent colleges, this kind of stuff is taught in the first course.' On Nov 9, 2009, at 9:41 AM, wooks wrote: > I will be teaching software development to the uninitiated at a > private college and they have agreed to let me use HTDP. > > I have a week to prepare and would be grateful for pointers to any > resources aside from the obvious (book and DrScheme). > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From grettke at acm.org Mon Nov 9 10:23:22 2009 From: grettke at acm.org (Grant Rettke) Date: Mon Nov 9 10:23:42 2009 Subject: [plt-scheme] Poacher turned gamekeeper In-Reply-To: References: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> Message-ID: <756daca50911090723g3d7366f9q40be39df58968f82@mail.gmail.com> On Mon, Nov 9, 2009 at 8:48 AM, Nadeem Abdul Hamid wrote: > Also, have a look at HTDP/2e linked off Matthias' website to get an idea of > techniques/methods that have changed or been introduced since the book was > written, such as the new functional-based world.ss/universe.ss teachpacks > (instead of the draw.ss teachpack in the book -- don't use that or any of > the exercises based on draw.ss in the book -- use world.ss instead; it's > much cooler), and the check-expect style of writing examples/test cases. That seems like helpful information for self-studiers. What else should we know? From sbloch at adelphi.edu Mon Nov 9 10:43:16 2009 From: sbloch at adelphi.edu (Stephen Bloch) Date: Mon Nov 9 10:43:49 2009 Subject: [plt-scheme] Poacher turned gamekeeper In-Reply-To: <39BE9753-0F4B-4E46-84D4-D7E5186150B4@ccs.neu.edu> References: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> <39BE9753-0F4B-4E46-84D4-D7E5186150B4@ccs.neu.edu> Message-ID: On Nov 9, 2009, at 9:50 AM, Matthias Felleisen wrote: > 1. Use HtDP/2e to get started. Then switch. You can also take a look at my _Picturing Programs_, which covers a lot of the same things as HtDP/2e (including, of course, the functional graphics and animation stuff -- don't use the graphics exercises in HtDP). The biggest difference is that (because a lot of my students are mathophobic) PP starts with images, and doesn't mention arithmetic until after your students have written a lot of functions and even a few animations. > 2. Diagnose first like this. Unless this is a first semester course, > ask students to design some function/method in their favorite > language (C, C++, Python, ...). Use a simple recursion data type, > e.g., > > geom-shape = circle | square | on-top-of(geom-shape,geom-shape) > > plus an in? function, which consumes a cartesian point and a shape > and determines whether the point is within the shape. > > 3. Assuming that the majority can't solve it, proceed with 'in > decent colleges, this kind of stuff is taught in the first course.' Or you could NOT open with antagonism and NOT run down the students' previous teachers and background. Instead, I would say "for those of you who have done some programming before, we'll be doing it a little differently; this approach may seem weird to you at first, but in my experience, it helps you produce correct, working programs faster. Approach it with an open mind, and you can combine the best of both approaches." You'll have to decide, based on your group of students, whether it'll work better to start by showing them how much they don't know. Steve Bloch > From robby at eecs.northwestern.edu Mon Nov 9 10:57:28 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Mon Nov 9 10:57:50 2009 Subject: [plt-scheme] Speed up check-syntax In-Reply-To: References: <595b9ab20911090556u5115e7dfpfdd863588ea3fb34@mail.gmail.com> Message-ID: <932b2f1f0911090757i1a4fe4e9rdf5b9e4fb6efd84b@mail.gmail.com> The first time you run it, it loads in the documentation indicies. That might be it. (Watch the status line at the bottom of the screen and see if that's where it looks like the time is going to know for sure.) Robby On Mon, Nov 9, 2009 at 8:23 AM, Matthias Felleisen wrote: > > I have noticed this too. The first time around check syntax is indeed > painfully slow. The second time+ it is as fast as it used to be. > > > On Nov 9, 2009, at 8:56 AM, Stephen De Gabrielle wrote: > >> Hi, I'm refactoring some mred code, and I'm finding check syntax has >> got painfully slow. >> Does anyone else experience this and what strategies do you use to >> avoid the problem? >> >> I don't think this is a mred specific issue- just an issue for code >> with lots of dependencies. >> >> Thanks, >> >> Stephen >> >> -- >> >> -- >> Stephen De Gabrielle >> stephen.degabrielle@acm.org >> Telephone +44 (0)20 85670911 >> Mobile ? ? ? ?+44 (0)79 85189045 >> http://www.degabrielle.name/stephen >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From matthias at ccs.neu.edu Mon Nov 9 11:27:18 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Mon Nov 9 11:27:47 2009 Subject: [plt-scheme] Speed up check-syntax In-Reply-To: <932b2f1f0911090757i1a4fe4e9rdf5b9e4fb6efd84b@mail.gmail.com> References: <595b9ab20911090556u5115e7dfpfdd863588ea3fb34@mail.gmail.com> <932b2f1f0911090757i1a4fe4e9rdf5b9e4fb6efd84b@mail.gmail.com> Message-ID: Yes, I know. It's very slow. Can't we load these indices while the user types in something? On Nov 9, 2009, at 10:57 AM, Robby Findler wrote: > The first time you run it, it loads in the documentation indicies. > That might be it. (Watch the status line at the bottom of the screen > and see if that's where it looks like the time is going to know for > sure.) > > Robby > > On Mon, Nov 9, 2009 at 8:23 AM, Matthias Felleisen > wrote: >> >> I have noticed this too. The first time around check syntax is indeed >> painfully slow. The second time+ it is as fast as it used to be. >> >> >> On Nov 9, 2009, at 8:56 AM, Stephen De Gabrielle wrote: >> >>> Hi, I'm refactoring some mred code, and I'm finding check syntax has >>> got painfully slow. >>> Does anyone else experience this and what strategies do you use to >>> avoid the problem? >>> >>> I don't think this is a mred specific issue- just an issue for code >>> with lots of dependencies. >>> >>> Thanks, >>> >>> Stephen >>> >>> -- >>> >>> -- >>> Stephen De Gabrielle >>> stephen.degabrielle@acm.org >>> Telephone +44 (0)20 85670911 >>> Mobile +44 (0)79 85189045 >>> http://www.degabrielle.name/stephen >>> _________________________________________________ >>> For list-related administrative tasks: >>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> From robby at eecs.northwestern.edu Mon Nov 9 11:28:52 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Mon Nov 9 11:29:15 2009 Subject: [plt-scheme] Speed up check-syntax In-Reply-To: References: <595b9ab20911090556u5115e7dfpfdd863588ea3fb34@mail.gmail.com> <932b2f1f0911090757i1a4fe4e9rdf5b9e4fb6efd84b@mail.gmail.com> Message-ID: <932b2f1f0911090828p72588563o9f83f758af475041@mail.gmail.com> Sounds like a good task for when we get multicore support. I'll pass that along to James and probably Kevin is reading this message. Robby On Mon, Nov 9, 2009 at 10:27 AM, Matthias Felleisen wrote: > > Yes, I know. It's very slow. Can't we load these indices while the user > types in something? > > > On Nov 9, 2009, at 10:57 AM, Robby Findler wrote: > >> The first time you run it, it loads in the documentation indicies. >> That might be it. (Watch the status line at the bottom of the screen >> and see if that's where it looks like the time is going to know for >> sure.) >> >> Robby >> >> On Mon, Nov 9, 2009 at 8:23 AM, Matthias Felleisen >> wrote: >>> >>> I have noticed this too. The first time around check syntax is indeed >>> painfully slow. The second time+ it is as fast as it used to be. >>> >>> >>> On Nov 9, 2009, at 8:56 AM, Stephen De Gabrielle wrote: >>> >>>> Hi, I'm refactoring some mred code, and I'm finding check syntax has >>>> got painfully slow. >>>> Does anyone else experience this and what strategies do you use to >>>> avoid the problem? >>>> >>>> I don't think this is a mred specific issue- just an issue for code >>>> with lots of dependencies. >>>> >>>> Thanks, >>>> >>>> Stephen >>>> >>>> -- >>>> >>>> -- >>>> Stephen De Gabrielle >>>> stephen.degabrielle@acm.org >>>> Telephone +44 (0)20 85670911 >>>> Mobile ? ? ? ?+44 (0)79 85189045 >>>> http://www.degabrielle.name/stephen >>>> _________________________________________________ >>>> ?For list-related administrative tasks: >>>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>> >>> _________________________________________________ >>> ?For list-related administrative tasks: >>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>> > > From noelwelsh at gmail.com Mon Nov 9 11:37:37 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Mon Nov 9 11:38:07 2009 Subject: [plt-scheme] Re: Restart Web-server In-Reply-To: <9e6db062-ff49-47b8-9d83-b54bd691d87e@n35g2000yqm.googlegroups.com> References: <779bf2730911041952j327333cby1b983e324b731811@mail.gmail.com> <75455381-3af6-4195-9aa0-fea4d91f0236@15g2000yqy.googlegroups.com> <779bf2730911071022l6721136dya0e4143c44ca2315@mail.gmail.com> <9e6db062-ff49-47b8-9d83-b54bd691d87e@n35g2000yqm.googlegroups.com> Message-ID: On Sun, Nov 8, 2009 at 9:48 PM, Japus wrote: > Now, I put a hidden textbox in the servlet and set the value to the > value of the variable. When I use Ajax and I want to renew the value > of the textbox on the document with the value out of the > XMLHttpRequest it's still the same as before although I know it has > changed. > I'm pretty new at the HTML-Javascript thing and it might be a stupid > question but what do I do wrong? I doubt anyone can say unless they see some code. Why use a hidden textbox when you can just declare a variable in Javascript? N. From matthias at ccs.neu.edu Mon Nov 9 12:02:24 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Mon Nov 9 12:02:49 2009 Subject: [plt-scheme] Poacher turned gamekeeper In-Reply-To: References: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> <39BE9753-0F4B-4E46-84D4-D7E5186150B4@ccs.neu.edu> Message-ID: On Nov 9, 2009, at 10:43 AM, Stephen Bloch wrote: >> >> 3. Assuming that the majority can't solve it, proceed with 'in >> decent colleges, this kind of stuff is taught in the first course.' > > Or you could NOT open with antagonism and NOT run down the students' > previous teachers and background. Instead, I would say "for those > of you who have done some programming before, we'll be doing it a > little differently; this approach may seem weird to you at first, > but in my experience, it helps you produce correct, working programs > faster. Approach it with an open mind, and you can combine the best > of both approaches." You'll have to decide, based on your group of > students, whether it'll work better to start by showing them how > much they don't know. Just drop the phrase "in decent colleges ..." but conduct the experiment anyway. Do tell them that good programmers can solve these questions easily and you will teach them how and more about systematic programmers. I repeatedly get students who think that their bad grades in an HtDP course are due to the odd choice of language. Over 10+ years, I have easily overcome strong versions of such opinions with "no problem. What language would you like to use? I'll give you an A for the course if you can solve this problem ..." A variation is to do it at the beginning and to let people go who can solve such things (give them the option). In my 10+ years, I have had ONE student who solved the problem in the alotted 30 mins, indeed, he needed much less time and he didn't do it in anything modern: he did it in C. He had 15 years of experience and no contact to FP. BUT he was a good programmer and he wanted to take my course anyway. -- Matthias From robby at eecs.northwestern.edu Mon Nov 9 13:09:50 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Mon Nov 9 13:10:11 2009 Subject: [plt-scheme] Speed up check-syntax In-Reply-To: References: <595b9ab20911090556u5115e7dfpfdd863588ea3fb34@mail.gmail.com> <932b2f1f0911090757i1a4fe4e9rdf5b9e4fb6efd84b@mail.gmail.com> <932b2f1f0911090828p72588563o9f83f758af475041@mail.gmail.com> Message-ID: <932b2f1f0911091009jec184kbe02b576da713d42@mail.gmail.com> Then it would slowdown the startup time by that much and people who don't use check syntax would suffer. Robby On Mon, Nov 9, 2009 at 12:02 PM, Jaime Vargas wrote: > Why not simple load them on startup? > > On Nov 9, 2009, at 11:28 AM, Robby Findler wrote: > >> Sounds like a good task for when we get multicore support. I'll pass >> that along to James and probably Kevin is reading this message. >> >> Robby >> >> On Mon, Nov 9, 2009 at 10:27 AM, Matthias Felleisen >> wrote: >>> >>> Yes, I know. It's very slow. Can't we load these indices while the user >>> types in something? >>> >>> >>> On Nov 9, 2009, at 10:57 AM, Robby Findler wrote: >>> >>>> The first time you run it, it loads in the documentation indicies. >>>> That might be it. (Watch the status line at the bottom of the screen >>>> and see if that's where it looks like the time is going to know for >>>> sure.) >>>> >>>> Robby >>>> >>>> On Mon, Nov 9, 2009 at 8:23 AM, Matthias Felleisen >>>> >>>> wrote: >>>>> >>>>> I have noticed this too. The first time around check syntax is indeed >>>>> painfully slow. The second time+ it is as fast as it used to be. >>>>> >>>>> >>>>> On Nov 9, 2009, at 8:56 AM, Stephen De Gabrielle wrote: >>>>> >>>>>> Hi, I'm refactoring some mred code, and I'm finding check syntax has >>>>>> got painfully slow. >>>>>> Does anyone else experience this and what strategies do you use to >>>>>> avoid the problem? >>>>>> >>>>>> I don't think this is a mred specific issue- just an issue for code >>>>>> with lots of dependencies. >>>>>> >>>>>> Thanks, >>>>>> >>>>>> Stephen >>>>>> >>>>>> -- >>>>>> >>>>>> -- >>>>>> Stephen De Gabrielle >>>>>> stephen.degabrielle@acm.org >>>>>> Telephone +44 (0)20 85670911 >>>>>> Mobile ? ? ? ?+44 (0)79 85189045 >>>>>> http://www.degabrielle.name/stephen >>>>>> _________________________________________________ >>>>>> ?For list-related administrative tasks: >>>>>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>>>> >>>>> _________________________________________________ >>>>> ?For list-related administrative tasks: >>>>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>>>> >>> >>> >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From matthias at ccs.neu.edu Mon Nov 9 13:13:26 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Mon Nov 9 13:13:55 2009 Subject: [plt-scheme] Speed up check-syntax In-Reply-To: <932b2f1f0911091009jec184kbe02b576da713d42@mail.gmail.com> References: <595b9ab20911090556u5115e7dfpfdd863588ea3fb34@mail.gmail.com> <932b2f1f0911090757i1a4fe4e9rdf5b9e4fb6efd84b@mail.gmail.com> <932b2f1f0911090828p72588563o9f83f758af475041@mail.gmail.com> <932b2f1f0911091009jec184kbe02b576da713d42@mail.gmail.com> Message-ID: Could we approximate parallelism with a 'niced' threading model? -- Matthias On Nov 9, 2009, at 1:09 PM, Robby Findler wrote: > Then it would slowdown the startup time by that much and people who > don't use check syntax would suffer. > > Robby > > On Mon, Nov 9, 2009 at 12:02 PM, Jaime Vargas wrote: >> Why not simple load them on startup? >> >> On Nov 9, 2009, at 11:28 AM, Robby Findler wrote: >> >>> Sounds like a good task for when we get multicore support. I'll pass >>> that along to James and probably Kevin is reading this message. >>> >>> Robby >>> >>> On Mon, Nov 9, 2009 at 10:27 AM, Matthias Felleisen >>> wrote: >>>> >>>> Yes, I know. It's very slow. Can't we load these indices while >>>> the user >>>> types in something? >>>> >>>> >>>> On Nov 9, 2009, at 10:57 AM, Robby Findler wrote: >>>> >>>>> The first time you run it, it loads in the documentation indicies. >>>>> That might be it. (Watch the status line at the bottom of the >>>>> screen >>>>> and see if that's where it looks like the time is going to know >>>>> for >>>>> sure.) >>>>> >>>>> Robby >>>>> >>>>> On Mon, Nov 9, 2009 at 8:23 AM, Matthias Felleisen >>>>> >>>>> wrote: >>>>>> >>>>>> I have noticed this too. The first time around check syntax is >>>>>> indeed >>>>>> painfully slow. The second time+ it is as fast as it used to be. >>>>>> >>>>>> >>>>>> On Nov 9, 2009, at 8:56 AM, Stephen De Gabrielle wrote: >>>>>> >>>>>>> Hi, I'm refactoring some mred code, and I'm finding check >>>>>>> syntax has >>>>>>> got painfully slow. >>>>>>> Does anyone else experience this and what strategies do you >>>>>>> use to >>>>>>> avoid the problem? >>>>>>> >>>>>>> I don't think this is a mred specific issue- just an issue for >>>>>>> code >>>>>>> with lots of dependencies. >>>>>>> >>>>>>> Thanks, >>>>>>> >>>>>>> Stephen >>>>>>> >>>>>>> -- >>>>>>> >>>>>>> -- >>>>>>> Stephen De Gabrielle >>>>>>> stephen.degabrielle@acm.org >>>>>>> Telephone +44 (0)20 85670911 >>>>>>> Mobile +44 (0)79 85189045 >>>>>>> http://www.degabrielle.name/stephen >>>>>>> _________________________________________________ >>>>>>> For list-related administrative tasks: >>>>>>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>>>>> >>>>>> _________________________________________________ >>>>>> For list-related administrative tasks: >>>>>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>>>>> >>>> >>>> >>> _________________________________________________ >>> For list-related administrative tasks: >>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> From yinso.chen at gmail.com Mon Nov 9 13:16:26 2009 From: yinso.chen at gmail.com (YC) Date: Mon Nov 9 13:16:48 2009 Subject: [plt-scheme] PLT's version number rules In-Reply-To: <932b2f1f0911090344ubb0662fr5c5e5087d2c4a9f0@mail.gmail.com> References: <779bf2730911090218w23ccc904n84af339bd68b1ebf@mail.gmail.com> <932b2f1f0911090344ubb0662fr5c5e5087d2c4a9f0@mail.gmail.com> Message-ID: <779bf2730911091016p46802d5fo6cc49a13132befe5@mail.gmail.com> This is great - thanks Robby. yc On Mon, Nov 9, 2009 at 3:44 AM, Robby Findler wrote: > Check out the version/utils library. > > Robby > > On Mon, Nov 9, 2009 at 4:18 AM, YC wrote: > > Hi all - > > > > I am wondering if anyone knows the rules governing the PLT's version > > number? I am interested in comparing and ordering PLT's version numbers. > > Below are what I am aware of: > > > > before v4, the version numbers are a single integer (300 = version 3.0, > 372 > > = version 3.72) > > since v4, the version numbers are .., like 4.2.2, > > where all are numbers; and presumably this will be the case for a while > > > > Are there other rules? For example - what would be the rules for pre or > svn > > builds? > > > > Thanks, > > yc > > > > > > > > _________________________________________________ > > For list-related administrative tasks: > > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091109/5b251583/attachment.htm From robby at eecs.northwestern.edu Mon Nov 9 13:22:10 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Mon Nov 9 13:22:31 2009 Subject: [plt-scheme] Speed up check-syntax In-Reply-To: References: <595b9ab20911090556u5115e7dfpfdd863588ea3fb34@mail.gmail.com> <932b2f1f0911090757i1a4fe4e9rdf5b9e4fb6efd84b@mail.gmail.com> <932b2f1f0911090828p72588563o9f83f758af475041@mail.gmail.com> <932b2f1f0911091009jec184kbe02b576da713d42@mail.gmail.com> Message-ID: <932b2f1f0911091022y3344aa69qc928e555ad5c7e15@mail.gmail.com> I think what you're asking is if the parallelism we get from the disk and the cpu is already enough to get some speed up here(?). I'm not sure. Robby On Mon, Nov 9, 2009 at 12:13 PM, Matthias Felleisen wrote: > > Could we approximate parallelism with a 'niced' threading model? -- Matthias > > > > > > > > > On Nov 9, 2009, at 1:09 PM, Robby Findler wrote: > >> Then it would slowdown the startup time by that much and people who >> don't use check syntax would suffer. >> >> Robby >> >> On Mon, Nov 9, 2009 at 12:02 PM, Jaime Vargas wrote: >>> >>> Why not simple load them on startup? >>> >>> On Nov 9, 2009, at 11:28 AM, Robby Findler wrote: >>> >>>> Sounds like a good task for when we get multicore support. I'll pass >>>> that along to James and probably Kevin is reading this message. >>>> >>>> Robby >>>> >>>> On Mon, Nov 9, 2009 at 10:27 AM, Matthias Felleisen >>>> wrote: >>>>> >>>>> Yes, I know. It's very slow. Can't we load these indices while the user >>>>> types in something? >>>>> >>>>> >>>>> On Nov 9, 2009, at 10:57 AM, Robby Findler wrote: >>>>> >>>>>> The first time you run it, it loads in the documentation indicies. >>>>>> That might be it. (Watch the status line at the bottom of the screen >>>>>> and see if that's where it looks like the time is going to know for >>>>>> sure.) >>>>>> >>>>>> Robby >>>>>> >>>>>> On Mon, Nov 9, 2009 at 8:23 AM, Matthias Felleisen >>>>>> >>>>>> wrote: >>>>>>> >>>>>>> I have noticed this too. The first time around check syntax is indeed >>>>>>> painfully slow. The second time+ it is as fast as it used to be. >>>>>>> >>>>>>> >>>>>>> On Nov 9, 2009, at 8:56 AM, Stephen De Gabrielle wrote: >>>>>>> >>>>>>>> Hi, I'm refactoring some mred code, and I'm finding check syntax has >>>>>>>> got painfully slow. >>>>>>>> Does anyone else experience this and what strategies do you use to >>>>>>>> avoid the problem? >>>>>>>> >>>>>>>> I don't think this is a mred specific issue- just an issue for code >>>>>>>> with lots of dependencies. >>>>>>>> >>>>>>>> Thanks, >>>>>>>> >>>>>>>> Stephen >>>>>>>> >>>>>>>> -- >>>>>>>> >>>>>>>> -- >>>>>>>> Stephen De Gabrielle >>>>>>>> stephen.degabrielle@acm.org >>>>>>>> Telephone +44 (0)20 85670911 >>>>>>>> Mobile ? ? ? ?+44 (0)79 85189045 >>>>>>>> http://www.degabrielle.name/stephen >>>>>>>> _________________________________________________ >>>>>>>> ?For list-related administrative tasks: >>>>>>>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>>>>>> >>>>>>> _________________________________________________ >>>>>>> ?For list-related administrative tasks: >>>>>>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>>>>>> >>>>> >>>>> >>>> _________________________________________________ >>>> ?For list-related administrative tasks: >>>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>> >>> > > From jev at mac.com Mon Nov 9 13:33:47 2009 From: jev at mac.com (Jaime Vargas) Date: Mon Nov 9 13:34:43 2009 Subject: [plt-scheme] Speed up check-syntax In-Reply-To: <932b2f1f0911091009jec184kbe02b576da713d42@mail.gmail.com> References: <595b9ab20911090556u5115e7dfpfdd863588ea3fb34@mail.gmail.com> <932b2f1f0911090757i1a4fe4e9rdf5b9e4fb6efd84b@mail.gmail.com> <932b2f1f0911090828p72588563o9f83f758af475041@mail.gmail.com> <932b2f1f0911091009jec184kbe02b576da713d42@mail.gmail.com> Message-ID: But the cost will be amortized, specially if one keeps DrS running for days. Also, how about some caching mechanism, where the cache is pre-loaded at load time? On Nov 9, 2009, at 1:09 PM, Robby Findler wrote: > Then it would slowdown the startup time by that much and people who > don't use check syntax would suffer. > > Robby > > On Mon, Nov 9, 2009 at 12:02 PM, Jaime Vargas wrote: >> Why not simple load them on startup? >> >> On Nov 9, 2009, at 11:28 AM, Robby Findler wrote: >> >>> Sounds like a good task for when we get multicore support. I'll pass >>> that along to James and probably Kevin is reading this message. >>> >>> Robby >>> >>> On Mon, Nov 9, 2009 at 10:27 AM, Matthias Felleisen >>> wrote: >>>> >>>> Yes, I know. It's very slow. Can't we load these indices while >>>> the user >>>> types in something? >>>> >>>> >>>> On Nov 9, 2009, at 10:57 AM, Robby Findler wrote: >>>> >>>>> The first time you run it, it loads in the documentation indicies. >>>>> That might be it. (Watch the status line at the bottom of the >>>>> screen >>>>> and see if that's where it looks like the time is going to know >>>>> for >>>>> sure.) >>>>> >>>>> Robby >>>>> >>>>> On Mon, Nov 9, 2009 at 8:23 AM, Matthias Felleisen >>>>> >>>>> wrote: >>>>>> >>>>>> I have noticed this too. The first time around check syntax is >>>>>> indeed >>>>>> painfully slow. The second time+ it is as fast as it used to be. >>>>>> >>>>>> >>>>>> On Nov 9, 2009, at 8:56 AM, Stephen De Gabrielle wrote: >>>>>> >>>>>>> Hi, I'm refactoring some mred code, and I'm finding check >>>>>>> syntax has >>>>>>> got painfully slow. >>>>>>> Does anyone else experience this and what strategies do you >>>>>>> use to >>>>>>> avoid the problem? >>>>>>> >>>>>>> I don't think this is a mred specific issue- just an issue for >>>>>>> code >>>>>>> with lots of dependencies. >>>>>>> >>>>>>> Thanks, >>>>>>> >>>>>>> Stephen >>>>>>> >>>>>>> -- >>>>>>> >>>>>>> -- >>>>>>> Stephen De Gabrielle >>>>>>> stephen.degabrielle@acm.org >>>>>>> Telephone +44 (0)20 85670911 >>>>>>> Mobile +44 (0)79 85189045 >>>>>>> http://www.degabrielle.name/stephen >>>>>>> _________________________________________________ >>>>>>> For list-related administrative tasks: >>>>>>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>>>>> >>>>>> _________________________________________________ >>>>>> For list-related administrative tasks: >>>>>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>>>>> >>>> >>>> >>> _________________________________________________ >>> For list-related administrative tasks: >>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> From samth at ccs.neu.edu Mon Nov 9 13:36:05 2009 From: samth at ccs.neu.edu (Sam TH) Date: Mon Nov 9 13:36:48 2009 Subject: [plt-scheme] Speed up check-syntax In-Reply-To: <932b2f1f0911091022y3344aa69qc928e555ad5c7e15@mail.gmail.com> References: <595b9ab20911090556u5115e7dfpfdd863588ea3fb34@mail.gmail.com> <932b2f1f0911090757i1a4fe4e9rdf5b9e4fb6efd84b@mail.gmail.com> <932b2f1f0911090828p72588563o9f83f758af475041@mail.gmail.com> <932b2f1f0911091009jec184kbe02b576da713d42@mail.gmail.com> <932b2f1f0911091022y3344aa69qc928e555ad5c7e15@mail.gmail.com> Message-ID: <63bb19ae0911091036g30586b47td36281e7805e4695@mail.gmail.com> On Mon, Nov 9, 2009 at 1:22 PM, Robby Findler wrote: > I think what you're asking is if the parallelism we get from the disk > and the cpu is already enough to get some speed up here(?). I'm not > sure. Is there some way to run a thread after DrScheme finishes starting? I know that the first 30 seconds after DrScheme comes up I usually spend staring at the buffer. sam th > > Robby > > On Mon, Nov 9, 2009 at 12:13 PM, Matthias Felleisen > wrote: >> >> Could we approximate parallelism with a 'niced' threading model? -- Matthias >> >> >> >> >> >> >> >> >> On Nov 9, 2009, at 1:09 PM, Robby Findler wrote: >> >>> Then it would slowdown the startup time by that much and people who >>> don't use check syntax would suffer. >>> >>> Robby >>> >>> On Mon, Nov 9, 2009 at 12:02 PM, Jaime Vargas wrote: >>>> >>>> Why not simple load them on startup? >>>> >>>> On Nov 9, 2009, at 11:28 AM, Robby Findler wrote: >>>> >>>>> Sounds like a good task for when we get multicore support. I'll pass >>>>> that along to James and probably Kevin is reading this message. >>>>> >>>>> Robby >>>>> >>>>> On Mon, Nov 9, 2009 at 10:27 AM, Matthias Felleisen >>>>> wrote: >>>>>> >>>>>> Yes, I know. It's very slow. Can't we load these indices while the user >>>>>> types in something? >>>>>> >>>>>> >>>>>> On Nov 9, 2009, at 10:57 AM, Robby Findler wrote: >>>>>> >>>>>>> The first time you run it, it loads in the documentation indicies. >>>>>>> That might be it. (Watch the status line at the bottom of the screen >>>>>>> and see if that's where it looks like the time is going to know for >>>>>>> sure.) >>>>>>> >>>>>>> Robby >>>>>>> >>>>>>> On Mon, Nov 9, 2009 at 8:23 AM, Matthias Felleisen >>>>>>> >>>>>>> wrote: >>>>>>>> >>>>>>>> I have noticed this too. The first time around check syntax is indeed >>>>>>>> painfully slow. The second time+ it is as fast as it used to be. >>>>>>>> >>>>>>>> >>>>>>>> On Nov 9, 2009, at 8:56 AM, Stephen De Gabrielle wrote: >>>>>>>> >>>>>>>>> Hi, I'm refactoring some mred code, and I'm finding check syntax has >>>>>>>>> got painfully slow. >>>>>>>>> Does anyone else experience this and what strategies do you use to >>>>>>>>> avoid the problem? >>>>>>>>> >>>>>>>>> I don't think this is a mred specific issue- just an issue for code >>>>>>>>> with lots of dependencies. >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> >>>>>>>>> Stephen >>>>>>>>> >>>>>>>>> -- >>>>>>>>> >>>>>>>>> -- >>>>>>>>> Stephen De Gabrielle >>>>>>>>> stephen.degabrielle@acm.org >>>>>>>>> Telephone +44 (0)20 85670911 >>>>>>>>> Mobile ? ? ? ?+44 (0)79 85189045 >>>>>>>>> http://www.degabrielle.name/stephen >>>>>>>>> _________________________________________________ >>>>>>>>> ?For list-related administrative tasks: >>>>>>>>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>>>>>>> >>>>>>>> _________________________________________________ >>>>>>>> ?For list-related administrative tasks: >>>>>>>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>>>>>>> >>>>>> >>>>>> >>>>> _________________________________________________ >>>>> ?For list-related administrative tasks: >>>>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>>> >>>> >> >> > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- sam th samth@ccs.neu.edu From robby at eecs.northwestern.edu Mon Nov 9 13:41:20 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Mon Nov 9 13:41:37 2009 Subject: [plt-scheme] Speed up check-syntax In-Reply-To: References: <595b9ab20911090556u5115e7dfpfdd863588ea3fb34@mail.gmail.com> <932b2f1f0911090757i1a4fe4e9rdf5b9e4fb6efd84b@mail.gmail.com> <932b2f1f0911090828p72588563o9f83f758af475041@mail.gmail.com> <932b2f1f0911091009jec184kbe02b576da713d42@mail.gmail.com> Message-ID: <932b2f1f0911091041o2657df9ehe6d0766115bdd76@mail.gmail.com> On Mon, Nov 9, 2009 at 12:33 PM, Jaime Vargas wrote: > But the cost will be amortized, specially if one keeps DrS running for days. The documentation index is only loaded (already). > Also, how about some caching mechanism, where the cache is pre-loaded at > load time? This is already happening too. It is filling the cache that takes the time here. Robby From robby at eecs.northwestern.edu Mon Nov 9 13:44:19 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Mon Nov 9 13:44:40 2009 Subject: [plt-scheme] Speed up check-syntax In-Reply-To: <63bb19ae0911091036g30586b47td36281e7805e4695@mail.gmail.com> References: <595b9ab20911090556u5115e7dfpfdd863588ea3fb34@mail.gmail.com> <932b2f1f0911090757i1a4fe4e9rdf5b9e4fb6efd84b@mail.gmail.com> <932b2f1f0911090828p72588563o9f83f758af475041@mail.gmail.com> <932b2f1f0911091009jec184kbe02b576da713d42@mail.gmail.com> <932b2f1f0911091022y3344aa69qc928e555ad5c7e15@mail.gmail.com> <63bb19ae0911091036g30586b47td36281e7805e4695@mail.gmail.com> Message-ID: <932b2f1f0911091044j53ff8dbbrc958bed19d2ca48d@mail.gmail.com> On Mon, Nov 9, 2009 at 12:36 PM, Sam TH wrote: > On Mon, Nov 9, 2009 at 1:22 PM, Robby Findler > wrote: >> I think what you're asking is if the parallelism we get from the disk >> and the cpu is already enough to get some speed up here(?). I'm not >> sure. > > Is there some way to run a thread after DrScheme finishes starting? ?I > know that the first 30 seconds after DrScheme comes up I usually spend > staring at the buffer. Yeah, I've thought the same thing (and Matthew suggests it as well in a private message). I've hesitated before because it could easily confuse users ("why is my drscheme using all of the cpu after it starts up?") and perhaps frustrate. I know I'm frustrated with the way that Windows only does 1/2 of the boot time before showing you a screen that looks like you're logged in, but nothing really works because your cpu is still going full speed booting up. As you already said, of course, this isn't the same kind of situation. Still, my inclination is to try one of our parallelization projects with this. If those don't pan out, I can try the above. Robby From sbloch at adelphi.edu Mon Nov 9 13:45:35 2009 From: sbloch at adelphi.edu (Stephen Bloch) Date: Mon Nov 9 13:47:26 2009 Subject: [plt-scheme] Speed up check-syntax In-Reply-To: <932b2f1f0911091022y3344aa69qc928e555ad5c7e15@mail.gmail.com> References: <595b9ab20911090556u5115e7dfpfdd863588ea3fb34@mail.gmail.com> <932b2f1f0911090757i1a4fe4e9rdf5b9e4fb6efd84b@mail.gmail.com> <932b2f1f0911090828p72588563o9f83f758af475041@mail.gmail.com> <932b2f1f0911091009jec184kbe02b576da713d42@mail.gmail.com> <932b2f1f0911091022y3344aa69qc928e555ad5c7e15@mail.gmail.com> Message-ID: Matthias asked: >>> Could we approximate parallelism with a 'niced' threading model? and Robby replied: > I think what you're asking is if the parallelism we get from the disk > and the cpu is already enough to get some speed up here(?). I'm not > sure. Forget about disk vs CPU; can't this be done in the eons between keystrokes? Particularly since nobody is likely to hit "Check Syntax" as the first action after starting DrScheme. There should be plenty of time while the user reads the screen, re-orients to the problem at hand, finds a spot in the source code, and makes an edit or two. Stephen Bloch sbloch@adelphi.edu From stephen.degabrielle at acm.org Mon Nov 9 13:55:30 2009 From: stephen.degabrielle at acm.org (Stephen De Gabrielle) Date: Mon Nov 9 13:56:08 2009 Subject: [plt-scheme] Re: Speed up check-syntax In-Reply-To: <932b2f1f0911090757i1a4fe4e9rdf5b9e4fb6efd84b@mail.gmail.com> References: <595b9ab20911090556u5115e7dfpfdd863588ea3fb34@mail.gmail.com> <932b2f1f0911090757i1a4fe4e9rdf5b9e4fb6efd84b@mail.gmail.com> Message-ID: <595b9ab20911091055t3838afdcw74e786655beea462@mail.gmail.com> I'll watch the status line, it wasn't the first time I'd run it. On the 4th run after I'd also run the macro expander, and was switching tabs a fair bit - drscheme froze. Hopefully I can catch it next time in the status log to see where it freezes. (btw - spare a thought for single core users on education targetted netbooks) Cheers, Stephen On Monday, November 9, 2009, Robby Findler wrote: > The first time you run it, it loads in the documentation indicies. > That might be it. (Watch the status line at the bottom of the screen > and see if that's where it looks like the time is going to know for > sure.) > > Robby > > On Mon, Nov 9, 2009 at 8:23 AM, Matthias Felleisen wrote: >> >> I have noticed this too. The first time around check syntax is indeed >> painfully slow. The second time+ it is as fast as it used to be. >> >> >> On Nov 9, 2009, at 8:56 AM, Stephen De Gabrielle wrote: >> >>> Hi, I'm refactoring some mred code, and I'm finding check syntax has >>> got painfully slow. >>> Does anyone else experience this and what strategies do you use to >>> avoid the problem? >>> >>> I don't think this is a mred specific issue- just an issue for code >>> with lots of dependencies. >>> >>> Thanks, >>> >>> Stephen >>> >>> -- >>> >>> -- >>> Stephen De Gabrielle >>> stephen.degabrielle@acm.org >>> Telephone +44 (0)20 85670911 >>> Mobile ? ? ? ?+44 (0)79 85189045 >>> http://www.degabrielle.name/stephen >>> _________________________________________________ >>> ?For list-related administrative tasks: >>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > -- -- Stephen De Gabrielle stephen.degabrielle@acm.org Telephone +44 (0)20 85670911 Mobile +44 (0)79 85189045 http://www.degabrielle.name/stephen From robby at eecs.northwestern.edu Mon Nov 9 13:55:48 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Mon Nov 9 13:56:13 2009 Subject: [plt-scheme] Speed up check-syntax In-Reply-To: References: <595b9ab20911090556u5115e7dfpfdd863588ea3fb34@mail.gmail.com> <932b2f1f0911090757i1a4fe4e9rdf5b9e4fb6efd84b@mail.gmail.com> <932b2f1f0911090828p72588563o9f83f758af475041@mail.gmail.com> <932b2f1f0911091009jec184kbe02b576da713d42@mail.gmail.com> <932b2f1f0911091022y3344aa69qc928e555ad5c7e15@mail.gmail.com> Message-ID: <932b2f1f0911091055s435613c6oa3668c80afbcf509@mail.gmail.com> On Mon, Nov 9, 2009 at 12:45 PM, Stephen Bloch wrote: > Matthias asked: > >>>> Could we approximate parallelism with a 'niced' threading model? > > and Robby replied: > >> I think what you're asking is if the parallelism we get from the disk >> and the cpu is already enough to get some speed up here(?). I'm not >> sure. > > Forget about disk vs CPU; can't this be done in the eons between keystrokes? > ?Particularly since nobody is likely to hit "Check Syntax" as the first > action after starting DrScheme. ?There should be plenty of time while the > user reads the screen, re-orients to the problem at hand, finds a spot in > the source code, and makes an edit or two. I find such behavior annoying in my OS and expect it would be the same in DrScheme. Things will be sluggish while it is loading. Nevertheless, I will try this if the parallelism stuff doesn't pan out. Robby From robby at eecs.northwestern.edu Mon Nov 9 13:57:18 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Mon Nov 9 13:57:39 2009 Subject: [plt-scheme] Re: Speed up check-syntax In-Reply-To: <595b9ab20911091055t3838afdcw74e786655beea462@mail.gmail.com> References: <595b9ab20911090556u5115e7dfpfdd863588ea3fb34@mail.gmail.com> <932b2f1f0911090757i1a4fe4e9rdf5b9e4fb6efd84b@mail.gmail.com> <595b9ab20911091055t3838afdcw74e786655beea462@mail.gmail.com> Message-ID: <932b2f1f0911091057o30573084h12a8a49c721c9fab@mail.gmail.com> On Mon, Nov 9, 2009 at 12:55 PM, Stephen De Gabrielle wrote: > I'll watch the status line, it wasn't the first time I'd run it. On > the 4th run after I'd also run the macro expander, and was switching > tabs a fair bit - drscheme froze. Hopefully I can catch it next time > in the status log to see where it freezes. > > (btw - spare a thought for single core users on education targetted netbooks) All intel atoms are dual core, right? (I have a slow, dual core netbook, but it isn't an education-targeted one, I don't think.) Robby From jev at mac.com Mon Nov 9 13:02:22 2009 From: jev at mac.com (Jaime Vargas) Date: Mon Nov 9 14:03:13 2009 Subject: [plt-scheme] Speed up check-syntax In-Reply-To: <932b2f1f0911090828p72588563o9f83f758af475041@mail.gmail.com> References: <595b9ab20911090556u5115e7dfpfdd863588ea3fb34@mail.gmail.com> <932b2f1f0911090757i1a4fe4e9rdf5b9e4fb6efd84b@mail.gmail.com> <932b2f1f0911090828p72588563o9f83f758af475041@mail.gmail.com> Message-ID: Why not simple load them on startup? On Nov 9, 2009, at 11:28 AM, Robby Findler wrote: > Sounds like a good task for when we get multicore support. I'll pass > that along to James and probably Kevin is reading this message. > > Robby > > On Mon, Nov 9, 2009 at 10:27 AM, Matthias Felleisen > wrote: >> >> Yes, I know. It's very slow. Can't we load these indices while the >> user >> types in something? >> >> >> On Nov 9, 2009, at 10:57 AM, Robby Findler wrote: >> >>> The first time you run it, it loads in the documentation indicies. >>> That might be it. (Watch the status line at the bottom of the screen >>> and see if that's where it looks like the time is going to know for >>> sure.) >>> >>> Robby >>> >>> On Mon, Nov 9, 2009 at 8:23 AM, Matthias Felleisen >> > >>> wrote: >>>> >>>> I have noticed this too. The first time around check syntax is >>>> indeed >>>> painfully slow. The second time+ it is as fast as it used to be. >>>> >>>> >>>> On Nov 9, 2009, at 8:56 AM, Stephen De Gabrielle wrote: >>>> >>>>> Hi, I'm refactoring some mred code, and I'm finding check syntax >>>>> has >>>>> got painfully slow. >>>>> Does anyone else experience this and what strategies do you use to >>>>> avoid the problem? >>>>> >>>>> I don't think this is a mred specific issue- just an issue for >>>>> code >>>>> with lots of dependencies. >>>>> >>>>> Thanks, >>>>> >>>>> Stephen >>>>> >>>>> -- >>>>> >>>>> -- >>>>> Stephen De Gabrielle >>>>> stephen.degabrielle@acm.org >>>>> Telephone +44 (0)20 85670911 >>>>> Mobile +44 (0)79 85189045 >>>>> http://www.degabrielle.name/stephen >>>>> _________________________________________________ >>>>> For list-related administrative tasks: >>>>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>>> >>>> _________________________________________________ >>>> For list-related administrative tasks: >>>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>>> >> >> > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From pivanyi at freemail.hu Mon Nov 9 17:31:09 2009 From: pivanyi at freemail.hu (Ivanyi Peter) Date: Mon Nov 9 17:31:33 2009 Subject: [plt-scheme] parser tools In-Reply-To: Message-ID: > But I recently made a simple quick-and-dirty text parser tool: > http://planet.plt-scheme.org/package-source/orseau/lazy-doc.plt > /1/6/planet-docs/manual/simple-parser.html Thanks, this seems to work. Now I do not understand one thing. Maybe this is not Scheme related, but from the following code I would expect: "\nsomething\n{#[#aa,#bb#]\n}\n" but I get: "\nsomething\n{\n#[\n#aa,#bb\n#]\n}\n" I thought the start-keyword would match zero or many new-line AND one or many spaces. What do I do wrong? Thanks, Peter Ivanyi ---------------------------------------------------------- #lang scheme (require (planet orseau/lazy-doc:1:6/simple-parser)) (define start-keyword "\n* +") (let ([block-parser (new-parser #:phase 'block-keywords)]) (add-items block-parser ('block-keywords (start-keyword "#")) ) (parse-text block-parser " something { [ aa, bb ] } ") ) From wookiz at hotmail.com Mon Nov 9 19:19:51 2009 From: wookiz at hotmail.com (wooks) Date: Mon Nov 9 19:28:05 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: References: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> <39BE9753-0F4B-4E46-84D4-D7E5186150B4@ccs.neu.edu> Message-ID: On Nov 9, 5:02?pm, Matthias Felleisen wrote: > On Nov 9, 2009, at 10:43 AM, Stephen Bloch wrote: > > > > >> 3. Assuming that the majority can't solve it, proceed with 'in ? > >> decent colleges, this kind of stuff is taught in the first course.' > > > Or you could NOT open with antagonism and NOT run down the students' ? > > previous teachers and background. ?Instead, I would say "for those ? > > of you who have done some programming before, we'll be doing it a ? > > little differently; this approach may seem weird to you at first, ? > > but in my experience, it helps you produce correct, working programs ? > > faster. ?Approach it with an open mind, and you can combine the best ? > > of both approaches." ?You'll have to decide, based on your group of ? > > students, whether it'll work better to start by showing them how ? > > much they don't know. > > Just drop the phrase "in decent colleges ..." but conduct the ? > experiment anyway. Do tell them that good programmers can solve these ? > questions easily and you will teach them how and more about systematic ? > programmers. > > I repeatedly get students who think that their bad grades in an HtDP ? > course are due to the odd choice of language. Over 10+ years, I have ? > easily overcome strong versions of such opinions with "no problem. ? > What language would you like to use? I'll give you an A for the course ? > if you can solve this problem ..." A variation is to do it at the ? > beginning and to let people go who can solve such things (give them ? > the option). In my 10+ years, I have had ONE student who solved the ? > problem in the alotted 30 mins, indeed, he needed much less time and ? > he didn't do it in anything modern: he did it in C. He had 15 years of ? > experience and no contact to FP. BUT he was a good programmer and he ? > wanted to take my course anyway. > They are all supposed to be newbies although I imagine some of them may have had some exposure and will want to know why they are not learning Java. That will probably be their second course anyway. They are a captive audience. They do not have the option of dropping the course. From m.douglas.williams at gmail.com Mon Nov 9 20:19:31 2009 From: m.douglas.williams at gmail.com (Doug Williams) Date: Mon Nov 9 20:20:07 2009 Subject: [plt-scheme] Describe Function Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: describe-test.ss Type: application/octet-stream Size: 3070 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091109/4e18e8af/describe-test-0001.obj From sk at cs.brown.edu Mon Nov 9 20:53:42 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Mon Nov 9 20:54:21 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: References: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> <39BE9753-0F4B-4E46-84D4-D7E5186150B4@ccs.neu.edu> Message-ID: > They are a captive audience. They do not have the option of dropping > the course. Then don't be hostile. You will already face a little resentment for doing things non-traditionally. Show them instead why it's better. After showing them animations with World, show them that you have already introduced them to what is generally considered an "advanced software engineering" topic (MVC, for us) in week 1. Just last week a major practitioner of software methodology (big-time author, consultant) wrote asking for access to our World material, to teach his child, on the grounds that it embodied the methodology he used and preached in his professional life. Shriram From toddobryan at gmail.com Mon Nov 9 21:01:51 2009 From: toddobryan at gmail.com (Todd O'Bryan) Date: Mon Nov 9 21:02:09 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: References: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> <39BE9753-0F4B-4E46-84D4-D7E5186150B4@ccs.neu.edu> Message-ID: <904774730911091801y74fd753dj432f3931fec88ac1@mail.gmail.com> On Mon, Nov 9, 2009 at 8:53 PM, Shriram Krishnamurthi wrote: >> They are a captive audience. They do not have the option of dropping >> the course. > > Then don't be hostile. ?You will already face a little resentment for > doing things non-traditionally. ?Show them instead why it's better. > After showing them animations with World, show them that you have > already introduced them to what is generally considered an "advanced > software engineering" topic (MVC, for us) in week 1. I can recommend Stephen's Picturing Programs very highly. It's only my first time using it and there are a few things I'd tweek (move faster, spend more time on, skip), but that's true of any book. What I love is that my students are already creating animations and they're almost crying out for structures so they can make their animations more complicated. When we get there, very soon, they'll already have ideas what they can use them for. Todd From czhu at cs.utah.edu Mon Nov 9 21:21:24 2009 From: czhu at cs.utah.edu (Chongkai Zhu) Date: Mon Nov 9 21:21:54 2009 Subject: [plt-scheme] Describe Function In-Reply-To: References: Message-ID: <4AF8CE24.80701@cs.utah.edu> Doug Williams wrote: > I've written a describe function for PLT Scheme - because I always > liked it in Common Lisp. I'll put it on PLaneT eventually, but was > wondering if anyone had suggestions for what to include. Data types > that are there now that I'm pretty comfortable with are: Booleans, > numbers, strings, byte strings, characters, symbols, regular > expressions, byte regular expressions, keywords, lists, pairs > (improper lists), mutable lists, mutable pairs (improper mpairs), > vectors, boxes, hashes, procedures, and void. > Don't forget eof. > I may have gone a bit overboard with giving the names of integers (up > to 10^102), but the Symbolics Common Lisp describe function did it and > I always liked showing it off. So, I included it. But, it might make > sense to limit it to fixums just to keep the name from getting so long. > > I'm pretty happy with procedure descriptions with the number of > positional arguments and required and optional keywords. (I still need > to handle the case of the optional keywords list being #f - that is, > allow any keyword.) I'm curious about whether a primitive closure is > different from a primitive procedure - for example, can you get the > result arity for a primitive closure like you can for a primitive > procedure. And, what is a example of a primitive closure so I can > include a test for it? > > I've included recursively describing boxes and hashes. It shouldn't be > a problem for boxes, but hash descriptions could get rather long when > I include descriptions of the key values. Would it make sense to have > a recursive? arguments to control this? If recursive? is implemented > should it also apply to lists, vectors, etc? I'm concerned about > inundating the user with detail where it isn't needed. [Maybe the best > thing is to limit recursive descriptions to boxes.] > > Structs and objects are somewhat more problematic. If a struct > responds to struct?, I can get some details with struct->vector. So, I > am currently recursively describing the field details (by field > number) for these. As far as I can tell, completely opaque structured > (i.e., those that return #f for struct?) will give me the 'name' of > the structure type by using object-name. Any suggestions for > describing structs and objects (and classes) would be welcome. > > What other first-class data object would be useful to include > (parameters, which get described as procedures now, modules, units, > signatures, processes, ...)? > > Thoughts, suggestions, comments, etc are welcome. > > The message with describe.ss attached was too big to post (I can send > it separately if anyone wants to play with it), but here is some spew > of the describe-test.ss file: > > --- Booleans --- > #t is the Boolean true > #f is the Boolean false > > --- Numbers --- > +inf.0 is positive infinity > -inf.0 is negative infinity > +nan.0 is an inexact positive real number > 0 is the exact integer fixnum zero > 3628800 is the exact positive integer fixnum three million six hundred > twenty-eight thousand eight hundred > 815915283247897734345611269596 > 115894272000000000 is an exact positive integer eight hundred fifteen > quattuordecillion nine hundred fifteen tredecillion two hundred > eighty-three duodecillion two hundred forty-seven undecillion eight > hundred ninety-seven decillion seven hundred thirty-four nonillion > three hundred forty-five octillion six hundred eleven septillion two > hundred sixty-nine sextillion five hundred ninety-six quintillion one > hundred fifteen quadrillion eight hundred ninety-four trillion two > hundred seventy-two billion > -32636611329915909373824450783844635770880000000000 is an exact > negative integer minus thirty-two quindecillion six hundred thirty-six > quattuordecillion six hundred eleven tredecillion three hundred > twenty-nine duodecillion nine hundred fifteen undecillion nine hundred > nine decillion three hundred seventy-three nonillion eight hundred > twenty-four octillion four hundred fifty septillion seven hundred > eighty-three sextillion eight hundred forty-four quintillion six > hundred thirty-five quadrillion seven hundred seventy trillion eight > hundred eighty billion > 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000 > is an exact positive integer value whose absolute value is >= 10^102 > 3628800/39916801 is an exact positive rational number with a numerator > of 3628800 and a denominator of 39916801 > -1+3i is an exact complex number whose magnitude is 3.1622776601683795 > 0.0 is an inexact integer zero > 3628800.0 is an inexact positive integer > 8.159152832478977e+047 is an inexact positive integer > 3.1622776601683795 is an inexact positive real number > 0+3.1622776601683795i is an inexact positive imaginary number > 3.1622776601683795+3.1622776601683795i is an inexact complex number > whose magnitude is 4.47213595499958 > > --- Strings --- > "abc" is an immutable string of length 3 > "123" is a mutable string of length 3 > > --- Byte Strings --- > #"abc" is an immutable byte string of length 3 > #"012" is a mutable byte string of length 3 > > --- Characters --- > #\a is the character whose code-point number is 97(#x61) and general > category is 'll (letter, lowercase) > #\A is the character whose code-point number is 65(#x41) and general > category is 'lu (letter, uppercase) > #\0 is the character whose code-point number is 48(#x30) and general > category is 'nd (number, decimal digit) > #\( is the character whose code-point number is 40(#x28) and general > category is 'ps (punctuation, open) > > --- Symbols --- > abc is the interned symbol > |(a + b)| is the interned symbol > g1121 is an uninterned symbol > > --- Regular Expressions --- > #rx"Ap*le" is a regular expression in regexp format > #px"Ap*le" is a regular expression in pregexp format > > --- Byte Regular Expressions --- > #rx#"Ap*le" is a byte regular expression in regexp format > #px#"Ap*le" is a byte regular expression in pregexp format > > --- Keywords --- > #:key is the keyword > > --- Lists and Pairs --- > (this is a proper list) is a proper immutable list of length 5 > (this is an improper . list) is an improper immutable list > ((this . is) (also . a) (proper . list)) is a proper immutable list of > length 3 > > --- Mutable Lists and Pairs --- > {this is a proper list} is a proper mutable list of length 5 > {this is an improper . list} is an improper mutable list > {(this . is) (also . a) (proper . list)} is a proper mutable list of > length 3 > > --- Vectors --- > #(1 2 3) is an immutable vector of length 3 > > --- Boxes --- > #&12 is a box containing 12, 12 is the exact positive integer fixnum > twelve > #&#&a is a box containing #&a, #&a is a box containing a, a is the > interned symbol > #&3.1622776601683795 is a box containing 3.1622776601683795, > 3.1622776601683795 is an inexact positive real number > > --- Hashes --- > #hash((c . 16) (b . 14) (a . 12)) is an immutable hash table and that > uses equal? to compare keys > c : 16, 16 is the exact positive integer fixnum sixteen > b : 14, 14 is the exact positive integer fixnum fourteen > a : 12, 12 is the exact positive integer fixnum twelve > #hasheq((c . c) (b . b) (a . a)) is an immutable hash table and that > uses eq? to compare keys > c : c, c is the interned symbol > b : b, b is the interned symbol > a : a, a is the interned symbol > #hasheqv((c . #\c) (b . #\b) (a . #\a)) is an immutable hash table and > that uses eqv? to compare keys > c : #\c, #\c is the character whose code-point number is 99(#x63) > and general category is 'll (letter, lowercase) > b : #\b, #\b is the character whose code-point number is 98(#x62) > and general category is 'll (letter, lowercase) > a : #\a, #\a is the character whose code-point number is 97(#x61) > and general category is 'll (letter, lowercase) > #hash((b . 14) (a . 12) (c . 16)) is a mutable hash table and that > uses equal? to compare keys > b : 14, 14 is the exact positive integer fixnum fourteen > a : 12, 12 is the exact positive integer fixnum twelve > c : 16, 16 is the exact positive integer fixnum sixteen > # is a mutable hash table that holds its keys weakly and that > uses equal? to compare keys > c : 16, 16 is the exact positive integer fixnum sixteen > b : 14, 14 is the exact positive integer fixnum fourteen > a : 12, 12 is the exact positive integer fixnum twelve > > --- Procedures --- > # is a primitive procedure named car that accepts 1 > argument and returns 1 result > # is a procedure named open-output-file > that accepts 1 argument plus optional keyword arguments #:exists and > #:mode > # is a primitive procedure named > current-input-port that accepts 0 or 1 arguments and returns 1 result > # is a procedure named > ...describe-test.ss:133:10 that accepts 1 argument > > --- Void --- > # is void > > --- Structures --- > #(struct:transparent-struct a b c) is a structure of type > transparent-struct > 1 : a, a is the interned symbol > 2 : b, b is the interned symbol > 3 : c, c is the interned symbol > > --- Other Named Things --- > # is an object of type opaque-struct > > Doug > ------------------------------------------------------------------------ > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From robby at eecs.northwestern.edu Mon Nov 9 21:26:17 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Mon Nov 9 21:26:40 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: References: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> <39BE9753-0F4B-4E46-84D4-D7E5186150B4@ccs.neu.edu> Message-ID: <932b2f1f0911091826r5f1457b3vce47bd45fcf29fba@mail.gmail.com> I agree with not being hostile, but Matthias's exercise can be quite valuable. Captives who don't want to be there are worse than people who can go away if they want and his exercise can convert some, if done with a bit of care. Robby On Mon, Nov 9, 2009 at 7:53 PM, Shriram Krishnamurthi wrote: >> They are a captive audience. They do not have the option of dropping >> the course. > > Then don't be hostile. ?You will already face a little resentment for > doing things non-traditionally. ?Show them instead why it's better. > After showing them animations with World, show them that you have > already introduced them to what is generally considered an "advanced > software engineering" topic (MVC, for us) in week 1. > > Just last week a major practitioner of software methodology (big-time > author, consultant) wrote asking for access to our World material, to > teach his child, on the grounds that it embodied the methodology he > used and preached in his professional life. > > Shriram > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From m.douglas.williams at gmail.com Mon Nov 9 21:28:18 2009 From: m.douglas.williams at gmail.com (Doug Williams) Date: Mon Nov 9 21:28:41 2009 Subject: [plt-scheme] Describe Function In-Reply-To: <4AF8CE24.80701@cs.utah.edu> References: <4AF8CE24.80701@cs.utah.edu> Message-ID: Thanks, I just added it. On Mon, Nov 9, 2009 at 7:21 PM, Chongkai Zhu wrote: > Doug Williams wrote: > >> I've written a describe function for PLT Scheme - because I always liked >> it in Common Lisp. I'll put it on PLaneT eventually, but was wondering if >> anyone had suggestions for what to include. Data types that are there now >> that I'm pretty comfortable with are: Booleans, numbers, strings, byte >> strings, characters, symbols, regular expressions, byte regular expressions, >> keywords, lists, pairs (improper lists), mutable lists, mutable pairs >> (improper mpairs), vectors, boxes, hashes, procedures, and void. >> >> > Don't forget eof. > > I may have gone a bit overboard with giving the names of integers (up to >> 10^102), but the Symbolics Common Lisp describe function did it and I always >> liked showing it off. So, I included it. But, it might make sense to limit >> it to fixums just to keep the name from getting so long. >> >> I'm pretty happy with procedure descriptions with the number of positional >> arguments and required and optional keywords. (I still need to handle the >> case of the optional keywords list being #f - that is, allow any keyword.) >> I'm curious about whether a primitive closure is different from a primitive >> procedure - for example, can you get the result arity for a primitive >> closure like you can for a primitive procedure. And, what is a example of a >> primitive closure so I can include a test for it? >> >> I've included recursively describing boxes and hashes. It shouldn't be a >> problem for boxes, but hash descriptions could get rather long when I >> include descriptions of the key values. Would it make sense to have a >> recursive? arguments to control this? If recursive? is implemented should it >> also apply to lists, vectors, etc? I'm concerned about inundating the user >> with detail where it isn't needed. [Maybe the best thing is to limit >> recursive descriptions to boxes.] >> >> Structs and objects are somewhat more problematic. If a struct responds to >> struct?, I can get some details with struct->vector. So, I am currently >> recursively describing the field details (by field number) for these. As far >> as I can tell, completely opaque structured (i.e., those that return #f for >> struct?) will give me the 'name' of the structure type by using object-name. >> Any suggestions for describing structs and objects (and classes) would be >> welcome. >> >> What other first-class data object would be useful to include (parameters, >> which get described as procedures now, modules, units, signatures, >> processes, ...)? >> >> Thoughts, suggestions, comments, etc are welcome. >> >> The message with describe.ss attached was too big to post (I can send it >> separately if anyone wants to play with it), but here is some spew of the >> describe-test.ss file: >> >> --- Booleans --- >> #t is the Boolean true >> #f is the Boolean false >> >> --- Numbers --- >> +inf.0 is positive infinity >> -inf.0 is negative infinity >> +nan.0 is an inexact positive real number >> 0 is the exact integer fixnum zero >> 3628800 is the exact positive integer fixnum three million six hundred >> twenty-eight thousand eight hundred >> 815915283247897734345611269596 >> 115894272000000000 is an exact positive integer eight hundred fifteen >> quattuordecillion nine hundred fifteen tredecillion two hundred eighty-three >> duodecillion two hundred forty-seven undecillion eight hundred ninety-seven >> decillion seven hundred thirty-four nonillion three hundred forty-five >> octillion six hundred eleven septillion two hundred sixty-nine sextillion >> five hundred ninety-six quintillion one hundred fifteen quadrillion eight >> hundred ninety-four trillion two hundred seventy-two billion >> -32636611329915909373824450783844635770880000000000 is an exact negative >> integer minus thirty-two quindecillion six hundred thirty-six >> quattuordecillion six hundred eleven tredecillion three hundred twenty-nine >> duodecillion nine hundred fifteen undecillion nine hundred nine decillion >> three hundred seventy-three nonillion eight hundred twenty-four octillion >> four hundred fifty septillion seven hundred eighty-three sextillion eight >> hundred forty-four quintillion six hundred thirty-five quadrillion seven >> hundred seventy trillion eight hundred eighty billion >> 93326215443944152681699238856266700490715968264381621468592963895217599993229915608941463976156518286253697920827223758251185210916864000000000000000000000000 >> is an exact positive integer value whose absolute value is >= 10^102 >> 3628800/39916801 is an exact positive rational number with a numerator of >> 3628800 and a denominator of 39916801 >> -1+3i is an exact complex number whose magnitude is 3.1622776601683795 >> 0.0 is an inexact integer zero >> 3628800.0 is an inexact positive integer >> 8.159152832478977e+047 is an inexact positive integer >> 3.1622776601683795 is an inexact positive real number >> 0+3.1622776601683795i is an inexact positive imaginary number >> 3.1622776601683795+3.1622776601683795i is an inexact complex number whose >> magnitude is 4.47213595499958 >> >> --- Strings --- >> "abc" is an immutable string of length 3 >> "123" is a mutable string of length 3 >> >> --- Byte Strings --- >> #"abc" is an immutable byte string of length 3 >> #"012" is a mutable byte string of length 3 >> >> --- Characters --- >> #\a is the character whose code-point number is 97(#x61) and general >> category is 'll (letter, lowercase) >> #\A is the character whose code-point number is 65(#x41) and general >> category is 'lu (letter, uppercase) >> #\0 is the character whose code-point number is 48(#x30) and general >> category is 'nd (number, decimal digit) >> #\( is the character whose code-point number is 40(#x28) and general >> category is 'ps (punctuation, open) >> >> --- Symbols --- >> abc is the interned symbol >> |(a + b)| is the interned symbol >> g1121 is an uninterned symbol >> >> --- Regular Expressions --- >> #rx"Ap*le" is a regular expression in regexp format >> #px"Ap*le" is a regular expression in pregexp format >> >> --- Byte Regular Expressions --- >> #rx#"Ap*le" is a byte regular expression in regexp format >> #px#"Ap*le" is a byte regular expression in pregexp format >> >> --- Keywords --- >> #:key is the keyword >> >> --- Lists and Pairs --- >> (this is a proper list) is a proper immutable list of length 5 >> (this is an improper . list) is an improper immutable list >> ((this . is) (also . a) (proper . list)) is a proper immutable list of >> length 3 >> >> --- Mutable Lists and Pairs --- >> {this is a proper list} is a proper mutable list of length 5 >> {this is an improper . list} is an improper mutable list >> {(this . is) (also . a) (proper . list)} is a proper mutable list of >> length 3 >> >> --- Vectors --- >> #(1 2 3) is an immutable vector of length 3 >> >> --- Boxes --- >> #&12 is a box containing 12, 12 is the exact positive integer fixnum >> twelve >> #&#&a is a box containing #&a, #&a is a box containing a, a is the >> interned symbol >> #&3.1622776601683795 is a box containing 3.1622776601683795, >> 3.1622776601683795 is an inexact positive real number >> >> --- Hashes --- >> #hash((c . 16) (b . 14) (a . 12)) is an immutable hash table and that uses >> equal? to compare keys >> c : 16, 16 is the exact positive integer fixnum sixteen >> b : 14, 14 is the exact positive integer fixnum fourteen >> a : 12, 12 is the exact positive integer fixnum twelve >> #hasheq((c . c) (b . b) (a . a)) is an immutable hash table and that uses >> eq? to compare keys >> c : c, c is the interned symbol >> b : b, b is the interned symbol >> a : a, a is the interned symbol >> #hasheqv((c . #\c) (b . #\b) (a . #\a)) is an immutable hash table and >> that uses eqv? to compare keys >> c : #\c, #\c is the character whose code-point number is 99(#x63) and >> general category is 'll (letter, lowercase) >> b : #\b, #\b is the character whose code-point number is 98(#x62) and >> general category is 'll (letter, lowercase) >> a : #\a, #\a is the character whose code-point number is 97(#x61) and >> general category is 'll (letter, lowercase) >> #hash((b . 14) (a . 12) (c . 16)) is a mutable hash table and that uses >> equal? to compare keys >> b : 14, 14 is the exact positive integer fixnum fourteen >> a : 12, 12 is the exact positive integer fixnum twelve >> c : 16, 16 is the exact positive integer fixnum sixteen >> # is a mutable hash table that holds its keys weakly and that uses >> equal? to compare keys >> c : 16, 16 is the exact positive integer fixnum sixteen >> b : 14, 14 is the exact positive integer fixnum fourteen >> a : 12, 12 is the exact positive integer fixnum twelve >> >> --- Procedures --- >> # is a primitive procedure named car that accepts 1 >> argument and returns 1 result >> # is a procedure named open-output-file that >> accepts 1 argument plus optional keyword arguments #:exists and #:mode >> # is a primitive procedure named >> current-input-port that accepts 0 or 1 arguments and returns 1 result >> # is a procedure named >> ...describe-test.ss:133:10 that accepts 1 argument >> >> --- Void --- >> # is void >> >> --- Structures --- >> #(struct:transparent-struct a b c) is a structure of type >> transparent-struct >> 1 : a, a is the interned symbol >> 2 : b, b is the interned symbol >> 3 : c, c is the interned symbol >> >> --- Other Named Things --- >> # is an object of type opaque-struct >> >> Doug >> ------------------------------------------------------------------------ >> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091109/5c616f1c/attachment-0001.htm From sk at cs.brown.edu Mon Nov 9 21:37:57 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Mon Nov 9 21:38:38 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: <932b2f1f0911091826r5f1457b3vce47bd45fcf29fba@mail.gmail.com> References: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> <39BE9753-0F4B-4E46-84D4-D7E5186150B4@ccs.neu.edu> <932b2f1f0911091826r5f1457b3vce47bd45fcf29fba@mail.gmail.com> Message-ID: I wasn't responding to Matthias's message specifically, just the general issue. I do like Matthias's exercise (obviously, I'm biased where that particular problem is concerned <-;). These are all different ways of getting the captives to calm down and start thinking and paying attention. On Mon, Nov 9, 2009 at 9:26 PM, Robby Findler wrote: > I agree with not being hostile, but Matthias's exercise can be quite > valuable. Captives who don't want to be there are worse than people > who can go away if they want and his exercise can convert some, if > done with a bit of care. > > Robby > > On Mon, Nov 9, 2009 at 7:53 PM, Shriram Krishnamurthi wrote: >>> They are a captive audience. They do not have the option of dropping >>> the course. >> >> Then don't be hostile. ?You will already face a little resentment for >> doing things non-traditionally. ?Show them instead why it's better. >> After showing them animations with World, show them that you have >> already introduced them to what is generally considered an "advanced >> software engineering" topic (MVC, for us) in week 1. >> >> Just last week a major practitioner of software methodology (big-time >> author, consultant) wrote asking for access to our World material, to >> teach his child, on the grounds that it embodied the methodology he >> used and preached in his professional life. >> >> Shriram >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > From sbloch at adelphi.edu Mon Nov 9 23:01:21 2009 From: sbloch at adelphi.edu (Stephen Bloch) Date: Mon Nov 9 23:01:45 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: References: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> <39BE9753-0F4B-4E46-84D4-D7E5186150B4@ccs.neu.edu> Message-ID: On Nov 9, 2009, at 7:19 PM, wooks wrote: > They are all supposed to be newbies although I imagine some of them > may have had some exposure and will want to know why they are not > learning Java. That will probably be their second course anyway. > > They are a captive audience. They do not have the option of dropping > the course. OK, then showing them how much they don't know isn't such a high priority. (I'm thinking of the first day of Potions class in _Harry Potter_ book 1, where the kids can't POSSIBLY know the stuff Professor Snape is eager to demonstrate that they don't know.) There will of course be some who, having written a dozen programs in Java or C++ or PHP or whatever, are convinced that if you're not teaching what they already know, it indicates your ignorance. You can approach these students as Matthias suggests, by showing on the first day how much they don't know, or you can try to convince them that even if they DO already know a bunch of stuff, knowing more stuff is better than knowing less stuff, and this class will teach them different stuff. Steve Bloch From rafkind at cs.utah.edu Mon Nov 9 23:44:00 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Mon Nov 9 23:47:09 2009 Subject: [plt-scheme] Describe Function In-Reply-To: References: <4AF8CE24.80701@cs.utah.edu> Message-ID: <4AF8EF90.7040206@cs.utah.edu> Continuations? Doug Williams wrote: > Thanks, I just added it. > > On Mon, Nov 9, 2009 at 7:21 PM, Chongkai Zhu wrote: > > >> Doug Williams wrote: >> >> >>> I've written a describe function for PLT Scheme - because I always liked >>> it in Common Lisp. I'll put it on PLaneT eventually, but was wondering if >>> anyone had suggestions for what to include. Data types that are there now >>> that I'm pretty comfortable with are: Booleans, numbers, strings, byte >>> strings, characters, symbols, regular expressions, byte regular expressions, >>> keywords, lists, pairs (improper lists), mutable lists, mutable pairs >>> (improper mpairs), vectors, boxes, hashes, procedures, and void. >>> From laurent.orseau at gmail.com Tue Nov 10 02:19:06 2009 From: laurent.orseau at gmail.com (Laurent) Date: Tue Nov 10 02:19:48 2009 Subject: [plt-scheme] parser tools In-Reply-To: References: Message-ID: 2009/11/9 Ivanyi Peter > > > But I recently made a simple quick-and-dirty text parser tool: > > http://planet.plt-scheme.org/package-source/orseau/lazy-doc.plt > > /1/6/planet-docs/manual/simple-parser.html > > Thanks, this seems to work. > Now I do not understand one thing. Maybe this is not Scheme > related, but from the following code I would expect: > "\nsomething\n{#[#aa,#bb#]\n}\n" > but I get: > "\nsomething\n{\n#[\n#aa,#bb\n#]\n}\n" > > I thought the start-keyword would match zero or many new-line > AND one or many spaces. What do I do wrong? > This is my bad. For some reason, I had chosen to cut the text into lines (so that reading files line by line would have the same behavior as reading it by chunks) and to separate the end-of-lines from the rest of the text, so in fact: " something { [ aa, bb ] } " is turned into : '("\n" "something" "\n" "{" "\n" "[" "\n" " aa, bb" "\n" "]" "\n" "}" "\n") which is parsed chunk by chunk. This also addresses a speed issue, because with big parsers, multiple regexps in parallel can be quite greedy, especially on long text files if the text is not split into lines. I should at least document that. Let me know if this makes things difficult for you, I'll try to find a workaround. Though for my own purposes, this behavior has not been much of a problem. Laurent > > Thanks, > > Peter Ivanyi > > ---------------------------------------------------------- > #lang scheme > > (require (planet orseau/lazy-doc:1:6/simple-parser)) > > (define start-keyword "\n* +") > > (let ([block-parser (new-parser #:phase 'block-keywords)]) > (add-items > block-parser > ('block-keywords (start-keyword "#")) > ) > (parse-text block-parser " > something > { > [ > aa, bb > ] > } > ") > ) > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091110/78333932/attachment.htm From wookiz at hotmail.com Tue Nov 10 02:51:47 2009 From: wookiz at hotmail.com (wooks) Date: Tue Nov 10 02:52:05 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: References: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> <39BE9753-0F4B-4E46-84D4-D7E5186150B4@ccs.neu.edu> Message-ID: <2c4c8163-eb10-4574-9ff9-0b2d5004312f@37g2000yqm.googlegroups.com> On Nov 10, 1:53?am, Shriram Krishnamurthi wrote: > > They are a captive audience. They do not have the option of dropping > > the course. > > Then don't be hostile. ?You will already face a little resentment for > doing things non-traditionally. ?Show them instead why it's better. > After showing them animations with World, show them that you have > already introduced them to what is generally considered an "advanced > software engineering" topic (MVC, for us) in week 1. > I was more reflecting the fact of the situation rather than my attitude. My information is that I am really dealing with the uninitiated - the college caters mainly to overseas students, in fact the language that may cause the most problems is English rather than Scheme. I made no mention of scheme or functional programming in the selling it to the college - just talked about focusing on a data analysis based approached to problem solving and the fact that we exploit that to get students up to speed quickly because their curriculum is language agnostic. I explained that I couldn't start with Java without having to explain alot of things on day 1 that are not really needed for day 1. If anything the fact that English may be a problem strengthens the case - it is hard enough explaining public static class to people who are supposedly fluent in the language (to be honest I don't even understand it myself). The suggestions to use the animation based material also fit well given the linguistic challenges. As I said, there will be a 2nd course in OOP and at the moment I am scheduled to take that. The simple answer to objectors is that they'll do Java next term (although I am tempted to do it in Python). From stephen.degabrielle at acm.org Tue Nov 10 04:02:05 2009 From: stephen.degabrielle at acm.org (Stephen De Gabrielle) Date: Tue Nov 10 04:02:27 2009 Subject: [plt-scheme] Registering another editor<%> Message-ID: <595b9ab20911100102o61ef5405l88b79e4958fb734a@mail.gmail.com> I'm trying to add "grid.ss" as a third kind of built-in `editor<%>', but I'm having a little dificulty getting started. I'm duplicating pasteboard to start with, have started renaming identifiers, but I can't get past cycle.ss - should I be registering this new editor somewhere else? Thanks, Stephen -- -- Stephen De Gabrielle stephen.degabrielle@acm.org Telephone +44 (0)20 85670911 Mobile +44 (0)79 85189045 http://www.degabrielle.name/stephen From matthias at ccs.neu.edu Tue Nov 10 08:00:28 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Tue Nov 10 08:00:59 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: <2c4c8163-eb10-4574-9ff9-0b2d5004312f@37g2000yqm.googlegroups.com> References: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> <39BE9753-0F4B-4E46-84D4-D7E5186150B4@ccs.neu.edu> <2c4c8163-eb10-4574-9ff9-0b2d5004312f@37g2000yqm.googlegroups.com> Message-ID: <9AE20A27-1BD9-482A-96BA-A5E13F588D9E@ccs.neu.edu> On Nov 10, 2009, at 2:51 AM, wooks wrote: > As I said, there will be a 2nd course in OOP and at the moment I am > scheduled to take that. The simple answer to objectors is that they'll > do Java next term (although I am tempted to do it in Python). I am about to teach this in PLT for the first time. I'll point to lecture notes when I have them. -- Matthias From phi500ac at yahoo.ca Tue Nov 10 08:27:46 2009 From: phi500ac at yahoo.ca (Philippos Apolinarius) Date: Tue Nov 10 08:34:49 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: <9AE20A27-1BD9-482A-96BA-A5E13F588D9E@ccs.neu.edu> Message-ID: <796171.24290.qm@web58801.mail.re1.yahoo.com> I often wonder why all Schemes don't have something like Gambit-C SIX syntax. After all, the the traditional syntax would still be available, if one needs or prefer it. One needs the traditional syntax to do things like genetic programming, neural networks or macros. One may often prefer it. There are people who cannot swallow Lisp prefix syntax.? I have shown Lisp, PLT and Bigloo to many people who uses tools like Mathlab. I always succeed in making them accetp Lisp. Here is what I do: 1 --- If the person needs a lot of math and computer algebra, I compile Maxima on SBCL to make it very fast. In fact, it becomes as fast as Lisp itself. People are amazed at the possibility of doing the same thing that they were doing in Matlab, and using similar syntax. 2 --- If the person works with network, Internet etc. I try to sell them Scheme. I discovered that it is much easier to sell them Bigloo and Gambit, that have an infix syntax than PLT or Larceny. Since providing an infix syntax seems to be very easy,? I wonder why this does not become official. As far as infix syntax goes, I have a few complaints to file against the existing ones. 1 --- SIX requires one to declare types. People with a Matlab background finds it annoying. 2 --- Maxima adds a lot of annotations to the prefix representation of the infix syntax. I am not sure, but I believe that this may slow processing. 3 --- Bigloo requires the presence of the bigloorc file at every point where one launches the interpreter. If the programmer forgets the bigloorc file, goodbie infix syntax. I am sure that all the above problems can be easily fixed. --- On Tue, 11/10/09, Matthias Felleisen wrote: From: Matthias Felleisen Subject: Re: [plt-scheme] Re: Poacher turned gamekeeper To: "wooks" Cc: plt-scheme@list.cs.brown.edu Received: Tuesday, November 10, 2009, 6:00 AM On Nov 10, 2009, at 2:51 AM, wooks wrote: > As I said, there will be a 2nd course in OOP and at the moment I am > scheduled to take that. The simple answer to objectors is that they'll > do Java next term (although I am tempted to do it in Python). I am about to teach this in PLT for the first time. I'll point to lecture notes when I have them. -- Matthias _________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-scheme __________________________________________________________________ Looking for the perfect gift? Give the gift of Flickr! http://www.flickr.com/gift/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091110/b00e6ba6/attachment.htm From phi500ac at yahoo.ca Tue Nov 10 08:34:48 2009 From: phi500ac at yahoo.ca (Philippos Apolinarius) Date: Tue Nov 10 08:35:16 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: <9AE20A27-1BD9-482A-96BA-A5E13F588D9E@ccs.neu.edu> Message-ID: <613922.73322.qm@web58805.mail.re1.yahoo.com> As an afterthought, at least one TA from the college where I study have used PLT to teach... Java. I noticed that all students that learned with that TA (Junia) became much better Java programmers than the rest of us. And they also learned PLT Scheme. This has two consequences: (1) It will be very easy for PLT to add an infix syntax, since well it already has a couple of them; of course, one must provide compilation facilities for the infix syntax and means of using both syntaxes in the same program, ? la Gambit; (2)? People can follow Junia's example and use PLT Scheme to teach Java. --- On Tue, 11/10/09, Matthias Felleisen wrote: From: Matthias Felleisen Subject: Re: [plt-scheme] Re: Poacher turned gamekeeper To: "wooks" Cc: plt-scheme@list.cs.brown.edu Received: Tuesday, November 10, 2009, 6:00 AM On Nov 10, 2009, at 2:51 AM, wooks wrote: > As I said, there will be a 2nd course in OOP and at the moment I am > scheduled to take that. The simple answer to objectors is that they'll > do Java next term (although I am tempted to do it in Python). I am about to teach this in PLT for the first time. I'll point to lecture notes when I have them. -- Matthias _________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-scheme __________________________________________________________________ Looking for the perfect gift? Give the gift of Flickr! http://www.flickr.com/gift/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091110/8f679e4f/attachment.htm From jpc-ml at zenburn.net Tue Nov 10 08:43:28 2009 From: jpc-ml at zenburn.net (=?UTF-8?B?SmFrdWIgUGlvdHIgQ8WCYXBh?=) Date: Tue Nov 10 08:43:56 2009 Subject: [plt-scheme] Re: [plt-dev] Re: Speed up check-syntax In-Reply-To: <19192.37625.138009.868012@winooski.ccs.neu.edu> References: <595b9ab20911090556u5115e7dfpfdd863588ea3fb34@mail.gmail.com> <932b2f1f0911090757i1a4fe4e9rdf5b9e4fb6efd84b@mail.gmail.com> <932b2f1f0911090828p72588563o9f83f758af475041@mail.gmail.com> <932b2f1f0911091009jec184kbe02b576da713d42@mail.gmail.com> <932b2f1f0911091022y3344aa69qc928e555ad5c7e15@mail.gmail.com> <932b2f1f0911091055s435613c6oa3668c80afbcf509@mail.gmail.com> <19192.37625.138009.868012@winooski.ccs.neu.edu> Message-ID: <4AF96E00.4070404@zenburn.net> On 09-11-09 23:08, Eli Barzilay wrote: > 4. The usual way to do these things is to have it loaded when it is > idle (exactly what Stephen said) -- but then don't just start to > load it so everything becomes slow, just do that in little > execution chunks which are done only if the system is still > otherwise idle. I think that MzScheme could use some more > functionality in this area -- a nice feature to have would be a way > for a thread to change its priority where this can also be a "run > me only when otherwise idle" (it would be especially nice to have a > hierarchy of these: "run me when otherwise idle including 1st-level > idle-priority threads, and give me only 20% running time"). Looks like you want something simillar to GCD [1][2][3]. I think that it should be quite easy to port GCD ideas to Scheme (not the multicore stuff but the dependencies and queues). Making it sensibly integrate with the system GCD library would be the challenging part. [1] http://arstechnica.com/apple/reviews/2009/08/mac-os-x-10-6.ars/12 [2] http://arstechnica.com/apple/reviews/2009/08/mac-os-x-10-6.ars/13 [3] http://www.mikeash.com/?page=pyblog/friday-qa-2009-08-28-intro-to-grand-central-dispatch-part-i-basics-and-dispatch-queues.html -- regards, Jakub Piotr C?apa From dherman at ccs.neu.edu Tue Nov 10 09:25:34 2009 From: dherman at ccs.neu.edu (Dave Herman) Date: Tue Nov 10 09:26:13 2009 Subject: [plt-scheme] Describe Function In-Reply-To: References: Message-ID: <4AF977DE.8080500@ccs.neu.edu> > What other first-class data object would be useful to include > (parameters, which get described as procedures now, modules, units, > signatures, processes, ...)? FWIW, I once tried to come up with a list of built-in PLT datatypes, which you can find here: http://bit.ly/2MSZtM (It's about 7 or 8 months old and there are probably plenty of omissions.) Dave From robby at eecs.northwestern.edu Tue Nov 10 09:31:35 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Tue Nov 10 09:31:57 2009 Subject: [plt-scheme] Describe Function In-Reply-To: <4AF977DE.8080500@ccs.neu.edu> References: <4AF977DE.8080500@ccs.neu.edu> Message-ID: <932b2f1f0911100631q16f9bc3sc9fe1e0ea7585b8b@mail.gmail.com> On Tue, Nov 10, 2009 at 8:25 AM, Dave Herman wrote: >> What other first-class data object would be useful to include (parameters, >> which get described as procedures now, modules, units, signatures, >> processes, ...)? > > FWIW, I once tried to come up with a list of built-in PLT datatypes, which > you can find here: > > ? ?http://bit.ly/2MSZtM > > (It's about 7 or 8 months old and there are probably plenty of omissions.) This probably doesn't help Doug, but here is another way to define the function linked above: #lang scheme (define (variant x) (string->symbol (regexp-replace #rx"^struct:" (symbol->string (vector-ref (struct->vector x) 0)) ""))) (variant (? (x) x)) (variant 1) (variant (let/cc k k)) (variant (let/ec k k)) From dherman at ccs.neu.edu Tue Nov 10 09:41:02 2009 From: dherman at ccs.neu.edu (Dave Herman) Date: Tue Nov 10 09:41:39 2009 Subject: [plt-scheme] Describe Function In-Reply-To: <932b2f1f0911100631q16f9bc3sc9fe1e0ea7585b8b@mail.gmail.com> References: <4AF977DE.8080500@ccs.neu.edu> <932b2f1f0911100631q16f9bc3sc9fe1e0ea7585b8b@mail.gmail.com> Message-ID: <4AF97B7E.6040202@ccs.neu.edu> > This probably doesn't help Doug, but here is another way to define the > function linked above: That's neat, thanks! Has struct->vector always worked on non-structs? Dave From robby at eecs.northwestern.edu Tue Nov 10 09:43:51 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Tue Nov 10 09:44:08 2009 Subject: [plt-scheme] Describe Function In-Reply-To: <4AF97B7E.6040202@ccs.neu.edu> References: <4AF977DE.8080500@ccs.neu.edu> <932b2f1f0911100631q16f9bc3sc9fe1e0ea7585b8b@mail.gmail.com> <4AF97B7E.6040202@ccs.neu.edu> Message-ID: <932b2f1f0911100643t5e115b91r41ad9a1c210bac4c@mail.gmail.com> On Tue, Nov 10, 2009 at 8:41 AM, Dave Herman wrote: >> This probably doesn't help Doug, but here is another way to define the >> function linked above: > > That's neat, thanks! Has struct->vector always worked on non-structs? I'm not sure about always, but at some point a while ago, Matthew decided that all values are structs (in the sense that you could have implemented everything with structs and scope, etc even if some of them are implemented in C) and adapted the primitives to make them behave accordingly. Robby From m.douglas.williams at gmail.com Tue Nov 10 10:08:33 2009 From: m.douglas.williams at gmail.com (Doug Williams) Date: Tue Nov 10 10:08:50 2009 Subject: [plt-scheme] Describe Function In-Reply-To: <932b2f1f0911100643t5e115b91r41ad9a1c210bac4c@mail.gmail.com> References: <4AF977DE.8080500@ccs.neu.edu> <932b2f1f0911100631q16f9bc3sc9fe1e0ea7585b8b@mail.gmail.com> <4AF97B7E.6040202@ccs.neu.edu> <932b2f1f0911100643t5e115b91r41ad9a1c210bac4c@mail.gmail.com> Message-ID: That is interesting. At a minimum it solves the else part of the cond. I would never have thought of using struct->vector on things I knew weren't structs. On Tue, Nov 10, 2009 at 7:43 AM, Robby Findler wrote: > On Tue, Nov 10, 2009 at 8:41 AM, Dave Herman wrote: > >> This probably doesn't help Doug, but here is another way to define the > >> function linked above: > > > > That's neat, thanks! Has struct->vector always worked on non-structs? > > I'm not sure about always, but at some point a while ago, Matthew > decided that all values are structs (in the sense that you could have > implemented everything with structs and scope, etc even if some of > them are implemented in C) and adapted the primitives to make them > behave accordingly. > > Robby > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091110/acfef700/attachment.htm From robby at eecs.northwestern.edu Tue Nov 10 10:13:39 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Tue Nov 10 10:13:56 2009 Subject: [plt-scheme] Describe Function In-Reply-To: References: <4AF977DE.8080500@ccs.neu.edu> <932b2f1f0911100631q16f9bc3sc9fe1e0ea7585b8b@mail.gmail.com> <4AF97B7E.6040202@ccs.neu.edu> <932b2f1f0911100643t5e115b91r41ad9a1c210bac4c@mail.gmail.com> Message-ID: <932b2f1f0911100713y5f4cd0a9ke3009cf391ffcbf8@mail.gmail.com> Oh, but they're all structs. Its turtles, all the way down. :) Robby On Tue, Nov 10, 2009 at 9:08 AM, Doug Williams wrote: > That is interesting. At a minimum it solves the else part of the cond. I > would never have thought of using struct->vector on things I knew weren't > structs. > > On Tue, Nov 10, 2009 at 7:43 AM, Robby Findler > wrote: >> >> On Tue, Nov 10, 2009 at 8:41 AM, Dave Herman wrote: >> >> This probably doesn't help Doug, but here is another way to define the >> >> function linked above: >> > >> > That's neat, thanks! Has struct->vector always worked on non-structs? >> >> I'm not sure about always, but at some point a while ago, Matthew >> decided that all values are structs (in the sense that you could have >> implemented everything with structs and scope, etc even if some of >> them are implemented in C) and adapted the primitives to make them >> behave accordingly. >> >> Robby > > From laurent.orseau at gmail.com Tue Nov 10 10:27:16 2009 From: laurent.orseau at gmail.com (Laurent) Date: Tue Nov 10 10:27:57 2009 Subject: [plt-scheme] Describe Function In-Reply-To: References: <4AF977DE.8080500@ccs.neu.edu> <932b2f1f0911100631q16f9bc3sc9fe1e0ea7585b8b@mail.gmail.com> <4AF97B7E.6040202@ccs.neu.edu> <932b2f1f0911100643t5e115b91r41ad9a1c210bac4c@mail.gmail.com> Message-ID: Hmm... I've just tried it on my cat, but it outputs nothing... On Tue, Nov 10, 2009 at 16:08, Doug Williams wrote: > That is interesting. At a minimum it solves the else part of the cond. I > would never have thought of using struct->vector on things I knew weren't > structs. > > > On Tue, Nov 10, 2009 at 7:43 AM, Robby Findler < > robby@eecs.northwestern.edu> wrote: > >> On Tue, Nov 10, 2009 at 8:41 AM, Dave Herman wrote: >> >> This probably doesn't help Doug, but here is another way to define the >> >> function linked above: >> > >> > That's neat, thanks! Has struct->vector always worked on non-structs? >> >> I'm not sure about always, but at some point a while ago, Matthew >> decided that all values are structs (in the sense that you could have >> implemented everything with structs and scope, etc even if some of >> them are implemented in C) and adapted the primitives to make them >> behave accordingly. >> >> Robby >> > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091110/99d16b1f/attachment.htm From geoff at knauth.org Tue Nov 10 10:54:57 2009 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Tue Nov 10 10:55:17 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: References: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> <39BE9753-0F4B-4E46-84D4-D7E5186150B4@ccs.neu.edu> <932b2f1f0911091826r5f1457b3vce47bd45fcf29fba@mail.gmail.com> Message-ID: <58C20459-B080-43E0-B61A-667E767EEF92@knauth.org> When I sense students are wondering "Why do I have to go through this...", I look for something really cool to show them, a look into the future, to indicate what this is leading to. Then I come back to the present task. The games that come with DrScheme often help. For the more mathematically inclined, I show (quickly) some math and simulation packages that exist in PLaneT. Long term, there are a number of simulators that exist in other languages I'd like to port to DrScheme--we need more application examples. This morning I visited my 10 year-old's 8th grade math glass. He explained his Game Maker program, another group of students showed their work with Scratch, and I introduced them to Bootstrap. This is the second time I've given a presentation to 8th graders in four days. I'm really struck by their inquisitiveness. They ask questions endlessly, which is really refreshing! Geoff On Nov 9, 2009, at 21:37, Shriram Krishnamurthi wrote: > I wasn't responding to Matthias's message specifically, just the general issue. > > I do like Matthias's exercise (obviously, I'm biased where that > particular problem is concerned <-;). > > These are all different ways of getting the captives to calm down and > start thinking and paying attention. > > On Mon, Nov 9, 2009 at 9:26 PM, Robby Findler > wrote: >> I agree with not being hostile, but Matthias's exercise can be quite >> valuable. Captives who don't want to be there are worse than people >> who can go away if they want and his exercise can convert some, if >> done with a bit of care. >> >> Robby >> >> On Mon, Nov 9, 2009 at 7:53 PM, Shriram Krishnamurthi wrote: >>>> They are a captive audience. They do not have the option of dropping >>>> the course. >>> >>> Then don't be hostile. You will already face a little resentment for >>> doing things non-traditionally. Show them instead why it's better. >>> After showing them animations with World, show them that you have >>> already introduced them to what is generally considered an "advanced >>> software engineering" topic (MVC, for us) in week 1. >>> >>> Just last week a major practitioner of software methodology (big-time >>> author, consultant) wrote asking for access to our World material, to >>> teach his child, on the grounds that it embodied the methodology he >>> used and preached in his professional life. >>> >>> Shriram From toddobryan at gmail.com Tue Nov 10 10:57:53 2009 From: toddobryan at gmail.com (Todd O'Bryan) Date: Tue Nov 10 10:58:15 2009 Subject: [plt-scheme] Any way to get pretty printing from the web-server? Message-ID: <904774730911100757i14643c0t6d6dce79a9913acc@mail.gmail.com> Is there an option to pretty-print the xexpr that gets passed to the webserver? We're trying to debug some JavaScript that's embedded in there, and it's really hard to read the source. Todd From noelwelsh at gmail.com Tue Nov 10 11:55:35 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Tue Nov 10 11:55:58 2009 Subject: [plt-scheme] Any way to get pretty printing from the web-server? In-Reply-To: <904774730911100757i14643c0t6d6dce79a9913acc@mail.gmail.com> References: <904774730911100757i14643c0t6d6dce79a9913acc@mail.gmail.com> Message-ID: You might try the firebug plugin for Firefox. It has a pretty printed HTML view. (You can pretty print xexprs but you have to do it manually, IIRC.) N. On Tue, Nov 10, 2009 at 3:57 PM, Todd O'Bryan wrote: > Is there an option to pretty-print the xexpr that gets passed to the > webserver? We're trying to debug some JavaScript that's embedded in > there, and it's really hard to read the source. > > Todd > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From noelwelsh at gmail.com Tue Nov 10 11:59:53 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Tue Nov 10 12:00:11 2009 Subject: [plt-scheme] Any way to get pretty printing from the web-server? In-Reply-To: References: <904774730911100757i14643c0t6d6dce79a9913acc@mail.gmail.com> Message-ID: On Tue, Nov 10, 2009 at 4:55 PM, Noel Welsh wrote: > (You can pretty print xexprs but you have to do it manually, IIRC.) To expand: 1. Pretty print the Xexpr using display-xexpr to a string port. 2. Construct a response using make-response/full and the output you accumulated in the string port N. From krhari at ccs.neu.edu Tue Nov 10 12:12:10 2009 From: krhari at ccs.neu.edu (krhari@ccs.neu.edu) Date: Tue Nov 10 12:12:38 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: <33432530.292581257872686798.JavaMail.root@zimbra> Message-ID: <24099848.292881257873130367.JavaMail.root@zimbra> Hi, I had a interesting experience last week... My brother who is doing his PhD(Mechanical) in UIUC had a presentation to give in his research group meeting... He uses a lot of MatLab... And he was struggling to do some simulation... He discussed it with me and I suggested that I will try it with PLT Scheme. Initially he had lot of doubts about it as he had never heard of Scheme but I insisted and he gave me a small data series and I came up with a simulation and he liked it. Then he asked me if I could implement the actual equations. He had 10-12 of them. I implemented it and gave him the actual code. He was very happy as the animation was exactly as he had imagined. And told me he understood the code very easily... He never asked me any questions. In his meeting when he showed the animation to his group, he told me that a couple of other PhD students and a Professor were really very happy with the animation and the simplicity of the code and they wanted to learn PLT and asked him for study material for PLT Scheme. I pointed them to many tutorials that were mentioned in the older posts here... I think no one had any FP background there(at least not my brother). And they liked it without Gambit so I don't know they might love Gambit more... But it worked here without Gambit or Bigloo... Just thought of sharing it... Thanks Hari ----- Original Message ----- From: "Philippos Apolinarius" To: plt-scheme@list.cs.brown.edu Sent: Tuesday, November 10, 2009 8:27:46 AM GMT -05:00 US/Canada Eastern Subject: Re: [plt-scheme] Re: Poacher turned gamekeeper I often wonder why all Schemes don't have something like Gambit-C SIX syntax. After all, the the traditional syntax would still be available, if one needs or prefer it. One needs the traditional syntax to do things like genetic programming, neural networks or macros. One may often prefer it. There are people who cannot swallow Lisp prefix syntax. I have shown Lisp, PLT and Bigloo to many people who uses tools like Mathlab. I always succeed in making them accetp Lisp. Here is what I do: 1 --- If the person needs a lot of math and computer algebra, I compile Maxima on SBCL to make it very fast. In fact, it becomes as fast as Lisp itself. People are amazed at the possibility of doing the same thing that they were doing in Matlab, and using similar syntax. 2 --- If the person works with network, Internet etc. I try to sell them Scheme. I discovered that it is much easier to sell them Bigloo and Gambit, that have an infix syntax than PLT or Larceny. Since providing an infix syntax seems to be very easy, I wonder why this does not become official. As far as infix syntax goes, I have a few complaints to file against the existing ones. 1 --- SIX requires one to declare types. People with a Matlab background finds it annoying. 2 --- Maxima adds a lot of annotations to the prefix representation of the infix syntax. I am not sure, but I believe that this may slow processing. 3 --- Bigloo requires the presence of the bigloorc file at every point where one launches the interpreter. If the programmer forgets the bigloorc file, goodbie infix syntax. I am sure that all the above problems can be easily fixed. --- On Tue, 11/10/09, Matthias Felleisen wrote: From: Matthias Felleisen Subject: Re: [plt-scheme] Re: Poacher turned gamekeeper To: "wooks" Cc: plt-scheme@list.cs.brown.edu Received: Tuesday, November 10, 2009, 6:00 AM On Nov 10, 2009, at 2:51 AM, wooks wrote: > As I said, there will be a 2nd course in OOP and at the moment I am > scheduled to take that. The simple answer to objectors is that they'll > do Java next term (although I am tempted to do it in Python). I am about to teach this in PLT for the first time. I'll point to lecture notes when I have them. -- Matthias _________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-scheme All new Yahoo! Mail - Get a sneak peak at messages with a handy reading pane. _________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-scheme From toddobryan at gmail.com Tue Nov 10 12:18:09 2009 From: toddobryan at gmail.com (Todd O'Bryan) Date: Tue Nov 10 12:18:27 2009 Subject: [plt-scheme] Any way to get pretty printing from the web-server? In-Reply-To: References: <904774730911100757i14643c0t6d6dce79a9913acc@mail.gmail.com> Message-ID: <904774730911100918m6cc58c9xa5736311c8945e30@mail.gmail.com> Thanks! On Tue, Nov 10, 2009 at 11:59 AM, Noel Welsh wrote: > On Tue, Nov 10, 2009 at 4:55 PM, Noel Welsh wrote: >> (You can pretty print xexprs but you have to do it manually, IIRC.) > > To expand: > > 1. Pretty print the Xexpr using display-xexpr to a string port. > 2. Construct a response using make-response/full and the output you > accumulated in the string port > > N. > From m.douglas.williams at gmail.com Tue Nov 10 13:18:12 2009 From: m.douglas.williams at gmail.com (Doug Williams) Date: Tue Nov 10 13:18:30 2009 Subject: [plt-scheme] Describe Function In-Reply-To: <932b2f1f0911100643t5e115b91r41ad9a1c210bac4c@mail.gmail.com> References: <4AF977DE.8080500@ccs.neu.edu> <932b2f1f0911100631q16f9bc3sc9fe1e0ea7585b8b@mail.gmail.com> <4AF97B7E.6040202@ccs.neu.edu> <932b2f1f0911100643t5e115b91r41ad9a1c210bac4c@mail.gmail.com> Message-ID: Robby, I am going to add your variant procedure to the describe collection. Are you happy with the name 'variant' and the contract (-> any/c symbol?)? What is the relationship between this and object-name? It seems that for actual structs they return the same value. Would it make sense to change object-name to return the same value as variant in those cases where it (i.e., object-name) returns #f? This would trivially make this functionality available in #lang scheme, which seems to be a good thing. Doug On Tue, Nov 10, 2009 at 7:43 AM, Robby Findler wrote: > On Tue, Nov 10, 2009 at 8:41 AM, Dave Herman wrote: > >> This probably doesn't help Doug, but here is another way to define the > >> function linked above: > > > > That's neat, thanks! Has struct->vector always worked on non-structs? > > I'm not sure about always, but at some point a while ago, Matthew > decided that all values are structs (in the sense that you could have > implemented everything with structs and scope, etc even if some of > them are implemented in C) and adapted the primitives to make them > behave accordingly. > > Robby > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091110/2563eba3/attachment.html From robby at eecs.northwestern.edu Tue Nov 10 13:21:47 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Tue Nov 10 13:22:51 2009 Subject: [plt-scheme] Describe Function In-Reply-To: References: <4AF977DE.8080500@ccs.neu.edu> <932b2f1f0911100631q16f9bc3sc9fe1e0ea7585b8b@mail.gmail.com> <4AF97B7E.6040202@ccs.neu.edu> <932b2f1f0911100643t5e115b91r41ad9a1c210bac4c@mail.gmail.com> Message-ID: <932b2f1f0911101021g24b9a6eqa7fa99e53d03ced@mail.gmail.com> On Tue, Nov 10, 2009 at 12:18 PM, Doug Williams wrote: > Robby, > > I am going to add your variant procedure to the describe collection. Great! > Are you > happy with the name 'variant' and the contract (-> any/c symbol?)? Yes. (You may want to use substring isntead of regexp-match.) > What is > the relationship between this and object-name? Nothing really. object-name is per-object (and not everything has a name). > It seems that for actual > structs they return the same value. Would it make sense to change > object-name to return the same value as variant in those cases where it > (i.e., object-name) returns #f? This would trivially make this functionality > available in #lang scheme, which seems to be a good thing. I don't think that that change is really a good idea at this point. Probably would break lots of stuff. Robby > Doug > > On Tue, Nov 10, 2009 at 7:43 AM, Robby Findler > wrote: >> >> On Tue, Nov 10, 2009 at 8:41 AM, Dave Herman wrote: >> >> This probably doesn't help Doug, but here is another way to define the >> >> function linked above: >> > >> > That's neat, thanks! Has struct->vector always worked on non-structs? >> >> I'm not sure about always, but at some point a while ago, Matthew >> decided that all values are structs (in the sense that you could have >> implemented everything with structs and scope, etc even if some of >> them are implemented in C) and adapted the primitives to make them >> behave accordingly. >> >> Robby > > From m.douglas.williams at gmail.com Tue Nov 10 13:29:24 2009 From: m.douglas.williams at gmail.com (Doug Williams) Date: Tue Nov 10 13:29:42 2009 Subject: [plt-scheme] Describe Function In-Reply-To: <932b2f1f0911101021g24b9a6eqa7fa99e53d03ced@mail.gmail.com> References: <4AF977DE.8080500@ccs.neu.edu> <932b2f1f0911100631q16f9bc3sc9fe1e0ea7585b8b@mail.gmail.com> <4AF97B7E.6040202@ccs.neu.edu> <932b2f1f0911100643t5e115b91r41ad9a1c210bac4c@mail.gmail.com> <932b2f1f0911101021g24b9a6eqa7fa99e53d03ced@mail.gmail.com> Message-ID: Sounds good. I was just thinking that a lower level implementation could avoid the need to create a vector just to get the variant. But for my code it's no big deal. On Tue, Nov 10, 2009 at 11:21 AM, Robby Findler wrote: > On Tue, Nov 10, 2009 at 12:18 PM, Doug Williams > wrote: > > Robby, > > > > I am going to add your variant procedure to the describe collection. > > Great! > > > Are you > > happy with the name 'variant' and the contract (-> any/c symbol?)? > > Yes. (You may want to use substring isntead of regexp-match.) > > > What is > > the relationship between this and object-name? > > Nothing really. object-name is per-object (and not everything has a name). > > > It seems that for actual > > structs they return the same value. Would it make sense to change > > object-name to return the same value as variant in those cases where it > > (i.e., object-name) returns #f? This would trivially make this > functionality > > available in #lang scheme, which seems to be a good thing. > > I don't think that that change is really a good idea at this point. > Probably would break lots of stuff. > > Robby > > > Doug > > > > On Tue, Nov 10, 2009 at 7:43 AM, Robby Findler < > robby@eecs.northwestern.edu> > > wrote: > >> > >> On Tue, Nov 10, 2009 at 8:41 AM, Dave Herman > wrote: > >> >> This probably doesn't help Doug, but here is another way to define > the > >> >> function linked above: > >> > > >> > That's neat, thanks! Has struct->vector always worked on non-structs? > >> > >> I'm not sure about always, but at some point a while ago, Matthew > >> decided that all values are structs (in the sense that you could have > >> implemented everything with structs and scope, etc even if some of > >> them are implemented in C) and adapted the primitives to make them > >> behave accordingly. > >> > >> Robby > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091110/904fae20/attachment.html From ebellani at gmail.com Tue Nov 10 13:39:58 2009 From: ebellani at gmail.com (ebellani@gmail.com) Date: Tue Nov 10 13:41:26 2009 Subject: [plt-scheme] Doubt about hashes Message-ID: Hey Plt folk I'm having a bit of a equality problem here, if someone could help I would very much appreciate it: ;; build-lexical-analysis : string -> hash ;; calculates the letter frequency for a given word ;; uses the letter as key and the frequency as value for ;; a hash (define (build-lexical-analysis word0) (local [(define (build-it word the-analysis) (cond [(empty? word) the-analysis] [(hash-has-key? the-analysis (first word)) (build-it (rest word) the-analysis)] [else (build-it (rest word) (hash-set the-analysis (first word) (count (? (the-char) (equal? (first word) the-char)) word)))]))] (build-it (string->list word0) #hash()))) (check-expect (build-lexical-analysis "hellol") #hash(("e" . 1) ("h" . 1) ("l" . 3) ("o" . 1))) Now, why is this check-expect failing? -- Eduardo Bellani www.cnxs.com.br I object to doing things that computers can do. - Olin Shivers -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: OpenPGP digital signature Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091110/640a420c/signature-0001.pgp From ebellani at gmail.com Tue Nov 10 13:49:47 2009 From: ebellani at gmail.com (ebellani@gmail.com) Date: Tue Nov 10 13:50:21 2009 Subject: [plt-scheme] Re: Doubt about hashes In-Reply-To: Message-ID: Got it, (check-expect (build-lexical-analysis "hellol") #hash((#\e . 1) (#\h . 1) (#\l . 3) (#\o . 1))) Thanks for the attention :P -- Eduardo Bellani www.cnxs.com.br I object to doing things that computers can do. - Olin Shivers -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: OpenPGP digital signature Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091110/672dcf32/signature.pgp From clements at brinckerhoff.org Tue Nov 10 15:26:44 2009 From: clements at brinckerhoff.org (John Clements) Date: Tue Nov 10 15:27:17 2009 Subject: [plt-scheme] Scheme productivity data point In-Reply-To: <4AF7D280.9070007@neilvandyke.org> References: <4AF6E07D.1050901@neilvandyke.org> <4AF7022F.9010905@cs.utah.edu> <4AF7D280.9070007@neilvandyke.org> Message-ID: On Nov 9, 2009, at 12:27 AM, Neil Van Dyke wrote: > Noel Welsh wrote at 11/08/2009 03:43 PM: >> The issue is total time to complete the job. Neil is saying that w/ >> Scheme >> > What Noel said. > > Disregard the non sequitur about the about the size of the output > files; that was quoted to help support the validity of my file I/O > comparisons, but then I decided I didn't need to support those in a > blog post, yet accidentally neglected to remove that part from the > quote. > > The nature of the work done, however, is relevant, since not all > tools are necessarily good at all tasks. PLT Scheme happens to be a > good general-purpose toolset, IMHO, but my anecdote alone doesn't go > far to supporting that. 1) Clearly, this argument applies to *any* high-level language with good libraries and low coding overhead. 2) I think it would be illuminating to find the crossover point. That is: how many times would you have to run this job to make the C++ version better? That depends on the size of the job itself, but if it took (total guess) 1 minute in C++ and 2 minutes in scheme, and you assume that the computer can run 24 hours a day after the code is written, then you have: 2 days + n*(2 minutes) = 5 days + n*(1 minute) looks like about 4,320. How many times did you actually run the program? Obviously, there are a bunch of guesses in here. John -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2484 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091110/7081e10b/smime.bin From neil at neilvandyke.org Tue Nov 10 16:00:39 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Tue Nov 10 16:01:01 2009 Subject: [plt-scheme] Scheme productivity data point In-Reply-To: References: <4AF6E07D.1050901@neilvandyke.org> <4AF7022F.9010905@cs.utah.edu> <4AF7D280.9070007@neilvandyke.org> Message-ID: <4AF9D477.4090103@neilvandyke.org> John Clements wrote at 11/10/2009 03:26 PM: > > 2) I think it would be illuminating to find the crossover point. That > is: how many times would you have to run this job to make the C++ > version better? I actually wouldn't assume that a C++ programmer would produce a faster implementation. (They might do something less efficient because, e.g., the greater complexity of poorer abstractions and/or having to manage allocations means they choose a simpler approach to keep it manageable. Or because a better approach is obscured to them by the details. Or because they don't have time to refine their approach as they gain a better understanding of the problem, since development productivity is lower, so they are stuck with one of their earlier ideas.) To answer your question, this little program has probably run for less than 2 hours wall clock time so far (it took 26 minutes to run through the entire corpus each of 2 times), and perhaps less than 1 hour in the future. Of course, as you said, we have a lot of guessing here as to what our imaginary C++ programmer might do, and this is just one anecdotal data point. -- http://www.neilvandyke.org/ From icfp.publicity at googlemail.com Tue Nov 10 16:23:29 2009 From: icfp.publicity at googlemail.com (Wouter Swierstra) Date: Tue Nov 10 16:23:49 2009 Subject: [plt-scheme] ICFP 2010: Call for papers Message-ID: <53ff55480911101323m33cdb778j2264808c6699e938@mail.gmail.com> ===================================================================== Call for Papers ICFP 2010: International Conference on Functional Programming Baltimore, Maryland, 27 -- 29 September 2010 http://www.icfpconference.org/icfp2010 ===================================================================== Important Dates (at 14:00 UTC) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Submission: 2 April 2010 Author response: 24 -- 25 May 2010 Notification: 7 June 2010 Final papers due: 12 July 2010 Scope ~~~~~ ICFP 2010 seeks original papers on the art and science of functional programming. Submissions are invited on all topics from principles to practice, from foundations to features, from abstraction to application. The scope includes all languages that encourage functional programming, including both purely applicative and imperative languages, as well as languages with objects or concurrency. Particular topics of interest include * Language Design: type systems; concurrency and distribution; modules; components and composition; metaprogramming; relations to object-oriented or logic programming; interoperability * Implementation: abstract machines; compilation; compile-time and run-time optimization; memory management; multi-threading; exploiting parallel hardware; interfaces to foreign functions, services, components or low-level machine resources * Software-Development Techniques: algorithms and data structures; design patterns; specification; verification; validation; proof assistants; debugging; testing; tracing; profiling * Foundations: formal semantics; lambda calculus; rewriting; type theory; monads; continuations; control; state; effects * Transformation and Analysis: abstract interpretation; partial evaluation; program transformation; program calculation; program proof * Applications and Domain-Specific Languages: symbolic computing; formal-methods tools; artificial intelligence; systems programming; distributed-systems and web programming; hardware design; databases; XML processing; scientific and numerical computing; graphical user interfaces; multimedia programming; scripting; system administration; security; education * Functional Pearls: elegant, instructive, and fun essays on functional programming The conference also solicits Experience Reports, which are short papers that provide evidence that functional programming really works or describe obstacles that have kept it from working in a particular application. Abbreviated instructions for authors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ By 2 April 2010, 14:00 UTC, submit an abstract of at most 300 words and a full paper of at most 12 pages (6 pages for an Experience Report), including bibliography and figures. The deadline will be strictly enforced and papers exceeding the page limits will be summarily rejected. Authors have the option to attach supplementary material to a submission, on the understanding that reviewers may choose not to look at it. A submission will be evaluated according to its relevance, correctness, significance, originality, and clarity. It should explain its contributions in both general and technical terms, clearly identifying what has been accomplished, explaining why it is significant, and comparing it with previous work. The technical content should be accessible to a broad audience. Functional Pearls and Experience Reports are separate categories of papers that need not report original research results and must be marked as such at the time of submission. Detailed guidelines on both categories are on the conference web site. Each submission must adhere to SIGPLAN's republication policy, as explained on the web at http://www.acm.org/sigplan/republicationpolicy.htm. Proceedings will be published by ACM Press. Authors of accepted submissions are expected to transfer the copyright to the ACM. Presentations will be videotaped and released online if the presenter consents by signing an additional permission form at the time of the presentation. Formatting: Submissions must be in PDF format printable in black and white on US Letter sized paper and interpretable by Ghostscript. If this requirement is a hardship, make contact with the program chair at least one week before the deadline. Papers must adhere to the standard ACM conference format: two columns, nine-point font on a ten-point baseline, with columns 20pc (3.33in) wide and 54pc (9in) tall, with a column gutter of 2pc (0.33in). A suitable document template for LATEX is available from SIGPLAN at http://www.acm.org/sigs/sigplan/authorInformation.htm. Submission: Submissions will be accepted electronically at a URL to be named later. Improved versions of a paper may be submitted at any point before the submission deadline using the same web interface. Author response: Authors will have a 48-hour period, starting at 14:00 UTC on 24 May 2010, to read and respond to reviews. Special Journal Issue: There will be a special issue of the Journal of Functional Programming with papers from ICFP 2010. The program committee will invite the authors of select accepted papers to submit a journal version to this issue. Organization ~~~~~~~~~~~~ Conference Chair Paul Hudak, Yale University Program Chair Stephanie Weirich, University of Pennsylvania Program Committee: Umut Acar, Max Planck Institute for Software Systems Zena Ariola, University of Oregon James Cheney, University of Edinburgh Peter Dybjer, Chalmers University of Technology Robert Bruce Findler, Northwestern University Andy Gill, Kansas University Fritz Henglein, University of Copenhagen Michael Hicks, University of Maryland, College Park Patricia Johann, University of Strathclyde Andres L?h, Utrecht University Simon L. Peyton Jones, Microsoft Research Didier R?my, INRIA Paris-Rocquencourt John Reppy, University of Chicago Manuel Serrano, INRIA Sophia-Antipolis Matthieu Sozeau, Harvard University From clements at brinckerhoff.org Tue Nov 10 18:04:39 2009 From: clements at brinckerhoff.org (John Clements) Date: Tue Nov 10 18:05:04 2009 Subject: [plt-scheme] Poacher turned gamekeeper In-Reply-To: References: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> <39BE9753-0F4B-4E46-84D4-D7E5186150B4@ccs.neu.edu> Message-ID: <28B96474-3DAF-47D6-BE6E-F3267F5B8BDD@brinckerhoff.org> On Nov 9, 2009, at 7:43 AM, Stephen Bloch wrote: > On Nov 9, 2009, at 9:50 AM, Matthias Felleisen > wrote: > >> 1. Use HtDP/2e to get started. Then switch. > > You can also take a look at my _Picturing Programs_, which covers a > lot of the same things as HtDP/2e (including, of course, the > functional graphics and animation stuff -- don't use the graphics > exercises in HtDP). The biggest difference is that (because a lot > of my students are mathophobic) PP starts with images, and doesn't > mention arithmetic until after your students have written a lot of > functions and even a few animations. I just spent five minutes searching for "Picturing Programs" online, and I couldn't find it. ? John -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2484 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091110/f5c2fe29/smime-0001.bin From areilly at bigpond.net.au Tue Nov 10 18:19:31 2009 From: areilly at bigpond.net.au (Andrew Reilly) Date: Tue Nov 10 18:19:56 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: <796171.24290.qm@web58801.mail.re1.yahoo.com> References: <9AE20A27-1BD9-482A-96BA-A5E13F588D9E@ccs.neu.edu> <796171.24290.qm@web58801.mail.re1.yahoo.com> Message-ID: <20091110231931.GB77609@duncan.reilly.home> On Tue, Nov 10, 2009 at 05:27:46AM -0800, Philippos Apolinarius wrote: > I often wonder why all Schemes don't have something like > Gambit-C SIX syntax. PLT has Honu (and Algol). Check it out at the bottom of the help desk. > After all, the the traditional syntax > would still be available, if one needs or prefer it. One needs > the traditional syntax to do things like genetic programming, > neural networks or macros. I'm curious about why you would think this. Scheme (like other lisps) is defined in terms of the parsed AST, not the source syntax. It works just the same with whatever syntax you use. I'm doubly curious why you would regard genetic programming and neural networks as special classes of algorithm, and put them in the same category as macros? I've used both, in C, many years ago. What's changed in the last fifteen years to make s-expression syntax a critical factor now? Cheers, -- Andrew From m.douglas.williams at gmail.com Tue Nov 10 18:51:13 2009 From: m.douglas.williams at gmail.com (Doug Williams) Date: Tue Nov 10 18:51:32 2009 Subject: [plt-scheme] Describe Function In-Reply-To: References: <4AF977DE.8080500@ccs.neu.edu> <932b2f1f0911100631q16f9bc3sc9fe1e0ea7585b8b@mail.gmail.com> <4AF97B7E.6040202@ccs.neu.edu> <932b2f1f0911100643t5e115b91r41ad9a1c210bac4c@mail.gmail.com> <932b2f1f0911101021g24b9a6eqa7fa99e53d03ced@mail.gmail.com> Message-ID: Instead of the 'everything is a struct' view, you could also use an 'everything is a vector view' and with unsafe-vector-ref take things apart - even when they are opaque. (require scheme/unsafe/ops) (define-struct s (a b c)) (define s1 (make-s 1 3 5)) s1 -> # (unsafe-vector-ref s1 0) -> # (unsafe-vector-ref s1 1) -> 1 (unsafe-vector-ref s1 2) -> 3 (unsafe-vector-ref s1 3) -> 5 I assume that as long as I stay within the bounds of the underlying representation (and probably sometimes even if I don't - negative indices are allowed), unsafe-vector-ref will give gladly me the pieces. At least there is no unsafe-vector-set! Doug On Tue, Nov 10, 2009 at 11:29 AM, Doug Williams < m.douglas.williams@gmail.com> wrote: > Sounds good. I was just thinking that a lower level implementation could > avoid the need to create a vector just to get the variant. But for my code > it's no big deal. > > > On Tue, Nov 10, 2009 at 11:21 AM, Robby Findler < > robby@eecs.northwestern.edu> wrote: > >> On Tue, Nov 10, 2009 at 12:18 PM, Doug Williams >> wrote: >> > Robby, >> > >> > I am going to add your variant procedure to the describe collection. >> >> Great! >> >> > Are you >> > happy with the name 'variant' and the contract (-> any/c symbol?)? >> >> Yes. (You may want to use substring isntead of regexp-match.) >> >> > What is >> > the relationship between this and object-name? >> >> Nothing really. object-name is per-object (and not everything has a name). >> >> > It seems that for actual >> > structs they return the same value. Would it make sense to change >> > object-name to return the same value as variant in those cases where it >> > (i.e., object-name) returns #f? This would trivially make this >> functionality >> > available in #lang scheme, which seems to be a good thing. >> >> I don't think that that change is really a good idea at this point. >> Probably would break lots of stuff. >> >> Robby >> >> > Doug >> > >> > On Tue, Nov 10, 2009 at 7:43 AM, Robby Findler < >> robby@eecs.northwestern.edu> >> > wrote: >> >> >> >> On Tue, Nov 10, 2009 at 8:41 AM, Dave Herman >> wrote: >> >> >> This probably doesn't help Doug, but here is another way to define >> the >> >> >> function linked above: >> >> > >> >> > That's neat, thanks! Has struct->vector always worked on non-structs? >> >> >> >> I'm not sure about always, but at some point a while ago, Matthew >> >> decided that all values are structs (in the sense that you could have >> >> implemented everything with structs and scope, etc even if some of >> >> them are implemented in C) and adapted the primitives to make them >> >> behave accordingly. >> >> >> >> Robby >> > >> > >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091110/9bc3caf4/attachment.htm From m.douglas.williams at gmail.com Tue Nov 10 18:57:32 2009 From: m.douglas.williams at gmail.com (Doug Williams) Date: Tue Nov 10 18:57:52 2009 Subject: [plt-scheme] Describe Function In-Reply-To: References: <4AF977DE.8080500@ccs.neu.edu> <932b2f1f0911100631q16f9bc3sc9fe1e0ea7585b8b@mail.gmail.com> <4AF97B7E.6040202@ccs.neu.edu> <932b2f1f0911100643t5e115b91r41ad9a1c210bac4c@mail.gmail.com> <932b2f1f0911101021g24b9a6eqa7fa99e53d03ced@mail.gmail.com> Message-ID: Oh, there is an unsafe-vector-set! - and unsafe-struct-ref and set!. On Tue, Nov 10, 2009 at 4:51 PM, Doug Williams wrote: > Instead of the 'everything is a struct' view, you could also use an > 'everything is a vector view' and with unsafe-vector-ref take things apart - > even when they are opaque. > > (require scheme/unsafe/ops) > > (define-struct s (a b c)) > > (define s1 (make-s 1 3 5)) > > s1 -> # > (unsafe-vector-ref s1 0) -> # > (unsafe-vector-ref s1 1) -> 1 > (unsafe-vector-ref s1 2) -> 3 > (unsafe-vector-ref s1 3) -> 5 > > I assume that as long as I stay within the bounds of the underlying > representation (and probably sometimes even if I don't - negative indices > are allowed), unsafe-vector-ref will give gladly me the pieces. At least > there is no unsafe-vector-set! > > Doug > > > On Tue, Nov 10, 2009 at 11:29 AM, Doug Williams < > m.douglas.williams@gmail.com> wrote: > >> Sounds good. I was just thinking that a lower level implementation could >> avoid the need to create a vector just to get the variant. But for my code >> it's no big deal. >> >> >> On Tue, Nov 10, 2009 at 11:21 AM, Robby Findler < >> robby@eecs.northwestern.edu> wrote: >> >>> On Tue, Nov 10, 2009 at 12:18 PM, Doug Williams >>> wrote: >>> > Robby, >>> > >>> > I am going to add your variant procedure to the describe collection. >>> >>> Great! >>> >>> > Are you >>> > happy with the name 'variant' and the contract (-> any/c symbol?)? >>> >>> Yes. (You may want to use substring isntead of regexp-match.) >>> >>> > What is >>> > the relationship between this and object-name? >>> >>> Nothing really. object-name is per-object (and not everything has a >>> name). >>> >>> > It seems that for actual >>> > structs they return the same value. Would it make sense to change >>> > object-name to return the same value as variant in those cases where it >>> > (i.e., object-name) returns #f? This would trivially make this >>> functionality >>> > available in #lang scheme, which seems to be a good thing. >>> >>> I don't think that that change is really a good idea at this point. >>> Probably would break lots of stuff. >>> >>> Robby >>> >>> > Doug >>> > >>> > On Tue, Nov 10, 2009 at 7:43 AM, Robby Findler < >>> robby@eecs.northwestern.edu> >>> > wrote: >>> >> >>> >> On Tue, Nov 10, 2009 at 8:41 AM, Dave Herman >>> wrote: >>> >> >> This probably doesn't help Doug, but here is another way to define >>> the >>> >> >> function linked above: >>> >> > >>> >> > That's neat, thanks! Has struct->vector always worked on >>> non-structs? >>> >> >>> >> I'm not sure about always, but at some point a while ago, Matthew >>> >> decided that all values are structs (in the sense that you could have >>> >> implemented everything with structs and scope, etc even if some of >>> >> them are implemented in C) and adapted the primitives to make them >>> >> behave accordingly. >>> >> >>> >> Robby >>> > >>> > >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091110/859904c3/attachment.html From robby at eecs.northwestern.edu Tue Nov 10 20:06:59 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Tue Nov 10 20:07:21 2009 Subject: [plt-scheme] Describe Function In-Reply-To: References: <4AF977DE.8080500@ccs.neu.edu> <932b2f1f0911100631q16f9bc3sc9fe1e0ea7585b8b@mail.gmail.com> <4AF97B7E.6040202@ccs.neu.edu> <932b2f1f0911100643t5e115b91r41ad9a1c210bac4c@mail.gmail.com> <932b2f1f0911101021g24b9a6eqa7fa99e53d03ced@mail.gmail.com> Message-ID: <932b2f1f0911101706w71ea7c2dgc898c128f61c7b30@mail.gmail.com> Those ones don't work on everything (fixnums, for example, altho that may be the only thing) and probably the guarantees of the behavior of those is less. And, of course, they are unsafe. :) Robby On Tue, Nov 10, 2009 at 5:57 PM, Doug Williams wrote: > Oh, there is an unsafe-vector-set! - and unsafe-struct-ref and set!. > > On Tue, Nov 10, 2009 at 4:51 PM, Doug Williams > wrote: >> >> Instead of the 'everything is a struct' view, you could also use an >> 'everything is a vector view' and with unsafe-vector-ref take things apart - >> even when they are opaque. >> >> (require scheme/unsafe/ops) >> >> (define-struct s (a b c)) >> >> (define s1 (make-s 1 3 5)) >> >> s1 -> # >> (unsafe-vector-ref s1 0) -> # >> (unsafe-vector-ref s1 1) -> 1 >> (unsafe-vector-ref s1 2) -> 3 >> (unsafe-vector-ref s1 3) -> 5 >> >> I assume that as long as I stay within the bounds of the underlying >> representation (and probably sometimes even if I don't - negative indices >> are allowed), unsafe-vector-ref will give gladly me the pieces. At least >> there is no unsafe-vector-set! >> >> Doug >> >> On Tue, Nov 10, 2009 at 11:29 AM, Doug Williams >> wrote: >>> >>> Sounds good. I was just thinking that a lower level implementation could >>> avoid the need to create a vector just to get the variant. But for my code >>> it's no big deal. >>> >>> On Tue, Nov 10, 2009 at 11:21 AM, Robby Findler >>> wrote: >>>> >>>> On Tue, Nov 10, 2009 at 12:18 PM, Doug Williams >>>> wrote: >>>> > Robby, >>>> > >>>> > I am going to add your variant procedure to the describe collection. >>>> >>>> Great! >>>> >>>> > Are you >>>> > happy with the name 'variant' and the contract (-> any/c symbol?)? >>>> >>>> Yes. (You may want to use substring isntead of regexp-match.) >>>> >>>> > What is >>>> > the relationship between this and object-name? >>>> >>>> Nothing really. object-name is per-object (and not everything has a >>>> name). >>>> >>>> > ?It seems that for actual >>>> > structs they return the same value. Would it make sense to change >>>> > object-name to return the same value as variant in those cases where >>>> > it >>>> > (i.e., object-name) returns #f? This would trivially make this >>>> > functionality >>>> > available in #lang scheme, which seems to be a good thing. >>>> >>>> I don't think that that change is really a good idea at this point. >>>> Probably would break lots of stuff. >>>> >>>> Robby >>>> >>>> > Doug >>>> > >>>> > On Tue, Nov 10, 2009 at 7:43 AM, Robby Findler >>>> > >>>> > wrote: >>>> >> >>>> >> On Tue, Nov 10, 2009 at 8:41 AM, Dave Herman >>>> >> wrote: >>>> >> >> This probably doesn't help Doug, but here is another way to define >>>> >> >> the >>>> >> >> function linked above: >>>> >> > >>>> >> > That's neat, thanks! Has struct->vector always worked on >>>> >> > non-structs? >>>> >> >>>> >> I'm not sure about always, but at some point a while ago, Matthew >>>> >> decided that all values are structs (in the sense that you could have >>>> >> implemented everything with structs and scope, etc even if some of >>>> >> them are implemented in C) and adapted the primitives to make them >>>> >> behave accordingly. >>>> >> >>>> >> Robby >>>> > >>>> > >>> >> > > From toddobryan at gmail.com Tue Nov 10 20:29:34 2009 From: toddobryan at gmail.com (Todd O'Bryan) Date: Tue Nov 10 20:30:13 2009 Subject: [plt-scheme] password formlet Message-ID: <904774730911101729o411b9260jb9b02f011c56f963@mail.gmail.com> Is there a bug in the password formlet? When I use it, I get plain text input rather than a password... Todd From jay.mccarthy at gmail.com Tue Nov 10 20:40:47 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Tue Nov 10 20:41:09 2009 Subject: [plt-scheme] password formlet In-Reply-To: <904774730911101729o411b9260jb9b02f011c56f963@mail.gmail.com> References: <904774730911101729o411b9260jb9b02f011c56f963@mail.gmail.com> Message-ID: There was a bug, but it is fixed in SVN (and in the release later this month.) Jay On Tue, Nov 10, 2009 at 6:29 PM, Todd O'Bryan wrote: > Is there a bug in the password formlet? When I use it, I get plain > text input rather than a password... > > Todd > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From phi500ac at yahoo.ca Tue Nov 10 22:12:44 2009 From: phi500ac at yahoo.ca (Philippos Apolinarius) Date: Tue Nov 10 22:13:07 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: <20091110231931.GB77609@duncan.reilly.home> Message-ID: <656195.82293.qm@web58802.mail.re1.yahoo.com> Hi, Andrew. Hi, Andrew. I think that I cannot answer your question, because I never understood how Lisp can be so fast. SBCL looks like Matlab or Python, but it is much faster. In fact, it beats C, if one uses a lot of data structures, pass functions around and build and eval expressions. In "When Lisp is fasten than C", Genetic and Evolutionary Computations, 2006, Svingen claims that Lisp is so fast because it compiles expressions on the fly. My question is: Why Python or Matlab cannot do the same? Soon after I started college two years ago, I learned to program in a language called Clean (it is the first language people learn in the small college where I study). Since I got good grades, I received a scholarship. My duties are to help people evaluate programs that solve certain engineering problems (climate change monitoring, medical signal processing, energy quality, etc.) In these fields, people use a lot of genetic programming, maximum entropy method, neural network, etc. I have seen problems that take days in Matlab and Python, hours in Ocaml and C, and are solved in minutes in SBCL or CMUCL. In one occasion, a problem took two days and a half in Matlab, and 9 minutes in SBCL+Maxima. In another example, a report generator took less than 10 seconds in CMUCL, and twenty minutes in Java. The boss couldn't believe in such a result, and examined the Java program line by line, looking for a flaw. The CMUCL version of the program should be a prototype; the idea is that the customer would receive a better and faster version in Java. Well, the customer decided to stick with the Lisp version, notwithstanding the difficulty of maintenance. As I told you, I really don't know why Lisp, having a feel of an interpreted language, can be so fast, almost as fast as batch compiled languages. I also don't understand why Python cannot have a compiler that generates code as fast as SBCL. Why Python compiler writers don't examine the SBCL code, and do something similar? In any case, I wrote a report on the speed of Lisp, and here are my hypothesis: 1 --- Lisp may attract better programmers. This means that Lisp code may be better than Python code, for instance. This include compilers. While people who work with Lisp can build very good incremental compilers that make one feel that he is working with an interpreter, and Python programmers don't? 2 --- It seems that Lisp is around a long time. Lisp compiler writers had time to write very good optimizers and incremental compilers. 3 --- Lisp may be very good for certain kinds of problems, like number crunching, computer algebra, and optimizing incremental compilers. By the way, I am not a Lisp programmer, and don't appreciate Lisp. In fact, I am trying to beat Lisp using languages like Clean and JHC. If you want to visit my page, here is the address where I describe my work: http://www.discenda.org/med/ My problem in beating Lisp is that most programs I am working with build expressions and eval them, and have a lot of occasion for parallelism. Clean and JHC don't have an eval function, i.e., I cannot build and function, compile it on the fly, and eval it; to be fair, Clean has dynamic link, which helps, but it is not as simple to use as SBCL eval. Besides this, parallel algorithms are much easier in Lisp than in Clean or JHC. Well, it is easy to program parallel algorithms in GHC, but GHC is much slower than JHC. You must understand that while Will Roger can distribute his Bigloo program in one hundred machines, all I have is a machine with two quadricore processors. Besides this, Bigloo is much faster than GHC. I believe that JHC is faster than Bigloo, but it does not have parallel processing. My theory is that Lisp compilers are so good (SBCL and CMUCL) because Lisp attracts fanatics :-) However, Clean, JHC and Haskell also attracts fanatics. Therefore, in a near future, these languages may have incremental compilers as fast as SBCL. Clean and Haskell (JHC) beats Lisp in one aspect. A genetic programming system that compiled into 52m of SBCL generated code, compiles in less than 2m of JHC generated code. Besides this, JHC code is only 4 times slower than the equivalent SBCL code. --- On Tue, 11/10/09, Andrew Reilly wrote: From: Andrew Reilly Subject: Re: [plt-scheme] Re: Poacher turned gamekeeper To: "Philippos Apolinarius" Cc: plt-scheme@list.cs.brown.edu Received: Tuesday, November 10, 2009, 4:19 PM On Tue, Nov 10, 2009 at 05:27:46AM -0800, Philippos Apolinarius wrote: > I often wonder why all Schemes don't have something like > Gambit-C SIX syntax. PLT has Honu (and Algol).? Check it out at the bottom of the help desk. > After all, the the traditional syntax > would still be available, if one needs or prefer it. One needs > the traditional syntax to do things like genetic programming, > neural networks or macros. I'm curious about why you would think this.? Scheme (like other lisps) is defined in terms of the parsed AST, not the source syntax.? It works just the same with whatever syntax you use. I'm doubly curious why you would regard genetic programming and neural networks as special classes of algorithm, and put them in the same category as macros?? I've used both, in C, many years ago.? What's changed in the last fifteen years to make s-expression syntax a critical factor now? Cheers, -- Andrew __________________________________________________________________ The new Internet Explorer? 8 - Faster, safer, easier. Optimized for Yahoo! Get it Now for Free! at http://downloads.yahoo.com/ca/internetexplorer/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091110/955debb9/attachment.htm From areilly at bigpond.net.au Wed Nov 11 00:09:31 2009 From: areilly at bigpond.net.au (Andrew Reilly) Date: Wed Nov 11 00:10:01 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: <656195.82293.qm@web58802.mail.re1.yahoo.com> References: <20091110231931.GB77609@duncan.reilly.home> <656195.82293.qm@web58802.mail.re1.yahoo.com> Message-ID: <20091111050931.GA79241@duncan.reilly.home> Hi Philippos, On Tue, Nov 10, 2009 at 07:12:44PM -0800, Philippos Apolinarius wrote: > I think that I cannot answer your question, because I never > understood how Lisp can be so fast. The important thing to remember about the performance of computer programs (and therefore benchmarks) is that the computer itself generally continues to work at exactly the same rate, in terms of instructions per second. To be sure, there's some variability these days, due to the complexity of memory hierarchies and instruction-level parallelism, and temperature regulation, but it is so, by and large. So the thing that makes one program slower than another is that it is making the processor execute a bunch of instructions that are extraneous to the process of actually computing the result. If you find that Lisp is faster than some other language for a particular class of problem, then that will almost certainly be because it is doing less unnecessary work. Finding out how and why can be interesting. > SBCL looks like Matlab > or Python, but it is much faster. In fact, it beats C, if one > uses a lot of data structures, pass functions around and build > and eval expressions. In "When Lisp is fasten than C", Genetic > and Evolutionary Computations, 2006, Svingen claims that Lisp > is so fast because it compiles expressions on the fly. My > question is: Why Python or Matlab cannot do the same? The simple answer is that they're not the same kind of language. Python is (mostly) a simple interpreter. Matlab is a simple interpreter wrapped around highly optimized BLAS and LAPAC Fortran Matrix libraries (or at least it was at one stage: I suspect that there's more Java involved, these days.) Python has an eval, but the eval'd code is still just interpreted. Matlab also has an eval (I think), but that's also working on the surface, interpreted language. Matlab is the wrong language to use unless your problem has a lot of heavy lifting in the matrix/vector functions. That's not to say that this is necessarily the case: both might (and will probably) change, over time. Python has iron Python that operates by compiling to MSIL (.NET), and so runs at native code speeds, perhaps. There is also PyPy, which can compile some classes of program. Matlab seems to be moving towards integration of its language with Java, so I would expect that to make use of the Java hot-spot compiler at some stage. (Of course the Matlab language has other issues that might make it slower than you would like in any given instance...) You might want to try some of your genetic programming work in Clojure, too: I believe that it dynamically compiles functions to JVM bytecode, which will then be compiled to native code by hotspot. > As I told you, I really don't know why Lisp, having a feel > of an interpreted language, can be so fast, almost as fast > as batch compiled languages. The lisps that you've been using, CMUCL and SBCL *are* native-code compilers. Everything that you eval is first compiled and then executed as a binary program. What's more, SBCL has a lot of type-inference (ML/Hascall style) in its compilation function, so it doesn't have to do as much dynamic dispatch as you might expect. Both interpreter loops and dynamic dispatch are examples of instruction execution superfluous to the task at hand (although usually there for good reasons none the less). > I also don't understand why > Python cannot have a compiler that generates code as fast as > SBCL. Why Python compiler writers don't examine the SBCL code, > and do something similar? That's easy: they don't want to. Python's primary creators aren't interested in the performance of their language, yet. They are only interested in the language itself. It is still young, and the community (and Guido) is still working out how they want to express their idioms. There is a lot of syntax in Python... It is an exercise in style, amongst other things. > 2 --- It seems that Lisp is around a long time. Lisp compiler > writers had time to write very good optimizers and incremental > compilers. This is certainly true. > 3 --- Lisp may be very good for certain kinds of problems, > like number crunching, computer algebra, and optimizing > incremental compilers. That is likely true too. > My problem in beating Lisp is that most programs I am working > with build expressions and eval them, and have a lot of > occasion for parallelism. Clean and JHC don't have an eval > function, i.e., I cannot build and function, compile it on the > fly, and eval it. Not many languages do. It is possible that genetic programming is in fact a perfect fit to Lisp. Oh: another language that now has dynamic compilation of generated functions is (I think) Javascript. You might want to keep your eye on that, too. > ; to be fair, Clean has dynamic link, which > helps, but it is not as simple to use as SBCL eval. Besides > this, parallel algorithms are much easier in Lisp than in > Clean or JHC. Well, it is easy to program parallel algorithms > in GHC, but GHC is much slower than JHC. You must understand > that while Will Roger can distribute his Bigloo program in one > hundred machines, all I have is a machine with two quadricore > processors. Besides this, Bigloo is much faster than GHC. I > believe that JHC is faster than Bigloo, but it does not have > parallel processing. For that kind of thing, you might want to look at erlang and termite (a library for Gambit scheme that provides erlang-like threading and communication facilities.) > Clean and Haskell (JHC) beats Lisp in one aspect. A genetic > programming system that compiled into 52m of SBCL generated > code, compiles in less than 2m of JHC generated code. Besides > this, JHC code is only 4 times slower than the equivalent SBCL > code. That's a very common trade-off: compilation time verses execution time. That's why most compilers have control knobs to tell them how hard to work on optimizing the compiled code, compared to just running it. After all, the act of compilation is a whole pile of instructions that aren't directly computing the desired result, but they may well be reducing the number of instructions that are executed once it eventually gets to the task of computing the desired result. You have to have a sense of how much work is involved in the result computation verses the amount involved in the compilation (and, indeed, the amount of human-time involved in writing the program in the first place: it is the latter factor that has the Python programmers all excited: they are mostly concerned with programs that take much longer to write than they do to run.) Good luck with your studies! You seem to have access to some very cool and interesting problems. That is a very good starting point. Cheers, -- Andrew From krhari at ccs.neu.edu Wed Nov 11 01:14:59 2009 From: krhari at ccs.neu.edu (Hari Prashanth K R) Date: Wed Nov 11 01:15:30 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: <439097.51059.qm@web58801.mail.re1.yahoo.com> Message-ID: <7532479.302921257920099422.JavaMail.root@zimbra> Hi Philippos, Well my name is just Hari:-). I agree with you... I was just trying to share my experience with you thats it... Thanks for the links... I will definitely go thru' it... Thanks Hari ----- Original Message ----- From: "Philippos Apolinarius" To: krhari@ccs.neu.edu Sent: Tuesday, November 10, 2009 10:30:31 PM GMT -05:00 US/Canada Eastern Subject: Re: [plt-scheme] Re: Poacher turned gamekeeper Hi, Krhari. Well, I think that having six in other Schemes won't hurt at all. I mean, if you want, you can stay with traditional Scheme. If somebody wants, s/he can use six-syntax. By the way, you may want to visit a Bigloo web application: http://hop.inria.fr/ You may also want to see a PHP compiler written in Bigloo (in fact, it generates Scheme, that Bigloo compiles): http://www.roadsend.com/home/index.php I also suggest that you show Maxima to your brother. I am sure he will like it. --- On Tue, 11/10/09, krhari@ccs.neu.edu wrote: From: krhari@ccs.neu.edu Subject: Re: [plt-scheme] Re: Poacher turned gamekeeper To: "Philippos Apolinarius" Cc: plt-scheme@list.cs.brown.edu Received: Tuesday, November 10, 2009, 10:12 AM Hi, I had a interesting experience last week... My brother who is doing his PhD(Mechanical) in UIUC had a presentation to give in his research group meeting... He uses a lot of MatLab... And he was struggling to do some simulation... He discussed it with me and I suggested that I will try it with PLT Scheme. Initially he had lot of doubts about it as he had never heard of Scheme but I insisted and he gave me a small data series and I came up with a simulation and he liked it. Then he asked me if I could implement the actual equations. He had 10-12 of them. I implemented it and gave him the actual code. He was very happy as the animation was exactly as he had imagined. And told me he understood the code very easily... He never asked me any questions. In his meeting when he showed the animation to his group, he told me that a couple of other PhD students and a Professor were really very happy with the animation and the simplicity of the code and they wanted to learn PLT and asked him for study material for PLT Scheme. I pointed them to many tutorials that were mentioned in the older posts here... I think no one had any FP background there(at least not my brother). And they liked it without Gambit so I don't know they might love Gambit more... But it worked here without Gambit or Bigloo... Just thought of sharing it... Thanks Hari ----- Original Message ----- From: "Philippos Apolinarius" < phi500ac@yahoo.ca > To: plt-scheme@list.cs.brown.edu Sent: Tuesday, November 10, 2009 8:27:46 AM GMT -05:00 US/Canada Eastern Subject: Re: [plt-scheme] Re: Poacher turned gamekeeper I often wonder why all Schemes don't have something like Gambit-C SIX syntax. After all, the the traditional syntax would still be available, if one needs or prefer it. One needs the traditional syntax to do things like genetic programming, neural networks or macros. One may often prefer it. There are people who cannot swallow Lisp prefix syntax. I have shown Lisp, PLT and Bigloo to many people who uses tools like Mathlab. I always succeed in making them accetp Lisp. Here is what I do: 1 --- If the person needs a lot of math and computer algebra, I compile Maxima on SBCL to make it very fast. In fact, it becomes as fast as Lisp itself. People are amazed at the possibility of doing the same thing that they were doing in Matlab, and using similar syntax. 2 --- If the person works with network, Internet etc. I try to sell them Scheme. I discovered that it is much easier to sell them Bigloo and Gambit, that have an infix syntax than PLT or Larceny. Since providing an infix syntax seems to be very easy, I wonder why this does not become official. As far as infix syntax goes, I have a few complaints to file against the existing ones. 1 --- SIX requires one to declare types. People with a Matlab background finds it annoying. 2 --- Maxima adds a lot of annotations to the prefix representation of the infix syntax. I am not sure, but I believe that this may slow processing. 3 --- Bigloo requires the presence of the bigloorc file at every point where one launches the interpreter. If the programmer forgets the bigloorc file, goodbie infix syntax. I am sure that all the above problems can be easily fixed. --- On Tue, 11/10/09, Matthias Felleisen < matthias@ccs.neu.edu > wrote: From: Matthias Felleisen < matthias@ccs.neu.edu > Subject: Re: [plt-scheme] Re: Poacher turned gamekeeper To: "wooks" < wookiz@hotmail.com > Cc: plt-scheme@list.cs.brown.edu Received: Tuesday, November 10, 2009, 6:00 AM On Nov 10, 2009, at 2:51 AM, wooks wrote: > As I said, there will be a 2nd course in OOP and at the moment I am > scheduled to take that. The simple answer to objectors is that they'll > do Java next term (although I am tempted to do it in Python). I am about to teach this in PLT for the first time. I'll point to lecture notes when I have them. -- Matthias _________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-scheme All new Yahoo! Mail - Get a sneak peak at messages with a handy reading pane. _________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-scheme Yahoo! Canada Toolbar : Search from anywhere on the web and bookmark your favourite sites. Download it now! From laurent.orseau at gmail.com Wed Nov 11 04:17:44 2009 From: laurent.orseau at gmail.com (Laurent) Date: Wed Nov 11 04:18:35 2009 Subject: [plt-scheme] Describe Function In-Reply-To: <932b2f1f0911101706w71ea7c2dgc898c128f61c7b30@mail.gmail.com> References: <932b2f1f0911100631q16f9bc3sc9fe1e0ea7585b8b@mail.gmail.com> <4AF97B7E.6040202@ccs.neu.edu> <932b2f1f0911100643t5e115b91r41ad9a1c210bac4c@mail.gmail.com> <932b2f1f0911101021g24b9a6eqa7fa99e53d03ced@mail.gmail.com> <932b2f1f0911101706w71ea7c2dgc898c128f61c7b30@mail.gmail.com> Message-ID: Is there a way to write normal scheme code, then (once check-proofed) change a value somewhere and make it use all the unsafe ops, preferably even at DrScheme core? I wonder how much faster the code could get. (Just thinking about a possible trade-off: a macro that switches between safe and unsafe locally.) Laurent On Wed, Nov 11, 2009 at 02:06, Robby Findler wrote: > Those ones don't work on everything (fixnums, for example, altho that > may be the only thing) and probably the guarantees of the behavior of > those is less. And, of course, they are unsafe. :) > > Robby > > On Tue, Nov 10, 2009 at 5:57 PM, Doug Williams > wrote: > > Oh, there is an unsafe-vector-set! - and unsafe-struct-ref and set!. > > > > On Tue, Nov 10, 2009 at 4:51 PM, Doug Williams > > wrote: > >> > >> Instead of the 'everything is a struct' view, you could also use an > >> 'everything is a vector view' and with unsafe-vector-ref take things > apart - > >> even when they are opaque. > >> > >> (require scheme/unsafe/ops) > >> > >> (define-struct s (a b c)) > >> > >> (define s1 (make-s 1 3 5)) > >> > >> s1 -> # > >> (unsafe-vector-ref s1 0) -> # > >> (unsafe-vector-ref s1 1) -> 1 > >> (unsafe-vector-ref s1 2) -> 3 > >> (unsafe-vector-ref s1 3) -> 5 > >> > >> I assume that as long as I stay within the bounds of the underlying > >> representation (and probably sometimes even if I don't - negative > indices > >> are allowed), unsafe-vector-ref will give gladly me the pieces. At least > >> there is no unsafe-vector-set! > >> > >> Doug > >> > >> On Tue, Nov 10, 2009 at 11:29 AM, Doug Williams > >> wrote: > >>> > >>> Sounds good. I was just thinking that a lower level implementation > could > >>> avoid the need to create a vector just to get the variant. But for my > code > >>> it's no big deal. > >>> > >>> On Tue, Nov 10, 2009 at 11:21 AM, Robby Findler > >>> wrote: > >>>> > >>>> On Tue, Nov 10, 2009 at 12:18 PM, Doug Williams > >>>> wrote: > >>>> > Robby, > >>>> > > >>>> > I am going to add your variant procedure to the describe collection. > >>>> > >>>> Great! > >>>> > >>>> > Are you > >>>> > happy with the name 'variant' and the contract (-> any/c symbol?)? > >>>> > >>>> Yes. (You may want to use substring isntead of regexp-match.) > >>>> > >>>> > What is > >>>> > the relationship between this and object-name? > >>>> > >>>> Nothing really. object-name is per-object (and not everything has a > >>>> name). > >>>> > >>>> > It seems that for actual > >>>> > structs they return the same value. Would it make sense to change > >>>> > object-name to return the same value as variant in those cases where > >>>> > it > >>>> > (i.e., object-name) returns #f? This would trivially make this > >>>> > functionality > >>>> > available in #lang scheme, which seems to be a good thing. > >>>> > >>>> I don't think that that change is really a good idea at this point. > >>>> Probably would break lots of stuff. > >>>> > >>>> Robby > >>>> > >>>> > Doug > >>>> > > >>>> > On Tue, Nov 10, 2009 at 7:43 AM, Robby Findler > >>>> > > >>>> > wrote: > >>>> >> > >>>> >> On Tue, Nov 10, 2009 at 8:41 AM, Dave Herman > >>>> >> wrote: > >>>> >> >> This probably doesn't help Doug, but here is another way to > define > >>>> >> >> the > >>>> >> >> function linked above: > >>>> >> > > >>>> >> > That's neat, thanks! Has struct->vector always worked on > >>>> >> > non-structs? > >>>> >> > >>>> >> I'm not sure about always, but at some point a while ago, Matthew > >>>> >> decided that all values are structs (in the sense that you could > have > >>>> >> implemented everything with structs and scope, etc even if some of > >>>> >> them are implemented in C) and adapted the primitives to make them > >>>> >> behave accordingly. > >>>> >> > >>>> >> Robby > >>>> > > >>>> > > >>> > >> > > > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091111/5a73b8f3/attachment.htm From geoff at knauth.org Wed Nov 11 06:18:12 2009 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Wed Nov 11 06:18:31 2009 Subject: [plt-scheme] Scheme productivity data point In-Reply-To: <7561645D-C04B-4AA0-A838-A2C482941DDC@ccs.neu.edu> References: <4AF6E07D.1050901@neilvandyke.org> <4AF7022F.9010905@cs.utah.edu> <7561645D-C04B-4AA0-A838-A2C482941DDC@ccs.neu.edu> Message-ID: <94D23672-EE7B-45C3-948D-85FD9BDBCF5A@knauth.org> On Nov 8, 2009, at 16:28, Matthias Felleisen wrote: > Here is a similar story from a scientific computation group at Cornell, working Boeing. (Zippel is my source.) > > They developed a Lisp-based framework for transforming continuous mathematics for wings into discrete and then into Fortran programs. They reduced the development time for Cray Fortran programs from a year to a month. Then they ran the program, which took another month (and a bit less). Then they had the results and could throw away the program. Sounds like a winner? Sadly a month of Cray time was more expensive in 1992 than 11 month of Fortran programmer time. They had lost -- Matthias Now we programmers are cheaper still, and our tools are vastly better. Supercomputers are probably not cheaper, but now we can use lots of cheap machines. I wonder if they would win if the computation could be distributed, and if Amazon cloud will let folks rent a non-trivial collection of machines. Scheme/Lisp could help make intelligent choices about how to divide and conquer, and could craft the distributed code. From neil at neilvandyke.org Wed Nov 11 06:48:12 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Wed Nov 11 06:48:33 2009 Subject: [plt-scheme] Scheme productivity data point In-Reply-To: <94D23672-EE7B-45C3-948D-85FD9BDBCF5A@knauth.org> References: <4AF6E07D.1050901@neilvandyke.org> <4AF7022F.9010905@cs.utah.edu> <7561645D-C04B-4AA0-A838-A2C482941DDC@ccs.neu.edu> <94D23672-EE7B-45C3-948D-85FD9BDBCF5A@knauth.org> Message-ID: <4AFAA47C.7000206@neilvandyke.org> Nowadays, there are lots of cheap ways to build, borrow, or rent a cheap distributed, cluster, or hard-wired supercomputer for many purposes. But, when thinking about viability of Scheme or any other platform, rather than try to do the math on vague general situations and imagined numbers, I think it's easier to start with specific real problems and reason about good ways to satisfy the project requirements. One can make sure Scheme always gets considered as part of the solution. -- http://www.neilvandyke.org/ From asau at inbox.ru Wed Nov 11 08:24:09 2009 From: asau at inbox.ru (Aleksej Saushev) Date: Wed Nov 11 08:24:55 2009 Subject: [plt-scheme] mred dumps core on NetBSD Message-ID: <87639hmbye.fsf@inbox.ru> Hello! I'm trying (rather lazily) to make this damn thing work. Current installation is NetBSD 5.99.22 i386, but this happened before. I'm using Subversion snapshot as of past midnight UTC. mred dumps core: $ gdb mred (gdb) run Starting program: /usr/pkg/bin/mred Program received signal SIGSEGV, Segmentation fault. 0x0835b6e7 in scheme_gmp_tls_unload () (gdb) bt #0 0x0835b6e7 in scheme_gmp_tls_unload () #1 0x0833473f in done_with_GC () #2 0xbafb04c0 in ?? () #3 0x00000000 in ?? () (gdb) c Continuing. Seg fault (internal error) at 0x0 Program received signal SIGABRT, Aborted. 0xbb662907 in _lwp_kill () from /usr/lib/libc.so.12 (gdb) bt #0 0xbb662907 in _lwp_kill () from /usr/lib/libc.so.12 #1 0xbb6628c5 in raise () from /usr/lib/libc.so.12 #2 0xbb66209a in abort () from /usr/lib/libc.so.12 #3 0x0836a4e5 in fault_handler () #4 0xbb33cd30 in ?? () #5 0xbb3754d8 in ?? () #6 0xbb41fdec in _citrus_iconv_std_iconv_getops () from /usr/lib/i18n/libiconv_std.so.5.0 Previous frame inner to this frame (corrupt stack?) (gdb) c Continuing. Program terminated with signal SIGABRT, Aborted. The program no longer exists. Eli suggested slightly different way to extract debug information, though I'm not sure it is more effective: $ gdb mred ... (gdb) handle SIGSEGV nostop noprint Signal Stop Print Pass to program Description SIGSEGV No No Yes Segmentation fault (gdb) run Starting program: /usr/pkg/bin/mred Seg fault (internal error) at 0x0 Program received signal SIGABRT, Aborted. 0xbb662907 in _lwp_kill () from /usr/lib/libc.so.12 (gdb) bt #0 0xbb662907 in _lwp_kill () from /usr/lib/libc.so.12 #1 0xbb6628c5 in raise () from /usr/lib/libc.so.12 #2 0xbb66209a in abort () from /usr/lib/libc.so.12 #3 0x0836a4e5 in fault_handler () #4 0xbae040d0 in ?? () #5 0xbb3754d8 in ?? () #6 0xbb41fdec in _citrus_iconv_std_iconv_getops () from /usr/lib/i18n/libiconv_std.so.5.0 Previous frame inner to this frame (corrupt stack?) (gdb) c Continuing. Program terminated with signal SIGABRT, Aborted. The program no longer exists. I'm afraid, that I can't debug it without your input, I don't have much time to grok the code. Yet I'd like to provide more input and testing. Command-line interpreter seems to work, though I didn't perform any tests. If there is regression testsuite, let me know, I'll try it out. Also, while here, I'd like to have some knob to make PLT not install files under HOME and use some directory under PREFIX instead. I can change it myself, if you tell me which components do that. -- HE CE3OH... From asau at inbox.ru Wed Nov 11 08:28:10 2009 From: asau at inbox.ru (Aleksej Saushev) Date: Wed Nov 11 08:30:24 2009 Subject: [plt-scheme] Re: mred dumps core on NetBSD References: <87639hmbye.fsf@inbox.ru> Message-ID: <871vk5mbrp.fsf@inbox.ru> Hello! I just realized that it is another binary which isn't stripped: (gdb) $ gdb /tmp/local/plt-scheme/work/plt-scheme-4.2.2/src/mred/mred3m (gdb) run Starting program: /tmp/local/plt-scheme/work/plt-scheme-4.2.2/src/mred/mred3m Program received signal SIGSEGV, Segmentation fault. 0x0835b6e7 in scheme_gmp_tls_unload () (gdb) bt #0 0x0835b6e7 in scheme_gmp_tls_unload () #1 0x0833473f in done_with_GC () #2 0xbafd84c0 in ?? () #3 0x00000000 in ?? () (gdb) c Continuing. Seg fault (internal error) at 0x0 Program received signal SIGABRT, Aborted. 0xbb662907 in _lwp_kill () from /usr/lib/libc.so.12 (gdb) bt #0 0xbb662907 in _lwp_kill () from /usr/lib/libc.so.12 #1 0xbb6628c5 in raise () from /usr/lib/libc.so.12 #2 0xbb66209a in abort () from /usr/lib/libc.so.12 #3 0x0836a4e5 in fault_handler () #4 0xbb6639a5 in __errno () from /usr/lib/libc.so.12 Previous frame inner to this frame (corrupt stack?) (gdb) c Continuing. Program terminated with signal SIGABRT, Aborted. The program no longer exists. Not that it helps much better though. -- HE CE3OH... From sbloch at adelphi.edu Wed Nov 11 08:51:52 2009 From: sbloch at adelphi.edu (Stephen Bloch) Date: Wed Nov 11 08:52:25 2009 Subject: [plt-scheme] Poacher turned gamekeeper In-Reply-To: <28B96474-3DAF-47D6-BE6E-F3267F5B8BDD@brinckerhoff.org> References: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> <39BE9753-0F4B-4E46-84D4-D7E5186150B4@ccs.neu.edu> <28B96474-3DAF-47D6-BE6E-F3267F5B8BDD@brinckerhoff.org> Message-ID: <6D35B1F1-868E-42E5-9C9F-C179EEF3BDC9@adelphi.edu> John Clements wrote: > I just spent five minutes searching for "Picturing Programs" online, > and I couldn't find it. Sorry; I haven't put it on the Web because that effectively puts it in the public domain. I will, however, e-mail a draft to pretty much anybody who wants one, particularly if you might want to use it in a class. I hope to have it in print next summer, at a reasonably low cost, and to make it free on the Web at a later date. The sooner the publisher makes back their original investment, the sooner I'm allowed to put it on the Web. Steve > From wmfarr at gmail.com Wed Nov 11 15:57:22 2009 From: wmfarr at gmail.com (Will M. Farr) Date: Wed Nov 11 15:57:44 2009 Subject: [plt-scheme] Question about _gcpointer and _cvector Message-ID: <0F1BCDE4-8B34-4847-8071-EE0BE3219580@gmail.com> Hello all, I have a question that (I think) the manual doesn't answer regarding the interaction between _gcpointer and _cvector in the foreign interface. Suppose I have a C routine that uses the scheme_malloc_... functions to create an array of structs allocated under the control of the garbage collector. Then I do the following in the FFI: (define make-some-stuff (get-ffi-obj 'make_some_stuff my-library (_fun (n-stuff : _ufixnum) -> (stuff-array _gcpointer) -> (make-cvector* stuff-array _stuff-pointer n-stuff)))) Does the cvector object always know that the pointer it holds should be a _gcpointer? Suppose I change the _gcpointer above to _pointer (which would be a mistake, but understandable)---does the cvector notice? What about if the memory is allocated using regular malloc, and I use _gcpointer above---is the new cvector vulnerable to the same memory bug that led to the creation of _gcpointer? In short, does a cvector know about the _[gc]pointer status of the memory block it holds? For the moment, these questions are academic (in that I have an interface like the above, and nothing seems to go wrong under many repetitions of allocation, use, and discard with interspersed (collect-garbage) calls), but since the bugs that required the introduction of _gcpointer were intermittent, I'm nervous. Thanks! Will From mflatt at cs.utah.edu Wed Nov 11 16:27:47 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Wed Nov 11 16:28:06 2009 Subject: [plt-scheme] Question about _gcpointer and _cvector In-Reply-To: <0F1BCDE4-8B34-4847-8071-EE0BE3219580@gmail.com> References: <0F1BCDE4-8B34-4847-8071-EE0BE3219580@gmail.com> Message-ID: <20091111212748.74FAC6500EA@mail-svr1.cs.utah.edu> At Wed, 11 Nov 2009 14:57:22 -0600, "Will M. Farr" wrote: > I have a question that (I think) the manual doesn't answer regarding the > interaction between _gcpointer and _cvector in the foreign interface. Suppose > I have a C routine that uses the scheme_malloc_... functions to create an > array of structs allocated under the control of the garbage collector. Then I > do the following in the FFI: > > (define make-some-stuff > (get-ffi-obj 'make_some_stuff my-library > (_fun (n-stuff : _ufixnum) -> (stuff-array _gcpointer) -> > (make-cvector* stuff-array _stuff-pointer n-stuff)))) > > Does the cvector object always know that the pointer it holds should be a > _gcpointer? The wrapper allocated by `make-cvector*' above uses the pointer representation (i.e., a Scheme value) that is bound to `stuff-array'. Since that representation is based on `_gcpointer', it will retain the underlying pointer in the correct way. > Suppose I change the _gcpointer above to _pointer (which would be > a mistake, but understandable)---does the cvector notice? Yes, the resulting `_cvector' would be wrong. > What about if the > memory is allocated using regular malloc, and I use _gcpointer above---is the > new cvector vulnerable to the same memory bug that led to the creation of > _gcpointer? Yes. > In short, does a cvector know about the _[gc]pointer status of > the memory block it holds? No. `make-cvector*' just holds on to the representation of the pointer, and the representation carries with it the GCability of the underlying pointer. I think it would be helpful to revise the FFI docs to make a clear distinction between a "foreign pointer" and "a Scheme value that represents a foreign pointer", but I haven't yet had time to try that. Not your question, but just in case it's an issue: You should make sure that `_stuff-pointer' is based on `_gcpointer' and not on `_pointer', since the individual pointers in the array produced by make_some_stuff() refer to GCable memory. Otherwise, when you extract a value from the array with `cvector-ref', the resulting pointer representation will not correctly retain the pointer extracted from the array. If `_stuff-pointer' happens to be defined by `(define-cstruct _stuff ....)', then you should use `(_gcable _stuff-pointer)' instead of `_stuff-pointer', since the `_stuff-pointer' defined by `define-cstruct' will be based on `_pointer'. From rafkind at cs.utah.edu Wed Nov 11 18:48:51 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Wed Nov 11 18:52:01 2009 Subject: [plt-scheme] show a snip in interactions pane Message-ID: <4AFB4D63.5070300@cs.utah.edu> I was trying to draw colored strings by overriding the `draw' method of string-snip% but my string is always drawn in black (foreground) and white (background). Is it because the interactions pane always prints the raw text from `get-text' ? (define (text-snip text) (new (class string-snip% (define/override (draw dc x y left top right bottom dx dy draw-caret) (send dc set-text-foreground (make-object color% 255 0 0))) (super-new) (send this insert text (string-length text))))) (text-snip "hello") From plt at synx.us.to Wed Nov 11 19:12:13 2009 From: plt at synx.us.to (Synx) Date: Wed Nov 11 19:12:49 2009 Subject: [plt-scheme] Any way to get pretty printing from the web-server? In-Reply-To: <904774730911100757i14643c0t6d6dce79a9913acc@mail.gmail.com> References: <904774730911100757i14643c0t6d6dce79a9913acc@mail.gmail.com> Message-ID: <4AFB52DD.1030100@synx.us.to> How about this? (require scheme/pretty) (pretty-print xexpr) An xexpr is a type of s-expression, so it should be prettily printable just like any other s-exp. From yinso.chen at gmail.com Wed Nov 11 19:30:19 2009 From: yinso.chen at gmail.com (YC) Date: Wed Nov 11 19:30:40 2009 Subject: [plt-scheme] Any way to get pretty printing from the web-server? In-Reply-To: <4AFB52DD.1030100@synx.us.to> References: <904774730911100757i14643c0t6d6dce79a9913acc@mail.gmail.com> <4AFB52DD.1030100@synx.us.to> Message-ID: <779bf2730911111630r4394938do41249cb06fcdf1a1@mail.gmail.com> Isn't this about pretty print the html output fconverted rom the xexpr? Cheers, yc On Wed, Nov 11, 2009 at 4:12 PM, Synx wrote: > > How about this? > > (require scheme/pretty) > > (pretty-print xexpr) > > An xexpr is a type of s-expression, so it should be prettily printable > just like any other s-exp. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091111/51904ff4/attachment.htm From ryanc at ccs.neu.edu Wed Nov 11 20:13:20 2009 From: ryanc at ccs.neu.edu (Ryan Culpepper) Date: Wed Nov 11 20:13:48 2009 Subject: [plt-scheme] show a snip in interactions pane In-Reply-To: <4AFB4D63.5070300@cs.utah.edu> References: <4AFB4D63.5070300@cs.utah.edu> Message-ID: <4AFB6130.7000903@ccs.neu.edu> I believe DrScheme makes a copy of the snip before inserting it into the interactions editor. Since you aren't overriding , the "copy" is probably just a string-snip%. might be just the snip% copy method. Or it might be the whole snip-class infrastructure. I'm not sure. Try implementing copy first and see if that works. Ryan Jon Rafkind wrote: > I was trying to draw colored strings by overriding the `draw' method of > string-snip% but my string is always drawn in black (foreground) and > white (background). Is it because the interactions pane always prints > the raw text from `get-text' ? > > (define (text-snip text) > (new > (class string-snip% > (define/override (draw dc x y left top right bottom dx dy draw-caret) > (send dc set-text-foreground (make-object color% 255 0 0))) > (super-new) > (send this insert text (string-length text))))) > (text-snip "hello") > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From robby at eecs.northwestern.edu Wed Nov 11 20:42:24 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Wed Nov 11 20:42:48 2009 Subject: [plt-scheme] show a snip in interactions pane In-Reply-To: <4AFB6130.7000903@ccs.neu.edu> References: <4AFB4D63.5070300@cs.utah.edu> <4AFB6130.7000903@ccs.neu.edu> Message-ID: <932b2f1f0911111742k4fb1b60bheed64dbfed5ac838@mail.gmail.com> Yes, it calls the copy method. But in general, you may have to follow all of the instructions in the snip% documentation to make sure everything works. (Another good test is are putting your snip into the definitions window and saving the file.) Robby On Wed, Nov 11, 2009 at 7:13 PM, Ryan Culpepper wrote: > I believe DrScheme makes a copy of the snip before inserting it into the > interactions editor. Since you aren't overriding , the > "copy" is probably just a string-snip%. > > might be just the snip% copy method. Or it might be the > whole snip-class infrastructure. I'm not sure. Try implementing copy first > and see if that works. > > Ryan > > Jon Rafkind wrote: >> >> I was trying to draw colored strings by overriding the `draw' method of >> string-snip% but my string is always drawn in black (foreground) and white >> (background). Is it because the interactions pane always prints the raw text >> from `get-text' ? >> >> (define (text-snip text) >> ?(new >> ?(class string-snip% >> ? ?(define/override (draw dc x y left top right bottom dx dy draw-caret) >> ? ? ?(send dc set-text-foreground (make-object color% 255 0 0))) >> ? ?(super-new) >> ? ?(send this insert text (string-length text))))) >> ? (text-snip "hello") >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From matthias at ccs.neu.edu Wed Nov 11 20:56:38 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Wed Nov 11 20:57:12 2009 Subject: [plt-scheme] show a snip in interactions pane In-Reply-To: <4AFB4D63.5070300@cs.utah.edu> References: <4AFB4D63.5070300@cs.utah.edu> Message-ID: Look for 'matrix' in the collects system. Copy and play what you find there. It took me three or four interactions with Robby and/or Matthew to get my matrix stuff installed. The docs contain a lot of stuff but not necessarily in a way that helps you get there. -- Matthias On Nov 11, 2009, at 6:48 PM, Jon Rafkind wrote: > I was trying to draw colored strings by overriding the `draw' method > of string-snip% but my string is always drawn in black (foreground) > and white (background). Is it because the interactions pane always > prints the raw text from `get-text' ? > > (define (text-snip text) > (new > (class string-snip% > (define/override (draw dc x y left top right bottom dx dy draw- > caret) > (send dc set-text-foreground (make-object color% 255 0 0))) > (super-new) > (send this insert text (string-length text))))) > (text-snip "hello") > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From wookiz at hotmail.com Thu Nov 12 05:44:26 2009 From: wookiz at hotmail.com (wooks) Date: Thu Nov 12 05:44:45 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: <39BE9753-0F4B-4E46-84D4-D7E5186150B4@ccs.neu.edu> References: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> <39BE9753-0F4B-4E46-84D4-D7E5186150B4@ccs.neu.edu> Message-ID: <9bc16bdc-f8bb-4ba6-b079-e881ff8b76e5@b2g2000yqi.googlegroups.com> On Nov 9, 2:50?pm, Matthias Felleisen wrote: > 1. Use HtDP/2e to get started. Then switch. > So I'm looking at it and wondering how to explain why (string->number "hello world") returns a boolean. From geoff at knauth.org Thu Nov 12 06:32:54 2009 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Thu Nov 12 06:33:13 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: <9bc16bdc-f8bb-4ba6-b079-e881ff8b76e5@b2g2000yqi.googlegroups.com> References: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> <39BE9753-0F4B-4E46-84D4-D7E5186150B4@ccs.neu.edu> <9bc16bdc-f8bb-4ba6-b079-e881ff8b76e5@b2g2000yqi.googlegroups.com> Message-ID: <950377D3-BFEF-42B4-976E-EF5059807407@knauth.org> On Nov 12, 2009, at 05:44, wooks wrote: > On Nov 9, 2:50 pm, Matthias Felleisen wrote: >> 1. Use HtDP/2e to get started. Then switch. > So I'm looking at it and wondering how to explain why (string->number > "hello world") returns a boolean. My documentation for beginner language says: string->number : (string -> (union number false)) Purpose: to convert a string into a number, produce false if impossible From wookiz at hotmail.com Thu Nov 12 06:42:36 2009 From: wookiz at hotmail.com (wooks) Date: Thu Nov 12 06:42:55 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: <950377D3-BFEF-42B4-976E-EF5059807407@knauth.org> References: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> <39BE9753-0F4B-4E46-84D4-D7E5186150B4@ccs.neu.edu> <9bc16bdc-f8bb-4ba6-b079-e881ff8b76e5@b2g2000yqi.googlegroups.com> <950377D3-BFEF-42B4-976E-EF5059807407@knauth.org> Message-ID: <0bc5e7ae-0312-459c-a123-c11e2819a44d@o10g2000yqa.googlegroups.com> On Nov 12, 11:32?am, "Geoffrey S. Knauth" wrote: > On Nov 12, 2009, at 05:44, wooks wrote: > > > On Nov 9, 2:50 pm, Matthias Felleisen wrote: > >> 1. Use HtDP/2e to get started. Then switch. > > So I'm looking at it and wondering how to explain why (string->number > > "hello world") returns a boolean. > > My documentation for beginner language says: > > string->number : (string -> (union number false)) > > Purpose: to convert a string into a number, produce false if >impossible > Yes I saw that. I was hoping be able to give a different answer than "thats the way it was defined". From laurent.orseau at gmail.com Thu Nov 12 07:51:51 2009 From: laurent.orseau at gmail.com (Laurent) Date: Thu Nov 12 07:52:34 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: <0bc5e7ae-0312-459c-a123-c11e2819a44d@o10g2000yqa.googlegroups.com> References: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> <39BE9753-0F4B-4E46-84D4-D7E5186150B4@ccs.neu.edu> <9bc16bdc-f8bb-4ba6-b079-e881ff8b76e5@b2g2000yqi.googlegroups.com> <950377D3-BFEF-42B4-976E-EF5059807407@knauth.org> <0bc5e7ae-0312-459c-a123-c11e2819a44d@o10g2000yqa.googlegroups.com> Message-ID: "instead of crashing when a non-number string is given, return a special value that says there is something wrong" ? That may be an introduction to error-handling, which is a big part of programming? On Thu, Nov 12, 2009 at 12:42, wooks wrote: > > > On Nov 12, 11:32 am, "Geoffrey S. Knauth" wrote: > > On Nov 12, 2009, at 05:44, wooks wrote: > > > > > On Nov 9, 2:50 pm, Matthias Felleisen wrote: > > >> 1. Use HtDP/2e to get started. Then switch. > > > So I'm looking at it and wondering how to explain why (string->number > > > "hello world") returns a boolean. > > > > My documentation for beginner language says: > > > > string->number : (string -> (union number false)) > > > > Purpose: to convert a string into a number, produce false if >impossible > > > > Yes I saw that. I was hoping be able to give a different answer than > "thats the way it was defined". > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091112/16229345/attachment.htm From nadeem at acm.org Thu Nov 12 08:01:49 2009 From: nadeem at acm.org (Nadeem Abdul Hamid) Date: Thu Nov 12 08:02:14 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: <0bc5e7ae-0312-459c-a123-c11e2819a44d@o10g2000yqa.googlegroups.com> References: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> <39BE9753-0F4B-4E46-84D4-D7E5186150B4@ccs.neu.edu> <9bc16bdc-f8bb-4ba6-b079-e881ff8b76e5@b2g2000yqi.googlegroups.com> <950377D3-BFEF-42B4-976E-EF5059807407@knauth.org> <0bc5e7ae-0312-459c-a123-c11e2819a44d@o10g2000yqa.googlegroups.com> Message-ID: <5D6EB3A6-CD46-4D1A-8695-38FD56B90D03@acm.org> You could try asking a student to be the function -- tell them you'll give them a sequence of digits (or write them on the board) and they have to read back to you the number. Try it with some 3 and 4 digit numbers; then give them something like "13z5". Hopefully, they'll say something like "that's not a number"; Try with a couple more valid sequences of digits; then another invalid one. Point out to them, that when they are given something not a number, then they are deciding somehow what a suitable response is -- "false" is just an easy, abbreviated way of indicating the "not a number" case -- because it wouldn't make sense to read back some arbitrary number if given something like "13z5." I don't think you want to overkill this issue at this point -- just make it seem intuitively sensible and move on. On Nov 12, 2009, at 6:42 AM, wooks wrote: > > > On Nov 12, 11:32 am, "Geoffrey S. Knauth" wrote: >> On Nov 12, 2009, at 05:44, wooks wrote: >> >>> On Nov 9, 2:50 pm, Matthias Felleisen wrote: >>>> 1. Use HtDP/2e to get started. Then switch. >>> So I'm looking at it and wondering how to explain why (string- >>> >number >>> "hello world") returns a boolean. >> >> My documentation for beginner language says: >> >> string->number : (string -> (union number false)) >> >> Purpose: to convert a string into a number, produce false if >> >impossible >> > > Yes I saw that. I was hoping be able to give a different answer than > "thats the way it was defined". > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From wookiz at hotmail.com Thu Nov 12 08:38:12 2009 From: wookiz at hotmail.com (wooks) Date: Thu Nov 12 08:38:29 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: <5D6EB3A6-CD46-4D1A-8695-38FD56B90D03@acm.org> References: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> <39BE9753-0F4B-4E46-84D4-D7E5186150B4@ccs.neu.edu> <9bc16bdc-f8bb-4ba6-b079-e881ff8b76e5@b2g2000yqi.googlegroups.com> <950377D3-BFEF-42B4-976E-EF5059807407@knauth.org> <0bc5e7ae-0312-459c-a123-c11e2819a44d@o10g2000yqa.googlegroups.com> <5D6EB3A6-CD46-4D1A-8695-38FD56B90D03@acm.org> Message-ID: <796cd054-cc72-4939-940a-a62dc1de03e2@a31g2000yqn.googlegroups.com> On Nov 12, 1:01?pm, Nadeem Abdul Hamid wrote: > You could try asking a student to be the function -- tell them you'll ? > give them a sequence of digits (or write them on the board) and they ? > have to read back to you the number. Try it with some 3 and 4 digit ? > numbers; then give them something like ?"13z5". Hopefully, they'll say ? > something like "that's not a number"; Try with a couple more valid ? > sequences of digits; then another invalid one. Point out to them, that ? > when they are given something not a number, then they are deciding ? > somehow what a suitable response is -- "false" is just an easy, ? > abbreviated way of indicating the "not a number" case -- because it ? > wouldn't make sense to read back some arbitrary number if given ? > something like "13z5." I don't think you want to overkill this issue ? > at this point -- just make it seem intuitively sensible and move on. Hmmm. This will come right after the example of string-append that crashes when given a numeric argument..... I guess it's an early exposure to the need to look up a fucnctions contract specification - sometimes you can intuit and sometimes you need to look it up. From laurent.orseau at gmail.com Thu Nov 12 08:43:58 2009 From: laurent.orseau at gmail.com (Laurent) Date: Thu Nov 12 08:44:41 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: <796cd054-cc72-4939-940a-a62dc1de03e2@a31g2000yqn.googlegroups.com> References: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> <39BE9753-0F4B-4E46-84D4-D7E5186150B4@ccs.neu.edu> <9bc16bdc-f8bb-4ba6-b079-e881ff8b76e5@b2g2000yqi.googlegroups.com> <950377D3-BFEF-42B4-976E-EF5059807407@knauth.org> <0bc5e7ae-0312-459c-a123-c11e2819a44d@o10g2000yqa.googlegroups.com> <5D6EB3A6-CD46-4D1A-8695-38FD56B90D03@acm.org> <796cd054-cc72-4939-940a-a62dc1de03e2@a31g2000yqn.googlegroups.com> Message-ID: with string-append, you can perform a test (string?) beforehand to know if it will crash or not (and avoid the crash). with string->number, the test can "only" (means: this is the simplest way) be done by that same function, so it can be used as either a tester or a transformer, a bit like member for example. On Thu, Nov 12, 2009 at 14:38, wooks wrote: > > > On Nov 12, 1:01 pm, Nadeem Abdul Hamid wrote: > > You could try asking a student to be the function -- tell them you'll > > give them a sequence of digits (or write them on the board) and they > > have to read back to you the number. Try it with some 3 and 4 digit > > numbers; then give them something like "13z5". Hopefully, they'll say > > something like "that's not a number"; Try with a couple more valid > > sequences of digits; then another invalid one. Point out to them, that > > when they are given something not a number, then they are deciding > > somehow what a suitable response is -- "false" is just an easy, > > abbreviated way of indicating the "not a number" case -- because it > > wouldn't make sense to read back some arbitrary number if given > > something like "13z5." I don't think you want to overkill this issue > > at this point -- just make it seem intuitively sensible and move on. > > Hmmm. This will come right after the example of string-append that > crashes when given a numeric argument..... > > I guess it's an early exposure to the need to look up a fucnctions > contract specification - sometimes you can intuit and sometimes you > need to look it up. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091112/58d7f07f/attachment-0001.htm From geoff at knauth.org Thu Nov 12 09:08:21 2009 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Thu Nov 12 09:08:42 2009 Subject: [plt-scheme] [OT] Re: Poacher turned gamekeeper In-Reply-To: References: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> <39BE9753-0F4B-4E46-84D4-D7E5186150B4@ccs.neu.edu> <9bc16bdc-f8bb-4ba6-b079-e881ff8b76e5@b2g2000yqi.googlegroups.com> <950377D3-BFEF-42B4-976E-EF5059807407@knauth.org> <0bc5e7ae-0312-459c-a123-c11e2819a44d@o10g2000yqa.googlegroups.com> Message-ID: On Nov 12, 2009, at 07:51, Laurent wrote: > "instead of crashing when a non-number string is given, return a special value that says there is something wrong" ? > That may be an introduction to error-handling, which is a big part of programming? I wonder if Asian programmers ever used Mu: http://en.wikipedia.org/wiki/Mu_(negative) From BLOCH at adelphi.edu Wed Nov 11 11:05:17 2009 From: BLOCH at adelphi.edu (Stephen Bloch) Date: Thu Nov 12 12:46:07 2009 Subject: [plt-scheme] PLT Scheme versions Message-ID: It would be nice if somewhere on download.plt-scheme.org were a list of versions, with release dates and summaries of the changes. I can see the changes in the $PLTDIR/doc/release-notes directory, but (a) this doesn't include dates, and (b) this requires downloading and unzipping the package before I can see the version history. My Computing Center is always reluctant to install anything less than a month or two old, and they do lab installations only twice a year, so my classes are currently running on 4.1.3. Stephen Bloch sbloch@adelphi.edu From eli at barzilay.org Thu Nov 12 12:48:46 2009 From: eli at barzilay.org (Eli Barzilay) Date: Thu Nov 12 12:49:06 2009 Subject: [plt-scheme] PLT Scheme versions In-Reply-To: References: Message-ID: <19196.19070.678434.944668@winooski.ccs.neu.edu> On Nov 11, Stephen Bloch wrote: > It would be nice if somewhere on download.plt-scheme.org were a list > of versions, with release dates and summaries of the changes. I can > see the changes in the $PLTDIR/doc/release-notes directory, but (a) > this doesn't include dates, and (b) this requires downloading and > unzipping the package before I can see the version history. > > My Computing Center is always reluctant to install anything less > than a month or two old, and they do lab installations only twice a > year, so my classes are currently running on 4.1.3. This is probably the closest thing: http://download.plt-scheme.org/chronology/ -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From aalleexx7 at yandex.ru Thu Nov 12 13:55:53 2009 From: aalleexx7 at yandex.ru (Ivanov Alexey) Date: Thu Nov 12 14:04:06 2009 Subject: [plt-scheme] defines and modules inside macro Message-ID: <7221258052153@webmail111.yandex.ru> I am writing a macro that defines some exported values. I want one more macro to test if it has exports them (define-syntax M (syntax-rules () ((_ n form) (begin (module x scheme form) (module y scheme (require 'x) (write n)))))) (M f (begin (provide f) (define f 1))) but mzscheme -r throws an error: compile: unbound identifier in module in: f Though the expected expansion is compiled with no errors (begin (module x scheme (begin (provide f) (define f 1))) (module y scheme (require 'x) (write f))) Why? From rafkind at cs.utah.edu Thu Nov 12 14:21:48 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Thu Nov 12 14:25:00 2009 Subject: [plt-scheme] PLT Scheme versions In-Reply-To: <19196.19070.678434.944668@winooski.ccs.neu.edu> References: <19196.19070.678434.944668@winooski.ccs.neu.edu> Message-ID: <4AFC604C.3070807@cs.utah.edu> >> My Computing Center is always reluctant to install anything less >> than a month or two old, and they do lab installations only twice a >> year, so my classes are currently running on 4.1.3. >> > > This is probably the closest thing: > > > > http://download.plt-scheme.org/chronology/ That page seems like a good candidate to be linked from the downloads page (download.plt-scheme.org). Maybe next to the "software license" link? From czhu at cs.utah.edu Thu Nov 12 15:59:55 2009 From: czhu at cs.utah.edu (Chognkai Zhu) Date: Thu Nov 12 16:00:28 2009 Subject: [plt-scheme] defines and modules inside macro In-Reply-To: <7221258052153@webmail111.yandex.ru> References: <7221258052153@webmail111.yandex.ru> Message-ID: <4AFC774B.5040208@cs.utah.edu> Reading PLT doc on valid syntax in detail, and you will find out that "module" can't be put inside "begin". Chongkai Ivanov Alexey wrote: > I am writing a macro that defines some exported values. I want one more macro to test if it has exports them > > (define-syntax M > (syntax-rules () > ((_ n form) > (begin > (module x scheme form) > (module y scheme > (require 'x) > (write n)))))) > > (M f (begin (provide f) (define f 1))) > > but mzscheme -r throws an error: > compile: unbound identifier in module in: f > > Though the expected expansion is compiled with no errors > > (begin > (module x scheme (begin (provide f) (define f 1))) > (module y scheme > (require 'x) > (write f))) > > Why? > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From ryanc at ccs.neu.edu Thu Nov 12 16:53:51 2009 From: ryanc at ccs.neu.edu (Ryan Culpepper) Date: Thu Nov 12 16:54:21 2009 Subject: [plt-scheme] defines and modules inside macro In-Reply-To: <4AFC774B.5040208@cs.utah.edu> References: <7221258052153@webmail111.yandex.ru> <4AFC774B.5040208@cs.utah.edu> Message-ID: <34C4F64B-6EBE-4052-ADFA-79336C58ECB7@ccs.neu.edu> On Nov 12, 2009, at 3:59 PM, Chognkai Zhu wrote: > Reading PLT doc on valid syntax in detail, and you will find out > that "module" can't be put inside "begin". Yes it can: http://docs.plt-scheme.org/reference/syntax-model.html#(part._fully-expanded) top-level-form = (module id name-id (#%plain-module-begin module-level-form ...)) | (begin top-level-form ...) | (Unless there's some other place that says different.) -- Here's the problem: The require form in the second module is introduced by the macro (it has a mark). Require is a binding form, and by default it only binds identifiers with the same mark as the require spec. (Require is not hygienic per se, but it tries to follow the spirit of hygiene.) So the module only has a binding of marked-f, not the unmarked f from the original macro use. You can fix this by explicitly binding the unmarked f using only-in: (define-syntax M (syntax-rules () ((_ n form) (begin (module x scheme form) (module y scheme (require (only-in 'x [n n])) (write n)))))) Ryan > > Chongkai > > Ivanov Alexey wrote: >> I am writing a macro that defines some exported values. I want one >> more macro to test if it has exports them >> >> (define-syntax M >> (syntax-rules () >> ((_ n form) >> (begin (module x scheme form) >> (module y scheme >> (require 'x) >> (write n)))))) >> >> (M f (begin (provide f) (define f 1))) >> >> but mzscheme -r throws an error: >> compile: unbound identifier in module in: f >> >> Though the expected expansion is compiled with no errors >> (begin >> (module x scheme (begin (provide f) (define f 1))) >> (module y scheme >> (require 'x) >> (write f))) >> >> Why? _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From clements at brinckerhoff.org Thu Nov 12 18:21:25 2009 From: clements at brinckerhoff.org (John Clements) Date: Thu Nov 12 18:21:48 2009 Subject: [plt-scheme] Denotation: barbarous neologism required Message-ID: <8F9B4C41-7DDE-45C6-9234-882C67F1CDAF@brinckerhoff.org> Suppose A represents B. Do we say that A is the representation of B or that B is the representation of A? Concrete example: let the table represent the street, and my hand represent the car. Do we say that my hand is the representation of the car, or that the car is the representation of my hand? I claim that the former is the standard one: that is, my hand is the representation of the car. Now: Suppose A denotes B. Do we say that A is the denotation of B or that B is the denotation of A? Bizarrely, it appears that most people in the languages community use the latter. That is: suppose that "(lambda (x) x)" denotes the platonic identity function. I believe we say that the program is the denotation of the function, rather than that the function is the denotation of the program. This irritates me. I claim we need a new word for "the thing that A denotes". Is there already a standard term for this? John -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2484 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091112/aeba4574/smime.bin From david.storrs at gmail.com Thu Nov 12 19:01:28 2009 From: david.storrs at gmail.com (David Storrs) Date: Thu Nov 12 19:01:53 2009 Subject: [plt-scheme] Denotation: barbarous neologism required In-Reply-To: <8F9B4C41-7DDE-45C6-9234-882C67F1CDAF@brinckerhoff.org> References: <8F9B4C41-7DDE-45C6-9234-882C67F1CDAF@brinckerhoff.org> Message-ID: On Thu, Nov 12, 2009 at 11:21 PM, John Clements wrote: > Suppose A represents B. Do we say that A is the representation of B or > that B is the representation of A? > > Concrete example: let the table represent the street, and my hand represent > the car. Do we say that my hand is the representation of the car, or that > the car is the representation of my hand? > > I claim that the former is the standard one: that is, my hand is the > representation of the car. > > Now: > > Suppose A denotes B. Do we say that A is the denotation of B or that B is > the denotation of A? > > Bizarrely, it appears that most people in the languages community use the > latter. That is: suppose that "(lambda (x) x)" denotes the platonic > identity function. I believe we say that the program is the denotation of > the function, rather than that the function is the denotation of the > program. > > This irritates me. I claim we need a new word for "the thing that A > denotes". > > Is there already a standard term for this? > > John http://dictionary.reference.com/browse/reification Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091113/5d4bfb0a/attachment-0001.htm From tov at ccs.neu.edu Thu Nov 12 20:04:23 2009 From: tov at ccs.neu.edu (Jesse Tov) Date: Thu Nov 12 20:04:46 2009 Subject: [plt-scheme] Re: [PRL] Denotation: barbarous neologism required In-Reply-To: <8F9B4C41-7DDE-45C6-9234-882C67F1CDAF@brinckerhoff.org> References: <8F9B4C41-7DDE-45C6-9234-882C67F1CDAF@brinckerhoff.org> Message-ID: <4AFCB097.3030305@ccs.neu.edu> [Assuming you had that last bit backward as Peter points out . . .] These usages seem to follow from the standard English definitions of the words "denotation" and "representation". In particular, "representation of X" means "thing that stands for X", whereas "denotation of X" means "thing that X stands for". This only seems odd if you expect the suffix "-ation" to have some meaning that composes with stem to which it is attached. Morphology isn't always that, um, denotational. Jesse On 11/12/09 6:21 PM, John Clements wrote: > Suppose A represents B. Do we say that A is the representation of B or > that B is the representation of A? > > Concrete example: let the table represent the street, and my hand > represent the car. Do we say that my hand is the representation of the > car, or that the car is the representation of my hand? > > I claim that the former is the standard one: that is, my hand is the > representation of the car. > > Now: > > Suppose A denotes B. Do we say that A is the denotation of B or that B > is the denotation of A? > > Bizarrely, it appears that most people in the languages community use > the latter. That is: suppose that "(lambda (x) x)" denotes the platonic > identity function. I believe we say that the program is the denotation > of the function, rather than that the function is the denotation of the > program. > > This irritates me. I claim we need a new word for "the thing that A > denotes". > > Is there already a standard term for this? > > John > > > > > > _______________________________________________ > PRL mailing list > PRL@lists.ccs.neu.edu > https://lists.ccs.neu.edu/bin/listinfo/prl From peterd at ccs.neu.edu Thu Nov 12 18:46:37 2009 From: peterd at ccs.neu.edu (peter r douglass) Date: Thu Nov 12 20:46:46 2009 Subject: [plt-scheme] Re: [PRL] Denotation: barbarous neologism required In-Reply-To: <8F9B4C41-7DDE-45C6-9234-882C67F1CDAF@brinckerhoff.org> References: <8F9B4C41-7DDE-45C6-9234-882C67F1CDAF@brinckerhoff.org> Message-ID: <4AFC9E5D.6040007@ccs.neu.edu> I don't know how the majority in the language community speak, but in Stoy's Denotational Semantics, the function is the denotation of the program. --peterd > Suppose A denotes B. Do we say that A is the denotation of B or that B > is the denotation of A? > > Bizarrely, it appears that most people in the languages community use > the latter. That is: suppose that "(lambda (x) x)" denotes the platonic > identity function. I believe we say that the program is the denotation > of the function, rather than that the function is the denotation of the > program. From will at ccs.neu.edu Thu Nov 12 19:59:21 2009 From: will at ccs.neu.edu (will@ccs.neu.edu) Date: Thu Nov 12 20:46:56 2009 Subject: [plt-scheme] Re: [PRL] Denotation: barbarous neologism required In-Reply-To: <15690937.330341258073959842.JavaMail.root@zimbra> Message-ID: <28981661.330361258073961262.JavaMail.root@zimbra> John Clements wrote: > Suppose A represents B. Do we say that A is the representation of B > or that B is the representation of A? The former. > Concrete example: let the table represent the street, and my hand > represent the car. Do we say that my hand is the representation of > the car, or that the car is the representation of my hand? The former. > Suppose A denotes B. Do we say that A is the denotation of B or that > B is the denotation of A? The latter. > Bizarrely, it appears that most people in the languages community use > the latter. Not bizarre at all. The usage of noun-ized verbs is idiosyncratic. Try going through your examples with "possesses"/"possessor" in place of "represents"/"representation". Then do the same with "possesses"/"possession". > That is: suppose that "(lambda (x) x)" denotes the > platonic identity function. I believe we say that the program is the > denotation of the function, rather than that the function is the > denotation of the program. Absurd. Perhaps someone does indeed say that, but I'd say they're moby confused. For the most part, "denotes" means about the same thing as "names" or "indicates". The word "denotation" means the thing named or indicated. > This irritates me. I claim we need a new word for "the thing that A > denotes". > > Is there already a standard term for this? Yes: the denotation of A. Will From steck at stecksoft.com Thu Nov 12 21:30:24 2009 From: steck at stecksoft.com (Paul Steckler) Date: Thu Nov 12 21:30:42 2009 Subject: [plt-scheme] Re: [PRL] Denotation: barbarous neologism required In-Reply-To: <8F9B4C41-7DDE-45C6-9234-882C67F1CDAF@brinckerhoff.org> References: <8F9B4C41-7DDE-45C6-9234-882C67F1CDAF@brinckerhoff.org> Message-ID: On Fri, Nov 13, 2009 at 10:21 AM, John Clements wrote: > Bizarrely, it appears that most people in the languages community use the > latter. ?That is: suppose that "(lambda (x) x)" denotes the platonic > identity function. ?I believe we say that the program is the denotation of > the function, rather than that the function is the denotation of the > program. You might gain some intuition by using "means" instead of "denotes", and "meaning" instead of "denotation". If A denotes/means B, then B is the denotation/meaning of A. -- Paul From wand at ccs.neu.edu Thu Nov 12 23:15:36 2009 From: wand at ccs.neu.edu (Mitchell Wand) Date: Thu Nov 12 23:15:58 2009 Subject: [plt-scheme] Re: [PRL] Denotation: barbarous neologism required In-Reply-To: References: <8F9B4C41-7DDE-45C6-9234-882C67F1CDAF@brinckerhoff.org> Message-ID: <1bd18ad50911122015w6449b11cq8ecdacad289a465b@mail.gmail.com> Umm, you mean maybe: III denotes 3 3 is the denotation of III III is the notation for 3 --Mitch On Thu, Nov 12, 2009 at 9:30 PM, Paul Steckler wrote: > On Fri, Nov 13, 2009 at 10:21 AM, John Clements > wrote: > > Bizarrely, it appears that most people in the languages community use the > > latter. That is: suppose that "(lambda (x) x)" denotes the platonic > > identity function. I believe we say that the program is the denotation > of > > the function, rather than that the function is the denotation of the > > program. > > You might gain some intuition by using "means" instead of "denotes", and > "meaning" instead of "denotation". > > If A denotes/means B, then B is the denotation/meaning of A. > > -- Paul > > _______________________________________________ > PRL mailing list > PRL@lists.ccs.neu.edu > https://lists.ccs.neu.edu/bin/listinfo/prl > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091112/5e1f3481/attachment.htm From clements at brinckerhoff.org Fri Nov 13 00:34:20 2009 From: clements at brinckerhoff.org (John Clements) Date: Fri Nov 13 00:34:41 2009 Subject: [plt-scheme] Re: [PRL] Denotation: barbarous neologism required In-Reply-To: <28981661.330361258073961262.JavaMail.root@zimbra> References: <28981661.330361258073961262.JavaMail.root@zimbra> Message-ID: <187C4322-E484-4B00-AE1C-4D3D5CC3E798@brinckerhoff.org> On Nov 12, 2009, at 4:59 PM, will@ccs.neu.edu wrote: > >> Bizarrely, it appears that most people in the languages community use >> the latter. > > Not bizarre at all. The usage of noun-ized verbs is idiosyncratic. > Try going through your examples with "possesses"/"possessor" in > place of "represents"/"representation". Then do the same with > "possesses"/"possession". > >> That is: suppose that "(lambda (x) x)" denotes the >> platonic identity function. I believe we say that the program is the >> denotation of the function, rather than that the function is the >> denotation of the program. > > Absurd. Perhaps someone does indeed say that, but I'd say they're > moby confused. For the most part, "denotes" means about the same > thing as "names" or "indicates". The word "denotation" means the > thing named or indicated. As indicated elsewhere, this *particular* sentence was a typo on my part, and was indeed absurd. More generally: thanks for comments. FWIW, the most convincing parallel case (to me) was Carl Eastlund's example of the word "connotes / connotation", which (like denotes / denotation) applies the noun form to the element of the codomain rather than the element of the domain. Returning you to your regularly scheduled program, John Clements -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2484 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091112/004d4f1f/smime.bin From charliesmith001 at gmail.com Fri Nov 13 02:41:44 2009 From: charliesmith001 at gmail.com (Charlie Smith) Date: Fri Nov 13 02:42:06 2009 Subject: [plt-scheme] installation problems Message-ID: hi, i'm having a problem getting plt-scheme installed on the redhat linux machine that i'm using at school and since i'm unfamiliar with linux, I don't know if the problem is due to restrictions in the system or not. when i run scheme from the terminal i get this error Floating point exception i'd appreciate if someone could give me some pointers on fixing this thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091113/f80b98a6/attachment-0001.htm From eli at barzilay.org Fri Nov 13 02:49:11 2009 From: eli at barzilay.org (Eli Barzilay) Date: Fri Nov 13 02:49:31 2009 Subject: [plt-scheme] installation problems In-Reply-To: References: Message-ID: <19197.3959.112490.800760@winooski.ccs.neu.edu> On Nov 13, Charlie Smith wrote: > hi, > > i'm having a problem getting plt-scheme installed on the redhat > linux machine that i'm using at school and since i'm unfamiliar with > linux, I don't know if the problem is due to restrictions in the > system or not. > > when i run scheme from the terminal i get this error > > Floating point exception > > i'd appreciate if someone could give me some pointers on fixing this IIRC, this error was caused by incompatible libc in RH and/or Fedora. It will probably go away if you compile from source -- or you can try some of the other linux builds. (But last time I've seen this was a while ago -- maybe you're using an old version?) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From charliesmith001 at gmail.com Fri Nov 13 02:56:30 2009 From: charliesmith001 at gmail.com (Charlie Smith) Date: Fri Nov 13 02:56:53 2009 Subject: [plt-scheme] installation problems In-Reply-To: <19197.3959.112490.800760@winooski.ccs.neu.edu> References: <19197.3959.112490.800760@winooski.ccs.neu.edu> Message-ID: the computers my school has are pretty bad, has only 218mb RAM and is quite old (8 years i think ), i'm not sure of the version of Redhat its using but i'll try and download other linux binaries or build from source thanks for the quick reply On 11/13/09, Eli Barzilay wrote: > > On Nov 13, Charlie Smith wrote: > > hi, > > > > i'm having a problem getting plt-scheme installed on the redhat > > linux machine that i'm using at school and since i'm unfamiliar with > > linux, I don't know if the problem is due to restrictions in the > > system or not. > > > > when i run scheme from the terminal i get this error > > > > Floating point exception > > > > i'd appreciate if someone could give me some pointers on fixing this > > > IIRC, this error was caused by incompatible libc in RH and/or Fedora. > It will probably go away if you compile from source -- or you can try > some of the other linux builds. (But last time I've seen this was a > while ago -- maybe you're using an old version?) > > > -- > ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: > http://barzilay.org/ Maze is Life! > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091113/95db8bbc/attachment.htm From aleix at member.fsf.org Fri Nov 13 03:08:36 2009 From: aleix at member.fsf.org (=?UTF-8?Q?Aleix_Conchillo_Flaqu=C3=A9?=) Date: Fri Nov 13 03:08:58 2009 Subject: [plt-scheme] changing code font size in slideshow Message-ID: Hi, I'm trying to find how to change the font size for the slideshow code macro. I have successfully changed the font style by using (current-code-font) but I'm still not able to change the size. Is this possible? Thanks in advance, Aleix From charliesmith001 at gmail.com Fri Nov 13 04:23:22 2009 From: charliesmith001 at gmail.com (Charlie Smith) Date: Fri Nov 13 04:23:44 2009 Subject: [plt-scheme] installation problems In-Reply-To: <19197.3959.112490.800760@winooski.ccs.neu.edu> References: <19197.3959.112490.800760@winooski.ccs.neu.edu> Message-ID: hi again, i built from source and now have mzscheme running. the readme file was very helpful and made it a snap. This is the first time i'm installing something using the source, and i'm pleased (and quite surprised actually) it ended out well. thanks Eli On 11/13/09, Eli Barzilay wrote: > > On Nov 13, Charlie Smith wrote: > > hi, > > > > i'm having a problem getting plt-scheme installed on the redhat > > linux machine that i'm using at school and since i'm unfamiliar with > > linux, I don't know if the problem is due to restrictions in the > > system or not. > > > > when i run scheme from the terminal i get this error > > > > Floating point exception > > > > i'd appreciate if someone could give me some pointers on fixing this > > > IIRC, this error was caused by incompatible libc in RH and/or Fedora. > It will probably go away if you compile from source -- or you can try > some of the other linux builds. (But last time I've seen this was a > while ago -- maybe you're using an old version?) > > > -- > ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: > http://barzilay.org/ Maze is Life! > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091113/64b7f974/attachment.htm From jpc-ml at zenburn.net Fri Nov 13 05:36:34 2009 From: jpc-ml at zenburn.net (=?UTF-8?B?SmFrdWIgUGlvdHIgQ8WCYXBh?=) Date: Fri Nov 13 05:36:57 2009 Subject: [plt-scheme] Honu syntax (was: Poacher turned gamekeeper) In-Reply-To: <20091110231931.GB77609@duncan.reilly.home> References: <9AE20A27-1BD9-482A-96BA-A5E13F588D9E@ccs.neu.edu> <796171.24290.qm@web58801.mail.re1.yahoo.com> <20091110231931.GB77609@duncan.reilly.home> Message-ID: <4AFD36B2.8020106@zenburn.net> On 09-11-11 00:19, Andrew Reilly wrote: > On Tue, Nov 10, 2009 at 05:27:46AM -0800, Philippos Apolinarius wrote: >> I often wonder why all Schemes don't have something like >> Gambit-C SIX syntax. > > PLT has Honu (and Algol). Check it out at the bottom of the > help desk. Btw. what's the status of Honu? How did the experiment to write Scheme in Honu syntax work out? -- regards, Jakub Piotr C?apa From neil at neilvandyke.org Fri Nov 13 05:44:18 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Fri Nov 13 05:44:40 2009 Subject: [plt-scheme] installation problems In-Reply-To: References: <19197.3959.112490.800760@winooski.ccs.neu.edu> Message-ID: <4AFD3882.7060401@neilvandyke.org> I'm guessing that you'd benefit from running DrScheme rather than just the "mzscheme" command-line tool. Are you sure that the machine at school has 218MB total? A more typical number near there would be 256MB total, or maybe 248MB total plus 8MB video RAM. In any case, you should be able to run DrScheme in 200-some total MB reasonably if you strip down the rest of your desktop software. If you don't have lots more RAM than you need, you want to be running just a plain X window manager, like Fvwm, not the ridiculously bloated Gnome. With 200-some MB, if you start up Firefox to read documentation online while running DrScheme, things will get a lot slower, as the computer's virtual memory system temporarily swaps pieces of DrScheme and Firefox onto disk. The solution Also, see whether you can beg or borrow an old laptop you can use for your work, and whether the computers at school will accommodate more memory. (A 512MB stick of PC133 is about $10.) Being able to run both DrScheme and a semi-modern Web browser at the same time will help you work/learn faster. -- http://www.neilvandyke.org/ From noelwelsh at gmail.com Fri Nov 13 06:33:47 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Fri Nov 13 06:34:08 2009 Subject: [plt-scheme] installation problems In-Reply-To: References: <19197.3959.112490.800760@winooski.ccs.neu.edu> Message-ID: On Fri, Nov 13, 2009 at 7:56 AM, Charlie Smith wrote: > the computers my school has are pretty bad, has only 218mb RAM and is quite > old (8 years i think ), i'm not sure of the version of Redhat its using but > i'll try and download other linux binaries or build from source You can get a bit more information about your machine using the uname command. For example, on my machine: ~> uname -a Linux hpc-005 2.6.18-164.2.1.el5 #1 SMP Wed Sep 30 12:55:19 EDT 2009 i686 i686 i386 GNU/Linux This tells me I'm running kernel version 2.6.18 (along with a bunch of other stuff that is mostly irrelevant). If you look at the files /proc/cpuinfo and /proc/meminfo you'll get info on the CPU and installed memory. HTH, N. From robby at eecs.northwestern.edu Fri Nov 13 08:37:41 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Fri Nov 13 08:38:05 2009 Subject: [plt-scheme] changing code font size in slideshow In-Reply-To: References: Message-ID: <932b2f1f0911130537m6017a356i400ff7a184dae25d@mail.gmail.com> current-font-size. Robby On Fri, Nov 13, 2009 at 2:08 AM, Aleix Conchillo Flaqu? wrote: > Hi, > > I'm trying to find how to change the font size for the slideshow code > macro. I have successfully changed the font style by using > (current-code-font) but I'm still not able to change the size. > > Is this possible? > > Thanks in advance, > > Aleix > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From robby at eecs.northwestern.edu Fri Nov 13 08:40:24 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Fri Nov 13 08:40:45 2009 Subject: [plt-scheme] changing code font size in slideshow In-Reply-To: <932b2f1f0911130537m6017a356i400ff7a184dae25d@mail.gmail.com> References: <932b2f1f0911130537m6017a356i400ff7a184dae25d@mail.gmail.com> Message-ID: <932b2f1f0911130540h1c85ef6dxbfacfd42cfcbb74b@mail.gmail.com> Just a little more detail. Here's how you can set it locally to a use of 'code'. (You'd have to use a macro to abstract over this.) Robby #lang scheme (require slideshow slideshow/code) (slide (parameterize ([current-font-size 32]) (code (f x))) (parameterize ([current-font-size 18]) (code (f x)))) On Fri, Nov 13, 2009 at 7:37 AM, Robby Findler wrote: > current-font-size. > > Robby > > On Fri, Nov 13, 2009 at 2:08 AM, Aleix Conchillo Flaqu? > wrote: >> Hi, >> >> I'm trying to find how to change the font size for the slideshow code >> macro. I have successfully changed the font style by using >> (current-code-font) but I'm still not able to change the size. >> >> Is this possible? >> >> Thanks in advance, >> >> Aleix >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > From aleix at member.fsf.org Fri Nov 13 09:22:48 2009 From: aleix at member.fsf.org (=?UTF-8?Q?Aleix_Conchillo_Flaqu=C3=A9?=) Date: Fri Nov 13 09:23:09 2009 Subject: [plt-scheme] changing code font size in slideshow In-Reply-To: <932b2f1f0911130540h1c85ef6dxbfacfd42cfcbb74b@mail.gmail.com> References: <932b2f1f0911130537m6017a356i400ff7a184dae25d@mail.gmail.com> <932b2f1f0911130540h1c85ef6dxbfacfd42cfcbb74b@mail.gmail.com> Message-ID: Great, thank you. On Fri, Nov 13, 2009 at 14:40, Robby Findler wrote: > Just a little more detail. Here's how you can set it locally to a use > of 'code'. (You'd have to use a macro to abstract over this.) > > Robby > > #lang scheme > (require slideshow slideshow/code) > > (slide (parameterize ([current-font-size 32]) > ? ? ? ? (code (f x))) > ? ? ? (parameterize ([current-font-size 18]) > ? ? ? ? (code (f x)))) > > > > On Fri, Nov 13, 2009 at 7:37 AM, Robby Findler > wrote: >> current-font-size. >> >> Robby >> >> On Fri, Nov 13, 2009 at 2:08 AM, Aleix Conchillo Flaqu? >> wrote: >>> Hi, >>> >>> I'm trying to find how to change the font size for the slideshow code >>> macro. I have successfully changed the font style by using >>> (current-code-font) but I'm still not able to change the size. >>> >>> Is this possible? >>> >>> Thanks in advance, >>> >>> Aleix >>> _________________________________________________ >>> ?For list-related administrative tasks: >>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>> >> > From david.storrs at gmail.com Fri Nov 13 10:22:58 2009 From: david.storrs at gmail.com (David Storrs) Date: Fri Nov 13 10:23:15 2009 Subject: [plt-scheme] Re: [PRL] Denotation: barbarous neologism required In-Reply-To: <187C4322-E484-4B00-AE1C-4D3D5CC3E798@brinckerhoff.org> References: <28981661.330361258073961262.JavaMail.root@zimbra> <187C4322-E484-4B00-AE1C-4D3D5CC3E798@brinckerhoff.org> Message-ID: I sent this once before, but it bounced. Apologies if anyone received it before. cf "Reification" Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091113/9c79c9b0/attachment.htm From rafkind at cs.utah.edu Fri Nov 13 13:06:00 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Fri Nov 13 13:09:10 2009 Subject: [plt-scheme] Honu syntax In-Reply-To: <4AFD36B2.8020106@zenburn.net> References: <9AE20A27-1BD9-482A-96BA-A5E13F588D9E@ccs.neu.edu> <796171.24290.qm@web58801.mail.re1.yahoo.com> <20091110231931.GB77609@duncan.reilly.home> <4AFD36B2.8020106@zenburn.net> Message-ID: <4AFDA008.2000402@cs.utah.edu> Jakub Piotr C?apa wrote: > On 09-11-11 00:19, Andrew Reilly wrote: >> On Tue, Nov 10, 2009 at 05:27:46AM -0800, Philippos Apolinarius wrote: >>> I often wonder why all Schemes don't have something like >>> Gambit-C SIX syntax. >> >> PLT has Honu (and Algol). Check it out at the bottom of the >> help desk. > > Btw. what's the status of Honu? How did the experiment to write Scheme > in Honu syntax work out? > It's ongoing. I'll let you know when you can start writing programs with Honu. From nadeem at acm.org Fri Nov 13 21:53:30 2009 From: nadeem at acm.org (Nadeem Abdul Hamid) Date: Fri Nov 13 21:53:49 2009 Subject: [plt-scheme] Mutation and worlds with world/universe.ss Message-ID: <9B335094-F571-4BB7-A0FA-268D503F0870@acm.org> It seems like the world/universe.ss teachpacks optimize things so that if the world structure has not changed, the window is not redrawn. This causes difficulty when the world is updated via mutation; for example, consider: ;; A Board is an N x N, Vector-of-Vector-of-Boolean ;; A World is a structure: (make-world Board) (define-struct world (board)) ... ;; handle-click : World Number Number MouseEv -> World (define (handle-click w x y me) (local [(define p (x/y->cell (world-board w) x y))] (cond [(mouse=? me "button-down") (begin (board-flip! (world-board w) (posn-x p) (posn-y p)) w)] [else w]))) (big-bang (make-world TEST-BOARD) (on-draw draw-world) (on-mouse handle-click)) This does not update the display upon clicking in the window, although when you stop the animation, it can be seen that the state has in fact changed. However, if the world is recreated in the handler with another piece of data that changes then the display gets updated as expected: ;; A World is a structure: (make-world Number Board) (define-struct world (n board)) ... ;; handle-click : World Number Number MouseEv -> World (define (handle-click w x y me) (local [(define p (x/y->cell (world-board w) x y))] (cond [(mouse=? me "button-down") (begin (board-flip! (world-board w) (posn-x p) (posn-y p)) (make-world (add1 (world-n w)) (world-board w)))] [else w]))) Is there any way to handle this other than recreating a new world structure? Is there another better way to program worlds with mutation? Thanks, nadeem From matthias at ccs.neu.edu Fri Nov 13 22:27:06 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Fri Nov 13 22:27:39 2009 Subject: [plt-scheme] Mutation and worlds with world/universe.ss In-Reply-To: <9B335094-F571-4BB7-A0FA-268D503F0870@acm.org> References: <9B335094-F571-4BB7-A0FA-268D503F0870@acm.org> Message-ID: <4E148FE1-2DED-41F6-8423-59639F62E567@ccs.neu.edu> This is indeed correct. I recommend the following arrangement: ;; space-invader-state% -> space-invader-state% (define (main sis0) (big-bang 0 (on-tick (lambda (x) (begin (tock sis0) (+ 1 x)))) (on-key (lambda (x ke) (begin (react sis0 ke) (+ 1 x)))) (on-draw (lambda (x) (render sis0))) (stop-when (lambda (x) (win-or-lose? sis0))))) I will add a more appropriate big-bang!! form to universe soon, including an abstract class so that one can teach the functional -> imperative transition in the context of a class-based data representation -- Matthias On Nov 13, 2009, at 9:53 PM, Nadeem Abdul Hamid wrote: > It seems like the world/universe.ss teachpacks optimize things so that if the world structure has not changed, the window is not redrawn. This causes difficulty when the world is updated via mutation; for example, consider: > > ;; A Board is an N x N, Vector-of-Vector-of-Boolean > > ;; A World is a structure: (make-world Board) > (define-struct world (board)) > > ... > > ;; handle-click : World Number Number MouseEv -> World > (define (handle-click w x y me) > (local [(define p (x/y->cell (world-board w) x y))] > (cond [(mouse=? me "button-down") > (begin (board-flip! (world-board w) (posn-x p) (posn-y p)) > w)] > [else w]))) > > (big-bang (make-world TEST-BOARD) > (on-draw draw-world) > (on-mouse handle-click)) > > > This does not update the display upon clicking in the window, although when you stop the animation, it can be seen that the state has in fact changed. > > However, if the world is recreated in the handler with another piece of data that changes then the display gets updated as expected: > > ;; A World is a structure: (make-world Number Board) > (define-struct world (n board)) > > ... > > ;; handle-click : World Number Number MouseEv -> World > (define (handle-click w x y me) > (local [(define p (x/y->cell (world-board w) x y))] > (cond [(mouse=? me "button-down") > (begin (board-flip! (world-board w) (posn-x p) (posn-y p)) > (make-world (add1 (world-n w)) (world-board w)))] > [else w]))) > > > > Is there any way to handle this other than recreating a new world structure? Is there another better way to program worlds with mutation? > > Thanks, > nadeem > > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From aleix at member.fsf.org Sat Nov 14 06:05:02 2009 From: aleix at member.fsf.org (=?UTF-8?Q?Aleix_Conchillo_Flaqu=C3=A9?=) Date: Sat Nov 14 06:05:23 2009 Subject: [plt-scheme] changing code font size in slideshow In-Reply-To: <932b2f1f0911130540h1c85ef6dxbfacfd42cfcbb74b@mail.gmail.com> References: <932b2f1f0911130537m6017a356i400ff7a184dae25d@mail.gmail.com> <932b2f1f0911130540h1c85ef6dxbfacfd42cfcbb74b@mail.gmail.com> Message-ID: I have defined this to help changing code size and avoid writing parameterize each time. I'm very newbie, so probably there's a much better way to do it. I used (plai-code) because I'm doing a slides for some PLAI chapters. (define-syntax plai-code (syntax-rules () [(plai-code code) code] [(plai-code code font-size) (parameterize ([current-font-size font-size]) code)])) (plai-code (code ...)) (plai-code (code ...) 26) On Fri, Nov 13, 2009 at 14:40, Robby Findler wrote: > Just a little more detail. Here's how you can set it locally to a use > of 'code'. (You'd have to use a macro to abstract over this.) > > Robby > > #lang scheme > (require slideshow slideshow/code) > > (slide (parameterize ([current-font-size 32]) > ? ? ? ? (code (f x))) > ? ? ? (parameterize ([current-font-size 18]) > ? ? ? ? (code (f x)))) > > > > On Fri, Nov 13, 2009 at 7:37 AM, Robby Findler > wrote: >> current-font-size. >> >> Robby >> >> On Fri, Nov 13, 2009 at 2:08 AM, Aleix Conchillo Flaqu? >> wrote: >>> Hi, >>> >>> I'm trying to find how to change the font size for the slideshow code >>> macro. I have successfully changed the font style by using >>> (current-code-font) but I'm still not able to change the size. >>> >>> Is this possible? >>> >>> Thanks in advance, >>> >>> Aleix >>> _________________________________________________ >>> ?For list-related administrative tasks: >>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>> >> > From toddobryan at gmail.com Sat Nov 14 09:24:29 2009 From: toddobryan at gmail.com (Todd O'Bryan) Date: Sat Nov 14 09:24:49 2009 Subject: [plt-scheme] Projects from my class Message-ID: <904774730911140624x365a32b7v871889e7a343a1f4@mail.gmail.com> My most recent assignment was, "Create something cool using what we've learned so far." Here are two of the best projects. Both are written in Beginning Student with the universe teachpack. For the first, just hit run. For the second, you also need Stephen Bloch's tiles teachpack, and after you hit run, try (I-chooose-you "Pikachu") or POKEDEX Todd -------------- next part -------------- A non-text attachment was scrubbed... Name: solar-system-universe.ss.zip Type: application/zip Size: 1446 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091114/84d05535/solar-system-universe.ss.zip -------------- next part -------------- A non-text attachment was scrubbed... Name: pokemon-universe.ss.zip Type: application/zip Size: 3402 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091114/84d05535/pokemon-universe.ss.zip From matthias at ccs.neu.edu Sat Nov 14 09:30:53 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Sat Nov 14 09:31:29 2009 Subject: [plt-scheme] Projects from my class In-Reply-To: <904774730911140624x365a32b7v871889e7a343a1f4@mail.gmail.com> References: <904774730911140624x365a32b7v871889e7a343a1f4@mail.gmail.com> Message-ID: Cool solar system, and quite simple. The pictures of the planets come with HtDP. Tell the student to implement a refinement: if someone clicks on a planet, show the real image It becomes a little game. Then donate it to your local science museum. -- Matthias p.s. it's lack test cases but hey it's all domain knowledge anyway :-) On Nov 14, 2009, at 9:24 AM, Todd O'Bryan wrote: > My most recent assignment was, "Create something cool using what we've > learned so far." Here are two of the best projects. > > Both are written in Beginning Student with the universe teachpack. For > the first, just hit run. > > For the second, you also need Stephen Bloch's tiles teachpack, and > after you hit run, try > > (I-chooose-you "Pikachu") or POKEDEX > > Todd > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From toddobryan at gmail.com Sat Nov 14 10:42:43 2009 From: toddobryan at gmail.com (Todd O'Bryan) Date: Sat Nov 14 10:43:04 2009 Subject: [plt-scheme] Projects from my class In-Reply-To: References: <904774730911140624x365a32b7v871889e7a343a1f4@mail.gmail.com> Message-ID: <904774730911140742t644982d8sc36f52d0db247659@mail.gmail.com> I must admit, I let them get away with not writing test cases for animations, especially when the only input is a frame number. If they just write the function with the variable replaced with a number, it doesn't prove anything, and if they use the image as the expected answer, it makes the size of the files and the run times grow very quickly. I've told them the test is to run the animation and make sure it does what it's supposed to. Now that I've introduced structures and their draw functions are going to be more complicated, I'll have them create tests for the draw, tick, and on-blah handlers. Todd On Sat, Nov 14, 2009 at 9:30 AM, Matthias Felleisen wrote: > > Cool solar system, and quite simple. The pictures of the planets come with HtDP. Tell the student to implement a refinement: > > ?if someone clicks on a planet, show the real image > > It becomes a little game. Then donate it to your local science museum. > > -- Matthias > > p.s. it's lack test cases but hey it's all domain knowledge anyway :-) > > > > > On Nov 14, 2009, at 9:24 AM, Todd O'Bryan wrote: > >> My most recent assignment was, "Create something cool using what we've >> learned so far." Here are two of the best projects. >> >> Both are written in Beginning Student with the universe teachpack. For >> the first, just hit run. >> >> For the second, you also need Stephen Bloch's tiles teachpack, and >> after you hit run, try >> >> (I-chooose-you "Pikachu") or POKEDEX >> >> Todd >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From shaoron at gmail.com Sat Nov 14 12:00:29 2009 From: shaoron at gmail.com (G G) Date: Sat Nov 14 12:00:50 2009 Subject: [plt-scheme] Alpha-beta pruning Message-ID: <1ab9a21f0911140900w2c6c574bgf3c3c193178c1348@mail.gmail.com> I am trying to implement the alpha beta pruning but with no luck can anyone help me with how it works I am trying to use this Algorithm ??(n, d, ?, ?) S ? Successors(n) if d ? 0 ? S ? ? then return f(n) best ? ?? for all ni ? S do v ? ???(ni, d ? 1, ??, ?max(?, best)) if v > best then best ? v if best ? ? then return best return best Best regards, G -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091114/18779182/attachment.htm From scott at adrenaline.com Sat Nov 14 12:57:03 2009 From: scott at adrenaline.com (Scott McLoughlin) Date: Sat Nov 14 12:58:40 2009 Subject: [plt-scheme] Scheme performance Message-ID: <4AFEEF6F.3070906@adrenaline.com> regarding: Date: Sun, 08 Nov 2009 10:15:09 -0500 From: Neil Van Dyke Subject: [plt-scheme] Scheme productivity data point ----------------------------------- I am glad along with you that PLT did the trick in better than adequate time, but I do wonder how much time was spent in RTS routines written in C/C++/asm and thus optimized by non-scheme compilers? [...] The output files take less than 7% the space of the input files. >> >> And, for people who think Scheme is slow... Wall clock time for the >> conversion (which was doing lots of parsing, XPath, simple >> pattern-matching, and a little regexp-ing) was only a little more >> than twice the wall clock time of "dd" doing comparable file I/O [to >> local disk on a fast machine]. I think the "ultimate" test is a set of "real world" oriented tasks/benchmarks that use only routines written and compiled in Scheme, skipping all RTS routines excepting things like arithmetic, moves, branches, os interaction like opening files and so forth. So either an NFA or DFA based regex processor can be easily written in scheme, so in my theoretical "benchmark"," the regex routines would have to be written in Scheme, and so on and so forth. But I ramble at this point. Sorry. Congrats on you positive performance experience again. Scott From neil at neilvandyke.org Sat Nov 14 13:18:48 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Sat Nov 14 13:19:09 2009 Subject: [plt-scheme] Scheme performance In-Reply-To: <4AFEEF6F.3070906@adrenaline.com> References: <4AFEEF6F.3070906@adrenaline.com> Message-ID: <4AFEF488.7030207@neilvandyke.org> Scott McLoughlin wrote at 11/14/2009 12:57 PM: > > So either an NFA or DFA based regex processor can be easily written in > scheme, > so in my theoretical "benchmark"," the regex routines would have to be > written > in Scheme, and so on and so forth. I am taking a higher-level view when I choose PLT Scheme. As a tool, it's a black box, and I don't care whether it's self-hosting and layered only atop x86 instructions or a libc. Asking whether the Scheme implementation itself is implemented entirely in Scheme is perfectly valid, but I think that's of more interest to compilers people or people asking "Should I use this particular implementation to code my real-time OS kernel." BTW, for regexps implemented in portable, pure Scheme, see "http://evalwhen.com/pregexp/index.html". I found this library very useful under PLT Scheme years ago, although PLT's built-in regexp support was faster. -- http://www.neilvandyke.org/ From sk at cs.brown.edu Sat Nov 14 13:36:09 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Sat Nov 14 13:36:48 2009 Subject: [plt-scheme] Alpha-beta pruning In-Reply-To: <1ab9a21f0911140900w2c6c574bgf3c3c193178c1348@mail.gmail.com> References: <1ab9a21f0911140900w2c6c574bgf3c3c193178c1348@mail.gmail.com> Message-ID: Sure, we'd be happy to help. Where are your data definitions, examples of data, and test cases? Shriram On Sat, Nov 14, 2009 at 12:00 PM, G G wrote: > I am trying to implement the alpha beta pruning but with no luck can anyone > help me with how it works I am trying to use this Algorithm > > ??(n, d, ?, ?) > S ? Successors(n) > if d ? 0 ? S ? ? then > return f(n) > best ? ?? > for all ni ? S do > ? v ? ???(ni, d ? 1, ??, ?max(?, best)) > ?? if?? ?v > best?? ?then > ??? best ? v if?? ?best ? ??? ?then > ????? return best > return best > > > Best regards, > G > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From noelwelsh at gmail.com Sat Nov 14 14:44:30 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Sat Nov 14 14:44:49 2009 Subject: [plt-scheme] Scheme performance In-Reply-To: <4AFEEF6F.3070906@adrenaline.com> References: <4AFEEF6F.3070906@adrenaline.com> Message-ID: On Sat, Nov 14, 2009 at 5:57 PM, Scott McLoughlin wrote: > > I am glad along with you that PLT did the trick in better than adequate > time, but I do wonder how much time was spent in RTS routines written in > C/C++/asm and thus optimized by non-scheme compilers? > The niche of "scripting languages" is basically providing an simpler interface to the OS runtime. This is a valid use case, even if it doesn't say much about the performance of the language runtime. (I expect Neil's case used quite a bit of pure Scheme code given he did XML transformation.) N. From clements at brinckerhoff.org Sat Nov 14 17:37:45 2009 From: clements at brinckerhoff.org (John Clements) Date: Sat Nov 14 17:38:34 2009 Subject: Your Student Saved the Day! (was: Re: [plt-scheme] Projects from my class) In-Reply-To: <904774730911140624x365a32b7v871889e7a343a1f4@mail.gmail.com> References: <904774730911140624x365a32b7v871889e7a343a1f4@mail.gmail.com> Message-ID: On Nov 14, 2009, at 6:24 AM, Todd O'Bryan wrote: > My most recent assignment was, "Create something cool using what we've > learned so far." Here are two of the best projects. > > Both are written in Beginning Student with the universe teachpack. For > the first, just hit run. I ran a set of four hour-long workshops for 6th, 7th, and 8th graders today. On a whim, I included your student's solar system simulation, and challenged the students to make one planet move backward, or have an eccentric orbit. This was a *huge* hit with the students. So: I owe your student... a beer? Maybe not. But something, for sure. Tell him or her that about a hundred middle school students had a great time playing with this program. Thanks! John -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2484 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091114/da08ad3b/smime.bin From toddobryan at gmail.com Sat Nov 14 19:23:33 2009 From: toddobryan at gmail.com (Todd O'Bryan) Date: Sat Nov 14 19:23:52 2009 Subject: Your Student Saved the Day! (was: Re: [plt-scheme] Projects from my class) In-Reply-To: References: <904774730911140624x365a32b7v871889e7a343a1f4@mail.gmail.com> Message-ID: <904774730911141623k3726a80dkd7af379c40f76954@mail.gmail.com> You can buy them (a boy and girl team) a beer in about 5 years. Or earlier if you're willing to fly them to Europe. In the meantime, I'll pass along your thanks and congrats! On Sat, Nov 14, 2009 at 5:37 PM, John Clements wrote: > > On Nov 14, 2009, at 6:24 AM, Todd O'Bryan wrote: > >> My most recent assignment was, "Create something cool using what we've >> learned so far." Here are two of the best projects. >> >> Both are written in Beginning Student with the universe teachpack. For >> the first, just hit run. > > I ran a set of four hour-long workshops for 6th, 7th, and 8th graders today. > ?On a whim, I included your student's solar system simulation, and > challenged the students to make one planet move backward, or have an > eccentric orbit. ?This was a *huge* hit with the students. > > So: I owe your student... a beer? ?Maybe not. ?But something, for sure. > ?Tell him or her that about a hundred middle school students had a great > time playing with this program. > > Thanks! > > John > > From masashi.kameda at gmail.com Sat Nov 14 14:24:41 2009 From: masashi.kameda at gmail.com (cametan) Date: Sun Nov 15 08:05:16 2009 Subject: [plt-scheme] What should (procedure? macro) return? Message-ID: According to R5RS, how procedure? works is ?Returns #t if obj is a procedure, otherwise returns #f. That's all. R6RS says: ?Returns #t if obj is a procedure, otherwise returns #f. Same way. This implies, I believe, its argument can be anything and whatever it is, it must give #f if it is not procedure; however, PLT Scheme gives an error. > (procedure? cond) stdin::3601: cond: bad syntax in: cond === context === /usr/lib/plt/collects/scheme/private/cond.ss:21:13: go /usr/lib/plt/collects/scheme/private/misc.ss:74:7 > (procedure? if) stdin::3619: if: bad syntax in: if === context === /usr/lib/plt/collects/scheme/private/misc.ss:74:7 > Of course, I know if and cond are not procedure. I definitely know what they are. But these evals should give #f back, shouldn't they? I checked out some other scheme implementations. In case of Gauche: gosh> (procedure? cond) #f gosh> (procedure? if) #f gosh> In case of Guile: guile> (procedure? cond) #f guile> (procedure? if) #f guile> I think these are what R5RS or R6RS expects. On the other hand, in case of Scheme48: (procedure? cond) Warning: invalid variable reference cond #{Package 249 user} (&warning) Error: undefined variable cond (package scheme-level-0) 1> > (procedure? if) Warning: invalid variable reference if #{Package 249 user} (&warning) Error: undefined variable if (package scheme-level-0) 1> Scheme 48 basically gives back what PLT does. Well, which way is correct? I still believe (procedure? macro) should give back #f; however is there any reason to give errors? Thanks. From li.anye.0 at gmail.com Sat Nov 14 17:21:43 2009 From: li.anye.0 at gmail.com (Anye Li) Date: Sun Nov 15 08:05:20 2009 Subject: [plt-scheme] bitwise operations on scheme/foreign _bitmask Message-ID: Using the _bitmask type provided by the scheme/foreign module, is there a simple and efficient way of doing bitwise manipulations, e.g. turn off a particular set of bits from an existing set of bits? From mflatt at cs.utah.edu Sun Nov 15 08:34:48 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Sun Nov 15 08:35:08 2009 Subject: [plt-scheme] What should (procedure? macro) return? In-Reply-To: References: Message-ID: <20091115133449.8DCBA6500B7@mail-svr1.cs.utah.edu> At Sat, 14 Nov 2009 11:24:41 -0800 (PST), cametan wrote: > According to R5RS, how procedure? works is > > ?Returns #t if obj is a procedure, otherwise returns #f. > > That's all. > R6RS says: > > ?Returns #t if obj is a procedure, otherwise returns #f. > > Same way. > This implies, I believe, its argument can be anything Yes, the argument can be any *value*. But to deliver a value to a procedure, you must write a valid procedure-call expression. The problem with (procedure? cond) is not that `procedure?' returns the wrong result, but that `(procedure? cond)' isn't an expression according to R5RS. No expression is evaluated, and the `procedure?' procedure is never called. Along the same lines, (procedure? [ ) does not produce #f, even though an open square bracket is not a procedure. The above is a syntax error, and so `procedure?' isn't called. In the same way that R5RS prohibits square brackets, R5RS says that `cond' has to be used after an open parenthesis to form a valid expression. More generally, both R5RS and PLT classify misuse of a syntactic-form identifier as a syntax error. At the same time, R5RS generally allows implementations to give a meaning to things that are prohibited in R5RS. So, Gauche and Guile are probably free to produce #f for `(procedure? cond)' without violating R5RS, even though `(procedure? cond)' is not a valid R5RS expression (at the top level, assuming that `cond' is not redefined). From sk at cs.brown.edu Sun Nov 15 08:48:57 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Sun Nov 15 09:08:03 2009 Subject: [plt-scheme] Alpha-beta pruning In-Reply-To: <1ab9a21f0911142025n42d2819ao4a9220543b5d904a@mail.gmail.com> References: <1ab9a21f0911140900w2c6c574bgf3c3c193178c1348@mail.gmail.com> <1ab9a21f0911142025n42d2819ao4a9220543b5d904a@mail.gmail.com> Message-ID: I assume G forgot to reply to the list, so I'm taking the liberty of replying there. I'll point out that this code still has no data definitions, examples of data, test cases, etc. S. On Sat, Nov 14, 2009 at 11:25 PM, G G wrote: > This is the orignal Minimax that I am trying to add Alpha-beta on > > > (define minimax > ? (lambda (b player moves max-depth heuristic-function) > ??? (define max/min > ????? (lambda (player) > ??????? (if (eq? player 'W) max min))) > ??? (define minimax-move > ????? (lambda (b player max-depth move) > ??????? (minimax/depth > ????????? (apply-move b player move) > ????????? (opponent player) > ????????? (- max-depth 1)))) > ??? (define minimax/depth > ????? (lambda (b player max-depth) > ??????? (if (= max-depth 0) > ??????????? (heuristic-function b) > ??????????? (let ([moves (possible-moves b player)]) > ????????????? (if (null? moves) > ????????????????? (minimax/depth b (opponent player) (- max-depth 1)) > ????????????????? (let ([scores > ???????????????????????? (map (lambda (move) > ??????????????????????????????? (minimax-move b player max-depth move)) > ????????????????????????????? moves)]) > ??????????????????? (apply (max/min player) scores))))))) > ??? (let ([scores > ?????????? (map (lambda (move) (minimax-move b player max-depth move)) > ??????????????? moves)]) > ????? (let ([best (apply (max/min player) scores)]) > ??????? (let loop ([moves moves] [scores scores]) > ????????? (if (= (car scores) best) > ????????????? (car moves) > ????????????? (loop (cdr moves) (cdr scores)))))))) > > > And I used the algorithm but i didnt know how to do these > > S ? Successors(n) > > best ? ?? >> for all ni ? S do >> ? v ? ???(ni, d ? 1, ??, ?max(?, best)) > > > Thanks a lot, > G > > On Sat, Nov 14, 2009 at 9:36 PM, Shriram Krishnamurthi > wrote: >> >> Sure, we'd be happy to help. ?Where are your data definitions, >> examples of data, and test cases? >> >> Shriram >> >> On Sat, Nov 14, 2009 at 12:00 PM, G G wrote: >> > I am trying to implement the alpha beta pruning but with no luck can >> > anyone >> > help me with how it works I am trying to use this Algorithm >> > >> > ??(n, d, ?, ?) >> > S ? Successors(n) >> > if d ? 0 ? S ? ? then >> > return f(n) >> > best ? ?? >> > for all ni ? S do >> > ? v ? ???(ni, d ? 1, ??, ?max(?, best)) >> > ?? if?? ?v > best?? ?then >> > ??? best ? v if?? ?best ? ??? ?then >> > ????? return best >> > return best >> > >> > >> > Best regards, >> > G >> > >> > _________________________________________________ >> > ?For list-related administrative tasks: >> > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > >> > > > From jos.koot at telefonica.net Sun Nov 15 10:07:23 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Sun Nov 15 10:07:46 2009 Subject: [plt-scheme] bitwise operations on scheme/foreign _bitmask References: Message-ID: <9D09F0D55EB4468380C60FD2CF64D238@uw2b2dff239c4d> Look for bitwise in the PLT docs. Jos ----- Original Message ----- From: "Anye Li" To: Sent: Saturday, November 14, 2009 11:21 PM Subject: [plt-scheme] bitwise operations on scheme/foreign _bitmask > Using the _bitmask type provided by the scheme/foreign module, is > there a simple and efficient way of doing bitwise manipulations, e.g. > turn off a particular set of bits from an existing set of bits? > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From shaoron at gmail.com Sun Nov 15 11:01:47 2009 From: shaoron at gmail.com (G G) Date: Sun Nov 15 11:17:06 2009 Subject: [plt-scheme] Alpha-beta pruning In-Reply-To: References: <1ab9a21f0911140900w2c6c574bgf3c3c193178c1348@mail.gmail.com> <1ab9a21f0911142025n42d2819ao4a9220543b5d904a@mail.gmail.com> Message-ID: <1ab9a21f0911150801i37a7a10fm20bc158c21a37e01@mail.gmail.com> Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: reversi.ss Type: application/octet-stream Size: 7128 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091115/108dd198/reversi-0001.obj From li.anye.0 at gmail.com Sun Nov 15 11:25:05 2009 From: li.anye.0 at gmail.com (Anye Li) Date: Sun Nov 15 11:25:26 2009 Subject: [plt-scheme] bitwise operations on scheme/foreign _bitmask In-Reply-To: <9D09F0D55EB4468380C60FD2CF64D238@uw2b2dff239c4d> References: <9D09F0D55EB4468380C60FD2CF64D238@uw2b2dff239c4d> Message-ID: Of course I did that. I know how to do bitwise arithmetic with integers in Scheme. That's not what I was asking. _bitmask in the foreign module doesn't give me integers. It gives me lists of symbols. Moreover, I see no way of converting between the symbols and numbers manually besides doing the equivalent of defining the bitmask again. So it seems to me, from reading the documentation, that I have to use list algorithms, which to me seem to be more work for both me and the computer and less natural than using arithmetic bitwise operations on numbers. If that's the case, I see no reason to use _bitmask, other than to get a nice symbolic representation of a bitmask when a foreign function returns one. That's less important to me than actually being able to manipulate the bitmask conveniently and efficiently. On Sun, Nov 15, 2009 at 10:07 AM, Jos Koot wrote: > Look for bitwise in the PLT docs. > Jos > > ----- Original Message ----- From: "Anye Li" > To: > Sent: Saturday, November 14, 2009 11:21 PM > Subject: [plt-scheme] bitwise operations on scheme/foreign _bitmask > > > Using the _bitmask type provided by the scheme/foreign module, is >> there a simple and efficient way of doing bitwise manipulations, e.g. >> turn off a particular set of bits from an existing set of bits? >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091115/ea128cc4/attachment.htm From sk at cs.brown.edu Sun Nov 15 13:38:29 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Sun Nov 15 13:39:10 2009 Subject: [plt-scheme] Alpha-beta pruning In-Reply-To: <1ab9a21f0911150801i37a7a10fm20bc158c21a37e01@mail.gmail.com> References: <1ab9a21f0911140900w2c6c574bgf3c3c193178c1348@mail.gmail.com> <1ab9a21f0911142025n42d2819ao4a9220543b5d904a@mail.gmail.com> <1ab9a21f0911150801i37a7a10fm20bc158c21a37e01@mail.gmail.com> Message-ID: Does your course prof not require you to write ANY data definitions, templates, etc.? You're allowed to turn in ONLY code and they give you a full grade? Shriram On Sun, Nov 15, 2009 at 11:01 AM, G G wrote: > Well I can attach the full .ss file here > > On Sun, Nov 15, 2009 at 4:48 PM, Shriram Krishnamurthi > wrote: >> >> I assume G forgot to reply to the list, so I'm taking the liberty of >> replying there. >> >> I'll point out that this code still has no data definitions, examples >> of data, test cases, etc. >> >> S. >> >> On Sat, Nov 14, 2009 at 11:25 PM, G G wrote: >> > This is the orignal Minimax that I am trying to add Alpha-beta on >> > >> > >> > (define minimax >> > ? (lambda (b player moves max-depth heuristic-function) >> > ??? (define max/min >> > ????? (lambda (player) >> > ??????? (if (eq? player 'W) max min))) >> > ??? (define minimax-move >> > ????? (lambda (b player max-depth move) >> > ??????? (minimax/depth >> > ????????? (apply-move b player move) >> > ????????? (opponent player) >> > ????????? (- max-depth 1)))) >> > ??? (define minimax/depth >> > ????? (lambda (b player max-depth) >> > ??????? (if (= max-depth 0) >> > ??????????? (heuristic-function b) >> > ??????????? (let ([moves (possible-moves b player)]) >> > ????????????? (if (null? moves) >> > ????????????????? (minimax/depth b (opponent player) (- max-depth 1)) >> > ????????????????? (let ([scores >> > ???????????????????????? (map (lambda (move) >> > ??????????????????????????????? (minimax-move b player max-depth move)) >> > ????????????????????????????? moves)]) >> > ??????????????????? (apply (max/min player) scores))))))) >> > ??? (let ([scores >> > ?????????? (map (lambda (move) (minimax-move b player max-depth move)) >> > ??????????????? moves)]) >> > ????? (let ([best (apply (max/min player) scores)]) >> > ??????? (let loop ([moves moves] [scores scores]) >> > ????????? (if (= (car scores) best) >> > ????????????? (car moves) >> > ????????????? (loop (cdr moves) (cdr scores)))))))) >> > >> > >> > And I used the algorithm but i didnt know how to do these >> > >> > S ? Successors(n) >> > >> > best ? ?? >> >> for all ni ? S do >> >> ? v ? ???(ni, d ? 1, ??, ?max(?, best)) >> > >> > >> > Thanks a lot, >> > G >> > >> > On Sat, Nov 14, 2009 at 9:36 PM, Shriram Krishnamurthi >> > wrote: >> >> >> >> Sure, we'd be happy to help. ?Where are your data definitions, >> >> examples of data, and test cases? >> >> >> >> Shriram >> >> >> >> On Sat, Nov 14, 2009 at 12:00 PM, G G wrote: >> >> > I am trying to implement the alpha beta pruning but with no luck can >> >> > anyone >> >> > help me with how it works I am trying to use this Algorithm >> >> > >> >> > ??(n, d, ?, ?) >> >> > S ? Successors(n) >> >> > if d ? 0 ? S ? ? then >> >> > return f(n) >> >> > best ? ?? >> >> > for all ni ? S do >> >> > ? v ? ???(ni, d ? 1, ??, ?max(?, best)) >> >> > ?? if?? ?v > best?? ?then >> >> > ??? best ? v if?? ?best ? ??? ?then >> >> > ????? return best >> >> > return best >> >> > >> >> > >> >> > Best regards, >> >> > G >> >> > >> >> > _________________________________________________ >> >> > ?For list-related administrative tasks: >> >> > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> > >> >> > >> > >> > > > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From lspector at hampshire.edu Sun Nov 15 15:14:37 2009 From: lspector at hampshire.edu (Lee Spector) Date: Sun Nov 15 15:19:58 2009 Subject: [plt-scheme] documentation feature requests Message-ID: I've been using and teaching DrScheme for a couple of months now, and while I'm still a newbie I would nonetheless like to offer a couple of suggestions based on my experience coming from Common Lisp environments and teaching students with an unusually wide range of backgrounds and motivations. 1. It would be really great if DrScheme provided more immediate access to more rudimentary documentation right in the IDE. I'm thinking primarily of arglist info and/or English descriptions of what particular procedures do. I know that one can get into the main documentation in a browser with a couple of keystrokes, and it may seem like that should be good enough. But for one thing that documentation isn't as helpful to beginners as it might be (see below), and for another those couple of keystrokes and the context switching add up when you're trying to write code and aren't yet fluent. Having the information you need right there in the IDE, right when you need it, is qualitatively different. When I first started with DrScheme I made a plea here for "arglist on space" and received helpful replies about ways to get this in other editors along with explanations of why it isn't straightforward in PLT (because of case- lambda, at least). All the same, I think it would be possible to do something along these lines, and that even something partial would make a big difference for me and my students. I also know that what DrScheme provides is probably already a lot better than what most IDEs provide for most languages, but I guess I'm spoiled from using Common Lisp environments that provide arglist-on-space and keystroke access to documentation strings right in the IDE. I figure DrScheme could do something approximating this and I think this would be really helpful. 2. More examples -- simple, minimal examples -- in the documentation would help very very very much, both for relatively experienced programmers and especially for beginners. I also teach using Processing (www.processing.org) and the presence of simple examples in the documentation of every procedure is a transformative thing. The PLT documentation seems admirably thorough but it is often completely baffling to my students and I myself often have to chase several links before I can figure out how to make even a simple call to a particular procedure that interests me. And it's discouraging, because one never knows how many link-following and new-concept-learning steps will be required to make that first simple call. I'm not talking about complicated examples, and in fact the simpler the better. With such examples the user can try any procedure out immediately by cutting, pasting, and then adapting the example to suit their purposes. The "adapting" step may require a lot more reading, of course, but at that point the foot is in the door. I realize it will take time to write these examples, but I think they would make a big difference. Just my 2 cents! Overall I'm enjoying working with PLT/DrScheme quite a bit, and I thank everyone involved for creating such a great environment! -Lee -- Lee Spector, Professor of Computer Science School of Cognitive Science, Hampshire College 893 West Street, Amherst, MA 01002-3359 lspector@hampshire.edu, http://hampshire.edu/lspector/ Phone: 413-559-5352, Fax: 413-559-5438 Check out Genetic Programming and Evolvable Machines: http://www.springer.com/10710 - http://gpemjournal.blogspot.com/ From dyrueta at gmail.com Sun Nov 15 15:24:06 2009 From: dyrueta at gmail.com (Gadfly) Date: Sun Nov 15 15:24:24 2009 Subject: [plt-scheme] HtDP Exercise 37.5.1 Message-ID: <03a46cb0-f3be-4b98-9fe6-8f7ec1dac90b@z3g2000prd.googlegroups.com> Hi All -- How do picture fields work? How does one assign a photo to a structure? Also, are there any pre-defined campuses available as teachpacks? Thanks! Dave Yrueta From eli at barzilay.org Sun Nov 15 15:26:57 2009 From: eli at barzilay.org (Eli Barzilay) Date: Sun Nov 15 15:27:19 2009 Subject: [plt-scheme] bitwise operations on scheme/foreign _bitmask In-Reply-To: References: <9D09F0D55EB4468380C60FD2CF64D238@uw2b2dff239c4d> Message-ID: <19200.25617.536728.528061@winooski.ccs.neu.edu> On Nov 15, Anye Li wrote: > > If that's the case, I see no reason to use _bitmask, other than to > get a nice symbolic representation of a bitmask when a foreign > function returns one. That's less important to me than actually > being able to manipulate the bitmask conveniently and efficiently. The purpose of `_bitmask' is to provide a convenient "list of symbols" interface to a numeric value. If you prefer to deal with just the numbers, then you should use a plain `_int'. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From noelwelsh at gmail.com Sun Nov 15 16:09:49 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Sun Nov 15 16:10:06 2009 Subject: [plt-scheme] documentation feature requests In-Reply-To: References: Message-ID: On Sun, Nov 15, 2009 at 8:14 PM, Lee Spector wrote: > > 2. More examples -- simple, minimal examples -- in the documentation would > help very very very much Out of interest, how do you use the documentation? Do you start at the Guide, or with search, or the Reference? What do you do if search fails? Thanks, N. From plt at synx.us.to Sun Nov 15 16:14:21 2009 From: plt at synx.us.to (Synx) Date: Sun Nov 15 16:14:46 2009 Subject: [plt-scheme] pipe-between Message-ID: <4B006F2D.5000904@synx.us.to> Something I've rolled around in my head for some time is how annoyingly simple the bash "pipe" syntax is. Why shouldn't a more sensible language be able to do that as well? So I hacked together this syntax, which you might find useful. I ran that test procedure and it seems to have worked fine. Only problem is what is leftmost in bash syntax becomes rightmost in this syntax, but not sure that's worth bothering with. -------------- next part -------------- #lang scheme/base (define-syntax pipe-between (syntax-rules (input:) ((_ (process args ...) rest ...) (pipe-between input: (current-output-port) (process args ...) rest ...)) ((_ input: input (process args ...)) (let-values (((pid stdout stdin error) (subprocess input (current-input-port) (current-error-port) (find-executable-path process) args ...))) (subprocess-wait pid))) ((_ input: input (process args ...) rest ...) (let-values (((pid nothin stdin error) (subprocess (or input (current-output-port)) #f (current-error-port) (find-executable-path process) args ...))) (pipe-between input: stdin rest ...) (close-output-port stdin) (subprocess-wait pid))))) (define (main) (with-output-to-file "etc.cpio.gz" #:exists 'replace (? () (pipe-between ("gzip") ("cpio" "-o") ("find" "/etc" "-xdev"))))) (provide main) From lspector at hampshire.edu Sun Nov 15 16:39:36 2009 From: lspector at hampshire.edu (Lee Spector) Date: Sun Nov 15 16:44:58 2009 Subject: [plt-scheme] documentation feature requests In-Reply-To: References: Message-ID: I usually get into the documentation with searches, either with esc-F1 to search for the currently selected symbol or by selecting "Help Desk" from the Help menu (in Mac OS X) and then doing a search from there. When search fails I'm pretty frustrated and then start hunting through the docs from the ToC. BTW my searches often fail because my search term doesn't occur in a defined symbol name, or whatever else the searches search, even if it occurs in the documentation itself. It'd be nice to have searches that search over all of the text in the documentation, at least optionally. -Lee On Nov 15, 2009, at 4:09 PM, Noel Welsh wrote: > On Sun, Nov 15, 2009 at 8:14 PM, Lee Spector > wrote: >> >> 2. More examples -- simple, minimal examples -- in the >> documentation would >> help very very very much > > Out of interest, how do you use the documentation? Do you start at the > Guide, or with search, or the Reference? What do you do if search > fails? > > Thanks, > N. -- Lee Spector, Professor of Computer Science School of Cognitive Science, Hampshire College 893 West Street, Amherst, MA 01002-3359 lspector@hampshire.edu, http://hampshire.edu/lspector/ Phone: 413-559-5352, Fax: 413-559-5438 Check out Genetic Programming and Evolvable Machines: http://www.springer.com/10710 - http://gpemjournal.blogspot.com/ From samth at ccs.neu.edu Sun Nov 15 16:52:53 2009 From: samth at ccs.neu.edu (Sam TH) Date: Sun Nov 15 16:54:26 2009 Subject: [plt-scheme] pipe-between In-Reply-To: <4B006F2D.5000904@synx.us.to> References: <4B006F2D.5000904@synx.us.to> Message-ID: <63bb19ae0911151352r6325fe1bpd827bd6a0824582@mail.gmail.com> On Sun, Nov 15, 2009 at 4:14 PM, Synx wrote: > Something I've rolled around in my head for some time is how annoyingly > simple the bash "pipe" syntax is. Why shouldn't a more sensible language > be able to do that as well? So I hacked together this syntax, which you > might find useful. I ran that test procedure and it seems to have worked > fine. Only problem is what is leftmost in bash syntax becomes rightmost > in this syntax, but not sure that's worth bothering with. There's lots of prior art here from SCSH [1]. I've long thought that PLT could use an adaptation of lots of the SCSH libraries - this would be a good place to start. [1] http://www.scsh.net/ , see esp. the process notation at http://www.scsh.net/docu/html/man-Z-H-3.html#node_sec_2.2 -- sam th samth@ccs.neu.edu From grettke at acm.org Sun Nov 15 16:54:43 2009 From: grettke at acm.org (Grant Rettke) Date: Sun Nov 15 16:55:58 2009 Subject: [plt-scheme] documentation feature requests In-Reply-To: References: Message-ID: <756daca50911151354h11fa43b6qc1fba9fcaa76d9ef@mail.gmail.com> On Sun, Nov 15, 2009 at 2:14 PM, Lee Spector wrote: > I've been using and teaching DrScheme for a couple of months now, and while > I'm still a newbie I would nonetheless like to offer a couple of suggestions > based on my experience coming from Common Lisp environments and teaching > students with an unusually wide range of backgrounds and motivations. Your observations make me wonder if the approach in DrScheme is intended to encourage a certain style of development. Stay with me here: "Enterprise Development" often involves tens or hundreds of programmers coding away against tens of APIs each with hundreds and hundreds of API calls available. Usually no one reads up on the APIs or plans what code they are going to write. Often it is a matter of typing object. to find a method that looks right and reading the blurb about it. Now, that is not how I was taught in School, even with Java, but that is how most folks write code. For the HtDP style of coding the docs seems to work well. Then again I may just be projecting. From lspector at hampshire.edu Sun Nov 15 17:20:05 2009 From: lspector at hampshire.edu (Lee Spector) Date: Sun Nov 15 17:25:26 2009 Subject: [plt-scheme] documentation feature requests In-Reply-To: <756daca50911151354h11fa43b6qc1fba9fcaa76d9ef@mail.gmail.com> References: <756daca50911151354h11fa43b6qc1fba9fcaa76d9ef@mail.gmail.com> Message-ID: <83E2AAC8-1D90-44E0-8E4F-AF5E86D11CDB@hampshire.edu> I assume that DrScheme is indeed intended to encourage a certain style of development, and that, while it's not a perfect match to what I or my students often do it can nonetheless support my style of development quite well. I'm not using HtDP in my current teaching, although I have a copy and may use it at some point. My students are often primarily artists or musicians or philosophers or biologists or whatevers, and both they and I often engage in improvisational, bottom up, exploratory programming. I'm often coding up one-off computational experiments that aren't fully specified in advance and won't be incorporated into any products. I do want them to be correct and maintainable, etc., at least as a general rule, but the most important thing for me is usually to be able to go from idea to code as quickly as possible, to try something out, and to see what happens. Anyway, I know there's a lot to discuss/debate about development processes and styles, both when teaching beginning programmers and when programming more generally, and I wasn't really intending to go there. I think that the suggestions I made -- more documentation/ arglists in the IDE and more simple examples in the full documentation -- would help all sorts of people developing with all sorts of methodologies. They might help people who code like I do more, I guess, but I think they'd be generally useful. -Lee On Nov 15, 2009, at 4:54 PM, Grant Rettke wrote: > On Sun, Nov 15, 2009 at 2:14 PM, Lee Spector > wrote: >> I've been using and teaching DrScheme for a couple of months now, >> and while >> I'm still a newbie I would nonetheless like to offer a couple of >> suggestions >> based on my experience coming from Common Lisp environments and >> teaching >> students with an unusually wide range of backgrounds and motivations. > > Your observations make me wonder if the approach in DrScheme is > intended to encourage a certain style of development. Stay with me > here: "Enterprise Development" often involves tens or hundreds of > programmers coding away against tens of APIs each with hundreds and > hundreds of API calls available. Usually no one reads up on the APIs > or plans what code they are going to write. Often it is a matter of > typing object. to find a method that looks > right and reading the blurb about it. Now, that is not how I was > taught in School, even with Java, but that is how most folks write > code. For the HtDP style of coding the docs seems to work well. > > Then again I may just be projecting. -- Lee Spector, Professor of Computer Science School of Cognitive Science, Hampshire College 893 West Street, Amherst, MA 01002-3359 lspector@hampshire.edu, http://hampshire.edu/lspector/ Phone: 413-559-5352, Fax: 413-559-5438 Check out Genetic Programming and Evolvable Machines: http://www.springer.com/10710 - http://gpemjournal.blogspot.com/ From neil at neilvandyke.org Sun Nov 15 17:58:10 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Sun Nov 15 17:58:38 2009 Subject: [plt-scheme] documentation feature requests In-Reply-To: <83E2AAC8-1D90-44E0-8E4F-AF5E86D11CDB@hampshire.edu> References: <756daca50911151354h11fa43b6qc1fba9fcaa76d9ef@mail.gmail.com> <83E2AAC8-1D90-44E0-8E4F-AF5E86D11CDB@hampshire.edu> Message-ID: <4B008782.9080506@neilvandyke.org> I actually find writing examples for procedures to be relatively fun, as API documentation goes. (Though not as much fun as it used to be, now that I'm targeting so-so HTML, rather than nicely typeset PDF with my pretty TeXinfo "@result{}" arrow and everything.) I can also see validity of arguments, e.g., that lots of little examples often clutter the documentation unnecessarily, and that such examples are often used as crutches in lieu of understanding the language, library, or problem domain. Also note that examples won't necessarily avert you having to look around at bits of documentation. Below is an example from one of my libraries. You could use it as a model for how to turn a CSV file into SXML, but that doesn't tell you how to transform the SXML, nor pick values out of it, nor write it out as XML, etc. Such things are not within the scope of the documentation of this procedure nor this library. > For example, given a CSV-format file friends.csv that has the contents: > > Binoche,Ste. Brune,33-1-2-3 > Posey,Main St.,555-5309 > Ryder,Cellblock 9, > > with elements not given, the result is: > > (csv->sxml (open-input-file "friends.csv")) > ==> > (*TOP* > (row (col-0 "Binoche") (col-1 "Ste. Brune") (col-2 "33-1-2-3")) > (row (col-0 "Posey") (col-1 "Main St.") (col-2 "555-5309")) > (row (col-0 "Ryder") (col-1 "Cellblock 9") (col-2 ""))) > > With elements given, the result is like: > > (csv->sxml (open-input-file "friends.csv") > 'friend > '(name address phone)) > ==> > (*TOP* (friend (name "Binoche") > (address "Ste. Brune") > (phone "33-1-2-3")) > (friend (name "Posey") > (address "Main St.") > (phone "555-5309")) > (friend (name "Ryder") > (address "Cellblock 9") > (phone ""))) -- http://www.neilvandyke.org/ From lspector at hampshire.edu Sun Nov 15 18:24:33 2009 From: lspector at hampshire.edu (Lee Spector) Date: Sun Nov 15 18:29:55 2009 Subject: [plt-scheme] documentation feature requests In-Reply-To: <4B008782.9080506@neilvandyke.org> References: <756daca50911151354h11fa43b6qc1fba9fcaa76d9ef@mail.gmail.com> <83E2AAC8-1D90-44E0-8E4F-AF5E86D11CDB@hampshire.edu> <4B008782.9080506@neilvandyke.org> Message-ID: <99217E0C-9D28-4467-A94E-DF22BC6A5B10@hampshire.edu> Crutches are often quite useful! :-) Minimal examples shouldn't add much clutter, and a minimal example can establish a base line of understanding even when more reading would be necessary to do anything fancier. I mentioned the use of examples in the Processing documentation -- here's a link: http://processing.org/reference/ . You'll see that almost every procedure is introduced with a simple example, sometimes just a single line (although in some cases it has to be quite a bit longer). One can often just glance at the example and know how to use the procedure in the simplest cases, without reading anything else. There are already a few examples of the sort that I'm talking about in the PLT documentation -- for example I like the examples for build- list and for several of the other procedures in section 3.9. What I was hoping to encourage was the inclusion of such example more uniformly throughout the documentation. -Lee On Nov 15, 2009, at 5:58 PM, Neil Van Dyke wrote: > I actually find writing examples for procedures to be relatively > fun, as API documentation goes. (Though not as much fun as it used > to be, now that I'm targeting so-so HTML, rather than nicely typeset > PDF with my pretty TeXinfo "@result{}" arrow and everything.) > > I can also see validity of arguments, e.g., that lots of little > examples often clutter the documentation unnecessarily, and that > such examples are often used as crutches in lieu of understanding > the language, library, or problem domain. > > Also note that examples won't necessarily avert you having to look > around at bits of documentation. Below is an example from one of my > libraries. You could use it as a model for how to turn a CSV file > into SXML, but that doesn't tell you how to transform the SXML, nor > pick values out of it, nor write it out as XML, etc. Such things > are not within the scope of the documentation of this procedure nor > this library. > >> For example, given a CSV-format file friends.csv that has the >> contents: >> >> Binoche,Ste. Brune,33-1-2-3 >> Posey,Main St.,555-5309 >> Ryder,Cellblock 9, >> >> with elements not given, the result is: >> >> (csv->sxml (open-input-file "friends.csv")) >> ==> >> (*TOP* >> (row (col-0 "Binoche") (col-1 "Ste. Brune") (col-2 "33-1-2-3")) >> (row (col-0 "Posey") (col-1 "Main St.") (col-2 "555-5309")) >> (row (col-0 "Ryder") (col-1 "Cellblock 9") (col-2 ""))) >> >> With elements given, the result is like: >> >> (csv->sxml (open-input-file "friends.csv") >> 'friend >> '(name address phone)) >> ==> >> (*TOP* (friend (name "Binoche") >> (address "Ste. Brune") >> (phone "33-1-2-3")) >> (friend (name "Posey") >> (address "Main St.") >> (phone "555-5309")) >> (friend (name "Ryder") >> (address "Cellblock 9") >> (phone ""))) > > -- > http://www.neilvandyke.org/ -- Lee Spector, Professor of Computer Science School of Cognitive Science, Hampshire College 893 West Street, Amherst, MA 01002-3359 lspector@hampshire.edu, http://hampshire.edu/lspector/ Phone: 413-559-5352, Fax: 413-559-5438 Check out Genetic Programming and Evolvable Machines: http://www.springer.com/10710 - http://gpemjournal.blogspot.com/ From robby at eecs.northwestern.edu Sun Nov 15 18:40:47 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Sun Nov 15 18:41:09 2009 Subject: [plt-scheme] documentation feature requests In-Reply-To: <99217E0C-9D28-4467-A94E-DF22BC6A5B10@hampshire.edu> References: <756daca50911151354h11fa43b6qc1fba9fcaa76d9ef@mail.gmail.com> <83E2AAC8-1D90-44E0-8E4F-AF5E86D11CDB@hampshire.edu> <4B008782.9080506@neilvandyke.org> <99217E0C-9D28-4467-A94E-DF22BC6A5B10@hampshire.edu> Message-ID: <932b2f1f0911151540g6f2fb5a8n1fb07dfbcb1df76a@mail.gmail.com> I've seen that Jon Rafkind has been adding such things to lots of places in the docs and I've put them in the new image documentation library (http://pre.plt-scheme.org/docs/html/teachpack/2htdpimage.html), so I think it is safe to say we recognize the need and are working on it. Robby On Sun, Nov 15, 2009 at 5:24 PM, Lee Spector wrote: > > Crutches are often quite useful! :-) > > Minimal examples shouldn't add much clutter, and a minimal example can > establish a base line of understanding even when more reading would be > necessary to do anything fancier. > > I mentioned the use of examples in the Processing documentation -- here's a > link: http://processing.org/reference/ . You'll see that almost every > procedure is introduced with a simple example, sometimes just a single line > (although in some cases it has to be quite a bit longer). One can often just > glance at the example and know how to use the procedure in the simplest > cases, without reading anything else. > > There are already a few examples of the sort that I'm talking about in the > PLT documentation -- for example I like the examples for build-list and for > several of the other procedures in section 3.9. What I was hoping to > encourage was the inclusion of such example more uniformly throughout the > documentation. > > ?-Lee > > > > > On Nov 15, 2009, at 5:58 PM, Neil Van Dyke wrote: > >> I actually find writing examples for procedures to be relatively fun, as >> API documentation goes. ?(Though not as much fun as it used to be, now that >> I'm targeting so-so HTML, rather than nicely typeset PDF with my pretty >> TeXinfo "@result{}" arrow and everything.) >> >> I can also see validity of arguments, e.g., that lots of little examples >> often clutter the documentation unnecessarily, and that such examples are >> often used as crutches in lieu of understanding the language, library, or >> problem domain. >> >> Also note that examples won't necessarily avert you having to look around >> at bits of documentation. ?Below is an example from one of my libraries. >> ?You could use it as a model for how to turn a CSV file into SXML, but that >> doesn't tell you how to transform the SXML, nor pick values out of it, nor >> write it out as XML, etc. ?Such things are not within the scope of the >> documentation of this procedure nor this library. >> >>> For example, given a CSV-format file friends.csv that has the contents: >>> >>> Binoche,Ste. Brune,33-1-2-3 >>> Posey,Main St.,555-5309 >>> Ryder,Cellblock 9, >>> >>> with elements not given, the result is: >>> >>> ?(csv->sxml (open-input-file "friends.csv")) >>> ?==> >>> ?(*TOP* >>> ?(row (col-0 "Binoche") (col-1 "Ste. Brune") ?(col-2 "33-1-2-3")) >>> ?(row (col-0 "Posey") ? (col-1 "Main St.") ? ?(col-2 "555-5309")) >>> ?(row (col-0 "Ryder") ? (col-1 "Cellblock 9") (col-2 ""))) >>> >>> With elements given, the result is like: >>> >>> ?(csv->sxml (open-input-file "friends.csv") >>> ? ? ? ? ? ?'friend >>> ? ? ? ? ? ?'(name address phone)) >>> ?==> >>> ?(*TOP* (friend (name ? ?"Binoche") >>> ? ? ? ? ? ? ? ?(address "Ste. Brune") >>> ? ? ? ? ? ? ? ?(phone ? "33-1-2-3")) >>> ? ? ? ?(friend (name ? ?"Posey") >>> ? ? ? ? ? ? ? ?(address "Main St.") >>> ? ? ? ? ? ? ? ?(phone ? "555-5309")) >>> ? ? ? ?(friend (name ? ?"Ryder") >>> ? ? ? ? ? ? ? ?(address "Cellblock 9") >>> ? ? ? ? ? ? ? ?(phone ? ""))) >> >> -- >> http://www.neilvandyke.org/ > > -- > Lee Spector, Professor of Computer Science > School of Cognitive Science, Hampshire College > 893 West Street, Amherst, MA 01002-3359 > lspector@hampshire.edu, http://hampshire.edu/lspector/ > Phone: 413-559-5352, Fax: 413-559-5438 > > Check out Genetic Programming and Evolvable Machines: > http://www.springer.com/10710 - http://gpemjournal.blogspot.com/ > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From lspector at hampshire.edu Sun Nov 15 18:43:54 2009 From: lspector at hampshire.edu (Lee Spector) Date: Sun Nov 15 18:49:16 2009 Subject: [plt-scheme] documentation feature requests In-Reply-To: <932b2f1f0911151540g6f2fb5a8n1fb07dfbcb1df76a@mail.gmail.com> References: <756daca50911151354h11fa43b6qc1fba9fcaa76d9ef@mail.gmail.com> <83E2AAC8-1D90-44E0-8E4F-AF5E86D11CDB@hampshire.edu> <4B008782.9080506@neilvandyke.org> <99217E0C-9D28-4467-A94E-DF22BC6A5B10@hampshire.edu> <932b2f1f0911151540g6f2fb5a8n1fb07dfbcb1df76a@mail.gmail.com> Message-ID: <6536CEA8-647C-4A04-BCE9-4BD9AACCBF34@hampshire.edu> Oh indeed, those are wonderful examples that I hadn't previously seen in the image library. That's exactly the sort of thing I'd love to see everywhere some day. Thanks, -Lee On Nov 15, 2009, at 6:40 PM, Robby Findler wrote: > I've seen that Jon Rafkind has been adding such things to lots of > places in the docs and I've put them in the new image documentation > library (http://pre.plt-scheme.org/docs/html/teachpack/ > 2htdpimage.html), > so I think it is safe to say we recognize the need and are working on > it. > > Robby > > On Sun, Nov 15, 2009 at 5:24 PM, Lee Spector > wrote: >> >> Crutches are often quite useful! :-) >> >> Minimal examples shouldn't add much clutter, and a minimal example >> can >> establish a base line of understanding even when more reading would >> be >> necessary to do anything fancier. >> >> I mentioned the use of examples in the Processing documentation -- >> here's a >> link: http://processing.org/reference/ . You'll see that almost every >> procedure is introduced with a simple example, sometimes just a >> single line >> (although in some cases it has to be quite a bit longer). One can >> often just >> glance at the example and know how to use the procedure in the >> simplest >> cases, without reading anything else. >> >> There are already a few examples of the sort that I'm talking about >> in the >> PLT documentation -- for example I like the examples for build-list >> and for >> several of the other procedures in section 3.9. What I was hoping to >> encourage was the inclusion of such example more uniformly >> throughout the >> documentation. >> >> -Lee >> >> >> >> >> On Nov 15, 2009, at 5:58 PM, Neil Van Dyke wrote: >> >>> I actually find writing examples for procedures to be relatively >>> fun, as >>> API documentation goes. (Though not as much fun as it used to be, >>> now that >>> I'm targeting so-so HTML, rather than nicely typeset PDF with my >>> pretty >>> TeXinfo "@result{}" arrow and everything.) >>> >>> I can also see validity of arguments, e.g., that lots of little >>> examples >>> often clutter the documentation unnecessarily, and that such >>> examples are >>> often used as crutches in lieu of understanding the language, >>> library, or >>> problem domain. >>> >>> Also note that examples won't necessarily avert you having to look >>> around >>> at bits of documentation. Below is an example from one of my >>> libraries. >>> You could use it as a model for how to turn a CSV file into SXML, >>> but that >>> doesn't tell you how to transform the SXML, nor pick values out of >>> it, nor >>> write it out as XML, etc. Such things are not within the scope of >>> the >>> documentation of this procedure nor this library. >>> >>>> For example, given a CSV-format file friends.csv that has the >>>> contents: >>>> >>>> Binoche,Ste. Brune,33-1-2-3 >>>> Posey,Main St.,555-5309 >>>> Ryder,Cellblock 9, >>>> >>>> with elements not given, the result is: >>>> >>>> (csv->sxml (open-input-file "friends.csv")) >>>> ==> >>>> (*TOP* >>>> (row (col-0 "Binoche") (col-1 "Ste. Brune") (col-2 "33-1-2-3")) >>>> (row (col-0 "Posey") (col-1 "Main St.") (col-2 "555-5309")) >>>> (row (col-0 "Ryder") (col-1 "Cellblock 9") (col-2 ""))) >>>> >>>> With elements given, the result is like: >>>> >>>> (csv->sxml (open-input-file "friends.csv") >>>> 'friend >>>> '(name address phone)) >>>> ==> >>>> (*TOP* (friend (name "Binoche") >>>> (address "Ste. Brune") >>>> (phone "33-1-2-3")) >>>> (friend (name "Posey") >>>> (address "Main St.") >>>> (phone "555-5309")) >>>> (friend (name "Ryder") >>>> (address "Cellblock 9") >>>> (phone ""))) >>> >>> -- >>> http://www.neilvandyke.org/ >> >> -- >> Lee Spector, Professor of Computer Science >> School of Cognitive Science, Hampshire College >> 893 West Street, Amherst, MA 01002-3359 >> lspector@hampshire.edu, http://hampshire.edu/lspector/ >> Phone: 413-559-5352, Fax: 413-559-5438 >> >> Check out Genetic Programming and Evolvable Machines: >> http://www.springer.com/10710 - http://gpemjournal.blogspot.com/ >> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> -- Lee Spector, Professor of Computer Science School of Cognitive Science, Hampshire College 893 West Street, Amherst, MA 01002-3359 lspector@hampshire.edu, http://hampshire.edu/lspector/ Phone: 413-559-5352, Fax: 413-559-5438 Check out Genetic Programming and Evolvable Machines: http://www.springer.com/10710 - http://gpemjournal.blogspot.com/ From tjm_22 at hotmail.com Sun Nov 15 18:46:58 2009 From: tjm_22 at hotmail.com (Tim Marchbank) Date: Sun Nov 15 18:52:17 2009 Subject: [plt-scheme] Compile error help Message-ID: Hi, Here is a simplified example of the problem I am having: I open the following in DrScheme: #lang scheme (define (string-eval str) (eval (read (open-input-string str)))) (define (:Object-new c) (new (string-eval c)) ) (define entity% (class object% (field (Colour: "Red")) (super-new) ) ) (define point% (class entity% (field (X: 0.0)) (field (Y: 0.0)) (field (Z: 0.0)) (super-new) ) ) (define aa (:Object-new "point%")) (define ab (:Object-new "entity%")) When I run it, it comes up with the following error: compile: unbound identifier (and no #%top syntax transformer is bound) in: point% but then when I enter the last two lines into the interactions window, directly after the error, it works: > (define aa (:Object-new "point%")) (define ab (:Object-new "entity%")) > aa #(struct:object:point% ...) > ab #(struct:object:entity% ...) Why does it work one time & not the other?? Any help would be appreciated. Thanks Tim. _________________________________________________________________ Looking to move this spring? With all the lastest places, searching has never been easier. Look now! http://clk.atdmt.com/NMN/go/157631292/direct/01/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091115/e09123db/attachment.htm From tjm_22 at hotmail.com Sun Nov 15 18:49:30 2009 From: tjm_22 at hotmail.com (Tim Marchbank) Date: Sun Nov 15 18:52:48 2009 Subject: [plt-scheme] Compile error help Message-ID: Hi, Here is a simplified example of the problem I am having: I open the following in DrScheme: #lang scheme (define (string-eval str) (eval (read (open-input-string str)))) (define (:Object-new c) (new (string-eval c)) ) (define entity% (class object% (field (Colour: "Red")) (super-new) ) ) (define point% (class entity% (field (X: 0.0)) (field (Y: 0.0)) (field (Z: 0.0)) (super-new) ) ) (define aa (:Object-new "point%")) (define ab (:Object-new "entity%")) When I run it, it comes up with the following error: compile: unbound identifier (and no #%top syntax transformer is bound) in: point% but then when I enter the last two lines into the interactions window, directly after the error, it works: > (define aa (:Object-new "point%")) (define ab (:Object-new "entity%")) > aa #(struct:object:point% ...) > ab #(struct:object:entity% ...) Why does it work one time & not the other?? Any help would be appreciated. Thanks Tim. _________________________________________________________________ Looking to move this spring? With all the lastest places, searching has never been easier. Look now! http://clk.atdmt.com/NMN/go/157631292/direct/01/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091115/edb4bc5c/attachment.htm From matthias at ccs.neu.edu Sun Nov 15 19:07:11 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Sun Nov 15 19:07:39 2009 Subject: [plt-scheme] documentation feature requests In-Reply-To: <6536CEA8-647C-4A04-BCE9-4BD9AACCBF34@hampshire.edu> References: <756daca50911151354h11fa43b6qc1fba9fcaa76d9ef@mail.gmail.com> <83E2AAC8-1D90-44E0-8E4F-AF5E86D11CDB@hampshire.edu> <4B008782.9080506@neilvandyke.org> <99217E0C-9D28-4467-A94E-DF22BC6A5B10@hampshire.edu> <932b2f1f0911151540g6f2fb5a8n1fb07dfbcb1df76a@mail.gmail.com> <6536CEA8-647C-4A04-BCE9-4BD9AACCBF34@hampshire.edu> Message-ID: Lee, which languages and which libraries are you primarily using? -- Matthias From czhu at cs.utah.edu Sun Nov 15 19:08:48 2009 From: czhu at cs.utah.edu (Chongkai Zhu) Date: Sun Nov 15 19:09:14 2009 Subject: [plt-scheme] Compile error help In-Reply-To: References: Message-ID: <4B009810.7050707@cs.utah.edu> Could I ask why you use `eval' here? The error is related to the way you use `eval'. Most of the time, people misuse `eval' (i.e., use eval when they shouldn't). Chongkai Tim Marchbank wrote: > Hi, > > Here is a simplified example of the problem I am having: > I open the following in DrScheme: > > > #lang scheme > (define (string-eval str) (eval (read (open-input-string str)))) > (define (:Object-new c) > (new (string-eval c)) > ) > (define entity% (class object% > (field (Colour: "Red")) > (super-new) > ) > ) > (define point% (class entity% > (field (X: 0.0)) > (field (Y: 0.0)) > (field (Z: 0.0)) > (super-new) > ) > ) > (define aa (:Object-new "point%")) > (define ab (:Object-new "entity%")) > > > When I run it, it comes up with the following error: > > compile: unbound identifier (and no #%top syntax transformer is bound) > in: point% > > but then when I enter the last two lines into the interactions window, > directly after the error, it works: > > > (define aa (:Object-new "point%")) > (define ab (:Object-new "entity%")) > > aa > #(struct:object:point% ...) > > ab > #(struct:object:entity% .. > > Why does it work one time & not the other?? > > Any help would be appreciated. > > Thanks > > Tim. > > > ------------------------------------------------------------------------ > With all the lastest places, searching has never been easier. Look > now! Looking to move this spring? > > ------------------------------------------------------------------------ > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From matthias at ccs.neu.edu Sun Nov 15 19:20:36 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Sun Nov 15 19:21:07 2009 Subject: [plt-scheme] HtDP Exercise 37.5.1 In-Reply-To: <03a46cb0-f3be-4b98-9fe6-8f7ec1dac90b@z3g2000prd.googlegroups.com> References: <03a46cb0-f3be-4b98-9fe6-8f7ec1dac90b@z3g2000prd.googlegroups.com> Message-ID: <61F87D2F-25D8-40A3-BDFA-03340C1AE3AB@ccs.neu.edu> On Nov 15, 2009, at 3:24 PM, Gadfly wrote: > Hi All -- > > How do picture fields work? How does one assign a photo to a > structure? (define-struct building (location image)) (make-building "202 huntington" ... use Insert | Image .. here ) > Also, are there any pre-defined campuses available as teachpacks? Nope, but if you want to produce some, go for it. In the new world of web mash ups, I'd add geocoding here: http://www.ccs.neu.edu/home/matthias/107-f09/Assignments/8.html (problem 8.1) credit to Gregor Kiczales -- Matthias From dyrueta at gmail.com Sun Nov 15 19:25:08 2009 From: dyrueta at gmail.com (David Yrueta) Date: Sun Nov 15 19:31:25 2009 Subject: [plt-scheme] HtDP Exercise 37.5.1 In-Reply-To: <61F87D2F-25D8-40A3-BDFA-03340C1AE3AB@ccs.neu.edu> References: <03a46cb0-f3be-4b98-9fe6-8f7ec1dac90b@z3g2000prd.googlegroups.com> <61F87D2F-25D8-40A3-BDFA-03340C1AE3AB@ccs.neu.edu> Message-ID: <186df66b0911151625y37320a79je1563258cf51f175@mail.gmail.com> Thank you! On Sun, Nov 15, 2009 at 4:20 PM, Matthias Felleisen wrote: > > On Nov 15, 2009, at 3:24 PM, Gadfly wrote: > >> Hi All -- >> >> How do picture fields work? ?How does one assign a photo to a >> structure? > > > (define-struct building (location image)) > > (make-building "202 huntington" ... use Insert | Image .. here ) > > >> Also, are there any pre-defined campuses available as teachpacks? > > Nope, but if you want to produce some, go for it. In the new world of web mash ups, I'd add geocoding here: > > ?http://www.ccs.neu.edu/home/matthias/107-f09/Assignments/8.html (problem 8.1) > ?credit to Gregor Kiczales > > > -- Matthias > > From lspector at hampshire.edu Sun Nov 15 19:47:20 2009 From: lspector at hampshire.edu (Lee Spector) Date: Sun Nov 15 19:52:42 2009 Subject: [plt-scheme] documentation feature requests In-Reply-To: References: <756daca50911151354h11fa43b6qc1fba9fcaa76d9ef@mail.gmail.com> <83E2AAC8-1D90-44E0-8E4F-AF5E86D11CDB@hampshire.edu> <4B008782.9080506@neilvandyke.org> <99217E0C-9D28-4467-A94E-DF22BC6A5B10@hampshire.edu> <932b2f1f0911151540g6f2fb5a8n1fb07dfbcb1df76a@mail.gmail.com> <6536CEA8-647C-4A04-BCE9-4BD9AACCBF34@hampshire.edu> Message-ID: <75024A9E-B249-4C18-A77D-B04E049CEA4B@hampshire.edu> I'm using mostly #lang scheme, scheme/gui, scheme/gui/dynamic, and plot. Some of my students are using a bunch of other stuff too -- some of them are pretty independent. BTW there are indeed some sections of the documentation for these parts of the system that have lots of good examples, but there are also some with none, or with only occasional examples of unusual calls, and some with only a few. -Lee On Nov 15, 2009, at 7:07 PM, Matthias Felleisen wrote: > > Lee, which languages and which libraries are you primarily using? -- > Matthias -- Lee Spector, Professor of Computer Science School of Cognitive Science, Hampshire College 893 West Street, Amherst, MA 01002-3359 lspector@hampshire.edu, http://hampshire.edu/lspector/ Phone: 413-559-5352, Fax: 413-559-5438 Check out Genetic Programming and Evolvable Machines: http://www.springer.com/10710 - http://gpemjournal.blogspot.com/ From tjm_22 at hotmail.com Sun Nov 15 20:22:11 2009 From: tjm_22 at hotmail.com (Tim Marchbank) Date: Sun Nov 15 20:22:32 2009 Subject: [plt-scheme] Compile error help In-Reply-To: <4B009810.7050707@cs.utah.edu> References: , <4B009810.7050707@cs.utah.edu> Message-ID: Thanks for replying. The reason I am doing it this way, is because it is the only way I could find to convert a string of a class into an input for new / make-object etc. (Probably comes back to the way I would have done it or something similar in VisualLISP.) Why do I want to do that? Well, I was wanting a common way of creating any class of object by passing its class (and other initialisation variables) to a common function, and sending it as a string seemed the most useful means (as I can then use it dialogs etc..) As I said, this is only a simplified version of what I am working on. If there is a better way to do it, I'm all ears. But.. Why does it not work, and then work? Still learning.. Tim. > Date: Sun, 15 Nov 2009 17:08:48 -0700 > From: czhu@cs.utah.edu > To: tjm_22@hotmail.com > CC: plt-scheme@list.cs.brown.edu > Subject: Re: [plt-scheme] Compile error help > > Could I ask why you use `eval' here? The error is related to the way you > use `eval'. Most of the time, people misuse `eval' (i.e., use eval when > they shouldn't). > > Chongkai > > Tim Marchbank wrote: > > Hi, > > > > Here is a simplified example of the problem I am having: > > I open the following in DrScheme: > > > > > > #lang scheme > > (define (string-eval str) (eval (read (open-input-string str)))) > > (define (:Object-new c) > > (new (string-eval c)) > > ) > > (define entity% (class object% > > (field (Colour: "Red")) > > (super-new) > > ) > > ) > > (define point% (class entity% > > (field (X: 0.0)) > > (field (Y: 0.0)) > > (field (Z: 0.0)) > > (super-new) > > ) > > ) > > (define aa (:Object-new "point%")) > > (define ab (:Object-new "entity%")) > > > > > > When I run it, it comes up with the following error: > > > > compile: unbound identifier (and no #%top syntax transformer is bound) > > in: point% > > > > but then when I enter the last two lines into the interactions window, > > directly after the error, it works: > > > > > (define aa (:Object-new "point%")) > > (define ab (:Object-new "entity%")) > > > aa > > #(struct:object:point% ...) > > > ab > > #(struct:object:entity% .. > > > > Why does it work one time & not the other?? > > > > Any help would be appreciated. > > > > Thanks > > > > Tim. > > > > > > ------------------------------------------------------------------------ > > With all the lastest places, searching has never been easier. Look > > now! Looking to move this spring? > > > > ------------------------------------------------------------------------ > > > > _________________________________________________ > > For list-related administrative tasks: > > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > > _________________________________________________________________ Want to know what your boss is paid? Check out The Great Australian Pay Check now http://clk.atdmt.com/NMN/go/157639755/direct/01/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091116/979f42bd/attachment.htm From robby at eecs.northwestern.edu Sun Nov 15 20:56:22 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Sun Nov 15 20:56:45 2009 Subject: [plt-scheme] Compile error help In-Reply-To: References: <4B009810.7050707@cs.utah.edu> Message-ID: <932b2f1f0911151756j21313cf9maae5a5861e3b8837@mail.gmail.com> You could just pass the class. Classes are values (ie, can be passed to and returned from functions) in PLT. Robby On Sun, Nov 15, 2009 at 7:22 PM, Tim Marchbank wrote: > > Thanks for replying. > > The reason I am doing it this way, is because it is the only way I could > find to convert a string of a class into?an input?for new / make-object etc. > (Probably comes back to the way I would have done it?or something similar in > VisualLISP.) > Why do I want to do that? Well, I was wanting a common way of creating any > class of object by passing its class (and other initialisation variables) to > a common function, and sending it as a string seemed?the most useful means > (as I can then use it dialogs etc..) > As I said, this is only a simplified version of what I am working on. > > If there is a better way to do it, I'm all ears. > > But.. > Why does it not work, and then work? > > Still learning.. > > Tim. > > >> Date: Sun, 15 Nov 2009 17:08:48 -0700 >> From: czhu@cs.utah.edu >> To: tjm_22@hotmail.com >> CC: plt-scheme@list.cs.brown.edu >> Subject: Re: [plt-scheme] Compile error help >> >> Could I ask why you use `eval' here? The error is related to the way you >> use `eval'. Most of the time, people misuse `eval' (i.e., use eval when >> they shouldn't). >> >> Chongkai >> >> Tim Marchbank wrote: >> > Hi, >> > >> > Here is a simplified example of the problem I am having: >> > I open the following in DrScheme: >> > >> > >> > #lang scheme >> > (define (string-eval str) (eval (read (open-input-string str)))) >> > (define (:Object-new c) >> > (new (string-eval c)) >> > ) >> > (define entity% (class object% >> > (field (Colour: "Red")) >> > (super-new) >> > ) >> > ) >> > (define point% (class entity% >> > (field (X: 0.0)) >> > (field (Y: 0.0)) >> > (field (Z: 0.0)) >> > (super-new) >> > ) >> > ) >> > (define aa (:Object-new "point%")) >> > (define ab (:Object-new "entity%")) >> > >> > >> > When I run it, it comes up with the following error: >> > >> > compile: unbound identifier (and no #%top syntax transformer is bound) >> > in: point% >> > >> > but then when I enter the last two lines into the interactions window, >> > directly after the error, it works: >> > >> > > (define aa (:Object-new "point%")) >> > (define ab (:Object-new "entity%")) >> > > aa >> > #(struct:object:point% ...) >> > > ab >> > #(struct:object:entity% .. >> > >> > Why does it work one time & not the other?? >> > >> > Any help would be appreciated. >> > >> > Thanks >> > >> > Tim. >> > >> > >> > ------------------------------------------------------------------------ >> > With all the lastest places, searching has never been easier. Look >> > now! Looking to move this spring? >> > >> > ------------------------------------------------------------------------ >> > >> > _________________________________________________ >> > For list-related administrative tasks: >> > http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > >> > > ________________________________ > Check out The Great Australian Pay Check now Want to know what your boss is > paid? > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From shaoron at gmail.com Sun Nov 15 23:02:47 2009 From: shaoron at gmail.com (G G) Date: Sun Nov 15 23:03:10 2009 Subject: [plt-scheme] Alpha-beta pruning In-Reply-To: References: <1ab9a21f0911140900w2c6c574bgf3c3c193178c1348@mail.gmail.com> <1ab9a21f0911142025n42d2819ao4a9220543b5d904a@mail.gmail.com> <1ab9a21f0911150801i37a7a10fm20bc158c21a37e01@mail.gmail.com> Message-ID: <1ab9a21f0911152002x7c2eca03x910cf5f3a88b7129@mail.gmail.com> Well I guess yes. On Sun, Nov 15, 2009 at 9:38 PM, Shriram Krishnamurthi wrote: > Does your course prof not require you to write ANY data definitions, > templates, etc.? You're allowed to turn in ONLY code and they give > you a full grade? > > Shriram > > On Sun, Nov 15, 2009 at 11:01 AM, G G wrote: > > Well I can attach the full .ss file here > > > > On Sun, Nov 15, 2009 at 4:48 PM, Shriram Krishnamurthi > > wrote: > >> > >> I assume G forgot to reply to the list, so I'm taking the liberty of > >> replying there. > >> > >> I'll point out that this code still has no data definitions, examples > >> of data, test cases, etc. > >> > >> S. > >> > >> On Sat, Nov 14, 2009 at 11:25 PM, G G wrote: > >> > This is the orignal Minimax that I am trying to add Alpha-beta on > >> > > >> > > >> > (define minimax > >> > (lambda (b player moves max-depth heuristic-function) > >> > (define max/min > >> > (lambda (player) > >> > (if (eq? player 'W) max min))) > >> > (define minimax-move > >> > (lambda (b player max-depth move) > >> > (minimax/depth > >> > (apply-move b player move) > >> > (opponent player) > >> > (- max-depth 1)))) > >> > (define minimax/depth > >> > (lambda (b player max-depth) > >> > (if (= max-depth 0) > >> > (heuristic-function b) > >> > (let ([moves (possible-moves b player)]) > >> > (if (null? moves) > >> > (minimax/depth b (opponent player) (- max-depth 1)) > >> > (let ([scores > >> > (map (lambda (move) > >> > (minimax-move b player max-depth > move)) > >> > moves)]) > >> > (apply (max/min player) scores))))))) > >> > (let ([scores > >> > (map (lambda (move) (minimax-move b player max-depth move)) > >> > moves)]) > >> > (let ([best (apply (max/min player) scores)]) > >> > (let loop ([moves moves] [scores scores]) > >> > (if (= (car scores) best) > >> > (car moves) > >> > (loop (cdr moves) (cdr scores)))))))) > >> > > >> > > >> > And I used the algorithm but i didnt know how to do these > >> > > >> > S ? Successors(n) > >> > > >> > best ? ?? > >> >> for all ni ? S do > >> >> v ? ???(ni, d ? 1, ??, ?max(?, best)) > >> > > >> > > >> > Thanks a lot, > >> > G > >> > > >> > On Sat, Nov 14, 2009 at 9:36 PM, Shriram Krishnamurthi < > sk@cs.brown.edu> > >> > wrote: > >> >> > >> >> Sure, we'd be happy to help. Where are your data definitions, > >> >> examples of data, and test cases? > >> >> > >> >> Shriram > >> >> > >> >> On Sat, Nov 14, 2009 at 12:00 PM, G G wrote: > >> >> > I am trying to implement the alpha beta pruning but with no luck > can > >> >> > anyone > >> >> > help me with how it works I am trying to use this Algorithm > >> >> > > >> >> > ??(n, d, ?, ?) > >> >> > S ? Successors(n) > >> >> > if d ? 0 ? S ? ? then > >> >> > return f(n) > >> >> > best ? ?? > >> >> > for all ni ? S do > >> >> > v ? ???(ni, d ? 1, ??, ?max(?, best)) > >> >> > if v > best then > >> >> > best ? v if best ? ? then > >> >> > return best > >> >> > return best > >> >> > > >> >> > > >> >> > Best regards, > >> >> > G > >> >> > > >> >> > _________________________________________________ > >> >> > For list-related administrative tasks: > >> >> > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > >> >> > > >> >> > > >> > > >> > > > > > > > _________________________________________________ > > For list-related administrative tasks: > > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091116/ed9586f5/attachment-0001.htm From rafkind at cs.utah.edu Sun Nov 15 23:45:45 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Sun Nov 15 23:49:05 2009 Subject: [plt-scheme] documentation feature requests In-Reply-To: <932b2f1f0911151540g6f2fb5a8n1fb07dfbcb1df76a@mail.gmail.com> References: <756daca50911151354h11fa43b6qc1fba9fcaa76d9ef@mail.gmail.com> <83E2AAC8-1D90-44E0-8E4F-AF5E86D11CDB@hampshire.edu> <4B008782.9080506@neilvandyke.org> <99217E0C-9D28-4467-A94E-DF22BC6A5B10@hampshire.edu> <932b2f1f0911151540g6f2fb5a8n1fb07dfbcb1df76a@mail.gmail.com> Message-ID: <4B00D8F9.7010509@cs.utah.edu> Robby Findler wrote: > I've seen that Jon Rafkind has been adding such things to lots of > places in the docs and I've put them in the new image documentation > library (http://pre.plt-scheme.org/docs/html/teachpack/2htdpimage.html), > so I think it is safe to say we recognize the need and are working on > it. > > I just added examples for all the functions in section 3.9 except for the immutable cyclic data stuff at the bottom. The spacing for the caar/cddr/etc examples is broken, if anyone wants to help me out. From charliesmith001 at gmail.com Mon Nov 16 05:16:41 2009 From: charliesmith001 at gmail.com (Charlie Smith) Date: Mon Nov 16 05:17:04 2009 Subject: [plt-scheme] installation problems In-Reply-To: <4AFD3882.7060401@neilvandyke.org> References: <19197.3959.112490.800760@winooski.ccs.neu.edu> <4AFD3882.7060401@neilvandyke.org> Message-ID: Hi neil I'm sure its only 218mb cause, i see a warning that says not enough RAM when i start the machine :) Thanks for your concern, but the comps at college are quite fine for what i do (some network and text processing stuff) and like you suggested i'm planning to get a laptop soon. Although Dscheme would be better for a beginnner like me, I'm using mzscheme with Quack mode (which's really nice btw) because i've always wanted to learn to use emacs and figured this was a good oportunity to do so. also, my name isn't Charlie, I created this email id around a year ago to check how good Gmail was :) ( I was using hotmail back then) and this account just stayed like that. On 11/13/09, Neil Van Dyke wrote: > > I'm guessing that you'd benefit from running DrScheme rather than just the > "mzscheme" command-line tool. > > Are you sure that the machine at school has 218MB total? A more typical > number near there would be 256MB total, or maybe 248MB total plus 8MB video > RAM. > > In any case, you should be able to run DrScheme in 200-some total MB > reasonably if you strip down the rest of your desktop software. If you > don't have lots more RAM than you need, you want to be running just a plain > X window manager, like Fvwm, not the ridiculously bloated Gnome. > > With 200-some MB, if you start up Firefox to read documentation online > while running DrScheme, things will get a lot slower, as the computer's > virtual memory system temporarily swaps pieces of DrScheme and Firefox onto > disk. The solution > > Also, see whether you can beg or borrow an old laptop you can use for your > work, and whether the computers at school will accommodate more memory. (A > 512MB stick of PC133 is about $10.) Being able to run both DrScheme and a > semi-modern Web browser at the same time will help you work/learn faster. > > -- > http://www.neilvandyke.org/ > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091116/f1c45d94/attachment.htm From charliesmith001 at gmail.com Mon Nov 16 05:29:00 2009 From: charliesmith001 at gmail.com (Charlie Smith) Date: Mon Nov 16 05:29:18 2009 Subject: [plt-scheme] installation problems In-Reply-To: References: <19197.3959.112490.800760@winooski.ccs.neu.edu> Message-ID: Thanks for that tip, i'm still getting my feet wet with linux, but so far i really like it for working with scheme and c files. On 11/13/09, Noel Welsh wrote: > > On Fri, Nov 13, 2009 at 7:56 AM, Charlie Smith > wrote: > > the computers my school has are pretty bad, has only 218mb RAM and is > quite > > old (8 years i think ), i'm not sure of the version of Redhat its using > but > > i'll try and download other linux binaries or build from source > > > You can get a bit more information about your machine using the uname > command. For example, on my machine: > > ~> uname -a > Linux hpc-005 2.6.18-164.2.1.el5 #1 SMP Wed Sep 30 12:55:19 EDT 2009 > i686 i686 i386 GNU/Linux > > This tells me I'm running kernel version 2.6.18 (along with a bunch of > other stuff that is mostly irrelevant). > > If you look at the files /proc/cpuinfo and /proc/meminfo you'll get > info on the CPU and installed memory. > > HTH, > > N. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091116/2696c626/attachment.htm From sk at cs.brown.edu Mon Nov 16 08:05:56 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Mon Nov 16 08:06:36 2009 Subject: [plt-scheme] Alpha-beta pruning In-Reply-To: <1ab9a21f0911152002x7c2eca03x910cf5f3a88b7129@mail.gmail.com> References: <1ab9a21f0911140900w2c6c574bgf3c3c193178c1348@mail.gmail.com> <1ab9a21f0911142025n42d2819ao4a9220543b5d904a@mail.gmail.com> <1ab9a21f0911150801i37a7a10fm20bc158c21a37e01@mail.gmail.com> <1ab9a21f0911152002x7c2eca03x910cf5f3a88b7129@mail.gmail.com> Message-ID: You clearly have some type confusion, given that the algorithm on paper and the algorithm in your program have different type representations. Without any form of documentation of this, it's not surprising that you can't find the mismatch. Can you at least determine the mapping of the types in the algorithm to the types in your program? On Sun, Nov 15, 2009 at 11:02 PM, G G wrote: > Well I guess yes. > > On Sun, Nov 15, 2009 at 9:38 PM, Shriram Krishnamurthi > wrote: >> >> Does your course prof not require you to write ANY data definitions, >> templates, etc.? ?You're allowed to turn in ONLY code and they give >> you a full grade? >> >> Shriram >> >> On Sun, Nov 15, 2009 at 11:01 AM, G G wrote: >> > Well I can attach the full .ss file here >> > >> > On Sun, Nov 15, 2009 at 4:48 PM, Shriram Krishnamurthi >> > wrote: >> >> >> >> I assume G forgot to reply to the list, so I'm taking the liberty of >> >> replying there. >> >> >> >> I'll point out that this code still has no data definitions, examples >> >> of data, test cases, etc. >> >> >> >> S. >> >> >> >> On Sat, Nov 14, 2009 at 11:25 PM, G G wrote: >> >> > This is the orignal Minimax that I am trying to add Alpha-beta on >> >> > >> >> > >> >> > (define minimax >> >> > ? (lambda (b player moves max-depth heuristic-function) >> >> > ??? (define max/min >> >> > ????? (lambda (player) >> >> > ??????? (if (eq? player 'W) max min))) >> >> > ??? (define minimax-move >> >> > ????? (lambda (b player max-depth move) >> >> > ??????? (minimax/depth >> >> > ????????? (apply-move b player move) >> >> > ????????? (opponent player) >> >> > ????????? (- max-depth 1)))) >> >> > ??? (define minimax/depth >> >> > ????? (lambda (b player max-depth) >> >> > ??????? (if (= max-depth 0) >> >> > ??????????? (heuristic-function b) >> >> > ??????????? (let ([moves (possible-moves b player)]) >> >> > ????????????? (if (null? moves) >> >> > ????????????????? (minimax/depth b (opponent player) (- max-depth 1)) >> >> > ????????????????? (let ([scores >> >> > ???????????????????????? (map (lambda (move) >> >> > ??????????????????????????????? (minimax-move b player max-depth >> >> > move)) >> >> > ????????????????????????????? moves)]) >> >> > ??????????????????? (apply (max/min player) scores))))))) >> >> > ??? (let ([scores >> >> > ?????????? (map (lambda (move) (minimax-move b player max-depth >> >> > move)) >> >> > ??????????????? moves)]) >> >> > ????? (let ([best (apply (max/min player) scores)]) >> >> > ??????? (let loop ([moves moves] [scores scores]) >> >> > ????????? (if (= (car scores) best) >> >> > ????????????? (car moves) >> >> > ????????????? (loop (cdr moves) (cdr scores)))))))) >> >> > >> >> > >> >> > And I used the algorithm but i didnt know how to do these >> >> > >> >> > S ? Successors(n) >> >> > >> >> > best ? ?? >> >> >> for all ni ? S do >> >> >> ? v ? ???(ni, d ? 1, ??, ?max(?, best)) >> >> > >> >> > >> >> > Thanks a lot, >> >> > G >> >> > >> >> > On Sat, Nov 14, 2009 at 9:36 PM, Shriram Krishnamurthi >> >> > >> >> > wrote: >> >> >> >> >> >> Sure, we'd be happy to help. ?Where are your data definitions, >> >> >> examples of data, and test cases? >> >> >> >> >> >> Shriram >> >> >> >> >> >> On Sat, Nov 14, 2009 at 12:00 PM, G G wrote: >> >> >> > I am trying to implement the alpha beta pruning but with no luck >> >> >> > can >> >> >> > anyone >> >> >> > help me with how it works I am trying to use this Algorithm >> >> >> > >> >> >> > ??(n, d, ?, ?) >> >> >> > S ? Successors(n) >> >> >> > if d ? 0 ? S ? ? then >> >> >> > return f(n) >> >> >> > best ? ?? >> >> >> > for all ni ? S do >> >> >> > ? v ? ???(ni, d ? 1, ??, ?max(?, best)) >> >> >> > ?? if?? ?v > best?? ?then >> >> >> > ??? best ? v if?? ?best ? ??? ?then >> >> >> > ????? return best >> >> >> > return best >> >> >> > >> >> >> > >> >> >> > Best regards, >> >> >> > G >> >> >> > >> >> >> > _________________________________________________ >> >> >> > ?For list-related administrative tasks: >> >> >> > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> >> > >> >> >> > >> >> > >> >> > >> > >> > >> > _________________________________________________ >> > ?For list-related administrative tasks: >> > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > >> > > > From preen at informatik.uni-freiburg.de Mon Nov 16 10:41:17 2009 From: preen at informatik.uni-freiburg.de (Martin Preen) Date: Mon Nov 16 10:41:45 2009 Subject: [plt-scheme] Compiling PLT scheme on Solaris In-Reply-To: <4ADD9D40.5070300@informatik.uni-freiburg.de> References: <4ADD9D40.5070300@informatik.uni-freiburg.de> Message-ID: <4B01729D.2010909@informatik.uni-freiburg.de> Hi, I solved this by disabling large file support for the Solaris build. Is this a problem ? Is there any component requiring large file support ? Greetings. Martin Preen P.S.: Additionally I applied a patch from another thread (scheme_can_inline_fp_comp/scheme_can_inline_fp_op). Martin Preen wrote: > Hi, > we have a problem compiling PLT scheme 4.2.2 on Solaris 10. > Compiler ist gcc 4.2.2. It looks like a problem with large file > support and/or the procfs interface: > > ... > gcc -I./include -DNO_SIGNALS -g -O2 -Wall -D_LARGEFILE_SOURCE > -D_FILE_OFFSET_BITS=64 -DNO_EXECUTE_PERMISSION -DSILENT -DNO_GETENV > -DLARGE_CONFIG -DATOMIC_UNCOLLECTABLE -DINITIAL_MARK_STACK_SIZE=8192 -c > ./os_dep.c > In file included from /usr/include/sys/procfs.h:29, > from ./os_dep.c:3078: > /usr/include/sys/old_procfs.h:39:2: error: #error "Cannot use procfs in > the large file compilation environment" > ./os_dep.c: In function 'GC_dirty_init': > ./os_dep.c:3129: warning: format '%d' expects type 'int', but argument 3 > has type 'pid_t' > ./os_dep.c: In function 'GC_read_dirty': > ./os_dep.c:3176: warning: unused variable 'dummy' > ./os_dep.c: In function 'GC_is_fresh': > ./os_dep.c:3294: warning: unused variable 'index' > ... > > Is there some workaround for this ? --------------------------------------------------------------- Martin Preen, Universit?t Freiburg, Institut f?r Informatik Georges-Koehler-Allee 52, Raum EG-006, 79110 Freiburg, Germany phone: ++49 761 203-8250 preen@informatik.uni-freiburg.de fax: ++49 761 203-8242 www.informatik.uni-freiburg.de From krhari at ccs.neu.edu Mon Nov 16 10:52:56 2009 From: krhari at ccs.neu.edu (Hari Prashanth K R) Date: Mon Nov 16 10:53:20 2009 Subject: [plt-scheme] Alpha-beta pruning In-Reply-To: Message-ID: <25305509.364951258386776035.JavaMail.root@zimbra> Well, then the simplest way to get the solution right and to debug your code would be to come up with examples and turn them into test cases(for each function if required)... I this way when a test fails you will know where the problem is and one can easily help you there... Without that it would be difficult I suppose... It might take you a little more time to come up with test cases than to just start coding but the practice would definitely help you in a long run... And if you have comments in the code, it would help people to understand your code and also its a better practice... ----- Original Message ----- From: "Shriram Krishnamurthi" To: "G G" Cc: "PLT Scheme" Sent: Monday, November 16, 2009 8:05:56 AM GMT -05:00 US/Canada Eastern Subject: Re: [plt-scheme] Alpha-beta pruning You clearly have some type confusion, given that the algorithm on paper and the algorithm in your program have different type representations. Without any form of documentation of this, it's not surprising that you can't find the mismatch. Can you at least determine the mapping of the types in the algorithm to the types in your program? On Sun, Nov 15, 2009 at 11:02 PM, G G wrote: > Well I guess yes. > > On Sun, Nov 15, 2009 at 9:38 PM, Shriram Krishnamurthi > wrote: >> >> Does your course prof not require you to write ANY data definitions, >> templates, etc.? ?You're allowed to turn in ONLY code and they give >> you a full grade? >> >> Shriram >> >> On Sun, Nov 15, 2009 at 11:01 AM, G G wrote: >> > Well I can attach the full .ss file here >> > >> > On Sun, Nov 15, 2009 at 4:48 PM, Shriram Krishnamurthi >> > wrote: >> >> >> >> I assume G forgot to reply to the list, so I'm taking the liberty of >> >> replying there. >> >> >> >> I'll point out that this code still has no data definitions, examples >> >> of data, test cases, etc. >> >> >> >> S. >> >> >> >> On Sat, Nov 14, 2009 at 11:25 PM, G G wrote: >> >> > This is the orignal Minimax that I am trying to add Alpha-beta on >> >> > >> >> > >> >> > (define minimax >> >> > ? (lambda (b player moves max-depth heuristic-function) >> >> > ??? (define max/min >> >> > ????? (lambda (player) >> >> > ??????? (if (eq? player 'W) max min))) >> >> > ??? (define minimax-move >> >> > ????? (lambda (b player max-depth move) >> >> > ??????? (minimax/depth >> >> > ????????? (apply-move b player move) >> >> > ????????? (opponent player) >> >> > ????????? (- max-depth 1)))) >> >> > ??? (define minimax/depth >> >> > ????? (lambda (b player max-depth) >> >> > ??????? (if (= max-depth 0) >> >> > ??????????? (heuristic-function b) >> >> > ??????????? (let ([moves (possible-moves b player)]) >> >> > ????????????? (if (null? moves) >> >> > ????????????????? (minimax/depth b (opponent player) (- max-depth 1)) >> >> > ????????????????? (let ([scores >> >> > ???????????????????????? (map (lambda (move) >> >> > ??????????????????????????????? (minimax-move b player max-depth >> >> > move)) >> >> > ????????????????????????????? moves)]) >> >> > ??????????????????? (apply (max/min player) scores))))))) >> >> > ??? (let ([scores >> >> > ?????????? (map (lambda (move) (minimax-move b player max-depth >> >> > move)) >> >> > ??????????????? moves)]) >> >> > ????? (let ([best (apply (max/min player) scores)]) >> >> > ??????? (let loop ([moves moves] [scores scores]) >> >> > ????????? (if (= (car scores) best) >> >> > ????????????? (car moves) >> >> > ????????????? (loop (cdr moves) (cdr scores)))))))) >> >> > >> >> > >> >> > And I used the algorithm but i didnt know how to do these >> >> > >> >> > S ? Successors(n) >> >> > >> >> > best ? ?? >> >> >> for all ni ? S do >> >> >> ? v ? ???(ni, d ? 1, ??, ?max(?, best)) >> >> > >> >> > >> >> > Thanks a lot, >> >> > G >> >> > >> >> > On Sat, Nov 14, 2009 at 9:36 PM, Shriram Krishnamurthi >> >> > >> >> > wrote: >> >> >> >> >> >> Sure, we'd be happy to help. ?Where are your data definitions, >> >> >> examples of data, and test cases? >> >> >> >> >> >> Shriram >> >> >> >> >> >> On Sat, Nov 14, 2009 at 12:00 PM, G G wrote: >> >> >> > I am trying to implement the alpha beta pruning but with no luck >> >> >> > can >> >> >> > anyone >> >> >> > help me with how it works I am trying to use this Algorithm >> >> >> > >> >> >> > ??(n, d, ?, ?) >> >> >> > S ? Successors(n) >> >> >> > if d ? 0 ? S ? ? then >> >> >> > return f(n) >> >> >> > best ? ?? >> >> >> > for all ni ? S do >> >> >> > ? v ? ???(ni, d ? 1, ??, ?max(?, best)) >> >> >> > ?? if?? ?v > best?? ?then >> >> >> > ??? best ? v if?? ?best ? ??? ?then >> >> >> > ????? return best >> >> >> > return best >> >> >> > >> >> >> > >> >> >> > Best regards, >> >> >> > G >> >> >> > >> >> >> > _________________________________________________ >> >> >> > ?For list-related administrative tasks: >> >> >> > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> >> > >> >> >> > >> >> > >> >> > >> > >> > >> > _________________________________________________ >> > ?For list-related administrative tasks: >> > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > >> > > > _________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-scheme From nothere44 at gmail.com Mon Nov 16 12:32:18 2009 From: nothere44 at gmail.com (N N) Date: Mon Nov 16 12:32:36 2009 Subject: [plt-scheme] Weird timeouts in web-server Message-ID: <7478a1340911160932y69e01d79ie98b57c05fcc4895@mail.gmail.com> With initial-connection-timeout set to 300 (5 minutes) I'm still getting some deaths due to timeouts, and am at a loss. I've hunted through server code to try to figure out what is going on, but not with much success. Here is what is happening: I navigate to a page with a form. I click on submit for that form and it's intercepted by JavaScript to send off to the server in the background a la AJAX and displays the results when they return. Now, I would expect that this background submission has the full 5 minutes to complete (and if the time is exceeded, it seems from my tests with a 30-second timeout to retry the request once with the new connection and full timeout: if you could point me to where the logic that does this is I'd be grateful). However, in practice it is at times ended much more quickly (54 and 27 seconds seem the norm) and continues to die to timeouts in the same timespan when resubmitted (which seems to me to indicate the time is captured in the k-url of the form's action in some way, except that the kill-time is stored as an absolute not an offset). (It shouldn't matter, but we are using our own LRU continuation manager that only differs in that not at maximum memory continuations only live for 10 minutes and at maximum 2 minutes.) Any insights are appreciated, ~NT -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091116/2b2aefb9/attachment.htm From nothere44 at gmail.com Mon Nov 16 14:56:30 2009 From: nothere44 at gmail.com (N N) Date: Mon Nov 16 14:56:49 2009 Subject: [plt-scheme] Debugging library code Message-ID: <7478a1340911161156i1198b6d1i4ea82424af7392f8@mail.gmail.com> Is there a way to debug library code sanely? I tried doing it in DrScheme (which I don't generally use) but found that opening files from the collects directory under the install and setting breakpoints in them doesn't work: it seems DrScheme won't hit breakpoints in a .ss file if it's actually reading from a compiled library file. How can I do this? Thanks, ~NT -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091116/68bc71c7/attachment.htm From nothere44 at gmail.com Mon Nov 16 16:54:05 2009 From: nothere44 at gmail.com (N N) Date: Mon Nov 16 16:54:44 2009 Subject: [plt-scheme] Re: Weird timeouts in web-server In-Reply-To: <7478a1340911160932y69e01d79ie98b57c05fcc4895@mail.gmail.com> References: <7478a1340911160932y69e01d79ie98b57c05fcc4895@mail.gmail.com> Message-ID: <7478a1340911161354u395c9a75nd645fed4415fb431@mail.gmail.com> I solved my own problem. Here's what caused it: web-server/http/request.ss, line 39. This is in the function read-request. When it reads a POST request, it changes the timeout of whatever connection the request was sent over to be Content Length seconds later. I'm not sure when it makes sense to do this, but in my case with a very short request (Like doit="Go") calling an expensive operation this caused it to timeout. I've now copied web-server code to a personal collection where I just commented this line out. ~NT On Mon, Nov 16, 2009 at 12:32 PM, N N wrote: > With initial-connection-timeout set to 300 (5 minutes) I'm still getting > some deaths due to timeouts, and am at a loss. I've hunted through > server code to try to figure out what is going on, but not with much > success. Here is what is happening: I navigate to a page with a form. > I click on submit for that form and it's intercepted by JavaScript to > send off to the server in the background a la AJAX and displays the > results when they return. Now, I would expect that this background > submission has the full 5 minutes to complete (and if the time is > exceeded, it seems from my tests with a 30-second timeout to retry the > request once with the new connection and full timeout: if you could > point me to where the logic that does this is I'd be grateful). > However, in practice it is at times ended much more quickly (54 and 27 > seconds seem the norm) and continues to die to timeouts in the same > timespan when resubmitted (which seems to me to indicate the time is > captured in the k-url of the form's action in some way, except that > the kill-time is stored as an absolute not an offset). > > (It shouldn't matter, but we are using our own LRU continuation > manager that only differs in that not at maximum memory continuations > only live for 10 minutes and at maximum 2 minutes.) > > Any insights are appreciated, > ~NT > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091116/653c97eb/attachment.htm From jay.mccarthy at gmail.com Mon Nov 16 17:08:09 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Mon Nov 16 17:08:30 2009 Subject: [plt-scheme] Re: Weird timeouts in web-server In-Reply-To: <7478a1340911161354u395c9a75nd645fed4415fb431@mail.gmail.com> References: <7478a1340911160932y69e01d79ie98b57c05fcc4895@mail.gmail.com> <7478a1340911161354u395c9a75nd645fed4415fb431@mail.gmail.com> Message-ID: I've updated this to INCREMENT the timeout, rather than RESET it. Jay On Mon, Nov 16, 2009 at 2:54 PM, N N wrote: > I solved my own problem. ?Here's what caused it: > web-server/http/request.ss, line 39. ?This is in the function read-request. > ?When it reads a POST request, it changes the timeout of whatever connection > the request was sent over to be Content Length seconds later. ?I'm not sure > when it makes sense to do this, but in my case with a very short request > (Like doit="Go") calling an expensive operation this caused it to timeout. > ?I've now copied web-server code to a personal collection where I just > commented this line out. > > ~NT > On Mon, Nov 16, 2009 at 12:32 PM, N N wrote: >> >> With?initial-connection-timeout set to 300 (5 minutes) I'm still getting >> some deaths due to timeouts, and am at a loss. ?I've hunted through >> server code to try to figure out what is going on, but not with much >> success. ?Here is what is happening: I navigate to a page with a form. >> ?I click on submit for that form and it's intercepted by JavaScript to >> send off to the server in the background a la AJAX and displays the >> results when they return. ?Now, I would expect that this background >> submission has the full 5 minutes to complete (and if the time is >> exceeded, it seems from my tests with a 30-second timeout to retry the >> request once with the new connection and full timeout: if you could >> point me to where the logic that does this is I'd be grateful). >> However, in practice it is at times ended much more quickly (54 and 27 >> seconds seem the norm) and continues to die to timeouts in the same >> timespan when resubmitted (which seems to me to indicate the time is >> captured in the k-url of the form's action in some way, except that >> the kill-time is stored as an absolute not an offset). >> >> (It shouldn't matter, but we are using our own LRU continuation >> manager that only differs in that not at maximum memory continuations >> only live for 10 minutes and at maximum 2 minutes.) >> Any insights are appreciated, >> ~NT > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From toddobryan at gmail.com Mon Nov 16 20:24:47 2009 From: toddobryan at gmail.com (Todd O'Bryan) Date: Mon Nov 16 20:25:08 2009 Subject: [plt-scheme] 2htdp/image In-Reply-To: <932b2f1f0910131606n7f356cbcvfaf80896ffb2ed1b@mail.gmail.com> References: <932b2f1f0910131606n7f356cbcvfaf80896ffb2ed1b@mail.gmail.com> Message-ID: <904774730911161724y7697e5d8rdd77324607e0258f@mail.gmail.com> Robby, I just started looking at the new image2e teachpack and it looks great. The extra triangles, polygons, etc. are especially welcome. However, is there any reason you set out to break backwards compatibility? For example, the new overlay method draws front to back whereas the old one did back to front. The new one also lines pictures up on the top right corner whereas the old one used pinholes, which for most images were in the center. Having the new versions of overlay and overlay/xy do roughly what the old ones did seems like it would make adoption fairly painless, so if they could default to back to front and line up on centers, I'd be really happy. Ditto with beside and above--any way those could default to use centers, since that's often the most reasonable way to line up images? Then beside-places and above-places would be available for other choices. I'm also missing image->color-list, color-list->image, image->alpha-color-list, and alpha-color-list->image. Were you planning to add them or no? Since we'll be using images before we've gotten to polymorphic functions, can you provide image=? and image=~? so students don't get a whiff of equal? and equal~? before they should? Finally, there are a few functions that Stephen Bloch's tiles teachpack provides that would be nice: rotate-cw rotate-ccw rotate-180 (these are nice because students can flip things around before knowing how to use any kinds of arguments other than images) reflect-vert reflect-horiz reflect-main-diag reflect-other-diag (I don't think you have reflection in there, yet) crop-top crop-bottom crop-left crop-right (really nice for cutting off parts and putting back together) Obviously, some of these are pretty easy and I'd be happy to send in a patch if you give your blessing. Others, like the ->color-list and crop- functions are more work, so you'll need to decide if you think they're useful. Todd On Tue, Oct 13, 2009 at 6:06 PM, Robby Findler wrote: > The new HtDP 2e image library is ready for earlier adopters. It isn't > part of the release that recently went out, but it is available in the > SVN build of DrScheme (and will be available tomorrow in the nightly > builds). At the moment, it contains only some basic image operations, > but I expect to be adding more over the coming weeks. Let me know if > there are particular operations that you'd like me to get to first. > > Here's a quick list of the differences between this and the current > image teachpack: > > ?- copying and pasting does not introduce jaggies > ?- equal comparisions are more efficient > ?- added rotation & scaling > ?- got rid of pinholes (see the new overlay, beside, etc functions) > > All of the currently implemented functionality is documented here: > > ?http://pre.plt-scheme.org/docs/html/teachpack/2htdpimage.html > > Thanks, > Robby > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From robby at eecs.northwestern.edu Mon Nov 16 20:47:58 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Mon Nov 16 20:48:19 2009 Subject: [plt-scheme] 2htdp/image In-Reply-To: <904774730911161724y7697e5d8rdd77324607e0258f@mail.gmail.com> References: <932b2f1f0910131606n7f356cbcvfaf80896ffb2ed1b@mail.gmail.com> <904774730911161724y7697e5d8rdd77324607e0258f@mail.gmail.com> Message-ID: <932b2f1f0911161747s70c9fdc6x900f6dc39be3fa04@mail.gmail.com> On Mon, Nov 16, 2009 at 7:24 PM, Todd O'Bryan wrote: > Robby, > > I just started looking at the new image2e teachpack and it looks > great. The extra triangles, polygons, etc. are especially welcome. > > However, is there any reason you set out to break backwards compatibility? > > For example, the new overlay method draws front to back whereas the > old one did back to front. This was an often requested change. So was the lack of pinholes. > The new one also lines pictures up on the > top right corner whereas the old one used pinholes, which for most > images were in the center. Having the new versions of overlay and > overlay/xy do roughly what the old ones did seems like it would make > adoption fairly painless, so if they could default to back to front > and line up on centers, I'd be really happy. Lining up on the upper-left was the "default" for scenes, which is why I did it that way. Have you tried porting any of the old code to compare what is really better? > Ditto with beside and above--any way those could default to use > centers, since that's often the most reasonable way to line up images? > Then beside-places and above-places would be available for other > choices. > > I'm also missing image->color-list, color-list->image, > image->alpha-color-list, and alpha-color-list->image. Were you > planning to add them or no? It isn't possible to write color-list->image anymore, but I was planning to add color-list->bitmap and image->color-list eventually, yes. > Since we'll be using images before we've gotten to polymorphic > functions, can you provide image=? and image=~? so students don't get > a whiff of equal? and equal~? before they should? Sure. I can make image=? work on the new library (and add image=~? if it isn't there). > Finally, there are a few functions that Stephen Bloch's tiles > teachpack provides that would be nice: > > rotate-cw > rotate-ccw > rotate-180 > ?(these are nice because students can flip things around before > knowing how to use any kinds of arguments other than images) I'm not a big fan of the first two names there, since they seem like they should take other arguments (cw and ccw sound like directions, not amounts). Any other suggestions? > reflect-vert > reflect-horiz > reflect-main-diag > reflect-other-diag > ?(I don't think you have reflection in there, yet) I do plan to add reflection. > crop-top > crop-bottom > crop-left > crop-right > ?(really nice for cutting off parts and putting back together) These are not easy. Specifically, handling cropping is easy in the old library (which is what Bloch's library builds on) but in the current one you have to consider equality and cropping makes that tricky (the set of images you can make is not closed under cropping). So I had not planned to add them. Robby From nadeem at acm.org Mon Nov 16 20:58:13 2009 From: nadeem at acm.org (Nadeem Abdul Hamid) Date: Mon Nov 16 20:58:33 2009 Subject: [plt-scheme] 2htdp/image In-Reply-To: <932b2f1f0911161747s70c9fdc6x900f6dc39be3fa04@mail.gmail.com> References: <932b2f1f0910131606n7f356cbcvfaf80896ffb2ed1b@mail.gmail.com> <904774730911161724y7697e5d8rdd77324607e0258f@mail.gmail.com> <932b2f1f0911161747s70c9fdc6x900f6dc39be3fa04@mail.gmail.com> Message-ID: On Nov 16, 2009, at 8:47 PM, Robby Findler wrote: >> > It isn't possible to write color-list->image anymore, but I was > planning to add color-list->bitmap and image->color-list eventually, > yes. image->color-list and color-list->image are really useful for exercises like "negative-image" that get students to apply some function to a list of color structures and then see the effect. (It's the kind of thing the "media computation" folks get excited about.) What's the connection between bitmap and image? --- nadeem -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091116/195070ad/attachment.htm From robby at eecs.northwestern.edu Mon Nov 16 21:03:22 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Mon Nov 16 21:03:40 2009 Subject: [plt-scheme] 2htdp/image In-Reply-To: References: <932b2f1f0910131606n7f356cbcvfaf80896ffb2ed1b@mail.gmail.com> <904774730911161724y7697e5d8rdd77324607e0258f@mail.gmail.com> <932b2f1f0911161747s70c9fdc6x900f6dc39be3fa04@mail.gmail.com> Message-ID: <932b2f1f0911161803o3565bb20m300b6c20aca24b46@mail.gmail.com> On Mon, Nov 16, 2009 at 7:58 PM, Nadeem Abdul Hamid wrote: > On Nov 16, 2009, at 8:47 PM, Robby Findler wrote: > > It isn't possible to write color-list->image anymore, but I was > planning to add color-list->bitmap and image->color-list eventually, > yes. > > > image->color-list and color-list->image are really useful for exercises like > "negative-image" that get students to apply some function to a list of color > structures and then see the effect. (It's the kind of thing the "media > computation" folks get excited about.) > What's the connection between bitmap and image? In the old library, images were bitmaps (essentially, with some optimizations). This led to some performance problems, esp. on older machines, so in the new library, images are roughly trees of overlaid images with polygons, ellipses, text, and bitmaps at the leaves. So, if I have a collection of colors, I can make a bitmap but not figure out what the tree would have been. You'll be able to see the difference if you rotate or (especially) scale the image. If it is a tree of overlaid polygons, say, then scaling will work perfectly, but the bitmap scaling won't look as good. Robby From toddobryan at gmail.com Mon Nov 16 21:09:45 2009 From: toddobryan at gmail.com (Todd O'Bryan) Date: Mon Nov 16 21:10:05 2009 Subject: [plt-scheme] 2htdp/image In-Reply-To: <932b2f1f0911161803o3565bb20m300b6c20aca24b46@mail.gmail.com> References: <932b2f1f0910131606n7f356cbcvfaf80896ffb2ed1b@mail.gmail.com> <904774730911161724y7697e5d8rdd77324607e0258f@mail.gmail.com> <932b2f1f0911161747s70c9fdc6x900f6dc39be3fa04@mail.gmail.com> <932b2f1f0911161803o3565bb20m300b6c20aca24b46@mail.gmail.com> Message-ID: <904774730911161809h726fde11o353918a7446f13b7@mail.gmail.com> On Mon, Nov 16, 2009 at 9:03 PM, Robby Findler wrote: > On Mon, Nov 16, 2009 at 7:58 PM, Nadeem Abdul Hamid wrote: >> What's the connection between bitmap and image? > > In the old library, images were bitmaps (essentially, with some > optimizations). This led to some performance problems, esp. on older > machines, so in the new library, images are roughly trees of overlaid > images with polygons, ellipses, text, and bitmaps at the leaves. > > So, if I have a collection of colors, I can make a bitmap but not > figure out what the tree would have been. You'll be able to see the > difference if you rotate or (especially) scale the image. If it is a > tree of overlaid polygons, say, then scaling will work perfectly, but > the bitmap scaling won't look as good. > So images from pasting or Insert Image... won't actually be images anymore, but will be bitmaps? In that case, do we need bitmap=? or something like that so we can compare bitmaps to one another? And will you be able to add-line to a bitmap or overlay images on top of bitmaps, etc.? This scares me a little. I understand the motivation, but I'm worried that teaching the difference between images and bitmaps may be a bigger pain than pinholes were. :-) Any way to hide the difference from the user so that we get the speed-up where possible, but the expected semantics where we can't do any better? Todd From robby at eecs.northwestern.edu Mon Nov 16 21:12:21 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Mon Nov 16 21:12:39 2009 Subject: [plt-scheme] 2htdp/image In-Reply-To: <904774730911161809h726fde11o353918a7446f13b7@mail.gmail.com> References: <932b2f1f0910131606n7f356cbcvfaf80896ffb2ed1b@mail.gmail.com> <904774730911161724y7697e5d8rdd77324607e0258f@mail.gmail.com> <932b2f1f0911161747s70c9fdc6x900f6dc39be3fa04@mail.gmail.com> <932b2f1f0911161803o3565bb20m300b6c20aca24b46@mail.gmail.com> <904774730911161809h726fde11o353918a7446f13b7@mail.gmail.com> Message-ID: <932b2f1f0911161812i1b73e85j19af81472592e6a5@mail.gmail.com> On Mon, Nov 16, 2009 at 8:09 PM, Todd O'Bryan wrote: > On Mon, Nov 16, 2009 at 9:03 PM, Robby Findler > wrote: >> On Mon, Nov 16, 2009 at 7:58 PM, Nadeem Abdul Hamid wrote: >>> What's the connection between bitmap and image? >> >> In the old library, images were bitmaps (essentially, with some >> optimizations). This led to some performance problems, esp. on older >> machines, so in the new library, images are roughly trees of overlaid >> images with polygons, ellipses, text, and bitmaps at the leaves. >> >> So, if I have a collection of colors, I can make a bitmap but not >> figure out what the tree would have been. You'll be able to see the >> difference if you rotate or (especially) scale the image. If it is a >> tree of overlaid polygons, say, then scaling will work perfectly, but >> the bitmap scaling won't look as good. >> > So images from pasting or Insert Image... won't actually be images > anymore, but will be bitmaps? All bitmaps are images. > In that case, do we need bitmap=? or something like that so we can > compare bitmaps to one another? > > And will you be able to add-line to a bitmap or overlay images on top > of bitmaps, etc.? > > This scares me a little. I understand the motivation, but I'm worried > that teaching the difference between images and bitmaps may be a > bigger pain than pinholes were. :-) Any way to hide the difference > from the user so that we get the speed-up where possible, but the > expected semantics where we can't do any better? That requires someone better/smarter than me to figure out. Robby From toddobryan at gmail.com Mon Nov 16 21:28:05 2009 From: toddobryan at gmail.com (Todd O'Bryan) Date: Mon Nov 16 21:28:22 2009 Subject: [plt-scheme] 2htdp/image In-Reply-To: <932b2f1f0911161812i1b73e85j19af81472592e6a5@mail.gmail.com> References: <932b2f1f0910131606n7f356cbcvfaf80896ffb2ed1b@mail.gmail.com> <904774730911161724y7697e5d8rdd77324607e0258f@mail.gmail.com> <932b2f1f0911161747s70c9fdc6x900f6dc39be3fa04@mail.gmail.com> <932b2f1f0911161803o3565bb20m300b6c20aca24b46@mail.gmail.com> <904774730911161809h726fde11o353918a7446f13b7@mail.gmail.com> <932b2f1f0911161812i1b73e85j19af81472592e6a5@mail.gmail.com> Message-ID: <904774730911161828m6ca01823p83cacdb162c88026@mail.gmail.com> On Mon, Nov 16, 2009 at 9:12 PM, Robby Findler wrote: > On Mon, Nov 16, 2009 at 8:09 PM, Todd O'Bryan wrote: >> On Mon, Nov 16, 2009 at 9:03 PM, Robby Findler >> wrote: >>> On Mon, Nov 16, 2009 at 7:58 PM, Nadeem Abdul Hamid wrote: >>>> What's the connection between bitmap and image? >>> >>> In the old library, images were bitmaps (essentially, with some >>> optimizations). This led to some performance problems, esp. on older >>> machines, so in the new library, images are roughly trees of overlaid >>> images with polygons, ellipses, text, and bitmaps at the leaves. >>> >>> So, if I have a collection of colors, I can make a bitmap but not >>> figure out what the tree would have been. You'll be able to see the >>> difference if you rotate or (especially) scale the image. If it is a >>> tree of overlaid polygons, say, then scaling will work perfectly, but >>> the bitmap scaling won't look as good. >>> >> So images from pasting or Insert Image... won't actually be images >> anymore, but will be bitmaps? > > All bitmaps are images. > >> In that case, do we need bitmap=? or something like that so we can >> compare bitmaps to one another? >> >> And will you be able to add-line to a bitmap or overlay images on top >> of bitmaps, etc.? >> >> This scares me a little. I understand the motivation, but I'm worried >> that teaching the difference between images and bitmaps may be a >> bigger pain than pinholes were. :-) Any way to hide the difference >> from the user so that we get the speed-up where possible, but the >> expected semantics where we can't do any better? > > That requires someone better/smarter than me to figure out. I think I'm confused. If all bitmaps are images, but equality is done cleverly, what will happen if you do (equal? (overlay BITMAP (line 20 30 "black")) (add-line BITMAP 0 0 20 30 "black")) And if you have to handle bitmaps anyway, how is color-list->image or any of the crop functions any more problematic? In other words, suppose I make an image in DrScheme and save it as a PNG. When I read it back in, I've lost all the image-y information, so is it only equal to another bitmap that's pixel-identical, but not to an image that's pixel-identical (say the one I saved)? Sorry to be dense, but I'm just trying to understand how this is going to work when you start mixing user-created images and images loaded from outside the environment. Todd From carl.eastlund at gmail.com Mon Nov 16 21:34:38 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Mon Nov 16 21:42:18 2009 Subject: [plt-scheme] 2htdp/image In-Reply-To: <904774730911161828m6ca01823p83cacdb162c88026@mail.gmail.com> References: <932b2f1f0910131606n7f356cbcvfaf80896ffb2ed1b@mail.gmail.com> <904774730911161724y7697e5d8rdd77324607e0258f@mail.gmail.com> <932b2f1f0911161747s70c9fdc6x900f6dc39be3fa04@mail.gmail.com> <932b2f1f0911161803o3565bb20m300b6c20aca24b46@mail.gmail.com> <904774730911161809h726fde11o353918a7446f13b7@mail.gmail.com> <932b2f1f0911161812i1b73e85j19af81472592e6a5@mail.gmail.com> <904774730911161828m6ca01823p83cacdb162c88026@mail.gmail.com> Message-ID: <990e0c030911161834j22d94793la7b34297824d1aed@mail.gmail.com> On Mon, Nov 16, 2009 at 9:28 PM, Todd O'Bryan wrote: > > I think I'm confused. If all bitmaps are images, but equality is done > cleverly, what will happen if you do > > (equal? (overlay BITMAP (line 20 30 "black")) > ? ? ? ?(add-line BITMAP 0 0 20 30 "black")) > > And if you have to handle bitmaps anyway, how is color-list->image or > any of the crop functions any more problematic? > > In other words, suppose I make an image in DrScheme and save it as a > PNG. When I read it back in, I've lost all the image-y information, so > is it only equal to another bitmap that's pixel-identical, but not to > an image that's pixel-identical (say the one I saved)? > > Sorry to be dense, but I'm just trying to understand how this is going > to work when you start mixing user-created images and images loaded > from outside the environment. > > Todd Todd, There are a lot of images that are pixel-wise equal in this system, but not image-equal, even without resorting to bitmaps. Two images that are equal are guaranteed to continue to be equal after applying (the same) scale and rotation operations to them; if you fix something to a bitmap and then apply scaling or rotation, you will get a different result, however. So by differentiating bitmaps from other images, we lose some aspects of "ideal" image equality, but gain others. --Carl From robby at eecs.northwestern.edu Mon Nov 16 21:53:04 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Mon Nov 16 21:53:22 2009 Subject: [plt-scheme] 2htdp/image In-Reply-To: <990e0c030911161834j22d94793la7b34297824d1aed@mail.gmail.com> References: <932b2f1f0910131606n7f356cbcvfaf80896ffb2ed1b@mail.gmail.com> <904774730911161724y7697e5d8rdd77324607e0258f@mail.gmail.com> <932b2f1f0911161747s70c9fdc6x900f6dc39be3fa04@mail.gmail.com> <932b2f1f0911161803o3565bb20m300b6c20aca24b46@mail.gmail.com> <904774730911161809h726fde11o353918a7446f13b7@mail.gmail.com> <932b2f1f0911161812i1b73e85j19af81472592e6a5@mail.gmail.com> <904774730911161828m6ca01823p83cacdb162c88026@mail.gmail.com> <990e0c030911161834j22d94793la7b34297824d1aed@mail.gmail.com> Message-ID: <932b2f1f0911161853u56a0714eh65b48e1ad79e7e39@mail.gmail.com> Yes, what Carl said. (Thanks. :) I'll try to improve the docs along these lines (the juicy technical bits are there now at the end of the docs, but the main point that needed to be made is missing). Robby On Mon, Nov 16, 2009 at 8:34 PM, Carl Eastlund wrote: > On Mon, Nov 16, 2009 at 9:28 PM, Todd O'Bryan wrote: >> >> I think I'm confused. If all bitmaps are images, but equality is done >> cleverly, what will happen if you do >> >> (equal? (overlay BITMAP (line 20 30 "black")) >> ? ? ? ?(add-line BITMAP 0 0 20 30 "black")) >> >> And if you have to handle bitmaps anyway, how is color-list->image or >> any of the crop functions any more problematic? >> >> In other words, suppose I make an image in DrScheme and save it as a >> PNG. When I read it back in, I've lost all the image-y information, so >> is it only equal to another bitmap that's pixel-identical, but not to >> an image that's pixel-identical (say the one I saved)? >> >> Sorry to be dense, but I'm just trying to understand how this is going >> to work when you start mixing user-created images and images loaded >> from outside the environment. >> >> Todd > > Todd, > > There are a lot of images that are pixel-wise equal in this system, > but not image-equal, even without resorting to bitmaps. ?Two images > that are equal are guaranteed to continue to be equal after applying > (the same) scale and rotation operations to them; if you fix something > to a bitmap and then apply scaling or rotation, you will get a > different result, however. ?So by differentiating bitmaps from other > images, we lose some aspects of "ideal" image equality, but gain > others. > > --Carl > From robby at eecs.northwestern.edu Mon Nov 16 21:53:50 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Mon Nov 16 21:54:08 2009 Subject: [plt-scheme] 2htdp/image In-Reply-To: <932b2f1f0911161853u56a0714eh65b48e1ad79e7e39@mail.gmail.com> References: <932b2f1f0910131606n7f356cbcvfaf80896ffb2ed1b@mail.gmail.com> <904774730911161724y7697e5d8rdd77324607e0258f@mail.gmail.com> <932b2f1f0911161747s70c9fdc6x900f6dc39be3fa04@mail.gmail.com> <932b2f1f0911161803o3565bb20m300b6c20aca24b46@mail.gmail.com> <904774730911161809h726fde11o353918a7446f13b7@mail.gmail.com> <932b2f1f0911161812i1b73e85j19af81472592e6a5@mail.gmail.com> <904774730911161828m6ca01823p83cacdb162c88026@mail.gmail.com> <990e0c030911161834j22d94793la7b34297824d1aed@mail.gmail.com> <932b2f1f0911161853u56a0714eh65b48e1ad79e7e39@mail.gmail.com> Message-ID: <932b2f1f0911161853t1e128108l9d0e5aaafd7c8f49@mail.gmail.com> Also note: htdp/image is not going anywhere (and universe won't change in this release so it will continue to work only with htdp/image). So if you fear this change, fear not. Robby From aconchillo at gmail.com Tue Nov 17 11:26:48 2009 From: aconchillo at gmail.com (=?UTF-8?Q?Aleix_Conchillo_Flaqu=C3=A9?=) Date: Tue Nov 17 11:27:05 2009 Subject: [plt-scheme] slideshow with multiple displays Message-ID: Hi, continuing with my Slideshow tests, today I connected my laptop to a projector setting it as a virtual desktop. The result is that the slides are centered in the middle of the virtual desktop and I don't know how to move them. The idea is to have the comments window and the preview in one screen and the presentation in the projector, and I only get the first part. I know this is possible (jfp05-ff.pdf - 4.6 Display Interaction), but I don't know if I'm missing something. Thanks in advance, Aleix PS: my last two messages are awaiting for moderator, just delete them (image attachment was too big, I forgot about the size added by base64 mail conversions). Sorry for the inconvenience. From aconchillo at gmail.com Tue Nov 17 12:57:41 2009 From: aconchillo at gmail.com (=?UTF-8?Q?Aleix_Conchillo_Flaqu=C3=A9?=) Date: Tue Nov 17 12:57:58 2009 Subject: [plt-scheme] Re: slideshow with multiple displays (SOLVED) Message-ID: Grant Rettke suggested me to specify width and height via slideshow command. It worked! But I also had to move the window a bit via Alt-down to fit it in the screen. May be it should be documented somewhere, I don't know if I would have found it without his help. Thanks again Grant. Cheers, Aleix On Tue, Nov 17, 2009 at 17:26, Aleix Conchillo Flaqu? wrote: > Hi, > > continuing with my Slideshow tests, today I connected my laptop to a > projector setting it as a virtual desktop. The result is that the > slides are centered in the middle of the virtual desktop and I don't > know how to move them. The idea is to have the comments window and the > preview in one screen and the presentation in the projector, and I > only get the first part. > > I know this is possible (jfp05-ff.pdf - 4.6 Display Interaction), but > I don't know if I'm missing something. > > Thanks in advance, > > Aleix > > PS: my last two messages are awaiting for moderator, just delete them > (image attachment was too big, I forgot about the size added by base64 > mail conversions). Sorry for the inconvenience. > From robby at eecs.northwestern.edu Tue Nov 17 13:01:37 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Tue Nov 17 13:01:58 2009 Subject: [plt-scheme] Re: slideshow with multiple displays (SOLVED) In-Reply-To: References: Message-ID: <932b2f1f0911171001n5c617c9aie4b199d78f6786a6@mail.gmail.com> There is some information if you say % slideshow --help Also, the problem with putting it into the middle of the screen has to do with the way the low-level gui code provides screen size information to the scheme level. Hopefully it will be fixed before too long. Robby On Tue, Nov 17, 2009 at 11:57 AM, Aleix Conchillo Flaqu? wrote: > Grant Rettke suggested me to specify width and height via slideshow command. > > It worked! But I also had to move the window a bit via Alt-down to fit > it in the screen. > > May be it should be documented somewhere, I don't know if I would have > found it without his help. > > Thanks again Grant. > > Cheers, > > Aleix > > On Tue, Nov 17, 2009 at 17:26, Aleix Conchillo Flaqu? > wrote: >> Hi, >> >> continuing with my Slideshow tests, today I connected my laptop to a >> projector setting it as a virtual desktop. The result is that the >> slides are centered in the middle of the virtual desktop and I don't >> know how to move them. The idea is to have the comments window and the >> preview in one screen and the presentation in the projector, and I >> only get the first part. >> >> I know this is possible (jfp05-ff.pdf - 4.6 Display Interaction), but >> I don't know if I'm missing something. >> >> Thanks in advance, >> >> Aleix >> >> PS: my last two messages are awaiting for moderator, just delete them >> (image attachment was too big, I forgot about the size added by base64 >> mail conversions). Sorry for the inconvenience. >> > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From aconchillo at gmail.com Tue Nov 17 13:04:25 2009 From: aconchillo at gmail.com (=?UTF-8?Q?Aleix_Conchillo_Flaqu=C3=A9?=) Date: Tue Nov 17 13:04:46 2009 Subject: [plt-scheme] Re: slideshow with multiple displays (SOLVED) In-Reply-To: <932b2f1f0911171001n5c617c9aie4b199d78f6786a6@mail.gmail.com> References: <932b2f1f0911171001n5c617c9aie4b199d78f6786a6@mail.gmail.com> Message-ID: Yes, but one can not guess that those parameters are going to solve the multiple display issue. Well, at least I did not :-). Btw, Slideshow is just great. Thank you! Aleix On Tue, Nov 17, 2009 at 19:01, Robby Findler wrote: > There is some information if you say > > ?% slideshow --help > > Also, the problem with putting it into the middle of the screen has to > do with the way the low-level gui code provides screen size > information to the scheme level. Hopefully it will be fixed before too > long. > > Robby > > On Tue, Nov 17, 2009 at 11:57 AM, Aleix Conchillo Flaqu? > wrote: >> Grant Rettke suggested me to specify width and height via slideshow command. >> >> It worked! But I also had to move the window a bit via Alt-down to fit >> it in the screen. >> >> May be it should be documented somewhere, I don't know if I would have >> found it without his help. >> >> Thanks again Grant. >> >> Cheers, >> >> Aleix >> >> On Tue, Nov 17, 2009 at 17:26, Aleix Conchillo Flaqu? >> wrote: >>> Hi, >>> >>> continuing with my Slideshow tests, today I connected my laptop to a >>> projector setting it as a virtual desktop. The result is that the >>> slides are centered in the middle of the virtual desktop and I don't >>> know how to move them. The idea is to have the comments window and the >>> preview in one screen and the presentation in the projector, and I >>> only get the first part. >>> >>> I know this is possible (jfp05-ff.pdf - 4.6 Display Interaction), but >>> I don't know if I'm missing something. >>> >>> Thanks in advance, >>> >>> Aleix >>> >>> PS: my last two messages are awaiting for moderator, just delete them >>> (image attachment was too big, I forgot about the size added by base64 >>> mail conversions). Sorry for the inconvenience. >>> >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > From Stefan.Ballnat at fokus.fraunhofer.de Wed Nov 18 05:05:02 2009 From: Stefan.Ballnat at fokus.fraunhofer.de (Ballnat, Stefan) Date: Wed Nov 18 05:15:22 2009 Subject: AW: [plt-scheme] Debugging library code In-Reply-To: <7478a1340911161156i1198b6d1i4ea82424af7392f8@mail.gmail.com> References: <7478a1340911161156i1198b6d1i4ea82424af7392f8@mail.gmail.com> Message-ID: I had this problem while profiling my code. You must delete the "compiled" folder in order to make DrScheme debug/profile the scheme code. - Stefan Von: plt-scheme-bounces@list.cs.brown.edu [mailto:plt-scheme-bounces@list.cs.brown.edu] Im Auftrag von N N Gesendet: Montag, 16. November 2009 20:57 An: plt-scheme@list.cs.brown.edu Betreff: [plt-scheme] Debugging library code Is there a way to debug library code sanely? I tried doing it in DrScheme (which I don't generally use) but found that opening files from the collects directory under the install and setting breakpoints in them doesn't work: it seems DrScheme won't hit breakpoints in a .ss file if it's actually reading from a compiled library file. How can I do this? Thanks, ~NT -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091118/ce77275d/attachment.htm From icfp.publicity at googlemail.com Wed Nov 18 06:14:58 2009 From: icfp.publicity at googlemail.com (Wouter Swierstra) Date: Wed Nov 18 06:15:19 2009 Subject: [plt-scheme] ICFP '10: Second call for workshop proposals Message-ID: <53ff55480911180314t2500d154rcb5ba41a9cbd422b@mail.gmail.com> CALL FOR WORKSHOP AND CO-LOCATED EVENT PROPOSALS ICFP 2010 15th ACM SIGPLAN International Conference on Functional Programming September 27 - 29, 2010 Baltimore, Maryland http://www.icfpconference.org/icfp2010 The 15th ACM SIGPLAN International Conference on Functional Programming will be held in Baltimore, Maryland on September 27-29, 2010. ICFP provides a forum for researchers and developers to hear about the latest work on the design, implementations, principles, and uses of functional programming. Proposals are invited for workshops (and other co-located events, such as tutorials) to be affiliated with ICFP 2010 and sponsored by SIGPLAN. These events should be more informal and focused than ICFP itself, include sessions that enable interaction among the attendees, and be fairly low-cost. The preference is for one-day events, but other schedules can also be considered. ---------------------------------------------------------------------- Submission details Deadline for submission: November 20, 2009 Notification of acceptance: December 18, 2009 Prospective organizers of workshops or other co-located events are invited to submit a completed workshop proposal form in plain text format to the ICFP 2010 workshop co-chairs (Derek Dreyer and Chris Stone), via email to icfp10-workshops at mpi-sws.org by November 20, 2009. (For proposals of co-located events other than workshops, please fill in the workshop proposal form and just leave blank any sections that do not apply.) Please note that this is a firm deadline. Organizers will be notified if their event proposal is accepted by December 18, 2009, and if successful, depending on the event, they will be asked to produce a final report after the event has taken place that is suitable for publication in SIGPLAN Notices. The proposal form is available at: http://www.icfpconference.org/icfp2010/icfp10-workshops-form.txt Further information about SIGPLAN sponsorship is available at: http://acm.org/sigplan/sigplan_workshop_proposal.htm ---------------------------------------------------------------------- Selection committee The proposals will be evaluated by a committee comprising the following members of the ICFP 2010 organizing committee, together with the members of the SIGPLAN executive committee. Workshop Co-Chair: Derek Dreyer (MPI-SWS) Workshop Co-Chair: Chris Stone (Harvey Mudd College) General Chair: Paul Hudak (Yale University) Program Chair: Stephanie Weirich (University of Pennsylvania) ---------------------------------------------------------------------- Further information Any queries should be addressed to the workshop co-chairs (Derek Dreyer and Chris Stone), via email to icfp10-workshops at mpi-sws.org. From sbloch at adelphi.edu Wed Nov 18 10:13:20 2009 From: sbloch at adelphi.edu (Stephen Bloch) Date: Wed Nov 18 10:13:45 2009 Subject: [plt-scheme] 2htdp/image In-Reply-To: <990e0c030911161834j22d94793la7b34297824d1aed@mail.gmail.com> References: <932b2f1f0910131606n7f356cbcvfaf80896ffb2ed1b@mail.gmail.com> <904774730911161724y7697e5d8rdd77324607e0258f@mail.gmail.com> <932b2f1f0911161747s70c9fdc6x900f6dc39be3fa04@mail.gmail.com> <932b2f1f0911161803o3565bb20m300b6c20aca24b46@mail.gmail.com> <904774730911161809h726fde11o353918a7446f13b7@mail.gmail.com> <932b2f1f0911161812i1b73e85j19af81472592e6a5@mail.gmail.com> <904774730911161828m6ca01823p83cacdb162c88026@mail.gmail.com> <990e0c030911161834j22d94793la7b34297824d1aed@mail.gmail.com> Message-ID: <3CC43AC9-BDD1-4344-8552-FE103183E6D6@adelphi.edu> I think this is a reasonable approach to images: by default, store them in terms of drawing primitives (so rotation, scaling, etc. work nicely) but for display and some other purposes, "flatten" them to bitmaps. It also makes sense to have two different equality operators on images: do they have the same bit-map representation right now, and would they continue to have the same bit-map representation after rotation, reflection, scaling, etc? So what should the drawing primitives be? The obvious base cases (to me) are ellipses (filled or outline), polygons (filled or outline), line segments, and bitmaps. And maybe text in a specified font. The obvious operators, off the top of my head, are vertical and horizontal concatenation, overlay (with translation), rotation, reflection, scaling, and clipping. Concatenation is the composition of an overlay and a translation. Conveniently enough, rotation, reflection, translation, and scaling (as well as skewing) can all be represented as matrix multiplication, and matrix multiplication (at least in a pure, exact mathematical world) is associative, so any SEQUENCE of rotations, translations, reflections, scalings, and skews can be represented as a single matrix multiplication. Overlay, and clipping to an arbitrary rectangular region aligned with the current coordinate system, should be trivial (although they can't be represented as matrix multiplication). Now, about exactness. It would be nice if (reflect-horiz (rotate 72 (rotate 200 (rotate 88 (reflect-horiz blah))))) were exactly equal to blah. If you represent rotation, reflection, scaling, and skewing by matrix multiplication with floating-point matrix entries, it may not be. On the other hand, if you represent each of these operations by separate tree nodes even when they're in sequence, flattening (and therefore displaying) becomes needlessly expensive, especially after you've run an animation of a spinning star for a few minutes. Obviously, images coming from photographs should by rights be considered inexact, as should anything stored in a lossy format like JPEG... and for display on a physical monitor, we don't need exact images anyway. Why don't we just cut the Gordian knot and say that ALL images and ALL functions on them are inexact, and you can't reasonably rely on the equality I mentioned at the top of this paragraph? At low magnification, they may turn out to have equal bitmaps, just as the result of a floating-point computation may be within a large delta of another floating-point value, but one would no more expect exact equality on computed images than on computed inexact numbers. Most of what I've said above applies to 3-D "images" too, of course, but that's another bucket of worms.... Stephen Bloch sbloch@adelphi.edu From matthias at ccs.neu.edu Wed Nov 18 10:31:24 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Wed Nov 18 10:32:02 2009 Subject: [plt-scheme] 2htdp/image In-Reply-To: <3CC43AC9-BDD1-4344-8552-FE103183E6D6@adelphi.edu> References: <932b2f1f0910131606n7f356cbcvfaf80896ffb2ed1b@mail.gmail.com> <904774730911161724y7697e5d8rdd77324607e0258f@mail.gmail.com> <932b2f1f0911161747s70c9fdc6x900f6dc39be3fa04@mail.gmail.com> <932b2f1f0911161803o3565bb20m300b6c20aca24b46@mail.gmail.com> <904774730911161809h726fde11o353918a7446f13b7@mail.gmail.com> <932b2f1f0911161812i1b73e85j19af81472592e6a5@mail.gmail.com> <904774730911161828m6ca01823p83cacdb162c88026@mail.gmail.com> <990e0c030911161834j22d94793la7b34297824d1aed@mail.gmail.com> <3CC43AC9-BDD1-4344-8552-FE103183E6D6@adelphi.edu> Message-ID: <3BD648BE-7BF7-4851-96AB-DFFA22C57347@ccs.neu.edu> I think there's a general agreement here on the basics. Two points though: 1. Why do you think that a long list of image ops/tree nodes is more expensive than a bitmap? That's minor I think. I'd measure this first. 2. Inexactness: Perhaps I am misunderstanding but here is what I think Robby is saying and what you are saying: Robby: there are exact and inexact images just like their are exact and inexact numbers. His operations preserve exactness as much as possible, just like numeric operations. (In a sense his inexactness is of course derived from the inexactness of the numbers associated with images.) Stephen: You are saying, deal with all images as if they were inexacts. That simplifies life and we don't need to worry about comparisons. The problem that I see is testing. For testing rendering functions, I'd like to exercise all my code and get an idea that they work properly. I may not test it on 10,000 shots and 3 UFOs but on 2 shots and 1 UFO and that gives me some confidence that it will draw things properly when I run the program (as opposed to testing it). I don't see how I can do this without comparisons, and I really dislike having to warn kids about =-comparisons for numbers on day 1. Day 38 is fine. So for images I'd like some 'exact' equality and perhaps we need an 'inexact' quality (=~) too. ;; --- Does anyone know if others have turned images into first-class values and what problems they encountered and how they solved them? -- Matthias On Nov 18, 2009, at 10:13 AM, Stephen Bloch wrote: > I think this is a reasonable approach to images: by default, store them in terms of drawing primitives (so rotation, scaling, etc. work nicely) but for display and some other purposes, "flatten" them to bitmaps. It also makes sense to have two different equality operators on images: do they have the same bit-map representation right now, and would they continue to have the same bit-map representation after rotation, reflection, scaling, etc? > > So what should the drawing primitives be? The obvious base cases (to me) are ellipses (filled or outline), polygons (filled or outline), line segments, and bitmaps. And maybe text in a specified font. The obvious operators, off the top of my head, are vertical and horizontal concatenation, overlay (with translation), rotation, reflection, scaling, and clipping. Concatenation is the composition of an overlay and a translation. Conveniently enough, rotation, reflection, translation, and scaling (as well as skewing) can all be represented as matrix multiplication, and matrix multiplication (at least in a pure, exact mathematical world) is associative, so any SEQUENCE of rotations, translations, reflections, scalings, and skews can be represented as a single matrix multiplication. Overlay, and clipping to an arbitrary rectangular region aligned with the current coordinate system, should be trivial (although they can't be represented as matrix multiplication). > > Now, about exactness. It would be nice if (reflect-horiz (rotate 72 (rotate 200 (rotate 88 (reflect-horiz blah))))) were exactly equal to blah. If you represent rotation, reflection, scaling, and skewing by matrix multiplication with floating-point matrix entries, it may not be. On the other hand, if you represent each of these operations by separate tree nodes even when they're in sequence, flattening (and therefore displaying) becomes needlessly expensive, especially after you've run an animation of a spinning star for a few minutes. Obviously, images coming from photographs should by rights be considered inexact, as should anything stored in a lossy format like JPEG... and for display on a physical monitor, we don't need exact images anyway. Why don't we just cut the Gordian knot and say that ALL images and ALL functions on them are inexact, and you can't reasonably rely on the equality I mentioned at the top of this paragraph? At low magnification, they may turn out to have equal bitmaps, just as the result of a floating-point computation may be within a large delta of another floating-point value, but one would no more expect exact equality on computed images than on computed inexact numbers. > > Most of what I've said above applies to 3-D "images" too, of course, but that's another bucket of worms.... > > > Stephen Bloch > sbloch@adelphi.edu > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From sbloch at adelphi.edu Wed Nov 18 11:15:31 2009 From: sbloch at adelphi.edu (Stephen Bloch) Date: Wed Nov 18 11:15:57 2009 Subject: [plt-scheme] 2htdp/image In-Reply-To: <3BD648BE-7BF7-4851-96AB-DFFA22C57347@ccs.neu.edu> References: <932b2f1f0910131606n7f356cbcvfaf80896ffb2ed1b@mail.gmail.com> <904774730911161724y7697e5d8rdd77324607e0258f@mail.gmail.com> <932b2f1f0911161747s70c9fdc6x900f6dc39be3fa04@mail.gmail.com> <932b2f1f0911161803o3565bb20m300b6c20aca24b46@mail.gmail.com> <904774730911161809h726fde11o353918a7446f13b7@mail.gmail.com> <932b2f1f0911161812i1b73e85j19af81472592e6a5@mail.gmail.com> <904774730911161828m6ca01823p83cacdb162c88026@mail.gmail.com> <990e0c030911161834j22d94793la7b34297824d1aed@mail.gmail.com> <3CC43AC9-BDD1-4344-8552-FE103183E6D6@adelphi.edu> <3BD648BE-7BF7-4851-96AB-DFFA22C57347@ccs.neu.edu> Message-ID: On Nov 18, 2009, at 10:31 AM, Matthias Felleisen wrote: > 1. Why do you think that a long list of image ops/tree nodes is > more expensive than a bitmap? That's minor I think. I'd measure > this first. I didn't say "more expensive than a bitmap". Suppose you've got an animation whose model is (or contains) an image, initially a star or a triangle or a bitmap copied from the Web, and which has a tick handler that rotates the image by a certain number of degrees. One implementation: the tick handler adds a "rotate" node to the tree every time, and the redraw handler interprets the whole tree to flatten the image into a bitmap that can be displayed. Another implementation: the tick handler tries to add a "rotate" node (a kind of matrix multiplication) to the tree, but realizes that the previous top node of the tree was a matrix multiplication, so it composes the matrix multiplications and collapses the two nodes into one. The redraw handler, in flattening the image into a bitmap that can be displayed, only has to apply that single matrix to the underlying bitmap (or other primitive). My hypothesis is that the former implementation is significantly slower (especially as the animation keeps running for a few minutes) than the latter. Yes, that hypothesis should be tested empirically, but it seems very plausible. > 2. Inexactness: Perhaps I am misunderstanding but here is what I > think Robby is saying and what you are saying: > > Robby: there are exact and inexact images just like their are exact > and inexact numbers. His operations preserve exactness as much as > possible, just like numeric operations. (In a sense his inexactness > is of course derived from the inexactness of the numbers associated > with images.) > > Stephen: You are saying, deal with all images as if they were > inexacts. That simplifies life and we don't need to worry about > comparisons. Yes, I'm saying deal with all images as if they were inexacts (although we still need comparisons). I certainly see the appeal in the notion of "exact" vs. "inexact" images, but I fear that the distinction might cost too much in efficiency. > The problem that I see is testing. For testing rendering > functions, I'd like to exercise all my code and get an idea that > they work properly. I may not test it on 10,000 shots and 3 UFOs > but on 2 shots and 1 UFO and that gives me some confidence that it > will draw things properly when I run the program (as opposed to > testing it). > > I don't see how I can do this without comparisons, and I really > dislike having to warn kids about =-comparisons for numbers on day > 1. Day 38 is fine. So for images I'd like some 'exact' equality and > perhaps we need an 'inexact' quality (=~) too. I agree with having one equality test that compares the tree representations of two images, and another that compares the bitmap representations. The question is whether even the former can reasonably be called "exact". If some of the tree nodes contain matrices with inexact entries, obviously it can't. If a user ever calls "rotate" with an inexact angle, then again it obviously can't (even under the all-trees-all-the-time implementation). I would have check-expect, by default, compare images as bitmaps, so two images will compare as equal iff they would appear the same on the screen. That should be easy for beginning students to understand. > Does anyone know if others have turned images into first-class > values and what problems they encountered and how they solved them? Surely somebody has. Although the great majority of graphics research has been directed towards efficiently displaying things on a physical screen, which doesn't require exactness. BTW, there might be something to be said for an image representation which is primarily a tree, but which "caches" a bitmap whenever it is flattened (whether for comparison-as-bitmaps or for display), so the next time the same image is compared or displayed, it doesn't have to be re-flattened. Or to be more Schemish, the bitmap representation is a lazy function of the tree representation. I would do this caching only at the top level of an image tree, not at every node, to avoid egregious memory-hogging. Stephen Bloch sbloch@adelphi.edu From power.real at gmail.com Wed Nov 18 13:07:39 2009 From: power.real at gmail.com (Sergey Lilo) Date: Wed Nov 18 13:07:56 2009 Subject: [plt-scheme] Online code update. Message-ID: <715bde180911181007t29f054cbk9b862b174e17f26c@mail.gmail.com> Hello, everybody. I just started to study Scheme - I'm writing simple guestbook with Plt Web Server. It works fine, but is there a method for update code without restarting webserver? I saw the Swank for CL, and I want something like it for PLT-Scheme. Or, if you have better way - tell me. :) Thanks. From matthias at ccs.neu.edu Wed Nov 18 13:09:50 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Wed Nov 18 13:10:28 2009 Subject: [plt-scheme] Online code update. In-Reply-To: <715bde180911181007t29f054cbk9b862b174e17f26c@mail.gmail.com> References: <715bde180911181007t29f054cbk9b862b174e17f26c@mail.gmail.com> Message-ID: While you are experimenting change the HTML page's url to script.v1.ss script.v2.ss etc. No need to restart then. On Nov 18, 2009, at 1:07 PM, Sergey Lilo wrote: > Hello, everybody. > I just started to study Scheme - I'm writing simple guestbook with Plt > Web Server. > It works fine, but is there a method for update code without > restarting webserver? > I saw the Swank for CL, and I want something like it for PLT-Scheme. > Or, if you have better way - tell me. :) > Thanks. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From jay.mccarthy at gmail.com Wed Nov 18 13:12:57 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Wed Nov 18 13:13:18 2009 Subject: [plt-scheme] Online code update. In-Reply-To: <715bde180911181007t29f054cbk9b862b174e17f26c@mail.gmail.com> References: <715bde180911181007t29f054cbk9b862b174e17f26c@mail.gmail.com> Message-ID: This is what /conf/refresh-servlets does. Jay On Wed, Nov 18, 2009 at 11:07 AM, Sergey Lilo wrote: > Hello, everybody. > I just started to study Scheme - I'm writing simple guestbook with Plt > Web Server. > It works fine, but is there a method for update code without > restarting webserver? > I saw the Swank for CL, and I want something like it for PLT-Scheme. > Or, if you have better way - tell me. :) > Thanks. > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From jay.mccarthy at gmail.com Wed Nov 18 13:28:29 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Wed Nov 18 13:28:48 2009 Subject: Fwd: [plt-scheme] Online code update. In-Reply-To: References: <715bde180911181007t29f054cbk9b862b174e17f26c@mail.gmail.com> <715bde180911181023w5feb563dk7076780bd791ee08@mail.gmail.com> Message-ID: Just realized this didn't go to the list. ---------- Forwarded message ---------- From: Jay McCarthy Date: Wed, Nov 18, 2009 at 11:27 AM Subject: Re: [plt-scheme] Online code update. To: Sergey Lilo You can't reload with serve/servlet without restarting. If you use the command-line, then you can use /conf/refresh-servlets. If you are crazy, you can put the serve/servlet in another thread: (thread (lambda () (serve/servlet ...))) Then from the REPL you could just: (set! title "I am insane") and it would change. Normal craziness with this development style would apply. Jay On Wed, Nov 18, 2009 at 11:23 AM, Sergey Lilo wrote: > Thank you. > But can you show me a primer? > > For example, I running this code: > > (define title "Hello world") > > (define (guestbook request) > ?(list #"text/html" > ? ? ? ?(include-template "templates/index.tpl"))) > > (serve/servlet guestbook > ? ? ? ? ? ? ? ?#:port 8080 > ? ? ? ? ? ? ? ?#:servlet-path "/") > How can I redefine "title"? > > 2009/11/19 Jay McCarthy : >> This is what /conf/refresh-servlets does. >> >> Jay >> >> On Wed, Nov 18, 2009 at 11:07 AM, Sergey Lilo wrote: >>> Hello, everybody. >>> I just started to study Scheme - I'm writing simple guestbook with Plt >>> Web Server. >>> It works fine, but is there a method for update code without >>> restarting webserver? >>> I saw the Swank for CL, and I want something like it for PLT-Scheme. >>> Or, if you have better way - tell me. :) >>> Thanks. >>> _________________________________________________ >>> ?For list-related administrative tasks: >>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>> >> >> >> >> -- >> Jay McCarthy >> Assistant Professor / Brigham Young University >> http://teammccarthy.org/jay >> >> "The glory of God is Intelligence" - D&C 93 >> > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From noelwelsh at gmail.com Wed Nov 18 15:08:42 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Wed Nov 18 15:09:03 2009 Subject: [plt-scheme] 2htdp/image In-Reply-To: <3BD648BE-7BF7-4851-96AB-DFFA22C57347@ccs.neu.edu> References: <932b2f1f0910131606n7f356cbcvfaf80896ffb2ed1b@mail.gmail.com> <932b2f1f0911161747s70c9fdc6x900f6dc39be3fa04@mail.gmail.com> <932b2f1f0911161803o3565bb20m300b6c20aca24b46@mail.gmail.com> <904774730911161809h726fde11o353918a7446f13b7@mail.gmail.com> <932b2f1f0911161812i1b73e85j19af81472592e6a5@mail.gmail.com> <904774730911161828m6ca01823p83cacdb162c88026@mail.gmail.com> <990e0c030911161834j22d94793la7b34297824d1aed@mail.gmail.com> <3CC43AC9-BDD1-4344-8552-FE103183E6D6@adelphi.edu> <3BD648BE-7BF7-4851-96AB-DFFA22C57347@ccs.neu.edu> Message-ID: On Wed, Nov 18, 2009 at 3:31 PM, Matthias Felleisen wrote: > Does anyone know if others have turned images into first-class values and what problems they encountered and how they solved them? In the general case? There is a small literature on this in the functional world. E.g.: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.36.9799&rep=rep1&type=pdf (Pictures, 1995) http://www.ecs.soton.ac.uk/%7Eph/papers/funcgeo2.pdf (Functional Geometry, 2002) I don't recall any papers specifically addressing equality. The main concern in my reading has been expressing constraints in the layout (e.g. this box is twice as wide as the elements it contains). HTH, N. From noelwelsh at gmail.com Wed Nov 18 15:44:05 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Wed Nov 18 15:44:23 2009 Subject: [plt-scheme] changing code font size in slideshow In-Reply-To: References: <932b2f1f0911130537m6017a356i400ff7a184dae25d@mail.gmail.com> <932b2f1f0911130540h1c85ef6dxbfacfd42cfcbb74b@mail.gmail.com> Message-ID: More idiomatic would be to reverse the arguments, allow multiple "code" expressions, and call it with-font-size: (define-syntax with-font-size (syntax-rules () [(with-font-size size expr ...) (parameterize ([current-font-size size]) expr ...)])) [Untested] HTH, N. On Sat, Nov 14, 2009 at 11:05 AM, Aleix Conchillo Flaqu? wrote: > I have defined this to help changing code size and avoid writing > parameterize each time. I'm very newbie, so probably there's a much > better way to do it. I used (plai-code) because I'm doing a slides for > some PLAI chapters. > > (define-syntax plai-code > ?(syntax-rules () > ? ?[(plai-code code) code] > ? ?[(plai-code code font-size) (parameterize > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ([current-font-size font-size]) code)])) > > (plai-code (code ...)) > (plai-code (code ...) 26) > From noelwelsh at gmail.com Wed Nov 18 15:55:49 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Wed Nov 18 15:56:07 2009 Subject: [plt-scheme] documentation feature requests In-Reply-To: References: Message-ID: My pattern is similar: search. If that fails, start at the Reference. My understanding is that examples were kept out of the Reference and put into the Guide. I guess in a system where the primary mode of access is search this doesn't really work out. N. On Sun, Nov 15, 2009 at 9:39 PM, Lee Spector wrote: > > I usually get into the documentation with searches, either with esc-F1 to > search for the currently selected symbol or by selecting "Help Desk" from > the Help menu (in Mac OS X) and then doing a search from there. When search > fails I'm pretty frustrated and then start hunting through the docs from the > ToC. BTW my searches often fail because my search term doesn't occur in a > defined symbol name, or whatever else the searches search, even if it occurs > in the documentation itself. It'd be nice to have searches that search over > all of the text in the documentation, at least optionally. > > ?-Lee From carl.eastlund at gmail.com Wed Nov 18 15:56:41 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Wed Nov 18 15:57:20 2009 Subject: [plt-scheme] changing code font size in slideshow In-Reply-To: References: <932b2f1f0911130537m6017a356i400ff7a184dae25d@mail.gmail.com> <932b2f1f0911130540h1c85ef6dxbfacfd42cfcbb74b@mail.gmail.com> Message-ID: <990e0c030911181256x2bd09cfdu5f6a200ab70e0980@mail.gmail.com> See (planet cce/scheme/slideshow), which provides (with-size ) and (with-scale ) forms. See also (planet cce/scheme/define), which provides (define-with-parameter ) for constructing these kinds of macros. file:///Users/cce/plt/release/planet/4.2.2/cache/cce/scheme.plt/6/0/doc/manual/graphics-section.html#(part._slideshow) file:///Users/cce/plt/release/planet/4.2.2/cache/cce/scheme.plt/6/0/doc/manual/Macros.html#(part._define) Carl Eastlund On Wed, Nov 18, 2009 at 3:44 PM, Noel Welsh wrote: > More idiomatic would be to reverse the arguments, allow multiple > "code" expressions, and call it with-font-size: > > (define-syntax with-font-size > ?(syntax-rules () > ? ?[(with-font-size size expr ...) > ? ? ?(parameterize > ? ? ? ?([current-font-size size]) > ? ? ? ?expr ...)])) > > [Untested] > > HTH, > N. > > On Sat, Nov 14, 2009 at 11:05 AM, Aleix Conchillo Flaqu? > wrote: >> I have defined this to help changing code size and avoid writing >> parameterize each time. I'm very newbie, so probably there's a much >> better way to do it. I used (plai-code) because I'm doing a slides for >> some PLAI chapters. >> >> (define-syntax plai-code >> ?(syntax-rules () >> ? ?[(plai-code code) code] >> ? ?[(plai-code code font-size) (parameterize >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ([current-font-size font-size]) code)])) >> >> (plai-code (code ...)) >> (plai-code (code ...) 26) From robby at eecs.northwestern.edu Wed Nov 18 16:07:57 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Wed Nov 18 16:08:15 2009 Subject: [plt-scheme] 2htdp/image In-Reply-To: <3CC43AC9-BDD1-4344-8552-FE103183E6D6@adelphi.edu> References: <932b2f1f0910131606n7f356cbcvfaf80896ffb2ed1b@mail.gmail.com> <904774730911161724y7697e5d8rdd77324607e0258f@mail.gmail.com> <932b2f1f0911161747s70c9fdc6x900f6dc39be3fa04@mail.gmail.com> <932b2f1f0911161803o3565bb20m300b6c20aca24b46@mail.gmail.com> <904774730911161809h726fde11o353918a7446f13b7@mail.gmail.com> <932b2f1f0911161812i1b73e85j19af81472592e6a5@mail.gmail.com> <904774730911161828m6ca01823p83cacdb162c88026@mail.gmail.com> <990e0c030911161834j22d94793la7b34297824d1aed@mail.gmail.com> <3CC43AC9-BDD1-4344-8552-FE103183E6D6@adelphi.edu> Message-ID: <932b2f1f0911181307l3ab5a075s2ca7421bc286cd0b@mail.gmail.com> What you describe in the first paragraph (below) is what htdp/image did, except that it didn't provide the second equality operator, only the bitmap-based one. One of the things we found is that doing a full bitmap comparison for equality was too expensive for systems and that was part of the impetus for 2htdp/image. So far, all of the trickyness in 2htdp/image is in setting up the precise data definition for images to make equality match what one would expect (and still be linear time (usually)). Finally, what you say about matrices (in a followup message) doesn't really work for rotation because you need to compute the bounding box of the shape (to be prepared for future overlays and stuff) and thus you actually need to do a linear time computation to find that bound box (ie, apply the matrix to all of the points in the shape)-- it isn't just (constant time) matrix multiply. But yes, thinking thru all of these issues is what we've been doing recently. Robby On Wed, Nov 18, 2009 at 9:13 AM, Stephen Bloch wrote: > I think this is a reasonable approach to images: by default, store them in > terms of drawing primitives (so rotation, scaling, etc. work nicely) but for > display and some other purposes, "flatten" them to bitmaps. ?It also makes > sense to have two different equality operators on images: do they have the > same bit-map representation right now, and would they continue to have the > same bit-map representation after rotation, reflection, scaling, etc? > > So what should the drawing primitives be? ?The obvious base cases (to me) > are ellipses (filled or outline), polygons (filled or outline), line > segments, and bitmaps. ?And maybe text in a specified font. ?The obvious > operators, off the top of my head, are vertical and horizontal > concatenation, overlay (with translation), rotation, reflection, scaling, > and clipping. ?Concatenation is the composition of an overlay and a > translation. ?Conveniently enough, rotation, reflection, translation, and > scaling (as well as skewing) can all be represented as matrix > multiplication, and matrix multiplication (at least in a pure, exact > mathematical world) is associative, so any SEQUENCE of rotations, > translations, reflections, scalings, and skews can be represented as a > single matrix multiplication. ?Overlay, and clipping to an arbitrary > rectangular region aligned with the current coordinate system, should be > trivial (although they can't be represented as matrix multiplication). > > Now, about exactness. ?It would be nice if (reflect-horiz (rotate 72 (rotate > 200 (rotate 88 (reflect-horiz blah))))) were exactly equal to blah. ?If you > represent rotation, reflection, scaling, and skewing by matrix > multiplication with floating-point matrix entries, it may not be. ?On the > other hand, if you represent each of these operations by separate tree nodes > even when they're in sequence, flattening (and therefore displaying) becomes > needlessly expensive, especially after you've run an animation of a spinning > star for a few minutes. ?Obviously, images coming from photographs should by > rights be considered inexact, as should anything stored in a lossy format > like JPEG... and for display on a physical monitor, we don't need exact > images anyway. ?Why don't we just cut the Gordian knot and say that ALL > images and ALL functions on them are inexact, and you can't reasonably rely > on the equality I mentioned at the top of this paragraph? ?At low > magnification, they may turn out to have equal bitmaps, just as the result > of a floating-point computation may be within a large delta of another > floating-point value, but one would no more expect exact equality on > computed images than on computed inexact numbers. > > Most of what I've said above applies to 3-D "images" too, of course, but > that's another bucket of worms.... > > > Stephen Bloch > sbloch@adelphi.edu > > From robby at eecs.northwestern.edu Wed Nov 18 16:09:46 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Wed Nov 18 16:10:03 2009 Subject: [plt-scheme] 2htdp/image In-Reply-To: <3BD648BE-7BF7-4851-96AB-DFFA22C57347@ccs.neu.edu> References: <932b2f1f0910131606n7f356cbcvfaf80896ffb2ed1b@mail.gmail.com> <932b2f1f0911161747s70c9fdc6x900f6dc39be3fa04@mail.gmail.com> <932b2f1f0911161803o3565bb20m300b6c20aca24b46@mail.gmail.com> <904774730911161809h726fde11o353918a7446f13b7@mail.gmail.com> <932b2f1f0911161812i1b73e85j19af81472592e6a5@mail.gmail.com> <904774730911161828m6ca01823p83cacdb162c88026@mail.gmail.com> <990e0c030911161834j22d94793la7b34297824d1aed@mail.gmail.com> <3CC43AC9-BDD1-4344-8552-FE103183E6D6@adelphi.edu> <3BD648BE-7BF7-4851-96AB-DFFA22C57347@ccs.neu.edu> Message-ID: <932b2f1f0911181309q39d93bd4mc199854a7210ba6a@mail.gmail.com> On Wed, Nov 18, 2009 at 9:31 AM, Matthias Felleisen wrote: > Does anyone know if others have turned images into first-class values and what > problems they encountered and how they solved them? Matthew and I spent a fair amount of time looking for such papers when we were doing the slideshow design, so a reasonable starting point is the related work section of that paper. (There probably has been stuff since then, tho.) Robby From grettke at acm.org Wed Nov 18 16:23:53 2009 From: grettke at acm.org (Grant Rettke) Date: Wed Nov 18 16:24:11 2009 Subject: [plt-scheme] changing code font size in slideshow In-Reply-To: <990e0c030911181256x2bd09cfdu5f6a200ab70e0980@mail.gmail.com> References: <932b2f1f0911130537m6017a356i400ff7a184dae25d@mail.gmail.com> <932b2f1f0911130540h1c85ef6dxbfacfd42cfcbb74b@mail.gmail.com> <990e0c030911181256x2bd09cfdu5f6a200ab70e0980@mail.gmail.com> Message-ID: <756daca50911181323w1ad87001p660da467ba366ccd@mail.gmail.com> On Wed, Nov 18, 2009 at 2:56 PM, Carl Eastlund wrote: > See (planet cce/scheme/slideshow), which provides (with-size > ) and (with-scale ) forms. ?See also (planet > cce/scheme/define), which provides (define-with-parameter > ) for constructing these kinds of macros. I am unfamiliar with how code gets promoted into the PLT project. What are the pros and cons for something like Carl's slideshow tools getting added to PLT? From sbloch at adelphi.edu Wed Nov 18 16:29:22 2009 From: sbloch at adelphi.edu (Stephen Bloch) Date: Wed Nov 18 16:29:46 2009 Subject: [plt-scheme] 2htdp/image In-Reply-To: <932b2f1f0911181307l3ab5a075s2ca7421bc286cd0b@mail.gmail.com> References: <932b2f1f0910131606n7f356cbcvfaf80896ffb2ed1b@mail.gmail.com> <904774730911161724y7697e5d8rdd77324607e0258f@mail.gmail.com> <932b2f1f0911161747s70c9fdc6x900f6dc39be3fa04@mail.gmail.com> <932b2f1f0911161803o3565bb20m300b6c20aca24b46@mail.gmail.com> <904774730911161809h726fde11o353918a7446f13b7@mail.gmail.com> <932b2f1f0911161812i1b73e85j19af81472592e6a5@mail.gmail.com> <904774730911161828m6ca01823p83cacdb162c88026@mail.gmail.com> <990e0c030911161834j22d94793la7b34297824d1aed@mail.gmail.com> <3CC43AC9-BDD1-4344-8552-FE103183E6D6@adelphi.edu> <932b2f1f0911181307l3ab5a075s2ca7421bc286cd0b@mail.gmail.com> Message-ID: <69BFE4AB-10FF-4BD5-9572-1CAE721E75C0@adelphi.edu> On Nov 18, 2009, at 4:07 PM, Robby Findler wrote: > What you describe in the first paragraph (below) is what htdp/image > did, except that it didn't provide the second equality operator, only > the bitmap-based one. One of the things we found is that doing a full > bitmap comparison for equality was too expensive for systems and that > was part of the impetus for 2htdp/image. Gee, and I thought it was getting arbitrary rotations to work :-) Yes, full bitmap comparisons will be expensive: you have to (a) flatten the image to a bitmap, and (b) compare it bit by bit. But if you cache the flattened bitmap, at least you can amortize the time for (a) over multiple comparisons and displays. > Finally, what you say about matrices (in a followup message) doesn't > really work for rotation because you need to compute the bounding box > of the shape (to be prepared for future overlays and stuff) and thus > you actually need to do a linear time computation to find that bound > box (ie, apply the matrix to all of the points in the shape)-- it > isn't just (constant time) matrix multiply. But yes, thinking thru all > of these issues is what we've been doing recently. Hmm. We should be able to do better than "apply the matrix to all of the points in the shape." Do you really need a bounding box precomputed (as opposed to computing it only when you actually need it)? How about replacing the bounding box with a convex hull? To compute the convex hull after a rotation (or reflection or scaling or translation or skewing or whatever) you would simply apply the matrix to each of the vertices of the convex hull. In fact, like the "cached bitmap" I mentioned in a previous message, you don't need to store a convex hull at each node of the tree. When you apply any of the matrix-multiply operations (rotate, reflect, scale, translate, skew) to an image that has a known convex hull, just compose the new matrix with the existing one. The only times you need to actually COMPUTE a convex hull (by multiplying a matrix by all the vertices of the previous one) are when you're about to do a crop, an overlay, or a display. And since you don't actually need a precise convex hull, you can do a sort of "conservative convex hull" that merges any two vertices that are closer than a certain distance apart, so the hulls don't get enormous themselves. Stephen Bloch sbloch@adelphi.edu From carl.eastlund at gmail.com Wed Nov 18 16:32:34 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Wed Nov 18 16:33:11 2009 Subject: [plt-scheme] changing code font size in slideshow In-Reply-To: <756daca50911181323w1ad87001p660da467ba366ccd@mail.gmail.com> References: <932b2f1f0911130537m6017a356i400ff7a184dae25d@mail.gmail.com> <932b2f1f0911130540h1c85ef6dxbfacfd42cfcbb74b@mail.gmail.com> <990e0c030911181256x2bd09cfdu5f6a200ab70e0980@mail.gmail.com> <756daca50911181323w1ad87001p660da467ba366ccd@mail.gmail.com> Message-ID: <990e0c030911181332g24bbfc53se196a8bd4446b047@mail.gmail.com> On Wed, Nov 18, 2009 at 4:23 PM, Grant Rettke wrote: > On Wed, Nov 18, 2009 at 2:56 PM, Carl Eastlund wrote: >> See (planet cce/scheme/slideshow), which provides (with-size >> ) and (with-scale ) forms. ?See also (planet >> cce/scheme/define), which provides (define-with-parameter >> ) for constructing these kinds of macros. > > I am unfamiliar with how code gets promoted into the PLT project. > > What are the pros and cons for something like Carl's slideshow tools > getting added to PLT? As the developer of Dracula, I intentionally put most of my code in Planet so I can release it with Dracula and (where possible) maintain compatibility with older versions of PLT Scheme. There is nothing in theory keeping me from putting some of this stuff in the core, except that it would put one half of my code on a different release cycle from the other half, which is problematic. --Carl From robby at eecs.northwestern.edu Wed Nov 18 16:37:03 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Wed Nov 18 16:37:24 2009 Subject: [plt-scheme] 2htdp/image In-Reply-To: <69BFE4AB-10FF-4BD5-9572-1CAE721E75C0@adelphi.edu> References: <932b2f1f0910131606n7f356cbcvfaf80896ffb2ed1b@mail.gmail.com> <932b2f1f0911161803o3565bb20m300b6c20aca24b46@mail.gmail.com> <904774730911161809h726fde11o353918a7446f13b7@mail.gmail.com> <932b2f1f0911161812i1b73e85j19af81472592e6a5@mail.gmail.com> <904774730911161828m6ca01823p83cacdb162c88026@mail.gmail.com> <990e0c030911161834j22d94793la7b34297824d1aed@mail.gmail.com> <3CC43AC9-BDD1-4344-8552-FE103183E6D6@adelphi.edu> <932b2f1f0911181307l3ab5a075s2ca7421bc286cd0b@mail.gmail.com> <69BFE4AB-10FF-4BD5-9572-1CAE721E75C0@adelphi.edu> Message-ID: <932b2f1f0911181337w99bc3ffyf6c4a37aedbe822d@mail.gmail.com> On Wed, Nov 18, 2009 at 3:29 PM, Stephen Bloch wrote: > > On Nov 18, 2009, at 4:07 PM, Robby Findler wrote: > >> What you describe in the first paragraph (below) is what htdp/image >> did, except that it didn't provide the second equality operator, only >> the bitmap-based one. One of the things we found is that doing a full >> bitmap comparison for equality was too expensive for systems and that >> was part of the impetus for 2htdp/image. > > Gee, and I thought it was getting arbitrary rotations to work :-) Rotations was also part of the impetus for 2htdp/image. There were a few other things too. > Yes, full bitmap comparisons will be expensive: you have to (a) flatten the > image to a bitmap, and (b) compare it bit by bit. ?But if you cache the > flattened bitmap, at least you can amortize the time for (a) over multiple > comparisons and displays. Yes, and the current htdp/image library does this (and so your libraries inherit this behavior, I believe). >> Finally, what you say about matrices (in a followup message) doesn't >> really work for rotation because you need to compute the bounding box >> of the shape (to be prepared for future overlays and stuff) and thus >> you actually need to do a linear time computation to find that bound >> box (ie, apply the matrix to all of the points in the shape)-- it >> isn't just (constant time) matrix multiply. But yes, thinking thru all >> of these issues is what we've been doing recently. > > Hmm. ?We should be able to do better than "apply the matrix to all of the > points in the shape." > > Do you really need a bounding box precomputed (as opposed to computing it > only when you actually need it)? No, but most operations need it, so it will be computed. Repeated rotations (without intervening overlays) won't need it, but it didn't seem worth going the lazy route for that, since it seems uncommon. > How about replacing the bounding box with a convex hull? ?To compute the > convex hull after a rotation (or reflection or scaling or translation or > skewing or whatever) you would simply apply the matrix to each of the > vertices of the convex hull. ?In fact, like the "cached bitmap" I mentioned > in a previous message, you don't need to store a convex hull at each node of > the tree. ?When you apply any of the matrix-multiply operations (rotate, > reflect, scale, translate, skew) to an image that has a known convex hull, > just compose the new matrix with the existing one. ?The only times you need > to actually COMPUTE a convex hull (by multiplying a matrix by all the > vertices of the previous one) are when you're about to do a crop, an > overlay, or a display. I thought about that too, but it didn't seem worth the effort because it won't give an asymptotic speed up. That possibility is still open, of course, if we do run into performance problems (but it seems like premature optimization at this point). > And since you don't actually need a precise convex hull, you can do a sort > of "conservative convex hull" that merges any two vertices that are closer > than a certain distance apart, so the hulls don't get enormous themselves. But then the bounding boxes will start getting less precise, no? You don't want a situation where repeating a series of operations and (what seem like) inverses grows the bounding box. Can you avoid that here? Robby From toddobryan at gmail.com Wed Nov 18 16:45:13 2009 From: toddobryan at gmail.com (Todd O'Bryan) Date: Wed Nov 18 16:45:33 2009 Subject: [plt-scheme] 2htdp/image In-Reply-To: <932b2f1f0911181307l3ab5a075s2ca7421bc286cd0b@mail.gmail.com> References: <932b2f1f0910131606n7f356cbcvfaf80896ffb2ed1b@mail.gmail.com> <932b2f1f0911161747s70c9fdc6x900f6dc39be3fa04@mail.gmail.com> <932b2f1f0911161803o3565bb20m300b6c20aca24b46@mail.gmail.com> <904774730911161809h726fde11o353918a7446f13b7@mail.gmail.com> <932b2f1f0911161812i1b73e85j19af81472592e6a5@mail.gmail.com> <904774730911161828m6ca01823p83cacdb162c88026@mail.gmail.com> <990e0c030911161834j22d94793la7b34297824d1aed@mail.gmail.com> <3CC43AC9-BDD1-4344-8552-FE103183E6D6@adelphi.edu> <932b2f1f0911181307l3ab5a075s2ca7421bc286cd0b@mail.gmail.com> Message-ID: <904774730911181345q58e70a71pdf15b7cc715170d2@mail.gmail.com> In my (aborted) attempt to reproduce the functionality of the teaching languages in Python, I used PNG encryption for bitmaps. Since PNG is lossless and well understood, I just saved bitmaps as a string containing the base64 encoding of the PNG data (obtained by the same method for all bitmaps). Equality worked out to simple string equality. I don't know how hard it is to PNG-ify an image, but I can't imagine it'd be much more expensive than creating the bitmap itself. If you attach the PNG data to the structure, then you have an easy way to do bitmap comparison that's at most O(width * height), and probably much better assuming you do simple compression on the PNG data. Todd On Wed, Nov 18, 2009 at 4:07 PM, Robby Findler wrote: > What you describe in the first paragraph (below) is what htdp/image > did, except that it didn't provide the second equality operator, only > the bitmap-based one. One of the things we found is that doing a full > bitmap comparison for equality was too expensive for systems and that > was part of the impetus for 2htdp/image. > > So far, all of the trickyness in 2htdp/image is in setting up the > precise data definition for images to make equality match what one > would expect (and still be linear time (usually)). > > Finally, what you say about matrices (in a followup message) doesn't > really work for rotation because you need to compute the bounding box > of the shape (to be prepared for future overlays and stuff) and thus > you actually need to do a linear time computation to find that bound > box (ie, apply the matrix to all of the points in the shape)-- it > isn't just (constant time) matrix multiply. But yes, thinking thru all > of these issues is what we've been doing recently. > > Robby > > On Wed, Nov 18, 2009 at 9:13 AM, Stephen Bloch wrote: >> I think this is a reasonable approach to images: by default, store them in >> terms of drawing primitives (so rotation, scaling, etc. work nicely) but for >> display and some other purposes, "flatten" them to bitmaps. ?It also makes >> sense to have two different equality operators on images: do they have the >> same bit-map representation right now, and would they continue to have the >> same bit-map representation after rotation, reflection, scaling, etc? >> >> So what should the drawing primitives be? ?The obvious base cases (to me) >> are ellipses (filled or outline), polygons (filled or outline), line >> segments, and bitmaps. ?And maybe text in a specified font. ?The obvious >> operators, off the top of my head, are vertical and horizontal >> concatenation, overlay (with translation), rotation, reflection, scaling, >> and clipping. ?Concatenation is the composition of an overlay and a >> translation. ?Conveniently enough, rotation, reflection, translation, and >> scaling (as well as skewing) can all be represented as matrix >> multiplication, and matrix multiplication (at least in a pure, exact >> mathematical world) is associative, so any SEQUENCE of rotations, >> translations, reflections, scalings, and skews can be represented as a >> single matrix multiplication. ?Overlay, and clipping to an arbitrary >> rectangular region aligned with the current coordinate system, should be >> trivial (although they can't be represented as matrix multiplication). >> >> Now, about exactness. ?It would be nice if (reflect-horiz (rotate 72 (rotate >> 200 (rotate 88 (reflect-horiz blah))))) were exactly equal to blah. ?If you >> represent rotation, reflection, scaling, and skewing by matrix >> multiplication with floating-point matrix entries, it may not be. ?On the >> other hand, if you represent each of these operations by separate tree nodes >> even when they're in sequence, flattening (and therefore displaying) becomes >> needlessly expensive, especially after you've run an animation of a spinning >> star for a few minutes. ?Obviously, images coming from photographs should by >> rights be considered inexact, as should anything stored in a lossy format >> like JPEG... and for display on a physical monitor, we don't need exact >> images anyway. ?Why don't we just cut the Gordian knot and say that ALL >> images and ALL functions on them are inexact, and you can't reasonably rely >> on the equality I mentioned at the top of this paragraph? ?At low >> magnification, they may turn out to have equal bitmaps, just as the result >> of a floating-point computation may be within a large delta of another >> floating-point value, but one would no more expect exact equality on >> computed images than on computed inexact numbers. >> >> Most of what I've said above applies to 3-D "images" too, of course, but >> that's another bucket of worms.... >> >> >> Stephen Bloch >> sbloch@adelphi.edu >> >> > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From robby at eecs.northwestern.edu Wed Nov 18 16:50:01 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Wed Nov 18 16:50:23 2009 Subject: [plt-scheme] 2htdp/image In-Reply-To: <904774730911181345q58e70a71pdf15b7cc715170d2@mail.gmail.com> References: <932b2f1f0910131606n7f356cbcvfaf80896ffb2ed1b@mail.gmail.com> <932b2f1f0911161803o3565bb20m300b6c20aca24b46@mail.gmail.com> <904774730911161809h726fde11o353918a7446f13b7@mail.gmail.com> <932b2f1f0911161812i1b73e85j19af81472592e6a5@mail.gmail.com> <904774730911161828m6ca01823p83cacdb162c88026@mail.gmail.com> <990e0c030911161834j22d94793la7b34297824d1aed@mail.gmail.com> <3CC43AC9-BDD1-4344-8552-FE103183E6D6@adelphi.edu> <932b2f1f0911181307l3ab5a075s2ca7421bc286cd0b@mail.gmail.com> <904774730911181345q58e70a71pdf15b7cc715170d2@mail.gmail.com> Message-ID: <932b2f1f0911181350r2633e633v55f73af055ce757a@mail.gmail.com> The complaints we were getting were just with creating the bitmaps at all. (Internally, the representation of an htdp/image bitmap is either a function that draws the bitmap (fast for drawing, but can't do equality) or a bitmap with all the pixel values. The bitmap was computed when an equality test happened or when image->color-list or similar was used. It was making the images into bitmaps that triggered the performance problems we saw.) Robby On Wed, Nov 18, 2009 at 3:45 PM, Todd O'Bryan wrote: > In my (aborted) attempt to reproduce the functionality of the teaching > languages in Python, I used PNG encryption for bitmaps. Since PNG is > lossless and well understood, I just saved bitmaps as a string > containing the base64 encoding of the PNG data (obtained by the same > method for all bitmaps). Equality worked out to simple string > equality. > > I don't know how hard it is to PNG-ify an image, but I can't imagine > it'd be much more expensive than creating the bitmap itself. If you > attach the PNG data to the structure, then you have an easy way to do > bitmap comparison that's at most O(width * height), and probably much > better assuming you do simple compression on the PNG data. > > Todd > > On Wed, Nov 18, 2009 at 4:07 PM, Robby Findler > wrote: >> What you describe in the first paragraph (below) is what htdp/image >> did, except that it didn't provide the second equality operator, only >> the bitmap-based one. One of the things we found is that doing a full >> bitmap comparison for equality was too expensive for systems and that >> was part of the impetus for 2htdp/image. >> >> So far, all of the trickyness in 2htdp/image is in setting up the >> precise data definition for images to make equality match what one >> would expect (and still be linear time (usually)). >> >> Finally, what you say about matrices (in a followup message) doesn't >> really work for rotation because you need to compute the bounding box >> of the shape (to be prepared for future overlays and stuff) and thus >> you actually need to do a linear time computation to find that bound >> box (ie, apply the matrix to all of the points in the shape)-- it >> isn't just (constant time) matrix multiply. But yes, thinking thru all >> of these issues is what we've been doing recently. >> >> Robby >> >> On Wed, Nov 18, 2009 at 9:13 AM, Stephen Bloch wrote: >>> I think this is a reasonable approach to images: by default, store them in >>> terms of drawing primitives (so rotation, scaling, etc. work nicely) but for >>> display and some other purposes, "flatten" them to bitmaps. ?It also makes >>> sense to have two different equality operators on images: do they have the >>> same bit-map representation right now, and would they continue to have the >>> same bit-map representation after rotation, reflection, scaling, etc? >>> >>> So what should the drawing primitives be? ?The obvious base cases (to me) >>> are ellipses (filled or outline), polygons (filled or outline), line >>> segments, and bitmaps. ?And maybe text in a specified font. ?The obvious >>> operators, off the top of my head, are vertical and horizontal >>> concatenation, overlay (with translation), rotation, reflection, scaling, >>> and clipping. ?Concatenation is the composition of an overlay and a >>> translation. ?Conveniently enough, rotation, reflection, translation, and >>> scaling (as well as skewing) can all be represented as matrix >>> multiplication, and matrix multiplication (at least in a pure, exact >>> mathematical world) is associative, so any SEQUENCE of rotations, >>> translations, reflections, scalings, and skews can be represented as a >>> single matrix multiplication. ?Overlay, and clipping to an arbitrary >>> rectangular region aligned with the current coordinate system, should be >>> trivial (although they can't be represented as matrix multiplication). >>> >>> Now, about exactness. ?It would be nice if (reflect-horiz (rotate 72 (rotate >>> 200 (rotate 88 (reflect-horiz blah))))) were exactly equal to blah. ?If you >>> represent rotation, reflection, scaling, and skewing by matrix >>> multiplication with floating-point matrix entries, it may not be. ?On the >>> other hand, if you represent each of these operations by separate tree nodes >>> even when they're in sequence, flattening (and therefore displaying) becomes >>> needlessly expensive, especially after you've run an animation of a spinning >>> star for a few minutes. ?Obviously, images coming from photographs should by >>> rights be considered inexact, as should anything stored in a lossy format >>> like JPEG... and for display on a physical monitor, we don't need exact >>> images anyway. ?Why don't we just cut the Gordian knot and say that ALL >>> images and ALL functions on them are inexact, and you can't reasonably rely >>> on the equality I mentioned at the top of this paragraph? ?At low >>> magnification, they may turn out to have equal bitmaps, just as the result >>> of a floating-point computation may be within a large delta of another >>> floating-point value, but one would no more expect exact equality on >>> computed images than on computed inexact numbers. >>> >>> Most of what I've said above applies to 3-D "images" too, of course, but >>> that's another bucket of worms.... >>> >>> >>> Stephen Bloch >>> sbloch@adelphi.edu >>> >>> >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > From sbloch at adelphi.edu Wed Nov 18 17:24:01 2009 From: sbloch at adelphi.edu (Stephen Bloch) Date: Wed Nov 18 17:25:35 2009 Subject: [plt-scheme] 2htdp/image In-Reply-To: <932b2f1f0911181337w99bc3ffyf6c4a37aedbe822d@mail.gmail.com> References: <932b2f1f0910131606n7f356cbcvfaf80896ffb2ed1b@mail.gmail.com> <932b2f1f0911161803o3565bb20m300b6c20aca24b46@mail.gmail.com> <904774730911161809h726fde11o353918a7446f13b7@mail.gmail.com> <932b2f1f0911161812i1b73e85j19af81472592e6a5@mail.gmail.com> <904774730911161828m6ca01823p83cacdb162c88026@mail.gmail.com> <990e0c030911161834j22d94793la7b34297824d1aed@mail.gmail.com> <3CC43AC9-BDD1-4344-8552-FE103183E6D6@adelphi.edu> <932b2f1f0911181307l3ab5a075s2ca7421bc286cd0b@mail.gmail.com> <69BFE4AB-10FF-4BD5-9572-1CAE721E75C0@adelphi.edu> <932b2f1f0911181337w99bc3ffyf6c4a37aedbe822d@mail.gmail.com> Message-ID: > Yes, and the current htdp/image library does this (and so your > libraries inherit this behavior, I believe). I hadn't realized that; I thought they were just being stored as bitmaps. I would have written "tiles" differently.... > >> Do you really need a bounding box precomputed (as opposed to >> computing it >> only when you actually need it)? > > No, but most operations need it, so it will be computed. Repeated > rotations (without intervening overlays) won't need it, but it didn't > seem worth going the lazy route for that, since it seems uncommon. Any sequence of {rotations, reflections, scalings, translations, skews} doesn't need it. Of course, it's really easy to compute for reflections, scalings, and translations, but still not technically necessary. > >> How about replacing the bounding box with a convex hull? ... > I thought about that too, but it didn't seem worth the effort because > it won't give an asymptotic speed up. No, by itself it won't, but it means you're no longer tied to "boxes" parallel to the axes, so you no longer have an obligation to choose such a box after each operation. As a bonus, cropping can be implemented by ONLY operating on the convex hull (not touching the bitmap unless it's convenient), and in most cases will have the effect of reducing the number of vertices. > That possibility is still open, of course, if we do run into > performance problems (but it seems like premature optimization at this > point). Fair enough. > >> >> ... "conservative convex hull"... > But then the bounding boxes will start getting less precise, no? You > don't want a situation where repeating a series of operations and > (what seem like) inverses grows the bounding box. Can you avoid that > here? What operations increase the number of vertices in a convex hull? Overlay, or (rarely) crop. Neither of which has an inverse. I guess if the "certain distance" within which vertices get merged were an absolute number, scaling could trigger vertex-merging. So make it a relative radius, or just don't do vertex-merging unless the number of vertices gets annoyingly large -- which it never will from invertible linear operations. Hmm... What would have an "annoyingly large" convex hull? A circle or an ellipse; good thing nobody ever uses those :) Steve From robby at eecs.northwestern.edu Wed Nov 18 17:29:55 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Wed Nov 18 17:30:12 2009 Subject: [plt-scheme] 2htdp/image In-Reply-To: References: <932b2f1f0910131606n7f356cbcvfaf80896ffb2ed1b@mail.gmail.com> <904774730911161809h726fde11o353918a7446f13b7@mail.gmail.com> <932b2f1f0911161812i1b73e85j19af81472592e6a5@mail.gmail.com> <904774730911161828m6ca01823p83cacdb162c88026@mail.gmail.com> <990e0c030911161834j22d94793la7b34297824d1aed@mail.gmail.com> <3CC43AC9-BDD1-4344-8552-FE103183E6D6@adelphi.edu> <932b2f1f0911181307l3ab5a075s2ca7421bc286cd0b@mail.gmail.com> <69BFE4AB-10FF-4BD5-9572-1CAE721E75C0@adelphi.edu> <932b2f1f0911181337w99bc3ffyf6c4a37aedbe822d@mail.gmail.com> Message-ID: <932b2f1f0911181429h1d70d377k241bbf6afdeeca69@mail.gmail.com> On Wed, Nov 18, 2009 at 4:24 PM, Stephen Bloch wrote: >>> Do you really need a bounding box precomputed (as opposed to computing it >>> only when you actually need it)? >> >> No, but most operations need it, so it will be computed. Repeated >> rotations (without intervening overlays) won't need it, but it didn't >> seem worth going the lazy route for that, since it seems uncommon. > > Any sequence of {rotations, reflections, scalings, translations, skews} > doesn't need it. ?Of course, it's really easy to compute for reflections, > scalings, and translations, but still not technically necessary. Yes, right. When those are in the library then the tradeoffs may change. >> >>> How about replacing the bounding box with a convex hull? ?... > >> I thought about that too, but it didn't seem worth the effort because >> it won't give an asymptotic speed up. > > No, by itself it won't, but it means you're no longer tied to "boxes" > parallel to the axes, so you no longer have an obligation to choose such a > box after each operation. > > As a bonus, cropping can be implemented by ONLY operating on the convex hull > (not touching the bitmap unless it's convenient), and in most cases will > have the effect of reducing the number of vertices. Cropping still has the other problem that it adds to the set of images expressible by the image library and thus has some non-trivial implications on equality. I'm not sure how that would go. We could go to a most post-script (or dc-path%)-like model, but even there I think that cropping increases the set of expressible images (altho I'm not sure; I'm not up to speed on beziers enough to be sure). Anyways, that's definitely a problem for another (very very rainy) day. Robby From alon173 at hotmail.com Mon Nov 16 07:25:41 2009 From: alon173 at hotmail.com (alon arditi) Date: Thu Nov 19 08:05:35 2009 Subject: [plt-scheme] i need help Message-ID: im trying to configure constants(strucuts) that have other constants in theyre parameters and vice versa for example (define neamt(make-city 'neamt 234 (list(list lasi 87)))) (define lasi(make-city 'lasi 226 (list(list vaslui 92)(list neamt 87)))) i get error for the first decleration that lasi is not defined what to do? please help me _________________________________________________________________ Windows Live: Keep your friends up to date with what you do online. http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_1:092010 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091116/eec93b9d/attachment-0001.htm From aconchillo at gmail.com Tue Nov 17 11:22:28 2009 From: aconchillo at gmail.com (=?UTF-8?Q?Aleix_Conchillo_Flaqu=C3=A9?=) Date: Thu Nov 19 08:05:45 2009 Subject: [plt-scheme] slideshow with multiple displays In-Reply-To: References: Message-ID: Hi, continuing with my Slideshow tests, today I connected my laptop to a projector setting it as a virtual desktop. The result is that the slides are centered in the middle of the virtual desktop and I don't know how to move them (screenshot attached). The idea was to have the comments window in one screen and the presentation in the projector. I know this is possible (jfp05-ff.pdf - 4.6 Display Interaction), but I don't know if I'm missing something. Thanks in advance, Aleix PS: my last message is waiting for moderator (attachment too big). -------------- next part -------------- A non-text attachment was scrubbed... Name: slideshow-small.jpg Type: image/jpeg Size: 50612 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091117/d415dd55/slideshow-small-0001.jpg From matthias at ccs.neu.edu Thu Nov 19 08:51:34 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Nov 19 08:52:04 2009 Subject: [plt-scheme] i need help In-Reply-To: References: Message-ID: <7F1D7FD3-F056-49F1-B225-31C54D90FF89@ccs.neu.edu> In ASL: (define-struct city (a b c)) (shared ((neamt (make-city 'neamt 234 (list (list lasi 87)))) (lasi (make-city 'lasi 226 (list (list "!!!vaslui!!!" 92) (list neamt 87))))) (list neamt lasi)) In Module: #lang scheme (define-struct city (a b c)) (define-values (neamt lasi) (shared ((neamt (make-city 'neamt 234 (list (list lasi 87)))) (lasi (make-city 'lasi 226 (list (list "!!!vaslui!!!" 92) (list neamt 87))))) (values neamt lasi))) On Nov 16, 2009, at 7:25 AM, alon arditi wrote: > im trying to configure constants(strucuts) that have other constants in theyre parameters and vice versa > > for example > (define neamt(make-city 'neamt 234 (list(list lasi 87)))) > (define lasi(make-city 'lasi 226 (list(list vaslui 92)(list neamt 87)))) > > i get error for the first decleration that lasi is not defined > > what to do? please help me > > Windows Live: Keep your friends up to date with what you do online. _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091119/fe9256c7/attachment.htm From robby at eecs.northwestern.edu Thu Nov 19 09:28:32 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Nov 19 09:28:52 2009 Subject: [plt-scheme] slideshow with multiple displays In-Reply-To: References: Message-ID: <932b2f1f0911190628t2332d50aq98c3c8be18b5a05a@mail.gmail.com> For the moment, I think that the only thing you can do is to mirror the displays and then see the same thing on both screens or use the arrow keys to move the slideshow window around. Hopefully we'll be able to get better support in the core for X & multiple displays at some point. Sorry, Robby On Tue, Nov 17, 2009 at 10:22 AM, Aleix Conchillo Flaqu? wrote: > Hi, > > continuing with my Slideshow tests, today I connected my laptop to a > projector setting it as a virtual desktop. The result is that the > slides are centered in the middle of the virtual desktop and I don't > know how to move them (screenshot attached). The idea was to have the > comments window in one screen and the presentation in the projector. > > I know this is possible (jfp05-ff.pdf - 4.6 Display Interaction), but > I don't know if I'm missing something. > > Thanks in advance, > > Aleix > > PS: my last message is waiting for moderator (attachment too big). > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From rafkind at cs.utah.edu Thu Nov 19 10:28:54 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Thu Nov 19 10:32:10 2009 Subject: [plt-scheme] mathematicians lament Message-ID: <4B056436.9000509@cs.utah.edu> http://www.maa.org/devlin/LockhartsLament.pdf This is a comment on the state of teaching mathematics. I'm not sure how old it is but a few parallels can probably be drawn to computer science (or maybe will be drawn in a few years). The first 3 pages are pretty amusing, at least. From grettke at acm.org Thu Nov 19 10:45:10 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Nov 19 10:45:28 2009 Subject: [plt-scheme] mathematicians lament In-Reply-To: <4B056436.9000509@cs.utah.edu> References: <4B056436.9000509@cs.utah.edu> Message-ID: <756daca50911190745g33e971cav4eb06619467ed83b@mail.gmail.com> On Thu, Nov 19, 2009 at 9:28 AM, Jon Rafkind wrote: > This is a comment on the state of teaching mathematics. I'm not sure how old > it is but a few parallels can probably be drawn to computer science (or > maybe will be drawn in a few years). The first 3 pages are pretty amusing, > at least. Notable points: p5. Mathematics is the art of explanation. p6. Math is not about following directions, it is about making new ones. p7. It isn?t doing anyone any good having vague memories of formulas and clear memories of hating them. p11. Teaching is not about information. It?s about having an honest intellectual relationship with your students. Teaching means openness and honesty, an ability to share excitement, and a love of learning. p21. Mathematics is about removing obstacles to our intuition, and keeping things simple. From sk at cs.brown.edu Thu Nov 19 10:49:15 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Nov 19 10:49:52 2009 Subject: [plt-scheme] mathematicians lament In-Reply-To: <4B056436.9000509@cs.utah.edu> References: <4B056436.9000509@cs.utah.edu> Message-ID: I believe that's what AP stands for: Advanced Paint-by-numbers. Shriram From nowgate at yahoo.com Thu Nov 19 11:23:35 2009 From: nowgate at yahoo.com (michael rice) Date: Thu Nov 19 11:30:38 2009 Subject: [plt-scheme] mathematicians lament In-Reply-To: <4B056436.9000509@cs.utah.edu> Message-ID: <555757.23144.qm@web31106.mail.mud.yahoo.com> So, mandatory sex education should result in ... um, a lower birth rate? Michael --- On Thu, 11/19/09, Jon Rafkind wrote: From: Jon Rafkind Subject: [plt-scheme] mathematicians lament To: "PLT-Scheme Mailing List" Date: Thursday, November 19, 2009, 10:28 AM http://www.maa.org/devlin/LockhartsLament.pdf This is a comment on the state of teaching mathematics. I'm not sure how old it is but a few parallels can probably be drawn to computer science (or maybe will be drawn in a few years). The first 3 pages are pretty amusing, at least. _________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-scheme -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091119/b7f55759/attachment.htm From carl.eastlund at gmail.com Thu Nov 19 11:43:31 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Thu Nov 19 11:44:18 2009 Subject: [plt-scheme] mathematicians lament In-Reply-To: <555757.23144.qm@web31106.mail.mud.yahoo.com> References: <4B056436.9000509@cs.utah.edu> <555757.23144.qm@web31106.mail.mud.yahoo.com> Message-ID: <990e0c030911190843y4ebc5e31n93c49d4a517e3135@mail.gmail.com> If you make it dry and boring enough. Start with calculating the reproduction rates of people who go at it like... well, rabbits... and there you've got the Fibonacci sequence. From there on out, it's dry statistics and formulae all the way ;) Carl Eastlund On Thu, Nov 19, 2009 at 11:23 AM, michael rice wrote: > So, mandatory sex education should result in ... um, a lower birth rate? > > Michael > > --- On *Thu, 11/19/09, Jon Rafkind * wrote: > > > From: Jon Rafkind > Subject: [plt-scheme] mathematicians lament > To: "PLT-Scheme Mailing List" > Date: Thursday, November 19, 2009, 10:28 AM > > > http://www.maa.org/devlin/LockhartsLament.pdf > > This is a comment on the state of teaching mathematics. I'm not sure how > old it is but a few parallels can probably be drawn to computer science (or > maybe will be drawn in a few years). The first 3 pages are pretty amusing, > at least. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091119/96c8c3c2/attachment-0001.htm From martindemello at gmail.com Thu Nov 19 11:50:22 2009 From: martindemello at gmail.com (Martin DeMello) Date: Thu Nov 19 11:50:43 2009 Subject: [plt-scheme] mathematicians lament In-Reply-To: <555757.23144.qm@web31106.mail.mud.yahoo.com> References: <4B056436.9000509@cs.utah.edu> <555757.23144.qm@web31106.mail.mud.yahoo.com> Message-ID: Teenagers who know what they're doing are less likely to get pregnant :) m. On Thu, Nov 19, 2009 at 9:53 PM, michael rice wrote: > > So, mandatory sex education should result in ... um, a lower birth rate? > > Michael > > --- On Thu, 11/19/09, Jon Rafkind wrote: > > From: Jon Rafkind > Subject: [plt-scheme] mathematicians lament > To: "PLT-Scheme Mailing List" > Date: Thursday, November 19, 2009, 10:28 AM > > http://www.maa.org/devlin/LockhartsLament.pdf > > This is a comment on the state of teaching mathematics. I'm not sure how old it is but a few parallels can probably be drawn to computer science (or maybe will be drawn in a few years). The first 3 pages are pretty amusing, at least. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From matthias at ccs.neu.edu Thu Nov 19 12:02:47 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Nov 19 12:03:15 2009 Subject: [plt-scheme] mathematicians lament In-Reply-To: References: <4B056436.9000509@cs.utah.edu> <555757.23144.qm@web31106.mail.mud.yahoo.com> Message-ID: I have never seen any evidence for this. Not that it's a PLT topic. On Nov 19, 2009, at 11:50 AM, Martin DeMello wrote: > Teenagers who know what they're doing are less likely to get pregnant :) > > m. > > On Thu, Nov 19, 2009 at 9:53 PM, michael rice wrote: >> >> So, mandatory sex education should result in ... um, a lower birth rate? >> >> Michael >> >> --- On Thu, 11/19/09, Jon Rafkind wrote: >> >> From: Jon Rafkind >> Subject: [plt-scheme] mathematicians lament >> To: "PLT-Scheme Mailing List" >> Date: Thursday, November 19, 2009, 10:28 AM >> >> http://www.maa.org/devlin/LockhartsLament.pdf >> >> This is a comment on the state of teaching mathematics. I'm not sure how old it is but a few parallels can probably be drawn to computer science (or maybe will be drawn in a few years). The first 3 pages are pretty amusing, at least. >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From masm at acm.org Thu Nov 19 16:54:58 2009 From: masm at acm.org (Marco Monteiro) Date: Thu Nov 19 16:55:16 2009 Subject: [plt-scheme] #%app literal does not match in syntax-case pattern Message-ID: <252c42fe0911191354j2ce63f73q16c15da540eeba72@mail.gmail.com> Hello. I have this reader in pltcollects/masm/lang/reader.ss ------- (module reader syntax/module-reader -ignored- ;; Reads and expands the module; then, use process-body on the module definitions and ;; expressions, to efectivelly remove (replace by (void)) the application expressions and ;; define all variables to be null. #:wrapper2 (lambda (in read stx?) (let ([mod (let ([m (read in)]) (if stx? m (datum->syntax #f m)))]) (syntax-case mod () [(module name lang* . body) (let ([lang `(file ,(path->string (resolved-module-path-name masm-lang-path)))]) (with-syntax ([lang (datum->syntax #'lang* lang #'lang*)]) (let ([expanded-mod (parameterize ([current-namespace (make-base-namespace)]) (expand #'(module name lang . body)))]) (let ([r (syntax-case expanded-mod () [(module name lang (module-begin . body*)) (with-syntax ([body (process-body #'body*)]) (syntax/loc mod (module name lang (module-begin . body))))])]) (if stx? r (syntax->datum r))))))]))) (require scheme/runtime-path) (define-runtime-module-path masm-lang-path "../masm-lang.ss") (define (process-body body) (datum->syntax body (map process-form (syntax->list body)))) (define (process-form stx) (syntax-case stx (define-values #%app) [(define-values (id) value) #'(define-values (id) (void))] [(#%app . _) #'(void)] [_ (error "unsupported form" (syntax->datum stx))])) ) ------- and this in pltcollects/masm/masm-lang.ss ------- #lang scheme (define-syntax (_#%module-begin stx) (syntax-case stx () [(_ . forms) #'(#%plain-module-begin . forms)])) (provide (rename-out (_#%module-begin #%module-begin)) define #%app #%datum) ------- . When I tried to use this language with the code ------- #lang masm (define x (2 1)) (1 2) ------- I was expecting no error. But I got "pltcollects/masm/lang/reader.ss:36:7: unsupported form (#%app (quote 1) (quote 2))". The process-form procedure matches the literal define-values, but not the literal #%app. Why does this happen? I tried to require #%app from scheme module both at phases 0 an 1, but it still does not work. I was thinking that the problem could be the (make-base-namespace), but using module->namespace with the masm-lang.ss module does not work. What am I missing? Thanks. Marco -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091119/0bf25e83/attachment.htm From ntoronto at cs.byu.edu Thu Nov 19 16:59:27 2009 From: ntoronto at cs.byu.edu (Neil Toronto) Date: Thu Nov 19 16:56:59 2009 Subject: [plt-scheme] mathematicians lament In-Reply-To: <4B056436.9000509@cs.utah.edu> References: <4B056436.9000509@cs.utah.edu> Message-ID: <4B05BFBF.40407@cs.byu.edu> Jon Rafkind wrote: > http://www.maa.org/devlin/LockhartsLament.pdf > > This is a comment on the state of teaching mathematics. I'm not sure how > old it is but a few parallels can probably be drawn to computer science > (or maybe will be drawn in a few years). The first 3 pages are pretty > amusing, at least. Does anybody know of a list of example problems like the ones he gives in the essay? I'd love to have a big list of math teasers to draw from for dinner conversation with my kids. Last month we had a great discussion about the "Ten in the Bed" song. ("... then the little one said, 'Move over! move over!' So they all rolled over and one fell off...") I helped them through a (not at all rigorous) inductive proof that no matter how many kids started in the bed ("a million kids!"), the bed always ends up empty. We've defined infinity as the number of toys in a box where, if you take a toy out of it, I can always find a bigger toy in it. These have been some of the liveliest discussions, and I'm looking for source material. Neil T From dherman at ccs.neu.edu Thu Nov 19 18:04:40 2009 From: dherman at ccs.neu.edu (Dave Herman) Date: Thu Nov 19 18:05:07 2009 Subject: [plt-scheme] include and sub-directories Message-ID: <4B05CF08.2030700@ccs.neu.edu> When I try: #lang scheme/base (require scheme/include) (include "foo/bar.scm") I get the error: include: bad relative pathname string in: "foo/bar.scm" I tried looking at the source but got lost once I saw it called `resolve-path-spec' with three arguments, which the docs say takes exactly four arguments. Uncle! Thanks, Dave From dherman at ccs.neu.edu Thu Nov 19 18:34:53 2009 From: dherman at ccs.neu.edu (Dave Herman) Date: Thu Nov 19 18:35:21 2009 Subject: [plt-scheme] include and sub-directories In-Reply-To: <4B05CF08.2030700@ccs.neu.edu> References: <4B05CF08.2030700@ccs.neu.edu> Message-ID: <4B05D61D.4060704@ccs.neu.edu> A-ha. My example wasn't quite sufficient to demonstrate the bug. It's when the directory has dots in the name: #lang scheme/base (require scheme/include) (include "foo-0.2.1/bar.scm") Error: include: bad relative pathname string in "foo-0.2.1/bar.scm" Dave Dave Herman wrote: > When I try: > > #lang scheme/base > (require scheme/include) > (include "foo/bar.scm") > > I get the error: > > include: bad relative pathname string in: "foo/bar.scm" > > I tried looking at the source but got lost once I saw it called > `resolve-path-spec' with three arguments, which the docs say takes > exactly four arguments. Uncle! > > Thanks, > Dave > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From carl.eastlund at gmail.com Thu Nov 19 18:42:35 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Thu Nov 19 18:43:16 2009 Subject: [plt-scheme] include and sub-directories In-Reply-To: <4B05D61D.4060704@ccs.neu.edu> References: <4B05CF08.2030700@ccs.neu.edu> <4B05D61D.4060704@ccs.neu.edu> Message-ID: <990e0c030911191542q284d9eb1gcca8c317fe765fc6@mail.gmail.com> Good catch. http://docs.plt-scheme.org/reference/include.html#(form._((lib._scheme/include..ss)._include)) The docs for include (linked immediately above) refer to module paths as interpreted by require. http://docs.plt-scheme.org/reference/require.html#(form._((lib._scheme/base..ss)._require)) The docs for require (linked immediately above) define a module path using the following prose: "A path relative to the containing source (as determined by current-load-relative-directory or current-directory). Regardless of the current platform, rel-string is always parsed as a Unix-format relative path: / is the path delimiter (multiple adjacent /s are treated as a single delimiter), .. accesses the parent directory, and . accesses the current directory. The path cannot be empty or contain a leading or trailing slash, path elements before than the last one cannot include a file suffix (i.e., a . in an element other than . or ..), and the only allowed characters are ASCII letters, ASCII digits, -, +, _, ., /, and %. Furthermore, a % is allowed only when followed by two lowercase hexadecimal digits, and the digits must form a number that is not the ASCII value of a letter, digit, -, +, or _." For better or for worse, it states that "path elements before than the last one cannot include a file suffix (i.e., a . in an element other than . or ..)". So what you have run into is an annoying and obscure feature, but a documented and apparently intentional one. Carl Eastlund On Thu, Nov 19, 2009 at 6:34 PM, Dave Herman wrote: > A-ha. My example wasn't quite sufficient to demonstrate the bug. It's when > the directory has dots in the name: > > ? ?#lang scheme/base > ? ?(require scheme/include) > ? ?(include "foo-0.2.1/bar.scm") > > Error: include: bad relative pathname string in "foo-0.2.1/bar.scm" > > Dave From dherman at ccs.neu.edu Thu Nov 19 18:57:15 2009 From: dherman at ccs.neu.edu (Dave Herman) Date: Thu Nov 19 18:57:43 2009 Subject: [plt-scheme] include and sub-directories In-Reply-To: <990e0c030911191542q284d9eb1gcca8c317fe765fc6@mail.gmail.com> References: <4B05CF08.2030700@ccs.neu.edu> <4B05D61D.4060704@ccs.neu.edu> <990e0c030911191542q284d9eb1gcca8c317fe765fc6@mail.gmail.com> Message-ID: <4B05DB5B.7000508@ccs.neu.edu> > So what you have run into is an annoying and obscure feature, but a > documented and apparently intentional one. I think the error message could be more suggestive, and those docs are pretty impenetrable. But I'm glad it's cleared up. Thanks for the help! Dave From robby at eecs.northwestern.edu Thu Nov 19 19:01:39 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Nov 19 19:02:00 2009 Subject: [plt-scheme] include and sub-directories In-Reply-To: <4B05DB5B.7000508@ccs.neu.edu> References: <4B05CF08.2030700@ccs.neu.edu> <4B05D61D.4060704@ccs.neu.edu> <990e0c030911191542q284d9eb1gcca8c317fe765fc6@mail.gmail.com> <4B05DB5B.7000508@ccs.neu.edu> Message-ID: <932b2f1f0911191601o63b16e6hbde7850f6add0c49@mail.gmail.com> This is probably reasonably considered a bug. :) On Thursday, November 19, 2009, Dave Herman wrote: > > So what you have run into is an annoying and obscure feature, but a > documented and apparently intentional one. > > > I think the error message could be more suggestive, and those docs are pretty impenetrable. But I'm glad it's cleared up. Thanks for the help! > > Dave > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From jay.mccarthy at gmail.com Thu Nov 19 19:09:45 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Nov 19 19:10:06 2009 Subject: [plt-scheme] include and sub-directories In-Reply-To: <932b2f1f0911191601o63b16e6hbde7850f6add0c49@mail.gmail.com> References: <4B05CF08.2030700@ccs.neu.edu> <4B05D61D.4060704@ccs.neu.edu> <990e0c030911191542q284d9eb1gcca8c317fe765fc6@mail.gmail.com> <4B05DB5B.7000508@ccs.neu.edu> <932b2f1f0911191601o63b16e6hbde7850f6add0c49@mail.gmail.com> Message-ID: My impression is that this is to ensure source compatibility on the many platforms we support. I am willing to bet that there is a version of Windows or Mac OS 9 that these rules are specifically designed to be safe wrt. Jay On Thu, Nov 19, 2009 at 5:01 PM, Robby Findler wrote: > This is probably reasonably considered a bug. :) > > On Thursday, November 19, 2009, Dave Herman wrote: >> >> So what you have run into is an annoying and obscure feature, but a >> documented and apparently intentional one. >> >> >> I think the error message could be more suggestive, and those docs are pretty impenetrable. But I'm glad it's cleared up. Thanks for the help! >> >> Dave >> >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From dherman at ccs.neu.edu Thu Nov 19 19:18:59 2009 From: dherman at ccs.neu.edu (Dave Herman) Date: Thu Nov 19 19:19:28 2009 Subject: [plt-scheme] include and sub-directories In-Reply-To: References: <4B05CF08.2030700@ccs.neu.edu> <4B05D61D.4060704@ccs.neu.edu> <990e0c030911191542q284d9eb1gcca8c317fe765fc6@mail.gmail.com> <4B05DB5B.7000508@ccs.neu.edu> <932b2f1f0911191601o63b16e6hbde7850f6add0c49@mail.gmail.com> Message-ID: <4B05E073.6070001@ccs.neu.edu> I submitted a bug but I leave it to y'all -- I'm fine working around it by replacing '.' with '_' in my pathname. Thanks, Dave Jay McCarthy wrote: > My impression is that this is to ensure source compatibility on the > many platforms we support. I am willing to bet that there is a version > of Windows or Mac OS 9 that these rules are specifically designed to > be safe wrt. > > Jay > > On Thu, Nov 19, 2009 at 5:01 PM, Robby Findler > wrote: >> This is probably reasonably considered a bug. :) >> >> On Thursday, November 19, 2009, Dave Herman wrote: >>> So what you have run into is an annoying and obscure feature, but a >>> documented and apparently intentional one. >>> >>> >>> I think the error message could be more suggestive, and those docs are pretty impenetrable. But I'm glad it's cleared up. Thanks for the help! >>> >>> Dave >>> >>> _________________________________________________ >>> For list-related administrative tasks: >>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > > > From robby at eecs.northwestern.edu Thu Nov 19 19:20:13 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Nov 19 19:20:33 2009 Subject: [plt-scheme] include and sub-directories In-Reply-To: <4B05E073.6070001@ccs.neu.edu> References: <4B05CF08.2030700@ccs.neu.edu> <4B05D61D.4060704@ccs.neu.edu> <990e0c030911191542q284d9eb1gcca8c317fe765fc6@mail.gmail.com> <4B05DB5B.7000508@ccs.neu.edu> <932b2f1f0911191601o63b16e6hbde7850f6add0c49@mail.gmail.com> <4B05E073.6070001@ccs.neu.edu> Message-ID: <932b2f1f0911191620r6040d88cs86f4ecbdf7f79b4e@mail.gmail.com> I believe what Jay writes is true for require and that the same code is used for require and include, but it somehow seems less important for include. Maybe the right thing is a special argument to include to say "don't down on my groove d00d". Robby On Thu, Nov 19, 2009 at 6:18 PM, Dave Herman wrote: > I submitted a bug but I leave it to y'all -- I'm fine working around it by > replacing '.' with '_' in my pathname. > > Thanks, > Dave > > Jay McCarthy wrote: >> >> My impression is that this is to ensure source compatibility on the >> many platforms we support. I am willing to bet that there is a version >> of Windows or Mac OS 9 that these rules are specifically designed to >> be safe wrt. >> >> Jay >> >> On Thu, Nov 19, 2009 at 5:01 PM, Robby Findler >> wrote: >>> >>> This is probably reasonably considered a bug. :) >>> >>> On Thursday, November 19, 2009, Dave Herman wrote: >>>> >>>> So what you have run into is an annoying and obscure feature, but a >>>> documented and apparently intentional one. >>>> >>>> >>>> I think the error message could be more suggestive, and those docs are >>>> pretty impenetrable. But I'm glad it's cleared up. Thanks for the help! >>>> >>>> Dave >>>> >>>> _________________________________________________ >>>> ?For list-related administrative tasks: >>>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>>> >>> _________________________________________________ >>> ?For list-related administrative tasks: >>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>> >> >> >> > > From eli at barzilay.org Fri Nov 20 00:15:40 2009 From: eli at barzilay.org (Eli Barzilay) Date: Fri Nov 20 00:16:01 2009 Subject: [plt-scheme] #%app literal does not match in syntax-case pattern In-Reply-To: <252c42fe0911191354j2ce63f73q16c15da540eeba72@mail.gmail.com> References: <252c42fe0911191354j2ce63f73q16c15da540eeba72@mail.gmail.com> Message-ID: <19206.9724.532506.576793@winooski.ccs.neu.edu> On Nov 19, Marco Monteiro wrote: > Hello. > > I have this reader in pltcollects/masm/lang/reader.ss > > ------- > (module reader syntax/module-reader > [...] > ) I didn't actually read your code, but I think that I see your general problem. Roughly speaking, the best (or the sanest) rule of thumb to follow is for the reader module to not do anything beyond reading raw syntax. For example, even something like (define (my-reader ...) ... #'(+ 1 2) ...) would be wrong because it plants a piece of syntax with a lexical context that comes from the reader module itself. Instead, this should be: (define (my-reader ...) ... (datum->syntax #f '(+ 1 2) ...) ...) which creates such a raw piece of syntax. If you follow this line, then you'll see why uses of `expand' in the reader module (or any need for making a namespace) are bad: they mix the two levels of the reader and macro expansion. It's basically the same as mixing evaluation with reading. Note that I'm not saying that what you're trying to do is impossible (to say that, I'll need to at least read and understand what you're trying to do) -- just that there's some problems that are inherent to that approach. For example, it might be possible to first expand the syntax, then turn it back into context-less syntax (eg, by expanding it, then turning the result into a datum, and then turning that back into a syntax using #f as above, and finally matching on plain symbols in your post-processing step). But my first thought when I saw that (or rather when someone pointed at your question when you raised it on #scheme) is that you're trying to do some CL-ish kind of a code walker. (And I did see that you mentioned that this is a translation of CL code, so it seems relevant.) In this case, I think that trying to *match* on `#%app's is missing its point. The role of `#%app' is as a kind of a hook that you can use to redefine what happens on every point where a function is being applied *instead* of using a code walker. For example, say that I want to have a language where the four arithmetic operators can be used in infix form (ignoring issues that the result from the ambiguity in doing that). The CL approach would be to write a macro that implements a code walker whose job is to identify sexprs that stand for function application, and then transforming those where you see any of these operators in an infix position. (And I'm also ignoring the lack of real identifiers in CL for this example.) In PLT, you can use `#%app' instead of a code walker, and it gets to do its work wherever a function application is happening -- which frees you from the huge hassle involved in a code walker. In this case, I can do this easily with: ;; "infix.ss" #lang scheme/base (provide (except-out (all-from-out scheme/base) #%app) (rename-out [my-app #%app])) (define-syntax my-app (syntax-rules (+ - * /) [(_ x + y) (+ x y)] [(_ x - y) (- x y)] [(_ x * y) (* x y)] [(_ x / y) (/ x y)] [(_ f x ...) (f x ...)])) And then: #lang s-exp "infix.ss" (define (fib n) (if (<= n 1) n ((fib (n - 1)) + (fib (n - 2))))) As a side bonus of using PLT, you also get this to work even when the identifiers are renamed: ;; "infix.ss" #lang scheme/base (provide (except-out (all-from-out scheme/base) #%app) (rename-out [my-app #%app]) (rename-out [+ plus] [- minus])) (define-syntax my-app (syntax-rules (+ - * /) [(_ x + y) (+ x y)] [(_ x - y) (- x y)] [(_ x * y) (* x y)] [(_ x / y) (/ x y)] [(_ f x ...) (f x ...)])) #lang s-exp "infix.ss" (define (fib n) (if (<= n 1) n ((fib (n minus 1)) plus (fib (n minus 2))))) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From wookiz at hotmail.com Fri Nov 20 08:52:35 2009 From: wookiz at hotmail.com (wooks) Date: Fri Nov 20 08:52:52 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: <9AE20A27-1BD9-482A-96BA-A5E13F588D9E@ccs.neu.edu> References: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> <39BE9753-0F4B-4E46-84D4-D7E5186150B4@ccs.neu.edu> <2c4c8163-eb10-4574-9ff9-0b2d5004312f@37g2000yqm.googlegroups.com> <9AE20A27-1BD9-482A-96BA-A5E13F588D9E@ccs.neu.edu> Message-ID: <38178c6d-6a17-4628-88f0-37ed992bd238@m38g2000yqd.googlegroups.com> On Nov 10, 1:00?pm, Matthias Felleisen wrote: > On Nov 10, 2009, at 2:51 AM, wooks wrote: > > > As I said, there will be a 2nd course in OOP and at the moment I am > > scheduled to take that. The simple answer to objectors is that they'll > > do Java next term (although I am tempted to do it in Python). > > I am about to teach this in PLT for the first time. I'll point to ? > lecture notes when I have them. -- Matthias > For the next course, that would be wonderful. I have been looking at past exam papers for the CS1 course I am teaching. Many of the questions take the form of snippets of code which the students are to analyze, explain etc. Officially it's psuedo- code, but guess what paradigm the psuedo-code is in. So I am going to have to expose my class to arrays, for and while loops, etc (I even came across a question that specifically forbade recursion). So we will do Scheme as far as it goes, but will need to supplement it with something else. Clearly Java is a candidate but I'm not sure about getting involved in all that OO paraphenalia for this 1st course. Suggestions? My first instinct was Javascript but I don't know if we can use it for scripting outside of a browser. From laurent.orseau at gmail.com Fri Nov 20 08:57:19 2009 From: laurent.orseau at gmail.com (Laurent) Date: Fri Nov 20 09:03:00 2009 Subject: [plt-scheme] Unhygienic macro not needed? Message-ID: Hi all, Still having difficulties with (hygienic) macros... I have the following (simplified) code : (define (f1 x) (let ([y (foo x)]) (bar x y y) (plop y x y) (baz x y))) (define (f2 x) (let ([y (foo x)]) (baz x y))) As I dislike code repetitions, I want to make a macro that could generate either f1 or f2 or any function that has a body between the `let' and the `(baz'. I want the generated code to be as fast as without using macro. This (as I understand it) is the case for `define-syntax' et al. Since `bar' has some arguments that are defined inside the function, my first (probably bad) guess was to use an unhygienic macro with `define-macro'. That was simple and worked. However my code was quite slower so I suspect the transformation is not syntactic but is rather done on the fly with an eval. And I don't want to be beaten to death by hygienic macro programmers either. So what is the correct way to (generically) compress this code without losing run-time, i.e. to have a syntactical transformation? Is it possible to define an hygienic macro without loss of genericity? Is there a hygienic macro programming style that I could automatically use? Thanks, Laurent -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091120/5130a1b3/attachment-0001.htm From samth at ccs.neu.edu Fri Nov 20 09:10:24 2009 From: samth at ccs.neu.edu (Sam TH) Date: Fri Nov 20 09:11:02 2009 Subject: [plt-scheme] Unhygienic macro not needed? In-Reply-To: References: Message-ID: <63bb19ae0911200610i24aa3a07s77fad5c91783e774@mail.gmail.com> On Fri, Nov 20, 2009 at 8:57 AM, Laurent wrote: > Hi all, > > Still having difficulties with (hygienic) macros... > > I have the following (simplified) code : > > (define (f1 x) > ? (let ([y (foo x)]) > ??? (bar x y y) > ??? (plop y x y) > ??? (baz x y))) > > (define (f2 x) > ? (let ([y (foo x)]) > ??? (baz x y))) > > As I dislike code repetitions, I want to make a macro that could generate > either f1 or f2 or any function that has a body between the `let' and the > `(baz'. > I want the generated code to be as fast as without using macro. This (as I > understand it) is the case for `define-syntax' et al. > > Since `bar' has some arguments that are defined inside the function, my > first (probably bad) guess was to use an unhygienic macro with > `define-macro'. That was simple and worked. However my code was quite slower > so I suspect the transformation is not syntactic but is rather done on the > fly with an eval. And I don't want to be beaten to death by hygienic macro > programmers either. `defmacro' in PLT Scheme runs at expansion time, just like all other macros. > So what is the correct way to (generically) compress this code without > losing run-time, i.e. to have a syntactical transformation? > Is it possible to define an hygienic macro without loss of genericity? > Is there a hygienic macro programming style? that I could automatically use? How about: #lang scheme (define-syntax-rule (mymacro f x y . body) (define (f x) (let ([y (foo x)]) . body))) (mymacro f x y (bar x y y) (plop y x y) (baz x y)) (mymacro f2 x y (baz x y)) -- sam th samth@ccs.neu.edu From carl.eastlund at gmail.com Fri Nov 20 09:11:00 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Fri Nov 20 09:11:39 2009 Subject: [plt-scheme] Unhygienic macro not needed? In-Reply-To: References: Message-ID: <990e0c030911200611u205f2861q4f4b3feed5899e0@mail.gmail.com> Laurent, I am a bit puzzled here. What pattern of code are you trying to abstract over here? Code that calls several functions, culminating with baz, with arguments x and (foo x)? If so, I'd write it like this: (define-syntax foo==>baz (syntax-rules () ((_ (a b) e ...) (let ((b (foo a))) e ... (baz a b))))) (define (f1 x) (foo==>baz (x y) (bar x y y) (plop y x y))) (define (f2 x) (foo==>baz (x y))) As long as you put the variable names in the call to foo==>baz, hygiene will be your friend. There will be absolutely no difference in code speed after compilation; the compiler will see exactly the same function definitions you wrote before. Carl Eastlund On Fri, Nov 20, 2009 at 8:57 AM, Laurent wrote: > Hi all, > > Still having difficulties with (hygienic) macros... > > I have the following (simplified) code : > > (define (f1 x) > ? (let ([y (foo x)]) > ??? (bar x y y) > ??? (plop y x y) > ??? (baz x y))) > > (define (f2 x) > ? (let ([y (foo x)]) > ??? (baz x y))) > > As I dislike code repetitions, I want to make a macro that could generate > either f1 or f2 or any function that has a body between the `let' and the > `(baz'. > I want the generated code to be as fast as without using macro. This (as I > understand it) is the case for `define-syntax' et al. > > Since `bar' has some arguments that are defined inside the function, my > first (probably bad) guess was to use an unhygienic macro with > `define-macro'. That was simple and worked. However my code was quite slower > so I suspect the transformation is not syntactic but is rather done on the > fly with an eval. And I don't want to be beaten to death by hygienic macro > programmers either. > > So what is the correct way to (generically) compress this code without > losing run-time, i.e. to have a syntactical transformation? > Is it possible to define an hygienic macro without loss of genericity? > Is there a hygienic macro programming style? that I could automatically use? > > Thanks, > Laurent From matthias at ccs.neu.edu Fri Nov 20 09:21:31 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Fri Nov 20 09:21:59 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: <38178c6d-6a17-4628-88f0-37ed992bd238@m38g2000yqd.googlegroups.com> References: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> <39BE9753-0F4B-4E46-84D4-D7E5186150B4@ccs.neu.edu> <2c4c8163-eb10-4574-9ff9-0b2d5004312f@37g2000yqm.googlegroups.com> <9AE20A27-1BD9-482A-96BA-A5E13F588D9E@ccs.neu.edu> <38178c6d-6a17-4628-88f0-37ed992bd238@m38g2000yqd.googlegroups.com> Message-ID: <880CF9D2-4624-44E2-BB31-E673448B4C33@ccs.neu.edu> On Nov 20, 2009, at 8:52 AM, wooks wrote: > On Nov 10, 1:00 pm, Matthias Felleisen wrote: >> On Nov 10, 2009, at 2:51 AM, wooks wrote: >> >>> As I said, there will be a 2nd course in OOP and at the moment I am >>> scheduled to take that. The simple answer to objectors is that >>> they'll >>> do Java next term (although I am tempted to do it in Python). >> >> I am about to teach this in PLT for the first time. I'll point to >> lecture notes when I have them. -- Matthias >> > > For the next course, that would be wonderful. For notes on classes, see http://www.ccs.neu.edu/home/matthias/107-f09/classes.html For lecture notes in raw shape, see http://www.ccs.neu.edu/home/matthias/107-f09/Blog/9/ From sk at cs.brown.edu Fri Nov 20 09:25:56 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Fri Nov 20 09:26:34 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: <38178c6d-6a17-4628-88f0-37ed992bd238@m38g2000yqd.googlegroups.com> References: <25a80002-5593-49c6-8674-2eee9a852463@v30g2000yqm.googlegroups.com> <39BE9753-0F4B-4E46-84D4-D7E5186150B4@ccs.neu.edu> <2c4c8163-eb10-4574-9ff9-0b2d5004312f@37g2000yqm.googlegroups.com> <9AE20A27-1BD9-482A-96BA-A5E13F588D9E@ccs.neu.edu> <38178c6d-6a17-4628-88f0-37ed992bd238@m38g2000yqd.googlegroups.com> Message-ID: > Suggestions? My first instinct was Javascript but I don't know if we > can use it for scripting outside of a browser. ML? Visual Basic? You haven't said anything about what contract this supplement needs to satisfy. (And if you think Java OO is bad, wait till you get to weird prototype behavior in JavaScript.) Shriram From plragde at uwaterloo.ca Fri Nov 20 09:33:38 2009 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Fri Nov 20 09:34:16 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: <38178c6d-6a17-4628-88f0-37ed992bd238@m38g2000yqd.googlegroups.com> Message-ID: <4B06A8C2.9090000@uwaterloo.ca> wooks wrote: > I have been looking at past exam papers for the CS1 course I am > teaching. Many of the questions take the form of snippets of code > which the students are to analyze, explain etc. Officially it's psuedo- > code, but guess what paradigm the psuedo-code is in. > > So I am going to have to expose my class to arrays, for and while > loops, etc (I even came across a question that specifically forbade > recursion). > > So we will do Scheme as far as it goes, but will need to supplement it > with something else. Clearly Java is a candidate but I'm not sure > about getting involved in all that OO paraphenalia for this 1st > course. > > Suggestions? Use the Algol-60 language level in DrScheme. You laugh, but it's lower in overhead and closer to what they'll probably see in data structures/algorithms courses than any of the more modern alternatives. --PR From matthias at ccs.neu.edu Fri Nov 20 09:40:58 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Fri Nov 20 09:41:27 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: <4B06A8C2.9090000@uwaterloo.ca> References: <4B06A8C2.9090000@uwaterloo.ca> Message-ID: What a wonderful idea! On Nov 20, 2009, at 9:33 AM, Prabhakar Ragde wrote: > wooks wrote: > >> I have been looking at past exam papers for the CS1 course I am >> teaching. Many of the questions take the form of snippets of code >> which the students are to analyze, explain etc. Officially it's >> psuedo- >> code, but guess what paradigm the psuedo-code is in. >> So I am going to have to expose my class to arrays, for and while >> loops, etc (I even came across a question that specifically forbade >> recursion). >> So we will do Scheme as far as it goes, but will need to supplement >> it >> with something else. Clearly Java is a candidate but I'm not sure >> about getting involved in all that OO paraphenalia for this 1st >> course. >> Suggestions? > > Use the Algol-60 language level in DrScheme. > > You laugh, but it's lower in overhead and closer to what they'll > probably see in data structures/algorithms courses than any of the > more modern alternatives. --PR > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From laurent.orseau at gmail.com Fri Nov 20 10:10:29 2009 From: laurent.orseau at gmail.com (Laurent) Date: Fri Nov 20 10:11:08 2009 Subject: [plt-scheme] Unhygienic macro not needed? In-Reply-To: <63bb19ae0911200610i24aa3a07s77fad5c91783e774@mail.gmail.com> References: <63bb19ae0911200610i24aa3a07s77fad5c91783e774@mail.gmail.com> Message-ID: Thanks Carl and Sam, [snip] `defmacro' in PLT Scheme runs at expansion time, just like all other macros. > my bad indeed. My test was badly designed. > > > So what is the correct way to (generically) compress this code without > > losing run-time, i.e. to have a syntactical transformation? > > Is it possible to define an hygienic macro without loss of genericity? > > Is there a hygienic macro programming style that I could automatically > use? > > How about: > > #lang scheme > > (define-syntax-rule (mymacro f x y . body) > (define (f x) > (let ([y (foo x)]) . body))) > > (mymacro f x y > (bar x y y) > (plop y x y) > (baz x y)) > > (mymacro f2 x y (baz x y)) > Thanks, that's it. I wonder why I couldn't find it myself... The programming style is then to turn "free" variables in unhygienic macros into identifiers that are bound to one given in the macro call. Thanks also for your fast replies! Laurent -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091120/236a873b/attachment-0001.htm From wookiz at hotmail.com Fri Nov 20 10:23:30 2009 From: wookiz at hotmail.com (wooks) Date: Fri Nov 20 10:23:47 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: <4B06A8C2.9090000@uwaterloo.ca> References: <4B06A8C2.9090000@uwaterloo.ca> Message-ID: On Nov 20, 2:33?pm, Prabhakar Ragde wrote: > wooks wrote: > > I have been looking at past exam papers for the CS1 course I am > > teaching. Many of the questions take the form of snippets of code > > which the students are to analyze, explain etc. Officially it's psuedo- > > code, but guess what paradigm the psuedo-code is in. > > > So I am going to have to expose my class to arrays, for and while > > loops, etc (I even came across a question that specifically forbade > > recursion). > > > So we will do Scheme as far as it goes, but will need to supplement it > > with something else. Clearly Java is a candidate but I'm not sure > > about getting involved in all that OO paraphenalia for this 1st > > course. > > > Suggestions? > > Use the Algol-60 language level in DrScheme. > > You laugh, but it's lower in overhead and closer to what they'll > probably see in data structures/algorithms courses than any of the more > modern alternatives. --PR I feel more like crying. Scheme and Algol for CS1....they better all pass with flying colours. Web tutorials for it are hard to come by, and I'll need one (for me and the students). Is it safe to use one for ALGOL68 (assuming I can find one)? From jmarshall at alum.mit.edu Fri Nov 20 10:55:09 2009 From: jmarshall at alum.mit.edu (Joe Marshall) Date: Fri Nov 20 10:55:47 2009 Subject: [plt-scheme] Unhygienic macro not needed? In-Reply-To: References: Message-ID: On Fri, Nov 20, 2009 at 5:57 AM, Laurent wrote: > > I have the following (simplified) code : > > (define (f1 x) > ? (let ([y (foo x)]) > ??? (bar x y y) > ??? (plop y x y) > ??? (baz x y))) > > (define (f2 x) > ? (let ([y (foo x)]) > ??? (baz x y))) (define (wrapper receiver) (lambda (x) (let ((y (foo x))) (receiver x y) (baz x y)))) (define f1 (wrapper (lambda (x y) (bar x y y) (plop y x y) ))) (define f2 (wrapper (lambda (x y) #f))) > > And I don't want to be beaten to death by hygienic macro > programmers either. > Is there a hygienic macro programming style? that I could automatically use? > The programming style is then to turn "free" variables in unhygienic macros > into identifiers that are bound to one given in the macro call. Yes! This has the important advantage over the non-hygienic form: you don't get `magic variables' appearing out of nowhere. Every variable that you can access in the body of the macro is explicitly mentioned in the code at the macro call site, and you can rename them at will if you like. -- ~jrm From carl.eastlund at gmail.com Fri Nov 20 11:14:40 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Fri Nov 20 11:15:20 2009 Subject: [plt-scheme] Unhygienic macro not needed? In-Reply-To: References: Message-ID: <990e0c030911200814g704c50c3p9bf435b97d1cd8cb@mail.gmail.com> On Fri, Nov 20, 2009 at 10:55 AM, Joe Marshall wrote: > On Fri, Nov 20, 2009 at 5:57 AM, Laurent wrote: >> >> I have the following (simplified) code : >> >> (define (f1 x) >> ? (let ([y (foo x)]) >> ??? (bar x y y) >> ??? (plop y x y) >> ??? (baz x y))) >> >> (define (f2 x) >> ? (let ([y (foo x)]) >> ??? (baz x y))) > > (define (wrapper receiver) > ?(lambda (x) > ? ?(let ((y (foo x))) > ? ? ?(receiver x y) > ? ? ?(baz x y)))) > > (define f1 > ? (wrapper > ? ? (lambda (x y) > ? ? ? ? (bar x y y) > ? ? ? ? (plop y x y) ))) > > (define f2 > ? (wrapper > ? ? ?(lambda (x y) #f))) Oops. Joe, of course, has the best solution. No need for "macrology" when "functionality" does the job. Pardon the puns. --Carl From laurent.orseau at gmail.com Fri Nov 20 11:25:37 2009 From: laurent.orseau at gmail.com (Laurent) Date: Fri Nov 20 11:26:15 2009 Subject: [plt-scheme] Unhygienic macro not needed? In-Reply-To: <990e0c030911200814g704c50c3p9bf435b97d1cd8cb@mail.gmail.com> References: <990e0c030911200814g704c50c3p9bf435b97d1cd8cb@mail.gmail.com> Message-ID: On Fri, Nov 20, 2009 at 17:14, Carl Eastlund wrote: > On Fri, Nov 20, 2009 at 10:55 AM, Joe Marshall > wrote: > > On Fri, Nov 20, 2009 at 5:57 AM, Laurent > wrote: > >> > >> I have the following (simplified) code : > >> > >> (define (f1 x) > >> (let ([y (foo x)]) > >> (bar x y y) > >> (plop y x y) > >> (baz x y))) > >> > >> (define (f2 x) > >> (let ([y (foo x)]) > >> (baz x y))) > > > > (define (wrapper receiver) > > (lambda (x) > > (let ((y (foo x))) > > (receiver x y) > > (baz x y)))) > > > > (define f1 > > (wrapper > > (lambda (x y) > > (bar x y y) > > (plop y x y) ))) > > > > (define f2 > > (wrapper > > (lambda (x y) #f))) > > Oops. Joe, of course, has the best solution. No need for "macrology" > when "functionality" does the job. Pardon the puns. > But this introduces a (little?) run-time cost, doesn't it? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091120/8b13472f/attachment.htm From carl.eastlund at gmail.com Fri Nov 20 11:32:37 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Fri Nov 20 11:33:15 2009 Subject: [plt-scheme] Unhygienic macro not needed? In-Reply-To: References: <990e0c030911200814g704c50c3p9bf435b97d1cd8cb@mail.gmail.com> Message-ID: <990e0c030911200832nc710a5cv9ab92f9d0bf1a96a@mail.gmail.com> On Fri, Nov 20, 2009 at 11:25 AM, Laurent wrote: > > On Fri, Nov 20, 2009 at 17:14, Carl Eastlund > wrote: >> >> On Fri, Nov 20, 2009 at 10:55 AM, Joe Marshall >> wrote: >> > On Fri, Nov 20, 2009 at 5:57 AM, Laurent >> > wrote: >> >> >> >> I have the following (simplified) code : >> >> >> >> (define (f1 x) >> >> ? (let ([y (foo x)]) >> >> ??? (bar x y y) >> >> ??? (plop y x y) >> >> ??? (baz x y))) >> >> >> >> (define (f2 x) >> >> ? (let ([y (foo x)]) >> >> ??? (baz x y))) >> > >> > (define (wrapper receiver) >> > ?(lambda (x) >> > ? ?(let ((y (foo x))) >> > ? ? ?(receiver x y) >> > ? ? ?(baz x y)))) >> > >> > (define f1 >> > ? (wrapper >> > ? ? (lambda (x y) >> > ? ? ? ? (bar x y y) >> > ? ? ? ? (plop y x y) ))) >> > >> > (define f2 >> > ? (wrapper >> > ? ? ?(lambda (x y) #f))) >> >> Oops. ?Joe, of course, has the best solution. ?No need for "macrology" >> when "functionality" does the job. ?Pardon the puns. > > But this introduces a (little?) run-time cost, doesn't it? Two responses. One, code clarity is almost always more important than tiny runtime costs. Two, no it doesn't, as long as the compiler is even halfway intelligent about inlining and constant propagation. Trust the compiler. If it's good, it's often smarter about optimizing your code than you are. If it's bad, your code is never going to run fast anyway. --Carl From BLOCH at adelphi.edu Fri Nov 20 11:35:07 2009 From: BLOCH at adelphi.edu (Stephen Bloch) Date: Fri Nov 20 11:35:31 2009 Subject: [plt-scheme] mathematicians lament Message-ID: <4B067EED02000022000363EB@adlibv.adelphi.edu> On Nov 19, 2009, at 4:59 PM, Neil Toronto wrote: > Does anybody know of a list of example problems like the ones he gives in the essay? I'd love to have a big list of math > teasers to draw from for dinner conversation with my kids. Well, you could take a look at "CS Unplugged". Of course there are Fibonacci numbers. How much bigger is each Fibonacci number than the previous one? The ratio seems to be alternating bigger and smaller, but the "bigger" and "smaller" are getting closer to one another. Where will they meet? Is this number interesting in any other ways? What if I started the Fibonacci sequence with something other than 1 and 1? Use your calculator (or, better yet, DrScheme) to write various fractions in decimal. Some of them end after a fixed number of digits, while others repeat digits indefinitely. Which are which? 1/9 repeats a single digit forever; 1/11 repeats a pair of digits forever; 1/7 repeats six digits forever. Can you predict, given the number n, whether 1/n will be repeating, and if so, how many digits will be in the repeating pattern? What if you write it in a base other than ten? Steve Bloch From sbloch at adelphi.edu Thu Nov 19 20:10:22 2009 From: sbloch at adelphi.edu (Stephen Bloch) Date: Fri Nov 20 11:38:19 2009 Subject: [plt-scheme] mathematicians lament In-Reply-To: <4B05BFBF.40407@cs.byu.edu> References: <4B056436.9000509@cs.utah.edu> <4B05BFBF.40407@cs.byu.edu> Message-ID: <4B0C5027-6CD6-42B6-86C2-3757A6D4CBCD@adelphi.edu> An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091119/7e37fbe8/attachment-0001.htm From laurent.orseau at gmail.com Fri Nov 20 11:46:23 2009 From: laurent.orseau at gmail.com (Laurent) Date: Fri Nov 20 11:47:02 2009 Subject: [plt-scheme] Unhygienic macro not needed? In-Reply-To: <990e0c030911200832nc710a5cv9ab92f9d0bf1a96a@mail.gmail.com> References: <990e0c030911200814g704c50c3p9bf435b97d1cd8cb@mail.gmail.com> <990e0c030911200832nc710a5cv9ab92f9d0bf1a96a@mail.gmail.com> Message-ID: Ok, I quite agree with you. Indeed my little tests did not show any significant difference. Laurent On Fri, Nov 20, 2009 at 17:32, Carl Eastlund wrote: > On Fri, Nov 20, 2009 at 11:25 AM, Laurent > wrote: > > > > On Fri, Nov 20, 2009 at 17:14, Carl Eastlund > > wrote: > >> > >> On Fri, Nov 20, 2009 at 10:55 AM, Joe Marshall > >> wrote: > >> > On Fri, Nov 20, 2009 at 5:57 AM, Laurent > >> > wrote: > >> >> > >> >> I have the following (simplified) code : > >> >> > >> >> (define (f1 x) > >> >> (let ([y (foo x)]) > >> >> (bar x y y) > >> >> (plop y x y) > >> >> (baz x y))) > >> >> > >> >> (define (f2 x) > >> >> (let ([y (foo x)]) > >> >> (baz x y))) > >> > > >> > (define (wrapper receiver) > >> > (lambda (x) > >> > (let ((y (foo x))) > >> > (receiver x y) > >> > (baz x y)))) > >> > > >> > (define f1 > >> > (wrapper > >> > (lambda (x y) > >> > (bar x y y) > >> > (plop y x y) ))) > >> > > >> > (define f2 > >> > (wrapper > >> > (lambda (x y) #f))) > >> > >> Oops. Joe, of course, has the best solution. No need for "macrology" > >> when "functionality" does the job. Pardon the puns. > > > > But this introduces a (little?) run-time cost, doesn't it? > > Two responses. One, code clarity is almost always more important than > tiny runtime costs. Two, no it doesn't, as long as the compiler is > even halfway intelligent about inlining and constant propagation. > Trust the compiler. If it's good, it's often smarter about optimizing > your code than you are. If it's bad, your code is never going to run > fast anyway. > > --Carl > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091120/92427e5a/attachment.htm From hendrik at topoi.pooq.com Fri Nov 20 12:24:56 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Fri Nov 20 12:25:17 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: References: <4B06A8C2.9090000@uwaterloo.ca> Message-ID: <20091120172455.GA25857@topoi.pooq.com> On Fri, Nov 20, 2009 at 07:23:30AM -0800, wooks wrote: > > Web tutorials for it are hard to come by, and I'll need one (for me > and the students). Is it safe to use one for ALGOL68 (assuming I can > find one)? Algol 68 and Algol 60 are completely different languages. There is a superficial resemblance of syntax, but even that is significantly different. But aside from that, if you found an Algol 68 compiler, Algol 68 would probably be good, too. There's a legacy Algol 68 compiler in the process of resurrection on http://mtn-host.prjek.net. It's a site containing a number of projects. One of them is mine, a68h. Unfortunately, it still needs a run-time system and massive amounts of debugging. There's also a new Algol W compiler in existence that translates Algol W into C. It's the language A68H is written in. And Algol W might suit your purposes as well. It's another statically types, securely garbage-collected Algol dialect. -- hendrik From robby at eecs.northwestern.edu Fri Nov 20 12:36:12 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Fri Nov 20 12:36:32 2009 Subject: [plt-scheme] Poacher turned gamekeeper In-Reply-To: References: <4B06A8C2.9090000@uwaterloo.ca> Message-ID: <932b2f1f0911200936l21897bc1q93bfd84b0597a669@mail.gmail.com> Tears of joy, no doubt. Robby On Friday, November 20, 2009, wooks wrote: > > > On Nov 20, 2:33?pm, Prabhakar Ragde wrote: >> wooks wrote: >> > I have been looking at past exam papers for the CS1 course I am >> > teaching. Many of the questions take the form of snippets of code >> > which the students are to analyze, explain etc. Officially it's psuedo- >> > code, but guess what paradigm the psuedo-code is in. >> >> > So I am going to have to expose my class to arrays, for and while >> > loops, etc (I even came across a question that specifically forbade >> > recursion). >> >> > So we will do Scheme as far as it goes, but will need to supplement it >> > with something else. Clearly Java is a candidate but I'm not sure >> > about getting involved in all that OO paraphenalia for this 1st >> > course. >> >> > Suggestions? >> >> Use the Algol-60 language level in DrScheme. >> >> You laugh, but it's lower in overhead and closer to what they'll >> probably see in data structures/algorithms courses than any of the more >> modern alternatives. --PR > > I feel more like crying. Scheme and Algol for CS1....they better all > pass with flying colours. > > Web tutorials for it are hard to come by, and I'll need one (for me > and the students). Is it safe to use one for ALGOL68 (assuming I can > find one)? > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From plragde at uwaterloo.ca Fri Nov 20 13:30:06 2009 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Fri Nov 20 13:30:28 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: Message-ID: <4B06E02E.2090304@uwaterloo.ca> wooks wrote: > Web tutorials for it are hard to come by, and I'll need one (for me > and the students). Is it safe to use one for ALGOL68 (assuming I can > find one)? Now *that* would be interesting... but, no. Use the Revised Report on Algol 60. http://www.masswerk.at/algol60/report.htm or http://portal.acm.org/citation.cfm?id=366193.366201 if you have an institutional subscription to ACM publications. --PR From jmj at fellowhuman.com Fri Nov 20 14:20:33 2009 From: jmj at fellowhuman.com (Jordan Johnson) Date: Fri Nov 20 14:21:26 2009 Subject: [plt-scheme] mathematicians lament In-Reply-To: <4B0C5027-6CD6-42B6-86C2-3757A6D4CBCD@adelphi.edu> References: <4B056436.9000509@cs.utah.edu> <4B05BFBF.40407@cs.byu.edu> <4B0C5027-6CD6-42B6-86C2-3757A6D4CBCD@adelphi.edu> Message-ID: Another good one is the mutilated checkerboard problem: can you tile a checkerboard with 1x2 dominoes if two diagonally opposed squares have been removed? It's a great introduction to the concept of proof: visually and kinesthetically accessible, with a very simple but non-obvious solution. Usually my students get sufficiently engaged with it that they really want to know for sure if it's impossible. Hofstadter's MIU-puzzle is similar in spirit but much more language- oriented. Best, Jordan On Nov 19, 2009, at 5:10 PM, Stephen Bloch wrote: > > On Nov 19, 2009, at 4:59 PM, Neil Toronto wrote: > >> Jon Rafkind wrote: >>> http://www.maa.org/devlin/LockhartsLament.pdf >> >> Does anybody know of a list of example problems like the ones he >> gives in the essay? I'd love to have a big list of math teasers to >> draw from for dinner conversation with my kids. > > Well, you could take a look at "CS Unplugged". > > Of course there are Fibonacci numbers. How much bigger is each > Fibonacci number than the previous one? The ratio seems to be > alternating bigger and smaller, but the "bigger" and "smaller" are > getting closer to one another. Where will they meet? Is this > number interesting in any other ways? What if I started the > Fibonacci sequence with something other than 1 and 1? > > Use your calculator (or, better yet, DrScheme) to write various > fractions in decimal. Some of them end after a fixed number of > digits, while others repeat digits indefinitely. Which are which? > 1/9 repeats a single digit forever; 1/11 repeats a pair of digits > forever; 1/7 repeats six digits forever. Can you predict, given the > number n, whether 1/n will be repeating, and if so, how many digits > will be in the repeating pattern? What if you write it in a base > other than ten? > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091120/2213510b/attachment.htm From hendrik at topoi.pooq.com Fri Nov 20 15:54:50 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Fri Nov 20 15:55:26 2009 Subject: [plt-scheme] Re: Poacher turned gamekeeper In-Reply-To: References: <4B06A8C2.9090000@uwaterloo.ca> Message-ID: <20091120205449.GA26443@topoi.pooq.com> On Fri, Nov 20, 2009 at 07:23:30AM -0800, wooks wrote: > > I feel more like crying. Scheme and Algol for CS1....they better all > pass with flying colours. What about OCaml? Strongly typed .... I don't know what its iteration syntax is, but it does seem to be able to have expressions and varying variables and side-effects. > > Web tutorials for it are hard to come by, and I'll need one (for me > and the students). Is it safe to use one for ALGOL68 (assuming I can > find one)? And if you find a decent on-line introductory OCaml manual (especially for people like me who already know how to program in many languages) I'd like to see it. -- hendrik From masm at acm.org Fri Nov 20 17:09:40 2009 From: masm at acm.org (Marco Monteiro) Date: Fri Nov 20 17:10:07 2009 Subject: [plt-scheme] #%app literal does not match in syntax-case pattern In-Reply-To: <19206.9724.532506.576793@winooski.ccs.neu.edu> References: <252c42fe0911191354j2ce63f73q16c15da540eeba72@mail.gmail.com> <19206.9724.532506.576793@winooski.ccs.neu.edu> Message-ID: <252c42fe0911201409l4a5361b5k7c763f0ee68f0c@mail.gmail.com> So, I am writing a Scheme to JavaScript compiler. Because I want to write the macro and module system later, my idea was to use PLT Scheme's macro and module system, for now. Of course, this probably must be done with some kind of hack. I'm just trying to find one that is reliable. My first approach was to expand the module in the reader, store this expanded code (later will be translated to JavaScript), and replace the expressions in the expanded code by (void), so that the module just read, and to be returned by the reader, has no expressions. This is necessary because this code is to be evaluated later in the web browser. I'm using PLT to read, macro-expand but not evaluate the module. After reading what you wrote, I changed the process a bit. I still expand the code in the reader but then I return the read module, without replacing the expressions, but in a different language. In that new language, I have #%app to expand to #'(void). It works, but I have two languages that are different only in the provided #%app. Now I'm trying a new approach. Instead of expanding the module in the reader, I export a #%module-begin that replaces its subforms by a new macro that code-walks by using local-expand and some other hacks. This does not mix read and macro expansion levels, but I have to 10 times more code. Anyway, I know that all this is an hack, but... what is the best way to do what I want? Is there a less hacky way to proceed? On Fri, Nov 20, 2009 at 5:15 AM, Eli Barzilay wrote: > But my first thought when I saw that (or rather when someone pointed > at your question when you raised it on #scheme) is that you're trying > to do some CL-ish kind of a code walker. (And I did see that you > mentioned that this is a translation of CL code, so it seems > relevant.) In this case, I think that trying to *match* on `#%app's > is missing its point. The role of `#%app' is as a kind of a hook that > you can use to redefine what happens on every point where a function > is being applied *instead* of using a code walker. > This code is not ported from CL. Although I do have some work in CL that I want to port to Scheme, this is just my experiments in a new system. I still don't known PLT (and Scheme) well enough to not make some newbie mistakes. That said, I've been writing CL for the last 3 years; probably I'm still thinking in CL. Thanks. Marco P.S. Yes, I am aware of Moby. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091120/d06cb835/attachment.htm From eli at barzilay.org Fri Nov 20 17:17:58 2009 From: eli at barzilay.org (Eli Barzilay) Date: Fri Nov 20 17:18:18 2009 Subject: [plt-scheme] #%app literal does not match in syntax-case pattern In-Reply-To: <252c42fe0911201409l4a5361b5k7c763f0ee68f0c@mail.gmail.com> References: <252c42fe0911191354j2ce63f73q16c15da540eeba72@mail.gmail.com> <19206.9724.532506.576793@winooski.ccs.neu.edu> <252c42fe0911201409l4a5361b5k7c763f0ee68f0c@mail.gmail.com> Message-ID: <19207.5526.78917.522340@winooski.ccs.neu.edu> On Nov 20, Marco Monteiro wrote: > > Now I'm trying a new approach. Instead of expanding the module in > the reader, I export a #%module-begin that replaces its subforms by > a new macro that code-walks by using local-expand and some other > hacks. This does not mix read and macro expansion levels, but I have > to 10 times more code. I didn't understand what you're trying to do in general? Why do you need any kind of a code walker to begin with? -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From masm at acm.org Fri Nov 20 17:45:20 2009 From: masm at acm.org (Marco Monteiro) Date: Fri Nov 20 17:45:39 2009 Subject: [plt-scheme] #%app literal does not match in syntax-case pattern In-Reply-To: <19207.5526.78917.522340@winooski.ccs.neu.edu> References: <252c42fe0911191354j2ce63f73q16c15da540eeba72@mail.gmail.com> <19206.9724.532506.576793@winooski.ccs.neu.edu> <252c42fe0911201409l4a5361b5k7c763f0ee68f0c@mail.gmail.com> <19207.5526.78917.522340@winooski.ccs.neu.edu> Message-ID: <252c42fe0911201445p30a6daf4x3761c072e865fba0@mail.gmail.com> On Fri, Nov 20, 2009 at 10:17 PM, Eli Barzilay wrote: > On Nov 20, Marco Monteiro wrote: > > > > Now I'm trying a new approach. Instead of expanding the module in > > the reader, I export a #%module-begin that replaces its subforms by > > a new macro that code-walks by using local-expand and some other > > hacks. This does not mix read and macro expansion levels, but I have > > to 10 times more code. > > I didn't understand what you're trying to do in general? Why do you > need any kind of a code walker to begin with? > > To expand the code. For example, I want to write --- #lang masm/sines (define (f) (lambda () 42)) (f) --- and I want it evaluated as if I wrote this: --- #lang my-module (define-values (f) (#%app void)) (#%app void) (store-code (list '(define-values (f) (lambda () (#%datum 42)) '(#%app f)) --- This is a simplification, because I also want to store some syntax information, line number, etc. The definitions must stay in place because the module may have a provide form that provides f. The expressions must not be executed, because some of the variables (f in this case) will not have the expected value (a procedure in this case). Actually, the idea was to have the evaluation of a module to build its Scheme AST, that can later be transformed to a JavaScript AST. There may be a much saner way to do this. And this may end up not working. I'm just experimenting. Marco -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091120/86b7158e/attachment.htm From masm at acm.org Fri Nov 20 18:01:25 2009 From: masm at acm.org (Marco Monteiro) Date: Fri Nov 20 18:01:44 2009 Subject: [plt-scheme] #%app literal does not match in syntax-case pattern In-Reply-To: <252c42fe0911201445p30a6daf4x3761c072e865fba0@mail.gmail.com> References: <252c42fe0911191354j2ce63f73q16c15da540eeba72@mail.gmail.com> <19206.9724.532506.576793@winooski.ccs.neu.edu> <252c42fe0911201409l4a5361b5k7c763f0ee68f0c@mail.gmail.com> <19207.5526.78917.522340@winooski.ccs.neu.edu> <252c42fe0911201445p30a6daf4x3761c072e865fba0@mail.gmail.com> Message-ID: <252c42fe0911201501y5f975b16o7fccc27df971974f@mail.gmail.com> One thing I forgot to mention: define, define-values and lambda in the code fragments are from the scheme language. If I didn't code-walk (or expand on the reader), I wouldn't be able to store the expanded code, right? The problem, in this case, is hygiene (I can't replace scheme's define-values because define expands to it) and the quote: the code inside it is not expanded. Marco On Fri, Nov 20, 2009 at 10:45 PM, Marco Monteiro wrote: > On Fri, Nov 20, 2009 at 10:17 PM, Eli Barzilay wrote: > >> On Nov 20, Marco Monteiro wrote: >> > >> > Now I'm trying a new approach. Instead of expanding the module in >> > the reader, I export a #%module-begin that replaces its subforms by >> > a new macro that code-walks by using local-expand and some other >> > hacks. This does not mix read and macro expansion levels, but I have >> > to 10 times more code. >> >> I didn't understand what you're trying to do in general? Why do you >> need any kind of a code walker to begin with? >> >> > To expand the code. For example, I want to write > > --- > #lang masm/sines > > (define (f) (lambda () 42)) > > (f) > --- > > and I want it evaluated as if I wrote this: > > --- > #lang my-module > > (define-values (f) (#%app void)) > > (#%app void) > > (store-code (list '(define-values (f) (lambda () (#%datum 42)) '(#%app f)) > --- > > This is a simplification, because I also want to store some syntax > information, line number, etc. The definitions must stay in place > because the module may have a provide form that provides f. > The expressions must not be executed, because some of the > variables (f in this case) will not have the expected value > (a procedure in this case). > > Actually, the idea was to have the evaluation of a module to build > its Scheme AST, that can later be transformed to a JavaScript AST. > There may be a much saner way to do this. And this may end up > not working. I'm just experimenting. > > Marco > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091120/3390fcc4/attachment.htm From ryanc at ccs.neu.edu Fri Nov 20 18:08:32 2009 From: ryanc at ccs.neu.edu (Ryan Culpepper) Date: Fri Nov 20 18:09:02 2009 Subject: [plt-scheme] #%app literal does not match in syntax-case pattern In-Reply-To: <252c42fe0911201409l4a5361b5k7c763f0ee68f0c@mail.gmail.com> References: <252c42fe0911191354j2ce63f73q16c15da540eeba72@mail.gmail.com> <19206.9724.532506.576793@winooski.ccs.neu.edu> <252c42fe0911201409l4a5361b5k7c763f0ee68f0c@mail.gmail.com> Message-ID: <72145A72-E0BE-4014-B74C-27BD990C0BD3@ccs.neu.edu> On Nov 20, 2009, at 5:09 PM, Marco Monteiro wrote: > So, I am writing a Scheme to JavaScript compiler. Because I want to > write the macro and module system later, my idea was to use > PLT Scheme's macro and module system, for now. Of course, this > probably must be done with some kind of hack. I'm just trying to find > one that is reliable. > > My first approach was to expand the module in the reader, store this > expanded code (later will be translated to JavaScript), and replace > the expressions in the expanded code by (void), so that the module > just read, and to be returned by the reader, has no expressions. This > is necessary because this code is to be evaluated later in the web > browser. I'm using PLT to read, macro-expand but not evaluate the > module. > > After reading what you wrote, I changed the process a bit. I still > expand > the code in the reader but then I return the read module, without > replacing the expressions, but in a different language. In that new > language, > I have #%app to expand to #'(void). It works, but I have two languages > that are different only in the provided #%app. > > Now I'm trying a new approach. Instead of expanding the module in the > reader, I export a #%module-begin that replaces its subforms by a > new macro that code-walks by using local-expand and some other > hacks. This does not mix read and macro expansion levels, but I have > to > 10 times more code. This sounds like the best way to do what you want. You might also find it useful to read "Advanced Macrology and the Implementation of Typed Scheme" as a source of ideas and techniques for working with PLT's macro system: http://www.ccs.neu.edu/scheme/pubs/scheme2007-ctf.pdf For example, you can write a #%module-begin macro that local-expands the entire module contents at once, then does a code walk (still at compile time) over the results. You might find that easier to get started with than the compositional approach that you seem to be using (IIUC). Ryan > Anyway, I know that all this is an hack, but... what is the best way > to > do what I want? Is there a less hacky way to proceed? > > On Fri, Nov 20, 2009 at 5:15 AM, Eli Barzilay > wrote: > But my first thought when I saw that (or rather when someone pointed > at your question when you raised it on #scheme) is that you're trying > to do some CL-ish kind of a code walker. (And I did see that you > mentioned that this is a translation of CL code, so it seems > relevant.) In this case, I think that trying to *match* on `#%app's > is missing its point. The role of `#%app' is as a kind of a hook that > you can use to redefine what happens on every point where a function > is being applied *instead* of using a code walker. > > This code is not ported from CL. Although I do have some work in CL > that > I want to port to Scheme, this is just my experiments in a new system. > I still don't known PLT (and Scheme) well enough to not make some > newbie > mistakes. That said, I've been writing CL for the last 3 years; > probably I'm > still thinking in CL. > > Thanks. > > Marco > > P.S. Yes, I am aware of Moby. > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091120/9a11f361/attachment.htm From eli at barzilay.org Fri Nov 20 19:39:50 2009 From: eli at barzilay.org (Eli Barzilay) Date: Fri Nov 20 19:40:19 2009 Subject: [plt-scheme] #%app literal does not match in syntax-case pattern In-Reply-To: <252c42fe0911201445p30a6daf4x3761c072e865fba0@mail.gmail.com>, <252c42fe0911201501y5f975b16o7fccc27df971974f@mail.gmail.com> References: <252c42fe0911191354j2ce63f73q16c15da540eeba72@mail.gmail.com> <19206.9724.532506.576793@winooski.ccs.neu.edu> <252c42fe0911201409l4a5361b5k7c763f0ee68f0c@mail.gmail.com> <19207.5526.78917.522340@winooski.ccs.neu.edu> <252c42fe0911201445p30a6daf4x3761c072e865fba0@mail.gmail.com> <252c42fe0911201501y5f975b16o7fccc27df971974f@mail.gmail.com> Message-ID: <19207.14038.360939.219577@winooski.ccs.neu.edu> On Nov 20, Marco Monteiro wrote: > One thing I forgot to mention: define, define-values and lambda in > the code fragments are from the scheme language. If I didn't > code-walk (or expand on the reader), I wouldn't be able to store the > expanded code, right? The problem, in this case, is hygiene (I > can't replace scheme's define-values because define expands to it) > and the quote: the code inside it is not expanded. Yes, if you want the expanded code then you need to expand it -- but why do you need to walk over the code? Or maybe you're talking about some compilation step of the expanded code (which is not what code walkers are usually used for in CL, at least IIRC). -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From mona.esmaili at gmail.com Fri Nov 20 14:36:53 2009 From: mona.esmaili at gmail.com (Mona) Date: Fri Nov 20 20:34:49 2009 Subject: [plt-scheme] event mouse Message-ID: <7287891a-20b5-4674-bd56-c7ddad390c54@p8g2000yqb.googlegroups.com> Hi every body I Have problem in my project ,my project is dots and box I want when I click between two posn it draws line ,I add techpack universe.ss What I must do ?please help to me. From masm at acm.org Fri Nov 20 20:45:18 2009 From: masm at acm.org (Marco Monteiro) Date: Fri Nov 20 20:45:38 2009 Subject: [plt-scheme] #%app literal does not match in syntax-case pattern In-Reply-To: <19207.14038.360939.219577@winooski.ccs.neu.edu> References: <252c42fe0911191354j2ce63f73q16c15da540eeba72@mail.gmail.com> <19206.9724.532506.576793@winooski.ccs.neu.edu> <252c42fe0911201409l4a5361b5k7c763f0ee68f0c@mail.gmail.com> <19207.5526.78917.522340@winooski.ccs.neu.edu> <252c42fe0911201445p30a6daf4x3761c072e865fba0@mail.gmail.com> <252c42fe0911201501y5f975b16o7fccc27df971974f@mail.gmail.com> <19207.14038.360939.219577@winooski.ccs.neu.edu> Message-ID: <252c42fe0911201745j2c914178uc73e9b588407ef1b@mail.gmail.com> On Sat, Nov 21, 2009 at 12:39 AM, Eli Barzilay wrote: > On Nov 20, Marco Monteiro wrote: > > One thing I forgot to mention: define, define-values and lambda in > > the code fragments are from the scheme language. If I didn't > > code-walk (or expand on the reader), I wouldn't be able to store the > > expanded code, right? The problem, in this case, is hygiene (I > > can't replace scheme's define-values because define expands to it) > > and the quote: the code inside it is not expanded. > > Yes, if you want the expanded code then you need to expand it -- but > why do you need to walk over the code? Or maybe you're talking about > some compilation step of the expanded code (which is not what code > walkers are usually used for in CL, at least IIRC). > > It may not be necessary (maybe this is implemented already somewhere in the library), but here is what I do: Given, in a module context: (define (x) (* x x)) I want to get: (list 'define-values '(x) (list '#%app '* 'x 'x)) I export #%module-begin from my language that wrap every immediate subform in a X macro. The X macro takes the (define-values (x) (* x x)) form and returns (list 'define-values '(x) (Y (* x x))). The Y macro code-walks the forms: it takes (* x y) and returns (list #'app (Y *) (Y x) (Y x)). Finally, we get what we want. The Y macro uses local-expand. This is a simplification. The Y macro returns more than symbols and lists of symbols. For example, it may expand to an expression that builds a syntax tree with location information. Is there a better way to get the expansion as given in the example above? Maybe something that recursively applies local-expand to subforms. If there is, I can use that and then traverse all the expanded code in one go. Thanks. Marco -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091121/823a5e33/attachment.htm From masm at acm.org Fri Nov 20 20:47:46 2009 From: masm at acm.org (Marco Monteiro) Date: Fri Nov 20 20:48:08 2009 Subject: [plt-scheme] #%app literal does not match in syntax-case pattern In-Reply-To: <72145A72-E0BE-4014-B74C-27BD990C0BD3@ccs.neu.edu> References: <252c42fe0911191354j2ce63f73q16c15da540eeba72@mail.gmail.com> <19206.9724.532506.576793@winooski.ccs.neu.edu> <252c42fe0911201409l4a5361b5k7c763f0ee68f0c@mail.gmail.com> <72145A72-E0BE-4014-B74C-27BD990C0BD3@ccs.neu.edu> Message-ID: <252c42fe0911201747k4bbffb6aya25f28dac5d068b0@mail.gmail.com> On Fri, Nov 20, 2009 at 11:08 PM, Ryan Culpepper wrote: > > You might also find it useful to read "Advanced Macrology and the > Implementation of Typed Scheme" as a source of ideas and techniques for > working with PLT's macro system: > > http://www.ccs.neu.edu/scheme/pubs/scheme2007-ctf.pdf > > For example, you can write a #%module-begin macro that local-expands the > entire module contents at once, then does a code walk (still at compile > time) over the results. You might find that easier to get started with than > the compositional approach that you seem to be using (IIUC). > > Ryan > > That one was already printed, but I have not yet found time for it. I'll read it this weekend. Thanks for the reference. Marco -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091121/b1fbcd2c/attachment.htm From matthias at ccs.neu.edu Fri Nov 20 20:51:26 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Fri Nov 20 20:51:49 2009 Subject: [plt-scheme] event mouse In-Reply-To: <7287891a-20b5-4674-bd56-c7ddad390c54@p8g2000yqb.googlegroups.com> References: <7287891a-20b5-4674-bd56-c7ddad390c54@p8g2000yqb.googlegroups.com> Message-ID: <90C3AC98-62A6-4838-A3A0-5A439C7367C2@ccs.neu.edu> On Nov 20, 2009, at 2:36 PM, Mona wrote: > Hi every body I Have problem in my project ,my project is dots and box > I want when I click between two posn it draws line ,I add techpack > universe.ss What I must do ?please help to me. Easy. Just define an event handler for mouse clicks and keep the coordinates in the state. From carl.eastlund at gmail.com Sat Nov 21 00:14:35 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Sat Nov 21 00:22:37 2009 Subject: [plt-scheme] #%app literal does not match in syntax-case pattern In-Reply-To: <252c42fe0911201745j2c914178uc73e9b588407ef1b@mail.gmail.com> References: <252c42fe0911191354j2ce63f73q16c15da540eeba72@mail.gmail.com> <19206.9724.532506.576793@winooski.ccs.neu.edu> <252c42fe0911201409l4a5361b5k7c763f0ee68f0c@mail.gmail.com> <19207.5526.78917.522340@winooski.ccs.neu.edu> <252c42fe0911201445p30a6daf4x3761c072e865fba0@mail.gmail.com> <252c42fe0911201501y5f975b16o7fccc27df971974f@mail.gmail.com> <19207.14038.360939.219577@winooski.ccs.neu.edu> <252c42fe0911201745j2c914178uc73e9b588407ef1b@mail.gmail.com> Message-ID: <990e0c030911202114h1895ad9co6e651c92d9ee9b6c@mail.gmail.com> On Fri, Nov 20, 2009 at 8:45 PM, Marco Monteiro wrote: > On Sat, Nov 21, 2009 at 12:39 AM, Eli Barzilay wrote: >> >> On Nov 20, Marco Monteiro wrote: >> > One thing I forgot to mention: define, define-values and lambda in >> > the code fragments are from the scheme language. If I didn't >> > code-walk (or expand on the reader), I wouldn't be able to store the >> > expanded code, right? ?The problem, in this case, is hygiene (I >> > can't replace scheme's define-values because define expands to it) >> > and the quote: the code inside it is not expanded. >> >> Yes, if you want the expanded code then you need to expand it -- but >> why do you need to walk over the code? ?Or maybe you're talking about >> some compilation step of the expanded code (which is not what code >> walkers are usually used for in CL, at least IIRC). >> > > It may not be necessary (maybe this is implemented already somewhere > in the library), but here is?what I do: > > Given, in a module context: > > (define (x) (* x x)) > > I want to get: > > (list 'define-values '(x) (list '#%app '* 'x 'x)) > > I export #%module-begin from my language that wrap every immediate > subform in a X macro. The X macro takes the (define-values (x) (* x x)) form > and returns (list 'define-values '(x) (Y (* x x))). The Y macro code-walks > the > forms: it takes (* x y) and returns (list #'app (Y *) (Y x) (Y x)). Finally, > we get what we > want. The Y macro uses local-expand. > > This is a simplification. The Y macro returns more than symbols and > lists of symbols. For example, it may expand to an expression > that builds a syntax tree with location information. > > Is there a better way to get the expansion as given in the example above? > Maybe something that recursively applies local-expand to subforms. If there > is, I can use that and then traverse all the expanded code in one go. > > Thanks. > > Marco Marco (I almost typed "Macro" in place of your name), Why do you need to use "Y" to perform the recursive expansion? Why not just have your #%module-begin run local-expand on a regular #%module-begin wrapped around the contents, and post-process the fully expanded result? You can go from unexpanded code to expanded code in one non-recursive line of code. Then you can emit whatever code you want. And you don't need to emit lists (in fact, emitting lists will give you *bad* results with respect to hygienic macro expansion) if you want "Scheme ASTs". Syntax objects are Scheme ASTs, and have source location information -- you might as well just keep the whole syntax object around. The only real work you'll need to do is replacing top level expressions and the bodies of top level definitions with stubs (calls to void), and that's very shallow processing. --Carl From masm at acm.org Sat Nov 21 07:13:37 2009 From: masm at acm.org (Marco Monteiro) Date: Sat Nov 21 07:13:56 2009 Subject: [plt-scheme] #%app literal does not match in syntax-case pattern In-Reply-To: <990e0c030911202114h1895ad9co6e651c92d9ee9b6c@mail.gmail.com> References: <252c42fe0911191354j2ce63f73q16c15da540eeba72@mail.gmail.com> <19206.9724.532506.576793@winooski.ccs.neu.edu> <252c42fe0911201409l4a5361b5k7c763f0ee68f0c@mail.gmail.com> <19207.5526.78917.522340@winooski.ccs.neu.edu> <252c42fe0911201445p30a6daf4x3761c072e865fba0@mail.gmail.com> <252c42fe0911201501y5f975b16o7fccc27df971974f@mail.gmail.com> <19207.14038.360939.219577@winooski.ccs.neu.edu> <252c42fe0911201745j2c914178uc73e9b588407ef1b@mail.gmail.com> <990e0c030911202114h1895ad9co6e651c92d9ee9b6c@mail.gmail.com> Message-ID: <252c42fe0911210413j6767bdf9g35ae90c6df81ed71@mail.gmail.com> On Sat, Nov 21, 2009 at 5:14 AM, Carl Eastlund wrote: > Marco (I almost typed "Macro" in place of your name), > > Why do you need to use "Y" to perform the recursive expansion? Why > not just have your #%module-begin run local-expand on a regular > #%module-begin wrapped around the contents, and post-process the fully > expanded result? You can go from unexpanded code to expanded code in > one non-recursive line of code. Then you can emit whatever code you > want. And you don't need to emit lists (in fact, emitting lists will > give you *bad* results with respect to hygienic macro expansion) if > you want "Scheme ASTs". Syntax objects are Scheme ASTs, and have > source location information -- you might as well just keep the whole > syntax object around. The only real work you'll need to do is > replacing top level expressions and the bodies of top level > definitions with stubs (calls to void), and that's very shallow > processing. > > --Carl > You are right, of course. I was under the impression that local-expand only expands the immediate subform. I'm sorry for wasting yor time. Marco -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091121/e8f2f5e2/attachment.htm From mflatt at cs.utah.edu Sat Nov 21 11:08:03 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Sat Nov 21 11:08:33 2009 Subject: [plt-scheme] include and sub-directories In-Reply-To: <932b2f1f0911191620r6040d88cs86f4ecbdf7f79b4e@mail.gmail.com> References: <4B05CF08.2030700@ccs.neu.edu> <4B05D61D.4060704@ccs.neu.edu> <990e0c030911191542q284d9eb1gcca8c317fe765fc6@mail.gmail.com> <4B05DB5B.7000508@ccs.neu.edu> <932b2f1f0911191601o63b16e6hbde7850f6add0c49@mail.gmail.com> <4B05E073.6070001@ccs.neu.edu> <932b2f1f0911191620r6040d88cs86f4ecbdf7f79b4e@mail.gmail.com> Message-ID: <20091121160805.372256500CB@mail-svr1.cs.utah.edu> As with `require', you can use `file' to specify an unportable path: (include (file "foo-0.2.1/bar.scm")) At Thu, 19 Nov 2009 18:20:13 -0600, Robby Findler wrote: > I believe what Jay writes is true for require and that the same code > is used for require and include, but it somehow seems less important > for include. Maybe the right thing is a special argument to include to > say "don't down on my groove d00d". > > Robby > > On Thu, Nov 19, 2009 at 6:18 PM, Dave Herman wrote: > > I submitted a bug but I leave it to y'all -- I'm fine working around it by > > replacing '.' with '_' in my pathname. > > > > Thanks, > > Dave > > > > Jay McCarthy wrote: > >> > >> My impression is that this is to ensure source compatibility on the > >> many platforms we support. I am willing to bet that there is a version > >> of Windows or Mac OS 9 that these rules are specifically designed to > >> be safe wrt. > >> > >> Jay > >> > >> On Thu, Nov 19, 2009 at 5:01 PM, Robby Findler > >> wrote: > >>> > >>> This is probably reasonably considered a bug. :) > >>> > >>> On Thursday, November 19, 2009, Dave Herman wrote: > >>>> > >>>> So what you have run into is an annoying and obscure feature, but a > >>>> documented and apparently intentional one. > >>>> > >>>> > >>>> I think the error message could be more suggestive, and those docs are > >>>> pretty impenetrable. But I'm glad it's cleared up. Thanks for the help! > >>>> > >>>> Dave > >>>> > >>>> _________________________________________________ > >>>> ?For list-related administrative tasks: > >>>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > >>>> > >>> _________________________________________________ > >>> ?For list-related administrative tasks: > >>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > >>> > >> > >> > >> > > > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From dherman at ccs.neu.edu Sat Nov 21 12:17:36 2009 From: dherman at ccs.neu.edu (Dave Herman) Date: Sat Nov 21 12:18:09 2009 Subject: [plt-scheme] include and sub-directories In-Reply-To: <20091121160805.372256500CB@mail-svr1.cs.utah.edu> References: <4B05CF08.2030700@ccs.neu.edu> <4B05D61D.4060704@ccs.neu.edu> <990e0c030911191542q284d9eb1gcca8c317fe765fc6@mail.gmail.com> <4B05DB5B.7000508@ccs.neu.edu> <932b2f1f0911191601o63b16e6hbde7850f6add0c49@mail.gmail.com> <4B05E073.6070001@ccs.neu.edu> <932b2f1f0911191620r6040d88cs86f4ecbdf7f79b4e@mail.gmail.com> <20091121160805.372256500CB@mail-svr1.cs.utah.edu> Message-ID: <609AE035-EDED-4812-8181-BA3019E7972C@ccs.neu.edu> Yes, but for my purposes I needed it to be portable. Dave On Nov 21, 2009, at 11:08 AM, Matthew Flatt wrote: > As with `require', you can use `file' to specify an unportable path: > > (include (file "foo-0.2.1/bar.scm")) > > > At Thu, 19 Nov 2009 18:20:13 -0600, Robby Findler wrote: >> I believe what Jay writes is true for require and that the same code >> is used for require and include, but it somehow seems less important >> for include. Maybe the right thing is a special argument to include >> to >> say "don't down on my groove d00d". >> >> Robby >> >> On Thu, Nov 19, 2009 at 6:18 PM, Dave Herman >> wrote: >>> I submitted a bug but I leave it to y'all -- I'm fine working >>> around it by >>> replacing '.' with '_' in my pathname. >>> >>> Thanks, >>> Dave >>> >>> Jay McCarthy wrote: >>>> >>>> My impression is that this is to ensure source compatibility on the >>>> many platforms we support. I am willing to bet that there is a >>>> version >>>> of Windows or Mac OS 9 that these rules are specifically designed >>>> to >>>> be safe wrt. >>>> >>>> Jay >>>> >>>> On Thu, Nov 19, 2009 at 5:01 PM, Robby Findler >>>> wrote: >>>>> >>>>> This is probably reasonably considered a bug. :) >>>>> >>>>> On Thursday, November 19, 2009, Dave Herman >>>>> wrote: >>>>>> >>>>>> So what you have run into is an annoying and obscure feature, >>>>>> but a >>>>>> documented and apparently intentional one. >>>>>> >>>>>> >>>>>> I think the error message could be more suggestive, and those >>>>>> docs are >>>>>> pretty impenetrable. But I'm glad it's cleared up. Thanks for >>>>>> the help! >>>>>> >>>>>> Dave >>>>>> >>>>>> _________________________________________________ >>>>>> For list-related administrative tasks: >>>>>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>>>>> >>>>> _________________________________________________ >>>>> For list-related administrative tasks: >>>>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>>>> >>>> >>>> >>>> >>> >>> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme From carl.eastlund at gmail.com Sat Nov 21 15:07:13 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Sat Nov 21 15:07:50 2009 Subject: [plt-scheme] #%app literal does not match in syntax-case pattern In-Reply-To: <252c42fe0911210413j6767bdf9g35ae90c6df81ed71@mail.gmail.com> References: <252c42fe0911191354j2ce63f73q16c15da540eeba72@mail.gmail.com> <19206.9724.532506.576793@winooski.ccs.neu.edu> <252c42fe0911201409l4a5361b5k7c763f0ee68f0c@mail.gmail.com> <19207.5526.78917.522340@winooski.ccs.neu.edu> <252c42fe0911201445p30a6daf4x3761c072e865fba0@mail.gmail.com> <252c42fe0911201501y5f975b16o7fccc27df971974f@mail.gmail.com> <19207.14038.360939.219577@winooski.ccs.neu.edu> <252c42fe0911201745j2c914178uc73e9b588407ef1b@mail.gmail.com> <990e0c030911202114h1895ad9co6e651c92d9ee9b6c@mail.gmail.com> <252c42fe0911210413j6767bdf9g35ae90c6df81ed71@mail.gmail.com> Message-ID: <990e0c030911211207y33da9d3enfec31bd348643bce@mail.gmail.com> On Sat, Nov 21, 2009 at 7:13 AM, Marco Monteiro wrote: > On Sat, Nov 21, 2009 at 5:14 AM, Carl Eastlund > wrote: >> >> Marco (I almost typed "Macro" in place of your name), >> >> Why do you need to use "Y" to perform the recursive expansion? ?Why >> not just have your #%module-begin run local-expand on a regular >> #%module-begin wrapped around the contents, and post-process the fully >> expanded result? ?You can go from unexpanded code to expanded code in >> one non-recursive line of code. ?Then you can emit whatever code you >> want. ?And you don't need to emit lists (in fact, emitting lists will >> give you *bad* results with respect to hygienic macro expansion) if >> you want "Scheme ASTs". ?Syntax objects are Scheme ASTs, and have >> source location information -- you might as well just keep the whole >> syntax object around. ?The only real work you'll need to do is >> replacing top level expressions and the bodies of top level >> definitions with stubs (calls to void), and that's very shallow >> processing. >> >> --Carl > > You are right, of course. I was under the impression that local-expand only > expands the immediate subform. > > I'm sorry for wasting yor time. No waste. I'm well aware how tricky playing games with #%module-begin and local-expand can be. In fact, I probably shouldn't have phrased my statement in terms of "why do you need ..." as if you should have known this, so sorry if I implied that. It wasn't intentional. Best of luck with your compiler! --Carl From ebzzry at gmail.com Sat Nov 21 19:06:03 2009 From: ebzzry at gmail.com (Rommel M. Martinez) Date: Sat Nov 21 19:06:44 2009 Subject: [plt-scheme] Web server dispatcher call wrapper Message-ID: <391934950911211606k164d8f3ck396ba5f3c7828c38@mail.gmail.com> Is there a way to wrap a call to a dispatcher so that it simulates an HTTP POST request? For example, if `render-foo' is defined as: (define (render-foo request x y) (local [(define (response-generator make-url) ...)] (send/suspend/dispatch response-generator))) How can I call `render-foo' like this? (with-bindings [(x "foo") (y "bar")] (render-foo request)) -- Rommel M. Martinez http://www.bespin.org/~ebzzry From jmj at fellowhuman.com Sat Nov 21 19:17:07 2009 From: jmj at fellowhuman.com (Jordan Johnson) Date: Sat Nov 21 19:17:25 2009 Subject: [plt-scheme] Planet HTTP 403 errors Message-ID: Hi all, I seem to consistently be unable to download planet packages from my home computer: I get a 403 error, regardless of package. Since I'm usually working from school (and for a long time I only happened on this error at odd hours of the night on weekends, which let me assume it was a periodic planned-downtime issue) I haven't bothered to report this, but it's been consistent for the last few weeks, happening every time I've tried regardless of time of day. I have an off-the-shelf D-Link router / masquerading firewall, and am running OS 10 Leopard. Logging into a server on my university account, I can download packages with no problems, but at home (require (planet ...)) always fails, showing the error: require: PLaneT could not download the requested package: Internal error (unknown HTTP response code 403) I've tried multiple versions of DrScheme and mzscheme. Any ideas, or suggestions for further troubleshooting? Thanks, jmj From jay.mccarthy at gmail.com Sat Nov 21 19:19:04 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Sat Nov 21 19:19:23 2009 Subject: [plt-scheme] Web server dispatcher call wrapper In-Reply-To: <391934950911211606k164d8f3ck396ba5f3c7828c38@mail.gmail.com> References: <391934950911211606k164d8f3ck396ba5f3c7828c38@mail.gmail.com> Message-ID: I don't understand. Are you trying to write test cases? And you want to make a fake 'request' object? You can just construct them manually based on the docs in the web-server/http collection. Jay On Sat, Nov 21, 2009 at 5:06 PM, Rommel M. Martinez wrote: > Is there a way to wrap a call to a dispatcher so that it simulates an > HTTP POST request? For example, if `render-foo' is defined as: > > (define (render-foo request x y) > ?(local [(define (response-generator make-url) ...)] > ? ?(send/suspend/dispatch response-generator))) > > How can I call `render-foo' like this? > > (with-bindings > ?[(x "foo") > ? (y "bar")] > ?(render-foo request)) > > > -- > Rommel M. Martinez > http://www.bespin.org/~ebzzry > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From ebzzry at gmail.com Sat Nov 21 19:38:59 2009 From: ebzzry at gmail.com (Rommel M. Martinez) Date: Sat Nov 21 19:39:56 2009 Subject: [plt-scheme] Web server dispatcher call wrapper In-Reply-To: References: <391934950911211606k164d8f3ck396ba5f3c7828c38@mail.gmail.com> Message-ID: <391934950911211638l1ab0e8f4p99c2280c09327436@mail.gmail.com> Yes, I'm trying to write test cases. Ah yes. I also found the test cases in bindings-test.ss. On Sun, Nov 22, 2009 at 8:19 AM, Jay McCarthy wrote: > I don't understand. > > Are you trying to write test cases? And you want to make a fake > 'request' object? You can just construct them manually based on the > docs in the web-server/http collection. > > Jay > > On Sat, Nov 21, 2009 at 5:06 PM, Rommel M. Martinez wrote: >> Is there a way to wrap a call to a dispatcher so that it simulates an >> HTTP POST request? For example, if `render-foo' is defined as: >> >> (define (render-foo request x y) >> ?(local [(define (response-generator make-url) ...)] >> ? ?(send/suspend/dispatch response-generator))) >> >> How can I call `render-foo' like this? >> >> (with-bindings >> ?[(x "foo") >> ? (y "bar")] >> ?(render-foo request)) >> >> >> -- >> Rommel M. Martinez >> http://www.bespin.org/~ebzzry >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > > > > -- > Jay McCarthy > Assistant Professor / Brigham Young University > http://teammccarthy.org/jay > > "The glory of God is Intelligence" - D&C 93 > -- Rommel M. Martinez http://www.bespin.org/~ebzzry From jay.mccarthy at gmail.com Sat Nov 21 19:52:15 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Sat Nov 21 19:52:35 2009 Subject: [plt-scheme] Web server dispatcher call wrapper In-Reply-To: <391934950911211638l1ab0e8f4p99c2280c09327436@mail.gmail.com> References: <391934950911211606k164d8f3ck396ba5f3c7828c38@mail.gmail.com> <391934950911211638l1ab0e8f4p99c2280c09327436@mail.gmail.com> Message-ID: Also take a look at delirium to do end-to-end testing of the application itself. Jay On Sat, Nov 21, 2009 at 5:38 PM, Rommel M. Martinez wrote: > Yes, I'm trying to write test cases. > > Ah yes. I also found the test cases in bindings-test.ss. > > On Sun, Nov 22, 2009 at 8:19 AM, Jay McCarthy wrote: >> I don't understand. >> >> Are you trying to write test cases? And you want to make a fake >> 'request' object? You can just construct them manually based on the >> docs in the web-server/http collection. >> >> Jay >> >> On Sat, Nov 21, 2009 at 5:06 PM, Rommel M. Martinez wrote: >>> Is there a way to wrap a call to a dispatcher so that it simulates an >>> HTTP POST request? For example, if `render-foo' is defined as: >>> >>> (define (render-foo request x y) >>> ?(local [(define (response-generator make-url) ...)] >>> ? ?(send/suspend/dispatch response-generator))) >>> >>> How can I call `render-foo' like this? >>> >>> (with-bindings >>> ?[(x "foo") >>> ? (y "bar")] >>> ?(render-foo request)) >>> >>> >>> -- >>> Rommel M. Martinez >>> http://www.bespin.org/~ebzzry >>> _________________________________________________ >>> ?For list-related administrative tasks: >>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>> >> >> >> >> -- >> Jay McCarthy >> Assistant Professor / Brigham Young University >> http://teammccarthy.org/jay >> >> "The glory of God is Intelligence" - D&C 93 >> > > > > -- > Rommel M. Martinez > http://www.bespin.org/~ebzzry > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From ebzzry at gmail.com Sat Nov 21 20:40:32 2009 From: ebzzry at gmail.com (Rommel M. Martinez) Date: Sat Nov 21 20:41:12 2009 Subject: [plt-scheme] Web server dispatcher call wrapper In-Reply-To: References: <391934950911211606k164d8f3ck396ba5f3c7828c38@mail.gmail.com> <391934950911211638l1ab0e8f4p99c2280c09327436@mail.gmail.com> Message-ID: <391934950911211740r2cac7088s84c05a226331ac17@mail.gmail.com> Thanks for the tip. I'll take a look at that. On Sun, Nov 22, 2009 at 8:52 AM, Jay McCarthy wrote: > Also take a look at delirium to do end-to-end testing of the application itself. > > Jay > > On Sat, Nov 21, 2009 at 5:38 PM, Rommel M. Martinez wrote: >> Yes, I'm trying to write test cases. >> >> Ah yes. I also found the test cases in bindings-test.ss. >> >> On Sun, Nov 22, 2009 at 8:19 AM, Jay McCarthy wrote: >>> I don't understand. >>> >>> Are you trying to write test cases? And you want to make a fake >>> 'request' object? You can just construct them manually based on the >>> docs in the web-server/http collection. >>> >>> Jay >>> >>> On Sat, Nov 21, 2009 at 5:06 PM, Rommel M. Martinez wrote: >>>> Is there a way to wrap a call to a dispatcher so that it simulates an >>>> HTTP POST request? For example, if `render-foo' is defined as: >>>> >>>> (define (render-foo request x y) >>>> ?(local [(define (response-generator make-url) ...)] >>>> ? ?(send/suspend/dispatch response-generator))) >>>> >>>> How can I call `render-foo' like this? >>>> >>>> (with-bindings >>>> ?[(x "foo") >>>> ? (y "bar")] >>>> ?(render-foo request)) >>>> >>>> >>>> -- >>>> Rommel M. Martinez >>>> http://www.bespin.org/~ebzzry >>>> _________________________________________________ >>>> ?For list-related administrative tasks: >>>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>>> >>> >>> >>> >>> -- >>> Jay McCarthy >>> Assistant Professor / Brigham Young University >>> http://teammccarthy.org/jay >>> >>> "The glory of God is Intelligence" - D&C 93 >>> >> >> >> >> -- >> Rommel M. Martinez >> http://www.bespin.org/~ebzzry >> > > > > -- > Jay McCarthy > Assistant Professor / Brigham Young University > http://teammccarthy.org/jay > > "The glory of God is Intelligence" - D&C 93 > -- Rommel M. Martinez http://www.bespin.org/~ebzzry From ebzzry at gmail.com Sat Nov 21 20:49:39 2009 From: ebzzry at gmail.com (Rommel M. Martinez) Date: Sat Nov 21 20:50:30 2009 Subject: [plt-scheme] Web server dispatcher call wrapper In-Reply-To: <391934950911211740r2cac7088s84c05a226331ac17@mail.gmail.com> References: <391934950911211606k164d8f3ck396ba5f3c7828c38@mail.gmail.com> <391934950911211638l1ab0e8f4p99c2280c09327436@mail.gmail.com> <391934950911211740r2cac7088s84c05a226331ac17@mail.gmail.com> Message-ID: <391934950911211749l72fa65c1va0b034a34d4e5e28@mail.gmail.com> A separate but related question: I noticed that in the unit tests, there are references to modules that are not in the base PLT installation, like schemeunit. What is the advised way to run these tests without force-modifying the scheme installation? On Sun, Nov 22, 2009 at 9:40 AM, Rommel M. Martinez wrote: > Thanks for the tip. I'll take a look at that. > > On Sun, Nov 22, 2009 at 8:52 AM, Jay McCarthy wrote: >> Also take a look at delirium to do end-to-end testing of the application itself. >> >> Jay >> >> On Sat, Nov 21, 2009 at 5:38 PM, Rommel M. Martinez wrote: >>> Yes, I'm trying to write test cases. >>> >>> Ah yes. I also found the test cases in bindings-test.ss. >>> >>> On Sun, Nov 22, 2009 at 8:19 AM, Jay McCarthy wrote: >>>> I don't understand. >>>> >>>> Are you trying to write test cases? And you want to make a fake >>>> 'request' object? You can just construct them manually based on the >>>> docs in the web-server/http collection. >>>> >>>> Jay >>>> >>>> On Sat, Nov 21, 2009 at 5:06 PM, Rommel M. Martinez wrote: >>>>> Is there a way to wrap a call to a dispatcher so that it simulates an >>>>> HTTP POST request? For example, if `render-foo' is defined as: >>>>> >>>>> (define (render-foo request x y) >>>>> ?(local [(define (response-generator make-url) ...)] >>>>> ? ?(send/suspend/dispatch response-generator))) >>>>> >>>>> How can I call `render-foo' like this? >>>>> >>>>> (with-bindings >>>>> ?[(x "foo") >>>>> ? (y "bar")] >>>>> ?(render-foo request)) >>>>> >>>>> >>>>> -- >>>>> Rommel M. Martinez >>>>> http://www.bespin.org/~ebzzry >>>>> _________________________________________________ >>>>> ?For list-related administrative tasks: >>>>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>>>> >>>> >>>> >>>> >>>> -- >>>> Jay McCarthy >>>> Assistant Professor / Brigham Young University >>>> http://teammccarthy.org/jay >>>> >>>> "The glory of God is Intelligence" - D&C 93 >>>> >>> >>> >>> >>> -- >>> Rommel M. Martinez >>> http://www.bespin.org/~ebzzry >>> >> >> >> >> -- >> Jay McCarthy >> Assistant Professor / Brigham Young University >> http://teammccarthy.org/jay >> >> "The glory of God is Intelligence" - D&C 93 >> > > > > -- > Rommel M. Martinez > http://www.bespin.org/~ebzzry > -- Rommel M. Martinez http://www.bespin.org/~ebzzry From jay.mccarthy at gmail.com Sat Nov 21 20:53:06 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Sat Nov 21 20:53:41 2009 Subject: [plt-scheme] Web server dispatcher call wrapper In-Reply-To: <391934950911211749l72fa65c1va0b034a34d4e5e28@mail.gmail.com> References: <391934950911211606k164d8f3ck396ba5f3c7828c38@mail.gmail.com> <391934950911211638l1ab0e8f4p99c2280c09327436@mail.gmail.com> <391934950911211740r2cac7088s84c05a226331ac17@mail.gmail.com> <391934950911211749l72fa65c1va0b034a34d4e5e28@mail.gmail.com> Message-ID: <51109F85-76C2-4CF3-BA6D-CCD0E9AD4894@gmail.com> The tests only run in the svn release. Sent from my iPhone On Nov 21, 2009, at 6:49 PM, "Rommel M. Martinez" wrote: > A separate but related question: I noticed that in the unit tests, > there are references > to modules that are not in the base PLT installation, like schemeunit. > What is the > advised way to run these tests without force-modifying the scheme > installation? > > On Sun, Nov 22, 2009 at 9:40 AM, Rommel M. Martinez > wrote: >> Thanks for the tip. I'll take a look at that. >> >> On Sun, Nov 22, 2009 at 8:52 AM, Jay McCarthy >> wrote: >>> Also take a look at delirium to do end-to-end testing of the >>> application itself. >>> >>> Jay >>> >>> On Sat, Nov 21, 2009 at 5:38 PM, Rommel M. Martinez >> > wrote: >>>> Yes, I'm trying to write test cases. >>>> >>>> Ah yes. I also found the test cases in bindings-test.ss. >>>> >>>> On Sun, Nov 22, 2009 at 8:19 AM, Jay McCarthy >>> > wrote: >>>>> I don't understand. >>>>> >>>>> Are you trying to write test cases? And you want to make a fake >>>>> 'request' object? You can just construct them manually based on >>>>> the >>>>> docs in the web-server/http collection. >>>>> >>>>> Jay >>>>> >>>>> On Sat, Nov 21, 2009 at 5:06 PM, Rommel M. Martinez >>>> > wrote: >>>>>> Is there a way to wrap a call to a dispatcher so that it >>>>>> simulates an >>>>>> HTTP POST request? For example, if `render-foo' is defined as: >>>>>> >>>>>> (define (render-foo request x y) >>>>>> (local [(define (response-generator make-url) ...)] >>>>>> (send/suspend/dispatch response-generator))) >>>>>> >>>>>> How can I call `render-foo' like this? >>>>>> >>>>>> (with-bindings >>>>>> [(x "foo") >>>>>> (y "bar")] >>>>>> (render-foo request)) >>>>>> >>>>>> >>>>>> -- >>>>>> Rommel M. Martinez >>>>>> http://www.bespin.org/~ebzzry >>>>>> _________________________________________________ >>>>>> For list-related administrative tasks: >>>>>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Jay McCarthy >>>>> Assistant Professor / Brigham Young University >>>>> http://teammccarthy.org/jay >>>>> >>>>> "The glory of God is Intelligence" - D&C 93 >>>>> >>>> >>>> >>>> >>>> -- >>>> Rommel M. Martinez >>>> http://www.bespin.org/~ebzzry >>>> >>> >>> >>> >>> -- >>> Jay McCarthy >>> Assistant Professor / Brigham Young University >>> http://teammccarthy.org/jay >>> >>> "The glory of God is Intelligence" - D&C 93 >>> >> >> >> >> -- >> Rommel M. Martinez >> http://www.bespin.org/~ebzzry >> > > > > -- > Rommel M. Martinez > http://www.bespin.org/~ebzzry From ebzzry at gmail.com Sat Nov 21 21:16:45 2009 From: ebzzry at gmail.com (Rommel M. Martinez) Date: Sat Nov 21 21:17:26 2009 Subject: [plt-scheme] Web server dispatcher call wrapper In-Reply-To: <51109F85-76C2-4CF3-BA6D-CCD0E9AD4894@gmail.com> References: <391934950911211606k164d8f3ck396ba5f3c7828c38@mail.gmail.com> <391934950911211638l1ab0e8f4p99c2280c09327436@mail.gmail.com> <391934950911211740r2cac7088s84c05a226331ac17@mail.gmail.com> <391934950911211749l72fa65c1va0b034a34d4e5e28@mail.gmail.com> <51109F85-76C2-4CF3-BA6D-CCD0E9AD4894@gmail.com> Message-ID: <391934950911211816r17a2867mea7a3acb051c983f@mail.gmail.com> OK. Thanks for the clarification. On Sun, Nov 22, 2009 at 9:53 AM, Jay McCarthy wrote: > The tests only run in the svn release. > > Sent from my iPhone > > On Nov 21, 2009, at 6:49 PM, "Rommel M. Martinez" wrote: > >> A separate but related question: I noticed that in the unit tests, >> there are references >> to modules that are not in the base PLT installation, like schemeunit. >> What is the >> advised way to run these tests without force-modifying the scheme >> installation? >> >> On Sun, Nov 22, 2009 at 9:40 AM, Rommel M. Martinez >> wrote: >>> >>> Thanks for the tip. I'll take a look at that. >>> >>> On Sun, Nov 22, 2009 at 8:52 AM, Jay McCarthy >>> wrote: >>>> >>>> Also take a look at delirium to do end-to-end testing of the application >>>> itself. >>>> >>>> Jay >>>> >>>> On Sat, Nov 21, 2009 at 5:38 PM, Rommel M. Martinez >>>> wrote: >>>>> >>>>> Yes, I'm trying to write test cases. >>>>> >>>>> Ah yes. I also found the test cases in bindings-test.ss. >>>>> >>>>> On Sun, Nov 22, 2009 at 8:19 AM, Jay McCarthy >>>>> wrote: >>>>>> >>>>>> I don't understand. >>>>>> >>>>>> Are you trying to write test cases? And you want to make a fake >>>>>> 'request' object? You can just construct them manually based on the >>>>>> docs in the web-server/http collection. >>>>>> >>>>>> Jay >>>>>> >>>>>> On Sat, Nov 21, 2009 at 5:06 PM, Rommel M. Martinez >>>>>> wrote: >>>>>>> >>>>>>> Is there a way to wrap a call to a dispatcher so that it simulates an >>>>>>> HTTP POST request? For example, if `render-foo' is defined as: >>>>>>> >>>>>>> (define (render-foo request x y) >>>>>>> ?(local [(define (response-generator make-url) ...)] >>>>>>> ? (send/suspend/dispatch response-generator))) >>>>>>> >>>>>>> How can I call `render-foo' like this? >>>>>>> >>>>>>> (with-bindings >>>>>>> ?[(x "foo") >>>>>>> ?(y "bar")] >>>>>>> ?(render-foo request)) >>>>>>> >>>>>>> >>>>>>> -- >>>>>>> Rommel M. Martinez >>>>>>> http://www.bespin.org/~ebzzry >>>>>>> _________________________________________________ >>>>>>> ?For list-related administrative tasks: >>>>>>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -- >>>>>> Jay McCarthy >>>>>> Assistant Professor / Brigham Young University >>>>>> http://teammccarthy.org/jay >>>>>> >>>>>> "The glory of God is Intelligence" - D&C 93 >>>>>> >>>>> >>>>> >>>>> >>>>> -- >>>>> Rommel M. Martinez >>>>> http://www.bespin.org/~ebzzry >>>>> >>>> >>>> >>>> >>>> -- >>>> Jay McCarthy >>>> Assistant Professor / Brigham Young University >>>> http://teammccarthy.org/jay >>>> >>>> "The glory of God is Intelligence" - D&C 93 >>>> >>> >>> >>> >>> -- >>> Rommel M. Martinez >>> http://www.bespin.org/~ebzzry >>> >> >> >> >> -- >> Rommel M. Martinez >> http://www.bespin.org/~ebzzry > -- Rommel M. Martinez http://www.bespin.org/~ebzzry From farrer at cs.utah.edu Sat Nov 21 22:06:41 2009 From: farrer at cs.utah.edu (Evan Farrer) Date: Sat Nov 21 22:07:03 2009 Subject: [plt-scheme] could we have a git-svn mirror of the repository? In-Reply-To: References: <19182.52977.971236.466927@winooski.ccs.neu.edu> Message-ID: <20091122030641.GA2615@memphis.cs.utah.edu> I've found that it's sufficient to just use git-svn directly for svn projects. The major differences between git-svn on a svn repository and using git on a git repository is using git-svn dcommit instead of push and git svn rebase instead of pull. I haven't tried it but I suspect this will just work. git svn clone http://svn.plt-scheme.org/plt -T trunk -b branches -t tags Evan On Sun, Nov 08, 2009 at 07:23:22PM +0530, Martin DeMello wrote: > Github has support for importing of an existing public svn repository. > Seems like the best way to go - they have an excellent setup for > managing git repositories, and are one of the default open source > project sites these days. I asked on stackoverflow how I might do such > a thing myself and both responses I got said 'just use github'. The > best workflow I can think of is: > > 1. Let github do the import > 2. Do a local checkout of the github repo > 3. Have an svn post-commit hook to rebase your local repo and then > push it to github > > martin > > p.s. keeping this on list so that other people can chime in with > possible better suggestions > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From sbloch at adelphi.edu Sat Nov 21 19:40:40 2009 From: sbloch at adelphi.edu (Stephen Bloch) Date: Sun Nov 22 12:55:02 2009 Subject: [plt-scheme] Planet HTTP 403 errors In-Reply-To: References: Message-ID: <9F7516C7-1857-4559-A091-2F5526A0869D@adelphi.edu> Jordan Johnson wrote: > I seem to consistently be unable to download planet packages from my > home computer: I get a 403 error, regardless of package. I've been getting the same thing for the past week or two. I know the server is up, because downloading with the command-line "planet" command works fine, but I haven't been able to "(require (planet ...))" unless the relevant package is already in the local cache. Steve From anesward at mac.com Sun Nov 22 15:54:47 2009 From: anesward at mac.com (mike) Date: Sun Nov 22 16:03:55 2009 Subject: [plt-scheme] abstract wall of recursion Message-ID: <83827dc3-e400-49dd-bb2d-8e7d7a666c53@o9g2000prg.googlegroups.com> Problem 14.3.4 and 15.1.2 were certainly challenging but i was able to solve them by not thinking too deeply about the recursive procedures embedded within both solutions. And that is the problem if i try to think too much about what is going on, i feel i'm hitting an abstract wall made of steel. I hope this unsettled feeling is part of the learning process and will pass. mike From martindemello at gmail.com Sun Nov 22 16:18:43 2009 From: martindemello at gmail.com (Martin DeMello) Date: Sun Nov 22 16:19:04 2009 Subject: [plt-scheme] could we have a git-svn mirror of the repository? In-Reply-To: <20091122030641.GA2615@memphis.cs.utah.edu> References: <19182.52977.971236.466927@winooski.ccs.neu.edu> <20091122030641.GA2615@memphis.cs.utah.edu> Message-ID: That pulls the entire svn history; I tried it and it died midway, which is what prompted this whole post :) It'd be far more efficient (and kinder to the servers!) for the maintainers to maintain a git clone, and then let other people pull from there. martin On Sun, Nov 22, 2009 at 8:36 AM, Evan Farrer wrote: > I've found that it's sufficient to just use git-svn directly for svn > projects. ?The major differences between git-svn on a svn repository and > using git on a git repository is using git-svn dcommit instead of push > and git svn rebase instead of pull. > > I haven't tried it but I suspect this will just work. > ? ?git svn clone http://svn.plt-scheme.org/plt -T trunk -b branches -t tags > > Evan > > On Sun, Nov 08, 2009 at 07:23:22PM +0530, Martin DeMello wrote: >> Github has support for importing of an existing public svn repository. >> Seems like the best way to go - they have an excellent setup for >> managing git repositories, and are one of the default open source >> project sites these days. I asked on stackoverflow how I might do such >> a thing myself and both responses I got said 'just use github'. The >> best workflow I can think of is: >> >> 1. Let github do the import >> 2. Do a local checkout of the github repo >> 3. Have an svn post-commit hook to rebase your local repo and then >> push it to github >> >> martin >> >> p.s. keeping this on list so that other people can chime in with >> possible better suggestions >> _________________________________________________ >> ? For list-related administrative tasks: >> ? http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From noelwelsh at gmail.com Sun Nov 22 17:21:37 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Sun Nov 22 17:21:54 2009 Subject: [plt-scheme] abstract wall of recursion In-Reply-To: <83827dc3-e400-49dd-bb2d-8e7d7a666c53@o9g2000prg.googlegroups.com> References: <83827dc3-e400-49dd-bb2d-8e7d7a666c53@o9g2000prg.googlegroups.com> Message-ID: How do you feel about proof by induction? If you're not comfortable/familiar might try some simple proofs by induction to get comfortable with it. This was 1st year maths for me, so there should be many examples on the 'net. Proof by induction is the basis for solving problems by recursion. HTH, N. On Sun, Nov 22, 2009 at 8:54 PM, mike wrote: > Problem 14.3.4 and 15.1.2 were certainly challenging but i was able to > solve them by not thinking too deeply about the > recursive procedures embedded within both solutions. And > that is the problem if i try to think too much about what is > going on, i feel i'm hitting an abstract wall made of steel. > ?I hope this unsettled feeling is part of the learning process > and will pass. > mike From carl.eastlund at gmail.com Sun Nov 22 17:44:29 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Sun Nov 22 17:45:08 2009 Subject: [plt-scheme] abstract wall of recursion In-Reply-To: <83827dc3-e400-49dd-bb2d-8e7d7a666c53@o9g2000prg.googlegroups.com> References: <83827dc3-e400-49dd-bb2d-8e7d7a666c53@o9g2000prg.googlegroups.com> Message-ID: <990e0c030911221444y56e04632g655acf911b37231@mail.gmail.com> On Sun, Nov 22, 2009 at 3:54 PM, mike wrote: > Problem 14.3.4 and 15.1.2 were certainly challenging but i was able to > solve them by not thinking too deeply about the > recursive procedures embedded within both solutions. And > that is the problem if i try to think too much about what is > going on, i feel i'm hitting an abstract wall made of steel. > ?I hope this unsettled feeling is part of the learning process > and will pass. > mike Actually, I would say you're on the right side of that wall. That wall is part of the lesson. It is the computer's job to think deeply about the recursion, taking 1,000 steps to process a list of 1,000 elements. It is the programmer's job to think shallowly about recursion. To process a list of 1,000 elements, you only have to think about two steps: 0 elements (the base or "empty?" case) and "one more" element (the recursive or "cons?" case). When writing the "one more" case, you don't have to think about the 999 steps the recursive call takes, you get to trust that they work and use your contract, purpose statement, and examples to figure out what they (should) do. --Carl From robby at eecs.northwestern.edu Sun Nov 22 17:54:14 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Sun Nov 22 17:54:35 2009 Subject: [plt-scheme] Planet HTTP 403 errors In-Reply-To: <9F7516C7-1857-4559-A091-2F5526A0869D@adelphi.edu> References: <9F7516C7-1857-4559-A091-2F5526A0869D@adelphi.edu> Message-ID: <932b2f1f0911221454q3160b8dco700a777b2b2d5070@mail.gmail.com> jmj, Steve: What happens if you try to visit the relevant link in your web browser? Here's one example url, which I got from the planet commandline tool: % planet url sbloch tiles.plt 1 14 http://planet.plt-scheme.org/servlets/planet-servlet.ss?lang=%224.2.3.2%22&name=%22tiles.plt%22&maj=1&min-lo=14&min-hi=%23f&path=%28%22sbloch%22%29 You should get a few screenfuls of gibberish, starting like this: H4sIAJF83EoAA+xdbXPTRtf+jH7F3mIKNhPZjhNoSELaEt5SoPCQAKWdDs9KWltqJK0qreIY hvu33+fsSrJky45tiONQZSaJvS9nz1579jr7Ju3rFydaw6O+aVPSiNg/CYsF6VHXSyLWJA2L Robby From jmj at fellowhuman.com Sun Nov 22 22:58:53 2009 From: jmj at fellowhuman.com (Jordan Johnson) Date: Sun Nov 22 22:59:12 2009 Subject: [plt-scheme] Planet HTTP 403 errors In-Reply-To: <932b2f1f0911221454q3160b8dco700a777b2b2d5070@mail.gmail.com> References: <9F7516C7-1857-4559-A091-2F5526A0869D@adelphi.edu> <932b2f1f0911221454q3160b8dco700a777b2b2d5070@mail.gmail.com> Message-ID: Hi Robby, In Safari it works, though again, in DrScheme (require (planet sbloch/ tiles:1:14)) fails (and so does the old-style require). jmj On Nov 22, 2009, at 2:54 PM, Robby Findler wrote: > jmj, Steve: > > What happens if you try to visit the relevant link in your web > browser? Here's one example url, which I got from the planet > commandline tool: > > % planet url sbloch tiles.plt 1 14 > http://planet.plt-scheme.org/servlets/planet-servlet.ss?lang=%224.2.3.2%22&name=%22tiles.plt%22&maj=1&min-lo=14&min-hi=%23f&path=%28%22sbloch%22%29 > > You should get a few screenfuls of gibberish, starting like this: > > H4sIAJF83EoAA+xdbXPTRtf > +jH7F3mIKNhPZjhNoSELaEt5SoPCQAKWdDs9KWltqJK0qreIY > hvu33+fsSrJky45tiONQZSaJvS9nz1579jr7Ju3rFydaw6O+aVPSiNg/ > CYsF6VHXSyLWJA2L > > Robby