From eli at barzilay.org Thu Oct 1 00:57:05 2009 From: eli at barzilay.org (Eli Barzilay) Date: Thu Oct 1 00:57:27 2009 Subject: [plt-scheme] Teeny little net/url bug [and 1 more messages] In-Reply-To: <4AC3DC94.8090104@synx.us.to>, <4AC3E2BD.3010509@synx.us.to> References: <4AC3DC94.8090104@synx.us.to> <4AC3E2BD.3010509@synx.us.to> Message-ID: <19140.13985.224066.635320@winooski.ccs.neu.edu> On Sep 30, Synx wrote: > (url->string (string->url "?")) => "" > > I can't seem to make a url structure where url->string produces the > valid URL "?" (meaning the same spot, with no query arguments). "" > by itself means the same spot with the same query arguments. > > I would recommend adding something in the url structure contract > that allows the query portion of make-url be either (listof (cons/c > symbol? (or/c false/c string?))) or 'clear to produce a ? without > any name/value pairs. Allowing #f (which is a different contract) seems like the right thing (given that the fragment part is done this way), but I'm not sure if there's code that relies on it. Is there anyone who uses this and relies on the query part to always be a list of bindings? On Sep 30, Synx wrote: > [...] > So it handles space/%25 just fine, but colon gets encoded, decoded, > but never encoded again when it ought to be. That makes it > impossible to make a relative url whose path contains colons, as > (url->string) returns unescaped colons, which are treated as > delimiters for the schema. The problem with making colons be decoded too is shown in this test that fails: (url->string (path->url (bytes->path #"c:\\a\\b" 'windows))) does not return "file:///c:/a/b" I'm not sure that it's a good idea to change this, although it looks like the encoded uris do get to the right place on Windows. (I tried FF, IE, and Opera). Anyone? -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From clklein at eecs.northwestern.edu Thu Oct 1 07:03:02 2009 From: clklein at eecs.northwestern.edu (Casey Klein) Date: Thu Oct 1 07:03:20 2009 Subject: [plt-scheme] redex: leveraging generated checks and coverage In-Reply-To: <1368C526-01CF-4CA8-B459-C5CED1155847@dcc.uchile.cl> References: <7BC19F94-3904-43A5-BE44-47929BAE9539@dcc.uchile.cl> <1368C526-01CF-4CA8-B459-C5CED1155847@dcc.uchile.cl> Message-ID: On Thu, Sep 17, 2009 at 4:09 PM, Eric Tanter wrote: >> My guess is that you have a side-condition somewhere that Redex is >> having trouble satisfying randomly. >> [..] > > right, that may definitely be the case > >> (define-language M >> ?(q (side-condition number_1 (= (term number_1) 12345431)))) >> >>> (redex-check M q #t) >> >> redex-check: unable to generate pattern number_1 in 100 attempts >> >> This error message should really include the side-condition part of >> the pattern since it's that part, not number_1, that's actually >> causing the difficulty. I'll fix that. > > That'd be better indeed. This is fixed in SVN (but not in time for the 4.2.2 release). > (define-language L (n number)) > (redex-check L (side-condition n #f) #t) redex-check: unable to generate pattern (side-condition n #) in 100 attempts If the pattern that can't be satisifed is the left-hand side of a relation clause, the message points to that clause. > (check-reduction-relation (reduction-relation L (--> n n (side-condition #f) foo)) (? (_) #t)) check-reduction-relation: unable to generate LHS of foo in 100 attempts > (check-reduction-relation (reduction-relation L (--> n n (side-condition #f))) (? (_) #t)) check-reduction-relation: unable to generate LHS of clause at unsaved-editor4524:18:9 in 100 attempts >>> * Finally, I really enjoy the coverage report for a reduction relation. >>> There does not seem to be a similar functionality for metafunctions, >>> though. >>> It would be nice if I could get confidence that my test cases, in >>> addition >>> to testing all reduction rules, actually cover each possible path in the >>> metafunctions (ie. telling me, for each metafunction, how many times each >>> clause has matched). >> >> I'll add a metafunction-coverage parameter that works like >> relation-coverage. > > Cool! I look forward to that! > This is in SVN too (again, not for 4.2.2). (define-language L (n number)) (define-metafunction L [(plus n_1 n_2) ,(+ (term n_1) (term n_2))]) (define sum (reduction-relation L (--> (+) 0 "zero") (--> (+ n) n "one") (--> (+ n_1 n_2 n_3 ...) (+ (plus n_1 n_2) n_3 ...) "many"))) > (let ([plus-cov (make-coverage plus)] [sum-cov (make-coverage sum)]) (parameterize ([relation-coverage (list plus-cov sum-cov)]) (apply-reduction-relation* sum '(+ 0 1 2 3 4 5))) (values (covered-cases plus-cov) (covered-cases sum-cov))) (("unsaved-editor4545:9:2" . 5)) (("many" . 5) ("one" . 1) ("zero" . 0)) From egarrulo at gmail.com Thu Oct 1 10:11:32 2009 From: egarrulo at gmail.com (egarrulo) Date: Thu Oct 1 10:11:56 2009 Subject: [plt-scheme] 'net/url' package: path/param? Message-ID: <9bd8a08a0910010711v3d15bec9n504631f7c3c00570@mail.gmail.com> Hello, I'm learning the 'net/url' package: http://docs.plt-scheme.org/net/url.html I don't understand how to create a 'path/param': http://docs.plt-scheme.org/net/url.html#(def._((lib._net/url-structs..ss)._path/param)) since parameters are already passed by the 'query' argument to the 'url''s constructor: http://docs.plt-scheme.org/net/url.html#(def._((lib._net/url-structs..ss)._url)) therefore I should only pass path's components. Thanks From lordgeoffrey at optusnet.com.au Thu Oct 1 15:54:52 2009 From: lordgeoffrey at optusnet.com.au (LordGeoffrey) Date: Thu Oct 1 15:55:14 2009 Subject: [plt-scheme] FFI examples Message-ID: <4AC5090C.80101@optusnet.com.au> I have just started working with FFI and i am trying to read device state information from the X11 libraries. Can anyone point me at some code that does that, or examples of creating nested structs? thanks. From rafkind at cs.utah.edu Thu Oct 1 15:55:55 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Thu Oct 1 15:58:35 2009 Subject: [plt-scheme] FFI examples In-Reply-To: <4AC5090C.80101@optusnet.com.au> References: <4AC5090C.80101@optusnet.com.au> Message-ID: <4AC5094B.4060607@cs.utah.edu> LordGeoffrey wrote: > I have just started working with FFI and i am trying to read device > state information from the X11 libraries. Can anyone point me at some > code that does that, or examples of creating nested structs? > My package isn't complete but does any of this X11 FFI code help you? http://planet.plt-scheme.org/display.ss?package=x11.plt&owner=kazzmir From yinso.chen at gmail.com Thu Oct 1 16:22:48 2009 From: yinso.chen at gmail.com (YC) Date: Thu Oct 1 16:23:07 2009 Subject: [plt-scheme] Teeny little net/url bug [and 1 more messages] In-Reply-To: <19140.13985.224066.635320@winooski.ccs.neu.edu> References: <4AC3DC94.8090104@synx.us.to> <4AC3E2BD.3010509@synx.us.to> <19140.13985.224066.635320@winooski.ccs.neu.edu> Message-ID: <779bf2730910011322v3b39ba8i61197ffe06f72834@mail.gmail.com> On Wed, Sep 30, 2009 at 9:57 PM, Eli Barzilay wrote: > On Sep 30, Synx wrote: > > (url->string (string->url "?")) => "" > > > > I can't seem to make a url structure where url->string produces the > > valid URL "?" (meaning the same spot, with no query arguments). "" > > by itself means the same spot with the same query arguments. > > > > I would recommend adding something in the url structure contract > > that allows the query portion of make-url be either (listof (cons/c > > symbol? (or/c false/c string?))) or 'clear to produce a ? without > > any name/value pairs. > > Allowing #f (which is a different contract) seems like the right thing > (given that the fragment part is done this way), but I'm not sure if > there's code that relies on it. Is there anyone who uses this and > relies on the query part to always be a list of bindings? > This change will mean mapping the query would take one extra test - or we will have to have a separate function to help filter it out. (define (url-query* url) (if (not (url-query url)) '() (url-query url))) Which probably should be supplied within net/url so people who depends on the binding do not have to write their own. Cheers, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091001/1f7f8fca/attachment.htm From sshickey at qwest.net Thu Oct 1 16:46:44 2009 From: sshickey at qwest.net (Scott Hickey) Date: Thu Oct 1 16:47:04 2009 Subject: [plt-scheme] bzlib/dbi error trying to insert a null value Message-ID: <901561.83262.qm@web62503.mail.re1.yahoo.com> Using the latest dbi + jazmysql, I get an error trying to insert a null value into column defined as nullable in MySQL. Also, I added code that is MySQL specific to return the row id for the row inserted. Is there a database agnostic way to get that id using the dbi module? (define (get-handle) (connect 'jazmysql "localhost" 3306 "golfscore" "golfscore" '#:schema "golfscore")) (define-struct hole_played (hole_number par score putts fairway_hit round_played_id [id #:auto] )) (define (insert-hole_played hp) (let ((a-handle (get-handle))) (exec a-handle "insert into hole_played (hole_number, par, score, putts, fairway_hit, round_played_id) VALUES (?hole_number, ?par, ?score, ?putts, ?fairway_hit, ?round_played_id)" `( (hole_number . ,(hole_played-hole_number hp)) (par . ,(hole_played-par hp)) (score . ,(hole_played-score hp)) (putts . ,(hole_played-putts hp)) (fairway_hit . ,(hole_played-fairway_hit hp)) (round_played_id . ,(hole_played-round_played_id hp)))) (caadr (query a-handle "select LAST_INSERT_ID()" '())))) (insert-hole_played (make-hole_played 1 4 4 2 null 1)) uncaught exception: # Scott Hickey Senior Consultant Object Partners, Inc. From zeppieri at gmail.com Thu Oct 1 17:57:34 2009 From: zeppieri at gmail.com (Jon Zeppieri) Date: Thu Oct 1 18:03:19 2009 Subject: [plt-scheme] bzlib/dbi error trying to insert a null value In-Reply-To: <901561.83262.qm@web62503.mail.re1.yahoo.com> References: <901561.83262.qm@web62503.mail.re1.yahoo.com> Message-ID: <7622cdaf0910011457u5a92ebc4m1586144641b08913@mail.gmail.com> My bug. Fixed in version 1.5 of mysql.plt, which I just uploaded to PLaneT. Thanks for the report! -Jon On Thu, Oct 1, 2009 at 4:46 PM, Scott Hickey wrote: > Using the latest dbi + jazmysql, I get an error trying to insert a null > value into column defined as nullable in MySQL. > > Also, I added code that is MySQL specific to return the row id for the row > inserted. Is there a database agnostic way to get that id using the dbi > module? > > > (define (get-handle) (connect 'jazmysql "localhost" 3306 "golfscore" > "golfscore" '#:schema "golfscore")) > > > (define-struct hole_played (hole_number par score putts fairway_hit > round_played_id [id #:auto] )) > > (define (insert-hole_played hp) > (let ((a-handle (get-handle))) > (exec a-handle "insert into hole_played (hole_number, par, score, putts, > fairway_hit, round_played_id) > VALUES (?hole_number, ?par, ?score, ?putts, ?fairway_hit, > ?round_played_id)" > `( (hole_number . ,(hole_played-hole_number hp)) > (par . ,(hole_played-par hp)) > (score . ,(hole_played-score hp)) > (putts . ,(hole_played-putts hp)) > (fairway_hit . ,(hole_played-fairway_hit hp)) > (round_played_id . ,(hole_played-round_played_id hp)))) > (caadr (query a-handle "select LAST_INSERT_ID()" '())))) > > (insert-hole_played (make-hole_played 1 4 4 2 null 1)) > > > uncaught exception: # message="Incorrect arguments to mysql_stmt_execute"> > > > Scott Hickey > Senior Consultant > Object Partners, Inc. > > _________________________________________________ > 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/20091001/ecf4093c/attachment.htm From rafkind at cs.utah.edu Thu Oct 1 18:04:08 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Thu Oct 1 18:06:43 2009 Subject: [plt-scheme] s-expr differ Message-ID: <4AC52758.6080201@cs.utah.edu> I wrote a little program to highlight the differences in s-expressions. Right now it only works in xterm but if anyone cares about it I can probably get it to work in other terms and drscheme. Here it is working in xterm (yes my theme is xp): http://www.cs.utah.edu/~rafkind/tmp/diff/diff.png Code is there too http://www.cs.utah.edu/~rafkind/tmp/diff/ From clements at brinckerhoff.org Thu Oct 1 18:37:51 2009 From: clements at brinckerhoff.org (John Clements) Date: Thu Oct 1 18:38:22 2009 Subject: [plt-scheme] s-expr differ In-Reply-To: <4AC52758.6080201@cs.utah.edu> References: <4AC52758.6080201@cs.utah.edu> Message-ID: On Oct 1, 2009, at 3:04 PM, Jon Rafkind wrote: > I wrote a little program to highlight the differences in s- > expressions. Right now it only works in xterm but if anyone cares > about it I can probably get it to work in other terms and drscheme. > > Here it is working in xterm (yes my theme is xp): > > http://www.cs.utah.edu/~rafkind/tmp/diff/diff.png > > Code is there too > > http://www.cs.utah.edu/~rafkind/tmp/diff/ Could be very useful in displaying results of test cases, no? E.G. expected: oesthaoesntuhansoehuatehstsomehugehorriblethingasoteuhsantoehusntahoestuhaoesntuhaseont got: oesthaoesntuhansoehuatehstsomehugehorriblethingwithanAasoteuhsantoehusntahoestuhaoesntuhaseont Well, if those were s-expressions, that is. Also, this could be a hard problem: Suppose I'm comparing these two: (a b (c (d e) (f g) ((h YY) (i))) (c (d e) (f g) ((h XX) (i)))) (a b (c (d e) (f g) ((h XX) (i)))) Does your diff tell me that I changed the YY into an XX and removed the fourth list element, or that I deleted the third element? I think I would prefer the latter, but that could be tricky. 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/20091001/e103cef8/smime-0001.bin From raould at gmail.com Thu Oct 1 18:43:59 2009 From: raould at gmail.com (Raoul Duke) Date: Thu Oct 1 18:44:17 2009 Subject: [plt-scheme] s-expr differ In-Reply-To: References: <4AC52758.6080201@cs.utah.edu> Message-ID: <91a2ba3e0910011543i473e21fbu30ada29283e8964c@mail.gmail.com> in a pinch, there are also pretty good visual diff tools out there, by the way. e.g. Araxis Merge, or maybe some XML differs, which might not be completely useless even for s-exprs. From robby at eecs.northwestern.edu Thu Oct 1 18:56:54 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Oct 1 18:57:16 2009 Subject: [plt-scheme] s-expr differ In-Reply-To: <4AC52758.6080201@cs.utah.edu> References: <4AC52758.6080201@cs.utah.edu> Message-ID: <932b2f1f0910011556s6e024e2fk73d27c712347aa80@mail.gmail.com> Redex also has something like this built into the 'stepper' function. I struggled with getting that right (altho a lot of those struggles were because I was using pretty-print to produce the results) so if this is better, that'd be nice to use instead. Anyways, if you want to try it out, define a reduction system that reduces from one of the sexps to the other and then use the stepper so those two expressions come out as subsequent steps. Robby On Thu, Oct 1, 2009 at 5:04 PM, Jon Rafkind wrote: > I wrote a little program to highlight the differences in s-expressions. > Right now it only works in xterm but if anyone cares about it I can probably > get it to work in other terms and drscheme. > > Here it is working in xterm (yes my theme is xp): > > http://www.cs.utah.edu/~rafkind/tmp/diff/diff.png > > Code is there too > > http://www.cs.utah.edu/~rafkind/tmp/diff/ > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From sshickey at qwest.net Thu Oct 1 19:08:01 2009 From: sshickey at qwest.net (Scott Hickey) Date: Thu Oct 1 19:08:20 2009 Subject: [plt-scheme] running code in a slide show / intro to plt-scheme slideshow or slide deck Message-ID: <744158.15727.qm@web62508.mail.re1.yahoo.com> I once saw a webcast of someone doing a live code demos - running code and showing the results in a window - using the plt-scheme slideshow module. I was wondering if anyone has a presentation that does this that they could make available. I don't remember exactly how it looked in the webcast but it seemed like it was cooler than just showing results in a message-box. On a more general note, if anyone is willing to share an "intro to plt-scheme" slide show (or even plain old slides) that would be good for user groups / bar camps / etc..., I'd be interested in it. Thanks. Scott Hickey Senior Consultant Object Partners, Inc. From plt at synx.us.to Thu Oct 1 19:10:39 2009 From: plt at synx.us.to (Synx) Date: Thu Oct 1 19:11:20 2009 Subject: [plt-scheme] Teeny little net/url bug [and 1 more messages] In-Reply-To: <19140.13985.224066.635320@winooski.ccs.neu.edu> References: <4AC3DC94.8090104@synx.us.to> <4AC3E2BD.3010509@synx.us.to> <19140.13985.224066.635320@winooski.ccs.neu.edu> Message-ID: <4AC536EF.5010407@synx.us.to> Eli Barzilay wrote: > The problem with making colons be decoded too is shown in this test > that fails: > > (url->string (path->url (bytes->path #"c:\\a\\b" 'windows))) > > does not return > > "file:///c:/a/b" And thankfully certain organizations haven't been able to establish "file:///c:\\a\\b" as a valid URL either. I'm pretty sure "file://c%3A/a/b/" is a working encoding for including Microsoft drive letter names in a file URL. http://www.cs.tut.fi/~jkorpela/fileurl.html also says that "file://C|/a/b/" can be used for c:\a\b\. From plt at synx.us.to Thu Oct 1 19:16:15 2009 From: plt at synx.us.to (Synx) Date: Thu Oct 1 19:16:39 2009 Subject: [plt-scheme] 'net/url' package: path/param? In-Reply-To: <9bd8a08a0910010711v3d15bec9n504631f7c3c00570@mail.gmail.com> References: <9bd8a08a0910010711v3d15bec9n504631f7c3c00570@mail.gmail.com> Message-ID: <4AC5383F.7050402@synx.us.to> (make-path/param "folder" null) A path/param is just a standard un-special PLT structure type. (define-struct path/param (path param)) ...with a few contracts wrapped around it. (make-path/param "folder" null) is what you'll use in most cases. If you want parameters (make-path/param "folder" '("param1" "param2" ...)). To get at the path or parameters it's just path/param-path and path/param-param. Kind of redundant naming, but better I guess than thingy-path and thingy-param. Remember that the URL path is a (listof path/param) so each path/param only specifies a single element of the path. Also path/param paths are different from the filesystem specific PLT paths that you get from (build-path) From plt at synx.us.to Thu Oct 1 19:18:09 2009 From: plt at synx.us.to (Synx) Date: Thu Oct 1 19:18:40 2009 Subject: [plt-scheme] Teeny little net/url bug [and 1 more messages] In-Reply-To: <4AC536EF.5010407@synx.us.to> References: <4AC3DC94.8090104@synx.us.to> <4AC3E2BD.3010509@synx.us.to> <19140.13985.224066.635320@winooski.ccs.neu.edu> <4AC536EF.5010407@synx.us.to> Message-ID: <4AC538B1.8060504@synx.us.to> file:///C|/a/b/ sorry. From yinso.chen at gmail.com Thu Oct 1 20:17:10 2009 From: yinso.chen at gmail.com (YC) Date: Thu Oct 1 20:17:29 2009 Subject: [plt-scheme] bzlib/dbi error trying to insert a null value In-Reply-To: <7622cdaf0910011457u5a92ebc4m1586144641b08913@mail.gmail.com> References: <901561.83262.qm@web62503.mail.re1.yahoo.com> <7622cdaf0910011457u5a92ebc4m1586144641b08913@mail.gmail.com> Message-ID: <779bf2730910011717w5cdffa26o84e51e9ed02b6313@mail.gmail.com> On Thu, Oct 1, 2009 at 2:57 PM, Jon Zeppieri wrote: > My bug. Fixed in version 1.5 of mysql.plt, which I just uploaded to > PLaneT. > > Thanks for the report! > Jon - thanks for chiming in and fix it so quickly. On Thu, Oct 1, 2009 at 4:46 PM, Scott Hickey wrote: > >> >> Also, I added code that is MySQL specific to return the row id for the row >> inserted. Is there a database agnostic way to get that id using the dbi >> module? >> > Scott - DBI will depend on the underlying driver for such functionalities. jaz/mysql appears to return the last inserted id in its side-effect struct. Until I have it wrapped with the next release - you can retrieve the data by explicitly requiring (require (planet jaz/mysql)) and then use side-effect-insert-id to get the data back. 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. Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091001/00ed9682/attachment.htm From matthias at ccs.neu.edu Thu Oct 1 20:24:03 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Oct 1 20:24:40 2009 Subject: [plt-scheme] s-expr differ In-Reply-To: <4AC52758.6080201@cs.utah.edu> References: <4AC52758.6080201@cs.utah.edu> Message-ID: <09A958A0-8C18-465A-B73C-E595E45B9B1A@ccs.neu.edu> This kind of thing could be useful for two different places in our tool suite: 1. the test suite system, whatever comes out of that working group (I am sorry for using a Scheme word): -- when tests involve 'complex' S-expressions, a colorful diff would make the comparison more efficient. 2. the contract system (though this is not quite the same!!) -- when a contract fails, see where the test fails the S-exp grammar of a contract -- the xml library and its x-expr interface is a particularly good example (Of course our two steppers might benefit, too, and as Robby says, Redex needs it/has it.) -- Matthias On Oct 1, 2009, at 6:04 PM, Jon Rafkind wrote: > I wrote a little program to highlight the differences in s- > expressions. Right now it only works in xterm but if anyone cares > about it I can probably get it to work in other terms and drscheme. > > Here it is working in xterm (yes my theme is xp): > > http://www.cs.utah.edu/~rafkind/tmp/diff/diff.png > > Code is there too > > http://www.cs.utah.edu/~rafkind/tmp/diff/ > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From zeppieri at gmail.com Thu Oct 1 20:36:53 2009 From: zeppieri at gmail.com (Jon Zeppieri) Date: Thu Oct 1 20:37:17 2009 Subject: [plt-scheme] bzlib/dbi error trying to insert a null value In-Reply-To: <779bf2730910011717w5cdffa26o84e51e9ed02b6313@mail.gmail.com> References: <901561.83262.qm@web62503.mail.re1.yahoo.com> <7622cdaf0910011457u5a92ebc4m1586144641b08913@mail.gmail.com> <779bf2730910011717w5cdffa26o84e51e9ed02b6313@mail.gmail.com> Message-ID: <7622cdaf0910011736h73c20aeve3382852980110bc@mail.gmail.com> On Thu, Oct 1, 2009 at 8:17 PM, YC wrote: > > jaz/mysql appears to return the last inserted id in its side-effect > struct. Until I have it wrapped with the next release - you can retrieve > the data by explicitly requiring (require (planet jaz/mysql)) and then use > side-effect-insert-id to get the data back. > Yes, and side-effect-insert-id should be significantly more efficient than SELECT LAST_INSERT_ID(), since the latter involves another round-trip to the DB server. > > 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 -Jon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091001/05b6257d/attachment-0001.htm From yinso.chen at gmail.com Thu Oct 1 20:47:53 2009 From: yinso.chen at gmail.com (YC) Date: Thu Oct 1 20:48:16 2009 Subject: [plt-scheme] bzlib/dbi error trying to insert a null value In-Reply-To: <7622cdaf0910011736h73c20aeve3382852980110bc@mail.gmail.com> References: <901561.83262.qm@web62503.mail.re1.yahoo.com> <7622cdaf0910011457u5a92ebc4m1586144641b08913@mail.gmail.com> <779bf2730910011717w5cdffa26o84e51e9ed02b6313@mail.gmail.com> <7622cdaf0910011736h73c20aeve3382852980110bc@mail.gmail.com> Message-ID: <779bf2730910011747x6d256776wc1bc04fd1f1b718a@mail.gmail.com> 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/20091001/4b9310e8/attachment.htm From czhu at cs.utah.edu Thu Oct 1 22:09:38 2009 From: czhu at cs.utah.edu (Chongkai Zhu) Date: Thu Oct 1 22:10:23 2009 Subject: [plt-scheme] MzScheme and read-line In-Reply-To: <8b9ca925-b07d-4114-bf47-30006bdbf32b@g1g2000pra.googlegroups.com> References: <8b9ca925-b07d-4114-bf47-30006bdbf32b@g1g2000pra.googlegroups.com> Message-ID: <4AC560E2.1020405@cs.utah.edu> This happens because the REPL will read one expression, so the newline that follows it is still in the input buffer. eswenson wrote: > Invoking (read-line) in DrScheme behaves as I would expect -- it > doesn't return until a newline is read. However, invoking (read-line) > in MzScheme (on Win7) return "\r" immediately without waiting for any > input. I've tried this before and after loading the GNU readline > support with no change in behavior. I have verified that the current > port is a terminal port in the interactive session and I've tried > starting MzScheme with and without "-i". Thanks. > > -- Eric > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From lordgeoffrey at optusnet.com.au Fri Oct 2 06:06:29 2009 From: lordgeoffrey at optusnet.com.au (LordGeoffrey) Date: Fri Oct 2 06:07:19 2009 Subject: [plt-scheme] FFI examples In-Reply-To: <4AC5094B.4060607@cs.utah.edu> References: <4AC5090C.80101@optusnet.com.au> <4AC5094B.4060607@cs.utah.edu> Message-ID: <4AC5D0A5.2000103@optusnet.com.au> Jon, I was after XQueryDeviceState, which isn't included, but your code looks like it will be a big help, thanks. Geoff. Jon Rafkind wrote: > LordGeoffrey wrote: >> I have just started working with FFI and i am trying to read device >> state information from the X11 libraries. Can anyone point me at some >> code that does that, or examples of creating nested structs? >> > > My package isn't complete but does any of this X11 FFI code help you? > > http://planet.plt-scheme.org/display.ss?package=x11.plt&owner=kazzmir > From laurent.orseau at gmail.com Fri Oct 2 08:12:04 2009 From: laurent.orseau at gmail.com (Laurent) Date: Fri Oct 2 08:12:46 2009 Subject: [plt-scheme] running code in a slide show / intro to plt-scheme slideshow or slide deck In-Reply-To: <744158.15727.qm@web62508.mail.re1.yahoo.com> References: <744158.15727.qm@web62508.mail.re1.yahoo.com> Message-ID: Hi, I've just taught a course on PHP, and I made my slides in Slideshow (it is sooo pleasant to create slides exactly the way you want them to be!). You can see the PDF results here: http://www.agroparistech.fr/IMG/pdf/amphi-PHP.pdf http://www.agroparistech.fr/IMG/pdf/amphi-php-html-2.pdf (It's in French but I don't think you care about the text...) The first one contains some simple examples of PHP program step-by-step executions. The "PHP code" is in Scheme (it does not interpret .php files). For the second one, I had to make a syntax-colorizer to display PHP/HTML files. The code is currently a bit messy, and it's not ready yet to become a package (it's not general enough), but if you're interested I can put some additional efforts. Laurent On Fri, Oct 2, 2009 at 01:08, Scott Hickey wrote: > I once saw a webcast of someone doing a live code demos - running code and > showing the results in a window - using the plt-scheme slideshow module. > > I was wondering if anyone has a presentation that does this that they could > make available. I don't remember exactly how it looked in the webcast but it > seemed like it was cooler than just showing results in a message-box. > > On a more general note, if anyone is willing to share an "intro to > plt-scheme" slide show (or even plain old slides) that would be good for > user groups / bar camps / etc..., I'd be interested in it. Thanks. > Scott Hickey > Senior Consultant > Object Partners, Inc. > > _________________________________________________ > 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/20091002/6a70ec4b/attachment.htm From mflatt at cs.utah.edu Fri Oct 2 09:41:43 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Fri Oct 2 09:42:13 2009 Subject: [plt-scheme] running code in a slide show / intro to plt-scheme slideshow or slide deck In-Reply-To: <744158.15727.qm@web62508.mail.re1.yahoo.com> References: <744158.15727.qm@web62508.mail.re1.yahoo.com> Message-ID: <20091002134146.133AC65014C@mail-svr1.cs.utah.edu> At Thu, 1 Oct 2009 16:08:01 -0700 (PDT), Scott Hickey wrote: > I once saw a webcast of someone doing a live code demos - running code and > showing the results in a window - using the plt-scheme slideshow module. > > I was wondering if anyone has a presentation that does this that they could > make available. I don't remember exactly how it looked in the webcast but it > seemed like it was cooler than just showing results in a message-box. The page http://www.plt-scheme.org/software/slideshow/examples.html has a link to a "Languages as Operating Systems" talk. It mostly still works in the latest version, but something something changed along the way (the fine details of parameters, I think) so that stdout/stderr is not captured correctly. Here's an updated variant of that talk that does work in the current version of PLT: http://www.cs.utah.edu/~mflatt/tmp/mred-talk.tgz From robby at eecs.northwestern.edu Fri Oct 2 09:48:11 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Fri Oct 2 09:48:36 2009 Subject: [plt-scheme] running code in a slide show / intro to plt-scheme slideshow or slide deck In-Reply-To: References: <744158.15727.qm@web62508.mail.re1.yahoo.com> Message-ID: <932b2f1f0910020648l1d9df53h5a1f7d03ce12746e@mail.gmail.com> Very nice PHP stepper! Robby On Fri, Oct 2, 2009 at 7:12 AM, Laurent wrote: > Hi, > I've just taught a course on PHP, and I made my slides in Slideshow (it is > sooo pleasant to create slides exactly the way you want them to be!). > > You can see the PDF results here: > http://www.agroparistech.fr/IMG/pdf/amphi-PHP.pdf > http://www.agroparistech.fr/IMG/pdf/amphi-php-html-2.pdf > > (It's in French but I don't think you care about the text...) > > The first one contains some simple examples of PHP program step-by-step > executions. The "PHP code" is in Scheme? (it does not interpret .php files). > For the second one, I had to make a syntax-colorizer to display PHP/HTML > files. > > The code is currently a bit messy, and it's not ready yet to become a > package (it's not general enough), but if you're interested I can put some > additional efforts. > > Laurent > > > On Fri, Oct 2, 2009 at 01:08, Scott Hickey wrote: >> >> I once saw a webcast of someone doing a live code demos - running code and >> showing the results in a window - using the plt-scheme slideshow module. >> >> I was wondering if anyone has a presentation that does this that they >> could make available. I don't remember exactly how it looked in the webcast >> but it seemed like it was cooler than just showing results in a message-box. >> >> On a more general note, if anyone is willing to share an "intro to >> plt-scheme" slide show (or even plain old slides) that would be good for >> user groups / bar camps / etc..., I'd be interested in it. Thanks. >> ?Scott Hickey >> Senior Consultant >> Object Partners, Inc. >> >> _________________________________________________ >> ?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 eric at swenson.org Fri Oct 2 12:23:50 2009 From: eric at swenson.org (Eric Swenson) Date: Fri Oct 2 12:29:59 2009 Subject: [plt-scheme] MzScheme and read-line In-Reply-To: References: <8b9ca925-b07d-4114-bf47-30006bdbf32b@g1g2000pra.googlegroups.com> <4AC560E2.1020405@cs.utah.edu> <4AC57235.2040804@cs.utah.edu> Message-ID: On Fri, Oct 2, 2009 at 9:21 AM, Eric Swenson wrote: > Hello Chongkai, > Thanks for your suggestions. I tried this, but it didn't work. In the > case where (read-line) is returning "\r", I note that read-bytes-avail!* is > returning 0, yet a subsequent read-line still returns "\r". (I tried your > example code exactly, and my-read-line returns "\r" as well.) I wonder if > this is a Win32 issue (line-ending issue) where some of the win32-specific > support is not stripping the "\r" from the end-of-line sequence "\n\r"? > > Update: I tried this out on linux and your solution works fine. But on > Win32, it doesn't. It would appear that some code doesn't know how to strip > both the \n\r from the "text-mode" console. Any suggestions? > > -- Eric > > > On Thu, Oct 1, 2009 at 8:23 PM, Chongkai Zhu wrote: > >> (define flush-input >> (let ([buf (make-bytes 64)]) >> (lambda () >> (do () >> ((zero? (read-bytes-avail!* buf))))))) >> >> (define (my-read-line) >> (begin (flush-input) (read-line))) >> >> Chongkai >> >> Eric Swenson wrote: >> >>> How do you get around this, then? -- Eric >>> >>> On Thu, Oct 1, 2009 at 7:09 PM, Chongkai Zhu >> czhu@cs.utah.edu>> wrote: >>> >>> This happens because the REPL will read one expression, so the newline >>> that follows it is still in the input buffer. >>> >>> >>> >>> >>> eswenson wrote: >>> >>> Invoking (read-line) in DrScheme behaves as I would expect -- it >>> doesn't return until a newline is read. However, invoking >>> (read-line) >>> in MzScheme (on Win7) return "\r" immediately without waiting >>> for any >>> input. I've tried this before and after loading the GNU readline >>> support with no change in behavior. I have verified that the >>> current >>> port is a terminal port in the interactive session and I've tried >>> starting MzScheme with and without "-i". 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 >>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091002/aa948789/attachment.htm From yinso.chen at gmail.com Fri Oct 2 14:50:13 2009 From: yinso.chen at gmail.com (YC) Date: Fri Oct 2 14:50:34 2009 Subject: [plt-scheme] MzScheme and read-line In-Reply-To: References: <8b9ca925-b07d-4114-bf47-30006bdbf32b@g1g2000pra.googlegroups.com> <4AC560E2.1020405@cs.utah.edu> <4AC57235.2040804@cs.utah.edu> Message-ID: <779bf2730910021150r1cf32292nc4e0bc9648e2cb20@mail.gmail.com> On Fri, Oct 2, 2009 at 9:23 AM, Eric Swenson wrote: > > > On Fri, Oct 2, 2009 at 9:21 AM, Eric Swenson wrote: > >> Hello Chongkai, >> Thanks for your suggestions. I tried this, but it didn't work. In the >> case where (read-line) is returning "\r", I note that read-bytes-avail!* is >> returning 0, yet a subsequent read-line still returns "\r". (I tried your >> example code exactly, and my-read-line returns "\r" as well.) I wonder if >> this is a Win32 issue (line-ending issue) where some of the win32-specific >> support is not stripping the "\r" from the end-of-line sequence "\n\r"? >> > The line ending on Windows is \r\n instead of \n\r. The reason you have \r returned is because (read-line) as is by default only use \n as a terminator, so when it sees \r\n it thinks \r is the data and returns it (on Unix it only sees \n, so the data is ""). Use (read-line (current-port) *'any*) instead of just plain (read-line) will treat \r\n as a single terminator. As Chongkai said - when you type (read-line) the reader will consume the (read-line) but leaves in the buffer, which read-line then consumes, so you need a function that has two read-line calls, the first will consume the left over, and the second will then wait on input. (define (my-read-line) (read-line (current-input-port) 'any) (read-line (current-input-port) 'any)) Since this specifically tackles the behavior of REPL - it has limited applicability elsewhere. Cheers, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091002/50c8cd1a/attachment.htm From eric at swenson.org Fri Oct 2 14:52:40 2009 From: eric at swenson.org (Eric Swenson) Date: Fri Oct 2 14:53:00 2009 Subject: [plt-scheme] MzScheme and read-line In-Reply-To: <779bf2730910021150r1cf32292nc4e0bc9648e2cb20@mail.gmail.com> References: <8b9ca925-b07d-4114-bf47-30006bdbf32b@g1g2000pra.googlegroups.com> <4AC560E2.1020405@cs.utah.edu> <4AC57235.2040804@cs.utah.edu> <779bf2730910021150r1cf32292nc4e0bc9648e2cb20@mail.gmail.com> Message-ID: Thanks, YC. I will give this a try. Note, however, that if I found this confusing, others will too. This is a difference in behavior from running under DrScheme and MzScheme. I would recommend that it be documented somewhere. -- Eric On Fri, Oct 2, 2009 at 11:50 AM, YC wrote: > > > On Fri, Oct 2, 2009 at 9:23 AM, Eric Swenson wrote: > >> >> >> On Fri, Oct 2, 2009 at 9:21 AM, Eric Swenson wrote: >> >>> Hello Chongkai, >>> Thanks for your suggestions. I tried this, but it didn't work. In the >>> case where (read-line) is returning "\r", I note that read-bytes-avail!* is >>> returning 0, yet a subsequent read-line still returns "\r". (I tried your >>> example code exactly, and my-read-line returns "\r" as well.) I wonder if >>> this is a Win32 issue (line-ending issue) where some of the win32-specific >>> support is not stripping the "\r" from the end-of-line sequence "\n\r"? >>> >> > The line ending on Windows is \r\n instead of \n\r. The reason you have \r > returned is because (read-line) as is by default only use \n as a > terminator, so when it sees \r\n it thinks \r is the data and returns it (on > Unix it only sees \n, so the data is ""). > > Use (read-line (current-port) *'any*) instead of just plain (read-line) > will treat \r\n as a single terminator. > > As Chongkai said - when you type (read-line) the reader will consume > the (read-line) but leaves in the buffer, which read-line then > consumes, so you need a function that has two read-line calls, the first > will consume the left over, and the second will then wait on input. > > (define (my-read-line) > (read-line (current-input-port) 'any) > (read-line (current-input-port) 'any)) > > Since this specifically tackles the behavior of REPL - it has limited > applicability elsewhere. > > Cheers, > yc > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091002/99995147/attachment.htm From eric at swenson.org Fri Oct 2 14:57:58 2009 From: eric at swenson.org (Eric Swenson) Date: Fri Oct 2 14:58:20 2009 Subject: [plt-scheme] MzScheme and read-line In-Reply-To: References: <8b9ca925-b07d-4114-bf47-30006bdbf32b@g1g2000pra.googlegroups.com> <4AC560E2.1020405@cs.utah.edu> <4AC57235.2040804@cs.utah.edu> <779bf2730910021150r1cf32292nc4e0bc9648e2cb20@mail.gmail.com> Message-ID: Not to belabor the point, but if you write code using my-read-line, it will work in MzScheme, but not in DrScheme. (And, conversely, if you write code using the normal read-line in DrScheme, it will not work in MzScheme). This seems non-optimal! -- Eric On Fri, Oct 2, 2009 at 11:52 AM, Eric Swenson wrote: > Thanks, YC. I will give this a try. Note, however, that if I found this > confusing, others will too. This is a difference in behavior from running > under DrScheme and MzScheme. I would recommend that it be documented > somewhere. -- Eric > > > On Fri, Oct 2, 2009 at 11:50 AM, YC wrote: > >> >> >> On Fri, Oct 2, 2009 at 9:23 AM, Eric Swenson wrote: >> >>> >>> >>> On Fri, Oct 2, 2009 at 9:21 AM, Eric Swenson wrote: >>> >>>> Hello Chongkai, >>>> Thanks for your suggestions. I tried this, but it didn't work. In the >>>> case where (read-line) is returning "\r", I note that read-bytes-avail!* is >>>> returning 0, yet a subsequent read-line still returns "\r". (I tried your >>>> example code exactly, and my-read-line returns "\r" as well.) I wonder if >>>> this is a Win32 issue (line-ending issue) where some of the win32-specific >>>> support is not stripping the "\r" from the end-of-line sequence "\n\r"? >>>> >>> >> The line ending on Windows is \r\n instead of \n\r. The reason you have >> \r returned is because (read-line) as is by default only use \n as a >> terminator, so when it sees \r\n it thinks \r is the data and returns it (on >> Unix it only sees \n, so the data is ""). >> >> Use (read-line (current-port) *'any*) instead of just plain (read-line) >> will treat \r\n as a single terminator. >> >> As Chongkai said - when you type (read-line) the reader will >> consume the (read-line) but leaves in the buffer, which read-line >> then consumes, so you need a function that has two read-line calls, the >> first will consume the left over, and the second will then wait on input. >> >> (define (my-read-line) >> (read-line (current-input-port) 'any) >> (read-line (current-input-port) 'any)) >> >> Since this specifically tackles the behavior of REPL - it has limited >> applicability elsewhere. >> >> Cheers, >> yc >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091002/a1a0f14e/attachment-0001.htm From czhu at cs.utah.edu Sat Oct 3 12:13:53 2009 From: czhu at cs.utah.edu (czhu@cs.utah.edu) Date: Sat Oct 3 12:14:16 2009 Subject: [plt-scheme] FFI with Mac OS X framework? Message-ID: <20091003101353.sfwcji6twswsgss8@webmail.cs.utah.edu> On a Mac computer: > (system-type 'so-suffix) #".dylib" So there is no #".framework" support for FFI? Could I ask why? According to http://en.wikipedia.org/wiki/Dynamic_loading , the actual call to dlopen is nearly the same. Chongkai ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. From jay.mccarthy at gmail.com Sat Oct 3 13:04:49 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Sat Oct 3 13:05:11 2009 Subject: [plt-scheme] FFI with Mac OS X framework? In-Reply-To: <20091003101353.sfwcji6twswsgss8@webmail.cs.utah.edu> References: <20091003101353.sfwcji6twswsgss8@webmail.cs.utah.edu> Message-ID: The framework is a directory that contains a bunch of differently compiled frameworks. You can go in and get the right one and give the path to the FFI. That will help you make due until the FFI can handle it directly. Jay On Sat, Oct 3, 2009 at 10:13 AM, wrote: > On a Mac computer: > >> (system-type 'so-suffix) > > #".dylib" > > So there is no #".framework" support for FFI? Could I ask why? According to > http://en.wikipedia.org/wiki/Dynamic_loading , the actual call to dlopen is > nearly the same. > > Chongkai > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > _________________________________________________ > ?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 david.storrs at gmail.com Sat Oct 3 13:39:31 2009 From: david.storrs at gmail.com (David Storrs) Date: Sat Oct 3 13:39:51 2009 Subject: [plt-scheme] Looking for a security consultant with PLT web server experience Message-ID: Hey folks, We are bootstrapping a startup. We care a lot about security and privacy, especially as they relate to customer data, and we want to find someone with real experience in these areas to advise us. We need ground up advice--likely attacks, best ways to achieve minimum surface area, recommended trusted hosting, etc--but in particular we want someone who has experience dealing with the PLT web server, since it's new to us and we don't fully understand the security implications of stateful servlets. I'm going to be reaching out to Untyped as soon as I send this email, since they have some experience here. Aside from them, any suggestions? --Dks From etanter at dcc.uchile.cl Sat Oct 3 15:07:13 2009 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Sat Oct 3 15:07:40 2009 Subject: [plt-scheme] redex: leveraging generated checks and coverage In-Reply-To: References: <7BC19F94-3904-43A5-BE44-47929BAE9539@dcc.uchile.cl> <1368C526-01CF-4CA8-B459-C5CED1155847@dcc.uchile.cl> Message-ID: Thanks Casey, that is great. I look forward to the 4.2.3 release then. One more request actually, wrt traces: the code in the traces view does not enjoy the same syntax highlight (matching parenthesis, color levels) than the definition window. Would it be possible to make it so? that would be useful to visually parse huge terms. I have found myself several times copy/pasting the content of a traces window into the definition window just to get that support. Or maybe there is already a way to activate that? Cheers, -- ?ric On Oct 1, 2009, at 7:03 AM, Casey Klein wrote: > On Thu, Sep 17, 2009 at 4:09 PM, Eric Tanter > wrote: >>> My guess is that you have a side-condition somewhere that Redex is >>> having trouble satisfying randomly. >>> [..] >> >> right, that may definitely be the case >> >>> (define-language M >>> (q (side-condition number_1 (= (term number_1) 12345431)))) >>> >>>> (redex-check M q #t) >>> >>> redex-check: unable to generate pattern number_1 in 100 attempts >>> >>> This error message should really include the side-condition part of >>> the pattern since it's that part, not number_1, that's actually >>> causing the difficulty. I'll fix that. >> >> That'd be better indeed. > > This is fixed in SVN (but not in time for the 4.2.2 release). > >> (define-language L > (n number)) >> (redex-check L (side-condition n #f) #t) > redex-check: unable to generate pattern (side-condition n > #) in 100 attempts > > If the pattern that can't be satisifed is the left-hand side of a > relation clause, the message points to that clause. > >> (check-reduction-relation > (reduction-relation > L > (--> n n > (side-condition #f) > foo)) > (? (_) #t)) > check-reduction-relation: unable to generate LHS of foo in 100 > attempts >> (check-reduction-relation > (reduction-relation > L > (--> n n > (side-condition #f))) > (? (_) #t)) > check-reduction-relation: unable to generate LHS of clause at > unsaved-editor4524:18:9 in 100 attempts > >>>> * Finally, I really enjoy the coverage report for a reduction >>>> relation. >>>> There does not seem to be a similar functionality for >>>> metafunctions, >>>> though. >>>> It would be nice if I could get confidence that my test cases, in >>>> addition >>>> to testing all reduction rules, actually cover each possible path >>>> in the >>>> metafunctions (ie. telling me, for each metafunction, how many >>>> times each >>>> clause has matched). >>> >>> I'll add a metafunction-coverage parameter that works like >>> relation-coverage. >> >> Cool! I look forward to that! >> > > This is in SVN too (again, not for 4.2.2). > > (define-language L > (n number)) > > (define-metafunction L > [(plus n_1 n_2) > ,(+ (term n_1) (term n_2))]) > > (define sum > (reduction-relation > L > (--> (+) 0 "zero") > (--> (+ n) n "one") > (--> (+ n_1 n_2 n_3 ...) > (+ (plus n_1 n_2) n_3 ...) > "many"))) > >> (let ([plus-cov (make-coverage plus)] > [sum-cov (make-coverage sum)]) > (parameterize ([relation-coverage (list plus-cov sum-cov)]) > (apply-reduction-relation* sum '(+ 0 1 2 3 4 5))) > (values (covered-cases plus-cov) > (covered-cases sum-cov))) > (("unsaved-editor4545:9:2" . 5)) > (("many" . 5) ("one" . 1) ("zero" . 0)) From eli at barzilay.org Sat Oct 3 15:18:21 2009 From: eli at barzilay.org (Eli Barzilay) Date: Sat Oct 3 15:18:46 2009 Subject: [plt-scheme] FFI with Mac OS X framework? In-Reply-To: References: <20091003101353.sfwcji6twswsgss8@webmail.cs.utah.edu> Message-ID: <19143.41853.832044.365448@winooski.ccs.neu.edu> The `ffi-lib' function will use dlopen() directly, so if it works with some file in a .framework directory you should be fine with naming the file. There are cases where the OS (dlopen(), actually) does some searching, but IIRC, on OS X this is not done and you're expected to use hard-wired paths where the library is expected to be. On Oct 3, Jay McCarthy wrote: > The framework is a directory that contains a bunch of differently > compiled frameworks. You can go in and get the right one and give > the path to the FFI. That will help you make due until the FFI can > handle it directly. > > Jay > > On Sat, Oct 3, 2009 at 10:13 AM, wrote: > > On a Mac computer: > > > >> (system-type 'so-suffix) > > > > #".dylib" > > > > So there is no #".framework" support for FFI? Could I ask why? > > According to http://en.wikipedia.org/wiki/Dynamic_loading , the > > actual call to dlopen is nearly the same. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From noelwelsh at gmail.com Sat Oct 3 17:27:31 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Sat Oct 3 17:27:52 2009 Subject: [plt-scheme] Looking for a security consultant with PLT web server experience In-Reply-To: References: Message-ID: Hi David, I got your email to Untyped, but I'm replying on the list so there is a public archive for future developers. Regarding this: On Sat, Oct 3, 2009 at 6:39 PM, David Storrs wrote: > we want someone who has experience dealing with the PLT web server, since > it's new to us and we don't fully understand the security implications > of stateful servlets. There are the two kinds of servlets: so called "stateless" servlets, meaning the continuation is serialised, and "stateful" servlets, meaning the continuation is stored in memory and accessed by a key. (You mention stateful servlets but you might not be using the terminology in the same way as the web server docs, so I'll cover both) Addressing the later first, the main vector of attack is by guessing a continuation key. The continuation key is encrypted IIRC, but to make the system more secure you could also check, e.g. IP address or a cookie or some other signing mechanism before serving the request. A stateful servlet doesn't leak any more information than you let it, as everything is in memory unless you choose to encode information in e.g. form parameters. A stateless servlet can potentially leak information, as the continuation could be serialised to the client and could contain sensitive information. The web server offers various ways around this. One way is to store the continuations on disk (the key/value store in the docs) and then address the continuation using a hash ("hash-addressed storage") that is sent to the client. The web server also provides facilities to sign the hash so you can prevent tampering. You might also want to encrypt the continuations on disk, though this is possibly getting a bit excessive. You could also check IP address etc. as for the stateful servlets. Basically, both servlets provide facilities to ensure you don't leak information, and if you want to make things even more secure you can do so with a bit of additional effort. HTH, N. From yinso.chen at gmail.com Sat Oct 3 20:06:34 2009 From: yinso.chen at gmail.com (YC) Date: Sat Oct 3 20:06:55 2009 Subject: [plt-scheme] Looking for a security consultant with PLT web server experience In-Reply-To: References: Message-ID: <779bf2730910031706i325b3ac0ne4b55fb57ef7099d@mail.gmail.com> David - On Sat, Oct 3, 2009 at 2:27 PM, Noel Welsh wrote: > Addressing the later first, the main vector of attack is by guessing a > continuation key. The continuation key is encrypted IIRC, but to make > the system more secure you could also check, e.g. IP address or a > cookie or some other signing mechanism before serving the request. A > stateful servlet doesn't leak any more information than you let it, as > everything is in memory unless you choose to encode information in > e.g. form parameters. > Another thing to be thinking about for stateful servlet is that the url is the key to the continuation. As long as the continuation is live, people can email urls to another person, and the other person will get to the exact same page. Depending on the link in question - it can be a security issue. If you want to add additional check such as verifying IP address (which doesn't work for customers behind an anonymous proxy) you'll have to build your own abstractions on top of send/suspend and co. Given that everything is kept in memory, it's conceivable that web-server is more suspectible than others to D/DOS attacks. Obviously unless you have thousands and thousands of servers you probably can't for sure handle such attack with any framework. But making sure you have good continuation expiration policy is only sensible. The nice thing about PLT (assuming you are using xexpr) is that it is less suspectible to html injections than systems that concatenate pages such as PHP. SQL injection still is a primary area of intrusion for web apps - elimination of dynamic SQL is the key. My DBI package eliminates its usage. As you are aware, security is best designed in from the beginning. You start with the why, the assets, and then figure out what is the right approach to eliminate possible security holes without compromising features. Sometimes that means do not store the sensitive data - best security is not to have to guard secrets. And the best long term approach is to train developers on security awareness and secure coding practices. I used to perform application security audit and train developers on security awareness for a fortune 500 company. If you are interested in consultations, please contact me offline. Cheers, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091003/fd9fd648/attachment-0001.htm From david.storrs at gmail.com Sat Oct 3 20:07:30 2009 From: david.storrs at gmail.com (David Storrs) Date: Sat Oct 3 20:07:49 2009 Subject: [plt-scheme] Re: Looking for a security consultant with PLT web server experience In-Reply-To: References: Message-ID: Thank you everyone. I've been utterly amazed at the number of fast, helpful responses I've gotten--Jay himself, Noel from Untyped, Shriram and more. Honestly, I hadn't expected such a fast response to a question asked on a weekend about a highly specialized area. It's an embarrassment of riches, honestly. --Dks PS: And another one just came in as I was writing this. I love this community. :> From sk at cs.brown.edu Sat Oct 3 20:13:21 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Sat Oct 3 20:13:59 2009 Subject: [plt-scheme] Re: Looking for a security consultant with PLT web server experience In-Reply-To: References: Message-ID: > Noel from Untyped I think we should drop the "from". Then, just as we have "MTV Unplugged", "10,000 Maniacs Unplugged", etc., we can have our own "Noel Untyped", i.e., Noel at his most extreme. The merchandise and franchise opportunities boggle the mind. Shriram From david.storrs at gmail.com Sat Oct 3 20:19:53 2009 From: david.storrs at gmail.com (David Storrs) Date: Sat Oct 3 20:20:15 2009 Subject: [plt-scheme] Re: Looking for a security consultant with PLT web server experience In-Reply-To: References: Message-ID: On Sat, Oct 3, 2009 at 8:13 PM, Shriram Krishnamurthi wrote: >> Noel from Untyped > > I think we should drop the "from". ?Then, just as we have "MTV > Unplugged", "10,000 Maniacs Unplugged", etc., we can have our own > "Noel Untyped", i.e., Noel at his most extreme. ?The merchandise and > franchise opportunities boggle the mind. > > Shriram > *snerk* Touche, sir. --Dks From czhu at cs.utah.edu Sat Oct 3 20:27:24 2009 From: czhu at cs.utah.edu (Chongkai Zhu) Date: Sat Oct 3 20:27:57 2009 Subject: [plt-scheme] FFI with Mac OS X framework? In-Reply-To: <19143.41853.832044.365448@winooski.ccs.neu.edu> References: <20091003101353.sfwcji6twswsgss8@webmail.cs.utah.edu> <19143.41853.832044.365448@winooski.ccs.neu.edu> Message-ID: <4AC7EBEC.8040406@cs.utah.edu> Many thanks Eli and Jay. Naming the file inside the .framework directory works. I just thought maybe it can be made automatic, because now I write "foo.framework/foo" instead of just "foo". Chongkai Eli Barzilay wrote: > The `ffi-lib' function will use dlopen() directly, so if it works with > some file in a .framework directory you should be fine with naming the > file. There are cases where the OS (dlopen(), actually) does some > searching, but IIRC, on OS X this is not done and you're expected to > use hard-wired paths where the library is expected to be. > > > On Oct 3, Jay McCarthy wrote: > >> The framework is a directory that contains a bunch of differently >> compiled frameworks. You can go in and get the right one and give >> the path to the FFI. That will help you make due until the FFI can >> handle it directly. >> >> Jay >> >> On Sat, Oct 3, 2009 at 10:13 AM, wrote: >> >>> On a Mac computer: >>> >>> >>>> (system-type 'so-suffix) >>>> >>> #".dylib" >>> >>> So there is no #".framework" support for FFI? Could I ask why? >>> According to http://en.wikipedia.org/wiki/Dynamic_loading , the >>> actual call to dlopen is nearly the same. >>> > > From neil at neilvandyke.org Sun Oct 4 02:19:41 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Sun Oct 4 02:20:02 2009 Subject: [plt-scheme] Looking for a security consultant with PLT web server experience In-Reply-To: <779bf2730910031706i325b3ac0ne4b55fb57ef7099d@mail.gmail.com> References: <779bf2730910031706i325b3ac0ne4b55fb57ef7099d@mail.gmail.com> Message-ID: <4AC83E7D.2050808@neilvandyke.org> YC wrote at 10/03/2009 08:06 PM: > Another thing to be thinking about for stateful servlet is that the > url is the key to the continuation. As long as the continuation is > live, people can email urls to another person, and the other person > will get to the exact same page. Depending on the link in question - > it can be a security issue. If you want to add additional check such > as verifying IP address (which doesn't work for customers behind an > anonymous proxy) you'll have to build your own abstractions on top of > send/suspend and co. To add to this, checking IP address provides a check that might give a tiny bit more confidence, but it's not a solid security solution, and fails in a variety of situations more common than anon proxies (NAT, firewalls, shared machines, hijacked wire links, some wireless roaming...). Regarding continuations, I think that the normal case is that the continuations correspond to a single session with a single human/robot. The purity of the model that lets other humans/robots also invoke continuations from the session is appealing in one sense, but stored continuations are ephemeral anyway, and unless session hijacking this way is a desired feature in a particular application, I suggest that always precluding it with the authentication mechanism is the way to go. Unless you always pair a continuation ID with an authentication mechanism (or perhaps the continuation ID *is* the authentication token), putting the ID in the URL exposes it a lot of places that cookies do not, including on the link and in various HTTP proxies and logs that look at requests. Even if you use SSL, I don't have 100% trust that the URLs themselves are hidden, as some browsers will leak request URLs in the clear under some circumstances. Also, here's no reason that the non-session-specific information about pages can't be exposed in RESTful URLs, too, so that, say, user A could email to user B a URL to a page of photos without getting the continuation-based session context. That's the preferred Web way of doing things, and you just need to consider canonical URLs for resources when doing information design for your site. These are off-the-cuff, casual comments, not researched. I'm sure that Untyped or YC could investigate these concerns and address if necessary. Full disclosure: Untyped and I have collaborated a bit, and I hope to work with them more in the future. (I'm not soliciting new consulting work myself right now, as my university term appointment gets first priority on my time, except for at 2am Saturday night. :) -- http://www.neilvandyke.org/ From eli at barzilay.org Sun Oct 4 16:16:09 2009 From: eli at barzilay.org (Eli Barzilay) Date: Sun Oct 4 16:16:31 2009 Subject: [plt-scheme] PLT Scheme v4.2.2 Message-ID: PLT Scheme version 4.2.2 is now available from http://plt-scheme.org/ * DrScheme now, by default, compiles all of the files that are loaded when it runs a program and saves the compiled files in the filesystem. This should lead to faster load times (not faster runtimes) since it avoids re-compiling files whose dependencies have not changed. * New Scribble libraries and documentation make it easier to get started with Scribble, especially for uses other than PLT documentation. DrScheme now has better indentation and syntax coloring support for Scribble languages (and generally all @-exp based languages). * The new `syntax/keyword' library provides support for macros with keyword options. A new quick start guide has been added to the documentation for the `syntax/parse' library. * Added support for abstract contracts via the #:exists keywords. This is an experiment to add support for data hiding to the contract system. * Added `in-producer': a sequence expression makes it easy to iterate over producer functions (e.g., `read'). A new `scheme/generator' library creates generators that can use a (parameterized) yield function. * HtDP langs: several primitives now consume 0 and 1 arguments in ISL (and up), including `append', `+' and `*'. In addition, `make-list' was added to the primitives. * The API to Universe has a number of new constructs. All Universe programs should run unchanged. The most important change is the addition of `animate' as an alternative name for `run-simulation'. In addition, adding the clause `(state true)' to a world description now pretty-prints the state of the world into a separate canvas. * A number of changes were made to the DeinProgramm / DMdA language levels: The `check-property' and `contract' forms were added, `define-record-procedures-parametric' has changed. See the documentation for details. * The test engine in the HtDP languages no longer warns programmers when the Definitions window has no tests. * ProfessorJ (and related code) is no longer included in the PLT distributions. It may re-appear in the future as a PLaneT package. [Note that mirror sites can take a while to catch up with the new downloads.] Feedback Welcome, -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From vishalsodani at gmail.com Sun Oct 4 01:34:59 2009 From: vishalsodani at gmail.com (vishy) Date: Sun Oct 4 16:22:23 2009 Subject: [plt-scheme] Beginner Question Message-ID: Why (cons (list 1 2) (list 5 3)), produces ((1,2) 5 3) and not ((1,2),(5, 3)) thats is a list of 2 elements . thanks From carl.eastlund at gmail.com Sun Oct 4 16:26:58 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Sun Oct 4 16:27:36 2009 Subject: [plt-scheme] Beginner Question In-Reply-To: References: Message-ID: <990e0c030910041326k972e985l647fca0f37f76026@mail.gmail.com> On Sun, Oct 4, 2009 at 1:34 AM, vishy wrote: > Why (cons (list 1 2) (list 5 3)), produces > ((1,2) 5 3) and not ((1,2),(5, 3)) thats is a list of 2 elements . > > thanks Vishy, The cons procedure adds an element to a list. If you run (cons 1 (list 2 3)), you add the element 1 to (list 2 3) and get (list 1 2 3). If you run (cons (list 1 2) (list 5 3)), you add (list 1 2) as an element, and get (list (list 1 2) 5 3)). If your intent is to join the elements of two lists, the appropriate function is append. Running (append (list 1 2) (list 5 3)) will give you (list 1 2 5 3). Both methods of combination, cons and append, have their uses, so be careful to always choose the one you mean. --Carl From nadeem at acm.org Sun Oct 4 16:37:09 2009 From: nadeem at acm.org (Nadeem Abdul Hamid) Date: Sun Oct 4 16:37:35 2009 Subject: [plt-scheme] Beginner Question In-Reply-To: <990e0c030910041326k972e985l647fca0f37f76026@mail.gmail.com> References: <990e0c030910041326k972e985l647fca0f37f76026@mail.gmail.com> Message-ID: <8DA93E67-2899-4035-8AE7-AE272AE34E66@acm.org> And if what you really do want is a list of two elements, where each of those elements is a list of two numbers, do: (list (list 1 2) (list 5 3)) or, alternatively if you want to use cons: (cons (list 1 2) (cons (list 5 3) empty)) On Oct 4, 2009, at 4:26 PM, Carl Eastlund wrote: > On Sun, Oct 4, 2009 at 1:34 AM, vishy wrote: >> Why (cons (list 1 2) (list 5 3)), produces >> ((1,2) 5 3) and not ((1,2),(5, 3)) thats is a list of 2 elements . >> >> thanks > > Vishy, > > The cons procedure adds an element to a list. If you run (cons 1 > (list 2 3)), you add the element 1 to (list 2 3) and get (list 1 2 3). > If you run (cons (list 1 2) (list 5 3)), you add (list 1 2) as an > element, and get (list (list 1 2) 5 3)). If your intent is to join > the elements of two lists, the appropriate function is append. > Running (append (list 1 2) (list 5 3)) will give you (list 1 2 5 3). > Both methods of combination, cons and append, have their uses, so be > careful to always choose the one you mean. > > --Carl > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From robby at eecs.northwestern.edu Sun Oct 4 20:55:59 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Sun Oct 4 20:56:17 2009 Subject: [plt-scheme] 2htdp/image Message-ID: <932b2f1f0910041755p40bca426p2f4cdcdff629d56d@mail.gmail.com> The 2htdp/image library XZZZZe From robby at eecs.northwestern.edu Sun Oct 4 21:40:23 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Sun Oct 4 21:40:42 2009 Subject: [plt-scheme] Re: 2htdp/image In-Reply-To: <932b2f1f0910041755p40bca426p2f4cdcdff629d56d@mail.gmail.com> References: <932b2f1f0910041755p40bca426p2f4cdcdff629d56d@mail.gmail.com> Message-ID: <932b2f1f0910041840v79d8f9e8p7afe16ab3000f9d7@mail.gmail.com> Sorry all. Had a little "help" writing this email (and didn't mean to actually send anything at all just yet). Robby On Sun, Oct 4, 2009 at 7:55 PM, Robby Findler wrote: > The 2htdp/image library XZZZZe > From vishalsodani at gmail.com Mon Oct 5 01:56:34 2009 From: vishalsodani at gmail.com (vishal sodani) Date: Mon Oct 5 01:57:18 2009 Subject: [plt-scheme] Beginner Question In-Reply-To: <990e0c030910041326k972e985l647fca0f37f76026@mail.gmail.com> References: <990e0c030910041326k972e985l647fca0f37f76026@mail.gmail.com> Message-ID: <488714b80910042256uf153e9bi6f04bbdb35816964@mail.gmail.com> thanks for the clarification.understood! On Mon, Oct 5, 2009 at 1:56 AM, Carl Eastlund wrote: > On Sun, Oct 4, 2009 at 1:34 AM, vishy wrote: >> Why (cons (list 1 2) (list 5 3)), produces >> ((1,2) 5 3) and not ((1,2),(5, 3)) thats is a list of 2 elements . >> >> thanks > > Vishy, > > The cons procedure adds an element to a list. ?If you run (cons 1 > (list 2 3)), you add the element 1 to (list 2 3) and get (list 1 2 3). > ?If you run (cons (list 1 2) (list 5 3)), you add (list 1 2) as an > element, and get (list (list 1 2) 5 3)). ?If your intent is to join > the elements of two lists, the appropriate function is append. > Running (append (list 1 2) (list 5 3)) will give you (list 1 2 5 3). > Both methods of combination, cons and append, have their uses, so be > careful to always choose the one you mean. > > --Carl > -- http://vishalsodani.wordpress.com From d.j.gurnell at gmail.com Mon Oct 5 04:37:06 2009 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Mon Oct 5 04:37:28 2009 Subject: [plt-scheme] Looking for a security consultant with PLT web server experience In-Reply-To: <4AC83E7D.2050808@neilvandyke.org> References: <779bf2730910031706i325b3ac0ne4b55fb57ef7099d@mail.gmail.com> <4AC83E7D.2050808@neilvandyke.org> Message-ID: <466B9C1D-44FF-4D86-AC87-E1DCCE016856@gmail.com> Neil Van Dyke wrote: > YC wrote : >> Another thing to be thinking about for stateful servlet is that the >> url is the key to the continuation. As long as the continuation is >> live, people can email urls to another person, and the other person >> will get to the exact same page. Depending on the link in question >> - it can be a security issue. If you want to add additional check >> such as verifying IP address (which doesn't work for customers >> behind an anonymous proxy) you'll have to build your own >> abstractions on top of send/suspend and co. > > To add to this, checking IP address provides a check that might give > a tiny bit more confidence, but it's not a solid security solution, > and fails in a variety of situations more common than anon proxies > (NAT, firewalls, shared machines, hijacked wire links, some wireless > roaming...). I've been thinking about this one recently. I'm no expert in TCP/IP - is IP checking something that's reliable enough to be built into the web server (say, into the LRU)? You say it's not a solid security option, but I'm guessing it only ever produces false positives. If it doesn't produce false negatives, could it be built right in without fear of locking users out of their own continuations? > Unless you always pair a continuation ID with an authentication > mechanism (or perhaps the continuation ID *is* the authentication > token), putting the ID in the URL exposes it a lot of places that > cookies do not, including on the link and in various HTTP proxies > and logs that look at requests. Even if you use SSL, I don't have > 100% trust that the URLs themselves are hidden, as some browsers > will leak request URLs in the clear under some circumstances. I only currently know about the stateful model, in which a continuation is associated with three numbers embedded into the URL: - a sequentially assigned "instance id", which corresponds to a chain of continuations created from a specific initial HTTP request; - a sequentially assigned "continuation id", which points to a continuation inside the instance; - a random "salt" number, which prevents accidental reloading of continuations created in old runs of the web server. The salt is the thing that provides the security here. AFAIK it's just a regular random number with no particular emphasis on security. If that wasn't secure enough, I guess you could increase the size or randomness of the salt. > I'm sure that Untyped or YC could investigate these concerns and > address if necessary. Full disclosure: Untyped and I have > collaborated a bit, and I hope to work with them more in the > future. (I'm not soliciting new consulting work myself right now, > as my university term appointment gets first priority on my time, > except for at 2am Saturday night. :) One nice thing about the web server architecture is that all of these issues can be addressed (if they need to be addressed) by writing and plugging in a custom continuation manager. The Untypers have dabbled with the LRU manager a few times, implementing things like extra logging and some application specific continuation management. These security-related features seem like other natural extensions. It'd be good to collaborate on something like this as and release it as a PLaneT package. Cheers, -- Dave From neil at neilvandyke.org Mon Oct 5 06:25:41 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Mon Oct 5 06:26:03 2009 Subject: [plt-scheme] Looking for a security consultant with PLT web server experience In-Reply-To: <466B9C1D-44FF-4D86-AC87-E1DCCE016856@gmail.com> References: <779bf2730910031706i325b3ac0ne4b55fb57ef7099d@mail.gmail.com> <4AC83E7D.2050808@neilvandyke.org> <466B9C1D-44FF-4D86-AC87-E1DCCE016856@gmail.com> Message-ID: <4AC9C9A5.1080306@neilvandyke.org> Dave Gurnell wrote at 10/05/2009 04:37 AM: > > I've been thinking about this one recently. I'm no expert in TCP/IP - > is IP checking something that's reliable enough to be built into the > web server (say, into the LRU)? You say it's not a solid security > option, but I'm guessing it only ever produces false positives. If it > doesn't produce false negatives, could it be built right in without > fear of locking users out of their own continuations? Some wireless technologies and setups might give false negatives right now. I think we cannot assume the IP address will remain the same between requests that constitute a session, or we won't work with some perfectly legitimate HTTP networking, now and in the future. (Some banks might check the IP address, but the same banks are doing snake-oil things and even making a big PR deal about authentication methods that they've been quietly told don't actually work. And they're very much, "We don't care. We don't have to. We're the phone company.") > I only currently know about the stateful model, in which a > continuation is associated with three numbers embedded into the URL: Yes, I would try to take session information out of the URL. Offhand, I'm not sure the best way to do this for all browsers while preserving all back button behavior that one might preserve with URLs, so there would be experiments and possible tradeoffs or mitigating measures. > One nice thing about the web server architecture is that all of these > issues can be addressed (if they need to be addressed) by writing and > plugging in a custom continuation manager. The Untypers have dabbled > with the LRU manager a few times, implementing things like extra > logging and some application specific continuation management. These > security-related features seem like other natural extensions. > > It'd be good to collaborate on something like this as and release it > as a PLaneT package. Seems like PLT has been putting a lot of energy into the Web server and servlets in the last year or two. I'd first find out whether this is something they want to look into right now. (Just yesterday, I found that Ryan Culpepper had scooped me on macro keyword support, after I'd recently slaved over a hot syntax-rules to do the same thing. :) In any case, I would try to make sure I understood PLT's rationale for everything upfront, to save a lot of energy. I'd be happy to kibitz on this, and am especially curious about a model for session vs. session-independent URLs, but unfortunately I can't volunteer coding work right now. -- http://www.neilvandyke.org/ From d.j.gurnell at gmail.com Mon Oct 5 06:34:38 2009 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Mon Oct 5 06:34:59 2009 Subject: [plt-scheme] Looking for a security consultant with PLT web server experience In-Reply-To: <4AC9C9A5.1080306@neilvandyke.org> References: <779bf2730910031706i325b3ac0ne4b55fb57ef7099d@mail.gmail.com> <4AC83E7D.2050808@neilvandyke.org> <466B9C1D-44FF-4D86-AC87-E1DCCE016856@gmail.com> <4AC9C9A5.1080306@neilvandyke.org> Message-ID: >> One nice thing about the web server architecture is that all of >> these issues can be addressed (if they need to be addressed) by >> writing and plugging in a custom continuation manager. The Untypers >> have dabbled with the LRU manager a few times, implementing things >> like extra logging and some application specific continuation >> management. These security-related features seem like other natural >> extensions. >> >> It'd be good to collaborate on something like this as and release >> it as a PLaneT package. > > Seems like PLT has been putting a lot of energy into the Web server > and servlets in the last year or two. I'd first find out whether > this is something they want to look into right now. (Just > yesterday, I found that Ryan Culpepper had scooped me on macro > keyword support, after I'd recently slaved over a hot syntax-rules > to do the same thing. :) In any case, I would try to make sure I > understood PLT's rationale for everything upfront, to save a lot of > energy. Absolutely. I'm sure if the contributions are good they can be rolled into the core. I'd be slightly cautious of this kind of networking "improvement", though - it's probably all too easy to not notice bugs and design flaws for weeks and weeks, at least until after you're convinced that the code is working okay. -- Dave From noelwelsh at gmail.com Mon Oct 5 06:57:02 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Mon Oct 5 06:57:21 2009 Subject: [plt-scheme] Looking for a security consultant with PLT web server experience In-Reply-To: <4AC9C9A5.1080306@neilvandyke.org> References: <779bf2730910031706i325b3ac0ne4b55fb57ef7099d@mail.gmail.com> <4AC83E7D.2050808@neilvandyke.org> <466B9C1D-44FF-4D86-AC87-E1DCCE016856@gmail.com> <4AC9C9A5.1080306@neilvandyke.org> Message-ID: On Mon, Oct 5, 2009 at 11:25 AM, Neil Van Dyke wrote: >> I only currently know about the stateful model, in which a continuation is >> associated with three numbers embedded into the URL: > > Yes, I would try to take session information out of the URL. ?Offhand, I'm > not sure the best way to do this for all browsers while preserving all back > button behavior that one might preserve with URLs, so there would be > experiments and possible tradeoffs or mitigating measures. > Yeah, the issue here is that the URL identifies the browser window, which is what is associated with the continuation. One could add an additional part to the URL which combines with, say, a cookie to identify a particular user. This way just a URL is not sufficient to hijack a session. This doesn't allow people to, say, email URLs to one another. Also, someone eavesdropping on the network could hijack the session. For the former a sensible URL scheme (using dispatchers) allows one to show the correct page in many cases. The later is an issue faced by all web apps, and I think SSL is the appropriate solution if it is a concern. N. From yminsky at gmail.com Mon Oct 5 07:27:41 2009 From: yminsky at gmail.com (Yaron Minsky) Date: Mon Oct 5 07:28:00 2009 Subject: [plt-scheme] Music and worlds Message-ID: <891bd3390910050427p3ea635bfy9b0aa920ebf47495@mail.gmail.com> Hi all. I'm thinking again about using the scheme/worlds framework for education. One of the compelling features of Scratch is the ability to integrate sound and music in various ways. Is there any ability to do this (or plans to make it possible) within the world/universe framework? y -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091005/556c5cdc/attachment.htm From jay.mccarthy at gmail.com Mon Oct 5 07:40:09 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Mon Oct 5 07:40:31 2009 Subject: [plt-scheme] Looking for a security consultant with PLT web server experience In-Reply-To: References: <779bf2730910031706i325b3ac0ne4b55fb57ef7099d@mail.gmail.com> <4AC83E7D.2050808@neilvandyke.org> <466B9C1D-44FF-4D86-AC87-E1DCCE016856@gmail.com> <4AC9C9A5.1080306@neilvandyke.org> Message-ID: I'm happy to put useful contributions in the core. Re: Building IP checking into the default behavior --- I don't think that is wise, for the reasons Neil V. describes. Jay On Mon, Oct 5, 2009 at 4:34 AM, Dave Gurnell wrote: >>> One nice thing about the web server architecture is that all of these >>> issues can be addressed (if they need to be addressed) by writing and >>> plugging in a custom continuation manager. The Untypers have dabbled with >>> the LRU manager a few times, implementing things like extra logging and some >>> application specific continuation management. These security-related >>> features seem like other natural extensions. >>> >>> It'd be good to collaborate on something like this as and release it as a >>> PLaneT package. >> >> Seems like PLT has been putting a lot of energy into the Web server and >> servlets in the last year or two. ?I'd first find out whether this is >> something they want to look into right now. ?(Just yesterday, I found that >> Ryan Culpepper had scooped me on macro keyword support, after I'd recently >> slaved over a hot syntax-rules to do the same thing. :) ?In any case, I >> would try to make sure I understood PLT's rationale for everything upfront, >> to save a lot of energy. > > > Absolutely. I'm sure if the contributions are good they can be rolled into > the core. I'd be slightly cautious of this kind of networking "improvement", > though - it's probably all too easy to not notice bugs and design flaws for > weeks and weeks, at least until after you're convinced that the code is > working okay. > > -- Dave > > _________________________________________________ > ?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 Mon Oct 5 07:44:08 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Mon Oct 5 07:44:30 2009 Subject: [plt-scheme] Looking for a security consultant with PLT web server experience In-Reply-To: References: <779bf2730910031706i325b3ac0ne4b55fb57ef7099d@mail.gmail.com> <4AC83E7D.2050808@neilvandyke.org> <466B9C1D-44FF-4D86-AC87-E1DCCE016856@gmail.com> <4AC9C9A5.1080306@neilvandyke.org> Message-ID: On Mon, Oct 5, 2009 at 4:57 AM, Noel Welsh wrote: > On Mon, Oct 5, 2009 at 11:25 AM, Neil Van Dyke wrote: >>> I only currently know about the stateful model, in which a continuation is >>> associated with three numbers embedded into the URL: >> >> Yes, I would try to take session information out of the URL. ?Offhand, I'm >> not sure the best way to do this for all browsers while preserving all back >> button behavior that one might preserve with URLs, so there would be >> experiments and possible tradeoffs or mitigating measures. >> > > Yeah, the issue here is that the URL identifies the browser window, > which is what is associated with the continuation. One could add an > additional part to the URL which combines with, say, a cookie to > identify a particular user. This way just a URL is not sufficient to > hijack a session. This doesn't allow people to, say, email URLs to one > another. Also, someone eavesdropping on the network could hijack the > session. For the former a sensible URL scheme (using dispatchers) > allows one to show the correct page in many cases. The later is an > issue faced by all web apps, and I think SSL is the appropriate > solution if it is a concern. This, in general, is the method I advise. However, the comment that "This doesn't allow people to, say, email URLs to one another." is not exactly true even when you aren't using the URL dispatcher. The continuation will always be invoked, but if there is extra authentication then it will perform that before doing work. When the authentication isn't there, it doesn't need to just error; it can request authentication and then resume the previous user's computation if it is appropriate. (For example, if the previous continuation was changing the password, then new authentication doesn't allow it, but if it is looking a paper review, then the new authentication would consult the ACL to decide if the paper review should be displayed and maybe it can.) Basically, the continuation can do *anything* including authentication and resuming. Also, re: SSL. You only read need SSL in the first step that gives the authenticator. That will be better for performance. Jay -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From matthias at ccs.neu.edu Mon Oct 5 08:07:29 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Mon Oct 5 08:08:08 2009 Subject: [plt-scheme] Music and worlds In-Reply-To: <891bd3390910050427p3ea635bfy9b0aa920ebf47495@mail.gmail.com> References: <891bd3390910050427p3ea635bfy9b0aa920ebf47495@mail.gmail.com> Message-ID: <39EADD3A-E80B-471B-BCB5-207BD677F673@ccs.neu.edu> There is a rather primitive means for doing so, and Emmanuel's version of Universe/World does so. (The demo I had included in Edinburgh was his or actually one of his students and it ran sounds but it was impossible to hear this in a large hall like that.) In general, Eli will at some point in the future (for some value of future) provide portable music. How's Scratch doing with networked games? On Oct 5, 2009, at 7:27 AM, Yaron Minsky wrote: > Hi all. I'm thinking again about using the scheme/worlds framework > for education. One of the compelling features of Scratch is the > ability to integrate sound and music in various ways. Is there any > ability to do this (or plans to make it possible) within the world/ > universe framework? > > y > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From icfp.publicity at googlemail.com Mon Oct 5 10:06:33 2009 From: icfp.publicity at googlemail.com (Wouter Swierstra) Date: Mon Oct 5 10:06:55 2009 Subject: [plt-scheme] ICFP videos now available Message-ID: <53ff55480910050706v4411ecdfr36b3a838c1419870@mail.gmail.com> I am happy to announce that videos of all talks at ICFP and some of the associated workshops this year have made available online: http://www.vimeo.com/user2191865/albums I'm sure you'll join me in thanking Malcolm Wallace for the time and effort he put into making this possible. Thank you Malcolm! Wouter From david.storrs at gmail.com Mon Oct 5 11:36:54 2009 From: david.storrs at gmail.com (David Storrs) Date: Mon Oct 5 11:37:14 2009 Subject: [plt-scheme] Looking for a security consultant with PLT web server experience In-Reply-To: <4AC9C9A5.1080306@neilvandyke.org> References: <779bf2730910031706i325b3ac0ne4b55fb57ef7099d@mail.gmail.com> <4AC83E7D.2050808@neilvandyke.org> <466B9C1D-44FF-4D86-AC87-E1DCCE016856@gmail.com> <4AC9C9A5.1080306@neilvandyke.org> Message-ID: On Mon, Oct 5, 2009 at 6:25 AM, Neil Van Dyke wrote: > Seems like PLT has been putting a lot of energy into the Web server and > servlets in the last year or two. ?I'd first find out whether this is > something they want to look into right now. ?(Just yesterday, I found that > Ryan Culpepper had scooped me on macro keyword support, after I'd recently > slaved over a hot syntax-rules to do the same thing. :) ?In any case, I > would try to make sure I understood PLT's rationale for everything upfront, > to save a lot of energy. > > I'd be happy to kibitz on this, and am especially curious about a model for > session vs. session-independent URLs, but unfortunately I can't volunteer > coding work right now. I can volunteer a limited amount of coding work, insofar as this is the problem that we're trying to solve. That said, my partner and I are both new enough at Scheme that our coding contributions may not be that helpful. As to the design goals, what I'm trying to achieve in my web-app is actually pretty simple, and is probably something that everyone using the server for apps would like to have: 1) A user can be securely and unambiguously authenticated. 2) The authentication system must be simple to implement by the web-app author...ideally, it would just consist of a single standard function call, or even just a decoration on the servlet declaration. 3) The authentication system must be easy to integrate with external data stores (databases, etc). 4) Once a user has authenticated, the server stores a new session object which will be available to servlets. This object contains the username of the current user, along with other information dependent on the needs of the app. All of the above should be pretty much standard across any web app that wants to do user login. The following are my thoughts on a security model; those may or may not suit other people. 1) A "page" in a webapp is the unit of security granularity (*). 2) Pages are either "public" or "private"; is-public? and is-private? query for these. 3) All pages have an 'authz' and 'on-fail' procedure. These have default values and can be specified on a per-page basis. 4) When a page is requested, its authz procedure runs before the page function runs. If authz => #t, the page runs, else the on-fail procedure runs. The on-fail procedure is never run unless authz fails. 5) The default on-fail procedure is (lambda (sess) (redirect-to-page default-error-page)) 6) The default authz procedure is: (lambda (sess) (or (is-public?) (allowed-user? sess) (allowed-role? sess))) 7) Private pages have two (by default, empty) lists associated with them: allowed-users and allowed-roles. The first contains usernames allowed to access the page. The second contains roles (e.g. "admin", "dev", "basic-user", "premium-user") that are allowed to access the page. In order to access the page, the current user must either be in the allowed-users list or have one of the roles appearing in allowed-roles. 8) Every webapp has a default-error-page function generated for it by default; this function renders a blank page with a standard message like "Oops, sorry, we couldn't do that. You may need to login." This function can be overriden. (*) In most casess, a "page" as used above will be a full page in the browser, but it could also be a self contained component such as a formlet, which then gets composited into other pages. This model could be extended a lot. For example, pages could have a chain of authz procedures, and the author could specify whether to combine them with AND or OR. Combining with AND makes it easy to write complicated authentication logic as a series of filters. Combining with OR makes it easy to allow for exceptions: all premium users, plus this one basic user who did us a favor once. On the principle of KISS, however, I'm starting off without these extensions. What do you all think? --Dks From eli at barzilay.org Mon Oct 5 12:24:17 2009 From: eli at barzilay.org (Eli Barzilay) Date: Mon Oct 5 12:24:38 2009 Subject: [plt-scheme] Compression dictionary Message-ID: <19146.7601.102032.609421@winooski.ccs.neu.edu> Does anyone know of a good and simple method for building a dictionary for compression? [ Explanation: The documentation index file was ~2mb initially, and now it's up to 3mb. In addition, some thing I did for compression make loading it slower (like nested arrays which are used like Sexprs) so I'm revising the whole thing. To get better compression, I started hand-crafting regexps, but you can imagine the kind of mess that this leads to... so I'm looking for a more proper compression. To that end, I even found a very short Javascript LZW encoder and decoder, but the problem is that LZW works better with a lot of text but I can't afford having the whole thing as one giant string (since the time to decode it will be even longer). Instead, I'm looking for a way to find a good set of common substrings from all index entries, then go over the data and replace these strings by pointers to an array holding the dictionary. I'll be happy to hear on better methods too. ] -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From matthias at ccs.neu.edu Mon Oct 5 12:31:01 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Mon Oct 5 12:31:36 2009 Subject: [plt-scheme] Compression dictionary In-Reply-To: <19146.7601.102032.609421@winooski.ccs.neu.edu> References: <19146.7601.102032.609421@winooski.ccs.neu.edu> Message-ID: <35C0DBA8-186F-4825-BFAE-38220FEFCEB7@ccs.neu.edu> Could one reformulate your problem as one of executing compressed instructions on a VM? Marc Feeley and Mario Latendresse worked on such things, as did others. On Oct 5, 2009, at 12:24 PM, Eli Barzilay wrote: > Does anyone know of a good and simple method for building a dictionary > for compression? > > > [ > > Explanation: The documentation index file was ~2mb initially, and now > it's up to 3mb. In addition, some thing I did for compression make > loading it slower (like nested arrays which are used like Sexprs) so > I'm revising the whole thing. > > To get better compression, I started hand-crafting regexps, but you > can imagine the kind of mess that this leads to... so I'm looking for > a more proper compression. To that end, I even found a very short > Javascript LZW encoder and decoder, but the problem is that LZW works > better with a lot of text but I can't afford having the whole thing as > one giant string (since the time to decode it will be even longer). > > Instead, I'm looking for a way to find a good set of common substrings > from all index entries, then go over the data and replace these > strings by pointers to an array holding the dictionary. I'll be happy > to hear on better methods too. > > ] > > -- > ((lambda (x) (x x)) (lambda (x) (x x))) Eli > Barzilay: > http://barzilay.org/ Maze is > Life! > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From eli at barzilay.org Mon Oct 5 12:51:41 2009 From: eli at barzilay.org (Eli Barzilay) Date: Mon Oct 5 12:52:02 2009 Subject: [plt-scheme] Compression dictionary In-Reply-To: <35C0DBA8-186F-4825-BFAE-38220FEFCEB7@ccs.neu.edu> References: <19146.7601.102032.609421@winooski.ccs.neu.edu> <35C0DBA8-186F-4825-BFAE-38220FEFCEB7@ccs.neu.edu> Message-ID: <19146.9245.28064.885494@winooski.ccs.neu.edu> On Oct 5, Matthias Felleisen wrote: > Could one reformulate your problem as one of executing compressed > instructions on a VM? Marc Feeley and Mario Latendresse worked on > such things, as did others. Maybe, but my guess is that the nature of the compression that I need is different. But in any case, I'm looking for something simple (so I can understand and maintain the code) and hopefully fast (so setup-plt doesn't get slower by 15 minutes for doing this search). I forgot to include a quick concrete example -- say that I have this array of strings: "foo_bar" "meh_blah_foo_blah" A solution should be a list of dictionary strings so that I can turn that to something like: "$1_bar" "meh$2_$1$2" dictionary: 1: "foo" 2: "_blah" or "$1bar" "meh_$2_$1$2" dictionary: 1: "foo_" 2: "blah" where in this case both solutions compress the same. (But in general I suspect that I don't need to have some intensive search that will try to find a solution that is close to optimal -- for the above reasons.) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From robby at eecs.northwestern.edu Mon Oct 5 12:55:50 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Mon Oct 5 12:56:11 2009 Subject: [plt-scheme] Compression dictionary In-Reply-To: <19146.9245.28064.885494@winooski.ccs.neu.edu> References: <19146.7601.102032.609421@winooski.ccs.neu.edu> <35C0DBA8-186F-4825-BFAE-38220FEFCEB7@ccs.neu.edu> <19146.9245.28064.885494@winooski.ccs.neu.edu> Message-ID: <932b2f1f0910050955y5c5cfbfal67eedcc70e19a42a@mail.gmail.com> That looks a lot like LZW compression to me. Perhaps you can't use the library, but you shoudl eb able to use the algorithm. Robby On Mon, Oct 5, 2009 at 11:51 AM, Eli Barzilay wrote: > On Oct ?5, Matthias Felleisen wrote: >> Could one reformulate your problem as one of executing compressed >> instructions on a VM? Marc Feeley and Mario Latendresse worked on >> such things, as did others. > > Maybe, but my guess is that the nature of the compression that I need > is different. ?But in any case, I'm looking for something simple (so I > can understand and maintain the code) and hopefully fast (so setup-plt > doesn't get slower by 15 minutes for doing this search). > > I forgot to include a quick concrete example -- say that I have this > array of strings: > > ?"foo_bar" > ?"meh_blah_foo_blah" > > A solution should be a list of dictionary strings so that I can turn > that to something like: > > ?"$1_bar" > ?"meh$2_$1$2" > ?dictionary: > ?1: "foo" > ?2: "_blah" > > or > > ?"$1bar" > ?"meh_$2_$1$2" > ?dictionary: > ?1: "foo_" > ?2: "blah" > > where in this case both solutions compress the same. ?(But in general > I suspect that I don't need to have some intensive search that will > try to find a solution that is close to optimal -- for the above > reasons.) > > -- > ? ? ? ? ?((lambda (x) (x x)) (lambda (x) (x x))) ? ? ? ? ?Eli Barzilay: > ? ? ? ? ? ? ? ? ? ?http://barzilay.org/ ? ? ? ? ? ? ? ? ? Maze is Life! > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From eli at barzilay.org Mon Oct 5 13:00:35 2009 From: eli at barzilay.org (Eli Barzilay) Date: Mon Oct 5 13:00:58 2009 Subject: [plt-scheme] Compression dictionary In-Reply-To: <932b2f1f0910050955y5c5cfbfal67eedcc70e19a42a@mail.gmail.com> References: <19146.7601.102032.609421@winooski.ccs.neu.edu> <35C0DBA8-186F-4825-BFAE-38220FEFCEB7@ccs.neu.edu> <19146.9245.28064.885494@winooski.ccs.neu.edu> <932b2f1f0910050955y5c5cfbfal67eedcc70e19a42a@mail.gmail.com> Message-ID: <19146.9779.628466.591534@winooski.ccs.neu.edu> On Oct 5, Robby Findler wrote: > That looks a lot like LZW compression to me. Perhaps you can't use > the library, but you should be able to use the algorithm. Yes, that's the best candidate I have so far, but I prefer a better approach if there is one. The problem with LZW is that it is based on a running sequence of data, but I'm dealing with short unrelated segments. Also, at least in the simple versions that I've seen, the dictionary never shrinks, and I don't know how that will play out with a big file... I'm hoping that someone knows of some simple solution that fits this problem naturally... -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From jensaxel at soegaard.net Mon Oct 5 13:03:01 2009 From: jensaxel at soegaard.net (=?UTF-8?Q?Jens_Axel_S=C3=B8gaard?=) Date: Mon Oct 5 13:03:22 2009 Subject: [plt-scheme] Compression dictionary In-Reply-To: <19146.7601.102032.609421@winooski.ccs.neu.edu> References: <19146.7601.102032.609421@winooski.ccs.neu.edu> Message-ID: <4072c51f0910051003g759fe2c6j23562a0d6b651d6b@mail.gmail.com> 2009/10/5 Eli Barzilay : > Does anyone know of a good and simple method for building a dictionary > for compression? > Explanation: The documentation index file was ~2mb initially, and now > it's up to 3mb. ?In addition, some thing I did for compression make > loading it slower (like nested arrays which are used like Sexprs) so > I'm revising the whole thing. > Example> > "foo_bar" > "meh_blah_foo_blah" I understand the tokens are "foo", "bar", "meh", and, "blah". How many bytes do you need to store the tokens alone? How many different tokens are there? -- Jens Axel S?gaard From eli at barzilay.org Mon Oct 5 13:09:37 2009 From: eli at barzilay.org (Eli Barzilay) Date: Mon Oct 5 13:10:01 2009 Subject: [plt-scheme] Compression dictionary In-Reply-To: <4072c51f0910051003g759fe2c6j23562a0d6b651d6b@mail.gmail.com> References: <19146.7601.102032.609421@winooski.ccs.neu.edu> <4072c51f0910051003g759fe2c6j23562a0d6b651d6b@mail.gmail.com> Message-ID: <19146.10321.820316.63386@winooski.ccs.neu.edu> On Oct 5, Jens Axel S?gaard wrote: > 2009/10/5 Eli Barzilay : > > Does anyone know of a good and simple method for building a dictionary > > for compression? > > > Explanation: The documentation index file was ~2mb initially, and now > > it's up to 3mb. ?In addition, some thing I did for compression make > > loading it slower (like nested arrays which are used like Sexprs) so > > I'm revising the whole thing. > > > Example> > > > "foo_bar" > > "meh_blah_foo_blah" > > I understand the tokens are "foo", "bar", "meh", and, "blah". Well, I'm working with just raw strings -- trying to get meaningful tokens is going down "regexp-hell"... So in that example I had "_blah" as a token in one example, and "foo_" in the other. > How many bytes do you need to store the tokens alone? How many > different tokens are there? The actual JS representation of the first example will look close to: search_data = ["$1_bar", "meh$2_$1$2"]; dictionary = ["foo", "_blah"]; That is: numbers in the data marked in a way that makes them into pointers to the dictionary, which holds strings. The reason for using this over some sexpr-like thing like search_data = [[1, "_bar"], ["meh", 2, "_", 1, 2]]; is that loading/executing JS code that has flat strings seemed to be considerably faster than nested arrays. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From jensaxel at soegaard.net Mon Oct 5 13:42:18 2009 From: jensaxel at soegaard.net (=?UTF-8?Q?Jens_Axel_S=C3=B8gaard?=) Date: Mon Oct 5 13:42:42 2009 Subject: [plt-scheme] Compression dictionary In-Reply-To: <19146.10321.820316.63386@winooski.ccs.neu.edu> References: <19146.7601.102032.609421@winooski.ccs.neu.edu> <4072c51f0910051003g759fe2c6j23562a0d6b651d6b@mail.gmail.com> <19146.10321.820316.63386@winooski.ccs.neu.edu> Message-ID: <4072c51f0910051042h5e6a8bf6s908c44ec7541ad48@mail.gmail.com> 2009/10/5 Eli Barzilay : > On Oct ?5, Jens Axel S?gaard wrote: >> 2009/10/5 Eli Barzilay : >> > Does anyone know of a good and simple method for building a dictionary >> > for compression? >> >> > Explanation: The documentation index file was ~2mb initially, and now >> > it's up to 3mb. ?In addition, some thing I did for compression make >> > loading it slower (like nested arrays which are used like Sexprs) so >> > I'm revising the whole thing. >> >> > Example> >> >> > "foo_bar" >> > ?"meh_blah_foo_blah" >> >> I understand the tokens are "foo", "bar", "meh", and, "blah". > > Well, I'm working with just raw strings -- trying to get meaningful > tokens is going down "regexp-hell"... ?So in that example I had > "_blah" as a token in one example, and "foo_" in the other. Okay, so what the actual tokens used by the algorithm is not as important as fast decoding is. Is it possible to make a back-of-the-envelope calculation with respect to compression rate, download time, and decoding time? Just to get a feeling of the sizes involved: jasmacair:tmp jensaxelsoegaard$ ls -las index.html 7960 -rw-r--r-- 1 jensaxelsoegaard wheel 4071868 4 Okt 19:33 index.html jasmacair:tmp jensaxelsoegaard$ gzip index.html jasmacair:tmp jensaxelsoegaard$ ls -las index.html.gz 648 -rw-r--r-- 1 jensaxelsoegaard wheel 330511 4 Okt 19:33 index.html.gz The original file size is 4071868 bytes and a gzipped version is only 330511. The gzipped version is thus only 8% of the original. Question: Does the PLT web server support on-the-fly gzip compression? I suppose it does (I think, I saw a gzip-stuffer some where). Is it used for docs.plt-scheme.org? NB: The 8% might not be directly applicable, since the file contains a lot of html. -- Jens Axel S?gaard From eli at barzilay.org Mon Oct 5 13:49:33 2009 From: eli at barzilay.org (Eli Barzilay) Date: Mon Oct 5 13:50:14 2009 Subject: [plt-scheme] Compression dictionary In-Reply-To: <4072c51f0910051042h5e6a8bf6s908c44ec7541ad48@mail.gmail.com> References: <19146.7601.102032.609421@winooski.ccs.neu.edu> <4072c51f0910051003g759fe2c6j23562a0d6b651d6b@mail.gmail.com> <19146.10321.820316.63386@winooski.ccs.neu.edu> <4072c51f0910051042h5e6a8bf6s908c44ec7541ad48@mail.gmail.com> Message-ID: <19146.12717.613528.771553@winooski.ccs.neu.edu> On Oct 5, Jens Axel S?gaard wrote: > 2009/10/5 Eli Barzilay : > > On Oct ?5, Jens Axel S?gaard wrote: > >> 2009/10/5 Eli Barzilay : > >> > Does anyone know of a good and simple method for building a dictionary > >> > for compression? > >> > >> > Explanation: The documentation index file was ~2mb initially, and now > >> > it's up to 3mb. ?In addition, some thing I did for compression make > >> > loading it slower (like nested arrays which are used like Sexprs) so > >> > I'm revising the whole thing. > >> > >> > Example> > >> > >> > "foo_bar" > >> > ?"meh_blah_foo_blah" > >> > >> I understand the tokens are "foo", "bar", "meh", and, "blah". > > > > Well, I'm working with just raw strings -- trying to get meaningful > > tokens is going down "regexp-hell"... ?So in that example I had > > "_blah" as a token in one example, and "foo_" in the other. > > Okay, so what the actual tokens used by the algorithm is not as important > as fast decoding is. > > Is it possible to make a back-of-the-envelope calculation with > respect to compression rate, download time, and decoding time? Heh -- you could -- but the critical point here is is (I think) not the download time, but the time it takes the browser to parse the 3mb file and execute it to get the vector of data into memory. > Just to get a feeling of the sizes involved: > > jasmacair:tmp jensaxelsoegaard$ ls -las index.html > 7960 -rw-r--r-- 1 jensaxelsoegaard wheel 4071868 4 Okt 19:33 index.html > jasmacair:tmp jensaxelsoegaard$ gzip index.html > jasmacair:tmp jensaxelsoegaard$ ls -las index.html.gz > 648 -rw-r--r-- 1 jensaxelsoegaard wheel 330511 4 Okt 19:33 index.html.gz > > The original file size is 4071868 bytes and a gzipped version is > only 330511. The gzipped version is thus only 8% of the original. > > Question: Does the PLT web server support on-the-fly gzip > compression? I don't think so, but that's a side-issue, since I'm dealing with static files that are being served through apache (as does docs.plt-scheme.org). > I suppose it does (I think, I saw a gzip-stuffer some where). > > Is it used for docs.plt-scheme.org? > > NB: The 8% might not be directly applicable, since the file contains > a lot of html. To clarify, the problem I'm tackling is the javascript index used for searching -- the one you get if you go to docs.plt-scheme.org/search/ or if you do a search from drscheme. It's basically the delay you get when you open the search -- which includes both the network time and the JS execution time, and if you do it locally then it's all just JS time. To see how the index file looks like now, open "plt/doc/search/plt-index.js" (but be careful with editors that will try to do highlights etc). -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From yminsky at gmail.com Mon Oct 5 14:33:52 2009 From: yminsky at gmail.com (Yaron Minsky) Date: Mon Oct 5 14:34:11 2009 Subject: [plt-scheme] Music and worlds In-Reply-To: <39EADD3A-E80B-471B-BCB5-207BD677F673@ccs.neu.edu> References: <891bd3390910050427p3ea635bfy9b0aa920ebf47495@mail.gmail.com> <39EADD3A-E80B-471B-BCB5-207BD677F673@ccs.neu.edu> Message-ID: <891bd3390910051133s4f9ad66end6339b6ef9e3ea6a@mail.gmail.com> On Mon, Oct 5, 2009 at 8:07 AM, Matthias Felleisen wrote: > > There is a rather primitive means for doing so, and Emmanuel's version of > Universe/World does so. (The demo I had included in Edinburgh was his or > actually one of his students and it ran sounds but it was impossible to hear > this in a large hall like that.) In general, Eli will at some point in the > future (for some value of future) provide portable music. > > How's Scratch doing with networked games? I don't think that it has any support yet. That said, I think sound is in some ways more important for catching kids (at least my kid's) attention. Sound (including pre-recorded music) is such a basic part of computer games these days, that it doesn't quite feel like a game without it. One of the things that is attractive about scratch is that it does a good job of integrating multimedia into the environment. Drscheme does one critical bit of this, which is supporting images reasonably well. But having an easy built-in facility for drawing pictures and recording sounds is really nice for young kids. That said, the programming model in scratch is kind of horrible... y -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091005/66b71505/attachment.htm From yinso.chen at gmail.com Mon Oct 5 15:11:20 2009 From: yinso.chen at gmail.com (YC) Date: Mon Oct 5 15:11:45 2009 Subject: [plt-scheme] [ANN] bzlib/date & bzlib/date-tz - date & timezone manipulation Message-ID: <779bf2730910051211t532b503dk91bc1b21d612adc9@mail.gmail.com> Hi all - bzlib/date & bzlib/date-tz are now available via planet. They provide date & timezone manipulation capabilities (so you can find the future/past timezone offsets without messing with TZ environment variable). They currently work with srfi/19 date objects (not yet with PLT dates). (require (planet bzlib/date) (planet bzlib/date-tz)) You can find the tutorial at http://weblambda.blogspot.com/2009/10/introducing-bzlibdate-bzlibdate-tz-date.html Cheers, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091005/5d2820fb/attachment.htm From keydana at gmx.de Mon Oct 5 15:58:47 2009 From: keydana at gmx.de (keydana@gmx.de) Date: Mon Oct 5 15:59:16 2009 Subject: [plt-scheme] problem with backtracking order of nested ambs Message-ID: <9B48BAD4-8C2D-4209-A07F-6B0CC8F866FC@gmx.de> Hi all, I have a problem with the backtracking order of nested ambs which makes that I cannot get the result I need. I've made up a dummy example: (let ((x (amb 3 5 4))) (let ((result (amb (begin (assert (even? x)) x) 77))) result)) I would need amb to first try all of '(3 5 4) and only after that, take 77 as last possible way out. In practice, I want to generate a list with amb, then check if every item is unique, if not, try all other possible ways to compose the list - and only there's no way to get it unique, decide that "ok, nearly unique is fine too", such that 2 elements may be the same, so try and assert that... and so on, until I can be sure that at least the program will not fail, not producing any results at all. I'd be glad for any hints what I'm doing wrong here... Thanks a lot in advance, Sigrid From jensaxel at soegaard.net Mon Oct 5 16:27:58 2009 From: jensaxel at soegaard.net (=?UTF-8?Q?Jens_Axel_S=C3=B8gaard?=) Date: Mon Oct 5 16:28:17 2009 Subject: [plt-scheme] Compression dictionary In-Reply-To: <19146.12717.613528.771553@winooski.ccs.neu.edu> References: <19146.7601.102032.609421@winooski.ccs.neu.edu> <4072c51f0910051003g759fe2c6j23562a0d6b651d6b@mail.gmail.com> <19146.10321.820316.63386@winooski.ccs.neu.edu> <4072c51f0910051042h5e6a8bf6s908c44ec7541ad48@mail.gmail.com> <19146.12717.613528.771553@winooski.ccs.neu.edu> Message-ID: <4072c51f0910051327h73994a4xd74b5f66f9658a31@mail.gmail.com> 2009/10/5 Eli Barzilay : > On Oct ?5, Jens Axel S?gaard wrote: >> Is it possible to make a back-of-the-envelope calculation with >> respect to compression rate, download time, and decoding time? > > Heh -- you could -- but the critical point here is is (I think) not > the download time, but the time it takes the browser to parse the 3mb > file and execute it to get the vector of data into memory. Okay, then it is irrelevant whether gzip the server uses gzip or not. >> Question: Does the PLT web server support on-the-fly gzip >> compression? > > I don't think so, but that's a side-issue, since I'm dealing with > static files that are being served through apache (as does > docs.plt-scheme.org). > To clarify, the problem I'm tackling is the javascript index used for > searching -- the one you get if you go to docs.plt-scheme.org/search/ > or if you do a search from drscheme. ?It's basically the delay you get > when you open the search -- which includes both the network time and > the JS execution time, and if you do it locally then it's all just JS > time. Hmm. Tricky. You said that LZW worked best on large text, but that you couldn't afford large strings. Is it an idea to build a dictionary on the server, by running the LZW compression algorithm on all the strings (thus having a large text), and then start the LZW decompression with a non-empty dictionary? There is a trade of between the time to download the dictionary and the time won by starting with a better dictionary involved. -- Jens Axel S?gaard From yinso.chen at gmail.com Mon Oct 5 16:37:23 2009 From: yinso.chen at gmail.com (YC) Date: Mon Oct 5 16:37:46 2009 Subject: [plt-scheme] Looking for a security consultant with PLT web server experience In-Reply-To: References: <779bf2730910031706i325b3ac0ne4b55fb57ef7099d@mail.gmail.com> <4AC83E7D.2050808@neilvandyke.org> <466B9C1D-44FF-4D86-AC87-E1DCCE016856@gmail.com> <4AC9C9A5.1080306@neilvandyke.org> Message-ID: <779bf2730910051337u7d89ea4bwfb8a5807f392c10a@mail.gmail.com> On Mon, Oct 5, 2009 at 4:44 AM, Jay McCarthy wrote: > This, in general, is the method I advise. However, the comment that > "This doesn't allow people to, say, email URLs to one another." is not > exactly true even when you aren't using the URL dispatcher. The > continuation will always be invoked, but if there is extra > authentication then it will perform that before doing work. When the > authentication isn't there, it doesn't need to just error; it can > request authentication and then resume the previous user's computation > if it is appropriate. (For example, if the previous continuation was > changing the password, then new authentication doesn't allow it, but > if it is looking a paper review, then the new authentication would > consult the ACL to decide if the paper review should be displayed and > maybe it can.) > > Jay - this is interesting - do you need to write your own dispatcher to make this work? Also - does it work with form-based auth? Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091005/eda687bb/attachment.htm From sshickey at qwest.net Mon Oct 5 16:37:42 2009 From: sshickey at qwest.net (Scott Hickey) Date: Mon Oct 5 16:38:23 2009 Subject: [plt-scheme] warnings trying to require snooze in PLT-Scheme v4.2.2 Message-ID: <173403.92808.qm@web62507.mail.re1.yahoo.com> require: unknown module: 'program setup-plt: error: during Building docs for /Users/jshickey/Library/PLT Scheme/planet/300/4.2.2/cache/cce/scheme.plt/4/1/scribblings/main.scrbl setup-plt: require: unknown module: 'program WARNING: collected information for key multiple times: (index-entry (mod-path "(planet schematics/sake)")); values: (("(planet schematics/sake)") (#(struct:sized-element ... ...)) #) (("(planet schematics/sake)") (#(struct:sized-element ... ...)) #) WARNING: collected information for key multiple times: (mod-path "(planet schematics/sake)"); values: #(# ("Build files") #t (mod-path "(planet schematics/sake)")) #(# ("The Sake API") #t (mod-path "(planet schematics/sake)")) WARNING: collected information for key multiple times: (index-entry (mod-path "(planet schematics/sake)")); values: (("(planet schematics/sake)") (#(struct:sized-element ... ...)) #) (("(planet schematics/sake)") (#(struct:sized-element ... ...)) #) WARNING: collected information for key multiple times: (mod-path "(planet schematics/sake)"); values: #(# ("Build files") #t (mod-path "(planet schematics/sake)")) #(# ("The Sake API") #t (mod-path "(planet schematics/sake)")) open-input-file: cannot open input file: "/scribblings/db.ss" (No such file or directory; errno=2) setup-plt: error: during Building docs for /Users/jshickey/Library/PLT Scheme/planet/300/4.2.2/cache/untyped/snooze.plt/2/8/scribblings/snooze.scrbl setup-plt: open-input-file: cannot open input file: "/scribblings/db.ss" (No such file or directory; errno=2) Scott Hickey Senior Consultant Object Partners, Inc. From eli at barzilay.org Mon Oct 5 16:39:16 2009 From: eli at barzilay.org (Eli Barzilay) Date: Mon Oct 5 16:39:39 2009 Subject: [plt-scheme] Compression dictionary In-Reply-To: <4072c51f0910051327h73994a4xd74b5f66f9658a31@mail.gmail.com> References: <19146.7601.102032.609421@winooski.ccs.neu.edu> <4072c51f0910051003g759fe2c6j23562a0d6b651d6b@mail.gmail.com> <19146.10321.820316.63386@winooski.ccs.neu.edu> <4072c51f0910051042h5e6a8bf6s908c44ec7541ad48@mail.gmail.com> <19146.12717.613528.771553@winooski.ccs.neu.edu> <4072c51f0910051327h73994a4xd74b5f66f9658a31@mail.gmail.com> Message-ID: <19146.22900.599681.982152@winooski.ccs.neu.edu> On Oct 5, Jens Axel S?gaard wrote: > Hmm. Tricky. > > You said that LZW worked best on large text, but that you couldn't > afford large strings. Is it an idea to build a dictionary on the > server, by running the LZW compression algorithm on all the strings > (thus having a large text), and then start the LZW decompression > with a non-empty dictionary? Perhaps being very concrete would help... Here's a fragment from the JS index (which is part of the code that does the help search): ["disposition-read","../net/mime.html#(def._((lib._net/mime..ss)._disposition-read))","disposition-read",["net/mime"]], ["disposition-size","../net/mime.html#(def._((lib._net/mime..ss)._disposition-size))","disposition-size",["net/mime"]], ["disposition-type","../net/mime.html#(def._((lib._net/mime..ss)._disposition-type))","disposition-type",["net/mime"]], It has a lot of strings that are repeated -- and this translates to a much bigger file as well as a much longer time for the browser's JS engine to parse this source and run it. I'm looking for a way to find a good set of words that I can use at the time where this index is created, so that the overall file is smaller. Using something like LZW on each string is not effective -- because LZW becomes effective when you give it more text. (This is essentially why tgz will often outperform (older) zip files by compressing a whole directory as one unit.) When I have such a set of strings (phrases), I can do a simple substitution of occurrences of these strings with pointers into an array that holds the phrases. So overall the array would be smaller (much, hopefully), which would reduce the time you wait for the search page to come up -- while keeping the decoding effort (which is done in javascript) to a simple process of substituting such references with words found in the phrases vector. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From jmarshall at alum.mit.edu Mon Oct 5 16:59:17 2009 From: jmarshall at alum.mit.edu (Joe Marshall) Date: Mon Oct 5 17:00:00 2009 Subject: [plt-scheme] problem with backtracking order of nested ambs In-Reply-To: <9B48BAD4-8C2D-4209-A07F-6B0CC8F866FC@gmx.de> References: <9B48BAD4-8C2D-4209-A07F-6B0CC8F866FC@gmx.de> Message-ID: I believe that the backtracking order is to the most recent (dynamically) AMB. In your example, you could reverse the nesting of the AMBs, but I imagine that would be much trickier in the problem you describe. The propagator work that Sussman and Radul were doing was exploring how to get AMB to backtrack to the nearest one that could potentially satisfy the required dependency. It involves a serious change to the way the compiler compiles the code, though. On Mon, Oct 5, 2009 at 12:58 PM, keydana@gmx.de wrote: > Hi all, > > I have a problem with the backtracking order of nested ambs which makes that > I cannot get the result I need. I've made up a dummy example: > > ?(let ((x (amb 3 5 4))) > ? (let ((result (amb (begin (assert (even? x)) x) 77))) > ? ? result)) > > I would need amb to first try all of '(3 5 4) and only after that, take 77 > as last possible way out. > > In practice, I want to generate a list with amb, then check if every item is > unique, if not, try all other possible ways to compose the list - and only > there's no way to get it unique, > decide that "ok, nearly unique is fine too", such that 2 elements may be the > same, so try and assert that... and so on, until I can be sure that at least > the program will not fail, > not producing any results at all. > > I'd be glad for any hints what I'm doing wrong here... > > Thanks a lot in advance, > Sigrid > > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- ~jrm From czhu at cs.utah.edu Mon Oct 5 17:03:06 2009 From: czhu at cs.utah.edu (Chongkai Zhu) Date: Mon Oct 5 17:03:37 2009 Subject: [plt-scheme] problem with backtracking order of nested ambs In-Reply-To: <9B48BAD4-8C2D-4209-A07F-6B0CC8F866FC@gmx.de> References: <9B48BAD4-8C2D-4209-A07F-6B0CC8F866FC@gmx.de> Message-ID: <4ACA5F0A.70401@cs.utah.edu> Maybe you want something like: (let ((x (amb 3 5 4))) (assert (even? x)) (amb x 77)) Chongkai keydana@gmx.de wrote: > Hi all, > > I have a problem with the backtracking order of nested ambs which > makes that I cannot get the result I need. I've made up a dummy example: > > (let ((x (amb 3 5 4))) > (let ((result (amb (begin (assert (even? x)) x) 77))) > result)) > > I would need amb to first try all of '(3 5 4) and only after that, > take 77 as last possible way out. > > In practice, I want to generate a list with amb, then check if every > item is unique, if not, try all other possible ways to compose the > list - and only there's no way to get it unique, > decide that "ok, nearly unique is fine too", such that 2 elements may > be the same, so try and assert that... and so on, until I can be sure > that at least the program will not fail, > not producing any results at all. > > I'd be glad for any hints what I'm doing wrong here... > > Thanks a lot in advance, > Sigrid > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From jay.mccarthy at gmail.com Mon Oct 5 17:05:10 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Mon Oct 5 17:05:51 2009 Subject: [plt-scheme] Looking for a security consultant with PLT web server experience In-Reply-To: <779bf2730910051337u7d89ea4bwfb8a5807f392c10a@mail.gmail.com> References: <779bf2730910031706i325b3ac0ne4b55fb57ef7099d@mail.gmail.com> <4AC83E7D.2050808@neilvandyke.org> <466B9C1D-44FF-4D86-AC87-E1DCCE016856@gmail.com> <4AC9C9A5.1080306@neilvandyke.org> <779bf2730910051337u7d89ea4bwfb8a5807f392c10a@mail.gmail.com> Message-ID: You would not need your own dispatcher and works with all auth. Pseudo-code... (define current-user ...) ... (define prev-user (current-user)) (define unauthed-req (send/suspend ...)) (if (has-authenticator? unauthed-req prev-user) (continue) (with-authentication (cond [(equal? prev-user (current-user)) (continue)] [(has-access? (current-user) continue) (continue)] [else (access-denied+restart-ui)]))) Jay On Mon, Oct 5, 2009 at 2:37 PM, YC wrote: > > On Mon, Oct 5, 2009 at 4:44 AM, Jay McCarthy wrote: >> >> This, in general, is the method I advise. However, the comment that >> "This doesn't allow people to, say, email URLs to one another." is not >> exactly true even when you aren't using the URL dispatcher. The >> continuation will always be invoked, but if there is extra >> authentication then it will perform that before doing work. When the >> authentication isn't there, it doesn't need to just error; it can >> request authentication and then resume the previous user's computation >> if it is appropriate. (For example, if the previous continuation was >> changing the password, then new authentication doesn't allow it, but >> if it is looking a paper review, then the new authentication would >> consult the ACL to decide if the paper review should be displayed and >> maybe it can.) >> > Jay - > > this is interesting - do you need to write your own dispatcher to make this > work? ?Also - does it work with form-based auth? > > Thanks, > yc > > -- 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 Mon Oct 5 17:07:11 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Mon Oct 5 17:07:37 2009 Subject: [plt-scheme] Compression dictionary In-Reply-To: <19146.22900.599681.982152@winooski.ccs.neu.edu> References: <19146.7601.102032.609421@winooski.ccs.neu.edu> <4072c51f0910051003g759fe2c6j23562a0d6b651d6b@mail.gmail.com> <19146.10321.820316.63386@winooski.ccs.neu.edu> <4072c51f0910051042h5e6a8bf6s908c44ec7541ad48@mail.gmail.com> <19146.12717.613528.771553@winooski.ccs.neu.edu> <4072c51f0910051327h73994a4xd74b5f66f9658a31@mail.gmail.com> <19146.22900.599681.982152@winooski.ccs.neu.edu> Message-ID: One thought... The JS can make an AJAX request for the search file and the web server can serve it gzipped, because most browsers support on the fly decompression. Then that file would be received by JS in plain-text and it could parse/eval it. Jay On Mon, Oct 5, 2009 at 2:39 PM, Eli Barzilay wrote: > On Oct ?5, Jens Axel S?gaard wrote: >> Hmm. Tricky. >> >> You said that LZW worked best on large text, but that you couldn't >> afford large strings. Is it an idea to build a dictionary on the >> server, by running the LZW compression algorithm on all the strings >> (thus having a large text), and then start the LZW decompression >> with a non-empty dictionary? > > Perhaps being very concrete would help... ?Here's a fragment from the > JS index (which is part of the code that does the help search): > > ?["disposition-read","../net/mime.html#(def._((lib._net/mime..ss)._disposition-read))","disposition-read",["net/mime"]], > ?["disposition-size","../net/mime.html#(def._((lib._net/mime..ss)._disposition-size))","disposition-size",["net/mime"]], > ?["disposition-type","../net/mime.html#(def._((lib._net/mime..ss)._disposition-type))","disposition-type",["net/mime"]], > > It has a lot of strings that are repeated -- and this translates to a > much bigger file as well as a much longer time for the browser's JS > engine to parse this source and run it. ?I'm looking for a way to find > a good set of words that I can use at the time where this index is > created, so that the overall file is smaller. ?Using something like > LZW on each string is not effective -- because LZW becomes effective > when you give it more text. ?(This is essentially why tgz will often > outperform (older) zip files by compressing a whole directory as one > unit.) > > When I have such a set of strings (phrases), I can do a simple > substitution of occurrences of these strings with pointers into an > array that holds the phrases. ?So overall the array would be smaller > (much, hopefully), which would reduce the time you wait for the search > page to come up -- while keeping the decoding effort (which is done in > javascript) to a simple process of substituting such references with > words found in the phrases vector. > > -- > ? ? ? ? ?((lambda (x) (x x)) (lambda (x) (x x))) ? ? ? ? ?Eli Barzilay: > ? ? ? ? ? ? ? ? ? ?http://barzilay.org/ ? ? ? ? ? ? ? ? ? Maze is Life! > _________________________________________________ > ?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 eli at barzilay.org Mon Oct 5 17:57:25 2009 From: eli at barzilay.org (Eli Barzilay) Date: Mon Oct 5 17:57:49 2009 Subject: [plt-scheme] Compression dictionary In-Reply-To: References: <19146.7601.102032.609421@winooski.ccs.neu.edu> <4072c51f0910051003g759fe2c6j23562a0d6b651d6b@mail.gmail.com> <19146.10321.820316.63386@winooski.ccs.neu.edu> <4072c51f0910051042h5e6a8bf6s908c44ec7541ad48@mail.gmail.com> <19146.12717.613528.771553@winooski.ccs.neu.edu> <4072c51f0910051327h73994a4xd74b5f66f9658a31@mail.gmail.com> <19146.22900.599681.982152@winooski.ccs.neu.edu> Message-ID: <19146.27589.516684.50074@winooski.ccs.neu.edu> On Oct 5, Jay McCarthy wrote: > One thought... > > The JS can make an AJAX request for the search file and the web server > can serve it gzipped, because most browsers support on the fly > decompression. Then that file would be received by JS in plain-text > and it could parse/eval it. I suspect that this will work poorly when the ajax request is done to a `file://' url... but in any case the major time issue is evaluating and getting all that data into the runtime. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From ebellani at gmail.com Mon Oct 5 18:02:31 2009 From: ebellani at gmail.com (ebellani@gmail.com) Date: Mon Oct 5 18:03:19 2009 Subject: [plt-scheme] Music and worlds In-Reply-To: <891bd3390910051133s4f9ad66end6339b6ef9e3ea6a@mail.gmail.com> Message-ID: Have you tried etoys? Their sound support is very good IMHO. -- Eduardo Bellani www.cnxs.com.br Someone once called me "just a dreamer" That offended me, the "just" part. Being a dreamer is hard work. It really gets hard when you start believing in your dreams. --Doug Engelbart -------------- 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/20091005/d55cff6b/signature-0001.pgp From sk at cs.brown.edu Mon Oct 5 19:49:06 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Mon Oct 5 19:49:46 2009 Subject: [plt-scheme] Music and worlds In-Reply-To: <891bd3390910051133s4f9ad66end6339b6ef9e3ea6a@mail.gmail.com> References: <891bd3390910050427p3ea635bfy9b0aa920ebf47495@mail.gmail.com> <39EADD3A-E80B-471B-BCB5-207BD677F673@ccs.neu.edu> <891bd3390910051133s4f9ad66end6339b6ef9e3ea6a@mail.gmail.com> Message-ID: Yaron -- Emmanuel, Danny Yoo, and I have been working for several months on something Scratch-related to bridge that gulf. Nothing to show the broader world yet... Shriram From yminsky at gmail.com Mon Oct 5 20:00:28 2009 From: yminsky at gmail.com (Yaron Minsky) Date: Mon Oct 5 20:00:50 2009 Subject: [plt-scheme] Music and worlds In-Reply-To: References: <891bd3390910050427p3ea635bfy9b0aa920ebf47495@mail.gmail.com> <39EADD3A-E80B-471B-BCB5-207BD677F673@ccs.neu.edu> <891bd3390910051133s4f9ad66end6339b6ef9e3ea6a@mail.gmail.com> Message-ID: <891bd3390910051700k1e05537akbad11696be0a01dd@mail.gmail.com> Sounds great. I've wanted a functional scratch from day one. Or at least, a scratch where one could define functions... y On Mon, Oct 5, 2009 at 7:49 PM, Shriram Krishnamurthi wrote: > Yaron -- Emmanuel, Danny Yoo, and I have been working for several > months on something Scratch-related to bridge that gulf. Nothing to > show the broader world yet... > > Shriram > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091005/c5474990/attachment.htm From thomas.gordon at fokus.fraunhofer.de Tue Oct 6 04:34:17 2009 From: thomas.gordon at fokus.fraunhofer.de (Tom Gordon) Date: Tue Oct 6 04:45:20 2009 Subject: [plt-scheme] Automatic recompilation of source files with new versions of PLT Scheme Message-ID: <0EF32420-4D89-47F0-A8DA-A2901B8A919C@fokus.fraunhofer.de> I was excited by this new feature of PLT Scheme version 4.2.2: > DrScheme now, by default, compiles all of the files that are > loaded when it runs a program and saves the compiled files in the > filesystem. This should lead to faster load times (not faster > runtimes) since it avoids re-compiling files whose dependencies > have not changed. But when I tried to run one of my programs in DrScheme I get this error message: > ... search_sls.zo:1:0: read (compiled): code compiled for version > 4.2.1, not 4.2.2 I've received similar messages in the past, whenever I've switched to a new version of PLT Scheme. In the past I've fixed this manually, by deleting all the *.zo object files in the "compiled" folders that PLT Scheme creates. I was hoping that the new version would do this automatically. Is there some tool for updating the object files that I've overlooked? On a related issue: I'm not really happy with PLT Scheme storing its object files in folders it creates within my source tree, since the code is portable R6RS Scheme and designed to be used with any R6RS implementation. Is there some option for having the object files stored in some place outside of the source tree? -Tom Gordon From keydana at gmx.de Tue Oct 6 07:38:46 2009 From: keydana at gmx.de (Sigrid) Date: Tue Oct 6 07:39:08 2009 Subject: [plt-scheme] Re: problem with backtracking order of nested ambs In-Reply-To: <4ACA5F0A.70401@cs.utah.edu> References: <9B48BAD4-8C2D-4209-A07F-6B0CC8F866FC@gmx.de> <4ACA5F0A.70401@cs.utah.edu> Message-ID: <3e71c469-637d-4d92-b920-8726823665f0@z34g2000vbl.googlegroups.com> Hi Chongkai, this would be great if it worked also in case the first amb fails... but it seems it doesn't: (let ((x (amb 3 5 7))) (assert (even? x)) (amb x 77)) Amb tree exhausted It seems it justs hangs after the first amb and never tries the second - which is exactly what I have to avoid... On 5 Okt., 23:03, Chongkai Zhu wrote: > Maybe you want something like: > > (let ((x (amb 3 5 4))) > ? ?(assert (even? x)) > ? ?(amb x 77)) > > Chongkai > > > > keyd...@gmx.de wrote: > > Hi all, > > > I have a problem with the backtracking order of nested ambs which > > makes that I cannot get the result I need. I've made up a dummy example: > > > ?(let ((x (amb 3 5 4))) > > ? ?(let ((result (amb (begin (assert (even? x)) x) 77))) > > ? ? ?result)) > > > I would need amb to first try all of '(3 5 4) and only after that, > > take 77 as last possible way out. > > > In practice, I want to generate a list with amb, then check if every > > item is unique, if not, try all other possible ways to compose the > > list - and only there's no way to get it unique, > > decide that "ok, nearly unique is fine too", such that 2 elements may > > be the same, so try and assert that... and so on, until I can be sure > > that at least the program will not fail, > > not producing any results at all. > > > I'd be glad for any hints what I'm doing wrong here... > > > Thanks a lot in advance, > > Sigrid > > > _________________________________________________ > > ?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 keydana at gmx.de Tue Oct 6 08:13:20 2009 From: keydana at gmx.de (Sigrid) Date: Tue Oct 6 08:13:42 2009 Subject: [plt-scheme] Re: problem with backtracking order of nested ambs In-Reply-To: References: <9B48BAD4-8C2D-4209-A07F-6B0CC8F866FC@gmx.de> Message-ID: Hi Joe, thanks for your answer! Could you perhaps detail a bit more what you mean by reversing the nesting of the ambs, so we could see if this would work here? To give a more realistic example code, what I really need to do is something like this: (let ((list (generate-list-using-amb-for-each-item))) (let ((result (amb (let ((correct-list list)) (begin (check- correct correct-list) correct-list)) (let ((nearly-correct-list list)) (begin (check- nearly-correct nearly-correct-list) (make-acceptable nearly-correct- list))) (let ((still-somehow-correct-list list)) (begin (check-still-somehow-correct still-somehow-correct-list) (make- acceptable still-somehow-correct-list)))))) result)) The first list, produced by (generate-list-using-amb-for-each-item), is totally unusable - it normally produces lots of identical items. So I'm totally dependent on the first assert (in check-correct) to run, and normally, when all goes well, I keep the result and that's it. But if this assert fails, I have to make sure the program itself doesn't fail and stop, so I have to handle it somehow. It's not even so important what I do, the important thing is that I don't get stuck in the blind alley of backtracking... With one exception: The first list I can really never accept, so I cannot just revert to that one. (Basically I'm just using amb like in the puzzles from SICP, choosing whatever values with amb and then "getting it all right" with assert. Only I have to find a workaround when the assert fails, as in my case the puzzle needs to have some solution...) Thanks a lot again for any further suggestions if possible :-) Sigrid On 5 Okt., 22:59, Joe Marshall wrote: > I believe that the backtracking order is to the most recent (dynamically) AMB. > In your example, you could reverse the nesting of the AMBs, but I imagine > that would be much trickier in the problem you describe. > > The propagator work that Sussman and Radul were doing was exploring how > to get AMB to backtrack to the nearest one that could potentially satisfy > the required dependency. ?It involves a serious change to the way the compiler > compiles the code, though. > > > > On Mon, Oct 5, 2009 at 12:58 PM, keyd...@gmx.de wrote: > > Hi all, > > > I have a problem with the backtracking order of nested ambs which makes that > > I cannot get the result I need. I've made up a dummy example: > > > ?(let ((x (amb 3 5 4))) > > ? (let ((result (amb (begin (assert (even? x)) x) 77))) > > ? ? result)) > > > I would need amb to first try all of '(3 5 4) and only after that, take 77 > > as last possible way out. > > > In practice, I want to generate a list with amb, then check if every item is > > unique, if not, try all other possible ways to compose the list - and only > > there's no way to get it unique, > > decide that "ok, nearly unique is fine too", such that 2 elements may be the > > same, so try and assert that... and so on, until I can be sure that at least > > the program will not fail, > > not producing any results at all. > > > I'd be glad for any hints what I'm doing wrong here... > > > Thanks a lot in advance, > > Sigrid > > > _________________________________________________ > > ?For list-related administrative tasks: > > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > -- > ~jrm > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme From robby at eecs.northwestern.edu Tue Oct 6 08:48:56 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Tue Oct 6 08:49:17 2009 Subject: [plt-scheme] Automatic recompilation of source files with new versions of PLT Scheme In-Reply-To: <0EF32420-4D89-47F0-A8DA-A2901B8A919C@fokus.fraunhofer.de> References: <0EF32420-4D89-47F0-A8DA-A2901B8A919C@fokus.fraunhofer.de> Message-ID: <932b2f1f0910060548qbafabc4jd3af85cd12b3d2c2@mail.gmail.com> On Tue, Oct 6, 2009 at 3:34 AM, Tom Gordon wrote: > I was excited by this new feature of PLT Scheme version 4.2.2: > >> ?DrScheme now, by default, compiles all of the files that are >> ?loaded when it runs a program and saves the compiled files in the >> ?filesystem. ?This should lead to faster load times (not faster >> ?runtimes) since it avoids re-compiling files whose dependencies >> ?have not changed. > > But when I tried to run one of my programs in DrScheme I get this error > message: > >> ... search_sls.zo:1:0: read (compiled): code compiled for version 4.2.1, >> not 4.2.2 > > I've received similar messages in the past, whenever I've switched to a new > version of PLT Scheme. ?In the past I've fixed this manually, by deleting > all the *.zo object files in the "compiled" folders that PLT Scheme creates. > ? I was hoping that the new version would do this automatically. ? Is there > some tool for updating the object files that I've overlooked? This should happen automatically for the .zo files that DrScheme itself manages. Just to double check: you got this message while hitting "run" from inside DrScheme and the language was the module language (and automatic compilation was not disabled)? > On a related issue: ?I'm not really happy with PLT Scheme storing its object > files in folders it creates within my source tree, since the code is > portable R6RS Scheme and designed to be used with any R6RS implementation. > ?Is there some option for having the object files stored in some place > outside of the source tree? At the moment, that's not possible, I'm sorry to say. Robby From noelwelsh at gmail.com Tue Oct 6 09:09:24 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Tue Oct 6 09:09:45 2009 Subject: [plt-scheme] warnings trying to require snooze in PLT-Scheme v4.2.2 In-Reply-To: <173403.92808.qm@web62507.mail.re1.yahoo.com> References: <173403.92808.qm@web62507.mail.re1.yahoo.com> Message-ID: Hi Scott, These warnings can all be safely ignored. They'll go away when the next version of Snooze is released. Right now we haven't had time to make a release so this junk remains. HTH, N. On Mon, Oct 5, 2009 at 9:37 PM, Scott Hickey wrote: > require: unknown module: 'program > setup-plt: error: during Building docs for /Users/jshickey/Library/PLT Scheme/planet/300/4.2.2/cache/cce/scheme.plt/4/1/scribblings/main.scrbl > setup-plt: ? require: unknown module: 'program ... From chust at web.de Tue Oct 6 09:47:25 2009 From: chust at web.de (Thomas Chust) Date: Tue Oct 6 09:47:45 2009 Subject: [plt-scheme] problem with backtracking order of nested ambs In-Reply-To: <9B48BAD4-8C2D-4209-A07F-6B0CC8F866FC@gmx.de> References: <9B48BAD4-8C2D-4209-A07F-6B0CC8F866FC@gmx.de> Message-ID: <1c1a33bc0910060647x746e5e2epcf12a18e9e7905dd@mail.gmail.com> 2009/10/5 keydana@gmx.de : > [...] > (let ((x (amb 3 5 4))) > (let ((result (amb (begin (assert (even? x)) x) 77))) > result)) > > I would need amb to first try all of '(3 5 4) and only after that, take 77 > as last possible way out. > [...] Hello Sigrid, since the evaluation order of amb itself cannot be modified easily, you have to reverse the dynamic nesting order of the two ambivalent expressions. This can for example be done by "physically" moving the inner out outward: (let ((result (amb (let ((x (amb 3 5 4))) (assert (even? x)) x) 77))) result) or by wrapping the outer one in a procedure: (let ((x (lambda () (amb 3 5 4)))) (let ((result (amb (let ((x (x))) (assert (even? x)) x) 77))) result)) Ciao, Thomas -- All these theories, diverse as they are, have two things in common: They explain the observed facts, and they are completely and utterly wrong. -- Terry Pratchett, "The Light Fantastic" From fre at informatik.uni-kiel.de Tue Oct 6 10:16:16 2009 From: fre at informatik.uni-kiel.de (Fabian Reck) Date: Tue Oct 6 10:24:35 2009 Subject: [plt-scheme] Problems compiling PLT scheme on Solaris Message-ID: <4ACB5130.40402@informatik.uni-kiel.de> Hi, we encounter problems when we try to compile the latest version of PLT scheme on Sun Solaris 5.10 with gcc 4.1.2. The problem is, that in the file src/mzscheme/src/numcomp.c two symbols are referenced: scheme_can_inline_fp_comp and scheme_can_inline_fp_op Both of them are defined in src/mzscheme/src/jit.c but since the macro MZ_USE_JIT is not defined, the compiler ignores them. In order to solve a problem with large file support, we had to pass the options "-m64 -Xlinker -64" to the compiler. Perhaps this is related to our problem. In spite of that we just did the standard compilation procedure. Is this a known problem? Is there a workaround? Thanks Fabian From mflatt at cs.utah.edu Tue Oct 6 10:56:30 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Tue Oct 6 10:56:49 2009 Subject: [plt-scheme] Problems compiling PLT scheme on Solaris In-Reply-To: <4ACB5130.40402@informatik.uni-kiel.de> References: <4ACB5130.40402@informatik.uni-kiel.de> Message-ID: <20091006145630.E12B06500BE@mail-svr1.cs.utah.edu> You're running Solaris on Sparc, right? This wasn't a known problem. We recently stopped creating our own builds for Sparc, and I guess that was the one platform we used to build where the JIT is not supported. So, we overlooked this mismatch in the implementation. The problem is now fixed for the next version. In the current version, you can work around it by adding definitions of scheme_can_inline_fp_comp() and scheme_can_inline_fp_op() that just return 0. (Add them to any C file in "plt/src/mzscheme/src", such as "numcomp.c".) Thanks for the report! At Tue, 06 Oct 2009 16:16:16 +0200, Fabian Reck wrote: > Hi, > > we encounter problems when we try to compile the latest version of PLT > scheme on Sun Solaris 5.10 with gcc 4.1.2. The problem is, that in the > file src/mzscheme/src/numcomp.c two symbols are referenced: > > scheme_can_inline_fp_comp and scheme_can_inline_fp_op > > Both of them are defined in src/mzscheme/src/jit.c but since the macro > MZ_USE_JIT is not defined, the compiler ignores them. > > In order to solve a problem with large file support, we had to pass the > options "-m64 -Xlinker -64" to the compiler. Perhaps this is related to > our problem. In spite of that we just did the standard compilation > procedure. > > Is this a known problem? Is there a workaround? > > Thanks > > Fabian From thomas.gordon at fokus.fraunhofer.de Tue Oct 6 11:06:45 2009 From: thomas.gordon at fokus.fraunhofer.de (Tom Gordon) Date: Tue Oct 6 11:07:07 2009 Subject: [plt-scheme] Automatic recompilation of source files with new versions of PLT Scheme In-Reply-To: <932b2f1f0910060548qbafabc4jd3af85cd12b3d2c2@mail.gmail.com> References: <0EF32420-4D89-47F0-A8DA-A2901B8A919C@fokus.fraunhofer.de> <932b2f1f0910060548qbafabc4jd3af85cd12b3d2c2@mail.gmail.com> Message-ID: <0FFE16BD-7BA7-4075-90DE-58F474C0D2B6@fokus.fraunhofer.de> > > This should happen automatically for the .zo files that DrScheme > itself manages. Just to double check: you got this message while > hitting "run" from inside DrScheme and the language was the module > language (and automatic compilation was not disabled)? Yes, exactly. Maybe I should tell you that the sources were not compiled by DrScheme, but by the plt-r6rs script, in case that makes a difference. Thanks for trying to track this problem down. -Tom Gordon From fre at informatik.uni-kiel.de Tue Oct 6 11:38:59 2009 From: fre at informatik.uni-kiel.de (Fabian Reck) Date: Tue Oct 6 11:39:57 2009 Subject: [plt-scheme] Problems compiling PLT scheme on Solaris In-Reply-To: <20091006145630.E12B06500BE@mail-svr1.cs.utah.edu> References: <4ACB5130.40402@informatik.uni-kiel.de> <20091006145630.E12B06500BE@mail-svr1.cs.utah.edu> Message-ID: <4ACB6493.8060805@informatik.uni-kiel.de> Great, thank you! That solved our problem. Unfortunately we just ran into another one: While compiling a segmentation fault occures. Since we don't have any clue about why this happens, I paste the compiler output below. Thanks cd wxs; make ccsources make[4]: Entering directory `/home/jac/plt-4.2.2/src/build/mred/wxs' if [ "" = '' ] ; then touch ../../../mred/wxs/wxs_bmap.cxx ; else ../../../mred/wxs/../../mzscheme/utils/xctocc -cxx ../../../mred/wxs/wxs_bmap.xc ; fi if [ "" = '' ] ; then touch ../../../mred/wxs/wxs_butn.cxx ; else ../../../mred/wxs/../../mzscheme/utils/xctocc -cxx ../../../mred/wxs/wxs_butn.xc ; fi if [ "" = '' ] ; then touch ../../../mred/wxs/wxs_chce.cxx ; else ../../../mred/wxs/../../mzscheme/utils/xctocc -cxx ../../../mred/wxs/wxs_chce.xc ; fi if [ "" = '' ] ; then touch ../../../mred/wxs/wxs_ckbx.cxx ; else ../../../mred/wxs/../../mzscheme/utils/xctocc -cxx ../../../mred/wxs/wxs_ckbx.xc ; fi if [ "" = '' ] ; then touch ../../../mred/wxs/wxs_cnvs.cxx ; else ../../../mred/wxs/../../mzscheme/utils/xctocc -cxx ../../../mred/wxs/wxs_cnvs.xc ; fi if [ "" = '' ] ; then touch ../../../mred/wxs/wxs_dc.cxx ; else ../../../mred/wxs/../../mzscheme/utils/xctocc -cxx ../../../mred/wxs/wxs_dc.xc ; fi if [ "" = '' ] ; then touch ../../../mred/wxs/wxs_evnt.cxx ; else ../../../mred/wxs/../../mzscheme/utils/xctocc -cxx ../../../mred/wxs/wxs_evnt.xc ; fi if [ "" = '' ] ; then touch ../../../mred/wxs/wxs_fram.cxx ; else ../../../mred/wxs/../../mzscheme/utils/xctocc -cxx ../../../mred/wxs/wxs_fram.xc ; fi if [ "" = '' ] ; then touch ../../../mred/wxs/wxs_gage.cxx ; else ../../../mred/wxs/../../mzscheme/utils/xctocc -cxx ../../../mred/wxs/wxs_gage.xc ; fi if [ "" = '' ] ; then touch ../../../mred/wxs/wxs_gdi.cxx ; else ../../../mred/wxs/../../mzscheme/utils/xctocc -cxx ../../../mred/wxs/wxs_gdi.xc ; fi if [ "" = '' ] ; then touch ../../../mred/wxs/wxs_glob.cxx ; else ../../../mred/wxs/../../mzscheme/utils/xctocc -cxx ../../../mred/wxs/wxs_glob.xc ; fi if [ "" = '' ] ; then touch ../../../mred/wxs/wxs_item.cxx ; else ../../../mred/wxs/../../mzscheme/utils/xctocc -cxx ../../../mred/wxs/wxs_item.xc ; fi if [ "" = '' ] ; then touch ../../../mred/wxs/wxs_lbox.cxx ; else ../../../mred/wxs/../../mzscheme/utils/xctocc -cxx ../../../mred/wxs/wxs_lbox.xc ; fi if [ "" = '' ] ; then touch ../../../mred/wxs/wxs_menu.cxx ; else ../../../mred/wxs/../../mzscheme/utils/xctocc -cxx ../../../mred/wxs/wxs_menu.xc ; fi if [ "" = '' ] ; then touch ../../../mred/wxs/wxs_misc.cxx ; else ../../../mred/wxs/../../mzscheme/utils/xctocc -cxx ../../../mred/wxs/wxs_misc.xc ; fi if [ "" = '' ] ; then touch ../../../mred/wxs/wxs_obj.cxx ; else ../../../mred/wxs/../../mzscheme/utils/xctocc -cxx ../../../mred/wxs/wxs_obj.xc ; fi if [ "" = '' ] ; then touch ../../../mred/wxs/wxs_panl.cxx ; else ../../../mred/wxs/../../mzscheme/utils/xctocc -cxx ../../../mred/wxs/wxs_panl.xc ; fi if [ "" = '' ] ; then touch ../../../mred/wxs/wxs_rado.cxx ; else ../../../mred/wxs/../../mzscheme/utils/xctocc -cxx ../../../mred/wxs/wxs_rado.xc ; fi if [ "" = '' ] ; then touch ../../../mred/wxs/wxs_slid.cxx ; else ../../../mred/wxs/../../mzscheme/utils/xctocc -cxx ../../../mred/wxs/wxs_slid.xc ; fi if [ "" = '' ] ; then touch ../../../mred/wxs/wxs_tabc.cxx ; else ../../../mred/wxs/../../mzscheme/utils/xctocc -cxx ../../../mred/wxs/wxs_tabc.xc ; fi if [ "" = '' ] ; then touch ../../../mred/wxs/wxs_win.cxx ; else ../../../mred/wxs/../../mzscheme/utils/xctocc -cxx ../../../mred/wxs/wxs_win.xc ; fi make[4]: Leaving directory `/home/jac/plt-4.2.2/src/build/mred/wxs' cd gc2; make gen-deps make[4]: Entering directory `/home/jac/plt-4.2.2/src/build/mred/gc2' ../../mzscheme/mzscheme3m -cqu "../../../mred/gc2/gen-deps.ss" Seg fault (internal error during gc) at ffffffff7e20c000 Abort make[4]: *** [gen-deps] Error 134 make[4]: Leaving directory `/home/jac/plt-4.2.2/src/build/mred/gc2' make[3]: *** [3m] Error 2 make[3]: Leaving directory `/home/jac/plt-4.2.2/src/build/mred' make[2]: *** [mred-3m] Error 2 make[2]: Leaving directory `/home/jac/plt-4.2.2/src/build' make[1]: *** [3m] Error 2 make[1]: Leaving directory `/home/jac/plt-4.2.2/src/build' make: *** [all] Error 2 Matthew Flatt wrote: > You're running Solaris on Sparc, right? > > This wasn't a known problem. We recently stopped creating our own > builds for Sparc, and I guess that was the one platform we used to > build where the JIT is not supported. So, we overlooked this mismatch > in the implementation. > > The problem is now fixed for the next version. > > In the current version, you can work around it by adding definitions of > scheme_can_inline_fp_comp() and scheme_can_inline_fp_op() that just > return 0. (Add them to any C file in "plt/src/mzscheme/src", such as > "numcomp.c".) > > Thanks for the report! > > At Tue, 06 Oct 2009 16:16:16 +0200, Fabian Reck wrote: > >> Hi, >> >> we encounter problems when we try to compile the latest version of PLT >> scheme on Sun Solaris 5.10 with gcc 4.1.2. The problem is, that in the >> file src/mzscheme/src/numcomp.c two symbols are referenced: >> >> scheme_can_inline_fp_comp and scheme_can_inline_fp_op >> >> Both of them are defined in src/mzscheme/src/jit.c but since the macro >> MZ_USE_JIT is not defined, the compiler ignores them. >> >> In order to solve a problem with large file support, we had to pass the >> options "-m64 -Xlinker -64" to the compiler. Perhaps this is related to >> our problem. In spite of that we just did the standard compilation >> procedure. >> >> Is this a known problem? Is there a workaround? >> >> Thanks >> >> Fabian >> From nothere44 at gmail.com Tue Oct 6 12:59:50 2009 From: nothere44 at gmail.com (N N) Date: Tue Oct 6 13:00:12 2009 Subject: [plt-scheme] Has anyone written an automated web browser? Message-ID: <7478a1340910060959u36ff8573r844ba004f415635a@mail.gmail.com> I suspect the answer is no, given what I've seen (as I understand it Delirium, for instance, only runs against the Scheme web server). We would like something that allows us to browse the web controlled by coded logic instead of a human. If it already exists, great, if not, I guess we'll have to write it. ~NoT -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091006/8b77db74/attachment.htm From troelskn at gmail.com Tue Oct 6 13:15:05 2009 From: troelskn at gmail.com (troels knak-nielsen) Date: Tue Oct 6 13:15:27 2009 Subject: [plt-scheme] Has anyone written an automated web browser? In-Reply-To: <7478a1340910060959u36ff8573r844ba004f415635a@mail.gmail.com> References: <7478a1340910060959u36ff8573r844ba004f415635a@mail.gmail.com> Message-ID: <98b8086f0910061015q3dedb556wa96c8840e44d4718@mail.gmail.com> On Tue, Oct 6, 2009 at 6:59 PM, N N wrote: > I suspect the answer is no, given what I've seen (as I understand it > Delirium, for instance, only runs against the Scheme web server). We would > like something that allows us to browse the web controlled by coded logic > instead of a human. If it already exists, great, if not, I guess we'll have > to write it. This was discussed in a recent thread: http://list.cs.brown.edu/pipermail/plt-scheme/2009-July/034642.html -- troels From troelskn at gmail.com Tue Oct 6 13:18:43 2009 From: troelskn at gmail.com (troels knak-nielsen) Date: Tue Oct 6 13:19:31 2009 Subject: [plt-scheme] Has anyone written an automated web browser? In-Reply-To: <98b8086f0910061015q3dedb556wa96c8840e44d4718@mail.gmail.com> References: <7478a1340910060959u36ff8573r844ba004f415635a@mail.gmail.com> <98b8086f0910061015q3dedb556wa96c8840e44d4718@mail.gmail.com> Message-ID: <98b8086f0910061018s14cdc135t96de63564cd86d14@mail.gmail.com> On Tue, Oct 6, 2009 at 7:15 PM, troels knak-nielsen wrote: > On Tue, Oct 6, 2009 at 6:59 PM, N N wrote: >> I suspect the answer is no, given what I've seen (as I understand it >> Delirium, for instance, only runs against the Scheme web server). ?We would >> like something that allows us to browse the web controlled by coded logic >> instead of a human. ?If it already exists, great, if not, I guess we'll have >> to write it. > > This was discussed in a recent thread: > > http://list.cs.brown.edu/pipermail/plt-scheme/2009-July/034642.html > And here: http://list.cs.brown.edu/pipermail/plt-scheme/2009-July/034755.html -- troels From robby at eecs.northwestern.edu Tue Oct 6 14:59:33 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Tue Oct 6 15:00:06 2009 Subject: [plt-scheme] Automatic recompilation of source files with new versions of PLT Scheme In-Reply-To: <0FFE16BD-7BA7-4075-90DE-58F474C0D2B6@fokus.fraunhofer.de> References: <0EF32420-4D89-47F0-A8DA-A2901B8A919C@fokus.fraunhofer.de> <932b2f1f0910060548qbafabc4jd3af85cd12b3d2c2@mail.gmail.com> <0FFE16BD-7BA7-4075-90DE-58F474C0D2B6@fokus.fraunhofer.de> Message-ID: <932b2f1f0910061159s1d3a1be1la681d4f82a8c5e29@mail.gmail.com> On Tue, Oct 6, 2009 at 10:06 AM, Tom Gordon wrote: >> >> This should happen automatically for the .zo files that DrScheme >> itself manages. Just to double check: you got this message while >> hitting "run" from inside DrScheme and the language was the module >> language (and automatic compilation was not disabled)? > > Yes, exactly. > > Maybe I should tell you that the sources were not compiled by DrScheme, but > by the plt-r6rs script, in case that makes a difference. I'm not quite seeing how this could happen (altho I'm not at all surprised that you are making it happen). If you don't mind, could you provide some more detail as to how you make this happen and perhaps even some sample program to go along with the steps? If not, I'll try myself too at some point. tia, Robby From keydana at gmx.de Tue Oct 6 16:02:09 2009 From: keydana at gmx.de (keydana@gmx.de) Date: Tue Oct 6 16:02:32 2009 Subject: [plt-scheme] problem with backtracking order of nested ambs In-Reply-To: <1c1a33bc0910060647x746e5e2epcf12a18e9e7905dd@mail.gmail.com> References: <9B48BAD4-8C2D-4209-A07F-6B0CC8F866FC@gmx.de> <1c1a33bc0910060647x746e5e2epcf12a18e9e7905dd@mail.gmail.com> Message-ID: Hi Thomas, thanks very much - this is it! I'll use your second version with the thunk, and from there call the specific selection function - and as I have no performance considerations here, I can safely call the procedure several times from the "top-level" amb :-) Thanks again for the quick help (I'm really in quite a pressure to get this working), Sigrid Am 06.10.2009 um 15:47 schrieb Thomas Chust: > 2009/10/5 keydana@gmx.de : >> [...] >> (let ((x (amb 3 5 4))) >> (let ((result (amb (begin (assert (even? x)) x) 77))) >> result)) >> >> I would need amb to first try all of '(3 5 4) and only after that, >> take 77 >> as last possible way out. >> [...] > > Hello Sigrid, > > since the evaluation order of amb itself cannot be modified easily, > you have to reverse the dynamic nesting order of the two ambivalent > expressions. This can for example be done by "physically" moving the > inner out outward: > > (let ((result > (amb > (let ((x (amb 3 5 4))) > (assert (even? x)) > x) > 77))) > result) > > or by wrapping the outer one in a procedure: > > (let ((x (lambda () (amb 3 5 4)))) > (let ((result (amb (let ((x (x))) (assert (even? x)) x) 77))) > result)) > > Ciao, > Thomas > > > -- > All these theories, diverse as they are, have two things in common: > They > explain the observed facts, and they are completely and utterly wrong. > -- Terry Pratchett, "The Light > Fantastic" From robby at eecs.northwestern.edu Tue Oct 6 17:02:44 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Tue Oct 6 17:03:03 2009 Subject: [plt-scheme] Automatic recompilation of source files with new versions of PLT Scheme In-Reply-To: References: <0EF32420-4D89-47F0-A8DA-A2901B8A919C@fokus.fraunhofer.de> <932b2f1f0910060548qbafabc4jd3af85cd12b3d2c2@mail.gmail.com> <0FFE16BD-7BA7-4075-90DE-58F474C0D2B6@fokus.fraunhofer.de> <932b2f1f0910061159s1d3a1be1la681d4f82a8c5e29@mail.gmail.com> Message-ID: <932b2f1f0910061402p47f8d809q43a3f84aa69c7148@mail.gmail.com> On Tue, Oct 6, 2009 at 2:58 PM, Gordon, Thomas wrote: > I usually add the Carneades sources to the PLT collects folder with a > symbolic link (ln -s ...) from the Unix shell. Ah, that explains it. DrScheme avoids compilation of files in the collections tree, as some installations don't have write access there and the .zo files there are generally assumed to be up to date (by running setup-plt). Altho such moves would have been more normal in the past, nowadays we try to discourage that (well, the positive way to put that is we try to make things work with relative paths and the like so that people don't feel the need to do that). Is there some reason in this case why you need to that? Robby From toddobryan at gmail.com Tue Oct 6 20:55:38 2009 From: toddobryan at gmail.com (Todd O'Bryan) Date: Tue Oct 6 20:55:58 2009 Subject: [plt-scheme] contracts in teaching languages Message-ID: <904774730910061755w26532a74ld0d883845b4ffdd1@mail.gmail.com> I want to try having students use real, honest-to-goodness contracts, just to see how it goes. I'm just about to cover booleans and predicates, so I think it's a good time to give it a go. I think I'm also ready to try writing a macro, so I want to do something like: (define/c (foo arg1 arg2 arg3) (pred1? pred2? pred3? -> ret-pred?) body) and have that convert to: (define/contract (foo arg1 arg2 arg3) (-> pred1? pred2? pred3? ret-pred?) ; equivalently (pred1? pred2? pred3? . -> . ret-pred?) body) One concern is that the reader in BSL gets upset by functions in argument positions, but I know there's a way around that, because the universe teachpack lets you specify handlers: (on-tick mod-world), etc. So, can somebody explain how I'd let my re-written contract fly under the BSL parser's radar? Obviously, if I get this working, I'll let people know how well--or badly--it works. Todd From toddobryan at gmail.com Tue Oct 6 21:07:02 2009 From: toddobryan at gmail.com (Todd O'Bryan) Date: Tue Oct 6 21:07:26 2009 Subject: [plt-scheme] possible typo in reference? Message-ID: <904774730910061807k1156d14p126bd356acfebb5@mail.gmail.com> I'm reading through the Evaluation Model of the Reference and think I found a typo... ---- Section 1.1.2 Tail Position For example, the (+ 1 1) expression is not in tail position with respect to (- 4 (+ 1 1)). To illustrate, we use the notation C[expr] to mean the expression that is produced by substituting expr in place of [] in the continuation C: C[(- 4 (+ 1 1))] ? C[(- 4 2)] In this case, the continuation for reducing (+ 1 1) is C[(+ 4 [])], not just C. ---- Should the last sentence say, "In this case, the continuation for reducing (+ 1 1) is C[(+ 4 [])], not just C[(+ 1 1)]." or am I still not understanding this? Todd From matthias at ccs.neu.edu Tue Oct 6 21:31:36 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Tue Oct 6 21:32:15 2009 Subject: [plt-scheme] contracts in teaching languages In-Reply-To: <904774730910061755w26532a74ld0d883845b4ffdd1@mail.gmail.com> References: <904774730910061755w26532a74ld0d883845b4ffdd1@mail.gmail.com> Message-ID: Just read 2htdp/universe.ss (Robby has been working on this for a while. This is a seriously non- trivial problem, with a research component. The DeinProgram version of HtDP supports it already, though they use a serious hack and worst, the docs are in German.) On Oct 6, 2009, at 8:55 PM, Todd O'Bryan wrote: > I want to try having students use real, honest-to-goodness contracts, > just to see how it goes. I'm just about to cover booleans and > predicates, so I think it's a good time to give it a go. > > I think I'm also ready to try writing a macro, so I want to do > something like: > > (define/c (foo arg1 arg2 arg3) > (pred1? pred2? pred3? -> ret-pred?) > body) > > and have that convert to: > > (define/contract (foo arg1 arg2 arg3) > (-> pred1? pred2? pred3? ret-pred?) ; equivalently (pred1? pred2? > pred3? . -> . ret-pred?) > body) > > One concern is that the reader in BSL gets upset by functions in > argument positions, but I know there's a way around that, because the > universe teachpack lets you specify handlers: (on-tick mod-world), > etc. > > So, can somebody explain how I'd let my re-written contract fly under > the BSL parser's radar? Obviously, if I get this working, I'll let > people know how well--or badly--it works. > > Todd > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From clements at brinckerhoff.org Tue Oct 6 22:46:40 2009 From: clements at brinckerhoff.org (John Clements) Date: Tue Oct 6 22:47:14 2009 Subject: [plt-scheme] possible typo in reference? In-Reply-To: <904774730910061807k1156d14p126bd356acfebb5@mail.gmail.com> References: <904774730910061807k1156d14p126bd356acfebb5@mail.gmail.com> Message-ID: <4957E792-52B4-4942-9260-110BC0E82BA0@brinckerhoff.org> On Oct 6, 2009, at 6:07 PM, Todd O'Bryan wrote: > I'm reading through the Evaluation Model of the Reference and think I > found a typo... > > ---- > Section 1.1.2 Tail Position > > For example, the (+ 1 1) expression is not in tail position with > respect to (- 4 (+ 1 1)). To illustrate, we use the notation C[expr] > to mean the expression that is produced by substituting expr in place > of [] in the continuation C: > > C[(- 4 (+ 1 1))] ? C[(- 4 2)] > > In this case, the continuation for reducing (+ 1 1) is C[(+ 4 [])], > not just C. > ---- > > Should the last sentence say, "In this case, the continuation for > reducing (+ 1 1) is C[(+ 4 [])], not just C[(+ 1 1)]." or am I still > not understanding this? The text is correct as written (though there seem to be some pluses and minuses changing back and forth). A continuation (or context) here is something with a hole. If you plug something without a hole into the hole (as in C[(+ 1 1)]), then that is no longer a context; it's just a plain old expression. If you plug something with a hole in it into the hole (as in C[(+ 4 [])], you get another context. So C is a context, and C[(+ 4 [])] is a context, but C[(+ 1 1)] is not a context. For my word "context," I'm guessing that you'll want to use "continuation." 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/20091006/f0f5cc85/smime.bin From toddobryan at gmail.com Tue Oct 6 23:16:14 2009 From: toddobryan at gmail.com (Todd O'Bryan) Date: Tue Oct 6 23:16:32 2009 Subject: [plt-scheme] possible typo in reference? In-Reply-To: <4957E792-52B4-4942-9260-110BC0E82BA0@brinckerhoff.org> References: <904774730910061807k1156d14p126bd356acfebb5@mail.gmail.com> <4957E792-52B4-4942-9260-110BC0E82BA0@brinckerhoff.org> Message-ID: <904774730910062016i3b635e1apd479a3a774d24301@mail.gmail.com> OK, I think I get it. The docs could have said C[(- 4 (+ 1 1))] -> C[(- 4 []][(+ 1 1)] and since C[(- 4 [])] is different from C, (+ 1 1) is not in tail position with respect to the original expression. In contrast, in the next example C[(if (zero? 0) (+ 1 1) 3)] -> C[(if #t (+ 1 1) 3)] -> C[(+ 1 1)] the C for the if-statement and the C for the (+ 1 1) are identical, so (+ 1 1) is in tail position with respect to the if-statement. Going back to John's holes, if expr1 can be used to fill the hole in the larger computation that its containing expression expr2 is meant to fill, then expr1 is in tail position with respect to expr2. Which is, I think, just a restatement of the definition without the rigor. Thanks! On Tue, Oct 6, 2009 at 10:46 PM, John Clements wrote: > > On Oct 6, 2009, at 6:07 PM, Todd O'Bryan wrote: > >> I'm reading through the Evaluation Model of the Reference and think I >> found a typo... >> >> ---- >> Section 1.1.2 Tail Position >> >> For example, the (+ 1 1) expression is not in tail position with >> respect to (- 4 (+ 1 1)). To illustrate, we use the notation C[expr] >> to mean the expression that is produced by substituting expr in place >> of [] in the continuation C: >> >> ?C[(- 4 (+ 1 1))] ? C[(- 4 2)] >> >> In this case, the continuation for reducing (+ 1 1) is C[(+ 4 [])], not >> just C. >> ---- >> >> Should the last sentence say, "In this case, the continuation for >> reducing (+ 1 1) is C[(+ 4 [])], not just C[(+ 1 1)]." or am I still >> not understanding this? > > The text is correct as written (though there seem to be some pluses and > minuses changing back and forth). > > A continuation (or context) here is something with a hole. ?If you plug > something without a hole into the hole (as in C[(+ 1 1)]), then that is no > longer a context; it's just a plain old expression. If you plug something > with a hole in it into the hole (as in C[(+ 4 [])], you get another context. > ?So C is a context, and C[(+ 4 [])] is a context, but C[(+ 1 1)] is not a > context. > > For my word "context," I'm guessing that you'll want to use "continuation." > > John > > > > > > From robby at eecs.northwestern.edu Wed Oct 7 02:55:08 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Wed Oct 7 02:55:27 2009 Subject: [plt-scheme] contracts in teaching languages In-Reply-To: References: <904774730910061755w26532a74ld0d883845b4ffdd1@mail.gmail.com> Message-ID: <932b2f1f0910062355r34c62499na81370c03503e2a4@mail.gmail.com> On Tue, Oct 6, 2009 at 8:31 PM, Matthias Felleisen wrote: > (Robby has been working on this for a while. This is a seriously non-trivial > problem, with a research component. The DeinProgram version of HtDP supports > it already, though they use a serious hack and worst, the docs are in > German.) Although I have not really been putting enough energy into it. :( Robby From jpc-ml at zenburn.net Wed Oct 7 04:28:49 2009 From: jpc-ml at zenburn.net (=?UTF-8?B?SmFrdWIgUGlvdHIgQ8WCYXBh?=) Date: Wed Oct 7 04:29:14 2009 Subject: [plt-scheme] Re: [plt-dev] 64-Bit PLT Scheme for Windows/Mac In-Reply-To: <20091006224032.GA80558@duncan.reilly.home> References: <4ACB5259.5050000@cs.utah.edu> <20091006142957.D57AC6500B9@mail-svr1.cs.utah.edu> <3A9017CA-0876-4FD5-8C1D-F936416C5018@brinckerhoff.org> <20091006224032.GA80558@duncan.reilly.home> Message-ID: <4ACC5141.7020003@zenburn.net> On 09-10-07 00:40, Andrew Reilly wrote: > [OT: I've been wondering how to deal with the change myself. I > haven't met a description of how to call out to objective-C > methods from C, yet, only the other way around. Anyone know of > a how-to or tutorial? Or is the only approach to make a cocoa > application that calls back to the C "main" code somehow > (inverting the call graph).] You haven't seen any of these because it is not a problem. Code compiled with an Objective-C compiler can define normal C procedures which use Objective-C features but have normal linkage. Objective-C (contrary to C++) is just some syntax sugar + runtime more than plain C. Alternatively you can use the Objective-C runtime manually and send any messages to any object you want. This is how the (quite new) PLT Scheme Objective-C FFI works. -- regards, Jakub Piotr C?apa From egarrulo at gmail.com Wed Oct 7 04:47:21 2009 From: egarrulo at gmail.com (egarrulo) Date: Wed Oct 7 04:47:44 2009 Subject: [plt-scheme] Has anyone written an automated web browser? In-Reply-To: <7478a1340910060959u36ff8573r844ba004f415635a@mail.gmail.com> References: <7478a1340910060959u36ff8573r844ba004f415635a@mail.gmail.com> Message-ID: <9bd8a08a0910070147h6ef6b3aena1542d42d7a0ded1@mail.gmail.com> 2009/10/6 N N : > I suspect the answer is no, given what I've seen (as I understand it > Delirium, for instance, only runs against the Scheme web server). ?We would > like something that allows us to browse the web controlled by coded logic > instead of a human. ?If it already exists, great, if not, I guess we'll have > to write it. See also: http://seleniumhq.org/projects/ide/ From d.j.gurnell at gmail.com Wed Oct 7 06:29:54 2009 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Wed Oct 7 06:30:19 2009 Subject: [plt-scheme] Has anyone written an automated web browser? In-Reply-To: <7478a1340910060959u36ff8573r844ba004f415635a@mail.gmail.com> References: <7478a1340910060959u36ff8573r844ba004f415635a@mail.gmail.com> Message-ID: On 6 Oct 2009, at 17:59, N N wrote: > I suspect the answer is no, given what I've seen (as I understand it > Delirium, for instance, only runs against the Scheme web server). > We would like something that allows us to browse the web controlled > by coded logic instead of a human. If it already exists, great, if > not, I guess we'll have to write it. > > ~NoT Just a clarification regarding Delirium: Your Delirium test suites have to run on the PLT web server. However, there's nothing except XSS restrictions to prevent you testing any old web application using Delirium. I believe Selenium gets around XSS in one of two ways: 1. deploy Selenium from the same server as the target web app; 2. use a URl rewriting proxy that makes the browser thing the test server and the app server are one and the same. Delirium obviously uses technique #1 by default. Noel and I tried writing a proxy for Delirium but it was more complicated than we anticipated so we gave up in the end. It might be possible to use Selenium's proxy with Delirium, but I haven't looked. In summary, though, Delirium and Selenium are basically the same technology. Delirium just lets you write your tests using Schemeunit. -- Dave From clements at brinckerhoff.org Wed Oct 7 15:25:47 2009 From: clements at brinckerhoff.org (John Clements) Date: Wed Oct 7 15:26:12 2009 Subject: [plt-scheme] Q. about editor<%> internal-locks Message-ID: <4D07C725-5309-4375-8C3A-611FC8FA97D8@brinckerhoff.org> The stepper is triggering sequence-contract violations, and I've tracked it down to a text% that's *internally locked*. My question is this: what's the right way to deal with this? Should I just poll until the text% is no longer internally locked? E.G., something like this? (let loop () (cond [(send status-text locked-for-write?) (fprintf (current-error-port) "waiting to try again.\n") (sleep/yield 0.01) (loop)] [else (send status-text delete 0 (send status-text last- position))])) ... This seems to work, and it never seems to need to yield more than once, but I picked the sleep/yield number out of a hat, and it seems like polling is not the right solution here. Perhaps there's a way to queue a sequence of operations to be performed when the editor is no longer locked? Perhaps these locks are predictable, and there's a way to avoid the write lock in the first place? 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/20091007/c5216d28/smime.bin From robby at eecs.northwestern.edu Wed Oct 7 15:31:22 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Wed Oct 7 15:31:46 2009 Subject: [plt-scheme] Q. about editor<%> internal-locks In-Reply-To: <4D07C725-5309-4375-8C3A-611FC8FA97D8@brinckerhoff.org> References: <4D07C725-5309-4375-8C3A-611FC8FA97D8@brinckerhoff.org> Message-ID: <932b2f1f0910071231m36935cectc86d7c7d13a4b61a@mail.gmail.com> Are you accessing the editor from more than one thread? Robby On Wed, Oct 7, 2009 at 2:25 PM, John Clements wrote: > The stepper is triggering sequence-contract violations, and I've tracked it > down to a text% that's *internally locked*. ?My question is this: what's the > right way to deal with this? Should I just poll until the text% is no longer > internally locked? > > E.G., something like this? > > (let loop () > ? ? ?(cond [(send status-text locked-for-write?) > ? ? ? ? ? ? (fprintf (current-error-port) "waiting to try again.\n") > ? ? ? ? ? ? (sleep/yield 0.01) > ? ? ? ? ? ? (loop)] > ? ? ? ? ? ?[else (send status-text delete 0 (send status-text > last-position))])) > > > ... This seems to work, and it never seems to need to yield more than once, > but I picked the sleep/yield number out of a hat, and it seems like polling > is not the right solution here. Perhaps there's a way to queue a sequence of > operations to be performed when the editor is no longer locked? Perhaps > these locks are predictable, and there's a way to avoid the write lock in > the first place? > > John > > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From clements at brinckerhoff.org Wed Oct 7 15:58:31 2009 From: clements at brinckerhoff.org (John Clements) Date: Wed Oct 7 15:58:57 2009 Subject: [plt-scheme] Q. about editor<%> internal-locks In-Reply-To: <932b2f1f0910071231m36935cectc86d7c7d13a4b61a@mail.gmail.com> References: <4D07C725-5309-4375-8C3A-611FC8FA97D8@brinckerhoff.org> <932b2f1f0910071231m36935cectc86d7c7d13a4b61a@mail.gmail.com> Message-ID: On Oct 7, 2009, at 12:31 PM, Robby Findler wrote: > Are you accessing the editor from more than one thread? No. In particular, the only references to this editor are 1) it's embedded in a canvas which is part of a visible pane, and 2) There's an "update" method that is called by only one thread. Also, in order to verify this, I protected it with a semaphore (which had no effect) and bracketed it with printfs (which confirmed that there were always an equal number of 'enter's and 'exit's before an 'enter'). My guess is therefore that the internal locking is caused by some kind of drawing-to-the-screen-mumble process that I have no control over. 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/20091007/a476de1f/smime.bin From robby at eecs.northwestern.edu Wed Oct 7 16:06:12 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Wed Oct 7 16:06:31 2009 Subject: [plt-scheme] Q. about editor<%> internal-locks In-Reply-To: References: <4D07C725-5309-4375-8C3A-611FC8FA97D8@brinckerhoff.org> <932b2f1f0910071231m36935cectc86d7c7d13a4b61a@mail.gmail.com> Message-ID: <932b2f1f0910071306r749ebe31m40a669488a6c0338@mail.gmail.com> On Wed, Oct 7, 2009 at 2:58 PM, John Clements wrote: > > On Oct 7, 2009, at 12:31 PM, Robby Findler wrote: > >> Are you accessing the editor from more than one thread? > > No. ?In particular, the only references to this editor are > > 1) it's embedded in a canvas which is part of a visible pane, and > 2) There's an "update" method that is called by only one thread. > > Also, in order to verify this, I protected it with a semaphore (which had no > effect) and bracketed it with printfs (which confirmed that there were > always an equal number of 'enter's and 'exit's before an 'enter'). My guess > is therefore that the internal locking is caused by some kind of > drawing-to-the-screen-mumble process that I have no control over. It is possible that there is some refresh being queued and things are locked until that refresh completes. Which is strange, but would be one possible explanation of why sleep/yield polling works. I don't suppose you can make this happen in a small(ish) program so we can see what's going on? Maybe Matthew has some idea or already knows what is going on, tho, so it might be best to wait for him to ring in before spending too much time trying to narrow things down. Sorry I'm not much use after all. Robby From mflatt at cs.utah.edu Wed Oct 7 16:16:52 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Wed Oct 7 16:17:13 2009 Subject: [plt-scheme] Q. about editor<%> internal-locks In-Reply-To: References: <4D07C725-5309-4375-8C3A-611FC8FA97D8@brinckerhoff.org> <932b2f1f0910071231m36935cectc86d7c7d13a4b61a@mail.gmail.com> Message-ID: <20091007201653.345726500C3@mail-svr1.cs.utah.edu> At Wed, 7 Oct 2009 12:58:31 -0700, John Clements wrote: > On Oct 7, 2009, at 12:31 PM, Robby Findler wrote: > > > Are you accessing the editor from more than one thread? > > No. In particular, the only references to this editor are > > 1) it's embedded in a canvas which is part of a visible pane, and > 2) There's an "update" method that is called by only one thread. So the "one thread" in #2 is the same as the canvas's eventspace's handler thread? From ryanc at ccs.neu.edu Wed Oct 7 16:56:05 2009 From: ryanc at ccs.neu.edu (Ryan Culpepper) Date: Wed Oct 7 16:56:31 2009 Subject: [plt-scheme] Q. about editor<%> internal-locks In-Reply-To: <20091007201653.345726500C3@mail-svr1.cs.utah.edu> References: <4D07C725-5309-4375-8C3A-611FC8FA97D8@brinckerhoff.org> <932b2f1f0910071231m36935cectc86d7c7d13a4b61a@mail.gmail.com> <20091007201653.345726500C3@mail-svr1.cs.utah.edu> Message-ID: <136C3984-81FF-4A63-B002-A9059A77A56C@ccs.neu.edu> On Oct 7, 2009, at 4:16 PM, Matthew Flatt wrote: > At Wed, 7 Oct 2009 12:58:31 -0700, John Clements wrote: >> On Oct 7, 2009, at 12:31 PM, Robby Findler wrote: >> >>> Are you accessing the editor from more than one thread? >> >> No. In particular, the only references to this editor are >> >> 1) it's embedded in a canvas which is part of a visible pane, and >> 2) There's an "update" method that is called by only one thread. > > So the "one thread" in #2 is the same as the canvas's eventspace's > handler thread? Does the canvas have its own eventspace, or does it use the frame's eventspace? What's the right way to modify the editor in a thread other than the eventspace handler thread? (Asking because I've seen this error in the macro stepper and never been able to reproduce or diagnose it.) Ryan From mflatt at cs.utah.edu Wed Oct 7 17:06:28 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Wed Oct 7 17:06:53 2009 Subject: [plt-scheme] Q. about editor<%> internal-locks In-Reply-To: <136C3984-81FF-4A63-B002-A9059A77A56C@ccs.neu.edu> References: <4D07C725-5309-4375-8C3A-611FC8FA97D8@brinckerhoff.org> <932b2f1f0910071231m36935cectc86d7c7d13a4b61a@mail.gmail.com> <20091007201653.345726500C3@mail-svr1.cs.utah.edu> <136C3984-81FF-4A63-B002-A9059A77A56C@ccs.neu.edu> Message-ID: <20091007210629.A37B26500AF@mail-svr1.cs.utah.edu> At Wed, 7 Oct 2009 16:56:05 -0400, Ryan Culpepper wrote: > On Oct 7, 2009, at 4:16 PM, Matthew Flatt wrote: > > > At Wed, 7 Oct 2009 12:58:31 -0700, John Clements wrote: > >> On Oct 7, 2009, at 12:31 PM, Robby Findler wrote: > >> > >>> Are you accessing the editor from more than one thread? > >> > >> No. In particular, the only references to this editor are > >> > >> 1) it's embedded in a canvas which is part of a visible pane, and > >> 2) There's an "update" method that is called by only one thread. > > > > So the "one thread" in #2 is the same as the canvas's eventspace's > > handler thread? > > Does the canvas have its own eventspace, or does it use the frame's > eventspace? It's always the frame's eventspace. > What's the right way to modify the editor in a thread other than the > eventspace handler thread? Wrap the modifications with `begin-edit-sequence' and `end-edit-sequence'. An edit sequence takes a lock that is also used by the repaint method of an editor. (I think that might be the answer for John, but only if he meant "Yes" instead of "No" in answering Robby's question.) From mflatt at cs.utah.edu Wed Oct 7 17:18:57 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Wed Oct 7 17:19:23 2009 Subject: [plt-scheme] Q. about editor<%> internal-locks In-Reply-To: <20091007210629.A37B26500AF@mail-svr1.cs.utah.edu> References: <4D07C725-5309-4375-8C3A-611FC8FA97D8@brinckerhoff.org> <932b2f1f0910071231m36935cectc86d7c7d13a4b61a@mail.gmail.com> <20091007201653.345726500C3@mail-svr1.cs.utah.edu> <136C3984-81FF-4A63-B002-A9059A77A56C@ccs.neu.edu> <20091007210629.A37B26500AF@mail-svr1.cs.utah.edu> Message-ID: <20091007211857.C4FF2650108@mail-svr1.cs.utah.edu> At Wed, 7 Oct 2009 15:06:28 -0600, Matthew Flatt wrote: > At Wed, 7 Oct 2009 16:56:05 -0400, Ryan Culpepper wrote: > > What's the right way to modify the editor in a thread other than the > > eventspace handler thread? > > Wrap the modifications with `begin-edit-sequence' and > `end-edit-sequence'. An edit sequence takes a lock that is also used by > the repaint method of an editor. See also http://docs.plt-scheme.org/gui/editor-overview.html#%28part._editorthreads%29 From clements at brinckerhoff.org Wed Oct 7 17:54:24 2009 From: clements at brinckerhoff.org (John Clements) Date: Wed Oct 7 17:54:48 2009 Subject: [plt-scheme] Q. about editor<%> internal-locks In-Reply-To: <20091007201653.345726500C3@mail-svr1.cs.utah.edu> References: <4D07C725-5309-4375-8C3A-611FC8FA97D8@brinckerhoff.org> <932b2f1f0910071231m36935cectc86d7c7d13a4b61a@mail.gmail.com> <20091007201653.345726500C3@mail-svr1.cs.utah.edu> Message-ID: <25E6BC42-B94A-4B3B-B6C0-E05893948DB7@brinckerhoff.org> On Oct 7, 2009, at 1:16 PM, Matthew Flatt wrote: > At Wed, 7 Oct 2009 12:58:31 -0700, John Clements wrote: >> On Oct 7, 2009, at 12:31 PM, Robby Findler wrote: >> >>> Are you accessing the editor from more than one thread? >> >> No. In particular, the only references to this editor are >> >> 1) it's embedded in a canvas which is part of a visible pane, and >> 2) There's an "update" method that is called by only one thread. > > So the "one thread" in #2 is the same as the canvas's eventspace's > handler thread? Aha! No, it's not. It's another thread. Based on the discussion in the messages that follow this one, I'm confident that "begin-edit- sequence" and "end-edit-sequence" will solve this problem. I see now that the *very next section* after "Internal Locks" is "Editors and Threads." I can claim (lamely) that ending the "Internal Locks" section with the sentence "See also Editors and Threads" would have helped me, but I think that's basically just a big fat RTFM to me. I'm slightly comforted by the fact that Ryan appears not to have known this either. Thanks for your patience. 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/20091007/17557ae7/smime.bin From ryanc at ccs.neu.edu Wed Oct 7 18:04:45 2009 From: ryanc at ccs.neu.edu (Ryan Culpepper) Date: Wed Oct 7 18:05:11 2009 Subject: [plt-scheme] Q. about editor<%> internal-locks In-Reply-To: <20091007210629.A37B26500AF@mail-svr1.cs.utah.edu> References: <4D07C725-5309-4375-8C3A-611FC8FA97D8@brinckerhoff.org> <932b2f1f0910071231m36935cectc86d7c7d13a4b61a@mail.gmail.com> <20091007201653.345726500C3@mail-svr1.cs.utah.edu> <136C3984-81FF-4A63-B002-A9059A77A56C@ccs.neu.edu> <20091007210629.A37B26500AF@mail-svr1.cs.utah.edu> Message-ID: On Oct 7, 2009, at 5:06 PM, Matthew Flatt wrote: > At Wed, 7 Oct 2009 16:56:05 -0400, Ryan Culpepper wrote: >> On Oct 7, 2009, at 4:16 PM, Matthew Flatt wrote: >> >>> At Wed, 7 Oct 2009 12:58:31 -0700, John Clements wrote: >>>> On Oct 7, 2009, at 12:31 PM, Robby Findler wrote: >>>> >>>>> Are you accessing the editor from more than one thread? >>>> >>>> No. In particular, the only references to this editor are >>>> >>>> 1) it's embedded in a canvas which is part of a visible pane, and >>>> 2) There's an "update" method that is called by only one thread. >>> >>> So the "one thread" in #2 is the same as the canvas's eventspace's >>> handler thread? >> >> Does the canvas have its own eventspace, or does it use the frame's >> eventspace? > > It's always the frame's eventspace. > >> What's the right way to modify the editor in a thread other than the >> eventspace handler thread? > > Wrap the modifications with `begin-edit-sequence' and > `end-edit-sequence'. An edit sequence takes a lock that is also used > by > the repaint method of an editor. Ah, I think most of my changes occur within an edit sequence, but some might not. That might account for the error showing up very rarely. Thanks! Ryan > > > (I think that might be the answer for John, but only if he meant "Yes" > instead of "No" in answering Robby's question.) > From ebellani at gmail.com Thu Oct 8 14:20:44 2009 From: ebellani at gmail.com (ebellani@gmail.com) Date: Thu Oct 8 14:27:57 2009 Subject: [plt-scheme] Planet packages and drscheme update Message-ID: Hey there I'm using DrScheme version 4.2 under ubuntu 9.04, and recently I've tried to update to version 4.2.2. Everything went ok, except for my planet packages, that didn't follow the update (I'm just using Diva and SICP language packages, but I image it is a pattern). Is there some way to simply make the packages work in the new version, without having to install them all again? Thanks for the attention. -- 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/20091008/71cbc890/signature.pgp From robby at eecs.northwestern.edu Thu Oct 8 15:36:08 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Oct 8 15:36:31 2009 Subject: [plt-scheme] Planet packages and drscheme update In-Reply-To: References: Message-ID: <932b2f1f0910081236l4d221392m8ef75608647bdf9@mail.gmail.com> Generally, the planet packages should install themselves when you require the libraries. But if you are installing a package only because it adds a new drscheme tool (say) instead of requiring it in one of your programs, then you'll have to run the planet commandline tool yourself. Robby On Thu, Oct 8, 2009 at 1:20 PM, wrote: > Hey there > > I'm using DrScheme version 4.2 under ubuntu 9.04, and recently I've tried to > update to version 4.2.2. > Everything went ok, except for my planet packages, that didn't follow the > update (I'm just using Diva and > SICP language packages, but I image it is a pattern). Is there some way to > simply make the packages work > in the new version, without having to install them all again? > > Thanks for the attention. > -- > Eduardo Bellani > > www.cnxs.com.br > > I object to doing things that computers can do. > - Olin Shivers > > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From andrew-scheme at areilly.bpc-users.org Thu Oct 8 18:23:25 2009 From: andrew-scheme at areilly.bpc-users.org (Andrew Reilly) Date: Thu Oct 8 18:24:31 2009 Subject: [plt-scheme] Re: [plt-dev] 64-Bit PLT Scheme for Windows/Mac In-Reply-To: <4ACC5141.7020003@zenburn.net> References: <4ACB5259.5050000@cs.utah.edu> <20091006142957.D57AC6500B9@mail-svr1.cs.utah.edu> <3A9017CA-0876-4FD5-8C1D-F936416C5018@brinckerhoff.org> <20091006224032.GA80558@duncan.reilly.home> <4ACC5141.7020003@zenburn.net> Message-ID: <20091008222325.GA8981@duncan.reilly.home> On Wed, Oct 07, 2009 at 10:28:49AM +0200, Jakub Piotr C?apa wrote: > On 09-10-07 00:40, Andrew Reilly wrote: > >[OT: I've been wondering how to deal with the change myself. I > >haven't met a description of how to call out to objective-C > >methods from C, yet, only the other way around. Anyone know of > >a how-to or tutorial? Or is the only approach to make a cocoa > >application that calls back to the C "main" code somehow > >(inverting the call graph).] > > You haven't seen any of these because it is not a problem. Code compiled > with an Objective-C compiler can define normal C procedures which use > Objective-C features but have normal linkage. Objective-C (contrary to > C++) is just some syntax sugar + runtime more than plain C. I did a bit of reading after posting yesterday (wrong order I know!) and was surprised to come to the same conclusion! I must have been burned by the C++ experience. > Alternatively you can use the Objective-C runtime manually and send any > messages to any object you want. This is how the (quite new) PLT Scheme > Objective-C FFI works. I haven't noticed that (objective-C FFI) yet. Thanks for pointing it out. I'll give it a spin soon! [ For posterity: I did find a nice neat description of the mechanism (using SEL and IMP and associated functions) in this objective C FAQ: http://www.thaesofereode.info/clocFAQ/ ] Cheers, -- Andrew From robby at eecs.northwestern.edu Thu Oct 8 18:23:35 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Oct 8 18:24:41 2009 Subject: Fwd: [plt-scheme] Planet packages and drscheme update In-Reply-To: References: <932b2f1f0910081236l4d221392m8ef75608647bdf9@mail.gmail.com> Message-ID: <932b2f1f0910081523g708710f2ud5d912067fab14f7@mail.gmail.com> ---------- Forwarded message ---------- From: Date: Thursday, October 8, 2009 Subject: [plt-scheme] Planet packages and drscheme update To: Robby Findler Hmm, would it be a valid work around for things like divascheme to make something like this on .plt-scheme/plt-prefs.ss for instance //pseudo code if diva-is-not-installed ?install diva ?do-nothing Anyone tried this? On Thu, Oct 8, 2009 at 4:36 PM, Robby Findler wrote: Generally, the planet packages should install themselves when you require the libraries. But if you are installing a package only because it adds a new drscheme tool (say) instead of requiring it in one of your programs, then you'll have to run the planet commandline tool yourself. Robby On Thu, Oct 8, 2009 at 1:20 PM, ? wrote: Hey there I'm using DrScheme version 4.2 under ubuntu 9.04, and recently I've tried to update to version 4.2.2. Everything went ok, except for my planet packages, that didn't follow the update (I'm just using Diva and SICP language packages, but I image it is a pattern). Is there some way to simply make the packages work in the new version, without having to install them all again? Thanks for the attention. -- Eduardo Bellani www.cnxs.com.br I object to doing things that computers can do. - Olin Shivers _________________________________________________ ?For list-related administrative tasks: ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme -- 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: 196 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091008/fda7238e/signature.pgp From stephen.degabrielle at acm.org Fri Oct 9 09:12:35 2009 From: stephen.degabrielle at acm.org (Stephen De Gabrielle) Date: Fri Oct 9 09:12:58 2009 Subject: [plt-scheme] Tool/plugin: packer.plt Message-ID: <595b9ab20910090612q98420e4g8c05fef3acaf67da@mail.gmail.com> Hi, I made a simple little plugin to help get a library on planet. It makes an info.ss and creates a .PLT file for upload. Comments suggestions welcome- or just tell me if it's a dumb idea. Haveagoodweekend, Stephen ---------- Forwarded message ---------- From: PLaneT Date: Friday, October 9, 2009 Subject: [plt-planet-announce] New PLaneT package: spdegabrielle/packer.plt for 4.x To: plt-planet-announce@list.cs.brown.edu This announces the availability of a new package from PLaneT: ------- Name: ? ? ? ? ? ?packer.plt Package version: 1.0 Owner: ? ? ? ? ? spdegabrielle Package Description Makes an info.ss and .plt file for upload. Check the file menu for the Pack .PLT menu item. Release Notes for 4.x. ------- Go to http://planet.plt-scheme.org/display.ss?package=packer.plt&owner=spdegabrielle for more information. _________________________________________________ ?For list-related administrative tasks: ?http://list.cs.brown.edu/mailman/listinfo/plt-planet-announce -- -- 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 Fri Oct 9 12:15:04 2009 From: stephen.degabrielle at acm.org (Stephen De Gabrielle) Date: Fri Oct 9 12:15:29 2009 Subject: [plt-scheme] Re: Tool/plugin: packer.plt In-Reply-To: <595b9ab20910090612q98420e4g8c05fef3acaf67da@mail.gmail.com> References: <595b9ab20910090612q98420e4g8c05fef3acaf67da@mail.gmail.com> Message-ID: <595b9ab20910090915r18a048a1yb15d4ab8bf71bc0f@mail.gmail.com> > No docs to read about how it works?! ;) Load it up, restart drscheme and you will have a new menu item I'll try correct the oversight over the weekend. Cheers, Stephen On Fri, Oct 9, 2009 at 2:12 PM, Stephen De Gabrielle < stephen.degabrielle@acm.org> wrote: > Hi, > > I made a simple little plugin to help get a library on planet. > It makes an info.ss and creates a .PLT file for upload. > > Comments suggestions welcome- or just tell me if it's a dumb idea. > > Haveagoodweekend, > > Stephen > > > > > ---------- Forwarded message ---------- > From: PLaneT > Date: Friday, October 9, 2009 > Subject: [plt-planet-announce] New PLaneT package: > spdegabrielle/packer.plt for 4.x > To: plt-planet-announce@list.cs.brown.edu > > > This announces the availability of a new package from PLaneT: > > ------- > Name: packer.plt > Package version: 1.0 > Owner: spdegabrielle > > > Package Description > Makes an info.ss and .plt file for upload. Check the file menu for the > Pack .PLT menu item. > Release Notes > for 4.x. > ------- > > Go to > > > http://planet.plt-scheme.org/display.ss?package=packer.plt&owner=spdegabrielle > > for more information. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-planet-announce > > > > -- > > -- > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091009/47227ff1/attachment.htm From rafkind at cs.utah.edu Fri Oct 9 12:19:28 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Fri Oct 9 12:22:08 2009 Subject: [plt-scheme] Tool/plugin: packer.plt In-Reply-To: <595b9ab20910090612q98420e4g8c05fef3acaf67da@mail.gmail.com> References: <595b9ab20910090612q98420e4g8c05fef3acaf67da@mail.gmail.com> Message-ID: <4ACF6290.1040600@cs.utah.edu> Stephen De Gabrielle wrote: > Hi, > > I made a simple little plugin to help get a library on planet. > It makes an info.ss and creates a .PLT file for upload. > > Comments suggestions welcome- or just tell me if it's a dumb idea. > > I tried it out. Its a good idea, I think. Usually I make these dumb little makefiles to generate .plt files but I'd rather use something else. 1. if I run 'pack .plt' without saving the current buffer (I mean its a brand new, unnamed buffer) I get some error about split-path and #f. 2. if my current file is blah.ss then the resulting .plt file is blah.ss.plt. I think it should be just blah.plt 3. at first I was worried that only blah.ss was part of the .plt package but when I did 'planet structure blah.ss.plt' I noticed everything in the directory where blah.ss was (or maybe it was the current working directory, which happened to be the same) was also included. It would be nice if I could manually select the files with the option of "include all .ss files found recursively" or something. This is especially important because even if I am in my project directory I will probably have .svn directories hanging around that I don't want to send to planet. From geoff at knauth.org Fri Oct 9 15:24:20 2009 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Fri Oct 9 15:24:41 2009 Subject: [plt-scheme] [OT] grateful for PLT Check Syntax Message-ID: <55DFE91C-1EB8-4A54-AEAD-26F2FC2F871D@knauth.org> A colleague running experiments in Mathematica recently found that some of his extraordinarily good results were due to a misspelled variable. datalengh = Length[data]; Later in the code, datalength was not misspelled, but it had no value. The program was happy when it should not have been, and it produced happy pill results. I listened to the story and thought, "This could not have happened with DrScheme." Geoff From czhu at cs.utah.edu Fri Oct 9 15:34:54 2009 From: czhu at cs.utah.edu (Chognkai Zhu) Date: Fri Oct 9 15:35:17 2009 Subject: [plt-scheme] [OT] grateful for PLT Check Syntax In-Reply-To: <55DFE91C-1EB8-4A54-AEAD-26F2FC2F871D@knauth.org> References: <55DFE91C-1EB8-4A54-AEAD-26F2FC2F871D@knauth.org> Message-ID: <4ACF905E.9030001@cs.utah.edu> Sorry for telling that, but that story has nothing to do with PLT's Check Syntax. For nearly all languages, reference to an undefined variable is a compile time error. But this is not true for Computer Algebra Systems(CAS). Even with no values bind to variable `x', a CAS should still reduce `x+x+x' to `3x', which implies reference to an undefined variable is not an error. But CAS do have their merits. Chongkai Geoffrey S. Knauth wrote: > A colleague running experiments in Mathematica recently found that > some of his extraordinarily good results were due to a misspelled > variable. > > datalengh = Length[data]; > > Later in the code, datalength was not misspelled, but it had no > value. The program was happy when it should not have been, and it > produced happy pill results. I listened to the story and thought, > "This could not have happened with DrScheme." > > Geoff > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From geoff at knauth.org Fri Oct 9 15:48:31 2009 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Fri Oct 9 15:48:50 2009 Subject: [plt-scheme] [OT] grateful for PLT Check Syntax In-Reply-To: <4ACF905E.9030001@cs.utah.edu> References: <55DFE91C-1EB8-4A54-AEAD-26F2FC2F871D@knauth.org> <4ACF905E.9030001@cs.utah.edu> Message-ID: On Oct 9, 2009, at 15:34, Chognkai Zhu wrote: > Sorry for telling that, but that story has nothing to do with PLT's > Check Syntax. For nearly all languages, reference to an undefined > variable is a compile time error. But this is not true for Computer > Algebra Systems(CAS). Even with no values bind to variable `x', a > CAS should still reduce `x+x+x' to `3x', which implies reference to > an undefined variable is not an error. But CAS do have their merits. Yes, you're right. But there was another part of the story that made me think of Check Syntax. He had other code that had variable names s and ss. In one place, he had forgotten an s, and ss became s. Check Syntax would have drawn arrows helping him see that mistake. From sk at cs.brown.edu Fri Oct 9 16:23:16 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Fri Oct 9 16:23:54 2009 Subject: [plt-scheme] [OT] grateful for PLT Check Syntax In-Reply-To: <55DFE91C-1EB8-4A54-AEAD-26F2FC2F871D@knauth.org> References: <55DFE91C-1EB8-4A54-AEAD-26F2FC2F871D@knauth.org> Message-ID: On Fri, Oct 9, 2009 at 3:24 PM, Geoffrey S. Knauth wrote: > A colleague running experiments in Mathematica recently found that some of > his extraordinarily good results were due to a misspelled variable. > > datalengh = Length[data]; > > Later in the code, datalength was not misspelled, but it had no value. ?The > program was happy when it should not have been, and it produced happy pill > results. ?I listened to the story and thought, "This could not have happened > with DrScheme." Nor could symbolic integration. Shriram From czhu at cs.utah.edu Fri Oct 9 21:39:54 2009 From: czhu at cs.utah.edu (Chongkai Zhu) Date: Fri Oct 9 21:40:22 2009 Subject: [plt-scheme] scheme_add_managed with FFI Message-ID: <4ACFE5EA.2030305@cs.utah.edu> Hi all, In one of my programs, I need to use custodian to manage some resource. So I wrote the following: (define add-managed (get-ffi-obj "scheme_add_managed" #f (_fun (_pointer = #f) _scheme (_fun _scheme _pointer -> _void) _pointer _bool -> _pointer))) ... (add-managed p (lambda (p _) (my-close p)) #f #f) A side note: here p itself is a _pointer (print as #) returned from some other FFI call. If I run the program for long enough, adding objects under the manage of custodians, and closing custodians once a while, with other process (other than PLT) actively using memory, eventually a segfault will happen when I'm shutdown a custodian (which has some p under it's management). Testing shows the segfault is related to my `add-managed', as commenting it the segfault also disappears. I noticed in http://schemecookbook.org/Cookbook/PLTCustodianRegistration, the FFI type of scheme_add_managed is different from how I use it. Did I do something wrong using scheme_add_managed this way? Why does the segfault happen? Could anyone help elaborate? Thanks in advance. Sincerely, Chongkai From ccwu660601 at gmail.com Sun Oct 11 03:36:12 2009 From: ccwu660601 at gmail.com (ccwu) Date: Sun Oct 11 15:24:36 2009 Subject: [plt-scheme] #lang at-exp scheme/base doesn't work? Message-ID: <73ce6334-99f8-4313-a60d-13d00e5ded01@w37g2000prg.googlegroups.com> Hi, I'm learning scheme and scribble using plt-scheme 4.2.2. I tried the following code: #lang at-exp scheme/base (define (greet who) @string-append{Hello, @|who|.}) But drscheme give me an error: unquote: not in quasiquote in: (unquote @who.) Any idea? From mark.engelberg at gmail.com Sun Oct 11 15:41:52 2009 From: mark.engelberg at gmail.com (Mark Engelberg) Date: Sun Oct 11 15:42:12 2009 Subject: [plt-scheme] Slideshow questions Message-ID: Is there a way to: Disable the standard navigation controls? Add customized key handlers? Jump ahead a certain number of slides, or jump ahead to a specific slide? I'm trying to figure out if I can use slideshow to create something that's a little less "linear", and a bit more hypertexty. Thanks. From mark.engelberg at gmail.com Sun Oct 11 15:44:21 2009 From: mark.engelberg at gmail.com (Mark Engelberg) Date: Sun Oct 11 15:44:40 2009 Subject: [plt-scheme] MrEd question about formatted text Message-ID: Is there an easy way in the MrEd toolkit to create text that uses a simple markup to display a mix of different font sizes, italics, bold, etc? For example, can the slideshow text markup functions be used from MrEd to label buttons? From robby at eecs.northwestern.edu Sun Oct 11 16:26:25 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Sun Oct 11 16:26:47 2009 Subject: [plt-scheme] Slideshow questions In-Reply-To: References: Message-ID: <932b2f1f0910111326v3851e506q6d7e396db1c6703b@mail.gmail.com> I don't thikn that there is a way to setup an arbitrary key handler currently, no. But the function you wan to change (perhaps just by adding a hook for your own, slideshow-specific function), is on-subwindow-char in plt/collects/slideshow/viewer.ss. There is also 'clickback'. Robby On Sun, Oct 11, 2009 at 2:41 PM, Mark Engelberg wrote: > Is there a way to: > > Disable the standard navigation controls? > Add customized key handlers? > Jump ahead a certain number of slides, or jump ahead to a specific slide? > > I'm trying to figure out if I can use slideshow to create something > that's a little less "linear", and a bit more hypertexty. > > Thanks. > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From matthias at ccs.neu.edu Sun Oct 11 17:42:33 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Sun Oct 11 17:43:14 2009 Subject: [plt-scheme] #lang at-exp scheme/base doesn't work? In-Reply-To: <73ce6334-99f8-4313-a60d-13d00e5ded01@w37g2000prg.googlegroups.com> References: <73ce6334-99f8-4313-a60d-13d00e5ded01@w37g2000prg.googlegroups.com> Message-ID: <12D24557-494E-4393-B8E0-4BF23F427627@ccs.neu.edu> I ran this: #lang at-exp scheme/base (define (greet who) @string-append{Hello, @|who|.}) @greet{world} I got this: Welcome to DrScheme, version 4.2.2.4-svn5oct2009 [3m]. Language: Module. "Hello, world." > What are you doing? On Oct 11, 2009, at 3:36 AM, ccwu wrote: > Hi, > > I'm learning scheme and scribble using plt-scheme 4.2.2. > I tried the following code: > > #lang at-exp scheme/base > > (define (greet who) @string-append{Hello, @|who|.}) > > But drscheme give me an error: > unquote: not in quasiquote in: (unquote @who.) > > Any idea? > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From etanter at dcc.uchile.cl Sun Oct 11 22:50:10 2009 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Sun Oct 11 22:50:32 2009 Subject: [plt-scheme] redex: syntactic equality Message-ID: <92BE2CDC-4AE4-47D3-8578-03BF1AC8E73B@dcc.uchile.cl> Hi, Is there a way to compare two terms for equality (modulo alpha renaming) out-of-the-box? or do I have to define my own metafunction for that? Thanks, -- ?ric From jay.mccarthy at gmail.com Sun Oct 11 23:50:31 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Sun Oct 11 23:50:53 2009 Subject: [plt-scheme] redex: syntactic equality In-Reply-To: <92BE2CDC-4AE4-47D3-8578-03BF1AC8E73B@dcc.uchile.cl> References: <92BE2CDC-4AE4-47D3-8578-03BF1AC8E73B@dcc.uchile.cl> Message-ID: I don't believe there is, because Redex would have no way of knowing which terms of yours are binders and are available for alpha-renaming. Not to mention rules like let* and letrec. Jay On Sun, Oct 11, 2009 at 8:50 PM, Eric Tanter wrote: > Hi, > > Is there a way to compare two terms for equality (modulo alpha renaming) > out-of-the-box? > or do I have to define my own metafunction for that? > > Thanks, > > -- ?ric > > > _________________________________________________ > ?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 etanter at dcc.uchile.cl Mon Oct 12 00:09:48 2009 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Mon Oct 12 00:10:18 2009 Subject: [plt-scheme] redex: syntactic equality In-Reply-To: References: <92BE2CDC-4AE4-47D3-8578-03BF1AC8E73B@dcc.uchile.cl> Message-ID: You're right, in the general case there is no way for redex to know what my language is doing... Actually, what I need is comparison of lambda terms: I want (let ((f (lambda (x) x)) (eq? f f)) to be true in my language So I'm going another way that consists in tagging lambda values with a unique identifier, and then having comparison check this: eg. (lambda (x) x) --> (lambda r1234 (x) x) The identifier is obtained with (gensym "r"). This is working fine, except that I realize that I don't know how to write a test-->> for that, because when a lambda value ends up in the store, I have no way to know which r__ it has. Is there a way to do so? Thanks! -- ?ric On Oct 11, 2009, at 11:50 PM, Jay McCarthy wrote: > I don't believe there is, because Redex would have no way of knowing > which terms of yours are binders and are available for alpha-renaming. > Not to mention rules like let* and letrec. > > Jay > > On Sun, Oct 11, 2009 at 8:50 PM, Eric Tanter > wrote: >> Hi, >> >> Is there a way to compare two terms for equality (modulo alpha >> renaming) >> out-of-the-box? >> or do I have to define my own metafunction for that? >> >> Thanks, >> >> -- ?ric >> >> >> _________________________________________________ >> 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 clklein at eecs.northwestern.edu Mon Oct 12 06:15:46 2009 From: clklein at eecs.northwestern.edu (Casey Klein) Date: Mon Oct 12 06:16:07 2009 Subject: [plt-scheme] redex: syntactic equality In-Reply-To: References: <92BE2CDC-4AE4-47D3-8578-03BF1AC8E73B@dcc.uchile.cl> Message-ID: On Sun, Oct 11, 2009 at 11:09 PM, Eric Tanter wrote: > You're right, in the general case there is no way for redex to know what my > language is doing... > > Actually, what I need is comparison of lambda terms: > I want (let ((f (lambda (x) x)) (eq? f f)) to be true in my language > > So I'm going another way that consists in tagging lambda values with a > unique identifier, and then having comparison check this: > > eg. (lambda (x) x) --> (lambda r1234 (x) x) > > The identifier is obtained with (gensym "r"). > This is working fine, except that I realize that I don't know how to write a > test-->> for that, because when a lambda value ends up in the store, I have > no way to know which r__ it has. > > Is there a way to do so? > No, you can't check this with test-->>. Try formulating the expected result as a Redex pattern and comparing the actual result to that pattern using redex-match. Use _!_ patterns to force tags to be distinct. http://docs.plt-scheme.org/redex/Patterns.html#%28idx._%28gentag._11._%28lib._redex/redex..scrbl%29%29%29 For example, if the expected result is the pair produced by ?x.x and ?x.1, use this pattern: ((? r_!_1 (x) x) (? r_!_1 (x) 1)) From robby at eecs.northwestern.edu Mon Oct 12 07:14:23 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Mon Oct 12 07:14:46 2009 Subject: [plt-scheme] redex: syntactic equality In-Reply-To: References: <92BE2CDC-4AE4-47D3-8578-03BF1AC8E73B@dcc.uchile.cl> Message-ID: <932b2f1f0910120414p3088fde7o38db87ba9d770a34@mail.gmail.com> Another thing you might try is systematically renaming your terms (the first variable gets the name "x1", the second "x2", etc) and then use equal? to compare them. That amount to implementing your own alpha comparison, of course, but if you've gone as far as tagging lambdas, maybe you're not that far from that function. Robby 2009/10/12 Casey Klein : > On Sun, Oct 11, 2009 at 11:09 PM, Eric Tanter wrote: >> You're right, in the general case there is no way for redex to know what my >> language is doing... >> >> Actually, what I need is comparison of lambda terms: >> I want (let ((f (lambda (x) x)) (eq? f f)) to be true in my language >> >> So I'm going another way that consists in tagging lambda values with a >> unique identifier, and then having comparison check this: >> >> eg. (lambda (x) x) --> (lambda r1234 (x) x) >> >> The identifier is obtained with (gensym "r"). >> This is working fine, except that I realize that I don't know how to write a >> test-->> for that, because when a lambda value ends up in the store, I have >> no way to know which r__ it has. >> >> Is there a way to do so? >> > > No, you can't check this with test-->>. > > Try formulating the expected result as a Redex pattern and comparing > the actual result to that pattern using redex-match. Use _!_ patterns > to force tags to be distinct. > > http://docs.plt-scheme.org/redex/Patterns.html#%28idx._%28gentag._11._%28lib._redex/redex..scrbl%29%29%29 > > For example, if the expected result is the pair produced by ?x.x and > ?x.1, use this pattern: > > ? ((? r_!_1 (x) x) (? r_!_1 (x) 1)) > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From ccwu660601 at gmail.com Mon Oct 12 06:36:03 2009 From: ccwu660601 at gmail.com (ccwu) Date: Mon Oct 12 08:16:15 2009 Subject: [plt-scheme] Re: #lang at-exp scheme/base doesn't work? In-Reply-To: <12D24557-494E-4393-B8E0-4BF23F427627@ccs.neu.edu> References: <73ce6334-99f8-4313-a60d-13d00e5ded01@w37g2000prg.googlegroups.com> <12D24557-494E-4393-B8E0-4BF23F427627@ccs.neu.edu> Message-ID: <2e1970ff-72b8-4474-9254-0577a3767eb0@h14g2000pri.googlegroups.com> Now I understand it. The at-exp works only in the definition window, not in the interaction window. Thank anyway. I have yet another question. Can 'require' accept Unicode file names? (require "=AEa=C5=DC.ss") gives the following error message: require: bad module-path string in: "=AEa=C5=DC.ss" I'm using Debian GNU/Linux. From noelwelsh at gmail.com Mon Oct 12 08:47:59 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Mon Oct 12 08:48:18 2009 Subject: [plt-scheme] Re: #lang at-exp scheme/base doesn't work? In-Reply-To: <2e1970ff-72b8-4474-9254-0577a3767eb0@h14g2000pri.googlegroups.com> References: <73ce6334-99f8-4313-a60d-13d00e5ded01@w37g2000prg.googlegroups.com> <12D24557-494E-4393-B8E0-4BF23F427627@ccs.neu.edu> <2e1970ff-72b8-4474-9254-0577a3767eb0@h14g2000pri.googlegroups.com> Message-ID: 2009/10/12 ccwu : > > I have yet another question. Can 'require' accept Unicode file names? > (require "=AEa=C5=DC.ss") gives the following error message: > require: bad module-path string in: "=AEa=C5=DC.ss" > I'm using Debian GNU/Linux. Yes, using the (file ...) form. If you search for require in the docs you'll see that (require ) requires that be a rel-string, which is only ASCII. (require (file )) accepts a string, however. N. From etanter at dcc.uchile.cl Mon Oct 12 09:15:43 2009 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Mon Oct 12 09:16:09 2009 Subject: [plt-scheme] redex: syntactic equality In-Reply-To: References: <92BE2CDC-4AE4-47D3-8578-03BF1AC8E73B@dcc.uchile.cl> Message-ID: Thanks Casey, I'm now using test-predicate in conjunction with redex- match, it works fine. -- ?ric On Oct 12, 2009, at 6:15 AM, Casey Klein wrote: > On Sun, Oct 11, 2009 at 11:09 PM, Eric Tanter > wrote: >> You're right, in the general case there is no way for redex to know >> what my >> language is doing... >> >> Actually, what I need is comparison of lambda terms: >> I want (let ((f (lambda (x) x)) (eq? f f)) to be true in my language >> >> So I'm going another way that consists in tagging lambda values >> with a >> unique identifier, and then having comparison check this: >> >> eg. (lambda (x) x) --> (lambda r1234 (x) x) >> >> The identifier is obtained with (gensym "r"). >> This is working fine, except that I realize that I don't know how >> to write a >> test-->> for that, because when a lambda value ends up in the >> store, I have >> no way to know which r__ it has. >> >> Is there a way to do so? >> > > No, you can't check this with test-->>. > > Try formulating the expected result as a Redex pattern and comparing > the actual result to that pattern using redex-match. Use _!_ patterns > to force tags to be distinct. > > http://docs.plt-scheme.org/redex/Patterns.html#%28idx._%28gentag._11._%28lib._redex/redex..scrbl%29%29%29 > > For example, if the expected result is the pair produced by ?x.x and > ?x.1, use this pattern: > > ((? r_!_1 (x) x) (? r_!_1 (x) 1)) From etanter at dcc.uchile.cl Mon Oct 12 09:16:28 2009 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Mon Oct 12 09:16:55 2009 Subject: [plt-scheme] redex: syntactic equality In-Reply-To: <932b2f1f0910120414p3088fde7o38db87ba9d770a34@mail.gmail.com> References: <92BE2CDC-4AE4-47D3-8578-03BF1AC8E73B@dcc.uchile.cl> <932b2f1f0910120414p3088fde7o38db87ba9d770a34@mail.gmail.com> Message-ID: <32002DE6-0181-4806-B1EC-4B015ADBDA95@dcc.uchile.cl> ok, will try that next time ;) (for now I'm fine with the tag solution) -- ?ric On Oct 12, 2009, at 7:14 AM, Robby Findler wrote: > Another thing you might try is systematically renaming your terms (the > first variable gets the name "x1", the second "x2", etc) and then use > equal? to compare them. That amount to implementing your own alpha > comparison, of course, but if you've gone as far as tagging lambdas, > maybe you're not that far from that function. > > Robby > > 2009/10/12 Casey Klein : >> On Sun, Oct 11, 2009 at 11:09 PM, Eric Tanter >> wrote: >>> You're right, in the general case there is no way for redex to >>> know what my >>> language is doing... >>> >>> Actually, what I need is comparison of lambda terms: >>> I want (let ((f (lambda (x) x)) (eq? f f)) to be true in my language >>> >>> So I'm going another way that consists in tagging lambda values >>> with a >>> unique identifier, and then having comparison check this: >>> >>> eg. (lambda (x) x) --> (lambda r1234 (x) x) >>> >>> The identifier is obtained with (gensym "r"). >>> This is working fine, except that I realize that I don't know how >>> to write a >>> test-->> for that, because when a lambda value ends up in the >>> store, I have >>> no way to know which r__ it has. >>> >>> Is there a way to do so? >>> >> >> No, you can't check this with test-->>. >> >> Try formulating the expected result as a Redex pattern and comparing >> the actual result to that pattern using redex-match. Use _!_ patterns >> to force tags to be distinct. >> >> http://docs.plt-scheme.org/redex/Patterns.html#%28idx._%28gentag._11._%28lib._redex/redex..scrbl%29%29%29 >> >> For example, if the expected result is the pair produced by ?x.x and >> ?x.1, use this pattern: >> >> ((? r_!_1 (x) x) (? r_!_1 (x) 1)) >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> From plt at synx.us.to Mon Oct 12 16:32:51 2009 From: plt at synx.us.to (Synx) Date: Mon Oct 12 16:33:24 2009 Subject: [plt-scheme] Apply a procedure in a module Message-ID: <4AD39273.6040804@synx.us.to> I'd like to know how to invoke mzscheme or mred or the like, so that I can run a specific procedure inside a specific module. What I have is a situation where I make a do-something.ss file/module and it contains something useful to import for do-something-else.ss, so I end up having to remove the toplevel procedure application from do-something.ss and instead make do-do-something.ss which contains a pretty carbon copy form of this: --- #lang scheme/base (require "do-something.ss") (main) --- Two things about that strike me as not a good idea. First off having toplevel procedure application at all is ugly, and the only reason I do is because I can't specify a procedure to apply on the command line. Secondly it means I have a bunch of redundant nearly identical files that do nothing besides import a module and apply its procedure. I'd like to have something instead the likes of: $ mzscheme -n -t do-something.ss -e '(main)' ...and not need to bother manually writing out a do-do-something.ss file at all. Another advantage to doing that is it would enable me to be more flexible with regard to program entry points. This is very convenient especially for testing, and in my opinion is more expressive. Trouble is, I don't know how to do it. :( $ mred -n -t prompt.ss -e '(watch-forever "/var/tmp/bink")' #f::0: compile: bad syntax; function application is not allowed, because no #%app syntax transformer is bound in: (watch-forever "/var/tmp/bink") Help? ^.^; From david.storrs at gmail.com Mon Oct 12 16:52:36 2009 From: david.storrs at gmail.com (David Storrs) Date: Mon Oct 12 16:59:28 2009 Subject: [plt-scheme] sqlite:finalize statement throws unexpectedly Message-ID: (require (prefix-in sqlite: (planet jaymccarthy/sqlite:4:5/sqlite))) sqlite:finalize function will raise an exception when: 1) You pass it something that is not a SQLite statement 2) The statement you pass it is not a sqlite:open-statement? 3) The statement you pass it IS an open-statement? but it produced a constraint violation when you ran it. #2 and #3 surprised me. I would have thought that finalize would either succeed or be a no-op--since, presumably, you dealt with whatever errors came up back where you were running the statement. Does anyone else find this surprising? --Dks From jay.mccarthy at gmail.com Mon Oct 12 17:07:43 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Mon Oct 12 17:08:04 2009 Subject: [plt-scheme] sqlite:finalize statement throws unexpectedly In-Reply-To: References: Message-ID: The contract for finalize specifies #2. Re: #3 --- SQLite's sqlite3_finalize returns a status. I uniformly turn these status values into exns. My attitude is that the C API allows you to forget to handle errors but the Scheme API should never fail without warning. Jay On Mon, Oct 12, 2009 at 2:52 PM, David Storrs wrote: > (require (prefix-in sqlite: (planet jaymccarthy/sqlite:4:5/sqlite))) > > sqlite:finalize function will raise an exception when: > > 1) You pass it something that is not a SQLite statement > > 2) The statement you pass it is not a sqlite:open-statement? > > 3) The statement you pass it IS an open-statement? but it produced a > constraint violation when you ran it. > > #2 and #3 surprised me. ?I would have thought that finalize would > either succeed or be a no-op--since, presumably, you dealt with > whatever errors came up back where you were running the statement. > > Does anyone else find this surprising? > > --Dks > _________________________________________________ > ?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 eli at barzilay.org Mon Oct 12 17:13:31 2009 From: eli at barzilay.org (Eli Barzilay) Date: Mon Oct 12 17:13:55 2009 Subject: [plt-scheme] Apply a procedure in a module In-Reply-To: <4AD39273.6040804@synx.us.to> References: <4AD39273.6040804@synx.us.to> Message-ID: <19155.39931.884074.108120@winooski.ccs.neu.edu> On Oct 12, Synx wrote: > I'd like to know how to invoke mzscheme or mred or the like, so that > I can run a specific procedure inside a specific module. What I have > is a situation where I make a do-something.ss file/module and it > contains something useful to import for do-something-else.ss, so I > end up having to remove the toplevel procedure application from > do-something.ss and instead make do-do-something.ss which contains a > pretty carbon copy form of this: > --- > #lang scheme/base > (require "do-something.ss") > (main) > --- > > Two things about that strike me as not a good idea. First off having > toplevel procedure application at all is ugly, It's perfectly fine to do that. > and the only reason I do is because I can't specify a procedure to > apply on the command line. You can use `--main' to have the `main' function applied on the list of command-line arguments. For example, try this: #!/bin/sh #| exec mzscheme -um "$0" "$@" |# #lang scheme (provide main) (define (main . args) (printf "Arguments: ~s\n" args)) But it's better to do that using scheme/cmdline, for example: #!/bin/env mzscheme #lang scheme (let ([a "A"] [b "B"]) (command-line #:once-each [("-a" "--hay") a-val "blah blah" (set! a a-val)] [("-b" "--bee") b-val "blah blah" (set! b b-val)] #:args stuff (printf "A: ~s\nB: ~s\nArguments: ~s\n" a b stuff))) > Secondly it means I have a bunch of redundant nearly identical files > that do nothing besides import a module and apply its procedure. I'd > like to have something instead the likes of: > > $ mzscheme -n -t do-something.ss -e '(main)' > > ...and not need to bother manually writing out a do-do-something.ss file > at all. You can use the above and use an argument to dispatch to some function to run -- using scheme/cmdline will make it easy to do this reliably (for example, using `#:once-any' to choose exactly one mode). > Another advantage to doing that is it would enable me to be more > flexible with regard to program entry points. This is very convenient > especially for testing, and in my opinion is more expressive. > > Trouble is, I don't know how to do it. :( > > $ mred -n -t prompt.ss -e '(watch-forever "/var/tmp/bink")' > #f::0: compile: bad syntax; function application is not allowed, because > no #%app syntax transformer is bound in: (watch-forever "/var/tmp/bink") If you really insist on doing this, you will need to have the bindings from `scheme' available. Here's one way to do this: #lang scheme (provide (all-from-out scheme)) (provide foo) (define (foo x) (printf "foo: ~s\n" x)) and you can now run it with mzscheme -t that-file.ss -e '(foo 123)' But it's better to avoid the module providing the scheme bindings, and instead require them yourself -- drop that first `provide', and run with: mzscheme -l scheme -t $f -e '(foo 123)' or mzscheme -lte scheme $f '(foo 123)' -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From ryanc at ccs.neu.edu Mon Oct 12 17:16:19 2009 From: ryanc at ccs.neu.edu (Ryan Culpepper) Date: Mon Oct 12 17:15:42 2009 Subject: [plt-scheme] Apply a procedure in a module In-Reply-To: <4AD39273.6040804@synx.us.to> References: <4AD39273.6040804@synx.us.to> Message-ID: <4AD39CA3.9060106@ccs.neu.edu> Synx wrote: > I'd like to know how to invoke mzscheme or mred or the like, so that I > can run a specific procedure inside a specific module. What I have is a > situation where I make a do-something.ss file/module and it contains > something useful to import for do-something-else.ss, so I end up having > to remove the toplevel procedure application from do-something.ss and > instead make do-do-something.ss which contains a pretty carbon copy form > of this: > --- > #lang scheme/base > (require "do-something.ss") > (main) > --- > > Two things about that strike me as not a good idea. First off having > toplevel procedure application at all is ugly, and the only reason I do > is because I can't specify a procedure to apply on the command line. > Secondly it means I have a bunch of redundant nearly identical files > that do nothing besides import a module and apply its procedure. I'd > like to have something instead the likes of: > > $ mzscheme -n -t do-something.ss -e '(main)' > > ...and not need to bother manually writing out a do-do-something.ss file > at all. > > Another advantage to doing that is it would enable me to be more > flexible with regard to program entry points. This is very convenient > especially for testing, and in my opinion is more expressive. > > Trouble is, I don't know how to do it. :( > > $ mred -n -t prompt.ss -e '(watch-forever "/var/tmp/bink")' > #f::0: compile: bad syntax; function application is not allowed, because > no #%app syntax transformer is bound in: (watch-forever "/var/tmp/bink") How about either of these: mred -e \ '(begin (require "prompt.ss") (watch-forever "/var/tmp/bink"))' mred -e \ "((dynamic-require \"prompt.ss\" 'watch-forever) \"/var/tmp/bink\")" Why doesn't -t let you do that? I think -t is intended for compiled modules that act as programs, so it avoids loading things necessary for compiling expressions. Ryan From david.storrs at gmail.com Mon Oct 12 17:19:50 2009 From: david.storrs at gmail.com (David Storrs) Date: Mon Oct 12 17:20:09 2009 Subject: [plt-scheme] sqlite:finalize statement throws unexpectedly In-Reply-To: References: Message-ID: On Mon, Oct 12, 2009 at 5:07 PM, Jay McCarthy wrote: > The contract for finalize specifies #2. No, I got that. I was just surprised. It would be nice if the contract was (-> statement? void?) instead of (-> open-statement? void?). > Re: #3 --- SQLite's sqlite3_finalize returns a status. I uniformly > turn these status values into exns. My attitude is that the C API > allows you to forget to handle errors but the Scheme API should never > fail without warning. Agreed, absolutely. My thought was only that, in practice, the author *must* have already dealt with this error, because an exception would have been thrown when he tried to execute the statement in the first place. The finalize is re-raising an already-dealt-with error. For example: ;; Assume the users table has a UNIQUE constraint on username (let ((stmt (prepare db "insert into users (username, password) values (?, ?)"))) (with-handlers ((sqlite:exn? (finalize stmt) (void))) (run stmt 'Joe' 'pass1') ; executes fine, row is inserted (run stmt 'Joe' 'pass1') ; => exn:sqlite. This user already exists ) This is a simplified version of what I was just debugging. It took me a while to realize that the with-handlers was working fine; it's simply that the handler function was re-raising the error, when I expected it to ensure that the statement was finalized and then eat the exception. The way the sqlite module is currently written, one needs to wrap a with-handlers around every call to finalize, just in case the statement had problems when it was run. That seems redundant. --Dks From jay.mccarthy at gmail.com Mon Oct 12 17:27:31 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Mon Oct 12 17:27:52 2009 Subject: [plt-scheme] sqlite:finalize statement throws unexpectedly In-Reply-To: References: Message-ID: On Mon, Oct 12, 2009 at 3:19 PM, David Storrs wrote: > On Mon, Oct 12, 2009 at 5:07 PM, Jay McCarthy wrote: >> The contract for finalize specifies #2. > > No, I got that. ?I was just surprised. ?It would be nice if the > contract was (-> statement? void?) instead of (-> open-statement? > void?). It can cause a core dump if you finalize twice. This contract avoids that problem without hiding the error from the programmer. There may be other ways to avoid it in the implementation... but I prefer exposing errors like this to programmer... just my philosophy I guess. > >> Re: #3 --- SQLite's sqlite3_finalize returns a status. I uniformly >> turn these status values into exns. My attitude is that the C API >> allows you to forget to handle errors but the Scheme API should never >> fail without warning. > > Agreed, absolutely. ?My thought was only that, in practice, the author > *must* have already dealt with this error, because an exception would > have been thrown when he tried to execute the statement in the first > place. ?The finalize is re-raising an already-dealt-with error. ?For > example: > > ;; ? ?Assume the users table has a UNIQUE constraint on username > (let ((stmt (prepare db "insert into users (username, password) values > (?, ?)"))) > ?(with-handlers ((sqlite:exn? (finalize stmt) (void))) > ? ?(run stmt 'Joe' 'pass1') ; executes fine, row is inserted > ? ?(run stmt 'Joe' 'pass1') ; => exn:sqlite. ?This user already exists > ) > > This is a simplified version of what I was just debugging. ?It took me > a while to realize that the with-handlers was working fine; it's > simply that the handler function was re-raising the error, when I > expected it to ensure that the statement was finalized and then eat > the exception. > > The way the sqlite module is currently written, one needs to wrap a > with-handlers around every call to finalize, just in case the > statement had problems when it was run. ?That seems redundant. I agree that it is silly that SQLite errors in this situation. I am worried that removing the possibility of error on finalize will hide real errors. I am not an expert on its implementation, so I trust the API they've developed. FWIW, you can define your own finalize* that is implicitly in a with-handlers. Jay > > --Dks > -- 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 Oct 12 17:30:10 2009 From: david.storrs at gmail.com (David Storrs) Date: Mon Oct 12 17:30:29 2009 Subject: [plt-scheme] sqlite:finalize statement throws unexpectedly In-Reply-To: References: Message-ID: On Mon, Oct 12, 2009 at 5:27 PM, Jay McCarthy wrote: > On Mon, Oct 12, 2009 at 3:19 PM, David Storrs wrote: > It can cause a core dump if you finalize twice. This contract avoids > that problem without hiding the error from the programmer. [...] > I agree that it is silly that SQLite errors in this situation. I am > worried that removing the possibility of error on finalize will hide > real errors. I am not an expert on its implementation, so I trust the > API they've developed. FWIW, you can define your own finalize* that is > implicitly in a with-handlers. Ah, ok. Now it makes more sense. Thanks for taking the time to explain. --Dks From stephen.degabrielle at acm.org Mon Oct 12 17:50:46 2009 From: stephen.degabrielle at acm.org (Stephen De Gabrielle) Date: Mon Oct 12 17:51:07 2009 Subject: [plt-scheme] Tool/plugin: packer.plt In-Reply-To: <4ACF6290.1040600@cs.utah.edu> References: <595b9ab20910090612q98420e4g8c05fef3acaf67da@mail.gmail.com> <4ACF6290.1040600@cs.utah.edu> Message-ID: <595b9ab20910121450j156934e0j757377ad10041382@mail.gmail.com> Hi Jon, Thanks for your comments. I've updated the packer tool, and I feel I've addressed your points best I can for the moment. (see below) As usual, to load (require (planet spdegabrielle/packer:1:1)) [ http://planet.plt-scheme.org/display.ss?package=packer.plt&owner=spdegabrielle ] Thanks again, Stephen > I tried it out. Its a good idea, I think. Usually I make these dumb little makefiles to generate .plt files but I'd rather use something else. > > 1. if I run 'pack .plt' without saving the current buffer (I mean its a brand > new, unnamed buffer) I get some error about split-path and #f. it now just ignores the request - I think I should work out how to generate a DrScheme-ey error message (like check-syntax) > 2. if my current file is blah.ss then the resulting .plt file is blah.ss.plt. I > think it should be just blah.plt fixed > 3. at first I was worried that only blah.ss was part of the .plt package but > when I did 'planet structure blah.ss.plt' I noticed everything in the > directory where blah.ss was (or maybe it was the current working directory, > which happened to be the same) was also included. It would be nice if I > could manually select the files with the option of "include all .ss files found > recursively" or something. This is especially important because even if I am > in my project directory I will probably have .svn directories hanging around > that I don't want to send to planet. The manual suggests that make-planet-archive should skip subversion files/folders. On Fri, Oct 9, 2009 at 5:19 PM, Jon Rafkind wrote: > > Stephen De Gabrielle wrote: >> >> Hi, >> >> I made a simple little plugin to help get a library on planet. >> It makes an info.ss and creates a .PLT file for upload. >> >> Comments suggestions welcome- or just tell me if it's a dumb idea. >> >> > > I tried it out. Its a good idea, I think. Usually I make these dumb little makefiles to generate .plt files but I'd rather use something else. > > 1. if I run 'pack .plt' without saving the current buffer (I mean its a brand new, unnamed buffer) I get some error about split-path and #f. > > 2. if my current file is blah.ss then the resulting .plt file is blah.ss.plt. I think it should be just blah.plt > > 3. at first I was worried that only blah.ss was part of the .plt package but when I did 'planet structure blah.ss.plt' I noticed everything in the directory where blah.ss was (or maybe it was the current working directory, which happened to be the same) was also included. It would be nice if I could manually select the files with the option of "include all .ss files found recursively" or something. This is especially important because even if I am in my project directory I will probably have .svn directories hanging around that I don't want to send to planet. From rafkind at cs.utah.edu Mon Oct 12 18:00:07 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Mon Oct 12 18:02:42 2009 Subject: [plt-scheme] Tool/plugin: packer.plt In-Reply-To: <595b9ab20910121450j156934e0j757377ad10041382@mail.gmail.com> References: <595b9ab20910090612q98420e4g8c05fef3acaf67da@mail.gmail.com> <4ACF6290.1040600@cs.utah.edu> <595b9ab20910121450j156934e0j757377ad10041382@mail.gmail.com> Message-ID: <4AD3A6E7.7080103@cs.utah.edu> >> 3. at first I was worried that only blah.ss was part of the .plt package but >> when I did 'planet structure blah.ss.plt' I noticed everything in the >> directory where blah.ss was (or maybe it was the current working directory, >> which happened to be the same) was also included. It would be nice if I >> could manually select the files with the option of "include all .ss files found >> recursively" or something. This is especially important because even if I am >> in my project directory I will probably have .svn directories hanging around >> that I don't want to send to planet. >> > > The manual suggests that make-planet-archive should skip subversion > files/folders. > > Ok, duly noted but its still an issue. I tend to make a lot of files that ultimately should not get sent to planet so I need some way to cull them. A new issue: it would be nice if the packer read the existing info.ss file so I don't have to fill out the same information each time. Also, shouldn't there be a release notes section? One more: when the tool creates the file it would be nice if a message popped up saying "created blah.plt" or something. Or what would be *really* nice is if a dialog box popped up asking if the user wants to send the package to planet, and then asks for the username/password and does the whole upload process automatically. From plt at synx.us.to Mon Oct 12 22:27:40 2009 From: plt at synx.us.to (Synx) Date: Mon Oct 12 22:28:07 2009 Subject: [plt-scheme] Apply a procedure in a module In-Reply-To: <19155.39931.884074.108120@winooski.ccs.neu.edu> References: <4AD39273.6040804@synx.us.to> <19155.39931.884074.108120@winooski.ccs.neu.edu> Message-ID: <4AD3E59C.5090404@synx.us.to> --main works great, and was pretty much what I was looking for. But I wanted to point out why (command-line) is not what I'm looking for, in case it trips anyone up. It doesn't distinguish between whether a file was imported as a module or called as a script. So if I were to say: commandline.ss --- #lang scheme/base (require scheme/cmdline) (define (main) (display "test\n")) (command-line #:once-any (("-g" "--go") "GO" (main))) --- test-commandline.ss --- #lang scheme/base (require scheme/cmdline) (require (prefix-in commandline: "commandline.ss")) (define (main) (display "foo\n")) (command-line #:once-any (("-g" "--go") "GO" (main))) --- Then when I went to say $ mz -n -t test-commandline.ss -- -g It will run both main functions, even though I don't want commandline:main to run at all when I invoke test-commandline.ss. From eli at barzilay.org Mon Oct 12 23:15:20 2009 From: eli at barzilay.org (Eli Barzilay) Date: Mon Oct 12 23:15:43 2009 Subject: [plt-scheme] Apply a procedure in a module In-Reply-To: <4AD3E59C.5090404@synx.us.to> References: <4AD39273.6040804@synx.us.to> <19155.39931.884074.108120@winooski.ccs.neu.edu> <4AD3E59C.5090404@synx.us.to> Message-ID: <19155.61640.713811.480868@winooski.ccs.neu.edu> On Oct 12, Synx wrote: > Then when I went to say > $ mz -n -t test-commandline.ss -- -g > > It will run both main functions, even though I don't want > commandline:main to run at all when I invoke test-commandline.ss. You can still use `command-line' with different flags for different modules, or you could use the value of (find-system-path 'run-file) to decide whether to run the function or not. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From brvlaeth at vub.ac.be Tue Oct 13 10:32:37 2009 From: brvlaeth at vub.ac.be (Brecht Van Laethem) Date: Tue Oct 13 10:33:05 2009 Subject: [plt-scheme] program online game Message-ID: <1255444357.15208.3.camel@brecht> I know scheme for offline use but now we have to program an online version of the boardgame Stratego (http://en.wikipedia.org/wiki/Stratego) in Scheme as a task for school. Which library should I use best for this? You must be able to select a pawn (this will probably be a jpeg or gif) and remove it to another square on the gameboard (this will probably be an array of pictures) I've read the library Continue (http://docs.plt-scheme.org/continue/index.html). It shows how you can make an online blog with scheme. Is this a suitable library for an online game? I can't find how you can put an image on a specific position on the screen. I've noticed that there is also another library: Web (http://docs.plt-scheme.org/web-server/index.html). This library seems more complex then the Continue library. I've with this library the same problem: I can't find how you can use images. What's the easiest way to select a pawn? A button with a picture above it so you can't see the button? With friendly regards, Brecht From marek at xivilization.net Tue Oct 13 10:55:34 2009 From: marek at xivilization.net (Marek Kubica) Date: Tue Oct 13 10:55:59 2009 Subject: [plt-scheme] program online game In-Reply-To: <1255444357.15208.3.camel@brecht> References: <1255444357.15208.3.camel@brecht> Message-ID: <20091013165534.5591e08f@halmanfloyd.lan.local> On Tue, 13 Oct 2009 16:32:37 +0200 Brecht Van Laethem wrote: > I've read the library Continue > (http://docs.plt-scheme.org/continue/index.html). It shows how you can > make an online blog with scheme. Is this a suitable library for an > online game? I can't find how you can put an image on a specific > position on the screen. Because you need to know HTML and CSS for that. But that's orthogonal to Scheme, that is: the backend (Scheme) and frontend (HTML) are independent of each other. regards, Marek From david.storrs at gmail.com Tue Oct 13 11:58:10 2009 From: david.storrs at gmail.com (David Storrs) Date: Tue Oct 13 11:58:30 2009 Subject: [plt-scheme] program online game In-Reply-To: <20091013165534.5591e08f@halmanfloyd.lan.local> References: <1255444357.15208.3.camel@brecht> <20091013165534.5591e08f@halmanfloyd.lan.local> Message-ID: > On Tue, 13 Oct 2009 16:32:37 +0200 > Brecht Van Laethem wrote: > >> I can't find how you can put an image on a specific position on the screen. The simplest, easiest way to do this is to build the board as a full-screen table where each table cell corresponds to one square on the Stratego board. The table as a whole will have a very large transparent background image of the Stratego board (the water, etc). Squares (i.e. table cells) with pieces in them will have a background image of the piece in question which will overlay the table's background. Moving the pawns consists of selecting the pawn you want to move, then selecting the square you want to move to. The page will then be refreshed with the images in new places that represent the new state of the board. If you really want to support drag-and-drop moving of pieces, updates that don't require full refresh, and other "eye-candy", then I suggest you look into jQuery, or one of its competitors (YUI, Dojo, etc). I would suggest, however, that you get the game logic working with the method I describe above and then go back and implement the eye-candy. --Dks From sbloch at adelphi.edu Tue Oct 13 12:02:57 2009 From: sbloch at adelphi.edu (Stephen Bloch) Date: Tue Oct 13 12:03:13 2009 Subject: [plt-scheme] Download links in PLaneT In-Reply-To: <595b9ab20910121450j156934e0j757377ad10041382@mail.gmail.com> References: <595b9ab20910090612q98420e4g8c05fef3acaf67da@mail.gmail.com> <4ACF6290.1040600@cs.utah.edu> <595b9ab20910121450j156934e0j757377ad10041382@mail.gmail.com> Message-ID: Is there any way to download a specified .plt file from the PLaneT server other than by running DrScheme with a "(require planet ...)"? This past weekend I was out of town on vacation, and I could get a Net connection through my phone (which doesn't have DrScheme installed), but not through my laptop (which does). I was also able to communicate (with some difficulty) between the phone and the laptop, so I could have ftp'ed a .plt file from phone to laptop, but I couldn't figure out how to download the .plt file to the phone. Likewise, it would be nice in setting up a student lab if I could download the .plt file once and use the local copy for each of the computers in the lab, rather than having each computer download separately from the PLaneT server. Stephen Bloch sbloch@adelphi.edu From grettke at acm.org Tue Oct 13 12:09:31 2009 From: grettke at acm.org (Grant Rettke) Date: Tue Oct 13 12:10:06 2009 Subject: [plt-scheme] program online game In-Reply-To: <1255444357.15208.3.camel@brecht> References: <1255444357.15208.3.camel@brecht> Message-ID: <756daca50910130909o570abac3o24f0701a4d00527f@mail.gmail.com> On Tue, Oct 13, 2009 at 9:32 AM, Brecht Van Laethem wrote: > Which library should I use best for this? You must be able to select a > pawn (this will probably be a jpeg or gif) and remove it to another > square on the gameboard (this will probably be an array of pictures) As long as the back-end is in Scheme you should investigate the best options for implementing the GUI you describe be they Scheme or not. What about something like Flex or Flash? From carl.eastlund at gmail.com Tue Oct 13 12:09:23 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Tue Oct 13 12:10:10 2009 Subject: [plt-scheme] Download links in PLaneT In-Reply-To: References: <595b9ab20910090612q98420e4g8c05fef3acaf67da@mail.gmail.com> <4ACF6290.1040600@cs.utah.edu> <595b9ab20910121450j156934e0j757377ad10041382@mail.gmail.com> Message-ID: <990e0c030910130909y7738efb8l16989c2a5fe6f85a@mail.gmail.com> There is a 'planet' command-line tool that does these things. It sounds like you would be most interested in 'planet fetch' (which downloads without installing) and 'planet fileinject' (which installs from a local file). Run 'planet' with no options to get a list of commands, and 'planet --help' for information on . Carl Eastlund On Tue, Oct 13, 2009 at 12:02 PM, Stephen Bloch wrote: > Is there any way to download a specified .plt file from the PLaneT server > other than by running DrScheme with a "(require planet ...)"? ?This past > weekend I was out of town on vacation, and I could get a Net connection > through my phone (which doesn't have DrScheme installed), but not through my > laptop (which does). ?I was also able to communicate (with some difficulty) > between the phone and the laptop, so I could have ftp'ed a .plt file from > phone to laptop, but I couldn't figure out how to download the .plt file to > the phone. > > Likewise, it would be nice in setting up a student lab if I could download > the .plt file once and use the local copy for each of the computers in the > lab, rather than having each computer download separately from the PLaneT > server. > > > > Stephen Bloch > sbloch@adelphi.edu From jay.mccarthy at gmail.com Tue Oct 13 11:05:35 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Tue Oct 13 12:11:00 2009 Subject: [plt-scheme] program online game In-Reply-To: <1255444357.15208.3.camel@brecht> References: <1255444357.15208.3.camel@brecht> Message-ID: I would try to do it in the world style and use the Javascript/Flash compiler some are developing. Start here: http://world.cs.brown.edu/ Jay On Tue, Oct 13, 2009 at 8:32 AM, Brecht Van Laethem wrote: > I know scheme for offline use but now we have to program an online > version of the boardgame Stratego > (http://en.wikipedia.org/wiki/Stratego) in Scheme as a task for school. > > > Which library should I use best for this? You must be able to select a > pawn (this will probably be a jpeg or gif) and remove it to another > square on the gameboard (this will probably be an array of pictures) > > > I've read the library Continue > (http://docs.plt-scheme.org/continue/index.html). It shows how you can > make an online blog with scheme. Is this a suitable library for an > online game? I can't find how you can put an image on a specific > position on the screen. > > > I've noticed that there is also another library: Web > (http://docs.plt-scheme.org/web-server/index.html). This library seems > more complex then the Continue library. I've with this library the same > problem: I can't find how you can use images. > > > What's the easiest way to select a pawn? A button with a picture above > it so you can't see the button? > > > > With friendly regards, > > Brecht > > _________________________________________________ > ?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 sbloch at adelphi.edu Tue Oct 13 12:10:37 2009 From: sbloch at adelphi.edu (Stephen Bloch) Date: Tue Oct 13 12:11:04 2009 Subject: [plt-scheme] program online game In-Reply-To: References: <1255444357.15208.3.camel@brecht> <20091013165534.5591e08f@halmanfloyd.lan.local> Message-ID: <5BB372CA-90CB-4759-A3B1-D1926D447AFC@adelphi.edu> On Oct 13, 2009, at 11:58 AM, David Storrs wrote: >> On Tue, 13 Oct 2009 16:32:37 +0200 >> Brecht Van Laethem wrote: >> >>> I can't find how you can put an image on a specific position on >>> the screen. > > The simplest, easiest way to do this is to build the board as a > full-screen table where each table cell corresponds to one square on > the Stratego board. ... > If you really want to support drag-and-drop moving of pieces, updates > that don't require full refresh, and other "eye-candy", then I suggest > you look into jQuery, or one of its competitors (YUI, Dojo, etc). Another approach is to use the "universe" and "tiles" (or "image") teachpacks. "tiles" (which includes "image") gives you a bunch of basic operations on images, such as rotation, reflection, vertical and horizontal concatenation, etc. "universe" gives you event- driven, client/server GUI programming. Both are intended to be accessible to first-year students, but still give you enough power to develop a moderately serious GUI. One of my first-year students wrote a chess program three or four years ago in a much more primitive version of "universe" (which didn't have networking or mouse input, only keyboard input) Stephen Bloch sbloch@adelphi.edu From jay.mccarthy at gmail.com Tue Oct 13 12:13:47 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Tue Oct 13 12:14:08 2009 Subject: [plt-scheme] Download links in PLaneT In-Reply-To: <990e0c030910130909y7738efb8l16989c2a5fe6f85a@mail.gmail.com> References: <595b9ab20910090612q98420e4g8c05fef3acaf67da@mail.gmail.com> <4ACF6290.1040600@cs.utah.edu> <595b9ab20910121450j156934e0j757377ad10041382@mail.gmail.com> <990e0c030910130909y7738efb8l16989c2a5fe6f85a@mail.gmail.com> Message-ID: I don't that is useful either, because the phone doesn't have that tool. Jay On Tue, Oct 13, 2009 at 10:09 AM, Carl Eastlund wrote: > There is a 'planet' command-line tool that does these things. ?It > sounds like you would be most interested in 'planet fetch' (which > downloads without installing) and 'planet fileinject' (which installs > from a local file). ?Run 'planet' with no options to get a list of > commands, and 'planet --help' for information on . > > Carl Eastlund > > On Tue, Oct 13, 2009 at 12:02 PM, Stephen Bloch wrote: >> Is there any way to download a specified .plt file from the PLaneT server >> other than by running DrScheme with a "(require planet ...)"? ?This past >> weekend I was out of town on vacation, and I could get a Net connection >> through my phone (which doesn't have DrScheme installed), but not through my >> laptop (which does). ?I was also able to communicate (with some difficulty) >> between the phone and the laptop, so I could have ftp'ed a .plt file from >> phone to laptop, but I couldn't figure out how to download the .plt file to >> the phone. >> >> Likewise, it would be nice in setting up a student lab if I could download >> the .plt file once and use the local copy for each of the computers in the >> lab, rather than having each computer download separately from the PLaneT >> server. >> >> >> >> Stephen Bloch >> sbloch@adelphi.edu > _________________________________________________ > ?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 carl.eastlund at gmail.com Tue Oct 13 12:15:08 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Tue Oct 13 12:15:45 2009 Subject: [plt-scheme] Download links in PLaneT In-Reply-To: References: <595b9ab20910090612q98420e4g8c05fef3acaf67da@mail.gmail.com> <4ACF6290.1040600@cs.utah.edu> <595b9ab20910121450j156934e0j757377ad10041382@mail.gmail.com> <990e0c030910130909y7738efb8l16989c2a5fe6f85a@mail.gmail.com> Message-ID: <990e0c030910130915o1fa12466vb2d1a6a96981ce67@mail.gmail.com> It should be for setting up a student lab, if not for the phone situation. Carl Eastlund On Tue, Oct 13, 2009 at 12:13 PM, Jay McCarthy wrote: > I don't that is useful either, because the phone doesn't have that tool. > > Jay > > On Tue, Oct 13, 2009 at 10:09 AM, Carl Eastlund wrote: >> There is a 'planet' command-line tool that does these things. ?It >> sounds like you would be most interested in 'planet fetch' (which >> downloads without installing) and 'planet fileinject' (which installs >> from a local file). ?Run 'planet' with no options to get a list of >> commands, and 'planet --help' for information on . >> >> Carl Eastlund >> >> On Tue, Oct 13, 2009 at 12:02 PM, Stephen Bloch wrote: >>> Is there any way to download a specified .plt file from the PLaneT server >>> other than by running DrScheme with a "(require planet ...)"? ?This past >>> weekend I was out of town on vacation, and I could get a Net connection >>> through my phone (which doesn't have DrScheme installed), but not through my >>> laptop (which does). ?I was also able to communicate (with some difficulty) >>> between the phone and the laptop, so I could have ftp'ed a .plt file from >>> phone to laptop, but I couldn't figure out how to download the .plt file to >>> the phone. >>> >>> Likewise, it would be nice in setting up a student lab if I could download >>> the .plt file once and use the local copy for each of the computers in the >>> lab, rather than having each computer download separately from the PLaneT >>> server. >>> >>> >>> >>> Stephen Bloch >>> sbloch@adelphi.edu From pltscheme at pnkfx.org Tue Oct 13 14:59:58 2009 From: pltscheme at pnkfx.org (Felix Klock's PLT scheme proxy) Date: Tue Oct 13 15:00:27 2009 Subject: [plt-scheme] ICFP videos now available In-Reply-To: <53ff55480910050706v4411ecdfr36b3a838c1419870@mail.gmail.com> References: <53ff55480910050706v4411ecdfr36b3a838c1419870@mail.gmail.com> Message-ID: <87FFEC3E-2ED4-4EA5-9A13-7338C8A105DB@pnkfx.org> Matthew (cc'ing PLT Scheme)- After hearing Matthias make various references to "Princesses" and "Wishing Wells" to his students, and then watching the video of Matthew's talk about Scribble [1] (and thus resolving the previously "unbound references" introduced into my life by Matthias), I was dumbstruck a day later when I happened to leaf through the paper "Breaking Paragraphs Into Lines" [2] (which documents TeX's algorithm and gives an interesting retrospective on the history of line-breaking). Why was I dumbstruck? Well, I discovered that Knuth and Plass used, as a running example of paragraph layout in the paper, a story that immediately starts off discussing Wishes, a Princess, and a Well (!!!). The paper [2] does not seem to be freely available online, but the running examples have been transcribed at the following URL, so that you can see (a prefix of) the story for yourself. http://defoe.sourceforge.net/folio/knuth-plass.html (For the whole story [3], I guess you'll have to find the paper, or snag someone's copy of "Digital Typography.") It is this sort of subtle detail that turns a cute analogy into a strange loop worthy of Douglas Hofstadter. Bravo Matthew, bravo! -Felix [1] http://www.vimeo.com/user2191865/albums [2] Donald E. Knuth and Michael F. Plass, "Breaking Paragraphs Into Lines," Software: Practice and Experience 11 (1981) 1119-1184. [3] Then again, the "whole story" is not really worth reading, IMO. I don't understand the moral of "The Frog Prince" (at least as rendered in Knuth's version). Maybe Disney will explain it to me later this year, but I doubt it. From yinso.chen at gmail.com Tue Oct 13 16:14:14 2009 From: yinso.chen at gmail.com (YC) Date: Tue Oct 13 16:21:20 2009 Subject: [plt-scheme] Download links in PLaneT In-Reply-To: <990e0c030910130915o1fa12466vb2d1a6a96981ce67@mail.gmail.com> References: <595b9ab20910090612q98420e4g8c05fef3acaf67da@mail.gmail.com> <4ACF6290.1040600@cs.utah.edu> <595b9ab20910121450j156934e0j757377ad10041382@mail.gmail.com> <990e0c030910130909y7738efb8l16989c2a5fe6f85a@mail.gmail.com> <990e0c030910130915o1fa12466vb2d1a6a96981ce67@mail.gmail.com> Message-ID: <779bf2730910131314j17749365g4fb5cc699ee297de@mail.gmail.com> On Tue, Oct 13, 2009 at 9:15 AM, Carl Eastlund wrote: > It should be for setting up a student lab, if not for the phone situation. > > A similar issue is the recent planet outage - http://groups.google.com/group/plt-scheme/browse_thread/thread/bd9108a0081f973a?pli=1- it's desirable not to have to depend solely on the central planet server. Having a proxy pulling from the central planet server (either real-time or batch) would solve the problem for both cases. And to use such server we'll need to configure the url that planet will point to. It seems that the value of the planet server is hardcoded in COLLECTS/planet/config.ss, and it would be a pain to modify the value for each installed PLT instance. It's better if the value is read from a environment variable or a file (one which the planet command line tool can also read and modify). Once this is made configurable, a planet proxy can be built and used. For now - how about use an environment variable called PLTPLANETURL (or another more preferable name)? If so below is a potential patch. --- plt-4.2.1/collects/planet/config.ss 2009-07-16 05:28:08.000000000 -0700 +++ plt-scheme/planet/config.ss 2009-10-13 13:09:09.000000000 -0700 @@ -19,6 +19,7 @@ (DEFAULT-PACKAGE-LANGUAGE (version)) (USE-HTTP-DOWNLOADS? #t) - (HTTP-DOWNLOAD-SERVLET-URL " http://planet.plt-scheme.org/servlets/planet-servlet.ss") + (HTTP-DOWNLOAD-SERVLET-URL (let ((url (getenv "PLTPLANETURL"))) + (if (not url) " http://planet.plt-scheme.org/servlets/planet-servlet.ss" url))) (PLANET-ARCHIVE-FILTER #f))) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091013/9195162c/attachment.htm From jmj at fellowhuman.com Tue Oct 13 16:25:58 2009 From: jmj at fellowhuman.com (Jordan Johnson) Date: Tue Oct 13 16:26:18 2009 Subject: [plt-scheme] number->string in BSL Message-ID: Hi all, Is there a way to control the translation of numbers to strings in Beginning Student Language? I had expected that the "Output Syntax" options in the language menu would control it, but it seems number->string is rendering all exact decimals as fractions. For example: > (number->string .1) "1/10" Thanks, jmj From robby at eecs.northwestern.edu Tue Oct 13 19:06:56 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Tue Oct 13 19:07:18 2009 Subject: [plt-scheme] 2htdp/image Message-ID: <932b2f1f0910131606n7f356cbcvfaf80896ffb2ed1b@mail.gmail.com> 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 From dyoo at cs.wpi.edu Tue Oct 13 20:45:58 2009 From: dyoo at cs.wpi.edu (Danny Yoo) Date: Tue Oct 13 20:46:21 2009 Subject: [plt-scheme] program online game In-Reply-To: References: <1255444357.15208.3.camel@brecht> Message-ID: On Tue, Oct 13, 2009 at 11:05 AM, Jay McCarthy wrote: > I would try to do it in the world style and use the Javascript/Flash > compiler some are developing. > > Start here: http://world.cs.brown.edu/ You may be able to use Moby; it's the BSL+world-to-Javascript compiler that Jay refers to. You can start here: http://github.com/dyoo/moby-scheme Moby takes a program written in BSL+World and translates them into a Javascript program that can run on your web browser. As an example, you can look at the baduk-clock (igo Clock) example in: http://github.com/dyoo/moby-scheme/blob/master/examples/baduk-clock.ss You can see a demo of the program running here: http://hashcollision.org/baduk-clock/ It's a game clock; note that it uses HTML input elements --- buttons --- as its main UI. (If you're running with a fairly modern web browser, one of those buttons is styled using a CSS rotation transformation!) For the button with a picture, for example, something like this may work: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; #lang moby ;; The world consists of a number. ;; We have two images, a plus and a minus image, that we'll plop onto our buttons. (define PLUS (js-img "http://boredzo.org/buttonicons/plus-8.png")) (define MINUS (js-img "http://boredzo.org/buttonicons/minus-8.png")) ;; plus-press: world -> world (define (plus-press w) (add1 w)) ;; minus-press: world -> world (define (minus-press w) (sub1 w)) ;; draw: world -> dom-sexp (define (draw w) (list (js-div '((id "main"))) (list (js-text (format "World contains: ~a" w))) (list (js-button plus-press) (list PLUS)) (list (js-button minus-press) (list MINUS)))) ;; draw-css: world -> css-sexp ;; Let all text drawn in the main div have a font size of 30px. (define (draw-css w) '(("main" ("font-size" "30px")))) (js-big-bang 0 (on-draw draw draw-css)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Moby itself is still in very rough shape and under active development; I've got a sketch of documentation in: http://github.com/dyoo/moby-scheme/blob/master/doc/moby-user-api.txt which we're working to Scribble; hopefully we'll have something more reasonable in the very near future. But if Moby can make your Stratego program work on the web, I'd be thrilled. Let me know if you have any questions! From mflatt at cs.utah.edu Tue Oct 13 21:16:44 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Tue Oct 13 21:17:36 2009 Subject: [plt-scheme] ICFP videos now available In-Reply-To: <87FFEC3E-2ED4-4EA5-9A13-7338C8A105DB@pnkfx.org> References: <53ff55480910050706v4411ecdfr36b3a838c1419870@mail.gmail.com> <87FFEC3E-2ED4-4EA5-9A13-7338C8A105DB@pnkfx.org> Message-ID: <20091014011646.877F06500BA@mail-svr1.cs.utah.edu> At Tue, 13 Oct 2009 14:59:58 -0400, Felix Klock's PLT scheme proxy wrote: > Well, I discovered that Knuth and Plass used, > as a running example of paragraph layout in the paper, a story that > immediately starts off discussing Wishes, a Princess, and a Well (!!!). I wish I knew enough to have done that on purpose! From matthias at ccs.neu.edu Tue Oct 13 21:21:09 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Tue Oct 13 21:21:57 2009 Subject: [plt-scheme] program online game In-Reply-To: References: <1255444357.15208.3.camel@brecht> Message-ID: <8B5D741B-BF1C-471C-88A2-2FF9503CDD0B@ccs.neu.edu> Shriram told me weeks ago that Moby was a drop-down menu in drscheme. -- Matthias On Oct 13, 2009, at 8:45 PM, Danny Yoo wrote: > On Tue, Oct 13, 2009 at 11:05 AM, Jay McCarthy > wrote: >> I would try to do it in the world style and use the Javascript/Flash >> compiler some are developing. >> >> Start here: http://world.cs.brown.edu/ > > > You may be able to use Moby; it's the BSL+world-to-Javascript compiler > that Jay refers to. You can start here: > > http://github.com/dyoo/moby-scheme > > Moby takes a program written in BSL+World and translates them into a > Javascript program that can run on your web browser. As an example, > you can look at the baduk-clock (igo Clock) example in: > > http://github.com/dyoo/moby-scheme/blob/master/examples/baduk-clock.ss > > You can see a demo of the program running here: > > http://hashcollision.org/baduk-clock/ > > It's a game clock; note that it uses HTML input elements --- buttons > --- as its main UI. (If you're running with a fairly modern web > browser, one of those buttons is styled using a CSS rotation > transformation!) > > For the button with a picture, for example, something like this may > work: > > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > #lang moby > > ;; The world consists of a number. > > ;; We have two images, a plus and a minus image, that we'll plop onto > our buttons. > (define PLUS (js-img "http://boredzo.org/buttonicons/plus-8.png")) > (define MINUS (js-img "http://boredzo.org/buttonicons/minus-8.png")) > > ;; plus-press: world -> world > (define (plus-press w) > (add1 w)) > > ;; minus-press: world -> world > (define (minus-press w) > (sub1 w)) > > ;; draw: world -> dom-sexp > (define (draw w) > (list (js-div '((id "main"))) > (list (js-text (format "World contains: ~a" w))) > (list (js-button plus-press) > (list PLUS)) > (list (js-button minus-press) > (list MINUS)))) > > ;; draw-css: world -> css-sexp > ;; Let all text drawn in the main div have a font size of 30px. > (define (draw-css w) > '(("main" ("font-size" "30px")))) > > (js-big-bang 0 > (on-draw draw draw-css)) > ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; > > > Moby itself is still in very rough shape and under active development; > I've got a sketch of documentation in: > > http://github.com/dyoo/moby-scheme/blob/master/doc/moby-user- > api.txt > > which we're working to Scribble; hopefully we'll have something more > reasonable in the very near future. > > > But if Moby can make your Stratego program work on the web, I'd be > thrilled. Let me know if you have any questions! > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From dyoo at cs.wpi.edu Tue Oct 13 23:55:57 2009 From: dyoo at cs.wpi.edu (Danny Yoo) Date: Tue Oct 13 23:56:16 2009 Subject: [plt-scheme] program online game In-Reply-To: <8B5D741B-BF1C-471C-88A2-2FF9503CDD0B@ccs.neu.edu> References: <1255444357.15208.3.camel@brecht> <8B5D741B-BF1C-471C-88A2-2FF9503CDD0B@ccs.neu.edu> Message-ID: On Tue, Oct 13, 2009 at 9:21 PM, Matthias Felleisen wrote: > > Shriram told me weeks ago that Moby was a drop-down menu in drscheme. -- This is my fault: I misunderstood Shriram and didn't communicate my misunderstanding with him until very lately. The hook into DrScheme is not currently a drop-down; it is implemented in terms of overriding #%module-begin. Running a program in the Moby language will invoke the compiler. From scott at adrenaline.com Wed Oct 14 06:31:46 2009 From: scott at adrenaline.com (Scott McLoughlin) Date: Wed Oct 14 06:32:10 2009 Subject: [plt-scheme] Questions on PLT status and project structure Message-ID: <4AD5A892.6090209@adrenaline.com> Kind folks - a few questions on PLT Scheme: First questions regard performance. First, is there an inlining directive (or delcaration or proclamation, etc.) Second, are there type proclamations to speed up common fixnum arithmatec, vector indexes, etc. Is there are role for typed-scheme here? Second questions reqargd PLT as an open source project. Are there good documents on PLT internals and optimization/compilation strategies? Is there are formal "front end" vs. optimizations vs. "back end + more optimizations" style architecture to the compiler? A simple matter of fact, is there a considerable number of community contributors to the "core group" working on the PLT compiler and runtime system itself? Third, is there thorough documentation (NOT academic papers) on the PLT JIT. Fourth, Is there a formal roadmap for the Planet libraries - a sort of wishlist from the core development group or user community vote/consensus. Similarly, is there an up to date raodmap for the core PLT system? Fifth, how well is the PLT system structures towards becoming a user-driven open source project? To boil all this down to a general scheme community question, PLT has become *very* popular in the scheme community (programmer community, to a lesser degree) at large. How stable a platform does it present for a future canonical open source project should the academic group behind PLT abandon the platform for one reason or another (lack of funding, changing research focus, etc.) Scott From jay.mccarthy at gmail.com Wed Oct 14 07:19:30 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Wed Oct 14 07:19:51 2009 Subject: [plt-scheme] Questions on PLT status and project structure In-Reply-To: <4AD5A892.6090209@adrenaline.com> References: <4AD5A892.6090209@adrenaline.com> Message-ID: I can answer some questions, but none authoritatively. A lot of the low-level ones seem to be for Matthew and the high-level ones will have elegant answers from Matthias. On Wed, Oct 14, 2009 at 4:31 AM, Scott McLoughlin wrote: > Kind folks - a few questions on PLT Scheme: > > First questions regard performance. First, is there an inlining directive > (or delcaration or proclamation, etc.) Not really, but using modules allows inlining of core MzScheme primitives. > Second, are there type proclamations to speed up common fixnum arithmatec, > vector indexes, etc. ?Is there > are role for typed-scheme here? Sam jokes that Typed Scheme uses types to make your program slower. The point (now) is safety, not speed. You may be interested in the recently added unsafe ops: http://pre.plt-scheme.org/docs/html/reference/unsafe.html > > Second questions reqargd PLT as an open source project. Are there good > documents on PLT internals and > optimization/compilation strategies? The "Inside" manual is what there is: http://pre.plt-scheme.org/docs/html/inside/index.html I don't think it is really what you're looking for though. > Is there are formal "front end" vs. > optimizations vs. "back end + more > optimizations" style architecture to the compiler? ?A simple matter of fact, > is there a considerable number of > community contributors to the "core group" working on the PLT compiler and > runtime system itself? Not really. The PLT compiler and runtime system is a generous gift of Matthew Flatt and people who have sat within a few hundred feet of him. (IIUC, Robby did a lot of work on the original MrEd portion, but now "only" develops the tremendously large and useful DrScheme, contracts, Redex, and GUI libraries.) > Third, is there thorough documentation (NOT academic papers) on the PLT JIT. The JIT is GNU Lightning. The documentation on the decompiler gives you an idea about how the JIT is used/what the low-level VM *is*: http://pre.plt-scheme.org/docs/html/mzc/decompile.html > Fourth, ?Is there a formal roadmap for the Planet libraries - a sort of > wishlist from the core development group > or user community vote/consensus. I don't know of anything such thing for PLaneT. > Similarly, is there an up to date raodmap > for the core PLT system? In the past year I can think of two mailing list threads suggesting projects that non-core members can do for the core. One that comes to mind is writing Typed Scheme wrappers or re-implementations: http://www.ccs.neu.edu/home/samth/adapt/ Also, the PLT group recently had a meeting to coordinate our work, but that wasn't so much a formal "roadmap". > > Fifth, how well is the PLT system structures towards becoming a user-driven > open source project? I don't really understand what this means. I think of it as user-driven but I feel like we must have different definitions. > > To boil all this down to a general scheme community question, PLT has become > *very* popular in the > scheme community (programmer community, to a lesser degree) at large. How > stable a platform does > it present for a future canonical open source project should the academic > group behind PLT abandon > the platform for one reason or another (lack of funding, changing research > focus, etc.) Speaking for myself, I can't think of anything that would make me give up on PLT. I would guess that most would say the same. Jay > > Scott > > _________________________________________________ > ?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 robby at eecs.northwestern.edu Wed Oct 14 07:27:37 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Wed Oct 14 07:27:56 2009 Subject: [plt-scheme] Questions on PLT status and project structure In-Reply-To: References: <4AD5A892.6090209@adrenaline.com> Message-ID: <932b2f1f0910140427l4a5cb130q28f63d2d4508dadc@mail.gmail.com> On Wed, Oct 14, 2009 at 6:19 AM, Jay McCarthy wrote: >> Is there are formal "front end" vs. >> optimizations vs. "back end + more >> optimizations" style architecture to the compiler? ?A simple matter of fact, >> is there a considerable number of >> community contributors to the "core group" working on the PLT compiler and >> runtime system itself? > > Not really. The PLT compiler and runtime system is a generous gift of > Matthew Flatt and people who have sat within a few hundred feet of > him. (IIUC, Robby did a lot of work on the original MrEd portion, > ... Well, for many years I was the first to complain about broken things in new functionality, but I'm not sure how much that counts :) >> To boil all this down to a general scheme community question, PLT has become >> *very* popular in the >> scheme community (programmer community, to a lesser degree) at large. How >> stable a platform does >> it present for a future canonical open source project should the academic >> group behind PLT abandon >> the platform for one reason or another (lack of funding, changing research >> focus, etc.) > > Speaking for myself, I can't think of anything that would make me give > up on PLT. I would guess that most would say the same. I certainly would. Robby From geoff at knauth.org Wed Oct 14 07:54:48 2009 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Wed Oct 14 07:55:06 2009 Subject: [plt-scheme] Questions on PLT status and project structure In-Reply-To: References: <4AD5A892.6090209@adrenaline.com> Message-ID: <6E527756-6898-4748-B841-1215819E674F@knauth.org> On Oct 14, 2009, at 07:19, Jay McCarthy wrote: > Speaking for myself, I can't think of anything that would make me give > up on PLT. I would guess that most would say the same. PLT is the most interesting continuously operating and improving and energetic project and community I've encountered in years. Signal-to- noise is very high. I suppose I'll have to stop using it when I'm dead, but it may very well keep me alive longer. It certainly feeds my brain. From sk at cs.brown.edu Wed Oct 14 08:04:42 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Wed Oct 14 08:05:20 2009 Subject: [plt-scheme] Questions on PLT status and project structure In-Reply-To: <4AD5A892.6090209@adrenaline.com> References: <4AD5A892.6090209@adrenaline.com> Message-ID: Scott, For one thing, given that it is a project developed on a combination of federal research support and private free time, making it open source by the last person to turn off the lights will pose no problems. We've taken certain steps to ensure that. More to the point, it's not clear that that last person is anywhere in sight. At this point we've kept the project supported for nearly just shy of 15 years (the very first DrScheme -- two variants of it -- was created in Feb and Mar 1995). Set against an average human lifespan, that's already pretty good. And we continue to actively seek more support for upcoming innovations. Furthermore, support leads to growth. The first response on this thread was from Jay McCarthy, who is a third-generation PLTer. I have no doubt that someone will ask a similar question on the PLT list or PLT Wave or PLT Ethercyberunrealspace fifteen years from now, and someone two generations descended from Jay will be saying, "Speaking for myself, I can't think of anything that would make me give up on PLT. I would guess that most would say the same." The state of the system is also interesting. Like any large project it has some cruft, but like VERY few other large projects, it has made getting rid of its own cruft a central part of the project. Since we have lots of ability to produce cruft, we will be in business for a while yet. (-: Shriram From matthias at ccs.neu.edu Wed Oct 14 08:26:08 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Wed Oct 14 08:26:48 2009 Subject: [plt-scheme] program online game In-Reply-To: References: <1255444357.15208.3.camel@brecht> <8B5D741B-BF1C-471C-88A2-2FF9503CDD0B@ccs.neu.edu> Message-ID: #lang moby works? On Oct 13, 2009, at 11:55 PM, Danny Yoo wrote: > On Tue, Oct 13, 2009 at 9:21 PM, Matthias Felleisen > wrote: >> >> Shriram told me weeks ago that Moby was a drop-down menu in >> drscheme. -- > > > This is my fault: I misunderstood Shriram and didn't communicate my > misunderstanding with him until very lately. > > The hook into DrScheme is not currently a drop-down; it is implemented > in terms of overriding #%module-begin. Running a program in the Moby > language will invoke the compiler. From clklein at eecs.northwestern.edu Wed Oct 14 09:24:16 2009 From: clklein at eecs.northwestern.edu (Casey Klein) Date: Wed Oct 14 09:24:34 2009 Subject: [plt-scheme] Questions on PLT status and project structure In-Reply-To: References: <4AD5A892.6090209@adrenaline.com> Message-ID: On Wed, Oct 14, 2009 at 6:19 AM, Jay McCarthy wrote: > > On Wed, Oct 14, 2009 at 4:31 AM, Scott McLoughlin wrote: >> Kind folks - a few questions on PLT Scheme: >> >> First questions regard performance. First, is there an inlining directive >> (or delcaration or proclamation, etc.) > > Not really, but using modules allows inlining of core MzScheme primitives. > Of course, the compiler sometimes in-lines non-primitives too. From scott at adrenaline.com Wed Oct 14 09:54:21 2009 From: scott at adrenaline.com (Scott McLoughlin) Date: Wed Oct 14 09:56:35 2009 Subject: [plt-scheme] Questions on PLT status and project structure In-Reply-To: <6E527756-6898-4748-B841-1215819E674F@knauth.org> References: <4AD5A892.6090209@adrenaline.com> <6E527756-6898-4748-B841-1215819E674F@knauth.org> Message-ID: <4AD5D80D.80303@adrenaline.com> I guess I'm noticing that PLT doesn't have exactly the same structure as some other popular open source projects. These other project structures encourage community participation (from qualified community members in different realms) in the PLT project offering it a longevity beyond the activities of the core group. Just for example, I was discouraged to learn that Alice-SML, a very nice implementation of the dialect, activity has essentially ground to a halt - in part a by product of failing to build an active dev an user community around Alice-SML. I'd hate to see the same happen the PLT, especially has I plan to use it for a reasonably large and complex projects. I have never been a "high ceremony" guy, but I can imagine partitioning subsystems and assigning responsibility outside of the core group: Documentation, Kernel/Compiler/GC/RTS documentation, SRFI maintenance, typed-scheme / scheme integration, porting, core language evolution (immutable cons cells, lazy expressions or whatever) and so forth and so on. Here we can maintain and publish a simple "Core PLT scheme language roadmap." Similarly for Plant - there might be a relatively informal but still named group of block-and-tackle application implementation folks who try to structure Planet, isolate the glaring holes in the libraries and encourage development in these areas. Again, here, the core group can publish a core "Planet Development Roadmap." Yada, yada, yada. I don't mean to propose anything radical hear. Just setting the docs/environment up for greater community participation in the language and libraries development - bringing it in line with the structure of many other open source projects, several much larger than the PLT project. Scott Geoffrey S. Knauth wrote: > On Oct 14, 2009, at 07:19, Jay McCarthy wrote: > >> Speaking for myself, I can't think of anything that would make me give >> up on PLT. I would guess that most would say the same. > > PLT is the most interesting continuously operating and improving and > energetic project and community I've encountered in years. > Signal-to-noise is very high. I suppose I'll have to stop using it > when I'm dead, but it may very well keep me alive longer. It > certainly feeds my brain. > > > From scott at adrenaline.com Wed Oct 14 09:58:45 2009 From: scott at adrenaline.com (Scott McLoughlin) Date: Wed Oct 14 09:59:06 2009 Subject: [plt-scheme] Questions on PLT status and project structure In-Reply-To: References: <4AD5A892.6090209@adrenaline.com> Message-ID: <4AD5D915.8080400@adrenaline.com> Yes, I can see how calls to sibling module functions can be treated specially by the compiler. OTOH, in a Haskell article, to paraphrase, "...we're talking about optimizations of higher order function applications; a failure to optimize calls to statically known functions is a gross compiler failure." ;-) Something like that. I suppose with all function bindings being mutable, Scheme is going to have a much tougher time of it. Casey Klein wrote: > On Wed, Oct 14, 2009 at 6:19 AM, Jay McCarthy wrote: > >> On Wed, Oct 14, 2009 at 4:31 AM, Scott McLoughlin wrote: >> >>> Kind folks - a few questions on PLT Scheme: >>> >>> First questions regard performance. First, is there an inlining directive >>> (or delcaration or proclamation, etc.) >>> >> Not really, but using modules allows inlining of core MzScheme primitives. >> >> > > Of course, the compiler sometimes in-lines non-primitives too. > > > From robby at eecs.northwestern.edu Wed Oct 14 10:03:25 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Wed Oct 14 10:03:50 2009 Subject: [plt-scheme] Questions on PLT status and project structure In-Reply-To: <4AD5D915.8080400@adrenaline.com> References: <4AD5A892.6090209@adrenaline.com> <4AD5D915.8080400@adrenaline.com> Message-ID: <932b2f1f0910140703gb96b7a7ma4c704b6d92a9592@mail.gmail.com> I don't think that set! on module variables is directly a cause (you can see that there are restrictions on this if you dig in a little bit), but instead it is an issue with the way the compiler is structured and how much information is available across module boundaries. Robby On Wed, Oct 14, 2009 at 8:58 AM, Scott McLoughlin wrote: > Yes, I can see how calls to sibling module functions can be treated > specially by > the compiler. ?OTOH, in a Haskell article, to paraphrase, "...we're talking > about > optimizations of higher order function applications; a failure to optimize > calls to > statically known functions is a gross compiler failure." ;-) ?Something like > that. > I suppose with all function bindings being mutable, Scheme is going to have > a much > tougher time of it. > > Casey Klein wrote: >> >> On Wed, Oct 14, 2009 at 6:19 AM, Jay McCarthy >> wrote: >> >>> >>> On Wed, Oct 14, 2009 at 4:31 AM, Scott McLoughlin >>> wrote: >>> >>>> >>>> Kind folks - a few questions on PLT Scheme: >>>> >>>> First questions regard performance. First, is there an inlining >>>> directive >>>> (or delcaration or proclamation, etc.) >>>> >>> >>> Not really, but using modules allows inlining of core MzScheme >>> primitives. >>> >>> >> >> Of course, the compiler sometimes in-lines non-primitives too. >> >> >> > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From noelwelsh at gmail.com Wed Oct 14 11:17:35 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Wed Oct 14 11:18:14 2009 Subject: [plt-scheme] Questions on PLT status and project structure In-Reply-To: <4AD5A892.6090209@adrenaline.com> References: <4AD5A892.6090209@adrenaline.com> Message-ID: Time is the one resource that is truly limited. My observation is that the core PLT developers spend the majority of their time working towards goals with real identified benefits (e.g. implementing compiler improvements) rather than hypothetical ones (e.g. documenting the JIT so that some previously unknown developers will suddenly start working on it). Plenty of people on this list, including me, are happy to talk about potential projects but few (99.99999% of the time, not including me) actually do anything concrete about them. I'd really much rather the people who do work on PLT just get on with it, rather than spending their creating structures and verbiage for no observable benefit. If there was a demonstrable need for the things you list I'm sure these needs will be met. Hope you don't see this as a personal attack. N. On Wed, Oct 14, 2009 at 11:31 AM, Scott McLoughlin wrote: ... > Second questions reqargd PLT as an open source project. Are there good > documents on PLT internals and > optimization/compilation strategies? Is there are formal "front end" vs. > optimizations vs. "back end + more > optimizations" style architecture to the compiler? ?A simple matter of fact, > is there a considerable number of > community contributors to the "core group" working on the PLT compiler and > runtime system itself? > > Third, is there thorough documentation (NOT academic papers) on the PLT JIT. > > Fourth, ?Is there a formal roadmap for the Planet libraries - a sort of > wishlist from the core development group > or user community vote/consensus. ?Similarly, is there an up to date raodmap > for the core PLT system? > > Fifth, how well is the PLT system structures towards becoming a user-driven > open source project? > > To boil all this down to a general scheme community question, PLT has become > *very* popular in the > scheme community (programmer community, to a lesser degree) at large. How > stable a platform does > it present for a future canonical open source project should the academic > group behind PLT abandon > the platform for one reason or another (lack of funding, changing research > focus, etc.) > > Scott > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From eli at barzilay.org Wed Oct 14 11:30:15 2009 From: eli at barzilay.org (Eli Barzilay) Date: Wed Oct 14 11:30:37 2009 Subject: [plt-scheme] Questions on PLT status and project structure In-Reply-To: <4AD5A892.6090209@adrenaline.com>, , <932b2f1f0910140427l4a5cb130q28f63d2d4508dadc@mail.gmail.com>, , <4AD5D80D.80303@adrenaline.com>, <4AD5D915.8080400@adrenaline.com> References: <4AD5A892.6090209@adrenaline.com> <4AD5D915.8080400@adrenaline.com> <6E527756-6898-4748-B841-1215819E674F@knauth.org> <4AD5D80D.80303@adrenaline.com> <932b2f1f0910140427l4a5cb130q28f63d2d4508dadc@mail.gmail.com> Message-ID: <19157.61063.782353.885922@winooski.ccs.neu.edu> [I'll probably repeat some of the things said...] On Oct 14, Scott McLoughlin wrote: > First questions regard performance. First, is there an inlining > directive (or delcaration or proclamation, etc.) No, the compiler decides what to inline. (IMO, this is better than an inline directive -- it's true that you're getting a "one size fits all" kind of a decision, but it's made by someone who knows about it much more.) See the decompiler to look over the code that the compiler generates, if you're wondering if something gets compiled or not. If you *do* need to control inlining -- especially if you need it for large chunks of code that the compiler will usually avoid, then you can use macros. Given some very basic compiler optimizations, this is a very sane path to take -- for example, see the code in "collects/scheme/private/sort.ss": after I wrote the code, I moved it all into a macro, then used the macro a few times, which means that there are several versions of sorting that get compiled for different kinds of inputs -- and the compiler can optimize them well. > Second, are there type proclamations to speed up common fixnum > arithmatec, vector indexes, etc. No. Instead, there is a new `scheme/unsafe/ops' module that provides you with unchecked versions of operations that you can use to make things run fast. > Is there are role for typed-scheme here? Yes. Currently, it doesn't do anything -- but consider that `scheme/unsafe/ops' thing -- it provides some low-level functionality that runs fast but it is unsafe. Typed scheme might be used in the future to wrap this in a safe module by forcing code to type check before compiling code that calls the unchecked functions in that module. > Second questions reqargd PLT as an open source project. Are there > good documents on PLT internals and optimization/compilation > strategies? Is there are formal "front end" vs. optimizations > vs. "back end + more optimizations" style architecture to the > compiler? There are some descriptions in the "src" directory, I think. Probably not at the level that you're hinting at. There is also the "inside" manual, but that's something that is intended for writing extensions more than a documentation of how things like the compiler are designed. > A simple matter of fact, is there a considerable number of community > contributors to the "core group" working on the PLT compiler No. > and runtime system itself? That depends on what you consider as runtime -- "core" functions? GC? Threads? IO? > Fourth, Is there a formal roadmap for the Planet libraries - a sort > of wishlist from the core development group or user community > vote/consensus. How could there be? Planet is intended for people who want to share code. > Similarly, is there an up to date raodmap for the core PLT system? No, unless you consider piles of todo lists to be roadmaps. Note that that's not saying that there is no communication, quite the opposite. Also, there are some big-goal-next-thing to work on areas. > Fifth, how well is the PLT system structures towards becoming a > user-driven open source project? It is user driven in the usual sense. > To boil all this down to a general scheme community question, PLT > has become *very* popular in the scheme community (programmer > community, to a lesser degree) at large. How stable a platform does > it present for a future canonical open source project should the > academic group behind PLT abandon the platform for one reason or > another (lack of funding, changing research focus, etc.) The "academic group behind PLT" is big enough that the chances that everyone will wake up one day and realize that they want to teach early French literature are very slim. In addition, there's a good number of people outside that group who are interested. (Nothing surprising, really.) On Oct 14, Robby Findler wrote: > On Wed, Oct 14, 2009 at 6:19 AM, Jay McCarthy wrote: > > > > Speaking for myself, I can't think of anything that would make me > > give up on PLT. I would guess that most would say the same. > > I certainly would. Me too. I think that the conclusion here is that if *all* funding is lost one day, and everyone involved needs to go out and get ... um ... real jobs, then you'd see the same kind of people continue to work on the project, only as a side thing in addition to these jobs. On Oct 14, Scott McLoughlin wrote: > I guess I'm noticing that PLT doesn't have exactly the same > structure as some other popular open source projects. My guess is that you're doing some comparisons that might be misleading. Take any open source *language* project, and see how many people work on the actual core -- even in cases of non-academic languages, there is usually a very small core, and often there's some single dictator for the language. > These other project structures encourage community participation > (from qualified community members in different realms) in the PLT > project offering it a longevity beyond the activities of the core > group. IMO such longevity is there, given the above. (Seems like you're equating "PLT" with "a group of people who only do this for an (academic) living, and might wonder off tomorrow if they get tempted by Some Big Company".) > I'd hate to see the same happen the PLT, especially has I plan to > use it for a reasonably large and complex projects. As Shriram said, it's been there for a long while. Chances are that it will survive long enough for your needs. > I don't mean to propose anything radical hear. Just setting the > docs/environment up for greater community participation in the > language and libraries development - bringing it in line with the > structure of many other open source projects, several much larger > than the PLT project. What does other projects have that PLT lacks? (Not a rhetorical question: I'm wondering what concrete examples you have in mind.) On Oct 14, Scott McLoughlin wrote: > Casey Klein wrote: > > > > Of course, the compiler sometimes in-lines non-primitives too. > > Yes, I can see how calls to sibling module functions can be treated > specially by the compiler. Just to clarify: the compiler inlines non-primitive functions often, but IIRC, it doesn't do that across modules. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From dyoo at cs.wpi.edu Wed Oct 14 11:38:46 2009 From: dyoo at cs.wpi.edu (Danny Yoo) Date: Wed Oct 14 11:39:04 2009 Subject: [plt-scheme] program online game In-Reply-To: References: <1255444357.15208.3.camel@brecht> <8B5D741B-BF1C-471C-88A2-2FF9503CDD0B@ccs.neu.edu> Message-ID: On Wed, Oct 14, 2009 at 8:26 AM, Matthias Felleisen wrote: > > #lang moby works? Yes, it should work if Moby's installed as a collection; I have the lang/reader.ss to wrap Moby source code with the right module language. From jay.mccarthy at gmail.com Wed Oct 14 12:10:35 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Wed Oct 14 12:10:57 2009 Subject: [plt-scheme] program online game In-Reply-To: References: <1255444357.15208.3.camel@brecht> <8B5D741B-BF1C-471C-88A2-2FF9503CDD0B@ccs.neu.edu> Message-ID: I can't wait untill #lang planet moby/moby works! Jay On Wed, Oct 14, 2009 at 9:38 AM, Danny Yoo wrote: > On Wed, Oct 14, 2009 at 8:26 AM, Matthias Felleisen > wrote: >> >> #lang moby works? > > Yes, it should work if Moby's installed as a collection; I have the > lang/reader.ss to wrap Moby source code with the right module > language. > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From m.douglas.williams at gmail.com Wed Oct 14 13:32:19 2009 From: m.douglas.williams at gmail.com (Doug Williams) Date: Wed Oct 14 13:32:38 2009 Subject: [plt-scheme] Questions on PLT status and project structure In-Reply-To: <4AD5A892.6090209@adrenaline.com> References: <4AD5A892.6090209@adrenaline.com> Message-ID: A few comments from a outside developer who puts things in PLaneT. First questions regard performance. First, is there an inlining directive > (or delcaration or proclamation, etc.) > Second, are there type proclamations to speed up common fixnum arithmatec, > vector indexes, etc. Is there > are role for typed-scheme here? > > Several other have noted the new 'unsafe' operations that have been added. I have update the science collection to make use of these. Actually, I find them more of a help with floating point operations than with fixed. [Most cases where I use exact integers, there is no guarantee that there are indeed only small integers (fixnums) as opposed to large integer (bignums) or any good reason to make such a restriction, but there are exceptions - string and vector indices, etc.] I haven't released these to PLaneT yet because I haven't done enough testing and I am using some that aren't in the released 4.2.2 (e.g., unsafe-fx->unsafe-fl and unsafe-flabs). > Fourth, Is there a formal roadmap for the Planet libraries - a sort of > wishlist from the core development group > or user community vote/consensus. Similarly, is there an up to date > raodmap for the core PLT system? > > Maybe it is time for a PLT Scheme Users group or something similar. I would love input on my own packages, etc. > > To boil all this down to a general scheme community question, PLT has > become *very* popular in the > scheme community (programmer community, to a lesser degree) at large. How > stable a platform does > it present for a future canonical open source project should the academic > group behind PLT abandon > the platform for one reason or another (lack of funding, changing research > focus, etc.) > > Several of us non-academics (although I am an ex-academic) have enough faith in the core group and the product use PLT Scheme in our work. Doug -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091014/5fff596d/attachment.htm From yinso.chen at gmail.com Wed Oct 14 15:35:06 2009 From: yinso.chen at gmail.com (YC) Date: Wed Oct 14 15:35:26 2009 Subject: [plt-scheme] Questions on PLT status and project structure In-Reply-To: References: <4AD5A892.6090209@adrenaline.com> Message-ID: <779bf2730910141235y2e03fa81te146ce2e062857eb@mail.gmail.com> >From another outside developer ;) On Wed, Oct 14, 2009 at 10:32 AM, Doug Williams < m.douglas.williams@gmail.com> wrote: > >> Fourth, Is there a formal roadmap for the Planet libraries - a sort of >> wishlist from the core development group >> or user community vote/consensus. Similarly, is there an up to date >> raodmap for the core PLT system? >> >> I personally consider anything (not necessarily everything though) in perl's CPAN is a fair game to add to planet. CPAN is a good bar to measure against and can act as a roadmap, at least for people into using PLT for everyday purposes. On Wed, Oct 14, 2009 at 6:54 AM, Scott McLoughlin wrote: > > I have never been a "high ceremony" guy, but I can imagine partitioning > subsystems and assigning responsibility outside of the core group: > Documentation, > Kernel/Compiler/GC/RTS documentation, SRFI maintenance, typed-scheme / > scheme > integration, porting, core language evolution (immutable cons cells, lazy > expressions > or whatever) and so forth and so on. Here we can maintain and publish a > simple > "Core PLT scheme language roadmap." > I do feel like that finding a way to have user-contributed documentations would be helpful to have others quickly provide incremental improvements, especially for smaller things like typos. Scribble isn't designed for that right now, and we might need a wiki. That being said - I agree with Noel that the core group needs to focus their energy on tasks that produces the highest value and that isn't to document everything in their heads. To have such documentations someone will need to pickup the mantle to get the knowledge out, just like to have a particular non-existent planet lib someone needs to suck it up and write it. In this sense it isn't so different from other open source projects. > >> To boil all this down to a general scheme community question, PLT has >> become *very* popular in the >> scheme community (programmer community, to a lesser degree) at large. How >> stable a platform does >> it present for a future canonical open source project should the academic >> group behind PLT abandon >> the platform for one reason or another (lack of funding, changing research >> focus, etc.) >> >> > Several of us non-academics (although I am an ex-academic) have enough > faith in the core group and the product use PLT Scheme in our work. > > I feel like the current system is mature enough that it can stay stale for a few years and I can still be productive using it, YMMV of course. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091014/b3ad84ad/attachment.htm From scott at adrenaline.com Wed Oct 14 17:40:03 2009 From: scott at adrenaline.com (Scott McLoughlin) Date: Wed Oct 14 17:41:23 2009 Subject: [plt-scheme] Questions on PLT status and project structure In-Reply-To: References: <4AD5A892.6090209@adrenaline.com> Message-ID: <4AD64533.5080901@adrenaline.com> I think this is a spendid idea - if just an active IRC channel or separate mail list. > > Maybe it is time for a PLT Scheme Users group or something similar. I > would love input on my own packages, etc. > .... By no means did I mean to express any lack of faith at all - just expressing the many benefits (including "technical marketing") of transparency and clear organization. Scott > > Several of us non-academics (although I am an ex-academic) have enough > faith in the core group and the product use PLT Scheme in our work. > > Doug From scott at adrenaline.com Wed Oct 14 17:48:25 2009 From: scott at adrenaline.com (Scott McLoughlin) Date: Wed Oct 14 17:48:45 2009 Subject: [plt-scheme] Questions on PLT status and project structure In-Reply-To: <779bf2730910141235y2e03fa81te146ce2e062857eb@mail.gmail.com> References: <4AD5A892.6090209@adrenaline.com> <779bf2730910141235y2e03fa81te146ce2e062857eb@mail.gmail.com> Message-ID: <4AD64729.2090005@adrenaline.com> A splendid idea (no, I'm not heavy Perl user). Ti's almost always better to borrow/steal than to reinvent ;-) > I personally consider anything (not necessarily everything though) in > perl's CPAN is a fair game to add to planet. CPAN is a good bar to > measure against and can act as a roadmap, at least for people into > using PLT for everyday purposes. > For an old troff guy (and then Java Doc), I find the old Scribble docs prettty opaque and needlessly "why" oriented and not appropriately "how" oriented. Then again, I haven't viewed the Scribble docs from the latest release. > I do feel like that finding a way to have user-contributed > documentations would be helpful to have others quickly provide > incremental improvements, especially for smaller things like typos. > Scribble isn't designed for that right now, and we might need a wiki. > There is always a balance between immediate user needs/wants and more "systemic" developments to a code base, the benefits of which only show up down the road a bit. I just think there should be a more or less constant and transparent meeting of the minds on these two trajectories within the PLT project (or any large project, for that matter). Scott From matthias at ccs.neu.edu Wed Oct 14 20:31:59 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Wed Oct 14 20:32:41 2009 Subject: [plt-scheme] Questions on PLT status and project structure In-Reply-To: <4AD64729.2090005@adrenaline.com> References: <4AD5A892.6090209@adrenaline.com> <779bf2730910141235y2e03fa81te146ce2e062857eb@mail.gmail.com> <4AD64729.2090005@adrenaline.com> Message-ID: <059A8DF8-2DF0-449F-A86C-C1E5D61989C5@ccs.neu.edu> Scott, the proper way to extract knowledge from the core team and to create your envisioned 'open project' is for you to crete a wonk wiki where people can 'deposit' knowledge about the internals of the system. Just imagine you have a compiler tab there that says -- invariants for the internal compiler representation People read the code for the compiler, deposit what they find out, link it to the on-line svn repository, and use it for submitting patches. Such patches could then be about -- exploiting additional derived knowledge for the jit-ter (not twitter) and so on. Naturally, this wonk-wiki would evolve according to people's interest and tastes. For all I know, the web server and its guts may become the hottest topic there just because a lot of people use it to run small sites and web services. Whatever it is it would truly be community driven. I bet that if you had such a site and you'd get stuck on a piece of knowledge in -- invariants for the internal compiler representation you could post a question here and the core member who works on this stuff would answer. I am quite sure that most of us would love to 'consult' with such an active user group, while we are dedicating our time to the projects that are on the critical path (for some value of 'critical'). Go for it. Sooner or later you may have enough knowledge in this wonk- wiki to replace Matthew, Robby, Jay, Sam, Ryan, Carl, Jon, and all the other active contributors to the svn code base. -- Matthias From neil at neilvandyke.org Wed Oct 14 21:36:13 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Wed Oct 14 21:36:59 2009 Subject: [plt-scheme] DrScheme to Windows system tray Message-ID: Does anyone have a trick to make the DrScheme 4.2.2 window on Windows XP minimize to the system tray instead of the task bar? This is for a big demo in which the server (ideally running in DrScheme) must run on the same laptop that is demonstrating something about the Windows desktop, to avoid network glitches at the venue. I think that the person giving the demo would prefer to acknowledge PLT Scheme in the usual academic way, not have to explain that the prominent extra thing in the task bar is not part of the demo. (I thought I used to have a tool for this, but I haven't had to do Windows in a long time.) -- http://www.neilvandyke.org/ From areilly at bigpond.net.au Wed Oct 14 20:45:39 2009 From: areilly at bigpond.net.au (Andrew Reilly) Date: Wed Oct 14 22:08:14 2009 Subject: [plt-scheme] Sliders in scheme/gui: platform-dependent orientation Message-ID: <20091015004539.GA89781@duncan.reilly.home> Hi there, I posted something like this little demo as part of a previous question, but here it is again, slightly modified: #lang scheme/gui (let ((t (thread (lambda () (let ((start (current-milliseconds))) (let loop () (printf "~a: ~a~%" (- (current-milliseconds) start) (thread-receive)) (flush-output) (loop)))))) (f (new frame% (label "SLIDER TEST")))) (new slider% (parent f) (label "foo") (min-value 0) (max-value 400) (init-value 200) (style '(vertical vertical-label plain)) (min-height 50) (min-width 400) (callback (lambda (s e) (thread-send t (send s get-value))))) (send f show #t) (yield 'wait) (kill-thread t)) The only difference here is that the style is now vertical. If you run this from the IDE or from mred on Windows or Unix, you'll find that location min-value is at the top, and max-value is at the bottom. Run it on OS-X though, and min-value is at the bottom. I suppose that this is a side-effect of the Aqua/Postscript drawing model that has 0,0 in the bottom left corner of the page/screen, compared to everyone else who puts it in the top left corner. This isn't too difficult to fix in my code, but it seems a little unfortunate to have to put (system-type 'os) calls into what is otherwise a portable GUI. Just thought I'd mention it, as this doesn't seem to be described in the manual. Cheers, -- Andrew From neil at neilvandyke.org Wed Oct 14 23:32:47 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Wed Oct 14 23:33:32 2009 Subject: [plt-scheme] RE: DrScheme to Windows system tray Message-ID: Eli's superior Googling found several such tools. I picked PowerMenu (which I think is the tool I used 10 years ago). From neil at neilvandyke.org Thu Oct 15 04:13:46 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Oct 15 04:14:06 2009 Subject: [plt-scheme] Questions on PLT status and project structure In-Reply-To: <4AD5D80D.80303@adrenaline.com> References: <4AD5A892.6090209@adrenaline.com> <6E527756-6898-4748-B841-1215819E674F@knauth.org> <4AD5D80D.80303@adrenaline.com> Message-ID: <4AD6D9BA.50507@neilvandyke.org> I've been involved in (what's now called) open source for a couple decades, and have been using PLT Scheme for close to 8 years. I think that PLT's development model has been working out very well. At this time, I have more confidence in the existing model than I would in a divvying-up of pieces of PLT Scheme among some network of community members. For random community members, like myself, writing PLaneT packages is a no-brainer great way to contribute. Bug reports and feature suggestions, and even small patches, too. Nothing precludes very smart community members someday taking up core PLT development, such as in the event of all existing PLT developers signing up to be astronauts on the Mars mission. But until that time, I wouldn't want PLT to mess too much with a winning formula. -- http://www.neilvandyke.org/ From jensaxel at soegaard.net Thu Oct 15 05:18:42 2009 From: jensaxel at soegaard.net (=?UTF-8?Q?Jens_Axel_S=C3=B8gaard?=) Date: Thu Oct 15 05:19:05 2009 Subject: [plt-scheme] Questions on PLT status and project structure In-Reply-To: <4AD6D9BA.50507@neilvandyke.org> References: <4AD5A892.6090209@adrenaline.com> <6E527756-6898-4748-B841-1215819E674F@knauth.org> <4AD5D80D.80303@adrenaline.com> <4AD6D9BA.50507@neilvandyke.org> Message-ID: <4072c51f0910150218u4670ba94y2b8ed22ab5e9bb88@mail.gmail.com> 2009/10/15 Neil Van Dyke : > I've been involved in (what's now called) open source for a couple decades, > and have been using PLT Scheme for close to 8 years. > > I think that PLT's development model has been working out very well. What sets PLT's approach apart is an unlimited supply of grad students in the years to come. http://www.phdcomics.com/comics/archive.php?comicid=1007 http://www.phdcomics.com/comics/archive.php?comicid=1022 -- Jens Axel S?gaard From 1031310562 at qq.com Thu Oct 15 09:41:18 2009 From: 1031310562 at qq.com (=?gbk?B?1Ko=?=) Date: Thu Oct 15 09:48:09 2009 Subject: [plt-scheme] Questions on PLT status and project structure Message-ID: The mutable pairs and lists work something like pointers in C,does a mutable list works faster than a immutable one,generally? ------------------ Original ------------------ From: "Neil Van Dyke"; Date: 2009Äê10ÔÂ15ÈÕ(ÐÇÆÚËÄ) ÏÂÎç4:13 To: "Scott McLoughlin"; "PLT"; Subject: Re: [plt-scheme] Questions on PLT status and project structure I've been involved in (what's now called) open source for a couple decades, and have been using PLT Scheme for close to 8 years. I think that PLT's development model has been working out very well. At this time, I have more confidence in the existing model than I would in a divvying-up of pieces of PLT Scheme among some network of community members. For random community members, like myself, writing PLaneT packages is a no-brainer great way to contribute. Bug reports and feature suggestions, and even small patches, too. Nothing precludes very smart community members someday taking up core PLT development, such as in the event of all existing PLT developers signing up to be astronauts on the Mars mission. But until that time, I wouldn't want PLT to mess too much with a winning formula. -- http://www.neilvandyke.org/ _________________________________________________ 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/20091015/2808d702/attachment.htm From matthias at ccs.neu.edu Thu Oct 15 09:49:53 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Oct 15 09:50:20 2009 Subject: [plt-scheme] Questions on PLT status and project structure In-Reply-To: References: Message-ID: No. On Oct 15, 2009, at 9:41 AM, =D4=AA wrote: > The mutable pairs and lists work something like pointers in C,does =20= > a mutable list works faster than a immutable one,generally? > > > ------------------ Original ------------------ > From: "Neil Van Dyke"; > Date: 2009=C4=EA10=D4=C215=C8=D5(=D0=C7=C6=DA=CB=C4) =CF=C2=CE=E74:13 > To: "Scott McLoughlin"; = "PLT" >; > Subject: Re: [plt-scheme] Questions on PLT status and project =20 > structure > > I've been involved in (what's now called) open source for a couple > decades, and have been using PLT Scheme for close to 8 years. > > I think that PLT's development model has been working out very well. > > At this time, I have more confidence in the existing model than I =20 > would > in a divvying-up of pieces of PLT Scheme among some network of =20 > community > members. > > For random community members, like myself, writing PLaneT packages =20 > is a > no-brainer great way to contribute. Bug reports and feature > suggestions, and even small patches, too. > > Nothing precludes very smart community members someday taking up core > PLT development, such as in the event of all existing PLT developers > signing up to be astronauts on the Mars mission. But until that =20 > time, I > wouldn't want PLT to mess too much with a winning formula. > > --=20 > http://www.neilvandyke.org/ > > _________________________________________________ > 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 Oct 15 10:05:08 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Oct 15 10:05:33 2009 Subject: [plt-scheme] Questions on PLT status and project structure In-Reply-To: References: Message-ID: <932b2f1f0910150705m7df55035ra50ce3f544a99569@mail.gmail.com> 2009/10/15 ? <1031310562@qq.com>: > The?mutable?pairs?and?lists?work?something?like?pointers?in?C,does??a?mutable?list?works?faster?than?a?immutable?one,generally? Not in general, no. The tradeoffs are not simple, but immutable cons cells, IMO, have more potential for speed than mutable ones do. But I think a better answer to your question is here: http://blog.plt-scheme.org/2007/11/getting-rid-of-set-car-and-set-cdr.html Robby > > ------------------?Original?------------------ > From: "Neil Van Dyke"; > Date: 2009?10?15?(???) ??4:13 > To: "Scott McLoughlin"; > "PLT"; > Subject: Re: [plt-scheme] Questions on PLT status and project structure > > I've been involved in (what's now called) open source for a couple > decades, and have been using PLT Scheme for close to 8 years. > > I think that PLT's development model has been working out very well. > > At this time, I have more confidence in the existing model than I would > in a divvying-up of pieces of PLT Scheme among some network of community > members. > > For random community members, like myself, writing PLaneT packages is a > no-brainer great way to contribute.? Bug reports and feature > suggestions, and even small patches, too. > > Nothing precludes very smart community members someday taking up core > PLT development, such as in the event of all existing PLT developers > signing up to be astronauts on the Mars mission.? But until that time, I > wouldn't want PLT to mess too much with a winning formula. > > -- > http://www.neilvandyke.org/ > > _________________________________________________ > ? 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 rafkind at cs.utah.edu Thu Oct 15 13:42:38 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Thu Oct 15 13:45:56 2009 Subject: [plt-scheme] svn statistics Message-ID: <4AD75F0E.8080603@cs.utah.edu> I found a neat tool called statsvn (http://www.statsvn.org) that generates graphs based on svn commit logs. Here are the generated graphs for plt scheme. http://www.cs.utah.edu/~rafkind/tmp/plt/index.html Nothing terribly surprising, but interesting anyway. From clements at brinckerhoff.org Thu Oct 15 14:04:48 2009 From: clements at brinckerhoff.org (John Clements) Date: Thu Oct 15 14:05:17 2009 Subject: [plt-scheme] svn statistics In-Reply-To: <4AD75F0E.8080603@cs.utah.edu> References: <4AD75F0E.8080603@cs.utah.edu> Message-ID: On Oct 15, 2009, at 10:42 AM, Jon Rafkind wrote: > I found a neat tool called statsvn (http://www.statsvn.org) that > generates graphs based on svn commit logs. Here are the generated > graphs for plt scheme. > > http://www.cs.utah.edu/~rafkind/tmp/plt/index.html > > Nothing terribly surprising, but interesting anyway. Observations: Matthew was in China from September 2006 until July 2007. Eli *never* sleeps. All the work gets done at 11:00 on Saturday. 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/20091015/2bb48db1/smime.bin From stefan.ballnat at yahoo.de Fri Oct 16 05:01:35 2009 From: stefan.ballnat at yahoo.de (sballnat) Date: Fri Oct 16 07:58:04 2009 Subject: [plt-scheme] plt-threads in r6rs Message-ID: <02b1762c-d1c0-44e2-9f98-2cea5534d8e8@r5g2000yqb.googlegroups.com> Hi, I'm writing an r6rs-script using some functions imported from (scheme base) and (scheme tcp). I'm especially using threads and want to make sure everything is thread-safe as described in the manual (10.1 Threads). There it is said that most operations are atomic (like set!) or in case of hashtables they have semaphores. Now, I wonder if this is still true for r6rs-operations and hashtables. I'm running a tcp-server on scheme accepting new connections. For every connection a thread is started who is reading from the new tcp- port, doing some evaluation and sending the result back via the corresponding tcp-output-port. Some intermediate-results are safed in hashtables (with set!), which are shared between all threads. I already had some problems while using the ssax-library I ported to r6rs when reading some xml-files. I used semaphores at this part to avoid the failures but I still wonder, if the rest of my script is thread-safe. Thanks in advance, Stefan From mflatt at cs.utah.edu Fri Oct 16 08:37:48 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Fri Oct 16 08:38:54 2009 Subject: [plt-scheme] Sliders in scheme/gui: platform-dependent orientation In-Reply-To: <20091015004539.GA89781@duncan.reilly.home> References: <20091015004539.GA89781@duncan.reilly.home> Message-ID: <20091016123749.A3539650125@mail-svr1.cs.utah.edu> I agree that it would be better to flip over the Mac control to make it consistent with other platforms. Does anyone rely on the current direction, or should I just flip it? At Thu, 15 Oct 2009 11:45:39 +1100, Andrew Reilly wrote: > Hi there, > > I posted something like this little demo as part of a previous > question, but here it is again, slightly modified: > > #lang scheme/gui > > (let ((t (thread (lambda () > (let ((start (current-milliseconds))) > (let loop () > (printf "~a: ~a~%" > (- (current-milliseconds) start) > (thread-receive)) > (flush-output) > (loop)))))) > (f (new frame% (label "SLIDER TEST")))) > (new slider% > (parent f) > (label "foo") > (min-value 0) > (max-value 400) > (init-value 200) > (style '(vertical vertical-label plain)) > (min-height 50) > (min-width 400) > (callback > (lambda (s e) > (thread-send t (send s get-value))))) > (send f show #t) > (yield 'wait) > (kill-thread t)) > > The only difference here is that the style is now vertical. > If you run this from the IDE or from mred on Windows or Unix, > you'll find that location min-value is at the top, and max-value > is at the bottom. > > Run it on OS-X though, and min-value is at the bottom. I > suppose that this is a side-effect of the Aqua/Postscript > drawing model that has 0,0 in the bottom left corner of the > page/screen, compared to everyone else who puts it in the top > left corner. > > This isn't too difficult to fix in my code, but it seems a > little unfortunate to have to put (system-type 'os) calls into > what is otherwise a portable GUI. > > Just thought I'd mention it, as this doesn't seem to be > described in the manual. > > Cheers, > > -- > Andrew > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From lianciana at gmail.com Fri Oct 16 15:29:04 2009 From: lianciana at gmail.com (Morgan) Date: Fri Oct 16 15:38:20 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite Message-ID: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> Hi, Newbie here getting used to scheme and getting a whole lota "procedure application: expected procedure blah blah blah blah" because of missing parens. How do you all cope emotionally? :-p More importantly, what survival tricks are there to discovering whether there's too few or too many parens? Just knowing the syntax backward? I mean, my nice purple SICP book informs me LISP doesn't give a crap about syntax compared to most languages, yet the interpreter throws a fit if I've a single pair of superfluous parentheses? It just seems a bit unreasonable, c++ and java are entirely happy to allow my superfluous parentheses I'm accustomed to using, it can make the code easier to read after all. Discuss :) From robby at eecs.northwestern.edu Fri Oct 16 15:41:37 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Fri Oct 16 15:41:59 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> Message-ID: <932b2f1f0910161241j62a37614tdb5806f7d07197ea@mail.gmail.com> Your mistake is that you write () when you should write {}. Just substitute all of your () for {}s and then you'll be happy. Robby On Fri, Oct 16, 2009 at 2:29 PM, Morgan wrote: > Hi, > > Newbie here getting used to scheme and getting a whole lota > "procedure application: expected procedure blah blah blah blah" > because of missing parens. > > How do you all cope emotionally? :-p > > More importantly, what survival tricks are there to discovering > whether there's too few or too many parens? Just knowing the syntax > backward? > > I mean, my nice purple SICP book informs me LISP doesn't give a crap > about syntax compared to most languages, yet the interpreter throws a > fit if I've a single pair of superfluous parentheses? > It just seems a bit unreasonable, c++ and java are entirely happy to > allow my superfluous parentheses I'm accustomed to using, it can make > the code easier to read after all. > > Discuss :) > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From jmarshall at alum.mit.edu Fri Oct 16 15:50:28 2009 From: jmarshall at alum.mit.edu (Joe Marshall) Date: Fri Oct 16 15:51:06 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> Message-ID: On Fri, Oct 16, 2009 at 12:29 PM, Morgan wrote: > > It just seems a bit unreasonable, c++ and java are entirely happy to > allow my superfluous parentheses I'm accustomed to using, it can make > the code easier to read after all. What compiler are you using? My C++ and Java compilers get all bent out of shape if there are superfluous parenthesis: int ma(in() )) { prin))tf("hello, wor(ld"); r)etu(rn 0;) }((( -- ~jrm From carl.eastlund at gmail.com Fri Oct 16 15:55:44 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Fri Oct 16 15:56:23 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> Message-ID: <990e0c030910161255t4dea9dc5yb7832c4d62cf3c2f@mail.gmail.com> On Fri, Oct 16, 2009 at 3:29 PM, Morgan wrote: > Hi, > > Newbie here getting used to scheme and getting a whole lota > "procedure application: expected procedure blah blah blah blah" > because of missing parens. > > How do you all cope emotionally? :-p > > More importantly, what survival tricks are there to discovering > whether there's too few or too many parens? Just knowing the syntax > backward? > > I mean, my nice purple SICP book informs me LISP doesn't give a crap > about syntax compared to most languages, yet the interpreter throws a > fit if I've a single pair of superfluous parentheses? > It just seems a bit unreasonable, c++ and java are entirely happy to > allow my superfluous parentheses I'm accustomed to using, it can make > the code easier to read after all. > > Discuss :) So how forgiving are C++ or Java going to be if you put in extra braces somewhere? How about brackets? Or commas, semicolons, colons, or periods? The main difference you're running into here is that in Scheme, parentheses always mean something. They never just mean "group these things together". They [almost] always mean "apply this function". [And when they don't, they still mean do something. Never nothing.] I know it's tricky -- English grammar and high school algebra use parentheses to group things together, but not really to change their meaning. Scheme gives them more meaning. It's not more or less picky about syntax than any other language... but it chooses parentheses as the important part, instead of braces or semicolons or whatever. Fix that difference in your mind. Rule #1: Parentheses mean "apply a function". If you see (f x y z), it means apply f to arguments x, y, and z. If you see (f), it means apply f to no arguments. It doesn't just mean f. There, now you know the syntax backwards and forwards... since there's just one rule, it's the same both ways! {...okay, there are a few more rules, like for "let" and "define". But 90% of the time, you want Rule #1. And even in other cases, parentheses NEVER mean nothing.} That, and use a Scheme-conscious editor like DrScheme (or Emacs or vi, if you're familiar). When you add the right parenthesis, it will highlight the corresponding left parenthesis, so you can double check that you're applying the right function. Always check that. If you open or close parentheses, there must be a function, or something special like "let" or "define". Never just grouping. Good luck with learning Scheme! It looks a bit different than other languages, but once you get the hang of it, it's a lot of fun. And don't pay too much attention to the curmudgeons on this list, they've gotten so used to Scheme parentheses they've forgotten there's any other way of using them. --Carl From david.storrs at gmail.com Fri Oct 16 16:04:17 2009 From: david.storrs at gmail.com (David Storrs) Date: Fri Oct 16 16:04:53 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <990e0c030910161255t4dea9dc5yb7832c4d62cf3c2f@mail.gmail.com> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <990e0c030910161255t4dea9dc5yb7832c4d62cf3c2f@mail.gmail.com> Message-ID: On Fri, Oct 16, 2009 at 3:55 PM, Carl Eastlund wrote: > That, and use a Scheme-conscious editor like DrScheme (or Emacs or vi, > if you're familiar). Carl beat me to it on this one. Two more tricks you can do to simplify your life: 1) Always write parens in pairs, then fill in what goes inside them. 2) Add newlines to make it clearer what goes with what. This isn't the "done thing" in Scheme, but it's a useful tool while you're learning. So: (define (foo a b (c 7)) (let ( (x a) ) (begin (display a b c) ) )) ; let and define A decent editor will handle the alignment for you. --Dks From neil at neilvandyke.org Fri Oct 16 16:04:20 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Fri Oct 16 16:05:00 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> Message-ID: <4AD8D1C4.4090804@neilvandyke.org> I don't recall offhand how SICP introduces syntax, but there's actually very little to remember about where the parentheses go in Scheme. Once you know that a single set of parens denotes a procedure application, you're at least 50% of the way there. It's easy to get if you read those sentences in a book and take them to heart, but difficult for someone who glances at Scheme examples and tries to code without doing some reading. Then, after procedure application, there's just little bits of syntax extensions, which generally are logical, and you pick them up as you go. If you're still having trouble after a person-day or so of using Scheme, remember that Clint Eastwood movie, in which he steals the Russian mind-controlled super-airplane, and he has to *think* in Russian before he can fly it. From david.storrs at gmail.com Fri Oct 16 16:11:22 2009 From: david.storrs at gmail.com (David Storrs) Date: Fri Oct 16 16:11:45 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <4AD8D1C4.4090804@neilvandyke.org> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <4AD8D1C4.4090804@neilvandyke.org> Message-ID: On Fri, Oct 16, 2009 at 4:04 PM, Neil Van Dyke wrote: > ...that Clint Eastwood movie, in which he steals the Russian > mind-controlled super-airplane, and he has to *think* in Russian before he > can fly it. I had forgotten that movie. It was called Firefox, ironically--interesting case of associations changing. http://www.imdb.com/title/tt0083943/ It was a better book than a movie. --Dks From robby at eecs.northwestern.edu Fri Oct 16 16:06:46 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Fri Oct 16 16:15:03 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <990e0c030910161255t4dea9dc5yb7832c4d62cf3c2f@mail.gmail.com> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <990e0c030910161255t4dea9dc5yb7832c4d62cf3c2f@mail.gmail.com> Message-ID: <932b2f1f0910161306i24e3565euc009d4689852d036@mail.gmail.com> On Fri, Oct 16, 2009 at 2:55 PM, Carl Eastlund wrote: > Good luck with learning Scheme! ?It looks a bit different than other > languages, but once you get the hang of it, it's a lot of fun. ?And > don't pay too much attention to the curmudgeons on this list, they've > gotten so used to Scheme parentheses they've forgotten there's any > other way of using them. Grumble grumble. You young kids get off my yard! . ;) Robby From goetter at mazama.net Fri Oct 16 16:12:30 2009 From: goetter at mazama.net (Ben Goetter) Date: Fri Oct 16 16:19:16 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> Message-ID: <4AD8D3AE.9040507@mazama.net> Morgan wrote: > It just seems a bit unreasonable, c++ and java are entirely happy to > allow my superfluous parentheses I'm accustomed to using, it can make > the code easier to read after all. > Not to pile on here, but consider: what is wrong with the following line? printf("Hello, world.")(); That's what you'd be saying by stating ((display "Hello, world.")) instead of (display "Hello, world."). Lisp absolutely has syntax. It is very simple and regular, but it is nevertheless syntax. Ben From mellowfish at gmail.com Fri Oct 16 16:31:51 2009 From: mellowfish at gmail.com (Christopher Coleman) Date: Fri Oct 16 16:32:13 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <990e0c030910161255t4dea9dc5yb7832c4d62cf3c2f@mail.gmail.com> Message-ID: These tricks are great, I use them all the time in my coding even though I've been at it for a while now. Its just so much easier to think line by line instead of trying to keep track of which set of parens I am in on a single line. Also, as a tutor I teach my students the same concept of paren pairing and filling with {} in c-style languages. On Fri, Oct 16, 2009 at 1:04 PM, David Storrs wrote: > On Fri, Oct 16, 2009 at 3:55 PM, Carl Eastlund wrote: > >> That, and use a Scheme-conscious editor like DrScheme (or Emacs or vi, >> if you're familiar). > > Carl beat me to it on this one. > > Two more tricks you can do to simplify your life: > > 1) Always write parens in pairs, then fill in what goes inside them. > > 2) Add newlines to make it clearer what goes with what. ?This isn't > the "done thing" in Scheme, but it's a useful tool while you're > learning. ?So: > > (define (foo a b (c 7)) > ?(let ( > ? ? ? ? ?(x a) > ? ? ? ?) > ? ?(begin > ? ? ?(display a b c) > ? ? ) > )) ; let and define > > A decent editor will handle the alignment for you. > > --Dks > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From lianciana at gmail.com Fri Oct 16 16:35:24 2009 From: lianciana at gmail.com (Morgan) Date: Fri Oct 16 16:35:44 2009 Subject: [plt-scheme] Re: Paren Paralysis Sufferers Unite In-Reply-To: <932b2f1f0910161241j62a37614tdb5806f7d07197ea@mail.gmail.com> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <932b2f1f0910161241j62a37614tdb5806f7d07197ea@mail.gmail.com> Message-ID: <451c05f3-438a-41ce-9b47-e1a4b747844e@o10g2000yqa.googlegroups.com> Nice... :D On 16 Oct, 20:41, Robby Findler wrote: > Your mistake is that you write () when you should write {}. Just > substitute all of your () for {}s and then you'll be happy. > > Robby > > > > > > On Fri, Oct 16, 2009 at 2:29 PM, Morgan wrote: > > Hi, > > > Newbie here getting used to scheme and getting a whole lota > > "procedure application: expected procedure blah blah blah blah" > > because of missing parens. > > > How do you all cope emotionally? :-p > > > More importantly, what survival tricks are there to discovering > > whether there's too few or too many parens? Just knowing the syntax > > backward? > > > I mean, my nice purple SICP book informs me LISP doesn't give a crap > > about syntax compared to most languages, yet the interpreter throws a > > fit if I've a single pair of superfluous parentheses? > > It just seems a bit unreasonable, c++ and java are entirely happy to > > allow my superfluous parentheses I'm accustomed to using, it can make > > the code easier to read after all. > > > Discuss :) > > > _________________________________________________ > > ?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- Hide quoted text - > > - Show quoted text - From carl.eastlund at gmail.com Fri Oct 16 16:40:09 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Fri Oct 16 16:40:49 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <990e0c030910161255t4dea9dc5yb7832c4d62cf3c2f@mail.gmail.com> Message-ID: <990e0c030910161340v3ef372e7p580278bf9b7dfc1d@mail.gmail.com> A word of caution: to an experienced Scheme/Lisp programmer, that code is pretty unreadable. I'm very used to using the indentation of code, and the auto-selecting of open/close pairs, to read my code, and not having lots of blank lines with a single parenthesis in them to intervene. It's about the equivalent of writing the following in C (or C++, Java, Perl, any of those language): ((((2 * x) * y) + (((y * x) / z) / 7)) - (((a * b) / c) / d)) Sure, the extra parentheses make it clear what goes with what, but you can just write: 2*x*y + y*x/z - a*b/c/d or, for a little more caution, (2*x*y) + (y*x/z) - (a*b/c/d) ...to get the same thing. Putting in lots of extra parentheses (or newlines, in the Scheme case) can clutter things up, instead of clear them up, when you get comfortable with a language. Use them now if you need to, to get started, but if you're going to use Scheme long-term you might want to get comfortable with closing all your parentheses on one line. Carl Eastlund On Fri, Oct 16, 2009 at 4:31 PM, Christopher Coleman wrote: > These tricks are great, I use them all the time in my coding even > though I've been at it for a while now. ?Its just so much easier to > think line by line instead of trying to keep track of which set of > parens I am in on a single line. > > Also, as a tutor I teach my students the same concept of paren pairing > and filling with {} in c-style languages. > > On Fri, Oct 16, 2009 at 1:04 PM, David Storrs wrote: >> On Fri, Oct 16, 2009 at 3:55 PM, Carl Eastlund wrote: >> >>> That, and use a Scheme-conscious editor like DrScheme (or Emacs or vi, >>> if you're familiar). >> >> Carl beat me to it on this one. >> >> Two more tricks you can do to simplify your life: >> >> 1) Always write parens in pairs, then fill in what goes inside them. >> >> 2) Add newlines to make it clearer what goes with what. ?This isn't >> the "done thing" in Scheme, but it's a useful tool while you're >> learning. ?So: >> >> (define (foo a b (c 7)) >> ?(let ( >> ? ? ? ? ?(x a) >> ? ? ? ?) >> ? ?(begin >> ? ? ?(display a b c) >> ? ? ) >> )) ; let and define >> >> A decent editor will handle the alignment for you. >> >> --Dks From lianciana at gmail.com Fri Oct 16 16:47:14 2009 From: lianciana at gmail.com (Morgan) Date: Fri Oct 16 16:47:39 2009 Subject: [plt-scheme] Re: Paren Paralysis Sufferers Unite In-Reply-To: References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> Message-ID: On 16 Oct, 20:50, Joe Marshall wrote: > On Fri, Oct 16, 2009 at 12:29 PM, Morgan wrote: > > > It just seems a bit unreasonable, c++ and java are entirely happy to > > allow my superfluous parentheses I'm accustomed to using, it can make > > the code easier to read after all. > > What compiler are you using? ?My C++ and Java compilers get all bent > out of shape if there are superfluous parenthesis: > > int ma(in() )) > ?{ > ? ? ? ? prin))tf("hello, wor(ld"); > ? ? ? ? r)etu(rn 0;) > ?}((( > > -- > ~jrm > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme LOL! No, I mean something a wee bit different to that. taking an example; the difference between these two pieces of code. (define (get-smallest x y z) (cond ((and (< x y) (< x z)) x) ((and (< y x) (< y z)) y) ((and (< z x) (< z y)) z) ) ) scheme is all happy with that, but not with what's below: (define (get-smallest x y z) (cond (((and (< x y) (< x z))) x) (((and (< y x) (< y z))) y) (((and (< z x) (< z y))) z) ) ) which results in this lot: (get-smallest 1 2 3) . . procedure application: expected procedure, given: #t (no arguments) Now, I freely admit there's absolutely no utility in having those extra parens. But they do no harm! [I think. Being a newb could possibly mean being wrong about these things. However the sky hasn't fallen in yet, so I'm fairly hopeful] taking the typical math example ((2 + 2) * 3) I mean, we know those parens are useless, but they potentially help to clarify the situation if you're uncertain of the order of evaluation with arithmetric operators. In C++ and Java, superfluous parentheses like those are o.k. but not so in scheme, an extra pair of parens is OTT. Which it is. But it still seems a wee bit inflexible. Thoughts? From lianciana at gmail.com Fri Oct 16 16:54:38 2009 From: lianciana at gmail.com (Morgan) Date: Fri Oct 16 16:54:58 2009 Subject: [plt-scheme] Re: Paren Paralysis Sufferers Unite In-Reply-To: <990e0c030910161255t4dea9dc5yb7832c4d62cf3c2f@mail.gmail.com> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <990e0c030910161255t4dea9dc5yb7832c4d62cf3c2f@mail.gmail.com> Message-ID: <6b5d70c7-b2b8-4fd5-a0af-53b33cd14fbb@b15g2000yqd.googlegroups.com> On 16 Oct, 20:55, Carl Eastlund wrote: > > Good luck with learning Scheme! ?It looks a bit different than other > languages, but once you get the hang of it, it's a lot of fun. ?And > don't pay too much attention to the curmudgeons on this list, they've > gotten so used to Scheme parentheses they've forgotten there's any > other way of using them. > (chuckle (curmudgeons talking)) :) Thanks for the advice! (and thank god that there's a plt-scheme newsgroup, because comp.lang.lisp is simply overwhelmed with spam) From lianciana at gmail.com Fri Oct 16 16:56:27 2009 From: lianciana at gmail.com (Morgan) Date: Fri Oct 16 16:56:46 2009 Subject: [plt-scheme] Re: Paren Paralysis Sufferers Unite In-Reply-To: References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> Message-ID: <4e3a78cf-1538-4c90-b358-a822b758934b@t2g2000yqn.googlegroups.com> On 16 Oct, 21:47, Morgan wrote: > In C++ and Java, superfluous parentheses like those are o.k. but not > so in scheme, an extra pair of parens is OTT. Which it is. But it > still seems a wee bit inflexible. > > Thoughts? > Actually it looks like carl pretty much answered that, so just ignore my last post! From matthias at ccs.neu.edu Fri Oct 16 17:09:57 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Fri Oct 16 17:10:26 2009 Subject: [plt-scheme] Re: Paren Paralysis Sufferers Unite In-Reply-To: <4e3a78cf-1538-4c90-b358-a822b758934b@t2g2000yqn.googlegroups.com> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <4e3a78cf-1538-4c90-b358-a822b758934b@t2g2000yqn.googlegroups.com> Message-ID: <0F0C5AAC-DCD4-488E-877E-521F3C0B1062@ccs.neu.edu> Morgan, the real answer is that SICP got it completely, totally wrong. Lisp, Scheme, and related friends have syntax. All off-the-shelf languages have syntax, and if you don't know the syntax, the implementation reports errors assuming you know the *entire* language. (The problem is that in languages like Scheme or Perl, you get many errors reported when you *run* the program not before you run. But even then, the error message assumes that you know the *entire* language.) Because this project explicitly recognizes this fact and because the people who started it liked Scheme -- they could have liked Pascal, C, or Java instead -- they created teaching languages, which approximate the chosen language and provide error messages for the small language, which is usually easier to grasp than those for the full language. The person who maintains a lot of this work is super-curmudgeon Robby. What the other people pointed out to you is that {!@#$} languages have the exact same problem as Scheme. They are off the shelf and they provide bad error messages. Before you say 'no' reflect on this statement. The group respects people a lot more who reflect before they shoot, even though we are all from Texas :-) -- Matthias From lianciana at gmail.com Fri Oct 16 17:53:05 2009 From: lianciana at gmail.com (Morgan) Date: Fri Oct 16 17:53:27 2009 Subject: [plt-scheme] Re: Paren Paralysis Sufferers Unite In-Reply-To: <0F0C5AAC-DCD4-488E-877E-521F3C0B1062@ccs.neu.edu> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <4e3a78cf-1538-4c90-b358-a822b758934b@t2g2000yqn.googlegroups.com> <0F0C5AAC-DCD4-488E-877E-521F3C0B1062@ccs.neu.edu> Message-ID: <5aa9eb9e-9b65-427e-ab55-0e903f678c31@g19g2000yqo.googlegroups.com> On 16 Oct, 22:09, Matthias Felleisen wrote: > Morgan, > > the real answer is that SICP got it completely, totally wrong. Lisp, > Scheme, and related friends have syntax. All off-the-shelf languages > have syntax, and if you don't know the syntax, the implementation > reports errors assuming you know the *entire* language. (The problem > is that in languages like Scheme or Perl, you get many errors reported > when you *run* the program not before you run. But even then, the > error message assumes that you know the *entire* language.) > > Because this project explicitly recognizes this fact and because the > people who started it liked Scheme -- they could have liked Pascal, C, > or Java instead -- they created teaching languages, which approximate > the chosen language and provide error messages for the small language, > which is usually easier to grasp than those for the full language. > > The person who maintains a lot of this work is super-curmudgeon Robby. > > What the other people pointed out to you is that {!@#$} languages have > the exact same problem as Scheme. They are off the shelf and they > provide bad error messages. Before you say 'no' reflect on this > statement. The group respects people a lot more who reflect before > they shoot, even though we are all from Texas :-) > > -- Matthias > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme Hi dude! I bought your book 'how to design programs' but haven't got a chance to study it yet, I looked through it and it looks like it leads into the language in a more gentle way than SICP, but our lecturer is a 'devout' SICPer, so that's our core textbook for this semester (god only knows how we'll get through it in 13 weeks) In any case, you've found the last person to disagree with you that languages in general provide god-awful error messages. I suspect, the idea of having a series of languages which progress from the simple to the most powerful/knowledgble is one that will last indefinitely even if the 'biggies' like C++ and Java haven't caught on (to my knowledge anyway), good ideas never die, languages should be like concentric shells, or like those tree trunk cross section diagrams in operating systems books about the interdyanamic between the person, software, the kernal, the hardware. It would be cool, if we had a situation where the error messages could be scaled down to a level of natural language where my grandmother could potentially glance at the code snippet causing havoc and fix it herself. A situation where everyone was some kind of programmer would be great, a bit like a wikipedia arrangment where the experts provide very domain specific knowledge, but everyone has an opportunity to chip in, and in time, become experts themselves with enough usage. I think I've heard of your 'teach-packs' for teaching languages, and that's probably part of the solution to getting there. Ideally, we'd want a world where people never get a error message coming back to them in, of all the things, a list of hexadecimal symbols in the way that windows likes to do to you. Quite honestly, a wiki style of building systems like operating systems or seriously big enterprise software, is probably the only real way we're ever going to be able to build big complex systems that don't have about a billion bugs in them. And the only way we're going to be able to do that, is to start building programming languages than can be converted module by module into various levels of simpler natural language, little 'stories' for the users if you like whilst maintaining the rigor nesscary for the code/story to be converted back to it's original form and run on a processor properly. It's a helluva lot of work to build such a thing, but something like this is eventually going to have to happen. Have you heard of any projects along such lines? I have a link here to something quite similar to what I'm banging on about: http://fold.it/portal/info/science You'd need a way for the newbie coders to turn into experts, so maybe a combination of a role playing game style attributes e.g. you fixed a b c modules/stories, so maybe you get a silver star/experience points and get more complex 'puzzles' presented to you in the category of natural language problem solving that you are good at. Eventually of course, they wind up being closer to what the machine understands. I reckon, of the top of my head, that 9/10 of all computer bugs are relatively simple to fix, things like missing semicolons or off by one errors in array loops etc. These could be represented as metaphors, and attempts could be made to solve them via flash games with direct manipulation maybe. Anyway, goodnight! It's nearly 11pm in England. Probably early morning for you Texas! From jmarshall at alum.mit.edu Fri Oct 16 18:30:00 2009 From: jmarshall at alum.mit.edu (Joe Marshall) Date: Fri Oct 16 18:30:39 2009 Subject: [plt-scheme] Re: Paren Paralysis Sufferers Unite In-Reply-To: References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> Message-ID: On Fri, Oct 16, 2009 at 1:47 PM, Morgan wrote: > > LOL! No, I mean something a wee bit different to that. > > taking an example; the difference between these two pieces of code. > > (define (get-smallest x y z) > ? ? ? ? ?(cond ((and (< x y) (< x z)) x) > ? ? ? ? ? ? ? ?((and (< y x) (< y z)) y) > ? ? ? ? ? ? ? ?((and (< z x) (< z y)) z) > ? ? ? ? ? ?) > ?) > > scheme is all happy with that, but not with what's below: > > (define (get-smallest x y z) > ? ? ? ? ?(cond (((and (< x y) (< x z))) x) > ? ? ? ? ? ? ? ?(((and (< y x) (< y z))) y) > ? ? ? ? ? ? ? ?(((and (< z x) (< z y))) z) > ? ? ? ? ? ?) > ?) Hmmm. What happens when you do this? int main { printf "hello, world"; return 0; } > Now, I freely admit there's absolutely no utility in having those > extra parens. Why are some parenthesis `extra', but others seem to be `required'? After all, if too many parens are OK, why not too few? What's the difference? -- ~jrm From gremio at acm.org Fri Oct 16 19:27:36 2009 From: gremio at acm.org (Gregory Marton) Date: Fri Oct 16 19:27:57 2009 Subject: [plt-scheme] Re: Paren Paralysis Sufferers Unite Message-ID: Hi Morgan, There is a purpose to the madness. Others have told you that the "extra" parentheses are read by Scheme as another procedure application -- it "expected a procedure" as the first item in ()s. What it found was a boolean value instead. Okay. Why would it expect a procedure? What's the point of expecting a procedure instead of just passing on whatever value is there, like math does? When is that kind of thing useful? When do we pass procedures around elsewhere? You might get just the even numbers out of a list like this: (define some-numbers '(3 2 4 1 5 7 2)) (filter even? some-numbers) Here we are passing a procedure to filter, and it calls that procedure. Okay, so it's nice to be able to pass procedures around. Bear with me while I make up some non-existent functions for the purpose of illustration. This may be more than you wanted to know, but it's an attempt to get at the heart of the matter. What if you had a function it-is-bright that told you what time of day it is. Now you can write (define (notify-for-phone-call) (if (it-is-bright) (ring) (vibrate))) Wouldn't that be cool in the movie theater? Now what you want now is to make the backlight brighter whenever it's dark. But your function is it-is-bright so you seek out your friendly (define (complement fn) (lambda () (not (fn)))) This new function complement takes any function (of zero arguments) and turns it into a new function (also of zero arguments) that returns the boolean opposite of whatever the original function would have returned. It's pretty easy to make this work with any number of arguments rather than exactly zero, but it's also unimportant. Armed with complement, you can now write (define (ensure-backlight) (when ((complement it-is-bright)) (set-backlight! 1))) Now look, I've used an "extra" set of parentheses. What did it do for me? I called complement, giving it a function it-is-bright. Complement returned a new function that would say the opposite of whatever you gave it. But that's a function, so I need to invoke it. If I don't invoke it, then the "when" form is testing the function itself, rather than its result. What would happen? Let's try: (if even? "the even? function is considered true" "nope") Go ahead, try it. Note that this is different from (if (even? 3) "three is even" "nope") So the backlight would always get turned on. The "extra" parentheses ran the new function, which ran the old function, and then did the right thing. The function by itself is just considered a true value. Now consider: what would happen if (5) meant the same as 5? Now we have to distinguish somehow between the values we wanted to pass on, untouched, and the values that we should go ahead and evaluate. In our brave new language, would this test ever fail? (when ((complement it-is-bright)) (set-backlight! 1)) Do we pass on the complemented function as just a value, or do we evaluate it? How do we know which to do? The complemented function is a perfectly good value, as far as Scheme is concerned. You might be wondering whether complement returned any value at all, or whether it returned #f. This example is contrived, of course, but this is why the parentheses are not "extra". They mean "evaluate what's in here as a function and its arguments". They always mean that, and there's no ambiguity. The error message reflects that it tried to do that and failed, because it didn't know how to use #t (the boolean true value that was the result of your and clause) as a function. Hope that helps, Grem > taking an example; the difference between these two pieces of code. > > (define (get-smallest x y z) > (cond ((and (< x y) (< x z)) x) > ((and (< y x) (< y z)) y) > ((and (< z x) (< z y)) z) > ) > ) > > scheme is all happy with that, but not with what's below: > > (define (get-smallest x y z) > (cond (((and (< x y) (< x z))) x) > (((and (< y x) (< y z))) y) > (((and (< z x) (< z y))) z) > ) > ) > > which results in this lot: > > (get-smallest 1 2 3) > > . . procedure application: expected procedure, given: #t (no > arguments) > > Now, I freely admit there's absolutely no utility in having those > extra parens. But they do no harm! [I think. Being a newb could > possibly mean being wrong about these things. However the sky hasn't > fallen in yet, so I'm fairly hopeful] > > taking the typical math example ((2 + 2) * 3) I mean, we know those > parens are useless, but they potentially help to clarify the situation > if you're uncertain of the order of evaluation with arithmetric > operators. -- ------ __@ Gregory A. Marton http://csail.mit.edu/~gremio --- _`\<,_ 617-775-3005 -- (*)/ (*) Purpose of life: be happy; help others be happy. ~~~~~~~~~~~~~~~~-~~~~~~~~_~~~_~~~~~v~~~~^^^^~~~~~--~~~~~~~~~~~~~~~++~~~~~~~ From grettke at acm.org Sat Oct 17 00:03:34 2009 From: grettke at acm.org (Grant Rettke) Date: Sat Oct 17 00:04:10 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> Message-ID: <756daca50910162103t5fc8c8d4k58c54a6ef63f3911@mail.gmail.com> Hi Morgan, On Fri, Oct 16, 2009 at 2:29 PM, Morgan wrote: > More importantly, what survival tricks are there to discovering > whether there's too few or too many parens? Just knowing the syntax > backward? Other folks have described the syntax so that leaves the question of how to make it easier. I can't find the post, but in it Eli explained how to make navigating among s-expressions easy. Basically, you take advantage of what your editor has to offer. Take DrScheme. Read this part about the keybindings: http://www.wisdomandwonder.com/article/139/working-with-drscheme-372 It can be very easy to navigate s-expressions and make sure that they are balanced by using the built in keybindings. The 2nd thing you pointed out is that you would like to be able to distinguish different parts of an expression by adding extra parentheses. In PLT Scheme you can use round brackets and curly brackets and square brackets interchangeably as long as they balance. You might experiment with this to make your code appear more to your liking. From mail.prashanthkr at gmail.com Sat Oct 17 00:39:54 2009 From: mail.prashanthkr at gmail.com (Hari Prashanth) Date: Sat Oct 17 00:48:06 2009 Subject: [plt-scheme] New to PLT Redex. Need some help. Message-ID: Hi Everyone, I took the code given in the Redex website ( http://redex.plt-scheme.org/lam-v.html) and made the following changes to it. 1. changed number pattern to string 2. Instead of +(in reduction-relation), I used string-append 3. (if0 0 e_1 e_2) to (if0 "true" e_1 e_2) and for the other case any other string except "true". And called traces like this (traces red (term ((? (n) (if0 n 1 ((? (x) (x x)) (? (x) (x x))))) (+ "2" "2"))))... But it did not reduce the expression in any way. Basically The output was just ((? (n) (if0 n 1 ((? (x) (x x)) (? (x) (x x))))) (+ "2" "2")). Where am I going wrong? How can I use symbol instead of string? When I used symbol, I got an error saying expected a non-terminal pattern but got one of Expr, Var, Val, Cntxt in symbol_1. Why did I get that error? Can someone throw some light on it. Thanks Hari -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091017/3cde335f/attachment.htm From robby at eecs.northwestern.edu Sat Oct 17 08:27:24 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Sat Oct 17 08:27:48 2009 Subject: [plt-scheme] New to PLT Redex. Need some help. In-Reply-To: References: Message-ID: <932b2f1f0910170527u21233659g6c1c3dfa419b57ef@mail.gmail.com> 2009/10/16 Hari Prashanth : > Hi Everyone, > I took the code given in the Redex website > (http://redex.plt-scheme.org/lam-v.html) and made the following changes to > it. > 1. changed number pattern to string > > 2. Instead of +(in reduction-relation), I used string-append > > 3. (if0 0 e_1 e_2) to (if0 "true" e_1 e_2) and for the other case any other > string except "true". > > And called traces like this > > (traces red > ??????? (term > ???????? ((? (n) > ??????????? (if0 > ???????????? n > ???????????? 1 > ???????????? ((? (x) (x x)) > ????????????? (? (x) (x x))))) > ????????? (+ "2" "2"))))... > > But it did not reduce the expression in any way. Basically The output was > just > ((? (n) > ??????????? (if0 > ???????????? n > ???????????? 1 > ???????????? ((? (x) (x x)) > ????????????? (? (x) (x x))))) > ????????? (+ "2" "2")). > > Where am I going wrong? That should work. Probably there was some other small mistake somewhere that is tripping you up. My best advice for debugging Redex programs is to start playing with redex-match. Make sure the expression above really is an "e". If it isn't one, make a smaller and smaller example to understand why not. Possibly, in this case, you needed a "1" in the middle of the term? > How can I use symbol instead of string? When I used symbol, I got an error > saying expected a non-terminal pattern but got one of Expr, Var, Val, Cntxt > in symbol_1. > Why did I get that error? symbol isn't a built-in non-terminal. variable is, however. Robby From taost_on_cheeezman at hotmail.com Fri Oct 16 20:44:45 2009 From: taost_on_cheeezman at hotmail.com (Jonathan Tot) Date: Sat Oct 17 09:19:21 2009 Subject: [plt-scheme] untitled file Message-ID: Hi I am wondering if scheme stores an empty file like other programs, becuase i'd like to edit it so it has a comment header everytime i open it? Does Scheme have something like this? any help would be greatly appreciated. Jonathan Tot _________________________________________________________________ New! Open Messenger faster on the MSN homepage http://go.microsoft.com/?linkid=9677405 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091016/006985e5/attachment.htm From robby at eecs.northwestern.edu Sat Oct 17 09:34:14 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Sat Oct 17 09:40:27 2009 Subject: [plt-scheme] untitled file In-Reply-To: References: Message-ID: <932b2f1f0910170634y1ecba40i9c9e69aed80731ac@mail.gmail.com> No, DrScheme doesn't do that. You'd have to make a file that has what you want and copy it and open the copy each time (or similar), I'm sorry to say. Robby On Fri, Oct 16, 2009 at 7:44 PM, Jonathan Tot wrote: > Hi I am wondering if scheme stores an empty file like other programs, > becuase i'd like to edit it so it has a comment header everytime i open it? > > Does Scheme have something like this? > > any help would be greatly appreciated. > > Jonathan Tot > > ________________________________ > New! Open Hotmail faster on the new MSN homepage! > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From mflatt at cs.utah.edu Sat Oct 17 10:06:43 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Sat Oct 17 10:07:18 2009 Subject: [plt-scheme] plt-threads in r6rs In-Reply-To: <02b1762c-d1c0-44e2-9f98-2cea5534d8e8@r5g2000yqb.googlegroups.com> References: <02b1762c-d1c0-44e2-9f98-2cea5534d8e8@r5g2000yqb.googlegroups.com> Message-ID: <20091017140648.0CF4C6500BE@mail-svr1.cs.utah.edu> At Fri, 16 Oct 2009 02:01:35 -0700 (PDT), sballnat wrote: > I'm writing an r6rs-script using some functions imported from (scheme > base) and (scheme tcp). I'm especially using threads and want to make > sure everything is thread-safe as described in the manual (10.1 > Threads). There it is said that most operations are atomic (like set!) > or in case of hashtables they have semaphores. Now, I wonder if this > is still true for r6rs-operations and hashtables. Yes. R6RS hash tables are built on `scheme/base' hash tables, and they inherit the latter's thread-related properties. (I'll add a note in the documentation.) From sbloch at adelphi.edu Sat Oct 17 11:56:41 2009 From: sbloch at adelphi.edu (Stephen Bloch) Date: Sat Oct 17 11:57:16 2009 Subject: [plt-scheme] Re: Paren Paralysis Sufferers Unite In-Reply-To: References: Message-ID: On Oct 16, 2009, at 7:27 PM, Gregory Marton wrote: > ... This example is contrived, of course, but this is why the > parentheses are not "extra". They mean "evaluate what's in here as > a function and its arguments". They always mean that, and there's no > ambiguity. Another way to resolve the ambiguity would have been to add an explicit "call" keyword, so "call foo" and "(call((foo)))" would both mean the result of calling foo, and "foo" and "(((foo)))" would both mean the funtion foo itself. But then the quadratic formula would have to be call /(call -(call sqrt(call -(call sqr(b)), call *(4,a,c))), b), call *(2,a)) which is too horrible to contemplate. From ebellani at gmail.com Sat Oct 17 12:26:01 2009 From: ebellani at gmail.com (Eduardo Bellani) Date: Sat Oct 17 12:26:25 2009 Subject: [plt-scheme] Did anyone saw this article? Message-ID: <184222e50910170926p74ab2a9r2f444c6f96d10218@mail.gmail.com> Its so pretty :) http://www.eecs.berkeley.edu/Pubs/TechRpts/2009/EECS-2009-79.pdf -- Eduardo Bellani www.cnxs.com.br I object to doing things that computers can do. - Olin Shivers From mail.prashanthkr at gmail.com Sat Oct 17 17:04:18 2009 From: mail.prashanthkr at gmail.com (Hari Prashanth) Date: Sat Oct 17 17:04:43 2009 Subject: [plt-scheme] New to PLT Redex. Need some help. In-Reply-To: <956144.94159.qm@web95302.mail.in2.yahoo.com> References: <956144.94159.qm@web95302.mail.in2.yahoo.com> Message-ID: > > Hi, > >>> Possibly, in this case, you needed a "1" in the middle of the term? > > Yes this did the trick. Thanks a ton... It reduced:-) > > But should it not raise an error when a number was passed and my pattern > was string. > > Thanks > Hari > > --- On *Sat, 17/10/09, Robby Findler * wrote: > > > From: Robby Findler > Subject: Re: [plt-scheme] New to PLT Redex. Need some help. > To: "Hari Prashanth" > Cc: plt-scheme@list.cs.brown.edu > Date: Saturday, 17 October, 2009, 5:57 PM > > 2009/10/16 Hari Prashanth : > > Hi Everyone, > > I took the code given in the Redex website > > (http://redex.plt-scheme.org/lam-v.html) and made the following changes > to > > it. > > 1. changed number pattern to string > > > > 2. Instead of +(in reduction-relation), I used string-append > > > > 3. (if0 0 e_1 e_2) to (if0 "true" e_1 e_2) and for the other case any > other > > string except "true". > > > > And called traces like this > > > > (traces red > > (term > > ((? (n) > > (if0 > > n > > 1 > > ((? (x) (x x)) > > (? (x) (x x))))) > > (+ "2" "2"))))... > > > > But it did not reduce the expression in any way. Basically The output was > > just > > ((? (n) > > (if0 > > n > > 1 > > ((? (x) (x x)) > > (? (x) (x x))))) > > (+ "2" "2")). > > > > Where am I going wrong? > > That should work. Probably there was some other small mistake > somewhere that is tripping you up. > > My best advice for debugging Redex programs is to start playing with > redex-match. Make sure the expression above really is an "e". If it > isn't one, make a smaller and smaller example to understand why not. > > Possibly, in this case, you needed a "1" in the middle of the term? > > > How can I use symbol instead of string? When I used symbol, I got an > error > > saying expected a non-terminal pattern but got one of Expr, Var, Val, > Cntxt > > in symbol_1. > > Why did I get that error? > > symbol isn't a built-in non-terminal. variable is, however. > > > Robby > > > ------------------------------ > From cricket scores to your friends. Try the Yahoo! India Homepage! > > > ------------------------------ > Connect more, do more and share more with Yahoo! India Mail. Learn more > . > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091017/4642b650/attachment.htm From spdegabrielle at gmail.com Sat Oct 17 19:36:39 2009 From: spdegabrielle at gmail.com (Stephen De Gabrielle) Date: Sat Oct 17 19:37:03 2009 Subject: omitted-paths error [was: [plt-scheme] error building plt-4.2.1] Message-ID: <595b9ab20910171636p19114eb1g726e84a3ea8d2db5@mail.gmail.com> Hi, I'm getting a similar problem for a plugin I'm trying to debug using dev links but running setup-plt gets the same error. Did you solve it? Cheers, Stephen stephen@stephen-laptop:~$ full-4.2.2.1/bin/planet show Development links: spdegabrielle projectmgr.plt 1 2 --> /home/stephen/projects/projects-project/projectmgr stephen@stephen-laptop:~$ full-4.2.2.1/bin/setup-plt -P spdegabrielle projectmgr.plt 1 2 setup-plt: version: 4.2.2.1 [3m] setup-plt: variants: 3m cgc setup-plt: main collects: /home/stephen/full-4.2.2.1/collects setup-plt: collects paths: setup-plt: /home/stephen/.plt-scheme/4.2.2.1/collects setup-plt: /home/stephen/full-4.2.2.1/collects omitted-paths: given directory path is not in any collection root: # === context === /home/stephen/full-4.2.2.1/collects/setup/private/omitted-paths.ss:85:0: omitted-paths* /home/stephen/full-4.2.2.1/collects/scheme/private/more-scheme.ss:396:13: hash-ref! /home/stephen/full-4.2.2.1/collects/setup/setup-unit.ss:234:2: planet->cc /home/stephen/full-4.2.2.1/collects/scheme/list.ss:243:4: loop stephen@stephen-laptop:~$ full-4.2.2.1/bin/planet show Development links: spdegabrielle projectmgr.plt 1 2 --> /home/stephen/projects/projects-project/projectmgr stephen@stephen-laptop:~$ full-4.2.2.1/bin/setup-plt setup-plt: version: 4.2.2.1 [3m] setup-plt: variants: 3m cgc setup-plt: main collects: /home/stephen/full-4.2.2.1/collects setup-plt: collects paths: setup-plt: /home/stephen/.plt-scheme/4.2.2.1/collects setup-plt: /home/stephen/full-4.2.2.1/collects omitted-paths: given directory path is not in any collection root: # === context === /home/stephen/full-4.2.2.1/collects/setup/private/omitted-paths.ss:85:0: omitted-paths* /home/stephen/full-4.2.2.1/collects/scheme/private/more-scheme.ss:396:13: hash-ref! /home/stephen/full-4.2.2.1/collects/setup/setup-unit.ss:234:2: planet->cc /home/stephen/full-4.2.2.1/collects/scheme/list.ss:243:4: loop stephen@stephen-laptop:~$ full-4.2.2.1/bin/setup-plt -h On Sat, Aug 8, 2009 at 9:50 , AM, YC wrote: > Hi - > > I am encountering error of building plt 4.2.1 that says the following in the > make install step: > > omitted-paths: given directory path is not in any collection root: > # > > ?=== context === > /../tmp/plt-4.2.1/collects/setup/private/omitted-paths.ss:84:0: > omitted-paths* > /../tmp/plt-4.2.1/collects/scheme/private/more-scheme.ss:396:13: hash-ref! > /../tmp/plt-4.2.1/collects/setup/setup-unit.ss:233:2: planet->cc > /../tmp/plt-4.2.1/collects/scheme/list.ss:243:4: loop > > It seems that the setup-plt tries to build my development linked packages, > and since they are linked packages they do not belong in a collection root. > > How should I get around this issue?? I am on CentOS5.1 if that makes a > difference.? Thanks, > yc > > > > _________________________________________________ > ?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 yinso.chen at gmail.com Sat Oct 17 22:09:52 2009 From: yinso.chen at gmail.com (YC) Date: Sat Oct 17 22:10:22 2009 Subject: omitted-paths error [was: [plt-scheme] error building plt-4.2.1] In-Reply-To: <595b9ab20910171636p19114eb1g726e84a3ea8d2db5@mail.gmail.com> References: <595b9ab20910171636p19114eb1g726e84a3ea8d2db5@mail.gmail.com> Message-ID: <779bf2730910171909p37467dfau46456f885655f14f@mail.gmail.com> On Sat, Oct 17, 2009 at 4:36 PM, Stephen De Gabrielle < spdegabrielle@gmail.com> wrote: > Hi, > I'm getting a similar problem for a plugin I'm trying to debug using > dev links but running setup-plt gets the same error. > > Did you solve it? > > Cheers, > Stephen > I envision removing the links will get rid of the problem (and add the links back in), but I did not do so as it was my production environment so I wasn't able to mess with the settings while getting the code built. yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091017/03f3a06c/attachment.htm From philrand at gmail.com Sun Oct 18 17:26:34 2009 From: philrand at gmail.com (Phil Rand) Date: Sun Oct 18 17:34:20 2009 Subject: [plt-scheme] PLT Scheme v4.2.2 In-Reply-To: References: Message-ID: <5784c1b10910181426o378c9ccfy9c40f667d72460a1@mail.gmail.com> I've installed 4.2.2 on Mac OSX Snow Leopard 10.6 and it seems to work fine, but I noticed today that the Help -> Help Desk menu item takes me to the PLT web site rather than a local copy as previous versions did. How can I make sure all the documentation is installed and accessed locally? On Sun, Oct 4, 2009 at 1:16 PM, Eli Barzilay wrote: > PLT Scheme version 4.2.2 is now available from > > ?http://plt-scheme.org/ > > * DrScheme now, by default, compiles all of the files that are > ?loaded when it runs a program and saves the compiled files in the > ?filesystem. ?This should lead to faster load times (not faster > ?runtimes) since it avoids re-compiling files whose dependencies > ?have not changed. > > * New Scribble libraries and documentation make it easier to get > ?started with Scribble, especially for uses other than PLT > ?documentation. ?DrScheme now has better indentation and syntax > ?coloring support for Scribble languages (and generally all @-exp > ?based languages). > > * The new `syntax/keyword' library provides support for macros with > ?keyword options. ?A new quick start guide has been added to the > ?documentation for the `syntax/parse' library. > > * Added support for abstract contracts via the #:exists keywords. > ?This is an experiment to add support for data hiding to the > ?contract system. > > * Added `in-producer': a sequence expression makes it easy to > ?iterate over producer functions (e.g., `read'). ?A new > ?`scheme/generator' library creates generators that can use a > ?(parameterized) yield function. > > * HtDP langs: several primitives now consume 0 and 1 arguments in > ?ISL (and up), including `append', `+' and `*'. ?In addition, > ?`make-list' was added to the primitives. > > * The API to Universe has a number of new constructs. ?All Universe > ?programs should run unchanged. ?The most important change is the > ?addition of `animate' as an alternative name for `run-simulation'. > ?In addition, adding the clause `(state true)' to a world > ?description now pretty-prints the state of the world into a > ?separate canvas. > > * A number of changes were made to the DeinProgramm / DMdA language > ?levels: The `check-property' and `contract' forms were added, > ?`define-record-procedures-parametric' has changed. ?See the > ?documentation for details. > > * The test engine in the HtDP languages no longer warns programmers > ?when the Definitions window has no tests. > > * ProfessorJ (and related code) is no longer included in the PLT > ?distributions. ?It may re-appear in the future as a PLaneT package. > > [Note that mirror sites can take a while to catch up with the new > downloads.] > > Feedback Welcome, > -- > ? ? ? ? ?((lambda (x) (x x)) (lambda (x) (x x))) ? ? ? ? ?Eli Barzilay: > ? ? ? ? ? ? ? ? ? ?http://barzilay.org/ ? ? ? ? ? ? ? ? ? Maze is Life! > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Phil Rand philrand@gmail.com philrand@pobox.com From toddobryan at gmail.com Sun Oct 18 19:57:54 2009 From: toddobryan at gmail.com (Todd O'Bryan) Date: Sun Oct 18 19:58:15 2009 Subject: [plt-scheme] textarea formlet? Message-ID: <904774730910181657y4658aa0dhac28ee2d632975ef@mail.gmail.com> Is there a textarea formlet that I'm missing, or an easy way to create one that I'm overlooking, or is it something that's waiting for an official implementation (but which everybody already has one of who's using the webapp framework)? Todd From jay.mccarthy at gmail.com Sun Oct 18 21:13:58 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Sun Oct 18 21:14:21 2009 Subject: [plt-scheme] textarea formlet? In-Reply-To: <904774730910181657y4658aa0dhac28ee2d632975ef@mail.gmail.com> References: <904774730910181657y4658aa0dhac28ee2d632975ef@mail.gmail.com> Message-ID: There is none in the core. If you write one, I will add it. Base the implementation off text-or-password from http://svn.plt-scheme.org/plt/trunk/collects/web-server/formlets/input.ss And it should be straight forward. There are many formlets that should exist, but do not. Some don't because I don't have the time/need yet. Some don't because I can't think of the right API (for example, selects and radios.) I welcome all contributions though. =) Jay On Sun, Oct 18, 2009 at 5:57 PM, Todd O'Bryan wrote: > Is there a textarea formlet that I'm missing, or an easy way to create > one that I'm overlooking, or is it something that's waiting for an > official implementation (but which everybody already has one of who's > using the webapp framework)? > > 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 Mon Oct 19 04:08:45 2009 From: laurent.orseau at gmail.com (Laurent) Date: Mon Oct 19 04:09:25 2009 Subject: [plt-scheme] Red links in scribble documentation Message-ID: Hi all, I'm writing my first package, but all the functions and form names in the scribble documentation are underlined with a red line. This probably means the linking is wrong, but I can't figure out what it is. Does anyone know what kind of error this comes from? Thanks, Laurent -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091019/ea86521f/attachment.htm From stephen.degabrielle at acm.org Mon Oct 19 08:45:41 2009 From: stephen.degabrielle at acm.org (Stephen De Gabrielle) Date: Mon Oct 19 08:46:04 2009 Subject: omitted-paths error [was: [plt-scheme] error building plt-4.2.1] In-Reply-To: <779bf2730910171909p37467dfau46456f885655f14f@mail.gmail.com> References: <595b9ab20910171636p19114eb1g726e84a3ea8d2db5@mail.gmail.com> <779bf2730910171909p37467dfau46456f885655f14f@mail.gmail.com> Message-ID: <595b9ab20910190545y142c4398tfadfdea4680b802@mail.gmail.com> I tried removing and reinstating the dev-link, but I still get the "omitted paths: given directory path is not in the collection root: ." error? Does anyone else use dev links? Thanks, Stephen On Sunday, October 18, 2009, YC wrote: > > On Sat, Oct 17, 2009 at 4:36 PM, Stephen De Gabrielle wrote: > > Hi, > I'm getting a similar problem for a plugin I'm trying to debug using > dev links but running setup-plt gets the same error. > > Did you solve it? > > Cheers, > Stephen > > I envision removing the links will get rid of the problem (and add the links back in), but I did > not do so as it was my production environment so I wasn't able to mess > with the settings while getting the code built. > > yc > > > -- -- Stephen De Gabrielle stephen.degabrielle@acm.org Telephone +44 (0)20 85670911 Mobile +44 (0)79 85189045 http://www.degabrielle.name/stephen From carl.eastlund at gmail.com Mon Oct 19 09:59:22 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Mon Oct 19 10:00:03 2009 Subject: omitted-paths error [was: [plt-scheme] error building plt-4.2.1] In-Reply-To: <595b9ab20910190545y142c4398tfadfdea4680b802@mail.gmail.com> References: <595b9ab20910171636p19114eb1g726e84a3ea8d2db5@mail.gmail.com> <779bf2730910171909p37467dfau46456f885655f14f@mail.gmail.com> <595b9ab20910190545y142c4398tfadfdea4680b802@mail.gmail.com> Message-ID: <990e0c030910190659i3b210427gc5716b7ff855d0ff@mail.gmail.com> I use development links. I got this error message once a year ago, and it turned out to be a setup-plt bug, but it was soon fixed and has long since been released. I'm not sure what you're seeing now. Carl Eastlund On Mon, Oct 19, 2009 at 8:45 AM, Stephen De Gabrielle wrote: > I tried removing and reinstating the dev-link, but I still get the > "omitted paths: given directory path is not in the collection root: > ." error? > > Does anyone else use dev links? > > Thanks, > > Stephen > > On Sunday, October 18, 2009, YC wrote: >> >> On Sat, Oct 17, 2009 at 4:36 PM, Stephen De Gabrielle wrote: >> >> Hi, >> I'm getting a similar problem for a plugin I'm trying to debug using >> dev links but running setup-plt gets the same error. >> >> Did you solve it? >> >> Cheers, >> Stephen >> >> I envision removing the links will get rid of the problem (and add the links back in), but I did >> not do so as it was my production environment so I wasn't able to mess >> with the settings while getting the code built. >> >> yc From mflatt at cs.utah.edu Mon Oct 19 10:09:43 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Mon Oct 19 10:10:04 2009 Subject: [plt-scheme] Red links in scribble documentation In-Reply-To: References: Message-ID: <20091019140944.E9596650075@mail-svr1.cs.utah.edu> At Mon, 19 Oct 2009 10:08:45 +0200, Laurent wrote: > I'm writing my first package, but all the functions and form names in the > scribble documentation are underlined with a red line. > This probably means the linking is wrong, but I can't figure out what it is. > > Does anyone know what kind of error this comes from? You see the red underlines when you install the package or setup with a development link, right? Are you using `(require (for-label ...))' within your Scribble source to import the bindings of the documented module? From czhu at cs.utah.edu Mon Oct 19 10:10:12 2009 From: czhu at cs.utah.edu (Chongkai Zhu) Date: Mon Oct 19 10:10:45 2009 Subject: [plt-scheme] Red links in scribble documentation In-Reply-To: References: Message-ID: <4ADC7344.4030604@cs.utah.edu> Yes, the link is wrong. Chances are that you have to tweak your ".scrbl" to make them correct. With you your source code, I can't given further help on what part is wrong though. Chongkai Laurent wrote: > Hi all, > > I'm writing my first package, but all the functions and form names in > the scribble documentation are underlined with a red line. > This probably means the linking is wrong, but I can't figure out what > it is. > > Does anyone know what kind of error this comes from? > > Thanks, > Laurent > ------------------------------------------------------------------------ > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From icfp.publicity at googlemail.com Mon Oct 19 10:42:26 2009 From: icfp.publicity at googlemail.com (Wouter Swierstra) Date: Mon Oct 19 10:42:47 2009 Subject: [plt-scheme] ICFP10: Call for workshop proposals Message-ID: <53ff55480910190742o23017f75y26342b5f9c63eee8@mail.gmail.com> (Apologies for sending out multiple copies, the first version may not have made it past the list moderator.) 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 laurent.orseau at gmail.com Mon Oct 19 12:02:20 2009 From: laurent.orseau at gmail.com (Laurent) Date: Mon Oct 19 12:03:04 2009 Subject: [plt-scheme] Red links in scribble documentation In-Reply-To: <4ADC7344.4030604@cs.utah.edu> References: <4ADC7344.4030604@cs.utah.edu> Message-ID: The package and the .ss files (btw, .scm files cannot be used in packages??) are in the "..../lazy-doc" directory, and the scrbl files are in "..../lazy-doc/reference". Here is common.scrbl header: --------------- #lang scribble/manual @(require (for-label scheme "../common.ss")) @defmodule[(planet orseau/lazy-doc:1:0/common)] --------------- There is no warning when I use "planet create ...." and all the documentation looks fine except for the red links. I also set a hard link with "add-hard-link" and when I test my package with (require (planet orseau/lazy-doc:1:0/common)) in another file in another directory all is fine. I did not use directly setup-plt or any install command. Should I have? Thanks, Laurent On Mon, Oct 19, 2009 at 16:10, Chongkai Zhu wrote: > Yes, the link is wrong. Chances are that you have to tweak your ".scrbl" to > make them correct. With you your source code, I can't given further help on > what part is wrong though. > > Chongkai > > Laurent wrote: > >> Hi all, >> >> I'm writing my first package, but all the functions and form names in the >> scribble documentation are underlined with a red line. >> This probably means the linking is wrong, but I can't figure out what it >> is. >> >> Does anyone know what kind of error this comes from? >> >> Thanks, >> Laurent >> ------------------------------------------------------------------------ >> >> _________________________________________________ >> 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/20091019/296b42c3/attachment.htm From carl.eastlund at gmail.com Mon Oct 19 12:09:12 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Mon Oct 19 12:09:54 2009 Subject: [plt-scheme] Red links in scribble documentation In-Reply-To: References: <4ADC7344.4030604@cs.utah.edu> Message-ID: <990e0c030910190909m7450c2d9x2b3193ba455716e6@mail.gmail.com> On Mon, Oct 19, 2009 at 12:02 PM, Laurent wrote: > The package and the .ss files (btw, .scm files cannot be used in packages??) > are in the "..../lazy-doc" directory, > and the scrbl files are in "..../lazy-doc/reference". > > Here is common.scrbl header: > --------------- > #lang scribble/manual > > @(require (for-label scheme > ???????????????????? "../common.ss")) > > @defmodule[(planet orseau/lazy-doc:1:0/common)] > --------------- > > There is no warning when I use "planet create ...." and all the > documentation looks fine except for the red links. > I also set a hard link with "add-hard-link" and when I test my package with > (require (planet orseau/lazy-doc:1:0/common)) > in another file in another directory all is fine. > > I did not use directly setup-plt or any install command. Should I have? > > Thanks, > Laurent Ah ha. I see the problem. You have required "../common.ss" for-label, but you have declared your documentation to describe (planet orseau/lazy-doc:1:0/common). Scribble is not smart enough to know those are the same thing. You want to use a planet path for both positions. I also recommend you replace the require spec with (this-packagin-in common), and the defmodule with (defmodule/this-package common). Both bindings are available from (planet cce/scheme), and you can find the online documentation here: http://planet.plt-scheme.org/package-source/cce/scheme.plt/6/0/planet-docs/manual/Modules.html#(part._planet) http://planet.plt-scheme.org/package-source/cce/scheme.plt/6/0/planet-docs/manual/scribble.html (It only occurs to me now that I should have those documented in the same section for just this reason... oops.) If you use them, your code will continue to work even when you release 1.1, 1.2, 2.0, etc., without having to update the version numbers. --Carl From laurent.orseau at gmail.com Mon Oct 19 12:53:09 2009 From: laurent.orseau at gmail.com (Laurent) Date: Mon Oct 19 12:53:53 2009 Subject: [plt-scheme] Red links in scribble documentation In-Reply-To: <990e0c030910190909m7450c2d9x2b3193ba455716e6@mail.gmail.com> References: <4ADC7344.4030604@cs.utah.edu> <990e0c030910190909m7450c2d9x2b3193ba455716e6@mail.gmail.com> Message-ID: It works now! That was the problem. For those who could have the same error, here is now my header: --------------- #lang scribble/manual @(require (planet cce/scheme:6:0/scribble) (for-label scheme (this-package-in common))) @(defmodule/this-package common) --------------- Thanks all, Laurent On Mon, Oct 19, 2009 at 18:09, Carl Eastlund wrote: > On Mon, Oct 19, 2009 at 12:02 PM, Laurent > wrote: > > The package and the .ss files (btw, .scm files cannot be used in > packages??) > > are in the "..../lazy-doc" directory, > > and the scrbl files are in "..../lazy-doc/reference". > > > > Here is common.scrbl header: > > --------------- > > #lang scribble/manual > > > > @(require (for-label scheme > > "../common.ss")) > > > > @defmodule[(planet orseau/lazy-doc:1:0/common)] > > --------------- > > > > There is no warning when I use "planet create ...." and all the > > documentation looks fine except for the red links. > > I also set a hard link with "add-hard-link" and when I test my package > with > > (require (planet orseau/lazy-doc:1:0/common)) > > in another file in another directory all is fine. > > > > I did not use directly setup-plt or any install command. Should I have? > > > > Thanks, > > Laurent > > Ah ha. I see the problem. You have required "../common.ss" > for-label, but you have declared your documentation to describe > (planet orseau/lazy-doc:1:0/common). Scribble is not smart enough to > know those are the same thing. You want to use a planet path for both > positions. > > I also recommend you replace the require spec with (this-packagin-in > common), and the defmodule with (defmodule/this-package common). Both > bindings are available from (planet cce/scheme), and you can find the > online documentation here: > > > http://planet.plt-scheme.org/package-source/cce/scheme.plt/6/0/planet-docs/manual/Modules.html#(part._planet) > > http://planet.plt-scheme.org/package-source/cce/scheme.plt/6/0/planet-docs/manual/scribble.html > > (It only occurs to me now that I should have those documented in the > same section for just this reason... oops.) > > If you use them, your code will continue to work even when you release > 1.1, 1.2, 2.0, etc., without having to update the version numbers. > > --Carl > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091019/7b56a16a/attachment.htm From jay.mccarthy at gmail.com Mon Oct 19 13:14:03 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Mon Oct 19 13:14:32 2009 Subject: [plt-scheme] [ANN] BulletML Message-ID: I've just released an implementation of BulletML on PLaneT: http://planet.plt-scheme.org/display.ss?package=bulletml.plt&owner=jaymccarthy http://planet.plt-scheme.org/package-source/jaymccarthy/bulletml.plt/1/0/planet-docs/bulletml/index.html Run (require (planet jaymccarthy/bulletml:1:0)) in DrScheme or MrEd, select a file, and watch something cool. Read more about BulletML (and try a different implementation) here: http://www.asahi-net.or.jp/~cs8k-cyu/bulletml/index_e.html For the Scheme programmers, you might want to check out the implementation for a good use of World, an XML->ADT parser, and some fun use of Typed Scheme. Jay -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From rafkind at cs.utah.edu Mon Oct 19 14:13:28 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Mon Oct 19 14:16:02 2009 Subject: [plt-scheme] syntax-parse literals Message-ID: <4ADCAC48.6050307@cs.utah.edu> The set of literals that can be used in syntax-parse have to be defined which quickly leads me to a situation where I have duplicate identifiers. Is there some way to tell syntax-parse an identifier is a literal without defining it? In general it seems like a bad idea to have to define all literals as it pollutes the namespace. This code gives a duplicate identifier for 'a' and 'b'. (define (test2) (define-syntax mymacro (syntax-rules () [(_ (literal ...) (name pattern ...) template) (begin (define-syntax literal (lambda (stx) (error 'literal "dont use this"))) ... (define-syntax (name stx) (syntax-parse stx #:literals (literal ...) [(_ pattern ...) #'template])))])) (mymacro (a b) (foo a b) 1) (mymacro (a b) (bar a b) 2) (foo a b)) From ryanc at ccs.neu.edu Mon Oct 19 17:19:30 2009 From: ryanc at ccs.neu.edu (Ryan Culpepper) Date: Mon Oct 19 17:20:04 2009 Subject: [plt-scheme] syntax-parse literals In-Reply-To: <4ADCAC48.6050307@cs.utah.edu> References: <4ADCAC48.6050307@cs.utah.edu> Message-ID: <306A47F6-A6D6-4395-BC29-89F7DF7161A2@ccs.neu.edu> On Oct 19, 2009, at 2:13 PM, Jon Rafkind wrote: > The set of literals that can be used in syntax-parse have to be > defined which quickly leads me to a situation where I have duplicate > identifiers. Is there some way to tell syntax-parse an identifier is > a literal without defining it? Not a literal per se, but you can use the following syntax class and pass it the identifier you want to match. (define-syntax-class (literal-like lit) (pattern x:id #:when (free-identifier=? #'x lit))) > In general it seems like a bad idea to have to define all literals > as it pollutes the namespace. On the contrary, it's a bad idea not to. Literals generally indicate, or "tag", a special subform, like an 'else' branch of a conditional or a 'public' method declaration. These are entities in their own right. Giving them their own bindings lets them be renamable and documentable. The convention of defining these keywords as error- raising macros also effectively removes them from the domain of expressions, so your macros can retain uniform behavior on expressions. If you want lightweight "tags", use keywords (#:blah) instead. Or use symbolic comparison (and the 'atom-in-list' syntax class, if you like). Ryan > This code gives a duplicate identifier for 'a' and 'b'. > > (define (test2) > (define-syntax mymacro > (syntax-rules () > [(_ (literal ...) > (name pattern ...) > template) > (begin > (define-syntax literal (lambda (stx) (error 'literal "dont > use this"))) ... > (define-syntax (name stx) > (syntax-parse stx > #:literals (literal ...) > [(_ pattern ...) #'template])))])) > (mymacro (a b) (foo a b) 1) > (mymacro (a b) (bar a b) 2) > (foo a b)) > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From tmcdowell at gmail.com Mon Oct 19 19:43:25 2009 From: tmcdowell at gmail.com (Timothy McDowell) Date: Mon Oct 19 19:43:46 2009 Subject: [plt-scheme] Lambda in a list... am I doing something wrong? Message-ID: <88e4f940910191643q5d9be7dcg87a424de6fbe41bb@mail.gmail.com> I'm trying to write a little interactive fiction, and I have a setup like this: (define commands '( ("look" (lambda () (display "test"))))) The response I get from trying ((cdr (car commands))): procedure application: expected procedure, given: ((lambda () (display "test"))) (no arguments) Can someone explain to me what I am doing wrong? -- Thanks, --Timothy. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091019/c0e44816/attachment.htm From rafkind at cs.utah.edu Mon Oct 19 19:43:30 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Mon Oct 19 19:46:07 2009 Subject: [plt-scheme] Lambda in a list... am I doing something wrong? In-Reply-To: <88e4f940910191643q5d9be7dcg87a424de6fbe41bb@mail.gmail.com> References: <88e4f940910191643q5d9be7dcg87a424de6fbe41bb@mail.gmail.com> Message-ID: <4ADCF9A2.4010309@cs.utah.edu> Timothy McDowell wrote: > I'm trying to write a little interactive fiction, and I have a setup like > this: > (define commands > '( > ("look" (lambda () (display "test"))))) > > Try (define commands (list (list "look" (lambda () (display "test"))))) > The response I get from trying ((cdr (car commands))): > procedure application: expected procedure, given: ((lambda () (display > "test"))) (no arguments) > > Can someone explain to me what I am doing wrong? > > -- Thanks, > --Timothy. > > > ------------------------------------------------------------------------ > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From krhari at ccs.neu.edu Mon Oct 19 22:50:16 2009 From: krhari at ccs.neu.edu (krhari@ccs.neu.edu) Date: Mon Oct 19 22:50:45 2009 Subject: [plt-scheme] Lambda in a list... am I doing something wrong? In-Reply-To: <31177164.1092601256006820054.JavaMail.root@zimbra> Message-ID: <31369610.1092621256007016483.JavaMail.root@zimbra> Hi, If I am not wrong, cdr returns a list. So when you have ((cdr (car commands))), it will give you ((list your-lambda)). So if you want just your function, try ((car (cdr (car commands)))). You might get your desired result ("test"). Hari ----- Original Message ----- From: "Jon Rafkind" To: "Timothy McDowell" Cc: plt-scheme@list.cs.brown.edu Sent: Monday, October 19, 2009 7:43:30 PM GMT -05:00 US/Canada Eastern Subject: Re: [plt-scheme] Lambda in a list... am I doing something wrong? Timothy McDowell wrote: > I'm trying to write a little interactive fiction, and I have a setup like > this: > (define commands > '( > ("look" (lambda () (display "test"))))) > > Try (define commands (list (list "look" (lambda () (display "test"))))) > The response I get from trying ((cdr (car commands))): > procedure application: expected procedure, given: ((lambda () (display > "test"))) (no arguments) > > Can someone explain to me what I am doing wrong? > > -- Thanks, > --Timothy. > > > ------------------------------------------------------------------------ > > _________________________________________________ > 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 jmj at fellowhuman.com Mon Oct 19 23:21:23 2009 From: jmj at fellowhuman.com (Jordan Johnson) Date: Mon Oct 19 23:21:57 2009 Subject: [plt-scheme] Lambda in a list... am I doing something wrong? In-Reply-To: <31369610.1092621256007016483.JavaMail.root@zimbra> References: <31369610.1092621256007016483.JavaMail.root@zimbra> Message-ID: That's not the only issue here, though; the original code had the lambda inside a quoted list, so the lambda was never evaluated. Best, Jordan On Oct 19, 2009, at 7:50 PM, krhari@ccs.neu.edu wrote: > Hi, > > If I am not wrong, cdr returns a list. So when you have ((cdr (car > commands))), it will give you ((list your-lambda)). So if you want > just your function, try ((car (cdr (car commands)))). You might get > your desired result ("test"). > > Hari > > ----- Original Message ----- > From: "Jon Rafkind" > To: "Timothy McDowell" > Cc: plt-scheme@list.cs.brown.edu > Sent: Monday, October 19, 2009 7:43:30 PM GMT -05:00 US/Canada Eastern > Subject: Re: [plt-scheme] Lambda in a list... am I doing something > wrong? > > Timothy McDowell wrote: >> I'm trying to write a little interactive fiction, and I have a >> setup like >> this: >> (define commands >> '( >> ("look" (lambda () (display "test"))))) >> >> > > Try (define commands (list (list "look" (lambda () (display > "test"))))) > >> The response I get from trying ((cdr (car commands))): >> procedure application: expected procedure, given: ((lambda () >> (display >> "test"))) (no arguments) >> >> Can someone explain to me what I am doing wrong? >> >> -- Thanks, >> --Timothy. >> >> >> --- >> --------------------------------------------------------------------- >> >> _________________________________________________ >> 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 krhari at ccs.neu.edu Mon Oct 19 23:38:47 2009 From: krhari at ccs.neu.edu (krhari@ccs.neu.edu) Date: Mon Oct 19 23:39:17 2009 Subject: [plt-scheme] Lambda in a list... am I doing something wrong? In-Reply-To: <10381383.1092821256009405914.JavaMail.root@zimbra> Message-ID: <23779448.1092901256009927275.JavaMail.root@zimbra> Its because you have >> (lambda () (display "test")). Its just a function here. Instead if you have >> ((lambda () (display "test"))), you will get back "test". My guess is that the return type of display is void. So you will not get back a list of strings by doing what you are doing. Hari ----- Original Message ----- From: "Jordan Johnson" To: krhari@ccs.neu.edu Cc: plt-scheme@list.cs.brown.edu Sent: Monday, October 19, 2009 11:21:23 PM GMT -05:00 US/Canada Eastern Subject: Re: [plt-scheme] Lambda in a list... am I doing something wrong? That's not the only issue here, though; the original code had the lambda inside a quoted list, so the lambda was never evaluated. Best, Jordan On Oct 19, 2009, at 7:50 PM, krhari@ccs.neu.edu wrote: > Hi, > > If I am not wrong, cdr returns a list. So when you have ((cdr (car > commands))), it will give you ((list your-lambda)). So if you want > just your function, try ((car (cdr (car commands)))). You might get > your desired result ("test"). > > Hari > > ----- Original Message ----- > From: "Jon Rafkind" > To: "Timothy McDowell" > Cc: plt-scheme@list.cs.brown.edu > Sent: Monday, October 19, 2009 7:43:30 PM GMT -05:00 US/Canada Eastern > Subject: Re: [plt-scheme] Lambda in a list... am I doing something > wrong? > > Timothy McDowell wrote: >> I'm trying to write a little interactive fiction, and I have a >> setup like >> this: >> (define commands >> '( >> ("look" (lambda () (display "test"))))) >> >> > > Try (define commands (list (list "look" (lambda () (display > "test"))))) > >> The response I get from trying ((cdr (car commands))): >> procedure application: expected procedure, given: ((lambda () >> (display >> "test"))) (no arguments) >> >> Can someone explain to me what I am doing wrong? >> >> -- Thanks, >> --Timothy. >> >> >> --- >> --------------------------------------------------------------------- >> >> _________________________________________________ >> 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 preen at informatik.uni-freiburg.de Tue Oct 20 07:21:36 2009 From: preen at informatik.uni-freiburg.de (Martin Preen) Date: Tue Oct 20 07:22:02 2009 Subject: [plt-scheme] Compiling PLT scheme on Solaris Message-ID: <4ADD9D40.5070300@informatik.uni-freiburg.de> 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 ? Thanks. Martin --------------------------------------------------------------- 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 ccwu660601 at gmail.com Tue Oct 20 08:43:18 2009 From: ccwu660601 at gmail.com (ccwu) Date: Tue Oct 20 17:44:09 2009 Subject: [plt-scheme] Chinese input method? Message-ID: Hi, Under X I'm using SCIM as my chinese input method. I usually do a Ctrl- Space to show the chinese input window, but it doesn't work for PLT Scheme. I've tried changing the keybinding of SCIM to Alt-Ctrl-Space, which doesn't help. From yinso.chen at gmail.com Tue Oct 20 17:50:32 2009 From: yinso.chen at gmail.com (YC) Date: Tue Oct 20 17:50:56 2009 Subject: [plt-scheme] Re: [ANN] bzlib/date & bzlib/date-tz - date & timezone manipulation In-Reply-To: <779bf2730910051211t532b503dk91bc1b21d612adc9@mail.gmail.com> References: <779bf2730910051211t532b503dk91bc1b21d612adc9@mail.gmail.com> Message-ID: <779bf2730910201450k4716a252r8e384c781b7846dd@mail.gmail.com> Hi all - the date.plt & date-tz.plt has been updated so you now can use PLT date objects as well as srfi/19 date objects (the srfi/19 functions are also wrapped so you can use PLT dates with it too), along with other changes such as day comparisons. You can find the details at http://weblambda.blogspot.com/2009/10/bzlibdate-bzlibdate-tz-02-now-available.html Cheers, yc On Mon, Oct 5, 2009 at 12:11 PM, YC wrote: > Hi all - > > bzlib/date & bzlib/date-tz are now available via planet. They provide date > & timezone manipulation capabilities (so you can find the future/past > timezone offsets without messing with TZ environment variable). They > currently work with srfi/19 date objects (not yet with PLT dates). > > (require (planet bzlib/date) (planet bzlib/date-tz)) > > You can find the tutorial at > http://weblambda.blogspot.com/2009/10/introducing-bzlibdate-bzlibdate-tz-date.html > > Cheers, > yc > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091020/2db44f18/attachment.htm From geoff at knauth.org Wed Oct 21 07:03:56 2009 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Wed Oct 21 07:11:51 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> Message-ID: <3A0E3C0D-92B8-41FF-98D2-87E82B390E99@knauth.org> On Oct 16, 2009, at 15:29, Morgan wrote: > It just seems a bit unreasonable, c++ and java are entirely happy to > allow my superfluous parentheses I'm accustomed to using, it can make > the code easier to read after all. You could try Literate Programming, or Nested Parens: http://www.flickr.com/photos/ioerror/3014911710/ From winhqwebmstr at gmail.com Tue Oct 20 23:00:00 2009 From: winhqwebmstr at gmail.com (Mike) Date: Wed Oct 21 11:57:52 2009 Subject: [plt-scheme] "Hiding" a global variable Message-ID: Hello, I have a rather difficult homework question. I would like to know what direction to look in in order to solve it: "Develop a function named next that takes no arguments, but each time you call it, it returns how many times it has been called: > (next) 1 > (next) 2 > (next) 3 Hint: You can do this with a global variable, but it would be "neater" if you could hide the variable. Think about local.... " I wrote the function implementing a global variable, as follows; (define times 0) ; next - returns how many times it has been called each time it is called ; @ none ; -> number (define (next) (begin (set! times (add1 times)) times)) I now need to make an implementation without using a global variable. Any suggestions? From robby at eecs.northwestern.edu Wed Oct 21 12:00:56 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Wed Oct 21 12:01:19 2009 Subject: [plt-scheme] "Hiding" a global variable In-Reply-To: References: Message-ID: <932b2f1f0910210900u78b5a9e8y3d0c926acf6b3e39@mail.gmail.com> Please do not post homework questions here, esp. not partial solutions. Better to contact your instructor (you are paying them, right?) or at least don't include solutions so your classmates don't see them. Robby On Tue, Oct 20, 2009 at 10:00 PM, Mike wrote: > Hello, > > I have a rather difficult homework question. I would like to know what > direction to look in in order to solve it: > > "Develop a function named next that takes no arguments, but each time > you call it, it returns how many times it has been called: > >> (next) > 1 >> (next) > 2 >> (next) > 3 > > > Hint: You can do this with a global variable, but it would be "neater" > if you could hide the variable. Think about local.... " > > > I wrote the function implementing a global variable, as follows; > > (define times 0) > > ; next - returns how many times it has been called each time it is > called > ; @ none > ; -> number > > (define (next) > ? (begin (set! times (add1 times)) > ? ? ? ? ?times)) > > I now need to make an implementation without using a global variable. > Any suggestions? > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From sbloch at adelphi.edu Wed Oct 21 12:42:09 2009 From: sbloch at adelphi.edu (Stephen Bloch) Date: Wed Oct 21 12:42:39 2009 Subject: [plt-scheme] "Hiding" a global variable In-Reply-To: References: Message-ID: On Oct 20, 2009, at 11:00 PM, Mike wrote: > I have a rather difficult homework question. I would like to know what > direction to look in in order to solve it: > > "Develop a function named next that takes no arguments, but each time > you call it, it returns how many times it has been called: > >> (next) > 1 >> (next) > 2 >> (next) > 3 > > > Hint: You can do this with a global variable, but it would be "neater" > if you could hide the variable. Think about local.... " Mike, one of your classmates was just in my office asking about the same problem. Here's another hint. You need a local in order to have a variable that the function can update, but not have this variable be globally visible. But if you put the local inside the function definition, it'll create a NEW variable every time you call the function, so that's no good. Thus the local must be OUTSIDE the function definition. See if that gets you a little farther. Dr. Stephen Bloch Math/CS Department Adelphi University sbloch@adelphi.edu From hendrik at topoi.pooq.com Wed Oct 21 12:54:04 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Wed Oct 21 13:14:47 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <3A0E3C0D-92B8-41FF-98D2-87E82B390E99@knauth.org> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <3A0E3C0D-92B8-41FF-98D2-87E82B390E99@knauth.org> Message-ID: <20091021165404.GB1700@topoi.pooq.com> On Wed, Oct 21, 2009 at 07:03:56AM -0400, Geoffrey S. Knauth wrote: > On Oct 16, 2009, at 15:29, Morgan wrote: > > >It just seems a bit unreasonable, c++ and java are entirely happy to > >allow my superfluous parentheses I'm accustomed to using, it can make > >the code easier to read after all. In C++ and java, parentheses make things readable because there are so few of them. It's usually easy to just see mathcing parentheses. In all the Lisps, there are so many parentheses anyway, that having redundant ones would just add to the visual confusion. I think Lisp badly needs simpls syntactic schemes to reduce the number of parntheses and make parentheses-matching visualy easier. But every proposal I've seen or made gets shouted down with complaints of "We've learned to count parentheses -- Why can't you?" -- hendrik From ebellani at gmail.com Wed Oct 21 13:45:22 2009 From: ebellani at gmail.com (Eduardo Bellani) Date: Wed Oct 21 13:45:45 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <20091021165404.GB1700@topoi.pooq.com> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <3A0E3C0D-92B8-41FF-98D2-87E82B390E99@knauth.org> <20091021165404.GB1700@topoi.pooq.com> Message-ID: <184222e50910211045vf13bd8i6977cc58dc09999b@mail.gmail.com> > I think Lisp badly needs simpls syntactic schemes to reduce the number > of parntheses and make parentheses-matching visualy easier. But every > proposal I've seen or made gets shouted down with complaints of "We've > learned to count parentheses -- Why can't you?" Well, there are Dylan and some other things.[1] Speaking for myself, parens are scary for people used to C syntax like Java, Ruby or C. But for people not used to them, parens are as natural as anything, and they make the language look clearer, at least from reports from some of my students. But like other skills, guitar for example, the position of the notes is just some details that you'll get in a couple of weeks. It's what comes next that is fun. [1]http://www.dwheeler.com/readable/index.html -- Eduardo Bellani www.cnxs.com.br I object to doing things that computers can do. - Olin Shivers From eli at barzilay.org Wed Oct 21 13:51:51 2009 From: eli at barzilay.org (Eli Barzilay) Date: Wed Oct 21 13:52:13 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <20091021165404.GB1700@topoi.pooq.com> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <3A0E3C0D-92B8-41FF-98D2-87E82B390E99@knauth.org> <20091021165404.GB1700@topoi.pooq.com> Message-ID: <19167.18999.89790.51634@winooski.ccs.neu.edu> On Oct 21, hendrik@topoi.pooq.com wrote: > But every proposal I've seen or made gets shouted down with > complaints of "We've learned to count parentheses -- Why can't you?" Show me a Schemer/Lisper that counts parentheses, and I'll show you his fake mustache. I'm serious. In http://ll1.ai.mit.edu/shriram-talk.pdf, in the slides on pages 37-39, I think that Shriram made a major mistake in having the parentheses on page 39 way too bright, the slide on 37 is much closer to what I see. As for editing -- the idea of inserting one paren only (in *any* language) seems completely broken to me. In some *styles* of programming you use much less parens if you use more assignments (spending a whole 8-spaces on a level of indentation is another symptom of this disease), but still, when I see a student write int foo(int x) { if (x == 2) { printf("blah I have exactly the same kind of reaction I have for the equivalently unbalanced Scheme code. Writing code snippets in browsers is bad exactly because they always have very primitive notepad-like editors, and the way I compensate for that is to be even more strict about always inserting matching delimiters. I do that even in emails. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From grettke at acm.org Wed Oct 21 14:27:43 2009 From: grettke at acm.org (Grant Rettke) Date: Wed Oct 21 14:28:06 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <20091021165404.GB1700@topoi.pooq.com> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <3A0E3C0D-92B8-41FF-98D2-87E82B390E99@knauth.org> <20091021165404.GB1700@topoi.pooq.com> Message-ID: <756daca50910211127s4b0a49b6w99b7b552d15d819b@mail.gmail.com> On Wed, Oct 21, 2009 at 11:54 AM, wrote: > I think Lisp badly needs simpls syntactic schemes to reduce the number > of parntheses and make parentheses-matching visualy easier. ?But every > proposal I've seen or made gets shouted down with complaints of "We've > learned to count parentheses -- Why can't you?" Whoever told you that is really misleading you. After a few weeks you don't see the parentheses; you care primarily about the indentation. You really don't see them after a while; and you can rely on your editor to keep parentheses balanced in the first place (first rule: don't do work the computer can do for you). From rafkind at cs.utah.edu Wed Oct 21 14:34:32 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Wed Oct 21 14:37:40 2009 Subject: [plt-scheme] with-struct Message-ID: <4ADF5438.8060301@cs.utah.edu> Here is a macro that introduces fields of a struct into the current lexical environment so that instead of saying (foo-x some-foo) you can just say 'x', similar to pascal's `with' construct. I had to resort to string munging to get the original field names. Is there a better way? I guess the "right" answer is to make the user pass in the field names themselves but I dislike such verbosity. Here is the uncleaned-up version. #lang scheme (require (for-syntax scheme/struct-info) (for-syntax scheme/match)) (define-syntax (with-struct stx) (syntax-case stx () [(_ (info instance) body1 body ...) (identifier? #'instance) (let ([a (syntax-local-value #'info (lambda () #f))]) #; (printf "~a items\n" (length (extract-struct-info a))) (match (extract-struct-info a) [(list name init-field-count auto-field-count accessor-proc mutator-proc immutable-k-list) (begin ;; messing around with strings is bad, whats a better solution? (define (make-local-field field-stx) (datum->syntax #'body1 (string->symbol (substring (symbol->string (syntax->datum field-stx)) (- (string-length (string-append (symbol->string (syntax->datum name)) "-")) (string-length "struct:")))))) #; (apply printf "name: ~a init-field-count: ~a auto-field-count: ~a accessor-proc: ~a mutator-proc: ~a immutable-k-list: ~a\n" (list name init-field-count auto-field-count (map syntax->datum accessor-proc) mutator-proc immutable-k-list)) (with-syntax ([(field ...) (map make-local-field accessor-proc)] [(setter! ...) mutator-proc] [(accessor ...) accessor-proc]) #| (printf "bind: ~a\n" (map syntax->datum (syntax->list #'(field ...)))) (printf "setter: ~a\n" (map syntax->datum (syntax->list #'(setter! ...)))) |# (syntax-local-introduce #; #'(let ([my-accessor]) let-syntax ([field (make-rename-transformer my-accessor)] ...) body) #; #'(let ([field (make-rename-transformer #'field (accessor instance))] ...) body) #'(let-syntax ([field (make-set!-transformer (lambda (stx) (syntax-case stx (set!) [(set! id v) (if #'setter! #'(setter! instance v) #'(error 'with-struct "field ~a is not mutable so no set! is available" 'field))] [id #'(accessor instance)])))] ...) body1 body ...) #; #'(let-syntax ([field (lambda (stx) #'(accessor instance))] ...) body1 body ...))))]))])) (define-struct foo (n m b) #:mutable) (let ([my-foo (make-foo 1 2 3)]) (with-struct (foo my-foo) (begin (set! n 9) (printf "n is ~a\n" n)))) ==> n is 9 From eli at barzilay.org Wed Oct 21 14:50:11 2009 From: eli at barzilay.org (Eli Barzilay) Date: Wed Oct 21 14:50:33 2009 Subject: [plt-scheme] with-struct In-Reply-To: <4ADF5438.8060301@cs.utah.edu> References: <4ADF5438.8060301@cs.utah.edu> Message-ID: <19167.22499.401283.287184@winooski.ccs.neu.edu> On Oct 21, Jon Rafkind wrote: > Here is a macro that introduces fields of a struct into the current > lexical environment so that instead of saying (foo-x some-foo) you > can just say 'x', similar to pascal's `with' construct. > > I had to resort to string munging to get the original field > names. Is there a better way? I guess the "right" answer is to make > the user pass in the field names themselves but I dislike such > verbosity. The right answer, IMO, and if this was desirable, is to make the struct information include the field names, which would probably not even be too much work. But I don't think that this is a good idea. If anything, then I think that an extension to `define-struct' works out better. For example (using a horrible name): (define-struct foo (n m b) #:mutable #:with-scoper) (let ([my-foo (make-foo 1 2 3)]) (with-foo my-foo (set! n 9) (printf "n is ~a\n" n))) And BTW, that's one of the first fights I had with the then-new module system and Swindle -- I used to have a `with-slots' macro that did just the above dynamically, and it was a bad idea for obvious reasons. I eventually made it accept the identifiers that you want in scope, which seems much cleaner. You can also think about not wanting all of the bindings for these (for example, don't expose some field that is holding some computed value), or using the same thing to deal with struct-like values (which I implemented in the form of `with-accessors'). -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From noelwelsh at gmail.com Wed Oct 21 15:28:21 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Wed Oct 21 15:28:41 2009 Subject: [plt-scheme] with-struct In-Reply-To: <4ADF5438.8060301@cs.utah.edu> References: <4ADF5438.8060301@cs.utah.edu> Message-ID: On Wed, Oct 21, 2009 at 7:34 PM, Jon Rafkind wrote: > Here is a macro that introduces fields of a struct into the current lexical > environment so that instead of saying (foo-x some-foo) you can just say 'x', > similar to pascal's `with' construct. I use pattern matching in this situation: (match-define (struct foo x y) a-foo) HTH, N. From rafkind at cs.utah.edu Wed Oct 21 15:27:45 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Wed Oct 21 15:30:20 2009 Subject: [plt-scheme] with-struct In-Reply-To: References: <4ADF5438.8060301@cs.utah.edu> Message-ID: <4ADF60B1.1030802@cs.utah.edu> Noel Welsh wrote: > On Wed, Oct 21, 2009 at 7:34 PM, Jon Rafkind wrote: > >> Here is a macro that introduces fields of a struct into the current lexical >> environment so that instead of saying (foo-x some-foo) you can just say 'x', >> similar to pascal's `with' construct. >> > > I use pattern matching in this situation: > > (match-define (struct foo x y) a-foo) > > Yes, my `with-struct' degenerates to match if the user lists all the fields when using the macro and also if set! is not provided. From toddobryan at gmail.com Wed Oct 21 15:39:37 2009 From: toddobryan at gmail.com (Todd O'Bryan) Date: Wed Oct 21 15:40:01 2009 Subject: [plt-scheme] "Hiding" a global variable In-Reply-To: References: Message-ID: <904774730910211239r13a2dba2hf5f7032bed9d9130@mail.gmail.com> Or at least realize that your professor is likely to read this list... :-) On Wed, Oct 21, 2009 at 12:42 PM, Stephen Bloch wrote: > > On Oct 20, 2009, at 11:00 PM, Mike wrote: > >> I have a rather difficult homework question. I would like to know what >> direction to look in in order to solve it: >> >> "Develop a function named next that takes no arguments, but each time >> you call it, it returns how many times it has been called: >> >>> (next) >> >> 1 >>> >>> (next) >> >> 2 >>> >>> (next) >> >> 3 >> >> >> Hint: You can do this with a global variable, but it would be "neater" >> if you could hide the variable. Think about local.... " > > Mike, one of your classmates was just in my office asking about the same > problem. ?Here's another hint. > > You need a local in order to have a variable that the function can update, > but not have this variable be globally visible. ?But if you put the local > inside the function definition, it'll create a NEW variable every time you > call the function, so that's no good. ?Thus the local must be OUTSIDE the > function definition. > > See if that gets you a little farther. > > > > Dr. Stephen Bloch > Math/CS Department > Adelphi University > sbloch@adelphi.edu > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From ebellani at gmail.com Wed Oct 21 16:38:06 2009 From: ebellani at gmail.com (Eduardo Bellani) Date: Wed Oct 21 16:38:29 2009 Subject: [plt-scheme] HTDP errata Message-ID: <184222e50910211338h69476c01jd4fe351e5c4f583a@mail.gmail.com> In Figure 116 there is a bug ... (define (f-make-posn x0 y0) (local ((define x y0) (define y y0) ... should be (define (f-make-posn x0 y0) (local ((define x x0) (define y y0) ... Hugs -- Eduardo Bellani www.cnxs.com.br I object to doing things that computers can do. - Olin Shivers From dtnoizerz58 at yandex.ru Wed Oct 21 16:34:13 2009 From: dtnoizerz58 at yandex.ru (DTNOIZR) Date: Wed Oct 21 16:44:04 2009 Subject: [plt-scheme] how to retrieve url ? Message-ID: <102941256157253@webmail23.yandex.ru> I want to put url ang get string with all web page in it I try (call/input-url url get-pure-port read) but there are something wrong - parts of page and eternal after how must I wrote this? From matthias at ccs.neu.edu Wed Oct 21 16:50:33 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Wed Oct 21 16:51:04 2009 Subject: [plt-scheme] HTDP errata In-Reply-To: <184222e50910211338h69476c01jd4fe351e5c4f583a@mail.gmail.com> References: <184222e50910211338h69476c01jd4fe351e5c4f583a@mail.gmail.com> Message-ID: Thanks! On Oct 21, 2009, at 4:38 PM, Eduardo Bellani wrote: > In Figure 116 there is a bug ... > > (define (f-make-posn x0 y0) > (local ((define x y0) > (define y y0) ... > > should be > > (define (f-make-posn x0 y0) > (local ((define x x0) > (define y y0) ... > > > Hugs > -- > Eduardo Bellani > > www.cnxs.com.br > > I object to doing things that computers can do. > - Olin Shivers > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From rafkind at cs.utah.edu Wed Oct 21 16:59:44 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Wed Oct 21 17:02:22 2009 Subject: [plt-scheme] macro stepper enhancements Message-ID: <4ADF7640.8040906@cs.utah.edu> 1. I would like to hide a specific s-expression in the macro stepper. If I right click on a something, like letrec-values, and click 'hide' then all instances of letrec-values are hidden. 2. Going a step back takes a long time, I guess because the entire computation from beginning to end is re-computed? Can all the steps be cached along the way instead? From ebellani at gmail.com Wed Oct 21 17:07:22 2009 From: ebellani at gmail.com (Eduardo Bellani) Date: Wed Oct 21 17:07:44 2009 Subject: [plt-scheme] HTDP errata In-Reply-To: References: <184222e50910211338h69476c01jd4fe351e5c4f583a@mail.gmail.com> Message-ID: <184222e50910211407w37bce784gb6d717f3a8a69f69@mail.gmail.com> >> In Figure 116 there is a bug ... >> >> (define (f-make-posn x0 y0) >> (local ((define x y0) >> (define y y0) ... >> >> should be >> >> (define (f-make-posn x0 y0) >> (local ((define x x0) >> (define y y0) ... The same applies to 117 apparently -- Eduardo Bellani www.cnxs.com.br I object to doing things that computers can do. - Olin Shivers From czhu at cs.utah.edu Wed Oct 21 17:09:06 2009 From: czhu at cs.utah.edu (Chognkai Zhu) Date: Wed Oct 21 17:09:32 2009 Subject: [plt-scheme] scheme_add_managed with FFI In-Reply-To: <4ACFE5EA.2030305@cs.utah.edu> References: <4ACFE5EA.2030305@cs.utah.edu> Message-ID: <4ADF7872.4080806@cs.utah.edu> Matthew told me to change (add-managed p (lambda (p _) (my-close p)) #f #f) to (add-managed p my-close #f #f) where my-close lives at top-level so that the lambda won't get garbage collected. I just tried that. No. Segfault still happens. Could anyone (Eli or Matthew) please help again? Many thanks. Also, should I make a small example that can reproduce the problem? Chongkai Chongkai Zhu wrote: > Hi all, > > In one of my programs, I need to use custodian to manage some > resource. So I wrote the following: > > (define add-managed > (get-ffi-obj "scheme_add_managed" #f > (_fun (_pointer = #f) _scheme (_fun _scheme _pointer -> > _void) _pointer _bool -> _pointer))) > > ... > > (add-managed p (lambda (p _) (my-close p)) #f #f) > > A side note: here p itself is a _pointer (print as #) > returned from some other FFI call. > > If I run the program for long enough, adding objects under the manage > of custodians, and closing custodians once a while, with other process > (other than PLT) actively using memory, eventually a segfault will > happen when I'm shutdown a custodian (which has some p under it's > management). Testing shows the segfault is related to my > `add-managed', as commenting it the segfault also disappears. > > I noticed in > http://schemecookbook.org/Cookbook/PLTCustodianRegistration, the FFI > type of scheme_add_managed is different from how I use it. Did I do > something wrong using scheme_add_managed this way? Why does the > segfault happen? Could anyone help elaborate? Thanks in advance. > > Sincerely, > Chongkai > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From ryanc at ccs.neu.edu Wed Oct 21 17:13:41 2009 From: ryanc at ccs.neu.edu (Ryan Culpepper) Date: Wed Oct 21 17:14:07 2009 Subject: [plt-scheme] macro stepper enhancements In-Reply-To: <4ADF7640.8040906@cs.utah.edu> References: <4ADF7640.8040906@cs.utah.edu> Message-ID: <0BB9CC29-F884-421A-832E-51207F4B4B44@ccs.neu.edu> On Oct 21, 2009, at 4:59 PM, Jon Rafkind wrote: > 1. I would like to hide a specific s-expression in the macro > stepper. If I right click on a something, like letrec-values, and > click 'hide' then all instances of letrec-values are hidden. Do you mean "hide" as the macro stepper uses the term, or do you mean something more like "collapse s-expression"? > 2. Going a step back takes a long time, I guess because the entire > computation from beginning to end is re-computed? Can all the steps > be cached along the way instead? They are. The steps are only recomputed when you change the hiding policy. The time is being taken up by pretty-printing, coloring, clickback-attaching, etc. I'll check to see if any of the latter parts are happening outside of edit-sequences, but other than that I don't know of any way to speed it up. Ryan From rafkind at cs.utah.edu Wed Oct 21 17:15:41 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Wed Oct 21 17:18:16 2009 Subject: [plt-scheme] macro stepper enhancements In-Reply-To: <0BB9CC29-F884-421A-832E-51207F4B4B44@ccs.neu.edu> References: <4ADF7640.8040906@cs.utah.edu> <0BB9CC29-F884-421A-832E-51207F4B4B44@ccs.neu.edu> Message-ID: <4ADF79FD.6000809@cs.utah.edu> Ryan Culpepper wrote: > On Oct 21, 2009, at 4:59 PM, Jon Rafkind wrote: > >> 1. I would like to hide a specific s-expression in the macro stepper. >> If I right click on a something, like letrec-values, and click 'hide' >> then all instances of letrec-values are hidden. > > Do you mean "hide" as the macro stepper uses the term, or do you mean > something more like "collapse s-expression"? > Yes, I meant collapse s-expression. That would be extremely useful considering the size of expanded terms. >> 2. Going a step back takes a long time, I guess because the entire >> computation from beginning to end is re-computed? Can all the steps >> be cached along the way instead? > > They are. The steps are only recomputed when you change the hiding > policy. The time is being taken up by pretty-printing, coloring, > clickback-attaching, etc. I'll check to see if any of the latter parts > are happening outside of edit-sequences, but other than that I don't > know of any way to speed it up. > :( ok. For some of my expressions it takes upto 30 seconds. From rafkind at cs.utah.edu Wed Oct 21 17:29:05 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Wed Oct 21 17:31:40 2009 Subject: [plt-scheme] macro stepper enhancements In-Reply-To: <0BB9CC29-F884-421A-832E-51207F4B4B44@ccs.neu.edu> References: <4ADF7640.8040906@cs.utah.edu> <0BB9CC29-F884-421A-832E-51207F4B4B44@ccs.neu.edu> Message-ID: <4ADF7D21.6020600@cs.utah.edu> > >> 2. Going a step back takes a long time, I guess because the entire >> computation from beginning to end is re-computed? Can all the steps >> be cached along the way instead? > > They are. The steps are only recomputed when you change the hiding > policy. The time is being taken up by pretty-printing, coloring, > clickback-attaching, etc. I'll check to see if any of the latter parts > are happening outside of edit-sequences, but other than that I don't > know of any way to speed it up. > If you can't speed it up can you provide '<- step 5' ? Or something like that. From rafkind at cs.utah.edu Wed Oct 21 17:32:53 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Wed Oct 21 17:35:29 2009 Subject: [plt-scheme] macro stepper enhancements In-Reply-To: <4ADF7D21.6020600@cs.utah.edu> References: <4ADF7640.8040906@cs.utah.edu> <0BB9CC29-F884-421A-832E-51207F4B4B44@ccs.neu.edu> <4ADF7D21.6020600@cs.utah.edu> Message-ID: <4ADF7E05.5020307@cs.utah.edu> Jon Rafkind wrote: > >> >>> 2. Going a step back takes a long time, I guess because the entire >>> computation from beginning to end is re-computed? Can all the steps >>> be cached along the way instead? >> >> They are. The steps are only recomputed when you change the hiding >> policy. The time is being taken up by pretty-printing, coloring, >> clickback-attaching, etc. I'll check to see if any of the latter >> parts are happening outside of edit-sequences, but other than that I >> don't know of any way to speed it up. >> > > If you can't speed it up can you provide '<- step 5' ? Or something > like that. Or... can you render the s-expressions in a new thread so that if I hit '<- step' it will cancel the current rendering and just go back a step? Also it would be nice to see what step I'm on (if you can know such a thing). Like 'you are on step 5 out of 200'. From ryanc at ccs.neu.edu Wed Oct 21 17:36:42 2009 From: ryanc at ccs.neu.edu (Ryan Culpepper) Date: Wed Oct 21 17:37:19 2009 Subject: [plt-scheme] macro stepper enhancements In-Reply-To: <4ADF7D21.6020600@cs.utah.edu> References: <4ADF7640.8040906@cs.utah.edu> <0BB9CC29-F884-421A-832E-51207F4B4B44@ccs.neu.edu> <4ADF7D21.6020600@cs.utah.edu> Message-ID: <306C6FE4-4BC7-40D9-9C30-FBA865E88931@ccs.neu.edu> On Oct 21, 2009, at 5:29 PM, Jon Rafkind wrote: > >> >>> 2. Going a step back takes a long time, I guess because the entire >>> computation from beginning to end is re-computed? Can all the >>> steps be cached along the way instead? >> >> They are. The steps are only recomputed when you change the hiding >> policy. The time is being taken up by pretty-printing, coloring, >> clickback-attaching, etc. I'll check to see if any of the latter >> parts are happening outside of edit-sequences, but other than that >> I don't know of any way to speed it up. >> > > If you can't speed it up can you provide '<- step 5' ? Or something > like that. In the macro stepper, go to Stepper | Extra options and enable "Extra navigation". Then you get a text entry with the step number, and you can edit it to jump around. Ryan From jmarshall at alum.mit.edu Wed Oct 21 17:43:41 2009 From: jmarshall at alum.mit.edu (Joe Marshall) Date: Wed Oct 21 17:44:20 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <20091021165404.GB1700@topoi.pooq.com> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <3A0E3C0D-92B8-41FF-98D2-87E82B390E99@knauth.org> <20091021165404.GB1700@topoi.pooq.com> Message-ID: On Wed, Oct 21, 2009 at 9:54 AM, wrote: > > I think Lisp badly needs simpls syntactic schemes to reduce the number > of parntheses and make parentheses-matching visualy easier. Wow! What a novel idea! Why hasn't anyone done this? -- ~jrm From matthias at ccs.neu.edu Wed Oct 21 17:59:45 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Wed Oct 21 18:00:17 2009 Subject: [plt-scheme] how to retrieve url ? In-Reply-To: <102941256157253@webmail23.yandex.ru> References: <102941256157253@webmail23.yandex.ru> Message-ID: <52457ABA-463A-479A-A6B1-A46DF8E3FC91@ccs.neu.edu> look for more-io.ss at http://www.ccs.neu.edu/home/matthias/107-f09/Assignments/4.html On Oct 21, 2009, at 4:34 PM, DTNOIZR wrote: > I want to put url ang get string with all web page in it > I try > (call/input-url url get-pure-port read) > but there are something wrong - parts of page and eternal after > how must I wrote this? > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From barry at cs.sierracollege.edu Wed Oct 21 18:17:24 2009 From: barry at cs.sierracollege.edu (Barry Brown) Date: Wed Oct 21 18:17:50 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <3A0E3C0D-92B8-41FF-98D2-87E82B390E99@knauth.org> <20091021165404.GB1700@topoi.pooq.com> Message-ID: Are you thinking of: * editors that visually match parentheses? * Lisp-like languages that accept any pair of matching symbols, like braces {} and brackets [], in addition to parentheses? * programming environments that use entirely different syntactic constructs, such as boxes or circles, instead of parentheses? I don't think such things exist. I could be wrong... ;) Seriously, I agree that the parentheses can get out of hand, especially once you depart from the scaled-down languages of HtDP. Once you've reached that point, though, you've started to recognize what the parentheses are for and can begin to see through them. I'd like to see more research into using alternative syntactic constructs (boxes, circles, sounds, colors, etc.) that could help free beginners from the tyranny of parentheses. -B On Oct 21, 2009, at 2:43 PM, Joe Marshall wrote: > On Wed, Oct 21, 2009 at 9:54 AM, wrote: >> >> I think Lisp badly needs simpls syntactic schemes to reduce the >> number >> of parntheses and make parentheses-matching visualy easier. > > Wow! What a novel idea! Why hasn't anyone done this? > > -- > ~jrm > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From toddobryan at gmail.com Wed Oct 21 18:23:59 2009 From: toddobryan at gmail.com (Todd O'Bryan) Date: Wed Oct 21 18:24:20 2009 Subject: [plt-scheme] way to convert from string to digest and back in vyzo/crypto Message-ID: <904774730910211523p6778be71l68b2c586e3dd3864@mail.gmail.com> Anyone (maybe the author) know if there's a way to get a digest method given its name and get a digest method's name from the digest object? I'd like to store my password hashes as digest-type$salt$hash in my database, and am hoping I can avoid creating a lookup table to go back and forth from digest types to a string representation suitable for db viewing. Thanks, Todd From jensaxel at soegaard.net Wed Oct 21 19:05:54 2009 From: jensaxel at soegaard.net (=?UTF-8?Q?Jens_Axel_S=C3=B8gaard?=) Date: Wed Oct 21 19:06:17 2009 Subject: [plt-scheme] Scheme for first year CS classes, good or bad? Message-ID: <4072c51f0910211605i693dda1q29d140921b82dba8@mail.gmail.com> http://www.reddit.com/r/programming/comments/9w1br/scheme_for_first_year_cs_classes_good_or_bad/ -- Jens Axel S?gaard From jmarshall at alum.mit.edu Wed Oct 21 19:59:35 2009 From: jmarshall at alum.mit.edu (Joe Marshall) Date: Wed Oct 21 20:00:18 2009 Subject: [plt-scheme] Scheme for first year CS classes, good or bad? In-Reply-To: <4072c51f0910211605i693dda1q29d140921b82dba8@mail.gmail.com> References: <4072c51f0910211605i693dda1q29d140921b82dba8@mail.gmail.com> Message-ID: My first programming course in college used MACRO-11 (PDP-11 assembly code). It was good enough for us. On Wed, Oct 21, 2009 at 4:05 PM, Jens Axel S?gaard wrote: > http://www.reddit.com/r/programming/comments/9w1br/scheme_for_first_year_cs_classes_good_or_bad/ > > -- > Jens Axel S?gaard > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- ~jrm From sk at cs.brown.edu Wed Oct 21 20:06:15 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Wed Oct 21 20:06:54 2009 Subject: [plt-scheme] Scheme for first year CS classes, good or bad? In-Reply-To: <4072c51f0910211605i693dda1q29d140921b82dba8@mail.gmail.com> References: <4072c51f0910211605i693dda1q29d140921b82dba8@mail.gmail.com> Message-ID: Wow. Tore him a new one. I have a new-found respect for reddit. Shriram From rafkind at cs.utah.edu Wed Oct 21 20:09:06 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Wed Oct 21 20:11:42 2009 Subject: [plt-scheme] macro stepper enhancements In-Reply-To: <306C6FE4-4BC7-40D9-9C30-FBA865E88931@ccs.neu.edu> References: <4ADF7640.8040906@cs.utah.edu> <0BB9CC29-F884-421A-832E-51207F4B4B44@ccs.neu.edu> <4ADF7D21.6020600@cs.utah.edu> <306C6FE4-4BC7-40D9-9C30-FBA865E88931@ccs.neu.edu> Message-ID: <4ADFA2A2.1090604@cs.utah.edu> >> >> If you can't speed it up can you provide '<- step 5' ? Or something >> like that. > > In the macro stepper, go to Stepper | Extra options and enable "Extra > navigation". Then you get a text entry with the step number, and you > can edit it to jump around. > Ok cool. Can you make it a more prominent feature? From barry at cs.sierracollege.edu Wed Oct 21 20:12:29 2009 From: barry at cs.sierracollege.edu (Barry Brown) Date: Wed Oct 21 20:12:57 2009 Subject: [plt-scheme] Scheme for first year CS classes, good or bad? In-Reply-To: References: <4072c51f0910211605i693dda1q29d140921b82dba8@mail.gmail.com> Message-ID: <7FD2DD3C-26B1-4CD9-9435-89748A238D0E@cs.sierracollege.edu> I was most impressed that so many respondents had been through the HtDP curriculum. Judging by specific key phrases they used, some even seemed to be educators who had attended the summer workshops! -B On Oct 21, 2009, at 5:06 PM, Shriram Krishnamurthi wrote: > Wow. Tore him a new one. > > I have a new-found respect for reddit. > > Shriram > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From matthias at ccs.neu.edu Wed Oct 21 20:29:38 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Wed Oct 21 20:30:19 2009 Subject: [plt-scheme] Scheme for first year CS classes, good or bad? In-Reply-To: References: <4072c51f0910211605i693dda1q29d140921b82dba8@mail.gmail.com> Message-ID: <42624CA2-09A7-4A7D-A7F9-D56CF99F7FCF@ccs.neu.edu> On Oct 21, 2009, at 7:59 PM, Joe Marshall wrote: > My first programming course in college used MACRO-11 (PDP-11 > assembly code). > It was good enough for us. Laura Arbilla said to me as she was telling me that she'd be in charge of her department in Montevideo: Students must first go through hell to appreciate paradise. -- Matthias From hendrik at topoi.pooq.com Wed Oct 21 21:33:38 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Wed Oct 21 21:33:59 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <20091021165404.GB1700@topoi.pooq.com> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <3A0E3C0D-92B8-41FF-98D2-87E82B390E99@knauth.org> <20091021165404.GB1700@topoi.pooq.com> Message-ID: <20091022013338.GA2578@topoi.pooq.com> On Wed, Oct 21, 2009 at 12:54:04PM -0400, hendrik@topoi.pooq.com wrote: > On Wed, Oct 21, 2009 at 07:03:56AM -0400, Geoffrey S. Knauth wrote: > > On Oct 16, 2009, at 15:29, Morgan wrote: > > > > >It just seems a bit unreasonable, c++ and java are entirely happy to > > >allow my superfluous parentheses I'm accustomed to using, it can make > > >the code easier to read after all. > > In C++ and java, parentheses make things readable because there are so > few of them. It's usually easy to just see mathcing parentheses. > > In all the Lisps, there are so many parentheses anyway, that > having redundant ones would just add to the visual confusion. > > I think Lisp badly needs simpls syntactic schemes to reduce the number > of parntheses and make parentheses-matching visualy easier. But every > proposal I've seen or made gets shouted down with complaints of "We've > learned to count parentheses -- Why can't you?" OK. Here's what I used in a Lisp dialect once: ( foofoofoo / barbarbar ) means ( foofoofoo ( barbarbar )) where foofoofoo and barbarbar are each sequences of s-expressions. Of course, you can iterate: ( foo / bar / clum / ink ) means ( foo ( bar ( clum ( ink )))) And that's all there is to it. It was inspired by notincing that huge clusters of close-parenthese arise. This gets rid of most of them. And you can write it vertically if you want: ( foo / bar / clum / ink ) if you like lining things up vertically. This is useful for some kinds of nested if's: ( if a b / if c d / if e f / error 'nogood ) It also leads to a desire for constructs that don't themselves contain lists as a syntactic hack to cut down on nesting. It makes if's easier to use than cond's, for example. -- hendrik From hendrik at topoi.pooq.com Wed Oct 21 21:39:23 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Wed Oct 21 21:39:42 2009 Subject: [plt-scheme] with-struct In-Reply-To: <19167.22499.401283.287184@winooski.ccs.neu.edu> References: <4ADF5438.8060301@cs.utah.edu> <19167.22499.401283.287184@winooski.ccs.neu.edu> Message-ID: <20091022013923.GB2578@topoi.pooq.com> On Wed, Oct 21, 2009 at 02:50:11PM -0400, Eli Barzilay wrote: > On Oct 21, Jon Rafkind wrote: > > Here is a macro that introduces fields of a struct into the current > > lexical environment so that instead of saying (foo-x some-foo) you > > can just say 'x', similar to pascal's `with' construct. > > > > I had to resort to string munging to get the original field > > names. Is there a better way? I guess the "right" answer is to make > > the user pass in the field names themselves but I dislike such > > verbosity. > > The right answer, IMO, and if this was desirable, is to make the > struct information include the field names, which would probably not > even be too much work. > > But I don't think that this is a good idea. If anything, then I think > that an extension to `define-struct' works out better. For example > (using a horrible name): > > (define-struct foo (n m b) #:mutable #:with-scoper) > (let ([my-foo (make-foo 1 2 3)]) > (with-foo my-foo > (set! n 9) > (printf "n is ~a\n" n))) > > And BTW, that's one of the first fights I had with the then-new module > system and Swindle -- I used to have a `with-slots' macro that did > just the above dynamically, and it was a bad idea for obvious reasons. Getting the names from the type of the argument might be feasible in typed scheme. -- hendrik From carl.eastlund at gmail.com Wed Oct 21 21:40:43 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Wed Oct 21 21:41:24 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <20091022013338.GA2578@topoi.pooq.com> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <3A0E3C0D-92B8-41FF-98D2-87E82B390E99@knauth.org> <20091021165404.GB1700@topoi.pooq.com> <20091022013338.GA2578@topoi.pooq.com> Message-ID: <990e0c030910211840u27af9635kc2f0aa3a3d7cc356@mail.gmail.com> On Wed, Oct 21, 2009 at 9:33 PM, wrote: > > OK. ?Here's what I used in a Lisp dialect once: > > ? ? ( foofoofoo / barbarbar ) > > means > > ? ? ( foofoofoo ( barbarbar )) > > where foofoofoo and barbarbar are each sequences of s-expressions. > > Of course, you can iterate: > > ? ?( foo / bar / clum / ink ) > > means > > ? ?( foo ( bar ( clum ( ink )))) > > And that's all there is to it. > > It was inspired by notincing that huge clusters of close-parenthese > arise. ?This gets rid of most of them. > > And you can write it vertically if you want: > > ? ?( foo > ? ?/ bar > ? ?/ clum > ? ?/ ink > ? ?) > > if you like lining things up vertically. > > This is useful for some kinds of nested if's: > > ? ?( if a b > ? ?/ if c d > ? ?/ if e f > ? ?/ error 'nogood > ? ?) > > ?It also leads to a desire for constructs that don't themselves contain > lists as a syntactic hack to cut down on nesting. It makes if's easier > to use than cond's, for example. ...of course, now I can't copy/paste the expression where you invoke error on 'nogood, because you've gotten rid of the separate set of parentheses. It can be convenient to have very regular syntax, especially when you have a computer to help you manipulate it. The more "human-intuitive" you try to make your syntax, the less computer-amenable it becomes. --Carl From plragde at uwaterloo.ca Wed Oct 21 21:59:07 2009 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Wed Oct 21 21:59:40 2009 Subject: [plt-scheme] Scheme for first year CS classes, good or bad? In-Reply-To: <4072c51f0910211605i693dda1q29d140921b82dba8@mail.gmail.com> Message-ID: <4ADFBC6B.2010804@uwaterloo.ca> Jens Axel writes: > http://www.reddit.com/r/programming/comments/9w1br/scheme_for_first_year_cs_classes_good_or_bad/ This is a Waterloo student (not in the class I'm teaching, though at least one of his respondents is). He picked the wrong forum, as reddit seems to have a core of active dedicated functional programming fans. What was striking was the lack of agreement with his stance. --PR From matthias at ccs.neu.edu Wed Oct 21 22:00:02 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Wed Oct 21 22:00:47 2009 Subject: [plt-scheme] with-struct In-Reply-To: <19167.22499.401283.287184@winooski.ccs.neu.edu> References: <4ADF5438.8060301@cs.utah.edu> <19167.22499.401283.287184@winooski.ccs.neu.edu> Message-ID: <7FEC9573-ED4B-4B3C-80A2-C913FD3E47A2@ccs.neu.edu> This looks like its worth experimenting with, especially if we can figure out how to get it into BSL and ISL. I am afraid of the scoping of names that aren't spelled out, but hey, we already do this for define-struct. So why not experiment. -- Matthias On Oct 21, 2009, at 2:50 PM, Eli Barzilay wrote: > On Oct 21, Jon Rafkind wrote: >> Here is a macro that introduces fields of a struct into the current >> lexical environment so that instead of saying (foo-x some-foo) you >> can just say 'x', similar to pascal's `with' construct. >> >> I had to resort to string munging to get the original field >> names. Is there a better way? I guess the "right" answer is to make >> the user pass in the field names themselves but I dislike such >> verbosity. > > The right answer, IMO, and if this was desirable, is to make the > struct information include the field names, which would probably not > even be too much work. > > But I don't think that this is a good idea. If anything, then I think > that an extension to `define-struct' works out better. For example > (using a horrible name): > > (define-struct foo (n m b) #:mutable #:with-scoper) > (let ([my-foo (make-foo 1 2 3)]) > (with-foo my-foo > (set! n 9) > (printf "n is ~a\n" n))) > > And BTW, that's one of the first fights I had with the then-new module > system and Swindle -- I used to have a `with-slots' macro that did > just the above dynamically, and it was a bad idea for obvious reasons. > I eventually made it accept the identifiers that you want in scope, > which seems much cleaner. You can also think about not wanting all of > the bindings for these (for example, don't expose some field that is > holding some computed value), or using the same thing to deal with > struct-like values (which I implemented in the form of > `with-accessors'). > > -- > ((lambda (x) (x x)) (lambda (x) (x x))) Eli > Barzilay: > http://barzilay.org/ Maze is > Life! > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From plragde at uwaterloo.ca Wed Oct 21 22:02:32 2009 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Wed Oct 21 22:03:00 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <20091022013338.GA2578@topoi.pooq.com> Message-ID: <4ADFBD38.3000709@uwaterloo.ca> hendrik wrote: > OK. Here's what I used in a Lisp dialect once: > > ( foofoofoo / barbarbar ) > > means > > ( foofoofoo ( barbarbar )) > > where foofoofoo and barbarbar are each sequences of s-expressions. > > Of course, you can iterate: > > ( foo / bar / clum / ink ) > > means > > ( foo ( bar ( clum ( ink )))) > > And that's all there is to it. This is similar to the way that the $ infix operator (function application) is used in Haskell. foo (bar (clum (ink))) becomes foo $ bar $ clum $ ink John Clements once teased me for using $ in a short snippet of Haskell I wrote. Like all syntactic sugar, overuse increases the chance of diabetes. (There, I have left an opening for a pun, if anyone cares to pursue it.) --PR From eli at barzilay.org Wed Oct 21 22:04:04 2009 From: eli at barzilay.org (Eli Barzilay) Date: Wed Oct 21 22:04:27 2009 Subject: [plt-scheme] with-struct In-Reply-To: <7FEC9573-ED4B-4B3C-80A2-C913FD3E47A2@ccs.neu.edu> References: <4ADF5438.8060301@cs.utah.edu> <19167.22499.401283.287184@winooski.ccs.neu.edu> <7FEC9573-ED4B-4B3C-80A2-C913FD3E47A2@ccs.neu.edu> Message-ID: <19167.48532.164275.722395@winooski.ccs.neu.edu> Well, it should be easy to make that `with-foo' macro detect when the value expression is really an identifier, and bind names like this: (with-posn a (printf "<~s,~s>" a.x a.y)) But that's getting too close to something like a real `.' infix syntax (IIRC, Jens had implemented something like that). On Oct 21, Matthias Felleisen wrote: > This looks like its worth experimenting with, especially > if we can figure out how to get it into BSL and ISL. > > I am afraid of the scoping of names that aren't spelled > out, but hey, we already do this for define-struct. So > why not experiment. > > -- Matthias > > > > On Oct 21, 2009, at 2:50 PM, Eli Barzilay wrote: > > > On Oct 21, Jon Rafkind wrote: > >> Here is a macro that introduces fields of a struct into the current > >> lexical environment so that instead of saying (foo-x some-foo) you > >> can just say 'x', similar to pascal's `with' construct. > >> > >> I had to resort to string munging to get the original field > >> names. Is there a better way? I guess the "right" answer is to make > >> the user pass in the field names themselves but I dislike such > >> verbosity. > > > > The right answer, IMO, and if this was desirable, is to make the > > struct information include the field names, which would probably not > > even be too much work. > > > > But I don't think that this is a good idea. If anything, then I think > > that an extension to `define-struct' works out better. For example > > (using a horrible name): > > > > (define-struct foo (n m b) #:mutable #:with-scoper) > > (let ([my-foo (make-foo 1 2 3)]) > > (with-foo my-foo > > (set! n 9) > > (printf "n is ~a\n" n))) > > > > And BTW, that's one of the first fights I had with the then-new module > > system and Swindle -- I used to have a `with-slots' macro that did > > just the above dynamically, and it was a bad idea for obvious reasons. > > I eventually made it accept the identifiers that you want in scope, > > which seems much cleaner. You can also think about not wanting all of > > the bindings for these (for example, don't expose some field that is > > holding some computed value), or using the same thing to deal with > > struct-like values (which I implemented in the form of > > `with-accessors'). -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From carl.eastlund at gmail.com Wed Oct 21 22:08:23 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Wed Oct 21 22:09:02 2009 Subject: [plt-scheme] with-struct In-Reply-To: <19167.48532.164275.722395@winooski.ccs.neu.edu> References: <4ADF5438.8060301@cs.utah.edu> <19167.22499.401283.287184@winooski.ccs.neu.edu> <7FEC9573-ED4B-4B3C-80A2-C913FD3E47A2@ccs.neu.edu> <19167.48532.164275.722395@winooski.ccs.neu.edu> Message-ID: <990e0c030910211908y202ba7b2ge4195bae3d6c56e6@mail.gmail.com> On Wed, Oct 21, 2009 at 10:04 PM, Eli Barzilay wrote: > Well, it should be easy to make that `with-foo' macro detect when the > value expression is really an identifier, and bind names like this: > > ?(with-posn a > ? ?(printf "<~s,~s>" a.x a.y)) > > But that's getting too close to something like a real `.' infix syntax > (IIRC, Jens had implemented something like that). So this macro is going to have different lexical binding structure if its argument -- an expression -- happens to be in the form of an identifier, than if it's any other expression? I am wary of such voodoo. --Carl From eli at barzilay.org Wed Oct 21 22:12:39 2009 From: eli at barzilay.org (Eli Barzilay) Date: Wed Oct 21 22:13:02 2009 Subject: [plt-scheme] with-struct In-Reply-To: <990e0c030910211908y202ba7b2ge4195bae3d6c56e6@mail.gmail.com> References: <4ADF5438.8060301@cs.utah.edu> <19167.22499.401283.287184@winooski.ccs.neu.edu> <7FEC9573-ED4B-4B3C-80A2-C913FD3E47A2@ccs.neu.edu> <19167.48532.164275.722395@winooski.ccs.neu.edu> <990e0c030910211908y202ba7b2ge4195bae3d6c56e6@mail.gmail.com> Message-ID: <19167.49047.491129.377208@winooski.ccs.neu.edu> On Oct 21, Carl Eastlund wrote: > On Wed, Oct 21, 2009 at 10:04 PM, Eli Barzilay wrote: > > Well, it should be easy to make that `with-foo' macro detect when the > > value expression is really an identifier, and bind names like this: > > > > ?(with-posn a > > ? ?(printf "<~s,~s>" a.x a.y)) > > > > But that's getting too close to something like a real `.' infix syntax > > (IIRC, Jens had implemented something like that). > > So this macro is going to have different lexical binding structure > if its argument -- an expression -- happens to be in the form of an > identifier, than if it's any other expression? > > I am wary of such voodoo. Me too, but it shouldn't be too problematic, since you still get the usual lexical scope. For example, have it bind `a.x' and `a.y' and make `x' and `y' aliases for them, so that the latter are always getting the closest `with-*' values. But in any case, it looks to me like there's too many variables so a good design for this thing is going to be difficult. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From david.storrs at gmail.com Wed Oct 21 22:11:02 2009 From: david.storrs at gmail.com (David Storrs) Date: Wed Oct 21 22:19:27 2009 Subject: [plt-scheme] Scheme for first year CS classes, good or bad? In-Reply-To: <4ADFBC6B.2010804@uwaterloo.ca> References: <4072c51f0910211605i693dda1q29d140921b82dba8@mail.gmail.com> <4ADFBC6B.2010804@uwaterloo.ca> Message-ID: On Wed, Oct 21, 2009 at 9:59 PM, Prabhakar Ragde wrote: > Jens Axel writes: > >> >> http://www.reddit.com/r/programming/comments/9w1br/scheme_for_first_year_cs_classes_good_or_bad/ > > This is a Waterloo student (not in the class I'm teaching, though at least > one of his respondents is). He picked the wrong forum, as reddit seems to > have a core of active dedicated functional programming fans. What was > striking was the lack of agreement with his stance. --PR The thing I found interesting was the basic message inherent in his thinking: "All that matters is that the program (seems to) output the correct result." Yes, that's important, but testing and maintainability actually count for more, IMO. I would guess that his curriculum will address this, though. --Dks From gremio at acm.org Wed Oct 21 22:32:46 2009 From: gremio at acm.org (Gregory Marton) Date: Wed Oct 21 22:33:13 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <4ADFBD38.3000709@uwaterloo.ca> References: <4ADFBD38.3000709@uwaterloo.ca> Message-ID: >> ( foo / bar / clum / ink ) >> means >> ( foo ( bar ( clum ( ink )))) >> > This is similar to the way that the $ infix operator (function > application) is used in Haskell. > > foo (bar (clum (ink))) > becomes > foo $ bar $ clum $ ink > > John Clements once teased me for using $ in a short snippet of Haskell I > wrote. Like all syntactic sugar, overuse increases the chance of diabetes. > (There, I have left an opening for a pun, if anyone cares to pursue it.) This is also reminiscent of the use of / in categorial grammars. Slashes are used to associate lambda calculus expressions with recognized parts of a string. Each lexical item has a pattern, a signature (type), and a semantics, so "John" : NP :- "John" "loves" : (S \ NP / NP) :- (lambda (obj) (lambda (subj) (loves subj obj))) "Mary" : NP :- "Mary" With this lexicon, the string "John loves Mary" is parsed by first recognizing the three lexical items, then using the forward slash in the signature for "loves" to mean "apply forward", which is to say, apply the semantics associated with "loves" to the semantics of the thing to its right (which must have a matching signature with the rightmost element of the signature for "loves"). You thus get a new meaning "loves Mary" : (S \ NP) :- (lambda (subj) (loves subj "Mary")) This can now apply backwards to the argument "John", making "John loves Mary" : S :- (loves "John" "Mary") Purely in Scheme, the directionality of the slash doesn't matter. It's neat that in both cases it means "apply" -- I'm sorely ignorant of the roots of these things, so I can only guess that they're causally related. I wrote a parser for such expressions that uses (sorry) Guile as its underlying semantic interpreter, and have been toying with the semantics of various expressions of English. I'd love to talk with folks about it if there's interest. I have thought about porting it to PLT. http://csail.mit.edu/~gremio/Sepia/ Cheers, Grem -- ------ __@ Gregory A. Marton http://csail.mit.edu/~gremio --- _`\<,_ 617-775-3005 -- (*)/ (*) In charity there is no excess. ~~~~~~~~~~~~~~~~-~~~~~~~~_~~~_~~~~~v~~~~^^^^~~~~~--~~~~~~~~~~~~~~~++~~~~~~~ From noelwelsh at gmail.com Thu Oct 22 03:38:14 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Oct 22 03:38:34 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <20091022013338.GA2578@topoi.pooq.com> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <3A0E3C0D-92B8-41FF-98D2-87E82B390E99@knauth.org> <20091021165404.GB1700@topoi.pooq.com> <20091022013338.GA2578@topoi.pooq.com> Message-ID: On Thu, Oct 22, 2009 at 2:33 AM, wrote: >> I think Lisp badly needs simpls syntactic schemes to reduce the number >> of parntheses and make parentheses-matching visualy easier. ?But every >> proposal I've seen or made gets shouted down with complaints of "We've >> learned to count parentheses -- Why can't you?" Random points: 1. Some of the more recent Lisp-like languages (Clojure, Arc, Newlisp perhaps) have syntax with reduced number of parens. IIRC let in Clojure is (let (var val ...) expr ...) rather than Scheme's (let ([var val] ...) expr ...) If you like this you can easily experiment with different forms using PLT's #lang features. 2. I use lots of pattern matching and internal defines to avoid right creep in my code 3. Making macros work with a true infix syntax is an open problem, I believe. That's about all I have to say on this topic. Hope that's of some interest to someone. N. From grettke at acm.org Thu Oct 22 04:22:11 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Oct 22 04:22:36 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <3A0E3C0D-92B8-41FF-98D2-87E82B390E99@knauth.org> <20091021165404.GB1700@topoi.pooq.com> <20091022013338.GA2578@topoi.pooq.com> Message-ID: <756daca50910220122w7e3ff657xbc56887ae7eacb63@mail.gmail.com> On Thu, Oct 22, 2009 at 2:38 AM, Noel Welsh wrote: > On Thu, Oct 22, 2009 at 2:33 AM, ? wrote: >>> I think Lisp badly needs simpls syntactic schemes to reduce the number >>> of parntheses and make parentheses-matching visualy easier. ?But every >>> proposal I've seen or made gets shouted down with complaints of "We've >>> learned to count parentheses -- Why can't you?" > > Random points: > > 1. Some of the more recent Lisp-like languages (Clojure, Arc, Newlisp > perhaps) have syntax with reduced number of parens. Gambit seems to have an infix/reduced-paren mode: http://www.iro.umontreal.ca/~gambit/doc/gambit-c.html#Scheme-infix-syntax-extension From neil at neilvandyke.org Thu Oct 22 01:52:29 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Oct 22 04:52:52 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <20091022013338.GA2578@topoi.pooq.com> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <3A0E3C0D-92B8-41FF-98D2-87E82B390E99@knauth.org> <20091021165404.GB1700@topoi.pooq.com> <20091022013338.GA2578@topoi.pooq.com> Message-ID: <4ADFF31D.1090407@neilvandyke.org> hendrik@topoi.pooq.com wrote at 10/21/2009 09:33 PM: > OK. Here's what I used in a Lisp dialect once: > > ( foofoofoo / barbarbar ) > > means > > ( foofoofoo ( barbarbar )) > With Scheme, you can wake up in the middle of the night and quickly implement questionable new syntax, so long as you don't use it once fully awake. #lang scheme/base ;; Note: This is written as if "%appslash" is implementing your front-end ;; application syntax, such as can be done in PLT Scheme. ;; TODO: Consider whether "a / / b" should be "(a (%divide b))", "(a ((b)))", ;; an error, or something else. (define %divide /) (define-syntax %appreal (syntax-rules () ((_ X ...) (X ...)))) (define-syntax %appslash (syntax-rules (/) ((_) (%appreal)) ((_ / X ...) (%appreal %divide X ...)) ((_ A) (%appreal A)) ((_ A / X ...) (%appreal A (%appslash X ...))) ((_ X ...) (%appslash:2 (X ...) ())))) (define-syntax %appslash:2 ;; (REMAINING PROCESSED) (syntax-rules (/) ((_ (/ X ...) (A B Z ...)) (apply A B Z ... (%appslash X ...))) ((_ (X Y ...) (Z ...)) (%appslash:2 (Y ...) (Z ... X))) ((_ () (Z ...)) (%appreal Z ...)))) ;; Crude tests, as viewed in PLT DrScheme Macro Stepper: (define-values (a b c d e f g) (values #f #f #f #f #f #f #f)) (%appslash a) ;; =expand=> (a) (%appslash a / b) ;; =expand=> (a (b)) (%appslash a / b / c) ;; =expand=> (a (b (c))) (%appslash a / b c / d e) ;; =expand=> (a (apply b c (d e))) (%appslash a / b c d / e f g) ;; =expand=> (a (apply b c d (e f g))) (%appslash /) ;; =expand=> (%divide) (%appslash / a) ;; =expand=> (%divide a) (%appslash / a b) ;; =expand=> (%divide a b) (%appslash / a / b) ;; =expand=> (%divide a / b) (%appslash a / / b c) ;; =expand=> (a (/ b c)) (%appslash a b / c d / e f) ;; =expand=> (apply a b (apply c d (e f))) -- http://www.neilvandyke.org/ From laurent.orseau at gmail.com Thu Oct 22 05:12:57 2009 From: laurent.orseau at gmail.com (Laurent) Date: Thu Oct 22 05:13:42 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <4ADFBD38.3000709@uwaterloo.ca> References: <20091022013338.GA2578@topoi.pooq.com> <4ADFBD38.3000709@uwaterloo.ca> Message-ID: For a limited version of this, there also exists the compose function : ((compose foo bar clum ink)) Laurent On Thu, Oct 22, 2009 at 04:02, Prabhakar Ragde wrote: > hendrik wrote: > > OK. Here's what I used in a Lisp dialect once: >> >> ( foofoofoo / barbarbar ) >> >> means >> >> ( foofoofoo ( barbarbar )) >> >> where foofoofoo and barbarbar are each sequences of s-expressions. >> >> Of course, you can iterate: >> >> ( foo / bar / clum / ink ) >> >> means >> >> ( foo ( bar ( clum ( ink )))) >> >> And that's all there is to it. >> > > This is similar to the way that the $ infix operator (function application) > is used in Haskell. > > foo (bar (clum (ink))) > > becomes > > foo $ bar $ clum $ ink > > John Clements once teased me for using $ in a short snippet of Haskell I > wrote. Like all syntactic sugar, overuse increases the chance of diabetes. > (There, I have left an opening for a pun, if anyone cares to pursue it.) > --PR > > _________________________________________________ > 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/20091022/4cb23a96/attachment.htm From neil at neilvandyke.org Thu Oct 22 02:37:09 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Oct 22 05:37:32 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <4ADFF31D.1090407@neilvandyke.org> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <3A0E3C0D-92B8-41FF-98D2-87E82B390E99@knauth.org> <20091021165404.GB1700@topoi.pooq.com> <20091022013338.GA2578@topoi.pooq.com> <4ADFF31D.1090407@neilvandyke.org> Message-ID: <4ADFFD95.8090704@neilvandyke.org> Er, imagine that I didn't implement that second transformer, which can transform to an application of "apply". Instead of the value of the text to the right of the "/" being used as a list of arguments, it should be used as a single argument, of course. -- http://www.neilvandyke.org/ From robby at eecs.northwestern.edu Thu Oct 22 07:30:43 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Oct 22 07:31:26 2009 Subject: [plt-scheme] Scheme for first year CS classes, good or bad? In-Reply-To: References: <4072c51f0910211605i693dda1q29d140921b82dba8@mail.gmail.com> <4ADFBC6B.2010804@uwaterloo.ca> Message-ID: <932b2f1f0910220430p481cb099te6d8e6b91734c158@mail.gmail.com> Well, that and his "take it like a man" seems woefully misplaced. :) Robby On Wed, Oct 21, 2009 at 9:11 PM, David Storrs wrote: > On Wed, Oct 21, 2009 at 9:59 PM, Prabhakar Ragde wrote: >> Jens Axel writes: >> >>> >>> http://www.reddit.com/r/programming/comments/9w1br/scheme_for_first_year_cs_classes_good_or_bad/ >> >> This is a Waterloo student (not in the class I'm teaching, though at least >> one of his respondents is). He picked the wrong forum, as reddit seems to >> have a core of active dedicated functional programming fans. What was >> striking was the lack of agreement with his stance. --PR > > The thing I found interesting was the basic message inherent in his thinking: > > ? "All that matters is that the program (seems to) output the correct result." > > Yes, that's important, but testing and maintainability actually count > for more, IMO. ?I would guess that his curriculum will address this, > though. > > --Dks > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From tom at zwizwa.be Thu Oct 22 06:52:42 2009 From: tom at zwizwa.be (Tom Schouten) Date: Thu Oct 22 07:34:53 2009 Subject: [plt-scheme] gstreamer Message-ID: <20091022105242.GB26020@giebrok.zwizwa.be> Dear List, Is anyone working on a bridge between gstreamer and PLT Scheme? Cheers, Tom From marek at xivilization.net Thu Oct 22 08:26:19 2009 From: marek at xivilization.net (Marek Kubica) Date: Thu Oct 22 08:26:44 2009 Subject: [plt-scheme] Scheme for first year CS classes, good or bad? In-Reply-To: References: <4072c51f0910211605i693dda1q29d140921b82dba8@mail.gmail.com> Message-ID: <20091022142619.4e2fd49b@halmanfloyd.lan.local> On Wed, 21 Oct 2009 20:06:15 -0400 Shriram Krishnamurthi wrote: > I have a new-found respect for reddit. Yes, there are quite a few folks I know from Scheme-land there, which is nice. And there is a scheme sub-reddit, too. regards, reddit, Marek From plragde at uwaterloo.ca Thu Oct 22 10:01:50 2009 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Oct 22 10:02:12 2009 Subject: [plt-scheme] Scheme for first year CS classes, good or bad? In-Reply-To: <932b2f1f0910220430p481cb099te6d8e6b91734c158@mail.gmail.com> References: <4072c51f0910211605i693dda1q29d140921b82dba8@mail.gmail.com> <4ADFBC6B.2010804@uwaterloo.ca> <932b2f1f0910220430p481cb099te6d8e6b91734c158@mail.gmail.com> Message-ID: <4AE065CE.6020509@uwaterloo.ca> Robby Findler wrote: > Well, that and his "take it like a man" seems woefully misplaced. :) This is telling, too, as it is symptomatic of a certain kind of programmer macho which views any attempt at communication with human beings (conventions, documentation, readable keywords and function names) as "soft" or "unmasculine" (cf. "Real men don't use Macs"). To his credit, the original reddit poster seems to be listening to and learning from the responses to his post (though he's still being stubborn about if versus cond). --PR From matthias at ccs.neu.edu Thu Oct 22 10:15:40 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Oct 22 10:16:10 2009 Subject: [plt-scheme] Scheme for first year CS classes, good or bad? In-Reply-To: <4AE065CE.6020509@uwaterloo.ca> References: <4072c51f0910211605i693dda1q29d140921b82dba8@mail.gmail.com> <4ADFBC6B.2010804@uwaterloo.ca> <932b2f1f0910220430p481cb099te6d8e6b91734c158@mail.gmail.com> <4AE065CE.6020509@uwaterloo.ca> Message-ID: It is one common misunderstanding of people in so-called 'hard' discipline to think of their problems as 'difficult' and to think of things in 'soft' disciplines as 'easy.' Nothing can be further from the truth of course. For example, human communication about technical matters is one of the most difficult problems I have encountered; it resists a solution much more than the so-called Full Abstraction problem, which I solved (in some way) after it was open for 30 years. In this light, I appreciate the efforts of my colleagues who think that every communication should be (type and proof) checked but I suspect that it is grossly misguided. To sell the curriculum at NEU, I started using the slogan Programming is a People Discipline some four or five years ago, and it worked wonders. It really is what HtDP is all about and even 'industrialists' understand it and support it. Well, anyone with a modicum of experience in industry and the desired to deliver more than s'f. -- Matthias On Oct 22, 2009, at 10:01 AM, Prabhakar Ragde wrote: > Robby Findler wrote: >> Well, that and his "take it like a man" seems woefully misplaced. :) > > This is telling, too, as it is symptomatic of a certain kind of > programmer macho which views any attempt at communication with human > beings (conventions, documentation, readable keywords and function > names) as "soft" or "unmasculine" (cf. "Real men don't use Macs"). > To his credit, the original reddit poster seems to be listening to > and learning from the responses to his post (though he's still being > stubborn about if versus cond). --PR > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From spdegabrielle at gmail.com Thu Oct 22 12:01:31 2009 From: spdegabrielle at gmail.com (Stephen De Gabrielle) Date: Thu Oct 22 12:02:25 2009 Subject: [plt-scheme] gstreamer In-Reply-To: <20091022105242.GB26020@giebrok.zwizwa.be> References: <20091022105242.GB26020@giebrok.zwizwa.be> Message-ID: <595b9ab20910220901l66dbede3xfbdbb7df12c40ed7@mail.gmail.com> Hi, It was mentioned on the Fluxus list recently. s. On Thu, Oct 22, 2009 at 11:52 AM, Tom Schouten wrote: > Dear List, > > Is anyone working on a bridge between gstreamer and PLT Scheme? > > Cheers, > Tom > > _________________________________________________ > ?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 ebellani at gmail.com Thu Oct 22 14:25:34 2009 From: ebellani at gmail.com (Eduardo Bellani) Date: Thu Oct 22 14:25:55 2009 Subject: [plt-scheme] Doubt in folding Message-ID: <184222e50910221125p46ff939y57d22a9ffc2f865c@mail.gmail.com> Small doubt in a fuction I've been playing with: ;; my-fold-left : (X X -> X) X (listof X) -> (listof X) ;; applies operation to each element of lox, and ;; combines them in a new list. Works from left to right ;; in lox. (define (my-fold-left combinator initial lox) (cond [(empty? lox) initial] [else (combinator (my-fold-left combinator initial (rest lox)) (first lox))])) ;; plt's built in foldl (foldl cons empty (list 1 2 3 4)) ; evals to what I expected -> (4 3 2 1) ;; mine (my-fold-left cons empty (list 1 2 3 4)) ; evals to ((((() . 4) . 3) . 2) . 1), but why ? Thanks for the time. -- Eduardo Bellani www.cnxs.com.br I object to doing things that computers can do. - Olin Shivers From matthias at ccs.neu.edu Thu Oct 22 14:32:54 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Oct 22 14:33:25 2009 Subject: [plt-scheme] Doubt in folding In-Reply-To: <184222e50910221125p46ff939y57d22a9ffc2f865c@mail.gmail.com> References: <184222e50910221125p46ff939y57d22a9ffc2f865c@mail.gmail.com> Message-ID: Two changes: #lang scheme ;; my-fold-left : (X X -> X) X (listof X) -> (listof X) ;; applies operation to each element of lox, and ;; combines them in a new list. Works from left to right ;; in lox. (define (my-fold-left combinator initial lox) (cond [(empty? lox) initial] [else (combinator (first lox) (my-fold-left combinator initial (rest lox)))])) ;; plt's built in foldl (foldr cons empty (list 1 2 3 4)) ; evals to what I expected -> (4 3 2 1) ;; mine (my-fold-left cons empty (list 1 2 3 4)) ; evals to ((((() . 4) . 3) . 2) . 1), but why ? ;; ---- Hint: Foldl is an accumulator function. On Oct 22, 2009, at 2:25 PM, Eduardo Bellani wrote: > Small doubt in a fuction I've been playing with: > > ;; my-fold-left : (X X -> X) X (listof X) -> (listof X) > ;; applies operation to each element of lox, and > ;; combines them in a new list. Works from left to right > ;; in lox. > (define (my-fold-left combinator initial lox) > (cond > [(empty? lox) initial] > [else > (combinator (my-fold-left combinator > initial > (rest lox)) > (first lox))])) > > ;; plt's built in foldl > (foldl cons empty (list 1 2 3 4)) ; evals to what I expected - > > (4 3 2 1) > > ;; mine > (my-fold-left cons empty (list 1 2 3 4)) ; evals to ((((() . 4) . 3) > . 2) . 1), but why ? > > > Thanks for the time. > -- > Eduardo Bellani > > www.cnxs.com.br > > I object to doing things that computers can do. > - Olin Shivers > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From ebellani at gmail.com Thu Oct 22 15:24:29 2009 From: ebellani at gmail.com (Eduardo Bellani) Date: Thu Oct 22 15:24:53 2009 Subject: [plt-scheme] Doubt in folding In-Reply-To: References: <184222e50910221125p46ff939y57d22a9ffc2f865c@mail.gmail.com> Message-ID: <184222e50910221224v25d311cbx356100c4374f99af@mail.gmail.com> ;; my-fold-left : (X X -> X) X (listof X) -> (listof X) ;; applies operation to each element of lox, and ;; combines them in a new list. Works from left to right ;; in lox. (define (my-fold-left combinator initial lox) (local [(define (folding local-lox accumulator) (cond [(empty? local-lox) accumulator] [else (folding (rest local-lox) (combinator (first local-lox) accumulator))]))] (folding lox initial))) ;; plt's built in foldl (foldl cons empty (list 1 2 3 4)) ; evals to (4 3 2 1) ;; mine (my-fold-left cons empty (list 1 2 3 4)) ; evals to (4 3 2 1) thanks for the hint! -- Eduardo Bellani www.cnxs.com.br I object to doing things that computers can do. - Olin Shivers From nadeem at acm.org Thu Oct 22 18:10:19 2009 From: nadeem at acm.org (Nadeem Abdul Hamid) Date: Thu Oct 22 18:10:43 2009 Subject: [plt-scheme] Need low-level help: blocking on reading from serial port in Windows Message-ID: <3D331186-00CF-4B81-B8A7-92F40675A881@acm.org> Hello all, I'm working on a Scheme interface to some robots and am having issues with reading from a serial port (really a wireless Bluetooth connection) on Windows. Basically, I need help writing a function that efficiently reads data from the port (without running into deadlock apparently). Here's the function in question; it's supposed to read a specified number of bytes from the input port in a "bot" structure and return them in a list: ;; raw-read : number bot -> (listof byte) (define (raw-read n a-bot) ;(printf " raw-read") (local (;; read-aux : (listof byte) number port -> (listof byte) (define (read-aux acc n in) ;(sleep (/ LATENCY 1000)) ;(printf ".~a" acc) (cond [(= n 0) acc] [else (cond [(byte-ready? in) (read-aux (cons (read-byte in) acc) (- n 1) in)] [else (read-aux acc n in)])])) (define r (reverse (read-aux empty n (bot-in-port a- bot))))) ;(printf " done: ~a\n" r) r )) First, everything works fine beautifully on Mac OS X. Then I went to try this on Windows XP (using PLT Scheme 4.2.2) and it would hang in this function. I've finally figured out that if I uncomment the "sleep" statement, then it does *not* hang. However, that makes performance very sluggish (even though LATENCY is defined as .01). So I'm wondering if without the sleep there is some sort of deadlock happening with the byte-ready? function? I suppose I could keep a counter and only "sleep" every 100 or 1000 failures of the byte-ready? condition, but does anyone have suggestions for a better way to do this? To tell the truth, I don't remember why I used byte-ready? to begin with -- in the morning I'll try without it and see what happens by just letting "read-byte" block until there's data. The port in the "bot" structure was opened using: (open-input-output-file portname #:mode 'binary #:exists 'update) where on windows portname is something like "\\\\.\\COM10". Thanks in advance for suggestions, comments. I'm still a Scheme newbie so welcome any criticisms :-) --- nadeem From carl.eastlund at gmail.com Thu Oct 22 18:31:27 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Thu Oct 22 18:32:09 2009 Subject: [plt-scheme] Need low-level help: blocking on reading from serial port in Windows In-Reply-To: <3D331186-00CF-4B81-B8A7-92F40675A881@acm.org> References: <3D331186-00CF-4B81-B8A7-92F40675A881@acm.org> Message-ID: <990e0c030910221531x2362674s8e716c5195ba08df@mail.gmail.com> On Thu, Oct 22, 2009 at 6:10 PM, Nadeem Abdul Hamid wrote: > Hello all, > > I'm working on a Scheme interface to some robots and am having issues with > reading from a serial port (really a wireless Bluetooth connection) on > Windows. Basically, I need help writing a function that efficiently reads > data from the port (without running into deadlock apparently). Here's the > function in question; it's supposed to read a specified number of bytes from > the input port in a "bot" structure and return them in a list: > > ?;; raw-read : number bot -> (listof byte) > ?(define (raw-read n a-bot) > ? ?;(printf " raw-read") > ? ?(local (;; read-aux : (listof byte) number port -> (listof byte) > ? ? ? ? ? ?(define (read-aux acc n in) > ? ? ? ? ? ? ?;(sleep (/ LATENCY 1000)) > ? ? ? ? ? ? ?;(printf ".~a" acc) > ? ? ? ? ? ? ?(cond > ? ? ? ? ? ? ? ?[(= n 0) acc] > ? ? ? ? ? ? ? ?[else > ? ? ? ? ? ? ? ? (cond > ? ? ? ? ? ? ? ? ? [(byte-ready? in) (read-aux (cons (read-byte in) acc) > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? (- n 1) in)] > ? ? ? ? ? ? ? ? ? [else (read-aux acc n in)])])) > ? ? ? ? ? ?(define r (reverse (read-aux empty n (bot-in-port a-bot))))) > ? ? ?;(printf " done: ~a\n" r) > ? ? ?r > ? ? ?)) > > First, everything works fine beautifully on Mac OS X. Then I went to try > this on Windows XP (using PLT Scheme 4.2.2) and it would hang in this > function. I've finally figured out that if I uncomment the "sleep" > statement, then it does *not* hang. However, that makes performance very > sluggish (even though LATENCY is defined as .01). So I'm wondering if > without the sleep there is some sort of deadlock happening with the > byte-ready? function? I suppose I could keep a counter and only "sleep" > every 100 or 1000 failures of the byte-ready? condition, but does anyone > have suggestions for a better way to do this? To tell the truth, I don't > remember why I used byte-ready? to begin with -- in the morning I'll try > without it and see what happens by just letting "read-byte" block until > there's data. > > The port in the "bot" structure was opened using: > ? (open-input-output-file portname #:mode 'binary #:exists 'update) > where on windows portname is something like "\\\\.\\COM10". > > > Thanks in advance for suggestions, comments. I'm still a Scheme newbie so > welcome any criticisms :-) > > --- nadeem Nadeem, You may want to look at the read-bytes-avail* function: http://docs.plt-scheme.org/reference/Byte_and_String_Input.html#(def._((quote._~23~25kernel)._read-bytes-avail!*)) It reads a byte string from a port and returns it immediately, never blocking. It looks like it does the work for you. --Carl From mhcoffin at gmail.com Thu Oct 22 23:42:04 2009 From: mhcoffin at gmail.com (Michael Coffin) Date: Thu Oct 22 23:42:30 2009 Subject: [plt-scheme] Scheme for first year CS classes, good or bad? In-Reply-To: <4AE065CE.6020509@uwaterloo.ca> References: <4072c51f0910211605i693dda1q29d140921b82dba8@mail.gmail.com> <4ADFBC6B.2010804@uwaterloo.ca> <932b2f1f0910220430p481cb099te6d8e6b91734c158@mail.gmail.com> <4AE065CE.6020509@uwaterloo.ca> Message-ID: <8a96949d0910222042p7b9ee956i91c663440e986890@mail.gmail.com> Yes. The thing that surprised me the most when moving from grad school/academia to industry is what an incredibly un-macho and *social* activity programming is when it's done right. There are a lot of things that drive that, but I think pervasive code reviews are the most important. If I ever went back to teaching, I would seriously consider requiring that every line of code submitted for an assignment first go through a code review by another student. p.s. But he's right about if vs. cond. :-) On Thu, Oct 22, 2009 at 7:01 AM, Prabhakar Ragde wrote: > Robby Findler wrote: > >> Well, that and his "take it like a man" seems woefully misplaced. :) >> > > This is telling, too, as it is symptomatic of a certain kind of programmer > macho which views any attempt at communication with human beings > (conventions, documentation, readable keywords and function names) as "soft" > or "unmasculine" (cf. "Real men don't use Macs"). To his credit, the > original reddit poster seems to be listening to and learning from the > responses to his post (though he's still being stubborn about if versus > cond). --PR > > _________________________________________________ > 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/20091022/67559d4f/attachment-0001.htm From david.storrs at gmail.com Thu Oct 22 23:55:40 2009 From: david.storrs at gmail.com (David Storrs) Date: Thu Oct 22 23:56:00 2009 Subject: [plt-scheme] Doubt in folding In-Reply-To: <184222e50910221224v25d311cbx356100c4374f99af@mail.gmail.com> References: <184222e50910221125p46ff939y57d22a9ffc2f865c@mail.gmail.com> <184222e50910221224v25d311cbx356100c4374f99af@mail.gmail.com> Message-ID: On Thu, Oct 22, 2009 at 3:24 PM, Eduardo Bellani wrote: > ;; my-fold-left : (X X -> X) X (listof X) -> (listof X) > ;; applies operation to each element of lox, and > ;; combines them in a new list. Works from left to right > ;; in lox. > (define (my-fold-left combinator initial lox) > ?(local [(define (folding local-lox accumulator) > ? ? ? ? ? ?(cond > ? ? ? ? ? ? ?[(empty? local-lox) accumulator] > ? ? ? ? ? ? ?[else > ? ? ? ? ? ? ? (folding (rest local-lox) > ? ? ? ? ? ? ? ? ? ? ? ?(combinator (first local-lox) > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?accumulator))]))] > ? ?(folding lox initial))) > > > ;; plt's built in foldl > (foldl cons empty (list 1 2 3 4)) ? ? ? ? ; evals to (4 3 2 1) > > ;; mine > (my-fold-left cons empty (list 1 2 3 4)) ?; evals to (4 3 2 1) thanks > for the hint! This version also works for the limited test cases I ran: (define (myfoldl comb init l) (if (empty? l) init (myfoldl comb (comb (car l) init) (cdr l)))) Dave From david.storrs at gmail.com Thu Oct 22 23:58:00 2009 From: david.storrs at gmail.com (David Storrs) Date: Thu Oct 22 23:58:19 2009 Subject: [plt-scheme] Need low-level help: blocking on reading from serial port in Windows In-Reply-To: <990e0c030910221531x2362674s8e716c5195ba08df@mail.gmail.com> References: <3D331186-00CF-4B81-B8A7-92F40675A881@acm.org> <990e0c030910221531x2362674s8e716c5195ba08df@mail.gmail.com> Message-ID: On Thu, Oct 22, 2009 at 6:31 PM, Carl Eastlund wrote: > On Thu, Oct 22, 2009 at 6:10 PM, Nadeem Abdul Hamid wrote: >> Hello all, >> >> I'm working on a Scheme interface to some robots Out of curiosity, are these Web robots, hardware robots, or something else? Dave From con.amalgamate at gmail.com Fri Oct 23 01:52:55 2009 From: con.amalgamate at gmail.com (Simon Haines) Date: Fri Oct 23 01:53:17 2009 Subject: [plt-scheme] How to write context-aware macros? Message-ID: <525455aa-098e-4ff1-8801-411f4dff9b2e@d9g2000prh.googlegroups.com> I'd like some advice for implementing related macros that share some kind of context. The example I'd like to emulate is (in clojure): http://github.com/ragnard/redis-clojure/blob/master/examples/demo.clj In this example, I assume the behaviour of redis/ping, redis/get and redis/set differ based on the first form supplied to redis/with- server. Is this possible with scheme? The scheme wiki (http:// community.schemewiki.org/?scheme-faq-macros) says that sub-macros are not possible (in R5RS), but that somehow the sub-macros may be implemented with let-syntax forms. How might this be achieved? If it is possible, what are the caveats? Thanks. From fare at tunes.org Fri Oct 23 03:37:54 2009 From: fare at tunes.org (Francois-Rene Rideau) Date: Fri Oct 23 03:38:18 2009 Subject: [plt-scheme] Boston Lisp Meeting Thursday 2009-10-29: Alex Plotnick, Daniel Herring Message-ID: <20091023003753.839833456.fare@tunes.org> Boston Lisp Meeting: Thursday 2009-10-29 Alex Plotnick, Daniel Herring http://fare.livejournal.com/147676.html A Boston Lisp Meeting will take place on Thursday, October 29th 2009 at 1800 at MIT 34-401B. Alex Plotnick with talk about CLWEB, and Daniel Herring will give a short presentation of LibCL. Additionally, we will have two 5-minute Lightning Talks, each followed by 2-minute Q&A. Speakers to be announced. Also, there will be a buffet offered by ITA Software. Registration is not necessary but appreciated. See details below. 1 Alex Plotnick on CLWEB CLWEB is a literate programming system for Common Lisp in the tradition of Knuth's WEB and CWEB systems. These systems are based on the idea that there are two audiences for every program ? the machine on the one hand and human programmers on the other ? and that these two audiences have very different requirements for understanding a given program. They take as input a document containing a mixture of source code, TeX, and WEB control codes, and output both a program suitable for compilation or evaluation, and also a TeX file that contains a pretty-printed version of the source code along with accompanying commentary. The former is for the machine, while the latter is ready for typesetting, printing, and reading by a human. CLWEB is of course itself a literate program, written in itself, using (mostly) portable Common Lisp as the source language. http://www.cs.brandeis.edu/~plotnick/clweb/ Alex Plotnick is a graduate student in computer science at Brandeis University. His interests include natural and computer language semantics, computational linguistics, and philosophy of language. 2 Daniel Herring on LibCL LibCL is a self-contained collection of portable, free Common Lisp libraries. LibCL is released on a quarterly cycle and provides the following features. Simple install: download a single file per release. Integration: libraries are tested to work with each other. Community building: aiming for shared licensing and ownership of packages. Platform neutrality: the libraries should be portable across implementations and OSs. Accountability: public read-only git repositories track full history. http://libcl.com/ 3 Lightning Talks At every meeting, before the main talk, there are two slots for strictly timed 5-minute "Lightning Talks" followed by 2 minutes for questions and answers. The slots for next meeting are still open. Step up and come talk about your pet project! Contact me at fare at tunes.org. 4 Time and Location The Lisp Meeting will take place on Thursday October 29th 2009 at 1800 (6pm) at MIT 34-401B. Note that this is not the usual day of the week. As the numbers indicate, the room is in Building 34, on the 4th floor. This is the usual location, on 50 Vassar Street, Cambridge. MIT map: http://whereis.mit.edu/bin/map?selection=34 Google map: http://maps.google.com/maps?q= 50+Vassar+St,+Cambridge,+MA+02139,+USA Many thanks go to Alexey Radul for arranging for the room, and to MIT for welcoming us. 5 Dinner ITA Software a fine employer of Lisp hackers (disclaimer: I work there), is kindly purchasing a buffet to accompany our monthly Boston Lisp meeting. Anyone who attends is welcome to partake. We appreciate it if you let us know you're coming, and what food taboos you have, so that we can order the correct amount and kind of food. Tell us by sending email to boston-lisp-meeting-register at common-lisp.net. We won't send any acknowledgement unless requested; importantly, we'll keep your identity and address confidential and won't communicate any such information to anyone, not even to our sponsors. 6 More about the Meeting The previous Boston Lisp Meeting on Wednesday, September 30th 2009 had about 20-odd participants. Christine Flood spoke about Project Fortress. We're always looking for more speakers. The call for speakers and all the other details are at: http://fare.livejournal.com/120393.html Volunteers to give Lightning Talks are also sought. http://fare.livejournal.com/ 143723.html For more information, see our web site http://boston-lisp.org/ For posts related to the Boston Lisp meetings in general, follow this link: http:// fare.livejournal.com/tag/boston-lisp-meeting or subscribe to our RSS feed: http://fare.livejournal.com/data/rss?tag=boston-lisp-meeting Please forward this information to people you think would be interested. Please accept my apologies for your receiving this message multiple times. My apologies if this announce gets posted to a list where it shouldn't, or fails to get posted to a list where it should. Feedback welcome by private email reply to fare at tunes.org. From geoff at knauth.org Fri Oct 23 04:05:41 2009 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Fri Oct 23 04:06:05 2009 Subject: [plt-scheme] DrScheme, libsdl Message-ID: <18AC9059-E2FC-40EA-8B3B-C3391B98852D@knauth.org> I was just using libsdl in another language and it reminded me that recently people were looking for cross-platform ways of handling sound. Might libsdl be suitable? See: http://www.libsdl.org/ From noelwelsh at gmail.com Fri Oct 23 06:52:23 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Fri Oct 23 06:52:46 2009 Subject: [plt-scheme] How to write context-aware macros? In-Reply-To: <525455aa-098e-4ff1-8801-411f4dff9b2e@d9g2000prh.googlegroups.com> References: <525455aa-098e-4ff1-8801-411f4dff9b2e@d9g2000prh.googlegroups.com> Message-ID: On Fri, Oct 23, 2009 at 6:52 AM, Simon Haines wrote: > I'd like some advice for implementing related macros that share some > kind of context. The example I'd like to emulate is (in clojure): > http://github.com/ragnard/redis-clojure/blob/master/examples/demo.clj Probably the simplest way to do this is using syntax parameters. They work just about the same as normal parameters. Note that in the clojure example, only the redis/with-server form need be a macro. The others could be implemented as normal functions if the with-server form were to expand into a call to parameterize, for example. N. From matthias at ccs.neu.edu Fri Oct 23 08:04:18 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Fri Oct 23 08:04:52 2009 Subject: [plt-scheme] Scheme for first year CS classes, good or bad? In-Reply-To: <8a96949d0910222042p7b9ee956i91c663440e986890@mail.gmail.com> References: <4072c51f0910211605i693dda1q29d140921b82dba8@mail.gmail.com> <4ADFBC6B.2010804@uwaterloo.ca> <932b2f1f0910220430p481cb099te6d8e6b91734c158@mail.gmail.com> <4AE065CE.6020509@uwaterloo.ca> <8a96949d0910222042p7b9ee956i91c663440e986890@mail.gmail.com> Message-ID: On Oct 22, 2009, at 11:42 PM, Michael Coffin wrote: > Yes. The thing that surprised me the most when moving from grad > school/academia to industry is what an incredibly un-macho and > *social* activity programming is when it's done right. There are a > lot of things that drive that, but I think pervasive code reviews > are the most important. If I ever went back to teaching, I would > seriously consider requiring that every line of code submitted for > an assignment first go through a code review by another student Not good enough. You need to train students to spot problems. We run almost all courses now with code reviews. I started in 1996 with this (then pair programming) and the training has continually improved -- Matthias From yinso.chen at gmail.com Fri Oct 23 08:06:30 2009 From: yinso.chen at gmail.com (YC) Date: Fri Oct 23 08:06:55 2009 Subject: [plt-scheme] Need low-level help: blocking on reading from serial port in Windows In-Reply-To: <3D331186-00CF-4B81-B8A7-92F40675A881@acm.org> References: <3D331186-00CF-4B81-B8A7-92F40675A881@acm.org> Message-ID: <779bf2730910230506q537d5e48r7f942db87452e18e@mail.gmail.com> On Thu, Oct 22, 2009 at 3:10 PM, Nadeem Abdul Hamid wrote: > > First, everything works fine beautifully on Mac OS X. Then I went to try > this on Windows XP (using PLT Scheme 4.2.2) and it would hang in this > function. I've finally figured out that if I uncomment the "sleep" > statement, then it does *not* hang. However, that makes performance very > sluggish (even though LATENCY is defined as .01). So I'm wondering if > without the sleep there is some sort of deadlock happening with the > byte-ready? function? I suppose I could keep a counter and only "sleep" > every 100 or 1000 failures of the byte-ready? condition, but does anyone > have suggestions for a better way to do this? To tell the truth, I don't > remember why I used byte-ready? to begin with -- in the morning I'll try > without it and see what happens by just letting "read-byte" block until > there's data. > Nadeem, byte-ready? shouldn't "lock" with anything - if there are nothing to be read in the port it returns immediately. Could the hanging be that there are no data coming through the port? Because in that case your code (with sleep commented out) will be run in a tight loop, which can appear as hanging. I tested your function with a string port with plenty of data on WinXP and it works. Cheers, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091023/195d26a9/attachment-0001.htm From stephen.degabrielle at acm.org Fri Oct 23 08:24:02 2009 From: stephen.degabrielle at acm.org (Stephen De Gabrielle) Date: Fri Oct 23 08:24:25 2009 Subject: [plt-scheme] Drscheme icon Message-ID: <595b9ab20910230524ydafb7fdx7c902acd0aa156f1@mail.gmail.com> Does anyone have a svg drscheme icon that works for gnome? (just installed 9.10 koala-ubuntu and am still motivated to keep it pretty) cheers, Stephen -- -- 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 Fri Oct 23 08:34:56 2009 From: stephen.degabrielle at acm.org (Stephen De Gabrielle) Date: Fri Oct 23 08:35:19 2009 Subject: [plt-scheme] DrScheme, libsdl In-Reply-To: <18AC9059-E2FC-40EA-8B3B-C3391B98852D@knauth.org> References: <18AC9059-E2FC-40EA-8B3B-C3391B98852D@knauth.org> Message-ID: <595b9ab20910230534p1575c383l2b79aacfb12e264b@mail.gmail.com> I thought someone had done a binding for this- though I may be thinking of fluxus. On Friday, October 23, 2009, Geoffrey S. Knauth wrote: > I was just using libsdl in another language and it reminded me that recently people were looking for cross-platform ways of handling sound. ?Might libsdl be suitable? > > See: ?http://www.libsdl.org/ > _________________________________________________ > ?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 Fri Oct 23 08:45:24 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Fri Oct 23 08:45:51 2009 Subject: [plt-scheme] scheme_add_managed with FFI In-Reply-To: <4ADF7872.4080806@cs.utah.edu> References: <4ACFE5EA.2030305@cs.utah.edu> <4ADF7872.4080806@cs.utah.edu> Message-ID: <20091023124526.C04436500B9@mail-svr1.cs.utah.edu> Thanks for the concrete example in PR 10538. The key feature of that example is that a single Scheme function is registered as a callback twice. The default handling of callbacks is that only the most recently generated foreign callback is retained with the Scheme function used as a callback. So, the second call to scheme_add_managed with the same function allows the foreign callback generated by the first call to be GCed. The simplest solution is to provides a boxed empty list for `#:keep' in the callback type: (_fun #:keep (box null) _scheme _pointer -> _void) At Wed, 21 Oct 2009 15:09:06 -0600, Chognkai Zhu wrote: > Matthew told me to change > > (add-managed p (lambda (p _) (my-close p)) #f #f) > > to > > (add-managed p my-close #f #f) > > where my-close lives at top-level so that the lambda won't get garbage > collected. I just tried that. No. Segfault still happens. Could anyone > (Eli or Matthew) please help again? Many thanks. > > Also, should I make a small example that can reproduce the problem? > > Chongkai > > Chongkai Zhu wrote: > > Hi all, > > > > In one of my programs, I need to use custodian to manage some > > resource. So I wrote the following: > > > > (define add-managed > > (get-ffi-obj "scheme_add_managed" #f > > (_fun (_pointer = #f) _scheme (_fun _scheme _pointer -> > > _void) _pointer _bool -> _pointer))) > > > > ... > > > > (add-managed p (lambda (p _) (my-close p)) #f #f) > > > > A side note: here p itself is a _pointer (print as #) > > returned from some other FFI call. > > > > If I run the program for long enough, adding objects under the manage > > of custodians, and closing custodians once a while, with other process > > (other than PLT) actively using memory, eventually a segfault will > > happen when I'm shutdown a custodian (which has some p under it's > > management). Testing shows the segfault is related to my > > `add-managed', as commenting it the segfault also disappears. > > > > I noticed in > > http://schemecookbook.org/Cookbook/PLTCustodianRegistration, the FFI > > type of scheme_add_managed is different from how I use it. Did I do > > something wrong using scheme_add_managed this way? Why does the > > segfault happen? Could anyone help elaborate? Thanks in advance. > > > > Sincerely, > > Chongkai > > _________________________________________________ > > 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 plragde at uwaterloo.ca Fri Oct 23 08:45:06 2009 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Fri Oct 23 08:46:49 2009 Subject: [plt-scheme] Scheme for first year CS classes, good or bad? In-Reply-To: References: <4072c51f0910211605i693dda1q29d140921b82dba8@mail.gmail.com> <4ADFBC6B.2010804@uwaterloo.ca> <932b2f1f0910220430p481cb099te6d8e6b91734c158@mail.gmail.com> <4AE065CE.6020509@uwaterloo.ca> <8a96949d0910222042p7b9ee956i91c663440e986890@mail.gmail.com> Message-ID: <4AE1A552.5000500@uwaterloo.ca> Matthias Felleisen wrote: > Not good enough. You need to train students to spot problems. > > We run almost all courses now with code reviews. I started in 1996 with > this (then pair programming) and the training has continually improved Can you describe the logistics of this? What is the class size, and what course personnel are involved? I am currently teaching an "advanced" class of 45, but our section sizes are now 90-100 in the regular classes, with tutorials of 60. --PR From grettke at acm.org Fri Oct 23 10:43:03 2009 From: grettke at acm.org (Grant Rettke) Date: Fri Oct 23 10:43:27 2009 Subject: [plt-scheme] How to write context-aware macros? In-Reply-To: References: <525455aa-098e-4ff1-8801-411f4dff9b2e@d9g2000prh.googlegroups.com> Message-ID: <756daca50910230743x22d67b42ubf1291d5a024ea73@mail.gmail.com> On Fri, Oct 23, 2009 at 5:52 AM, Noel Welsh wrote: > On Fri, Oct 23, 2009 at 6:52 AM, Simon Haines wrote: >> I'd like some advice for implementing related macros that share some >> kind of context. The example I'd like to emulate is (in clojure): >> http://github.com/ragnard/redis-clojure/blob/master/examples/demo.clj > > Probably the simplest way to do this is using syntax parameters. They > work just about the same as normal parameters. > > Note that in the clojure example, only the redis/with-server form need > be a macro. The others could be implemented as normal functions if the > with-server form were to expand into a call to parameterize, for > example. That seems like the easiest thing. For what Noel described, maybe something like this: #!r6rs (import (rnrs) (srfi :39) (srfi :48)) (define redis/address (make-parameter "Undefined")) (define (redis/info) (display (format "redis/info: ~a~%" (redis/address)))) (define (redis/get key) (display (format "redis/get: ~a Key: ~a~%" (redis/address) key))) (define (redis/set key val) (display (format "redis/set: ~a Key: ~a Val: ~a~%" (redis/address) key val))) (redis/info) (parameterize ((redis/address "127.0.0.1")) (redis/info)) (define-syntax redis/with-server (syntax-rules (:host) ((_ (:host address) body ...) (parameterize ((redis/address address)) body ...)))) (redis/with-server (:host "10.0.0.1") (redis/info) (redis/get "foo")) I wonder what is the pattern though for the "uninitialized" state of functions that rely on a parameter. Things like display are easy as they default to something, but for the redis examples they probably should generate an error. From dave at pawfal.org Fri Oct 23 10:49:44 2009 From: dave at pawfal.org (Dave Griffiths) Date: Fri Oct 23 10:50:12 2009 Subject: [plt-scheme] DrScheme, libsdl In-Reply-To: <595b9ab20910230534p1575c383l2b79aacfb12e264b@mail.gmail.com> References: <18AC9059-E2FC-40EA-8B3B-C3391B98852D@knauth.org> <595b9ab20910230534p1575c383l2b79aacfb12e264b@mail.gmail.com> Message-ID: <1256309384.12551.88.camel@kittywake> I've been thinking on and off about how to get sound working in DrScheme, but is sort of depends on exactly what you want to do. For example, fluxus has two ways of making audio: One is a dedicated audio server, a synthesis/dsp graph engine called fluxa - which runs in a separate process (similar, although much much smaller than supercollider). Events are timestamped and sent to the server over the network, things can then be made to happen with a very high timing accuracy (in other words, good for techno etc). It uses jack as it's audio server which is great in performance situations for it's reliability, but not for desktop audio due to fiddly setup (it's just not designed for that). I've used fluxa in DrScheme though. The other method in fluxus is a tiny C++ OpenAL binding, which should probably be rewritten using the ffi. It's designed for adding sounds to games. OpenAL is great if you're happy playing a wav file and altering it's pitch and volume. It's crossplatform and doesn't need any other servers or processes running, and is probably what SDL is using. I haven't tried making music with OpenAL though. One thing which could be problematic is getting the timing accurate enough. You'd have to drive it from a tight loop dealing with scheduled events, as it works around 'play now/asap' concept, rather than sequencing or scheduling things in the future. Even then, it might sound a little sloppy. It all needs experimenting with though. On the other hand, maybe someone is working on a solution already and has figured all this out... :) cheers, dave On Fri, 2009-10-23 at 13:34 +0100, Stephen De Gabrielle wrote: > I thought someone had done a binding for this- though I may be > thinking of fluxus. > > On Friday, October 23, 2009, Geoffrey S. Knauth wrote: > > I was just using libsdl in another language and it reminded me that recently people were looking for cross-platform ways of handling sound. Might libsdl be suitable? > > > > See: http://www.libsdl.org/ > > _________________________________________________ > > For list-related administrative tasks: > > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > > From matthias at ccs.neu.edu Fri Oct 23 11:09:21 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Fri Oct 23 11:09:50 2009 Subject: [plt-scheme] Scheme for first year CS classes, good or bad? In-Reply-To: <4AE1A552.5000500@uwaterloo.ca> References: <4072c51f0910211605i693dda1q29d140921b82dba8@mail.gmail.com> <4ADFBC6B.2010804@uwaterloo.ca> <932b2f1f0910220430p481cb099te6d8e6b91734c158@mail.gmail.com> <4AE065CE.6020509@uwaterloo.ca> <8a96949d0910222042p7b9ee956i91c663440e986890@mail.gmail.com> <4AE1A552.5000500@uwaterloo.ca> Message-ID: On Oct 23, 2009, at 8:45 AM, Prabhakar Ragde wrote: > Matthias Felleisen wrote: > >> Not good enough. You need to train students to spot problems. >> We run almost all courses now with code reviews. I started in 1996 >> with this (then pair programming) and the training has continually >> improved > > Can you describe the logistics of this? What is the class size, and > what course personnel are involved? I am currently teaching an > "advanced" class of 45, but our section sizes are now 90-100 in the > regular classes, with tutorials of 60. --PR In our middler course, we form student panels for in-class, public code reviews. Each panel has a head reader, a second reader, and a scribe. They get an introduction to these roles and they learn as they go. The panel is responsible for directing the code walk and for conducting it. If the panel misses obviously bad points, my TA or I stop the code walk and give the class a chance to spot the problem. If anyone does, he gets 'bonus' points. If not, we explain. The scribe drafts a memo of things that people should fix and mails it to me or my TA. I edit until it's okay. Then it is forwarded to the responsible pair. All panelists get grades for their performance and feedback. We typically conduct three 30 minutes code walks per session, giving us three chances to evaluate panel performance. At the end of the semester, my TA and I conduct a final code walk, 45 mins each pair. The typical class size is in the 40s, but I have run it with as few students as 18 at Rice and as many as 75 at NEU. The course is called 'Hell' but I have received thank-you notes from students who failed over the years. (They acknowledged that they saw the right learning environment even if they didn't learn enough there.) It is a hellish amount of work, too. The students tend to write some 10-15Kloc (if they choose C...ava) of 6K in a scripting language. I do all of the work that students do, too. Otherwise you don't know what you're throwing at them. -- Matthias From lianciana at gmail.com Fri Oct 23 12:01:18 2009 From: lianciana at gmail.com (lianciana@gmail.com) Date: Fri Oct 23 12:01:40 2009 Subject: [plt-scheme] google groups + mailing list Message-ID: <166c28750910230901p67e2a514kb603258696ab37e8@mail.gmail.com> Hello! Can you remove myself from the mailing list (discussion list) for plt-scheme? My email address is lianciana@gmail.com I'm looking at it on google groups already and there's no spam (amazingly for groups), so it's redundant to also be on the mailing list. Thank-you! Morgan From lianciana at gmail.com Fri Oct 23 12:03:43 2009 From: lianciana at gmail.com (Morgan) Date: Fri Oct 23 12:04:02 2009 Subject: [plt-scheme] Ignore spam! Message-ID: <3fc27e5a-df97-4fe9-9488-e40ccf8e4cfd@j19g2000vbp.googlegroups.com> crap, sent that last msg to the wrong email address. Sorry folks! Ignore the spam! From namekuseijin at gmail.com Fri Oct 23 13:39:11 2009 From: namekuseijin at gmail.com (namekuseijin) Date: Fri Oct 23 13:39:35 2009 Subject: [plt-scheme] Doubt in folding In-Reply-To: References: <184222e50910221125p46ff939y57d22a9ffc2f865c@mail.gmail.com> <184222e50910221224v25d311cbx356100c4374f99af@mail.gmail.com> Message-ID: <67d0527e0910231039k10a8327bx55595593b16a71e@mail.gmail.com> On Fri, Oct 23, 2009 at 1:55 AM, David Storrs wrote: > On Thu, Oct 22, 2009 at 3:24 PM, Eduardo Bellani wrote: >> ;; my-fold-left : (X X -> X) X (listof X) -> (listof X) >> ;; applies operation to each element of lox, and >> ;; combines them in a new list. Works from left to right >> ;; in lox. >> (define (my-fold-left combinator initial lox) >> ?(local [(define (folding local-lox accumulator) >> ? ? ? ? ? ?(cond >> ? ? ? ? ? ? ?[(empty? local-lox) accumulator] >> ? ? ? ? ? ? ?[else >> ? ? ? ? ? ? ? (folding (rest local-lox) >> ? ? ? ? ? ? ? ? ? ? ? ?(combinator (first local-lox) >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?accumulator))]))] >> ? ?(folding lox initial))) >> >> >> ;; plt's built in foldl >> (foldl cons empty (list 1 2 3 4)) ? ? ? ? ; evals to (4 3 2 1) >> >> ;; mine >> (my-fold-left cons empty (list 1 2 3 4)) ?; evals to (4 3 2 1) thanks >> for the hint! > > > This version also works for the limited test cases I ran: > > (define (myfoldl comb init l) > ?(if (empty? l) > ? ? ?init > ? ? ?(myfoldl comb > ? ? ? ? ? ? ? (comb (car l) init) > ? ? ? ? ? ? ? (cdr l)))) of course that's the plain, simple and no-frills foldl in plain Scheme. From nadeem at acm.org Fri Oct 23 16:04:26 2009 From: nadeem at acm.org (Nadeem Abdul Hamid) Date: Fri Oct 23 16:04:50 2009 Subject: [plt-scheme] Need low-level help: blocking on reading from serial port in Windows In-Reply-To: <990e0c030910221531x2362674s8e716c5195ba08df@mail.gmail.com> References: <3D331186-00CF-4B81-B8A7-92F40675A881@acm.org> <990e0c030910221531x2362674s8e716c5195ba08df@mail.gmail.com> Message-ID: <5d307820910231304k77dd35cj28b0d30170057974@mail.gmail.com> Thanks Carl for the suggestion. I've tried read-bytes-avail!* but still have a similar issue. Here's my function now: ;; raw-read : number bot -> (listof byte) (define (raw-read n a-bot) ;(printf " raw-read") (local [(define bstr (make-bytes n)) (define in (bot-in-port a-bot)) ;; read-aux : number port -> number (define (read-aux start-pos tries) (when (= 0 (remainder tries 10000000)) (sleep 0)) ; (printf ".")) (cond [(>= start-pos n) start-pos] ; should never be > really [else (let [(r (read-bytes-avail!* bstr in start-pos))] (cond [(number? r) (read-aux (+ r start-pos) 0)] [else (read-aux start-pos (add1 tries))] ; ??? ))])) ] (read-aux 0 0) (bytes->list bstr) )) Notice the "when" expression. If that is commented out, the code still hangs... Here's my interactions (apologies for the length of the run below; I wasn't sure if I attached it as a file that it would go through to the list): With (sleep 0) in when expression runs reliably (results produced within a second; (mostly) no hanging): Welcome to DrScheme, version 4.2.1 [3m]. Language: Module; memory limit: 128 megabytes. All 8 tests passed! > (with-bot-on-port "COM3" (lambda (b) (for ([i (in-range 10)]) (printf "~a\n" (get-senses b))))) info fluke:2.7.9,Robot-Version:2.6.1,Robot:Scribbler,Mode:Serial battery 6.386639531392239 name DrWeird senses #(struct:sensor-data 1 1 150 79 257 1 0 0) #(struct:sensor-data 1 1 150 79 256 1 0 0) #(struct:sensor-data 1 1 150 79 256 1 0 0) #(struct:sensor-data 1 1 150 79 256 1 0 0) #(struct:sensor-data 1 1 150 79 256 1 0 0) #(struct:sensor-data 0 1 150 79 256 1 0 0) #(struct:sensor-data 1 1 150 79 256 1 0 0) #(struct:sensor-data 1 1 150 79 256 1 0 0) #(struct:sensor-data 0 1 150 79 256 1 0 0) #(struct:sensor-data 1 1 150 79 256 1 0 0) #(struct:sensor-data 0 1 150 79 256 1 0 0) battery 6.386639531392239 senses #(struct:sensor-data 1 1 150 79 256 1 0 0) > (with-bot-on-port "COM3" (lambda (b) (for ([i (in-range 10)]) (printf "~a\n" (get-senses b))))) info fluke:2.7.9,Robot-Version:2.6.1,Robot:Scribbler,Mode:Serial battery 6.386639531392239 name DrWeird senses #(struct:sensor-data 0 1 137 74 231 1 0 0) #(struct:sensor-data 1 1 137 74 231 1 0 0) #(struct:sensor-data 1 1 137 74 232 1 0 0) #(struct:sensor-data 0 1 137 74 232 1 0 0) #(struct:sensor-data 1 1 137 74 232 1 0 0) #(struct:sensor-data 1 1 137 74 233 1 0 0) #(struct:sensor-data 0 1 138 75 233 1 0 0) #(struct:sensor-data 1 1 138 75 234 1 0 0) #(struct:sensor-data 1 1 138 75 235 1 0 0) #(struct:sensor-data 0 1 139 75 235 1 0 0) #(struct:sensor-data 1 0 139 75 236 1 0 0) battery 6.43430102043248 senses #(struct:sensor-data 1 1 141 76 237 1 0 0) > With the entire when commented out (hangs at different points): > (with-bot-on-port "COM3" (lambda (b) (for ([i (in-range 10)]) (printf "~a\n" (get-senses b))))) info fluke:2.7.9,Robot-Version:2.6.1,Robot:Scribbler,Mode:Serial battery 6.386639531392239 ;;;;;;;;;;;;;;;;;;;; HANG -- no response even after 30 seconds With (printf "."), works sometimes, but then hangs sometimes: Welcome to DrScheme, version 4.2.1 [3m]. Language: Module; memory limit: 128 megabytes. All 8 tests passed! > (with-bot-on-port "COM3" (lambda (b) (for ([i (in-range 3)]) (printf "~a\n" (get-senses b))))) .................... info fluke:2.7.9,Robot-Version:2.6.1,Robot:Scribbler,Mode:Serial ...battery 6.243655064271517 ...................................... name DrWeird ...................... senses #(struct:sensor-data 0 0 188 88 277 1 1 0) ......................#(struct:sensor-data 1 0 188 88 277 1 1 0) ......................#(struct:sensor-data 1 1 189 88 278 1 1 0) ......................#(struct:sensor-data 1 1 189 88 277 1 1 0) .........................battery 6.195993575231277 ...................... senses #(struct:sensor-data 1 1 189 88 277 1 1 0) > (with-bot-on-port "COM3" (lambda (b) (for ([i (in-range 3)]) (printf "~a\n" (get-senses b))))) .................... info fluke:2.7.9,Robot-Version:2.6.1,Robot:Scribbler,Mode:Serial ...battery 6.291316553311758 ...................................... name DrWeird ...................... senses #(struct:sensor-data 1 1 187 88 277 1 1 0) ......................#(struct:sensor-data 1 1 187 88 277 1 1 0) ......................#(struct:sensor-data 0 0 187 88 277 1 1 0) ......................#(struct:sensor-data 1 0 187 88 277 1 1 0) .........................battery 6.243655064271517 ...................... senses #(struct:sensor-data 1 0 187 88 277 1 1 0) > (with-bot-on-port "COM3" (lambda (b) (for ([i (in-range 3)]) (printf "~a\n" (get-senses b))))) . ;;;;;; HANG!!! Anyway, I'm going to try with the (sleep 0) option and see how that works for now. I'm trying to wrap the robot functionality up so they can be programmed using big-bang... Will post details of that in reply to Dave's question.... --- nadeem On Thu, Oct 22, 2009 at 6:31 PM, Carl Eastlund wrote: > On Thu, Oct 22, 2009 at 6:10 PM, Nadeem Abdul Hamid wrote: >> Hello all, >> >> I'm working on a Scheme interface to some robots and am having issues with >> reading from a serial port (really a wireless Bluetooth connection) on >> Windows. Basically, I need help writing a function that efficiently reads >> data from the port (without running into deadlock apparently). Here's the >> function in question; it's supposed to read a specified number of bytes from >> the input port in a "bot" structure and return them in a list: >> >> ?;; raw-read : number bot -> (listof byte) >> ?(define (raw-read n a-bot) >> ? ?;(printf " raw-read") >> ? ?(local (;; read-aux : (listof byte) number port -> (listof byte) >> ? ? ? ? ? ?(define (read-aux acc n in) >> ? ? ? ? ? ? ?;(sleep (/ LATENCY 1000)) >> ? ? ? ? ? ? ?;(printf ".~a" acc) >> ? ? ? ? ? ? ?(cond >> ? ? ? ? ? ? ? ?[(= n 0) acc] >> ? ? ? ? ? ? ? ?[else >> ? ? ? ? ? ? ? ? (cond >> ? ? ? ? ? ? ? ? ? [(byte-ready? in) (read-aux (cons (read-byte in) acc) >> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? (- n 1) in)] >> ? ? ? ? ? ? ? ? ? [else (read-aux acc n in)])])) >> ? ? ? ? ? ?(define r (reverse (read-aux empty n (bot-in-port a-bot))))) >> ? ? ?;(printf " done: ~a\n" r) >> ? ? ?r >> ? ? ?)) >> >> First, everything works fine beautifully on Mac OS X. Then I went to try >> this on Windows XP (using PLT Scheme 4.2.2) and it would hang in this >> function. I've finally figured out that if I uncomment the "sleep" >> statement, then it does *not* hang. However, that makes performance very >> sluggish (even though LATENCY is defined as .01). So I'm wondering if >> without the sleep there is some sort of deadlock happening with the >> byte-ready? function? I suppose I could keep a counter and only "sleep" >> every 100 or 1000 failures of the byte-ready? condition, but does anyone >> have suggestions for a better way to do this? To tell the truth, I don't >> remember why I used byte-ready? to begin with -- in the morning I'll try >> without it and see what happens by just letting "read-byte" block until >> there's data. >> >> The port in the "bot" structure was opened using: >> ? (open-input-output-file portname #:mode 'binary #:exists 'update) >> where on windows portname is something like "\\\\.\\COM10". >> >> >> Thanks in advance for suggestions, comments. I'm still a Scheme newbie so >> welcome any criticisms :-) >> >> --- nadeem > > Nadeem, > > You may want to look at the read-bytes-avail* function: > > http://docs.plt-scheme.org/reference/Byte_and_String_Input.html#(def._((quote._~23~25kernel)._read-bytes-avail!*)) > > It reads a byte string from a port and returns it immediately, never > blocking. ?It looks like it does the work for you. > > --Carl > From neil at neilvandyke.org Fri Oct 23 16:09:28 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Fri Oct 23 16:09:51 2009 Subject: [plt-scheme] Need low-level help: blocking on reading from serial port in Windows In-Reply-To: <5d307820910231304k77dd35cj28b0d30170057974@mail.gmail.com> References: <3D331186-00CF-4B81-B8A7-92F40675A881@acm.org> <990e0c030910221531x2362674s8e716c5195ba08df@mail.gmail.com> <5d307820910231304k77dd35cj28b0d30170057974@mail.gmail.com> Message-ID: <4AE20D78.7040900@neilvandyke.org> I suggest using "sync" to block until bytes are once again ready to be read from the port. http://download.plt-scheme.org/doc/html/reference/sync.html#(def._((quote._~23~25kernel)._sync)) -- http://www.neilvandyke.org/ From nadeem at acm.org Fri Oct 23 16:32:56 2009 From: nadeem at acm.org (Nadeem Abdul Hamid) Date: Fri Oct 23 16:33:16 2009 Subject: [plt-scheme] Need low-level help: blocking on reading from serial port in Windows In-Reply-To: <4AE20D78.7040900@neilvandyke.org> References: <3D331186-00CF-4B81-B8A7-92F40675A881@acm.org> <990e0c030910221531x2362674s8e716c5195ba08df@mail.gmail.com> <5d307820910231304k77dd35cj28b0d30170057974@mail.gmail.com> <4AE20D78.7040900@neilvandyke.org> Message-ID: <5d307820910231332g39efa3efsdf3c7534360e9102@mail.gmail.com> On Fri, Oct 23, 2009 at 4:09 PM, Neil Van Dyke wrote: > I suggest using "sync" to block until bytes are once again ready to be read > from the port. Tried that; it still hangs most of the time, and when I break the execution, it highlights the "sync" or "sync/enable-break" expression.... ;; raw-read : number bot -> (listof byte) (define (raw-read n a-bot) ;(printf " raw-read") (local [(define bstr (make-bytes n)) (define in (bot-in-port a-bot)) ;; read-aux : number port -> number (define (read-aux start-pos tries) (cond [(>= start-pos n) start-pos] ; should never be > really [else (let [(r (read-bytes-avail!* bstr (sync/enable-break in) start-pos))] (cond [(number? r) (read-aux (+ r start-pos) 0)] [else (read-aux start-pos (add1 tries))] ))])) ] (read-aux 0 0) (bytes->list bstr) )) From yinso.chen at gmail.com Fri Oct 23 16:43:14 2009 From: yinso.chen at gmail.com (YC) Date: Fri Oct 23 16:43:41 2009 Subject: [plt-scheme] Need low-level help: blocking on reading from serial port in Windows In-Reply-To: <5d307820910231332g39efa3efsdf3c7534360e9102@mail.gmail.com> References: <3D331186-00CF-4B81-B8A7-92F40675A881@acm.org> <990e0c030910221531x2362674s8e716c5195ba08df@mail.gmail.com> <5d307820910231304k77dd35cj28b0d30170057974@mail.gmail.com> <4AE20D78.7040900@neilvandyke.org> <5d307820910231332g39efa3efsdf3c7534360e9102@mail.gmail.com> Message-ID: <779bf2730910231343s2b8b717bu1bd49960244e7182@mail.gmail.com> On Fri, Oct 23, 2009 at 1:32 PM, Nadeem Abdul Hamid wrote: > On Fri, Oct 23, 2009 at 4:09 PM, Neil Van Dyke > wrote: > > I suggest using "sync" to block until bytes are once again ready to be > read > > from the port. > > Tried that; it still hangs most of the time, and when I break the > execution, it highlights the "sync" or "sync/enable-break" > expression.... > That seems like there are no data available in the port - sync blocks until there are data - in my previous response to you I was able to use your original function to read from a string port that has plenty of data. Are you able to read a single byte from the port? i.e. (read-byte (bot-in-port a-bot)). yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091023/8c7c3da5/attachment-0001.htm From czhu at cs.utah.edu Fri Oct 23 17:36:07 2009 From: czhu at cs.utah.edu (Chognkai Zhu) Date: Fri Oct 23 17:36:29 2009 Subject: [plt-scheme] scheme_add_managed with FFI In-Reply-To: <20091023124526.C04436500B9@mail-svr1.cs.utah.edu> References: <4ACFE5EA.2030305@cs.utah.edu> <4ADF7872.4080806@cs.utah.edu> <20091023124526.C04436500B9@mail-svr1.cs.utah.edu> Message-ID: <4AE221C7.30805@cs.utah.edu> Many thanks. With some experiment, it seems the following works: #lang scheme (require scheme/foreign) (unsafe!) (define add-managed (get-ffi-obj "scheme_add_managed" #f (_fun (_pointer = #f) _scheme (_fun #:keep (box null) _scheme _pointer -> _void) _pointer _bool -> _pointer))) (define (make-p) (let ((p (malloc _pointer 'raw))) (add-managed p (lambda (p _) (free p)) #f #f) p)) (define p1 (make-p)) (define p2 (make-p)) (ptr-ref p1 _int) (ptr-ref p2 _int) (collect-garbage) But I didn't store the (lambda (p _) (free p)) or the box anywhere. Is it really needed? Chongkai Matthew Flatt wrote: > Thanks for the concrete example in PR 10538. > > The key feature of that example is that a single Scheme function is > registered as a callback twice. The default handling of callbacks is > that only the most recently generated foreign callback is retained with > the Scheme function used as a callback. So, the second call to > scheme_add_managed with the same function allows the foreign callback > generated by the first call to be GCed. > > The simplest solution is to provides a boxed empty list for `#:keep' in > the callback type: > > (_fun #:keep (box null) _scheme _pointer -> _void) > > > From con.amalgamate at gmail.com Fri Oct 23 19:53:25 2009 From: con.amalgamate at gmail.com (Simon Haines) Date: Fri Oct 23 19:53:44 2009 Subject: [plt-scheme] Re: How to write context-aware macros? In-Reply-To: <756daca50910230743x22d67b42ubf1291d5a024ea73@mail.gmail.com> References: <525455aa-098e-4ff1-8801-411f4dff9b2e@d9g2000prh.googlegroups.com> <756daca50910230743x22d67b42ubf1291d5a024ea73@mail.gmail.com> Message-ID: Thank you both for your replies, I hadn't thought of this approach before. I guess what I was really looking for was alternatives to my usual pattern for programming against an interface. My typical approach is to define the interface in a struct, create convenience functions to access lambdas in the struct, then each implementation puts the appropriate lambdas in the struct. For example, assume a datastore-like interface with 'get' and 'put' operations. My approach would be: ; "datastore.ss" (define-struct ds (get put)) (define (ds/get ds key) ((ds-get ds) key)) (define (ds/put ds key value) ((ds-put ds) key value)) (provide make-datastore ds/get ds/put) ; "file-datastore-implementation.ss" (require "datastore.ss") (define make-file-datastore (make-datastore (lambda (key) ) (lambda (key value) ))) (provide make-file-datastore) Thus datastore consumers only need "datastore.ss" and the implementation can be set-up and provided by the consumer's controller. I'm not sure how canonical this approach is, or whether it is a legacy I've brought from exposure to object orientation, but it works for me. It 'feels' lighter than using a full object system. But I also like the expressiveness of the clojure example. Are there other techniques that may be considered 'du jour' for programming against encapsulated components, or am I still thinking too much in terms of object orientation? From dyoo at cs.wpi.edu Fri Oct 23 20:59:18 2009 From: dyoo at cs.wpi.edu (Danny Yoo) Date: Fri Oct 23 20:59:42 2009 Subject: [plt-scheme] getting planet documentation working right? Message-ID: Hi everyone, I'm trying to properly generate Scribble documentation for Moby, but my links are mostly broken on PLaneT (full of red underlines): http://planet.plt-scheme.org/package-source/dyoo/moby.plt/2/1/planet-docs/manual/index.html I am using Carl's PLaneT Scribbling library, which I hoped would solve the issue. I'm still missing something. If I look at the documentation locally, it looks fine to me. What else should I be doing? From carl.eastlund at gmail.com Fri Oct 23 21:07:16 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Fri Oct 23 21:07:59 2009 Subject: [plt-scheme] getting planet documentation working right? In-Reply-To: References: Message-ID: <990e0c030910231807l623fda50l37324414930933dd@mail.gmail.com> On Fri, Oct 23, 2009 at 8:59 PM, Danny Yoo wrote: > Hi everyone, > > I'm trying to properly generate Scribble documentation for Moby, but > my links are mostly broken on PLaneT (full of red underlines): > > http://planet.plt-scheme.org/package-source/dyoo/moby.plt/2/1/planet-docs/manual/index.html > > > I am using Carl's PLaneT Scribbling library, which I hoped would solve > the issue. ?I'm still missing something. ?If I look at the > documentation locally, it looks fine to me. ?What else should I be > doing? Hmm. Assuming you are using my scribble stuff correctly [using @(require (for-label (this-package-in ))) and @(defmodule/this-package ) for each module you document], you should also make sure that when you run 'planet create', it is on the same directory you have development linked. Though if you didn't, I think my */this-package stuff would probably blow up. So I'm not 100% certain what's going on. Can you provide more info on your setup? The header of the .scrbl file (requires, defmodules, etc.), your development links, what directory you are running 'planet create' on, etc.? --Carl From acowley at gmail.com Fri Oct 23 21:17:36 2009 From: acowley at gmail.com (Anthony Cowley) Date: Fri Oct 23 21:18:04 2009 Subject: [plt-scheme] Re: How to write context-aware macros? In-Reply-To: References: <525455aa-098e-4ff1-8801-411f4dff9b2e@d9g2000prh.googlegroups.com> <756daca50910230743x22d67b42ubf1291d5a024ea73@mail.gmail.com> Message-ID: <9052A8E8-2553-4BC4-82CF-539FC7A2B00D@gmail.com> On Oct 23, 2009, at 7:53 PM, Simon Haines wrote: > Are there other > techniques that may be considered 'du jour' for programming against > encapsulated components, or am I still thinking too much in terms of > object orientation? I've written a couple articles on using Units for this type of thing at Units bring a great deal of abstraction power, but sometimes all the syntax can feel a bit clunky unless you work up some syntax that better matches the way you want to think about your program. Anthony From nadeem at acm.org Fri Oct 23 21:35:08 2009 From: nadeem at acm.org (Nadeem Abdul Hamid) Date: Fri Oct 23 21:35:29 2009 Subject: [plt-scheme] Need low-level help: blocking on reading from serial port in Windows In-Reply-To: <779bf2730910231452n50c7902en6e2bc7d80aef069f@mail.gmail.com> References: <3D331186-00CF-4B81-B8A7-92F40675A881@acm.org> <990e0c030910221531x2362674s8e716c5195ba08df@mail.gmail.com> <5d307820910231304k77dd35cj28b0d30170057974@mail.gmail.com> <4AE20D78.7040900@neilvandyke.org> <5d307820910231332g39efa3efsdf3c7534360e9102@mail.gmail.com> <779bf2730910231343s2b8b717bu1bd49960244e7182@mail.gmail.com> <5d307820910231351s1b318ecw5a4137f7f56a3028@mail.gmail.com> <779bf2730910231404l1b278530nf0e043fe3b0c74a3@mail.gmail.com> <5d307820910231430y7b42eaebt638c47712d2805d3@mail.gmail.com> <779bf2730910231452n50c7902en6e2bc7d80aef069f@mail.gmail.com> Message-ID: <5d307820910231835k5adec957l5813c5ad63298ad@mail.gmail.com> OK, so thanks to YC, here's an isolated version of the problem with a simulated port using make-pipe, along with tests... It still hangs for an unreasonable amount of time if there is any delay in data getting sent to the port, so it must be something wrong with the way I'm writing the raw-read function(s)? (I haven't tried this on OS X to see if it only happens on Windows or not.) Can anyone see what could be wrong?? I really appreciate it... ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; #lang scheme ;; raw-read : number input-port -> (listof byte) (define (raw-read-1 n in) ;(printf " raw-read") (local [(define bstr (make-bytes n)) ;; read-aux : number port -> number (define (read-aux start-pos tries) (cond [(>= start-pos n) start-pos] ; should never be > really [else (let [(r (read-bytes-avail!* bstr (sync/enable-break in) start-pos))] (cond [(number? r) (read-aux (+ r start-pos) 0)] [else (read-aux start-pos (add1 tries))] ))])) ] (read-aux 0 0) (bytes->list bstr) )) ;; raw-read : number input-port -> (listof byte) (define (raw-read-2 n in) ;(printf " raw-read") (local [(define bstr (make-bytes n)) ;; read-aux : number port -> number (define (read-aux start-pos tries) (when (= 0 (remainder tries 10000000)) (sleep 0)) ; (printf ".")) (cond [(>= start-pos n) start-pos] ; should never be > really [else (let [(r (read-bytes-avail!* bstr in start-pos))] (cond [(number? r) (read-aux (+ r start-pos) 0)] [else (read-aux start-pos (add1 tries))] ; ??? ))])) ] (read-aux 0 0) (bytes->list bstr) )) (define (timed-write-to-port o bytes-string interval) (thread (lambda () (let loop ((bytes (bytes->list bytes-string))) (unless (null? bytes) (write-byte (car bytes) o) (flush-output o) (sleep interval) (loop (cdr bytes))))))) (define (test-raw-read read-func bytes-string interval) (let-values ([(in out) (make-pipe)]) (timed-write-to-port out bytes-string interval) (read-func (bytes-length bytes-string) in))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Welcome to DrScheme, version 4.2.2 [3m]. Language: Module; memory limit: 128 megabytes. > (test-raw-read raw-read-1 #"abcdefg" 0) (97 98 99 100 101 102 103) > (test-raw-read raw-read-2 #"abcdefg" 0) (97 98 99 100 101 102 103) > (test-raw-read raw-read-1 #"abcdefg" 1) . . user break > The delay causes the code to "hang" for about 5 to 10 seconds before it the read comes through. An interval of 5 causes a much longer "hang". And as YC suggested, the CPU usage is max-ed out during that period... --- nadeem On Fri, Oct 23, 2009 at 5:52 PM, YC wrote: > > On Fri, Oct 23, 2009 at 2:30 PM, Nadeem Abdul Hamid wrote: >> >> That makes sense, but I would expect that using functions like "sync", >> for example, should not cause the cpu to max out, but rather suspend >> until there is data available on the port? Anyway, so do you mean I >> should try something like making a simulated pair of ports using >> "make-input/output-port" and see what happens? Thanks for the >> suggestions, > > Yes that is what I mean. > > I agree that using sync should avoid CPU max out issue, so I also suspect > that there might be some lower level device driver issues with the port > itself, but that couldn't be verified until you can isolate the problem, so > that's why I suggest simulating the ports. > > Here's a possible port simulation routine: > > (define (timed-write-to-port o bytes-string interval) > ? (thread (lambda () > ??????????? (let loop ((bytes (bytes->list bytes-string))) > ????????????? (unless (null? bytes) > ??????????????? (write-byte (car bytes) o) > ??????????????? (sleep interval) > ??????????????? (loop (cdr bytes))))))) > > You can then use make-pipe to create a pair of ports - then you pass the > output port to timed-write-to-port & input-port to your read routine.? If > that works your read-routine is likely safe and problems lie elsewhere. > > HTH. > yc > > From andrey.demidov at gmail.com Fri Oct 23 22:21:03 2009 From: andrey.demidov at gmail.com (DemAS) Date: Sat Oct 24 08:14:02 2009 Subject: [plt-scheme] string-upper-case Message-ID: <8f2bfbbd-44e2-4185-95ae-22e6dd4e92de@j19g2000vbp.googlegroups.com> Hi, all I'm just wondering how can I make my string upper-case? I have found the string-upper-case? function (http://docs.plt- scheme.org/htdp-langs/advanced-prim-ops.html#%28def._%28%28lib._lang/ htdp-advanced..ss%29._string-upper-case~3f%29%29), but it just tests the strings. Thanks in advance. From neil at neilvandyke.org Sat Oct 24 08:23:55 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Sat Oct 24 08:24:16 2009 Subject: [plt-scheme] string-upper-case In-Reply-To: <8f2bfbbd-44e2-4185-95ae-22e6dd4e92de@j19g2000vbp.googlegroups.com> References: <8f2bfbbd-44e2-4185-95ae-22e6dd4e92de@j19g2000vbp.googlegroups.com> Message-ID: <4AE2F1DB.9020102@neilvandyke.org> DemAS wrote at 10/23/2009 10:21 PM: > I'm just wondering how can I make my string upper-case "string-upcase" (This actually doesn't show up in the help search, if one searches for "upper". People *do* find "string-uppercase!" in "mzlib" with this search, which is unlikely to be what they want.) From laurent.orseau at gmail.com Sat Oct 24 10:40:29 2009 From: laurent.orseau at gmail.com (Laurent) Date: Sat Oct 24 10:41:13 2009 Subject: [plt-scheme] [ANN] Lazy Scribble Documentator and Packager Message-ID: Hi all, This is my first package: http://planet.plt-scheme.org/display.ss?package=lazy-doc.plt&owner=orseau It is supposed to automate a good part of the process of creating Scribble documentation and building packages. It parses source files to generate .scrbl files automatically containing @defprocs, @defparams and @defforms. Additional text and contracts can be easily added in-source, but it is different from the In-Source Scribble documenting, and hopefully simpler. It is clearly far from perfect though and I am myself quite new to Scribble and packages... so feedback is greatly appreciated. Hope this can be useful to some people. Laurent P.S. : apparently there is a non-blocking warning when installing the package that I hope to resolve soon. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091024/37ab74f2/attachment.htm From czhu at cs.utah.edu Sat Oct 24 10:55:53 2009 From: czhu at cs.utah.edu (Chongkai Zhu) Date: Sat Oct 24 10:56:17 2009 Subject: [plt-scheme] scheme_add_managed with FFI In-Reply-To: <4AE221C7.30805@cs.utah.edu> References: <4ACFE5EA.2030305@cs.utah.edu> <4ADF7872.4080806@cs.utah.edu> <20091023124526.C04436500B9@mail-svr1.cs.utah.edu> <4AE221C7.30805@cs.utah.edu> Message-ID: <4AE31579.6010106@cs.utah.edu> Chognkai Zhu wrote: > Many thanks. With some experiment, it seems the following works: > > #lang scheme > > (require scheme/foreign) > (unsafe!) > > (define add-managed > (get-ffi-obj "scheme_add_managed" #f > (_fun (_pointer = #f) _scheme (_fun #:keep (box null) > _scheme _pointer -> _void) > _pointer _bool -> _pointer))) > > (define (make-p) > (let ((p (malloc _pointer 'raw))) > (add-managed p (lambda (p _) (free p)) #f #f) > p)) > > (define p1 (make-p)) > (define p2 (make-p)) > > (ptr-ref p1 _int) > (ptr-ref p2 _int) > > (collect-garbage) > > But I didn't store the (lambda (p _) (free p)) or the box anywhere. Is > it really needed? > Never mind. I was reading the doc without thinking: 'make-p is holding the box from being collected. > Chongkai > From nadeem at acm.org Sat Oct 24 11:06:05 2009 From: nadeem at acm.org (Nadeem Abdul Hamid) Date: Sat Oct 24 11:06:25 2009 Subject: [plt-scheme] Need low-level help: blocking on reading from serial port in Windows In-Reply-To: <5d307820910231835k5adec957l5813c5ad63298ad@mail.gmail.com> References: <3D331186-00CF-4B81-B8A7-92F40675A881@acm.org> <5d307820910231304k77dd35cj28b0d30170057974@mail.gmail.com> <4AE20D78.7040900@neilvandyke.org> <5d307820910231332g39efa3efsdf3c7534360e9102@mail.gmail.com> <779bf2730910231343s2b8b717bu1bd49960244e7182@mail.gmail.com> <5d307820910231351s1b318ecw5a4137f7f56a3028@mail.gmail.com> <779bf2730910231404l1b278530nf0e043fe3b0c74a3@mail.gmail.com> <5d307820910231430y7b42eaebt638c47712d2805d3@mail.gmail.com> <779bf2730910231452n50c7902en6e2bc7d80aef069f@mail.gmail.com> <5d307820910231835k5adec957l5813c5ad63298ad@mail.gmail.com> Message-ID: <5d307820910240806ud9758b7i923bb1ff4a72e535@mail.gmail.com> On Fri, Oct 23, 2009 at 9:35 PM, Nadeem Abdul Hamid wrote: > > The delay causes the code to "hang" for about 5 to 10 seconds before > it the read comes through. An interval of 5 causes a much longer > "hang". And as YC suggested, the CPU usage is max-ed out during that > period... > Sorry, this was dumb. It delays exactly as expected. I've been working on this too long... From david.storrs at gmail.com Sat Oct 24 11:37:03 2009 From: david.storrs at gmail.com (David Storrs) Date: Sat Oct 24 11:37:23 2009 Subject: [plt-scheme] string-upper-case In-Reply-To: <4AE2F1DB.9020102@neilvandyke.org> References: <8f2bfbbd-44e2-4185-95ae-22e6dd4e92de@j19g2000vbp.googlegroups.com> <4AE2F1DB.9020102@neilvandyke.org> Message-ID: On Sat, Oct 24, 2009 at 8:23 AM, Neil Van Dyke wrote: > DemAS wrote at 10/23/2009 10:21 PM: >> >> ?I'm just wondering how can I make my string upper-case > > "string-upcase" > > (This actually doesn't show up in the help search, if one searches for > "upper". ?People *do* find "string-uppercase!" in "mzlib" with this search, > which is unlikely to be what they want.) I had a similar question recently. Are there string-lcfirst / string-ucfirst function? e.g.: (let ((lower "lowercase") (upper "UPPERCASE)) (display (string-lcfirst upper) (newline)) (display (string-ucfirst lower) (newline))) => prints: uPPercase Lowercase If not, they are easy enough to write via regex / string-append. --Dks From neil at neilvandyke.org Sat Oct 24 11:53:05 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Sat Oct 24 11:53:25 2009 Subject: [plt-scheme] string-upper-case In-Reply-To: References: <8f2bfbbd-44e2-4185-95ae-22e6dd4e92de@j19g2000vbp.googlegroups.com> <4AE2F1DB.9020102@neilvandyke.org> Message-ID: <4AE322E1.1010407@neilvandyke.org> > I had a similar question recently. Are there string-lcfirst / > I have often wondered why R5RS didn't have a procedure that accepts a string and returns a new string that is like the input one but with all the likely names of cats in it capitalized. R6RS dropped the ball on "string-catcap", but perhaps PLT will lead where others have been too small-minded or fearful to tread. From yinso.chen at gmail.com Sat Oct 24 14:58:17 2009 From: yinso.chen at gmail.com (YC) Date: Sat Oct 24 14:58:39 2009 Subject: [plt-scheme] Need low-level help: blocking on reading from serial port in Windows In-Reply-To: <5d307820910240806ud9758b7i923bb1ff4a72e535@mail.gmail.com> References: <3D331186-00CF-4B81-B8A7-92F40675A881@acm.org> <4AE20D78.7040900@neilvandyke.org> <5d307820910231332g39efa3efsdf3c7534360e9102@mail.gmail.com> <779bf2730910231343s2b8b717bu1bd49960244e7182@mail.gmail.com> <5d307820910231351s1b318ecw5a4137f7f56a3028@mail.gmail.com> <779bf2730910231404l1b278530nf0e043fe3b0c74a3@mail.gmail.com> <5d307820910231430y7b42eaebt638c47712d2805d3@mail.gmail.com> <779bf2730910231452n50c7902en6e2bc7d80aef069f@mail.gmail.com> <5d307820910231835k5adec957l5813c5ad63298ad@mail.gmail.com> <5d307820910240806ud9758b7i923bb1ff4a72e535@mail.gmail.com> Message-ID: <779bf2730910241158q6576d78dx156aebfefb887454@mail.gmail.com> On Sat, Oct 24, 2009 at 8:06 AM, Nadeem Abdul Hamid wrote: > On Fri, Oct 23, 2009 at 9:35 PM, Nadeem Abdul Hamid > wrote: > > > > The delay causes the code to "hang" for about 5 to 10 seconds before > > it the read comes through. An interval of 5 causes a much longer > > "hang". And as YC suggested, the CPU usage is max-ed out during that > > period... > > > > Sorry, this was dumb. It delays exactly as expected. I've been working > on this too long... > Nadeem - to reduce the CPU usage you can use sync or the blocking variety of the read-* functions, so that you are not melting your computer waiting for the bytes to come through. Looking at your function's logic it doesn't appear you need the non-blocking methods, and the logic appears very similar to read-bytes, but it returns a list of bytes instead of a byte-string. So something like the below should work: (define (read-bytes/list num in) (bytes->list (read-bytes num in))) read-bytes will hang unless it has captured enough bytes or encounter an EOF. If you need the function to return before encountering EOF but doesn't hang forever - you can use other mechanisms, such as installing a max timeout: (define (read-bytes/list/timeout num in timeout) (define (helper alarm acc count) (let ((evt (sync alarm in))) (if (eq? alarm evt) (reverse acc) (let ((b (read-byte in))) (cond ((eof-object? b) (if (null? acc) b (reverse acc))) ((= (add1 count) num) (reverse (cons b acc))) (else (helper alarm (cons b acc) (add1 count)))))))) (helper (alarm-evt (+ (current-inexact-milliseconds) (* 1000 timeout))) '() 0)) In any event, it's likely that the issue lies at the port level if your simulation that provides a deterministic flow of bytes works correctly even when the cpu is maxed out. You might have better luck to investigate the port to make sure the data is flowing through. HTH, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091024/ab2e4361/attachment.htm From eli at barzilay.org Sat Oct 24 16:05:51 2009 From: eli at barzilay.org (Eli Barzilay) Date: Sat Oct 24 16:06:14 2009 Subject: [plt-scheme] string-upper-case In-Reply-To: <4AE322E1.1010407@neilvandyke.org> References: <8f2bfbbd-44e2-4185-95ae-22e6dd4e92de@j19g2000vbp.googlegroups.com> <4AE2F1DB.9020102@neilvandyke.org> <4AE322E1.1010407@neilvandyke.org> Message-ID: <19171.24095.688421.383334@winooski.ccs.neu.edu> On Oct 24, Neil Van Dyke wrote: > > I had a similar question recently. Are there string-lcfirst / > > > > I have often wondered why R5RS didn't have a procedure that accepts > a string and returns a new string that is like the input one but > with all the likely names of cats in it capitalized. `string-titlecase' will do that. (Cat name likelihood proof left as an exercise.) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From scott at adrenaline.com Sat Oct 24 17:31:05 2009 From: scott at adrenaline.com (Scott McLoughlin) Date: Sat Oct 24 17:31:28 2009 Subject: [plt-scheme] Problem writing SML style enumerate vector constructor/initializer in typed-scheme Message-ID: <4AE37219.6020909@adrenaline.com> To paraphrase Sarah Silverman's comedy special, "Vectors are Magic." While cons cells can be allocated and initialized and chained together one at a time, vector memory must be (or should be) allocated as a block and then initialized in a nice tight loop. This creates some problems for typed code. Case in point, I'm trying to implement SML's style enumerate array constructor in typed-scheme. The code is a little messy as I've been trying different things, but I think the essential errors are apparent. *(define: (x) (enumerate [size : Integer] [init : (Integer -> x)]) : (Vectorof x) (let: ([v : (Vectorof x) (make-vector size)]) ; <<< big problem (for ([k (in-range size)]) <<< problem #2 I can't seem to grok (vector-set! v k (init k)))))* So the first obvious problem is that make-vector has no obvious default value of the type variable x. The second error is a little more obscure to me and relates to the for expression. Here is DrScheme's error message: *typecheck: untyped identifier in-range imported from module in: in-range typecheck: Expected (Vectorof x), but got Void in: fold-var* Scott -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091024/02d8885a/attachment.htm From carl.eastlund at gmail.com Sat Oct 24 17:36:20 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Sat Oct 24 17:37:01 2009 Subject: [plt-scheme] Problem writing SML style enumerate vector constructor/initializer in typed-scheme In-Reply-To: <4AE37219.6020909@adrenaline.com> References: <4AE37219.6020909@adrenaline.com> Message-ID: <990e0c030910241436j5552a27bk8101f9dd49082041@mail.gmail.com> Scott, It looks like you want build-vector rather than make-vector, for, and set!. http://docs.plt-scheme.org/reference/vectors.html#(def._((lib._scheme/base..ss)._build-vector)) --Carl On Sat, Oct 24, 2009 at 5:31 PM, Scott McLoughlin wrote: > To paraphrase Sarah Silverman's comedy special, "Vectors are Magic." > While cons cells can be allocated and initialized and chained together > one at a time, vector memory must be (or should be) allocated as a block > and then initialized in a nice tight loop.? This creates some problems for > typed code. > > Case in point, I'm trying to implement SML's style enumerate array > constructor in typed-scheme. > > The code is a little messy as I've been trying different things, > but I think the essential errors? are apparent. > > (define: (x) (enumerate [size : Integer] [init : (Integer -> x)]) : > (Vectorof x) > ? (let: ([v : (Vectorof x) (make-vector size)]) ; <<< big problem > ??? (for ([k (in-range size)])?? ?? ?? ?? ?? ?? ? <<< problem #2 I can't > seem to grok > ?????????? (vector-set! v k (init k))))) > > So the first obvious problem is that make-vector has no obvious > default value of the type variable x. > > The second error is a little more obscure to me and relates to the for > expression. > > Here is DrScheme's error message: > > typecheck: untyped identifier in-range imported from module in: > in-range > typecheck: Expected (Vectorof x), but got Void in: fold-var > > Scott From marek at xivilization.net Sat Oct 24 17:39:27 2009 From: marek at xivilization.net (Marek Kubica) Date: Sat Oct 24 17:39:53 2009 Subject: [plt-scheme] Drscheme icon In-Reply-To: <595b9ab20910230524ydafb7fdx7c902acd0aa156f1@mail.gmail.com> References: <595b9ab20910230524ydafb7fdx7c902acd0aa156f1@mail.gmail.com> Message-ID: <20091024233927.2eac1379@halmanfloyd.lan.local> Hi, On Fri, 23 Oct 2009 13:24:02 +0100 Stephen De Gabrielle wrote: > Does anyone have a svg drscheme icon that works for gnome? > (just installed 9.10 koala-ubuntu and am still motivated to keep it > pretty) Not a SVG, but this is what I use: (looks pretty good, even when scaled down for the launcher icon in the GNOME panel) regards, Marek From stephen.degabrielle at acm.org Sat Oct 24 20:27:19 2009 From: stephen.degabrielle at acm.org (Stephen De Gabrielle) Date: Sat Oct 24 20:27:42 2009 Subject: [plt-scheme] Re: Drscheme icon In-Reply-To: <20091024233927.2eac1379@halmanfloyd.lan.local> References: <595b9ab20910230524ydafb7fdx7c902acd0aa156f1@mail.gmail.com> <20091024233927.2eac1379@halmanfloyd.lan.local> Message-ID: <595b9ab20910241727u534be9d1ue42a492b32d2179c@mail.gmail.com> Thanks, it's nice to get the aesthetics right, after a catestrophic crash, it just makes you feel better. S. (must move to a DVCS!) On Saturday, October 24, 2009, Marek Kubica wrote: > Hi, > > On Fri, 23 Oct 2009 13:24:02 +0100 > Stephen De Gabrielle wrote: > >> Does anyone have a svg drscheme icon that works for gnome? >> (just installed 9.10 koala-ubuntu and am still motivated to keep it >> pretty) > > Not a SVG, but this is what I use: > > (looks pretty good, even when scaled down for the launcher icon in the > GNOME panel) > > regards, > Marek > -- -- Stephen De Gabrielle stephen.degabrielle@acm.org Telephone +44 (0)20 85670911 Mobile +44 (0)79 85189045 http://www.degabrielle.name/stephen From eli at barzilay.org Sat Oct 24 20:36:50 2009 From: eli at barzilay.org (Eli Barzilay) Date: Sat Oct 24 20:37:18 2009 Subject: [plt-scheme] Re: Drscheme icon In-Reply-To: <595b9ab20910241727u534be9d1ue42a492b32d2179c@mail.gmail.com> References: <595b9ab20910230524ydafb7fdx7c902acd0aa156f1@mail.gmail.com> <20091024233927.2eac1379@halmanfloyd.lan.local> <595b9ab20910241727u534be9d1ue42a492b32d2179c@mail.gmail.com> Message-ID: <19171.40354.809912.556891@winooski.ccs.neu.edu> Sorry, I meant to reply to this earlier... We have a big version of the logo, split into two pngs, one with the logo and one with the shadow. I've put them at http://tmp.barzilay.org/plt-logo-3d.png http://tmp.barzilay.org/plt-logo-shadow-3d.png I'm not sure whether it's possible to make a precise SVG version, since the logo is not using some simple gradients, it's a result of slapping the lambda logo on a 3d shield, and rendering it in povray. John Clements did that part. I do have two povray files, in case that's more helpful. On Oct 25, Stephen De Gabrielle wrote: > Thanks, > it's nice to get the aesthetics right, after a catestrophic crash, it > just makes you feel better. > > S. > (must move to a DVCS!) > > On Saturday, October 24, 2009, Marek Kubica wrote: > > Hi, > > > > On Fri, 23 Oct 2009 13:24:02 +0100 > > Stephen De Gabrielle wrote: > > > >> Does anyone have a svg drscheme icon that works for gnome? > >> (just installed 9.10 koala-ubuntu and am still motivated to keep it > >> pretty) > > > > Not a SVG, but this is what I use: > > > > (looks pretty good, even when scaled down for the launcher icon in the > > GNOME panel) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From toddobryan at gmail.com Sat Oct 24 22:11:47 2009 From: toddobryan at gmail.com (Todd O'Bryan) Date: Sat Oct 24 22:12:06 2009 Subject: [plt-scheme] OT: OpenLDAP with TLS/SSL Message-ID: <904774730910241911h2b6df459u963885ea20998b8b@mail.gmail.com> This is completely off-topic, but I'm desperate and this list is both very friendly and very knowledgeable. For the past several weeks, I've been trying to set up OpenLDAP with TLS/SSL support on the Ubuntu 9.04 server for my lab at school. Unfortunately, OpenLDAP likes OpenSSL and Debian/Ubuntu have compiled the package to work with GnuTLS. Most of the How-Tos are for OpenSSL and they fail just at the point where I try to add TLS support. Until I get some kind of centralized user database, I'm running my whole lab on one server, while the other two sit idly. I've googled like crazy, I put two of my better students on it (including one who placed second in Computer Science at ISEF last year) and they ended up screaming in frustration, and I'm now ready to throw money at the problem. If someone has successfully set up OpenLDAP with TLS/SSL support on a Debian/Ubuntu server and would like a $50 gift certificate to the online retailer of his/her choice to help me replicate it, please contact me off-list. If $50 isn't enough, make me an offer--I'm getting desperate. Todd From hendrik at topoi.pooq.com Sat Oct 24 22:29:59 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Sat Oct 24 22:30:31 2009 Subject: [plt-scheme] OT: OpenLDAP with TLS/SSL In-Reply-To: <904774730910241911h2b6df459u963885ea20998b8b@mail.gmail.com> References: <904774730910241911h2b6df459u963885ea20998b8b@mail.gmail.com> Message-ID: <20091025022959.GA11037@topoi.pooq.com> On Sat, Oct 24, 2009 at 10:11:47PM -0400, Todd O'Bryan wrote: > This is completely off-topic, but I'm desperate and this list is both > very friendly and very knowledgeable. > > For the past several weeks, I've been trying to set up OpenLDAP with > TLS/SSL support on the Ubuntu 9.04 server for my lab at school. > Unfortunately, OpenLDAP likes OpenSSL and Debian/Ubuntu have compiled > the package to work with GnuTLS. Most of the How-Tos are for OpenSSL > and they fail just at the point where I try to add TLS support. You might get better response by asking on the Ubuntu forums or the Debian-user mailing list: debian-user@lists.debian.org -- hendrik From geoff at knauth.org Sat Oct 24 22:44:41 2009 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Sat Oct 24 22:45:05 2009 Subject: [plt-scheme] a week of hard work can sometimes save you an hour of thought Message-ID: I was reading Stackoverflow Dev Days Toronto reviews, and this quote, attributed to Greg Wilson's father, made me think of HtDP: "A week of hard work can sometimes save you an hour of thought." http://meta.stackoverflow.com/questions/27151/devdays-reviews-toronto (seems like I've heard it before, though) From dyrueta at gmail.com Sat Oct 24 23:55:10 2009 From: dyrueta at gmail.com (David Yrueta) Date: Sat Oct 24 23:55:52 2009 Subject: [plt-scheme] HtDP phone-book teachpack Message-ID: <186df66b0910242055m4aada2c2p5791f71b234671c4@mail.gmail.com> Hi All -- HtDP exercise 35.4.2 requires the phone-book.ss teachpack, which is not available in Dr. Scheme's list of pre-installed teachpacks. Anyone have a copy? Thanks, Dave Yrueta -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091024/f7efd9da/attachment.htm From scott at adrenaline.com Sun Oct 25 00:09:33 2009 From: scott at adrenaline.com (Scott McLoughlin) Date: Sun Oct 25 00:10:03 2009 Subject: [plt-scheme] Problem writing SML style enumerate vector constructor/initializer in typed-scheme In-Reply-To: <990e0c030910241436j5552a27bk8101f9dd49082041@mail.gmail.com> References: <4AE37219.6020909@adrenaline.com> <990e0c030910241436j5552a27bk8101f9dd49082041@mail.gmail.com> Message-ID: <4AE3CF7D.306@adrenaline.com> That did it - thanks a million! build-vector is sort of an untyped "enumerate" function already built into Scheme (is it part of the R5RS or R6RS standards?). Pretty cool!!! Scott Carl Eastlund wrote: > Scott, > > It looks like you want build-vector rather than make-vector, for, and set!. > > http://docs.plt-scheme.org/reference/vectors.html#(def._((lib._scheme/base..ss)._build-vector)) > > --Carl > > On Sat, Oct 24, 2009 at 5:31 PM, Scott McLoughlin wrote: > >> To paraphrase Sarah Silverman's comedy special, "Vectors are Magic." >> While cons cells can be allocated and initialized and chained together >> one at a time, vector memory must be (or should be) allocated as a block >> and then initialized in a nice tight loop. This creates some problems for >> typed code. >> >> Case in point, I'm trying to implement SML's style enumerate array >> constructor in typed-scheme. >> >> The code is a little messy as I've been trying different things, >> but I think the essential errors are apparent. >> >> (define: (x) (enumerate [size : Integer] [init : (Integer -> x)]) : >> (Vectorof x) >> (let: ([v : (Vectorof x) (make-vector size)]) ; <<< big problem >> (for ([k (in-range size)]) <<< problem #2 I can't >> seem to grok >> (vector-set! v k (init k))))) >> >> So the first obvious problem is that make-vector has no obvious >> default value of the type variable x. >> >> The second error is a little more obscure to me and relates to the for >> expression. >> >> Here is DrScheme's error message: >> >> typecheck: untyped identifier in-range imported from module in: >> in-range >> typecheck: Expected (Vectorof x), but got Void in: fold-var >> >> Scott >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091025/5c30a4b5/attachment.htm From alex at schenkman.info Sun Oct 25 05:21:52 2009 From: alex at schenkman.info (Alex Schenkman) Date: Sun Oct 25 05:22:13 2009 Subject: [plt-scheme] Using scmutils (written in MIT-Scheme) Message-ID: <67c0a2ee0910250221s76fc1b30y991ca6eacc3eda82@mail.gmail.com> Hello list: I'm new to Scheme and I'm reading the MIT books: 1) Structure and Interpretation of computer programs 2) Structure and Interpretation of classical mechanics The second book uses a library (scmutils) written in MIT-Scheme. Can I run this library within PLT Scheme? If not, is it possible to port? How difficult would it be? Thanks in advance! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091025/ab270093/attachment.htm From czhu at cs.utah.edu Sun Oct 25 09:50:24 2009 From: czhu at cs.utah.edu (Chongkai Zhu) Date: Sun Oct 25 09:51:16 2009 Subject: [plt-scheme] Using scmutils (written in MIT-Scheme) In-Reply-To: <67c0a2ee0910250221s76fc1b30y991ca6eacc3eda82@mail.gmail.com> References: <67c0a2ee0910250221s76fc1b30y991ca6eacc3eda82@mail.gmail.com> Message-ID: <4AE457A0.7090501@cs.utah.edu> http://www.cs.brown.edu/pipermail/plt-scheme/2002-December/001450.html Alex Schenkman wrote: > Hello list: > > I'm new to Scheme and I'm reading the MIT books: > 1) Structure and Interpretation of computer programs > 2) Structure and Interpretation of classical mechanics > > The second book uses a library (scmutils) written in MIT-Scheme. > > Can I run this library within PLT Scheme? > If not, is it possible to port? How difficult would it be? > > Thanks in advance! > ------------------------------------------------------------------------ > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From d.j.gurnell at gmail.com Sun Oct 25 10:13:39 2009 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Sun Oct 25 10:14:05 2009 Subject: [plt-scheme] string-upper-case In-Reply-To: <19171.24095.688421.383334@winooski.ccs.neu.edu> References: <8f2bfbbd-44e2-4185-95ae-22e6dd4e92de@j19g2000vbp.googlegroups.com> <4AE2F1DB.9020102@neilvandyke.org> <4AE322E1.1010407@neilvandyke.org> <19171.24095.688421.383334@winooski.ccs.neu.edu> Message-ID: <22694C37-E474-4847-88B8-C348C9F1B486@gmail.com> Eli Barzilay wrote: > On Oct 24, Neil Van Dyke wrote: >> I have often wondered why R5RS didn't have a procedure that accepts >> a string and returns a new string that is like the input one but >> with all the likely names of cats in it capitalized. > > `string-titlecase' will do that. (Cat name likelihood proof left as > an exercise.) Point of note - string-titlecase does both the upping and the downing of case, which may be a good or a bad thing depending on what you're trying to achieve: (string-titlecase "Welcome to PLT!") ; => "Welcome To Plt!" For what it's worth there's a variant in unlib.plt called "string- titlecase*" that only does the upping part: (string-titlecase* "Welcome to PLT!") ; => "Welcome To PLT!" I've found this useful from time to time. Hope this helps, -- Dave From laurent.orseau at gmail.com Sun Oct 25 10:35:21 2009 From: laurent.orseau at gmail.com (Laurent) Date: Sun Oct 25 10:36:00 2009 Subject: [plt-scheme] Error when installing package : "unexpected value rendered" Message-ID: Hi all, During the process of installing my package (either from PLaneT or from local source), I get a strange error and I don't know what to do about it: unexpected value rendered: ~e ((font ((class "badlink")) (span ((class "indexlink")) (span ((class "ScmPn")) "(") (span ((class "ScmSym")) (span ((class "ScmStxLink")) "planet")) (span ((class "stt")) " ") (span ((class "ScmSym")) "orseau/lazy-doc:1:2") (span ((class "ScmPn")) ")")))) setup-plt: error: during Building docs for M:\Program Files\PLT\collects\scribblings\main\user\search.scrbl setup-plt: unexpected value rendered: ~e ((font ((class "badlink")) (span ((class "indexlink")) (span ((class "ScmPn")) "(") (span ((class "ScmSym")) (span ((class "ScmStxLink")) "planet")) (span ((class "stt")) " ") (span ((class "ScmSym")) "orseau/lazy-doc:1:2") (span ((class "ScmPn")) ")")))) It looks like there is bad link (which is strange because in the local doc all seems fine and there is "planet create" error or warning), but it also looks like the setup of documentation doesn't know how to render some malformed value, and I can't figure out what that can be. Appart from this, the package works fine once installed, but the browser documentation search page is all screwed up (I get a complete blank page in the browser). Some thoughts anyone? Thanks, Laurent -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091025/ec4801da/attachment.htm From david.storrs at gmail.com Sun Oct 25 12:06:18 2009 From: david.storrs at gmail.com (David Storrs) Date: Sun Oct 25 12:06:38 2009 Subject: [plt-scheme] string-upper-case In-Reply-To: <22694C37-E474-4847-88B8-C348C9F1B486@gmail.com> References: <8f2bfbbd-44e2-4185-95ae-22e6dd4e92de@j19g2000vbp.googlegroups.com> <4AE2F1DB.9020102@neilvandyke.org> <4AE322E1.1010407@neilvandyke.org> <19171.24095.688421.383334@winooski.ccs.neu.edu> <22694C37-E474-4847-88B8-C348C9F1B486@gmail.com> Message-ID: On Sun, Oct 25, 2009 at 10:13 AM, Dave Gurnell wrote: > > Eli Barzilay wrote: >> >> On Oct 24, Neil Van Dyke wrote: >>> >>> I have often wondered why R5RS didn't have a procedure that accepts >>> a string and returns a new string that is like the input one but >>> with all the likely names of cats in it capitalized. >> >> `string-titlecase' will do that. ?(Cat name likelihood proof left as an >> exercise.) > > > Point of note - string-titlecase does both the upping and the downing of > case, which may be a good or a bad thing depending on what you're trying to > achieve: > > ? ?(string-titlecase ?"Welcome to PLT!") ; => "Welcome To Plt!" > > For what it's worth there's a variant in unlib.plt called > "string-titlecase*" that only does the upping part: > > ? ?(string-titlecase* "Welcome to PLT!") ; => "Welcome To PLT!" > > I've found this useful from time to time. Thanks, Dave, that's an important point. In Perl-land I use the built-in ucfirst and lcfirst often enough that it's nice to know they already exist here as well. --Dks From matthias at ccs.neu.edu Sun Oct 25 13:13:59 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Sun Oct 25 13:14:36 2009 Subject: [plt-scheme] HtDP phone-book teachpack In-Reply-To: <186df66b0910242055m4aada2c2p5791f71b234671c4@mail.gmail.com> References: <186df66b0910242055m4aada2c2p5791f71b234671c4@mail.gmail.com> Message-ID: Ignore the exercise. -- Matthias On Oct 24, 2009, at 11:55 PM, David Yrueta wrote: > Hi All -- > > HtDP exercise 35.4.2 requires the phone-book.ss teachpack, which is > not available in Dr. Scheme's list of pre-installed teachpacks. > Anyone have a copy? > > Thanks, > Dave Yrueta > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From noelwelsh at gmail.com Sun Oct 25 16:14:30 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Sun Oct 25 16:14:49 2009 Subject: [plt-scheme] string-upper-case In-Reply-To: <4AE322E1.1010407@neilvandyke.org> References: <8f2bfbbd-44e2-4185-95ae-22e6dd4e92de@j19g2000vbp.googlegroups.com> <4AE2F1DB.9020102@neilvandyke.org> <4AE322E1.1010407@neilvandyke.org> Message-ID: IIRC there used to be a function in Unlib that tried to correctly capitalise names. E.g. "Van Dyke" vs "van Dyke". I see this as a step towards what you propose. Of course cats are more difficult than humans, having three names (of distinct classes) as Old Possum explains. So the question becomes which class do you capitalise? A vexing problem indeed. N. On Sat, Oct 24, 2009 at 3:53 PM, Neil Van Dyke wrote: > I have often wondered why R5RS didn't have a procedure that accepts a string > and returns a new string that is like the input one but with all the likely > names of cats in it capitalized. > > R6RS dropped the ball on "string-catcap", but perhaps PLT will lead where > others have been too small-minded or fearful to tread. From scott at adrenaline.com Sun Oct 25 16:18:14 2009 From: scott at adrenaline.com (Scott McLoughlin) Date: Sun Oct 25 16:18:45 2009 Subject: [plt-scheme] Unit testing with typed-scheme (test-engine/scheme-tests) Message-ID: <4AE4B286.9030008@adrenaline.com> Kind Schemely PLT Folk, So I'm finally trying to get all "instrumented" for getting my typed-scheme project really organized and off the ground and am having trouble with testing. ;;; Here is the short module that just defines my little typed ;;; vector enumerate function/constructor. (module typscm typed-scheme (require test-engine/scheme-tests) (provide enumerate) ;;; enumerate Vectorof constructor, sml style (define: (x) (enumerate [size : Integer] [init : (Integer -> x)]) : (Vectorof x) (build-vector size init)) ;(print (enumerate 3 (lambda: ([y : Integer]) (make-string y #\c)))) (check-expect (enumerate 3 (lambda: ([y : Integer]) (make-string y #\c))) #("" "c" "cc")) (test) ) And here is the error output - *VERY* sorry for the long error message, but it might help someone in the know here on the list help me figure things out. ||typecheck: Error in macro expansion -- Untyped definition : (test5117) in: (define-values (test5117) (let-values (((test-info) (#%app namespace-variable-value (quote test~object) (quote #f) builder (#%app current-namespace)))) (if test-info (begin (#%app insert-test test-info (lambda () (#%app check-values-expected (#%app car (#%app list (lambda () (#%app enumerate (quote 3) (lambda (y) (#%app make-string y (quote #\c))))) (#%app void))) (quote #("" "c" "cc")) (#%app list (quote #) (quote 15) (quote 2) (quote 377) (quote 97)) test-info)))) (#%app void)))) > Any and all help *most kindly* appreciated regarded automating the testing of typed-scheme code. Scott -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091025/7fcf596e/attachment.htm From d.j.gurnell at gmail.com Sun Oct 25 16:21:41 2009 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Sun Oct 25 16:22:03 2009 Subject: [plt-scheme] string-upper-case In-Reply-To: References: <8f2bfbbd-44e2-4185-95ae-22e6dd4e92de@j19g2000vbp.googlegroups.com> <4AE2F1DB.9020102@neilvandyke.org> <4AE322E1.1010407@neilvandyke.org> Message-ID: <82258FE1-606A-44A1-9273-1794C21ECFDD@gmail.com> We got rid of that - it contained all sorts of hard-coded corner cases and didn't seem like the sort of code we wanted people to rely on. A more configurable version might be a useful endeavour, although it could end up like Ruby on Rail's pluralize function with a massive array of special cases. -- Dave On 25 Oct 2009, at 20:14, Noel Welsh wrote: > IIRC there used to be a function in Unlib that tried to correctly > capitalise names. E.g. "Van Dyke" vs "van Dyke". I see this as a step > towards what you propose. Of course cats are more difficult than > humans, having three names (of distinct classes) as Old Possum > explains. So the question becomes which class do you capitalise? A > vexing problem indeed. > > N. From carl.eastlund at gmail.com Sun Oct 25 16:27:51 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Sun Oct 25 16:28:50 2009 Subject: [plt-scheme] Unit testing with typed-scheme (test-engine/scheme-tests) In-Reply-To: <4AE4B286.9030008@adrenaline.com> References: <4AE4B286.9030008@adrenaline.com> Message-ID: <990e0c030910251327p10871c86peb6dbf7d0a2990ee@mail.gmail.com> On Sun, Oct 25, 2009 at 4:18 PM, Scott McLoughlin wrote: > Kind Schemely PLT Folk, > > So I'm finally trying to get all "instrumented" for getting my > typed-scheme project really organized and off the ground and am > having trouble with testing. > > ;;; Here is the short module that just defines my little typed > ;;;?? vector enumerate function/constructor. > > (module typscm typed-scheme > ? (require test-engine/scheme-tests) > ? (provide enumerate) > > ? ;;; enumerate Vectorof constructor, sml style > ? (define: (x) (enumerate [size : Integer] [init : (Integer -> x)]) : > (Vectorof x) > ??? (build-vector size init)) > > ? ;(print (enumerate 3 (lambda: ([y : Integer]) (make-string y #\c)))) > > ? (check-expect > ?? (enumerate 3 (lambda: ([y : Integer]) (make-string y #\c))) > ?? #("" "c" "cc")) > > ??? (test) > ? ) > > And here is the error output - *VERY* sorry for the long error message, but > it > might help someone in the know here on the list help me figure things out. > > typecheck: Error in macro expansion -- Untyped definition : (test5117) in: > (define-values (test5117) (let-values (((test-info) (#%app > namespace-variable-value (quote test~object) (quote #f) builder (#%app > current-namespace)))) (if test-info (begin (#%app insert-test test-info > (lambda () (#%app check-values-expected (#%app car (#%app list (lambda () > (#%app enumerate (quote 3) (lambda (y) (#%app make-string y (quote #\c))))) > (#%app void))) (quote #("" "c" "cc")) (#%app list (quote # and Settings\scottmcl\My Documents\scottmcl\src\ss\ssutil\typscm.ss>) (quote > 15) (quote 2) (quote 377) (quote 97)) test-info)))) (#%app void)))) >> > > > Any and all help *most kindly* appreciated regarded automating the testing > of typed-scheme code. > > Scott Scott, I think the problem you have run into is that check-expect (and related forms like test) are not typed, and are not written in a way Typed Scheme can infer types for. The upshot being, I don't think you can use check-expect inside typed modules. The good news is, you can write a separate untyped module, require the typed binding of enumerate into it, and run check-expect on enumerate in the untyped setting. Something like this: [note that I did not run this, there may be typos] ;; save in "typscm.ss": (module typscm typed-scheme (provide enumerate) ;;; enumerate Vectorof constructor, sml style (define: (x) (enumerate [size : Integer] [init : (Integer -> x)]) : (Vectorof x) (build-vector size init)) ) ;; close typed module ;; save in "untyp.ss": (module untyp scheme (require test-engine/scheme-tests) (require "typscm.ss") ;(print (enumerate 3 (lambda (y) (make-string y #\c)))) (check-expect (enumerate 3 (lambda (y) (make-string y #\c))) #("" "c" "cc")) (test) ) ;; close untyped module Carl Eastlund From neil at neilvandyke.org Sun Oct 25 16:28:26 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Sun Oct 25 16:28:54 2009 Subject: [plt-scheme] string-upper-case In-Reply-To: References: <8f2bfbbd-44e2-4185-95ae-22e6dd4e92de@j19g2000vbp.googlegroups.com> <4AE2F1DB.9020102@neilvandyke.org> <4AE322E1.1010407@neilvandyke.org> Message-ID: <4AE4B4EA.70308@neilvandyke.org> Noel Welsh wrote at 10/25/2009 04:14 PM: > IIRC there used to be a function in Unlib that tried to correctly > capitalise names. E.g. "Van Dyke" vs "van Dyke". I see this as a step > towards what you propose. Of course cats are more difficult than > Except for that nation of crazy engineers who build their coastal cities below sea level, who complicate things by capitalizing their names wrong. "string-titlecase*" is indeed a step towards "string-catcap", in that applying it to a full formal cat address with title, such as "sir i am become death, DESTROYER of upholstery", preserves the crucial all-caps portion. -- http://www.neilvandyke.org/ From neil at neilvandyke.org Sun Oct 25 16:38:40 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Sun Oct 25 16:39:03 2009 Subject: [plt-scheme] string-upper-case In-Reply-To: <82258FE1-606A-44A1-9273-1794C21ECFDD@gmail.com> References: <8f2bfbbd-44e2-4185-95ae-22e6dd4e92de@j19g2000vbp.googlegroups.com> <4AE2F1DB.9020102@neilvandyke.org> <4AE322E1.1010407@neilvandyke.org> <82258FE1-606A-44A1-9273-1794C21ECFDD@gmail.com> Message-ID: <4AE4B750.2060703@neilvandyke.org> Dave Gurnell wrote at 10/25/2009 04:21 PM: > We got rid of that - it contained all sorts of hard-coded corner cases > and didn't seem like the sort of code we wanted people to rely on. I committed a related sin with my Soundex library, with hard-coded "prefix-guessing". In case of Soundex, I think it was OK, since the prefix-guessing is used only (I hope) to generate *supplemental* hashes, for increased recall. http://www.neilvandyke.org/soundex-scheme/ From keiko at kurims.kyoto-u.ac.jp Mon Oct 26 10:37:29 2009 From: keiko at kurims.kyoto-u.ac.jp (Keiko Nakata) Date: Mon Oct 26 10:37:51 2009 Subject: [plt-scheme] a png file in World Message-ID: <20091026.233729.68549299.keiko@kurims.kyoto-u.ac.jp> Hello, How can I make an image from a png file in World? I.e. I do not know how to use given png files for the plane or balloon except for copying and pasting them... Thanks, Keiko From matthias at ccs.neu.edu Mon Oct 26 10:57:18 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Mon Oct 26 10:57:53 2009 Subject: [plt-scheme] a png file in World In-Reply-To: <20091026.233729.68549299.keiko@kurims.kyoto-u.ac.jp> References: <20091026.233729.68549299.keiko@kurims.kyoto-u.ac.jp> Message-ID: On Oct 26, 2009, at 10:37 AM, Keiko Nakata wrote: > Hello, > > How can I make an image from a png file in World? > > I.e. I do not know how to use given png files for the plane or > balloon except > for copying and pasting them... I do not understand your question so I'll provide two answers: 1. The Universe teachpack supports an optional descriptive clause for world programs that allows you to record all events and create a series of PNG files from all interactions. It also creates an animated gif file. See http://docs.plt-scheme.org/teachpack/2htdpuniverse.html#(form._((lib._2htdp/ universe..ss)._record~3f)) 2. If you wish to use existing PNG files with a world program, you have two options: -- copy and paste the image from some other application (e.g., web browser) -- use the Insert | Image ... functionality from the drscheme menus In the future we will support programmatic inclusion of images from files. -- Matthias From ebellani at gmail.com Mon Oct 26 11:13:33 2009 From: ebellani at gmail.com (Eduardo Bellani) Date: Mon Oct 26 11:13:58 2009 Subject: [plt-scheme] Some suggestions on nice pedagogical code Message-ID: <184222e50910260813r762e3084iffd3da8f2f3e7b7d@mail.gmail.com> Hey there I'm looking for some low/mid level complexity open source code in scheme that would be fairly well written so I can point some people who want to look at some 'real' code in the wild. Anything would do, but it would be nice if the code kind of is a nice representation of a style, like "This part is mostly OO, with some AOP mixed in (or vice versa), that other is mostly functional, with continuations and blabla". Suggestions? -- Eduardo Bellani www.cnxs.com.br I object to doing things that computers can do. - Olin Shivers From keiko at kurims.kyoto-u.ac.jp Mon Oct 26 11:15:03 2009 From: keiko at kurims.kyoto-u.ac.jp (Keiko Nakata) Date: Mon Oct 26 11:16:35 2009 Subject: [plt-scheme] a png file in World In-Reply-To: References: <20091026.233729.68549299.keiko@kurims.kyoto-u.ac.jp> Message-ID: <20091027.001503.125111449.keiko@kurims.kyoto-u.ac.jp> I was looking for the Insert | Image functionality. Thanks, Keiko From: Matthias Felleisen Subject: Re: [plt-scheme] a png file in World Date: Mon, 26 Oct 2009 10:57:18 -0400 > > On Oct 26, 2009, at 10:37 AM, Keiko Nakata wrote: > > > Hello, > > > > How can I make an image from a png file in World? > > > > I.e. I do not know how to use given png files for the plane or > > balloon except > > for copying and pasting them... > > > I do not understand your question so I'll provide two answers: > > 1. The Universe teachpack supports an optional descriptive clause for > world programs that allows you to record all events and create a > series of PNG files from all interactions. It also creates an animated > gif file. See > > http://docs.plt-scheme.org/teachpack/2htdpuniverse.html#(form._((lib._2htdp/ > universe..ss)._record~3f)) > > 2. If you wish to use existing PNG files with a world program, you > have two options: > > -- copy and paste the image from some other application (e.g., web > browser) > -- use the Insert | Image ... functionality from the drscheme menus > > In the future we will support programmatic inclusion of images from > files. > > -- Matthias > From laurent.orseau at gmail.com Mon Oct 26 11:19:22 2009 From: laurent.orseau at gmail.com (Laurent) Date: Mon Oct 26 11:20:02 2009 Subject: [plt-scheme] Re: Error when installing package : "unexpected value rendered" In-Reply-To: References: Message-ID: On Sun, Oct 25, 2009 at 15:35, Laurent wrote: > Hi all, > > During the process of installing my package (either from PLaneT or from > local source), I get a strange error and I don't know what to do about it: > > unexpected value rendered: ~e ((font ((class "badlink")) (span ((class > "indexlink")) (span ((class "ScmPn")) "(") (span ((class "ScmSym")) (span > ((class "ScmStxLink")) "planet")) (span ((class "stt")) " ") (span ((class > "ScmSym")) "orseau/lazy-doc:1:2") (span ((class "ScmPn")) ")")))) > > setup-plt: error: during Building docs for M:\Program > Files\PLT\collects\scribblings\main\user\search.scrbl > > setup-plt: unexpected value rendered: ~e > ((font ((class "badlink")) (span ((class "indexlink")) (span ((class > "ScmPn")) "(") (span ((class "ScmSym")) (span ((class "ScmStxLink")) > "planet")) (span ((class "stt")) " ") (span ((class "ScmSym")) > "orseau/lazy-doc:1:2") (span ((class "ScmPn")) ")")))) > > It looks like there is bad link (which is strange because in the local doc > all seems fine and there is "planet create" error or warning), oops.. I meant: there is *no* "planet create" error or warning! > but it also looks like the setup of documentation doesn't know how to > render some malformed value, and I can't figure out what that can be. > > Appart from this, the package works fine once installed, but the browser > documentation search page is all screwed up (I get a complete blank page in > the browser). > > Some thoughts anyone? > > Thanks, > Laurent > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091026/0e50c9ee/attachment.htm From pbewig at gmail.com Mon Oct 26 11:17:12 2009 From: pbewig at gmail.com (Phil Bewig) Date: Mon Oct 26 11:25:15 2009 Subject: [plt-scheme] Some suggestions on nice pedagogical code In-Reply-To: <184222e50910260813r762e3084iffd3da8f2f3e7b7d@mail.gmail.com> References: <184222e50910260813r762e3084iffd3da8f2f3e7b7d@mail.gmail.com> Message-ID: You might enjoy the exercises at http://programmingpraxis.com, with suggested solutions in Scheme. Mostly functional, but not entirely. On Mon, Oct 26, 2009 at 10:13 AM, Eduardo Bellani wrote: > Hey there > > I'm looking for some low/mid level complexity open source code in scheme > that would be fairly well written so I can point some people who want to > look at some 'real' code in the wild. > > Anything would do, but it would be nice if the code kind of is a nice > representation > of a style, like "This part is mostly OO, with some AOP mixed in (or > vice versa), that other > is mostly functional, with continuations and blabla". > > Suggestions? > > -- > Eduardo Bellani > > www.cnxs.com.br > > I object to doing things that computers can do. > - Olin Shivers > _________________________________________________ > 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/20091026/b9f691dc/attachment.htm From matthias at ccs.neu.edu Mon Oct 26 13:07:47 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Mon Oct 26 13:08:17 2009 Subject: [plt-scheme] Some suggestions on nice pedagogical code In-Reply-To: <184222e50910260813r762e3084iffd3da8f2f3e7b7d@mail.gmail.com> References: <184222e50910260813r762e3084iffd3da8f2f3e7b7d@mail.gmail.com> Message-ID: I'd look at the games in the game collection of the plt distribution. On Oct 26, 2009, at 11:13 AM, Eduardo Bellani wrote: > Hey there > > I'm looking for some low/mid level complexity open source code in > scheme > that would be fairly well written so I can point some people who > want to > look at some 'real' code in the wild. > > Anything would do, but it would be nice if the code kind of is a nice > representation > of a style, like "This part is mostly OO, with some AOP mixed in (or > vice versa), that other > is mostly functional, with continuations and blabla". > > Suggestions? > > -- > Eduardo Bellani > > www.cnxs.com.br > > I object to doing things that computers can do. > - Olin Shivers > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From clements at brinckerhoff.org Mon Oct 26 13:11:13 2009 From: clements at brinckerhoff.org (John Clements) Date: Mon Oct 26 13:11:40 2009 Subject: [plt-scheme] Redex q. about using 'with' for parallel composition Message-ID: <5B01082C-9B11-45A8-84E6-05249A2E6FCA@brinckerhoff.org> I'd like to use redex to extend a small relation to parallel composition. That is: if a list contains a and b that reduce to a' and b', then I'd like to be able to extend this relation to blah ... a blah ... b blah ... reduces to blah ... blah ... blah ... a' b' (I'm just moving the a' and b' to the end for readability.) Put differently, I'd like a with clause like this: [(--> (sel-or-act_1 ... a sel-or-act_2 ... b sel-or-act_3 ...) (sel-or-act_1 ... sel-or-act_2 ... sel-or-act_3 ... c d)) (==> (a b) (c d))] Unfortunately, redex's 'with' won't let me do this, because it's unhappy about the shape of (==> (a b) (c d)). I also can't write it as (==> a b c d). Naturally, I can accomplish this differently by just not using the 'with' clause and expanding the individual reductions into the desired form. However, I thought I'd ask whether there's another easy way to accomplish 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/20091026/4b82b348/smime.bin From robby at eecs.northwestern.edu Mon Oct 26 13:13:37 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Mon Oct 26 13:19:54 2009 Subject: [plt-scheme] Redex q. about using 'with' for parallel composition In-Reply-To: <5B01082C-9B11-45A8-84E6-05249A2E6FCA@brinckerhoff.org> References: <5B01082C-9B11-45A8-84E6-05249A2E6FCA@brinckerhoff.org> Message-ID: <932b2f1f0910261013ye8a48dbt17b27191757def19@mail.gmail.com> Sorry, I (for one) don't see an easier way. This seems like it would be a good argument for multi-hole context support in Redex, but that's a pretty major change. Robby On Mon, Oct 26, 2009 at 12:11 PM, John Clements wrote: > I'd like to use redex to extend a small relation to parallel composition. > ?That is: if a list contains a and b that reduce to a' and b', then I'd like > to be able to extend this relation to > > blah ... a blah ... b blah ... > > reduces to > > blah ... blah ... blah ... a' b' > > (I'm just moving the a' and b' to the end for readability.) > > Put differently, I'd like a with clause like this: > > > [(--> (sel-or-act_1 ... a sel-or-act_2 ... b sel-or-act_3 ...) > ? ? ? ? (sel-or-act_1 ... sel-or-act_2 ... sel-or-act_3 ... c d)) > ? ?(==> (a b) (c d))] > > Unfortunately, redex's 'with' won't let me do this, because it's unhappy > about the shape of (==> (a b) (c d)). ?I also can't write it as (==> a b c > d). > > Naturally, I can accomplish this differently by just not using the 'with' > clause and expanding the individual reductions into the desired form. > ?However, I thought I'd ask whether there's another easy way to accomplish > this. > > John > > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From anton at appsolutions.com Mon Oct 26 13:11:38 2009 From: anton at appsolutions.com (Anton van Straaten) Date: Mon Oct 26 13:28:42 2009 Subject: [plt-scheme] string-upper-case In-Reply-To: <4AE4B4EA.70308@neilvandyke.org> References: <8f2bfbbd-44e2-4185-95ae-22e6dd4e92de@j19g2000vbp.googlegroups.com> <4AE2F1DB.9020102@neilvandyke.org> <4AE322E1.1010407@neilvandyke.org> <4AE4B4EA.70308@neilvandyke.org> Message-ID: <4AE5D84A.5050500@appsolutions.com> Neil Van Dyke wrote: > Noel Welsh wrote at 10/25/2009 04:14 PM: >> IIRC there used to be a function in Unlib that tried to correctly >> capitalise names. E.g. "Van Dyke" vs "van Dyke". I see this as a step >> towards what you propose. Of course cats are more difficult than >> > > Except for that nation of crazy engineers who build their coastal cities > below sea level, who complicate things by capitalizing their names wrong. Right. Capitalize their names right. From rafkind at cs.utah.edu Mon Oct 26 15:43:16 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Mon Oct 26 15:45:51 2009 Subject: [plt-scheme] define-syntax-alias Message-ID: <4AE5FBD4.1010205@cs.utah.edu> Would anyone else appreciate this function `define-syntax-alias' in the core? Maybe in syntax/stx or something. (require (for-syntax syntax/stx)) (define-syntax (define-syntax-alias stx) (syntax-case stx () [(_ a b) #'(define-syntax (a stx) #`(b #,@(stx-cdr stx)))])) (define-syntax (bar stx) (syntax-case stx () [(_ a b ...) #'a])) (define-syntax-alias foo bar) (foo 1 2 3 4) ==> 1 From robby at eecs.northwestern.edu Mon Oct 26 15:47:29 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Mon Oct 26 15:47:51 2009 Subject: [plt-scheme] define-syntax-alias In-Reply-To: <4AE5FBD4.1010205@cs.utah.edu> References: <4AE5FBD4.1010205@cs.utah.edu> Message-ID: <932b2f1f0910261247r1310989av13e5656bd6c66c6e@mail.gmail.com> How about using Check Syntax & rename instead? Seems like you'd end up with clearer code afterwards. Robby On Mon, Oct 26, 2009 at 2:43 PM, Jon Rafkind wrote: > Would anyone else appreciate this function `define-syntax-alias' in the > core? Maybe in syntax/stx or something. > > (require (for-syntax syntax/stx)) > (define-syntax (define-syntax-alias stx) > (syntax-case stx () > ?[(_ a b) > ? ?#'(define-syntax (a stx) > ? ? ? ? ?#`(b #,@(stx-cdr stx)))])) > > (define-syntax (bar stx) > ?(syntax-case stx () > ? [(_ a b ...) #'a])) > (define-syntax-alias foo bar) > (foo 1 2 3 4) > > ==> 1 > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From mflatt at cs.utah.edu Mon Oct 26 15:51:14 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Mon Oct 26 15:51:34 2009 Subject: [plt-scheme] define-syntax-alias In-Reply-To: <4AE5FBD4.1010205@cs.utah.edu> References: <4AE5FBD4.1010205@cs.utah.edu> Message-ID: <20091026195115.0D82265010D@mail-svr1.cs.utah.edu> You should instead use (define-syntax foo (make-rename-transformer #'bar)) which works in more cases. At Mon, 26 Oct 2009 13:43:16 -0600, Jon Rafkind wrote: > Would anyone else appreciate this function `define-syntax-alias' in the > core? Maybe in syntax/stx or something. > > (require (for-syntax syntax/stx)) > (define-syntax (define-syntax-alias stx) > (syntax-case stx () > [(_ a b) > #'(define-syntax (a stx) > #`(b #,@(stx-cdr stx)))])) > > (define-syntax (bar stx) > (syntax-case stx () > [(_ a b ...) #'a])) > (define-syntax-alias foo bar) > (foo 1 2 3 4) > > ==> 1 From scott at adrenaline.com Mon Oct 26 15:53:07 2009 From: scott at adrenaline.com (Scott McLoughlin) Date: Mon Oct 26 15:53:28 2009 Subject: [plt-scheme] typed-scheme and either PLT for -style iterations/comprehensions (or even typed-scheme friendly SRFI-42) Message-ID: <4AE5FE23.6040701@adrenaline.com> Just wondering if typed-scheme support is forthcoming for PLT iterations and comprehensions (or even SRFI-42 for that matter). Until using typed-scheme, I hadn't really realized how much I'd come to rely on iterations/comprehensions in day-to-day coding style (I can't imagine I'm the only one). Doing without has been a refresher course in "do" and named "let" expressions, but I'd love to have my beloved iterations and comprehensions back in a typed-scheme context. Mucho thanks, and *many mucho thanks* for all the work on typed-scheme. Scott From samth at ccs.neu.edu Mon Oct 26 16:22:44 2009 From: samth at ccs.neu.edu (Sam TH) Date: Mon Oct 26 16:23:04 2009 Subject: [plt-scheme] typed-scheme and either PLT for -style iterations/comprehensions (or even typed-scheme friendly SRFI-42) In-Reply-To: <4AE5FE23.6040701@adrenaline.com> References: <4AE5FE23.6040701@adrenaline.com> Message-ID: <63bb19ae0910261322h1c51212ei31971dadb444bf01@mail.gmail.com> On Mon, Oct 26, 2009 at 3:53 PM, Scott McLoughlin wrote: > Just wondering if typed-scheme support is forthcoming for PLT iterations > and comprehensions (or even SRFI-42 for that matter). Yes, I hope to do this soon. -- sam th samth@ccs.neu.edu From nvandyke at csail.mit.edu Mon Oct 26 21:59:08 2009 From: nvandyke at csail.mit.edu (Neil Van Dyke) Date: Mon Oct 26 22:00:02 2009 Subject: [plt-scheme] PLT Scheme saves the day Message-ID: <4AE653EC.30102@csail.mit.edu> PLT Scheme recently helped save a presentation at an ACM workshop. We needed a demonstration of our system that could be run on a two-laptop LAN during the presentation. Whether the existing Java server part of the system could be adapted rapidly enough for this purpose, or would even run well on a Windows laptop, was questionable. I'd never used the PLT Web Server before, but I found that I was able to use the stateful servlets to reimplement the pertinent functionality of the server much more quickly than I believe that the existing Java code could have been adapted. After we ran into some snags elsewhere, the time savings on the server seemed to make the difference between having a demo/video in time and having only slides. I have impressed this fact upon my colleagues, who mostly remember Scheme from SICP problem sets, and who were not aware what a nice R&D platform PLT Scheme now is. One of my colleagues was also impressed by how PLT has been able to get research products out and used in practice, contrasted with the not-uncommon situation of good systems research disappearing because it's not accessible. Now, if they'd only let me replace all this Java and C++ code, we'd finish the rest of the project in half the time. :) Neil Van Dyke Research Scientist MIT CSAIL From jay.mccarthy at gmail.com Mon Oct 26 22:09:59 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Mon Oct 26 22:10:21 2009 Subject: [plt-scheme] PLT Scheme saves the day In-Reply-To: <4AE653EC.30102@csail.mit.edu> References: <4AE653EC.30102@csail.mit.edu> Message-ID: Glad to hear it! On Mon, Oct 26, 2009 at 7:59 PM, Neil Van Dyke wrote: > PLT Scheme recently helped save a presentation at an ACM workshop. > > We needed a demonstration of our system that could be run on a two-laptop > LAN during the presentation. ?Whether the existing Java server part of the > system could be adapted rapidly enough for this purpose, or would even run > well on a Windows laptop, was questionable. ?I'd never used the PLT Web > Server before, but I found that I was able to use the stateful servlets to > reimplement the pertinent functionality of the server much more quickly than > I believe that the existing Java code could have been adapted. ?After we ran > into some snags elsewhere, the time savings on the server seemed to make the > difference between having a demo/video in time and having only slides. > > I have impressed this fact upon my colleagues, who mostly remember Scheme > from SICP problem sets, and who were not aware what a nice R&D platform PLT > Scheme now is. ?One of my colleagues was also impressed by how PLT has been > able to get research products out and used in practice, contrasted with the > not-uncommon situation of good systems research disappearing because it's > not accessible. > > Now, if they'd only let me replace all this Java and C++ code, we'd finish > the rest of the project in half the time. :) > > Neil Van Dyke > Research Scientist > MIT CSAIL > > _________________________________________________ > ?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 matthias at ccs.neu.edu Mon Oct 26 23:09:07 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Mon Oct 26 23:09:47 2009 Subject: [plt-scheme] PLT Scheme saves the day In-Reply-To: <4AE653EC.30102@csail.mit.edu> References: <4AE653EC.30102@csail.mit.edu> Message-ID: <6FA68527-52AC-43CA-8AF0-A70BD2CAC4B1@ccs.neu.edu> Yeap, MIT hires their own, and it shows :-) On Oct 26, 2009, at 9:59 PM, Neil Van Dyke wrote: > PLT Scheme recently helped save a presentation at an ACM workshop. > > We needed a demonstration of our system that could be run on a two- > laptop LAN during the presentation. Whether the existing Java > server part of the system could be adapted rapidly enough for this > purpose, or would even run well on a Windows laptop, was > questionable. I'd never used the PLT Web Server before, but I found > that I was able to use the stateful servlets to reimplement the > pertinent functionality of the server much more quickly than I > believe that the existing Java code could have been adapted. After > we ran into some snags elsewhere, the time savings on the server > seemed to make the difference between having a demo/video in time > and having only slides. > > I have impressed this fact upon my colleagues, who mostly remember > Scheme from SICP problem sets, and who were not aware what a nice > R&D platform PLT Scheme now is. One of my colleagues was also > impressed by how PLT has been able to get research products out and > used in practice, contrasted with the not-uncommon situation of good > systems research disappearing because it's not accessible. > > Now, if they'd only let me replace all this Java and C++ code, we'd > finish the rest of the project in half the time. :) > > Neil Van Dyke > Research Scientist > MIT CSAIL > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From scott at adrenaline.com Tue Oct 27 04:59:20 2009 From: scott at adrenaline.com (Scott McLoughlin) Date: Tue Oct 27 04:59:43 2009 Subject: [plt-scheme] Some PLT environment issues Message-ID: <4AE6B668.1080506@adrenaline.com> I'm fairly new to PLT, so I may be unaware of some features that i think are sorely lacking. As well, this is in part just a late night dump of an insomniac :-) 1) First, while Scribble is a very cool virtual troff/TeX replacement, it's just *WAY* too complicated for documenting code quickly during the process of code writing. A more appropriate tool, IMHO, would simply embed docs in comments (or some other s-expr, docstring format, etc.). It would impose some minor structure via section tags, such as date, author, function parameters (checked by the documentation processor of course), type information where appropriate(including types from a fully integrated typed-scheme) etc. The default doc processor should be a simple menu item that just generates HTML for a collection of source files, including hyper links where appropriate (who calls, struct use to struct definition, and so on). Ideally the docs would feature an index, search, etc. in the generated HTML docs. And sure, there may be some more involved doc generation options provided by DrScheme as well - options for printed docs, PDF output and what not. But aside from the basic "Update Docs" menu item. 2) Regarding the "collection of files" refered to above, DrScheme would benefit greatly from a simple default Project structure concept. A simple directory hierarchy of files, included libraries, perhaps sub projects, maybe sharing - pretty much standard fare for many IDE's that have been out there for years now. Regarding HTML doc generations, it's the project files (or a subdir or even sub project) that is the "collection of files" unit of HTML documentation. 3) Spawning the browser to view the docs is fine, but really, just as easy these days is providing an HTML tab for viewing the hyperlinked documentation. This avoids repeatedly switching between apps to compare source and documentation, especially if DrScheme would provide both horizontal and vertical window splitting as Emacs does. Ideally, the source editor would be modified to hyperlink source forms directly to their associated documentation, presumably by an unobtrusive right mouse button context menu item. Request for such a source item doc could easily verify the up-to-date status of the HTML docs and bring them back up to date as necessary (CPUs and Disks are blessedly fast these days). 4) Dr Scheme needs clean, simple revision control integration. I've been on quite an illness driven coding hiatus, but not too many years ago, emacs and cvs went together like rum and coke, and setting up a CVS server was only a little harder than falling off a log. Subversion seems the new CVS if I'm reading the lay of the tech land correctly, but ideally, DrScheme should support a family of the most popular version control systems. The source file tabs can then show the checkin and even remote modification status, display inline diffs, generate regular diffs and of course allow resolution of conflicts right within the editor and so forth. Basically, on any kind of multi-user project, or even a large single user project, including this type of revision control by default would be a MAJOR productivity enhancement. 5) Anyway, just some immediate off the cuff observations. I *REALLY DO* have the greatest admiration for the folks banging on DrScheme and the whole PLT technology suite, and I (reluctantly) understand that there are design priorities outside of building a commercial software development tool. I also want to say that the resulting technology to date is nothing short of amazing and is, so far, my development technology of choice for so many different and good reasons. So I hope my critiques are taken in the right spirit. Night all, Scott From laurent.orseau at gmail.com Tue Oct 27 05:52:06 2009 From: laurent.orseau at gmail.com (Laurent) Date: Tue Oct 27 05:52:50 2009 Subject: [plt-scheme] Some PLT environment issues In-Reply-To: <4AE6B668.1080506@adrenaline.com> References: <4AE6B668.1080506@adrenaline.com> Message-ID: Hi, Concerning the docs, I've just recently made such a tool to easily create documentation from comments : http://planet.plt-scheme.org/display.ss?package=lazy-doc.plt&owner=orseau You can check the docs online. However, there is one remaining bug that prevents the package from being correctly installed but nobody seems to be able to help me... (see the thread "Error when installing package : ...") So I do not recommend to install the package right now, as it would screw your local documentation (removing the package would safely reverse the process though). Apart from this, it should work fine and I think it would partly answer your first question. There is also in-line scribble documenting: http://docs.plt-scheme.org/scribble/srcdoc.html And I agree with you, something that gives information about a function more quickly than F1 and HTML in a browser would be great. Why not a function (help some-function) that renders docs in the interaction window ? Best regards, Laurent On Tue, Oct 27, 2009 at 09:59, Scott McLoughlin wrote: > I'm fairly new to PLT, so I may be unaware of some features that i > think are sorely lacking. As well, this is in part just a late night dump > of an insomniac :-) > > > 1) First, while Scribble is a very cool virtual troff/TeX replacement, > it's just *WAY* too complicated for documenting code quickly during the > process of code writing. A more appropriate tool, IMHO, would simply > embed docs in comments (or some other s-expr, docstring format, etc.). > It would impose some minor structure via section tags, such as date, > author, function parameters (checked by the documentation processor > of course), type information where appropriate(including types from > a fully integrated typed-scheme) etc. > > The default doc processor should be a simple menu item that just > generates HTML for a collection of source files, including hyper links > where appropriate (who calls, struct use to struct definition, and > so on). Ideally the docs would feature an index, search, etc. in > the generated HTML docs. > > And sure, there may be some more involved doc generation options > provided by DrScheme as well - options for printed docs, PDF output > and what not. But aside from the basic "Update Docs" menu item. > > 2) Regarding the "collection of files" refered to above, DrScheme > would benefit greatly from a simple default Project structure concept. > A simple directory hierarchy of files, included libraries, perhaps sub > projects, maybe sharing - pretty much standard fare for many IDE's that > have been out there for years now. Regarding HTML doc generations, it's > the project files (or a subdir or even sub project) that is the > "collection of files" unit of HTML documentation. > > 3) Spawning the browser to view the docs is fine, but really, just as > easy these days is providing an HTML tab for viewing the hyperlinked > documentation. This avoids repeatedly switching between apps to compare > source and documentation, especially if DrScheme would provide both > horizontal and vertical window splitting as Emacs does. Ideally, the > source editor would be modified to hyperlink source forms directly to their > associated documentation, presumably by an unobtrusive right mouse button > context menu item. Request for such a source item doc could easily > verify the up-to-date status of the HTML docs and bring them back up > to date as necessary (CPUs and Disks are blessedly fast these days). > > > 4) Dr Scheme needs clean, simple revision control integration. I've been > on quite an illness driven coding hiatus, but not too many years ago, emacs > and cvs went together like rum and coke, and setting up a CVS server was > only > a little harder than falling off a log. Subversion seems the new CVS if > I'm > reading the lay of the tech land correctly, but ideally, DrScheme should > support > a family of the most popular version control systems. The source file tabs > can > then show the checkin and even remote modification status, display inline > diffs, > generate regular diffs and of course allow resolution of conflicts right > within > the editor and so forth. Basically, on any kind of multi-user project, or > even > a large single user project, including this type of revision control by > default > would be a MAJOR productivity enhancement. > > 5) Anyway, just some immediate off the cuff observations. > > I *REALLY DO* have the greatest admiration for the folks banging on > DrScheme and > the whole PLT technology suite, and I (reluctantly) understand that there > are > design priorities outside of building a commercial software development > tool. > > I also want to say that the resulting technology to date is nothing short > of > amazing and is, so far, my development technology of choice for so many > different > and good reasons. > > So I hope my critiques are taken in the right spirit. > > Night all, > > Scott > > _________________________________________________ > 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/20091027/aae0f113/attachment-0001.htm From scott at adrenaline.com Tue Oct 27 07:36:15 2009 From: scott at adrenaline.com (Scott McLoughlin) Date: Tue Oct 27 07:36:38 2009 Subject: [plt-scheme] Yet another (I think) hopefully minor typed-scheme problem with Vectorof types Message-ID: <4AE6DB2F.6060409@adrenaline.com> So I want to copy a polymorphic vector, (Vectorof a). I first try something like (let ([vcopy (copy-vector vorig)]) ... and find that there is no such simple copy-vector function. Instead, we have the (otherwise very) useful function in scheme/base vector-copy! dest dest-start src [src-start src-end] -> void? Unfortunately, in typed scheme with a parametric Vectorof type, there is no necessary (make-vector size dflt), as a dflt element is not computable in the general case. Hence it is not possible to compute a "dest" argument at all for vector-copy! as written in scheme/base. Anyway, for now I totally cludged (apply vector (vector->list)) which at least type checked in typed-scheme, but it seems like an unecessary and expensive cludge. Much better would be the addition of a simple function: (define (a) (vector-copy [src : (Vectorof a)]) : (Vectorof a) Even *nicer* would be to add optional start/end arguments, allowing for the computation of subvectors that type check typed-scheme. (define (a) (vector-copy [src : (Vectorof a)] [start = 0] [end = -1]) : (Vectorof a) with the [end = -1] argument simply indexing backwards from the end of the vector. Hope that all "type checks" with the typed-scheme crowd. Scott From madesroches at gmail.com Tue Oct 27 09:24:25 2009 From: madesroches at gmail.com (Marc-Antoine Desroches) Date: Tue Oct 27 09:24:48 2009 Subject: [plt-scheme] namespace mismatch using eval in embedded interpreter Message-ID: <8dfe977f0910270624x6c698fffi333c3e6d652435ac@mail.gmail.com> Hello, I need a little help calling mzscheme's eval in a compiled executable. Here is the program in question : ;; test.scm #lang scheme (define (say-hello) (display "hello")) (define-namespace-anchor my-anchor) (define (main) (eval (read) (namespace-anchor->namespace my-anchor))) (provide main) I can use it like this : >mzscheme Welcome to MzScheme v4.2.2 [3m], Copyright (c) 2004-2009 PLT Scheme Inc. > (require (file "test.scm")) > (main) (say-hello) hello> ^Z The problem is I can't find the right incantation to compile test.scm. Here is what I tried : ;; compile-test.scm #lang scheme (require compiler/embed) (require setup/dirs) (create-embedding-executable "allo.exe" #:modules '( (#f "test.scm")) #:cmdline '("-e" "(main)") #:collects-path (find-collects-dir) ) But there must be something missing because I get : >mzscheme compile-test.scm >allo.exe require: namespace mismatch; reference (phase 0) to a module '#%embedded:g166:kw that is not available (phase level 0) in: #%app I also tried using mzc.exe with similar problems. Any help would be appreciated, thanks. -- Marc-Antoine Desroches http://www.vlam.ca http://foobrac.blogspot.com/ From grettke at acm.org Tue Oct 27 09:45:56 2009 From: grettke at acm.org (Grant Rettke) Date: Tue Oct 27 09:46:21 2009 Subject: [plt-scheme] Some PLT environment issues In-Reply-To: <4AE6B668.1080506@adrenaline.com> References: <4AE6B668.1080506@adrenaline.com> Message-ID: <756daca50910270645r40140091m89aa2b9cdcdbba41@mail.gmail.com> On Tue, Oct 27, 2009 at 3:59 AM, Scott McLoughlin wrote: > 2) Regarding the "collection of files" refered to above, DrScheme > would benefit greatly from a simple default Project structure concept. Stephen wrote this: http://planet.plt-scheme.org/package-source/spdegabrielle/projectmgr.plt/1/1/doc.txt From jensaxel at soegaard.net Tue Oct 27 09:58:51 2009 From: jensaxel at soegaard.net (=?UTF-8?Q?Jens_Axel_S=C3=B8gaard?=) Date: Tue Oct 27 10:05:45 2009 Subject: [plt-scheme] Some PLT environment issues In-Reply-To: <4AE6B668.1080506@adrenaline.com> References: <4AE6B668.1080506@adrenaline.com> Message-ID: <4072c51f0910270658v39660450j5f6e2e8d2f35d10f@mail.gmail.com> 2009/10/27 Scott McLoughlin : > 3) Spawning the browser to view the docs is fine, but really, just as > easy these days ?is providing an HTML tab for viewing the hyperlinked > documentation. The only complication here is, that PLT is a cross platform project, so it is a requirement that the browser component works on Windows, OS X and Linux. The last time we looked for a library to use, we couldn't find anything approriate, so it was decided to spawn a standard browser instead. -- Jens Axel S?gaard From scott at adrenaline.com Tue Oct 27 10:56:39 2009 From: scott at adrenaline.com (Scott McLoughlin) Date: Tue Oct 27 10:57:05 2009 Subject: [plt-scheme] Some PLT environment issues In-Reply-To: <4072c51f0910270658v39660450j5f6e2e8d2f35d10f@mail.gmail.com> References: <4AE6B668.1080506@adrenaline.com> <4072c51f0910270658v39660450j5f6e2e8d2f35d10f@mail.gmail.com> Message-ID: <4AE70A27.5090300@adrenaline.com> I may be mistaken, but I believe that wxWindows (used by PLT, yes?) already has both a very nice "rich text" control and a credible HTML rendering control, I'd presume more than good enough to render text, fonts, some color and the occasional JPG image. Hmmm, I think I even have an older version of the wxWindows demo program somewhere on my disk, so I might get around to checking today. IIRC, th wxWindows framework made it very easy to put nearly anything inside of a tab control. But again, the the devils in the details, I understand. Scott Jens Axel S?gaard wrote: > 2009/10/27 Scott McLoughlin : > > >> 3) Spawning the browser to view the docs is fine, but really, just as >> easy these days is providing an HTML tab for viewing the hyperlinked >> documentation. >> > > The only complication here is, that PLT is a cross platform project, > so it is a requirement that the browser component works on > Windows, OS X and Linux. The last time we looked for a library > to use, we couldn't find anything approriate, so it was decided > to spawn a standard browser instead. > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091027/ad5a50e9/attachment.htm From robby at eecs.northwestern.edu Tue Oct 27 11:03:35 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Tue Oct 27 11:04:20 2009 Subject: [plt-scheme] Some PLT environment issues In-Reply-To: <4AE70A27.5090300@adrenaline.com> References: <4AE6B668.1080506@adrenaline.com> <4072c51f0910270658v39660450j5f6e2e8d2f35d10f@mail.gmail.com> <4AE70A27.5090300@adrenaline.com> Message-ID: <932b2f1f0910270803h677b4968mddb6c033ab8207fd@mail.gmail.com> Not to be a killjoy, but the devil is in the details indeed. The wxWindows thing you mention (is a pretty infrequent) faq; I think that there are more careful in the list archives. The short version: no we can't take newer versions of wxWindows; we branched a long long time ago and integrating the changes is difficult (nearly impossible) for various technical reasons. As far as the other aspect of your comments, we did try implementing our own browser for rendering the documentation, but it was a lot of work and we could never keep up with people's complaints (and their comparison to their actual browsers). So we stopped doing that and life got much better. I seriously doubt we'd even consider going back. Of course (and this applies equally well to your other comments), please feel free to do any of that stuff and contribute it to the project. Our only source of funding is research funding (and, of course, the products of that is research), so if you had a few millions (or tens of millions) you wanted to throw at the problem, that would also help. Robby On Tue, Oct 27, 2009 at 9:56 AM, Scott McLoughlin wrote: > I may be mistaken, but I believe that wxWindows (used > by PLT, yes?) already has both a very nice "rich text" > control and a credible HTML rendering control, I'd > presume more than good enough to render text, fonts, > some color and the occasional JPG image.? Hmmm, I think > I even have an older version of the wxWindows demo > program somewhere on my disk, so I might get around > to checking today.? IIRC, th wxWindows framework > made it very easy to put nearly anything inside of a > tab control. But again, the the devils in the details, > I understand. > > Scott > > Jens Axel S?gaard wrote: > > 2009/10/27 Scott McLoughlin : > > > > 3) Spawning the browser to view the docs is fine, but really, just as > easy these days ?is providing an HTML tab for viewing the hyperlinked > documentation. > > > The only complication here is, that PLT is a cross platform project, > so it is a requirement that the browser component works on > Windows, OS X and Linux. The last time we looked for a library > to use, we couldn't find anything approriate, so it was decided > to spawn a standard browser instead. > > > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From scott at adrenaline.com Tue Oct 27 11:03:49 2009 From: scott at adrenaline.com (Scott McLoughlin) Date: Tue Oct 27 11:04:29 2009 Subject: [plt-scheme] Some PLT environment issues In-Reply-To: <756daca50910270645r40140091m89aa2b9cdcdbba41@mail.gmail.com> References: <4AE6B668.1080506@adrenaline.com> <756daca50910270645r40140091m89aa2b9cdcdbba41@mail.gmail.com> Message-ID: <4AE70BD5.1090804@adrenaline.com> Grant, First, I can see that there's potentially alot more to the job than I had initially anticipated. Second, quite a number of features could be deferred for now to get a core project concept operational within DrScheme (and presumably mzscheme, so ultimately a purely textual manifest and file organization at its core). Finally, without meaning any disrespect, I think the spec could use a good working over, fleshing out of quite a bit of detail and so on. In my day, frobbing lots of files and directories and file formats was something I was pretty good at (back in my C/C++ days), so this may be something I can help out with once I come up to speed with all of the myriad PLT environment issues. Thoughts? Scott Grant Rettke wrote: > On Tue, Oct 27, 2009 at 3:59 AM, Scott McLoughlin wrote: > >> 2) Regarding the "collection of files" refered to above, DrScheme >> would benefit greatly from a simple default Project structure concept. >> > > Stephen wrote this: > > http://planet.plt-scheme.org/package-source/spdegabrielle/projectmgr.plt/1/1/doc.txt > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091027/3c33eb97/attachment-0001.htm From spdegabrielle at gmail.com Tue Oct 27 11:00:00 2009 From: spdegabrielle at gmail.com (Stephen De Gabrielle) Date: Tue Oct 27 11:07:36 2009 Subject: [plt-scheme] Some PLT environment issues In-Reply-To: <756daca50910270645r40140091m89aa2b9cdcdbba41@mail.gmail.com> References: <4AE6B668.1080506@adrenaline.com> <756daca50910270645r40140091m89aa2b9cdcdbba41@mail.gmail.com> Message-ID: <595b9ab20910270800u405772che15b2f365cd3a088@mail.gmail.com> 4) I'm working on 1.2 at the moment. Adding packing planet archives for simple libraries, though if I can get orseau/lazy-doc and scribble/srcdoc to work I may drop my own hack-job. version 1.3 of project should be support for revision/version control systems. Initially subversion and maybe fossil-scm- as it gets me a bug/task-tracker for free(see next point) 2 )I'd like to address the issue of a 'collection of files', but at the moment saving and loading sets of tabs, assuming you use the *not-default[1] * tabs facility in DrScheme, is what (the mis-named) ProjectMgr does. I really like eclipse/mylyn , but its a lot of things and it would be nice if someone with more experience said 'just do x' where x is something minimal that meets a need. Note: The value(or lack of) of adding project/task support is questionable. The good thing about DrScheme is if you don't like it you can write a plugin and change it - just load it up onto Planet so others can use it too :-) (please don't take that the wrong way - I immediately 'starred' your email as good input for my little plugin ) 3) I've often thought a popup that just had the syntax for a object or method would be good, doing gui stuff gets pretty heavy on the browser calling f1 key - at least when I do it. Cheers, Stephen [1] I think tabs should be the default. users are used to them these days. (I might log a change request on the plt-scheme bug tracker to see what response I get) On Tue, Oct 27, 2009 at 1:45 PM, Grant Rettke wrote: > On Tue, Oct 27, 2009 at 3:59 AM, Scott McLoughlin wrote: >> 2) Regarding the "collection of files" refered to above, DrScheme >> would benefit greatly from a simple default Project structure concept. > > Stephen wrote this: > > http://planet.plt-scheme.org/package-source/spdegabrielle/projectmgr.plt/1/1/doc.txt > _________________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091027/61de6ca4/attachment.htm From scott at adrenaline.com Tue Oct 27 11:17:15 2009 From: scott at adrenaline.com (Scott McLoughlin) Date: Tue Oct 27 11:17:42 2009 Subject: [plt-scheme] Some PLT environment issues In-Reply-To: <932b2f1f0910270803h677b4968mddb6c033ab8207fd@mail.gmail.com> References: <4AE6B668.1080506@adrenaline.com> <4072c51f0910270658v39660450j5f6e2e8d2f35d10f@mail.gmail.com> <4AE70A27.5090300@adrenaline.com> <932b2f1f0910270803h677b4968mddb6c033ab8207fd@mail.gmail.com> Message-ID: <4AE70EFB.3000700@adrenaline.com> Pity about the wxWindows fork. It's really become a very nice and rich GUI toolkit. Scott Robby Findler wrote: > Not to be a killjoy, but the devil is in the details indeed. > > The wxWindows thing you mention (is a pretty infrequent) faq; I think > that there are more careful in the list archives. The short version: > no we can't take newer versions of wxWindows; we branched a long long > time ago and integrating the changes is difficult (nearly impossible) > for various technical reasons. > > As far as the other aspect of your comments, we did try implementing > our own browser for rendering the documentation, but it was a lot of > work and we could never keep up with people's complaints (and their > comparison to their actual browsers). So we stopped doing that and > life got much better. I seriously doubt we'd even consider going back. > > Of course (and this applies equally well to your other comments), > please feel free to do any of that stuff and contribute it to the > project. Our only source of funding is research funding (and, of > course, the products of that is research), so if you had a few > millions (or tens of millions) you wanted to throw at the problem, > that would also help. > > Robby > > On Tue, Oct 27, 2009 at 9:56 AM, Scott McLoughlin wrote: > >> I may be mistaken, but I believe that wxWindows (used >> by PLT, yes?) already has both a very nice "rich text" >> control and a credible HTML rendering control, I'd >> presume more than good enough to render text, fonts, >> some color and the occasional JPG image. Hmmm, I think >> I even have an older version of the wxWindows demo >> program somewhere on my disk, so I might get around >> to checking today. IIRC, th wxWindows framework >> made it very easy to put nearly anything inside of a >> tab control. But again, the the devils in the details, >> I understand. >> >> Scott >> >> Jens Axel S?gaard wrote: >> >> 2009/10/27 Scott McLoughlin : >> >> >> >> 3) Spawning the browser to view the docs is fine, but really, just as >> easy these days is providing an HTML tab for viewing the hyperlinked >> documentation. >> >> >> The only complication here is, that PLT is a cross platform project, >> so it is a requirement that the browser component works on >> Windows, OS X and Linux. The last time we looked for a library >> to use, we couldn't find anything approriate, so it was decided >> to spawn a standard browser instead. >> >> >> >> _________________________________________________ >> 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/20091027/d1d27950/attachment.htm From spdegabrielle at gmail.com Tue Oct 27 11:48:25 2009 From: spdegabrielle at gmail.com (Stephen De Gabrielle) Date: Tue Oct 27 11:48:49 2009 Subject: [plt-scheme] Some PLT environment issues In-Reply-To: <4AE70BD5.1090804@adrenaline.com> References: <4AE6B668.1080506@adrenaline.com> <756daca50910270645r40140091m89aa2b9cdcdbba41@mail.gmail.com> <4AE70BD5.1090804@adrenaline.com> Message-ID: <595b9ab20910270848h39ece250ia50b63489886d3d2@mail.gmail.com> Hi, If you feel like making *any* change to the spec, small or large, please feel free. - http://code.google.com/p/projects-project/ (I've added you as a user) (the offer is open to anyone who is interested in adding any project features to DrScheme) Cheers, Stephen PS What is 'frobbing' ? On Tue, Oct 27, 2009 at 3:03 PM, Scott McLoughlin wrote: > Grant, > > First, I can see that there's potentially alot more to the job than > I had initially anticipated. Second, quite a number of features could > be deferred for now to get a core project concept operational within > DrScheme (and presumably mzscheme, so ultimately a purely textual > manifest and file organization at its core). Finally, without meaning > any disrespect, I think the spec could use a good working over, fleshing > out of quite a bit of detail and so on. > > In my day, frobbing lots of files and directories and file formats was > something I was pretty good at (back in my C/C++ days), so this may be > something I can help out with once I come up to speed with all of the > myriad PLT environment issues. > > Thoughts? > > Scott > > Grant Rettke wrote: > > On Tue, Oct 27, 2009 at 3:59 AM, Scott McLoughlin wrote: > > > 2) Regarding the "collection of files" refered to above, DrScheme > would benefit greatly from a simple default Project structure concept. > > > Stephen wrote this: > http://planet.plt-scheme.org/package-source/spdegabrielle/projectmgr.plt/1/1/doc.txt > > > > > _________________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091027/e7069952/attachment.htm From neil at neilvandyke.org Tue Oct 27 11:50:05 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Tue Oct 27 11:50:54 2009 Subject: [plt-scheme] Some PLT environment issues In-Reply-To: <4AE70EFB.3000700@adrenaline.com> References: <4AE6B668.1080506@adrenaline.com> <4072c51f0910270658v39660450j5f6e2e8d2f35d10f@mail.gmail.com> <4AE70A27.5090300@adrenaline.com> <932b2f1f0910270803h677b4968mddb6c033ab8207fd@mail.gmail.com> <4AE70EFB.3000700@adrenaline.com> Message-ID: <4AE716AD.1090700@neilvandyke.org> Just a general caution, which probably isn't needed right now, but I think should be mentioned from time to time... To any new Scheme programmers who miss their Eclipse, I recommend using the system for a while, as it is, on real projects, before deciding that it needs to look like what they already know. A recurring theme in the Scheme universe is realizing that what initially seemed wrong is actually right. One example of this is all the people who spend their first few days desperately trying to format their code like Java, before (almost everyone) deciding that snuggled close-parens and the standard indent rules are actually the way to go. I don't know exactly what all changes would be appropriate for DrScheme, but I'm comfortable suggesting that simply mimicing the prevailing notion of "IDE" will make everyone dumber. (Data point: I spent the last 2 months using MS Visual Studio and/or Aptana Studio throughout the day, and the bit of work that I could do in DrScheme was a breath of fresh air.) -- http://www.neilvandyke.org/ From acowley at seas.upenn.edu Tue Oct 27 11:50:26 2009 From: acowley at seas.upenn.edu (Anthony Cowley) Date: Tue Oct 27 11:51:01 2009 Subject: [plt-scheme] Yet another (I think) hopefully minor typed-scheme problem with Vectorof types In-Reply-To: <4AE6DB2F.6060409@adrenaline.com> References: <4AE6DB2F.6060409@adrenaline.com> Message-ID: <81addec70910270850iba998deo8b02a94b0816990a@mail.gmail.com> Hi Scott, On Tue, Oct 27, 2009 at 7:36 AM, Scott McLoughlin wrote: > Much better would be the addition of a simple function: > > ? (define (a) (vector-copy [src : (Vectorof a)]) : (Vectorof a) You should be able to roll your own to meet your exact needs in this situation. The one tricky part would be if you wanted static bounds checking as well, which would require just a skosh of extra work ;) #lang typed-scheme (: vcopy (? (a) ((Vectorof a) -> (Vectorof a)))) (define (vcopy v) (build-vector (vector-length v) (?:([i : Number]) (vector-ref v i)))) Anthony From noelwelsh at gmail.com Tue Oct 27 12:10:26 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Tue Oct 27 12:10:46 2009 Subject: [plt-scheme] Re: Error when installing package : "unexpected value rendered" In-Reply-To: References: Message-ID: On Mon, Oct 26, 2009 at 3:19 PM, Laurent wrote: > > On Sun, Oct 25, 2009 at 15:35, Laurent wrote: >> >> Hi all, >> >> During the process of installing my package (either from PLaneT or from >> local source), I get a strange error and I don't know what to do about it: >> >> unexpected value rendered: ~e ((font ((class "badlink")) (span ((class >> "indexlink")) (span ((class "ScmPn")) "(") (span ((class "ScmSym")) (span >> ((class "ScmStxLink")) "planet")) (span ((class "stt")) " ") (span ((class >> "ScmSym")) "orseau/lazy-doc:1:2") (span ((class "ScmPn")) ")")))) >> These errors are caused by module paths in your docs. I don't know what is wrong with them, but that might help you fix the problem. I also suggest you fix the errors below in your local install, to make debugging a bit easier. There are (I think) two bugs in PLT. First is in scribblings/main/private/make-search.ss Line 127 [else (error "unexpected value rendered: ~e" e)] should not have the ~e (or should call format). The other is in scribble/html-render.ss Line 998 I think it should read `(a (font ([class "badlink"]) Near this line, change the when statement from (when #f to (when #t to get somewhat more useful debugging info. HTH, N. From chengchangwu at yahoo.com Tue Oct 27 13:43:39 2009 From: chengchangwu at yahoo.com (Cheng-Chang Wu) Date: Tue Oct 27 13:51:23 2009 Subject: [plt-scheme] Chinese Input method? Message-ID: <888956.70442.qm@web51406.mail.re2.yahoo.com> Hi,=0A=0AI'm using plt scheme under Debian Linux. I'd like to input chines= e characters into DrScheme's definition windows. For other editors I usuall= y press Ctrl-Space to show the chinese input window, but It doesn't work fo= r DrScheme.=0A=0AThe input method I'm using is SCIM. How can I solve this p= roblem?=0A=0ACheng-Chang Wu=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://mes= senger.yahoo.com.tw/ From clements at brinckerhoff.org Tue Oct 27 14:36:23 2009 From: clements at brinckerhoff.org (John Clements) Date: Tue Oct 27 14:36:48 2009 Subject: [plt-scheme] redex model of pi calculus? Message-ID: <589DB31C-5763-4811-8CCB-8B56B3948A40@brinckerhoff.org> I'm trying to model a pi-calculus-like system in redex, and running into a couple of issues that would be solved by any model for the pi calculus in redex. Before I try solving them all myself (parallel composition, lifting nu's) I thought I'd ask: are there existing models of the pi calculus written using redex? 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/20091027/da7ea3b3/smime.bin From jay.mccarthy at gmail.com Tue Oct 27 14:37:17 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Tue Oct 27 14:45:33 2009 Subject: [plt-scheme] [ANN] Super C --- Integrated Scheme and C programs Message-ID: I just realized a new, evil, package. http://planet.plt-scheme.org/display.ss?package=superc.plt&owner=jaymccarthy Here's a sample: #lang planet jaymccarthy/superc (define main (get-ffi-obj 'main this-lib (_fun -> _int))) (display (main)) @-------------------------------@ #include int main(void) { int x = 0; printf("hello, world\n"); scanf("%d", &x); printf("you typed: %d\n", x); return 1; } -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From clements at brinckerhoff.org Tue Oct 27 14:55:48 2009 From: clements at brinckerhoff.org (John Clements) Date: Tue Oct 27 14:56:16 2009 Subject: [plt-scheme] [ANN] Super C --- Integrated Scheme and C programs In-Reply-To: References: Message-ID: <8AAA3439-A51B-4C5F-AD0C-837B0EA706E9@brinckerhoff.org> On Oct 27, 2009, at 11:37 AM, Jay McCarthy wrote: > I just realized a new, evil, package. > > http://planet.plt-scheme.org/display.ss?package=superc.plt&owner=jaymccarthy > > Here's a sample: Can you used advanced scribblism to achieve syntactic abstraction (albeit non-hygienic) in the C code? 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/20091027/3293e24d/smime.bin From jay.mccarthy at gmail.com Tue Oct 27 14:57:34 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Tue Oct 27 14:57:58 2009 Subject: [plt-scheme] [ANN] Super C --- Integrated Scheme and C programs In-Reply-To: <8AAA3439-A51B-4C5F-AD0C-837B0EA706E9@brinckerhoff.org> References: <8AAA3439-A51B-4C5F-AD0C-837B0EA706E9@brinckerhoff.org> Message-ID: That's the next step :) Jay On Tue, Oct 27, 2009 at 12:55 PM, John Clements wrote: > > On Oct 27, 2009, at 11:37 AM, Jay McCarthy wrote: > >> I just realized a new, evil, package. >> >> >> http://planet.plt-scheme.org/display.ss?package=superc.plt&owner=jaymccarthy >> >> Here's a sample: > > Can you used advanced scribblism to achieve syntactic abstraction (albeit > non-hygienic) in the C code? > > John > > > -- 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 Tue Oct 27 15:03:02 2009 From: laurent.orseau at gmail.com (Laurent) Date: Tue Oct 27 15:03:47 2009 Subject: [plt-scheme] Re: Error when installing package : "unexpected value rendered" In-Reply-To: References: Message-ID: EUREKA! After hours of struggling, I finally found that my mistake was that my scrbl headers looked like : @(defmodule/this-package package) @title[#:tag "package"]{Package Utilities} whereas they should (must!) look like: @title[#:tag "package"]{Package Utilities} @(defmodule/this-package package) It seems the installer does not like defmodule/this-package after the title. Because of the tag? The package has been updated and uploaded and is now fully functional. Probably. Thanks for the help, Hope this package will save some time to some of you now, Laurent On Tue, Oct 27, 2009 at 17:10, Noel Welsh wrote: > On Mon, Oct 26, 2009 at 3:19 PM, Laurent wrote: > > > > On Sun, Oct 25, 2009 at 15:35, Laurent wrote: > >> > >> Hi all, > >> > >> During the process of installing my package (either from PLaneT or from > >> local source), I get a strange error and I don't know what to do about > it: > >> > >> unexpected value rendered: ~e ((font ((class "badlink")) (span ((class > >> "indexlink")) (span ((class "ScmPn")) "(") (span ((class "ScmSym")) > (span > >> ((class "ScmStxLink")) "planet")) (span ((class "stt")) " ") (span > ((class > >> "ScmSym")) "orseau/lazy-doc:1:2") (span ((class "ScmPn")) ")")))) > >> > > These errors are caused by module paths in your docs. I don't know > what is wrong with them, but that might help you fix the problem. I > also suggest you fix the errors below in your local install, to make > debugging a bit easier. > > There are (I think) two bugs in PLT. First is in > > scribblings/main/private/make-search.ss > > Line 127 > > [else (error "unexpected value rendered: ~e" e)] > > should not have the ~e (or should call format). > > > The other is in > > scribble/html-render.ss > > Line 998 > > I think it should read > > `(a (font ([class "badlink"]) > > Near this line, change the when statement from (when #f to (when #t to > get somewhat more useful debugging info. > > HTH, > N. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091027/37415db3/attachment-0001.htm From feeley at iro.umontreal.ca Tue Oct 27 15:42:51 2009 From: feeley at iro.umontreal.ca (Marc Feeley) Date: Tue Oct 27 15:43:38 2009 Subject: [plt-scheme] [ANN] Scheme Language Working Groups 1 and 2 draft charters Message-ID: <9630B3AE-B724-4FEB-A924-9D697911AABD@iro.umontreal.ca> [Apologies if you get duplicates of this message.] The Scheme Language Steering Committee is pleased to announce that Arthur Gleckler and John Cowan have agreed to chair working groups 1 and 2, respectively, pending acceptance of the charters for those working groups. The Steering Committee will select the members of those working groups following a call for volunteers. Those who volunteer to serve on a working group should: * be prepared to serve for the duration named in the group's charter * believe in the value of standardization * accept the goals and limitations of the working group's charter * support the goal of sharing Scheme code effectively * be able to work constructively toward compromise Details of the volunteering process will be provided later. New drafts of the charters proposed for working groups 1 and 2 are now online at http://www.scheme-reports.org/ . Comments on these two draft charters are solicited. If you want your comments to be seen only by the Scheme Language Steering Committee, send them to steering-committee-feedback@scheme-reports.org If you want your comments to be viewable by everyone, send them to scheme-reports@scheme-reports.org after signing up for that mailing list at http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports Will Clinger Marc Feeley Chris Hanson Jonathan Rees Olin Shivers From scott at adrenaline.com Tue Oct 27 19:30:18 2009 From: scott at adrenaline.com (Scott McLoughlin) Date: Tue Oct 27 19:30:58 2009 Subject: [plt-scheme] Some PLT environment issues In-Reply-To: <595b9ab20910270848h39ece250ia50b63489886d3d2@mail.gmail.com> References: <4AE6B668.1080506@adrenaline.com> <756daca50910270645r40140091m89aa2b9cdcdbba41@mail.gmail.com> <4AE70BD5.1090804@adrenaline.com> <595b9ab20910270848h39ece250ia50b63489886d3d2@mail.gmail.com> Message-ID: <4AE7828A.7040507@adrenaline.com> Most importantly, on "frob" "The term *Frob* has typically been used to refer to any small device or object (usually hand-sized) which can be manipulated, or /*frobbed*/. It was adopted by the community of computer programmers which grew out of the MIT Tech Model Railroad Club in the 1950s. /Frob/ is among the oldest existing words in hacker jargon, as reported in the Jargon File ." Second, regarding adding a "Project" entity to PLT that can be managed, it just seems logical/prudent to me to completely defer secondary UI issues. Instead, all the logic an functionality could be worked out for mzscheme via a relatively simple command line utility (or even a little scheme repl - whatever). The utility could just run emacs or vi or whatever when needed (preferably an editor that can scripts on startup, highlight lines on demand, etc.), run Lynx or Firefox or whatever when needed to view docs, run the subversion command line utility and so on and so forth. This allows for actually building the data structures, organizing them on disk, analyzing the project information and keeping track of *that* and so on and so forth. Any thoughts? Sound like a reasonable first step? Scott Stephen De Gabrielle wrote: > Hi, > > If you feel like making *any* change to the spec, small or large, > please feel free. > - http://code.google.com/p/projects-project/ (I've added you as a user) > > (the offer is open to anyone who is interested in adding any project > features to DrScheme) > > Cheers, > > Stephen > > PS What is 'frobbing' ? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091027/e83735be/attachment.htm From mflatt at cs.utah.edu Tue Oct 27 20:25:31 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Tue Oct 27 20:26:01 2009 Subject: [plt-scheme] Chinese Input method? In-Reply-To: <888956.70442.qm@web51406.mail.re2.yahoo.com> References: <888956.70442.qm@web51406.mail.re2.yahoo.com> Message-ID: <20091028002537.22AE86500FE@mail-svr1.cs.utah.edu> At Tue, 27 Oct 2009 10:43:39 -0700 (PDT), Cheng-Chang Wu wrote: > I'm using plt scheme under Debian Linux. I'd like to input chinese characters > into DrScheme's definition windows. For other editors I usually press > Ctrl-Space to show the chinese input window, but It doesn't work for DrScheme. > > The input method I'm using is SCIM. How can I solve this problem? I expect that the current GUI library isn't handling keyboard input correctly. We are the process of replacing the whole GUI layer, and I bet that using modern GUI libraries will fix the problem, but it's going to be a while before the new GUI binding is ready. From laurent.orseau at gmail.com Wed Oct 28 04:50:33 2009 From: laurent.orseau at gmail.com (Laurent) Date: Wed Oct 28 04:51:16 2009 Subject: [plt-scheme] Re: [ANN] Lazy Scribble Documentator and Packager In-Reply-To: References: Message-ID: Quick update: Now that works. On Sat, Oct 24, 2009 at 15:40, Laurent wrote: > Hi all, > > This is my first package: > http://planet.plt-scheme.org/display.ss?package=lazy-doc.plt&owner=orseau > > It is supposed to automate a good part of the process of creating Scribble > documentation and building packages. > It parses source files to generate .scrbl files automatically containing > @defprocs, @defparams and @defforms. > Additional text and contracts can be easily added in-source, but it is > different from the In-Source Scribble documenting, and hopefully simpler. > > It is clearly far from perfect though and I am myself quite new to Scribble > and packages... so feedback is greatly appreciated. > > Hope this can be useful to some people. > > Laurent > P.S. : apparently there is a non-blocking warning when installing the > package that I hope to resolve soon. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091028/a84271e4/attachment.htm From laurent.orseau at gmail.com Wed Oct 28 05:06:27 2009 From: laurent.orseau at gmail.com (Laurent) Date: Wed Oct 28 05:07:17 2009 Subject: [plt-scheme] Some PLT environment issues In-Reply-To: <4AE7828A.7040507@adrenaline.com> References: <4AE6B668.1080506@adrenaline.com> <756daca50910270645r40140091m89aa2b9cdcdbba41@mail.gmail.com> <4AE70BD5.1090804@adrenaline.com> <595b9ab20910270848h39ece250ia50b63489886d3d2@mail.gmail.com> <4AE7828A.7040507@adrenaline.com> Message-ID: I tend to think that everything should be accessible with commands/function calls. In this way, everything can be automatized and easily reused in different situations. A "help" function/macro as mentioned earlier would be very convenient (at least to me). For example: (help arg) -> (requires header quick-description) > (help remove-pkg) (planet/util) (remove-pkg owner pkg maj min) "Removes the package from the local repository" Contracts could be given too probably. The F1 help could/should also be coded with such function (doesn't it exist yet somewhere?): (help-open remove-pkg) opens the browser to the remove-pkg page. An "I'm feeling lucky" option should also be set by default. Side note: quote-require from cce/scheme returns the definition symbols provided by a given package, which can probably be useful in such context. Laurent On Wed, Oct 28, 2009 at 00:30, Scott McLoughlin wrote: > Most importantly, on "frob" > > "The term *Frob* has typically been used to refer to any small device or > object > (usually hand-sized) which can be manipulated, or *frobbed*. It was > adopted by > the community of computer programmers which grew out of the MIT Tech > > Model Railroad Clubin the 1950s. > *Frob* is among the oldest existing words in > hacker jargon, as > reported in the Jargon File ." > > Second, regarding adding a "Project" entity to PLT that can be managed, it > just > seems logical/prudent to me to completely defer secondary UI issues. > Instead, > all the logic an functionality could be worked out for mzscheme via a > relatively > simple command line utility (or even a little scheme repl - whatever). > > The utility could just run emacs or vi or whatever when needed (preferably > an > editor that can scripts on startup, highlight lines on demand, etc.), run > Lynx > or Firefox or whatever when needed to view docs, run the subversion command > line > utility and so on and so forth. > > This allows for actually building the data structures, organizing them on > disk, > analyzing the project information and keeping track of *that* and so on and > > so forth. > > Any thoughts? Sound like a reasonable first step? > > Scott > > > Stephen De Gabrielle wrote: > > Hi, > > If you feel like making *any* change to the spec, small or large, please > feel free. > - http://code.google.com/p/projects-project/ (I've added you as a user) > > (the offer is open to anyone who is interested in adding any project > features to DrScheme) > > Cheers, > > Stephen > > PS What is 'frobbing' ? > > > > _________________________________________________ > 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/20091028/2bef57a0/attachment-0001.htm From laurent.orseau at gmail.com Wed Oct 28 05:45:52 2009 From: laurent.orseau at gmail.com (Laurent) Date: Wed Oct 28 05:46:36 2009 Subject: [plt-scheme] Some PLT environment issues In-Reply-To: References: <4AE6B668.1080506@adrenaline.com> <756daca50910270645r40140091m89aa2b9cdcdbba41@mail.gmail.com> <4AE70BD5.1090804@adrenaline.com> <595b9ab20910270848h39ece250ia50b63489886d3d2@mail.gmail.com> <4AE7828A.7040507@adrenaline.com> Message-ID: In "guide/More_Libraries.html", there is a reference to a unknown function "plt-help": "Run plt-help to find documentation for libraries that are installed on your system and specific to your user account." Was it implemented then removed? Laurent On Wed, Oct 28, 2009 at 10:06, Laurent wrote: > I tend to think that everything should be accessible with commands/function > calls. > In this way, everything can be automatized and easily reused in different > situations. > > A "help" function/macro as mentioned earlier would be very convenient (at > least to me). > For example: > (help arg) -> (requires header quick-description) > > > (help remove-pkg) > (planet/util) > (remove-pkg owner pkg maj min) > "Removes the package from the local repository" > > Contracts could be given too probably. > > The F1 help could/should also be coded with such function (doesn't it exist > yet somewhere?): > (help-open remove-pkg) > opens the browser to the remove-pkg page. An "I'm feeling lucky" option > should also be set by default. > > Side note: quote-require from cce/scheme returns the definition symbols > provided by a given package, > which can probably be useful in such context. > > Laurent > > On Wed, Oct 28, 2009 at 00:30, Scott McLoughlin wrote: > >> Most importantly, on "frob" >> >> "The term *Frob* has typically been used to refer to any small device or >> object >> (usually hand-sized) which can be manipulated, or *frobbed*. It was >> adopted by >> the community of computer programmers which grew out of the MIT Tech >> >> Model Railroad Clubin the 1950s. >> *Frob* is among the oldest existing words in >> hacker jargon, as >> reported in the Jargon File ." >> >> >> Second, regarding adding a "Project" entity to PLT that can be managed, it >> just >> seems logical/prudent to me to completely defer secondary UI issues. >> Instead, >> all the logic an functionality could be worked out for mzscheme via a >> relatively >> simple command line utility (or even a little scheme repl - whatever). >> >> The utility could just run emacs or vi or whatever when needed (preferably >> an >> editor that can scripts on startup, highlight lines on demand, etc.), run >> Lynx >> or Firefox or whatever when needed to view docs, run the subversion >> command line >> utility and so on and so forth. >> >> This allows for actually building the data structures, organizing them on >> disk, >> analyzing the project information and keeping track of *that* and so on >> and >> so forth. >> >> Any thoughts? Sound like a reasonable first step? >> >> Scott >> >> >> Stephen De Gabrielle wrote: >> >> Hi, >> >> If you feel like making *any* change to the spec, small or large, please >> feel free. >> - http://code.google.com/p/projects-project/ (I've added you as a user) >> >> (the offer is open to anyone who is interested in adding any project >> features to DrScheme) >> >> Cheers, >> >> Stephen >> >> PS What is 'frobbing' ? >> >> >> >> _________________________________________________ >> 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/20091028/a5580c20/attachment.htm From noelwelsh at gmail.com Wed Oct 28 05:54:28 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Wed Oct 28 05:54:48 2009 Subject: [plt-scheme] Some PLT environment issues In-Reply-To: References: <4AE6B668.1080506@adrenaline.com> <756daca50910270645r40140091m89aa2b9cdcdbba41@mail.gmail.com> <4AE70BD5.1090804@adrenaline.com> <595b9ab20910270848h39ece250ia50b63489886d3d2@mail.gmail.com> <4AE7828A.7040507@adrenaline.com> Message-ID: It's a command line application. Ultimately there is no magic -- it all resolves to a function calls somewhere. Whether these functions are conveniently packaged and documented is another matter. N. On Wed, Oct 28, 2009 at 9:45 AM, Laurent wrote: > In "guide/More_Libraries.html", there is a reference to a unknown function > "plt-help": > "Run plt-help to find documentation for libraries that are installed on your > system and specific to your user account." > > Was it implemented then removed? > > Laurent From eli at barzilay.org Wed Oct 28 06:10:25 2009 From: eli at barzilay.org (Eli Barzilay) Date: Wed Oct 28 06:10:48 2009 Subject: [plt-scheme] Some PLT environment issues In-Reply-To: References: <4AE6B668.1080506@adrenaline.com> <756daca50910270645r40140091m89aa2b9cdcdbba41@mail.gmail.com> <4AE70BD5.1090804@adrenaline.com> <595b9ab20910270848h39ece250ia50b63489886d3d2@mail.gmail.com> <4AE7828A.7040507@adrenaline.com> Message-ID: <19176.6289.416765.424496@winooski.ccs.neu.edu> On Oct 28, Noel Welsh wrote: > It's a command line application. > > Ultimately there is no magic -- it all resolves to a function calls > somewhere. Whether these functions are conveniently packaged and > documented is another matter. The "function" in this case is available in mzscheme as the `help' macro. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From laurent.orseau at gmail.com Wed Oct 28 06:35:03 2009 From: laurent.orseau at gmail.com (Laurent) Date: Wed Oct 28 06:35:49 2009 Subject: [plt-scheme] Some PLT environment issues In-Reply-To: <19176.6289.416765.424496@winooski.ccs.neu.edu> References: <4AE6B668.1080506@adrenaline.com> <756daca50910270645r40140091m89aa2b9cdcdbba41@mail.gmail.com> <4AE70BD5.1090804@adrenaline.com> <595b9ab20910270848h39ece250ia50b63489886d3d2@mail.gmail.com> <4AE7828A.7040507@adrenaline.com> <19176.6289.416765.424496@winooski.ccs.neu.edu> Message-ID: Indeed. I just found that there is help macro in scheme/help which launches the browser on a given id or string. Now that would be great if it could return (some) information as values, like the package or the .ss file. I'll look into that. On Wed, Oct 28, 2009 at 11:10, Eli Barzilay wrote: > On Oct 28, Noel Welsh wrote: > > It's a command line application. > > > > Ultimately there is no magic -- it all resolves to a function calls > > somewhere. Whether these functions are conveniently packaged and > > documented is another matter. > > The "function" in this case is available in mzscheme as the `help' > macro. > > -- > ((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/20091028/ea033a40/attachment.htm From mflatt at cs.utah.edu Wed Oct 28 06:59:08 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Wed Oct 28 06:59:43 2009 Subject: [plt-scheme] Some PLT environment issues In-Reply-To: References: <4AE6B668.1080506@adrenaline.com> <756daca50910270645r40140091m89aa2b9cdcdbba41@mail.gmail.com> <4AE70BD5.1090804@adrenaline.com> <595b9ab20910270848h39ece250ia50b63489886d3d2@mail.gmail.com> <4AE7828A.7040507@adrenaline.com> <19176.6289.416765.424496@winooski.ccs.neu.edu> Message-ID: <20091028105913.0C44065015A@mail-svr1.cs.utah.edu> See `scribble/xref' and `setup/xref' (both documented). At Wed, 28 Oct 2009 11:35:03 +0100, Laurent wrote: > Indeed. I just found that there is help macro in scheme/help which launches > the browser on a given id or string. > Now that would be great if it could return (some) information as values, > like the package or the .ss file. > I'll look into that. > > On Wed, Oct 28, 2009 at 11:10, Eli Barzilay wrote: > > > On Oct 28, Noel Welsh wrote: > > > It's a command line application. > > > > > > Ultimately there is no magic -- it all resolves to a function calls > > > somewhere. Whether these functions are conveniently packaged and > > > documented is another matter. > > > > The "function" in this case is available in mzscheme as the `help' > > macro. > > > > -- > > ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: > > http://barzilay.org/ Maze is Life! > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From eli at barzilay.org Wed Oct 28 07:05:57 2009 From: eli at barzilay.org (Eli Barzilay) Date: Wed Oct 28 07:06:23 2009 Subject: [plt-scheme] Some PLT environment issues In-Reply-To: <20091028105913.0C44065015A@mail-svr1.cs.utah.edu> References: <4AE6B668.1080506@adrenaline.com> <756daca50910270645r40140091m89aa2b9cdcdbba41@mail.gmail.com> <4AE70BD5.1090804@adrenaline.com> <595b9ab20910270848h39ece250ia50b63489886d3d2@mail.gmail.com> <4AE7828A.7040507@adrenaline.com> <19176.6289.416765.424496@winooski.ccs.neu.edu> <20091028105913.0C44065015A@mail-svr1.cs.utah.edu> Message-ID: <19176.9621.12757.301682@winooski.ccs.neu.edu> At Wed, 28 Oct 2009 11:35:03 +0100, Laurent wrote: > Indeed. I just found that there is help macro in scheme/help which > launches the browser on a given id or string. Yes, that's what I was talking about. > Now that would be great if it could return (some) information as > values, like the package or the .ss file. I'll look into that. On Oct 28, Matthew Flatt wrote: > See `scribble/xref' and `setup/xref' (both documented). A good place to see how to use these is the implementation of that macro. (Note that it must be a macro.) You can also look in my interactive hack for related useful functionality. For example: -> ,apropos flatt ; (no pun intended, I swear!) Matches: flatten. -> ,describe flatten `flatten' is a bound identifier, defined in "scheme/list.ss" required through "scheme/init.ss" -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From m.douglas.williams at gmail.com Wed Oct 28 11:44:29 2009 From: m.douglas.williams at gmail.com (Doug Williams) Date: Wed Oct 28 11:44:57 2009 Subject: [plt-scheme] Numeric Comparison Contracts Message-ID: I have a question about numeric comparisons (inequality operators) in contracts.I'm not sure if it's a documentation bug or an implementation bug, but /c, <=/c, and >=/c (and between/c and possibly others) specifies a number? argument. Unfortunately, they actually error (as opposed to giving a contract violation) when given a complex number. [The actual inequality operators require real numbers.] So, you actually need to write (and/c real? (<=/c 0.0)), for example, to guard the <=/c contract. It seems that the inequality operators should require (and enforce) a real number as its argument. Doug -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091028/d12d9c87/attachment.htm From robby at eecs.northwestern.edu Wed Oct 28 12:04:49 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Wed Oct 28 12:05:10 2009 Subject: [plt-scheme] Numeric Comparison Contracts In-Reply-To: References: Message-ID: <932b2f1f0910280904k6b8724a3o41aefcb821e59f0@mail.gmail.com> Thanks. That's fixed now (in SVN). Robby On Wed, Oct 28, 2009 at 10:44 AM, Doug Williams wrote: > I have a question about numeric comparisons (inequality operators) in > contracts.I'm not sure if it's a documentation bug or an implementation bug, > but /c, <=/c, and >=/c (and between/c > and possibly others) specifies a number? argument. Unfortunately, they > actually error (as opposed to giving a contract violation) when given a > complex number. [The actual inequality operators require real numbers.] So, > you actually need to write (and/c real? (<=/c 0.0)), for example, to guard > the <=/c contract. It seems that the inequality operators should require > (and enforce) a real number as its argument. > > Doug > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From rafkind at cs.utah.edu Wed Oct 28 12:44:03 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Wed Oct 28 12:46:45 2009 Subject: [plt-scheme] Re: [ANN] Lazy Scribble Documentator and Packager In-Reply-To: References: Message-ID: <4AE874D3.5050507@cs.utah.edu> I just tried this out but it broke. Maybe I did something wrong? I was working with a pre-existing file called 'tool.ss'. > (require (planet orseau/lazy-doc)) > (planet-build) . (file "/home/jon/.plt-scheme/planet/300/4.2.2.4/cache/orseau/lazy-doc.plt/1/4/package.ss") broke the contract (-> string? string? natural-number/c natural-number/c path? void?) on add-hard-link; expected , given: #f > Laurent wrote: > Quick update: Now that works. > > On Sat, Oct 24, 2009 at 15:40, Laurent wrote: > > >> Hi all, >> >> This is my first package: >> http://planet.plt-scheme.org/display.ss?package=lazy-doc.plt&owner=orseau >> >> It is supposed to automate a good part of the process of creating Scribble >> documentation and building packages. >> It parses source files to generate .scrbl files automatically containing >> @defprocs, @defparams and @defforms. >> Additional text and contracts can be easily added in-source, but it is >> different from the In-Source Scribble documenting, and hopefully simpler. >> >> It is clearly far from perfect though and I am myself quite new to Scribble >> and packages... so feedback is greatly appreciated. >> >> Hope this can be useful to some people. >> >> Laurent >> P.S. : apparently there is a non-blocking warning when installing the >> package that I hope to resolve soon. >> >> > > > ------------------------------------------------------------------------ > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From laurent.orseau at gmail.com Wed Oct 28 13:37:07 2009 From: laurent.orseau at gmail.com (Laurent) Date: Wed Oct 28 13:37:50 2009 Subject: [plt-scheme] Re: [ANN] Lazy Scribble Documentator and Packager In-Reply-To: <4AE874D3.5050507@cs.utah.edu> References: <4AE874D3.5050507@cs.utah.edu> Message-ID: try : (planet-build "jon" 1 0) or use (set-planet-env "jon" 1 0) beforehand to modify the default parameters. By default, the username is that of the OS environment (or maybe that value is windows-specific, I should check that). If there is none, I guess that could fail. Maybe I should use another default value. Tell me if that works. Laurent On Wed, Oct 28, 2009 at 17:44, Jon Rafkind wrote: > I just tried this out but it broke. Maybe I did something wrong? I was > working with a pre-existing file called 'tool.ss'. > > > > (require (planet orseau/lazy-doc)) > > (planet-build) > . (file "/home/jon/.plt-scheme/planet/300/ > 4.2.2.4/cache/orseau/lazy-doc.plt/1/4/package.ss") broke the contract > (-> > string? > string? > natural-number/c > natural-number/c > path? > void?) > on add-hard-link; expected , given: #f > > > > > Laurent wrote: > >> Quick update: Now that works. >> >> On Sat, Oct 24, 2009 at 15:40, Laurent wrote: >> >> >> >>> Hi all, >>> >>> This is my first package: >>> http://planet.plt-scheme.org/display.ss?package=lazy-doc.plt&owner=orseau >>> >>> It is supposed to automate a good part of the process of creating >>> Scribble >>> documentation and building packages. >>> It parses source files to generate .scrbl files automatically containing >>> @defprocs, @defparams and @defforms. >>> Additional text and contracts can be easily added in-source, but it is >>> different from the In-Source Scribble documenting, and hopefully simpler. >>> >>> It is clearly far from perfect though and I am myself quite new to >>> Scribble >>> and packages... so feedback is greatly appreciated. >>> >>> Hope this can be useful to some people. >>> >>> Laurent >>> P.S. : apparently there is a non-blocking warning when installing the >>> package that I hope to resolve soon. >>> >>> >>> >> >> ------------------------------------------------------------------------ >> >> _________________________________________________ >> 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/20091028/1044a913/attachment.htm From laurent.orseau at gmail.com Wed Oct 28 13:39:48 2009 From: laurent.orseau at gmail.com (Laurent) Date: Wed Oct 28 13:40:31 2009 Subject: [plt-scheme] Re: [ANN] Lazy Scribble Documentator and Packager In-Reply-To: References: <4AE874D3.5050507@cs.utah.edu> Message-ID: As said in the doc, it also supposes that current-directory is set to the current package directory. On Wed, Oct 28, 2009 at 18:37, Laurent wrote: > try : > (planet-build "jon" 1 0) > > or use (set-planet-env "jon" 1 0) beforehand to modify the default > parameters. > > By default, the username is that of the OS environment (or maybe that value > is windows-specific, I should check that). If there is none, I guess that > could fail. > Maybe I should use another default value. > > Tell me if that works. > Laurent > > > > On Wed, Oct 28, 2009 at 17:44, Jon Rafkind wrote: > >> I just tried this out but it broke. Maybe I did something wrong? I was >> working with a pre-existing file called 'tool.ss'. >> >> >> > (require (planet orseau/lazy-doc)) >> > (planet-build) >> . (file "/home/jon/.plt-scheme/planet/300/ >> 4.2.2.4/cache/orseau/lazy-doc.plt/1/4/package.ss") broke the contract >> (-> >> string? >> string? >> natural-number/c >> natural-number/c >> path? >> void?) >> on add-hard-link; expected , given: #f >> > >> >> >> Laurent wrote: >> >>> Quick update: Now that works. >>> >>> On Sat, Oct 24, 2009 at 15:40, Laurent wrote: >>> >>> >>> >>>> Hi all, >>>> >>>> This is my first package: >>>> >>>> http://planet.plt-scheme.org/display.ss?package=lazy-doc.plt&owner=orseau >>>> >>>> It is supposed to automate a good part of the process of creating >>>> Scribble >>>> documentation and building packages. >>>> It parses source files to generate .scrbl files automatically containing >>>> @defprocs, @defparams and @defforms. >>>> Additional text and contracts can be easily added in-source, but it is >>>> different from the In-Source Scribble documenting, and hopefully >>>> simpler. >>>> >>>> It is clearly far from perfect though and I am myself quite new to >>>> Scribble >>>> and packages... so feedback is greatly appreciated. >>>> >>>> Hope this can be useful to some people. >>>> >>>> Laurent >>>> P.S. : apparently there is a non-blocking warning when installing the >>>> package that I hope to resolve soon. >>>> >>>> >>>> >>> >>> ------------------------------------------------------------------------ >>> >>> _________________________________________________ >>> 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/20091028/ab2fab8a/attachment.htm From czhu at cs.utah.edu Wed Oct 28 13:48:49 2009 From: czhu at cs.utah.edu (Chognkai Zhu) Date: Wed Oct 28 13:49:11 2009 Subject: [plt-scheme] scheme_add_managed with FFI In-Reply-To: <20091023124526.C04436500B9@mail-svr1.cs.utah.edu> References: <4ACFE5EA.2030305@cs.utah.edu> <4ADF7872.4080806@cs.utah.edu> <20091023124526.C04436500B9@mail-svr1.cs.utah.edu> Message-ID: <4AE88401.5040006@cs.utah.edu> I still think there is a bug for that: #lang scheme (require scheme/foreign (only-in '#%foreign ffi-callback)) (unsafe!) (provide make-p) (define callback (ffi-callback (lambda (p _) (free p)) (list _scheme _pointer) _void)) (define add-managed (get-ffi-obj "scheme_add_managed" #f (_fun (_pointer = #f) _scheme _fpointer (_pointer = #f) _bool -> _pointer))) (define (make-p) (let ((p (malloc _pointer 'raw))) (add-managed p callback #t) p)) First I'm using ffi-callback from '#%foreign to make the callback, cause I can't figure out another way to do it so that only one C callback will be build. But the doc says "The '#%foreign module is not intended for direct use". Second even though the callback is kept in a module top level variable, it can/might be GCed when/before the custodian is shutdown, as demonstrated by the attached file. Chongkai Matthew Flatt wrote: > Thanks for the concrete example in PR 10538. > > The key feature of that example is that a single Scheme function is > registered as a callback twice. The default handling of callbacks is > that only the most recently generated foreign callback is retained with > the Scheme function used as a callback. So, the second call to > scheme_add_managed with the same function allows the foreign callback > generated by the first call to be GCed. > > The simplest solution is to provides a boxed empty list for `#:keep' in > the callback type: > > (_fun #:keep (box null) _scheme _pointer -> _void) > > > -------------- next part -------------- H4sIAAAAAAAAA4VU227UMBB9j7T/YLJC6yClW4kiUCUuH8ADD7whFE2S8dbUsV3bWUoR/85M bpvSrfDDXubM7ZwZ+8vnr5k00NUtCBnwrseYhAJt+oCFkA1EFLNZSgsdWfMWO5cTKnvrobnF QL/vepdQdA+xuUFyYpTjdMC4oFLKfPbg+KvLy4IPAY2zyugmrZ2nOqODN6kMaCDpI34sxDbN xhvX4SNEMZKo4ZLhVoc4GdEQGTmTo5MRAU28dOddSKIDbcvGGYPUR+khoB3iiVVvEzBLvGdP +jGZxNHp9mzLGQVmMp/T5bNqmdIGzwD05ZqL2ITakNPrq3fZq60BexBk0nVtcN+B7cFssk+z sCcIjwyI5YwS7yPYtnb3xSajqKSTwd+sy5/hP95D5w3Gb9trDheSCNN4Ewb9wFSm4NL1yfdJ 7GIK2h6KdZnzZ4nEEFz4N/58AtnBLZbcRw/JBfIeGdS8f9vreZP+X5zOTrKge2ZaPC43VvHF 983zU9BWuYsYaQZvTyPA1Ps9IwnqTUb5lbaL/MQqUlG5GqCQ466Qlh0tEZhi6OTZotzrWPTq zWrwLAHPajXwQRXlAuqDXVGTzppfpbZit305oUIpXTZgTE1XlKvTskdQ+GJYB+mDO+qWbuwo yWCbeM1BnF+us4jlpfCiIoYqIArP19Noeh+qsT1Readt4lehGq5HcUoNbVvSHsMB2yH7AVPJ FVz9Q+RjeEU+1eST08V9MnNZqd7S51RFvB9u91JczfYnHrVzRpQfTv0Vj2jLRQrig/zcebYZ 45olROwC/Jy3Sq7YCL/Ixm/TgJMyfwEY4gNhXwUAAA== From rafkind at cs.utah.edu Wed Oct 28 14:23:39 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Wed Oct 28 14:26:18 2009 Subject: [plt-scheme] Re: [ANN] Lazy Scribble Documentator and Packager In-Reply-To: References: <4AE874D3.5050507@cs.utah.edu> Message-ID: <4AE88C2B.2080105@cs.utah.edu> Laurent wrote: > try : > (planet-build "jon" 1 0) > > or use (set-planet-env "jon" 1 0) beforehand to modify the default > parameters. > > By default, the username is that of the OS environment (or maybe that value > is windows-specific, I should check that). If there is none, I guess that > could fail. > Maybe I should use another default value. > > Tell me if that works. > > Ok that worked. I got a bit farther but it died when trying to make the planet package. System: /home/jon/svn/scheme/vi/planet create /home/jon/svn/scheme/vi /bin/sh: /home/jon/svn/scheme/vi/planet: not found #f I guess it tried to search for the 'planet' executable and defaulted to the current directory? Maybe its better to invoke planet programmatically using its API? Also I checked the .scrbl files in the reference/ directory and they look ok, but they have ^M (as seen in vi) characters at the end of lines which is a windows-ism for leaving in carriage return (char 13). But thats not a huge deal. From jmj at fellowhuman.com Wed Oct 28 14:27:06 2009 From: jmj at fellowhuman.com (Jordan Johnson) Date: Wed Oct 28 14:27:41 2009 Subject: [plt-scheme] Window resize in world programs Message-ID: <52CB1151-E88B-4FB7-982F-B19948E2EA70@fellowhuman.com> All, A question from my class: is there any way to resize the window in a world program? Example situation: ;; world = Nat ;; world -> scene (define (show w) (nw:rectangle w w 'solid 'red)) (big-bang 50 (on-tick add1 .6) (on-draw show)) Best, Jordan From carl.eastlund at gmail.com Wed Oct 28 14:33:30 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Wed Oct 28 14:34:13 2009 Subject: [plt-scheme] Window resize in world programs In-Reply-To: <52CB1151-E88B-4FB7-982F-B19948E2EA70@fellowhuman.com> References: <52CB1151-E88B-4FB7-982F-B19948E2EA70@fellowhuman.com> Message-ID: <990e0c030910281133v53df66fbm1fb7a2d1d0442e22@mail.gmail.com> On Wed, Oct 28, 2009 at 2:27 PM, Jordan Johnson wrote: > All, > > A question from my class: is there any way to resize the window in a world > program? ?Example situation: > > ;; world = Nat > > ;; world -> scene > (define (show w) > ?(nw:rectangle w w 'solid 'red)) > > (big-bang 50 (on-tick add1 .6) (on-draw show)) Try: (big-bang 50 (on-tick add1 .6) (on-draw show 300 400)) The extra arguments to on-draw specify a width and height. See online documentation at: http://docs.plt-scheme.org/teachpack/2htdpuniverse.html#(form._((lib._2htdp/universe..ss)._big-bang)) --Carl From jmj at fellowhuman.com Wed Oct 28 14:51:34 2009 From: jmj at fellowhuman.com (Jordan Johnson) Date: Wed Oct 28 14:52:10 2009 Subject: [plt-scheme] Window resize in world programs In-Reply-To: <990e0c030910281133v53df66fbm1fb7a2d1d0442e22@mail.gmail.com> References: <52CB1151-E88B-4FB7-982F-B19948E2EA70@fellowhuman.com> <990e0c030910281133v53df66fbm1fb7a2d1d0442e22@mail.gmail.com> Message-ID: <192D6665-4074-46A8-83B3-C188B5BFE3E0@fellowhuman.com> Hi Carl, Yep, I'm aware of the option of adding those arguments; the question was more specifically about resizing the window after it's created. Thanks, though. Best, Jordan On Oct 28, 2009, at 11:33 AM, Carl Eastlund wrote: > On Wed, Oct 28, 2009 at 2:27 PM, Jordan Johnson > wrote: >> All, >> >> A question from my class: is there any way to resize the window in >> a world >> program? Example situation: >> >> ;; world = Nat >> >> ;; world -> scene >> (define (show w) >> (nw:rectangle w w 'solid 'red)) >> >> (big-bang 50 (on-tick add1 .6) (on-draw show)) > > Try: > > (big-bang 50 (on-tick add1 .6) (on-draw show 300 400)) > > The extra arguments to on-draw specify a width and height. See online > documentation at: > http://docs.plt-scheme.org/teachpack/2htdpuniverse.html#(form._ > ((lib._2htdp/universe..ss)._big-bang)) > > --Carl From carl.eastlund at gmail.com Wed Oct 28 14:55:42 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Wed Oct 28 14:56:21 2009 Subject: [plt-scheme] Window resize in world programs In-Reply-To: <192D6665-4074-46A8-83B3-C188B5BFE3E0@fellowhuman.com> References: <52CB1151-E88B-4FB7-982F-B19948E2EA70@fellowhuman.com> <990e0c030910281133v53df66fbm1fb7a2d1d0442e22@mail.gmail.com> <192D6665-4074-46A8-83B3-C188B5BFE3E0@fellowhuman.com> Message-ID: <990e0c030910281155p2dabca14i87ed478fe568ddab@mail.gmail.com> On Wed, Oct 28, 2009 at 2:51 PM, Jordan Johnson wrote: > Hi Carl, > > Yep, I'm aware of the option of adding those arguments; the question was > more specifically about resizing the window after it's created. ?Thanks, > though. > > Best, > Jordan Oh, after it's been created. No, I don't believe you can do that, sorry. --Carl From laurent.orseau at gmail.com Wed Oct 28 15:16:37 2009 From: laurent.orseau at gmail.com (Laurent) Date: Wed Oct 28 15:17:18 2009 Subject: [plt-scheme] Re: [ANN] Lazy Scribble Documentator and Packager In-Reply-To: <4AE88C2B.2080105@cs.utah.edu> References: <4AE874D3.5050507@cs.utah.edu> <4AE88C2B.2080105@cs.utah.edu> Message-ID: On Wed, Oct 28, 2009 at 19:23, Jon Rafkind wrote: > Laurent wrote: > >> try : >> (planet-build "jon" 1 0) >> >> or use (set-planet-env "jon" 1 0) beforehand to modify the default >> parameters. >> >> By default, the username is that of the OS environment (or maybe that >> value >> is windows-specific, I should check that). If there is none, I guess that >> could fail. >> Maybe I should use another default value. >> >> Tell me if that works. >> >> >> > Ok that worked. I got a bit farther but it died when trying to make the > planet package. > > System: /home/jon/svn/scheme/vi/planet create /home/jon/svn/scheme/vi > /bin/sh: /home/jon/svn/scheme/vi/planet: not found > #f > > I guess it tried to search for the 'planet' executable and defaulted to the > current directory? probably something like this indeed. Maybe its better to invoke planet programmatically using its API? > Strangely, I'm now having troubles using (make-planet-archive). I first chose the planet executable because it shows more debug info, but now on my system "planet create" still works but not make-planet-archive, which returns: M:\Program Files\PLT\collects\planet\util.ss:351:2: PLaneT packager: Error generating scribble documentation: M:\Program Files\PLT\collects\scheme\private\map.ss:45:11: namespace-attach-module: a different module with the same name is already in the destination namespace, for name: "M:\Program Files\PLT\collects\scheme\contract.ss" I don't know what this means or why this happens... Could you tell me what these calls return: (find-system-path 'run-file) (find-system-path 'orig-dir) >From the docs, I thought 'orig-dir would return DrScheme executable dir, but it looks like not always. So maybe if I switch to 'run-file and extract the path that could work. If 'run-file returns the correct PLT directory (and if the planet executable is in the same directory), then in the package.ss, locate "(define exec-dir ...." and try to replace it with this : (define exec-dir (let-values ([(base name must-be-dir?) (split-path (find-system-path 'run-file))]) base)) Then re-do the procedure to build the package (F5 in tools.ss then require then planet-build). > Also I checked the .scrbl files in the reference/ directory and they look > ok, but they have ^M (as seen in vi) characters at the end of lines which is > a windows-ism for leaving in carriage return (char 13). But thats not a huge > deal. > hmm, not nice. It shouldn't cause any problems for the HTML files though. I hope. Could it be because I used multi-line strings in my code? Laurent -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091028/f5df7e4a/attachment.htm From geoff at knauth.org Wed Oct 28 17:19:57 2009 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Wed Oct 28 17:20:28 2009 Subject: [plt-scheme] Some PLT environment issues In-Reply-To: <19176.9621.12757.301682@winooski.ccs.neu.edu> References: <4AE6B668.1080506@adrenaline.com> <756daca50910270645r40140091m89aa2b9cdcdbba41@mail.gmail.com> <4AE70BD5.1090804@adrenaline.com> <595b9ab20910270848h39ece250ia50b63489886d3d2@mail.gmail.com> <4AE7828A.7040507@adrenaline.com> <19176.6289.416765.424496@winooski.ccs.neu.edu> <20091028105913.0C44065015A@mail-svr1.cs.utah.edu> <19176.9621.12757.301682@winooski.ccs.neu.edu> Message-ID: <9F7D4CA5-6379-40B0-BD4F-05D0C9F8D653@knauth.org> On Oct 28, 2009, at 07:05, Eli Barzilay wrote: > You can also look in my interactive hack for related useful > functionality. For example: > > -> ,apropos flatt ; (no pun intended, I swear!) > Matches: flatten. > -> ,describe flatten > `flatten' is a bound identifier, > defined in "scheme/list.ss" > required through "scheme/init.ss" Thanks, I forgot about that great hack! Is it possible to use this with DrScheme as well as mzscheme? From jmj at fellowhuman.com Wed Oct 28 17:38:07 2009 From: jmj at fellowhuman.com (Jordan Johnson) Date: Wed Oct 28 17:38:33 2009 Subject: [plt-scheme] empty-scene vs. nw:rectangle Message-ID: Hi all, Question from one of my students: Why does (image=? (empty-scene 200 100) (nw:rectangle 200 100 "outline" "black")) evaluate to false? (My best answer, without going digging into the teachpack code, is that there's a non-visible difference somewhere in the bitmap of the image.) Thanks, jmj From matthias at ccs.neu.edu Wed Oct 28 17:47:20 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Wed Oct 28 17:47:49 2009 Subject: [plt-scheme] empty-scene vs. nw:rectangle In-Reply-To: References: Message-ID: <3003A1D4-6451-41D3-932E-C2BE2DCC2D4F@ccs.neu.edu> Try this: #lang scheme (require 2htdp/universe) (define size 4) (define es (empty-scene size size)) (image->color-list es) (define nw (nw:rectangle size size 'outline 'black)) (image->color-list nw) (image=? es nw) for size = 2, 3, 4 and look at the resulting images and lists under a microscope. (It really is an accidental oversight on my side.) On Oct 28, 2009, at 5:38 PM, Jordan Johnson wrote: > > Hi all, > > Question from one of my students: Why does > > (image=? (empty-scene 200 100) (nw:rectangle 200 100 "outline" > "black")) > > evaluate to false? (My best answer, without going digging into the > teachpack > code, is that there's a non-visible difference somewhere in the > bitmap of the > image.) > > Thanks, > jmj > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From jay.mccarthy at gmail.com Wed Oct 28 19:18:36 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Wed Oct 28 19:18:58 2009 Subject: [plt-scheme] [REQ] OpenCL Binding Cross Platform Testers Message-ID: I am working on a binding for OpenCL [1] but the only hardware I have is an OS X box. If you have Linux or Windows computer with compatible hardware (ie newish Nvidia cards) and are willing to help me get the binding compatible with those, let me know. Jay 1. http://en.wikipedia.org/wiki/OpenCL -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From sigzero at gmail.com Wed Oct 28 21:47:12 2009 From: sigzero at gmail.com (Robert H) Date: Wed Oct 28 21:48:00 2009 Subject: [plt-scheme] Re: [REQ] OpenCL Binding Cross Platform Testers In-Reply-To: References: Message-ID: On 10/28/09 7:18 PM, Jay McCarthy wrote: > I am working on a binding for OpenCL [1] but the only hardware I have > is an OS X box. If you have Linux or Windows computer with compatible > hardware (ie newish Nvidia cards) and are willing to help me get the > binding compatible with those, let me know. > > Jay > > 1. http://en.wikipedia.org/wiki/OpenCL > If you can't find any I would suggest Parallels or VMWare to run on your Mac. Awesome way to test on multiple operating systems. Bob P.S. There is also VirtualBox, which is free, but I haven't had a good experience with it yet. From jay.mccarthy at gmail.com Thu Oct 29 00:09:03 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Oct 29 00:09:31 2009 Subject: [plt-scheme] Re: [REQ] OpenCL Binding Cross Platform Testers In-Reply-To: References: Message-ID: The issue is that OpenCL needs very specific hardware acceleration drivers that aren't supported by most video cards and none of the virtualization products I know of support the drivers. Even the Linux and Windows drivers are only Nvidia betas. It is only deployed on OS X Snow Leopard with modern Mac hardware, yet all the major players are behind it and I'd like to have it ready for PLT users when it is more common. Jay On Wed, Oct 28, 2009 at 7:47 PM, Robert H wrote: > On 10/28/09 7:18 PM, Jay McCarthy wrote: >> >> I am working on a binding for OpenCL [1] but the only hardware I have >> is an OS X box. If you have Linux or Windows computer with compatible >> hardware (ie newish Nvidia cards) and are willing to help me get the >> binding compatible with those, let me know. >> >> Jay >> >> 1. http://en.wikipedia.org/wiki/OpenCL >> > > If you can't find any I would suggest Parallels or VMWare to run on your > Mac. Awesome way to test on multiple operating systems. > > Bob > > P.S. There is also VirtualBox, which is free, but I haven't had a good > experience with it yet. > > _________________________________________________ > ?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 noelwelsh at gmail.com Thu Oct 29 04:15:39 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Oct 29 04:16:02 2009 Subject: [plt-scheme] [REQ] OpenCL Binding Cross Platform Testers In-Reply-To: References: Message-ID: I've just started working on bindings! :) I was going to send a message saying your Super-C package would be super-useful for OpenCL... I'm in the process of setting up OpenCL (AMD's implementation) on Linux. Having some dependency issues but should be able to get it sorted out. I might also try NVidia's Linux impl at a later date. N. On Wed, Oct 28, 2009 at 11:18 PM, Jay McCarthy wrote: > I am working on a binding for OpenCL [1] but the only hardware I have > is an OS X box. If you have Linux or Windows computer with compatible > hardware (ie newish Nvidia cards) and are willing to help me get the > binding compatible with those, let me know. > > Jay > > 1. http://en.wikipedia.org/wiki/OpenCL > > -- > 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 laurent.orseau at gmail.com Thu Oct 29 04:18:16 2009 From: laurent.orseau at gmail.com (Laurent) Date: Thu Oct 29 04:19:16 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: 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. Thanks for trying the package :) Laurent On Wed, Oct 28, 2009 at 20:16, Laurent wrote: > > > On Wed, Oct 28, 2009 at 19:23, Jon Rafkind wrote: > >> Laurent wrote: >> >>> try : >>> (planet-build "jon" 1 0) >>> >>> or use (set-planet-env "jon" 1 0) beforehand to modify the default >>> parameters. >>> >>> By default, the username is that of the OS environment (or maybe that >>> value >>> is windows-specific, I should check that). If there is none, I guess that >>> could fail. >>> Maybe I should use another default value. >>> >>> Tell me if that works. >>> >>> >>> >> Ok that worked. I got a bit farther but it died when trying to make the >> planet package. >> >> System: /home/jon/svn/scheme/vi/planet create /home/jon/svn/scheme/vi >> /bin/sh: /home/jon/svn/scheme/vi/planet: not found >> #f >> >> I guess it tried to search for the 'planet' executable and defaulted to >> the current directory? > > > probably something like this indeed. > > Maybe its better to invoke planet programmatically using its API? >> > > Strangely, I'm now having troubles using (make-planet-archive). > I first chose the planet executable because it shows more debug info, but > now on my system "planet create" still works but not make-planet-archive, > which returns: > > M:\Program Files\PLT\collects\planet\util.ss:351:2: PLaneT packager: Error > generating scribble documentation: M:\Program > Files\PLT\collects\scheme\private\map.ss:45:11: namespace-attach-module: a > different module with the same name is already in the destination namespace, > for name: "M:\Program Files\PLT\collects\scheme\contract.ss" > > I don't know what this means or why this happens... > > Could you tell me what these calls return: > (find-system-path 'run-file) > (find-system-path 'orig-dir) > > From the docs, I thought 'orig-dir would return DrScheme executable dir, > but it looks like not always. > So maybe if I switch to 'run-file and extract the path that could work. > > If 'run-file returns the correct PLT directory (and if the planet > executable is in the same directory), then in the package.ss, locate > "(define exec-dir ...." and try to replace it with this : > (define exec-dir > (let-values ([(base name must-be-dir?) (split-path (find-system-path > 'run-file))]) > base)) > > Then re-do the procedure to build the package (F5 in tools.ss then require > then planet-build). > > >> Also I checked the .scrbl files in the reference/ directory and they look >> ok, but they have ^M (as seen in vi) characters at the end of lines which is >> a windows-ism for leaving in carriage return (char 13). But thats not a huge >> deal. >> > > hmm, not nice. It shouldn't cause any problems for the HTML files though. I > hope. > Could it be because I used multi-line strings in my code? > > > Laurent > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091029/4ecefa19/attachment-0001.htm From laurent.orseau at gmail.com Thu Oct 29 06:22:37 2009 From: laurent.orseau at gmail.com (Laurent) Date: Thu Oct 29 06:23:21 2009 Subject: [plt-scheme] Some PLT environment issues In-Reply-To: <19176.9621.12757.301682@winooski.ccs.neu.edu> References: <4AE6B668.1080506@adrenaline.com> <595b9ab20910270848h39ece250ia50b63489886d3d2@mail.gmail.com> <4AE7828A.7040507@adrenaline.com> <19176.6289.416765.424496@winooski.ccs.neu.edu> <20091028105913.0C44065015A@mail-svr1.cs.utah.edu> <19176.9621.12757.301682@winooski.ccs.neu.edu> Message-ID: > > See `scribble/xref' and `setup/xref' (both documented). > Thanks > A good place to see how to use these is the implementation of that > macro. (Note that it must be a macro.) > > You can also look in my interactive hack for related useful > functionality. For example: > > -> ,apropos flatt ; (no pun intended, I swear!) > Matches: flatten. > -> ,describe flatten > `flatten' is a bound identifier, > defined in "scheme/list.ss" > required through "scheme/init.ss" > That sounds cool. Is it in any package? It does not seem to be in any file on my local distribution (and (help apropos) doesn't help ;) ). I found it on the web though : http://barzilay.org/misc/interactive3.ss but is there a good way to include this file? Laurent -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091029/69129a79/attachment.htm From laurent.orseau at gmail.com Thu Oct 29 10:02:52 2009 From: laurent.orseau at gmail.com (Laurent) Date: Thu Oct 29 10:03:34 2009 Subject: [plt-scheme] Wishes for the PLaneT Message-ID: 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) Thanks, Santa! :) Laurent -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091029/e3d3117c/attachment.htm From m.douglas.williams at gmail.com Thu Oct 29 10:34:57 2009 From: m.douglas.williams at gmail.com (Doug Williams) Date: Thu Oct 29 10:35:20 2009 Subject: [plt-scheme] [REQ] OpenCL Binding Cross Platform Testers In-Reply-To: References: Message-ID: I have a Linux box and a Windows (Vista) box with newish Nvidia cards (those I know run CUDA) and a laptop with integrated Nvidia graphics. If they're compatible, I could help with some testing. Doug On Thu, Oct 29, 2009 at 2:15 AM, Noel Welsh wrote: > I've just started working on bindings! :) I was going to send a > message saying your Super-C package would be super-useful for > OpenCL... > > I'm in the process of setting up OpenCL (AMD's implementation) on > Linux. Having some dependency issues but should be able to get it > sorted out. I might also try NVidia's Linux impl at a later date. > > N. > > On Wed, Oct 28, 2009 at 11:18 PM, Jay McCarthy > wrote: > > I am working on a binding for OpenCL [1] but the only hardware I have > > is an OS X box. If you have Linux or Windows computer with compatible > > hardware (ie newish Nvidia cards) and are willing to help me get the > > binding compatible with those, let me know. > > > > Jay > > > > 1. http://en.wikipedia.org/wiki/OpenCL > > > > -- > > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091029/5bd5f33e/attachment.htm From sbloch at adelphi.edu Thu Oct 29 11:41:47 2009 From: sbloch at adelphi.edu (Stephen Bloch) Date: Thu Oct 29 11:41:56 2009 Subject: [plt-scheme] Some PLT environment issues In-Reply-To: <4AE6B668.1080506@adrenaline.com> References: <4AE6B668.1080506@adrenaline.com> Message-ID: On Oct 27, 2009, at 4:59 AM, Scott McLoughlin wrote: > 4) Dr Scheme needs clean, simple revision control integration. I was talking to the BlueJ list about this a few months ago. BlueJ, like DrScheme, is a beginner-friendly development environment. They added cvs and svn integration a year or two ago, but only as a collaboration tool -- there was no way (within the BlueJ environment) to retrieve an old version, revert to an old version, etc. I suggested a model similar to a Web browser with "forward" and "back" buttons: if you're already at the latest version, the "forward" button is disabled. This assumes that your cvs/svn/git/whatever repository is linear, not branching, but that would cover a large fraction of the cases for a tiny fraction of the complexity. You'd still need to go through a dialogue once to configure the connection to the server, of course.... Stephen Bloch sbloch@adelphi.edu From jay.mccarthy at gmail.com Thu Oct 29 11:42:57 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Oct 29 11:43:19 2009 Subject: [plt-scheme] Some PLT environment issues In-Reply-To: References: <4AE6B668.1080506@adrenaline.com> Message-ID: The forward button should commit your changes :) Jay On Thu, Oct 29, 2009 at 9:41 AM, Stephen Bloch wrote: > > On Oct 27, 2009, at 4:59 AM, Scott McLoughlin wrote: > >> 4) Dr Scheme needs clean, simple revision control integration. > > I was talking to the BlueJ list about this a few months ago. ?BlueJ, like > DrScheme, is a beginner-friendly development environment. ?They added cvs > and svn integration a year or two ago, but only as a collaboration tool -- > there was no way (within the BlueJ environment) to retrieve an old version, > revert to an old version, etc. ?I suggested a model similar to a Web browser > with "forward" and "back" buttons: if you're already at the latest version, > the "forward" button is disabled. ?This assumes that your > cvs/svn/git/whatever repository is linear, not branching, but that would > cover a large fraction of the cases for a tiny fraction of the complexity. > ?You'd still need to go through a dialogue once to configure the connection > to the server, of course.... > > > Stephen Bloch > sbloch@adelphi.edu > > _________________________________________________ > ?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 hendrik at topoi.pooq.com Thu Oct 29 11:55:08 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Oct 29 11:55:30 2009 Subject: [plt-scheme] Some PLT environment issues In-Reply-To: References: <4AE6B668.1080506@adrenaline.com> Message-ID: <20091029155507.GE24509@topoi.pooq.com> On Thu, Oct 29, 2009 at 11:41:47AM -0400, Stephen Bloch wrote: > > On Oct 27, 2009, at 4:59 AM, Scott McLoughlin wrote: > > >4) Dr Scheme needs clean, simple revision control integration. > > I was talking to the BlueJ list about this a few months ago. BlueJ, > like DrScheme, is a beginner-friendly development environment. They > added cvs and svn integration a year or two ago, but only as a > collaboration tool -- there was no way (within the BlueJ environment) > to retrieve an old version, revert to an old version, etc. I > suggested a model similar to a Web browser with "forward" and "back" > buttons: if you're already at the latest version, the "forward" > button is disabled. This assumes that your cvs/svn/git/whatever > repository is linear, not branching, but that would cover a large > fraction of the cases for a tiny fraction of the complexity. You'd > still need to go through a dialogue once to configure the connection > to the server, of course.... There's several viewers for the monotone revisin management system. One is used on a public-access repository server; see http://mtn-host.prjek.net/ , pick a project ( I suggest "monotone" which has a lot of branch structure), click on its project info page link, click on "Source browser", and there you are. By the way, monotone is distributed, and allows multiple heads in a branch. -- hendrik From hendrik at topoi.pooq.com Thu Oct 29 11:56:06 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Oct 29 11:56:34 2009 Subject: [plt-scheme] Some PLT environment issues In-Reply-To: References: <4AE6B668.1080506@adrenaline.com> Message-ID: <20091029155606.GF24509@topoi.pooq.com> On Thu, Oct 29, 2009 at 09:42:57AM -0600, Jay McCarthy wrote: > The forward button should commit your changes :) Too easy to move forward one step too far. and commit something that's not ready yet. -- hendrik > > Jay > > On Thu, Oct 29, 2009 at 9:41 AM, Stephen Bloch wrote: > > > > On Oct 27, 2009, at 4:59 AM, Scott McLoughlin wrote: > > > >> 4) Dr Scheme needs clean, simple revision control integration. > > > > I was talking to the BlueJ list about this a few months ago. ?BlueJ, like > > DrScheme, is a beginner-friendly development environment. ?They added cvs > > and svn integration a year or two ago, but only as a collaboration tool -- > > there was no way (within the BlueJ environment) to retrieve an old version, > > revert to an old version, etc. ?I suggested a model similar to a Web browser > > with "forward" and "back" buttons: if you're already at the latest version, > > the "forward" button is disabled. ?This assumes that your > > cvs/svn/git/whatever repository is linear, not branching, but that would > > cover a large fraction of the cases for a tiny fraction of the complexity. > > ?You'd still need to go through a dialogue once to configure the connection > > to the server, of course.... > > > > > > Stephen Bloch > > sbloch@adelphi.edu > > > > _________________________________________________ > > ?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 > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From david.storrs at gmail.com Thu Oct 29 12:28:32 2009 From: david.storrs at gmail.com (David Storrs) Date: Thu Oct 29 12:28:51 2009 Subject: [plt-scheme] Running PLT web server on port 80 Message-ID: On Linux (Debian on Linode, in our case), if you want the web server to run on port 80, you need to launch it as root. Apache will bind to the port and then downgrade itself to a non-privileged user. Is there a way to make the PLT web server do the same? Noel, Untyped must have addressed this before...what is your solution? --Dks -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091029/7e8e6fee/attachment.htm From jay.mccarthy at gmail.com Thu Oct 29 12:37:14 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Oct 29 12:37:37 2009 Subject: [plt-scheme] Running PLT web server on port 80 In-Reply-To: References: Message-ID: You can do it by writing a Scheme script that starts and calls the syscall to downgrade via the FFI. The core doesn't have it, but if you write I am willing to add it. I do it normally by running Apache on 80 for static files and proxying to PLT for dynamic content. Jay On Thu, Oct 29, 2009 at 10:28 AM, David Storrs wrote: > On Linux (Debian on Linode, in our case), if you want the web server to run > on port 80, you need to launch it as root.? Apache will bind to the port and > then downgrade itself to a non-privileged user.? Is there a way to make the > PLT web server do the same? > > Noel, Untyped must have addressed this before...what is your solution? > > > --Dks > _________________________________________________ > ?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 noelwelsh at gmail.com Thu Oct 29 13:09:42 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Oct 29 13:10:02 2009 Subject: [plt-scheme] Running PLT web server on port 80 In-Reply-To: References: Message-ID: On Thu, Oct 29, 2009 at 4:37 PM, Jay McCarthy wrote: y > I do it normally by running Apache on 80 for static files and proxying > to PLT for dynamic content. This is what we do. We also configure the web server to only accept connections from localhost. N. From david.storrs at gmail.com Thu Oct 29 13:27:35 2009 From: david.storrs at gmail.com (David Storrs) Date: Thu Oct 29 13:29:19 2009 Subject: [plt-scheme] Running PLT web server on port 80 In-Reply-To: References: Message-ID: On Thu, Oct 29, 2009 at 1:09 PM, Noel Welsh wrote: > On Thu, Oct 29, 2009 at 4:37 PM, Jay McCarthy > wrote: > y > > I do it normally by running Apache on 80 for static files and proxying > > to PLT for dynamic content. > > This is what we do. We also configure the web server to only accept > connections from localhost. > > N. > Ok, we'll do the same. Thanks, guys. Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091029/5ce85cd9/attachment.htm From plt at synx.us.to Thu Oct 29 13:28:19 2009 From: plt at synx.us.to (Synx) Date: Thu Oct 29 13:30:04 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> Message-ID: <4AE9D0B3.80303@synx.us.to> Really the only problem I have with parentheses is one of lexical context. I personally have a hard time maintaining a stack of context in my head, so when I reach a ) I can't easily tell what context I just returned to. Matching the closing parentheses /when I type it/ helps, but if I'm just looking at code that says (if (test? a) (if (test? b) ((let ((c (+ a b))) (lambda (d) (+ c d))) b)) I have no clue what that last 'b' is applied to. (it breaks down to (+ a b b), right?) So when I encounter ))))))))) (and I frequently do) I have to manually count the parentheses and track them back _with my finger_ to find where to insert a new cond clause for instance. Even if I'm looking at my own code! It's really frustrating. :( From clements at brinckerhoff.org Thu Oct 29 13:41:08 2009 From: clements at brinckerhoff.org (John Clements) Date: Thu Oct 29 13:41:36 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <4AE9D0B3.80303@synx.us.to> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <4AE9D0B3.80303@synx.us.to> Message-ID: On Oct 29, 2009, at 10:28 AM, Synx wrote: > > Really the only problem I have with parentheses is one of lexical > context. I personally have a hard time maintaining a stack of > context in > my head, so when I reach a ) I can't easily tell what context I just > returned to. Matching the closing parentheses /when I type it/ helps, > but if I'm just looking at code that says > > (if (test? a) > (if (test? b) > ((let ((c (+ a b))) > (lambda (d) > (+ c d))) > b)) > > I have no clue what that last 'b' is applied to. (it breaks down to > (+ a > b b), right?) So when I encounter ))))))))) (and I frequently do) I > have > to manually count the parentheses and track them back _with my finger_ > to find where to insert a new cond clause for instance. Even if I'm > looking at my own code! > > It's really frustrating. :( Yikes! don't do that. I have two suggestions: 1) Unless your e-mailer messed it up, you're not letting drscheme indent your code. Here's what it looks like, indented: (if (test? a) (if (test? b) ((let ((c (+ a b))) (lambda (d) (+ c d))) b)) In the drscheme editor, it's now fairly clear what's being applied to 'b'. 2) Use the s-expression navigation keys! for instance, suppose the cursor is right before the "b", and you're wondering what 'b' is the argument to. Just hit Alt-left (on the Mac, Meta-left on unix, etc.), and the cursor goes to the beginning of the first term in the application, and it's highlighted, to boot. It is *really, really* worth getting to know the s-expression navigation keys. 3) Tangentially related: if you introduce all your () pairs with ESC- (, then you'll never need to type a right paren again. You can highlight an s-expression and hit ESC-(, and you'll wrap the term in parens. Going whole hog, you can remap your left-paren to perform this operation, and you can get rid of the 'ESC'. All the best, 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/20091029/981dcae6/smime.bin From rafkind at cs.utah.edu Thu Oct 29 13:39:34 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Thu Oct 29 13:42:41 2009 Subject: [plt-scheme] Wishes for the PLaneT In-Reply-To: References: Message-ID: <4AE9D356.1000200@cs.utah.edu> 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. From clements at brinckerhoff.org Thu Oct 29 13:51:35 2009 From: clements at brinckerhoff.org (John Clements) Date: Thu Oct 29 13:52:02 2009 Subject: [plt-scheme] DrScheme, libsdl In-Reply-To: <1256309384.12551.88.camel@kittywake> References: <18AC9059-E2FC-40EA-8B3B-C3391B98852D@knauth.org> <595b9ab20910230534p1575c383l2b79aacfb12e264b@mail.gmail.com> <1256309384.12551.88.camel@kittywake> Message-ID: <912E9110-8F45-4481-A1B7-01E545106A03@brinckerhoff.org> Skipped content of type multipart/mixed-------------- 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/20091029/517d55db/smime.bin From jev at mac.com Thu Oct 29 13:52:30 2009 From: jev at mac.com (Jaime Vargas) Date: Thu Oct 29 13:53:11 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <4AE9D0B3.80303@synx.us.to> Message-ID: On Oct 29, 2009, at 1:41 PM, John Clements wrote: > 3) Tangentially related: if you introduce all your () pairs with ESC- > (, then you'll never need to type a right paren again. You can > highlight an s-expression and hit ESC-(, and you'll wrap the term in > parens. Going whole hog, you can remap your left-paren to perform > this operation, and you can get rid of the 'ESC'. Given than matching brackets are the norm. Why the default requires escaping to insert pairs? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091029/e01bba92/attachment.htm From clements at brinckerhoff.org Thu Oct 29 14:02:56 2009 From: clements at brinckerhoff.org (John Clements) Date: Thu Oct 29 14:03:25 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <4AE9D0B3.80303@synx.us.to> Message-ID: <2C4A6EB7-85F1-4421-9F61-B26E460B3434@brinckerhoff.org> On Oct 29, 2009, at 10:52 AM, Jaime Vargas wrote: > On Oct 29, 2009, at 1:41 PM, John Clements wrote: > >> 3) Tangentially related: if you introduce all your () pairs with >> ESC-(, then you'll never need to type a right paren again. You can >> highlight an s-expression and hit ESC-(, and you'll wrap the term >> in parens. Going whole hog, you can remap your left-paren to >> perform this operation, and you can get rid of the 'ESC'. > > Given than matching brackets are the norm. Why the default requires > escaping to insert pairs? I'm not sure I understand your question. By default, typing a left paren inserts a single left paren into the buffer. With the remapping I use, typing left-paren inserts a matching pair of parens, wrapped around the current selection, with the cursor just to the right of the left-paren. Are you suggesting that *everyone* should use this remapping? It seems like a good idea to me, but I'm betting it would increase the slope of the DrScheme learning curve. 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/20091029/da72154f/smime-0001.bin From ryanc at ccs.neu.edu Thu Oct 29 14:13:47 2009 From: ryanc at ccs.neu.edu (Ryan Culpepper) Date: Thu Oct 29 14:14:20 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <4AE9D0B3.80303@synx.us.to> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <4AE9D0B3.80303@synx.us.to> Message-ID: <4AE9DB5B.5070603@ccs.neu.edu> Synx wrote: > Really the only problem I have with parentheses is one of lexical > context. I personally have a hard time maintaining a stack of context in > my head, so when I reach a ) I can't easily tell what context I just > returned to. Matching the closing parentheses /when I type it/ helps, > but if I'm just looking at code that says > > (if (test? a) > (if (test? b) > ((let ((c (+ a b))) > (lambda (d) > (+ c d))) > b)) > > I have no clue what that last 'b' is applied to. (it breaks down to (+ a > b b), right?) So when I encounter ))))))))) (and I frequently do) I have > to manually count the parentheses and track them back _with my finger_ > to find where to insert a new cond clause for instance. Even if I'm > looking at my own code! > > It's really frustrating. :( DrScheme can highlight different parenthesized regions in different colors. Open the preferences dialog, go to the Colors tab, and switch the "Parenthesis color scheme" to anything other than "Basic grey". Then find some code and put the cursor right before or after a large, highly nested parethesized group. I agree with John's points too, though. I usually find indentation sufficient. Ryan From jev at mac.com Thu Oct 29 14:48:06 2009 From: jev at mac.com (Jaime Vargas) Date: Thu Oct 29 14:48:29 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <2C4A6EB7-85F1-4421-9F61-B26E460B3434@brinckerhoff.org> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <4AE9D0B3.80303@synx.us.to> <2C4A6EB7-85F1-4421-9F61-B26E460B3434@brinckerhoff.org> Message-ID: On Oct 29, 2009, at 2:02 PM, John Clements wrote: > By default, typing a left paren inserts a single left paren into > the buffer. With the remapping I use, typing left-paren inserts a > matching pair of parens, wrapped around the current selection, with > the cursor just to the right of the left-paren. Are you suggesting > that *everyone* should use this remapping? Yes. That is the default behavior in other editors for lispy languages, emacs lisp mode and textmate come to mind. > It seems like a good idea to me, but I'm betting it would increase > the slope of the DrScheme learning curve. I don't see why it will impede learning. If anything the current default forces the user to either type more or read more docs to accomplish a simple task. -- Jaime From jmj at fellowhuman.com Thu Oct 29 14:59:34 2009 From: jmj at fellowhuman.com (Jordan Johnson) Date: Thu Oct 29 15:00:10 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <4AE9D0B3.80303@synx.us.to> <2C4A6EB7-85F1-4421-9F61-B26E460B3434@brinckerhoff.org> Message-ID: On Oct 29, 2009, at 11:48 AM, Jaime Vargas wrote: > On Oct 29, 2009, at 2:02 PM, John Clements wrote: > >> By default, typing a left paren inserts a single left paren into >> the buffer. With the remapping I use, typing left-paren inserts a >> matching pair of parens, wrapped around the current selection, with >> the cursor just to the right of the left-paren. Are you suggesting >> that *everyone* should use this remapping? > > Yes. That is the default behavior in other editors for lispy > languages, emacs lisp mode and textmate come to mind. > Just so somebody's on record for the other side: that behavior annoys the heck out of me, and I would *not* want it as the default. Best, Jordan From jay.mccarthy at gmail.com Thu Oct 29 15:02:23 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Oct 29 15:02:47 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <4AE9D0B3.80303@synx.us.to> <2C4A6EB7-85F1-4421-9F61-B26E460B3434@brinckerhoff.org> Message-ID: Ditto... I've never gotten used to it. I'm a heathen, I know. Jay On Thu, Oct 29, 2009 at 12:59 PM, Jordan Johnson wrote: > > On Oct 29, 2009, at 11:48 AM, Jaime Vargas wrote: > >> On Oct 29, 2009, at 2:02 PM, John Clements wrote: >> >>> By default, typing a left paren inserts a single left paren into the >>> buffer. ?With the remapping I use, typing left-paren inserts a matching pair >>> of parens, wrapped around the current selection, with the cursor just to the >>> right of the left-paren. ?Are you suggesting that *everyone* should use this >>> remapping? >> >> Yes. That is the default behavior in other editors for lispy languages, >> emacs lisp mode and textmate come to mind. >> > > Just so somebody's on record for the other side: that behavior annoys the > heck out of me, and I would *not* want it as the default. > > Best, > Jordan > > _________________________________________________ > ?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 clements at brinckerhoff.org Thu Oct 29 15:06:22 2009 From: clements at brinckerhoff.org (John Clements) Date: Thu Oct 29 15:06:44 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <4AE9D0B3.80303@synx.us.to> <2C4A6EB7-85F1-4421-9F61-B26E460B3434@brinckerhoff.org> Message-ID: <3DE4448B-1E8D-4286-B2CD-62C7DCBF8250@brinckerhoff.org> On Oct 29, 2009, at 12:02 PM, Jay McCarthy wrote: > Ditto... I've never gotten used to it. I'm a heathen, I know. > No you're not. To the best of my knowledge, *none* of {eli,mflatt,robby,matthias} use this binding. That's why I didn't suggest it as the default. It makes my life much simpler, but most people don't seem to want 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/20091029/199e3457/smime.bin From jev at mac.com Thu Oct 29 15:09:16 2009 From: jev at mac.com (Jaime Vargas) Date: Thu Oct 29 15:09:53 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <4AE9D0B3.80303@synx.us.to> <2C4A6EB7-85F1-4421-9F61-B26E460B3434@brinckerhoff.org> Message-ID: <451CC10A-BCAA-4277-97B2-BBE25F8ABF84@mac.com> Funny, how such feeling is not expressed for auto indenting. IMHO, both auto indenting and auto insert of paren pairs are requirements of a "good" scheme editing mode. On Oct 29, 2009, at 3:02 PM, Jay McCarthy wrote: > Ditto... I've never gotten used to it. I'm a heathen, I know. > > Jay > > On Thu, Oct 29, 2009 at 12:59 PM, Jordan Johnson > wrote: >> >> On Oct 29, 2009, at 11:48 AM, Jaime Vargas wrote: >> >>> On Oct 29, 2009, at 2:02 PM, John Clements wrote: >>> >>>> By default, typing a left paren inserts a single left paren into >>>> the >>>> buffer. With the remapping I use, typing left-paren inserts a >>>> matching pair >>>> of parens, wrapped around the current selection, with the cursor >>>> just to the >>>> right of the left-paren. Are you suggesting that *everyone* >>>> should use this >>>> remapping? >>> >>> Yes. That is the default behavior in other editors for lispy >>> languages, >>> emacs lisp mode and textmate come to mind. >>> >> >> Just so somebody's on record for the other side: that behavior >> annoys the >> heck out of me, and I would *not* want it as the default. >> >> Best, >> Jordan >> >> _________________________________________________ >> 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 robby at eecs.northwestern.edu Thu Oct 29 15:54:52 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Oct 29 15:55:19 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <451CC10A-BCAA-4277-97B2-BBE25F8ABF84@mac.com> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <4AE9D0B3.80303@synx.us.to> <2C4A6EB7-85F1-4421-9F61-B26E460B3434@brinckerhoff.org> <451CC10A-BCAA-4277-97B2-BBE25F8ABF84@mac.com> Message-ID: <932b2f1f0910291254r726b840cv184effd94f0fdd25@mail.gmail.com> It seems okay to me when I'm writing new code, but less good when I'm editing existing code since the parens often go around non-emptyness. But perhaps I've just missed some other binding somewhere that makes that work well or something. Robby On Thu, Oct 29, 2009 at 2:09 PM, Jaime Vargas wrote: > Funny, how such feeling is not expressed for auto indenting. IMHO, both auto > indenting and auto insert of paren pairs are requirements of a "good" scheme > editing mode. > > On Oct 29, 2009, at 3:02 PM, Jay McCarthy wrote: > >> Ditto... I've never gotten used to it. I'm a heathen, I know. >> >> Jay >> >> On Thu, Oct 29, 2009 at 12:59 PM, Jordan Johnson >> wrote: >>> >>> On Oct 29, 2009, at 11:48 AM, Jaime Vargas wrote: >>> >>>> On Oct 29, 2009, at 2:02 PM, John Clements wrote: >>>> >>>>> By default, typing a left paren inserts a single left paren into the >>>>> buffer. ?With the remapping I use, typing left-paren inserts a matching >>>>> pair >>>>> of parens, wrapped around the current selection, with the cursor just >>>>> to the >>>>> right of the left-paren. ?Are you suggesting that *everyone* should use >>>>> this >>>>> remapping? >>>> >>>> Yes. That is the default behavior in other editors for lispy languages, >>>> emacs lisp mode and textmate come to mind. >>>> >>> >>> Just so somebody's on record for the other side: that behavior annoys the >>> heck out of me, and I would *not* want it as the default. >>> >>> Best, >>> Jordan >>> >>> _________________________________________________ >>> ?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 > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From grettke at acm.org Thu Oct 29 16:05:36 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Oct 29 16:05:54 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <932b2f1f0910291254r726b840cv184effd94f0fdd25@mail.gmail.com> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <4AE9D0B3.80303@synx.us.to> <2C4A6EB7-85F1-4421-9F61-B26E460B3434@brinckerhoff.org> <451CC10A-BCAA-4277-97B2-BBE25F8ABF84@mac.com> <932b2f1f0910291254r726b840cv184effd94f0fdd25@mail.gmail.com> Message-ID: <756daca50910291305g39ce8a72idc8f7e6331a5e54f@mail.gmail.com> On Thu, Oct 29, 2009 at 2:54 PM, Robby Findler wrote: > It seems okay to me when I'm writing new code, but less good when I'm > editing existing code since the parens often go around non-emptyness. > But perhaps I've just missed some other binding somewhere that makes > that work well or something. It sounds like binding ( to insert-()-pair would give you what you want in both cases (surrounding code or inserting matched round parens) or maybe I don't understand he use case. From plt at synx.us.to Thu Oct 29 16:17:02 2009 From: plt at synx.us.to (Synx) Date: Thu Oct 29 16:17:23 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <4AE9D0B3.80303@synx.us.to> Message-ID: <4AE9F83E.20402@synx.us.to> > 1) Unless your e-mailer messed it up, you're not letting drscheme indent > your code. Here's what it looks like, indented: I indented my own code, but it is relatively the same as yours, just you inserted 4 spaces instead of 2 to offset the second 'if' and 'let' expressions. I forgot how drscheme adds extra space to line up the other arguments with the first. I do use the lining up of arguments vertically to help find the context sometimes. But like I said when I am faced with ))))))))) it's hard for me to tell that I have to hit enter "))))))here)))" to get the indentation (and lexical context) that I want. When the indentation already exists it's relatively easy to understand, but when I just have a blob of close parens, I have to delete them one at a time until drscheme highlights to the expression I want, otherwise I'll never know when to hit enter. In that sense I like that one lisp paste website, where it highlights matching parens simply by hovering your mouse over it. (or cursor would be fine too). I don't think that's implemented in drscheme though. I really don't have that much trouble with parentheses. It's just a little tricky. I certainly don't think the solution is to go the XML way and have (procedure argument argument argument /procedure)! ...maybe if /procedure) was treated as a comment, but... NO BAD > 2) Use the s-expression navigation keys! THANK you. I've been trying to get something like this working for a while! When I hold Alt, right and left go from argument to argument in the current s-exp, up goes into the context of that expression being an argument of something else, and down goes into the current argument as if it were an expression. That's very intuitive! > Going > whole hog, you can remap your left-paren to perform this operation, and > you can get rid of the 'ESC'. I like how emacs can do this (though not so much how they block what is seen as improper deletion). How do I remap keys in drscheme? All I've been able to do so far is show the keybindings, but not change any of them. From clements at brinckerhoff.org Thu Oct 29 16:42:51 2009 From: clements at brinckerhoff.org (John Clements) Date: Thu Oct 29 16:43:17 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <932b2f1f0910291254r726b840cv184effd94f0fdd25@mail.gmail.com> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <4AE9D0B3.80303@synx.us.to> <2C4A6EB7-85F1-4421-9F61-B26E460B3434@brinckerhoff.org> <451CC10A-BCAA-4277-97B2-BBE25F8ABF84@mac.com> <932b2f1f0910291254r726b840cv184effd94f0fdd25@mail.gmail.com> Message-ID: On Oct 29, 2009, at 12:54 PM, Robby Findler wrote: > It seems okay to me when I'm writing new code, but less good when I'm > editing existing code since the parens often go around non-emptyness. > But perhaps I've just missed some other binding somewhere that makes > that work well or something. > Since you ask: Yes! In particular, the parens go around the highlighted region. So if I highlight three neighboring sexps and hit left-paren, I get a pair of parens that wrap those sexps. advocacy-r-us, 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/20091029/1099e0fa/smime.bin From eli at barzilay.org Thu Oct 29 16:48:17 2009 From: eli at barzilay.org (Eli Barzilay) Date: Thu Oct 29 16:48:40 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <4AE9F83E.20402@synx.us.to> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <4AE9D0B3.80303@synx.us.to> <4AE9F83E.20402@synx.us.to> Message-ID: <19177.65425.418557.195681@winooski.ccs.neu.edu> On Oct 29, Synx wrote: > > 1) Unless your e-mailer messed it up, you're not letting drscheme indent > > your code. Here's what it looks like, indented: > > I indented my own code, but it is relatively the same as yours, just > you inserted 4 spaces instead of 2 to offset the second 'if' and > 'let' expressions. I forgot how drscheme adds extra space to line up > the other arguments with the first. There were two problems in your original indentation: | (if (test? a) | (if (test? b) | ((let ((c (+ a b))) | (lambda (d) | (+ c d))) | b)) The first is that the last line should be indented by one more space. The "stack of contexts" is made clear by this -- that last line is a reference to `b', in the then-branch of a (one-armed) `if', in the then-branch of another `if'. The same will hold for using nested `let's, so overall it's the indentation that makes (or *should* make) the context clear at all times without any counting. The second problem is the missing closing paren. I find it very difficult to rely on indentation etc when the buffer is not always balanced, and if the above code was part of some module, then my first instinct would be to ignore any indentation hints in everything that follows it. It's easy to take care of by never inserting an orphan paren -- but in both drscheme and emacs I do that using `M-('. (BTW, the 2-spaces for the then/else branches is not a problem, and IMO it's much better than drscheme's and emacs's default 4 space indentation.) > In that sense I like that one lisp paste website, where it > highlights matching parens simply by hovering your mouse over > it. (or cursor would be fine too). I don't think that's implemented > in drscheme though. It's a cute feature, but I'd hate to use the mouse just to inspect the structure of code, and I'd also hate being forced to move the mouse to avoid some distracting hilight that is unrelated to what I'm working on now. > When I hold Alt, right and left go from argument to argument in the > current s-exp, up goes into the context of that expression being an > argument of something else, and down goes into the current argument > as if it were an expression. That's very intuitive! It's also very common -- drscheme borrowed this from emacs (my guess). > > Going whole hog, you can remap your left-paren to perform this > > operation, and you can get rid of the 'ESC'. > > I like how emacs can do this (though not so much how they block what > is seen as improper deletion). By that you're probably referring to things like paredit, which do much more than just remap open parens to inserting a balanced pair. (What these tools are trying to do is keep the buffer balanced at all times, which is a much more difficult.) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From clements at brinckerhoff.org Thu Oct 29 16:48:23 2009 From: clements at brinckerhoff.org (John Clements) Date: Thu Oct 29 16:49:43 2009 Subject: [plt-scheme] Paren Paralysis Sufferers Unite In-Reply-To: <4AE9F83E.20402@synx.us.to> References: <5e839702-7c69-48f4-8186-f34549c7bb19@d10g2000yqh.googlegroups.com> <4AE9D0B3.80303@synx.us.to> <4AE9F83E.20402@synx.us.to> Message-ID: <38E549BA-208E-4AF2-B881-B5DB53AB2EE7@brinckerhoff.org> On Oct 29, 2009, at 1:17 PM, Synx wrote: > >> 1) Unless your e-mailer messed it up, you're not letting drscheme >> indent >> your code. Here's what it looks like, indented: > > I indented my own code, but it is relatively the same as yours, just > you > inserted 4 spaces instead of 2 to offset the second 'if' and 'let' > expressions. I forgot how drscheme adds extra space to line up the > other > arguments with the first. > > I do use the lining up of arguments vertically to help find the > context > sometimes. But like I said when I am faced with ))))))))) it's hard > for > me to tell that I have to hit enter "))))))here)))" to get the > indentation (and lexical context) that I want. When the indentation > already exists it's relatively easy to understand, but when I just > have > a blob of close parens, I have to delete them one at a time until > drscheme highlights to the expression I want, otherwise I'll never > know > when to hit enter. You can do better than this; just use the arrow keys rather than hitting 'delete'. Same highlighting, no need to type the close parens again. > In that sense I like that one lisp paste website, where it highlights > matching parens simply by hovering your mouse over it. (or cursor > would > be fine too). I don't think that's implemented in drscheme though. For the cursor, that's already there. >> 2) Use the s-expression navigation keys! > > THANK you. I've been trying to get something like this working for a > while! Don't thank me, thank Robby. >> Going >> whole hog, you can remap your left-paren to perform this operation, >> and >> you can get rid of the 'ESC'. > > I like how emacs can do this (though not so much how they block what > is > seen as improper deletion). How do I remap keys in drscheme? All I've > been able to do so far is show the keybindings, but not change any > of them. See Edit > Keybindings > Add User-defined Keybindings ... FWIW, the attached file[*] instates the keybindings I've just mentioned. TNX also CLK. John Clements [*] actually, it was so short I just pasted it here: (module jbc-keybindings framework/keybinding-lang (define (kb binder function) (keybinding binder (lambda (editor event) (send (send editor get-keymap) call-function function editor event #t)))) (kb "~c:s:(" "insert-()-pair") (kb "~c:s:{" "insert-{}-pair") (kb "~c:s:\"" "insert-\"\"-pair")) -------------- 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/20091029/5aad77d2/smime.bin From david.storrs at gmail.com Thu Oct 29 16:57:52 2009 From: david.storrs at gmail.com (David Storrs) Date: Thu Oct 29 16:58:17 2009 Subject: [plt-scheme] Segfault in web server (due to missing library??) Message-ID: The following test script segfaults Scheme on my Debian 5.0 server: #lang scheme (require web-server/stuffers/hmac-sha1) (HMAC-SHA1 (string->bytes/utf-8 "secret") (string->bytes/utf-8 "foo bar baz")) I ran (enter! web-server/stuffers/hmac-sha1) from a scheme REPL, and verified that HMAC-SHA1/raw is the source of the segfault, but I don't know anything about FFI programming so I can't see how to go forward with it from there. This is a very bare-bones server, so it's probably just missing a library or such. I do see that it's looking for libcrypto, and (IIUC) it will accept 0.9.8. I have the following libcryptos: /usr/lib/libcrypto.a /usr/lib/libcrypto.so /usr/lib/libcrypto.so.0.9.8 /usr/lib/pkgconfig/libcrypto.pc ...so I would have thought it would work. Any suggestions on where to look next? Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091029/702381ee/attachment-0001.htm From jay.mccarthy at gmail.com Thu Oct 29 17:02:17 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Oct 29 17:02:39 2009 Subject: [plt-scheme] Segfault in web server (due to missing library??) In-Reply-To: References: Message-ID: It doesn't segfault for me... Can you run web-server/stuffers/hmac-sha1 from the repl and report what libcrypto EVP_SHA1 and HMAC-SHA1/raw are bound to? Jay On Thu, Oct 29, 2009 at 2:57 PM, David Storrs wrote: > The following test script segfaults Scheme on my Debian 5.0 server: > > #lang scheme > (require web-server/stuffers/hmac-sha1) > (HMAC-SHA1 > ? (string->bytes/utf-8 "secret") > ? (string->bytes/utf-8 "foo bar baz")) > > I ran (enter! web-server/stuffers/hmac-sha1) from a scheme REPL, and > verified that HMAC-SHA1/raw is the source of the segfault, but I don't know > anything about FFI programming so I can't see how to go forward with it from > there. > > This is a very bare-bones server, so it's probably just missing a library or > such.? I do see that it's looking for libcrypto, and (IIUC) it will accept > 0.9.8.? I have the following libcryptos: > > /usr/lib/libcrypto.a > /usr/lib/libcrypto.so > /usr/lib/libcrypto.so.0.9.8 > /usr/lib/pkgconfig/libcrypto.pc > > ...so I would have thought it would work. > > Any suggestions on where to look next? > > Dave > > _________________________________________________ > ?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 david.storrs at gmail.com Thu Oct 29 17:08:57 2009 From: david.storrs at gmail.com (David Storrs) Date: Thu Oct 29 17:09:16 2009 Subject: [plt-scheme] Segfault in web server (due to missing library??) In-Reply-To: References: Message-ID: On Thu, Oct 29, 2009 at 5:02 PM, Jay McCarthy wrote: > It doesn't segfault for me... > Yeah, it doesn't segfault on my local machine either...it must be something that we simply haven't installed yet. Like I said, VERY bare bones. I even had to install locate, which I thought was part of the core system. > > Can you run web-server/stuffers/hmac-sha1 from the repl and report what > [these are bound to?] > > libcrypto > EVP_SHA1 > and > HMAC-SHA1/raw > > > HMAC-SHA1/raw # > EVP_SHA1 # > libcrypto # Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091029/bb453b8f/attachment.htm From jay.mccarthy at gmail.com Thu Oct 29 17:17:13 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Oct 29 17:17:37 2009 Subject: [plt-scheme] Segfault in web server (due to missing library??) In-Reply-To: References: Message-ID: On Thu, Oct 29, 2009 at 3:08 PM, David Storrs wrote: > > > On Thu, Oct 29, 2009 at 5:02 PM, Jay McCarthy > wrote: >> >> It doesn't segfault for me... > > Yeah, it doesn't segfault on my local machine either...it must be something > that we simply haven't installed yet.? Like I said, VERY bare bones.? I even > had to install locate, which I thought was part of the core system. You need openssl... I don't know what parts there are, so I don't know what the smallest part you need is. Can you send the stack trace from gdb? > >> >> Can you run web-server/stuffers/hmac-sha1 from the repl and report what >> [these are bound to?] >> >> libcrypto >> >> EVP_SHA1 >> and >> HMAC-SHA1/raw >> > >> HMAC-SHA1/raw > # >> EVP_SHA1 > # Can you call these two and report the results? >> libcrypto > # > > Dave > -- 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 Thu Oct 29 17:26:37 2009 From: david.storrs at gmail.com (David Storrs) Date: Thu Oct 29 17:33:31 2009 Subject: [plt-scheme] Segfault in web server (due to missing library??) In-Reply-To: References: Message-ID: On Thu, Oct 29, 2009 at 5:17 PM, Jay McCarthy wrote: > On Thu, Oct 29, 2009 at 3:08 PM, David Storrs > wrote: > > > > > > On Thu, Oct 29, 2009 at 5:02 PM, Jay McCarthy > > wrote: > >> > >> It doesn't segfault for me... > > > > Yeah, it doesn't segfault on my local machine either...it must be > something > > that we simply haven't installed yet. Like I said, VERY bare bones. I > even > > had to install locate, which I thought was part of the core system. > > You need openssl... I don't know what parts there are, so I don't know > what the smallest part you need is. > sudo apt-get install openssl [...stuff...] openssl is already the newest version. > > Can you send the stack trace from gdb? > I'm actually having a little trouble turning the core file into a stack trace. gdb core "[long path]/core": not in executable format: File format not recognized" I tried compiling server.ss with mzc and doing gdb and running gdb compiles/server.zo core but that failed the same way. What is the right way to do this? > > >> HMAC-SHA1/raw > > # > >> EVP_SHA1 > > # > > Can you call these two and report the results? > > > (EVP_SHA1) # > (HMAC-SHA1/raw (string->bytes/utf-8 "key") (string->bytes/utf-8 "data")) SIGSEGV fault on 0xe00000000 Aborted Thanks for the fast feedback on this, Jay. No rush on it for now, though...I'm walking out the door and won't be around until this evening. Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091029/cd9918b4/attachment.htm From jay.mccarthy at gmail.com Thu Oct 29 17:35:41 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Oct 29 17:36:04 2009 Subject: [plt-scheme] Segfault in web server (due to missing library??) In-Reply-To: References: Message-ID: On Thu, Oct 29, 2009 at 3:26 PM, David Storrs wrote: > > > On Thu, Oct 29, 2009 at 5:17 PM, Jay McCarthy > wrote: >> >> On Thu, Oct 29, 2009 at 3:08 PM, David Storrs >> wrote: >> > >> > >> > On Thu, Oct 29, 2009 at 5:02 PM, Jay McCarthy >> > wrote: >> >> >> >> It doesn't segfault for me... >> > >> > Yeah, it doesn't segfault on my local machine either...it must be >> > something >> > that we simply haven't installed yet.? Like I said, VERY bare bones.? I >> > even >> > had to install locate, which I thought was part of the core system. >> >> You need openssl... I don't know what parts there are, so I don't know >> what the smallest part you need is. > > ? sudo apt-get install openssl > ? [...stuff...] > ? openssl is already the newest version. Try openssl-dev > >> >> Can you send the stack trace from gdb? > > I'm actually having a little trouble turning the core file into a stack > trace. > > ? gdb core > ? "[long path]/core": not in executable format: File format not recognized" > > I tried compiling server.ss with mzc and doing gdb and running gdb > compiles/server.zo core but that failed the same way.? What is the right way > to do this? I don't know about the core file, but you want to run mzscheme it gdb: $ gdb mzscheme ... > run -t hmac-sha1-user.ss ... error > bt > > > >> >> >> HMAC-SHA1/raw >> > # >> >> EVP_SHA1 >> > # >> >> Can you call these two and report the results? >> > > ?> (EVP_SHA1) > # > > ?> (HMAC-SHA1/raw (string->bytes/utf-8 "key") (string->bytes/utf-8 "data")) > SIGSEGV fault on 0xe00000000 > Aborted > > > Thanks for the fast feedback on this, Jay.? No rush on it for now, > though...I'm walking out the door and won't be around until this evening. > > Dave > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From geoff at knauth.org Thu Oct 29 20:16:07 2009 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Thu Oct 29 20:16:29 2009 Subject: [plt-scheme] [REQ] OpenCL Binding Cross Platform Testers In-Reply-To: References: Message-ID: <750A7A96-15F0-4C93-996A-67A24EAB313C@knauth.org> I can make the following two machines available: 1. Ubuntu 9.04, AMD Athlon 64, GeForce 6500 2. Windows 7, AMD Athlon 64 X2, GeForce 6150 LE If the graphics cards aren't new enough, I could be persuaded to upgrade the kids' computer. Geoff On Oct 28, 2009, at 19:18, Jay McCarthy wrote: > I am working on a binding for OpenCL [1] but the only hardware I have > is an OS X box. If you have Linux or Windows computer with compatible > hardware (ie newish Nvidia cards) and are willing to help me get the > binding compatible with those, let me know. From alex at schenkman.info Fri Oct 30 06:21:05 2009 From: alex at schenkman.info (Alex Schenkman) Date: Fri Oct 30 06:21:29 2009 Subject: [plt-scheme] Using scmutils (written in MIT-Scheme) In-Reply-To: <4AE457A0.7090501@cs.utah.edu> References: <67c0a2ee0910250221s76fc1b30y991ca6eacc3eda82@mail.gmail.com> <4AE457A0.7090501@cs.utah.edu> Message-ID: <67c0a2ee0910300321u4c22adf6h47c8ff0032780218@mail.gmail.com> Thanks for the link! On Sun, Oct 25, 2009 at 14:50, Chongkai Zhu wrote: > http://www.cs.brown.edu/pipermail/plt-scheme/2002-December/001450.html > > Alex Schenkman wrote: > >> Hello list: >> >> I'm new to Scheme and I'm reading the MIT books: >> 1) Structure and Interpretation of computer programs >> 2) Structure and Interpretation of classical mechanics >> >> The second book uses a library (scmutils) written in MIT-Scheme. >> >> Can I run this library within PLT Scheme? >> If not, is it possible to port? How difficult would it be? >> >> Thanks in advance! >> ------------------------------------------------------------------------ >> >> _________________________________________________ >> 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/20091030/04b3683b/attachment.htm From rahman.usta.88 at gmail.com Wed Oct 28 17:11:33 2009 From: rahman.usta.88 at gmail.com (rahman usta) Date: Fri Oct 30 07:22:25 2009 Subject: [plt-scheme] Moving-ball question - My question is when ball disappeared, instantly it comes to center of window Message-ID: <22f3b2670910281411ub944e45n9cf7dedccfed850e@mail.gmail.com> My question is when ball disappeared, instantly it comes to center of window ;; Teachpack: draw.ss (define-struct ball (radius x y x-dot y-dot color)) ;; A Ball is (make-ball Number Number Number Number Number Symbol) #| Template 1. Trivial case: Ball is entirely out of bounds. In that case, simply return true. 2. Divide: Draw the ball, erase it, then replace it by a moved copy. 3 Conquer: Nothing to do here. |# ;; move-ball-until-gone : Ball -> true ;; display a ball moving until it disappears from the window ;; uses generative recursion (define (move-ball-until-gone b) (cond ((out-of-bounds? b) true ) (else (and (draw-and-clear-ball b) (move-ball-until-gone (move-ball b)))))) (define DELTA-T 1) ; controls speed of simulation (define DELAY 0.1) ; seconds between updates ;; move-ball : Ball -> Ball ;; models the movement of a ball (define (move-ball b) (make-ball (ball-radius b) (+ (ball-x b) (* DELTA-T (ball-x-dot b))) (+ (ball-y b) (* DELTA-T (ball-y-dot b))) (ball-x-dot b) (ball-y-dot b) (ball-color b))) ;; drawing window dimensions (define WIDTH 300) (define HEIGHT 300) ;; draw-and-clear-ball : Ball -> true ;; draws ball, waits a short time, then clears it (define (draw-and-clear-ball b) (and (draw-solid-disk (make-posn (ball-x b) (ball-y b)) (ball-radius b) (ball-color b)) (sleep-for-a-while DELAY) (clear-solid-disk (make-posn (ball-x b) (ball-y b)) (ball-radius b) (ball-color b)))) ;; out-of-bounds? : Ball -> Boolean ;; determines if the ball is completely outside the drawing window (define (out-of-bounds? b) {local [(define ball-left (- (ball-x b) (ball-radius b))) (define ball-right (+ (ball-x b) (ball-radius b))) (define ball-top (- (ball-y b) (ball-radius b))) (define ball-bottom (+ (ball-y b) (ball-radius b)))] (or (< ball-right 0) (> ball-left WIDTH) (< ball-bottom 0) (> ball-top HEIGHT))}) ;; test the program (start WIDTH HEIGHT) (move-ball-until-gone (make-ball 10 50 50 3 0 'red)) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091028/1ffc1313/attachment.htm From david.storrs at gmail.com Fri Oct 30 12:34:51 2009 From: david.storrs at gmail.com (David Storrs) Date: Fri Oct 30 12:35:12 2009 Subject: [plt-scheme] Segfault in web server (due to missing library??) In-Reply-To: References: Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- (gdb) bt #0 scheme_gmp_tls_unload (s=0x2b4d47401448, data=0x0) at ../../../mzscheme/src/gmp/gmp.c:5810 #1 0x00002b4d4638ef6e in done_with_GC () at ../../../mzscheme/gc2/../src/thread.c:7438 #2 0x00002b4d463b8fe7 in garbage_collect (gc=0x607010, force_full=) at ../../../mzscheme/gc2/newgc.c:3236 #3 0x00002b4d463bdafc in GC_malloc_one_tagged (s=) at ../../../mzscheme/gc2/newgc.c:746 #4 0x00002b4d461dae39 in scheme_malloc_fail_ok (f=0x607010, s=0) at ../../../mzscheme/gc2/../src/salloc.c:407 #5 0x00002b4d4639fcd3 in scheme_make_vector (size=1114, fill=0x0) at ../../../mzscheme/gc2/../src/vector.c:185 #6 0x00002b4d4631b7ef in read_compact (port=0x2b4d47401f80, use_stack=) at ../../../mzscheme/gc2/../src/read.c:4590 #7 0x00002b4d4631d48c in read_compact_list (c=31, proper=1, use_stack=, port=0x2b4d47401f80) at ../../../mzscheme/gc2/../src/read.c:5020 #8 0x00002b4d4631c4b7 in read_compact (port=0x2b4d473f0ab8, use_stack=) at ../../../mzscheme/gc2/../src/read.c:4929 #9 0x00002b4d4631d579 in read_marshalled (type=100, port=0x2b4d47401f80) at ../../../mzscheme/gc2/../src/read.c:5067 #10 0x00002b4d4631bd95 in read_compact (port=0x2b4d47401f80, use_stack=) at ../../../mzscheme/gc2/../src/read.c:4677 #11 0x00002b4d4631d218 in read_compact (port=0x2b4d47401f80, use_stack=) at ../../../mzscheme/gc2/../src/read.c:4924 #12 0x00002b4d4631d579 in read_marshalled (type=3, port=0x2b4d47401f80) at ../../../mzscheme/gc2/../src/read.c:5067 #13 0x00002b4d4631c46e in read_compact (port=0x2b4d473f0ab8, use_stack=) at ../../../mzscheme/gc2/../src/read.c:4890 #14 0x00002b4d4631d4c5 in read_compact_list (c=0, proper=0, use_stack=, port=0x2b4d47401f80) at ../../../mzscheme/gc2/../src/read.c:5029 #15 0x00002b4d4631c4b7 in read_compact (port=0x2b4d473f0ab8, use_stack=) at ../../../mzscheme/gc2/../src/read.c:4929 #16 0x00002b4d4631d579 in read_marshalled (type=87, port=0x2b4d47401f80) at ../../../mzscheme/gc2/../src/read.c:5067 #17 0x00002b4d463165a0 in read_inner_inner (port=0x2b4d474020c0, stxsrc=0x2b4d474022e0, ht=0x2b4d4741e2c8, indentation=0x2b4d466600a0, params=0x7fff64b11f50, comment_mode=2, pre_char=-1, table=0x0, get_info=0) at ../../../mzscheme/gc2/../src/read.c:5303 #18 0x00002b4d4631ae81 in _internal_read (port=0x2b4d474020c0, stxsrc=0x2b4d474022e0, crc=, cant_fail=, honu_mode=, recur=0, expose_comment=0, extra_char=-1, init_readtable=0x0, magic_sym=0x0, magic_val=0x0, delay_load_info=0x2b4d47402300, get_info=0) at ../../../mzscheme/gc2/../src/read.c:2271 #19 0x00002b4d4631b30f in scheme_internal_read_k () at ../../../mzscheme/gc2/../src/read.c:2345 #20 0x00002b4d4623f4eb in scheme_top_level_do_worker (k=0x2b4d4631b240 , eb=, new_thread=0, dyn_state=0x0) at ../../../mzscheme/gc2/../src/fun.c:2078 #21 0x00002b4d46312490 in scheme_internal_read (port=0x2b4d470bd0e8, stxsrc=0x2b4d470bc038, crc=, cantfail=0, honu_mode=, recur=0, expose_comment=0, pre_char=, init_readtable=0x0, magic_sym=0x0, magic_val=0x0, delay_load_info=0x2b4d470bbf08) at ../../../mzscheme/gc2/../src/read.c:2379 #22 0x00002b4d462f7c12 in do_load_handler (data=) at ../../../mzscheme/gc2/../src/portfun.c:4050 #23 0x00002b4d46236599 in scheme_dynamic_wind (pre=0, act=0x2b4d462f7a80 , post=0x2b4d462f78b0 , jmp_handler=0, data=0x2b4d47402320) at ../../../mzscheme/gc2/../src/fun.c:7683 #24 0x00002b4d462f7663 in default_load (argc=1180893016, argv=0x2b4d4734ddc0) at ../../../mzscheme/gc2/../src/portfun.c:4282 #25 0x00002b4d473957a0 in ?? () #26 0x00007fff64b12860 in ?? () #27 0x00002b4d4734ddd0 in ?? () #28 0x0000000000000009 in ?? () #29 0x00002b4d4734de80 in ?? () #30 0x00002b4d4704b3e8 in ?? () #31 0x00002b4d4734dde0 in ?? () #32 0x00007fff64b12860 in ?? () #33 0x00002b4d4739b88f in ?? () #34 0x00002b4d46660070 in scheme_tail_call_waiting () from /usr/local/lib/libmzscheme3m-4.2.2.so #35 0x00002b4d473a587d in ?? () #36 0x00007fff64b12900 in ?? () #37 0x00007fff64b12a00 in ?? () #38 0x0000000000000007 in ?? () #39 0x00002b4d4662e720 in disappeared_binding_symbol () from /usr/local/lib/libmzscheme3m-4.2.2.so #40 0x00002b4d4665ffd8 in scheme_multiple_values () from /usr/local/lib/libmzscheme3m-4.2.2.so #41 0x0000000000000004 in ?? () #42 0x0000000000000001 in ?? () #43 0x00002b4d46211f6c in scheme_do_eval (obj=0x0, num_rands=1194646976, rands=0x7fff64b12d00, get_value=1) at ../../../mzscheme/gc2/../src/eval.c:8095 #44 0x00002b4d462330fc in apply_k () at ../../../mzscheme/gc2/../src/fun.c:2239 #45 0x00002b4d4623f4eb in scheme_top_level_do_worker (k=0x2b4d46233070 , eb=, new_thread=0, dyn_state=0x0) at ../../../mzscheme/gc2/../src/fun.c:2078 #46 0x00002b4d462a0525 in _module_resolve (modidx=0x2b4d47402428, stx=0x0, env=0x0, load_it=1) at ../../../mzscheme/gc2/../src/module.c:2979 #47 0x00002b4d462a3a10 in compute_require_names (menv=0x2b4d474024b8, phase=0x1, load_env=0x2b4d47400998, syntax_idx=0x2b4d47402460) at ../../../mzscheme/gc2/../src/module.c:3716 #48 0x00002b4d462ad8a6 in start_module (m=0x2b4d474025c8, env=0x2b4d47400998, restart=0, syntax_idx=0x2b4d47402460, eval_exp=0, eval_run=1, base_phase=0, cycle_list=0x2b4d474026e0) at ../../../mzscheme/gc2/../src/module.c:3781 #49 0x00002b4d462ad93a in start_module (m=0x2b4d47402868, env=0x2b4d47400998, restart=0, syntax_idx=0x2b4d47402720, eval_exp=0, eval_run=1, base_phase=0, cycle_list=0x2b4d47402980) at ../../../mzscheme/gc2/../src/module.c:3788 #50 0x00002b4d462ad93a in start_module (m=0x2b4d47402b08, env=0x2b4d47400998, restart=0, syntax_idx=0x2b4d474029c0, eval_exp=0, eval_run=1, base_phase=0, cycle_list=0x2b4d466600a0) at ../../../mzscheme/gc2/../src/module.c:3788 #51 0x00002b4d462b1c5c in _dynamic_require (argc=, argv=, env=0x2b4d47400998, get_bucket=0, phase=, mod_phase=0, indirect_ok=0, fail_with_error=1, position=-1) at ../../../mzscheme/gc2/../src/module.c:996 #52 0x00002b4d462b29f7 in scheme_dynamic_require (argc=2, argv=0x7fff64b13890) at ../../../mzscheme/gc2/../src/module.c:1061 #53 0x00002b4d4631190e in do_reader (modpath_stx=0x2b4d47402dc0, port=0x2b4d47402c78, stxsrc=0x2b4d47402c58, line=1, col=1, pos=1, get_info=0, ht=0x2b4d4741e2d8, indentation=0x2b4d466600a0, params=0x7fff64b14370) at ../../../mzscheme/gc2/../src/read.c:6041 #54 0x00002b4d463120c4 in read_lang (port=0x2b4d47055348, stxsrc=0x2b4d47054298, line=1, col=1, pos=1, get_info=0, ht=0x2b4d470558d0, indentation=0x2b4d466600a0, params=0x7fff64b14370, init_ch=0) at ../../../mzscheme/gc2/../src/read.c:6199 #55 0x00002b4d46314961 in read_inner_inner (port=0x2b4d47402c78, stxsrc=0x2b4d47402c58, ht=0x2b4d4741e2d8, indentation=0x2b4d466600a0, params=0x7fff64b14370, comment_mode=2, pre_char=-1, table=0x0, get_info=0) at ../../../mzscheme/gc2/../src/read.c:1378 #56 0x00002b4d4631ae81 in _internal_read (port=0x2b4d47402c78, stxsrc=0x2b4d47402c58, crc=, cant_fail=, honu_mode=, recur=0, expose_comment=0, extra_char=-1, init_readtable=0x0, magic_sym=0x0, magic_val=0x0, delay_load_info=0x2b4d47402e18, get_info=0) at ../../../mzscheme/gc2/../src/read.c:2271 #57 0x00002b4d4631b30f in scheme_internal_read_k () at ../../../mzscheme/gc2/../src/read.c:2345 #58 0x00002b4d4623f4eb in scheme_top_level_do_worker (k=0x2b4d4631b240 , eb=, new_thread=0, dyn_state=0x0) at ../../../mzscheme/gc2/../src/fun.c:2078 #59 0x00002b4d46312490 in scheme_internal_read (port=0x2b4d47055348, stxsrc=0x2b4d47054298, crc=, cantfail=0, honu_mode=, recur=0, expose_comment=0, pre_char=, init_readtable=0x0, magic_sym=0x0, magic_val=0x0, delay_load_info=0x2b4d4704fd68) at ../../../mzscheme/gc2/../src/read.c:2379 #60 0x00002b4d462f7c12 in do_load_handler (data=) at ../../../mzscheme/gc2/../src/portfun.c:4050 #61 0x00002b4d46236599 in scheme_dynamic_wind (pre=0, act=0x2b4d462f7a80 , post=0x2b4d462f78b0 , jmp_handler=0, data=0x2b4d47402e68) at ../../../mzscheme/gc2/../src/fun.c:7683 #62 0x00002b4d462f7663 in default_load (argc=1180893016, argv=0x2b4d4734de80) at ../../../mzscheme/gc2/../src/portfun.c:4282 #63 0x00002b4d473957a0 in ?? () #64 0x0000000000000004 in ?? () #65 0x00002b4d4626040d in add_symbol (start=140734882729340, end=0, value=0x0, gc_able=) at ../../../mzscheme/gc2/../src/codetab.inc:98 #66 0x00002b4d46277215 in on_demand () at ../../../mzscheme/gc2/../src/jit.c:8770 #67 0x00002b4d4739572f in ?? () #68 0x0000000000000001 in ?? () #69 0x00007fff64b14da8 in ?? () #70 0x000000000000001d in ?? () #71 0x00002b4d4662e720 in disappeared_binding_symbol () from /usr/local/lib/libmzscheme3m-4.2.2.so #72 0x00002b4d4665ffd8 in scheme_multiple_values () from /usr/local/lib/libmzscheme3m-4.2.2.so #73 0x0000000000000000 in ?? () (gdb) From david.storrs at gmail.com Fri Oct 30 12:45:15 2009 From: david.storrs at gmail.com (David Storrs) Date: Fri Oct 30 12:45:37 2009 Subject: [plt-scheme] Segfault in web server (due to missing library??) In-Reply-To: References: Message-ID: On Fri, Oct 30, 2009 at 12:34 PM, David Storrs wrote: > > > On Thu, Oct 29, 2009 at 5:35 PM, Jay McCarthy wrote: > >> Try openssl-dev >> > > > dpkg -S openssl-dev > dpkg: *openssl-dev* not found. [snip] > That's embarrassing; I copied the wrong chunk of my checking. What I meant to copy boils down to "yup not installed, couldn't find in package list via dpkg, doublechecked online at http://packages.debian.org/{stable|unstable|testing}/libdevel/ and found no openssl-dev library per se, just things that use it. Tried "sudo apt-get install libcurl4-openssl-dev" as a random pick; crash persists. Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091030/5141f026/attachment.htm From toddobryan at gmail.com Fri Oct 30 14:18:24 2009 From: toddobryan at gmail.com (Todd O'Bryan) Date: Fri Oct 30 14:18:46 2009 Subject: [plt-scheme] Segfault in web server (due to missing library??) In-Reply-To: References: Message-ID: <904774730910301118l1aee2478q1aef7ce5192d3b5@mail.gmail.com> There is a libssl-dev available in the Ubuntu repos. Probably the same in Debian. Also, I had something similar happen with libcrypt. There was a libcrypt.so.4 or something installed, but no libcrypt.so without a version. Adding a symlink from the unversioned name to the versioned name fixed it. Todd On Fri, Oct 30, 2009 at 12:45 PM, David Storrs wrote: > > > On Fri, Oct 30, 2009 at 12:34 PM, David Storrs > wrote: >> >> >> On Thu, Oct 29, 2009 at 5:35 PM, Jay McCarthy >> wrote: >>> >>> Try openssl-dev >> >> ?> dpkg -S openssl-dev >> dpkg: *openssl-dev* not found. [snip] > > That's embarrassing; I copied the wrong chunk of my checking. > > What I meant to copy boils down to "yup not installed, couldn't find in > package list via dpkg, doublechecked online at > http://packages.debian.org/{stable|unstable|testing}/libdevel/ and found no > openssl-dev library per se, just things that use it.? Tried "sudo apt-get > install libcurl4-openssl-dev" as a random pick; crash persists. > > Dave > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From david.storrs at gmail.com Fri Oct 30 16:44:42 2009 From: david.storrs at gmail.com (David Storrs) Date: Fri Oct 30 16:45:06 2009 Subject: [plt-scheme] Segfault in web server (due to missing library??) In-Reply-To: <904774730910301118l1aee2478q1aef7ce5192d3b5@mail.gmail.com> References: <904774730910301118l1aee2478q1aef7ce5192d3b5@mail.gmail.com> Message-ID: On Fri, Oct 30, 2009 at 2:18 PM, Todd O'Bryan wrote: > There is a libssl-dev available in the Ubuntu repos. Probably the same > in Debian. > > Also, I had something similar happen with libcrypt. There was a > libcrypt.so.4 or something installed, but no libcrypt.so without a > version. Adding a symlink from the unversioned name to the versioned > name fixed it. > > Todd > Hey Tood, Thanks for the suggestions. I installed libssl-dev; it didn't add anything in /usr/lib, just header files and such (not too surprising, I guess). /usr/lib/libssl.so is a link to /usr/lib/libssl.so.0.9.8, and I previously added a link from libcrypto.so -> libcrypto.so.0.9.8. Still no joy, unfortunately. Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091030/5e6294ae/attachment-0001.htm From ntoronto at cs.byu.edu Fri Oct 30 17:08:20 2009 From: ntoronto at cs.byu.edu (Neil Toronto) Date: Fri Oct 30 17:07:47 2009 Subject: [plt-scheme] Re: Drscheme icon In-Reply-To: <19171.40354.809912.556891@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> Message-ID: <4AEB55C4.8080109@cs.byu.edu> I got inspired to do a little Inkscape-ing. I've attached the results. plt-logo-orig.svg is in red and blue. I darkened the lower region for variety and balance. plt-logo-tri.svg is in red, blue and deep royal purple. I know it's a controversial change, but I like it a lot. What do you y'all think? Neil Eli Barzilay wrote: > Sorry, I meant to reply to this earlier... We have a big version of > the logo, split into two pngs, one with the logo and one with the > shadow. I've put them at > > http://tmp.barzilay.org/plt-logo-3d.png > http://tmp.barzilay.org/plt-logo-shadow-3d.png > > I'm not sure whether it's possible to make a precise SVG version, > since the logo is not using some simple gradients, it's a result of > slapping the lambda logo on a 3d shield, and rendering it in povray. > John Clements did that part. I do have two povray files, in case > that's more helpful. -------------- next part -------------- A non-text attachment was scrubbed... Name: plt-logo-orig.svg Type: image/svg+xml Size: 13052 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091030/38e9bc10/plt-logo-orig-0001.svg -------------- next part -------------- A non-text attachment was scrubbed... Name: plt-logo-tri.svg Type: image/svg+xml Size: 13070 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091030/38e9bc10/plt-logo-tri-0001.svg From marek at xivilization.net Fri Oct 30 17:09:07 2009 From: marek at xivilization.net (Marek Kubica) Date: Fri Oct 30 17:09:43 2009 Subject: [plt-scheme] Re: Drscheme icon In-Reply-To: <4AEB549D.9020204@cs.byu.edu> References: <595b9ab20910230524ydafb7fdx7c902acd0aa156f1@mail.gmail.com> <20091024233927.2eac1379@halmanfloyd.lan.local> <595b9ab20910241727u534be9d1ue42a492b32d2179c@mail.gmail.com> <19171.40354.809912.556891@winooski.ccs.neu.edu> <4AEB549D.9020204@cs.byu.edu> Message-ID: <20091030220907.281c9b1b@xivilization.net> On Fri, 30 Oct 2009 15:03:25 -0600 Neil Toronto wrote: > I got inspired to do a little Inkscape-ing, and attached the results. > (I've also attached a couple of hi-ish-res PNGs for those still > living in the dark ages. :) I think they are awesome. Thanks! > plt-logo-orig.svg is in red and blue. I darkened the lower region for > some variety. > > plt-logo-tri.svg is in red, blue and deep royal purple. I know it's a > controversial change, but I like it a lot. > > What do you y'all think? I think the lambda looks a bit tilted backward and the long line is a bit too thin. If you could do some minor edits, it would be a great alternative to the rendered logo. And I also prefer the "original" colors, but it might be that I got used to them. Thanks again, Marek From robby at eecs.northwestern.edu Fri Oct 30 17:11:09 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Fri Oct 30 17:11:33 2009 Subject: [plt-scheme] Re: Drscheme icon In-Reply-To: <20091030220907.281c9b1b@xivilization.net> References: <595b9ab20910230524ydafb7fdx7c902acd0aa156f1@mail.gmail.com> <20091024233927.2eac1379@halmanfloyd.lan.local> <595b9ab20910241727u534be9d1ue42a492b32d2179c@mail.gmail.com> <19171.40354.809912.556891@winooski.ccs.neu.edu> <4AEB549D.9020204@cs.byu.edu> <20091030220907.281c9b1b@xivilization.net> Message-ID: <932b2f1f0910301411w16bb3281i2f9db18be1502abb@mail.gmail.com> I like the new colors. Very cool! Robby On Fri, Oct 30, 2009 at 4:09 PM, Marek Kubica wrote: > On Fri, 30 Oct 2009 15:03:25 -0600 > Neil Toronto wrote: > >> I got inspired to do a little Inkscape-ing, and attached the results. >> (I've also attached a couple of hi-ish-res PNGs for those still >> living in the dark ages. :) > > I think they are awesome. Thanks! > >> plt-logo-orig.svg is in red and blue. I darkened the lower region for >> some variety. >> >> plt-logo-tri.svg is in red, blue and deep royal purple. I know it's a >> controversial change, but I like it a lot. >> >> What do you y'all think? > > I think the lambda looks a bit tilted backward and the long line is a > bit too thin. If you could do some minor edits, it would be a great > alternative to the rendered logo. > > And I also prefer the "original" colors, but it might be that I got > used to them. > > Thanks again, > Marek > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From pocmatos at gmail.com Fri Oct 30 17:20:19 2009 From: pocmatos at gmail.com (Paulo J. Matos) Date: Fri Oct 30 17:20:45 2009 Subject: [plt-scheme] Re: Drscheme icon In-Reply-To: <4AEB55C4.8080109@cs.byu.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> Message-ID: <1256937619.395.3.camel@turing> I really like the new colors and the logos. They give a feel of PLT-Scheme New Generation! :) Maybe it would be good to prepare them for a PLT-Scheme 500. On Fri, 2009-10-30 at 15:08 -0600, Neil Toronto wrote: > I got inspired to do a little Inkscape-ing. I've attached the results. > > plt-logo-orig.svg is in red and blue. I darkened the lower region for > variety and balance. > > plt-logo-tri.svg is in red, blue and deep royal purple. I know it's a > controversial change, but I like it a lot. > > What do you y'all think? > > Neil > > Eli Barzilay wrote: > > Sorry, I meant to reply to this earlier... We have a big version of > > the logo, split into two pngs, one with the logo and one with the > > shadow. I've put them at > > > > http://tmp.barzilay.org/plt-logo-3d.png > > http://tmp.barzilay.org/plt-logo-shadow-3d.png > > > > I'm not sure whether it's possible to make a precise SVG version, > > since the logo is not using some simple gradients, it's a result of > > slapping the lambda logo on a 3d shield, and rendering it in povray. > > John Clements did that part. I do have two povray files, in case > > that's more helpful. > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From jay.mccarthy at gmail.com Fri Oct 30 18:31:39 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Fri Oct 30 18:32:01 2009 Subject: [plt-scheme] Segfault in web server (due to missing library??) In-Reply-To: References: Message-ID: I really don't know what else to suggest... Can you run anything from the openssl collection? (In PLT) Jay On Fri, Oct 30, 2009 at 10:34 AM, David Storrs wrote: > > > On Thu, Oct 29, 2009 at 5:35 PM, Jay McCarthy > wrote: >> >> Try openssl-dev > > ?> dpkg -S openssl-dev > dpkg: *openssl-dev* not found. > > ?> dpkg -S openssl > ? [...among other things:]? libssl-dev: > > ?sudo apt-get install libssl-dev > Reading package lists... Done > Building dependency tree > Reading state information... Done > libssl-dev is already the newest version. > 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. > >> >> Can you send the stack trace from gdb? > > Stack trace attached. > > Dave > -- 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 Fri Oct 30 19:08:27 2009 From: david.storrs at gmail.com (David Storrs) Date: Fri Oct 30 19:08:47 2009 Subject: [plt-scheme] Segfault in web server (due to missing library??) In-Reply-To: References: Message-ID: On Fri, Oct 30, 2009 at 6:31 PM, Jay McCarthy wrote: > I really don't know what else to suggest... > > Can you run anything from the openssl collection? (In PLT) Yep, and it says the library is loading: > (if ssl-available? (display "Has SSL\n") (display "Does not have SSL")) Has SSL Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091030/184c1839/attachment.htm From sk at cs.brown.edu Fri Oct 30 19:11:18 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Fri Oct 30 19:12:01 2009 Subject: [plt-scheme] Re: Drscheme icon In-Reply-To: <1256937619.395.3.camel@turing> 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> Message-ID: The look is great, but boy, is that lambda ugly! Please read http://www.ece.northwestern.edu/~robby/logos/ (Search for "typeface".) Shriram From clements at brinckerhoff.org Fri Oct 30 19:29:49 2009 From: clements at brinckerhoff.org (John Clements) Date: Fri Oct 30 19:30:25 2009 Subject: [plt-scheme] Re: Drscheme icon In-Reply-To: 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> Message-ID: On Oct 30, 2009, at 4:11 PM, Shriram Krishnamurthi wrote: > The look is great, but boy, is that lambda ugly! Please read > > http://www.ece.northwestern.edu/~robby/logos/ > > (Search for "typeface".) To follow up on this: In case it's not already obvious from the pointer that Shriram provided, this web page includes both postscript and SVG http://www.ece.northwestern.edu/~robby/logos/plt.ps http://www.ece.northwestern.edu/~robby/logos/plt.svg ... that are sufficiently brief and elegant (the ps is hand-written) that it should be possible to import into the svg editor of your choice and decorate manually. I bet starting with the .svg and using the SVG editor of your choice, it would be the work of half an hour to duplicate the work you've already done. 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/20091030/ce03c9a8/smime-0001.bin From david.storrs at gmail.com Fri Oct 30 20:51:50 2009 From: david.storrs at gmail.com (David Storrs) Date: Fri Oct 30 20:52:12 2009 Subject: [plt-scheme] Segfault in web server (due to missing library??) In-Reply-To: References: Message-ID: Ok, we've got a bit more information. Here's a test file (we have it saved as "test-hmac.c"): #include #include int main(int argc, char** argv) { unsigned char foo[10] = "boo"; unsigned char* res = malloc(20); printf("%s\n", SHA1(foo, 10, res)); free(res); } We built this on the Debian 5.0 system in question, using gcc -lcrypto test-hmac.c. If we run it as-is, it works. If we change: printf("%s\n", SHA1(foo, 10, res)); to printf("%s\n", SHA1(foo, 10, 0)); ...it segfaults. Here is the code from web-server/stuffers/hmac-sha1.ss: (define HMAC-SHA1/raw (if libcrypto (get-ffi-obj 'HMAC libcrypto (_fun [EVP_MD : _fpointer = (EVP_SHA1)] [key : _bytes] [key_len : _int = (bytes-length key)] [data : _bytes] [data_len : _int = (bytes-length data)] [md : _int = 0] [md_len : _int = 0] ;; @@@@ Note the "0" here. f-> _pointer)) (lambda (key data) (error 'HMAC-SHA1/raw "libcrypto could not load")))) The last argument to the SHA1() function is where to put the result. When passed a NULL, it allocates its own return space. We are guessing that, on the Debian box, NULL is defined to something other than 0, so when it receives a literal 0, it tries to write to 0x0 and segfaults. We're trying to track down where NULL is defined now. Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091030/f3f8a774/attachment.htm From geoff at knauth.org Fri Oct 30 21:47:04 2009 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Fri Oct 30 21:47:24 2009 Subject: [plt-scheme] Segfault in web server (due to missing library??) In-Reply-To: References: Message-ID: <1C6977DC-DB2E-4CB7-923D-47A19D353A5A@knauth.org> On Oct 30, 2009, at 20:51, David Storrs wrote: > Ok, we've got a bit more information. Here's a test file (we have > it saved as "test-hmac.c"): > > #include > #include > > int main(int argc, char** argv) { > unsigned char foo[10] = "boo"; > unsigned char* res = malloc(20); > printf("%s\n", SHA1(foo, 10, res)); > free(res); > } > > We built this on the Debian 5.0 system in question, using gcc - > lcrypto test-hmac.c. If we run it as-is, it works. If we change: > > printf("%s\n", SHA1(foo, 10, res)); > to > printf("%s\n", SHA1(foo, 10, 0)); > > ...it segfaults. Here is the code from web-server/stuffers/hmac- > sha1.ss: > > (define HMAC-SHA1/raw > (if libcrypto > (get-ffi-obj 'HMAC libcrypto > (_fun [EVP_MD : _fpointer = (EVP_SHA1)] > [key : _bytes] > [key_len : _int = (bytes-length key)] > [data : _bytes] > [data_len : _int = (bytes-length data)] > [md : _int = 0] > [md_len : _int = 0] ;; @@@@ Note the > "0" here. > f-> > _pointer)) > (lambda (key data) (error 'HMAC-SHA1/raw "libcrypto could not > load")))) > > > The last argument to the SHA1() function is where to put the > result. When passed a NULL, it allocates its own return space. We > are guessing that, on the Debian box, NULL is defined to something > other than 0, so when it receives a literal 0, it tries to write to > 0x0 and segfaults. > > We're trying to track down where NULL is defined now. I looked at the source to SHA1: unsigned char *SHA1(const unsigned char *d, size_t n, unsigned char *md) { SHA_CTX c; static unsigned char m[SHA_DIGEST_LENGTH]; if (md == NULL) md=m; if (!SHA1_Init(&c)) return NULL; SHA1_Update(&c,d,n); SHA1_Final(md,&c); OPENSSL_cleanse(&c,sizeof(c)); return(md); } If md is not specified, the pointer returned is a static buffer inside the function. I don't know if that presents the FFI with a problem. That doesn't explain the crash in your pure C program. On my Mac OS X 10.6 and Ubuntu 9.04 systems, I had to add #include to the C file, else the compiler thought SHA1 returned an int. On both systems, both versions of your program ran fine and returned identical results. If I were in your shoes, I'd compile my open libcrypto with debug symbols, and step through your test program with gdb to see where the SIGSEGV is coming from. I also looked at the source to HMAC referenced in your FFI code: unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, const unsigned char *d, size_t n, unsigned char *md, unsigned int *md_len) { HMAC_CTX c; static unsigned char m[EVP_MAX_MD_SIZE]; if (md == NULL) md=m; HMAC_CTX_init(&c); HMAC_Init(&c,key,key_len,evp_md); HMAC_Update(&c,d,n); HMAC_Final(&c,md,md_len); HMAC_CTX_cleanup(&c); return(md); } My only observation is that md is unsigned char *, but your FFI code calls it int. From jay.mccarthy at gmail.com Fri Oct 30 22:00:47 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Fri Oct 30 22:01:08 2009 Subject: [plt-scheme] Segfault in web server (due to missing library??) In-Reply-To: References: Message-ID: This might be more compatible; can you try it? (define HMAC-SHA1/raw (if libcrypto (get-ffi-obj 'HMAC libcrypto (_fun [EVP_MD : _fpointer = (EVP_SHA1)] [key : _bytes] [key_len : _int = (bytes-length key)] [data : _bytes] [data_len : _int = (bytes-length data)] [md : _pointer = #f] [md_len : _uint = 0] f-> _pointer)) (lambda (key data) (error 'HMAC-SHA1/raw "libcrypto could not load")))) On Fri, Oct 30, 2009 at 6:51 PM, David Storrs wrote: > Ok, we've got a bit more information.? Here's a test file (we have it saved > as "test-hmac.c"): > > #include > #include > > int main(int argc, char** argv) { > ? unsigned char foo[10] = "boo"; > ? unsigned char* res = malloc(20); > ? printf("%s\n", SHA1(foo, 10, res)); > ? free(res); > } > > We built this on the Debian 5.0 system in question, using gcc -lcrypto > test-hmac.c.? If we run it as-is, it works.? If we change: > > ? printf("%s\n", SHA1(foo, 10, res)); > to > ? printf("%s\n", SHA1(foo, 10, 0)); > > ...it segfaults.? Here is the code from web-server/stuffers/hmac-sha1.ss: > > (define HMAC-SHA1/raw > ? (if libcrypto > ????? (get-ffi-obj 'HMAC libcrypto > ?????????????????? (_fun [EVP_MD : _fpointer = (EVP_SHA1)] > ???????????????????????? [key : _bytes] > ???????????????????????? [key_len : _int = (bytes-length key)] > ???????????????????????? [data : _bytes] > ???????????????????????? [data_len : _int = (bytes-length data)] > ???????????????????????? [md : _int = 0] > ???????????????????????? [md_len : _int = 0]???? ;;? @@@@ Note the "0" here. > ???????????????????????? f-> > ???????????????????????? _pointer)) > ????? (lambda (key data) (error 'HMAC-SHA1/raw "libcrypto could not > load")))) > > > The last argument to the SHA1() function is where to put the result.? When > passed a NULL, it allocates its own return space.? We are guessing that, on > the Debian box, NULL is defined to something other than 0, so when it > receives a literal 0, it tries to write to 0x0 and segfaults. > > We're trying to track down where NULL is defined now. > > Dave > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From scott at adrenaline.com Sat Oct 31 00:26:04 2009 From: scott at adrenaline.com (Scott McLoughlin) Date: Sat Oct 31 00:26:35 2009 Subject: [plt-scheme] vector-copy in typed scheme Message-ID: <4AEBBC5C.7010803@adrenaline.com> Kind Schemely Folk, I must be having a brain fart because i'm getting the following error using vector-copy! from within typed scheme. typecheck: untyped identifier vector-copy! imported from module in: vector-copy! Simply dummy test code at end of message. Stuck in default args in case that had some effect. (Generally wish I had a better mental "machine model" of exactly how typed-scheme worked). Anyway, odd because build-vector from the same module works just dandy. Scott Sill test code follows ---------------------- (define: (a) (vcpy! [dest : (Vectorof a)] [dest-start : Integer] [src : (Vectorof a)]) : (Vectorof a) (vector-copy! dest dest-start src 0 1) dest) From ntoronto at cs.byu.edu Sat Oct 31 00:57:56 2009 From: ntoronto at cs.byu.edu (Neil Toronto) Date: Sat Oct 31 00:58:34 2009 Subject: [plt-scheme] Re: Drscheme icon In-Reply-To: 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> Message-ID: <4AEBC3D4.2000801@cs.byu.edu> You're the boss(es). I've attached an update. Leg warmers are, like, totally 80s, but if you want 'em on your lambda, you've got 'em. Let me know if you want a popped collar on that sucker. Neil Shriram Krishnamurthi wrote: > The look is great, but boy, is that lambda ugly! Please read > > http://www.ece.northwestern.edu/~robby/logos/ > > (Search for "typeface".) > > Shriram -------------- next part -------------- A non-text attachment was scrubbed... Name: plt-logo-lambda-legwarmers.svg Type: image/svg+xml Size: 14341 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091030/cc7119c4/plt-logo-lambda-legwarmers-0001.svg -------------- next part -------------- A non-text attachment was scrubbed... Name: plt-logo-orig-lambda-legwarmers.svg Type: image/svg+xml Size: 14328 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091030/cc7119c4/plt-logo-orig-lambda-legwarmers-0001.svg From neil at neilvandyke.org Sat Oct 31 00:28:39 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Sat Oct 31 01:28:58 2009 Subject: [plt-scheme] Re: Drscheme icon In-Reply-To: <4AEBC3D4.2000801@cs.byu.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> Message-ID: <4AEBBCF7.1050501@neilvandyke.org> Neil Toronto wrote at 10/31/2009 12:57 AM: > You're the boss(es). I've attached an update. > > Leg warmers are, like, totally 80s, but if you want 'em on your > lambda, you've got 'em. Let me know if you want a popped collar on > that sucker. > > Neil The current PLT red-blue logo has a yin-yang thing going on. This one with purple has red and blue joining between the lambda legs. (Google "purple lambda".) Neil From noelwelsh at gmail.com Sat Oct 31 03:08:48 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Sat Oct 31 03:09:07 2009 Subject: [plt-scheme] Segfault in web server (due to missing library??) In-Reply-To: References: <904774730910301118l1aee2478q1aef7ce5192d3b5@mail.gmail.com> Message-ID: I haven't been following this threads too closely. That said, if this is really a missing library issue, if you run ldd (part of GNU binutils) on the various shared libraries involved you'll see if they have any missing dependencies. HTH, N. From samth at ccs.neu.edu Sat Oct 31 08:30:15 2009 From: samth at ccs.neu.edu (Sam TH) Date: Sat Oct 31 08:30:53 2009 Subject: [plt-scheme] vector-copy in typed scheme In-Reply-To: <4AEBBC5C.7010803@adrenaline.com> References: <4AEBBC5C.7010803@adrenaline.com> Message-ID: <63bb19ae0910310530u5c3ae7b4labd6734d0cf02a47@mail.gmail.com> On Sat, Oct 31, 2009 at 12:26 AM, Scott McLoughlin wrote: > Kind Schemely Folk, > > I must be having a brain fart because i'm getting the following > error using vector-copy! from within typed scheme. > > typecheck: untyped identifier vector-copy! imported from module > in: vector-copy! This just means that there isn't a type for `vector-copy!' implemented in Typed Scheme yet. I plan to have better vector support in Typed Scheme in a few days. -- sam th samth@ccs.neu.edu From tewk at cs.utah.edu Sat Oct 31 09:24:42 2009 From: tewk at cs.utah.edu (Kevin Tew) Date: Sat Oct 31 09:25:05 2009 Subject: [plt-scheme] Segfault in web server (due to missing library??) In-Reply-To: References: <904774730910301118l1aee2478q1aef7ce5192d3b5@mail.gmail.com> Message-ID: <4AEC3A9A.8070507@cs.utah.edu> I think the first segfault you are seeing is due to garbage collection, not an actual SIGSEGV you need to run handle sigsegv nostop handle sigsegv noprint in gdb before you launch your program if your using the default (3m) collector. Kevin Noel Welsh wrote: > I haven't been following this threads too closely. That said, if this > is really a missing library issue, if you run ldd (part of GNU > binutils) on the various shared libraries involved you'll see if they > have any missing dependencies. > > HTH, > N. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From eeepc904 at gmail.com Sat Oct 31 10:27:27 2009 From: eeepc904 at gmail.com (Nathan Paulino Campos) Date: Sat Oct 31 10:27:55 2009 Subject: [plt-scheme] Starting At GUI Scheme Applications Message-ID: <1256999247.6397.6.camel@eeepc> Hello, I'm learning PLT Scheme and I want to start building GUI applications, but where I can find a good tutorial to learn this? Thanks, Nathan Paulino Campos From matthias at ccs.neu.edu Sat Oct 31 11:31:50 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Sat Oct 31 11:32:27 2009 Subject: [plt-scheme] vector-copy in typed scheme In-Reply-To: <63bb19ae0910310530u5c3ae7b4labd6734d0cf02a47@mail.gmail.com> References: <4AEBBC5C.7010803@adrenaline.com> <63bb19ae0910310530u5c3ae7b4labd6734d0cf02a47@mail.gmail.com> Message-ID: <9BD791A4-5FD2-436E-9812-17B47D0157C3@ccs.neu.edu> Folks, that's short for Typed Scheme is still in an experimental phase and that we really really appreciate bug reports that request missing features, point out problems, nail bad error messages, etc. Thanks! -- Matthias On Oct 31, 2009, at 8:30 AM, Sam TH wrote: > On Sat, Oct 31, 2009 at 12:26 AM, Scott McLoughlin > wrote: >> Kind Schemely Folk, >> >> I must be having a brain fart because i'm getting the following >> error using vector-copy! from within typed scheme. >> >> typecheck: untyped identifier vector-copy! imported from module >> in: vector-copy! > > This just means that there isn't a type for `vector-copy!' implemented > in Typed Scheme yet. I plan to have better vector support in Typed > Scheme in a few days. > > -- > sam th > samth@ccs.neu.edu > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From grettke at acm.org Sat Oct 31 13:31:58 2009 From: grettke at acm.org (Grant Rettke) Date: Sat Oct 31 13:40:32 2009 Subject: [plt-scheme] Starting At GUI Scheme Applications In-Reply-To: <1256999247.6397.6.camel@eeepc> References: <1256999247.6397.6.camel@eeepc> Message-ID: <756daca50910311031u72ded804jf8874331a0d3e0f9@mail.gmail.com> On Sat, Oct 31, 2009 at 9:27 AM, Nathan Paulino Campos wrote: > ?I'm learning PLT Scheme and I want to start building GUI applications, > but where I can find a good tutorial to learn this? Hi Nathan I haven't see a tutorial per se but you could start here and here in particular: http://docs.plt-scheme.org/gui/index.html http://docs.plt-scheme.org/framework/index.html From matthias at ccs.neu.edu Sat Oct 31 13:43:05 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Sat Oct 31 13:43:44 2009 Subject: [plt-scheme] Moving-ball question - My question is when ball disappeared, instantly it comes to center of window In-Reply-To: <22f3b2670910281411ub944e45n9cf7dedccfed850e@mail.gmail.com> References: <22f3b2670910281411ub944e45n9cf7dedccfed850e@mail.gmail.com> Message-ID: <5CF47B1E-E7AD-434A-A313-33DF0D7A87EB@ccs.neu.edu> On Oct 28, 2009, at 5:11 PM, rahman usta wrote: > My question is when ball disappeared, instantly it comes to center > of window Not in my drscheme. The ball disappears and the program stops. You may wish to add a call to (stop) (define (move-ball-until-gone b) (cond ((out-of-bounds? b) (stop)) (else (and (draw-and-clear-ball b) (move-ball-until-gone (move-ball b)))))) > > ;; Teachpack: draw.ss > > (define-struct ball (radius x y x-dot y-dot color)) > ;; A Ball is (make-ball Number Number Number Number Number Symbol) > > #| Template > 1. Trivial case: > Ball is entirely out of bounds. In that case, simply return true. > 2. Divide: > Draw the ball, erase it, then replace it by a moved copy. > 3 Conquer: > Nothing to do here. > |# > > ;; move-ball-until-gone : Ball -> true > ;; display a ball moving until it disappears from the window > ;; uses generative recursion > (define (move-ball-until-gone b) > > (cond > ((out-of-bounds? b) true ) > (else (and > (draw-and-clear-ball b) > (move-ball-until-gone (move-ball b)))))) > > (define DELTA-T 1) ; controls speed of simulation > (define DELAY 0.1) ; seconds between updates > > ;; move-ball : Ball -> Ball > ;; models the movement of a ball > (define (move-ball b) > (make-ball (ball-radius b) > (+ (ball-x b) (* DELTA-T (ball-x-dot b))) > (+ (ball-y b) (* DELTA-T (ball-y-dot b))) > (ball-x-dot b) > (ball-y-dot b) > (ball-color b))) > > ;; drawing window dimensions > (define WIDTH 300) > (define HEIGHT 300) > > ;; draw-and-clear-ball : Ball -> true > ;; draws ball, waits a short time, then clears it > (define (draw-and-clear-ball b) > (and (draw-solid-disk (make-posn (ball-x b) (ball-y b)) > (ball-radius b) > (ball-color b)) > (sleep-for-a-while DELAY) > (clear-solid-disk (make-posn (ball-x b) (ball-y b)) > (ball-radius b) > (ball-color b)))) > > ;; out-of-bounds? : Ball -> Boolean > ;; determines if the ball is completely outside the drawing window > (define (out-of-bounds? b) > > {local [(define ball-left (- (ball-x b) (ball-radius b))) > (define ball-right (+ (ball-x b) (ball-radius b))) > (define ball-top (- (ball-y b) (ball-radius b))) > (define ball-bottom (+ (ball-y b) (ball-radius b)))] > (or (< ball-right 0) (> ball-left WIDTH) > (< ball-bottom 0) (> ball-top HEIGHT))}) > > ;; test the program > (start WIDTH HEIGHT) > (move-ball-until-gone > (make-ball 10 50 50 3 0 'red)) > > > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From clements at brinckerhoff.org Sat Oct 31 14:51:26 2009 From: clements at brinckerhoff.org (John Clements) Date: Sat Oct 31 14:51:51 2009 Subject: [plt-scheme] Re: Drscheme icon In-Reply-To: <4AEBC3D4.2000801@cs.byu.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> Message-ID: On Oct 30, 2009, at 9:57 PM, Neil Toronto wrote: > You're the boss(es). I've attached an update. > > Leg warmers are, like, totally 80s, but if you want 'em on your > lambda, you've got 'em. Let me know if you want a popped collar on > that sucker. > I see what you mean: that lambda looks stately, and pretty much wrecks the dynamism of the shiny nineties look. I still agree with Shriram's comments about the other lambda; that left leg looks ugly and grafted- on. FWIW, I'm always happy to see the logo change. 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/20091031/98092de7/smime.bin From ntoronto at cs.byu.edu Sat Oct 31 16:19:10 2009 From: ntoronto at cs.byu.edu (Neil Toronto) Date: Sat Oct 31 16:19:34 2009 Subject: [plt-scheme] Re: Drscheme icon In-Reply-To: <4AEBBCF7.1050501@neilvandyke.org> 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> Message-ID: <4AEC9BBE.3010202@cs.byu.edu> Neil Van Dyke wrote: > Neil Toronto wrote at 10/31/2009 12:57 AM: >> You're the boss(es). I've attached an update. >> >> Leg warmers are, like, totally 80s, but if you want 'em on your >> lambda, you've got 'em. Let me know if you want a popped collar on >> that sucker. >> >> Neil > > The current PLT red-blue logo has a yin-yang thing going on. > > This one with purple has red and blue joining between the lambda legs. > (Google "purple lambda".) Yikes! Freud would have a field day with these. Well, since we don't want PLT to be misidentified, I've had another go and attached the result. Mahogany lambdas aren't taken, are they? It looks like chocolate. Yum. Put a stick in that sucker and give it a lick. FWIW, anyone can experiment with the color by changing the second stop of linearGradient4073 in a text editor. Neil T -------------- next part -------------- A non-text attachment was scrubbed... Name: plt-logo-mahogany.svg Type: image/svg+xml Size: 14054 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091031/10978635/plt-logo-mahogany-0001.svg From ntoronto at cs.byu.edu Sat Oct 31 16:35:54 2009 From: ntoronto at cs.byu.edu (Neil Toronto) Date: Sat Oct 31 16:36:26 2009 Subject: [plt-scheme] Re: Drscheme icon In-Reply-To: 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> Message-ID: <4AEC9FAA.7070806@cs.byu.edu> John Clements wrote: > > On Oct 30, 2009, at 9:57 PM, Neil Toronto wrote: > >> You're the boss(es). I've attached an update. >> >> Leg warmers are, like, totally 80s, but if you want 'em on your >> lambda, you've got 'em. Let me know if you want a popped collar on >> that sucker. >> > > I see what you mean: that lambda looks stately, and pretty much wrecks > the dynamism of the shiny nineties look. Actually, I was just teasing Shriram to get back at him for calling mine ugly. Either that, or I was making a subtle philosophical point about the rise and fall of fashions (note: backported explanation). Wait... "shiny nineties look"? :p > I still agree with Shriram's > comments about the other lambda; that left leg looks ugly and grafted-on. Yeah, I wasn't too focused on making the lambda look good - I was all about the shiny. I also didn't know there was an SVG already. It was annoying to extract the lambda from the SVG. (I had to play some CSG ops + simplification games because the lambda is made of negative space.) I've attached the extracted lambda for anyone who wants it. > FWIW, I'm always happy to see the logo change. We have the last logo designer's blessing! Full steam ahead! :) Neil T -------------- next part -------------- A non-text attachment was scrubbed... Name: plt-lambda.svg Type: image/svg+xml Size: 4530 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091031/297d6d25/plt-lambda.svg From neil at neilvandyke.org Sat Oct 31 16:39:21 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Sat Oct 31 16:39:40 2009 Subject: [plt-scheme] Re: Drscheme icon In-Reply-To: <4AEC9BBE.3010202@cs.byu.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> Message-ID: <4AECA079.20309@neilvandyke.org> I really like the existing simple, pure red-and-blue design, like v204-205 and v206-present from the logos page. (I intentionally won't deconstruct it in terms of Texas origin and Red State vs. Blue State and who prevails when the twain clash.) What about simply making a gradientized SVG version of the existing logo, but otherwise changing nothing, for use with various desktop software that wants everything to be gradientized? Neil V. From eli at barzilay.org Sat Oct 31 18:12:34 2009 From: eli at barzilay.org (Eli Barzilay) Date: Sat Oct 31 18:12:55 2009 Subject: [plt-scheme] Re: Drscheme icon In-Reply-To: <4AECA079.20309@neilvandyke.org> 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> Message-ID: <19180.46674.307363.222495@winooski.ccs.neu.edu> On Oct 31, Neil Van Dyke wrote: > I really like the existing simple, pure red-and-blue design, like > v204-205 and v206-present from the logos page. +1 > What about simply making a gradientized SVG version of the existing > logo, but otherwise changing nothing, for use with various desktop > software that wants everything to be gradientized? +1 IMO, the current logo's lambda is not great (even given the huge obsession about it), and I wouldn't mind to see it change. Also the "shiny 90s look" looks a little old in comparison to new candy like icons, so maybe it would be good to have a different style svg specifically for icons. But changing the colors is a much bigger change -- especially I think that it works well to have the "\" split of the two colors. So I would like to see both of the left parts be identical -- it bugs me that the gradients are not the same, and having a third color, uh, between the legs of lambda really doesn't look too good. (I also showed it to my wife, and let's just say that "chocolate" wasn't the first association that she had.) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From spdegabrielle at gmail.com Sat Oct 31 19:33:19 2009 From: spdegabrielle at gmail.com (Stephen De Gabrielle) Date: Sat Oct 31 19:33:47 2009 Subject: [plt-scheme] Re: Drscheme icon In-Reply-To: <4AEC9FAA.7070806@cs.byu.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> <4AEC9FAA.7070806@cs.byu.edu> Message-ID: <595b9ab20910311633n621a563csef09488db350f3e4@mail.gmail.com> Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: plt-noborder-10stroke.svg Type: image/svg+xml Size: 4126 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091031/a53d9499/plt-noborder-10stroke-0001.svg From eeepc904 at gmail.com Sat Oct 31 19:35:39 2009 From: eeepc904 at gmail.com (Nathan Paulino Campos) Date: Sat Oct 31 19:36:12 2009 Subject: [plt-scheme] Starting At GUI Scheme Applications In-Reply-To: <756daca50910311031u72ded804jf8874331a0d3e0f9@mail.gmail.com> References: <1256999247.6397.6.camel@eeepc> <756daca50910311031u72ded804jf8874331a0d3e0f9@mail.gmail.com> Message-ID: <1257032139.19075.0.camel@eeepc> Thanks very much Grant! On Sat, 2009-10-31 at 12:31 -0500, Grant Rettke wrote: > On Sat, Oct 31, 2009 at 9:27 AM, Nathan Paulino Campos > wrote: > > I'm learning PLT Scheme and I want to start building GUI applications, > > but where I can find a good tutorial to learn this? > > Hi Nathan I haven't see a tutorial per se but you could start here and > here in particular: > > http://docs.plt-scheme.org/gui/index.html > > http://docs.plt-scheme.org/framework/index.html From spdegabrielle at gmail.com Sat Oct 31 19:43:17 2009 From: spdegabrielle at gmail.com (Stephen De Gabrielle) Date: Sat Oct 31 19:43:39 2009 Subject: [plt-scheme] Starting At GUI Scheme Applications In-Reply-To: <1257032139.19075.0.camel@eeepc> References: <1256999247.6397.6.camel@eeepc> <756daca50910311031u72ded804jf8874331a0d3e0f9@mail.gmail.com> <1257032139.19075.0.camel@eeepc> Message-ID: <595b9ab20910311643k61fd0b17i569e68f393e5c730@mail.gmail.com> H Nathan, feel free to ask questions here, I can't say I'll know the answer as, but I'll help if I can. Another good resource is 'mred designer'(google it), both to use and to read (the code of the app). Cheers, Stephen On Sat, Oct 31, 2009 at 11:35 PM, Nathan Paulino Campos wrote: > Thanks very much Grant! > > On Sat, 2009-10-31 at 12:31 -0500, Grant Rettke wrote: > > On Sat, Oct 31, 2009 at 9:27 AM, Nathan Paulino Campos > > wrote: > > > I'm learning PLT Scheme and I want to start building GUI applications, > > > but where I can find a good tutorial to learn this? > > > > Hi Nathan I haven't see a tutorial per se but you could start here and > > here in particular: > > > > http://docs.plt-scheme.org/gui/index.html > > > > http://docs.plt-scheme.org/framework/index.html > > _________________________________________________ > 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091031/4ccf514e/attachment.htm From geoff at knauth.org Sat Oct 31 19:56:36 2009 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Sat Oct 31 19:56:54 2009 Subject: [plt-scheme] Re: Drscheme icon In-Reply-To: <595b9ab20910311633n621a563csef09488db350f3e4@mail.gmail.com> 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> <4AEC9FAA.7070806@cs.byu.edu> <595b9ab20910311633n621a563csef09488db350f3e4@mail.gmail.com> Message-ID: I really appreciate all of Neil's graphical experiments with the logo. My students love to pick their own logo, to customize "their" DrScheme. Neil's given them more choices. (This week the Halloween logo was a bit hit.) Geoff From johnbclements at gmail.com Fri Oct 30 10:52:06 2009 From: johnbclements at gmail.com (John Clements) Date: Mon Nov 2 03:58:16 2009 Subject: [plt-scheme] redex model of pi calculus? In-Reply-To: <1b34e5e00910291432j33758c55l8fdc3b15f8022e32@mail.gmail.com> References: <589DB31C-5763-4811-8CCB-8B56B3948A40@brinckerhoff.org> <63bb19ae0910271150n20e0c89bie632ba017ceb5764@mail.gmail.com> <1b34e5e00910291432j33758c55l8fdc3b15f8022e32@mail.gmail.com> Message-ID: <5613C5A8-5E30-4007-957D-A06C28E4D1DF@gmail.com> On Oct 29, 2009, at 2:32 PM, Daniel Brown wrote: > Hi John, > > I built a small redex model of communication in CCS a while back > (attached). It's quite bare?just enough to do communication. I think > the hardest part was devising a way to model the traces. Since redex > doesn't let you compute labels for transitions, I just used a writer > monad to accumulate a sequence of actions in the term configuration. > Generalizing it from CCS to pi should be easy: just add substitutions. > I haven't put any thought into modeling ?... Well, my model is enormous and ungainly compared to yours, but I don't see a better way to do it. In particular, I gave up on trying to formulate a single canonical "flattest" representation for a given term as you were able to do, because of the replication nodes. Instead, I used evaluation contexts to look for reducible pairs, and stuck really close to the published algebra of terms; I even model parallel composition and zero directly rather than flattening them into lists. Model attached, if you care to take a look. Thanks! John -------------- next part -------------- A non-text attachment was scrubbed... Name: pi-calculus.ss Type: application/octet-stream Size: 14870 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20091030/f25ad688/pi-calculus-0001.obj -------------- next part -------------- > Also, John Reppy's thesis has a reduction semantics for concurrent ML, > so it might be a good source of ideas on how to model communicating > systems in redex. > > I'd be interested to see what you come up with for modeling pi. > > (Feel free to copy this back to plt-scheme. I don't have a handle on > the original thread, otherwise I would have replied to it instead.) > > Dan > > On Tue, Oct 27, 2009 at 14:50, Sam TH wrote: >> ---------- Forwarded message ---------- >> From: John Clements >> Date: Tue, Oct 27, 2009 at 2:36 PM >> Subject: [plt-scheme] redex model of pi calculus? >> To: Robby Findler >> Cc: PLT-Scheme Mailing List >> >> >> I'm trying to model a pi-calculus-like system in redex, and running >> into a couple of issues that would be solved by any model for the pi >> calculus in redex. Before I try solving them all myself (parallel >> composition, lifting nu's) I thought I'd ask: are there existing >> models of the pi calculus written using redex? >> >> John >> >> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> >> >> >> -- >> sam th >> samth@ccs.neu.edu >> > From eeepc904 at gmail.com Fri Oct 30 17:26:11 2009 From: eeepc904 at gmail.com (Nathan Campos) Date: Mon Nov 2 03:58:37 2009 Subject: [plt-scheme] Re: Drscheme icon In-Reply-To: <4AEB55C4.8080109@cs.byu.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> Message-ID: <28ea9b0e-0b8d-4a04-8777-9cecf54b84fc@w19g2000yqk.googlegroups.com> Very nice, I was needing the icon too, because the DrScheme icon that came with it in Ubuntu is very ugly, but this new icon with these new colors is very nice! Regards. On Oct 30, 7:08?pm, Neil Toronto wrote: > I got inspired to do a little Inkscape-ing. I've attached the results. > > plt-logo-orig.svg is in red and blue. I darkened the lower region for > variety and balance. > > plt-logo-tri.svg is in red, blue and deep royal purple. I know it's a > controversial change, but I like it a lot. > > What do you y'all think? > > Neil > > Eli Barzilay wrote: > > Sorry, I meant to reply to this earlier... ?We have a big version of > > the logo, split into two pngs, one with the logo and one with the > > shadow. ?I've put them at > > > ?http://tmp.barzilay.org/plt-logo-3d.png > > ?http://tmp.barzilay.org/plt-logo-shadow-3d.png > > > I'm not sure whether it's possible to make a precise SVG version, > > since the logo is not using some simple gradients, it's a result of > > slapping the lambda logo on a 3d shield, and rendering it in povray. > > John Clements did that part. ?I do have two povray files, in case > > that's more helpful. > > > > ?plt-logo-orig.svg > 17KViewDownload > > ?plt-logo-tri.svg > 17KViewDownload > > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme