From dph3dg at gmail.com Tue Jun 1 02:48:01 2010 From: dph3dg at gmail.com (David Gray) Date: Tue, 1 Jun 2010 09:48:01 +0300 Subject: [plt-scheme] mred-text -i and Plot Message-ID: I'm trying to use mred-text -i and plot together, however I'm not sure how to display a; #(struct:object:2d-view% ... ...) If the above is defined as t then I can call the public functions from view.ss ie (send t get-x-min) and get for example -5 but there must be a way to get a display up on the screen I'm using 4.2.3 as the versions after than don't return a REPL Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: From horace.dynamite at googlemail.com Tue Jun 1 11:09:33 2010 From: horace.dynamite at googlemail.com (Horace Dynamite) Date: Tue, 1 Jun 2010 16:09:33 +0100 Subject: [plt-scheme] HtDP exercise 29.1.1 | I don't understand ART. Message-ID: If posting my answer to this problem violates the rules, I'm sorry, please delete my mail; I can't explain myself properly without posting it. My answer to "What is the abstract running time?" is N. But this doesn't agree with my intuition, since I believe this procedure to have a faster growth rate than contains-doll? I have the following data definition for a number tree, ;; exercise 29.1.1 ; A number tree (short: nt) is either, ; 1. a number; or ; 2. (list nt nt) Therefore, I have the following template, (define (fun-for-nt ant) (cond [(number? ant) ...] [else ... (fun-for-nt (first ant)) .... ... (fun-for-nt (first (rest ant))) ...])) Filling in the blanks for sum-tree, I obtain, ;; sum-tree : nt -> number ;; To compute the sum of all the numbers in a number tree (define (sum-tree ant) (cond [(number? ant) ant] [else (+ (sum-tree (first ant)) (sum-tree (first (rest ant))))])) ;; examples (check-expect (sum-tree 0) 0) (check-expect (sum-tree 5) 5) (check-expect (sum-tree (list 1 9)) 10) (check-expect (sum-tree (list (list 3 4) 2)) 9) (check-expect (sum-tree (list 7 (list 12 8))) 27) (check-expect (sum-tree (list (list 1 5) (list 6 7))) 19) So, I should measure the size of a number tree by the number of LISTs it contains, since on meeting a LIST, I have to recur twice. Therefore, for a number tree containing N (nested) LISTs, I have at worst 2*N recursions to execute. But due to the discussion in the text, I can fudge the constant 2 and say this has on the order of N steps. Is all this correct? I think not. Can someone help me with this? Thanks for your time, Horace. From matthias at ccs.neu.edu Tue Jun 1 11:56:13 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Tue, 1 Jun 2010 11:56:13 -0400 Subject: [plt-scheme] HtDP exercise 29.1.1 | I don't understand ART. In-Reply-To: References: Message-ID: On Jun 1, 2010, at 11:09 AM, Horace Dynamite wrote: > Therefore, for a number tree containing N (nested) LISTs, I have at > worst 2*N recursions to execute. What is the N? Why 2 * N? If it is 2 * N, yes O(N) is correct. You do spawn two recursions at each stage, but draw a diagram before you jump to conclusions. Create a tree with 32 or 64 or 128 leaves well-distributed and not so well-distributed and imagine the function traversing this tree. -- Matthias From pocmatos at gmail.com Wed Jun 2 09:14:31 2010 From: pocmatos at gmail.com (Paulo J. Matos) Date: Wed, 02 Jun 2010 14:14:31 +0100 Subject: [plt-scheme] To Racket... Message-ID: Hello, I am starting to convert my scheme software to racket. So I load my main.scm and start by getting an internal error: ,---- | ../../Applications/racket/collects/compiler/cm.rkt:178:11: cm: internal | error?; cannot find sha1 for module: # `---- I looked at cm.rkt and can't find any suspicious, except for... my filename extension... -> scm Do I need to rename my filenames to rkt? It would be great to have a small guide saying what, in general, you need to do to get your software running on racket. Cheers, -- PMatos From matthias at ccs.neu.edu Wed Jun 2 10:20:22 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Wed, 2 Jun 2010 10:20:22 -0400 Subject: [plt-scheme] To Racket... In-Reply-To: References: Message-ID: <8E0B7178-5A6E-4E3B-AA1F-90B9AC72CAF5@ccs.neu.edu> Try .rkt or .ss for now. On Jun 2, 2010, at 9:14 AM, Paulo J. Matos wrote: > Hello, > > I am starting to convert my scheme software to racket. > So I load my main.scm and start by getting an internal error: > ,---- > | ../../Applications/racket/collects/compiler/cm.rkt:178:11: cm: > internal > | error?; cannot find sha1 for module: # eboc/modes/esmc-mode/search-sig.scm> > `---- > > I looked at cm.rkt and can't find any suspicious, except for... my > filename extension... -> scm > Do I need to rename my filenames to rkt? > > It would be great to have a small guide saying what, in general, you > need to do to get your software running on racket. > > Cheers, > > -- > PMatos > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From eli at barzilay.org Wed Jun 2 10:44:34 2010 From: eli at barzilay.org (Eli Barzilay) Date: Wed, 2 Jun 2010 10:44:34 -0400 Subject: [plt-scheme] To Racket... In-Reply-To: References: Message-ID: <19462.28242.390782.699156@winooski.ccs.neu.edu> On Jun 2, Paulo J. Matos wrote: > I am starting to convert my scheme software to racket. > So I load my main.scm and start by getting an internal error: > ,---- > | ../../Applications/racket/collects/compiler/cm.rkt:178:11: cm: internal > | error?; cannot find sha1 for module: # > `---- Did you remove all of your "compiled" directories? Do the .dep files in them have a SHA1 hash in them? -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From mflatt at cs.utah.edu Wed Jun 2 10:53:43 2010 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Wed, 2 Jun 2010 08:53:43 -0600 Subject: [plt-scheme] To Racket... In-Reply-To: References: Message-ID: <20100602145344.9092B650159@mail-svr1.cs.utah.edu> At Wed, 02 Jun 2010 14:14:31 +0100, Paulo J. Matos wrote: > Hello, > > I am starting to convert my scheme software to racket. > So I load my main.scm and start by getting an internal error: > ,---- > | ../../Applications/racket/collects/compiler/cm.rkt:178:11: cm: internal > | error?; cannot find sha1 for module: > # > `---- > > I looked at cm.rkt and can't find any suspicious, except for... my > filename extension... -> scm > Do I need to rename my filenames to rkt? > > It would be great to have a small guide saying what, in general, you > need to do to get your software running on racket. You shouldn't have to do anything. That looks like a bug in the compilation manager, but I'm not sure what the problem might be. If removing "compiled" directories helps, that would be good to know. Otherwise, can you say more about the file organization and/or produce an example that I can try? From m.douglas.williams at gmail.com Wed Jun 2 15:06:08 2010 From: m.douglas.williams at gmail.com (Doug Williams) Date: Wed, 2 Jun 2010 13:06:08 -0600 Subject: [plt-scheme] Another PLaneT Question Message-ID: I updated the animated-canvas collection to the new Racket conventions. It seems to build and upload to PLaneT fine. The URL for the collection on PLaneT is http://planet.plt-scheme.org/package-source/williams/animated-canvas.plt/2/1/. The new files are there - including the update info.rkt. [It is now Version 2.1 because I forgot to put (define required-core-version "5.0") the first time. However, the Current Version table information is incorrect. The blurb is from the old info.ss; the Docs, Req. PLT, To Load info, and release notes are all hosed. And, it shows it as being available for the 3.xx repository. [It's almost as though PLaneT didn't see the information in the info.rkt file.] Here is the contents of the new info.rkt file - you can also see it by browsing the files in PLaneT. #lang setup/infotab (define name "Animated Canvas") (define blurb (list "This library provides an animated-canvas% class that specializes the GRacket " "canvas% class to provide a simple double-buffered animation capability in Racket. " "Two simple demonstration programs are also provided.")) (define release-notes (list "Updated for Racket naming conventions.")) (define primary-file "animated-canvas.rkt") (define categories '(ui)) (define version "2.0") (define repositories '("4.x")) (define scribblings '(("animated-canvas.scrbl" ()))) (define url "http://schematics.sourceforge.net/") (define required-core-version "5.0") Any ideas as to what is happening? Doug -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.douglas.williams at gmail.com Wed Jun 2 15:15:56 2010 From: m.douglas.williams at gmail.com (Doug Williams) Date: Wed, 2 Jun 2010 13:15:56 -0600 Subject: [plt-scheme] Re: Another PLaneT Question In-Reply-To: References: Message-ID: It does load correctly from PLaneT (using the latest nightly build) and the correct documentation is added to the help desk. So, it does seem to just be the information on the PLaneT web page itself that is broken - at least for me. On Wed, Jun 2, 2010 at 1:06 PM, Doug Williams wrote: > I updated the animated-canvas collection to the new Racket conventions. It > seems to build and upload to PLaneT fine. The URL for the collection on > PLaneT is > http://planet.plt-scheme.org/package-source/williams/animated-canvas.plt/2/1/. > The new files are there - including the update info.rkt. [It is now Version > 2.1 because I forgot to put (define required-core-version "5.0") the first > time. However, the Current Version table information is incorrect. The blurb > is from the old info.ss; the Docs, Req. PLT, To Load info, and release notes > are all hosed. And, it shows it as being available for the 3.xx repository. > [It's almost as though PLaneT didn't see the information in the info.rkt > file.] > > Here is the contents of the new info.rkt file - you can also see it by > browsing the files in PLaneT. > > #lang setup/infotab > (define name "Animated Canvas") > (define blurb > (list "This library provides an animated-canvas% class that specializes the GRacket " > > "canvas% class to provide a simple double-buffered animation capability in Racket. " > "Two simple demonstration programs are also provided.")) > (define release-notes > (list "Updated for Racket naming conventions.")) > > (define primary-file "animated-canvas.rkt") > (define categories '(ui)) > (define version "2.0") > (define repositories '("4.x")) > (define scribblings '(("animated-canvas.scrbl" ()))) > > (define url "http://schematics.sourceforge.net/") > (define required-core-version "5.0") > > Any ideas as to what is happening? > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: From keydana at gmx.de Wed Jun 2 16:32:15 2010 From: keydana at gmx.de (keydana at gmx.de) Date: Wed, 2 Jun 2010 22:32:15 +0200 Subject: [plt-scheme] Typed scheme: Cannot apply expression of type Procedure, since it is not a function type In-Reply-To: References: <4468BC44-7DC5-4F55-8F46-4A148D3C5C01@gmx.de> Message-ID: > > Notice that our code will type check perfectly but every expression > has type Any and these types are essentially useless. This gives you > an idea of what static typing does and doesn't check. Basically types > are statically checked, but cases (in the discriminated union sense) > aren't. Cases are how you inject dynamic checks into statically typed > languages. Yes, I think I see what you mean... the discriminated union cases in a way threaten to "dissolve" the type system... In fact, it seems to me I'm approaching this from the opposite angle somehow: Taking standard dynamic scheme as the default, I use typed scheme primarily for "educational" purposes - I like being forced to think about how, exactly, the fields of a record (for example) are defined or what exactly a function has to accept/return. But even more, I like using the discriminated unions (with the define-datatype macro), they make me think about what "kinds of a thing there are", and they offer an easy way of structuring the code (I'll just have to handle every case and that's it). Certainly this also depends on the domain - in my case currently, discriminated unions seem like a very suitable way to implement something "language-like" (the discriminated unions looking like some semantic equivalent of BNF anyway). On the other hand, they really get inconvenient when there's too much pattern matching to do (speaking of pattern matching, their "natural proneness" to be used with pattern matching - if I my say so - is another reason I like them so much...) - All this just from the perspective of a "normal user" (well in the end, I should perhaps also admit that using the algebraic datatypes in typed scheme might be a way of coping with the sad fact that my spare time doesn't seem sufficient to learn/practice both scheme and haskell :-;) -------------- next part -------------- An HTML attachment was scrubbed... URL: From robby at eecs.northwestern.edu Wed Jun 2 16:58:00 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Wed, 2 Jun 2010 15:58:00 -0500 Subject: [plt-scheme] Another PLaneT Question In-Reply-To: References: Message-ID: My guess is that this is a bug in the planet's server code somewhere. Unfortunately, I cannot really take a look at this until I can get back to my office in Chicago (next week). My apologies. I'll look into a setup that will let me remotely work on my duplicate (debugging) planet installation. Robby On Wed, Jun 2, 2010 at 2:06 PM, Doug Williams wrote: > I updated the animated-canvas collection to the new Racket conventions. It > seems to build and upload to PLaneT fine. The URL for the collection on > PLaneT is > http://planet.plt-scheme.org/package-source/williams/animated-canvas.plt/2/1/. > The new files are there - including the update info.rkt. [It is now Version > 2.1 because I forgot to put (define required-core-version "5.0") the first > time. However, the Current Version table information is incorrect. The blurb > is from the old info.ss; the Docs, Req. PLT, To Load info, and release notes > are all hosed. And, it shows it as being available for the 3.xx repository. > [It's almost as though PLaneT didn't see the information in the info.rkt > file.] > > Here is the contents of the new info.rkt file - you can also see it by > browsing the files in PLaneT. > > #lang setup/infotab > (define name "Animated Canvas") > (define blurb > (list "This library provides an animated-canvas% class that specializes > the GRacket " > > "canvas% class to provide a simple double-buffered animation > capability in Racket. " > "Two simple demonstration programs are also provided.")) > (define release-notes > (list "Updated for Racket naming conventions.")) > > (define primary-file "animated-canvas.rkt") > (define categories '(ui)) > (define version "2.0") > (define repositories '("4.x")) > (define scribblings '(("animated-canvas.scrbl" ()))) > > (define url "http://schematics.sourceforge.net/") > (define required-core-version "5.0") > > Any ideas as to what is happening? > > Doug > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From jacobm at cs.uchicago.edu Wed Jun 2 17:08:33 2010 From: jacobm at cs.uchicago.edu (Jacob Matthews) Date: Wed, 2 Jun 2010 16:08:33 -0500 Subject: [plt-scheme] Another PLaneT Question In-Reply-To: References: Message-ID: This message tickled a memory, and sure enough, it looks like get-info/full in collects/setup/getinfo.ss (which planet uses to find a package's info file) looks for a file literally named "info.ss". I'd guess that's the issue. -jacob On Wed, Jun 2, 2010 at 3:58 PM, Robby Findler wrote: > My guess is that this is a bug in the planet's server code somewhere. > Unfortunately, I cannot really take a look at this until I can get > back to my office in Chicago (next week). > > My apologies. I'll look into a setup that will let me remotely work on > my duplicate (debugging) planet installation. > > Robby > > On Wed, Jun 2, 2010 at 2:06 PM, Doug Williams > wrote: >> I updated the animated-canvas collection to the new Racket conventions. It >> seems to build and upload to PLaneT fine. The URL for the collection on >> PLaneT is >> http://planet.plt-scheme.org/package-source/williams/animated-canvas.plt/2/1/. >> The new files are there - including the update info.rkt. [It is now Version >> 2.1 because I forgot to put (define required-core-version "5.0") the first >> time. However, the Current Version table information is incorrect. The blurb >> is from the old info.ss; the Docs, Req. PLT, To Load info, and release notes >> are all hosed. And, it shows it as being available for the 3.xx repository. >> [It's almost as though PLaneT didn't see the information in the info.rkt >> file.] >> >> Here is the contents of the new info.rkt file - you can also see it by >> browsing the files in PLaneT. >> >> #lang setup/infotab >> (define name "Animated Canvas") >> (define blurb >> ? (list "This library provides an animated-canvas% class that specializes >> the GRacket " >> >> ? ? ? ? "canvas% class to provide a simple double-buffered animation >> capability in Racket. " >> ? ? ? ? "Two simple demonstration programs are also provided.")) >> (define release-notes >> ? (list "Updated for Racket naming conventions.")) >> >> (define primary-file "animated-canvas.rkt") >> (define categories '(ui)) >> (define version "2.0") >> (define repositories '("4.x")) >> (define scribblings '(("animated-canvas.scrbl" ()))) >> >> (define url "http://schematics.sourceforge.net/") >> (define required-core-version "5.0") >> >> Any ideas as to what is happening? >> >> Doug >> >> _________________________________________________ >> ?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 Wed Jun 2 17:46:34 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Wed, 2 Jun 2010 16:46:34 -0500 Subject: [plt-scheme] Another PLaneT Question In-Reply-To: References: Message-ID: On Wed, Jun 2, 2010 at 4:08 PM, Jacob Matthews wrote: > This message tickled a memory, and sure enough, it looks like > get-info/full in collects/setup/getinfo.ss (which planet uses to find > a package's info file) looks for a file literally named "info.ss". I'd > guess that's the issue. Ah. This is due to the planet server running an ancient version of plt. Well, the proper fix is more than I can really do right now (ie bringing planet up to running v5.0 of plt) so I have just hacked the code in the planet installation and I'll look into doing this fix properly when I return. Thanks, Jacob! BTW, this means that newly uploaded packages should work properly, but the Doug's package will have the wrong information since it just used various defaults (since the code incorrectly assumed that the info file didn't exist at all). You should be able to update the information about the planet package tho. Robby From m.douglas.williams at gmail.com Wed Jun 2 18:24:50 2010 From: m.douglas.williams at gmail.com (Doug Williams) Date: Wed, 2 Jun 2010 16:24:50 -0600 Subject: [plt-scheme] Another PLaneT Question In-Reply-To: References: Message-ID: I updated the meta-data, which let me change most things. There doesn't seem to be any way to set the external version (which would be the same as the PLaneT version in this case) or the docs fields, but it's no biggie, On Wed, Jun 2, 2010 at 3:46 PM, Robby Findler wrote: > On Wed, Jun 2, 2010 at 4:08 PM, Jacob Matthews > wrote: > > This message tickled a memory, and sure enough, it looks like > > get-info/full in collects/setup/getinfo.ss (which planet uses to find > > a package's info file) looks for a file literally named "info.ss". I'd > > guess that's the issue. > > Ah. This is due to the planet server running an ancient version of > plt. Well, the proper fix is more than I can really do right now (ie > bringing planet up to running v5.0 of plt) so I have just hacked the > code in the planet installation and I'll look into doing this fix > properly when I return. > > Thanks, Jacob! > > BTW, this means that newly uploaded packages should work properly, but > the Doug's package will have the wrong information since it just used > various defaults (since the code incorrectly assumed that the info > file didn't exist at all). You should be able to update the > information about the planet package tho. > > Robby > -------------- next part -------------- An HTML attachment was scrubbed... URL: From m.douglas.williams at gmail.com Wed Jun 2 18:49:39 2010 From: m.douglas.williams at gmail.com (Doug Williams) Date: Wed, 2 Jun 2010 16:49:39 -0600 Subject: [plt-scheme] Another PLaneT Question In-Reply-To: References: Message-ID: Is there any way to change the meta-data on a previous version? There is a version 2.0 and 2.1 there now. I changed the meta-data for the 2.1 version so that it required version 5.0 (although I probably should use 4.90, since that is the candidate release), but I can't change it for the 2.0 version. Unfortunately, if anyone running V4 requires the package (without specifying an older version), it will load 2.0 - because there is no required-core-version defined for it. That will fail because it uses #lang racket. On Wed, Jun 2, 2010 at 3:46 PM, Robby Findler wrote: > On Wed, Jun 2, 2010 at 4:08 PM, Jacob Matthews > wrote: > > This message tickled a memory, and sure enough, it looks like > > get-info/full in collects/setup/getinfo.ss (which planet uses to find > > a package's info file) looks for a file literally named "info.ss". I'd > > guess that's the issue. > > Ah. This is due to the planet server running an ancient version of > plt. Well, the proper fix is more than I can really do right now (ie > bringing planet up to running v5.0 of plt) so I have just hacked the > code in the planet installation and I'll look into doing this fix > properly when I return. > > Thanks, Jacob! > > BTW, this means that newly uploaded packages should work properly, but > the Doug's package will have the wrong information since it just used > various defaults (since the code incorrectly assumed that the info > file didn't exist at all). You should be able to update the > information about the planet package tho. > > Robby > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmj at fellowhuman.com Wed Jun 2 19:19:09 2010 From: jmj at fellowhuman.com (Jordan Johnson) Date: Wed, 2 Jun 2010 16:19:09 -0700 (PDT) Subject: [plt-scheme] Grafting a console onto universe, hackety hack. Message-ID: Hi guys, I was talking with one of my students who's implementing a little chat server (and pig-latin translator) using universe, and naturally it occurred to me that -- although I've had students implemented a basic command-line editor earlier in the year (along the lines of what's in HtDP/2e) -- it'd be nice to have the option of doing this kind of thing without messing around with console input handling. So I started playing around with the GUI toolkit, and produced the code below: a console object and a demo file. I'm curious about: 1) whether there's a decent (and minimally intrusive) way to hook into universe to trigger events from this console -- polling a state variable in the tick handler is kinda icky 2) whether there's any locking I'd need to do to make it safe for both the user-input-callback (see below) and a universe/big-bang event handler callback to call append-line as I'm doing below 3) whether overriding on-char is really an OK way to make a text% object "read-only" from the user's perspective 4) whether there's already some spiffy console-style class I've missed in the docs :) Thanks, jmj ;; --- console-demo.ss ------------------------------------ #lang scheme/gui (require 2htdp/universe "console.ss") ;; Set up the console window: (define the-frame (let ([new-es (make-eventspace)]) ;; big-bang takes over the Interactions window's eventspace for use by ;; its on-key and on-mouse, so here we create and install a separate ;; event space to handle events in our console. ;; This means also that ;; (a) we must install a stop-when test to halt the world when the ;; window closes, and ;; (b) after the world halts, (send the-frame show #t) can re-show the ;; frame (but does NOT restart the world). (parameterize ([current-eventspace new-es]) (new console-frame% [label "universe test"] [width 500] [height 400] [echo? #f] [user-input-callback (lambda (s) (send the-frame append-line (format "Received ~s." s)))])))) ;; world = Nat, representing the # of seconds elapsed ;; stop? : world -> bool ;; True iff the world should stop. (define (stop? w) (not (send the-frame is-shown?))) ;; next : world -> world ;; Produces the next world. ;; EFFECT: every five seconds, shows "TICK!" in the console (define (next w) (let ([w2 (add1 w)]) (when (zero? (modulo w2 5)) (send the-frame append-line "TICK!")) w2)) ;; Run the show: (define (run w0) (send the-frame show #t) (big-bang w0 (on-tick next 1) (stop-when stop?) )) ;; Start it going: (run 0) ;; -- end console-demo.ss ----------------------------------------- ;; -- console.ss -------------------------------------------------- #lang scheme/gui (provide console-frame%) ;; A frame containing two elements at creation: ;; - a read-only output text% area ;; - a text-field% for input (define console-frame% (class frame% (super-new) (init-field user-input-callback ;; string -> any [echo? #f]) ;; user-input-callback is called when the user presses Enter, with ;; the text-field%'s contents as input. ;; The area that displays console output: (define output-view (new (class text% (super-new) ;; Disable typing in this area: (define/override (on-char evt) (void)) (inherit insert last-position) ;; string -> void ;; Appends a line at the end (bottom) of the text area. (define/public (append-line s) (let ([ins (lambda (s) (insert s (last-position)))]) (ins "\n") (ins s))) ;; boolean -> void ;; If this area gets keyboard focus, give it to the input ;; area instead. (define/override (on-focus on?) (when on? (send entry-line focus))) ) [auto-wrap #t])) (define ec (new editor-canvas% [parent this] [editor output-view])) ;; The area into which the user types their input: (define entry-line (new text-field% [label "text:"] [parent this] [callback (on-enter (lambda (tf) (let ([s (send tf get-value)]) (user-input-callback s) (send tf set-value "") (when echo? (send output-view append-line s)) )))])) ;; string -> void ;; Appends the line to the console display. (define/public (append-line s) (send output-view append-line s)) )) ;; on-enter : (text-field% -> X) -> (text-field% control-event<%> -> X) ;; Create a callback for a text field, to be triggered only when the user ;; presses Enter. (define (on-enter f) (lambda (tf evt) (when (eq? (send evt get-event-type) 'text-field-enter) (f tf)))) ;; -- end -------------------------------------------------- From etanter at dcc.uchile.cl Wed Jun 2 21:49:48 2010 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Wed, 2 Jun 2010 21:49:48 -0400 Subject: [plt-scheme] [redex] language keywords Message-ID: <07D269DE-9F82-46DE-8B05-70DD78BF517A@dcc.uchile.cl> Hi, What is the best way to specify what are the keywords of a language? I've seen variable-not-otherwise-mentioned and variable-except, but the problem is that I have 6 families of identifiers. Is there something as simple/direct as the list of keywords in syntax-rules/syntax-case? If not, any alternative suggestion? Thanks! -- ?ric From cce at ccs.neu.edu Wed Jun 2 21:56:53 2010 From: cce at ccs.neu.edu (Carl Eastlund) Date: Wed, 2 Jun 2010 21:56:53 -0400 Subject: [plt-scheme] [redex] language keywords In-Reply-To: <07D269DE-9F82-46DE-8B05-70DD78BF517A@dcc.uchile.cl> References: <07D269DE-9F82-46DE-8B05-70DD78BF517A@dcc.uchile.cl> Message-ID: On Wed, Jun 2, 2010 at 9:49 PM, Eric Tanter wrote: > Hi, > > What is the best way to specify what are the keywords of a language? > I've seen variable-not-otherwise-mentioned and variable-except, but the problem is that I have 6 families of identifiers. > > Is there something as simple/direct as the list of keywords in syntax-rules/syntax-case? > If not, any alternative suggestion? > > Thanks! > > -- ?ric Take a look at variable-prefix. In my latest Redex work, variables all start with x, y, or z, and I just have to avoid any keywords that start with those. --Carl From etanter at dcc.uchile.cl Wed Jun 2 22:02:40 2010 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Wed, 2 Jun 2010 22:02:40 -0400 Subject: [plt-scheme] [redex] language keywords In-Reply-To: References: <07D269DE-9F82-46DE-8B05-70DD78BF517A@dcc.uchile.cl> Message-ID: <9B1E31BD-7861-4E42-92CD-A3FBDD9BFF2A@dcc.uchile.cl> >> Is there something as simple/direct as the list of keywords in syntax-rules/syntax-case? >> If not, any alternative suggestion? >> >> Thanks! >> >> -- ?ric > > Take a look at variable-prefix. In my latest Redex work, variables > all start with x, y, or z, and I just have to avoid any keywords that > start with those. Thanks Carl, I'm using these as well, actually. A problem I have is that, for readability, I have a non-terminal which is define as (x >> x) where '>>' is a keyword. I know I could just use (x x) for exactly the same, but it does enhance readability. The problem is that >> is considered as a pattern variable... with macros I could just say: (syntax-rules (>>) ((x >> x) ...)) Any idea? -- ?ric From clklein at eecs.northwestern.edu Wed Jun 2 22:15:56 2010 From: clklein at eecs.northwestern.edu (Casey Klein) Date: Wed, 2 Jun 2010 21:15:56 -0500 Subject: [plt-scheme] [redex] language keywords In-Reply-To: <9B1E31BD-7861-4E42-92CD-A3FBDD9BFF2A@dcc.uchile.cl> References: <07D269DE-9F82-46DE-8B05-70DD78BF517A@dcc.uchile.cl> <9B1E31BD-7861-4E42-92CD-A3FBDD9BFF2A@dcc.uchile.cl> Message-ID: On Wed, Jun 2, 2010 at 9:02 PM, Eric Tanter wrote: >>> Is there something as simple/direct as the list of keywords in syntax-rules/syntax-case? >>> If not, any alternative suggestion? >>> >>> Thanks! >>> >>> -- ?ric >> >> Take a look at variable-prefix. ?In my latest Redex work, variables >> all start with x, y, or z, and I just have to avoid any keywords that >> start with those. > > Thanks Carl, > > I'm using these as well, actually. > A problem I have is that, for readability, I have a non-terminal which is define as (x >> x) where '>>' is a keyword. I know I could just use (x x) for exactly the same, but it does enhance readability. > The problem is that >> is considered as a pattern variable... > > with macros I could just say: > (syntax-rules (>>) > ?((x >> x) ...)) > > Any idea? > I don't follow. The variables in a Redex pattern are always named after non-terminals, so I don't see how >> could be treated as a pattern variable. Do you mean that >> matches one of your six classes of variables? From cce at ccs.neu.edu Wed Jun 2 22:21:43 2010 From: cce at ccs.neu.edu (Carl Eastlund) Date: Wed, 2 Jun 2010 22:21:43 -0400 Subject: [plt-scheme] [redex] language keywords In-Reply-To: References: <07D269DE-9F82-46DE-8B05-70DD78BF517A@dcc.uchile.cl> <9B1E31BD-7861-4E42-92CD-A3FBDD9BFF2A@dcc.uchile.cl> Message-ID: On Wed, Jun 2, 2010 at 10:15 PM, Casey Klein wrote: > On Wed, Jun 2, 2010 at 9:02 PM, Eric Tanter wrote: >>>> Is there something as simple/direct as the list of keywords in syntax-rules/syntax-case? >>>> If not, any alternative suggestion? >>>> >>>> Thanks! >>>> >>>> -- ?ric >>> >>> Take a look at variable-prefix. ?In my latest Redex work, variables >>> all start with x, y, or z, and I just have to avoid any keywords that >>> start with those. >> >> Thanks Carl, >> >> I'm using these as well, actually. >> A problem I have is that, for readability, I have a non-terminal which is define as (x >> x) where '>>' is a keyword. I know I could just use (x x) for exactly the same, but it does enhance readability. >> The problem is that >> is considered as a pattern variable... >> >> with macros I could just say: >> (syntax-rules (>>) >> ?((x >> x) ...)) >> >> Any idea? >> > > I don't follow. The variables in a Redex pattern are always named > after non-terminals, so I don't see how >> could be treated as a > pattern variable. > > Do you mean that >> matches one of your six classes of variables? Is it possible Eric is using one of the forms that match using syntax-case instead of the Redex pattern matcher? Do term-let and where clauses still work that way? (And if not, Eric, what version of PLT Scheme are you using?) --Carl From matthias at ccs.neu.edu Wed Jun 2 22:24:51 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Wed, 2 Jun 2010 22:24:51 -0400 Subject: [plt-scheme] Grafting a console onto universe, hackety hack. In-Reply-To: References: Message-ID: <50B9A046-AC0C-438D-9576-029A182D64A6@ccs.neu.edu> On Jun 2, 2010, at 7:19 PM, Jordan Johnson wrote: > 1) whether there's a decent (and minimally intrusive) way to hook into > universe to trigger events from this console -- polling a state variable > in the tick handler is kinda icky I am trying to figure what exactly you're trying to achieve. I have parameterized the 'world' over many things with mixins and all, but I have not considered a reuse where you want to bring events from somewhere else. I think it should be possible to expose some private interface -- if I knew what you wanted. > 2) whether there's any locking I'd need to do to make it safe for both the > user-input-callback (see below) and a universe/big-bang event handler > callback to call append-line as I'm doing below When you write GUI programs, you are writing concurrent programs. There are at least two processes involved: your program and the person sitting at the console. > 3) whether overriding on-char is really an OK way to make a text% object > "read-only" from the user's perspective (send text lock #t) > 4) whether there's already some spiffy console-style class I've missed in > the docs :) Again, what are you trying to do? One could imagine factoring it out the drracket console. From clklein at eecs.northwestern.edu Wed Jun 2 22:40:22 2010 From: clklein at eecs.northwestern.edu (Casey Klein) Date: Wed, 2 Jun 2010 21:40:22 -0500 Subject: [plt-scheme] [redex] language keywords In-Reply-To: References: <07D269DE-9F82-46DE-8B05-70DD78BF517A@dcc.uchile.cl> <9B1E31BD-7861-4E42-92CD-A3FBDD9BFF2A@dcc.uchile.cl> Message-ID: On Wed, Jun 2, 2010 at 9:21 PM, Carl Eastlund wrote: > On Wed, Jun 2, 2010 at 10:15 PM, Casey Klein > wrote: >> On Wed, Jun 2, 2010 at 9:02 PM, Eric Tanter wrote: >>>>> Is there something as simple/direct as the list of keywords in syntax-rules/syntax-case? >>>>> If not, any alternative suggestion? >>>>> >>>>> Thanks! >>>>> >>>>> -- ?ric >>>> >>>> Take a look at variable-prefix. ?In my latest Redex work, variables >>>> all start with x, y, or z, and I just have to avoid any keywords that >>>> start with those. >>> >>> Thanks Carl, >>> >>> I'm using these as well, actually. >>> A problem I have is that, for readability, I have a non-terminal which is define as (x >> x) where '>>' is a keyword. I know I could just use (x x) for exactly the same, but it does enhance readability. >>> The problem is that >> is considered as a pattern variable... >>> >>> with macros I could just say: >>> (syntax-rules (>>) >>> ?((x >> x) ...)) >>> >>> Any idea? >>> >> >> I don't follow. The variables in a Redex pattern are always named >> after non-terminals, so I don't see how >> could be treated as a >> pattern variable. >> >> Do you mean that >> matches one of your six classes of variables? > > Is it possible Eric is using one of the forms that match using > syntax-case instead of the Redex pattern matcher? ?Do term-let and > where clauses still work that way? Oh, good thinking! term-let uses syntax-case, but where clauses no longer do. > (And if not, Eric, what version of PLT Scheme are you using?) > From etanter at dcc.uchile.cl Wed Jun 2 22:51:20 2010 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Wed, 2 Jun 2010 22:51:20 -0400 Subject: [plt-scheme] [redex] language keywords In-Reply-To: References: <07D269DE-9F82-46DE-8B05-70DD78BF517A@dcc.uchile.cl> <9B1E31BD-7861-4E42-92CD-A3FBDD9BFF2A@dcc.uchile.cl> Message-ID: <28EF3E64-909D-4D0D-9F9F-D357B7B4C7D6@dcc.uchile.cl> Yes, I do use term-let and that's (at least up to now) exactly where the problem manifests! Should I be using something else? -- ?ric On Jun 2, 2010, at 22:40, Casey Klein wrote: > On Wed, Jun 2, 2010 at 9:21 PM, Carl Eastlund wrote: >> On Wed, Jun 2, 2010 at 10:15 PM, Casey Klein >> wrote: >>> On Wed, Jun 2, 2010 at 9:02 PM, Eric Tanter >>> wrote: >>>>>> Is there something as simple/direct as the list of keywords in >>>>>> syntax-rules/syntax-case? >>>>>> If not, any alternative suggestion? >>>>>> >>>>>> Thanks! >>>>>> >>>>>> -- ?ric >>>>> >>>>> Take a look at variable-prefix. In my latest Redex work, >>>>> variables >>>>> all start with x, y, or z, and I just have to avoid any keywords >>>>> that >>>>> start with those. >>>> >>>> Thanks Carl, >>>> >>>> I'm using these as well, actually. >>>> A problem I have is that, for readability, I have a non-terminal >>>> which is define as (x >> x) where '>>' is a keyword. I know I >>>> could just use (x x) for exactly the same, but it does enhance >>>> readability. >>>> The problem is that >> is considered as a pattern variable... >>>> >>>> with macros I could just say: >>>> (syntax-rules (>>) >>>> ((x >> x) ...)) >>>> >>>> Any idea? >>>> >>> >>> I don't follow. The variables in a Redex pattern are always named >>> after non-terminals, so I don't see how >> could be treated as a >>> pattern variable. >>> >>> Do you mean that >> matches one of your six classes of variables? >> >> Is it possible Eric is using one of the forms that match using >> syntax-case instead of the Redex pattern matcher? Do term-let and >> where clauses still work that way? > > Oh, good thinking! term-let uses syntax-case, but where clauses no > longer do. > >> (And if not, Eric, what version of PLT Scheme are you using?) >> From dougorleans at gmail.com Thu Jun 3 00:06:36 2010 From: dougorleans at gmail.com (Doug Orleans) Date: Thu, 3 Jun 2010 00:06:36 -0400 Subject: [plt-scheme] Fun with Unicode and delimited continuations Message-ID: Posted without comment: (define ? sqrt) (define ? sqr) (require scheme/control) (define (? x y) (shift k (values (k (+ x y)) (k (- x y))))) (define (quadratic-formula-roots a b c) (reset (/ (? (- b) (? (- (? b) (* 4 a c)))) (* 2 a)))) --dougorleans at gmail.com From robby at eecs.northwestern.edu Thu Jun 3 02:36:31 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu, 3 Jun 2010 01:36:31 -0500 Subject: [plt-scheme] [redex] language keywords In-Reply-To: <28EF3E64-909D-4D0D-9F9F-D357B7B4C7D6@dcc.uchile.cl> References: <07D269DE-9F82-46DE-8B05-70DD78BF517A@dcc.uchile.cl> <9B1E31BD-7861-4E42-92CD-A3FBDD9BFF2A@dcc.uchile.cl> <28EF3E64-909D-4D0D-9F9F-D357B7B4C7D6@dcc.uchile.cl> Message-ID: It would be good to avoid term-let, I think, if you can use things like 'where' in the reduction relation instead. But we'd probably need to see an example use if you don't see how to do the transformation. Robby On Wed, Jun 2, 2010 at 9:51 PM, Eric Tanter wrote: > Yes, I do use term-let and that's (at least up to now) exactly where the > problem manifests! > > Should I be using something else? > > -- ?ric > > On Jun 2, 2010, at 22:40, Casey Klein wrote: > >> On Wed, Jun 2, 2010 at 9:21 PM, Carl Eastlund wrote: >>> >>> On Wed, Jun 2, 2010 at 10:15 PM, Casey Klein >>> wrote: >>>> >>>> On Wed, Jun 2, 2010 at 9:02 PM, Eric Tanter >>>> wrote: >>>>>>> >>>>>>> Is there something as simple/direct as the list of keywords in >>>>>>> syntax-rules/syntax-case? >>>>>>> If not, any alternative suggestion? >>>>>>> >>>>>>> Thanks! >>>>>>> >>>>>>> -- ?ric >>>>>> >>>>>> Take a look at variable-prefix. ?In my latest Redex work, variables >>>>>> all start with x, y, or z, and I just have to avoid any keywords that >>>>>> start with those. >>>>> >>>>> Thanks Carl, >>>>> >>>>> I'm using these as well, actually. >>>>> A problem I have is that, for readability, I have a non-terminal which >>>>> is define as (x >> x) where '>>' is a keyword. I know I could just use (x x) >>>>> for exactly the same, but it does enhance readability. >>>>> The problem is that >> is considered as a pattern variable... >>>>> >>>>> with macros I could just say: >>>>> (syntax-rules (>>) >>>>> ?((x >> x) ...)) >>>>> >>>>> Any idea? >>>>> >>>> >>>> I don't follow. The variables in a Redex pattern are always named >>>> after non-terminals, so I don't see how >> could be treated as a >>>> pattern variable. >>>> >>>> Do you mean that >> matches one of your six classes of variables? >>> >>> Is it possible Eric is using one of the forms that match using >>> syntax-case instead of the Redex pattern matcher? ?Do term-let and >>> where clauses still work that way? >> >> Oh, good thinking! term-let uses syntax-case, but where clauses no longer >> do. >> >>> (And if not, Eric, what version of PLT Scheme are you using?) >>> > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From jmj at fellowhuman.com Thu Jun 3 03:08:06 2010 From: jmj at fellowhuman.com (Jordan Johnson) Date: Thu, 3 Jun 2010 00:08:06 -0700 Subject: [plt-scheme] Grafting a console onto universe, hackety hack. In-Reply-To: <50B9A046-AC0C-438D-9576-029A182D64A6@ccs.neu.edu> References: <50B9A046-AC0C-438D-9576-029A182D64A6@ccs.neu.edu> Message-ID: <1D7C9EA8-758D-47E7-A30C-B21384932B46@fellowhuman.com> On Jun 2, 2010, at 7:24 PM, Matthias Felleisen wrote: > I am trying to figure what exactly you're trying to achieve. > I have parameterized the 'world' over many things with mixins > and all, but I have not considered a reuse where you want to > bring events from somewhere else. I think it should be possible > to expose some private interface -- if I knew what you wanted. Sorry if the example code wasn't clear. I'm thinking of the Interactions window, or further afield, some chat and MUD clients, or terminal emulators, where the user interface essentially consists of: - a command line for entering text - a scrolling display of the interaction history, which cannot be edited Implementing all of this using big-bang is certainly doable, but around the point of implementing the scrolling display it starts seeming cumbersome and silly to reimplement all the niceties of such an interface. So my main interest is in seeing how to make use of the widget classes that are already written. As for the specific question about why I'm talking about triggering events from the class: I found pretty quickly that if I didn't create a separate eventspace for the new frame, the event handling didn't work right. (I don't remember all the details right now, but I think the program wasn't recognizing keystrokes unless the window created by on-draw had focus, or something similar.) aftwr that discovery, the specific scenario I was asking about in the original post inolved this desired behavior: 1) the user of the world program types a message and presses Enter 2) the program sends a representation of that message to the universe 3) the user's input (and any response from the universe) is displayed in the console With the code I've written, the problem I see is in step (2): if the text-field% has to be in a separate eventspace and so isn't being manipulated by key-events in the universe teachpack, then what will trigger the sending of the message to the server? The only way to do that is by returning a package from one of the handlers registered with big-bang...and those only get called in response to events the universe teachpack knows about. Does that make my intent clearer? Best, Jordan > > > >> 2) whether there's any locking I'd need to do to make it safe for >> both the >> user-input-callback (see below) and a universe/big-bang event >> handler >> callback to call append-line as I'm doing below > > > When you write GUI programs, you are writing concurrent programs. > There are at least two processes involved: your program and the person > sitting at the console. > > >> 3) whether overriding on-char is really an OK way to make a text% >> object >> "read-only" from the user's perspective > > (send text lock #t) > >> 4) whether there's already some spiffy console-style class I've >> missed in >> the docs :) > > Again, what are you trying to do? > > One could imagine factoring it out the drracket console. > From pocmatos at gmail.com Thu Jun 3 04:27:58 2010 From: pocmatos at gmail.com (Paulo J. Matos) Date: Thu, 03 Jun 2010 09:27:58 +0100 Subject: [plt-scheme] To Racket... In-Reply-To: <20100602145344.9092B650159@mail-svr1.cs.utah.edu> (Matthew Flatt's message of "Wed, 2 Jun 2010 08:53:43 -0600") References: <20100602145344.9092B650159@mail-svr1.cs.utah.edu> Message-ID: Matthew Flatt writes: > > You shouldn't have to do anything. That looks like a bug in the > compilation manager, but I'm not sure what the problem might be. > > If removing "compiled" directories helps, that would be good to know. Unfortunately removing the compiled directories doesn't help. > Otherwise, can you say more about the file organization and/or produce > an example that I can try? > The project is pretty big and all my attempts to generate a smaller situation failed. I investigated the insides of the compiled directory and found the following: ,---- | $ cd ~/Code/eboc/modes/esmc-mode/ | pmatos at pm18pc01:~/Code/eboc/modes/esmc-mode$ ls | alg eb-values.scm enumerations.scm generator.scm | probabilities.scm search-sig.scm | compiled eb-values.scm~ eventb-lib.scm interval.scm scheduler.scm | value-generator.scm | $ cat compiled/drracket/generator_scm.dep | ("5.0.0.1" ("7bc5a1b8b6d17beabd901159bc0d33d6b5add95d" | . "4c0c32c7299b3baa8075cd8b1cf6cc909e484da5") (collects #"scheme" | #"main.rkt") (collects #"scheme" #"match.rkt") | #"/localhome/pmatos/Code/eboc/modes/esmc-mode/../../ast2sexpr.scm" | #"/localhome/pmatos/Code/eboc/modes/esmc-mode/../../ast.scm" | #"/localhome/pmatos/Code/eboc/modes/esmc-mode/../../utils.scm" (collects | #"scheme" #"lang" #"reader.rkt")) `---- It looks like there are a couple of missing files in the dependencies, right? Instead of sending you a thousand line program, what else can provide you? I can, however, give you access to the private git repository in codaset if you wish. By the way, version is 5.0.0.1--2010-06-02(4ebe2a0/g). -- PMatos From pocmatos at gmail.com Thu Jun 3 04:31:48 2010 From: pocmatos at gmail.com (Paulo J. Matos) Date: Thu, 03 Jun 2010 09:31:48 +0100 Subject: [plt-scheme] To Racket... In-Reply-To: <19462.28242.390782.699156@winooski.ccs.neu.edu> (Eli Barzilay's message of "Wed, 2 Jun 2010 10:44:34 -0400") References: <19462.28242.390782.699156@winooski.ccs.neu.edu> Message-ID: Eli Barzilay writes: > > Did you remove all of your "compiled" directories? Do the .dep files > in them have a SHA1 hash in them? As I just said in my reply to Matthew, not all files in the directory have SHA1 hash on them. -- PMatos From pocmatos at gmail.com Thu Jun 3 04:32:13 2010 From: pocmatos at gmail.com (Paulo J. Matos) Date: Thu, 03 Jun 2010 09:32:13 +0100 Subject: [plt-scheme] To Racket... In-Reply-To: <8E0B7178-5A6E-4E3B-AA1F-90B9AC72CAF5@ccs.neu.edu> (Matthias Felleisen's message of "Wed, 2 Jun 2010 10:20:22 -0400") References: <8E0B7178-5A6E-4E3B-AA1F-90B9AC72CAF5@ccs.neu.edu> Message-ID: Matthias Felleisen writes: > Try .rkt or .ss for now. > Thanks, I will be changing the extension soon. -- PMatos From pocmatos at gmail.com Thu Jun 3 04:41:39 2010 From: pocmatos at gmail.com (Paulo J. Matos) Date: Thu, 03 Jun 2010 09:41:39 +0100 Subject: [plt-scheme] To Racket... In-Reply-To: <20100602145344.9092B650159@mail-svr1.cs.utah.edu> (Matthew Flatt's message of "Wed, 2 Jun 2010 08:53:43 -0600") References: <20100602145344.9092B650159@mail-svr1.cs.utah.edu> Message-ID: Matthew Flatt writes: > > If removing "compiled" directories helps, that would be good to know. > Otherwise, can you say more about the file organization and/or produce > an example that I can try? > I can know reproduce the problem. I have a hard link: ,---- | $ cat .racket/planet/300/HARD-LINKS | ("eboc.plt" ("pjmatos") 1 0 #"/localhome/pmatos/Code/eboc/." #f development-link) `---- Now the following structure inside ~/tmp: ,---- | pmatos at pm18pc01:~/tmp$ tree | . | |-- test | | |-- search-sig.scm | | `-- test1.scm | `-- test.scm | | 1 directories, 3 files `---- The files are all attached. Open test.scm and press Run. I hope you can also reproduce the problem. -------------- next part -------------- A non-text attachment was scrubbed... Name: test.scm Type: application/octet-stream Size: 40 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: search-sig.scm Type: application/octet-stream Size: 168 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test1.scm Type: application/octet-stream Size: 92 bytes Desc: not available URL: -------------- next part -------------- -- PMatos From matthias at ccs.neu.edu Thu Jun 3 08:07:29 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu, 3 Jun 2010 08:07:29 -0400 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: References: Message-ID: This must be the most fun (and useless) use of delimited continuations I have seen since 1984. Eli, I wonder how NUPRL deals with the quadratic formula? Or what is the logical content of the below? On Jun 3, 2010, at 12:06 AM, Doug Orleans wrote: > Posted without comment: > > (define ? sqrt) > (define ? sqr) > > (require scheme/control) > > (define (? x y) > (shift k (values (k (+ x y)) (k (- x y))))) > > (define (quadratic-formula-roots a b c) > (reset (/ (? (- b) (? (- (? b) (* 4 a c)))) > (* 2 a)))) > > > --dougorleans at gmail.com > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From eli at barzilay.org Thu Jun 3 08:55:20 2010 From: eli at barzilay.org (Eli Barzilay) Date: Thu, 3 Jun 2010 08:55:20 -0400 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: References: Message-ID: <19463.42552.339766.549059@winooski.ccs.neu.edu> On Jun 3, Matthias Felleisen wrote: > This must be the most fun (and useless) use of delimited > continuations I have seen since 1984. I'll bite: why is it useless? > Eli, I wonder how NUPRL deals with the quadratic formula? Or what is > the logical content of the below? Real numbers are not that interesting in that world... (But as for the logical content -- I don't remember much, I didn't go too much beyond being impressed with how call/cc translates.) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From matthias at ccs.neu.edu Thu Jun 3 09:08:02 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu, 3 Jun 2010 09:08:02 -0400 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: <19463.42552.339766.549059@winooski.ccs.neu.edu> References: <19463.42552.339766.549059@winooski.ccs.neu.edu> Message-ID: On Jun 3, 2010, at 8:55 AM, Eli Barzilay wrote: > On Jun 3, Matthias Felleisen wrote: >> This must be the most fun (and useless) use of delimited >> continuations I have seen since 1984. > > I'll bite: why is it useless? The reset and shift in this case statically determine the delimited continuation: \x. (/ x (* 2 a)) if it were prompt/control. ;; --- Of course, one can also shift (pardon the pun) reset around and start discussions of backtracking computations at this point and more stuff like that. >> Eli, I wonder how NUPRL deals with the quadratic formula? Or what is >> the logical content of the below? > > Real numbers are not that interesting in that world... (But as for > the logical content -- I don't remember much, I didn't go too much > beyond being impressed with how call/cc translates.) Ignoring the real numbers, I think Tim had an example that used two callccs and could have benefited from prompts. -- Matthias From etanter at dcc.uchile.cl Thu Jun 3 09:12:03 2010 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Thu, 3 Jun 2010 09:12:03 -0400 Subject: [plt-scheme] [redex] language keywords In-Reply-To: References: <07D269DE-9F82-46DE-8B05-70DD78BF517A@dcc.uchile.cl> <9B1E31BD-7861-4E42-92CD-A3FBDD9BFF2A@dcc.uchile.cl> <28EF3E64-909D-4D0D-9F9F-D357B7B4C7D6@dcc.uchile.cl> Message-ID: <6E41E775-1FB5-4703-8B13-FE25FCBD615A@dcc.uchile.cl> Thanks all, I'm moving to 'where' everywhere, and it seems to work. It's even much more readable with where clauses than with the collections of (nested) term-lets that I had. -- ?ric On Jun 3, 2010, at 2:36 AM, Robby Findler wrote: > It would be good to avoid term-let, I think, if you can use things > like 'where' in the reduction relation instead. But we'd probably need > to see an example use if you don't see how to do the transformation. > > Robby > > On Wed, Jun 2, 2010 at 9:51 PM, Eric Tanter wrote: >> Yes, I do use term-let and that's (at least up to now) exactly where the >> problem manifests! >> >> Should I be using something else? >> >> -- ?ric >> >> On Jun 2, 2010, at 22:40, Casey Klein wrote: >> >>> On Wed, Jun 2, 2010 at 9:21 PM, Carl Eastlund wrote: >>>> >>>> On Wed, Jun 2, 2010 at 10:15 PM, Casey Klein >>>> wrote: >>>>> >>>>> On Wed, Jun 2, 2010 at 9:02 PM, Eric Tanter >>>>> wrote: >>>>>>>> >>>>>>>> Is there something as simple/direct as the list of keywords in >>>>>>>> syntax-rules/syntax-case? >>>>>>>> If not, any alternative suggestion? >>>>>>>> >>>>>>>> Thanks! >>>>>>>> >>>>>>>> -- ?ric >>>>>>> >>>>>>> Take a look at variable-prefix. In my latest Redex work, variables >>>>>>> all start with x, y, or z, and I just have to avoid any keywords that >>>>>>> start with those. >>>>>> >>>>>> Thanks Carl, >>>>>> >>>>>> I'm using these as well, actually. >>>>>> A problem I have is that, for readability, I have a non-terminal which >>>>>> is define as (x >> x) where '>>' is a keyword. I know I could just use (x x) >>>>>> for exactly the same, but it does enhance readability. >>>>>> The problem is that >> is considered as a pattern variable... >>>>>> >>>>>> with macros I could just say: >>>>>> (syntax-rules (>>) >>>>>> ((x >> x) ...)) >>>>>> >>>>>> Any idea? >>>>>> >>>>> >>>>> I don't follow. The variables in a Redex pattern are always named >>>>> after non-terminals, so I don't see how >> could be treated as a >>>>> pattern variable. >>>>> >>>>> Do you mean that >> matches one of your six classes of variables? >>>> >>>> Is it possible Eric is using one of the forms that match using >>>> syntax-case instead of the Redex pattern matcher? Do term-let and >>>> where clauses still work that way? >>> >>> Oh, good thinking! term-let uses syntax-case, but where clauses no longer >>> do. >>> >>>> (And if not, Eric, what version of PLT Scheme are you using?) >>>> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> From robby at eecs.northwestern.edu Thu Jun 3 09:15:38 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu, 3 Jun 2010 08:15:38 -0500 Subject: [plt-scheme] [redex] language keywords In-Reply-To: <6E41E775-1FB5-4703-8B13-FE25FCBD615A@dcc.uchile.cl> References: <07D269DE-9F82-46DE-8B05-70DD78BF517A@dcc.uchile.cl> <9B1E31BD-7861-4E42-92CD-A3FBDD9BFF2A@dcc.uchile.cl> <28EF3E64-909D-4D0D-9F9F-D357B7B4C7D6@dcc.uchile.cl> <6E41E775-1FB5-4703-8B13-FE25FCBD615A@dcc.uchile.cl> Message-ID: Oh, great! Robby On Thu, Jun 3, 2010 at 8:12 AM, Eric Tanter wrote: > Thanks all, > > I'm moving to 'where' everywhere, and it seems to work. It's even much more readable with where clauses than with the collections of (nested) term-lets that I had. > > -- ?ric > > > On Jun 3, 2010, at 2:36 AM, Robby Findler wrote: > >> It would be good to avoid term-let, I think, if you can use things >> like 'where' in the reduction relation instead. But we'd probably need >> to see an example use if you don't see how to do the transformation. >> >> Robby >> >> On Wed, Jun 2, 2010 at 9:51 PM, Eric Tanter wrote: >>> Yes, I do use term-let and that's (at least up to now) exactly where the >>> problem manifests! >>> >>> Should I be using something else? >>> >>> -- ?ric >>> >>> On Jun 2, 2010, at 22:40, Casey Klein wrote: >>> >>>> On Wed, Jun 2, 2010 at 9:21 PM, Carl Eastlund wrote: >>>>> >>>>> On Wed, Jun 2, 2010 at 10:15 PM, Casey Klein >>>>> wrote: >>>>>> >>>>>> On Wed, Jun 2, 2010 at 9:02 PM, Eric Tanter >>>>>> wrote: >>>>>>>>> >>>>>>>>> Is there something as simple/direct as the list of keywords in >>>>>>>>> syntax-rules/syntax-case? >>>>>>>>> If not, any alternative suggestion? >>>>>>>>> >>>>>>>>> Thanks! >>>>>>>>> >>>>>>>>> -- ?ric >>>>>>>> >>>>>>>> Take a look at variable-prefix. ?In my latest Redex work, variables >>>>>>>> all start with x, y, or z, and I just have to avoid any keywords that >>>>>>>> start with those. >>>>>>> >>>>>>> Thanks Carl, >>>>>>> >>>>>>> I'm using these as well, actually. >>>>>>> A problem I have is that, for readability, I have a non-terminal which >>>>>>> is define as (x >> x) where '>>' is a keyword. I know I could just use (x x) >>>>>>> for exactly the same, but it does enhance readability. >>>>>>> The problem is that >> is considered as a pattern variable... >>>>>>> >>>>>>> with macros I could just say: >>>>>>> (syntax-rules (>>) >>>>>>> ?((x >> x) ...)) >>>>>>> >>>>>>> Any idea? >>>>>>> >>>>>> >>>>>> I don't follow. The variables in a Redex pattern are always named >>>>>> after non-terminals, so I don't see how >> could be treated as a >>>>>> pattern variable. >>>>>> >>>>>> Do you mean that >> matches one of your six classes of variables? >>>>> >>>>> Is it possible Eric is using one of the forms that match using >>>>> syntax-case instead of the Redex pattern matcher? ?Do term-let and >>>>> where clauses still work that way? >>>> >>>> Oh, good thinking! term-let uses syntax-case, but where clauses no longer >>>> do. >>>> >>>>> (And if not, Eric, what version of PLT Scheme are you using?) >>>>> >>> _________________________________________________ >>> ?For list-related administrative tasks: >>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>> > > From dougorleans at gmail.com Thu Jun 3 09:58:36 2010 From: dougorleans at gmail.com (Doug Orleans) Date: Thu, 3 Jun 2010 09:58:36 -0400 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: References: <19463.42552.339766.549059@winooski.ccs.neu.edu> Message-ID: On Thu, Jun 3, 2010 at 9:08 AM, Matthias Felleisen wrote: > > On Jun 3, 2010, at 8:55 AM, Eli Barzilay wrote: > >> On Jun ?3, Matthias Felleisen wrote: >>> This must be the most fun (and useless) use of delimited >>> continuations I have seen since 1984. >> >> I'll bite: why is it useless? > > > The reset and shift in this case statically determine > the delimited continuation: > > ?\x. (/ x (* 2 a)) > > if it were prompt/control. I had recently read a discussion of delimited continuations in Scala, which implemented "zip" in a similar manner: http://dcsobral.blogspot.com/2009/07/delimited-continuations-explained-in.html So when I was implementing the quadratic formula for a Project Euler problem (can you guess which one? it's in the first 50) I thought I'd try this approach. Yes, obviously it's overkill for such a simple continuation (and it's surprisingly inefficient-- something like 20x slower than when I had worked out the quadratic roots by hand), but I thought it was neat to see a Scheme expression that looked as much like the quadratic formula as I could make it. (I thought about using double-dot infix notation but that's just too ugly.) I think it's similar to using continuations in the web server, to avoid having to break up the flow of a procedure that needs to get information from the user. > Of course, one can also shift (pardon the pun) reset around > and start discussions of backtracking computations at this > point and more stuff like that. Yes, it's not really clear where to put the reset. If you have more computations you want to apply to both roots, then you might want to move the reset earlier. This is probably not a useful general-purpose API, but I wonder if different continuation constructs would help somehow? I still don't quite grok all the differences between the various operators in scheme/control. --dougorleans at gmail.com From matthias at ccs.neu.edu Thu Jun 3 10:03:59 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu, 3 Jun 2010 10:03:59 -0400 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: References: <19463.42552.339766.549059@winooski.ccs.neu.edu> Message-ID: On Jun 3, 2010, at 9:58 AM, Doug Orleans wrote: > I think it's similar to using continuations in the web server, to avoid having to break up the flow of a procedure that needs to get information from the user. Not really. If you're writing programs not poetry (I do appreciate both!), you want continuation operators when you grab control at unpredictable points (e.g., timer events) or when you compose functions and the continuation is difficult or impossible to compute (e.g., if you used +/- many times). -- Matthias From eli at barzilay.org Thu Jun 3 10:08:54 2010 From: eli at barzilay.org (Eli Barzilay) Date: Thu, 3 Jun 2010 10:08:54 -0400 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: References: <19463.42552.339766.549059@winooski.ccs.neu.edu> Message-ID: <19463.46966.525884.951308@winooski.ccs.neu.edu> On Jun 3, Matthias Felleisen wrote: > On Jun 3, 2010, at 8:55 AM, Eli Barzilay wrote: > > > On Jun 3, Matthias Felleisen wrote: > >> This must be the most fun (and useless) use of delimited > >> continuations I have seen since 1984. > > > > I'll bite: why is it useless? > > > The reset and shift in this case statically determine > the delimited continuation: > > \x. (/ x (* 2 a)) > > if it were prompt/control. Looks like I had a better reason to bite than I knew -- how about an example? (Speaking about examples, is this too much as a 7-line example of black magic?) > >> Eli, I wonder how NUPRL deals with the quadratic formula? Or what > >> is the logical content of the below? > > > > Real numbers are not that interesting in that world... (But as > > for the logical content -- I don't remember much, I didn't go too > > much beyond being impressed with how call/cc translates.) > > Ignoring the real numbers, I think Tim had an example that used two > callccs and could have benefited from prompts. (Ah, I *think* that I've seen some backtracking example, I might have even did a limited version for fun; but that's well beyond my memory at this point in the "day".) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From etanter at dcc.uchile.cl Thu Jun 3 10:09:55 2010 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Thu, 3 Jun 2010 10:09:55 -0400 Subject: [plt-scheme] [redex] language keywords In-Reply-To: References: <07D269DE-9F82-46DE-8B05-70DD78BF517A@dcc.uchile.cl> <9B1E31BD-7861-4E42-92CD-A3FBDD9BFF2A@dcc.uchile.cl> <28EF3E64-909D-4D0D-9F9F-D357B7B4C7D6@dcc.uchile.cl> <6E41E775-1FB5-4703-8B13-FE25FCBD615A@dcc.uchile.cl> Message-ID: <04C2D4F5-C7B8-4644-9E9C-5C5D3040C5E5@dcc.uchile.cl> Is this 'where' clause something that was introduced somewhat recently? I remember from my first redex examples that the way to introduce a new identifier for instance was with ,(term-let ...). The same question goes for the definition of metafunctions. For instance, the definition of lambda-v on the web: http://redex.plt-scheme.org/lam-v.html for the subst metafunction, uses ,(term-let ...) to introduce (x_new ...) It seems the preferred way to do that now would be with a where clause, right? (I was surprised actually when seeing in the doc that term-let was low-level and not meant to use, while it was--and still is in some cases-- used in the simple introductory examples of plt redex) Thanks, -- ?ric On Jun 3, 2010, at 9:15 AM, Robby Findler wrote: > Oh, great! > > Robby > > On Thu, Jun 3, 2010 at 8:12 AM, Eric Tanter wrote: >> Thanks all, >> >> I'm moving to 'where' everywhere, and it seems to work. It's even much more readable with where clauses than with the collections of (nested) term-lets that I had. >> >> -- ?ric >> >> >> On Jun 3, 2010, at 2:36 AM, Robby Findler wrote: >> >>> It would be good to avoid term-let, I think, if you can use things >>> like 'where' in the reduction relation instead. But we'd probably need >>> to see an example use if you don't see how to do the transformation. >>> >>> Robby >>> >>> On Wed, Jun 2, 2010 at 9:51 PM, Eric Tanter wrote: >>>> Yes, I do use term-let and that's (at least up to now) exactly where the >>>> problem manifests! >>>> >>>> Should I be using something else? >>>> >>>> -- ?ric >>>> >>>> On Jun 2, 2010, at 22:40, Casey Klein wrote: >>>> >>>>> On Wed, Jun 2, 2010 at 9:21 PM, Carl Eastlund wrote: >>>>>> >>>>>> On Wed, Jun 2, 2010 at 10:15 PM, Casey Klein >>>>>> wrote: >>>>>>> >>>>>>> On Wed, Jun 2, 2010 at 9:02 PM, Eric Tanter >>>>>>> wrote: >>>>>>>>>> >>>>>>>>>> Is there something as simple/direct as the list of keywords in >>>>>>>>>> syntax-rules/syntax-case? >>>>>>>>>> If not, any alternative suggestion? >>>>>>>>>> >>>>>>>>>> Thanks! >>>>>>>>>> >>>>>>>>>> -- ?ric >>>>>>>>> >>>>>>>>> Take a look at variable-prefix. In my latest Redex work, variables >>>>>>>>> all start with x, y, or z, and I just have to avoid any keywords that >>>>>>>>> start with those. >>>>>>>> >>>>>>>> Thanks Carl, >>>>>>>> >>>>>>>> I'm using these as well, actually. >>>>>>>> A problem I have is that, for readability, I have a non-terminal which >>>>>>>> is define as (x >> x) where '>>' is a keyword. I know I could just use (x x) >>>>>>>> for exactly the same, but it does enhance readability. >>>>>>>> The problem is that >> is considered as a pattern variable... >>>>>>>> >>>>>>>> with macros I could just say: >>>>>>>> (syntax-rules (>>) >>>>>>>> ((x >> x) ...)) >>>>>>>> >>>>>>>> Any idea? >>>>>>>> >>>>>>> >>>>>>> I don't follow. The variables in a Redex pattern are always named >>>>>>> after non-terminals, so I don't see how >> could be treated as a >>>>>>> pattern variable. >>>>>>> >>>>>>> Do you mean that >> matches one of your six classes of variables? >>>>>> >>>>>> Is it possible Eric is using one of the forms that match using >>>>>> syntax-case instead of the Redex pattern matcher? Do term-let and >>>>>> where clauses still work that way? >>>>> >>>>> Oh, good thinking! term-let uses syntax-case, but where clauses no longer >>>>> do. >>>>> >>>>>> (And if not, Eric, what version of PLT Scheme are you using?) >>>>>> >>>> _________________________________________________ >>>> For list-related administrative tasks: >>>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>>> >> >> From etanter at dcc.uchile.cl Thu Jun 3 10:22:46 2010 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Thu, 3 Jun 2010 10:22:46 -0400 Subject: [plt-scheme] [redex] language keywords In-Reply-To: <04C2D4F5-C7B8-4644-9E9C-5C5D3040C5E5@dcc.uchile.cl> References: <07D269DE-9F82-46DE-8B05-70DD78BF517A@dcc.uchile.cl> <9B1E31BD-7861-4E42-92CD-A3FBDD9BFF2A@dcc.uchile.cl> <28EF3E64-909D-4D0D-9F9F-D357B7B4C7D6@dcc.uchile.cl> <6E41E775-1FB5-4703-8B13-FE25FCBD615A@dcc.uchile.cl> <04C2D4F5-C7B8-4644-9E9C-5C5D3040C5E5@dcc.uchile.cl> Message-ID: Looking at the Redex book, I guess the answer to my question is "yes". So, it may be a good idea to update the redex website accordingly. Thanks, -- ?ric On Jun 3, 2010, at 10:09 AM, Eric Tanter wrote: > Is this 'where' clause something that was introduced somewhat recently? > I remember from my first redex examples that the way to introduce a new identifier for instance was with ,(term-let ...). > > The same question goes for the definition of metafunctions. For instance, the definition of lambda-v on the web: > http://redex.plt-scheme.org/lam-v.html > for the subst metafunction, uses ,(term-let ...) to introduce (x_new ...) > > It seems the preferred way to do that now would be with a where clause, right? > > (I was surprised actually when seeing in the doc that term-let was low-level and not meant to use, while it was--and still is in some cases-- used in the simple introductory examples of plt redex) > > Thanks, > > -- ?ric > > > On Jun 3, 2010, at 9:15 AM, Robby Findler wrote: > >> Oh, great! >> >> Robby >> >> On Thu, Jun 3, 2010 at 8:12 AM, Eric Tanter wrote: >>> Thanks all, >>> >>> I'm moving to 'where' everywhere, and it seems to work. It's even much more readable with where clauses than with the collections of (nested) term-lets that I had. >>> >>> -- ?ric >>> >>> >>> On Jun 3, 2010, at 2:36 AM, Robby Findler wrote: >>> >>>> It would be good to avoid term-let, I think, if you can use things >>>> like 'where' in the reduction relation instead. But we'd probably need >>>> to see an example use if you don't see how to do the transformation. >>>> >>>> Robby >>>> >>>> On Wed, Jun 2, 2010 at 9:51 PM, Eric Tanter wrote: >>>>> Yes, I do use term-let and that's (at least up to now) exactly where the >>>>> problem manifests! >>>>> >>>>> Should I be using something else? >>>>> >>>>> -- ?ric >>>>> >>>>> On Jun 2, 2010, at 22:40, Casey Klein wrote: >>>>> >>>>>> On Wed, Jun 2, 2010 at 9:21 PM, Carl Eastlund wrote: >>>>>>> >>>>>>> On Wed, Jun 2, 2010 at 10:15 PM, Casey Klein >>>>>>> wrote: >>>>>>>> >>>>>>>> On Wed, Jun 2, 2010 at 9:02 PM, Eric Tanter >>>>>>>> wrote: >>>>>>>>>>> >>>>>>>>>>> Is there something as simple/direct as the list of keywords in >>>>>>>>>>> syntax-rules/syntax-case? >>>>>>>>>>> If not, any alternative suggestion? >>>>>>>>>>> >>>>>>>>>>> Thanks! >>>>>>>>>>> >>>>>>>>>>> -- ?ric >>>>>>>>>> >>>>>>>>>> Take a look at variable-prefix. In my latest Redex work, variables >>>>>>>>>> all start with x, y, or z, and I just have to avoid any keywords that >>>>>>>>>> start with those. >>>>>>>>> >>>>>>>>> Thanks Carl, >>>>>>>>> >>>>>>>>> I'm using these as well, actually. >>>>>>>>> A problem I have is that, for readability, I have a non-terminal which >>>>>>>>> is define as (x >> x) where '>>' is a keyword. I know I could just use (x x) >>>>>>>>> for exactly the same, but it does enhance readability. >>>>>>>>> The problem is that >> is considered as a pattern variable... >>>>>>>>> >>>>>>>>> with macros I could just say: >>>>>>>>> (syntax-rules (>>) >>>>>>>>> ((x >> x) ...)) >>>>>>>>> >>>>>>>>> Any idea? >>>>>>>>> >>>>>>>> >>>>>>>> I don't follow. The variables in a Redex pattern are always named >>>>>>>> after non-terminals, so I don't see how >> could be treated as a >>>>>>>> pattern variable. >>>>>>>> >>>>>>>> Do you mean that >> matches one of your six classes of variables? >>>>>>> >>>>>>> Is it possible Eric is using one of the forms that match using >>>>>>> syntax-case instead of the Redex pattern matcher? Do term-let and >>>>>>> where clauses still work that way? >>>>>> >>>>>> Oh, good thinking! term-let uses syntax-case, but where clauses no longer >>>>>> do. >>>>>> >>>>>>> (And if not, Eric, what version of PLT Scheme are you using?) >>>>>>> >>>>> _________________________________________________ >>>>> 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 marek at xivilization.net Thu Jun 3 10:24:21 2010 From: marek at xivilization.net (Marek Kubica) Date: Thu, 3 Jun 2010 16:24:21 +0200 Subject: [plt-scheme] miniKanren: translation from Prolog In-Reply-To: References: <20100526192007.1e5c2b93@xivilization.net> <9DBCE8E1-5594-481E-9013-F80EC6F32AD1@ccs.neu.edu> <20100527180618.47ed209c@xivilization.net> Message-ID: <20100603162421.091d6786@halmanfloyd.lan.local> Hi, On Thu, 27 May 2010 20:05:24 -0400 Lindsey Kuper wrote: > On Thu, May 27, 2010 at 12:06 PM, Marek Kubica > wrote: > > Ok, I slowly start to see the pattern how to translate Prolog code > > into miniKanren. > > It's tricky, because miniKanren doesn't have Prolog's pattern-matching > ability built in. There is, however, a pattern-matching macro for > miniKanren, which you can find at the URL I gave earlier. (Not much > in the way of up-to-date documentation, unfortunately. I should do > something about that.) As a matter of "getting things done" I switched to Schelog for that task. I needed to do some porting to get the 2001-code running but I was able to translate the Prolog solution without problems. The next major PLT release (PLT Racket 5) will include Racketlog, an improved version of Schelog. > > Hmm, maybe I should come up with a version of permute that does not > > need do-insert... Tricky, since I am quite new to logic programming. > > Yes, I think that do-insert might not be the most natural way to write > it in miniKanren. If I ever have time to come back again to miniKanren, I'll be sure to try it again :) regards, Marek From etanter at dcc.uchile.cl Thu Jun 3 10:32:17 2010 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Thu, 3 Jun 2010 10:32:17 -0400 Subject: [plt-scheme] [redex] what computation is happening? Message-ID: <72A991A8-4599-4A04-AA8D-493136EB6D55@dcc.uchile.cl> Hi, I'm wondering what happens exactly when one "runs" a redex module that has no tests/traces at all. I have one language definition and one reduction relation (admittedly both quite complex, around 300 lines with generous indentation), and when I click "run" it takes around 40 seconds before I get the prompt back in the interaction window. So something substantial must be going on, I'd like to know what. In particular, that computation was able to find places where I forgot to use ellipsis for instance, but not able to report parts where I use undefined metafunctions (I use around 20 as-yet-undefined metafunctions in the reductions). I doubt that these 40 seconds are only used to check for proper uses of ellipses... (I'm on 4.2.5, mac os 10.6) Thanks! -- ?ric From matthias at ccs.neu.edu Thu Jun 3 10:36:51 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu, 3 Jun 2010 10:36:51 -0400 Subject: [plt-scheme] [redex] what computation is happening? In-Reply-To: <72A991A8-4599-4A04-AA8D-493136EB6D55@dcc.uchile.cl> References: <72A991A8-4599-4A04-AA8D-493136EB6D55@dcc.uchile.cl> Message-ID: On Jun 3, 2010, at 10:32 AM, Eric Tanter wrote: > Hi, > > I'm wondering what happens exactly when one "runs" a redex module that has no tests/traces at all. Nothing really. See below. > I have one language definition and one reduction relation (admittedly both quite complex, around 300 lines with generous indentation), and when I click "run" it takes around 40 seconds before I get the prompt back in the interaction window. > > So something substantial must be going on, I'd like to know what. Expansion. Redex is kind of like Typed Scheme in this regard. It exists to make your programs run slower. > In particular, that computation was able to find places where I forgot to use ellipsis for instance, but not able to report parts where I use undefined metafunctions (I use around 20 as-yet-undefined metafunctions in the reductions). I doubt that these 40 seconds are only used to check for proper uses of ellipses... > > (I'm on 4.2.5, mac os 10.6) > > Thanks! > > -- ?ric > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From matthias at ccs.neu.edu Thu Jun 3 10:45:50 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu, 3 Jun 2010 10:45:50 -0400 Subject: [plt-scheme] Grafting a console onto universe, hackety hack. In-Reply-To: <1D7C9EA8-758D-47E7-A30C-B21384932B46@fellowhuman.com> References: <50B9A046-AC0C-438D-9576-029A182D64A6@ccs.neu.edu> <1D7C9EA8-758D-47E7-A30C-B21384932B46@fellowhuman.com> Message-ID: On Jun 3, 2010, at 3:08 AM, Jordan Johnson wrote: > > > On Jun 2, 2010, at 7:24 PM, Matthias Felleisen wrote: >> I am trying to figure what exactly you're trying to achieve. >> I have parameterized the 'world' over many things with mixins >> and all, but I have not considered a reuse where you want to >> bring events from somewhere else. I think it should be possible >> to expose some private interface -- if I knew what you wanted. > > Sorry if the example code wasn't clear. Your code was clear. The point of the code wasn't. > I'm thinking of the Interactions window, or further afield, some chat and MUD clients, or terminal emulators, where the user interface essentially consists of: > - a command line for entering text > - a scrolling display of the interaction history, which cannot be edited I assigned a chat room to my Bootcamp class last fall. Messages were at most N chars long, and they were sent when the user reached maximum width and/or hit return. If too many messages were sent, the oldest ones were removed from the display. No scrolling. See http://www.ccs.neu.edu/home/matthias/107-f09/Assignments/9.html When I first came up with this functional style of IO, I had hoped to get scrolling in there. I put a PhD student on (Carl), but that didn't work out. I had really hoped -- and still do deep down somewhere -- that it does scale. Shriram and Danny are kind of working on this problem. > Does that make my intent clearer? Completely. I am wondering whether you could write a console that is a participant of a 'universe' and use a local server to connect the text field and the displayed text. But that's also like set! so it's too imperative. ;; --- In my spare time, I will think about parameterizing big-bang over the text/window field that it displays. I know it's doable in principle because classes are first-class and it could be a neat test case for just that reason. -- Matthias From clklein at eecs.northwestern.edu Thu Jun 3 10:49:23 2010 From: clklein at eecs.northwestern.edu (Casey Klein) Date: Thu, 3 Jun 2010 09:49:23 -0500 Subject: [plt-scheme] [redex] what computation is happening? In-Reply-To: References: <72A991A8-4599-4A04-AA8D-493136EB6D55@dcc.uchile.cl> Message-ID: On Thu, Jun 3, 2010 at 9:36 AM, Matthias Felleisen wrote: > > > On Jun 3, 2010, at 10:32 AM, Eric Tanter wrote: > >> Hi, >> >> I'm wondering what happens exactly when one "runs" a redex module that has no tests/traces at all. > > Nothing really. See below. > > >> I have one language definition and one reduction relation (admittedly both quite complex, around 300 lines with generous indentation), and when I click "run" it takes around 40 seconds before I get the prompt back in the interaction window. >> >> So something substantial must be going on, I'd like to know what. > > Expansion. Redex is kind of like Typed Scheme in this regard. It exists to make your programs run slower. > If you find the 40 seconds too painful, turn off debugging and profiling. 1. Select "Choose Language..." from the "Language" menu. 2. Click the "Show Details" button for the module/#lang language. 3. Edit the "Dynamic Properties." On my machine, running the R6RS model takes about 70 seconds with debugging and profiling enabled but only 10 seconds without it. > >> In particular, that computation was able to find places where I forgot to use ellipsis for instance, but not able to report parts where I use undefined metafunctions (I use around 20 as-yet-undefined metafunctions in the reductions). I doubt that these 40 seconds are only used to check for proper uses of ellipses... >> FWIW, Redex can't tell if a symbol is an undefined meta-function or a literal in the syntax of your object language. >> (I'm on 4.2.5, mac os 10.6) >> >> Thanks! >> >> -- ?ric >> _________________________________________________ >> ?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 etanter at dcc.uchile.cl Thu Jun 3 10:54:02 2010 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Thu, 3 Jun 2010 10:54:02 -0400 Subject: [plt-scheme] [redex] what computation is happening? In-Reply-To: References: <72A991A8-4599-4A04-AA8D-493136EB6D55@dcc.uchile.cl> Message-ID: <194B8C84-861E-4CF2-B180-18E8304101E3@dcc.uchile.cl> On Jun 3, 2010, at 10:36 AM, Matthias Felleisen wrote: > Expansion. Redex is kind of like Typed Scheme in this regard. It exists to make your programs run slower. I had the unfortunate idea to open the macro stepper to see what expansion is going on. Quite bad idea because it took several minutes before the macro stepper window open and would finally not show anything, just saying "Expansion finished" and showing all the code, intact. -- ?ric From matthias at ccs.neu.edu Thu Jun 3 10:56:08 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu, 3 Jun 2010 10:56:08 -0400 Subject: [plt-scheme] [redex] what computation is happening? In-Reply-To: <194B8C84-861E-4CF2-B180-18E8304101E3@dcc.uchile.cl> References: <72A991A8-4599-4A04-AA8D-493136EB6D55@dcc.uchile.cl> <194B8C84-861E-4CF2-B180-18E8304101E3@dcc.uchile.cl> Message-ID: Play with hiding policy. On Jun 3, 2010, at 10:54 AM, Eric Tanter wrote: > On Jun 3, 2010, at 10:36 AM, Matthias Felleisen wrote: >> Expansion. Redex is kind of like Typed Scheme in this regard. It exists to make your programs run slower. > > I had the unfortunate idea to open the macro stepper to see what expansion is going on. Quite bad idea because it took several minutes before the macro stepper window open and would finally not show anything, just saying "Expansion finished" and showing all the code, intact. > > -- ?ric From etanter at dcc.uchile.cl Thu Jun 3 10:57:06 2010 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Thu, 3 Jun 2010 10:57:06 -0400 Subject: [plt-scheme] [redex] what computation is happening? In-Reply-To: References: <72A991A8-4599-4A04-AA8D-493136EB6D55@dcc.uchile.cl> Message-ID: Thanks Casey, this brought down the 40 seconds to around 7-8 seconds. -- ?ric On Jun 3, 2010, at 10:49 AM, Casey Klein wrote: > If you find the 40 seconds too painful, turn off debugging and profiling. > > 1. Select "Choose Language..." from the "Language" menu. > 2. Click the "Show Details" button for the module/#lang language. > 3. Edit the "Dynamic Properties." > > On my machine, running the R6RS model takes about 70 seconds with > debugging and profiling enabled but only 10 seconds without it. From clklein at eecs.northwestern.edu Thu Jun 3 11:01:31 2010 From: clklein at eecs.northwestern.edu (Casey Klein) Date: Thu, 3 Jun 2010 10:01:31 -0500 Subject: [plt-scheme] [redex] what computation is happening? In-Reply-To: References: <72A991A8-4599-4A04-AA8D-493136EB6D55@dcc.uchile.cl> Message-ID: One more coping mechanism: if it's not too painful, split your 300 line module into several smaller ones, so that only the modules you changed need to be recompiled. On Thu, Jun 3, 2010 at 9:57 AM, Eric Tanter wrote: > Thanks Casey, this brought down the 40 seconds to around 7-8 seconds. > > -- ?ric > > > On Jun 3, 2010, at 10:49 AM, Casey Klein wrote: >> If you find the 40 seconds too painful, turn off debugging and profiling. >> >> 1. Select "Choose Language..." from the "Language" menu. >> 2. Click the "Show Details" button for the module/#lang language. >> 3. Edit the "Dynamic Properties." >> >> On my machine, running the R6RS model takes about 70 seconds with >> debugging and profiling enabled but only 10 seconds without it. > > > From etanter at dcc.uchile.cl Thu Jun 3 11:03:13 2010 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Thu, 3 Jun 2010 11:03:13 -0400 Subject: [plt-scheme] [redex] what computation is happening? In-Reply-To: References: <72A991A8-4599-4A04-AA8D-493136EB6D55@dcc.uchile.cl> <194B8C84-861E-4CF2-B180-18E8304101E3@dcc.uchile.cl> Message-ID: Ahah, much more interesting! Thanks, -- ?ric On Jun 3, 2010, at 10:56 AM, Matthias Felleisen wrote: > > Play with hiding policy. > > On Jun 3, 2010, at 10:54 AM, Eric Tanter wrote: > >> On Jun 3, 2010, at 10:36 AM, Matthias Felleisen wrote: >>> Expansion. Redex is kind of like Typed Scheme in this regard. It exists to make your programs run slower. >> >> I had the unfortunate idea to open the macro stepper to see what expansion is going on. Quite bad idea because it took several minutes before the macro stepper window open and would finally not show anything, just saying "Expansion finished" and showing all the code, intact. >> >> -- ?ric From etanter at dcc.uchile.cl Thu Jun 3 11:05:48 2010 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Thu, 3 Jun 2010 11:05:48 -0400 Subject: [plt-scheme] [redex] what computation is happening? In-Reply-To: References: <72A991A8-4599-4A04-AA8D-493136EB6D55@dcc.uchile.cl> Message-ID: <204DA510-FCAE-40A2-8F71-DC7EC8841367@dcc.uchile.cl> Thanks, I will try that probably later, because at this early stage many things are likely to change. (or will I see benefits also if I just put the syntax in one module and the reductions in another?) -- ?ric On Jun 3, 2010, at 11:01 AM, Casey Klein wrote: > One more coping mechanism: if it's not too painful, split your 300 > line module into several smaller ones, so that only the modules you > changed need to be recompiled. > > On Thu, Jun 3, 2010 at 9:57 AM, Eric Tanter wrote: >> Thanks Casey, this brought down the 40 seconds to around 7-8 seconds. >> >> -- ?ric >> >> >> On Jun 3, 2010, at 10:49 AM, Casey Klein wrote: >>> If you find the 40 seconds too painful, turn off debugging and profiling. >>> >>> 1. Select "Choose Language..." from the "Language" menu. >>> 2. Click the "Show Details" button for the module/#lang language. >>> 3. Edit the "Dynamic Properties." >>> >>> On my machine, running the R6RS model takes about 70 seconds with >>> debugging and profiling enabled but only 10 seconds without it. >> >> >> From nadeem at acm.org Thu Jun 3 11:09:34 2010 From: nadeem at acm.org (Nadeem Abdul Hamid) Date: Thu, 3 Jun 2010 11:09:34 -0400 Subject: [plt-scheme] Formlet in web app examples Message-ID: Are there examples of formlet usage in web servlets somewhere? --- nadeem From clklein at eecs.northwestern.edu Thu Jun 3 11:14:31 2010 From: clklein at eecs.northwestern.edu (Casey Klein) Date: Thu, 3 Jun 2010 10:14:31 -0500 Subject: [plt-scheme] [redex] what computation is happening? In-Reply-To: <204DA510-FCAE-40A2-8F71-DC7EC8841367@dcc.uchile.cl> References: <72A991A8-4599-4A04-AA8D-493136EB6D55@dcc.uchile.cl> <204DA510-FCAE-40A2-8F71-DC7EC8841367@dcc.uchile.cl> Message-ID: On Thu, Jun 3, 2010 at 10:05 AM, Eric Tanter wrote: > Thanks, I will try that probably later, because at this early stage many things are likely to change. > (or will I see benefits also if I just put the syntax in one module and the reductions in another?) > You'll see some benefit by moving the `define-language' to another module, but my guess is that most of the time is spent expanding and compiling the reductions. From clements at brinckerhoff.org Thu Jun 3 12:06:24 2010 From: clements at brinckerhoff.org (John Clements) Date: Thu, 3 Jun 2010 09:06:24 -0700 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: References: <19463.42552.339766.549059@winooski.ccs.neu.edu> Message-ID: <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> On Jun 3, 2010, at 7:03 AM, Matthias Felleisen wrote: > > On Jun 3, 2010, at 9:58 AM, Doug Orleans wrote: > >> I think it's similar to using continuations in the web server, to avoid having to break up the flow of a procedure that needs to get information from the user. > > Not really. If you're writing programs not poetry (I do appreciate both!), you want continuation operators when you grab control at unpredictable points (e.g., timer events) or when you compose functions and the continuation is difficult or impossible to compute (e.g., if you used +/- many times). Am I naive to think of this use of delimited continuations as basically being a version of 'yield' with external control over the yield boundary? John -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4669 bytes Desc: not available URL: From matthias at ccs.neu.edu Thu Jun 3 12:11:11 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu, 3 Jun 2010 12:11:11 -0400 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> References: <19463.42552.339766.549059@winooski.ccs.neu.edu> <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> Message-ID: On Jun 3, 2010, at 12:06 PM, John Clements wrote: > > On Jun 3, 2010, at 7:03 AM, Matthias Felleisen wrote: > >> >> On Jun 3, 2010, at 9:58 AM, Doug Orleans wrote: >> >>> I think it's similar to using continuations in the web server, to avoid having to break up the flow of a procedure that needs to get information from the user. >> >> Not really. If you're writing programs not poetry (I do appreciate both!), you want continuation operators when you grab control at unpredictable points (e.g., timer events) or when you compose functions and the continuation is difficult or impossible to compute (e.g., if you used +/- many times). > > Am I naive to think of this use of delimited continuations as basically being a version of 'yield' with external control over the yield boundary? You can't do this with yield at all. Doug's poem computes two values -- as in multiple values -- with a single function body. From jay.mccarthy at gmail.com Thu Jun 3 12:19:48 2010 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu, 3 Jun 2010 10:19:48 -0600 Subject: [plt-scheme] Formlet in web app examples In-Reply-To: References: Message-ID: A recent application I've been writing uses them: http://github.com/jeapostrophe/m8b/blob/master/go.rkt Do you just want SOME example or do you find something confusing about the documentation? (i.e. what can I do to improve the documentation other than linking an example?) Jay On Thu, Jun 3, 2010 at 9:09 AM, Nadeem Abdul Hamid wrote: > Are there examples of formlet usage in web servlets somewhere? > > --- nadeem > _________________________________________________ > ?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 Jun 3 12:31:56 2010 From: clements at brinckerhoff.org (John Clements) Date: Thu, 3 Jun 2010 09:31:56 -0700 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: References: <19463.42552.339766.549059@winooski.ccs.neu.edu> <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> Message-ID: On Jun 3, 2010, at 9:11 AM, Matthias Felleisen wrote: > > On Jun 3, 2010, at 12:06 PM, John Clements wrote: > >> >> On Jun 3, 2010, at 7:03 AM, Matthias Felleisen wrote: >> >>> >>> On Jun 3, 2010, at 9:58 AM, Doug Orleans wrote: >>> >>>> I think it's similar to using continuations in the web server, to avoid having to break up the flow of a procedure that needs to get information from the user. >>> >>> Not really. If you're writing programs not poetry (I do appreciate both!), you want continuation operators when you grab control at unpredictable points (e.g., timer events) or when you compose functions and the continuation is difficult or impossible to compute (e.g., if you used +/- many times). >> >> Am I naive to think of this use of delimited continuations as basically being a version of 'yield' with external control over the yield boundary? > > You can't do this with yield at all. Doug's poem computes two values -- as in multiple values -- with a single function body. Sorry, maybe this wasn't clear: I mean e.g. the python 'yield', which allows a function to return multiple values in a serialized form. The only problem with this mechanism is that the yield boundary is fixed on entry to the function call. John -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4669 bytes Desc: not available URL: From nadeem at acm.org Thu Jun 3 12:32:03 2010 From: nadeem at acm.org (Nadeem Abdul Hamid) Date: Thu, 3 Jun 2010 12:32:03 -0400 Subject: [plt-scheme] Formlet in web app examples In-Reply-To: References: Message-ID: <88ED1DA7-608F-42B4-8C27-AE20B8EFF9BE@acm.org> OK that's helpful, thanks. Well, I was actually trying to figure out how embed-formlet would be used -- the docs for that and send/formlet seemed a little terse to me. But I see your example constructs the form action and calls formlet-process explicitly to extract results. --- nadeem On Jun 3, 2010, at 12:19 PM, Jay McCarthy wrote: > A recent application I've been writing uses them: > > http://github.com/jeapostrophe/m8b/blob/master/go.rkt > > Do you just want SOME example or do you find something confusing about > the documentation? (i.e. what can I do to improve the documentation > other than linking an example?) > > Jay > > On Thu, Jun 3, 2010 at 9:09 AM, Nadeem Abdul Hamid wrote: >> Are there examples of formlet usage in web servlets somewhere? >> >> --- nadeem >> _________________________________________________ >> 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 Thu Jun 3 12:33:53 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu, 3 Jun 2010 12:33:53 -0400 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: References: <19463.42552.339766.549059@winooski.ccs.neu.edu> <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> Message-ID: <187AADFC-4731-4DF9-BFE7-8696827C19E9@ccs.neu.edu> On Jun 3, 2010, at 12:31 PM, John Clements wrote: >> Sorry, maybe this wasn't clear: I mean e.g. the python 'yield', which allows a function to return multiple values in a serialized form. If you can write a yield + create a two-element structure in Python that way, you can mimic delimited continuations. > The only problem with this mechanism is that the yield boundary is fixed on entry to the function call. That's minor. Reset is next to the function entry point too. Go for it. Show us that Python has delimited continuations. From jay.mccarthy at gmail.com Thu Jun 3 12:35:32 2010 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu, 3 Jun 2010 10:35:32 -0600 Subject: [plt-scheme] Formlet in web app examples In-Reply-To: References: <88ED1DA7-608F-42B4-8C27-AE20B8EFF9BE@acm.org> Message-ID: They are very good for extremely short examples like add two numbers though: http://github.com/plt/racket/blob/master/collects/web-server/default-web-root/htdocs/servlets/examples/add-formlets.rkt Jay On Thu, Jun 3, 2010 at 10:34 AM, Jay McCarthy wrote: > Ya those functions were ideas that I thought would be useful but > really aren't that convenient to use in practice. > > Jay > > On Thu, Jun 3, 2010 at 10:32 AM, Nadeem Abdul Hamid wrote: >> OK that's helpful, thanks. >> >> Well, I was actually trying to figure out how embed-formlet would be used -- the docs for that and send/formlet seemed a little terse to me. But I see your example constructs the form action and calls formlet-process explicitly to extract results. >> >> --- nadeem >> >> >> On Jun 3, 2010, at 12:19 PM, Jay McCarthy wrote: >> >>> A recent application I've been writing uses them: >>> >>> http://github.com/jeapostrophe/m8b/blob/master/go.rkt >>> >>> Do you just want SOME example or do you find something confusing about >>> the documentation? (i.e. what can I do to improve the documentation >>> other than linking an example?) >>> >>> Jay >>> >>> On Thu, Jun 3, 2010 at 9:09 AM, Nadeem Abdul Hamid wrote: >>>> Are there examples of formlet usage in web servlets somewhere? >>>> >>>> --- nadeem >>>> _________________________________________________ >>>> ?For list-related administrative tasks: >>>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>>> >>> >>> >>> >>> -- >>> Jay McCarthy >>> Assistant Professor / Brigham Young University >>> http://teammccarthy.org/jay >>> >>> "The glory of God is Intelligence" - D&C 93 >> >> > > > > -- > Jay McCarthy > Assistant Professor / Brigham Young University > http://teammccarthy.org/jay > > "The glory of God is Intelligence" - D&C 93 > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From jay.mccarthy at gmail.com Thu Jun 3 12:34:37 2010 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu, 3 Jun 2010 10:34:37 -0600 Subject: [plt-scheme] Formlet in web app examples In-Reply-To: <88ED1DA7-608F-42B4-8C27-AE20B8EFF9BE@acm.org> References: <88ED1DA7-608F-42B4-8C27-AE20B8EFF9BE@acm.org> Message-ID: Ya those functions were ideas that I thought would be useful but really aren't that convenient to use in practice. Jay On Thu, Jun 3, 2010 at 10:32 AM, Nadeem Abdul Hamid wrote: > OK that's helpful, thanks. > > Well, I was actually trying to figure out how embed-formlet would be used -- the docs for that and send/formlet seemed a little terse to me. But I see your example constructs the form action and calls formlet-process explicitly to extract results. > > --- nadeem > > > On Jun 3, 2010, at 12:19 PM, Jay McCarthy wrote: > >> A recent application I've been writing uses them: >> >> http://github.com/jeapostrophe/m8b/blob/master/go.rkt >> >> Do you just want SOME example or do you find something confusing about >> the documentation? (i.e. what can I do to improve the documentation >> other than linking an example?) >> >> Jay >> >> On Thu, Jun 3, 2010 at 9:09 AM, Nadeem Abdul Hamid wrote: >>> Are there examples of formlet usage in web servlets somewhere? >>> >>> --- nadeem >>> _________________________________________________ >>> ?For list-related administrative tasks: >>> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>> >> >> >> >> -- >> Jay McCarthy >> Assistant Professor / Brigham Young University >> http://teammccarthy.org/jay >> >> "The glory of God is Intelligence" - D&C 93 > > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From dougorleans at gmail.com Thu Jun 3 12:41:42 2010 From: dougorleans at gmail.com (Doug Orleans) Date: Thu, 3 Jun 2010 12:41:42 -0400 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> References: <19463.42552.339766.549059@winooski.ccs.neu.edu> <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> Message-ID: On Thu, Jun 3, 2010 at 12:06 PM, John Clements wrote: > Am I naive to think of this use of delimited continuations as basically being a version of 'yield' with external control over the yield boundary? I think it's sort of the dual of that. With yield, you can return from a function multiple times (controlled by the caller). This example is calling the continuation multiple times, but then returning from the function once. --dougorleans at gmail.com From eli at barzilay.org Thu Jun 3 13:07:19 2010 From: eli at barzilay.org (Eli Barzilay) Date: Thu, 3 Jun 2010 13:07:19 -0400 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: <187AADFC-4731-4DF9-BFE7-8696827C19E9@ccs.neu.edu> References: <19463.42552.339766.549059@winooski.ccs.neu.edu> <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> <187AADFC-4731-4DF9-BFE7-8696827C19E9@ccs.neu.edu> Message-ID: <19463.57671.93353.161053@winooski.ccs.neu.edu> On Jun 3, Matthias Felleisen wrote: > On Jun 3, 2010, at 12:31 PM, John Clements wrote: > > >> Sorry, maybe this wasn't clear: I mean e.g. the python 'yield', > >> which allows a function to return multiple values in a serialized > >> form. > > If you can write a yield + create a two-element structure in Python > that way, you can mimic delimited continuations. > > > > The only problem with this mechanism is that the yield boundary is > > fixed on entry to the function call. > > That's minor. Reset is next to the function entry point too. > > Go for it. Show us that Python has delimited continuations. Here's some quick code: #lang scheme (require scheme/generator) (define (foo x y) (yield x) (yield (+ x y))) (define (bar a b c) (generator ; v5 will require () after `generator' (for* ([x (in-generator (foo a b))] [y (in-generator (foo x c))]) (yield y)))) (define g (bar 100 10 1)) (g) (g) (g) (g) where `foo' is the moral equivalent of plus/minus. Given that this uses exactly the feature that scheme/generator has that python doesn't (it uses a dynamic `yield' so it can be used in "helper" functions), it would be interesting to see if there's a way to do that in python. (I think that Jon looked for an example that shows the difference.) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From rafkind at cs.utah.edu Thu Jun 3 13:19:29 2010 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Thu, 03 Jun 2010 11:19:29 -0600 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: <19463.57671.93353.161053@winooski.ccs.neu.edu> References: <19463.42552.339766.549059@winooski.ccs.neu.edu> <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> <187AADFC-4731-4DF9-BFE7-8696827C19E9@ccs.neu.edu> <19463.57671.93353.161053@winooski.ccs.neu.edu> Message-ID: <4C07E421.40402@cs.utah.edu> On 06/03/2010 11:07 AM, Eli Barzilay wrote: > On Jun 3, Matthias Felleisen wrote: > >> On Jun 3, 2010, at 12:31 PM, John Clements wrote: >> >> >>>> Sorry, maybe this wasn't clear: I mean e.g. the python 'yield', >>>> which allows a function to return multiple values in a serialized >>>> form. >>>> >> If you can write a yield + create a two-element structure in Python >> that way, you can mimic delimited continuations. >> >> >> >>> The only problem with this mechanism is that the yield boundary is >>> fixed on entry to the function call. >>> >> That's minor. Reset is next to the function entry point too. >> >> Go for it. Show us that Python has delimited continuations. >> > Here's some quick code: > > #lang scheme > (require scheme/generator) > (define (foo x y) (yield x) (yield (+ x y))) > (define (bar a b c) > (generator ; v5 will require () after `generator' > (for* ([x (in-generator (foo a b))] > [y (in-generator (foo x c))]) > (yield y)))) > (define g (bar 100 10 1)) > (g) (g) (g) (g) > > where `foo' is the moral equivalent of plus/minus. Given that this > uses exactly the feature that scheme/generator has that python doesn't > (it uses a dynamic `yield' so it can be used in "helper" functions), > it would be interesting to see if there's a way to do that in python. > > (I think that Jon looked for an example that shows the difference.) > > This python program behaves the same, although it would break if one of the `yield's in (foo) were moved to a helper function, like (define (foo1 x) (yield x)) (define (foo x y) (yield x) (foo1 (+ x y))) # -- python -- def foo(x, y): yield x yield x + y def bar(a, b, c): for x in foo(a, b): for y in foo(x, c): yield y for n in bar(100, 10, 1): print n # -- end -- I wrote some stuff about delimited continuations in scheme vs python, I'll try to dig it up and see if there is anything interesting in it. From clements at brinckerhoff.org Thu Jun 3 13:40:39 2010 From: clements at brinckerhoff.org (John Clements) Date: Thu, 3 Jun 2010 10:40:39 -0700 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: <4C07E421.40402@cs.utah.edu> References: <19463.42552.339766.549059@winooski.ccs.neu.edu> <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> <187AADFC-4731-4DF9-BFE7-8696827C19E9@ccs.neu.edu> <19463.57671.93353.161053@winooski.ccs.neu.edu> <4C07E421.40402@cs.utah.edu> Message-ID: <96892BA4-ACB4-4734-9473-11850AAC8463@brinckerhoff.org> On Jun 3, 2010, at 10:19 AM, Jon Rafkind wrote: > On 06/03/2010 11:07 AM, Eli Barzilay wrote: >> On Jun 3, Matthias Felleisen wrote: >> >>> On Jun 3, 2010, at 12:31 PM, John Clements wrote: >>> >>> >>>>> Sorry, maybe this wasn't clear: I mean e.g. the python 'yield', >>>>> which allows a function to return multiple values in a serialized >>>>> form. >>>>> >>> If you can write a yield + create a two-element structure in Python >>> that way, you can mimic delimited continuations. >>> >>> >>> >>>> The only problem with this mechanism is that the yield boundary is >>>> fixed on entry to the function call. >>>> >>> That's minor. Reset is next to the function entry point too. >>> >>> Go for it. Show us that Python has delimited continuations. >>> >> Here's some quick code: >> >> #lang scheme >> (require scheme/generator) >> (define (foo x y) (yield x) (yield (+ x y))) >> (define (bar a b c) >> (generator ; v5 will require () after `generator' >> (for* ([x (in-generator (foo a b))] >> [y (in-generator (foo x c))]) >> (yield y)))) >> (define g (bar 100 10 1)) >> (g) (g) (g) (g) >> >> where `foo' is the moral equivalent of plus/minus. Given that this >> uses exactly the feature that scheme/generator has that python doesn't >> (it uses a dynamic `yield' so it can be used in "helper" functions), >> it would be interesting to see if there's a way to do that in python. >> >> (I think that Jon looked for an example that shows the difference.) >> >> > > This python program behaves the same, although it would break if one of the `yield's in (foo) were moved to a helper function, like > > (define (foo1 x) (yield x)) > (define (foo x y) (yield x) (foo1 (+ x y))) > > # -- python -- > def foo(x, y): > yield x > yield x + y > > def bar(a, b, c): > for x in foo(a, b): > for y in foo(x, c): > yield y > > for n in bar(100, 10, 1): > print n > # -- end -- Right... the problem with this is that the body of bar gets horribly mangled, and the calls to foo have to be lifted out. This is basically the partial CPSing that would be required to implement this without generators. I'm wondering, though: if you "capture a continuation" by using a yield in Python, and make a copy of the resulting generator, can you enter the two resulting "continuations" separately, or does the copied object contain a reference to state that gets messed up? I just spent a few minutes on this, and I got hung up on how to pull just one value from a python generator. It's probably easy, but I don't know how to do it. John -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4669 bytes Desc: not available URL: From jmj at fellowhuman.com Thu Jun 3 13:41:45 2010 From: jmj at fellowhuman.com (Jordan Johnson) Date: Thu, 3 Jun 2010 10:41:45 -0700 (PDT) Subject: [plt-scheme] Grafting a console onto universe, hackety hack. In-Reply-To: References: <50B9A046-AC0C-438D-9576-029A182D64A6@ccs.neu.edu> <1D7C9EA8-758D-47E7-A30C-B21384932B46@fellowhuman.com> Message-ID: On Thu, 3 Jun 2010, Matthias Felleisen wrote: > I am wondering whether you could write a console that is a participant of a 'universe' and use a local server to connect the text field and the displayed text. But that's also like set! so it's too imperative. > > ;; --- > > In my spare time, I will think about parameterizing big-bang over the text/window field that it displays. I know it's doable in principle because classes are first-class and it could be a neat test case for just that reason. For this case I could imagine something like: (big-bang/console world0 (on-input-line handle-string) ;; handle-string : str -> result ...) ;; called when the user enters a line where result = world | package | (make-output world str) | (make-output-package world str sexp) in which the string arg to the last two constructors is a line of output to be sent to the display, and all callbacks registered with big-bang/console return a result as defined above. What I don't like about that solution is the proliferation of return types. And of course it isn't general. But I'd expect that a form such as you're talking about would provide good opportunities for discussion of classes and interfaces with the students. If I think of anything else (and can articulate it in non-half-baked form), I'll let you know. Thanks for your comments & consideration. jmj From rafkind at cs.utah.edu Thu Jun 3 13:53:56 2010 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Thu, 03 Jun 2010 11:53:56 -0600 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: <96892BA4-ACB4-4734-9473-11850AAC8463@brinckerhoff.org> References: <19463.42552.339766.549059@winooski.ccs.neu.edu> <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> <187AADFC-4731-4DF9-BFE7-8696827C19E9@ccs.neu.edu> <19463.57671.93353.161053@winooski.ccs.neu.edu> <4C07E421.40402@cs.utah.edu> <96892BA4-ACB4-4734-9473-11850AAC8463@brinckerhoff.org> Message-ID: <4C07EC34.7010605@cs.utah.edu> On 06/03/2010 11:40 AM, John Clements wrote: > On Jun 3, 2010, at 10:19 AM, Jon Rafkind wrote: > > >> On 06/03/2010 11:07 AM, Eli Barzilay wrote: >> >>> On Jun 3, Matthias Felleisen wrote: >>> >>> >>>> On Jun 3, 2010, at 12:31 PM, John Clements wrote: >>>> >>>> >>>> >>>>>> Sorry, maybe this wasn't clear: I mean e.g. the python 'yield', >>>>>> which allows a function to return multiple values in a serialized >>>>>> form. >>>>>> >>>>>> >>>> If you can write a yield + create a two-element structure in Python >>>> that way, you can mimic delimited continuations. >>>> >>>> >>>> >>>> >>>>> The only problem with this mechanism is that the yield boundary is >>>>> fixed on entry to the function call. >>>>> >>>>> >>>> That's minor. Reset is next to the function entry point too. >>>> >>>> Go for it. Show us that Python has delimited continuations. >>>> >>>> >>> Here's some quick code: >>> >>> #lang scheme >>> (require scheme/generator) >>> (define (foo x y) (yield x) (yield (+ x y))) >>> (define (bar a b c) >>> (generator ; v5 will require () after `generator' >>> (for* ([x (in-generator (foo a b))] >>> [y (in-generator (foo x c))]) >>> (yield y)))) >>> (define g (bar 100 10 1)) >>> (g) (g) (g) (g) >>> >>> where `foo' is the moral equivalent of plus/minus. Given that this >>> uses exactly the feature that scheme/generator has that python doesn't >>> (it uses a dynamic `yield' so it can be used in "helper" functions), >>> it would be interesting to see if there's a way to do that in python. >>> >>> (I think that Jon looked for an example that shows the difference.) >>> >>> >>> >> This python program behaves the same, although it would break if one of the `yield's in (foo) were moved to a helper function, like >> >> (define (foo1 x) (yield x)) >> (define (foo x y) (yield x) (foo1 (+ x y))) >> >> # -- python -- >> def foo(x, y): >> yield x >> yield x + y >> >> def bar(a, b, c): >> for x in foo(a, b): >> for y in foo(x, c): >> yield y >> >> for n in bar(100, 10, 1): >> print n >> # -- end -- >> > > Right... the problem with this is that the body of bar gets horribly mangled, and the calls to foo have to be lifted out. This is basically the partial CPSing that would be required to implement this without generators. > > I'm wondering, though: if you "capture a continuation" by using a yield in Python, and make a copy of the resulting generator, can you enter the two resulting "continuations" separately, or does the copied object contain a reference to state that gets messed up? > Looks like you can't copy python generators (at least using the `copy' module). I get this error when I use either copy.copy or copy.deepcopy: TypeError: object.__new__(generator) is not safe, use generator.__new__() Anyway, python gives you delimited continuations but the reset is implicitly the start of the function where the yield is used. From clements at brinckerhoff.org Thu Jun 3 13:55:34 2010 From: clements at brinckerhoff.org (John Clements) Date: Thu, 3 Jun 2010 10:55:34 -0700 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: <96892BA4-ACB4-4734-9473-11850AAC8463@brinckerhoff.org> References: <19463.42552.339766.549059@winooski.ccs.neu.edu> <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> <187AADFC-4731-4DF9-BFE7-8696827C19E9@ccs.neu.edu> <19463.57671.93353.161053@winooski.ccs.neu.edu> <4C07E421.40402@cs.utah.edu> <96892BA4-ACB4-4734-9473-11850AAC8463@brinckerhoff.org> Message-ID: <53FF4B13-A86F-4127-82D2-6230D801704B@brinckerhoff.org> On Jun 3, 2010, at 10:40 AM, John Clements wrote: > > > Right... the problem with this is that the body of bar gets horribly mangled, and the calls to foo have to be lifted out. This is basically the partial CPSing that would be required to implement this without generators. > > I'm wondering, though: if you "capture a continuation" by using a yield in Python, and make a copy of the resulting generator, can you enter the two resulting "continuations" separately, or does the copied object contain a reference to state that gets messed up? > > I just spent a few minutes on this, and I got hung up on how to pull just one value from a python generator. It's probably easy, but I don't know how to do it. > So, Jon told me about the 'next' method. Unfortunately, it confirms that the "continuations" you get using 'yield' are one-shot. In retrospect, this seems entirely obvious. >>> def generator () : ... yield 1; ... yield 2; ... >>> newgenerator = generator() >>> copiedgenerator = newgenerator >>> newgenerator.next() 1 >>> copiedgenerator.next() 2 Perhaps there's some way to copy a generator's current state? Anyhow, I'm ready to concede that yield is definitely a different animal than delimited continuations. Thanks! John -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4669 bytes Desc: not available URL: From mflatt at cs.utah.edu Thu Jun 3 16:03:44 2010 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu, 3 Jun 2010 14:03:44 -0600 Subject: [plt-scheme] To Racket... In-Reply-To: References: <20100602145344.9092B650159@mail-svr1.cs.utah.edu> Message-ID: <20100603200345.8A0146500EA@mail-svr1.cs.utah.edu> Thanks! The problem is that Planet links are not in the area that DrRacket disables for automatic compilation, but they are also not compiled when loaded by the `planet' path resolver, because the `planet' path resolver resets the compiled-file subdirectory while loading a package. I'm not sure of the right way for DrRacket to handle Planet links, but I've changed the compilation manager to deal with the case that a compiled file is not available. At Thu, 03 Jun 2010 09:41:39 +0100, Paulo J. Matos wrote: > Matthew Flatt writes: > > > > > If removing "compiled" directories helps, that would be good to know. > > Otherwise, can you say more about the file organization and/or produce > > an example that I can try? > > > > I can know reproduce the problem. > I have a hard link: > ,---- > | $ cat .racket/planet/300/HARD-LINKS > | ("eboc.plt" ("pjmatos") 1 0 #"/localhome/pmatos/Code/eboc/." #f > development-link) > `---- > > Now the following structure inside ~/tmp: > ,---- > | pmatos at pm18pc01:~/tmp$ tree > | . > | |-- test > | | |-- search-sig.scm > | | `-- test1.scm > | `-- test.scm > | > | 1 directories, 3 files > `---- > > The files are all attached. > Open test.scm and press Run. I hope you can also reproduce the problem. > ------------------------------------------------------------------------------ > [application/octet-stream "test.scm"] [~/Desktop & open] [~/Temp & open] > > ------------------------------------------------------------------------------ > [application/octet-stream "search-sig.scm"] [~/Desktop & open] [~/Temp & open] > > ------------------------------------------------------------------------------ > [application/octet-stream "test1.scm"] [~/Desktop & open] [~/Temp & open] > > > > > -- > PMatos > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From pocmatos at gmail.com Thu Jun 3 17:43:54 2010 From: pocmatos at gmail.com (Paulo J. Matos) Date: Thu, 03 Jun 2010 22:43:54 +0100 Subject: [plt-scheme] To Racket... In-Reply-To: <20100603200345.8A0146500EA@mail-svr1.cs.utah.edu> (Matthew Flatt's message of "Thu, 3 Jun 2010 14:03:44 -0600") References: <20100602145344.9092B650159@mail-svr1.cs.utah.edu> <20100603200345.8A0146500EA@mail-svr1.cs.utah.edu> Message-ID: <84ocfrrdut.fsf@gmail.com> Matthew Flatt writes: > Thanks! > > I'm not sure of the right way for DrRacket to handle Planet links, but > I've changed the compilation manager to deal with the case that a > compiled file is not available. > Great Matthew, Thanks for letting me know what the problem was. At least there will be a workaround to the problem. I will update my racket version and see if it persists. Any further issue and I will let you know. Cheers, -- PMatos From dherman at ccs.neu.edu Thu Jun 3 18:25:24 2010 From: dherman at ccs.neu.edu (David Herman) Date: Thu, 3 Jun 2010 15:25:24 -0700 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: <53FF4B13-A86F-4127-82D2-6230D801704B@brinckerhoff.org> References: <19463.42552.339766.549059@winooski.ccs.neu.edu> <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> <187AADFC-4731-4DF9-BFE7-8696827C19E9@ccs.neu.edu> <19463.57671.93353.161053@winooski.ccs.neu.edu> <4C07E421.40402@cs.utah.edu> <96892BA4-ACB4-4734-9473-11850AAC8463@brinckerhoff.org> <53FF4B13-A86F-4127-82D2-6230D801704B@brinckerhoff.org> Message-ID: <95854740-184C-4CD3-9E4F-E15304303F95@ccs.neu.edu> > Unfortunately, it confirms that the "continuations" you get using 'yield' are one-shot. Yep. > Perhaps there's some way to copy a generator's current state? Doubt it. > Anyhow, I'm ready to concede that yield is definitely a different animal than delimited continuations. They're a different animal from the typical delimited continuation operators typically seen in the literature. But it seems clear to me that they are both first-class continuations and delimited. They're... implicitly delimited, first-class, one-shot continuations. Dave From robby at eecs.northwestern.edu Thu Jun 3 18:27:33 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu, 3 Jun 2010 17:27:33 -0500 Subject: [plt-scheme] [redex] language keywords In-Reply-To: <04C2D4F5-C7B8-4644-9E9C-5C5D3040C5E5@dcc.uchile.cl> References: <07D269DE-9F82-46DE-8B05-70DD78BF517A@dcc.uchile.cl> <9B1E31BD-7861-4E42-92CD-A3FBDD9BFF2A@dcc.uchile.cl> <28EF3E64-909D-4D0D-9F9F-D357B7B4C7D6@dcc.uchile.cl> <6E41E775-1FB5-4703-8B13-FE25FCBD615A@dcc.uchile.cl> <04C2D4F5-C7B8-4644-9E9C-5C5D3040C5E5@dcc.uchile.cl> Message-ID: On Thu, Jun 3, 2010 at 9:09 AM, Eric Tanter wrote: > Is this 'where' clause something that was introduced somewhat recently? > I remember from my first redex examples that the way to introduce a new identifier for instance was with ,(term-let ...). Somewhat. As we gain experience (and your experience has been quite helpful in this regard), Redex evolves to become better. I think you already agreed this was better, no? > The same question goes for the definition of metafunctions. For instance, the definition of lambda-v on the web: > http://redex.plt-scheme.org/lam-v.html > for the subst metafunction, uses ,(term-let ...) to introduce (x_new ...) > > It seems the preferred way to do that now would be with a where clause, right? Right. > (I was surprised actually when seeing in the doc that term-let was low-level and not meant to use, while it was--and still is in some cases-- used in the simple introductory examples of plt redex) > This was me not updating the website. Thank you for pointing it out. I looked into updating it, but I found a bug in redex, so I'll leave it alone until that gets fixed. Robby From matthias at ccs.neu.edu Thu Jun 3 18:33:09 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu, 3 Jun 2010 18:33:09 -0400 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: <95854740-184C-4CD3-9E4F-E15304303F95@ccs.neu.edu> References: <19463.42552.339766.549059@winooski.ccs.neu.edu> <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> <187AADFC-4731-4DF9-BFE7-8696827C19E9@ccs.neu.edu> <19463.57671.93353.161053@winooski.ccs.neu.edu> <4C07E421.40402@cs.utah.edu> <96892BA4-ACB4-4734-9473-11850AAC8463@brinckerhoff.org> <53FF4B13-A86F-4127-82D2-6230D801704B@brinckerhoff.org> <95854740-184C-4CD3-9E4F-E15304303F95@ccs.neu.edu> Message-ID: <426C6543-6451-4E5D-B0C0-571DFB8A8CB2@ccs.neu.edu> On Jun 3, 2010, at 6:25 PM, David Herman wrote: > They're... implicitly delimited, first-class, one-shot continuations. What's first-class about them? From robby at eecs.northwestern.edu Thu Jun 3 18:53:36 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu, 3 Jun 2010 17:53:36 -0500 Subject: [plt-scheme] [redex] language keywords In-Reply-To: References: <07D269DE-9F82-46DE-8B05-70DD78BF517A@dcc.uchile.cl> <9B1E31BD-7861-4E42-92CD-A3FBDD9BFF2A@dcc.uchile.cl> <28EF3E64-909D-4D0D-9F9F-D357B7B4C7D6@dcc.uchile.cl> <6E41E775-1FB5-4703-8B13-FE25FCBD615A@dcc.uchile.cl> <04C2D4F5-C7B8-4644-9E9C-5C5D3040C5E5@dcc.uchile.cl> Message-ID: Oh, duh. There was no bug; I just made a mistake. I've updated the web page and it will get sync'd up at some point in the next 6 or hours, I believe. Thanks for pointing out the problem. Robby On Thu, Jun 3, 2010 at 5:27 PM, Robby Findler wrote: > On Thu, Jun 3, 2010 at 9:09 AM, Eric Tanter wrote: >> Is this 'where' clause something that was introduced somewhat recently? >> I remember from my first redex examples that the way to introduce a new identifier for instance was with ,(term-let ...). > > Somewhat. As we gain experience (and your experience has been quite > helpful in this regard), Redex evolves to become better. I think you > already agreed this was better, no? > >> The same question goes for the definition of metafunctions. For instance, the definition of lambda-v on the web: >> http://redex.plt-scheme.org/lam-v.html >> for the subst metafunction, uses ,(term-let ...) to introduce (x_new ...) >> >> It seems the preferred way to do that now would be with a where clause, right? > > Right. > >> (I was surprised actually when seeing in the doc that term-let was low-level and not meant to use, while it was--and still is in some cases-- used in the simple introductory examples of plt redex) >> > > This was me not updating the website. Thank you for pointing it out. I > looked into updating it, but I found a bug in redex, so I'll leave it > alone until that gets fixed. > > Robby > From robby at eecs.northwestern.edu Thu Jun 3 19:00:39 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu, 3 Jun 2010 18:00:39 -0500 Subject: [plt-scheme] Another PLaneT Question In-Reply-To: References: Message-ID: Yes. You have to login and the follow the link to the package on the login page and you can edit the old versions' metadata from there. Robby On Wed, Jun 2, 2010 at 5:49 PM, Doug Williams wrote: > Is there any way to change the meta-data on a previous version? There is a > version 2.0 and 2.1 there now. I changed the meta-data for the 2.1 version > so that it required version 5.0 (although I probably should use 4.90, since > that is the candidate release), but I can't change it for the 2.0 version. > Unfortunately, if anyone running V4 requires the package (without specifying > an older version), it will load 2.0 - because there is no > required-core-version defined for it. That will fail because it uses #lang > racket. > > On Wed, Jun 2, 2010 at 3:46 PM, Robby Findler > wrote: >> >> On Wed, Jun 2, 2010 at 4:08 PM, Jacob Matthews >> wrote: >> > This message tickled a memory, and sure enough, it looks like >> > get-info/full in collects/setup/getinfo.ss (which planet uses to find >> > a package's info file) looks for a file literally named "info.ss". I'd >> > guess that's the issue. >> >> Ah. This is due to the planet server running an ancient version of >> plt. Well, the proper fix is more than I can really do right now (ie >> bringing planet up to running v5.0 of plt) so I have just hacked the >> code in the planet installation and I'll look into doing this fix >> properly when I return. >> >> Thanks, Jacob! >> >> BTW, this means that newly uploaded packages should work properly, but >> the Doug's package will have the wrong information since it just used >> various defaults (since the code incorrectly assumed that the info >> file didn't exist at all). You should be able to update the >> information about the planet package tho. >> >> Robby > > > _________________________________________________ > ?For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From dherman at ccs.neu.edu Thu Jun 3 19:01:53 2010 From: dherman at ccs.neu.edu (David Herman) Date: Thu, 3 Jun 2010 16:01:53 -0700 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: <426C6543-6451-4E5D-B0C0-571DFB8A8CB2@ccs.neu.edu> References: <19463.42552.339766.549059@winooski.ccs.neu.edu> <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> <187AADFC-4731-4DF9-BFE7-8696827C19E9@ccs.neu.edu> <19463.57671.93353.161053@winooski.ccs.neu.edu> <4C07E421.40402@cs.utah.edu> <96892BA4-ACB4-4734-9473-11850AAC8463@brinckerhoff.org> <53FF4B13-A86F-4127-82D2-6230D801704B@brinckerhoff.org> <95854740-184C-4CD3-9E4F-E15304303F95@ccs.neu.edu> <426C6543-6451-4E5D-B0C0-571DFB8A8CB2@ccs.neu.edu> Message-ID: They're values. Or do you not consider one-shot continuations first-class? (Genuine question, not facetious.) Dave On Jun 3, 2010, at 3:33 PM, Matthias Felleisen wrote: > > On Jun 3, 2010, at 6:25 PM, David Herman wrote: > >> They're... implicitly delimited, first-class, one-shot continuations. > > > What's first-class about them? From etanter at dcc.uchile.cl Thu Jun 3 19:23:10 2010 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Thu, 3 Jun 2010 19:23:10 -0400 Subject: [plt-scheme] [redex] language keywords In-Reply-To: References: <07D269DE-9F82-46DE-8B05-70DD78BF517A@dcc.uchile.cl> <9B1E31BD-7861-4E42-92CD-A3FBDD9BFF2A@dcc.uchile.cl> <28EF3E64-909D-4D0D-9F9F-D357B7B4C7D6@dcc.uchile.cl> <6E41E775-1FB5-4703-8B13-FE25FCBD615A@dcc.uchile.cl> <04C2D4F5-C7B8-4644-9E9C-5C5D3040C5E5@dcc.uchile.cl> Message-ID: <6FDFF80A-F6BF-476D-8ECA-F8E97DA82756@dcc.uchile.cl> Great! and yes, I *fully* agree, it is getting better and better, Thanks for all the great work! -- ?ric On Jun 3, 2010, at 6:53 PM, Robby Findler wrote: > Oh, duh. There was no bug; I just made a mistake. I've updated the web > page and it will get sync'd up at some point in the next 6 or hours, I > believe. Thanks for pointing out the problem. > > Robby > > On Thu, Jun 3, 2010 at 5:27 PM, Robby Findler > wrote: >> On Thu, Jun 3, 2010 at 9:09 AM, Eric Tanter wrote: >>> Is this 'where' clause something that was introduced somewhat recently? >>> I remember from my first redex examples that the way to introduce a new identifier for instance was with ,(term-let ...). >> >> Somewhat. As we gain experience (and your experience has been quite >> helpful in this regard), Redex evolves to become better. I think you >> already agreed this was better, no? >> >>> The same question goes for the definition of metafunctions. For instance, the definition of lambda-v on the web: >>> http://redex.plt-scheme.org/lam-v.html >>> for the subst metafunction, uses ,(term-let ...) to introduce (x_new ...) >>> >>> It seems the preferred way to do that now would be with a where clause, right? >> >> Right. >> >>> (I was surprised actually when seeing in the doc that term-let was low-level and not meant to use, while it was--and still is in some cases-- used in the simple introductory examples of plt redex) >>> >> >> This was me not updating the website. Thank you for pointing it out. I >> looked into updating it, but I found a bug in redex, so I'll leave it >> alone until that gets fixed. >> >> Robby >> From matthias at ccs.neu.edu Thu Jun 3 19:33:13 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu, 3 Jun 2010 19:33:13 -0400 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: References: <19463.42552.339766.549059@winooski.ccs.neu.edu> <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> <187AADFC-4731-4DF9-BFE7-8696827C19E9@ccs.neu.edu> <19463.57671.93353.161053@winooski.ccs.neu.edu> <4C07E421.40402@cs.utah.edu> <96892BA4-ACB4-4734-9473-11850AAC8463@brinckerhoff.org> <53FF4B13-A86F-4127-82D2-6230D801704B@brinckerhoff.org> <95854740-184C-4CD3-9E4F-E15304303F95@ccs.neu.edu> <426C6543-6451-4E5D-B0C0-571DFB8A8CB2@ccs.neu.edu> Message-ID: <64E9E6CB-BAE8-4299-8C3C-C7BE3BF5CBB9@ccs.neu.edu> Can you return them from the function that grabs them (in Python)? Can you resume the function once it has transfered control somewhere else? Can you store the continuations in some vector? (I don't know the answers, but these are some of the things one can do with 1st-class values.) -- Matthias On Jun 3, 2010, at 7:01 PM, David Herman wrote: > They're values. Or do you not consider one-shot continuations first-class? (Genuine question, not facetious.) > > Dave > > On Jun 3, 2010, at 3:33 PM, Matthias Felleisen wrote: > >> >> On Jun 3, 2010, at 6:25 PM, David Herman wrote: >> >>> They're... implicitly delimited, first-class, one-shot continuations. >> >> >> What's first-class about them? > From clements at brinckerhoff.org Thu Jun 3 19:47:59 2010 From: clements at brinckerhoff.org (John Clements) Date: Thu, 3 Jun 2010 16:47:59 -0700 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: <64E9E6CB-BAE8-4299-8C3C-C7BE3BF5CBB9@ccs.neu.edu> References: <19463.42552.339766.549059@winooski.ccs.neu.edu> <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> <187AADFC-4731-4DF9-BFE7-8696827C19E9@ccs.neu.edu> <19463.57671.93353.161053@winooski.ccs.neu.edu> <4C07E421.40402@cs.utah.edu> <96892BA4-ACB4-4734-9473-11850AAC8463@brinckerhoff.org> <53FF4B13-A86F-4127-82D2-6230D801704B@brinckerhoff.org> <95854740-184C-4CD3-9E4F-E15304303F95@ccs.neu.edu> <426C6543-6451-4E5D-B0C0-571DFB8A8CB2@ccs.neu.edu> <64E9E6CB-BAE8-4299-8C3C-C7BE3BF5CBB9@ccs.neu.edu> Message-ID: On Jun 3, 2010, at 4:33 PM, Matthias Felleisen wrote: > > Can you return them from the function that grabs them (in Python)? > Can you resume the function once it has transfered control somewhere else? > Can you store the continuations in some vector? > > (I don't know the answers, but these are some of the things one can do with 1st-class values.) Yes: def grabK () : yield 1 ; print "running..." ; yield 2 def grabAFewKonts () : return [grabK () , grabK ()] a = grabAFewKonts(); f = a[0]; g = a[1]; print(f.next()); print(f.next()); print(g.next()); ==> pcp062805pcs:~/.ssh clements$ python /tmp/foo.py 1 running... 2 1 -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4669 bytes Desc: not available URL: From hendrik at topoi.pooq.com Thu Jun 3 20:15:18 2010 From: hendrik at topoi.pooq.com (hendrik at topoi.pooq.com) Date: Thu, 3 Jun 2010 20:15:18 -0400 Subject: [plt-scheme] Typed scheme: Cannot apply expression of type Procedure, since it is not a function type In-Reply-To: References: <4468BC44-7DC5-4F55-8F46-4A148D3C5C01@gmx.de> Message-ID: <20100604001517.GG11727@topoi.pooq.com> On Wed, Jun 02, 2010 at 10:32:15PM +0200, keydana at gmx.de wrote: > > > > > Notice that our code will type check perfectly but every expression > > has type Any and these types are essentially useless. This gives you > > an idea of what static typing does and doesn't check. Basically types > > are statically checked, but cases (in the discriminated union sense) > > aren't. Cases are how you inject dynamic checks into statically typed > > languages. > > > Yes, I think I see what you mean... the discriminated union cases in a way threaten to "dissolve" the type system... > > In fact, it seems to me I'm approaching this from the opposite angle > somehow: Taking standard dynamic scheme as the default, I use typed > scheme primarily for "educational" purposes - I like being forced to > think about how, exactly, the fields of a record (for example) are > defined or what exactly a function has to accept/return. > But even more, I like using the discriminated unions (with the > define-datatype macro), they make me think about what "kinds of a > thing there are", and they offer an easy way of structuring the code > (I'll just have to handle every case and that's it). > Certainly this also depends on the domain - in my case currently, > discriminated unions seem like a very suitable way to implement > something "language-like" (the discriminated unions looking like some > semantic equivalent of BNF anyway). Discriminated unions are the category-theoretic dual of cartesian products. If you find one useful, chances are you need the other, too. > > On the other hand, they really get inconvenient when there's too much > pattern matching to do (speaking of pattern matching, their "natural > proneness" to be used with pattern matching - if I my say so - is > another reason I like them so much...) > > - All this just from the perspective of a "normal user" (well in the > end, I should perhaps also admit that using the algebraic datatypes in > typed scheme might be a way of coping with the sad fact that my spare > time doesn't seem sufficient to learn/practice both scheme and > haskell :-;) > You might be better off with CAML than Haskell, if you want to make smaller steps in that direction. CAML is not such a radical shift into lazy evaluation. Also, learn some elementary category theory (that found in the first chapter or two of *any* book on the subject will be enough to familiarize you with the ideas. The fundamental thing about data types is that they form the objects of a category, and the functions between them are the arrows. I believe the Yoneda of Yoneda's lemma is the Yoneda who also worked on the design of ALgol 68's tyope system. -- hendrik From matthias at ccs.neu.edu Thu Jun 3 22:22:41 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu, 3 Jun 2010 22:22:41 -0400 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: References: <19463.42552.339766.549059@winooski.ccs.neu.edu> <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> <187AADFC-4731-4DF9-BFE7-8696827C19E9@ccs.neu.edu> <19463.57671.93353.161053@winooski.ccs.neu.edu> <4C07E421.40402@cs.utah.edu> <96892BA4-ACB4-4734-9473-11850AAC8463@brinckerhoff.org> <53FF4B13-A86F-4127-82D2-6230D801704B@brinckerhoff.org> <95854740-184C-4CD3-9E4F-E15304303F95@ccs.neu.edu> <426C6543-6451-4E5D-B0C0-571DFB8A8CB2@ccs.neu.edu> <64E9E6CB-BAE8-4299-8C3C-C7BE3BF5CBB9@ccs.neu.edu> Message-ID: <84F5E3D8-28D2-44FB-983D-02D54BA33543@ccs.neu.edu> On Jun 3, 2010, at 7:47 PM, John Clements wrote: > > On Jun 3, 2010, at 4:33 PM, Matthias Felleisen wrote: > >> >> Can you return them from the function that grabs them (in Python)? >> Can you resume the function once it has transfered control somewhere else? >> Can you store the continuations in some vector? >> >> (I don't know the answers, but these are some of the things one can do with 1st-class values.) > > Yes: > > def grabK () : yield 1 ; print "running..." ; yield 2 > > def grabAFewKonts () : > return [grabK () , grabK ()] > > a = grabAFewKonts(); > > f = a[0]; > g = a[1]; > > print(f.next()); > print(f.next()); > print(g.next()); Interesting perception. What you are storing are not the continuations but the suspended generators. (Think of grabK() as the creation of a generator.) You could do that in Simula 67, and what you need for that is a pair of control stacks, not a continuation tree. So here is the next question then: Can you invoke them a __second__ time and get an error message about a second use? If you can't, they aren't real one-shot continuations. To be precise, you have no observation to prove that they are continuations. In the days of denotational semantics, you might have said that you can denote them but not express them (or backwards, Mitch would know). -- Matthias From samth at ccs.neu.edu Thu Jun 3 23:00:43 2010 From: samth at ccs.neu.edu (Sam Tobin-Hochstadt) Date: Thu, 3 Jun 2010 23:00:43 -0400 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: <84F5E3D8-28D2-44FB-983D-02D54BA33543@ccs.neu.edu> References: <19463.42552.339766.549059@winooski.ccs.neu.edu> <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> <187AADFC-4731-4DF9-BFE7-8696827C19E9@ccs.neu.edu> <19463.57671.93353.161053@winooski.ccs.neu.edu> <4C07E421.40402@cs.utah.edu> <96892BA4-ACB4-4734-9473-11850AAC8463@brinckerhoff.org> <53FF4B13-A86F-4127-82D2-6230D801704B@brinckerhoff.org> <95854740-184C-4CD3-9E4F-E15304303F95@ccs.neu.edu> <426C6543-6451-4E5D-B0C0-571DFB8A8CB2@ccs.neu.edu> <64E9E6CB-BAE8-4299-8C3C-C7BE3BF5CBB9@ccs.neu.edu> <84F5E3D8-28D2-44FB-983D-02D54BA33543@ccs.neu.edu> Message-ID: On Thu, Jun 3, 2010 at 10:22 PM, Matthias Felleisen wrote: > You could do that in Simula 67, and what you need for that is a pair of control stacks, not a continuation tree. There's a paper in TFP 2010 by Konrad Anton and Peter Thiemann that discusses these under the rubric of coroutines, with history going back to Simula. -- sam th samth at ccs.neu.edu From georgeolivergo at gmail.com Thu Jun 3 01:17:21 2010 From: georgeolivergo at gmail.com (George Oliver) Date: Wed, 02 Jun 2010 22:17:21 -0700 Subject: [plt-scheme] MUD servers? Message-ID: <4C073AE1.7080903@gmail.com> hi, While there are a few threads on the list that mention MUDs, and several PLT-Scheme muds referenced in Google results, it seems like most of the links to code or running games are long dead. Does anyone have current links to PLT-Scheme MUD info? As a long-time MUDder and beginning Schemer I think this would be a fun project to tackle. thanks, George From plt at synx.us.to Fri Jun 4 02:24:21 2010 From: plt at synx.us.to (Synx) Date: Thu, 03 Jun 2010 23:24:21 -0700 Subject: [plt-scheme] MUD servers? In-Reply-To: <4C073AE1.7080903@gmail.com> References: <4C073AE1.7080903@gmail.com> Message-ID: <4C089C15.2040102@synx.us.to> On 06/02/2010 10:17 PM, George Oliver wrote: > hi, > > While there are a few threads on the list that mention MUDs, and several > PLT-Scheme muds referenced in Google results, it seems like most of the > links to code or running games are long dead. Does anyone have current > links to PLT-Scheme MUD info? > > As a long-time MUDder and beginning Schemer I think this would be a fun > project to tackle. I thought it would be fun to tackle too. Then I realized how PLT does such wonderful optimization by not allowing you to remove modules explicitly, but that doesn't cater well to a situation where you are going in and out of different rooms and player contexts and such. Then I learned just how convoluted making custom languages is using PLT, which until last week or so had no tutorial how to do so at all. And finally I ran into the problems facing sandboxes, how to get them to a state where you can actually pass s-expressions to them and not have them error out claiming they're trying to hax your boxes. It turned out to be a lot more complicated than I imagined at first... probably mostly my fault since I seem to overcomplicate everything. I kind of concluded in the end that getting something working isn't worth the effort and I'd just use LambdaMOO instead (which ironically does not support any form of LISP at all). Then I just got tired of trying to make a convincing text game at all. Then I combed my hair over one eye and started wearing black clothing with striped sleeves everywhere. In short, I'm still working on it. Slowly. Got other priorities though. You're free to look at what I got: https://synx.us.to/code/mu/ The database thing is the trickiest part that actually works. I'm not sure I could get good performance using a relational SQL database though, and it'd be better to represent the data as it actually is instead of trying to strongarm it into some kind of human readable query language like sqlite wants me to. Oh also, http://pre.plt-scheme.org/docs/html/guide/languages.html From icfp.publicity at googlemail.com Fri Jun 4 02:37:08 2010 From: icfp.publicity at googlemail.com (Wouter Swierstra) Date: Fri, 4 Jun 2010 08:37:08 +0200 Subject: [plt-scheme] ICFP Programming Contest Message-ID: This year's ICFP Programming Contest will begin on June 18th (12:00 Noon GMT) and will run till June 21st (12:00 Noon GMT). As in the previous editions, this is your chance to show that your favorite programming language is better than all others! The problem statement and further information will become available at: http://icfpcontest.org/2010/ Feel free to contact ifcpcont at imn dot htwk-leipzig dot de for further questions. Good luck! Wouter From stepnem at gmail.com Fri Jun 4 08:40:27 2010 From: stepnem at gmail.com (=?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?=) Date: Fri, 04 Jun 2010 14:40:27 +0200 Subject: [plt-scheme] DrScheme macro stepper ignoring color settings? Message-ID: <87k4qfdl8k.fsf@gmail.com> Hello, although I've set dark background and it works in DrScheme's interaction and definition windows, the macro stepper seems to ignore the settings (i.e. it's still black text on white background); is this a known issue (or even the intended behaviour)? I don't see any macro-stepper-specific settings... I'm using the PLT 4.2.5 Debian installer downloaded from the website. Best regards, ?t?p?n From etanter at dcc.uchile.cl Fri Jun 4 10:11:56 2010 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Fri, 4 Jun 2010 10:11:56 -0400 Subject: [plt-scheme] drscheme vertical split? Message-ID: <9E2BCCD1-C515-41D8-8287-BFD385E3DFA8@dcc.uchile.cl> Hi, Sorry for such a mundane question, but I can't find a way to split the window vertically in DrScheme (4.2.5). Is it possible? (the split option in the view menu seems to be horizontal only) With wide screens (quite standard these days), splitting vertically is quite useful. An alternative is to just open two windows, but then I can't seem to have two windows open on the same file. Even if I explicitly drag the file I'm already seeing in window1 into window2, I just get a refresh of window1, and nothing in window2. Any idea? Thanks! -- ?ric From etanter at dcc.uchile.cl Fri Jun 4 10:17:19 2010 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Fri, 4 Jun 2010 10:17:19 -0400 Subject: [plt-scheme] drscheme vertical split? In-Reply-To: <9E2BCCD1-C515-41D8-8287-BFD385E3DFA8@dcc.uchile.cl> References: <9E2BCCD1-C515-41D8-8287-BFD385E3DFA8@dcc.uchile.cl> Message-ID: <6375449A-A509-4848-AFCE-1E5B6C50307F@dcc.uchile.cl> Oups, I've just found a way to get exactly what I was looking for. The "solution" is to go to the prefs and select the General > "Put the interactions window beside the definitions window". In that mode, the split command in the view menu splits the buffer vertically! (I guess then the noise might still be helpful to suggest that this should be more easily accessible, and why not also more flexible, ie. like in emacs where I can first split vertically to put the interaction window on the right, then split the code buffer on the left horizontally, etc...) -- ?ric On Jun 4, 2010, at 10:11 AM, Eric Tanter wrote: > Hi, > > Sorry for such a mundane question, but I can't find a way to split the window vertically in DrScheme (4.2.5). > Is it possible? (the split option in the view menu seems to be horizontal only) > > With wide screens (quite standard these days), splitting vertically is quite useful. > > An alternative is to just open two windows, but then I can't seem to have two windows open on the same file. Even if I explicitly drag the file I'm already seeing in window1 into window2, I just get a refresh of window1, and nothing in window2. > > Any idea? > > Thanks! > > -- ?ric > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From etanter at dcc.uchile.cl Fri Jun 4 10:24:12 2010 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Fri, 4 Jun 2010 10:24:12 -0400 Subject: [plt-scheme] scrolling windows Message-ID: <81E24F07-744A-4596-A51C-4E7AD4A87E61@dcc.uchile.cl> Hi again, Another usability report/request: in MacOS, the scrolling action (ie. with the mouse) affects the window/pane directly below the mouse (independently of which application is actually 'active'). DrScheme does not follow this metaphor: - if DrScheme is not the active app, then scrolling with mouse cursor over a DrScheme window does not have any effect - if DrScheme is the active app, but there are multiple panes (defs window, interaction window, splits) the pane that is scrolled is the one that was last clicked in, not the one that is below the cursor. Thanks, -- ?ric From justin at zamora.com Fri Jun 4 10:52:58 2010 From: justin at zamora.com (Justin Zamora) Date: Fri, 4 Jun 2010 10:52:58 -0400 Subject: [plt-scheme] Teaching languages and 2htdp/image Message-ID: I would like to use 2htdp/universe and 2htdp/image with the HTDP teaching languages, but I get conflicts because image? is defined differently in 2htdp/image and the teaching languages. For example: #lang racket (require lang/htdp-beginner) (require 2htdp/universe) (require 2htdp/image) results in the error: simple-world.rkt:5:9: module: identifier already imported from a different source in: image? 2htdp/image lang/htdp-beginner I can avoid this by using (require (rename-in lang/htdp-beginner (image? htdp/image))), but that seems inappropriate "magic" to use with beginning students. Is there a better way to achieve this? Justin From jos.koot at telefonica.net Fri Jun 4 11:22:33 2010 From: jos.koot at telefonica.net (Jos Koot) Date: Fri, 4 Jun 2010 17:22:33 +0200 Subject: [plt-scheme] RE: [plt-bug] all/10959: namespace-variable-value cannot find 'apply' in base-namespace In-Reply-To: <20100604122727.471866500EA@mail-svr1.cs.utah.edu> References: <201006040924.o549O2xf005075@champlain.ccs.neu.edu> <20100604122727.471866500EA@mail-svr1.cs.utah.edu> Message-ID: <84FD0771B4C4484D934CE1CC5B85F246@JacobPC> Is there some kind of a short README that lists the main differences between the former #lang scheme and the current #lang racket (5.0.0.1)? (: which runs like a rocket! :) I browsed a while but did not encounter what I am looking for. Matthew, thanks again for your quick and clear reply. Jos > -----Original Message----- > From: Matthew Flatt [mailto:mflatt at cs.utah.edu] > Sent: 04 June 2010 14:27 > To: jos.koot at telefonica.net; bugs at racket-lang.org > Cc: nobody at racket-lang.org; bug-notification at racket-lang.org > Subject: Re: [plt-bug] all/10959: namespace-variable-value cannot find > 'apply' in base-namespace > > At Fri, 4 Jun 2010 05:24:02 -0400, jos.koot at telefonica.net wrote: > > Procedure namespace-variable-value cannot find symbol 'apply' in a > > base-namespace. > > However, symbol apply does appear in (namespace-mapped-symbols). > > See steps to reproduce. > > `apply' is now bound as syntax, which allows an application of `apply' > without keywords to expand to a more primitive `apply' function, which > the bytecode compiler can sometimes optimize further. From mflatt at cs.utah.edu Fri Jun 4 11:23:10 2010 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Fri, 4 Jun 2010 09:23:10 -0600 Subject: [plt-scheme] scrolling windows In-Reply-To: <81E24F07-744A-4596-A51C-4E7AD4A87E61@dcc.uchile.cl> References: <81E24F07-744A-4596-A51C-4E7AD4A87E61@dcc.uchile.cl> Message-ID: <20100604152311.78F5D65009E@mail-svr1.cs.utah.edu> We are in the process of re-implementing the GUI toolbox (using Cocoa in the case of Mac OS X), and this problem will be fixed in that re-implementation. At Fri, 4 Jun 2010 10:24:12 -0400, Eric Tanter wrote: > Hi again, > > Another usability report/request: in MacOS, the scrolling action (ie. with the > mouse) affects the window/pane directly below the mouse (independently of > which application is actually 'active'). > > DrScheme does not follow this metaphor: > - if DrScheme is not the active app, then scrolling with mouse cursor over a > DrScheme window does not have any effect > - if DrScheme is the active app, but there are multiple panes (defs window, > interaction window, splits) the pane that is scrolled is the one that was last > clicked in, not the one that is below the cursor. > > Thanks, > > -- ?ric > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From mflatt at cs.utah.edu Fri Jun 4 11:29:07 2010 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Fri, 4 Jun 2010 09:29:07 -0600 Subject: [plt-scheme] RE: [plt-bug] all/10959: namespace-variable-value cannot find 'apply' in base-namespace In-Reply-To: <84FD0771B4C4484D934CE1CC5B85F246@JacobPC> References: <201006040924.o549O2xf005075@champlain.ccs.neu.edu> <20100604122727.471866500EA@mail-svr1.cs.utah.edu> <84FD0771B4C4484D934CE1CC5B85F246@JacobPC> Message-ID: <20100604152907.6956B6500FE@mail-svr1.cs.utah.edu> There's the usual notes: Follow the "Release Notes" link from the main doc page and then the "Porting from v4.x to v5.x" link. This particular change isn't in v5.0, but I will add it to the notes for v5.0.0.1. Even more significantly, I see that the ".ss" <-> ".rkt" correspondence isn't mentioned anywhere, and it should be. At Fri, 4 Jun 2010 17:22:33 +0200, "Jos Koot" wrote: > Is there some kind of a short README that lists the main differences between > the former #lang scheme and the current #lang racket (5.0.0.1)? (: which > runs like a rocket! :) I browsed a while but did not encounter what I am > looking for. > Matthew, thanks again for your quick and clear reply. > Jos > > > -----Original Message----- > > From: Matthew Flatt [mailto:mflatt at cs.utah.edu] > > Sent: 04 June 2010 14:27 > > To: jos.koot at telefonica.net; bugs at racket-lang.org > > Cc: nobody at racket-lang.org; bug-notification at racket-lang.org > > Subject: Re: [plt-bug] all/10959: namespace-variable-value cannot find > > 'apply' in base-namespace > > > > At Fri, 4 Jun 2010 05:24:02 -0400, jos.koot at telefonica.net wrote: > > > Procedure namespace-variable-value cannot find symbol 'apply' in a > > > base-namespace. > > > However, symbol apply does appear in (namespace-mapped-symbols). > > > See steps to reproduce. > > > > `apply' is now bound as syntax, which allows an application of `apply' > > without keywords to expand to a more primitive `apply' function, which > > the bytecode compiler can sometimes optimize further. From matthias at ccs.neu.edu Fri Jun 4 11:31:47 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Fri, 4 Jun 2010 11:31:47 -0400 Subject: [plt-scheme] Teaching languages and 2htdp/image In-Reply-To: References: Message-ID: <04D41588-A339-4D5E-9F5D-805DA7CA3A91@ccs.neu.edu> On Jun 4, 2010, at 10:52 AM, Justin Zamora wrote: > I would like to use 2htdp/universe and 2htdp/image with the HTDP > teaching languages, but I get conflicts because image? is defined > differently in 2htdp/image and the teaching languages. For example: > > #lang racket > > (require lang/htdp-beginner) > (require 2htdp/universe) > (require 2htdp/image) > > results in the error: > > simple-world.rkt:5:9: module: identifier already imported from a > different source in: > image? > 2htdp/image > lang/htdp-beginner > > I can avoid this by using (require (rename-in lang/htdp-beginner > (image? htdp/image))), but that seems inappropriate "magic" to use > with beginning students. Is there a better way to achieve this? Is there a reason why you are not using the teaching languages? They were designed to teach students w/o getting into complicated matters like these. -- Matthias From etanter at dcc.uchile.cl Fri Jun 4 11:35:12 2010 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Fri, 4 Jun 2010 11:35:12 -0400 Subject: [plt-scheme] scrolling windows In-Reply-To: <20100604152311.78F5D65009E@mail-svr1.cs.utah.edu> References: <81E24F07-744A-4596-A51C-4E7AD4A87E61@dcc.uchile.cl> <20100604152311.78F5D65009E@mail-svr1.cs.utah.edu> Message-ID: <4BB1536D-963F-4688-9024-B2C55EA9CA8B@dcc.uchile.cl> Cool, thanks! -- ?ric On Jun 4, 2010, at 11:23 AM, Matthew Flatt wrote: > We are in the process of re-implementing the GUI toolbox (using Cocoa > in the case of Mac OS X), and this problem will be fixed in that > re-implementation. > > At Fri, 4 Jun 2010 10:24:12 -0400, Eric Tanter wrote: >> Hi again, >> >> Another usability report/request: in MacOS, the scrolling action (ie. with the >> mouse) affects the window/pane directly below the mouse (independently of >> which application is actually 'active'). >> >> DrScheme does not follow this metaphor: >> - if DrScheme is not the active app, then scrolling with mouse cursor over a >> DrScheme window does not have any effect >> - if DrScheme is the active app, but there are multiple panes (defs window, >> interaction window, splits) the pane that is scrolled is the one that was last >> clicked in, not the one that is below the cursor. >> >> Thanks, >> >> -- ?ric >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme From jos.koot at telefonica.net Fri Jun 4 11:37:16 2010 From: jos.koot at telefonica.net (Jos Koot) Date: Fri, 4 Jun 2010 17:37:16 +0200 Subject: [plt-scheme] RE: [plt-bug] all/10959: namespace-variable-value cannot find 'apply' in base-namespace In-Reply-To: <20100604152907.6956B6500FE@mail-svr1.cs.utah.edu> References: <201006040924.o549O2xf005075@champlain.ccs.neu.edu> <20100604122727.471866500EA@mail-svr1.cs.utah.edu> <84FD0771B4C4484D934CE1CC5B85F246@JacobPC> <20100604152907.6956B6500FE@mail-svr1.cs.utah.edu> Message-ID: <91AAC9E7D2594E0DAA09F7DB28833011@JacobPC> Found it, Thanks, Jos > -----Original Message----- > From: Matthew Flatt [mailto:mflatt at cs.utah.edu] > Sent: 04 June 2010 17:29 > To: Jos Koot > Cc: plt-scheme at list.cs.brown.edu > Subject: RE: [plt-bug] all/10959: namespace-variable-value cannot find > 'apply' in base-namespace > > There's the usual notes: Follow the "Release Notes" link from the main > doc page and then the "Porting from v4.x to v5.x" link. > > This particular change isn't in v5.0, but I will add it to the notes > for v5.0.0.1. Even more significantly, I see that the ".ss" <-> ".rkt" > correspondence isn't mentioned anywhere, and it should be. > > At Fri, 4 Jun 2010 17:22:33 +0200, "Jos Koot" wrote: > > Is there some kind of a short README that lists the main differences > between > > the former #lang scheme and the current #lang racket (5.0.0.1)? (: which > > runs like a rocket! :) I browsed a while but did not encounter what I am > > looking for. > > Matthew, thanks again for your quick and clear reply. > > Jos > > > > > -----Original Message----- > > > From: Matthew Flatt [mailto:mflatt at cs.utah.edu] > > > Sent: 04 June 2010 14:27 > > > To: jos.koot at telefonica.net; bugs at racket-lang.org > > > Cc: nobody at racket-lang.org; bug-notification at racket-lang.org > > > Subject: Re: [plt-bug] all/10959: namespace-variable-value cannot find > > > 'apply' in base-namespace > > > > > > At Fri, 4 Jun 2010 05:24:02 -0400, jos.koot at telefonica.net wrote: > > > > Procedure namespace-variable-value cannot find symbol 'apply' in a > > > > base-namespace. > > > > However, symbol apply does appear in (namespace-mapped-symbols). > > > > See steps to reproduce. > > > > > > `apply' is now bound as syntax, which allows an application of `apply' > > > without keywords to expand to a more primitive `apply' function, which > > > the bytecode compiler can sometimes optimize further. From jos.koot at telefonica.net Fri Jun 4 11:58:13 2010 From: jos.koot at telefonica.net (Jos Koot) Date: Fri, 4 Jun 2010 17:58:13 +0200 Subject: [plt-scheme] apply syntactically bound (was RE: [plt-bug] all/10959: namespace-variable-valuecannot find 'apply' in base-namespace) In-Reply-To: <91AAC9E7D2594E0DAA09F7DB28833011@JacobPC> References: <201006040924.o549O2xf005075@champlain.ccs.neu.edu><20100604122727.471866500EA@mail-svr1.cs.utah.edu> <84FD0771B4C4484D934CE1CC5B85F246@JacobPC><20100604152907.6956B6500FE@mail-svr1.cs.utah.edu> <91AAC9E7D2594E0DAA09F7DB28833011@JacobPC> Message-ID: <2E3C338C1C354D469314108E40C15F6D@JacobPC> Strange: #lang racket ; version 5.0.0.1 (define x '(1 2 3)) (apply apply list (list x)) ; -> (1 2 3) where apply seems to accept the syntactically bound keyword apply, although the docs say that apply should have the value of a procedure. This confuses me. Thanks, Jos -------------- next part -------------- An HTML attachment was scrubbed... URL: From cce at ccs.neu.edu Fri Jun 4 12:14:21 2010 From: cce at ccs.neu.edu (Carl Eastlund) Date: Fri, 4 Jun 2010 12:14:21 -0400 Subject: [plt-scheme] apply syntactically bound (was RE: [plt-bug] all/10959: namespace-variable-valuecannot find 'apply' in base-namespace) In-Reply-To: <2E3C338C1C354D469314108E40C15F6D@JacobPC> References: <201006040924.o549O2xf005075@champlain.ccs.neu.edu> <20100604122727.471866500EA@mail-svr1.cs.utah.edu> <84FD0771B4C4484D934CE1CC5B85F246@JacobPC> <20100604152907.6956B6500FE@mail-svr1.cs.utah.edu> <91AAC9E7D2594E0DAA09F7DB28833011@JacobPC> <2E3C338C1C354D469314108E40C15F6D@JacobPC> Message-ID: On Fri, Jun 4, 2010 at 11:58 AM, Jos Koot wrote: > Strange: > > > > #lang racket ; version 5.0.0.1 > > (define x '(1 2 3)) > > (apply apply list (list x)) ; -> (1 2 3) > > > > where apply seems to accept the syntactically bound keyword apply, although > the docs say that apply should have the value of a procedure. This confuses > me. > > Thanks, Jos Jos, apply is a procedure, not a macro, so there is no problem with passing it to itself. --Carl From jos.koot at telefonica.net Fri Jun 4 12:24:10 2010 From: jos.koot at telefonica.net (Jos Koot) Date: Fri, 4 Jun 2010 18:24:10 +0200 Subject: [plt-scheme] apply syntactically bound (was RE: [plt-bug] all/10959: namespace-variable-valuecannot find 'apply' in base-namespace) In-Reply-To: References: <201006040924.o549O2xf005075@champlain.ccs.neu.edu> <20100604122727.471866500EA@mail-svr1.cs.utah.edu> <84FD0771B4C4484D934CE1CC5B85F246@JacobPC> <20100604152907.6956B6500FE@mail-svr1.cs.utah.edu> <91AAC9E7D2594E0DAA09F7DB28833011@JacobPC> <2E3C338C1C354D469314108E40C15F6D@JacobPC> Message-ID: I just learned that in #lang racket version 5.0.0.1 symbol 'apply' is syntactically bound. In an uncorrupted base-namespace it has no variable binding. See http://bugs.racket-lang.org/query/?cmd=view&pr=10959 Jos > -----Original Message----- > From: carl.eastlund at gmail.com [mailto:carl.eastlund at gmail.com] On Behalf > Of Carl Eastlund > Sent: 04 June 2010 18:14 > To: Jos Koot > Cc: Matthew Flatt; plt-scheme at list.cs.brown.edu > Subject: Re: [plt-scheme] apply syntactically bound (was RE: [plt-bug] > all/10959: namespace-variable-valuecannot find 'apply' in base-namespace) > > On Fri, Jun 4, 2010 at 11:58 AM, Jos Koot wrote: > > Strange: > > > > > > > > #lang racket ; version 5.0.0.1 > > > > (define x '(1 2 3)) > > > > (apply apply list (list x)) ; -> (1 2 3) > > > > > > > > where apply seems to accept the syntactically bound keyword apply, > although > > the docs say that apply should have the value of a procedure. This > confuses > > me. > > > > Thanks, Jos > > Jos, apply is a procedure, not a macro, so there is no problem with > passing it to itself. > > --Carl From cce at ccs.neu.edu Fri Jun 4 12:27:38 2010 From: cce at ccs.neu.edu (Carl Eastlund) Date: Fri, 4 Jun 2010 12:27:38 -0400 Subject: [plt-scheme] apply syntactically bound (was RE: [plt-bug] all/10959: namespace-variable-valuecannot find 'apply' in base-namespace) In-Reply-To: References: <201006040924.o549O2xf005075@champlain.ccs.neu.edu> <20100604122727.471866500EA@mail-svr1.cs.utah.edu> <84FD0771B4C4484D934CE1CC5B85F246@JacobPC> <20100604152907.6956B6500FE@mail-svr1.cs.utah.edu> <91AAC9E7D2594E0DAA09F7DB28833011@JacobPC> <2E3C338C1C354D469314108E40C15F6D@JacobPC> Message-ID: Okay, it might be a macro, but it can still be an identifier macro that always expands into a value, even when not used in application position. That is, for instance, how every contracted module export works. Carl Eastlund On Fri, Jun 4, 2010 at 12:24 PM, Jos Koot wrote: > I just learned that in #lang racket version 5.0.0.1 symbol 'apply' is > syntactically bound. In an uncorrupted base-namespace it has no variable > binding. > See http://bugs.racket-lang.org/query/?cmd=view&pr=10959 > Jos > >> -----Original Message----- >> From: carl.eastlund at gmail.com [mailto:carl.eastlund at gmail.com] On Behalf >> Of Carl Eastlund >> Sent: 04 June 2010 18:14 >> To: Jos Koot >> Cc: Matthew Flatt; plt-scheme at list.cs.brown.edu >> Subject: Re: [plt-scheme] apply syntactically bound (was RE: [plt-bug] >> all/10959: namespace-variable-valuecannot find 'apply' in base-namespace) >> >> On Fri, Jun 4, 2010 at 11:58 AM, Jos Koot wrote: >> > Strange: >> > >> > >> > >> > #lang racket ; version 5.0.0.1 >> > >> > (define x '(1 2 3)) >> > >> > (apply apply list (list x)) ; -> (1 2 3) >> > >> > >> > >> > where apply seems to accept the syntactically bound keyword apply, >> although >> > the docs say that apply should have the value of a procedure. This >> confuses >> > me. >> > >> > Thanks, Jos >> >> Jos, apply is a procedure, not a macro, so there is no problem with >> passing it to itself. >> >> --Carl From jos.koot at telefonica.net Fri Jun 4 12:36:28 2010 From: jos.koot at telefonica.net (Jos Koot) Date: Fri, 4 Jun 2010 18:36:28 +0200 Subject: [plt-scheme] apply syntactically bound (was RE: [plt-bug] all/10959: namespace-variable-valuecannot find 'apply' in base-namespace) In-Reply-To: References: <201006040924.o549O2xf005075@champlain.ccs.neu.edu> <20100604122727.471866500EA@mail-svr1.cs.utah.edu> <84FD0771B4C4484D934CE1CC5B85F246@JacobPC> <20100604152907.6956B6500FE@mail-svr1.cs.utah.edu> <91AAC9E7D2594E0DAA09F7DB28833011@JacobPC> <2E3C338C1C354D469314108E40C15F6D@JacobPC> Message-ID: <5AC6DD5359024BB2A9F3FBE0EC383BB3@JacobPC> That may very well be the case. 'apply' in the operator position of an expression like (apply bla bla bla ...) being expanded as by a transformer and in other positions being expanded to something that evaluates to a procedure. If this is the case, I think this should be added to the docs. Thanks, Jos > -----Original Message----- > From: carl.eastlund at gmail.com [mailto:carl.eastlund at gmail.com] On Behalf > Of Carl Eastlund > Sent: 04 June 2010 18:28 > To: Jos Koot > Cc: Matthew Flatt; plt-scheme at list.cs.brown.edu > Subject: Re: [plt-scheme] apply syntactically bound (was RE: [plt-bug] > all/10959: namespace-variable-valuecannot find 'apply' in base-namespace) > > Okay, it might be a macro, but it can still be an identifier macro > that always expands into a value, even when not used in application > position. That is, for instance, how every contracted module export > works. > > Carl Eastlund > > On Fri, Jun 4, 2010 at 12:24 PM, Jos Koot wrote: > > I just learned that in #lang racket version 5.0.0.1 symbol 'apply' is > > syntactically bound. In an uncorrupted base-namespace it has no variable > > binding. > > See http://bugs.racket-lang.org/query/?cmd=view&pr=10959 > > Jos > > > >> -----Original Message----- > >> From: carl.eastlund at gmail.com [mailto:carl.eastlund at gmail.com] On > Behalf > >> Of Carl Eastlund > >> Sent: 04 June 2010 18:14 > >> To: Jos Koot > >> Cc: Matthew Flatt; plt-scheme at list.cs.brown.edu > >> Subject: Re: [plt-scheme] apply syntactically bound (was RE: [plt-bug] > >> all/10959: namespace-variable-valuecannot find 'apply' in base- > namespace) > >> > >> On Fri, Jun 4, 2010 at 11:58 AM, Jos Koot > wrote: > >> > Strange: > >> > > >> > > >> > > >> > #lang racket ; version 5.0.0.1 > >> > > >> > (define x '(1 2 3)) > >> > > >> > (apply apply list (list x)) ; -> (1 2 3) > >> > > >> > > >> > > >> > where apply seems to accept the syntactically bound keyword apply, > >> although > >> > the docs say that apply should have the value of a procedure. This > >> confuses > >> > me. > >> > > >> > Thanks, Jos > >> > >> Jos, apply is a procedure, not a macro, so there is no problem with > >> passing it to itself. > >> > >> --Carl From samth at ccs.neu.edu Fri Jun 4 12:49:00 2010 From: samth at ccs.neu.edu (Sam Tobin-Hochstadt) Date: Fri, 4 Jun 2010 12:49:00 -0400 Subject: [plt-scheme] apply syntactically bound (was RE: [plt-bug] all/10959: namespace-variable-valuecannot find 'apply' in base-namespace) In-Reply-To: <5AC6DD5359024BB2A9F3FBE0EC383BB3@JacobPC> References: <201006040924.o549O2xf005075@champlain.ccs.neu.edu> <20100604122727.471866500EA@mail-svr1.cs.utah.edu> <84FD0771B4C4484D934CE1CC5B85F246@JacobPC> <20100604152907.6956B6500FE@mail-svr1.cs.utah.edu> <91AAC9E7D2594E0DAA09F7DB28833011@JacobPC> <2E3C338C1C354D469314108E40C15F6D@JacobPC> <5AC6DD5359024BB2A9F3FBE0EC383BB3@JacobPC> Message-ID: On Fri, Jun 4, 2010 at 12:36 PM, Jos Koot wrote: > That may very well be the case. 'apply' in the operator position of an > expression like (apply bla bla bla ...) being expanded as by a transformer > and in other positions being expanded to something that evaluates to a > procedure. If this is the case, I think this should be added to the docs. In general, the docs avoid committing to whether something is a procedure or merely something implemented with a macro that behaves like a procedure. This is because lots of identifiers may or may not be macros, depending on the precise implementation, but this distinction is mostly irrelevant, and we want the flexibility to change the implementation. In this specific case, (procedure? apply) still produces #t, and thus in almost all cases it can be thought of as a procedure. -- sam th samth at ccs.neu.edu From clements at brinckerhoff.org Fri Jun 4 13:07:39 2010 From: clements at brinckerhoff.org (John Clements) Date: Fri, 4 Jun 2010 10:07:39 -0700 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: <84F5E3D8-28D2-44FB-983D-02D54BA33543@ccs.neu.edu> References: <19463.42552.339766.549059@winooski.ccs.neu.edu> <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> <187AADFC-4731-4DF9-BFE7-8696827C19E9@ccs.neu.edu> <19463.57671.93353.161053@winooski.ccs.neu.edu> <4C07E421.40402@cs.utah.edu> <96892BA4-ACB4-4734-9473-11850AAC8463@brinckerhoff.org> <53FF4B13-A86F-4127-82D2-6230D801704B@brinckerhoff.org> <95854740-184C-4CD3-9E4F-E15304303F95@ccs.neu.edu> <426C6543-6451-4E5D-B0C0-571DFB8A8CB2@ccs.neu.edu> <64E9E6CB-BAE8-4299-8C3C-C7BE3BF5CBB9@ccs.neu.edu> <84F5E3D8-28D2-44FB-983D-02D54BA33543@ccs.neu.edu> Message-ID: On Jun 3, 2010, at 7:22 PM, Matthias Felleisen wrote: > > On Jun 3, 2010, at 7:47 PM, John Clements wrote: > >> >> On Jun 3, 2010, at 4:33 PM, Matthias Felleisen wrote: >> >>> >>> Can you return them from the function that grabs them (in Python)? >>> Can you resume the function once it has transfered control somewhere else? >>> Can you store the continuations in some vector? >>> >>> (I don't know the answers, but these are some of the things one can do with 1st-class values.) >> >> Yes: >> >> def grabK () : yield 1 ; print "running..." ; yield 2 >> >> def grabAFewKonts () : >> return [grabK () , grabK ()] >> >> a = grabAFewKonts(); >> >> f = a[0]; >> g = a[1]; >> >> print(f.next()); >> print(f.next()); >> print(g.next()); > > > Interesting perception. What you are storing are not the continuations but the suspended generators. (Think of grabK() as the creation of a generator.) You could do that in Simula 67, and what you need for that is a pair of control stacks, not a continuation tree. If I understand you correctly, the procedure-boundary limitation erases the difference between these, right? Also, FWIW, my understanding is that the presence of 'yield' is detected statically, and the corresponding function expanded into one whose invocation creates a generator, so removing the procedure-boundary limitation would be very difficult. > So here is the next question then: > > Can you invoke them a __second__ time and get an error message about a second use? > If you can't, they aren't real one-shot continuations. To be precise, you have no > observation to prove that they are continuations. You definitely get an error (or special value, I don't know the difference) when the generator is exhausted: ... print(f.next()); print(f.next()); print(f.next()); => 1 running... 2 Traceback (most recent call last): File "/tmp/foo.py", line 13, in print(f.next()); StopIteration ... but without that behavior, it wouldn't be a generator, so I'm not sure I'm understanding what you're suggesting. > In the days of denotational semantics, you might have said that you can denote them but not express them (or backwards, Mitch would know). Ah, those days of yore, when terms had real meanings :). Anyone know of work by philosophers or literary theorists on the significance of the move from denotational to operational semantics? John -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4669 bytes Desc: not available URL: From matthias at ccs.neu.edu Fri Jun 4 13:17:01 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Fri, 4 Jun 2010 13:17:01 -0400 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: References: <19463.42552.339766.549059@winooski.ccs.neu.edu> <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> <187AADFC-4731-4DF9-BFE7-8696827C19E9@ccs.neu.edu> <19463.57671.93353.161053@winooski.ccs.neu.edu> <4C07E421.40402@cs.utah.edu> <96892BA4-ACB4-4734-9473-11850AAC8463@brinckerhoff.org> <53FF4B13-A86F-4127-82D2-6230D801704B@brinckerhoff.org> <95854740-184C-4CD3-9E4F-E15304303F95@ccs.neu.edu> <426C6543-6451-4E5D-B0C0-571DFB8A8CB2@ccs.neu.edu> <64E9E6CB-BAE8-4299-8C3C-C7BE3BF5CBB9@ccs.neu.edu> <84F5E3D8-28D2-44FB-983D-02D54BA33543@ccs.neu.edu> Message-ID: <2A6AC825-0CF0-4EDC-8828-41E611F8B227@ccs.neu.edu> On Jun 4, 2010, at 1:07 PM, John Clements wrote: > so I'm not sure I'm understanding what you're suggesting. Here is what I am suggestion: Welcome to Racket v5.0.0.1. > (define f 0) > (require racket/control) > (+ 1 (let/ec k (set! f k) 10)) 11 > f # > (f 1) continuation application: attempt to jump into an escape continuation Produce this behavior in Python. In Python, you actually return from the procedure (at least it makes it look like it) and you use the continuation, yet, you can jump back into it. From samth at ccs.neu.edu Fri Jun 4 13:32:41 2010 From: samth at ccs.neu.edu (Sam Tobin-Hochstadt) Date: Fri, 4 Jun 2010 13:32:41 -0400 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: <2A6AC825-0CF0-4EDC-8828-41E611F8B227@ccs.neu.edu> References: <19463.42552.339766.549059@winooski.ccs.neu.edu> <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> <187AADFC-4731-4DF9-BFE7-8696827C19E9@ccs.neu.edu> <19463.57671.93353.161053@winooski.ccs.neu.edu> <4C07E421.40402@cs.utah.edu> <96892BA4-ACB4-4734-9473-11850AAC8463@brinckerhoff.org> <53FF4B13-A86F-4127-82D2-6230D801704B@brinckerhoff.org> <95854740-184C-4CD3-9E4F-E15304303F95@ccs.neu.edu> <426C6543-6451-4E5D-B0C0-571DFB8A8CB2@ccs.neu.edu> <64E9E6CB-BAE8-4299-8C3C-C7BE3BF5CBB9@ccs.neu.edu> <84F5E3D8-28D2-44FB-983D-02D54BA33543@ccs.neu.edu> <2A6AC825-0CF0-4EDC-8828-41E611F8B227@ccs.neu.edu> Message-ID: On Fri, Jun 4, 2010 at 1:17 PM, Matthias Felleisen wrote: > > On Jun 4, 2010, at 1:07 PM, John Clements wrote: > >> so I'm not sure I'm understanding what you're suggesting. > > > Here is what I am suggestion: > > Welcome to Racket v5.0.0.1. >> (define f 0) >> (require racket/control) >> (+ 1 (let/ec k (set! f k) 10)) > 11 >> f > # >> (f 1) > continuation application: attempt to jump into an escape continuation > > > Produce this behavior in Python. In Python, you actually return from the > procedure (at least it makes it look like it) and you use the continuation, > yet, you can jump back into > it. Generators in Python are not escape continuations, which is what you're using here. They're one-shot continuations, which is something we don't (straightforwardly) have in Racket. This means they can only be called once, but can be called from any dynamic context, even outside the context in which they're captured. -- sam th samth at ccs.neu.edu From jos.koot at telefonica.net Fri Jun 4 13:33:57 2010 From: jos.koot at telefonica.net (Jos Koot) Date: Fri, 4 Jun 2010 19:33:57 +0200 Subject: [plt-scheme] apply syntactically bound (was RE: [plt-bug] all/10959: namespace-variable-valuecannot find 'apply' in base-namespace) In-Reply-To: References: <201006040924.o549O2xf005075@champlain.ccs.neu.edu> <20100604122727.471866500EA@mail-svr1.cs.utah.edu> <84FD0771B4C4484D934CE1CC5B85F246@JacobPC> <20100604152907.6956B6500FE@mail-svr1.cs.utah.edu> <91AAC9E7D2594E0DAA09F7DB28833011@JacobPC> <2E3C338C1C354D469314108E40C15F6D@JacobPC> <5AC6DD5359024BB2A9F3FBE0EC383BB3@JacobPC> Message-ID: <205E9B7879384874AA91DF8236D4B3FD@JacobPC> Thanks, you are right. That's why I was surprised that 'apply' does not have a variable binding in a base-namespace. Nevertheless it seems contradictory to me that (procedure? apply) returns true while variable 'apply' is not bound as a variable in a base namespace. Now I know, thanks to Matthew, that apply is a macro, I have adapted my own toy interpreters such as to capture this issue. It seems to me that inclusion of identifier syntaxes introduces a little inconsistency between symbols having a syntactic binding or a simple variable binding. I very well know how to produce such mechanism, but I am not sure that I like them, how versatile they may be. Thanks, Jos > -----Original Message----- > From: samth0 at gmail.com [mailto:samth0 at gmail.com] On Behalf Of Sam Tobin- > Hochstadt > Sent: 04 June 2010 18:49 > To: Jos Koot > Cc: Carl Eastlund; Matthew Flatt; plt-scheme at list.cs.brown.edu > Subject: Re: [plt-scheme] apply syntactically bound (was RE: [plt-bug] > all/10959: namespace-variable-valuecannot find 'apply' in base-namespace) > > On Fri, Jun 4, 2010 at 12:36 PM, Jos Koot wrote: > > That may very well be the case. 'apply' in the operator position of an > > expression like (apply bla bla bla ...) being expanded as by a > transformer > > and in other positions being expanded to something that evaluates to a > > procedure. If this is the case, I think this should be added to the > docs. > > In general, the docs avoid committing to whether something is a > procedure or merely something implemented with a macro that behaves > like a procedure. This is because lots of identifiers may or may not > be macros, depending on the precise implementation, but this > distinction is mostly irrelevant, and we want the flexibility to > change the implementation. In this specific case, (procedure? apply) > still produces #t, and thus in almost all cases it can be thought of > as a procedure. > -- > sam th > samth at ccs.neu.edu From matthias at ccs.neu.edu Fri Jun 4 13:36:45 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Fri, 4 Jun 2010 13:36:45 -0400 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: References: <19463.42552.339766.549059@winooski.ccs.neu.edu> <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> <187AADFC-4731-4DF9-BFE7-8696827C19E9@ccs.neu.edu> <19463.57671.93353.161053@winooski.ccs.neu.edu> <4C07E421.40402@cs.utah.edu> <96892BA4-ACB4-4734-9473-11850AAC8463@brinckerhoff.org> <53FF4B13-A86F-4127-82D2-6230D801704B@brinckerhoff.org> <95854740-184C-4CD3-9E4F-E15304303F95@ccs.neu.edu> <426C6543-6451-4E5D-B0C0-571DFB8A8CB2@ccs.neu.edu> <64E9E6CB-BAE8-4299-8C3C-C7BE3BF5CBB9@ccs.neu.edu> <84F5E3D8-28D2-44FB-983D-02D54BA33 543@ccs.neu.edu> <2A6AC825-0CF0-4EDC-8828-41E611F8B227@ccs.neu.edu> Message-ID: <7EE45777-7D5B-4F9A-9730-C9B353D27E4D@ccs.neu.edu> On Jun 4, 2010, at 1:32 PM, Sam Tobin-Hochstadt wrote: > ... even outside the context in which they're captured. You're right. They are not escape continuations. How are they one-shot if you can escape from the context where you captured them? Did you or did you not use the continuation to exit from that context? (My true point is that they aren't continuation at all. You can use continuations in the denotational sense to explain them but I think you can get away with something much much simpler: procedure-local continuations, and they are NOT first-class.) -- Matthias From mflatt at cs.utah.edu Fri Jun 4 13:40:49 2010 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Fri, 4 Jun 2010 11:40:49 -0600 Subject: [plt-scheme] apply syntactically bound (was RE: [plt-bug] In-Reply-To: <205E9B7879384874AA91DF8236D4B3FD@JacobPC> References: <201006040924.o549O2xf005075@champlain.ccs.neu.edu> <20100604122727.471866500EA@mail-svr1.cs.utah.edu> <84FD0771B4C4484D934CE1CC5B85F246@JacobPC> <20100604152907.6956B6500FE@mail-svr1.cs.utah.edu> <91AAC9E7D2594E0DAA09F7DB28833011@JacobPC> <2E3C338C1C354D469314108E40C15F6D@JacobPC> <5AC6DD5359024BB2A9F3FBE0EC383BB3@JacobPC> <205E9B7879384874AA91DF8236D4B3FD@JacobPC> Message-ID: <20100604174050.334EC6500C6@mail-svr1.cs.utah.edu> At Fri, 4 Jun 2010 19:33:57 +0200, "Jos Koot" wrote: > It seems to me that inclusion of identifier syntaxes introduces > a little inconsistency between symbols having a syntactic binding or a > simple variable binding. I think that `namespace-variable-binding' is likely the problem, in that it exposes too much information. In contrast, if you use `dynamic-require' like (dynamic-require 'racket/base 'apply) then you don't have to know whether `apply' is bound as a variable or as syntax. The `dynamic-require' function correctly hides the difference. From samth at ccs.neu.edu Fri Jun 4 13:45:49 2010 From: samth at ccs.neu.edu (Sam Tobin-Hochstadt) Date: Fri, 4 Jun 2010 13:45:49 -0400 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: <7EE45777-7D5B-4F9A-9730-C9B353D27E4D@ccs.neu.edu> References: <19463.42552.339766.549059@winooski.ccs.neu.edu> <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> <187AADFC-4731-4DF9-BFE7-8696827C19E9@ccs.neu.edu> <19463.57671.93353.161053@winooski.ccs.neu.edu> <4C07E421.40402@cs.utah.edu> <96892BA4-ACB4-4734-9473-11850AAC8463@brinckerhoff.org> <53FF4B13-A86F-4127-82D2-6230D801704B@brinckerhoff.org> <95854740-184C-4CD3-9E4F-E15304303F95@ccs.neu.edu> <426C6543-6451-4E5D-B0C0-571DFB8A8CB2@ccs.neu.edu> <64E9E6CB-BAE8-4299-8C3C-C7BE3BF5CBB9@ccs.neu.edu> <2A6AC825-0CF0-4EDC-8828-41E611F8B227@ccs.neu.edu> <7EE45777-7D5B-4F9A-9730-C9B353D27E4D@ccs.neu.edu> Message-ID: On Fri, Jun 4, 2010 at 1:36 PM, Matthias Felleisen wrote: > > On Jun 4, 2010, at 1:32 PM, Sam Tobin-Hochstadt wrote: > >> ... even outside the context in which they're captured. > > You're right. They are not escape continuations. > > How are they one-shot if you can escape from the context where you captured them? Did you or did you not use the continuation to exit from that context? They're one-shot in that they can only be invoked once - after that, they change to do something else. Consider this implementation of `call/cc': (define (call/cc* f) (let/cc k (let* ([v #f] [k* (lambda (e) (if v (error 'too-many) (begin (set! v #t) (k e)))]) (f k*)))) This implements a first-class, full continuation that can only be used once. You can pass it back out, invoke it from anywhere, but after one use it errors. That's a one-shot continuation. > (My true point is that they aren't continuation at all. You can use continuations in the denotational sense to explain them but I think you can get away with something much much simpler: procedure-local continuations, and they are NOT first-class.) You can explain them as coroutines, as the paper I pointed to does. -- sam th samth at ccs.neu.edu From matthias at ccs.neu.edu Fri Jun 4 13:54:20 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Fri, 4 Jun 2010 13:54:20 -0400 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: References: <19463.42552.339766.549059@winooski.ccs.neu.edu> <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> <187AADFC-4731-4DF9-BFE7-8696827C19E9@ccs.neu.edu> <19463.57671.93353.161053@winooski.ccs.neu.edu> <4C07E421.40402@cs.utah.edu> <96892BA4-ACB4-4734-9473-11850AAC8463@brinckerhoff.org> <53FF4B13-A86F-4127-82D2-6230D801704B@brinckerhoff.org> <95854740-184C-4CD3-9E4F-E15304303F95@ccs.neu.edu> <426C6543-6451-4E5D-B0C0-571DFB8A8CB2@ccs.neu.edu> <64E9E6CB-BAE8-4299-8C3C-C7BE3BF5CBB9@ccs.neu.edu> <2A6AC825-0CF0-4EDC-8828-41E611F8B227@ccs.neu.edu> <7EE45777-7D5B-4F9A-9730-C9B353D27E4D@ccs.neu.edu> Message-ID: <7C80A3A9-37D3-4DC7-B5A4-B25D66B9CE6B@ccs.neu.edu> On Jun 4, 2010, at 1:45 PM, Sam Tobin-Hochstadt wrote: > They're one-shot in that they can only be invoked once - after that, > they change to do something else. Consider this implementation of > `call/cc': > > (define (call/cc* f) > (let/cc k > (let* ([v #f] > [k* (lambda (e) (if v (error 'too-many) (begin (set! v #t) (k e)))]) > (f k*)))) > > This implements a first-class, full continuation that can only be used > once. You can pass it back out, invoke it from anywhere, but after > one use it errors. That's a one-shot continuation. Please re-read Friedman and Haynes. At a min, run (k* (f k*)). >> (My true point is that they aren't continuation at all. You can use continuations in the denotational sense to explain them but I think you can get away with something much much simpler: procedure-local continuations, and they are NOT first-class.) > > You can explain them as coroutines, as the paper I pointed to does. Of course you can, I have done so in the past myself. From samth at ccs.neu.edu Fri Jun 4 13:55:41 2010 From: samth at ccs.neu.edu (Sam Tobin-Hochstadt) Date: Fri, 4 Jun 2010 13:55:41 -0400 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: <7C80A3A9-37D3-4DC7-B5A4-B25D66B9CE6B@ccs.neu.edu> References: <19463.42552.339766.549059@winooski.ccs.neu.edu> <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> <187AADFC-4731-4DF9-BFE7-8696827C19E9@ccs.neu.edu> <19463.57671.93353.161053@winooski.ccs.neu.edu> <4C07E421.40402@cs.utah.edu> <96892BA4-ACB4-4734-9473-11850AAC8463@brinckerhoff.org> <53FF4B13-A86F-4127-82D2-6230D801704B@brinckerhoff.org> <95854740-184C-4CD3-9E4F-E15304303F95@ccs.neu.edu> <426C6543-6451-4E5D-B0C0-571DFB8A8CB2@ccs.neu.edu> <64E9E6CB-BAE8-4299-8C3C-C7BE3BF5CBB9@ccs.neu.edu> <2A6AC825-0CF0-4EDC-8828-41E611F8B227@ccs.neu.edu> <7EE45777-7D5B-4F9A-9730-C9B353D27E4D@ccs.neu.edu> <7C80A3A9-37D3-4DC7-B5A4-B25D66B9CE6B@ccs.neu.edu> Message-ID: On Fri, Jun 4, 2010 at 1:54 PM, Matthias Felleisen wrote: > > On Jun 4, 2010, at 1:45 PM, Sam Tobin-Hochstadt wrote: > >> They're one-shot in that they can only be invoked once - after that, >> they change to do something else. ?Consider this implementation of >> `call/cc': >> >> (define (call/cc* f) >> ?(let/cc k >> ? ?(let* ([v #f] >> ? ? ? ? ? ?[k* (lambda (e) (if v (error 'too-many) (begin (set! v #t) (k e)))]) >> ? ? ?(f k*)))) >> >> This implements a first-class, full continuation that can only be used >> once. ?You can pass it back out, invoke it from anywhere, but after >> one use it errors. ?That's a one-shot continuation. > > > Please re-read Friedman and Haynes. At a min, run (k* (f k*)). What is `f' here? -- sam th samth at ccs.neu.edu From etanter at dcc.uchile.cl Fri Jun 4 14:14:54 2010 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Fri, 4 Jun 2010 14:14:54 -0400 Subject: [plt-scheme] [redex] matching question Message-ID: Hi, I have a subtype? metafunction where one clause is as follows: ((subtype? C_0 C_1 CT) #t (side-condition (not (equal? (term C_0) (term Object)))) (where (C_0 C_2 any_1 any_2) (class-lookup C_0 CT)) (side-condition (not (equal? (term C_0) (term C_1)))) (side-condition (equal? (term C_2) (term C_1)))) ie. C_0 is subtype of C_1 if C_0 directly inherits from C_1 I find it redundant that I have to write the above, ie. introducing C_2 in the where clause to then check that C_2 and C_1 are equal. At first I wrote: ((subtype? C_0 C_1 CT) #t (side-condition (not (equal? (term C_0) (term Object)))) (where (C_0 C_1 any_1 any_2) (class-lookup C_0 CT)) (side-condition (not (equal? (term C_0) (term C_1))))) putting C_1 directly in the pattern of the where clause, but it did not work (that is to say, it always matched, even if the superclass was different from C_1). Can someone explain me why this is so? Thanks! -- ?ric From jmarshall at alum.mit.edu Fri Jun 4 14:45:44 2010 From: jmarshall at alum.mit.edu (Joe Marshall) Date: Fri, 4 Jun 2010 11:45:44 -0700 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: References: <19463.42552.339766.549059@winooski.ccs.neu.edu> <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> <187AADFC-4731-4DF9-BFE7-8696827C19E9@ccs.neu.edu> <19463.57671.93353.161053@winooski.ccs.neu.edu> <4C07E421.40402@cs.utah.edu> <96892BA4-ACB4-4734-9473-11850AAC8463@brinckerhoff.org> <53FF4B13-A86F-4127-82D2-6230D801704B@brinckerhoff.org> <95854740-184C-4CD3-9E4F-E15304303F95@ccs.neu.edu> <426C6543-6451-4E5D-B0C0-571DFB8A8CB2@ccs.neu.edu> <64E9E6CB-BAE8-4299-8C3C-C7BE3BF5CBB9@ccs.neu.edu> <84F5E3D8-28D2-44FB-983D-02D54BA33543@ccs.neu.edu> Message-ID: On Fri, Jun 4, 2010 at 10:07 AM, John Clements wrote: > > Ah, those days of yore, when terms had real meanings :). Anyone know of work by philosophers or literary theorists on the significance of the move from denotational to operational semantics? I'd be surprised if there were. It's a pretty recent move in the computer world. You could probably map some philosophical movements onto these semantics: the philosophers that take the view that your actions define `who you are' would be operationalists, and the ones that take a `you are what you've accomplished' might be denotationalists, but it would be stretching the meaning. (But I bet you'd get published in Social Text!) -- ~jrm From clklein at eecs.northwestern.edu Fri Jun 4 14:48:55 2010 From: clklein at eecs.northwestern.edu (Casey Klein) Date: Fri, 4 Jun 2010 13:48:55 -0500 Subject: [plt-scheme] [redex] matching question In-Reply-To: References: Message-ID: On Fri, Jun 4, 2010 at 1:14 PM, Eric Tanter wrote: > Hi, > > I have a subtype? metafunction where one clause is as follows: > > ((subtype? C_0 C_1 CT) > ? #t > ? (side-condition (not (equal? (term C_0) (term Object)))) > ? (where (C_0 C_2 any_1 any_2) (class-lookup C_0 CT)) > ? (side-condition (not (equal? (term C_0) (term C_1)))) > ? (side-condition (equal? (term C_2) (term C_1)))) > > ie. C_0 is subtype of C_1 if C_0 directly inherits from C_1 > > I find it redundant that I have to write the above, ie. introducing C_2 in the where clause to then check that C_2 and C_1 are equal. > > At first I wrote: > > ((subtype? C_0 C_1 CT) > ? #t > ? (side-condition (not (equal? (term C_0) (term Object)))) > ? (where (C_0 C_1 any_1 any_2) (class-lookup C_0 CT)) > ? (side-condition (not (equal? (term C_0) (term C_1))))) > > putting C_1 directly in the pattern of the where clause, but it did not work (that is to say, it always matched, even if the superclass was different from C_1). > > Can someone explain me why this is so? > John requested the same behavior a few months ago, and I agree it would be very handy. I'll try to implement it in the next few weeks. From etanter at dcc.uchile.cl Fri Jun 4 14:59:30 2010 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Fri, 4 Jun 2010 14:59:30 -0400 Subject: [plt-scheme] [redex] matching question In-Reply-To: References: Message-ID: Great, thanks Casey! -- ?ric On Jun 4, 2010, at 2:48 PM, Casey Klein wrote: > On Fri, Jun 4, 2010 at 1:14 PM, Eric Tanter wrote: >> Hi, >> >> I have a subtype? metafunction where one clause is as follows: >> >> ((subtype? C_0 C_1 CT) >> #t >> (side-condition (not (equal? (term C_0) (term Object)))) >> (where (C_0 C_2 any_1 any_2) (class-lookup C_0 CT)) >> (side-condition (not (equal? (term C_0) (term C_1)))) >> (side-condition (equal? (term C_2) (term C_1)))) >> >> ie. C_0 is subtype of C_1 if C_0 directly inherits from C_1 >> >> I find it redundant that I have to write the above, ie. introducing C_2 in the where clause to then check that C_2 and C_1 are equal. >> >> At first I wrote: >> >> ((subtype? C_0 C_1 CT) >> #t >> (side-condition (not (equal? (term C_0) (term Object)))) >> (where (C_0 C_1 any_1 any_2) (class-lookup C_0 CT)) >> (side-condition (not (equal? (term C_0) (term C_1))))) >> >> putting C_1 directly in the pattern of the where clause, but it did not work (that is to say, it always matched, even if the superclass was different from C_1). >> >> Can someone explain me why this is so? >> > > John requested the same behavior a few months ago, and I agree it > would be very handy. I'll try to implement it in the next few weeks. From keydana at gmx.de Fri Jun 4 15:37:58 2010 From: keydana at gmx.de (keydana at gmx.de) Date: Fri, 4 Jun 2010 21:37:58 +0200 Subject: [plt-scheme] Re: Typed scheme: Cannot apply expression of type Procedure, since it is not a function type In-Reply-To: <20100604062452.2E11E402B6@qua.cs.brown.edu> References: <20100604062452.2E11E402B6@qua.cs.brown.edu> Message-ID: > > Discriminated unions are the category-theoretic dual of cartesian > products. If you find one useful, chances are you need the other, too. > Can you please elaborate? >> > You might be better off with CAML than Haskell, if you want to make > smaller steps in that direction. CAML is not such a radical shift into > lazy evaluation. I'm not totally unfamiliar with lazy evaluation (the concept, at least, practice will be a different matter I guess :-;), and having already started with Haskell (several times... - I've always been forced to postpone it somehow) I think I'd like to stick with it, not begin yet another thing... > > Also, learn some elementary category theory (that found in the first > chapter or two of *any* book on the subject will be enough to Yes, this topic really is on my "books queue". Only for me, as a mathematically totally untrained person, with no one to ask, it does make a difference which book I read - I fully realized this with John Fraleigh's "Abstract Algebra", which I've nearly finished by now and which I'm really enthusiastic about. For sure it may lack "rigor" as some critique on amazon was saying, but it really makes me understand the concepts. Could you perhaps recommend a book on category theory that emphasizes understanding in a similar way? In general, your post seems to suggest that learning about theoretical concepts and practical programming need not be so tightly coupled... which is in accordance with my realizing that perhaps using typed scheme for my project (of implementing relational algebra) might render things unnecessarily complicated (as I have to, in a way, implement types myself, and am using scheme functions on the other hand, which leads to serious typing problems). (Plus, I think I cannot go on bugging Sam with so many questions :-;). What I mean to say,- I should choose the easiest tool for the job and not make things overly complicated by trying to make the scheme code as haskell-like as possible :-; Ciao, Sigrid > > ------------------------------ > > Message: 3 > Date: Thu, 3 Jun 2010 22:22:41 -0400 > From: Matthias Felleisen > Subject: Re: [plt-scheme] Fun with Unicode and delimited continuations > To: John Clements > Cc: David Herman , Eli Barzilay > , plt-scheme at list.cs.brown.edu, Doug Orleans > > Message-ID: <84F5E3D8-28D2-44FB-983D-02D54BA33543 at ccs.neu.edu> > Content-Type: text/plain; charset=us-ascii > > > On Jun 3, 2010, at 7:47 PM, John Clements wrote: > >> >> On Jun 3, 2010, at 4:33 PM, Matthias Felleisen wrote: >> >>> >>> Can you return them from the function that grabs them (in Python)? >>> Can you resume the function once it has transfered control somewhere else? >>> Can you store the continuations in some vector? >>> >>> (I don't know the answers, but these are some of the things one can do with 1st-class values.) >> >> Yes: >> >> def grabK () : yield 1 ; print "running..." ; yield 2 >> >> def grabAFewKonts () : >> return [grabK () , grabK ()] >> >> a = grabAFewKonts(); >> >> f = a[0]; >> g = a[1]; >> >> print(f.next()); >> print(f.next()); >> print(g.next()); > > > Interesting perception. What you are storing are not the continuations but the suspended generators. (Think of grabK() as the creation of a generator.) You could do that in Simula 67, and what you need for that is a pair of control stacks, not a continuation tree. > > So here is the next question then: > > Can you invoke them a __second__ time and get an error message about a second use? > If you can't, they aren't real one-shot continuations. To be precise, you have no > observation to prove that they are continuations. > > In the days of denotational semantics, you might have said that you can denote them but not express them (or backwards, Mitch would know). > > -- Matthias > > > > > > > > ------------------------------ > > Message: 4 > Date: Thu, 3 Jun 2010 23:00:43 -0400 > From: Sam Tobin-Hochstadt > Subject: Re: [plt-scheme] Fun with Unicode and delimited continuations > To: Matthias Felleisen > Cc: David Herman , Eli Barzilay > , John Clements , > plt-scheme at list.cs.brown.edu, Doug Orleans > Message-ID: > > Content-Type: text/plain; charset=ISO-8859-1 > > On Thu, Jun 3, 2010 at 10:22 PM, Matthias Felleisen > wrote: >> You could do that in Simula 67, and what you need for that is a pair of control stacks, not a continuation tree. > > There's a paper in TFP 2010 by Konrad Anton and Peter Thiemann that > discusses these under the rubric of coroutines, with history going > back to Simula. > > -- > sam th > samth at ccs.neu.edu > > > ------------------------------ > > Message: 5 > Date: Wed, 02 Jun 2010 22:17:21 -0700 > From: George Oliver > Subject: [plt-scheme] MUD servers? > To: plt-scheme at list.cs.brown.edu > Message-ID: <4C073AE1.7080903 at gmail.com> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > hi, > > While there are a few threads on the list that mention MUDs, and several > PLT-Scheme muds referenced in Google results, it seems like most of the > links to code or running games are long dead. Does anyone have current > links to PLT-Scheme MUD info? > > As a long-time MUDder and beginning Schemer I think this would be a fun > project to tackle. > > > thanks, George > > > ------------------------------ > > Message: 6 > Date: Thu, 03 Jun 2010 23:24:21 -0700 > From: Synx > Subject: Re: [plt-scheme] MUD servers? > To: PLT-Scheme Mailing List > Message-ID: <4C089C15.2040102 at synx.us.to> > Content-Type: text/plain; charset=ISO-8859-1 > > > On 06/02/2010 10:17 PM, George Oliver wrote: >> hi, >> >> While there are a few threads on the list that mention MUDs, and several >> PLT-Scheme muds referenced in Google results, it seems like most of the >> links to code or running games are long dead. Does anyone have current >> links to PLT-Scheme MUD info? >> >> As a long-time MUDder and beginning Schemer I think this would be a fun >> project to tackle. > > I thought it would be fun to tackle too. Then I realized how PLT does > such wonderful optimization by not allowing you to remove modules > explicitly, but that doesn't cater well to a situation where you are > going in and out of different rooms and player contexts and such. Then I > learned just how convoluted making custom languages is using PLT, which > until last week or so had no tutorial how to do so at all. And finally I > ran into the problems facing sandboxes, how to get them to a state where > you can actually pass s-expressions to them and not have them error out > claiming they're trying to hax your boxes. > > It turned out to be a lot more complicated than I imagined at first... > probably mostly my fault since I seem to overcomplicate everything. I > kind of concluded in the end that getting something working isn't worth > the effort and I'd just use LambdaMOO instead (which ironically does not > support any form of LISP at all). Then I just got tired of trying to > make a convincing text game at all. Then I combed my hair over one eye > and started wearing black clothing with striped sleeves everywhere. > > In short, I'm still working on it. Slowly. Got other priorities though. > You're free to look at what I got: > https://synx.us.to/code/mu/ > > The database thing is the trickiest part that actually works. I'm not > sure I could get good performance using a relational SQL database > though, and it'd be better to represent the data as it actually is > instead of trying to strongarm it into some kind of human readable query > language like sqlite wants me to. > > Oh also, > http://pre.plt-scheme.org/docs/html/guide/languages.html > > > End of plt-scheme Digest, Vol 58, Issue 14 > ****************************************** -------------- next part -------------- An HTML attachment was scrubbed... URL: From clements at brinckerhoff.org Fri Jun 4 15:39:30 2010 From: clements at brinckerhoff.org (John Clements) Date: Fri, 4 Jun 2010 12:39:30 -0700 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: <7C80A3A9-37D3-4DC7-B5A4-B25D66B9CE6B@ccs.neu.edu> References: <19463.42552.339766.549059@winooski.ccs.neu.edu> <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> <187AADFC-4731-4DF9-BFE7-8696827C19E9@ccs.neu.edu> <19463.57671.93353.161053@winooski.ccs.neu.edu> <4C07E421.40402@cs.utah.edu> <96892BA4-ACB4-4734-9473-11850AAC8463@brinckerhoff.org> <53FF4B13-A86F-4127-82D2-6230D801704B@brinckerhoff.org> <95854740-184C-4CD3-9E4F-E15304303F95@ccs.neu.edu> <426C6543-6451-4E5D-B0C0-571DFB8A8CB2@ccs.neu.edu> <64E9E6CB-BAE8-4299-8C3C-C7BE3BF5CBB9@ccs.neu.edu> <2A6AC825-0CF0-4EDC-8828-41E611F8B227@ccs.neu.edu> <7EE45777-7D5B-4F9A-9730-C9B353D27E4D@ccs.neu.edu> <7C80A3A9-37D3-4DC7-B5A4-B25D66B9CE6B@ccs.neu.edu> Message-ID: On Jun 4, 2010, at 10:54 AM, Matthias Felleisen wrote: > > On Jun 4, 2010, at 1:45 PM, Sam Tobin-Hochstadt wrote: > >> They're one-shot in that they can only be invoked once - after that, >> they change to do something else. Consider this implementation of >> `call/cc': >> >> (define (call/cc* f) >> (let/cc k >> (let* ([v #f] >> [k* (lambda (e) (if v (error 'too-many) (begin (set! v #t) (k e)))]) >> (f k*)))) >> >> This implements a first-class, full continuation that can only be used >> once. You can pass it back out, invoke it from anywhere, but after >> one use it errors. That's a one-shot continuation. > > > Please re-read Friedman and Haynes. At a min, run (k* (f k*)). IIUC, you're asking what happens if you inject a call to the continuation into a context that is the result of invoking the continuation? In Python: def grabK () : f = yield 1 ; print "running..." ; fresult = f() yield fresult f = grabK(); def const8 () : return 8; def invokefwithconst8 () : f.send(const8) print(f.next()); print(f.send(invokefwithconst8)); ... to which python responds: pcp062805pcs:/tmp clements$ python /tmp/foo.py 1 running... Traceback (most recent call last): File "/tmp/foo.py", line 15, in print(f.send(invokefwithconst8)); File "/tmp/foo.py", line 4, in grabK fresult = f() File "/tmp/foo.py", line 12, in invokefwithconst8 def invokefwithconst8 () : f.send(const8) ValueError: generator already executing ... which last line makes it clear that the python implementors are also thinking of these as coroutines. > >>> (My true point is that they aren't continuation at all. You can use continuations in the denotational sense to explain them but I think you can get away with something much much simpler: procedure-local continuations, and they are NOT first-class.) I'm still wrestling with what exactly you mean by "first-class" in this context. I think it has something to do with "can't be nicely expressed without lots of yucky mutation." If there's a paper I should go read, tell me which one it is. John -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4669 bytes Desc: not available URL: From matthias at ccs.neu.edu Fri Jun 4 15:52:48 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Fri, 4 Jun 2010 15:52:48 -0400 Subject: [plt-scheme] Fun with Unicode and delimited continuations In-Reply-To: References: <19463.42552.339766.549059@winooski.ccs.neu.edu> <446ED186-3219-4187-9E7A-CE18B60C64C6@brinckerhoff.org> <187AADFC-4731-4DF9-BFE7-8696827C19E9@ccs.neu.edu> <19463.57671.93353.161053@winooski.ccs.neu.edu> <4C07E421.40402@cs.utah.edu> <96892BA4-ACB4-4734-9473-11850AAC8463@brinckerhoff.org> <53FF4B13-A86F-4127-82D2-6230D801704B@brinckerhoff.org> <95854740-184C-4CD3-9E4F-E15304303F95@ccs.neu.edu> <426C6543-6451-4E5D-B0C0-571DFB8A8CB2@ccs.neu.edu> <64E9E6CB-BAE8-4299-8C3C-C7BE3BF5CBB9@ccs.neu.edu> <2A6AC825-0CF0-4EDC-8828-41E611F8B227@ccs.neu.edu> <7EE45777-7D5B-4F9A-9730-C9B353D27E4D@ccs.neu.edu> <7C80A3A9-37D3-4DC7-B5A4-B25D66B9CE6B@ccs.neu.edu> Message-ID: <5BF47A7F-86E3-45CA-8F52-1A2922D3904A@ccs.neu.edu> On Jun 4, 2010, at 3:39 PM, John Clements wrote: > I'm still wrestling with what exactly you mean by "first-class" in this context. I think it has something to do with "can't be nicely expressed without lots of yucky mutation." If there's a paper I should go read, tell me which one it is. 1. Clearly the phrase 'first-class' is nearly meaningless and this discussion has gone that way too. 2. I see that Python recognizes that the coroutine is already running and can't be re-entered. Sad. But that's not the same as grabbing a one-shot continuation and saying it has been run. 3. No, first-class has nothing to do with mutation and difficult to 'get at.' I can't bring myself to use the word 'express' here. From noelwelsh at gmail.com Fri Jun 4 16:28:23 2010 From: noelwelsh at gmail.com (Noel Welsh) Date: Fri, 4 Jun 2010 21:28:23 +0100 Subject: [plt-scheme] Re: Typed scheme: Cannot apply expression of type Procedure, since it is not a function type In-Reply-To: References: <20100604062452.2E11E402B6@qua.cs.brown.edu> Message-ID: On Fri, Jun 4, 2010 at 8:37 PM, keydana at gmx.de wrote: > > Discriminated unions are the category-theoretic dual of cartesian > products... > > Can you please elaborate? > Products are Ands are tuples. E.g. int * bool -- an integer and a boolean Sums are Ors are discrimintaed unions. E.g. Foo | Bar Duals informally means you can map concepts in one domain directly into the other >?If you find one useful, chances are you need the other, too. I don't have a good explanation for this, but I think sums and products as axes in 2D, and having the two allows you to escape the constraints of one axis. > ... (Plus, I think I cannot go on bugging Sam with so many > questions :-;). ... I think this is good for Sam. It will motivate better docs and toughen him up for the Ecmascript committee. N. From samth at ccs.neu.edu Fri Jun 4 16:37:55 2010 From: samth at ccs.neu.edu (Sam Tobin-Hochstadt) Date: Fri, 4 Jun 2010 16:37:55 -0400 Subject: [plt-scheme] Re: Typed scheme: Cannot apply expression of type Procedure, since it is not a function type In-Reply-To: References: <20100604062452.2E11E402B6@qua.cs.brown.edu> Message-ID: On Fri, Jun 4, 2010 at 4:28 PM, Noel Welsh wrote: > >> ... (Plus, I think I cannot go on bugging Sam with so many >> questions :-;). ... > > I think this is good for Sam. It will motivate better docs and toughen > him up for the Ecmascript committee. While I admit to being bored of the category theory, I'm always happy to have questions about Typed Scheme. Also, I think your original question points to something that should be added to Typed Scheme. What you really want to write is this: (define-struct: (ret args ...) Fun ((name : Symbol) (proc : (args ... -> ret)) (args : (Listof Symbol)) (ret : Symbol))) But you can't write that at the moment. Stevie and I will take a look at enabling it. -- sam th samth at ccs.neu.edu From rovitotv at gmail.com Fri Jun 4 22:59:34 2010 From: rovitotv at gmail.com (Todd V Rovito) Date: Fri, 4 Jun 2010 22:59:34 -0400 Subject: [plt-scheme] Build PLT Scheme on Mac OS X Snow Leopard (10.6) for Leopard (10.5) Message-ID: Greetings, I have a project that I am working on were people do most of their work on Leopard but machines are starting to trickle in that have 10.6 or Snow Leopard. So far we have been able to move the 10.5 binaries to 10.6 and run with no problems. Now as a developer I have 10.6 and I want to build the project for 10.5, Apple supports this with the options -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 as documented on this web page: http://cocoawithlove.com/2009/09/building-for-earlier-os-versions-in.html. This seems to work for some simple projects both in xcode and on the command line. But with PLT Scheme version 4.2.3 (for mac) I can't build using the following commands: export LDFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" export CFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5" ./configure --prefix=/opt/plt-scheme --disable-mred --enable-xonx && make both && make install-both The configure runs ok but the build failes with the output below, thanks for the help. gcc -m32 -I./.. -I./../include -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -DOS_X -D_DARWIN_UNLIMITED_SELECT -DXONX -DNEWGC_BTC_ACCOUNT -Wall -I./.. -c ./gc2.c -o gc2.o ar ruv ../libmzscheme3m.a salloc.o bignum.o bool.o builtin.o char.o complex.o dynext.o env.o error.o eval.o file.o fun.o future.o hash.o jit.o list.o module.o mzrt.o network.o numarith.o number.o numcomp.o numstr.o places.o port.o portfun.o print.o rational.o read.o regexp.o sema.o setjmpup.o string.o struct.o stxobj.o symbol.o syntax.o thread.o type.o vector.o foreign.o ../src/gmp.o ../src/unwind.o ../../foreign/gcc/libffi/src/*.o ../../foreign/gcc/libffi/src/*/*.o gc2.o ar: creating archive ../libmzscheme3m.a a - salloc.o a - bignum.o a - bool.o a - builtin.o a - char.o a - complex.o a - dynext.o a - env.o a - error.o a - eval.o a - file.o a - fun.o a - future.o a - hash.o a - jit.o a - list.o a - module.o a - mzrt.o a - network.o a - numarith.o a - number.o a - numcomp.o a - numstr.o a - places.o a - port.o a - portfun.o a - print.o a - rational.o a - read.o a - regexp.o a - sema.o a - setjmpup.o a - string.o a - struct.o a - stxobj.o a - symbol.o a - syntax.o a - thread.o a - type.o a - vector.o a - foreign.o a - ../src/gmp.o a - ../src/unwind.o a - ../../foreign/gcc/libffi/src/closures.o a - ../../foreign/gcc/libffi/src/debug.o a - ../../foreign/gcc/libffi/src/java_raw_api.o a - ../../foreign/gcc/libffi/src/prep_cif.o a - ../../foreign/gcc/libffi/src/raw_api.o a - ../../foreign/gcc/libffi/src/types.o a - ../../foreign/gcc/libffi/src/x86/darwin.o a - ../../foreign/gcc/libffi/src/x86/darwin64.o a - ../../foreign/gcc/libffi/src/x86/ffi.o a - ../../foreign/gcc/libffi/src/x86/ffi64.o a - gc2.o /usr/bin/ranlib: file: ../libmzscheme3m.a(future.o) has no symbols /usr/bin/ranlib: file: ../libmzscheme3m.a(mzrt.o) has no symbols /usr/bin/ranlib: file: ../libmzscheme3m.a(unwind.o) has no symbols /usr/bin/ranlib: file: ../libmzscheme3m.a(darwin64.o) has no symbols /usr/bin/ranlib: file: ../libmzscheme3m.a(ffi64.o) has no symbols ranlib ../libmzscheme3m.a ranlib: file: ../libmzscheme3m.a(future.o) has no symbols ranlib: file: ../libmzscheme3m.a(mzrt.o) has no symbols ranlib: file: ../libmzscheme3m.a(unwind.o) has no symbols ranlib: file: ../libmzscheme3m.a(darwin64.o) has no symbols ranlib: file: ../libmzscheme3m.a(ffi64.o) has no symbols cd ..; gcc -m32 -o mzscheme3m gc2/main.o libmzscheme3m.a -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -ldl -lm -liconv Undefined symbols: "_fopen$UNIX2003", referenced from: _copy_file in libmzscheme3m.a(file.o) _copy_file in libmzscheme3m.a(file.o) ld: symbol(s) not found collect2: ld returned 1 exit status make[4]: *** [../mzscheme3m] Error 1 make[3]: *** [all] Error 2 make[2]: *** [3m] Error 2 make[1]: *** [3m] Error 2 make: *** [both] Error 2 _________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-scheme From mflatt at cs.utah.edu Fri Jun 4 23:34:53 2010 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Fri, 4 Jun 2010 21:34:53 -0600 Subject: [racket] [plt-scheme] Build PLT Scheme on Mac OS X Snow Leopard (10.6) for Leopard (10.5) In-Reply-To: References: Message-ID: <20100605033458.60C98650108@mail-svr1.cs.utah.edu> You may have more success with configure --enable-sdk=/Developer/SDKs/MacOSX10.5.sdk That has an effect similar to your flag settings, except that PREFLAGS is set instead of CFLAGS. Unlike CFLAGS, PREFLAGS is used for C pre-processing, and pre-processor expansion is used directly to build the 3m variant of mzscheme. At Fri, 4 Jun 2010 22:59:34 -0400, Todd V Rovito wrote: > Greetings, > I have a project that I am working on were people do most of their work > on Leopard but machines are starting to trickle in that have 10.6 or Snow > Leopard. So far we have been able to move the 10.5 binaries to 10.6 and run > with no problems. Now as a developer I have 10.6 and I want to build the > project for 10.5, Apple supports this with the options -isysroot > /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 as documented on > this web page: > http://cocoawithlove.com/2009/09/building-for-earlier-os-versions-in.html. > This seems to work for some simple projects both in xcode and on the command > line. But with PLT Scheme version 4.2.3 (for mac) I can't build using the > following commands: > export LDFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk > -mmacosx-version-min=10.5" > export CFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk > -mmacosx-version-min=10.5" > ./configure --prefix=/opt/plt-scheme --disable-mred --enable-xonx && make > both && make install-both > > The configure runs ok but the build failes with the output below, thanks for > the help. > > > > gcc -m32 -I./.. -I./../include -isysroot /Developer/SDKs/MacOSX10.5.sdk > -mmacosx-version-min=10.5 -DOS_X -D_DARWIN_UNLIMITED_SELECT -DXONX > -DNEWGC_BTC_ACCOUNT -Wall -I./.. -c ./gc2.c -o gc2.o > ar ruv ../libmzscheme3m.a salloc.o bignum.o bool.o builtin.o char.o > complex.o dynext.o env.o error.o eval.o file.o fun.o future.o hash.o jit.o > list.o module.o mzrt.o network.o numarith.o number.o numcomp.o numstr.o > places.o port.o portfun.o print.o rational.o read.o regexp.o sema.o > setjmpup.o string.o struct.o stxobj.o symbol.o syntax.o thread.o type.o > vector.o foreign.o ../src/gmp.o ../src/unwind.o > ../../foreign/gcc/libffi/src/*.o ../../foreign/gcc/libffi/src/*/*.o gc2.o > ar: creating archive ../libmzscheme3m.a > a - salloc.o > a - bignum.o > a - bool.o > a - builtin.o > a - char.o > a - complex.o > a - dynext.o > a - env.o > a - error.o > a - eval.o > a - file.o > a - fun.o > a - future.o > a - hash.o > a - jit.o > a - list.o > a - module.o > a - mzrt.o > a - network.o > a - numarith.o > a - number.o > a - numcomp.o > a - numstr.o > a - places.o > a - port.o > a - portfun.o > a - print.o > a - rational.o > a - read.o > a - regexp.o > a - sema.o > a - setjmpup.o > a - string.o > a - struct.o > a - stxobj.o > a - symbol.o > a - syntax.o > a - thread.o > a - type.o > a - vector.o > a - foreign.o > a - ../src/gmp.o > a - ../src/unwind.o > a - ../../foreign/gcc/libffi/src/closures.o > a - ../../foreign/gcc/libffi/src/debug.o > a - ../../foreign/gcc/libffi/src/java_raw_api.o > a - ../../foreign/gcc/libffi/src/prep_cif.o > a - ../../foreign/gcc/libffi/src/raw_api.o > a - ../../foreign/gcc/libffi/src/types.o > a - ../../foreign/gcc/libffi/src/x86/darwin.o > a - ../../foreign/gcc/libffi/src/x86/darwin64.o > a - ../../foreign/gcc/libffi/src/x86/ffi.o > a - ../../foreign/gcc/libffi/src/x86/ffi64.o > a - gc2.o > /usr/bin/ranlib: file: ../libmzscheme3m.a(future.o) has no symbols > /usr/bin/ranlib: file: ../libmzscheme3m.a(mzrt.o) has no symbols > /usr/bin/ranlib: file: ../libmzscheme3m.a(unwind.o) has no symbols > /usr/bin/ranlib: file: ../libmzscheme3m.a(darwin64.o) has no symbols > /usr/bin/ranlib: file: ../libmzscheme3m.a(ffi64.o) has no symbols > ranlib ../libmzscheme3m.a > ranlib: file: ../libmzscheme3m.a(future.o) has no symbols > ranlib: file: ../libmzscheme3m.a(mzrt.o) has no symbols > ranlib: file: ../libmzscheme3m.a(unwind.o) has no symbols > ranlib: file: ../libmzscheme3m.a(darwin64.o) has no symbols > ranlib: file: ../libmzscheme3m.a(ffi64.o) has no symbols > cd ..; gcc -m32 -o mzscheme3m gc2/main.o libmzscheme3m.a -isysroot > /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -ldl -lm -liconv > Undefined symbols: > "_fopen$UNIX2003", referenced from: > _copy_file in libmzscheme3m.a(file.o) > _copy_file in libmzscheme3m.a(file.o) > ld: symbol(s) not found > collect2: ld returned 1 exit status > make[4]: *** [../mzscheme3m] Error 1 > make[3]: *** [all] Error 2 > make[2]: *** [3m] Error 2 > make[1]: *** [3m] Error 2 > make: *** [both] Error 2 > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme _________________________________________________ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users From jos.koot at telefonica.net Fri Jun 4 23:47:22 2010 From: jos.koot at telefonica.net (Jos Koot) Date: Sat, 5 Jun 2010 05:47:22 +0200 Subject: [racket] [plt-scheme] apply syntactically bound (was RE: [plt-bug] In-Reply-To: <20100604174050.334EC6500C6@mail-svr1.cs.utah.edu> References: <201006040924.o549O2xf005075@champlain.ccs.neu.edu><20100604122727.471866500EA@mail-svr1.cs.utah.edu><84FD0771B4C4484D934CE1CC5B85F246@JacobPC><20100604152907.6956B6500FE@mail-svr1.cs.utah.edu><91AAC9E7D2594E0DAA09F7DB28833011@JacobPC><2E3C338C1C354D469314108E40C15F6D@JacobPC><5AC6DD5359024BB2A9F3FBE0EC383BB3@JacobPC> <205E9B7879384874AA91DF8236D4B3FD@JacobPC> <20100604174050.334EC6500C6@mail-svr1.cs.utah.edu> Message-ID: Thanks for your extended explanation. Correct, 'apply' only behaves different with namespace-variable-value. For example: (procedure? apply) -> #t The macro stepper showed me what happens (apply / new-apply) Thanks again, it is perfectly clear now. Jos > -----Original Message----- > From: Matthew Flatt [mailto:mflatt at cs.utah.edu] > Sent: 04 June 2010 19:41 > To: Jos Koot > Cc: 'Sam Tobin-Hochstadt'; 'Carl Eastlund'; plt-scheme at list.cs.brown.edu > Subject: RE: [plt-scheme] apply syntactically bound (was RE: [plt-bug] > > At Fri, 4 Jun 2010 19:33:57 +0200, "Jos Koot" wrote: > > It seems to me that inclusion of identifier syntaxes introduces > > a little inconsistency between symbols having a syntactic binding or a > > simple variable binding. > > I think that `namespace-variable-binding' is likely the problem, in > that it exposes too much information. > > In contrast, if you use `dynamic-require' like > > (dynamic-require 'racket/base 'apply) > > then you don't have to know whether `apply' is bound as a variable or > as syntax. The `dynamic-require' function correctly hides the > difference. _________________________________________________ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users From keydana at gmx.de Sat Jun 5 02:33:06 2010 From: keydana at gmx.de (keydana at gmx.de) Date: Sat, 5 Jun 2010 08:33:06 +0200 Subject: [racket] Re: [plt-scheme] Re: Typed scheme: Cannot apply expression of type Procedure, since it is not a function type In-Reply-To: References: <20100604062452.2E11E402B6@qua.cs.brown.edu> Message-ID: <8A147445-41AD-4CAC-AF87-EE63D7BC7F03@gmx.de> >> > > While I admit to being bored of the category theory, I'm always happy > to have questions about Typed Scheme. > Glad to hear this :-; > What you really want to write is this: > > (define-struct: (ret args ...) Fun ((name : Symbol) (proc : (args ... > -> ret)) (args : (Listof Symbol)) (ret : Symbol))) yes, I think this would be it... But for this I've found a workaround now, thanks to Noel (although this workaround leads to some horrible code duplication I don't know how to avoid, in the line of (match o .......... ((struct AppFun (f o1 o2)) (let ((o1 (eval-operand t o1)) (o2 (eval-operand t o2))) (match o1 ((struct S (s1)) (match o2 ((struct S (s2)) (case f ((strapp) (make-S ((StrApp-p strapp) s1 s2))))) ((struct N (n)) (case f ((substr) (make-S ((Substr-p substr) s1 n)))))))) - I'm talking of the (Substr-p substr) and (StrApp-p strapp) , I would have this same code for extracting the function in every case... But the real reason why I'm thinking of "giving up" and switching to untyped scheme is another one - I'm totally stuck with type conversion problems as the "implemented language" has types itself. For starters, I have 2 types only, strings and numbers, which I define like this: (define-datatype Value (S ((s : String))) (N ((n : Real)))) Now the problem is, I want to apply scheme functions on them. The problem arises e.g. with scheme's substring, which expects an Exact-Nonnegative-Integer as the second argument. Now I can't manage to convert the Real I have to to an Exact-Nonnegative-Integer... or I don't see how. In untyped scheme, I think this should work: (inexact->exact (truncate n)) but in typed it gives me an Exact-Rational and I can't get on further. Is there a solution for this? Also I think I will incur more difficulties of this kind if I go on... when integrating other functions. This in general is what I meant by "it might get too complicated to use typed scheme when having to implement types yourself" (even in a very simplified manner). Ciao Sigrid _________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-scheme _________________________________________________ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users From keydana at gmx.de Sat Jun 5 02:44:23 2010 From: keydana at gmx.de (keydana at gmx.de) Date: Sat, 5 Jun 2010 08:44:23 +0200 Subject: [racket] Re: [plt-scheme] Re: Typed scheme: Cannot apply expression of type Procedure, since it is not a function type In-Reply-To: References: <20100604062452.2E11E402B6@qua.cs.brown.edu> Message-ID: <921B0869-9D6E-44B8-9468-FF4880E3D750@gmx.de> >> > > Products are Ands are tuples. E.g. int * bool -- an integer and a boolean > Sums are Ors are discrimintaed unions. E.g. Foo | Bar > Duals informally means you can map concepts in one domain directly > into the other so products and sums would be isomorphic? Then sums would be some kind of "compressed representation" in a way, allowing me to express the same thing in a shorter/easier way? > > I don't have a good explanation for this, but I think sums and > products as axes in 2D, and having the two allows you to escape the > constraints of one axis. This sounds interesting. What kinds of constraints are these - or perhaps a quicker-to-answer question: where's this subject treated in mathematics (haven't read anything about it in my precious "Abstract Algebra" :-;)? _________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-scheme _________________________________________________ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users From samth at ccs.neu.edu Sat Jun 5 06:44:22 2010 From: samth at ccs.neu.edu (Sam Tobin-Hochstadt) Date: Sat, 5 Jun 2010 06:44:22 -0400 Subject: [racket] Re: [plt-scheme] Re: Typed scheme: Cannot apply expression of type Procedure, since it is not a function type In-Reply-To: <8A147445-41AD-4CAC-AF87-EE63D7BC7F03@gmx.de> References: <20100604062452.2E11E402B6@qua.cs.brown.edu> <8A147445-41AD-4CAC-AF87-EE63D7BC7F03@gmx.de> Message-ID: On Sat, Jun 5, 2010 at 2:33 AM, keydana at gmx.de wrote: > I think this should work: > > (inexact->exact (truncate n)) > > but in typed it gives me an Exact-Rational and I can't get on further. Is there a solution for this? Try the other way around: (truncate (inexact->exact n)) You have to do it this way because Typed Scheme doesn't know anything about the internal structure of the Float type. -- sam th samth at ccs.neu.edu _________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-scheme _________________________________________________ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users From pocmatos at gmail.com Sat Jun 5 07:01:42 2010 From: pocmatos at gmail.com (Paulo J. Matos) Date: Sat, 05 Jun 2010 12:01:42 +0100 Subject: [racket] Transparent Structures in 4.2.1 Message-ID: <84zkz93fqh.fsf@gmail.com> Hello all, I am generating code for a unit, which is later then loaded and evaluated. My current approach is to convert all structures into a 'personally designed' sexpr and then when loaded, the unit converts the sexpr back into structures. I have the feeling that there is currently a better way to do this. I want basically to automatically serialise my structures and have the unit deserialise them. This would simplify greatly my software by removing my hand-coded serialisation implementation. I thought transparent structures were what I was looking for but after trying the following maybe they are not: ,---- | #lang scheme | | (define-struct xpto | (x y) | #:transparent) `---- ,---- | > (define x (make-xpto 1 2)) | > x | #(struct:xpto 1 2) | > (define y #(struct:xpto 1 2)) | > x | #(struct:xpto 1 2) | > y | #(struct:xpto 1 2) | > (xpto-x x) | 1 | > (xpto-x y) | . . xpto-x: expects argument of type ; given #(struct:xpto | 1 2) `---- So, what's the actual difference here? And how can I obtain the automatic serialisation/deserialisation that I need? Cheers, -- PMatos _________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-scheme _________________________________________________ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users From laurent.orseau at gmail.com Sat Jun 5 08:38:17 2010 From: laurent.orseau at gmail.com (Laurent) Date: Sat, 5 Jun 2010 14:38:17 +0200 Subject: [racket] Transparent Structures in 4.2.1 In-Reply-To: <84zkz93fqh.fsf@gmail.com> References: <84zkz93fqh.fsf@gmail.com> Message-ID: Hi, you are probably looking for this define-serializable-struct: http://docs.plt-scheme.org/reference/serialization.html?q=define-serializable-struct#%28form._%28%28lib._scheme/serialize..ss%29._define-serializable-struct%29%29 Transparent structures are not serializable as is (as explained in the docs). Prefabs can be though. HTH, Laurent On Sat, Jun 5, 2010 at 13:01, Paulo J. Matos wrote: > Hello all, > > I am generating code for a unit, which is later then loaded and > evaluated. My current approach is to convert all structures into a > 'personally designed' sexpr and then when loaded, the unit converts the > sexpr back into structures. > > I have the feeling that there is currently a better way to do this. I > want basically to automatically serialise my structures and have the > unit deserialise them. This would simplify greatly my software by > removing my hand-coded serialisation implementation. > > I thought transparent structures were what I was looking for but after > trying the following maybe they are not: > ,---- > | #lang scheme > | > | (define-struct xpto > | (x y) > | #:transparent) > `---- > > ,---- > | > (define x (make-xpto 1 2)) > | > x > | #(struct:xpto 1 2) > | > (define y #(struct:xpto 1 2)) > | > x > | #(struct:xpto 1 2) > | > y > | #(struct:xpto 1 2) > | > (xpto-x x) > | 1 > | > (xpto-x y) > | . . xpto-x: expects argument of type ; given #(struct:xpto > | 1 2) > `---- > > So, what's the actual difference here? And how can I obtain the > automatic serialisation/deserialisation that I need? > > Cheers, > > -- > PMatos > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users > _________________________________________________ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users From acowley at seas.upenn.edu Sat Jun 5 11:04:21 2010 From: acowley at seas.upenn.edu (Anthony Cowley) Date: Sat, 5 Jun 2010 11:04:21 -0400 Subject: [racket] [plt-scheme] Re: Typed scheme: Cannot apply expression of type Procedure, since it is not a function type In-Reply-To: <921B0869-9D6E-44B8-9468-FF4880E3D750@gmx.de> References: <20100604062452.2E11E402B6@qua.cs.brown.edu> <921B0869-9D6E-44B8-9468-FF4880E3D750@gmx.de> Message-ID: On Sat, Jun 5, 2010 at 2:44 AM, keydana at gmx.de wrote: > so products and sums would be isomorphic? No, dual means that the arrows are reversed. For a product, you have two projections: arrows from the product to its constituent parts. For a (binary) sum, you have two arrows injecting values into the sum. That is, a sum can be created either by providing a value on the left, or on the right. In practice, I think it is more helpful to think about functions that take these types as arguments. A function that takes a product of type A x B (written (a,b) in Haskell) will look like so, foo (x,y) = if x < 2 then y * 3 else y - 4 Note that both an A *and* a B are available to the function. Or, from the other direction, a caller must provide *both*. With sums, the key word is "either." A function on a sum type A | B must be defined if it is given an A, *or* if it is given a B. This is usually handled with pattern matching on type constructors, bar (Left x) = x + 2 bar (Right y) = 5 In these silly examples, A and B can be different numeric types, foo returns a B while bar returns an A. Anthony _________________________________________________ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/users From diggerrrrr at gmail.com Sat Jun 5 12:55:12 2010 From: diggerrrrr at gmail.com (Veer) Date: Sat, 5 Jun 2010 22:25:12 +0530 Subject: [racket] Stopping scheme object from being GCed Message-ID: How do i stop the scheme values being GCed Here is roughly what happens in two files given below: 1. binds two functions connect and emit 2. when connect is called with function as its argument , it is stored in global variable 3. when emit is called , it applies the function stored in the callback variable. 4. during next emit , the apply function does not get the correct scheme object/function. I am assuming that function is garbage collected , what is the correct way to do above? Thanks SCHEME FILE : #lang scheme (require "scheme_test.ss") (connect (lambda () (printf "ok\n"))) (emit) and in repl : > (emit) > (build-list 1000 (lambda (i) i)) > (emit) > procedure application: expected procedure, given: # (no arguments) C FILE : #define MZ_PRECISE_GC #include "escheme.h" void *callback ; void scheme_generic(void *data) { Scheme_Object* proc = (Scheme_Object *) data; scheme_apply(proc , 0 , NULL); } Scheme_Object* scheme_emit(int argc , Scheme_Object* argv[]) { scheme_generic(callback); return scheme_void; } Scheme_Object* scheme_connect(int argc , Scheme_Object* argv[]) { callback = argv[0]; return scheme_void; } Scheme_Object* scheme_initialize (Scheme_Env* env) { Scheme_Env* mod_env = NULL; callback = NULL; MZ_GC_DECL_REG(2); MZ_GC_VAR_IN_REG(0,env); MZ_GC_VAR_IN_REG(1,mod_env); MZ_GC_REG(); mod_env=scheme_primitive_module(scheme_intern_symbol("scheme_test"),env); scheme_add_global("connect" ,scheme_make_prim_w_arity(scheme_connect,"connect",1,1),mod_env); scheme_add_global("emit" ,scheme_make_prim_w_arity(scheme_emit,"emit",0,0),mod_env); scheme_finish_primitive_module(mod_env); MZ_GC_UNREG(); return scheme_void; } Scheme_Object* scheme_reload (Scheme_Env* env) { return scheme_initialize(env); } Scheme_Object* scheme_module_name (void) { return scheme_intern_symbol("scheme_test"); } From chust at web.de Sat Jun 5 13:26:35 2010 From: chust at web.de (Thomas Chust) Date: Sat, 5 Jun 2010 19:26:35 +0200 Subject: [racket] Stopping scheme object from being GCed In-Reply-To: References: Message-ID: 2010/6/5 Veer : > How do i stop the scheme values being GCed > [...] Hello, your C code doesn't register the global variable holding the callback procedure with the garbage collector, hence the garbage collector may not know that there is still a reference to the procedure left. You can register global variables with the precise garbage collector using the macro MZ_REGISTER_STATIC or the function scheme_register_static ( http://www.plt-racket.org/docs/html/inside/im_memoryalloc.html#(cpp._scheme_register_static) ). Ciao, Thomas -- When C++ is your hammer, every problem looks like your thumb. From diggerrrrr at gmail.com Sat Jun 5 14:07:09 2010 From: diggerrrrr at gmail.com (Veer) Date: Sat, 5 Jun 2010 23:37:09 +0530 Subject: [racket] Stopping scheme object from being GCed In-Reply-To: References: Message-ID: Thanks , it works now . I should have reread the memory allocation part before asking :) . On Sat, Jun 5, 2010 at 10:56 PM, Thomas Chust wrote: > 2010/6/5 Veer : >> How do i stop the scheme values being GCed >> [...] > > Hello, > > your C code doesn't register the global variable holding the callback > procedure with the garbage collector, hence the garbage collector may > not know that ?there is still a reference to the procedure left. > > You can register global variables with the precise garbage collector > using the macro MZ_REGISTER_STATIC or the function > scheme_register_static ( > http://www.plt-racket.org/docs/html/inside/im_memoryalloc.html#(cpp._scheme_register_static) > ). > > Ciao, > Thomas > > > -- > When C++ is your hammer, every problem looks like your thumb. > From keydana at gmx.de Sat Jun 5 16:18:50 2010 From: keydana at gmx.de (keydana at gmx.de) Date: Sat, 5 Jun 2010 22:18:50 +0200 Subject: [racket] Re: [plt-scheme] Re: Typed scheme: Cannot apply expression of type Procedure, since it is not a function type In-Reply-To: References: <20100604062452.2E11E402B6@qua.cs.brown.edu> <8A147445-41AD-4CAC-AF87-EE63D7BC7F03@gmx.de> Message-ID: <16D8B086-3F35-46CD-AE82-8D942081A383@gmx.de> > > Try the other way around: > > (truncate (inexact->exact n)) > > You have to do it this way because Typed Scheme doesn't know anything > about the internal structure of the Float type. I will, thanks! And if you really don't mind my frequent questions, I think I'll go on writing this code in typed scheme :-; Well in fact, there's something else that troubles me, having read the thread about, among others, the future support for typed scheme - it said something about there being, currently, enough graduate students to work on it... which makes me think "and afterwards"? The thing is, would it make sense to use typed scheme for something rather "permanent", that is to be put on Planet, maintained etc.? I'm playing with the thought of using this relational algebra code to implement Chris Date's "Tutorial D" database query language (or rather, some small subset of it). Of course I don't know if I'll manage (I'll have to see how easy or difficult the "parsing" part would be, I'll read the "languages" chapter in the guide for this),- but it would be good to know... Ciao, Sigrid -------------- next part -------------- An HTML attachment was scrubbed... URL: From noelwelsh at gmail.com Sat Jun 5 16:22:55 2010 From: noelwelsh at gmail.com (Noel Welsh) Date: Sat, 5 Jun 2010 21:22:55 +0100 Subject: [racket] [plt-scheme] Re: Typed scheme: Cannot apply expression of type Procedure, since it is not a function type In-Reply-To: <16D8B086-3F35-46CD-AE82-8D942081A383@gmx.de> References: <20100604062452.2E11E402B6@qua.cs.brown.edu> <8A147445-41AD-4CAC-AF87-EE63D7BC7F03@gmx.de> <16D8B086-3F35-46CD-AE82-8D942081A383@gmx.de> Message-ID: On Sat, Jun 5, 2010 at 9:18 PM, keydana at gmx.de wrote: > Well in fact, there's something else that troubles me, having read the > thread about, among others, the future support for typed scheme - it said > something about there being, currently, enough graduate students to work on > it... which makes me think "and afterwards"? One of those students has ~5 years left, so things are ok for a decent chunk of time. The more TS gets used, the stronger the incentive to maintain it methinks. N. From samth at ccs.neu.edu Sat Jun 5 20:36:03 2010 From: samth at ccs.neu.edu (Sam Tobin-Hochstadt) Date: Sat, 5 Jun 2010 20:36:03 -0400 Subject: [racket] Re: [plt-scheme] Re: Typed scheme: Cannot apply expression of type Procedure, since it is not a function type In-Reply-To: <16D8B086-3F35-46CD-AE82-8D942081A383@gmx.de> References: <20100604062452.2E11E402B6@qua.cs.brown.edu> <8A147445-41AD-4CAC-AF87-EE63D7BC7F03@gmx.de> <16D8B086-3F35-46CD-AE82-8D942081A383@gmx.de> Message-ID: On Sat, Jun 5, 2010 at 4:18 PM, keydana at gmx.de wrote: > Well in fact, there's something else that troubles me, having read the > thread about, among others, the future support for typed scheme - it said > something about there being, currently, enough graduate students to work on > it... which makes me think "and afterwards"? At the moment, our infrastructure is almost entirely maintained by academics of various varieties. Whether you think that makes it more or less likely to be maintained in the future is up to you, but I certainly don't plan on stopping work on Typed Scheme. -- sam th samth at ccs.neu.edu From sbloch at adelphi.edu Sun Jun 6 03:04:18 2010 From: sbloch at adelphi.edu (Stephen Bloch) Date: Sun, 06 Jun 2010 00:04:18 -0700 Subject: [racket] how does PLaneT work? Message-ID: <38B05BE1-351F-4881-B6DB-5603AFB2E3F4@adelphi.edu> In particular, how does it decide what version of a package to serve? My guess would have been that it finds the most recent version which meets two criteria: a) its major version number is the same as that requested (if any), and b) its required core version number is <= the version of the DrScheme that's requesting it. But I just typed (require (planet sbloch/picturing-programs:2)) and it gave me version 2.0, even though there is a version 2.1 with the same required-core-version, which I can get by specifically requesting it: (require (planet sbloch/picturing-programs:2:1)) Stephen Bloch sbloch at adelphi.edu From pocmatos at gmail.com Sun Jun 6 06:29:56 2010 From: pocmatos at gmail.com (Paulo J. Matos) Date: Sun, 06 Jun 2010 11:29:56 +0100 Subject: [racket] Transparent Structures in 4.2.1 In-Reply-To: (Laurent's message of "Sat, 5 Jun 2010 14:38:17 +0200") References: <84zkz93fqh.fsf@gmail.com> Message-ID: <844ohgwj17.fsf@gmail.com> Laurent writes: > Hi, > you are probably looking for this define-serializable-struct: > > http://docs.plt-scheme.org/reference/serialization.html?q=define-serializable-struct#%28form._%28%28lib._scheme/serialize..ss%29._define-serializable-struct%29%29 > > Transparent structures are not serializable as is (as explained in the > docs). > Prefabs can be though. > Thanks for the reference on define-serializable-struct. -- PMatos From pocmatos at gmail.com Sun Jun 6 07:19:54 2010 From: pocmatos at gmail.com (Paulo J. Matos) Date: Sun, 06 Jun 2010 12:19:54 +0100 Subject: [racket] Serializable Structs and Contracts Message-ID: <84vd9wv25h.fsf@gmail.com> After playing a bit with serializable structs I just noticed that the usual contract on structs doesn't work: ,---- | (define-serializable-struct point | (x y)) | | (provide/contract | [struct point ((x number?) (y number?))]) `---- generates: ,---- | provide/contract: expected a struct name in: point `---- Oh no! :-( Any way to have contracts over serializable structs? Looking at the docs didn't provide much help. I am running 4.2.1. If nothing is implemented for this version, do new versions support contracts for serializable-structs? Cheers, -- PMatos From robby at eecs.northwestern.edu Sun Jun 6 07:49:16 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Sun, 6 Jun 2010 06:49:16 -0500 Subject: [racket] how does PLaneT work? In-Reply-To: <38B05BE1-351F-4881-B6DB-5603AFB2E3F4@adelphi.edu> References: <38B05BE1-351F-4881-B6DB-5603AFB2E3F4@adelphi.edu> Message-ID: That's how it works, yes, if you are typing the require at the REPL. If you do the require from some specific file and that file had gotten version 2.0 before, then that file will continue to get version 2.0 (unless you issue "raco planet clearlinks"). For more about this, please see chapter 2 in the planet manual (or if it isn't clear, I'll try to clarify it). Robby On Sun, Jun 6, 2010 at 2:04 AM, Stephen Bloch wrote: > In particular, how does it decide what version of a package to serve? > > My guess would have been that it finds the most recent version which meets two criteria: > a) its major version number is the same as that requested (if any), and > b) its required core version number is <= the version of the DrScheme that's requesting it. > > But I just typed > (require (planet sbloch/picturing-programs:2)) > and it gave me version 2.0, even though there is a version 2.1 with the same required-core-version, which I can get by specifically requesting it: > (require (planet sbloch/picturing-programs:2:1)) > > > Stephen Bloch > sbloch at adelphi.edu > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > From sbloch at adelphi.edu Sun Jun 6 10:37:54 2010 From: sbloch at adelphi.edu (Stephen Bloch) Date: Sun, 06 Jun 2010 07:37:54 -0700 Subject: [racket] how does PLaneT work? In-Reply-To: References: <38B05BE1-351F-4881-B6DB-5603AFB2E3F4@adelphi.edu> Message-ID: <2856C8B3-8185-4E94-BA4E-77A2CD9F1B21@adelphi.edu> On Jun 6, 2010, at 4:49 AM, Robby Findler wrote: > That's how it works, yes, if you are typing the require at the REPL. But that's what I just did, and it didn't. >> I just typed >> (require (planet sbloch/picturing-programs:2)) >> and it gave me version 2.0, even though there is a version 2.1 with the same required-core-version, which I can get by specifically requesting it: >> (require (planet sbloch/picturing-programs:2:1)) This was in the Interactions pane of DrScheme. Stephen Bloch sbloch at adelphi.edu From keydana at gmx.de Sun Jun 6 11:46:18 2010 From: keydana at gmx.de (keydana at gmx.de) Date: Sun, 6 Jun 2010 17:46:18 +0200 Subject: [racket] Re: [plt-scheme] Re: Typed scheme: Cannot apply expression of type Procedure, since it is not a function type In-Reply-To: References: <20100604062452.2E11E402B6@qua.cs.brown.edu> <8A147445-41AD-4CAC-AF87-EE63D7BC7F03@gmx.de> <16D8B086-3F35-46CD-AE82-8D942081A383@gmx.de> Message-ID: thanks for your replies, that's very nice to hear :-) then I'll certainly go on bothering you with my questions :-; Am 06.06.2010 um 02:36 schrieb Sam Tobin-Hochstadt: > On Sat, Jun 5, 2010 at 4:18 PM, keydana at gmx.de wrote: >> Well in fact, there's something else that troubles me, having read the >> thread about, among others, the future support for typed scheme - it said >> something about there being, currently, enough graduate students to work on >> it... which makes me think "and afterwards"? > > At the moment, our infrastructure is almost entirely maintained by > academics of various varieties. Whether you think that makes it more > or less likely to be maintained in the future is up to you, but I > certainly don't plan on stopping work on Typed Scheme. > -- > sam th > samth at ccs.neu.edu From robby at eecs.northwestern.edu Sun Jun 6 14:51:59 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Sun, 6 Jun 2010 13:51:59 -0500 Subject: [racket] how does PLaneT work? In-Reply-To: <2856C8B3-8185-4E94-BA4E-77A2CD9F1B21@adelphi.edu> References: <38B05BE1-351F-4881-B6DB-5603AFB2E3F4@adelphi.edu> <2856C8B3-8185-4E94-BA4E-77A2CD9F1B21@adelphi.edu> Message-ID: On Sun, Jun 6, 2010 at 9:37 AM, Stephen Bloch wrote: > > On Jun 6, 2010, at 4:49 AM, Robby Findler wrote: > >> That's how it works, yes, if you are typing the require at the REPL. > > But that's what I just did, and it didn't. Hm. It did for me. Here's what I did from the prompt before sending my previous message: [robby at robby-laptop] ~/git/exp/plt/src/build$ racket Welcome to Racket v5.0.0.1. > (require (planet sbloch/picturing-programs:2)) Wrote file "picturing-programs.ss" to installed-teachpacks directory > [robby at robby-laptop] ~/git/exp/plt/src/build$ [robby at robby-laptop] ~/git/exp/plt/src/build$ raco planet show Normally-installed packages: sbloch picturing-programs.plt 2 1 > This was in the Interactions pane of DrScheme. I just tried it that way (after deleting my planet cache) and it is also installing version (2 1). Maybe if you send the log it would help illuminate the difference (you can click "show log" in the bar at the bottom that shows planet's progress in DrRacket). Robby From noelwelsh at gmail.com Sun Jun 6 15:52:11 2010 From: noelwelsh at gmail.com (Noel Welsh) Date: Sun, 6 Jun 2010 20:52:11 +0100 Subject: [racket] Re: [plt-scheme] Re: Typed scheme: Cannot apply expression of type Procedure, since it is not a function type In-Reply-To: <921B0869-9D6E-44B8-9468-FF4880E3D750@gmx.de> References: <20100604062452.2E11E402B6@qua.cs.brown.edu> <921B0869-9D6E-44B8-9468-FF4880E3D750@gmx.de> Message-ID: On Sat, Jun 5, 2010 at 7:44 AM, keydana at gmx.de wrote: > I don't have a good explanation for this, but I think [of] sums and > products as axes in 2D, and having the two allows you to escape the > constraints of one axis. > > > This sounds interesting. What kinds of constraints are these - or perhaps a > quicker-to-answer question: where's this subject treated in mathematics > (haven't read anything about it in my precious "Abstract Algebra" :-;)? I don't have a ref for this, as this is just an intuitive model I use. The constraints for sums and products are pretty straightforward: they are or and and respectively and everything follows from that. An example from machine learning, in case you have any experience there: any linear program (in the optimisation sense) has a dual. The dual is often easier to solve and this is one of the tricks used in support vector machines IIRC. Wikipedia has the details; I don't recall them all now. HTH, N From pocmatos at gmail.com Sun Jun 6 16:22:31 2010 From: pocmatos at gmail.com (Paulo J. Matos) Date: Sun, 06 Jun 2010 21:22:31 +0100 Subject: [racket] Re: Serializable Structs and Contracts In-Reply-To: <84vd9wv25h.fsf@gmail.com> (Paulo J. Matos's message of "Sun, 06 Jun 2010 12:19:54 +0100") References: <84vd9wv25h.fsf@gmail.com> Message-ID: <84631vvrlk.fsf@gmail.com> It seems this is a bug. Lead to this conclusion after inspecting snooze source code. Bug was reported as: 10963 Cheers, Paulo Matos pocmatos at gmail.com (Paulo J. Matos) writes: > After playing a bit with serializable structs I just noticed that the > usual contract on structs doesn't work: > ,---- > | (define-serializable-struct point > | (x y)) > | > | (provide/contract > | [struct point ((x number?) (y number?))]) > `---- > > generates: > ,---- > | provide/contract: expected a struct name in: point > `---- > > Oh no! :-( > Any way to have contracts over serializable structs? Looking at the docs > didn't provide much help. I am running 4.2.1. If nothing is implemented > for this version, do new versions support contracts for > serializable-structs? > > Cheers, -- PMatos From pocmatos at gmail.com Sun Jun 6 16:40:15 2010 From: pocmatos at gmail.com (Paulo J. Matos) Date: Sun, 06 Jun 2010 21:40:15 +0100 Subject: [racket] Re: Serializable Structs and Contracts In-Reply-To: <84631vvrlk.fsf@gmail.com> (Paulo J. Matos's message of "Sun, 06 Jun 2010 21:22:31 +0100") References: <84vd9wv25h.fsf@gmail.com> <84631vvrlk.fsf@gmail.com> Message-ID: <84wrubuc7k.fsf@gmail.com> pocmatos at gmail.com (Paulo J. Matos) writes: > It seems this is a bug. Lead to this conclusion after inspecting snooze > source code. Bug was reported as: 10963 Opps, my misconception. Thought scheme == scheme/* but it is not. In this specific case problem is that scheme does not export scheme/serialize. -- PMatos From horace.dynamite at googlemail.com Mon Jun 7 11:33:54 2010 From: horace.dynamite at googlemail.com (Horace Dynamite) Date: Mon, 7 Jun 2010 16:33:54 +0100 Subject: [racket] Checking (on) queens | Concerns about HtDP exercise 28.2.4 Message-ID: Dear readers, After several false starts (mainly underestimating just how much computation is needed), I've managed to come to a solution for this exercise. For reasons I probably shouldn't mention, for the sake of other students, I believe I've found the solution the authors were looking for, but there are three concerns I have. The first concern is speed. I found a page on the Internet that claimed to be able to compute /all/ solutions to the case N=8 in less than 0 seconds[1]. The author of the page also claims his program beats the "world record" for speed, but here is the result for my program (and I'm using backtracking, so I bomb out as soon as I've found a solution; i.e. I don't generate them all.) (define test-board (build-board 8 (lambda (i j) false))) (time (placement 8 test-board)) cpu time: 23345 real time: 23408 gc time: 148 (list (list true false false false false false false false) (list false false false false false false true false) (list false false false false true false false false) (list false false false false false false false true) (list false true false false false false false false) (list false false false true false false false false) (list false false false false false true false false) (list false false true false false false false false)) And attempting the following computation, well, I've yet to have enough patience to wait long enough to see the result (which I know is false anyway!) (placement 9 test-board) zzzzzzzzzzzzzzzzz..... I figure my poor little design has to check all of 64C8 = 4426165368 configurations before it can finally draw breath and tell me the answer is false. But such a number seems so small for a computer :P I'm taking a stab in the dark here that most of the frequenters of this list have implemented such a solution. How does mine compare to yours? Is it so slow that perhaps I'm doing it all wrong? My second concern is the behavior in the case when the input board contains queens[2]. For (it seems anyway, see concern 3) N<=4, my design outputs the expected boards. That is, it will try to place however many queens you give it on a board that may itself contain queens. However, when (approx) N >= 7, the design outputs legitimate boards, in terms of N queens being placed (along with any initially on the board) and none of them in check from each other, but the positions of the original queens appear to have been shuffled! This is magic to me, because I see no way that my solution could be doing this :$. I realise this all very difficult to talk about without your being able to see my solution, but maybe others have noticed this with their solutions? Maybe my solution isn't so wrong? And finally, my third concern is testing. How am I to test with any assurance that I have a sane design? I've thought about generating lots of random boards, running placement over them, and then running a checker procedure over that to make sure none of the queens are in check. But thats hardly bullet proof either. How would the experienced designers test a procedure such as this? Thank you for your time, Horace. [1] This is the Internet site of the "world record breaking queens procedure", I have no idea how to use the program, but I found the discussion frightening : http://jsomers.com/nqueen_demo/nqueens.html [2] David Yreta has already brought this issue up with Matthias. The book does suggest the following contract for placement, ;; placement : N board -> board or false But Matthias tells us that the intended interpretation is that the input board /does not/ contain any queens. He admits the book is misleading. To me however, it seems that the only way to solve this problem is to keep checking for threats, so who cares if the input board contains queens? From eli at barzilay.org Mon Jun 7 14:13:23 2010 From: eli at barzilay.org (Eli Barzilay) Date: Mon, 07 Jun 2010 14:13:23 -0400 Subject: [racket] Racket v5.0 Message-ID: PLT is happy to announce the release of Racket, available from http://racket-lang.org/ With Racket, you can script command shells and web servers; you can quickly prototype animations and complex GUIs; regexps and threads are here to serve you. To organize your systems, you can mix and match classes, modules or components. Best of all, you start without writing down types. If you later wish to turn your script into a program, equip your Racket modules with explicit type declarations as you wish. And Racket doesn't just come as a typed variant; you can also write your modules in a purely functional and lazy dialect. Racket comes in so many flavors because Racket is much more than a standard scripting language or a plain programming language. Racket supports language extensibility to an unequaled degree. A Racket programmer knows that making up a new language is as easy as writing a new library. To help you start quickly, Racket includes batteries in all shapes and sizes, most importantly, extensive documentation and all kinds of libraries. Racket occupies a unique position between research and practice. It inherits many major ideas from language research, among them type safety (when the type system says that x is a number, then at runtime it always is a number) and memory safety (when some memory is reclaimed by the garbage collector it is impossible to still have a reference to it). At the same time, user demand governs rigid adherence to purely theoretical principles. Racket, formerly PLT Scheme, is a product of over 15 years of development. Although Racket starts with a mature software base and an established user community, its new name reflects our view that this is just the beginning of Racket's evolution. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From eli at barzilay.org Mon Jun 7 14:44:36 2010 From: eli at barzilay.org (Eli Barzilay) Date: Mon, 7 Jun 2010 14:44:36 -0400 Subject: [racket] Racket v5.0 In-Reply-To: <2FA50C89-DC73-491A-A873-4E389507655F@dcc.uchile.cl> References: <2FA50C89-DC73-491A-A873-4E389507655F@dcc.uchile.cl> Message-ID: <19469.15892.73302.855209@winooski.ccs.neu.edu> On Jun 7, Eric Tanter wrote: > Excellent news and congratulations to all of you! > > Is there a page somewhere where the motivations for changing name > are exposed? This is the #1 question that is going to appear once we > spread the word, so it would be nice to have a standard answer to > the question (and if it's written by Shriram, even better ;-)). There's a page ready for this: http://racket-lang.org/new-name.html -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From horace.dynamite at googlemail.com Mon Jun 7 15:14:02 2010 From: horace.dynamite at googlemail.com (Horace Dynamite) Date: Mon, 7 Jun 2010 20:14:02 +0100 Subject: [racket] Racket v5.0 In-Reply-To: <19469.15892.73302.855209@winooski.ccs.neu.edu> References: <2FA50C89-DC73-491A-A873-4E389507655F@dcc.uchile.cl> <19469.15892.73302.855209@winooski.ccs.neu.edu> Message-ID: > There's a page ready for this: http://racket-lang.org/new-name.html > > -- > ? ? ? ? ?((lambda (x) (x x)) (lambda (x) (x x))) ? ? ? ? ?Eli Barzilay: > ? ? ? ? ? ? ? ? ? ?http://barzilay.org/ ? ? ? ? ? ? ? ? ? Maze is Life! > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users There is a typo, ... How can I tell my department that we should teach with Racket instead of Scheme? They've never heard of Racket. ... Horace. From eli at barzilay.org Mon Jun 7 15:29:57 2010 From: eli at barzilay.org (Eli Barzilay) Date: Mon, 7 Jun 2010 15:29:57 -0400 Subject: [racket] Racket v5.0 In-Reply-To: References: <2FA50C89-DC73-491A-A873-4E389507655F@dcc.uchile.cl> <19469.15892.73302.855209@winooski.ccs.neu.edu> Message-ID: <19469.18613.47342.658419@winooski.ccs.neu.edu> On Jun 7, Horace Dynamite wrote: > > There's a page ready for this: http://racket-lang.org/new-name.html > > There is a typo, > > ... > How can I tell my department that we should teach with Racket > instead of Scheme? They've never heard of Racket. > ... Fixed, thanks. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From nadeem at acm.org Mon Jun 7 15:40:06 2010 From: nadeem at acm.org (Nadeem Abdul Hamid) Date: Mon, 7 Jun 2010 15:40:06 -0400 Subject: [racket] Racket v5.0 In-Reply-To: <19469.15892.73302.855209@winooski.ccs.neu.edu> References: <2FA50C89-DC73-491A-A873-4E389507655F@dcc.uchile.cl> <19469.15892.73302.855209@winooski.ccs.neu.edu> Message-ID: <8EC59E9C-6A93-4565-81AC-7A1C68735959@acm.org> On Jun 7, 2010, at 2:44 PM, Eli Barzilay wrote: > There's a page ready for this: http://racket-lang.org/new-name.html There should perhaps be a link on the racket-lang.org front page to this page, at least for the first several weeks. --- nadeem -------------- next part -------------- An HTML attachment was scrubbed... URL: From keydana at gmx.de Mon Jun 7 16:08:09 2010 From: keydana at gmx.de (keydana at gmx.de) Date: Mon, 7 Jun 2010 22:08:09 +0200 Subject: [racket] [plt-scheme] Re: Typed scheme: Cannot apply expression of type Procedure, since it is not a function type In-Reply-To: References: <20100604062452.2E11E402B6@qua.cs.brown.edu> <8A147445-41AD-4CAC-AF87-EE63D7BC7F03@gmx.de> Message-ID: > > Try the other way around: > > (truncate (inexact->exact n)) > Finally I've found the time to try this - but it gives me a Real (same with round): (truncate (inexact->exact 1.222)) - : Real 1 So I still have the typing error, the substring function insisting on an Integer... One general question... Having right now read through the "untyped" http://docs.racket-lang.org/reference/numbers.html page, which introduces the exact vs. inexact concept and the sets of numbers from mathematics as orthogonal, I'd be curious about how TS handles this in the type hierarchy? Also, in practice, think it'd be helpful to show the inclusion hierarchy for numeric types in the typed scheme reference... in fact I just realized that even in my ultra-simplistic representation, where I just want to have one "number" type (like the sql number type), I should think more about which one to use, whether it should be an exact or an inexact one... but I'm not really sure which possibilities there are for both options (e.g., I assume Number and Real are inexact, and Exact-Rational is the farthest I can get away from Integer with exact numbers? -- BTW, Exact-Rational is not in the docs, I just see it in drscheme). Thanks a lot as always, Sigrid From dvanhorn at ccs.neu.edu Mon Jun 7 16:18:30 2010 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Mon, 07 Jun 2010 16:18:30 -0400 Subject: [racket] [plt-scheme] Re: Typed scheme: Cannot apply expression of type Procedure, since it is not a function type In-Reply-To: References: <20100604062452.2E11E402B6@qua.cs.brown.edu> <8A147445-41AD-4CAC-AF87-EE63D7BC7F03@gmx.de> Message-ID: <4C0D5416.5000709@ccs.neu.edu> On 6/7/10 4:08 PM, keydana at gmx.de wrote: >> >> Try the other way around: >> >> (truncate (inexact->exact n)) >> > > > Finally I've found the time to try this - but it gives me a Real (same with round): > > (truncate (inexact->exact 1.222)) > - : Real > 1 > > So I still have the typing error, the substring function insisting on an Integer... > > One general question... > Having right now read through the "untyped" http://docs.racket-lang.org/reference/numbers.html page, which introduces the exact vs. inexact concept and the sets of numbers from mathematics as orthogonal, I'd be curious about how TS handles this in the type hierarchy? > > Also, in practice, think it'd be helpful to show the inclusion hierarchy for numeric types in the typed scheme reference... in fact I just realized that even in my ultra-simplistic representation, where I just want to have one "number" type (like the sql number type), I should think more about which one to use, whether it should be an exact or an inexact one... but I'm not really sure which possibilities there are for both options (e.g., I assume Number and Real are inexact, and Exact-Rational is the farthest I can get away from Integer with exact numbers? -- BTW, Exact-Rational is not in the docs, I just see it in drscheme). Sigrid, I know that Sam and Vincent are actively developing the numeric part of Typed Scheme, so truncate may already have the right type for you in the latest sources, but more generally I've found it's useful to insert casts when Typed Scheme cannot follow the programmer's reasoning. So here is one way to make your program work: (: cast (All (T) ((Any -> Boolean : T) Any -> T))) (define (cast p? x) (if (p? x) x (error "Cast failed"))) (cast exact-integer? (truncate n)) My backgammon package has some other examples of casts, too. David From dvanhorn at ccs.neu.edu Mon Jun 7 16:21:03 2010 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Mon, 07 Jun 2010 16:21:03 -0400 Subject: [racket] [plt-scheme] Re: Typed scheme: Cannot apply expression of type Procedure, since it is not a function type In-Reply-To: <4C0D5416.5000709@ccs.neu.edu> References: <20100604062452.2E11E402B6@qua.cs.brown.edu> <8A147445-41AD-4CAC-AF87-EE63D7BC7F03@gmx.de> <4C0D5416.5000709@ccs.neu.edu> Message-ID: <4C0D54AF.6080700@ccs.neu.edu> On 6/7/10 4:18 PM, David Van Horn wrote: > (cast exact-integer? (truncate n)) That should be (cast exact-integer? (inexact->exact (truncate n))), obviously. David From lumimies at gmail.com Mon Jun 7 17:37:25 2010 From: lumimies at gmail.com (Zohar Kelrich) Date: Tue, 8 Jun 2010 00:37:25 +0300 Subject: [racket] Racket v5.0 In-Reply-To: References: Message-ID: Part 12 of quick seems a bit confused - no one distinguishes or describes Racket as minimalist, these are all done to Scheme. On Mon, Jun 7, 2010 at 21:13, Eli Barzilay wrote: > PLT is happy to announce the release of Racket, available from > > http://racket-lang.org/ > > With Racket, you can script command shells and web servers; you can > quickly prototype animations and complex GUIs; regexps and threads > are here to serve you. To organize your systems, you can mix and > match classes, modules or components. Best of all, you start > without writing down types. If you later wish to turn your script > into a program, equip your Racket modules with explicit type > declarations as you wish. And Racket doesn't just come as a typed > variant; you can also write your modules in a purely functional and > lazy dialect. > > Racket comes in so many flavors because Racket is much more than a > standard scripting language or a plain programming language. Racket > supports language extensibility to an unequaled degree. A Racket > programmer knows that making up a new language is as easy as writing > a new library. > > To help you start quickly, Racket includes batteries in all shapes > and sizes, most importantly, extensive documentation and all kinds > of libraries. > > Racket occupies a unique position between research and practice. It > inherits many major ideas from language research, among them type > safety (when the type system says that x is a number, then at > runtime it always is a number) and memory safety (when some memory > is reclaimed by the garbage collector it is impossible to still have > a reference to it). At the same time, user demand governs rigid > adherence to purely theoretical principles. > > Racket, formerly PLT Scheme, is a product of over 15 years of > development. Although Racket starts with a mature software base and an > established user community, its new name reflects our view that this is > just the beginning of Racket's evolution. > > -- > ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: > http://barzilay.org/ Maze is Life! > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mflatt at cs.utah.edu Mon Jun 7 20:18:23 2010 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Mon, 7 Jun 2010 20:18:23 -0400 Subject: [racket] Racket v5.0 In-Reply-To: References: Message-ID: <20100608001825.7170C650111@mail-svr1.cs.utah.edu> At Tue, 8 Jun 2010 00:37:25 +0300, Zohar Kelrich wrote: > Part 12 of quick seems a bit confused - no one distinguishes or describes > Racket as minimalist, these are all done to Scheme. Thanks for pointing that out! Two of the "Racket"s should have stayed "Scheme". From noelwelsh at gmail.com Tue Jun 8 01:35:47 2010 From: noelwelsh at gmail.com (Noel Welsh) Date: Mon, 7 Jun 2010 22:35:47 -0700 Subject: [racket] [plt-scheme] Re: Typed scheme: Cannot apply expression of type Procedure, since it is not a function type In-Reply-To: References: <20100604062452.2E11E402B6@qua.cs.brown.edu> <8A147445-41AD-4CAC-AF87-EE63D7BC7F03@gmx.de> Message-ID: On Mon, Jun 7, 2010 at 1:08 PM, keydana at gmx.de wrote: > > Finally I've found the time to try this - but it gives me a Real (same with round): > > (truncate (inexact->exact 1.222)) > - : Real > 1 > > So I still have the typing error, the substring function insisting on an Integer... This file contains type conversion functions that I've used in my code: http://github.com/noelwelsh/bayesian-scan-matching/blob/master/util.ss HTH, N. From madokama at gmail.com Tue Jun 8 02:08:05 2010 From: madokama at gmail.com (Madoka Machitani) Date: Tue, 8 Jun 2010 15:08:05 +0900 Subject: [racket] Racket v5.0 In-Reply-To: <20100608001825.7170C650111@mail-svr1.cs.utah.edu> References: <20100608001825.7170C650111@mail-svr1.cs.utah.edu> Message-ID: Congrats to the official release of Racket!! That said, I think I have spotted a bug in the example program of the Racket website: #lang racket ; Simple web scraper (require net/url net/uri-codec) (define (let-me-google-that-for-you str) (let* ([g "http://www.google.com/search?q="] [u (string-append g (uri-encode str))] [rx #rx"(?<=

).*?(?=

)"]) (regexp-match* rx (get-pure-port (string->url g))))) The last occurence of `g' above has to be replaced with `u', right? Cheers, Madoka From eli at barzilay.org Tue Jun 8 02:22:01 2010 From: eli at barzilay.org (Eli Barzilay) Date: Tue, 8 Jun 2010 02:22:01 -0400 Subject: [racket] Racket v5.0 In-Reply-To: References: <20100608001825.7170C650111@mail-svr1.cs.utah.edu> Message-ID: <19469.57737.747709.44062@winooski.ccs.neu.edu> On Jun 8, Madoka Machitani wrote: > Congrats to the official release of Racket!! > > That said, I think I have spotted a bug in the example program of the > Racket website: > > #lang racket ; Simple web scraper > (require net/url net/uri-codec) > (define (let-me-google-that-for-you str) > (let* ([g "http://www.google.com/search?q="] > [u (string-append g (uri-encode str))] > [rx #rx"(?<=

).*?(?=

)"]) > (regexp-match* rx (get-pure-port (string->url g))))) > > The last occurence of `g' above has to be replaced with `u', right? You're right -- fixed. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From norman at astro.gla.ac.uk Tue Jun 8 05:08:52 2010 From: norman at astro.gla.ac.uk (Norman Gray) Date: Tue, 8 Jun 2010 10:08:52 +0100 Subject: [racket] Racket v5.0 In-Reply-To: <19469.15892.73302.855209@winooski.ccs.neu.edu> References: <2FA50C89-DC73-491A-A873-4E389507655F@dcc.uchile.cl> <19469.15892.73302.855209@winooski.ccs.neu.edu> Message-ID: <94702CC5-F70A-4C04-BF9D-8B52914F1C2F@astro.gla.ac.uk> Racketeers, greetings. On 2010 Jun 7, at 19:44, Eli Barzilay wrote: >> Is there a page somewhere where the motivations for changing name >> are exposed? This is the #1 question that is going to appear once we >> spread the word, so it would be nice to have a standard answer to >> the question (and if it's written by Shriram, even better ;-)). > > There's a page ready for this: http://racket-lang.org/new-name.html That's useful, thanks. However: * It's not obviously findable from the front page (I spent five minutes trying various possible routes to it, knowing it was there), which means that it won't be found by people who want that information, but who haven't seen this message. * A useful addition to that page would be 'what do I have to do to make the transition from PLT Scheme to being a first-class Racket programmer?' (as opposed to working in some sort of legacy support mode). From that page, the answer seems to be 'not very much', but if the transition is indeed as simple as: (1) edit '#lang scheme' to '#lang racket', (2) type 'racket' rather than 'mzscheme', (3) you're done; then it would be reassuring to make that wonderfully transparent (and well done). As Nadeem Abdul Hamid mentioned later in this thread, having it temporarily on the front page might be useful, because at least to start with, most of the folk going to that page will be PLT schemers. Perhaps put the link behind a picture of a grizzly old fart. All the best, Norman -- Norman Gray : http://nxg.me.uk From samth at ccs.neu.edu Tue Jun 8 08:19:22 2010 From: samth at ccs.neu.edu (Sam Tobin-Hochstadt) Date: Tue, 8 Jun 2010 08:19:22 -0400 Subject: [racket] [plt-scheme] Re: Typed scheme: Cannot apply expression of type Procedure, since it is not a function type In-Reply-To: References: <20100604062452.2E11E402B6@qua.cs.brown.edu> <8A147445-41AD-4CAC-AF87-EE63D7BC7F03@gmx.de> Message-ID: On Mon, Jun 7, 2010 at 4:08 PM, keydana at gmx.de wrote: >> >> Try the other way around: >> >> (truncate (inexact->exact n)) >> > > > Finally I've found the time to try this - but it gives me a Real (same with round): > > (truncate (inexact->exact 1.222)) > - : Real > 1 If you use the now-released 5.0, this should work. > One general question... > Having right now read through the "untyped" http://docs.racket-lang.org/reference/numbers.html page, which introduces the exact vs. inexact concept and the sets of numbers from mathematics as orthogonal, I'd be curious about how TS handles this in the type hierarchy? > > Also, in practice, ?think it'd be helpful to show the inclusion hierarchy for numeric types in the typed scheme reference... We plan to add this to the docs. > in fact I just realized that even in my ultra-simplistic representation, where I just want to have one "number" type (like the sql number type), I should think more about which one to use, whether it should be an exact or an inexact one... but I'm not really sure which possibilities there are for both options (e.g., I assume Number and Real are inexact, and Exact-Rational is the farthest I can get away from Integer with exact numbers? -- BTW, Exact-Rational is not in the docs, I just see it in drscheme). I'll fix that. -- sam th samth at ccs.neu.edu From stepnem at gmail.com Tue Jun 8 08:22:39 2010 From: stepnem at gmail.com (=?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?=) Date: Tue, 08 Jun 2010 14:22:39 +0200 Subject: [racket] DrScheme macro stepper ignoring color settings? References: <87k4qfdl8k.fsf@gmail.com> Message-ID: <87ocflogs0.fsf@gmail.com> ?t?p?n N?mec writes: > Hello, > > although I've set dark background and it works in DrScheme's interaction > and definition windows, the macro stepper seems to ignore the settings > (i.e. it's still black text on white background); is this a known issue > (or even the intended behaviour)? I don't see any macro-stepper-specific > settings... > > I'm using the PLT 4.2.5 Debian installer downloaded from the website. > > Best regards, > > ?t?p?n PING Anything unclear? Any better place to whine about/report (what seems to me to be) PLT bugs? From robby at eecs.northwestern.edu Tue Jun 8 09:12:47 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Tue, 8 Jun 2010 08:12:47 -0500 Subject: [racket] DrScheme macro stepper ignoring color settings? In-Reply-To: <87ocflogs0.fsf@gmail.com> References: <87k4qfdl8k.fsf@gmail.com> <87ocflogs0.fsf@gmail.com> Message-ID: The best form of whining would be, of course, a patch. :) But if you want to file a bug report, there is a bug menu item. Robby On Tue, Jun 8, 2010 at 7:22 AM, ?t?p?n N?mec wrote: > ?t?p?n N?mec writes: > >> Hello, >> >> although I've set dark background and it works in DrScheme's interaction >> and definition windows, the macro stepper seems to ignore the settings >> (i.e. it's still black text on white background); is this a known issue >> (or even the intended behaviour)? I don't see any macro-stepper-specific >> settings... >> >> I'm using the PLT 4.2.5 Debian installer downloaded from the website. >> >> Best regards, >> >> ?t?p?n > > PING > > Anything unclear? Any better place to whine about/report (what seems to > me to be) PLT bugs? > > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users From matthias at ccs.neu.edu Tue Jun 8 09:29:27 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Tue, 8 Jun 2010 09:29:27 -0400 Subject: [racket] DrScheme macro stepper ignoring color settings? In-Reply-To: References: <87k4qfdl8k.fsf@gmail.com> <87ocflogs0.fsf@gmail.com> Message-ID: This is the proper place to whine and management apologizes on behalf of an absent-minded post-doc. (In this day and age, it is the younger people who suffer from memory lapses.) On Jun 8, 2010, at 9:12 AM, Robby Findler wrote: > The best form of whining would be, of course, a patch. :) > > But if you want to file a bug report, there is a bug menu item. > > Robby > > On Tue, Jun 8, 2010 at 7:22 AM, ?t?p?n N?mec > wrote: >> ?t?p?n N?mec writes: >> >>> Hello, >>> >>> although I've set dark background and it works in DrScheme's >>> interaction >>> and definition windows, the macro stepper seems to ignore the >>> settings >>> (i.e. it's still black text on white background); is this a known >>> issue >>> (or even the intended behaviour)? I don't see any macro-stepper- >>> specific >>> settings... >>> >>> I'm using the PLT 4.2.5 Debian installer downloaded from the >>> website. >>> >>> Best regards, >>> >>> ?t?p?n >> >> PING >> >> Anything unclear? Any better place to whine about/report (what >> seems to >> me to be) PLT bugs? >> >> _________________________________________________ >> For list-related administrative tasks: >> http://lists.racket-lang.org/listinfo/users > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From robby at eecs.northwestern.edu Tue Jun 8 09:32:14 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Tue, 8 Jun 2010 08:32:14 -0500 Subject: [racket] DrScheme macro stepper ignoring color settings? In-Reply-To: References: <87k4qfdl8k.fsf@gmail.com> <87ocflogs0.fsf@gmail.com> Message-ID: Said postdoc is kindly helping me debug a performance problem with the planet db, so I'll try to take a look at this today. :) Robby On Tue, Jun 8, 2010 at 8:29 AM, Matthias Felleisen wrote: > > > This is the proper place to whine and management apologizes > on behalf of an absent-minded post-doc. (In this day and age, > it is the younger people who suffer from memory lapses.) > > > On Jun 8, 2010, at 9:12 AM, Robby Findler wrote: > >> The best form of whining would be, of course, a patch. :) >> >> But if you want to file a bug report, there is a bug menu item. >> >> Robby >> >> On Tue, Jun 8, 2010 at 7:22 AM, ?t?p?n N?mec wrote: >>> >>> ?t?p?n N?mec writes: >>> >>>> Hello, >>>> >>>> although I've set dark background and it works in DrScheme's interaction >>>> and definition windows, the macro stepper seems to ignore the settings >>>> (i.e. it's still black text on white background); is this a known issue >>>> (or even the intended behaviour)? I don't see any macro-stepper-specific >>>> settings... >>>> >>>> I'm using the PLT 4.2.5 Debian installer downloaded from the website. >>>> >>>> Best regards, >>>> >>>> ?t?p?n >>> >>> PING >>> >>> Anything unclear? Any better place to whine about/report (what seems to >>> me to be) PLT bugs? >>> >>> _________________________________________________ >>> ?For list-related administrative tasks: >>> ?http://lists.racket-lang.org/listinfo/users >> >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://lists.racket-lang.org/listinfo/users > > From matthias at ccs.neu.edu Tue Jun 8 10:13:22 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Tue, 8 Jun 2010 10:13:22 -0400 Subject: [racket] Checking (on) queens | Concerns about HtDP exercise 28.2.4 In-Reply-To: References: Message-ID: On Jun 7, 2010, at 11:33 AM, Horace Dynamite wrote: > The first concern is speed. The book is not about designing the fastest possible N queens program. It's been years (decade?) since I ran this problem but on my old sun3 it didn't take very long to solve the problem. > My second concern is the behavior in the case when the input board > contains queens[2]. As I said in a private email, this is an instance of an accumulator design and I am jumping the gun here with this hint. The key is that the board must satisfy the constraint that neither of its queens may threaten another one. An empty board obviously satisfies this one. Design a function that checks whether some given board is a valid board. > And finally, my third concern is testing. How am I to test with any > assurance that I have a sane design? You need to figure out how to test the auxiliary functions in your project. When/if I have time today, I'll write a solution. -- Matthias From robby at eecs.northwestern.edu Tue Jun 8 10:25:35 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Tue, 8 Jun 2010 09:25:35 -0500 Subject: [racket] Racket v5.0 In-Reply-To: <94702CC5-F70A-4C04-BF9D-8B52914F1C2F@astro.gla.ac.uk> References: <2FA50C89-DC73-491A-A873-4E389507655F@dcc.uchile.cl> <19469.15892.73302.855209@winooski.ccs.neu.edu> <94702CC5-F70A-4C04-BF9D-8B52914F1C2F@astro.gla.ac.uk> Message-ID: On Tue, Jun 8, 2010 at 4:08 AM, Norman Gray wrote: > ?* A useful addition to that page would be 'what do I have to do to make the transition from PLT Scheme to being a first-class Racket programmer?' (as opposed to working in some sort of legacy support mode). ?From that page, the answer seems to be 'not very much', but if the transition is indeed as simple as: (1) edit '#lang scheme' to '#lang racket', (2) type 'racket' rather than 'mzscheme', (3) you're done; then it would be reassuring to make that wonderfully transparent (and well done). You can do just that, or you can do arbitrarily more. Our goal is to keep old programs working and, of course, to call people who use those old programs Racketeers. :) The more? You can do things like you suggest above or, even better, start building your own languages. Robby From toddobryan at gmail.com Tue Jun 8 11:31:20 2010 From: toddobryan at gmail.com (Todd O'Bryan) Date: Tue, 8 Jun 2010 11:31:20 -0400 Subject: [racket] How do I quote a syntax object for runtime binding? Message-ID: I have a syntax object that looks something like this: ((key val) (key2 val2)) I need access to the literal values both at compile and run-time. At compile time is easy: (define-syntax info 'syntax-object) saves the quoted form into info, which I can use as a transformer binding. Unfortunately, I can't figure out how to write something that will expand into (define runtime-info '((key val) (key2 val2))) because I think it's trying to evaluate key and val rather than just hanging on to them. Assuming that, in the macro's expansion, (define-syntax info 'syntax-object) correctly defines info to be '((key val) (key2 val2)) at compile time, what do I write so that runtime-info will be defined as '((key val) (key2 val2)) at runtime? Thanks, Todd From ryanc at ccs.neu.edu Tue Jun 8 13:08:19 2010 From: ryanc at ccs.neu.edu (Ryan Culpepper) Date: Tue, 08 Jun 2010 11:08:19 -0600 Subject: [racket] DrScheme macro stepper ignoring color settings? In-Reply-To: <87ocflogs0.fsf@gmail.com> References: <87k4qfdl8k.fsf@gmail.com> <87ocflogs0.fsf@gmail.com> Message-ID: <4C0E7903.2070109@ccs.neu.edu> ?t?p?n N?mec wrote: > ?t?p?n N?mec writes: > >> Hello, >> >> although I've set dark background and it works in DrScheme's interaction >> and definition windows, the macro stepper seems to ignore the settings >> (i.e. it's still black text on white background); is this a known issue >> (or even the intended behaviour)? I don't see any macro-stepper-specific >> settings... >> >> I'm using the PLT 4.2.5 Debian installer downloaded from the website. >> >> Best regards, >> >> ?t?p?n > > PING > > Anything unclear? Any better place to whine about/report (what seems to > me to be) PLT bugs? This is the right place. I apologize for not responding sooner. Robby has just checked in a fix to make the macro stepper respect DrScheme's setting (thanks Robby!), but the macro stepper uses text colors other than black to convey information, and some of those are likely to look odd or be unreadable against a black background. I'll see what I can do about the colors and post again. Ryan From norman at astro.gla.ac.uk Tue Jun 8 12:04:19 2010 From: norman at astro.gla.ac.uk (Norman Gray) Date: Tue, 8 Jun 2010 17:04:19 +0100 Subject: [racket] Racket v5.0 In-Reply-To: References: <2FA50C89-DC73-491A-A873-4E389507655F@dcc.uchile.cl> <19469.15892.73302.855209@winooski.ccs.neu.edu> <94702CC5-F70A-4C04-BF9D-8B52914F1C2F@astro.gla.ac.uk> Message-ID: Robbie, hello. On 2010 Jun 8, at 15:25, Robby Findler wrote: > On Tue, Jun 8, 2010 at 4:08 AM, Norman Gray wrote: >> * A useful addition to that page would be 'what do I have to do to make the transition from PLT Scheme to being a first-class Racket programmer?' (as opposed to working in some sort of legacy support mode). From that page, the answer seems to be 'not very much', but if the transition is indeed as simple as: (1) edit '#lang scheme' to '#lang racket', (2) type 'racket' rather than 'mzscheme', (3) you're done; then it would be reassuring to make that wonderfully transparent (and well done). > > You can do just that, or you can do arbitrarily more. With PLT-Scheme^WRacket, there's always more beyond... I suppose I was meaning one or other of: * are there quick headlines of what's actually changed (is Racket just PLT Scheme v5.0 plus a name change plus plans for world domination?; or * If I carry on using #lang scheme with my shiny new racket executable, am I going to be like one of those "manuals? who needs 'em?" refuseniks who still writes \documentstyle and is kept going by heroic backward-compatibility efforts on the part of the system developers? ---- Y'know, the real thing to do is just to damn well _try_ it... <20 minutes passes> ...I've just 'converted' a C extension, and a program using it, to Racket. Doing so consisted of s/#lang scheme/#lang racket/, s/mzscheme/racket/, and s/mzc/raco ctool/ . Well. Emmm. That was ... easy. I'm not sure what to say. Well done? While a 'what's changed' section might still be useful on the documentation page, for reassurance purposes, it certainly doesn't look like a long section. I'm sure some eq?/eqv?/equal? gag could be worked up there. Nice work. All the best, Norman -- Norman Gray : http://nxg.me.uk From curtdutt at gmail.com Tue Jun 8 14:47:28 2010 From: curtdutt at gmail.com (Curtis Dutton) Date: Tue, 8 Jun 2010 14:47:28 -0400 Subject: [racket] Format Bug Message-ID: Just found a quick little bug with format where it behaves differently than printf. It appears to treat values formatted through "~v" as if "~a" was specified. I've only tested this for exact fractional numbers like 11 5/16 so I'm not sure if this happens with other such values. For instance: (printf "~a~n" (+ 11 (/ 5 16))) > 181/16 (printf "~v~n" (+ 11 (/ 5 16))) > 11 5/16 now format does not behave exactly this way... (format "~a~n" (+ 11 (/ 5 16))) > "181/16\n" (format "~v~n" (+ 11 (/ 5 16))) > "181/16\n" Is this expected behavior? Thanks, Curtis -------------- next part -------------- An HTML attachment was scrubbed... URL: From cce at racket-lang.org Tue Jun 8 15:09:02 2010 From: cce at racket-lang.org (Carl Eastlund) Date: Tue, 8 Jun 2010 15:09:02 -0400 Subject: [racket] Format Bug In-Reply-To: References: Message-ID: On Tue, Jun 8, 2010 at 2:47 PM, Curtis Dutton wrote: > Just found a quick little bug with format where it behaves differently than > printf. > It appears to treat values formatted through "~v" as if "~a" was specified. > I've only tested this for exact fractional numbers like 11 5/16 so I'm not > sure if this happens with other such values. > For instance: > (printf "~a~n" (+ 11 (/ 5 16))) >> 181/16 > (printf "~v~n" (+ 11 (/ 5 16))) >> 11 5/16 > now format does not behave exactly this way... > (format "~a~n" (+ 11 (/ 5 16))) >> "181/16\n" > (format "~v~n" (+ 11 (/ 5 16))) >> "181/16\n" > Is this expected behavior? > Thanks, > ?? ?Curtis This is not a bug in format, but rather a peculiarity of the "print" function and different kinds of output ports. Try the following in DrRacket: (print (+ 11 (/ 5 16))) (newline) (with-output-to-string (lambda () (print (+ 11 (/ 5 16))))) The fraction displayed as 5 over 16 with a line between is not, in fact, a string, but is instead an image. DrRacket uses a special output port that can display graphical images; but format and with-output-to-string use a port that can only accept characters. The print function distinguishes between these kinds of ports and decides how to render fractions accordingly. --Carl From curtdutt at gmail.com Tue Jun 8 15:19:08 2010 From: curtdutt at gmail.com (Curtis Dutton) Date: Tue, 8 Jun 2010 15:19:08 -0400 Subject: [racket] Format Bug In-Reply-To: References: Message-ID: Thanks. I started to think that was what was going on after I sent the mail. Doh! Thanks for the explanation. On Jun 8, 2010 3:09 PM, "Carl Eastlund" wrote: On Tue, Jun 8, 2010 at 2:47 PM, Curtis Dutton wrote: > Just found a quick littl... This is not a bug in format, but rather a peculiarity of the "print" function and different kinds of output ports. Try the following in DrRacket: (print (+ 11 (/ 5 16))) (newline) (with-output-to-string (lambda () (print (+ 11 (/ 5 16))))) The fraction displayed as 5 over 16 with a line between is not, in fact, a string, but is instead an image. DrRacket uses a special output port that can display graphical images; but format and with-output-to-string use a port that can only accept characters. The print function distinguishes between these kinds of ports and decides how to render fractions accordingly. --Carl -------------- next part -------------- An HTML attachment was scrubbed... URL: From keydana at gmx.de Tue Jun 8 16:07:57 2010 From: keydana at gmx.de (keydana at gmx.de) Date: Tue, 8 Jun 2010 22:07:57 +0200 Subject: [racket] [plt-scheme] Re: Typed scheme: Cannot apply expression of type Procedure, since it is not a function type In-Reply-To: References: <20100604062452.2E11E402B6@qua.cs.brown.edu> <8A147445-41AD-4CAC-AF87-EE63D7BC7F03@gmx.de> Message-ID: <89B511D1-1030-4610-B570-05A207799F72@gmx.de> Noel & David, thanks a lot for sharing your code! I've downloaded racket now, and really it works without the casts (at least my example), but to understand I tried your solutions on my case: David's cast worked fine, but your conversion function Noel did not work in my case (in plt 4.2.5), there was a problem with the Option type: (substring "qqq" (number->exact-integer (truncate (inexact->exact 1.2)))) Type Checker: No function domains matched in function application: Domains: String Integer String Integer Integer Arguments: String (U Integer False) in: (substring "qqq" (number->exact-integer (truncate (inexact->exact 1.2)))) O course it's not a problem now any more, the reason I tried this out was that looking at (both your) code, I was puzzled how these casts would work in TS... my main experience with casts being from Java, I was missing something like the (Object) part in, e.g., return (Object) astring; But it looks like in TS, it's the return type of the function which accomplishes everything, - would that be correct? Thanks again Sigrid Am 08.06.2010 um 07:35 schrieb Noel Welsh: > On Mon, Jun 7, 2010 at 1:08 PM, keydana at gmx.de wrote: >> >> Finally I've found the time to try this - but it gives me a Real (same with round): >> >> (truncate (inexact->exact 1.222)) >> - : Real >> 1 >> >> So I still have the typing error, the substring function insisting on an Integer... > > This file contains type conversion functions that I've used in my code: > > http://github.com/noelwelsh/bayesian-scan-matching/blob/master/util.ss > > HTH, > N. From keydana at gmx.de Tue Jun 8 16:08:07 2010 From: keydana at gmx.de (keydana at gmx.de) Date: Tue, 8 Jun 2010 22:08:07 +0200 Subject: [racket] [plt-scheme] Re: Typed scheme: Cannot apply expression of type Procedure, since it is not a function type In-Reply-To: References: <20100604062452.2E11E402B6@qua.cs.brown.edu> <8A147445-41AD-4CAC-AF87-EE63D7BC7F03@gmx.de> Message-ID: <94C44522-4500-43A2-86CB-02A689088EE4@gmx.de> >> > > If you use the now-released 5.0, this should work. Yes it does, thanks! >> >> Also, in practice, think it'd be helpful to show the inclusion hierarchy for numeric types in the typed scheme reference... > > We plan to add this to the docs. That would be great really. Till then, could you perhaps point me to some source file(s) to look at? (I used to look into the Java sources when I learned Java, but I've never had the courage yet to look up something in scheme source files - I'm thinking right now it might be time for a first try :-) ) Ciao Sigrid From samth at ccs.neu.edu Tue Jun 8 16:39:52 2010 From: samth at ccs.neu.edu (Sam Tobin-Hochstadt) Date: Tue, 8 Jun 2010 16:39:52 -0400 Subject: [racket] [plt-scheme] Re: Typed scheme: Cannot apply expression of type Procedure, since it is not a function type In-Reply-To: <94C44522-4500-43A2-86CB-02A689088EE4@gmx.de> References: <20100604062452.2E11E402B6@qua.cs.brown.edu> <8A147445-41AD-4CAC-AF87-EE63D7BC7F03@gmx.de> <94C44522-4500-43A2-86CB-02A689088EE4@gmx.de> Message-ID: On Tue, Jun 8, 2010 at 4:08 PM, keydana at gmx.de wrote: > >>> Also, in practice, ?think it'd be helpful to show the inclusion hierarchy for numeric types in the typed scheme reference... >> >> We plan to add this to the docs. > > > That would be great really. > Till then, could you perhaps point me to some source file(s) to look at? (I used to look into the Java sources when I learned Java, but I've never had the courage yet to look up something in scheme source files - I'm thinking right now it might be time for a first try :-) ) > If you really want, you can look at the subtyping algorithm here: http://github.com/plt/racket/blob/master/collects/typed-scheme/types/subtype.rkt It's unlikely to be very helpful, though. -- sam th samth at ccs.neu.edu From ryanc at ccs.neu.edu Tue Jun 8 16:50:34 2010 From: ryanc at ccs.neu.edu (Ryan Culpepper) Date: Tue, 08 Jun 2010 14:50:34 -0600 Subject: [racket] DrScheme macro stepper ignoring color settings? In-Reply-To: <87ocflogs0.fsf@gmail.com> References: <87k4qfdl8k.fsf@gmail.com> <87ocflogs0.fsf@gmail.com> Message-ID: <4C0EAD1A.1040608@ccs.neu.edu> The macro stepper should work in white-on-black color mode now. Let me know if you have any problems with it. Ryan ?t?p?n N?mec wrote: > ?t?p?n N?mec writes: > >> Hello, >> >> although I've set dark background and it works in DrScheme's interaction >> and definition windows, the macro stepper seems to ignore the settings >> (i.e. it's still black text on white background); is this a known issue >> (or even the intended behaviour)? I don't see any macro-stepper-specific >> settings... >> >> I'm using the PLT 4.2.5 Debian installer downloaded from the website. >> >> Best regards, >> >> ?t?p?n > > PING > > Anything unclear? Any better place to whine about/report (what seems to > me to be) PLT bugs? > > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From DekuDekuplex at Yahoo.com Tue Jun 8 17:05:46 2010 From: DekuDekuplex at Yahoo.com (Benjamin L. Russell) Date: Wed, 09 Jun 2010 06:05:46 +0900 Subject: [racket] "The Disadvantages of High School Programming" Message-ID: There is an interesting, if somewhat dated (posted on October 9, 2008), article, entitled "The Disadvantages of High School Programming" [1] (see http://compsci.ca/blog/the-disadvantages-of-high-school-programming/), by Roman Zimine, then a "first-year student at the University of Waterloo's Math Faculty" (according to the byline), on CompSci.ca Blog. The article discusses the issue that certain students with a high school background in computer science were having more difficulty in an introductory computer science course taught in Scheme than students with no computer science background whatsoever in high school. The case of Waterloo is interesting because starting from fall 2008, all first-term courses in computer science started using the programming language Scheme running in DrScheme (see the related article "Computer Science at Waterloo: the new Scheme of things | CompSci.ca/blog" [2] at http://compsci.ca/blog/computer-science-at-waterloo-the-new-scheme-of-things/). The article contends that some high-school programming courses focus on "the idea of 'just making it work'," which interferes with the concept of "[p]rogramming is communication," as taught in certain university-level computer science courses. The article argues that "[b]asically, those who take programming courses in high school can find themselves at a disadvantage, as they have to unlearn bad programming habits while learning a new and very different language." >From what I have read in some of the publications written by certain members of the PLT Research Group, it would seem that this viewpoint runs counter to the PLT goal of introducing computer science into the high school curriculum. Personally, I think that the issue is not that teaching computer science in high school is bad, but that the quality of education is computer science courses at the high school level should be geared more toward "programming as communication," instead of focusing on the idea of "just making it work." Does anybody else have any ideas on how to deal with the problem outlined in the article? -- Benjamin L. Russell [1] Zimine, Roman. "The Disadvantages of High School Programming." _CompSci.ca Blog_. CompSci.ca Blog, 9 Oct. 2008. Web. 9 June 2010. . [2] Ragde, Prabhakar. "Computer Science at Waterloo: the new Scheme of things." _CompSci.ca Blog_. CompSci.ca Blog, 18 Mar. 2008. Web. 9 June 2010. . -- Benjamin L. Russell / DekuDekuplex at Yahoo dot com http://dekudekuplex.wordpress.com/ Translator/Interpreter / Mobile: +011 81 80-3603-6725 "Furuike ya, kawazu tobikomu mizu no oto." -- Matsuo Basho^ From robby at eecs.northwestern.edu Tue Jun 8 17:13:25 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Tue, 8 Jun 2010 16:13:25 -0500 Subject: [racket] "The Disadvantages of High School Programming" In-Reply-To: References: Message-ID: Seems right to me: if you teach poorly, you can hurt your students by setting up false expectations. I don't think that is in any way in conflict with our goal of teaching better in high schools. Robby On Tue, Jun 8, 2010 at 4:05 PM, Benjamin L. Russell wrote: > There is an interesting, if somewhat dated (posted on October 9, 2008), > article, entitled "The Disadvantages of High School Programming" [1] > (see > http://compsci.ca/blog/the-disadvantages-of-high-school-programming/), > by Roman Zimine, then a "first-year student at the University of > Waterloo's Math Faculty" (according to the byline), on CompSci.ca > Blog. ?The article discusses the issue that certain students with a high > school background in computer science were having more difficulty in an > introductory computer science course taught in Scheme than students with > no computer science background whatsoever in high school. > > The case of Waterloo is interesting because starting from fall 2008, all > first-term courses in computer science started using the programming > language Scheme running in DrScheme (see the related article "Computer > Science at Waterloo: the new Scheme of things | CompSci.ca/blog" [2] at > http://compsci.ca/blog/computer-science-at-waterloo-the-new-scheme-of-things/). > > The article contends that some high-school programming courses focus on > "the idea of 'just making it work'," which interferes with the concept > of "[p]rogramming is communication," as taught in certain > university-level computer science courses. ?The article argues that > "[b]asically, those who take programming courses in high school can find > themselves at a disadvantage, as they have to unlearn bad programming > habits while learning a new and very different language." > > From what I have read in some of the publications written by certain > members of the PLT Research Group, it would seem that this viewpoint > runs counter to the PLT goal of introducing computer science into the > high school curriculum. > > Personally, I think that the issue is not that teaching computer science > in high school is bad, but that the quality of education is computer > science courses at the high school level should be geared more toward > "programming as communication," instead of focusing on the idea of "just > making it work." > > Does anybody else have any ideas on how to deal with the problem > outlined in the article? > > -- Benjamin L. Russell > > [1] Zimine, Roman. "The Disadvantages of High School Programming." > _CompSci.ca Blog_. CompSci.ca Blog, 9 Oct. 2008. Web. 9 June > 2010. . > > [2] Ragde, Prabhakar. "Computer Science at Waterloo: the new Scheme of > things." _CompSci.ca Blog_. CompSci.ca Blog, 18 Mar. 2008. Web. 9 June > 2010. . > -- > Benjamin L. Russell ?/ ? DekuDekuplex at Yahoo dot com > http://dekudekuplex.wordpress.com/ > Translator/Interpreter / Mobile: ?+011 81 80-3603-6725 > "Furuike ya, kawazu tobikomu mizu no oto." -- Matsuo Basho^ > > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > From isaac.raway at gmail.com Tue Jun 8 17:25:27 2010 From: isaac.raway at gmail.com (Isaac Raway) Date: Tue, 8 Jun 2010 16:25:27 -0500 Subject: [racket] "The Disadvantages of High School Programming" In-Reply-To: References: Message-ID: It seem that this might be an issue of the dichotomy between vocational training in computer programming and true computer science. Note that "computer programming" != "computer science". It's quite possible to be a productive and successful programmer without having a solid understanding of computer science. I would tend to think (however obviously without any evidence) that high school courses will be geared more towards the vocational side of giving students basic programming capability in preparation not for university courses but for community college Java classes that will pump out another batch of programmers who don't really care about the theory. I say this having attended those community college Java classes and finding them extremely wanting, they were completely useless to me. No where in that environment did I find any true computer science, which I think has put me at a disadvantage ultimately. The skillet I left with was approximately what I entered with - innate problem solving ability and the possibly perverse interest to read a technical manual without falling asleep. I personally fully support the idea of introducing true computer science at an early age. Had I been given that I think my own skills would have developed a lot faster. With the environment I did have, a lot of the real learning about more advanced theory has to happen when I come across a need for it on the job. This isn't ideal. However doing away with vocational computer programming training at the high school level entirely probably isn't a good idea. Some are drawn in by theory, some are drawn in by practice. Offering both is the key. IJR On Tue, Jun 8, 2010 at 4:05 PM, Benjamin L. Russell wrote: > There is an interesting, if somewhat dated (posted on October 9, 2008), > article, entitled "The Disadvantages of High School Programming" [1] > (see > http://compsci.ca/blog/the-disadvantages-of-high-school-programming/), > by Roman Zimine, then a "first-year student at the University of > Waterloo's Math Faculty" (according to the byline), on CompSci.ca > Blog. ?The article discusses the issue that certain students with a high > school background in computer science were having more difficulty in an > introductory computer science course taught in Scheme than students with > no computer science background whatsoever in high school. > > The case of Waterloo is interesting because starting from fall 2008, all > first-term courses in computer science started using the programming > language Scheme running in DrScheme (see the related article "Computer > Science at Waterloo: the new Scheme of things | CompSci.ca/blog" [2] at > http://compsci.ca/blog/computer-science-at-waterloo-the-new-scheme-of-things/). > > The article contends that some high-school programming courses focus on > "the idea of 'just making it work'," which interferes with the concept > of "[p]rogramming is communication," as taught in certain > university-level computer science courses. ?The article argues that > "[b]asically, those who take programming courses in high school can find > themselves at a disadvantage, as they have to unlearn bad programming > habits while learning a new and very different language." > > From what I have read in some of the publications written by certain > members of the PLT Research Group, it would seem that this viewpoint > runs counter to the PLT goal of introducing computer science into the > high school curriculum. > > Personally, I think that the issue is not that teaching computer science > in high school is bad, but that the quality of education is computer > science courses at the high school level should be geared more toward > "programming as communication," instead of focusing on the idea of "just > making it work." > > Does anybody else have any ideas on how to deal with the problem > outlined in the article? > > -- Benjamin L. Russell > > [1] Zimine, Roman. "The Disadvantages of High School Programming." > _CompSci.ca Blog_. CompSci.ca Blog, 9 Oct. 2008. Web. 9 June > 2010. . > > [2] Ragde, Prabhakar. "Computer Science at Waterloo: the new Scheme of > things." _CompSci.ca Blog_. CompSci.ca Blog, 18 Mar. 2008. Web. 9 June > 2010. . > -- > Benjamin L. Russell ?/ ? DekuDekuplex at Yahoo dot com > http://dekudekuplex.wordpress.com/ > Translator/Interpreter / Mobile: ?+011 81 80-3603-6725 > "Furuike ya, kawazu tobikomu mizu no oto." -- Matsuo Basho^ > > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > From horace.dynamite at googlemail.com Tue Jun 8 17:27:30 2010 From: horace.dynamite at googlemail.com (Horace Dynamite) Date: Tue, 8 Jun 2010 22:27:30 +0100 Subject: [racket] "The Disadvantages of High School Programming" In-Reply-To: References: Message-ID: On Tue, Jun 8, 2010 at 10:05 PM, Benjamin L. Russell wrote: > There is an interesting, if somewhat dated (posted on October 9, 2008), > article, entitled "The Disadvantages of High School Programming" [1] > (see > http://compsci.ca/blog/the-disadvantages-of-high-school-programming/) I attend high school, and have the same sentiments as Roman. Luckily I discovered HtDP independently. The text book we're given (published by the AQA examining board in the UK) uses Pascal as its demonstration language. And my teacher uses Visual Basic as his demonstration language. This gets weird fast for me. Also, the text mostly discusses architecture (two's complement, etc & number representation) and data structures having spent ages explaining Pascals feature list. Most of this only helped to confuse me initially. I'd rather have been taught how to think about problems at first. I've since dropped the course incidentally, and feel I'll be much better prepared when (if) I get into University this year than my peers having discovered HtDP. > ... having more difficulty in an > introductory computer science course taught in Scheme than students with > no computer science background whatsoever in high school. I had to reread the first 8 sections of HtDP because of my previous misconceptions in my computing high school course. I thought that the design recipes were ridiculous! > Does anybody else have any ideas on how to deal with the problem > outlined in the article? I think the PLT group have addressed the problems outlined in the article. The new problem is make more high school aware of it I suppose. I told my teacher about HtDP, but he never mentioned it to me afterwards. As a student, I can't make an impression on my teacher, its the people my teacher can respect in the academic community that need to start shouting. Horace. From toddobryan at gmail.com Tue Jun 8 17:43:54 2010 From: toddobryan at gmail.com (Todd O'Bryan) Date: Tue, 8 Jun 2010 17:43:54 -0400 Subject: [racket] macro help redux Message-ID: I feel like I'm getting there, but macros still do things that confuse me. According to the Macro Stepper, I've written a macro that expands to: (module fields racket (#%module-begin (require "tables.rkt") (require "../date-utils.rkt") (begin (define-struct date-field (contract) #:transparent) (define (create-date-field #:contract (contract db-date?)) (make-date-field contract)) (provide/contract (create-date-field (-> #:contract any/c date-field?)))))) At the next step of the expansion, I get the error: expand: unbound identifier in module db-date? The only problem is that "../date-utils.rkt" provides db-date? and if I put everything inside the #%module-begin into its own DrRacket definitions window, it runs without error. For some reason, db-date? isn't available when it's needed, but I can't figure out how to make it available. What am I doing wrong? Todd From ryanc at ccs.neu.edu Tue Jun 8 17:57:02 2010 From: ryanc at ccs.neu.edu (Ryan Culpepper) Date: Tue, 08 Jun 2010 15:57:02 -0600 Subject: [racket] macro help redux In-Reply-To: References: Message-ID: <4C0EBCAE.3060908@ccs.neu.edu> Todd O'Bryan wrote: > I feel like I'm getting there, but macros still do things that confuse me. > > According to the Macro Stepper, I've written a macro that expands to: > > (module fields racket > (#%module-begin > (require "tables.rkt") > (require "../date-utils.rkt") > (begin > (define-struct > date-field > (contract) > #:transparent) > (define (create-date-field > #:contract > (contract db-date?)) > (make-date-field contract)) > (provide/contract > (create-date-field > (-> #:contract any/c date-field?)))))) > > At the next step of the expansion, I get the error: > > expand: unbound identifier in module > db-date? > > The only problem is that "../date-utils.rkt" provides db-date? and if > I put everything inside the #%module-begin into its own DrRacket > definitions window, it runs without error. For some reason, db-date? > isn't available when it's needed, but I can't figure out how to make > it available. > > What am I doing wrong? Is your macro defined in "tables.rkt"? If that's the case, it doesn't matter whether the module where it's *used* imports date-utils, but whether the module where the macro is *defined* imports date-utils. That's the idea of hygienic macros; they're lexically scoped. You can use the macro stepper to check an identifier's binding by clicking on the identifier (here, the reference to 'db-date?'), then opening the "Syntax properties" pane using the Stepper window. It'll tell you what bindings, if any, the identifier refers to. Did that help? Ryan From jmarshall at alum.mit.edu Tue Jun 8 18:22:28 2010 From: jmarshall at alum.mit.edu (Joe Marshall) Date: Tue, 8 Jun 2010 15:22:28 -0700 Subject: [racket] "The Disadvantages of High School Programming" In-Reply-To: References: Message-ID: On Tue, Jun 8, 2010 at 2:25 PM, Isaac Raway wrote: > It's quite > possible to be a productive and successful programmer without having a > solid understanding of computer science. That's the problem. Maybe it shouldn't be the case. Variations on this statement are alarming: ``It's quite possible to be a productive and successful physician without having a solid understanding of medicine.'' ``It's quite possible to be a productive and successful airplane engineer without having a solid understanding of aerodynamics.'' `Rocket Scientist' : `Newtonian physics' `Brain Surgeon' : `neurology' -- ~jrm From plragde at uwaterloo.ca Tue Jun 8 19:01:08 2010 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Tue, 08 Jun 2010 19:01:08 -0400 Subject: [racket] "The Disadvantages of High School Programming" In-Reply-To: Message-ID: <4C0ECBB4.1090009@uwaterloo.ca> Benjamin L. Russell wrote: > There is an interesting, if somewhat dated (posted on October 9, 2008), > article, entitled "The Disadvantages of High School Programming" [1] > (see > http://compsci.ca/blog/the-disadvantages-of-high-school-programming/), > by Roman Zimine, then a "first-year student at the University of > Waterloo's Math Faculty" (according to the byline), on CompSci.ca > Blog. The article discusses the issue that certain students with a high > school background in computer science were having more difficulty in an > introductory computer science course taught in Scheme than students with > no computer science background whatsoever in high school. As your second link made clear, I designed the course that Roman took, and in fact he was a student of mine in the followup course (continuing with Scheme and introducing C) in the early months of 2009. He came and spoke with me in office hours a few times about such matters. The first time I taught that introductory course to a substantial number of students, those who did not have an Ontario Grade 11 computer science credit (recommended for all students entering our Faculty) had a slightly higher average mark than those who did have such a credit. I have not checked the statistics recently; it is harder to do so now, because we have two courses, one for CS majors and those willing to be taught as if they were CS majors, and one for non-majors (mostly Math students, but some from the Science, Environment, and even Arts Faculties). I attribute this surprising statistic to two factors: 1) the difficulty of learning a second way of doing something, and 2) complacency, because at most institutions, first-term CS is a review of high-school CS, and incoming students know this. We tell them that it is not true at UW, but they tend not to believe us. > The case of Waterloo is interesting because starting from fall 2008, all > first-term courses in computer science started using the programming > language Scheme running in DrScheme (see the related article "Computer > Science at Waterloo: the new Scheme of things | CompSci.ca/blog" [2] at > http://compsci.ca/blog/computer-science-at-waterloo-the-new-scheme-of-things/). We currently have 1500 students a year taking a required course in Scheme. I suspect one will not find that volume of functional programming students at any other institution. > The article contends that some high-school programming courses focus on > "the idea of 'just making it work'," which interferes with the concept > of "[p]rogramming is communication," as taught in certain > university-level computer science courses. The article argues that > "[b]asically, those who take programming courses in high school can find > themselves at a disadvantage, as they have to unlearn bad programming > habits while learning a new and very different language." More specifically, students have typically been given little or no guidance in how to ensure, through design principles and careful testing, that a program works properly, and come to believe that anything that results in a program appearing to work (on the basis of a couple of ad-hoc tests) is good enough. Furthermore, they do not understand why they may not deserve full marks for such a program, or why even a program that passes all of our unit tests can be docked marks for stylistic errors. It may take a few years of dealing with other people's code in a production environment before they can really understand. > From what I have read in some of the publications written by certain > members of the PLT Research Group, it would seem that this viewpoint > runs counter to the PLT goal of introducing computer science into the > high school curriculum. Not at all. As Robby has pointed out, the difficulty lies in poor pedagogy at the high school level, not the mere fact that it is being done when students are a certain age. I would prefer to have students who have mastered algebra, but I can see the case for actually teaching algebra (or related concepts of abstraction, at any rate) through the use of something like Racket. The nice thing about Racket in a secondary- or elementary-school environment is that, if used properly, it can be accessible to a far wider audience than typically makes it through a CS class at this level. --PR From kwinterling at gmail.com Tue Jun 8 19:08:42 2010 From: kwinterling at gmail.com (Karl Winterling) Date: Tue, 8 Jun 2010 16:08:42 -0700 Subject: [racket] "The Disadvantages of High School Programming" In-Reply-To: References: Message-ID: It's mainly a practical issue. Public high schools know that the vast majority (including some in "advanced" classes) of students won't end up at major research Universities. They also typically don't have enough funding to offer multiple, say, computer science courses (my high school didn't have any programming courses). Many community college CS departments have explicitly vocational purposes due to the nature of demand and available funding. Hence, the main goal of these programs is to teach students basic familiarity with programming languages viewed as tools. Nothing's particularly wrong with this, but it sacrifices theory and design technique for concreteness and instant practicality. Likewise, many people learn how to compute derivatives and integrals in high school with no (or very little) conceptual understanding and end up at a disadvantage in freshman calculus. Most "good" CS courses (like some "Scheme-based" courses) require that students understand program design conceptually and put less emphasis on the syntax, libraries, or other features of any particular language. Students with high school experience expect that programming isn't intellectually challenging, so the courses fail to meet students' expectations. It's similar to why some students freak out in freshman calculus or physics. ---Karl From neil at neilvandyke.org Tue Jun 8 19:23:40 2010 From: neil at neilvandyke.org (Neil Van Dyke) Date: Tue, 08 Jun 2010 19:23:40 -0400 Subject: [racket] "The Disadvantages of High School Programming" In-Reply-To: References: Message-ID: <4C0ED0FC.50405@neilvandyke.org> Yes, it would be nice if everyone developing software had a better grounding in Computer Science. As a practical matter, not enough employers are willing to pay for that skill. They are fine hiring Java *technicians* rather than software *engineers* or the exceedingly rare *scientist*. (This is part of why I generally encourage students who want to be more than technicians *not* to focus solely on CS.) It is also not unusual for a technician to be more skilled at procedures than an engineer of the kind who developed the procedures or technologies that the technician uses. Then there are the employers who *are* willing to pay for developers with breadth&depth CS backgrounds. Sadly, some of them then go and bias the interview quizzes towards people fresh out college, with CS 101 questions that almost no one remembers precisely, even if they've internalized the gist of it. -- http://www.neilvandyke.org/ From toddobryan at gmail.com Tue Jun 8 20:33:48 2010 From: toddobryan at gmail.com (Todd O'Bryan) Date: Tue, 8 Jun 2010 20:33:48 -0400 Subject: [racket] macro help redux In-Reply-To: <4C0EBCAE.3060908@ccs.neu.edu> References: <4C0EBCAE.3060908@ccs.neu.edu> Message-ID: It does, but I'm confused. Does that mean that any macro I define that includes something like a contract has to require every predicate it could conceivably want? How do I define a macro that will allow me to specify a predicate later, maybe even one that didn't exist when I wrote the macro? Or is that not possible? Or, and this kind of makes sense as I'm writing it, is there a way to tell a macro to wait to evaluate something in the location it's used, rather than in its own scope? Todd On Tue, Jun 8, 2010 at 5:57 PM, Ryan Culpepper wrote: > Todd O'Bryan wrote: >> >> I feel like I'm getting there, but macros still do things that confuse me. >> >> According to the Macro Stepper, I've written a macro that expands to: >> >> (module fields racket >> ?(#%module-begin >> ? (require "tables.rkt") >> ? (require "../date-utils.rkt") >> ? (begin >> ? ? (define-struct >> ? ? ?date-field >> ? ? ?(contract) >> ? ? ?#:transparent) >> ? ? (define (create-date-field >> ? ? ? ? ? ? ?#:contract >> ? ? ? ? ? ? ?(contract db-date?)) >> ? ? ? (make-date-field contract)) >> ? ? (provide/contract >> ? ? ?(create-date-field >> ? ? ? (-> #:contract any/c date-field?)))))) >> >> At the next step of the expansion, I get the error: >> >> expand: unbound identifier in module >> db-date? >> >> The only problem is that "../date-utils.rkt" provides db-date? and if >> I put everything inside the #%module-begin into its own DrRacket >> definitions window, it runs without error. For some reason, db-date? >> isn't available when it's needed, but I can't figure out how to make >> it available. >> >> What am I doing wrong? > > Is your macro defined in "tables.rkt"? If that's the case, it doesn't matter > whether the module where it's *used* imports date-utils, but whether the > module where the macro is *defined* imports date-utils. That's the idea of > hygienic macros; they're lexically scoped. > > You can use the macro stepper to check an identifier's binding by clicking > on the identifier (here, the reference to 'db-date?'), then opening the > "Syntax properties" pane using the Stepper window. It'll tell you what > bindings, if any, the identifier refers to. > > Did that help? > > Ryan > > From ryanc at ccs.neu.edu Tue Jun 8 21:07:31 2010 From: ryanc at ccs.neu.edu (Ryan Culpepper) Date: Tue, 08 Jun 2010 19:07:31 -0600 Subject: [racket] macro help redux In-Reply-To: References: <4C0EBCAE.3060908@ccs.neu.edu> Message-ID: <4C0EE953.6030108@ccs.neu.edu> Can you post your macro and the example that produces the expansion you included in your previous message? My earlier answer was based on a conjecture about how your macro behaved, and it would be easier to provide a complete answer if I can see exactly what you're doing. Ryan Todd O'Bryan wrote: > It does, but I'm confused. Does that mean that any macro I define that > includes something like a contract has to require every predicate it > could conceivably want? How do I define a macro that will allow me to > specify a predicate later, maybe even one that didn't exist when I > wrote the macro? Or is that not possible? > > Or, and this kind of makes sense as I'm writing it, is there a way to > tell a macro to wait to evaluate something in the location it's used, > rather than in its own scope? > > Todd > > On Tue, Jun 8, 2010 at 5:57 PM, Ryan Culpepper wrote: >> Todd O'Bryan wrote: >>> I feel like I'm getting there, but macros still do things that confuse me. >>> >>> According to the Macro Stepper, I've written a macro that expands to: >>> >>> (module fields racket >>> (#%module-begin >>> (require "tables.rkt") >>> (require "../date-utils.rkt") >>> (begin >>> (define-struct >>> date-field >>> (contract) >>> #:transparent) >>> (define (create-date-field >>> #:contract >>> (contract db-date?)) >>> (make-date-field contract)) >>> (provide/contract >>> (create-date-field >>> (-> #:contract any/c date-field?)))))) >>> >>> At the next step of the expansion, I get the error: >>> >>> expand: unbound identifier in module >>> db-date? >>> >>> The only problem is that "../date-utils.rkt" provides db-date? and if >>> I put everything inside the #%module-begin into its own DrRacket >>> definitions window, it runs without error. For some reason, db-date? >>> isn't available when it's needed, but I can't figure out how to make >>> it available. >>> >>> What am I doing wrong? >> Is your macro defined in "tables.rkt"? If that's the case, it doesn't matter >> whether the module where it's *used* imports date-utils, but whether the >> module where the macro is *defined* imports date-utils. That's the idea of >> hygienic macros; they're lexically scoped. >> >> You can use the macro stepper to check an identifier's binding by clicking >> on the identifier (here, the reference to 'db-date?'), then opening the >> "Syntax properties" pane using the Stepper window. It'll tell you what >> bindings, if any, the identifier refers to. >> >> Did that help? >> >> Ryan >> >> From etanter at dcc.uchile.cl Tue Jun 8 21:16:18 2010 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Tue, 8 Jun 2010 21:16:18 -0400 Subject: [racket] [scribble] rendering syntax Message-ID: <53B5E8CA-292F-4B8C-B14C-5BC9C2F3C600@dcc.uchile.cl> Hi, I noticed that (syntax ....) renders as #'.... inside a schemeblock. why is it so? Thanks, -- ?ric From cce at ccs.neu.edu Tue Jun 8 21:24:41 2010 From: cce at ccs.neu.edu (Carl Eastlund) Date: Tue, 8 Jun 2010 21:24:41 -0400 Subject: [racket] [scribble] rendering syntax In-Reply-To: <53B5E8CA-292F-4B8C-B14C-5BC9C2F3C600@dcc.uchile.cl> References: <53B5E8CA-292F-4B8C-B14C-5BC9C2F3C600@dcc.uchile.cl> Message-ID: On Tue, Jun 8, 2010 at 9:16 PM, Eric Tanter wrote: > Hi, > > I noticed that (syntax ....) renders as #'.... inside a schemeblock. > > why is it so? > > Thanks, > > -- ?ric #'EXPRESSION is shorthand for (syntax EXPRESSION) just like 'EXPRESSION is shorthand for (quote EXPRESSION). They have the same data representation, so any tool that renders them simply has to choose one. Many tools prefer to render the shorthand. --Carl From toddobryan at gmail.com Tue Jun 8 22:12:48 2010 From: toddobryan at gmail.com (Todd O'Bryan) Date: Tue, 8 Jun 2010 22:12:48 -0400 Subject: [racket] macro help redux In-Reply-To: <4C0EE953.6030108@ccs.neu.edu> References: <4C0EBCAE.3060908@ccs.neu.edu> <4C0EE953.6030108@ccs.neu.edu> Message-ID: Let me see if I can make a smaller example that does the same thing. The one I'm currently working on is a big mess... On Tue, Jun 8, 2010 at 9:07 PM, Ryan Culpepper wrote: > Can you post your macro and the example that produces the expansion you > included in your previous message? My earlier answer was based on a > conjecture about how your macro behaved, and it would be easier to provide a > complete answer if I can see exactly what you're doing. > > Ryan > > Todd O'Bryan wrote: >> >> It does, but I'm confused. Does that mean that any macro I define that >> includes something like a contract has to require every predicate it >> could conceivably want? How do I define a macro that will allow me to >> specify a predicate later, maybe even one that didn't exist when I >> wrote the macro? Or is that not possible? > >> >> >> Or, and this kind of makes sense as I'm writing it, is there a way to >> tell a macro to wait to evaluate something in the location it's used, >> rather than in its own scope? >> >> Todd >> >> On Tue, Jun 8, 2010 at 5:57 PM, Ryan Culpepper wrote: >>> >>> Todd O'Bryan wrote: >>>> >>>> I feel like I'm getting there, but macros still do things that confuse >>>> me. >>>> >>>> According to the Macro Stepper, I've written a macro that expands to: >>>> >>>> (module fields racket >>>> ?(#%module-begin >>>> ?(require "tables.rkt") >>>> ?(require "../date-utils.rkt") >>>> ?(begin >>>> ? ?(define-struct >>>> ? ? date-field >>>> ? ? (contract) >>>> ? ? #:transparent) >>>> ? ?(define (create-date-field >>>> ? ? ? ? ? ? #:contract >>>> ? ? ? ? ? ? (contract db-date?)) >>>> ? ? ?(make-date-field contract)) >>>> ? ?(provide/contract >>>> ? ? (create-date-field >>>> ? ? ?(-> #:contract any/c date-field?)))))) >>>> >>>> At the next step of the expansion, I get the error: >>>> >>>> expand: unbound identifier in module >>>> db-date? >>>> >>>> The only problem is that "../date-utils.rkt" provides db-date? and if >>>> I put everything inside the #%module-begin into its own DrRacket >>>> definitions window, it runs without error. For some reason, db-date? >>>> isn't available when it's needed, but I can't figure out how to make >>>> it available. >>>> >>>> What am I doing wrong? >>> >>> Is your macro defined in "tables.rkt"? If that's the case, it doesn't >>> matter >>> whether the module where it's *used* imports date-utils, but whether the >>> module where the macro is *defined* imports date-utils. That's the idea >>> of >>> hygienic macros; they're lexically scoped. >>> >>> You can use the macro stepper to check an identifier's binding by >>> clicking >>> on the identifier (here, the reference to 'db-date?'), then opening the >>> "Syntax properties" pane using the Stepper window. It'll tell you what >>> bindings, if any, the identifier refers to. >>> >>> Did that help? >>> >>> Ryan >>> >>> > > From etanter at dcc.uchile.cl Tue Jun 8 22:19:52 2010 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Tue, 8 Jun 2010 22:19:52 -0400 Subject: [racket] [scribble] rendering syntax In-Reply-To: References: <53B5E8CA-292F-4B8C-B14C-5BC9C2F3C600@dcc.uchile.cl> Message-ID: <1DCE61AA-5CA8-4888-A4E6-8EE5E8C5E639@dcc.uchile.cl> Right, I somehow naively hoped that the representation used by schemeblock could be that used in the source code, but I understand this may not be possible... Thanks, -- ?ric On Jun 8, 2010, at 9:24 PM, Carl Eastlund wrote: > On Tue, Jun 8, 2010 at 9:16 PM, Eric Tanter wrote: >> Hi, >> >> I noticed that (syntax ....) renders as #'.... inside a schemeblock. >> >> why is it so? >> >> Thanks, >> >> -- ?ric > > #'EXPRESSION is shorthand for (syntax EXPRESSION) just like > 'EXPRESSION is shorthand for (quote EXPRESSION). They have the same > data representation, so any tool that renders them simply has to > choose one. Many tools prefer to render the shorthand. > > --Carl From clements at brinckerhoff.org Tue Jun 8 23:13:32 2010 From: clements at brinckerhoff.org (John Clements) Date: Tue, 8 Jun 2010 20:13:32 -0700 Subject: [racket] [scribble] rendering syntax In-Reply-To: <1DCE61AA-5CA8-4888-A4E6-8EE5E8C5E639@dcc.uchile.cl> References: <53B5E8CA-292F-4B8C-B14C-5BC9C2F3C600@dcc.uchile.cl> <1DCE61AA-5CA8-4888-A4E6-8EE5E8C5E639@dcc.uchile.cl> Message-ID: On Jun 8, 2010, at 7:19 PM, Eric Tanter wrote: > Right, I somehow naively hoped that the representation used by schemeblock could be that used in the source code, but I understand this may not be possible... Wait... in general, that's the point. You *can* use #' in source code. Am I misunderstanding you? John -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4669 bytes Desc: not available URL: From cce at ccs.neu.edu Tue Jun 8 23:15:48 2010 From: cce at ccs.neu.edu (Carl Eastlund) Date: Tue, 8 Jun 2010 23:15:48 -0400 Subject: [racket] [scribble] rendering syntax In-Reply-To: References: <53B5E8CA-292F-4B8C-B14C-5BC9C2F3C600@dcc.uchile.cl> <1DCE61AA-5CA8-4888-A4E6-8EE5E8C5E639@dcc.uchile.cl> Message-ID: On Tue, Jun 8, 2010 at 11:13 PM, John Clements wrote: > > On Jun 8, 2010, at 7:19 PM, Eric Tanter wrote: > >> Right, I somehow naively hoped that the representation used by schemeblock could be that used in the source code, but I understand this may not be possible... > > Wait... in general, that's the point. ?You *can* use #' in source code. Am I misunderstanding you? > > John I believe his hope is that schemeblock would show #' or (syntax --), whichever the user entered, rather than the current behavior of accepting both but always showing one. --Carl From clements at brinckerhoff.org Tue Jun 8 23:21:19 2010 From: clements at brinckerhoff.org (John Clements) Date: Tue, 8 Jun 2010 20:21:19 -0700 Subject: [racket] [scribble] rendering syntax In-Reply-To: References: <53B5E8CA-292F-4B8C-B14C-5BC9C2F3C600@dcc.uchile.cl> <1DCE61AA-5CA8-4888-A4E6-8EE5E8C5E639@dcc.uchile.cl> Message-ID: <1C4F17DC-8A31-4B9C-B2CB-6BA88FAE2940@brinckerhoff.org> On Jun 8, 2010, at 8:15 PM, Carl Eastlund wrote: > On Tue, Jun 8, 2010 at 11:13 PM, John Clements > wrote: >> >> On Jun 8, 2010, at 7:19 PM, Eric Tanter wrote: >> >>> Right, I somehow naively hoped that the representation used by schemeblock could be that used in the source code, but I understand this may not be possible... >> >> Wait... in general, that's the point. You *can* use #' in source code. Am I misunderstanding you? >> >> John > > I believe his hope is that schemeblock would show #' or (syntax --), > whichever the user entered, rather than the current behavior of > accepting both but always showing one. Ah, I see. File that one with "can the stepper show square brackets when my program contains square brackets?" John -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4669 bytes Desc: not available URL: From etanter at dcc.uchile.cl Tue Jun 8 23:27:13 2010 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Tue, 8 Jun 2010 23:27:13 -0400 Subject: [racket] [scribble] rendering syntax In-Reply-To: <1C4F17DC-8A31-4B9C-B2CB-6BA88FAE2940@brinckerhoff.org> References: <53B5E8CA-292F-4B8C-B14C-5BC9C2F3C600@dcc.uchile.cl> <1DCE61AA-5CA8-4888-A4E6-8EE5E8C5E639@dcc.uchile.cl> <1C4F17DC-8A31-4B9C-B2CB-6BA88FAE2940@brinckerhoff.org> Message-ID: <0C590F89-98E7-4F31-B4BF-632535961E24@dcc.uchile.cl> Yes, Carl got my point right. And yes, that's like showing square brackets in the stepper ;) -- ?ric On Jun 8, 2010, at 11:21 PM, John Clements wrote: > > On Jun 8, 2010, at 8:15 PM, Carl Eastlund wrote: > >> On Tue, Jun 8, 2010 at 11:13 PM, John Clements >> wrote: >>> >>> On Jun 8, 2010, at 7:19 PM, Eric Tanter wrote: >>> >>>> Right, I somehow naively hoped that the representation used by schemeblock could be that used in the source code, but I understand this may not be possible... >>> >>> Wait... in general, that's the point. You *can* use #' in source code. Am I misunderstanding you? >>> >>> John >> >> I believe his hope is that schemeblock would show #' or (syntax --), >> whichever the user entered, rather than the current behavior of >> accepting both but always showing one. > > Ah, I see. File that one with "can the stepper show square brackets when my program contains square brackets?" > > John > From anton at appsolutions.com Tue Jun 8 23:46:24 2010 From: anton at appsolutions.com (Anton van Straaten) Date: Tue, 08 Jun 2010 23:46:24 -0400 Subject: [racket] "The Disadvantages of High School Programming" In-Reply-To: References: Message-ID: <4C0F0E90.50407@appsolutions.com> Joe Marshall wrote: > On Tue, Jun 8, 2010 at 2:25 PM, Isaac Raway wrote: >> It's quite >> possible to be a productive and successful programmer without having a >> solid understanding of computer science. > > That's the problem. Maybe it shouldn't be the case. It arguably isn't the case. (Can't resist the curmudgeon bait.) A more accurate statement might be "it's quite possible to be a successful programmer, who appears to be productive, without having a solid understanding of computer science." A programmer who appears to be productive develops systems that initially appear to meet their requirements, but later fail in various ways, such as becoming prohibitively expensive to enhance and extend; being impossible to scale up to handle increasing demand; or requiring massive amounts of administrative babysitting to keep running. Noel suggests that many employers aren't willing to pay for the necessary skill, and he's right -- but they pay for the lack of it indirectly, in higher costs, lost customers, unhappy employees and worse. > Variations on this > statement are alarming: > > ``It's quite possible to be a productive and successful physician > without having a solid understanding of medicine.'' > > ``It's quite possible to be a productive and successful airplane > engineer without having a solid understanding of aerodynamics.'' > > `Rocket Scientist' : `Newtonian physics' > `Brain Surgeon' : `neurology' From neil at neilvandyke.org Wed Jun 9 00:01:19 2010 From: neil at neilvandyke.org (Neil Van Dyke) Date: Wed, 09 Jun 2010 00:01:19 -0400 Subject: [racket] "The Disadvantages of High School Programming" In-Reply-To: <4C0F0E90.50407@appsolutions.com> References: <4C0F0E90.50407@appsolutions.com> Message-ID: <4C0F120F.2060307@neilvandyke.org> Anton van Straaten wrote at 06/08/2010 11:46 PM: > Noel suggests that many employers aren't willing to pay for the > necessary skill, and he's right -- but they pay for the lack of it > indirectly, in higher costs, lost customers, unhappy employees and worse. I think that was me, not Noel. Our names get confused, but he's the cute Beatle. -- http://www.neilvandyke.org/ From anton at appsolutions.com Wed Jun 9 00:16:07 2010 From: anton at appsolutions.com (Anton van Straaten) Date: Wed, 09 Jun 2010 00:16:07 -0400 Subject: [racket] "The Disadvantages of High School Programming" In-Reply-To: <4C0F120F.2060307@neilvandyke.org> References: <4C0F0E90.50407@appsolutions.com> <4C0F120F.2060307@neilvandyke.org> Message-ID: <4C0F1587.9060404@appsolutions.com> Neil Van Dyke wrote: > Anton van Straaten wrote at 06/08/2010 11:46 PM: >> Noel suggests that many employers aren't willing to pay for the >> necessary skill, and he's right -- but they pay for the lack of it >> indirectly, in higher costs, lost customers, unhappy employees and worse. > > I think that was me, not Noel. Our names get confused, but he's the > cute Beatle. Oops, sorry. I do normally know the difference. That's what I get for responding to a different message than the one I'm directly replying to. Or perhaps the naming centers of my brain are currently in a state of upheaval for some reason - as if millions of occurrences of a name cried out in terror and were suddenly replaced. Antno From feeley at iro.umontreal.ca Tue Jun 8 23:59:54 2010 From: feeley at iro.umontreal.ca (Marc Feeley) Date: Tue, 8 Jun 2010 23:59:54 -0400 Subject: [racket] [ANN] Call for Papers for 2010 Workshop on Scheme and Functional Programming Message-ID: Please note that the deadline for submitting a paper to the Scheme workshop is 6 days from now... I encourage all authors in their last minute efforts to submit a paper! Please visit the workshop website at http://www.iro.umontreal.ca/~sfp2010 for more details on the submission process and workshop. Wether you submit a paper or not, I hope you will consider participating in the workshop to discuss Scheming with other Schemers like you! Marc Feeley -------------------------------------------------------------------------- Call for Papers 2010 Workshop on Scheme and Functional Programming Montr?al, Qu?bec, Canada Saturday and Sunday August 21-22, 2010 http://www.iro.umontreal.ca/~sfp2010 Important Dates --------------- Submission: 14 June 2010 *** REVISED DEADLINE *** Notification: 2 July 2010 Final papers due: 23 July 2010 All deadlines are at 23:59 UTC (7:59 PM EDT, 6:59 PM CDT, 5:59 PM MDT, and 4:59 PM PDT). Scope ----- The 2010 Workshop on Scheme and Functional Programming is a forum for discussing experience with and future development of the Scheme programming language. Papers are invited concerning all aspects of the design, implementation, theory, and application of Scheme. Some example areas include (but are not limited to): - History, evolution and standardization of Scheme - Applications, experience and industrial uses of Scheme - Program-development environments, debugging, testing - Implementation (interpreters, compilers, tools, benchmarks, etc) - Distributed computing, concurrency, parallelism - Interoperability with other languages, FFIs - Continuations, macros, modules, object systems, types - Theory, formal semantics, correctness - Education - Scheme pearls (elegant, instructive uses of Scheme) There are two classes of submissions, regular papers (up to 12 pages) and short papers (around 6 pages). A Scheme pearl submission is a special category, and should be a short paper presenting an algorithm, idea or programming device using Scheme in a way that is particularly elegant. Following the model of earlier workshops, Scheme pearls and experience papers need not necessarily report original research results; they may instead report practical experience that will be useful to others, re-usable programming idioms, or elegant new ways of approaching a problem. The key criterion for such a paper is that it makes a contribution from which other practitioners can benefit. It is not enough simply to describe a program! The proceedings of the conference will be published as a Universit? de Montr?al technical report. Instructions for authors ------------------------ Authors should submit a 100-200 word abstract and a full paper by the end of Monday, 14 June 2010, Universal Coordinated Time. (The end of the day UTC corresponds to 23:59 UTC, 7:59 PM EDT, 6:59 PM CDT, 5:59 PM MDT, and 4:59 PM PDT.) Papers must be submitted in PDF format, or as PostScript documents that are interpretable by Ghostscript, and they must be printable on US Letter sized paper. Suitable style files for LaTeX: - class file http://www.iro.umontreal.ca/~sfp2010/sigplanconf.cls - style guide http://www.iro.umontreal.ca/~sfp2010/sigplanconf-guide.pdf - template http://www.iro.umontreal.ca/~sfp2010/sigplanconf-template.tex - sample paper http://www.iro.umontreal.ca/~sfp2010/retrospective.tex - sample references http://www.iro.umontreal.ca/~sfp2010/retrospective.bbl Submissions will be carried out electronically via the Web, at http://www.iro.umontreal.ca/~sfp2010/submit.html A submission will be evaluated according to its relevance, correctness, significance, originality, and clarity. It should explain its contributions in both general and technical terms, clearly identifying what has been accomplished, explaining why it is significant, and comparing it with previous work. The technical content should be accessible to a broad audience. There are two classes of submissions, regular papers and short papers: Regular papers -------------- Submissions should be no more than 12 pages (including bibliography and appendices) in standard ACM conference format: two columns, nine point font on ten point baseline, page 20pc (3.33in) wide and 54pc (9in) tall with a column gutter of 2pc (0.33in). Authors wishing to supply additional material to the reviewers beyond the 12 page limit can do so in clearly marked appendices, on the understanding that reviewers may not read the appendices. Submissions that do not meet these guidelines will not be considered. Short papers ------------ Short papers need not present novel research; it is sufficient that they present material of interest or utility to the Scheme or functional-programming community. Scheme pearls submissions should be presented as short papers. Short papers should be formatted with the same guidelines as regular papers, but are expected to be around six pages in length. Organization ------------ Conference Chair and Program Chair - Marc Feeley, Universit? de Montr?al Program Committee - Alan Bawden, independent consultant - Olivier Danvy, Aarhus University - Christopher Dutchyn, University of Saskatchewan - Felix S. Klock II, Northeastern University - Jay McCarthy, Brigham Young University - Scott McKay, ITA software Steering Committee - William D. Clinger, Northeastern University - Marc Feeley, Universit? de Montr?al - Robby Findler, University of Chicago - Dan Friedman, Indiana University - Christian Queinnec, University Paris 6 - Manuel Serrano, INRIA Sophia Antipolis - Olin Shivers, Northeastern University - Mitchell Wand, Northeastern University From clements at brinckerhoff.org Wed Jun 9 00:59:02 2010 From: clements at brinckerhoff.org (John Clements) Date: Tue, 8 Jun 2010 21:59:02 -0700 Subject: [racket] "The Disadvantages of High School Programming" In-Reply-To: <4C0F1587.9060404@appsolutions.com> References: <4C0F0E90.50407@appsolutions.com> <4C0F120F.2060307@neilvandyke.org> <4C0F1587.9060404@appsolutions.com> Message-ID: On Jun 8, 2010, at 9:16 PM, Anton van Straaten wrote: > Neil Van Dyke wrote: >> Anton van Straaten wrote at 06/08/2010 11:46 PM: >>> Noel suggests that many employers aren't willing to pay for the necessary skill, and he's right -- but they pay for the lack of it indirectly, in higher costs, lost customers, unhappy employees and worse. >> I think that was me, not Noel. Our names get confused, but he's the cute Beatle. > > Oops, sorry. I do normally know the difference. That's what I get for responding to a different message than the one I'm directly replying to. > > Or perhaps the naming centers of my brain are currently in a state of upheaval for some reason - as if millions of occurrences of a name cried out in terror and were suddenly replaced. Scheme is peaceful! We have no weapons, you can't possibly...! -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4669 bytes Desc: not available URL: From kwinterling at gmail.com Wed Jun 9 01:04:32 2010 From: kwinterling at gmail.com (Karl Winterling) Date: Tue, 8 Jun 2010 22:04:32 -0700 Subject: [racket] "The Disadvantages of High School Programming" In-Reply-To: References: <4C0F0E90.50407@appsolutions.com> <4C0F120F.2060307@neilvandyke.org> <4C0F1587.9060404@appsolutions.com> Message-ID: On Tue, Jun 8, 2010 at 9:59 PM, John Clements wrote: > > Scheme is peaceful! We have no weapons, you can't possibly...! > You forgot to say where the rebel base is. From clements at brinckerhoff.org Wed Jun 9 01:45:27 2010 From: clements at brinckerhoff.org (John Clements) Date: Tue, 8 Jun 2010 22:45:27 -0700 Subject: [racket] "The Disadvantages of High School Programming" In-Reply-To: References: <4C0F0E90.50407@appsolutions.com> <4C0F120F.2060307@neilvandyke.org> <4C0F1587.9060404@appsolutions.com> Message-ID: <2BB2D3C5-6D31-4567-BB0A-1CEEB3F68C00@brinckerhoff.org> On Jun 8, 2010, at 10:04 PM, Karl Winterling wrote: > On Tue, Jun 8, 2010 at 9:59 PM, John Clements wrote: >> >> Scheme is peaceful! We have no weapons, you can't possibly...! >> > > You forgot to say where the rebel base is. -------------- next part -------------- A non-text attachment was scrubbed... Name: plt-death-star.jpg Type: image/jpg Size: 24378 bytes Desc: not available URL: -------------- next part -------------- (nice small jpeg this time) -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4669 bytes Desc: not available URL: From sgeorge.ml at gmail.com Wed Jun 9 01:51:08 2010 From: sgeorge.ml at gmail.com (Siju George) Date: Wed, 9 Jun 2010 11:21:08 +0530 Subject: [racket] racket build fail on archlinux Message-ID: Hi, I am trying to compile racket on archlinux/i686 Linux 2.6.33-ARCH #1 SMP PREEMPT Thu May 13 12:06:25 CEST 2010 i686 Intel(R) Pentium(R) D CPU 2.66GHz GenuineIntel GNU/Linux and got this error during make ../../../gracket/gc2/../../wxcommon/wxJPEG.cxx: In function ?int wx_write_png(char*, wxBitmap*)?: ../../../gracket/gc2/../../wxcommon/wxJPEG.cxx:967:28: warning: ?png_struct_def::jmpbuf? is deprecated (declared at /usr/include/libpng14/png.h:1114) ../../../gracket/gc2/../../wxcommon/wxJPEG.cxx:967:28: warning: ?png_struct_def::jmpbuf? is deprecated (declared at /usr/include/libpng14/png.h:1114) make[5]: *** [wxJPEG.o] Error 1 make[5]: Leaving directory `/var/software/plt-5.0/src/build/gracket/gc2' make[4]: *** [3m] Error 2 make[4]: Leaving directory `/var/software/plt-5.0/src/build/gracket/gc2' make[3]: *** [3m] Error 2 make[3]: Leaving directory `/var/software/plt-5.0/src/build/gracket' make[2]: *** [gracket-3m] Error 2 make[2]: Leaving directory `/var/software/plt-5.0/src/build' make[1]: *** [3m] Error 2 make[1]: Leaving directory `/var/software/plt-5.0/src/build' make: *** [all] Error 2 what could be the reason? thanks --Siju From rafkind at cs.utah.edu Wed Jun 9 02:08:47 2010 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Wed, 09 Jun 2010 00:08:47 -0600 Subject: [racket] racket build fail on archlinux In-Reply-To: References: Message-ID: <4C0F2FEF.3030304@cs.utah.edu> This is the same issue reported on the arch-linux forums: http://bbs.archlinux.org/viewtopic.php?pid=703488 This came up on IRC as well which is how I know whats wrong (I am telepathic but not on Wednesdays). what version of libpng do you have installed? http://bbs.archlinux.org/viewtopic.php?pid=703488 looks similar to this issue i guess you can just patch the racket source, maybe thats the easiest thing to do does that sound reasonable to you? I have version 1.2 installed. I remember having to get that specific version to build chromium. The standard version that comes with Arch is 1.4. I'll try re-compiling with their official package before I start doing patches :) ok On 06/08/2010 11:51 PM, Siju George wrote: > Hi, > > I am trying to compile racket on archlinux/i686 > > Linux 2.6.33-ARCH #1 SMP PREEMPT Thu May 13 12:06:25 CEST 2010 i686 > Intel(R) Pentium(R) D CPU 2.66GHz GenuineIntel GNU/Linux > > and got this error during make > > > ../../../gracket/gc2/../../wxcommon/wxJPEG.cxx: In function ?int > wx_write_png(char*, wxBitmap*)?: > ../../../gracket/gc2/../../wxcommon/wxJPEG.cxx:967:28: warning: > ?png_struct_def::jmpbuf? is deprecated (declared at > /usr/include/libpng14/png.h:1114) > ../../../gracket/gc2/../../wxcommon/wxJPEG.cxx:967:28: warning: > ?png_struct_def::jmpbuf? is deprecated (declared at > /usr/include/libpng14/png.h:1114) > make[5]: *** [wxJPEG.o] Error 1 > make[5]: Leaving directory `/var/software/plt-5.0/src/build/gracket/gc2' > make[4]: *** [3m] Error 2 > make[4]: Leaving directory `/var/software/plt-5.0/src/build/gracket/gc2' > make[3]: *** [3m] Error 2 > make[3]: Leaving directory `/var/software/plt-5.0/src/build/gracket' > make[2]: *** [gracket-3m] Error 2 > make[2]: Leaving directory `/var/software/plt-5.0/src/build' > make[1]: *** [3m] Error 2 > make[1]: Leaving directory `/var/software/plt-5.0/src/build' > make: *** [all] Error 2 > > > what could be the reason? > > thanks > > --Siju > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users > From noelwelsh at gmail.com Wed Jun 9 04:13:45 2010 From: noelwelsh at gmail.com (Noel Welsh) Date: Wed, 9 Jun 2010 09:13:45 +0100 Subject: [racket] [plt-scheme] Re: Typed scheme: Cannot apply expression of type Procedure, since it is not a function type In-Reply-To: <89B511D1-1030-4610-B570-05A207799F72@gmx.de> References: <20100604062452.2E11E402B6@qua.cs.brown.edu> <8A147445-41AD-4CAC-AF87-EE63D7BC7F03@gmx.de> <89B511D1-1030-4610-B570-05A207799F72@gmx.de> Message-ID: On Tue, Jun 8, 2010 at 9:07 PM, keydana at gmx.de wrote: > I've downloaded racket now, and really it works without the casts (at least my example), but to understand I tried your solutions on my case: David's cast worked fine, but your conversion function Noel did not work in my case (in plt 4.2.5), there was a problem with the Option type: Ah yes, I use the assert function as well. So number->exact-integer is Number -> Option Integer and assert is Option 'a -> 'a. The type defns tell you this. You should definitely read other's code. I recommend my code, because it's awesome. Better yet, you should implement the missing parts for me ;-P (Really, do read code. It is very useful. I happen to think my code is fairly simple, but you might not find this is the case if you don't understand the application domain.) > O course it's not a problem now any more, the reason I tried this out was that looking at (both your) code, I was puzzled how these casts would work in TS... my main experience with casts being from Java, I was missing something like the (Object) part in, e.g., > > return (Object) astring; > > But it looks like in TS, it's the return type of the function which accomplishes everything, - would that be correct? I don't understand what you mean by "it's the return type of the function which accomplishes everything". Anyway, TS has what is called "occurrence typing". Basically this means you can use predicates as ...err... type casts. This is going beyond my knowledge so I'll just refer you to the paper and LtU discussion: http://lambda-the-ultimate.org/node/2622 N. From samth at ccs.neu.edu Wed Jun 9 08:05:33 2010 From: samth at ccs.neu.edu (Sam Tobin-Hochstadt) Date: Wed, 9 Jun 2010 08:05:33 -0400 Subject: [racket] [scribble] rendering syntax In-Reply-To: <0C590F89-98E7-4F31-B4BF-632535961E24@dcc.uchile.cl> References: <53B5E8CA-292F-4B8C-B14C-5BC9C2F3C600@dcc.uchile.cl> <1DCE61AA-5CA8-4888-A4E6-8EE5E8C5E639@dcc.uchile.cl> <1C4F17DC-8A31-4B9C-B2CB-6BA88FAE2940@brinckerhoff.org> <0C590F89-98E7-4F31-B4BF-632535961E24@dcc.uchile.cl> Message-ID: On Tue, Jun 8, 2010 at 11:27 PM, Eric Tanter wrote: > Yes, Carl got my point right. And yes, that's like showing square brackets in the stepper ;) Right now, the two cases are slightly asymmetric, since there's a syntax property indicating the use of [] or {}, but none indicating the use of ', #', #`, etc. Similarly there's no syntax property indicating the difference between (a b) and (a . (b)) (something I once tried to fix, but gave up on). -- sam th samth at ccs.neu.edu From toddobryan at gmail.com Wed Jun 9 08:23:07 2010 From: toddobryan at gmail.com (Todd O'Bryan) Date: Wed, 9 Jun 2010 08:23:07 -0400 Subject: [racket] macro help redux In-Reply-To: References: <4C0EBCAE.3060908@ccs.neu.edu> <4C0EE953.6030108@ccs.neu.edu> Message-ID: OK. I've also attached a zipped folder that has the two files. Here's aug-struct.rkt: #lang racket (require (for-syntax racket/struct-info)) (provide define-aug-struct) ;; stolen from define-struct (define-for-syntax (build-name id . parts) (datum->syntax id (string->symbol (apply string-append (map (lambda (p) (cond [(syntax? p) (symbol->string (syntax-e p))] [(symbol? p) (symbol->string p)] [(string? p) p])) parts))) id)) ;; this unifies the super's info with the sub's info, allowing ;; you to override defaults and contract info (define-for-syntax (unify super-info sub-info) (append (map (? (sup) (let ([sub (assoc (car sup) sub-info)]) (or sub sup))) super-info) (filter (? (sub) (not (assoc (car sub) super-info))) sub-info))) ;; the general idea is that, assuming sup is either another aug-struct ;; or #f, ;; ;; (define-aug-struct (sub sup) ;; ([field1 contract1] ;; [field2 contract2 default2] ;; ...)) ;; ;; should be expanded to ;; ;; (define-syntax sub-info ;; '([field1 contract1] [field2 contract2 default2] ...)) ;; so I can grab this info later to unify it with any sub-structs ;; (define-struct (sub sup) ;; (field2)) assumes field1 was defined in sup ;; (define (create-sub #:field1 field1 ;; #:field2 [field2 default2]) ;; (make-sub field1 field2)) ;; (provide/contract ;; [create-sub (-> #:field1 contract1 ;; #:field2 contract2 ;; sub?)]) (define-syntax (define-aug-struct stx) (syntax-case stx () [(_ (id super-id) field-info-syntax) ; TODO: error-checking (let* ([id+maybe-super (if (syntax->datum #'super-id) #'(id super-id) #'id)] [super-info (if (syntax->datum #'super-id) (syntax-local-value (build-name #'super-id #'super-id "-info")) '())] [id-name (syntax->datum #'id)] [field-info (syntax->datum #'field-info-syntax)] [unified-info (unify super-info field-info)] [subfield-names (map car (filter (? (info) (not (assoc (car info) super-info))) field-info))] [all-field-names (map car unified-info)] [kw-names (map (? (fld) (string->keyword (symbol->string fld))) all-field-names)] [create-id (build-name #'id "create-" id-name)] [no-default (gensym)] [defaults (map (? (info) (if (= 2 (length info)) no-default (caddr info))) unified-info)] [create-formals (cons create-id (foldr append '() (map (? (kw fld def) (if (equal? no-default def) (list kw fld) (list kw (list fld def)))) kw-names all-field-names defaults)))] [contracts (map cadr unified-info)] [create-contract (cons '-> (foldr append `(,(build-name #'id id-name "?")) (map (? (kw contr) (list kw contr)) kw-names contracts)))] [make-id (build-name #'id "make-" id-name)] [id-info (build-name #'id id-name "-info")]) (with-syntax ([unified-info-syntax unified-info]) #`(begin (define-syntax #,id-info (syntax->datum #'unified-info-syntax)) (define-struct #,id+maybe-super #,subfield-names #:transparent) (define #,create-formals (#,make-id #, at all-field-names)) (provide/contract [#,create-id #,create-contract]))))] [(_ id field-info) #'(define-aug-struct (id #f) field-info)])) and here's date-field.rkt: #lang racket (require "aug-struct.rkt") (define-struct db-date (year month day)) (define-aug-struct date-field ([name string?] [contract any/c db-date?])) So, it seems to be evaluating db-date? in the context of aug-struct instead of of date-field. I'm sure I'm just screwing something minor up that will prove my lack of understanding of how macro expansion actually works. :-) Thanks for looking! Todd On Tue, Jun 8, 2010 at 10:12 PM, Todd O'Bryan wrote: > Let me see if I can make a smaller example that does the same thing. > The one I'm currently working on is a big mess... > > On Tue, Jun 8, 2010 at 9:07 PM, Ryan Culpepper wrote: >> Can you post your macro and the example that produces the expansion you >> included in your previous message? My earlier answer was based on a >> conjecture about how your macro behaved, and it would be easier to provide a >> complete answer if I can see exactly what you're doing. >> >> Ryan >> >> Todd O'Bryan wrote: >>> >>> It does, but I'm confused. Does that mean that any macro I define that >>> includes something like a contract has to require every predicate it >>> could conceivably want? How do I define a macro that will allow me to >>> specify a predicate later, maybe even one that didn't exist when I >>> wrote the macro? Or is that not possible? >> >>> >>> >>> Or, and this kind of makes sense as I'm writing it, is there a way to >>> tell a macro to wait to evaluate something in the location it's used, >>> rather than in its own scope? >>> >>> Todd >>> >>> On Tue, Jun 8, 2010 at 5:57 PM, Ryan Culpepper wrote: >>>> >>>> Todd O'Bryan wrote: >>>>> >>>>> I feel like I'm getting there, but macros still do things that confuse >>>>> me. >>>>> >>>>> According to the Macro Stepper, I've written a macro that expands to: >>>>> >>>>> (module fields racket >>>>> ?(#%module-begin >>>>> ?(require "tables.rkt") >>>>> ?(require "../date-utils.rkt") >>>>> ?(begin >>>>> ? ?(define-struct >>>>> ? ? date-field >>>>> ? ? (contract) >>>>> ? ? #:transparent) >>>>> ? ?(define (create-date-field >>>>> ? ? ? ? ? ? #:contract >>>>> ? ? ? ? ? ? (contract db-date?)) >>>>> ? ? ?(make-date-field contract)) >>>>> ? ?(provide/contract >>>>> ? ? (create-date-field >>>>> ? ? ?(-> #:contract any/c date-field?)))))) >>>>> >>>>> At the next step of the expansion, I get the error: >>>>> >>>>> expand: unbound identifier in module >>>>> db-date? >>>>> >>>>> The only problem is that "../date-utils.rkt" provides db-date? and if >>>>> I put everything inside the #%module-begin into its own DrRacket >>>>> definitions window, it runs without error. For some reason, db-date? >>>>> isn't available when it's needed, but I can't figure out how to make >>>>> it available. >>>>> >>>>> What am I doing wrong? >>>> >>>> Is your macro defined in "tables.rkt"? If that's the case, it doesn't >>>> matter >>>> whether the module where it's *used* imports date-utils, but whether the >>>> module where the macro is *defined* imports date-utils. That's the idea >>>> of >>>> hygienic macros; they're lexically scoped. >>>> >>>> You can use the macro stepper to check an identifier's binding by >>>> clicking >>>> on the identifier (here, the reference to 'db-date?'), then opening the >>>> "Syntax properties" pane using the Stepper window. It'll tell you what >>>> bindings, if any, the identifier refers to. >>>> >>>> Did that help? >>>> >>>> Ryan >>>> >>>> >> >> > -------------- next part -------------- A non-text attachment was scrubbed... Name: aug-struct.zip Type: application/zip Size: 1646 bytes Desc: not available URL: From curtdutt at gmail.com Wed Jun 9 11:36:56 2010 From: curtdutt at gmail.com (Curtis Dutton) Date: Wed, 9 Jun 2010 11:36:56 -0400 Subject: [racket] Writing a file from a web servlet Message-ID: I have a very simple web servlet application that tries to write data to a file as a sort of miniature database. Here is the code that writes the file. (define (save-costs costs) (with-output-to-file file-name (lambda () (write (serialize costs))) #:exists 'truncate #:mode 'text)) In normal scheme this code works fine and creates the file "costs.dat" and everything is merry. Inside the web server it does not create the file anywhere or update it thought the code executes without error. The web server is able to read the file on startup, just not write it. What am I doing wrong here? Thanks, Curtis -------------- next part -------------- An HTML attachment was scrubbed... URL: From ryanc at ccs.neu.edu Wed Jun 9 11:43:45 2010 From: ryanc at ccs.neu.edu (Ryan Culpepper) Date: Wed, 09 Jun 2010 09:43:45 -0600 Subject: [racket] [scribble] rendering syntax In-Reply-To: References: <53B5E8CA-292F-4B8C-B14C-5BC9C2F3C600@dcc.uchile.cl> <1DCE61AA-5CA8-4888-A4E6-8EE5E8C5E639@dcc.uchile.cl> <1C4F17DC-8A31-4B9C-B2CB-6BA88FAE2940@brinckerhoff.org> <0C590F89-98E7-4F31-B4BF-632535961E24@dcc.uchile.cl> Message-ID: <4C0FB6B1.1050909@ccs.neu.edu> Sam Tobin-Hochstadt wrote: > On Tue, Jun 8, 2010 at 11:27 PM, Eric Tanter wrote: >> Yes, Carl got my point right. And yes, that's like showing square brackets in the stepper ;) > > Right now, the two cases are slightly asymmetric, since there's a > syntax property indicating the use of [] or {}, but none indicating > the use of ', #', #`, etc. Similarly there's no syntax property > indicating the difference between (a b) and (a . (b)) (something I > once tried to fix, but gave up on). The macro stepper recognizes distinguishes #'_ from (syntax _) by checking the source location of the 'syntax' identifier. If it's the same as the whole form, it was produced by the reader macro. Ryan From noelwelsh at gmail.com Wed Jun 9 11:46:57 2010 From: noelwelsh at gmail.com (Noel Welsh) Date: Wed, 9 Jun 2010 16:46:57 +0100 Subject: [racket] Writing a file from a web servlet In-Reply-To: References: Message-ID: This should work, so either the file is being written in an unexpected location or the save-costs function is not be called. You could diagnose the later with a simple printf statement. You could also try a minimal servlet to ensure the file is being written in the location you expect. HTH, N. On Wed, Jun 9, 2010 at 4:36 PM, Curtis Dutton wrote: > I have a very simple web servlet application that tries to write data to a > file as a sort of?miniature?database. > Here is the code that writes the file. > (define (save-costs costs) > ??(with-output-to-file > ?? ? ?file-name > ?? ? ?(lambda () > ?? ? ? ?(write (serialize costs))) > ?? ?#:exists 'truncate > ?? ?#:mode 'text)) > > In normal scheme this code works fine and creates the file "costs.dat" and > everything is merry. > Inside the web server it does not create the file anywhere or update it > thought the code executes without error. > The web server is able to read the file on startup, just not write it. > What am I doing wrong here? > > Thanks, > ?? ? Curtis > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > From jay.mccarthy at gmail.com Wed Jun 9 12:34:24 2010 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Wed, 9 Jun 2010 12:34:24 -0400 Subject: [racket] Writing a file from a web servlet In-Reply-To: References: Message-ID: <035D2FB4-1357-49F3-9EBB-3338B06B232E@gmail.com> Also use define-runtime-path to have stable path references. Jay Sent from my iPhone On Jun 9, 2010, at 11:46 AM, Noel Welsh wrote: > This should work, so either the file is being written in an unexpected > location or the save-costs function is not be called. You could > diagnose the later with a simple printf statement. You could also try > a minimal servlet to ensure the file is being written in the location > you expect. > > HTH, > N. > > On Wed, Jun 9, 2010 at 4:36 PM, Curtis Dutton > wrote: >> I have a very simple web servlet application that tries to write >> data to a >> file as a sort of miniature database. >> Here is the code that writes the file. >> (define (save-costs costs) >> (with-output-to-file >> file-name >> (lambda () >> (write (serialize costs))) >> #:exists 'truncate >> #:mode 'text)) >> >> In normal scheme this code works fine and creates the file >> "costs.dat" and >> everything is merry. >> Inside the web server it does not create the file anywhere or >> update it >> thought the code executes without error. >> The web server is able to read the file on startup, just not write >> it. >> What am I doing wrong here? >> >> Thanks, >> Curtis >> _________________________________________________ >> For list-related administrative tasks: >> http://lists.racket-lang.org/listinfo/users >> > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From mikeg at psg.com Wed Jun 9 13:34:15 2010 From: mikeg at psg.com (Mike G.) Date: Wed, 9 Jun 2010 10:34:15 -0700 Subject: [racket] Off-topic: Scheme for JVM? Message-ID: <20100609173415.GA9964@goblin.punk.net> Until Racket has a back end to the JVM, what's a good alternative? Wikipedia lists Bigloo, Kawa, SISC, and JScheme, (http://en.wikipedia.org/wiki/List_of_JVM_languages) but I've never used any of them yet. Although not a dialect of Scheme, Clojure gets a lot of attention. Any experience or opinions? Thanks, MJG From sk at cs.brown.edu Wed Jun 9 14:15:30 2010 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Wed, 9 Jun 2010 14:15:30 -0400 Subject: [racket] Off-topic: Scheme for JVM? In-Reply-To: <20100609173415.GA9964@goblin.punk.net> References: <20100609173415.GA9964@goblin.punk.net> Message-ID: We use SISC in some of our reseach work, and it works well. However, I believe it is no longer maintained (or at least not actively developed -- though it's been robust enough for our needs), which is a strike against it. Since Google has some investment in Kawa, I'm sure it's in good shape. Finally, Bigloo is awesome. If you want a JVM back-end, would you be happy enough with a JavaScript back-end? (-: Shriram From dherman at ccs.neu.edu Wed Jun 9 14:23:23 2010 From: dherman at ccs.neu.edu (David Herman) Date: Wed, 9 Jun 2010 11:23:23 -0700 Subject: [racket] Off-topic: Scheme for JVM? In-Reply-To: References: <20100609173415.GA9964@goblin.punk.net> Message-ID: Rhino Racket! http://images.clipartof.com/small/36143-Clipart-Illustration-Of-A-Casual-Musician-Rhino-Playing-A-Pink-Guitar.jpg On Jun 9, 2010, at 11:15 AM, Shriram Krishnamurthi wrote: > We use SISC in some of our reseach work, and it works well. However, > I believe it is no longer maintained (or at least not actively > developed -- though it's been robust enough for our needs), which is a > strike against it. Since Google has some investment in Kawa, I'm > sure it's in good shape. Finally, Bigloo is awesome. > > If you want a JVM back-end, would you be happy enough with a > JavaScript back-end? (-: > > Shriram > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From stepnem at gmail.com Wed Jun 9 15:25:28 2010 From: stepnem at gmail.com (=?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?=) Date: Wed, 9 Jun 2010 21:25:28 +0200 Subject: [racket] DrScheme macro stepper ignoring color settings? In-Reply-To: <4C0EAD1A.1040608@ccs.neu.edu> References: <87k4qfdl8k.fsf@gmail.com> <87ocflogs0.fsf@gmail.com> <4C0EAD1A.1040608@ccs.neu.edu> Message-ID: <20100609192528.GI6485@headley> On Tue, Jun 08, 2010 at 02:50:34PM -0600, Ryan Culpepper wrote: > The macro stepper should work in white-on-black color mode now. Let > me know if you have any problems with it. Thank you all for the replies and fixing the problem. It even made me finally try and build Racket; unfortunately, after having run `make install' for 50 minutes, the OOM killer started to nuke other apps, so I had to kill the process :-) (and it's not like there wasn't plenty free RAM originally -- some 700 MB; for some reason racket deemed it a good idea to use all of it; I probably don't really know what I'm talking about -- I generally prefer pre-built PLT(/Racket) packages because `make install' always takes insane amount of time and resources, but I did build PLT successfully in the past). In any case, I can't comment on the fix for now. Thanks again anyway, ?t?p?n From chust at web.de Wed Jun 9 16:07:14 2010 From: chust at web.de (Thomas Chust) Date: Wed, 9 Jun 2010 22:07:14 +0200 Subject: [racket] Off-topic: Scheme for JVM? In-Reply-To: <20100609173415.GA9964@goblin.punk.net> References: <20100609173415.GA9964@goblin.punk.net> Message-ID: 2010/6/9 Mike G. : > Until Racket has a back end to the JVM, what's a good > alternative? ?Wikipedia lists Bigloo, Kawa, SISC, and JScheme, > (http://en.wikipedia.org/wiki/List_of_JVM_languages) but I've > never used any of them yet. ?Although not a dialect of Scheme, > Clojure gets a lot of attention. > [...] Hello, personally, I would recommend Kawa or Bigloo. Both are reasonably featureful Scheme dialects, the interface to the Java runtime is decent and you can actually compile scheme code to Java classes. SISC is relatively old, slower compared to Kawa or Bigloo because it is a pure interpreter and it has a rather clumsy Scheme to Java interface compared with Kawa or Bigloo -- apart from that it seems to be well designed and work well, too. I would not recommend Clojure, although it has some fancy features and is currently en vogue, because the standard library seems to be in a very bad shape and full of bugs. Ciao, Thomas -- When C++ is your hammer, every problem looks like your thumb. From ryanc at ccs.neu.edu Wed Jun 9 19:44:36 2010 From: ryanc at ccs.neu.edu (Ryan Culpepper) Date: Wed, 09 Jun 2010 17:44:36 -0600 Subject: [racket] macro help redux In-Reply-To: References: <4C0EBCAE.3060908@ccs.neu.edu> <4C0EE953.6030108@ccs.neu.edu> Message-ID: <4C102764.3080805@ccs.neu.edu> On 06/09/2010 06:23 AM, Todd O'Bryan wrote: > > [...] > > ;; (define-aug-struct (sub sup) > ;; ([field1 contract1] > ;; [field2 contract2 default2] > ;; ...)) > ;; > ;; should be expanded to > ;; > ;; (define-syntax sub-info > ;; '([field1 contract1] [field2 contract2 default2] ...)) > ;; so I can grab this info later to unify it with any sub-structs That's the problem. The contracts and defaults are expressions, but here you're quoting them, which throws away all of their lexical context information. Instead, you should produce something like this: (define-syntax sub-info (list (list 'field1 (quote-syntax contract1)) (list 'field2 (quote-syntax contract2) (quote-syntax default2)) ___)) quote-syntax is like quote, but it evaluates to syntax, and it preserves lexical context. In general, never call syntax->datum or use something else that has that effect (like quote) on anything you intend to treat as an *expression*. For example: > (define-syntax (define-aug-struct stx) > (syntax-case stx () > [(_ (id super-id) field-info-syntax) > ___ > [field-info (syntax->datum #'field-info-syntax)] field-info-syntax contains expressions; don't use syntax->datum. Instead, I'd rewrite the macro pattern to this: (_ (id super-id) (field-spec ...)) Then write a helper function that takes it apart using syntax-case, syntax->list, or something like that. > [create-contract > (cons '-> > (foldr append `(,(build-name #'id id-name "?")) > (map (? (kw contr) > (list kw contr)) > kw-names contracts)))] Using '-> (a symbol) actually happens to work here, but only because of the implicit coercion done by quasisyntax later. Looking just at this bit of code, I have to wonder: Do you apply some other, unexpected, lexical context later? What lexical context does quasiquote implicitly supply? Use #'-> instead, and the lexical context is (more) clear.* Ryan * To be fair, you still have to look to see if the macro is introducing a binding that shadows ->. From mark.engelberg at gmail.com Wed Jun 9 21:19:28 2010 From: mark.engelberg at gmail.com (Mark Engelberg) Date: Wed, 9 Jun 2010 18:19:28 -0700 Subject: [racket] Off-topic: Scheme for JVM? In-Reply-To: References: <20100609173415.GA9964@goblin.punk.net> Message-ID: On Wed, Jun 9, 2010 at 1:07 PM, Thomas Chust wrote: > I would not recommend Clojure, although it has some fancy features and > is currently en vogue, because the standard library seems to be in a > very bad shape and full of bugs. I completely disagree with this. I have found Clojure to be extremely stable, and the standard library to be well-organized and relatively bug-free. Even the bleeding edge builds are surprisingly stable, although you're certainly more likely to encounter problems than if you use one of the official releases. I wouldn't hesitate to recommend Clojure to anyone who likes Scheme/Lisp/Racket but requires interoperability with Java -- it was designed from the ground up with interoperability in mind. Clojure is definitely a new Lisp dialect, and is not exactly the same as Scheme. Many of the changes are, in my opinion, improvements. The built-in datatypes (e.g., the persistent vectors and hash maps) are a joy to use, and are elegantly layered into interfaces that allow them to be manipulated polymorphically. For example, you can manipulate vectors with sequence functions (first, rest, etc.), associative data structure functions (assoc, get, etc.), as well as vector-specific functions, and you can even use a vector as a function of its indices. Racket's sequence and collection types feel clunky in comparison, and other Schemes are even worse. Of course, Clojure makes compromises to exist on the JVM -- no complex numbers, no continuations, no tail-call optimization (although it offers a few workarounds). Furthermore, the Racket ecosystem (e.g., Typed Racket, Scribble, etc.) has a rather large number of extraordinary features that Clojure doesn't even attempt to address. So if you're expecting a clone of Racket that can work on the JVM, you'll be disappointed. But what Clojure does, it does rather well, and I can say without reservation that Clojure is a rather pleasant way to get real work done on the JVM using a Scheme-like functional programming approach. From chust at web.de Thu Jun 10 04:08:20 2010 From: chust at web.de (Thomas Chust) Date: Thu, 10 Jun 2010 10:08:20 +0200 Subject: [racket] Off-topic: Scheme for JVM? In-Reply-To: References: <20100609173415.GA9964@goblin.punk.net> Message-ID: 2010/6/10 Mark Engelberg : > On Wed, Jun 9, 2010 at 1:07 PM, Thomas Chust wrote: >> I would not recommend Clojure, although it has some fancy features and >> is currently en vogue, because the standard library seems to be in a >> very bad shape and full of bugs. > > I completely disagree with this. ?I have found Clojure to be extremely > stable, and the standard library to be well-organized and relatively > bug-free. > [...] Hello, maybe it improved in the past 6 month ? I haven't tried Clojure since then. Or maybe some areas of the standard library get less attention than others. Most of the bugs that really annoyed me were related to dispatch hierarchies and some of them were caused by very simple spelling mistakes, were already reported with patches but didn't get fixed for months anyway. I conclude form this that there are at least largely untested / unattended areas of the standard library. Probably not everything about Clojure is broken, but since all the particular non-trivial things I tried were broken, the system didn't leave a good impression with me. Ciao, Thomas -- When C++ is your hammer, every problem looks like your thumb. From lists at lowfrequency.org Thu Jun 10 09:11:06 2010 From: lists at lowfrequency.org (evan.raskob [lists]) Date: Thu, 10 Jun 2010 14:11:06 +0100 Subject: [racket] compiling 64bit for OS X 10.6? Message-ID: Hi, I'm trying to get Racket to compile on 10.6.3. I follow the instructions: mkdir build cd build ../configure --enable-mac64 --enable-sgc --disable-mred make ...but it fails during the make process: g++ -I../../../wxmac/src/../../racket/sgc -I../../../wxmac/src/../../wxmac/include/base -I../../../wxmac/src/../../wxmac/include/mac -I../../../wxmac/src/../../wxcommon -I../../../wxmac/src/../../gracket/wxme/ -I./../../racket/ -I../../../wxmac/src/../../racket/include/ -fno-common -DUSE_SENORA_GC -fpascal-strings -DOPERATOR_NEW_ARRAY -Dwx_mac -Wall -g -O2 -fno-rtti -DOS_X -D_DARWIN_UNLIMITED_SELECT -pthread -MMD -DWX_CARBON -I../../../wxmac/src/../contrib/wxxpm/libxpm.34b/lib -I../../../wxmac/src/../../a-list/c-headers/ -I../../../wxmac/src/../utils/image/src -DFOR_MAC -o create.o -c ../../../wxmac/src/../contrib/wxxpm/libxpm.34b/lib/create.cpp ../../../wxmac/src/../contrib/wxxpm/libxpm.34b/lib/create.cpp: In function ?void MACSetImagePixels(GDevice**, XImage*, unsigned int, unsigned int, unsigned int*, Pixel*)?: ../../../wxmac/src/../contrib/wxxpm/libxpm.34b/lib/create.cpp:1467: error: ?GetGWorld? was not declared in this scope ../../../wxmac/src/../contrib/wxxpm/libxpm.34b/lib/create.cpp:1468: error: ?SetGWorld? was not declared in this scope ../../../wxmac/src/../contrib/wxxpm/libxpm.34b/lib/create.cpp:1481: error: ?SetCPixel? was not declared in this scope ../../../wxmac/src/../contrib/wxxpm/libxpm.34b/lib/create.cpp: At global scope: ../../../wxmac/src/../contrib/wxxpm/libxpm.34b/lib/create.cpp:165: warning: ?int closeness_cmp(const void*, const void*)? defined but not used make[5]: *** [create.o] Error 1 make[4]: *** [wx_mac-min] Error 2 make[3]: *** [3m] Error 2 make[2]: *** [gracket-3m] Error 2 make[1]: *** [3m] Error 2 make: *** [all] Error 2 Does anyone know what the issue could be? Thanks Evan From samth at ccs.neu.edu Thu Jun 10 09:19:49 2010 From: samth at ccs.neu.edu (Sam Tobin-Hochstadt) Date: Thu, 10 Jun 2010 09:19:49 -0400 Subject: [racket] compiling 64bit for OS X 10.6? In-Reply-To: References: Message-ID: On Thu, Jun 10, 2010 at 9:11 AM, evan.raskob [lists] wrote: > Hi, > > I'm trying to get Racket to compile on 10.6.3. ?I follow the instructions: > > mkdir build > cd build > ../configure --enable-mac64 --enable-sgc --disable-mred > make I think you need to change --disable-mred to --disable-gracket. The error you're getting is in the GUI library build, which you should be disabling. -- sam th samth at ccs.neu.edu From lists at lowfrequency.org Thu Jun 10 09:30:35 2010 From: lists at lowfrequency.org (evan.raskob [lists]) Date: Thu, 10 Jun 2010 14:30:35 +0100 Subject: [racket] compiling 64bit for OS X 10.6? In-Reply-To: References: Message-ID: <65024177-643C-41CD-9DED-D973545242EE@lowfrequency.org> Great, that seems to work, thanks! FYI, I copied the options that were in the README in the src directory of the latest Racket Source (5.0), so that needs to be changed. Best Evan On 10 Jun 2010, at 14:19, Sam Tobin-Hochstadt wrote: > On Thu, Jun 10, 2010 at 9:11 AM, evan.raskob [lists] > wrote: >> Hi, >> >> I'm trying to get Racket to compile on 10.6.3. I follow the instructions: >> >> mkdir build >> cd build >> ../configure --enable-mac64 --enable-sgc --disable-mred >> make > > I think you need to change --disable-mred to --disable-gracket. The > error you're getting is in the GUI library build, which you should be > disabling. > > -- > sam th > samth at ccs.neu.edu From etanter at dcc.uchile.cl Thu Jun 10 09:49:55 2010 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Thu, 10 Jun 2010 09:49:55 -0400 Subject: [racket] arrows in macro stepper Message-ID: <69244FBC-4E84-47C0-855E-A04EFEEEB106@dcc.uchile.cl> Hi, A simple question: what exactly are those arrows with question mark in the macro stepper? (see picture below) I noticed that they seem to appear only if there is an occurrence of the same identifier with a different color in between (ie. in the example below, if (display it) is not there, then the second arrow is blue, and without question mark). I couldn't find a precise explanation in the guide. Thanks, -- ?ric -------------- next part -------------- A non-text attachment was scrubbed... Name: arrows.png Type: image/png Size: 18315 bytes Desc: not available URL: From lists at lowfrequency.org Thu Jun 10 10:19:14 2010 From: lists at lowfrequency.org (evan.raskob [lists]) Date: Thu, 10 Jun 2010 15:19:14 +0100 Subject: [racket] compiling 64bit for OS X 10.6? In-Reply-To: <65024177-643C-41CD-9DED-D973545242EE@lowfrequency.org> References: <65024177-643C-41CD-9DED-D973545242EE@lowfrequency.org> Message-ID: <7E6E066E-9A21-4D74-A994-0F27A925D942@lowfrequency.org> One further problem - after it builds raco, there are more errors with mzscheme: raco setup: post-installing: help raco setup: post-installing: mred raco setup: post-installing: mysterx raco setup: post-installing: mzcom raco setup: post-installing: mzscheme file-position: expects type as 2nd argument, given: #f; other arguments were: # raco setup: post-installing: racket/gui raco setup: done raco setup: raco setup: error: during Post Install for mzscheme raco setup: file-position: expects type as 2nd argument, given: #f; other arguments were: # make[1]: *** [install-3m] Error 1 make: *** [install] Error 2 On 10 Jun 2010, at 14:30, evan.raskob [lists] wrote: > Great, that seems to work, thanks! > > FYI, I copied the options that were in the README in the src directory of the latest Racket Source (5.0), so that needs to be changed. > > Best > Evan > > > On 10 Jun 2010, at 14:19, Sam Tobin-Hochstadt wrote: > >> On Thu, Jun 10, 2010 at 9:11 AM, evan.raskob [lists] >> wrote: >>> Hi, >>> >>> I'm trying to get Racket to compile on 10.6.3. I follow the instructions: >>> >>> mkdir build >>> cd build >>> ../configure --enable-mac64 --enable-sgc --disable-mred >>> make >> >> I think you need to change --disable-mred to --disable-gracket. The >> error you're getting is in the GUI library build, which you should be >> disabling. >> >> -- >> sam th >> samth at ccs.neu.edu > > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From mflatt at cs.utah.edu Thu Jun 10 10:53:08 2010 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu, 10 Jun 2010 10:53:08 -0400 Subject: [racket] compiling 64bit for OS X 10.6? In-Reply-To: <7E6E066E-9A21-4D74-A994-0F27A925D942@lowfrequency.org> References: <65024177-643C-41CD-9DED-D973545242EE@lowfrequency.org> <7E6E066E-9A21-4D74-A994-0F27A925D942@lowfrequency.org> Message-ID: <20100610145309.3CE4B65011B@mail-svr1.cs.utah.edu> Thanks for the report. I have a repair for this for the next version --- but I don't think I've pushed it to the main git repo, yet. If not, I'll push sometime soon. At Thu, 10 Jun 2010 15:19:14 +0100, "evan.raskob [lists]" wrote: > One further problem - after it builds raco, there are more errors with > mzscheme: > > raco setup: post-installing: help > raco setup: post-installing: mred > raco setup: post-installing: mysterx > raco setup: post-installing: mzcom > raco setup: post-installing: mzscheme > file-position: expects type as 2nd > argument, given: #f; other arguments were: > # > raco setup: post-installing: racket/gui > raco setup: done > raco setup: > raco setup: error: during Post Install for mzscheme > raco setup: file-position: expects type > as 2nd argument, given: #f; other arguments were: > # > make[1]: *** [install-3m] Error 1 > make: *** [install] Error 2 > > > > > On 10 Jun 2010, at 14:30, evan.raskob [lists] wrote: > > > Great, that seems to work, thanks! > > > > FYI, I copied the options that were in the README in the src directory of > the latest Racket Source (5.0), so that needs to be changed. > > > > Best > > Evan > > > > > > On 10 Jun 2010, at 14:19, Sam Tobin-Hochstadt wrote: > > > >> On Thu, Jun 10, 2010 at 9:11 AM, evan.raskob [lists] > >> wrote: > >>> Hi, > >>> > >>> I'm trying to get Racket to compile on 10.6.3. I follow the instructions: > >>> > >>> mkdir build > >>> cd build > >>> ../configure --enable-mac64 --enable-sgc --disable-mred > >>> make > >> > >> I think you need to change --disable-mred to --disable-gracket. The > >> error you're getting is in the GUI library build, which you should be > >> disabling. > >> > >> -- > >> sam th > >> samth at ccs.neu.edu > > > > _________________________________________________ > > For list-related administrative tasks: > > http://lists.racket-lang.org/listinfo/users > > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From ryanc at ccs.neu.edu Thu Jun 10 11:46:33 2010 From: ryanc at ccs.neu.edu (Ryan Culpepper) Date: Thu, 10 Jun 2010 09:46:33 -0600 Subject: [racket] arrows in macro stepper In-Reply-To: <69244FBC-4E84-47C0-855E-A04EFEEEB106@dcc.uchile.cl> References: <69244FBC-4E84-47C0-855E-A04EFEEEB106@dcc.uchile.cl> Message-ID: <4C1108D9.8030802@ccs.neu.edu> Eric Tanter wrote: > Hi, > > A simple question: what exactly are those arrows with question mark > in the macro stepper? (see picture below) I noticed that they seem to > appear only if there is an occurrence of the same identifier with a > different color in between (ie. in the example below, if (display it) > is not there, then the second arrow is blue, and without question > mark). > > I couldn't find a precise explanation in the guide. The blue arrows indicate "definite" references and the purple arrows indicate "apparent" references. A reference is definite when it lies in the exapnded part of the program. In the unexpanded part of the program (approximately, the part after the redex), things that look like references might be changed by intervening macros. They might become binding occurrences themselves, or expansion might uncover a binding closer than the one apparent before expansion starts. To illustrate, run the following program in the macro stepper: #lang racket (define (x) (cons x (let ([x 1]) (cons x (let ([x 2]) x))))) Set the macro hiding policy to "Custom"; click any occurrence of 'let' in the program and click "Show macro". At first, all of x's seem to refer to the module-level binding, but as macro expansion progresses it discovers the binding structure. Some purple arrows turn blue and others disappear as new bindings are uncovered. Check Syntax also has purple arrows that point into syntax constants (eg, macro templates). They mean roughly the same thing: who knows how apparent references in the syntax will eventually turn out? Ryan From raould at gmail.com Thu Jun 10 13:41:54 2010 From: raould at gmail.com (Raoul Duke) Date: Thu, 10 Jun 2010 10:41:54 -0700 Subject: [racket] "The Disadvantages of High School Programming" In-Reply-To: References: Message-ID: On Tue, Jun 8, 2010 at 3:22 PM, Joe Marshall wrote: > That's the problem. ?Maybe it shouldn't be the case. ?Variations on this > statement are alarming: > > ``It's quite possible to be a productive and successful physician > without having a > solid understanding of medicine.'' i work in the video game world, so i see another side to this: It is quite possible for an artist to be productive and successful without having a solid understanding of material science. sincerely. From etanter at dcc.uchile.cl Thu Jun 10 13:56:27 2010 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Thu, 10 Jun 2010 13:56:27 -0400 Subject: [racket] arrows in macro stepper In-Reply-To: <4C1108D9.8030802@ccs.neu.edu> References: <69244FBC-4E84-47C0-855E-A04EFEEEB106@dcc.uchile.cl> <4C1108D9.8030802@ccs.neu.edu> Message-ID: <8299507E-B2A5-42FB-8E69-DA43730C0525@dcc.uchile.cl> Thanks a lot Ryan for the explanation, -- ?ric On Jun 10, 2010, at 11:46 AM, Ryan Culpepper wrote: > Eric Tanter wrote: >> Hi, >> A simple question: what exactly are those arrows with question mark >> in the macro stepper? (see picture below) I noticed that they seem to >> appear only if there is an occurrence of the same identifier with a >> different color in between (ie. in the example below, if (display it) >> is not there, then the second arrow is blue, and without question >> mark). >> I couldn't find a precise explanation in the guide. > > The blue arrows indicate "definite" references and the purple arrows indicate "apparent" references. A reference is definite when it lies in the exapnded part of the program. In the unexpanded part of the program (approximately, the part after the redex), things that look like references might be changed by intervening macros. They might become binding occurrences themselves, or expansion might uncover a binding closer than the one apparent before expansion starts. > > To illustrate, run the following program in the macro stepper: > > #lang racket > (define (x) > (cons x > (let ([x 1]) > (cons x > (let ([x 2]) > x))))) > > Set the macro hiding policy to "Custom"; click any occurrence of 'let' in the program and click "Show macro". At first, all of x's seem to refer to the module-level binding, but as macro expansion progresses it discovers the binding structure. Some purple arrows turn blue and others disappear as new bindings are uncovered. > > Check Syntax also has purple arrows that point into syntax constants (eg, macro templates). They mean roughly the same thing: who knows how apparent references in the syntax will eventually turn out? > > Ryan From dekudekuplex at yahoo.com Thu Jun 10 14:23:36 2010 From: dekudekuplex at yahoo.com (Benjamin L. Russell) Date: Thu, 10 Jun 2010 11:23:36 -0700 (PDT) Subject: [racket] "The Disadvantages of High School Programming" In-Reply-To: Message-ID: <965954.71946.qm@web32005.mail.mud.yahoo.com> --- On Fri, 6/11/10, Raoul Duke wrote: > On Tue, Jun 8, 2010 at 3:22 PM, Joe > Marshall > wrote: > > That's the problem. ?Maybe it shouldn't be the case. > ?Variations on this > > statement are alarming: > > > > ``It's quite possible to be a productive and > successful physician > > without having a > > solid understanding of medicine.'' > > i work in the video game world, so i see another side to > this: It is > quite possible for an artist to be productive and > successful without > having a solid understanding of material science. That's not really a very good analogy; it is similar to saying, "It is quite possible to be a productive and successful writer without having a solid understanding of botany." The problem is that there is no clear relation between understanding material[s] science and being an artist, whereas there is a clear relation between understanding computer science (at least insofar as it concerns such related topics as data structures, algorithms, discrete mathematics, and the like) and writing robust programs. Granted, computer science != programming, and it is entirely possible to study topics in computer science in such a manner that they are orthogonal to programming. However, the link between related topics in computer science and robust programming seems to be much closer than that between materials science and being an artist. -- Benjamin L. Russell From raould at gmail.com Thu Jun 10 14:36:14 2010 From: raould at gmail.com (Raoul Duke) Date: Thu, 10 Jun 2010 11:36:14 -0700 Subject: [racket] "The Disadvantages of High School Programming" In-Reply-To: <965954.71946.qm@web32005.mail.mud.yahoo.com> References: <965954.71946.qm@web32005.mail.mud.yahoo.com> Message-ID: > Granted, computer science != programming, and it is entirely possible to study topics in computer science in such a manner that they are orthogonal to programming. ?However, the link between related topics in computer science and robust programming seems to be much closer than that between materials science and being an artist. if i have a point, my point (hidden, unstated, stunningly poorly conveyed) is that it comes down to the semantics / context / value judgment / connotation of "productive and successful". other people have sorta said that already, but they appeared to say it by stating their own personal preferred connotations. i offered different connotations to point out that it is all relative. i happen to also fall on the side of preferring to do it more logically right than just bunging something together that makes money even though it is a mess under the hood. but i try not to ignore the $ucess of other approaches. sincerely. From rcleis at mac.com Thu Jun 10 14:38:05 2010 From: rcleis at mac.com (Richard Cleis) Date: Thu, 10 Jun 2010 12:38:05 -0600 Subject: [racket] "The Disadvantages of High School Programming" In-Reply-To: References: Message-ID: <99E3F50B-4058-450D-912B-036B2021BDD1@mac.com> On Jun 10, 2010, at 11:41 AM, Raoul Duke wrote: > On Tue, Jun 8, 2010 at 3:22 PM, Joe Marshall wrote: >> That's the problem. Maybe it shouldn't be the case. Variations on this >> statement are alarming: >> >> ``It's quite possible to be a productive and successful physician >> without having a >> solid understanding of medicine.'' > > i work in the video game world, so i see another side to this: It is > quite possible for an artist to be productive and successful without > having a solid understanding of material science. Only a small part of programming is a solo activity, and individual programmers who demonstrate outstanding success rely on the successes of a technology that began with mathematics and the imagination of people who couldn't even know what a computer would eventually be. It seems to me that the 'trick' of early education is to allow students to feel what discovery is like (painting without knowing the materials science that provides understanding of how paint works), yet keep them aware of others in the vast pool of humans that made their newest discovery possible (the invention, manufacture, and delivery of paint to the artist's brush). The argument here seems to be about the education of all individual programmers, but success is derived from groups. Each group of programmers should benefit from at least some colleagues with deeper understanding than many 'Moby Hackers', and the others in the group need to occasionally believe things and accept decisions that they aren't actually required to understand. If high school computer education doesn't at least hint to students that there is much more to programming than learning a few patterns and repeating them until retirement, then we will forever be hearing about expensive, time consuming failures of software projects. Racketeeringly yours, rac From keydana at gmx.de Thu Jun 10 15:54:16 2010 From: keydana at gmx.de (keydana at gmx.de) Date: Thu, 10 Jun 2010 21:54:16 +0200 Subject: [racket] [plt-scheme] Re: Typed scheme: Cannot apply expression of type Procedure, since it is not a function type In-Reply-To: References: <20100604062452.2E11E402B6@qua.cs.brown.edu> <8A147445-41AD-4CAC-AF87-EE63D7BC7F03@gmx.de> <89B511D1-1030-4610-B570-05A207799F72@gmx.de> Message-ID: <9DFA2738-ACE1-4250-8201-D96743E2F8D4@gmx.de> >> > > Ah yes, I use the assert function as well. So number->exact-integer is > Number -> Option Integer and assert is Option 'a -> 'a. The type defns > tell you this. Oh yes, mea culpa mea culpa mea culpa :-; In fact I wanted to reply you quickly and had little time to try everything out... seems like it went TOO quickly really :-; > > You should definitely read other's code. I recommend my code, because > it's awesome. Better yet, you should implement the missing parts for > me ;-P (Really, do read code. It is very useful. I happen to think my > code is fairly simple, but you might not find this is the case if you > don't understand the application domain.) OK where's the schedule :-; No but really, of course this would be very useful and I want to do it more. The thing is, you probably don't imagine how much time it can take others (me!) to understand, e.g., the arith.rkt snippet from http://docs.racket-lang.org/guide/hash-reader.html#(part._.Source_.Locations). In general, I would say I've found the leap from say, books on / using scheme (including HTDP) to some PLT code I encountered (in blogs / tutorials, for example) too hard in the beginning. But this was less because of missing domain knowledge but because of constructs the code authors used that I didn't know and that I had too much difficulty understanding in the PLT Reference: Trying to remember, among those were parameters, custodians, comprehensions (which would have been easier had I known some Haskell at that time, of course...). Or when I think of the leap from the webserver tutorial (which was easy to follow) to the webserver docs... And then, there's still the fear of all the macros in others' code :-; Today still, I often have difficulties understanding things in the Reference. But you're right, all this - spanning the gap between own code and all he possibilities of the language - might really become easier by reading others' code :-) > >> O course it's not a problem now any more, the reason I tried this out was that looking at (both your) code, I was puzzled how these casts would work in TS... my main experience with casts being from Java, I was missing something like the (Object) part in, e.g., >> >> return (Object) astring; >> >> But it looks like in TS, it's the return type of the function which accomplishes everything, - would that be correct? > > I don't understand what you mean by "it's the return type of the > function which accomplishes everything". Anyway, TS has what is called > "occurrence typing". Basically this means you can use predicates as > ...err... type casts. This is going beyond my knowledge so I'll just > refer you to the paper and LtU discussion: > > http://lambda-the-ultimate.org/node/2622 > > N. From noelwelsh at gmail.com Thu Jun 10 16:19:56 2010 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu, 10 Jun 2010 21:19:56 +0100 Subject: [racket] [plt-scheme] Re: Typed scheme: Cannot apply expression of type Procedure, since it is not a function type In-Reply-To: <9DFA2738-ACE1-4250-8201-D96743E2F8D4@gmx.de> References: <20100604062452.2E11E402B6@qua.cs.brown.edu> <8A147445-41AD-4CAC-AF87-EE63D7BC7F03@gmx.de> <89B511D1-1030-4610-B570-05A207799F72@gmx.de> <9DFA2738-ACE1-4250-8201-D96743E2F8D4@gmx.de> Message-ID: On Thu, Jun 10, 2010 at 8:54 PM, keydana at gmx.de wrote: > > Oh yes, mea culpa mea culpa mea culpa :-; In fact I wanted to reply you quickly and had little time to try everything out... seems like it went TOO quickly really :-; Oops, that came across wrong. I meant, "the type defns tell you that, in case you were confused", not "the type defns tell you that, STUPID" > > OK where's the schedule :-; 1. Reimplement core algorithm in OpenCL 2. Run experiments 3. Write up paper :-) > ... The thing is, you probably don't imagine how much time it can take others (me!) to understand, e.g., the arith.rkt snippet ... > In general, I would say I've found the leap from say, books on / using scheme (including HTDP) to some PLT code I encountered (in blogs / tutorials, for example) too hard in the beginning. Have you read the Guide? I'm curious to learn where precisely the hole in the documentation lies. (Racket needs a book, but it has to be the right kind of book.) N. From matthias at ccs.neu.edu Thu Jun 10 22:18:37 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu, 10 Jun 2010 22:18:37 -0400 Subject: [racket] "The Disadvantages of High School Programming" In-Reply-To: <99E3F50B-4058-450D-912B-036B2021BDD1@mac.com> References: <99E3F50B-4058-450D-912B-036B2021BDD1@mac.com> Message-ID: <3C59506D-E1F5-431F-8147-FE192FDBC98F@ccs.neu.edu> On Jun 10, 2010, at 2:38 PM, Richard Cleis wrote: > thers in the group need to occasionally believe things and accept decisions that they aren't actually required to understand. If high school computer education doesn't at least hint to students that there is much more to programming than learning a few patterns and repeating them until retirement, It doesn't. Or very rarely. From plt at synx.us.to Thu Jun 10 23:28:13 2010 From: plt at synx.us.to (synx) Date: Thu, 10 Jun 2010 20:28:13 -0700 Subject: [racket] Primitive scheme -> racket namespace converter Message-ID: <4C11AD4D.7040701@synx.us.to> Yeah I went there. I tested it on a directory full of .ss files and it worked, but as you can see I resort to rather crude hacks involving my complete lack of understanding how to write syntax to file, never mind preserving line breaks and whitespace. I think it loses comments too, so still needs a lot of work. I dunno about line-based comments... there should be a comment form like quote except it doesn't go into compiled code or...something. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: to-racket.rkt URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 554 bytes Desc: OpenPGP digital signature URL: From stchang at ccs.neu.edu Fri Jun 11 00:34:42 2010 From: stchang at ccs.neu.edu (Stephen Chang) Date: Fri, 11 Jun 2010 00:34:42 -0400 Subject: [racket] Primitive scheme -> racket namespace converter In-Reply-To: <4C11AD4D.7040701@synx.us.to> References: <4C11AD4D.7040701@synx.us.to> Message-ID: This doesn't seem to do the replacement when the language is just #lang scheme. On Thu, Jun 10, 2010 at 11:28 PM, synx wrote: > Yeah I went there. I tested it on a directory full of .ss files and it > worked, but as you can see I resort to rather crude hacks involving my > complete lack of understanding how to write syntax to file, never mind > preserving line breaks and whitespace. I think it loses comments too, so > still needs a lot of work. I dunno about line-based comments... there > should be a comment form like quote except it doesn't go into compiled > code or...something. > > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > From plt at synx.us.to Fri Jun 11 03:02:57 2010 From: plt at synx.us.to (Synx) Date: Fri, 11 Jun 2010 00:02:57 -0700 Subject: [racket] Primitive scheme -> racket namespace converter In-Reply-To: References: <4C11AD4D.7040701@synx.us.to> Message-ID: <4C11DFA1.1040708@synx.us.to> On 06/10/2010 09:34 PM, Stephen Chang wrote: > This doesn't seem to do the replacement when the language is just #lang scheme. Oh, yeah it wouldn't. Well it's an easy fix. But seriously, don't use this on anything you care about. As I said it deletes line-based comments. It also reformats the whitespace, though that's less of a concern thanks to racket/pretty. I only wrote this because I don't know of any other automated tool in progress, and I hope someone else can benefit from my errors, when they later actually make something that works. The way I read #lang is wrong of course, but (read-language) is another one of those crazy procedures I don't understand either. Somehow it magically pulls a procedure named "get-info" from some global context I don't know, which it then calls to get a procedure that you call to get information about the syntax. None of which will tell you what's supposed to go after "#lang" when writing the .rkt file. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: to-racket.rkt URL: From antonio.menezes.leitao at ist.utl.pt Fri Jun 11 04:27:05 2010 From: antonio.menezes.leitao at ist.utl.pt (Antonio Menezes Leitao) Date: Fri, 11 Jun 2010 09:27:05 +0100 Subject: [racket] ILC 2010 Message-ID: With the usual apologies to those who receive multiple copies of this... ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ International Lisp Conference 2010 October 19-21, 2010 John Ascuaga's Nugget (Casino) Reno/Sparks, Nevada, USA (near Lake Tahoe) Collocated with SPLASH 2010 (OOPSLA & DLS & more) see also http://splashcon.org as well as http://www.dynamic-languages-symposium.org/dls-10/ In association with ACM SIGPLAN (PENDING) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The Association of Lisp Users is pleased to announce that the 2010 International Lisp Conference will be held in Reno, Nevada, in collocation with SPLASH 2010. The scope includes all areas related to the Lisp family of programming languages. Accepted papers will be published in the ACM Digital Library (PENDING). Extended Abstracts and Papers must be written in English and submitted electronically at http://www.easychair.org/conferences?conf=ilc2010 in PDF or WORD format. If an Extended Abstract is submitted, it must be between 2 and 4 pages, with full paper to follow before final deadline. Final submissions must not exceed 15 pages and need to use the ACM format, for which templates which can be found at: http://www.acm.org/sigs/pubs/proceed/template.html. Important Dates: ~~~~~~~~~~~~~~~~ * Deadline for Abstract Submission: August 1, 2010 * Deadline for Paper Submission: September 6, 2010 * Author notification: September 20, 2010 * Final paper due (in electronic form): October 5, 2010 * Conference: October 19-21, 2010 Scope: ~~~~~~ Lisp is one of the greatest ideas from computer science and a major influence for almost all programming languages and for all sufficiently complex software applications. The International Lisp Conference is a forum for the discussion of Lisp and, in particular, the design, implementation and application of any of the Lisp dialects. We encourage everyone interested in Lisp to participate. We invite high quality submissions in all areas involving Lisp dialects and any other languages in the Lisp family, including, but not limited to, ACL2, AutoLisp, Clojure, Common Lisp, ECMAScript, Dylan, Emacs Lisp, ISLISP, Racket, Scheme, etc. Topics may include any and all combinations of Lisp and: * Language design and implementation * Language critique * Language integration, inter-operation and deployment * Applications (especially commercial) * 'Pearls' (of wisdom) * Experience reports and case studies * Reflection, meta-object protocols, meta-programming * Domain-specific languages * Programming paradigms and environments * Parallel and distributed computing * Software evolution * Theorem proving * Scientific computing * Data mining * Semantic web We also encourage submissions about known ideas as long as they are presented in a new setting and/or in a highly elegant way. Authors concerned about the appropriateness of a topic may communicate by electronic mail with the program chair prior to submission. Each paper should explain its contributions in both general and technical terms, identifying what has been accomplished, explaining why it is significant, and comparing it with previous work. Authors should strive to make their papers understandable to a broad audience. Each paper will be judged according to its significance, novelty, correctness, clarity, and elegance. The official language of the conference is English. Some further information is available at the conference web site, with more details added later. See: http://www.international-lisp-conference.org Technical Program: ~~~~~~~~~~~~~~~~~~ Original submissions in all areas related to the conference themes are invited for the following categories. * Papers: Technical papers of up to 15 pages that describe original results or explain known ideas in new and elegant ways, or extended abstracts of 4 pages soon followed by the corresponding full paper. * Demonstrations: Abstracts of up to 4 pages for demonstrations of tools, libraries, and applications. * Tutorials: Abstracts of up to 4 pages for in-depth presentations about topics of special interest for at least 90 minutes and up to 180 minutes. * Workshops: Abstracts of up to 4 pages for groups of people who intend to work on a focused topic for half a day. * Panel discussions: Abstracts of up to 4 pages for discussions about current themes. Panel discussion proposals must mention panel members who are willing to partake in a discussion. * Lightning talks: Abstracts of up to one page for talks to last for no more than 5 minutes. Depending on the technical content, each submitted paper will be classified by the program committee as either a technical paper or as an experience paper; and authors will be informed about this classification. Note that all interesting submissions are considered valuable contributions to the success of the ILC series of conferences. As in past ILC's since 2007, accepted papers in both categories will be presented at the conference, included in the proceedings, and submitted to the ACM digital library. Organizing Committee: ~~~~~~~~~~~~~~~~~~~~~ * General Chair: JonL White - The Ginger IceCream Factory of Palo Alto, ALU * Program Chair: Antonio Leitao - Instituto Superior Tecnico/INESC-ID * Conference Treasurer: Duane Rettig - Franz, Inc., ALU Director * Publicity Chair: Daniel Herring - ALU Director * ALU Treasurer: Rusty Johnson - TASC, Inc., ALU Director Program Committee: ~~~~~~~~~~~~~~~~~~ * Antonio Leitao - Instituto Superior Tecnico/INESC-ID, Portugal * Alex Fukunaga - University of Tokyo, Japan * Charlotte Herzeel - Vrije Universiteit Brussel, Belgium * Christophe Rhodes - Goldsmiths College, University of London, UK * Didier Verna - EPITA Research and Development Laboratory, France * Duane Rettig - Franz, Inc., USA * Giuseppe Attardi - University of Pisa, Italy * Jeff Shrager - Symbolic Systems Program, Stanford University, USA * Joe Marshall - Google, Inc., USA * Julian Padget - University of Bath, UK * Keith Corbett - Clozure Associates, USA * Kent Pitman - PTC, USA * Manuel Serrano - INRIA Sophia Antipolis, France * Marc Feeley - University of Montreal, Canada * Marie Beurton-Aimar University of Bordeaux 1, France * Mark Stickel - SRI International, USA * Matthias Felleisen - Northeastern University, USA * Scott McKay - ITA Software, USA Contacts: ~~~~~~~~~ * Questions: ilc10-organizing-committee at alu.org * Program Chair: ilc2010 at easychair.org For more information, see http://www.international-lisp-conference.org From norman at astro.gla.ac.uk Fri Jun 11 09:43:40 2010 From: norman at astro.gla.ac.uk (Norman Gray) Date: Fri, 11 Jun 2010 14:43:40 +0100 Subject: [racket] Using raco exe Message-ID: Greetings. I'm having difficulty using raco to build a standalone executable which requires both web-server/servlet and an extension. The raco documentation seems to suggest that I'm doing the right thing, but I'm getting an error I can't really parse. Can anyone help? The players: A web server application (which we'll call) s.ss And a librdf-extn_rkt.dylib C extension, installed in my user collections path, required by s.ss. Racket 5.0, and OS X 10.6 Things don't go as smoothly as I'd expect. Viz: % cat s.ss #lang racket (require web-server/servlet) (require rdf/librdf-extn) # provides librdf:new-world amongst various others (printf "server: world ~s~%" (librdf:new-world)) % racket -v -t s.ss # running it with racket works Welcome to Racket v5.0. server: world # % raco exe -o build/s s.ss % build/s # ...but a standalone version doesn't link: reference (phase 0) to a variable in module '#%embedded:g3708:librdf-extn that is uninitialized (phase level 0); reference appears in module: '#%mzc:s in: librdf:new-world === context === #%mzc:s: [running body] loop % ls -l ~/Library/Racket/5.0/collects/rdf/compiled/native/i386-macosx/3m/librdf-extn_rkt.dylib -rwxr-xr-x 1 norman staff 97068 11 Jun 11:37 /Users/norman/Library/Racket/5.0/collects/rdf/compiled/native/i386-macosx/3m/librdf-extn_rkt.dylib % Hmm: what is it you're telling me, racket dear? The module librdf-extn is a C extension, providing an interface to an underlying C library. It works OK if I remove the (require web-server/servlet). Note that I don't call anything from web-server/servlet -- it mere presence seems to be enough to sow untold confusion. Excerpts from the output of raco exe --vv -o build/s s.ss: Copying to # Getting # Getting # Getting # [...] Getting # Getting # using extension: # Getting # Recording extension at # Writing module from # [...] Writing module from # Writing module from # Writing module from # Setting command line The way that the extension is built is: make install "/Data/LocalApplications/Racket/Racket v5.0/bin/raco" ctool --cc ++ccf -g ++ccf -I/Data/tools/librdf-2010-01-20/32bit/include --cgc librdf_bindings.c mv librdf_bindings.o build "/Data/LocalApplications/Racket/Racket v5.0/bin/raco" ctool ++ldf -L/Data/tools/librdf-2010-01-20/32bit/lib ++ldf -lrdf --ld build/compiled/native/i386-macosx/3m/librdf-extn_rkt.dylib build/librdf_bindings.o cp -R build/compiled "/Users/norman/Library/Racket/5.0/collects"/rdf I'm afraid I'm stumped. Can anyone suggest what I've missed? Best wishes, Norman -- Norman Gray : http://nxg.me.uk From tim at johnsons-web.com Fri Jun 11 14:40:45 2010 From: tim at johnsons-web.com (Tim Johnson) Date: Fri, 11 Jun 2010 10:40:45 -0800 Subject: [racket] Off-topic: Scheme for JVM? In-Reply-To: References: <20100609173415.GA9964@goblin.punk.net> Message-ID: <20100611184045.GA916@johnsons-web.com> * Shriram Krishnamurthi [100609 10:27]: <...> Since Google has some investment in Kawa, I'm > sure it's in good shape. Very interesting! Could you elaborate on this Google investment in kawa? Or just post some links? thanks -- Tim tim at johnsons-web.com or akwebsoft.com http://www.akwebsoft.com From matthias at ccs.neu.edu Fri Jun 11 14:57:29 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Fri, 11 Jun 2010 14:57:29 -0400 Subject: [racket] N queens, revisited Message-ID: <48B50494-7C44-470F-AFC6-7ADDB20A1917@ccs.neu.edu> Horace and others who have tackled the N queens problem in HtDP. Below find a first draft of an exercise that will go into HtDP/2e. It demonstrates the importance of formulating good data representations especially with the use of (what we called) data accumulators in HtDP/1e. Enjoy -- Matthias You have solved the N queens problem using the a seeminly natural representation of the board as an N by N grid. Now you notice that your solution takes quite some time. After thinking about it for a while, you realize that two of the operations on board representations are critical -- finding those positions that are still safe -- placing a queen on a board The key is to make these operations fast. Once you have studied accumulators and especially the notion of data accumulators (see Missionary and Cannibals), you can tackle this problem easily. Represent boards with data that keeps track of all placed queens and all safe positions. For the initial board, there are no queens and all positions are safe. When you place a queen on a board, you add the queen('s position) to the collection of queens, but you also remove all those positions from the collection of safe positions that are now threatened. A board thus constructed accumulates knowledge about its construction. Design the functions add-queen find-open-spots for this data representation and re-use the original solution with this representation. (Hint: this solution should run at least 20x faster than the previous one.) From kwinterling at gmail.com Fri Jun 11 15:13:58 2010 From: kwinterling at gmail.com (Karl Winterling) Date: Fri, 11 Jun 2010 12:13:58 -0700 Subject: [racket] Off-topic: Scheme for JVM? In-Reply-To: <20100611184045.GA916@johnsons-web.com> References: <20100609173415.GA9964@goblin.punk.net> <20100611184045.GA916@johnsons-web.com> Message-ID: On Fri, Jun 11, 2010 at 11:40 AM, Tim Johnson wrote: > ?Very interesting! Could you elaborate on this Google > ?investment in kawa? Or just post some links? > ?thanks I think that Google uses Scheme as a configuration language for android and a scripting language for the App Engine. Kawa can compile Scheme to Java bytecode for execution on Android. From sk at cs.brown.edu Fri Jun 11 15:15:27 2010 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Fri, 11 Jun 2010 15:15:27 -0400 Subject: [racket] Off-topic: Scheme for JVM? In-Reply-To: <20100611184045.GA916@johnsons-web.com> References: <20100609173415.GA9964@goblin.punk.net> <20100611184045.GA916@johnsons-web.com> Message-ID: All I know is what I read here: http://googleresearch.blogspot.com/2009/08/under-hood-of-app-inventor-for-android.html shriram From sk at cs.brown.edu Fri Jun 11 15:16:41 2010 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Fri, 11 Jun 2010 15:16:41 -0400 Subject: [racket] Off-topic: Scheme for JVM? In-Reply-To: References: <20100609173415.GA9964@goblin.punk.net> <20100611184045.GA916@johnsons-web.com> Message-ID: > [...] and a scripting language for the App Engine. That would be news to me! Shriram From phelps.da at gmail.com Fri Jun 11 15:18:54 2010 From: phelps.da at gmail.com (Daniel Phelps) Date: Fri, 11 Jun 2010 14:18:54 -0500 Subject: [racket] Http post using post-impure-port Message-ID: Hi all, I'm having trouble with post-impure-port from net/url. I'm trying to post two fields like this: #lang racket (require net/url) (require net/uri-codec) (define my-url ?(string->url "http://localhost:49986/foo/bar/")) (post-impure-port my-url #"foo=bar&fiz=fuz") An http post occurs but the data is nowhere to be found on the server; the strings foo and fiz are null. I expect them to be "bar" and "fuz". My server-side code works from the browser. What am I missing? I apologize if my question is silly. Daniel From endobson at cs.brown.edu Fri Jun 11 15:21:00 2010 From: endobson at cs.brown.edu (Eric Dobson) Date: Fri, 11 Jun 2010 15:21:00 -0400 Subject: [racket] syntax/parse ellipses question Message-ID: I'm trying to use the syntax/parse library, and am running into a weird problem when using ~or. It works without ellipses, but with ellipses it complains about a duplicated attribute. I would assume that the attributes with the same name in an ~or pattern were the same attribute that could just match in different ways. A simplified version is below, the first 4 examples work, and the fifth does not. Is there a restriction that I am missing for why this does not work? Thanks, Eric #lang racket (require syntax/parse) (syntax-parse #'(1 2 3) [((~or x:number) ...) (syntax->datum #'(x ...))]) (syntax-parse #'(a b c) [((~or x:id) ...) (syntax->datum #'(x ...))]) (syntax-parse #'(1) [((~or x:id x:number)) (syntax->datum #'(x))]) (syntax-parse #'(a) [((~or x:id x:number)) (syntax->datum #'(x))]) #; (syntax-parse #'(a 1 b) [((~or x:id x:number) ...) (syntax->datum #'(x ...))]) From noelwelsh at gmail.com Fri Jun 11 15:36:36 2010 From: noelwelsh at gmail.com (Noel Welsh) Date: Fri, 11 Jun 2010 20:36:36 +0100 Subject: [racket] Http post using post-impure-port In-Reply-To: References: Message-ID: I did a quick check of the source code and post-impure-port definitely does send the post data -- at least functions to do so appear in the code. Have you tried a packet sniffer like Wireshark? That will tell exactly was is being sent over the wire. HTH, N. On Fri, Jun 11, 2010 at 8:18 PM, Daniel Phelps wrote: > Hi all, > I'm having trouble with post-impure-port from net/url. > > I'm trying to post two fields like this: > > #lang racket > (require net/url) > (require net/uri-codec) > > (define my-url > ?(string->url "http://localhost:49986/foo/bar/")) > > (post-impure-port my-url #"foo=bar&fiz=fuz") > > An http post occurs but the data is nowhere to be found on > the server; the strings foo and fiz are null. ?I expect them > to be "bar" and "fuz". > > My server-side code works from the browser. > > What am I missing? ?I apologize if my question is silly. > > Daniel From kwinterling at gmail.com Fri Jun 11 15:38:09 2010 From: kwinterling at gmail.com (Karl Winterling) Date: Fri, 11 Jun 2010 12:38:09 -0700 Subject: [racket] Off-topic: Scheme for JVM? In-Reply-To: References: <20100609173415.GA9964@goblin.punk.net> <20100611184045.GA916@johnsons-web.com> Message-ID: On Fri, Jun 11, 2010 at 12:16 PM, Shriram Krishnamurthi wrote: >> [...] and a scripting language for the App Engine. > > That would be news to me! > > Shriram > Hearsay is wonderful. From eli at barzilay.org Fri Jun 11 15:42:22 2010 From: eli at barzilay.org (Eli Barzilay) Date: Fri, 11 Jun 2010 15:42:22 -0400 Subject: [racket] Http post using post-impure-port In-Reply-To: References: Message-ID: <19474.37278.934894.138880@winooski.ccs.neu.edu> On Jun 11, Noel Welsh wrote: > I did a quick check of the source code and post-impure-port definitely > does send the post data -- at least functions to do so appear in the > code. Have you tried a packet sniffer like Wireshark? That will tell > exactly was is being sent over the wire. Netcat is very simple -- I ran nc -l -p 49986 and the script sent exactly this: POST /foo/bar/ HTTP/1.0 Host: localhost:49986 Content-Length: 15 foo=bar&fiz=fuz -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From ryanc at ccs.neu.edu Fri Jun 11 15:56:39 2010 From: ryanc at ccs.neu.edu (Ryan Culpepper) Date: Fri, 11 Jun 2010 13:56:39 -0600 Subject: [racket] syntax/parse ellipses question In-Reply-To: References: Message-ID: <4C1294F7.7040203@ccs.neu.edu> Eric Dobson wrote: > I'm trying to use the syntax/parse library, and am running into a > weird problem when using ~or. It works without ellipses, but with > ellipses it complains about a duplicated attribute. I would assume > that the attributes with the same name in an ~or pattern were the same > attribute that could just match in different ways. A simplified > version is below, the first 4 examples work, and the fifth does not. > Is there a restriction that I am missing for why this does not work? There are three variants of ~or: single-term ~or, head ~or, and ellipsis-head ~or. Ellipsis-head ~or has different rules for attributes, which the docs seem not to explain. I'll update the docs. > (syntax-parse #'(1 2 3) > [((~or x:number) ...) (syntax->datum #'(x ...))]) > > (syntax-parse #'(a b c) > [((~or x:id) ...) (syntax->datum #'(x ...))]) Both of the above are ellipsis-head ~or, not that it matters. > (syntax-parse #'(1) > [((~or x:id x:number)) (syntax->datum #'(x))]) > > (syntax-parse #'(a) > [((~or x:id x:number)) (syntax->datum #'(x))]) These are both single-term ~or. > #; > (syntax-parse #'(a 1 b) > [((~or x:id x:number) ...) (syntax->datum #'(x ...))]) This is ellipsis-head ~or. The difference is that ellipsis-head ~or accumulates different alternatives' attributes independently. The different alternatives must have disjoint attributes. (For now, anyway; I'm considering relaxing that restriction.) For example, (syntax-parse #'(a b #:c d e #:f g) [((~or x:id (~seq k:keyword kx:id)) ...) #'((x ...) ((k kx) ...))]) => # You can turn the ~or back into a single-term ~or by putting another pattern form between it and the ellipses. For example, (syntax-parse #'(a 1 b) [((~and (~or x:id x:number)) ...) ___]) Hope that helps! Ryan From toddobryan at gmail.com Fri Jun 11 15:58:36 2010 From: toddobryan at gmail.com (Todd O'Bryan) Date: Fri, 11 Jun 2010 15:58:36 -0400 Subject: [racket] Feature Request: new-style requires in Student Languages Message-ID: I'd like to move my students to using #lang declarations and require statements, rather than loading teachpacks via the menu (mostly because as they move between computers, different configurations cause errors that are hard for them to understand). Currently BSL (at least) only accepts old-style (require ...) statements, at least for planet packages. Could it also allow new-style? Todd From matthias at ccs.neu.edu Fri Jun 11 16:01:32 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Fri, 11 Jun 2010 16:01:32 -0400 Subject: [racket] Feature Request: new-style requires in Student Languages In-Reply-To: References: Message-ID: <52627D32-0DCA-479D-9995-045523CFC909@ccs.neu.edu> It will. This is an open feature request. On Jun 11, 2010, at 3:58 PM, Todd O'Bryan wrote: > I'd like to move my students to using #lang declarations and require > statements, rather than loading teachpacks via the menu (mostly > because as they move between computers, different configurations cause > errors that are hard for them to understand). > > Currently BSL (at least) only accepts old-style (require ...) > statements, at least for planet packages. Could it also allow > new-style? > > Todd > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From endobson at cs.brown.edu Fri Jun 11 16:12:03 2010 From: endobson at cs.brown.edu (Eric Dobson) Date: Fri, 11 Jun 2010 16:12:03 -0400 Subject: [racket] syntax/parse ellipses question In-Reply-To: <4C1294F7.7040203@ccs.neu.edu> References: <4C1294F7.7040203@ccs.neu.edu> Message-ID: Thanks, that makes sense after looking very closely at the documentation. I was able to work around it by introducing a syntax-class, which had the added benefit of being more readable then nested ~or patterns. -Eric On Fri, Jun 11, 2010 at 3:56 PM, Ryan Culpepper wrote: > Eric Dobson wrote: >> >> I'm trying to use the syntax/parse library, and am running into a >> weird problem when using ~or. It works without ellipses, but with >> ellipses it complains about a duplicated attribute. I would assume >> that the attributes with the same name in an ~or pattern were the same >> attribute that could just match in different ways. A simplified >> version is below, the first 4 examples work, and the fifth does not. >> Is there a restriction that I am missing for why this does not work? > > There are three variants of ~or: single-term ~or, head ~or, and > ellipsis-head ~or. Ellipsis-head ~or has different rules for attributes, > which the docs seem not to explain. I'll update the docs. > >> (syntax-parse #'(1 2 3) >> ?[((~or x:number) ...) (syntax->datum #'(x ...))]) >> >> (syntax-parse #'(a b c) >> ?[((~or x:id) ...) (syntax->datum #'(x ...))]) > > Both of the above are ellipsis-head ~or, not that it matters. > >> (syntax-parse #'(1) >> ?[((~or x:id x:number)) (syntax->datum #'(x))]) >> >> (syntax-parse #'(a) >> ?[((~or x:id x:number)) (syntax->datum #'(x))]) > > These are both single-term ~or. > >> #; >> (syntax-parse #'(a 1 b) >> ?[((~or x:id x:number) ...) (syntax->datum #'(x ...))]) > > This is ellipsis-head ~or. The difference is that ellipsis-head ~or > accumulates different alternatives' attributes independently. The different > alternatives must have disjoint attributes. (For now, anyway; I'm > considering relaxing that restriction.) For example, > > (syntax-parse #'(a b #:c d e #:f g) > ?[((~or x:id (~seq k:keyword kx:id)) ...) > ? #'((x ...) ((k kx) ...))]) > => # > > You can turn the ~or back into a single-term ~or by putting another pattern > form between it and the ellipses. For example, > > (syntax-parse #'(a 1 b) > ?[((~and (~or x:id x:number)) ...) ___]) > > Hope that helps! > > Ryan > > From toddobryan at gmail.com Fri Jun 11 16:23:33 2010 From: toddobryan at gmail.com (Todd O'Bryan) Date: Fri, 11 Jun 2010 16:23:33 -0400 Subject: [racket] macro help redux In-Reply-To: <4C102764.3080805@ccs.neu.edu> References: <4C0EBCAE.3060908@ccs.neu.edu> <4C0EE953.6030108@ccs.neu.edu> <4C102764.3080805@ccs.neu.edu> Message-ID: Thanks for responding. I've been away chaperoning students at camp for the past three days--thus my belated response. This is starting to make more sense. I got that there was a difference between data and syntax, but I thought they were much more fluidly convertible. I understand now that you have to be aware of which is which. I'm sure I'll hit more snags, but let's see if I can figure this out, now. On Wed, Jun 9, 2010 at 7:44 PM, Ryan Culpepper wrote: > On 06/09/2010 06:23 AM, Todd O'Bryan wrote: >> >> [...] >> >> ;; (define-aug-struct (sub sup) >> ;; ? ([field1 contract1] >> ;; ? ?[field2 contract2 default2] >> ;; ? ?...)) >> ;; >> ;; should be expanded to >> ;; >> ;; (define-syntax sub-info >> ;; ? '([field1 contract1] [field2 contract2 default2] ...)) >> ;; ? so I can grab this info later to unify it with any sub-structs > > That's the problem. The contracts and defaults are expressions, but here > you're quoting them, which throws away all of their lexical context > information. Instead, you should produce something like this: > > (define-syntax sub-info > ?(list (list 'field1 (quote-syntax contract1)) > ? ? ? ?(list 'field2 (quote-syntax contract2) (quote-syntax default2)) > ? ? ? ?___)) > > quote-syntax is like quote, but it evaluates to syntax, and it preserves > lexical context. > > In general, never call syntax->datum or use something else that has that > effect (like quote) on anything you intend to treat as an *expression*. > > For example: > >> (define-syntax (define-aug-struct stx) >> ? (syntax-case stx () >> ? ? [(_ (id super-id) field-info-syntax) >> ? ? ? ___ >> ? ? ? [field-info (syntax->datum #'field-info-syntax)] > > field-info-syntax contains expressions; don't use syntax->datum. > Instead, I'd rewrite the macro pattern to this: > > ?(_ (id super-id) (field-spec ...)) > > Then write a helper function that takes it apart using syntax-case, > syntax->list, or something like that. > >> ? ? ? [create-contract >> ? ? ? ?(cons '-> >> ? ? ? ? ? ? ?(foldr append `(,(build-name #'id id-name "?")) >> ? ? ? ? ? ? ? ? ? ? (map (? (kw contr) >> ? ? ? ? ? ? ? ? ? ? ? ? ? ?(list kw contr)) >> ? ? ? ? ? ? ? ? ? ? ? ? ?kw-names contracts)))] > > Using '-> (a symbol) actually happens to work here, but only because of > the implicit coercion done by quasisyntax later. Looking just at this > bit of code, I have to wonder: Do you apply some other, unexpected, > lexical context later? What lexical context does quasiquote implicitly > supply? Use #'-> instead, and the lexical context is (more) clear.* > > Ryan > > > * To be fair, you still have to look to see if the macro is introducing > a binding that shadows ->. > From tim at johnsons-web.com Fri Jun 11 17:31:45 2010 From: tim at johnsons-web.com (Tim Johnson) Date: Fri, 11 Jun 2010 13:31:45 -0800 Subject: [racket] Off-topic: Scheme for JVM? In-Reply-To: References: <20100609173415.GA9964@goblin.punk.net> <20100611184045.GA916@johnsons-web.com> Message-ID: <20100611213145.GB916@johnsons-web.com> * Karl Winterling [100611 11:21]: > On Fri, Jun 11, 2010 at 11:40 AM, Tim Johnson wrote: > > > ?Very interesting! Could you elaborate on this Google > > ?investment in kawa? Or just post some links? > > ?thanks > > I think that Google uses Scheme as a configuration language for > android and a scripting language for the App Engine. Kawa can compile > Scheme to Java bytecode for execution on Android. Understood. I have kawa: see http://per.bothner.com/blog/2009/AndroidHelloScheme/ thanks -- Tim tim at johnsons-web.com or akwebsoft.com http://www.akwebsoft.com From phelps.da at gmail.com Fri Jun 11 18:08:14 2010 From: phelps.da at gmail.com (Daniel Phelps) Date: Fri, 11 Jun 2010 17:08:14 -0500 Subject: [racket] Http post using post-impure-port In-Reply-To: <19474.37278.934894.138880@winooski.ccs.neu.edu> References: <19474.37278.934894.138880@winooski.ccs.neu.edu> Message-ID: Hi All, Thanks for your help. Solution follows. Thanks for the pointer to netcat. Turns out I was missing the Content-Type. Hence: #lang racket (require net/url) (require net/uri-codec) (require net/head) (require web-server/http/request-structs) (require racket/string) (define my-url (string->url "http://localhost:49986/Foo/Bar")) (define (bytes-> str) (string->bytes/locale str)) (define (form-data str) (bytes-> str)) (define (post url data) (post-impure-port url (form-data data) '("Content-Type: application/x-www-form-urlencoded" "User-Agent: HackitWithRacket"))) (post my-url "foo=bar&fiz=buz") Which produced the following: C:\Users\Daniel\bxscripts>nc -l -p 49986 POST /Foo/Bar HTTP/1.0 Host: localhost:49986 Content-Length: 36 Content-Type: application/x-www-form-urlencoded User-Agent: HackitWithRacket foo=bar&fiz=buz And it works. Fun. I hope this helps somebody. Daniel On Fri, Jun 11, 2010 at 2:42 PM, Eli Barzilay wrote: > On Jun 11, Noel Welsh wrote: >> I did a quick check of the source code and post-impure-port definitely >> does send the post data -- at least functions to do so appear in the >> code. Have you tried a packet sniffer like Wireshark? That will tell >> exactly was is being sent over the wire. > > Netcat is very simple -- I ran > > ?nc -l -p 49986 > > and the script sent exactly this: > > ?POST /foo/bar/ HTTP/1.0 > ?Host: localhost:49986 > ?Content-Length: 15 > > ?foo=bar&fiz=fuz > > -- > ? ? ? ? ?((lambda (x) (x x)) (lambda (x) (x x))) ? ? ? ? ?Eli Barzilay: > ? ? ? ? ? ? ? ? ? ?http://barzilay.org/ ? ? ? ? ? ? ? ? ? Maze is Life! > From plt at synx.us.to Sat Jun 12 00:40:19 2010 From: plt at synx.us.to (synx) Date: Fri, 11 Jun 2010 21:40:19 -0700 Subject: [racket] context switching Message-ID: <4C130FB3.2050100@synx.us.to> Here's a little something I was playing with, the notion of context switching. What does a certain symbol (er, parameter) mean in a given context? Can parameters be grouped together into meaningful context objects that change a bunch of parameters at once? The motivation is for my text adventure thing, which has any number of parameters that change simultaneously, such as current room, current number of steps, current time of day, current status of unhatched eggs etc. But also just because it's a kind of neat idea. I envision having a set of contexts that refer to each other's parameters, that you just throw together and they all plug everything into the right spot and form a cohesive fully functioning program. Yeah after reading some of the code of LambdaMOO again and seeing I quote "({@first, @$list_utils:map_verb(args[1] ? listdelete(args[1], 1) | {}, v)}, @listdelete(args, 1))" I figured it might be easier to make a scheme/racket MU than to get this junk to work. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: context.rkt URL: From plt at synx.us.to Sat Jun 12 01:15:38 2010 From: plt at synx.us.to (synx) Date: Fri, 11 Jun 2010 22:15:38 -0700 Subject: [racket] Primitive scheme -> racket namespace converter In-Reply-To: <4C11DFA1.1040708@synx.us.to> References: <4C11AD4D.7040701@synx.us.to> <4C11DFA1.1040708@synx.us.to> Message-ID: <4C1317FA.5090307@synx.us.to> And now I noticed that my hackish '|'| eliminator sometimes eliminates the first ( because there is no ' on the expression for reasons I don't understand. So I made a work around! :D Someone who actually knows this stuff I'd really appreciate seeing something like this. ^.^; Not so much to attempt a mass automatic conversion, but just so I can understand how such things are done. -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: to-racket.rkt URL: From la at iki.fi Sat Jun 12 05:31:23 2010 From: la at iki.fi (Lauri Alanko) Date: Sat, 12 Jun 2010 12:31:23 +0300 Subject: [racket] context switching In-Reply-To: <4C130FB3.2050100@synx.us.to> References: <4C130FB3.2050100@synx.us.to> Message-ID: <20100612093122.GA2598@svm-18.cs.helsinki.fi> On Fri, Jun 11, 2010 at 09:40:19PM -0700, synx wrote: > Here's a little something I was playing with, the notion of context > switching. What does a certain symbol (er, parameter) mean in a given > context? Can parameters be grouped together into meaningful context > objects that change a bunch of parameters at once? Yes. The current values of parameters are a part of the dynamic context, which is a part of the current continuation. So to capture the dynamic context you need to capture the continuation. See here for details: http://groups.google.com/group/comp.lang.scheme/browse_thread/thread/5d01bb6c0a900b79 Lauri From jay.mccarthy at gmail.com Sat Jun 12 05:54:03 2010 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Sat, 12 Jun 2010 05:54:03 -0400 Subject: [racket] context switching In-Reply-To: <20100612093122.GA2598@svm-18.cs.helsinki.fi> References: <4C130FB3.2050100@synx.us.to> <20100612093122.GA2598@svm-18.cs.helsinki.fi> Message-ID: There is actually something called a parameterization for this purpose. Jay Sent from my iPhone On Jun 12, 2010, at 5:31 AM, Lauri Alanko wrote: > On Fri, Jun 11, 2010 at 09:40:19PM -0700, synx wrote: >> Here's a little something I was playing with, the notion of context >> switching. What does a certain symbol (er, parameter) mean in a given >> context? Can parameters be grouped together into meaningful context >> objects that change a bunch of parameters at once? > > Yes. The current values of parameters are a part of the dynamic > context, which is a part of the current continuation. So to capture > the dynamic context you need to capture the continuation. See here for > details: > > http://groups.google.com/group/comp.lang.scheme/browse_thread/thread/5d01bb6c0a900b79 > > > Lauri > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From mflatt at cs.utah.edu Sat Jun 12 08:53:17 2010 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Sat, 12 Jun 2010 06:53:17 -0600 Subject: [racket] Using raco exe In-Reply-To: References: Message-ID: <20100612125320.38B476500C3@mail-svr1.cs.utah.edu> The problem may be that you are compiling the extension for CGC, but you're linking and running for 3m. As a result, some local pointers in the implementation of the extension are invisible to the GC. Along those lines, my guess is that requiring `web-server/servlet' changes the timing of a GC so that one occurs during the initialization of the extension. Pointers then get lost in a way that drops the instantiation of the extension-implemented module. At Fri, 11 Jun 2010 14:43:40 +0100, Norman Gray wrote: > > Greetings. > > I'm having difficulty using raco to build a standalone executable which > requires both web-server/servlet and an extension. The raco documentation > seems to suggest that I'm doing the right thing, but I'm getting an error I > can't really parse. Can anyone help? > > The players: > > A web server application (which we'll call) s.ss > And a librdf-extn_rkt.dylib C extension, installed in my user collections > path, required by s.ss. > Racket 5.0, and OS X 10.6 > > Things don't go as smoothly as I'd expect. Viz: > > % cat s.ss > #lang racket > (require web-server/servlet) > (require rdf/librdf-extn) # provides librdf:new-world amongst various others > (printf "server: world ~s~%" (librdf:new-world)) > % racket -v -t s.ss # running it with racket works > Welcome to Racket v5.0. > server: world # > % raco exe -o build/s s.ss > % build/s # ...but a standalone version doesn't > link: reference (phase 0) to a variable in module > '#%embedded:g3708:librdf-extn that is uninitialized (phase level 0); reference > appears in module: '#%mzc:s in: librdf:new-world > > === context === > #%mzc:s: [running body] > loop > > % ls -l > ~/Library/Racket/5.0/collects/rdf/compiled/native/i386-macosx/3m/librdf-extn_rk > t.dylib > -rwxr-xr-x 1 norman staff 97068 11 Jun 11:37 > /Users/norman/Library/Racket/5.0/collects/rdf/compiled/native/i386-macosx/3m/li > brdf-extn_rkt.dylib > % > > Hmm: what is it you're telling me, racket dear? > > The module librdf-extn is a C extension, providing an interface to an > underlying C library. It works OK if I remove the (require > web-server/servlet). Note that I don't call anything from web-server/servlet > -- it mere presence seems to be enough to sow untold confusion. > > > Excerpts from the output of raco exe --vv -o build/s s.ss: > > Copying to # > Getting # > Getting # v5.0/collects/racket/main.rkt> > Getting # v5.0/collects/racket/base.rkt> > [...] > Getting # v5.0/collects/web-server/dispatch/coercion.rkt> > Getting # > using extension: > # x/3m/librdf-extn_rkt.dylib> > Getting # v5.0/collects/racket/runtime-config.rkt> > Recording extension at > # x/3m/librdf-extn_rkt.dylib> > Writing module from # v5.0/collects/racket/private/stx.rkt> > [...] > Writing module from # v5.0/collects/web-server/servlet.rkt> > Writing module from # > Writing module from # v5.0/collects/racket/runtime-config.rkt> > Setting command line > > > > The way that the extension is built is: > > make install > "/Data/LocalApplications/Racket/Racket v5.0/bin/raco" ctool --cc ++ccf -g > ++ccf -I/Data/tools/librdf-2010-01-20/32bit/include --cgc librdf_bindings.c > mv librdf_bindings.o build > "/Data/LocalApplications/Racket/Racket v5.0/bin/raco" ctool ++ldf > -L/Data/tools/librdf-2010-01-20/32bit/lib ++ldf -lrdf --ld > build/compiled/native/i386-macosx/3m/librdf-extn_rkt.dylib > build/librdf_bindings.o > cp -R build/compiled "/Users/norman/Library/Racket/5.0/collects"/rdf > > > > > I'm afraid I'm stumped. Can anyone suggest what I've missed? > > Best wishes, > > Norman > > > -- > Norman Gray : http://nxg.me.uk > > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From keydana at gmx.de Sat Jun 12 12:25:16 2010 From: keydana at gmx.de (keydana at gmx.de) Date: Sat, 12 Jun 2010 18:25:16 +0200 Subject: [racket] [plt-scheme] Re: Typed scheme: Cannot apply expression of type Procedure, since it is not a function type In-Reply-To: References: <20100604062452.2E11E402B6@qua.cs.brown.edu> <8A147445-41AD-4CAC-AF87-EE63D7BC7F03@gmx.de> <89B511D1-1030-4610-B570-05A207799F72@gmx.de> <9DFA2738-ACE1-4250-8201-D96743E2F8D4@gmx.de> Message-ID: > > Have you read the Guide? Caught again :-; Well I guess that when I first got acquainted with PLT scheme (in 2008 I think), having read (or reading in parallel) SICP, the former edition of Dybvig's book on scheme (or rather, the first parts of it) and perhaps some other stuff I don't remember right now, I thought I might skip the Guide... as a general read I mean; what I've always been doing is taking the links from the Reference to the Guide as an aid to understand... Perhaps also - I don't know - the Guide has become more voluminous, more PLT-specific in the meantime? Anyway I've had a look at the contents listing now and I see it contains lots of stuff I'll probably don't know or don't REALLY know. So I'll try to find the time to read it now! (In fact, this is always the problem with the good suggestions of what to read or do one gets on this list - if only one had more than those 30-40 minutes a day for the whole ensemble of writing scheme code, reading scheme code, reading scheme documentation, writing emails to this list :-; ... not even to mention trying to go on learning Haskell:-; ) > I'm curious to learn where precisely the hole > in the documentation lies. Perhaps there is none - but as you're going on in your mail yourself: People (me, at least) don't learn from documentation only. I read real books when I really want to understand concepts, get a broader view, .. and also, to learn by watching (some great books contain lots of code) > (Racket needs a book, but it has to be the > right kind of book.) Having quite a big (and thick!) queue of "must read" books on my desk right now, I've had to postpone reading it to the end yet another time, but the impression I've had from the first 200 (300?) pages of "Real World Haskell" was quite positive: It explains the core language, it gives a motivating introduction to functional programming (I remember being on vacation, without a laptop, when I read the section where it shows how to formulate functions in terms of foldl & foldr, and I tried doing the same in scheme in my head :-; ), but afterwards it really goes on to solving "real-world problems" in Haskell... I think a book on Racket might be a bit like this. All the necessary stuff, Racket has already... the web server, the FFI, the network functionalities and and and... just present it not as a reference, but more of a tutorial / "by example" kind of thing? Ciao, Sigrid > > N. -------------- next part -------------- An HTML attachment was scrubbed... URL: From toddobryan at gmail.com Sat Jun 12 17:32:20 2010 From: toddobryan at gmail.com (Todd O'Bryan) Date: Sat, 12 Jun 2010 17:32:20 -0400 Subject: [racket] buggy error information for keyword args in 5.0? Message-ID: Here's a minimal example of what I think is a bug: #lang racket (define (blah #:foo foo #:bar bar) (+ foo 2)) (blah #:bar 3) Running it causes: blah: requires an argument with keyword #:foo, not supplied; x: expects type as 1st argument, given: 'x; other arguments were: '#:bar 3 where the error information involving x is just bizarre. I'm guessing that's not intended behavior... Todd From samth at ccs.neu.edu Sat Jun 12 17:37:32 2010 From: samth at ccs.neu.edu (Sam Tobin-Hochstadt) Date: Sat, 12 Jun 2010 17:37:32 -0400 Subject: [racket] buggy error information for keyword args in 5.0? In-Reply-To: References: Message-ID: This is PR 10954. On Sat, Jun 12, 2010 at 5:32 PM, Todd O'Bryan wrote: > Here's a minimal example of what I think is a bug: > > #lang racket > > (define (blah #:foo foo #:bar bar) > ?(+ foo 2)) > > (blah #:bar 3) > > Running it causes: > > blah: requires an argument with keyword #:foo, not supplied; x: > expects type as 1st argument, given: 'x; other arguments were: > '#:bar 3 > > where the error information involving x is just bizarre. I'm guessing > that's not intended behavior... > > Todd > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > -- sam th samth at ccs.neu.edu From mflatt at cs.utah.edu Sat Jun 12 17:57:06 2010 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Sat, 12 Jun 2010 15:57:06 -0600 Subject: [racket] buggy error information for keyword args in 5.0? In-Reply-To: References: Message-ID: <20100612215708.3EA796500DD@mail-svr1.cs.utah.edu> Sorry that I lost track of that one --- fix pushed. At Sat, 12 Jun 2010 17:37:32 -0400, Sam Tobin-Hochstadt wrote: > This is PR 10954. > > On Sat, Jun 12, 2010 at 5:32 PM, Todd O'Bryan wrote: > > Here's a minimal example of what I think is a bug: > > > > #lang racket > > > > (define (blah #:foo foo #:bar bar) > > ?(+ foo 2)) > > > > (blah #:bar 3) > > > > Running it causes: > > > > blah: requires an argument with keyword #:foo, not supplied; x: > > expects type as 1st argument, given: 'x; other arguments were: > > '#:bar 3 > > > > where the error information involving x is just bizarre. I'm guessing > > that's not intended behavior... > > > > Todd > > _________________________________________________ > > ?For list-related administrative tasks: > > ?http://lists.racket-lang.org/listinfo/users > > > > > > -- > sam th > samth at ccs.neu.edu > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From toddobryan at gmail.com Sat Jun 12 21:15:27 2010 From: toddobryan at gmail.com (Todd O'Bryan) Date: Sat, 12 Jun 2010 21:15:27 -0400 Subject: [racket] buggy error information for keyword args in 5.0? In-Reply-To: <20100612215708.3EA796500DD@mail-svr1.cs.utah.edu> References: <20100612215708.3EA796500DD@mail-svr1.cs.utah.edu> Message-ID: Thanks for the quick service! Should I just be filing bug reports for things like this, or is it good to mention them on the list? I hesitate to file most things, because I'm not always sure they're bugs, but this one was pretty obvious. (And if I'd searched I probably would have discovered it had already been filed, but Matthew might not have been reminded and fixed it so quickly.) I guess my question is, for someone at my level of use (not a PLT developer by a long shot, but a pretty regular user) what should I do if I see something that looks like a bug? Todd On Sat, Jun 12, 2010 at 5:57 PM, Matthew Flatt wrote: > Sorry that I lost track of that one --- fix pushed. > > At Sat, 12 Jun 2010 17:37:32 -0400, Sam Tobin-Hochstadt wrote: >> This is PR 10954. >> >> On Sat, Jun 12, 2010 at 5:32 PM, Todd O'Bryan wrote: >> > Here's a minimal example of what I think is a bug: >> > >> > #lang racket >> > >> > (define (blah #:foo foo #:bar bar) >> > ?(+ foo 2)) >> > >> > (blah #:bar 3) >> > >> > Running it causes: >> > >> > blah: requires an argument with keyword #:foo, not supplied; x: >> > expects type as 1st argument, given: 'x; other arguments were: >> > '#:bar 3 >> > >> > where the error information involving x is just bizarre. I'm guessing >> > that's not intended behavior... >> > >> > Todd >> > _________________________________________________ >> > ?For list-related administrative tasks: >> > ?http://lists.racket-lang.org/listinfo/users >> > >> >> >> >> -- >> sam th >> samth at ccs.neu.edu >> _________________________________________________ >> ? For list-related administrative tasks: >> ? http://lists.racket-lang.org/listinfo/users > From matthias at ccs.neu.edu Sat Jun 12 22:02:15 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Sat, 12 Jun 2010 22:02:15 -0400 Subject: [racket] buggy error information for keyword args in 5.0? In-Reply-To: References: <20100612215708.3EA796500DD@mail-svr1.cs.utah.edu> Message-ID: Don't hesitate. File reports. We'll close them if they are double entries. The key to a bug report: -- describe the problem concisely -- send a long a piece of code or a series of instructions for repeating the problem. Thanks -- Matthias On Jun 12, 2010, at 9:15 PM, Todd O'Bryan wrote: > Thanks for the quick service! > > Should I just be filing bug reports for things like this, or is it > good to mention them on the list? I hesitate to file most things, > because I'm not always sure they're bugs, but this one was pretty > obvious. (And if I'd searched I probably would have discovered it had > already been filed, but Matthew might not have been reminded and fixed > it so quickly.) > > I guess my question is, for someone at my level of use (not a PLT > developer by a long shot, but a pretty regular user) what should I do > if I see something that looks like a bug? > > Todd > > On Sat, Jun 12, 2010 at 5:57 PM, Matthew Flatt wrote: >> Sorry that I lost track of that one --- fix pushed. >> >> At Sat, 12 Jun 2010 17:37:32 -0400, Sam Tobin-Hochstadt wrote: >>> This is PR 10954. >>> >>> On Sat, Jun 12, 2010 at 5:32 PM, Todd O'Bryan wrote: >>>> Here's a minimal example of what I think is a bug: >>>> >>>> #lang racket >>>> >>>> (define (blah #:foo foo #:bar bar) >>>> (+ foo 2)) >>>> >>>> (blah #:bar 3) >>>> >>>> Running it causes: >>>> >>>> blah: requires an argument with keyword #:foo, not supplied; x: >>>> expects type as 1st argument, given: 'x; other arguments were: >>>> '#:bar 3 >>>> >>>> where the error information involving x is just bizarre. I'm guessing >>>> that's not intended behavior... >>>> >>>> Todd >>>> _________________________________________________ >>>> For list-related administrative tasks: >>>> http://lists.racket-lang.org/listinfo/users >>>> >>> >>> >>> >>> -- >>> sam th >>> samth at ccs.neu.edu >>> _________________________________________________ >>> For list-related administrative tasks: >>> http://lists.racket-lang.org/listinfo/users >> > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From eli at barzilay.org Sat Jun 12 22:07:59 2010 From: eli at barzilay.org (Eli Barzilay) Date: Sat, 12 Jun 2010 22:07:59 -0400 Subject: [racket] buggy error information for keyword args in 5.0? In-Reply-To: References: <20100612215708.3EA796500DD@mail-svr1.cs.utah.edu> Message-ID: <19476.15743.387697.672891@winooski.ccs.neu.edu> On Jun 12, Matthias Felleisen wrote: > Don't hesitate. File reports. We'll close them if they are double entries. > > The key to a bug report: > > -- describe the problem concisely > -- send a long a piece of code or a series of instructions for > repeating the problem. (That's probably a typo -- short pieces of code are much easier...) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From matthias at ccs.neu.edu Sat Jun 12 22:10:15 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Sat, 12 Jun 2010 22:10:15 -0400 Subject: [racket] buggy error information for keyword args in 5.0? In-Reply-To: <19476.15743.387697.672891@winooski.ccs.neu.edu> References: <20100612215708.3EA796500DD@mail-svr1.cs.utah.edu> <19476.15743.387697.672891@winooski.ccs.neu.edu> Message-ID: Oh yes, "along" not "a long" :-) On Jun 12, 2010, at 10:07 PM, Eli Barzilay wrote: > On Jun 12, Matthias Felleisen wrote: >> Don't hesitate. File reports. We'll close them if they are double entries. >> >> The key to a bug report: >> >> -- describe the problem concisely >> -- send a long a piece of code or a series of instructions for >> repeating the problem. > > (That's probably a typo -- short pieces of code are much easier...) > > -- > ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: > http://barzilay.org/ Maze is Life! From neil at neilvandyke.org Sun Jun 13 02:51:44 2010 From: neil at neilvandyke.org (Neil Van Dyke) Date: Sun, 13 Jun 2010 02:51:44 -0400 Subject: [racket] feedback on migrating to immutable pairs? Message-ID: <4C148000.4070402@neilvandyke.org> Two questions on the move to immutable pairs: 1. Does anyone have feedback on how that went? (The only problems I recall dealing with personally were pain for HtmlPrag, a minor change to the "csv" library, and a small headache supporting SICP.) 2. What was the rationale for not having "pair?", "car", "cdr", work on both mutable pairs and immutable pairs? Was this to push everyone harder towards immutable pairs, at the cost of having to convert legacy libraries and breaking R5RS compatibility? I'm asking because this might be valuable input to a Scheme working group. Thanks. -- http://www.neilvandyke.org/ From noelwelsh at gmail.com Sun Jun 13 02:59:45 2010 From: noelwelsh at gmail.com (Noel Welsh) Date: Sun, 13 Jun 2010 07:59:45 +0100 Subject: [racket] feedback on migrating to immutable pairs? In-Reply-To: <4C148000.4070402@neilvandyke.org> References: <4C148000.4070402@neilvandyke.org> Message-ID: On Sun, Jun 13, 2010 at 7:51 AM, Neil Van Dyke wrote: > Two questions on the move to immutable pairs: > > 1. Does anyone have feedback on how that went? ?(The only problems I recall > dealing with personally were pain for HtmlPrag, a minor change to the "csv" > library, and a small headache supporting SICP.) For the Untyped code base this was virtually a non-issue. > 2. What was the rationale for not having "pair?", "car", "cdr", work on both > mutable pairs and immutable pairs? ?Was this to push everyone harder towards > immutable pairs, at the cost of having to convert legacy libraries and > breaking R5RS compatibility? Neither is a subtype of the other. Mutable pair break the invariants expected of immutable pairs, and immutable pairs don't support all the operations of mutable pairs. Given this you're just asking for confuzzlement if you elide the difference with pair?, car, and cdr -- in the same way that + doesn't work for strings and numbers, these functions shouldn't work for pair?, car, and cdr. N. From neil at neilvandyke.org Sun Jun 13 03:04:26 2010 From: neil at neilvandyke.org (Neil Van Dyke) Date: Sun, 13 Jun 2010 03:04:26 -0400 Subject: [racket] feedback on migrating to immutable pairs? In-Reply-To: References: <4C148000.4070402@neilvandyke.org> Message-ID: <4C1482FA.5060700@neilvandyke.org> Noel Welsh wrote at 06/13/2010 02:59 AM: > Neither is a subtype of the other. So having "pair" be an abstract supertype was not considered a good idea? -- http://www.neilvandyke.org/ From norman at astro.gla.ac.uk Sun Jun 13 07:44:25 2010 From: norman at astro.gla.ac.uk (Norman Gray) Date: Sun, 13 Jun 2010 12:44:25 +0100 Subject: [racket] Using raco exe In-Reply-To: <20100612125320.38B476500C3@mail-svr1.cs.utah.edu> References: <20100612125320.38B476500C3@mail-svr1.cs.utah.edu> Message-ID: Matthew, hello. On 2010 Jun 12, at 13:53, Matthew Flatt wrote: > The problem may be that you are compiling the extension for CGC, but > you're linking and running for 3m. As a result, some local pointers in > the implementation of the extension are invisible to the GC. Aha, it would have taken a while for this to occur to me. Thanks for that. The problem doesn't magically go away, however: > % "/Data/LocalApplications/Racket/Racket v5.0/bin/raco" exe --cgc -o build/simbad-lod server.ss > create-embedding-executable: can't find Racket executable for variant cgc > > === context === > /Data/LocalApplications/Racket/Racket v5.0/collects/compiler/embed-unit.rkt:1008:4: core > /Data/LocalApplications/Racket/Racket v5.0/collects/compiler/commands/exe.rkt: [running body] > /Data/LocalApplications/Racket/Racket v5.0/collects/raco/raco.rkt: [running body] > /Data/LocalApplications/Racket/Racket v5.0/collects/raco/main.rkt: [running body] So something may yet be amiss. But don't worry about it on my behalf: this is a sign. It's a sign that it's probably about time that I converted this extension to use the 3m GC, which will evade the problem in the Correct fashion. > Along those lines, my guess is that requiring `web-server/servlet' > changes the timing of a GC so that one occurs during the initialization > of the extension. Pointers then get lost in a way that drops the > instantiation of the extension-implemented module. Hmm: the GC still retains something of the occult in my perception. Best wishes, Norman -- Norman Gray : http://nxg.me.uk From mflatt at cs.utah.edu Sun Jun 13 08:49:25 2010 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Sun, 13 Jun 2010 06:49:25 -0600 Subject: [racket] feedback on migrating to immutable pairs? In-Reply-To: <4C148000.4070402@neilvandyke.org> References: <4C148000.4070402@neilvandyke.org> Message-ID: <20100613124929.786826500C8@mail-svr1.cs.utah.edu> At Sun, 13 Jun 2010 02:51:44 -0400, Neil Van Dyke wrote: > 1. Does anyone have feedback on how that went? (The only problems I > recall dealing with personally were pain for HtmlPrag, a minor change to > the "csv" library, and a small headache supporting SICP.) For the Racket (then PLT Scheme) tree, there was some brief pain in converting code that uses `set-car!' and `set-cdr!' to different data structures. In all cases, the change was local (i.e., no contracts had to change, other than the change in meaning of "pair" and "list"). Reduced interoperability between Racket libraries and R5RS/R6RS code was the one big hit. > 2. What was the rationale for not having "pair?", "car", "cdr", work on > both mutable pairs and immutable pairs? Was this to push everyone > harder towards immutable pairs, at the cost of having to convert legacy > libraries and breaking R5RS compatibility? Having `pair?' and `list?' recognize data constructed without mutable pairs would have missed the point of the change. The point was that existing code that uses `pair?' and `list?' almost always intended `pair-that-wont-change-while-i-am-looking?' and `list-that-will- stay-a-list-until-i-am-done?'. Having `pair?' recognize mutable pairs would not have given us the intended benefit of the change. From samth at ccs.neu.edu Sun Jun 13 11:26:30 2010 From: samth at ccs.neu.edu (Sam Tobin-Hochstadt) Date: Sun, 13 Jun 2010 11:26:30 -0400 Subject: [racket] feedback on migrating to immutable pairs? In-Reply-To: <4C148000.4070402@neilvandyke.org> References: <4C148000.4070402@neilvandyke.org> Message-ID: On Sun, Jun 13, 2010 at 2:51 AM, Neil Van Dyke wrote: > 2. What was the rationale for not having "pair?", "car", "cdr", work on both > mutable pairs and immutable pairs? ?Was this to push everyone harder towards > immutable pairs, at the cost of having to convert legacy libraries and > breaking R5RS compatibility? Having immutable and mutable pairs be distinct turns out to be very valuable for Typed Scheme/Racket. Mutable pairs support more operations, so in one sense they should be subtypes of pairs in general. But mutable pairs support fewer equations, and so cannot be used in places where immutable pairs are allowed, so cannot be treated as subtypes. This makes the story for hashtables, vectors and boxes much more complex, and I'm happy that it's not the case for pairs. -- sam th samth at ccs.neu.edu From yinso.chen at gmail.com Sun Jun 13 14:58:51 2010 From: yinso.chen at gmail.com (YC) Date: Sun, 13 Jun 2010 11:58:51 -0700 Subject: [racket] planet unable to find matching package Message-ID: Hi - I am trying to install planet package in racket, specifically lizorkin/ssax (which is on planet) and it returned the error "could not find matching package". I went back to an older version (4.2.1) and was able to install the package. Looking on ssax.plt's page it does not appear to have any maximum version number limits that would prohibit it from being downloaded. Are there any changes to the way packages are being matched? Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: From plt at synx.us.to Sun Jun 13 15:30:22 2010 From: plt at synx.us.to (synx) Date: Sun, 13 Jun 2010 12:30:22 -0700 Subject: [racket] nested environments Message-ID: <4C1531CE.2020602@synx.us.to> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I am trying to represent a situation where there are a number of "environments" that each contain a number of named procedures. These environments can be nested, in that there is a base environment and other environments that add to or replace from its list of named procedures. I realize I'm probably using entirely the wrong terms for all this. Anyone who can direct me to the correct ones would be most appreciated. I think "environment" might be best represented by a "module" but haven't quite figured out how to make it work. So for instance in the following situation there are two branches in a single sort of environment "tree" A - defines a, b, c B - defines b, d C - defines c, f D - defines e, f, g E - defines e, d, g A A B C D E x x I want to evaluate expression x in the context of both environment hierarchies, where the first one uses the e, f, and g from D, the b and d from B, and the a and c from A; and the second one uses the e, d, and g from E, the c and f from C, and the a and b from A. x could be any expression such as '(a (b (c (d (e (f (g))))))) that would be expected to produce different results in the two environment hierarchies, though the expression '(a) would produce the same result since it uses the same procedure for 'a in environment A. It's almost like I want D to be a module that requires B, which requires A, and E to require C which requires A. Then I could use namespace-require to attach modules D, then E to a namespace and evaluate the expression within that. But I would like to add, modify and remove identifiers and procedures, and I don't think you can do that with a module. I could replace the entire module, but replacing module A for instance would require me to also replace modules B, C, D and E with modules that require the new A, and I'm not sure how to keep track of all that. Modules specify the modules they require as an internal syntax, so it's not like I can go (module-requires module) -> (listof requires) or anything. It's not like I have filesystem files and directories to rely on here. It's more like environment id,name,s-expression, as gotten from some sort of database, for each procedure. Putting all the procedures for an environment in one file might seem nice, but then I would have to recreate this dummy file every time one of my procedures changed, or a new one was added, or an old one removed. That might also introduce problems keeping it synchronized, or even race conditions. I don't want to have to deal with a situation where there are 10 environments all depending on module A, so changing one procedure in module A requires recreating module A and all 10 environments, as well as manually keeping track of which module depends on whom. But I don't know how to abstract that, or if there's a better way to do it, or if it's already been done? -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJMFTHOAAoJECC/cKf8E7UIsy8H/2dat7imLCdmjhk+kjvYmVf9 2YV2FPJkKByy+n7Nfvwbycy3mXNl4TZ43kBUccr26CZepmyo6F2sbzG8Q7WXERcl xv6LmnZa0IPhUu6S4i1PM5DepwcwjGLhqWsEbj5xHEFpOvAFfUDeUUEJQxAmUy2V Q2iKEnKw82Pgv1QHrSK/eSY8A7ivA/oq6fX0F430etgtnOD2WzFllJpMJNB1MF9v P1FZFbzNXxcG/X5w/UT+99cR1s1ZpWWqF0TgnVjMKLCgh3CT81VysnG2H42DBX+u dATiHpbOtu0JCU+2f4EBPkVdctNJQvl6SuLNXkvfVD8oOarv4Fd/SMqdYcWLgDE= =yE+5 -----END PGP SIGNATURE----- From robby at eecs.northwestern.edu Sun Jun 13 19:10:08 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Sun, 13 Jun 2010 18:10:08 -0500 Subject: [racket] planet unable to find matching package In-Reply-To: References: Message-ID: On Sun, Jun 13, 2010 at 1:58 PM, YC wrote: > I am trying to install planet package in racket, specifically lizorkin/ssax > (which is on planet) and it returned the error "could not find matching > package".? I went back to an older version (4.2.1) and was able to install > the package.? Looking on ssax.plt's page it does not appear to have any > maximum version number limits that would prohibit it from being downloaded. I just tried this via the planet command-line tool in version 5.0.0.1 like this: $ raco planet install lizorkin ssax.plt 2 0 and it seemed to install fine. I also tried evaluating this in drracket in version 5.0: #lang racket (require (planet lizorkin/ssax:2)) and it too seemed to install fine (altho there is no main file so I got that error). > Are there any changes to the way packages are being matched? If there are, they'd be bugs, I expect. More specifically, the 4.xx repository also applies to versions 5.xx too. Robby From yinso.chen at gmail.com Mon Jun 14 04:22:54 2010 From: yinso.chen at gmail.com (YC) Date: Mon, 14 Jun 2010 01:22:54 -0700 Subject: [racket] planet unable to find matching package In-Reply-To: References: Message-ID: Thanks Robby for confirming that it works. I will see if there are configuration issues on my side. Thanks, yc On Sun, Jun 13, 2010 at 4:10 PM, Robby Findler wrote: > On Sun, Jun 13, 2010 at 1:58 PM, YC wrote: > > I am trying to install planet package in racket, specifically > lizorkin/ssax > > (which is on planet) and it returned the error "could not find matching > > package". I went back to an older version (4.2.1) and was able to > install > > the package. Looking on ssax.plt's page it does not appear to have any > > maximum version number limits that would prohibit it from being > downloaded. > > I just tried this via the planet command-line tool in version 5.0.0.1 like > this: > > $ raco planet install lizorkin ssax.plt 2 0 > > and it seemed to install fine. I also tried evaluating this in > drracket in version 5.0: > > #lang racket > (require (planet lizorkin/ssax:2)) > > and it too seemed to install fine (altho there is no main file so I > got that error). > > > Are there any changes to the way packages are being matched? > > If there are, they'd be bugs, I expect. > > More specifically, the 4.xx repository also applies to versions 5.xx too. > > Robby > -- Cheers, yc Taming the software dragon - http://dragonmaestro.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From noelwelsh at gmail.com Mon Jun 14 06:42:43 2010 From: noelwelsh at gmail.com (Noel Welsh) Date: Mon, 14 Jun 2010 11:42:43 +0100 Subject: [racket] nested environments In-Reply-To: <4C1531CE.2020602@synx.us.to> References: <4C1531CE.2020602@synx.us.to> Message-ID: Didn't get to the end of this, but it seems like you want to represent a lexical environment as found in any interpreter. For this, I suggest: http://planet.plt-scheme.org/display.ss?package=environment.plt&owner=cobbe A rib-cage environment data structure. HTH, N. On Sun, Jun 13, 2010 at 8:30 PM, synx wrote: > > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > I am trying to represent a situation where there are a number of > "environments" that each contain a number of named procedures. These > environments can be nested, in that there is a base environment and > other environments that add to or replace from its list of named > procedures. ... From norman at astro.gla.ac.uk Mon Jun 14 07:40:38 2010 From: norman at astro.gla.ac.uk (Norman Gray) Date: Mon, 14 Jun 2010 12:40:38 +0100 Subject: [racket] Using raco exe [summary] In-Reply-To: References: <20100612125320.38B476500C3@mail-svr1.cs.utah.edu> Message-ID: <18653C08-2037-4E2A-9FDB-909BE4372585@astro.gla.ac.uk> Matthew (and list), hello. On 2010 Jun 13, at 12:44, Norman Gray wrote: > On 2010 Jun 12, at 13:53, Matthew Flatt wrote: > >> The problem may be that you are compiling the extension for CGC, but >> you're linking and running for 3m. As a result, some local pointers in >> the implementation of the extension are invisible to the GC. and... > It's a sign that it's probably about time that I converted this extension to use the 3m GC, which will evade the problem in the Correct fashion. Just to confirm: rewriting the extension for 3m does indeed make 'raco exe' produce a work result (well modulo my to-be-discovered conversion errors, but...) Thanks for the pointers (*cough*), Norman -- Norman Gray : http://nxg.me.uk From cobbe at ccs.neu.edu Mon Jun 14 07:47:30 2010 From: cobbe at ccs.neu.edu (Richard Cobbe) Date: Mon, 14 Jun 2010 07:47:30 -0400 Subject: [racket] nested environments In-Reply-To: References: <4C1531CE.2020602@synx.us.to> Message-ID: <20100614114730.GA332@weatherwax.local> On Mon, Jun 14, 2010 at 11:42:43AM +0100, Noel Welsh wrote: > Didn't get to the end of this, but it seems like you want to represent > a lexical environment as found in any interpreter. For this, I > suggest: > > http://planet.plt-scheme.org/display.ss?package=environment.plt&owner=cobbe > A rib-cage environment data structure. There's a very good chance that this will do what you want, synx, but I'm a little unclear on the details -- perhaps because I only skimmed your post. The data structure in that package is primarily for use in an interpreter or type checker. I get the sense from your original message that the expression you wish to evaluate is written in Racket, in which case this package won't be much use, as there's no way to plug this environment structure into the Racket evaluator. If, on the other hand, you're writing your own evaluator for this expression('s language), then this package could be just what you need. Finally, I haven't used this package in a while, so it's possible that it may have succumbed to bit-rot in the interim. (That said, it doesn't use any particularly advanced features of the language, so I think dusting it off should be sufficient.) If you do try to use it and find any problems, please do let me know, ideally by filing a bug report with the existing Planet infrastructure. I'd like to keep this package usable and useful, although I can't promise that I'll be able to respond to issues immediately. Richard From feeley at iro.umontreal.ca Mon Jun 14 09:36:11 2010 From: feeley at iro.umontreal.ca (Marc Feeley) Date: Mon, 14 Jun 2010 09:36:11 -0400 Subject: [racket] [ANN] REVISED DEADLINE for Scheme and Functional Programming Workshop Message-ID: Please note that the deadline for submitting papers to the Scheme workshop has been extended to Wednesday the 16th of June. The workshop website at http://www.iro.umontreal.ca/~sfp2010 gives more details on the submission process and workshop. Marc Feeley -------------------------------------------------------------------------- Call for Papers 2010 Workshop on Scheme and Functional Programming Montr?al, Qu?bec, Canada Saturday and Sunday August 21-22, 2010 http://www.iro.umontreal.ca/~sfp2010 Important Dates --------------- Submission: 16 June 2010 *** EXTENDED DEADLINE *** Notification: 4 July 2010 Final papers due: 23 July 2010 All deadlines are at 23:59 UTC (7:59 PM EDT, 6:59 PM CDT, 5:59 PM MDT, and 4:59 PM PDT). Scope ----- The 2010 Workshop on Scheme and Functional Programming is a forum for discussing experience with and future development of the Scheme programming language. Papers are invited concerning all aspects of the design, implementation, theory, and application of Scheme. Some example areas include (but are not limited to): - History, evolution and standardization of Scheme - Applications, experience and industrial uses of Scheme - Program-development environments, debugging, testing - Implementation (interpreters, compilers, tools, benchmarks, etc) - Distributed computing, concurrency, parallelism - Interoperability with other languages, FFIs - Continuations, macros, modules, object systems, types - Theory, formal semantics, correctness - Education - Scheme pearls (elegant, instructive uses of Scheme) There are two classes of submissions, regular papers (up to 12 pages) and short papers (around 6 pages). A Scheme pearl submission is a special category, and should be a short paper presenting an algorithm, idea or programming device using Scheme in a way that is particularly elegant. Following the model of earlier workshops, Scheme pearls and experience papers need not necessarily report original research results; they may instead report practical experience that will be useful to others, re-usable programming idioms, or elegant new ways of approaching a problem. The key criterion for such a paper is that it makes a contribution from which other practitioners can benefit. It is not enough simply to describe a program! The proceedings of the conference will be published as a Universit? de Montr?al technical report. Instructions for authors ------------------------ Authors should submit a 100-200 word abstract and a full paper by the end of Wednesday, 16 June 2010, Universal Coordinated Time. (The end of the day UTC corresponds to 23:59 UTC, 7:59 PM EDT, 6:59 PM CDT, 5:59 PM MDT, and 4:59 PM PDT.) Papers must be submitted in PDF format, or as PostScript documents that are interpretable by Ghostscript, and they must be printable on US Letter sized paper. Suitable style files for LaTeX: - class file http://www.iro.umontreal.ca/~sfp2010/sigplanconf.cls - style guide http://www.iro.umontreal.ca/~sfp2010/sigplanconf-guide.pdf - template http://www.iro.umontreal.ca/~sfp2010/sigplanconf-template.tex - sample paper http://www.iro.umontreal.ca/~sfp2010/retrospective.tex - sample references http://www.iro.umontreal.ca/~sfp2010/retrospective.bbl Submissions will be carried out electronically via the Web, at http://www.iro.umontreal.ca/~sfp2010/submit.html A submission will be evaluated according to its relevance, correctness, significance, originality, and clarity. It should explain its contributions in both general and technical terms, clearly identifying what has been accomplished, explaining why it is significant, and comparing it with previous work. The technical content should be accessible to a broad audience. There are two classes of submissions, regular papers and short papers: Regular papers -------------- Submissions should be no more than 12 pages (including bibliography and appendices) in standard ACM conference format: two columns, nine point font on ten point baseline, page 20pc (3.33in) wide and 54pc (9in) tall with a column gutter of 2pc (0.33in). Authors wishing to supply additional material to the reviewers beyond the 12 page limit can do so in clearly marked appendices, on the understanding that reviewers may not read the appendices. Submissions that do not meet these guidelines will not be considered. Short papers ------------ Short papers need not present novel research; it is sufficient that they present material of interest or utility to the Scheme or functional-programming community. Scheme pearls submissions should be presented as short papers. Short papers should be formatted with the same guidelines as regular papers, but are expected to be around six pages in length. Organization ------------ Conference Chair and Program Chair - Marc Feeley, Universit? de Montr?al Program Committee - Alan Bawden, independent consultant - Olivier Danvy, Aarhus University - Christopher Dutchyn, University of Saskatchewan - Felix S. Klock II, Northeastern University - Jay McCarthy, Brigham Young University - Scott McKay, ITA software Steering Committee - William D. Clinger, Northeastern University - Marc Feeley, Universit? de Montr?al - Robby Findler, University of Chicago - Dan Friedman, Indiana University - Christian Queinnec, University Paris 6 - Manuel Serrano, INRIA Sophia Antipolis - Olin Shivers, Northeastern University - Mitchell Wand, Northeastern University From greghendershott at gmail.com Mon Jun 14 14:49:24 2010 From: greghendershott at gmail.com (Greg Hendershott) Date: Mon, 14 Jun 2010 14:49:24 -0400 Subject: [racket] Upgrading from 4.2 to 5.0 (Racket) Message-ID: Apologies if this was on the download page or release notes but I couldn't find it. What is the best way to upgrade from 4.2 to 5.0? Some possibilities I can imagine, multiple choice: [a] Install 5.0. (Maybe it's an in-place upgrade, 5.0 will find/use 4.2 prefs/config and remove 4.2?) [b] Install 5.0,then uninstall 4.2. (Maybe so 5.0 can find/use existing 4.2 prefs/config?) [c] Uninstall 4.2, then install 5.0. (Maybe the uninstall of 4.2 would somehow foobar 5.0?) ? Thank you. From jpc-ml at zenburn.net Mon Jun 14 15:47:54 2010 From: jpc-ml at zenburn.net (=?UTF-8?B?SmFrdWIgUGlvdHIgQ8WCYXBh?=) Date: Mon, 14 Jun 2010 21:47:54 +0200 Subject: [racket] context switching In-Reply-To: <4C130FB3.2050100@synx.us.to> References: <4C130FB3.2050100@synx.us.to> Message-ID: <4C16876A.80108@zenburn.net> On 12.06.10 06:40, synx wrote: > Here's a little something I was playing with, the notion of context > switching. What does a certain symbol (er, parameter) mean in a given > context? Can parameters be grouped together into meaningful context > objects that change a bunch of parameters at once? Why do you want to have your context in parameters in the first place? If you want to use multithreading then using parameters the way you do will result in a diverging world. If you don't want multiple threads then simple global variables and structures should be sufficient. IIUC you try to use PLT Scheme/Racket like LPC is used in LP-Muds (as a dynamic language to express the world). I don't think raw PLT Scheme is dynamic enough for this. As I see it you should build a dynamic (maybe Smalltalk like, you may check schemetalk from SCG.unibe.ch) object system with support for loading classes from disk at runtime (easy) and switching them without restarting the server. You may also check the DGD MUD driver (it is a MUD driver based on a new implementation of the LPC language and really nice persistency features; it seems to have quite a good overal design). You also really need some ways to protect yourself agains malicious and runaway code. (threads and kill-thread are good but you must check that all your code is kill-safe) -- regards, Jakub Piotr C?apa From eli at barzilay.org Tue Jun 15 12:06:17 2010 From: eli at barzilay.org (Eli Barzilay) Date: Tue, 15 Jun 2010 12:06:17 -0400 Subject: [racket] Upgrading from 4.2 to 5.0 (Racket) In-Reply-To: References: Message-ID: <19479.42233.924217.714616@winooski.ccs.neu.edu> On Jun 14, Greg Hendershott wrote: > Apologies if this was on the download page or release notes but I > couldn't find it. > > What is the best way to upgrade from 4.2 to 5.0? > > Some possibilities I can imagine, multiple choice: > > [a] Install 5.0. (Maybe it's an in-place upgrade, 5.0 will find/use > 4.2 prefs/config and remove 4.2?) > [b] Install 5.0,then uninstall 4.2. (Maybe so 5.0 can find/use > existing 4.2 prefs/config?) > [c] Uninstall 4.2, then install 5.0. (Maybe the uninstall of 4.2 would > somehow foobar 5.0?) > > ? If this is on Windows, then the installers won't find the PLT installation, which means that [a] will work, but you'll still have the old copy of PLT. I think that [b] will lose the .ss/.scm association when the PLT installer is removed (but I don't remember how the association is stored, it might not make a difference). So option [c] should should be fine -- the preferences are stored in your user-specific settings, and those are not removed with the uninstaller. (And the directory where they're stored is different now, but if the new preferences directory doesn't exist and the old one does, then it will copy and use the old one.) If you're on OSX/Linux, then [c] should work fine too. (I think that OSX has some way to associate files, but no idea how...) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From c_a_t13 at hotmail.com Tue Jun 15 16:40:34 2010 From: c_a_t13 at hotmail.com (Cristina Teodoropol) Date: Tue, 15 Jun 2010 13:40:34 -0700 Subject: [racket] Moby Message-ID: To whom it may concern, I'm an undergraduate student working with professor Gregor Kiczales at the University of British Columbia on course material. I've been trying to work on a lab for students involving the Android phone, but am having some issues with Moby. After running a simple program such as: (DrScheme V4.2.5) #lang planet dyoo/moby:2:34 (define initial-world 0) (js-big-bang initial-world (on-tick 1 add1)) I could run the program in the web brower or download a javascript .zip, but got the following error message when attempting to download the Android .apk package: The application raised an exception with the message: We are unable to build your Android package; the web service appears to be offline. Please contact the Moby developers; in your response, include the following: tcp-connect: connection to go.cs.brown.edu, port 80 failed (at step 6: No connection could be made because the target machine actively refused it.; errno=10061) (Also tried to locally compile the package; updated the PATH variable but there doesn't seem to be an executable named "android" in the Android SDK directories for find-executable-path to find.) Would the web service be online for September? Thank you much, Cristina Teodoropol _________________________________________________________________ Learn more ways to connect with your buddies now http://go.microsoft.com/?linkid=9734388 -------------- next part -------------- An HTML attachment was scrubbed... URL: From valery at digitalchile.net Thu Jun 17 13:01:17 2010 From: valery at digitalchile.net (Valeriya Pudova) Date: Thu, 17 Jun 2010 21:01:17 +0400 Subject: [racket] Eval and "compile: unbound identifier (and no #%app syntax transformer is bound) in:" Message-ID: Hi With the Racket 5, this simple code #lang scheme (eval '(+ 1 2)) printout error compile: unbound identifier (and no #%app syntax transformer is bound) in: + What is wrong? -- Valeriya -------------- next part -------------- An HTML attachment was scrubbed... URL: From robby at eecs.northwestern.edu Thu Jun 17 13:05:29 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu, 17 Jun 2010 12:05:29 -0500 Subject: [racket] Eval and "compile: unbound identifier (and no #%app syntax transformer is bound) in:" In-Reply-To: References: Message-ID: Please see the Guide on eval. Robby On Thu, Jun 17, 2010 at 12:01 PM, Valeriya Pudova wrote: > Hi > > With the Racket 5, this simple code > > #lang scheme > (eval '(+ 1 2)) > > printout error > > compile: unbound identifier (and no #%app syntax transformer is bound) in: + > > What is wrong? > > -- Valeriya > > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > From greghendershott at gmail.com Thu Jun 17 13:13:41 2010 From: greghendershott at gmail.com (Greg Hendershott) Date: Thu, 17 Jun 2010 13:13:41 -0400 Subject: [racket] Upgrading from 4.2 to 5.0 (Racket) In-Reply-To: <19479.42233.924217.714616@winooski.ccs.neu.edu> References: <19479.42233.924217.714616@winooski.ccs.neu.edu> Message-ID: Thank you, Eli. I did [c] and it worked smoothly. On Tue, Jun 15, 2010 at 12:06 PM, Eli Barzilay wrote: > On Jun 14, Greg Hendershott wrote: >> Apologies if this was on the download page or release notes but I >> couldn't find it. >> >> What is the best way to upgrade from 4.2 to 5.0? >> >> Some possibilities I can imagine, multiple choice: >> >> [a] Install 5.0. (Maybe it's an in-place upgrade, 5.0 will find/use >> 4.2 prefs/config and remove 4.2?) >> [b] Install 5.0,then uninstall 4.2. ?(Maybe so 5.0 can find/use >> existing 4.2 prefs/config?) >> [c] Uninstall 4.2, then install 5.0. (Maybe the uninstall of 4.2 would >> somehow foobar 5.0?) >> >> ? > > If this is on Windows, then the installers won't find the PLT > installation, which means that [a] will work, but you'll still have > the old copy of PLT. ?I think that [b] will lose the .ss/.scm > association when the PLT installer is removed (but I don't remember > how the association is stored, it might not make a difference). ?So > option [c] should should be fine -- the preferences are stored in your > user-specific settings, and those are not removed with the > uninstaller. ?(And the directory where they're stored is different > now, but if the new preferences directory doesn't exist and the old > one does, then it will copy and use the old one.) > > If you're on OSX/Linux, then [c] should work fine too. ?(I think that > OSX has some way to associate files, but no idea how...) > > -- > ? ? ? ? ?((lambda (x) (x x)) (lambda (x) (x x))) ? ? ? ? ?Eli Barzilay: > ? ? ? ? ? ? ? ? ? ?http://barzilay.org/ ? ? ? ? ? ? ? ? ? Maze is Life! > From fgizinski at att.net Thu Jun 17 11:19:56 2010 From: fgizinski at att.net (Frank Gizinski) Date: Thu, 17 Jun 2010 10:19:56 -0500 Subject: [racket] turtles.ss Message-ID: <06E2AFD4702049C090E4077E0C42699D@FrankGizinskPC> To Whom it might concern, I have seen the teachpack turtles.ss mentioned in connection with PLT Scheme quite a few times. In my new version 4.2.5 it doesn't exist. Is there anywhere that I can get it? Frank Gizinski -------------- next part -------------- An HTML attachment was scrubbed... URL: From robby at eecs.northwestern.edu Thu Jun 17 13:31:31 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu, 17 Jun 2010 12:31:31 -0500 Subject: [racket] turtles.ss In-Reply-To: <06E2AFD4702049C090E4077E0C42699D@FrankGizinskPC> References: <06E2AFD4702049C090E4077E0C42699D@FrankGizinskPC> Message-ID: Did you try searching for "turtles" in the documentation? You'll find a few libraries there. Nothing that I would say is bulletproof for working with students, but there is something there. Robby On Thu, Jun 17, 2010 at 10:19 AM, Frank Gizinski wrote: > To Whom it might concern, > > I have seen the teachpack turtles.ss mentioned in connection with PLT Scheme > quite a few times.? In my new version 4.2.5 it doesn't exist.? Is there > anywhere that I can get it? > > Frank Gizinski > > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > From matthias at ccs.neu.edu Thu Jun 17 13:34:56 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu, 17 Jun 2010 13:34:56 -0400 Subject: [racket] Eval and "compile: unbound identifier (and no #%app syntax transformer is bound) in:" In-Reply-To: References: Message-ID: <2B368C01-430E-438B-8BA7-7A8254B780C7@ccs.neu.edu> I think Valeriya is using the Guide, to wit http://docs.racket-lang.org/guide/eval.html > > (eval '(+ 1 2)) > 3 is the first example. On Jun 17, 2010, at 1:05 PM, Robby Findler wrote: > Please see the Guide on eval. > > Robby > > On Thu, Jun 17, 2010 at 12:01 PM, Valeriya Pudova > wrote: >> Hi >> >> With the Racket 5, this simple code >> >> #lang scheme >> (eval '(+ 1 2)) >> >> printout error >> >> compile: unbound identifier (and no #%app syntax transformer is >> bound) in: + >> >> What is wrong? >> >> -- Valeriya >> >> _________________________________________________ >> For list-related administrative tasks: >> http://lists.racket-lang.org/listinfo/users >> > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From robby at eecs.northwestern.edu Thu Jun 17 13:45:57 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu, 17 Jun 2010 12:45:57 -0500 Subject: [racket] Eval and "compile: unbound identifier (and no #%app syntax transformer is bound) in:" In-Reply-To: <2B368C01-430E-438B-8BA7-7A8254B780C7@ccs.neu.edu> References: <2B368C01-430E-438B-8BA7-7A8254B780C7@ccs.neu.edu> Message-ID: Oh, I see. The relevant section in the guide is 15.1.2 (a little further on). I've added this note to the docs. Does that help? @margin-note{This example will not run properly in DrRacket's definitions window but it will in the interactions window; read on for why (specifically see the end of @secref["namespaces"]).} On Thu, Jun 17, 2010 at 12:34 PM, Matthias Felleisen wrote: > > I think Valeriya is using the Guide, to wit > > ?http://docs.racket-lang.org/guide/eval.html > >> > (eval '(+ 1 2)) >> ?3 > > is the first example. > > > > > On Jun 17, 2010, at 1:05 PM, Robby Findler wrote: > >> Please see the Guide on eval. >> >> Robby >> >> On Thu, Jun 17, 2010 at 12:01 PM, Valeriya Pudova >> wrote: >>> >>> Hi >>> >>> With the Racket 5, this simple code >>> >>> #lang scheme >>> (eval '(+ 1 2)) >>> >>> printout error >>> >>> compile: unbound identifier (and no #%app syntax transformer is bound) >>> in: + >>> >>> What is wrong? >>> >>> -- Valeriya >>> >>> _________________________________________________ >>> ?For list-related administrative tasks: >>> ?http://lists.racket-lang.org/listinfo/users >>> >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://lists.racket-lang.org/listinfo/users > > From norman at astro.gla.ac.uk Fri Jun 18 05:02:12 2010 From: norman at astro.gla.ac.uk (Norman Gray) Date: Fri, 18 Jun 2010 10:02:12 +0100 Subject: [racket] PLaneT and proxies Message-ID: Greetings. PLaneT appears to have some difficulties with HTTP caches. When I require a PLaneT package, I get an error: csv2skos.rkt:3:9: require: PLaneT could not download the requested package: Internal error (unknown HTTP response code 403) in: (planet neil/csv:1:6/csv) This is probably due to the presence of the campus-wide HTTP cache (long may its bits rot). Installing the package manually does work, but is a bit of a fuss (that's using % curl `planet url neil csv.plt 1 6` >csv.plt % planet fileinject neil csv.plt 1 6 ...for the archive's reference), and this has cropped up on 'this' list before , but the resolution there was simply 'yes, this is a proxy problem'. So: herewith the obvious feature request. Would it be feasible or reasonable for racket to respect the conventional $http_proxy environment variable (on Unix boxes, obviously, but I imagine there's a windows alternative)? Something along the lines of net/url's (current-proxy-servers (parse-proxy-string (getenv "http_proxy"))) would appear to be sufficient. Best wishes, Norman -- Norman Gray : http://nxg.me.uk From jensaxel at soegaard.net Fri Jun 18 09:47:55 2010 From: jensaxel at soegaard.net (=?UTF-8?Q?Jens_Axel_S=C3=B8gaard?=) Date: Fri, 18 Jun 2010 15:47:55 +0200 Subject: [racket] [The Racket Blog] New comment on Racket. In-Reply-To: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com> References: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com> Message-ID: 2010/6/18 Kyle Smith : > Kyle Smith has left a new comment on your post "Racket": > > Racket is just an organized scheme. The name still brings up connotations of > something nefarious. What is in a name? I'm good with it if it continues to > run on a proper OpenBSD platform. Will Apple let something, so expressive as > ?Racket?, the honor of being available from their apps store, for use with > the iPad? Now that would be the app to write, however, unless Apple has > changed their minds, no interpretive languages, that I'm aware of, have made > it to iTunes. In the latest agreement Apple changed the wording to: Unless otherwise approved by Apple in writing, no interpreted code may be downloaded or used in an Application except for code that is interpreted and run by Apple?s Documented APIs and built-in interpreter(s). Notwithstanding the foregoing, with Apple?s prior written consent, an Application may use embedded interpreted code in a limited way if such use is solely for providing minor features or functionality that are consistent with the intended and advertised purpose of the Application.? This means that if Racket gets an Arm port, it is possible to use it. MzScheme used to have an Arm port, but I am somewhat unsure, whether it has survived the test of time. Has it survived? -- Jens Axel S?gaard From neil at neilvandyke.org Fri Jun 18 10:28:44 2010 From: neil at neilvandyke.org (Neil Van Dyke) Date: Fri, 18 Jun 2010 10:28:44 -0400 Subject: [racket] iPhone (Was: [The Racket Blog] New comment on Racket.) In-Reply-To: References: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com> Message-ID: <4C1B829C.4010806@neilvandyke.org> Apple has been brutal with iPhone developers, running the platform as a ruthless and fickle dictatorship. I believe that this is the general perception of iPhone developers. Even if one is willing to jump through Apple's hoops, and one accepts that, at any time and for any reason, Apple will have no qualms about simply kicking one off the platform, instantly and without explanation... I believe that there is also an ethical question of whether supporting the iPhone platform is contributing to the success of Apple's ruthless, anti-competitive, and closed-platform practices. Android, Symbian, the new Nokia Qt stuff, Java... all alternative mobile device platforms for civic-minded techies to consider. -- http://www.neilvandyke.org/ From robby at eecs.northwestern.edu Fri Jun 18 10:33:22 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Fri, 18 Jun 2010 09:33:22 -0500 Subject: [racket] iPhone (Was: [The Racket Blog] New comment on Racket.) In-Reply-To: <4C1B829C.4010806@neilvandyke.org> References: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com> <4C1B829C.4010806@neilvandyke.org> Message-ID: Why is this an ethical question and not an economic one? Robby On Friday, June 18, 2010, Neil Van Dyke wrote: > Apple has been brutal with iPhone developers, running the platform as a ruthless and fickle dictatorship. ?I believe that this is the general perception of iPhone developers. > > Even if one is willing to jump through Apple's hoops, and one accepts that, at any time and for any reason, Apple will have no qualms about simply kicking one off the platform, instantly and without explanation... I believe that there is also an ethical question of whether supporting the iPhone platform is contributing to the success of Apple's ruthless, anti-competitive, and closed-platform practices. > > Android, Symbian, the new Nokia Qt stuff, Java... all alternative mobile device platforms for civic-minded techies to consider. > > -- > http://www.neilvandyke.org/ > > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > From neil at neilvandyke.org Fri Jun 18 10:58:33 2010 From: neil at neilvandyke.org (Neil Van Dyke) Date: Fri, 18 Jun 2010 10:58:33 -0400 Subject: [racket] iPhone (Was: [The Racket Blog] New comment on Racket.) In-Reply-To: References: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com> <4C1B829C.4010806@neilvandyke.org> Message-ID: <4C1B8999.1060200@neilvandyke.org> I think it's both. I mentioned the ethical question because one could probably find a worthwhile risk-reward solution for the short-term self-interest economics question, or one could find a way to cover one's own butt (perhaps involving a backroom deal and PR leverage), but I think that the ethics (collective, long-term) problem of supporting the iPhone iron-fisting is harder to resolve. Robby Findler wrote at 06/18/2010 10:33 AM: > Why is this an ethical question and not an economic one? > > Robby > > On Friday, June 18, 2010, Neil Van Dyke wrote: > >> Apple has been brutal with iPhone developers, running the platform as a ruthless and fickle dictatorship. I believe that this is the general perception of iPhone developers. >> >> Even if one is willing to jump through Apple's hoops, and one accepts that, at any time and for any reason, Apple will have no qualms about simply kicking one off the platform, instantly and without explanation... I believe that there is also an ethical question of whether supporting the iPhone platform is contributing to the success of Apple's ruthless, anti-competitive, and closed-platform practices. >> >> Android, Symbian, the new Nokia Qt stuff, Java... all alternative mobile device platforms for civic-minded techies to consider. >> >> From robby at eecs.northwestern.edu Fri Jun 18 11:15:36 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Fri, 18 Jun 2010 10:15:36 -0500 Subject: [racket] iPhone (Was: [The Racket Blog] New comment on Racket.) In-Reply-To: <4C1B8999.1060200@neilvandyke.org> References: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com> <4C1B829C.4010806@neilvandyke.org> <4C1B8999.1060200@neilvandyke.org> Message-ID: We are a fair bit off topic here, but what I see in Apple's policies is a desire to ensure that their devices behave in consistent, well-designed ways and to make that happen they have decided to do things like charge more money for them (presumably to pain for the extra work that goes into the design process), design their own hardware & software platform together, and to limit the kinds of third-party stuff that can go on them. They do this in order to guarantee they are easy to use and thus hope to sell more of them. While I certainly agree with the sentiment that they go to far to achieve this end (and I personally find their earlier PL-based restrictions to be very disappointing) I can't see how this could be considered an ethical issue. Robby On Friday, June 18, 2010, Neil Van Dyke wrote: > I think it's both. ?I mentioned the ethical question because one could probably find a worthwhile risk-reward solution for the short-term self-interest economics question, or one could find a way to cover one's own butt (perhaps involving a backroom deal and PR leverage), but I think that the ethics (collective, long-term) problem of supporting the iPhone iron-fisting is harder to resolve. > > Robby Findler wrote at 06/18/2010 10:33 AM: > > Why is this an ethical question and not an economic one? > > Robby > > On Friday, June 18, 2010, Neil Van Dyke wrote: > > > Apple has been brutal with iPhone developers, running the platform as a ruthless and fickle dictatorship. ?I believe that this is the general perception of iPhone developers. > > Even if one is willing to jump through Apple's hoops, and one accepts that, at any time and for any reason, Apple will have no qualms about simply kicking one off the platform, instantly and without explanation... I believe that there is also an ethical question of whether supporting the iPhone platform is contributing to the success of Apple's ruthless, anti-competitive, and closed-platform practices. > > Android, Symbian, the new Nokia Qt stuff, Java... all alternative mobile device platforms for civic-minded techies to consider. > > > > > From neil at neilvandyke.org Fri Jun 18 11:49:00 2010 From: neil at neilvandyke.org (Neil Van Dyke) Date: Fri, 18 Jun 2010 11:49:00 -0400 Subject: [racket] iPhone (Was: [The Racket Blog] New comment on Racket.) In-Reply-To: References: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com> <4C1B829C.4010806@neilvandyke.org> <4C1B8999.1060200@neilvandyke.org> Message-ID: <4C1B956C.1080606@neilvandyke.org> I have gotten a somewhat less favorable impression of Apple's motives and methods... I believe that Apple has been in anticompetitive territory, such as killing off apps when when they now compete with their own offerings or partnerships, and prohibiting features that would let developers or users add behavior that Apple could not kill off in this way when it becomes competition. There is also anti-free-speech territory, with Apple prohibiting "objectionable" content. Although sometimes they have disingenuously used the "family values" line for anticompetitive purposes, such as prohibiting a Project Gutenberg e-book viewer because that competes with big-business selling e-books, or prohibiting independent apps with bikini pictures but selling a Playboy app.) Google has a "don't be evil" policy, but Apple's new policy seems to be more like, "be a fashionable rich kid, and you can get away with anything." :) I believe that this is relevant to any Racket developers considering whether or how they want to be investing in and supporting the iPhone platform. Robby Findler wrote at 06/18/2010 11:15 AM: > We are a fair bit off topic here, but what I see in Apple's policies > is a desire to ensure that their devices behave in consistent, > well-designed ways and to make that happen they have decided to do > things like charge more money for them (presumably to pain for the > extra work that goes into the design process), design their own > hardware & software platform together, and to limit the kinds of > third-party stuff that can go on them. They do this in order to > guarantee they are easy to use and thus hope to sell more of them. > While I certainly agree with the sentiment that they go to far to > achieve this end (and I personally find their earlier PL-based > restrictions to be very disappointing) I can't see how this could be > considered an ethical issue. > > Robby > > On Friday, June 18, 2010, Neil Van Dyke wrote: > >> I think it's both. I mentioned the ethical question because one could probably find a worthwhile risk-reward solution for the short-term self-interest economics question, or one could find a way to cover one's own butt (perhaps involving a backroom deal and PR leverage), but I think that the ethics (collective, long-term) problem of supporting the iPhone iron-fisting is harder to resolve. >> >> Robby Findler wrote at 06/18/2010 10:33 AM: >> >> Why is this an ethical question and not an economic one? >> >> Robby >> >> On Friday, June 18, 2010, Neil Van Dyke wrote: >> >> >> Apple has been brutal with iPhone developers, running the platform as a ruthless and fickle dictatorship. I believe that this is the general perception of iPhone developers. >> >> Even if one is willing to jump through Apple's hoops, and one accepts that, at any time and for any reason, Apple will have no qualms about simply kicking one off the platform, instantly and without explanation... I believe that there is also an ethical question of whether supporting the iPhone platform is contributing to the success of Apple's ruthless, anti-competitive, and closed-platform practices. >> >> Android, Symbian, the new Nokia Qt stuff, Java... all alternative mobile device platforms for civic-minded techies to consider. >> >> >> >> >> >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From engineer at alum.mit.edu Fri Jun 18 11:53:21 2010 From: engineer at alum.mit.edu ('Paul Ojanen') Date: Fri, 18 Jun 2010 11:53:21 -0400 Subject: [racket] iPhone (Was: [The Racket Blog] New comment on Racket.) In-Reply-To: <4C1B829C.4010806@neilvandyke.org> References: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com> <4C1B829C.4010806@neilvandyke.org> Message-ID: <123EB819FD044C868D62368C4E76A15D@ptab> > Even if one is willing to jump through Apple's hoops, and one accepts > that, at any time and for any reason, Apple will have no qualms about > simply kicking one off the platform, instantly and without > explanation... Steve Jobs agrees... http://www.apple.com/hotnews/thoughts-on-flash/ ...see number six. His "most important reason" for not supporting Flash explains why Apple is wary of third-party developing environments. From Racket's perspective this gives reason to be reciprocally wary of supporting the iPhone platform. -Paul From kwinterling at gmail.com Fri Jun 18 12:02:20 2010 From: kwinterling at gmail.com (Karl Winterling) Date: Fri, 18 Jun 2010 09:02:20 -0700 Subject: [racket] iPhone (Was: [The Racket Blog] New comment on Racket.) In-Reply-To: References: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com> <4C1B829C.4010806@neilvandyke.org> <4C1B8999.1060200@neilvandyke.org> Message-ID: It's probably a mix of Apple's desire to have a consistent user interface, control code distribution through the app store, prevent worthy competing API's (like, say, Java ME) from challenging Cocoa (which partially concerns money and partially consistent UI), and assure the FCC and carriers that no one (other than people who want to do something illegal) will get direct access to hardware and do something questionable. I think it's an ethical question insofar as it relates to the freedom consumers should have to run any code they want on their computers or, more generally, use their computers for any (legal) purpose. Some consumers know how to write code, so they should be able to run it on their iphones and share it without restriction. Beyond protecting their kids from sexual predators, I'm really indifferent to whether parents think it's objectionable for their kids to look at "clad women/men." That's why you have parental controls. It's not Apple's job to decide whether Space: 1999 is appropriate for the average US/EU/Japan/SK family. On Fri, Jun 18, 2010 at 8:15 AM, Robby Findler wrote: > We are a fair bit off topic here, but what I see in Apple's policies > is a desire to ensure that their devices behave in consistent, > well-designed ways and to make that happen they have decided to do > things like charge more money for them (presumably to pain for the > extra work that goes into the design process), design their own > hardware & software platform together, and to limit the kinds of > third-party stuff that can go on them. They do this in order to > guarantee they are easy to use and thus hope to sell more of them. > While I certainly agree with the sentiment that they go to far to > achieve this end (and I personally find their earlier PL-based > restrictions to be very disappointing) I can't see how this could be > considered an ethical issue. > > Robby > > On Friday, June 18, 2010, Neil Van Dyke wrote: >> I think it's both. ?I mentioned the ethical question because one could probably find a worthwhile risk-reward solution for the short-term self-interest economics question, or one could find a way to cover one's own butt (perhaps involving a backroom deal and PR leverage), but I think that the ethics (collective, long-term) problem of supporting the iPhone iron-fisting is harder to resolve. >> >> Robby Findler wrote at 06/18/2010 10:33 AM: >> >> Why is this an ethical question and not an economic one? >> >> Robby >> >> On Friday, June 18, 2010, Neil Van Dyke wrote: >> >> >> Apple has been brutal with iPhone developers, running the platform as a ruthless and fickle dictatorship. ?I believe that this is the general perception of iPhone developers. >> >> Even if one is willing to jump through Apple's hoops, and one accepts that, at any time and for any reason, Apple will have no qualms about simply kicking one off the platform, instantly and without explanation... I believe that there is also an ethical question of whether supporting the iPhone platform is contributing to the success of Apple's ruthless, anti-competitive, and closed-platform practices. >> >> Android, Symbian, the new Nokia Qt stuff, Java... all alternative mobile device platforms for civic-minded techies to consider. >> >> >> >> >> > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users From jwise at draga.com Fri Jun 18 13:32:19 2010 From: jwise at draga.com (Jim Wise) Date: Fri, 18 Jun 2010 13:32:19 -0400 Subject: [racket] iPhone In-Reply-To: <4C1B956C.1080606@neilvandyke.org> (Neil Van Dyke's message of "Fri, 18 Jun 2010 11:49:00 -0400") References: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com> <4C1B829C.4010806@neilvandyke.org> <4C1B8999.1060200@neilvandyke.org> <4C1B956C.1080606@neilvandyke.org> Message-ID: <87k4pwdz6k.fsf@gondolin.draga.com> Neil Van Dyke writes: > There is also anti-free-speech territory, with Apple prohibiting > "objectionable" content.? Although sometimes they have disingenuously > used the "family values" line for anticompetitive purposes, such as > prohibiting a Project Gutenberg e-book viewer because that competes > with big-business selling e-books, or prohibiting independent apps > with bikini pictures but selling a Playboy app.) I'm not sure how Apple's decision as to what they sell in their own store can be construed as a free speech issue. It may be an argument against shopping at that store for you, but surely that's a different statement... Remember, this isn't even a question of what you can run on your iPhone -- the (free!) iPhone developer kit lets you download software you compile yourself from your computer to the iPhone. What you can't do is upload that software to Apple's store. I think the only real confusion comes in when you look at the iPhone and think of it as a general-purpose computer -- an environment where you are used to downloading your own software. A better comparison is to a game console like a Nintendo Wii or a Microsoft XBox, where it has always been the case that only software sold under a license from the console manufacturer was available. In comparison, it's worth noting that Sony experimented with allowing third-party OS software to run on the PS3, and has since backed away from doing so. > I believe that this is relevant to any Racket developers considering > whether or how they want to be investing in and supporting the iPhone > platform. This is clearly true -- the effort to port Racket to the iPhone as an officially supported platform is probably not justified, considering that only iPhone developers will be able to use it. I would hope that Apple would see some benefit in loosening this policy in the future, but if they don't, it's one more factor to consider when deciding if you want an iPhone. -- Jim Wise jwise at draga.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 184 bytes Desc: not available URL: From kwinterling at gmail.com Fri Jun 18 13:40:16 2010 From: kwinterling at gmail.com (Karl Winterling) Date: Fri, 18 Jun 2010 10:40:16 -0700 Subject: [racket] iPhone (Was: [The Racket Blog] New comment on Racket.) In-Reply-To: References: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com> <4C1B829C.4010806@neilvandyke.org> <4C1B8999.1060200@neilvandyke.org> Message-ID: I know this is a bit off-topic, but I wanted to see if anybody knows of an iPad-like device that lets you install LaTeX and a PDF viewer that supports annotations. On Fri, Jun 18, 2010 at 9:02 AM, Karl Winterling wrote: > It's probably a mix of Apple's desire to have a consistent user > interface, control code distribution through the app store, prevent > worthy competing API's (like, say, Java ME) from challenging Cocoa > (which partially concerns money and partially consistent UI), and > assure the FCC and carriers that no one (other than people who want to > do something illegal) will get direct access to hardware and do > something questionable. > > I think it's an ethical question insofar as it relates to the freedom > consumers should have to run any code they want on their computers or, > more generally, use their computers for any (legal) purpose. Some > consumers know how to write code, so they should be able to run it on > their iphones and share it without restriction. > > Beyond protecting their kids from sexual predators, I'm really > indifferent to whether parents think it's objectionable for their kids > to look at "clad women/men." That's why you have parental controls. > It's not Apple's job to decide whether Space: 1999 is appropriate for > the average US/EU/Japan/SK family. > > On Fri, Jun 18, 2010 at 8:15 AM, Robby Findler > wrote: >> We are a fair bit off topic here, but what I see in Apple's policies >> is a desire to ensure that their devices behave in consistent, >> well-designed ways and to make that happen they have decided to do >> things like charge more money for them (presumably to pain for the >> extra work that goes into the design process), design their own >> hardware & software platform together, and to limit the kinds of >> third-party stuff that can go on them. They do this in order to >> guarantee they are easy to use and thus hope to sell more of them. >> While I certainly agree with the sentiment that they go to far to >> achieve this end (and I personally find their earlier PL-based >> restrictions to be very disappointing) I can't see how this could be >> considered an ethical issue. >> >> Robby >> >> On Friday, June 18, 2010, Neil Van Dyke wrote: >>> I think it's both. ?I mentioned the ethical question because one could probably find a worthwhile risk-reward solution for the short-term self-interest economics question, or one could find a way to cover one's own butt (perhaps involving a backroom deal and PR leverage), but I think that the ethics (collective, long-term) problem of supporting the iPhone iron-fisting is harder to resolve. >>> >>> Robby Findler wrote at 06/18/2010 10:33 AM: >>> >>> Why is this an ethical question and not an economic one? >>> >>> Robby >>> >>> On Friday, June 18, 2010, Neil Van Dyke wrote: >>> >>> >>> Apple has been brutal with iPhone developers, running the platform as a ruthless and fickle dictatorship. ?I believe that this is the general perception of iPhone developers. >>> >>> Even if one is willing to jump through Apple's hoops, and one accepts that, at any time and for any reason, Apple will have no qualms about simply kicking one off the platform, instantly and without explanation... I believe that there is also an ethical question of whether supporting the iPhone platform is contributing to the success of Apple's ruthless, anti-competitive, and closed-platform practices. >>> >>> Android, Symbian, the new Nokia Qt stuff, Java... all alternative mobile device platforms for civic-minded techies to consider. >>> >>> >>> >>> >>> >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://lists.racket-lang.org/listinfo/users > From clements at brinckerhoff.org Fri Jun 18 13:41:55 2010 From: clements at brinckerhoff.org (John Clements) Date: Fri, 18 Jun 2010 10:41:55 -0700 Subject: [racket] iPhone In-Reply-To: <87k4pwdz6k.fsf@gondolin.draga.com> References: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com> <4C1B829C.4010806@neilvandyke.org> <4C1B8999.1060200@neilvandyke.org> <4C1B956C.1080606@neilvandyke.org> <87k4pwdz6k.fsf@gondolin.draga.com> Message-ID: On Jun 18, 2010, at 10:32 AM, Jim Wise wrote: > I think the only real confusion comes in when you look at the iPhone and > think of it as a general-purpose computer -- an environment where you > are used to downloading your own software. A better comparison is to a > game console like a Nintendo Wii or a Microsoft XBox, where it has > always been the case that only software sold under a license from the > console manufacturer was available. In comparison, it's worth noting > that Sony experimented with allowing third-party OS software to run on > the PS3, and has since backed away from doing so. To bring this closer to home: This reminds me of the rumor going around about two months ago, that Apple was going create an "App Store" for macs, meaning that only apple-approved applications could run on macs. It was just a rumor, but my thought at the time was that for a large class of users, this would be a welcome change. At the same time, it would completely hose Racket, and any other development group that didn't have a legal and marketing team to get their development environment approved. I think it's a good idea to be aware that the ability to compile and run arbitrary programs on the computers sold to us by Apple (or any other company) is not a constitutionally protected right, and that many if not all OS vendors would be delighted to move to a world where all applications required licensing fees and prior approval. My guess is that when this becomes feasible, it will happen. John Clements -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4669 bytes Desc: not available URL: From kwinterling at gmail.com Fri Jun 18 13:46:04 2010 From: kwinterling at gmail.com (Karl Winterling) Date: Fri, 18 Jun 2010 10:46:04 -0700 Subject: [racket] iPhone In-Reply-To: <87k4pwdz6k.fsf@gondolin.draga.com> References: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com> <4C1B829C.4010806@neilvandyke.org> <4C1B8999.1060200@neilvandyke.org> <4C1B956C.1080606@neilvandyke.org> <87k4pwdz6k.fsf@gondolin.draga.com> Message-ID: On Fri, Jun 18, 2010 at 10:32 AM, Jim Wise wrote: > > I think the only real confusion comes in when you look at the iPhone and > think of it as a general-purpose computer -- an environment where you > are used to downloading your own software. ?A better comparison is to a > game console like a Nintendo Wii or a Microsoft XBox, where it has > always been the case that only software sold under a license from the > console manufacturer was available. ?In comparison, it's worth noting > that Sony experimented with allowing third-party OS software to run on > the PS3, and has since backed away from doing so. > *Yawn* http://www.youtube.com/watch?v=uxjpmc8ZIxM From neil at neilvandyke.org Fri Jun 18 13:46:21 2010 From: neil at neilvandyke.org (Neil Van Dyke) Date: Fri, 18 Jun 2010 13:46:21 -0400 Subject: [racket] iPhone In-Reply-To: <87k4pwdz6k.fsf@gondolin.draga.com> References: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com> <4C1B829C.4010806@neilvandyke.org> <4C1B8999.1060200@neilvandyke.org> <4C1B956C.1080606@neilvandyke.org> <87k4pwdz6k.fsf@gondolin.draga.com> Message-ID: <4C1BB0ED.1030504@neilvandyke.org> > I think the only real confusion comes in when you look at the iPhone and think of it as a general-purpose computer The smartphone is a key ubiquitous computing device, and I believe that the app selection for iPhone/Android/etc. constitutes "general-purpose." I believe that keeping these platforms open is extremely important. -- http://www.neilvandyke.org/ From engineer at alum.mit.edu Fri Jun 18 14:17:52 2010 From: engineer at alum.mit.edu ('Paul Ojanen') Date: Fri, 18 Jun 2010 14:17:52 -0400 Subject: [racket] iPhone In-Reply-To: <87k4pwdz6k.fsf@gondolin.draga.com> References: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com><4C1B829C.4010806@neilvandyke.org><4C1B8999.1060200@neilvandyke.org><4C1B956C.1080606@neilvandyke.org> <87k4pwdz6k.fsf@gondolin.draga.com> Message-ID: > Remember, this isn't even a question of what you can run on your iPhone > -- the (free!) iPhone developer kit lets you download software you > compile yourself from your computer to the iPhone. Their SDK runs on MY computer? -Paul From jwise at draga.com Fri Jun 18 14:22:49 2010 From: jwise at draga.com (Jim Wise) Date: Fri, 18 Jun 2010 14:22:49 -0400 Subject: [racket] iPhone In-Reply-To: (Karl Winterling's message of "Fri, 18 Jun 2010 10:46:04 -0700") References: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com> <4C1B829C.4010806@neilvandyke.org> <4C1B8999.1060200@neilvandyke.org> <4C1B956C.1080606@neilvandyke.org> <87k4pwdz6k.fsf@gondolin.draga.com> Message-ID: <87d3vodwue.fsf@gondolin.draga.com> Karl Winterling writes: > On Fri, Jun 18, 2010 at 10:32 AM, Jim Wise wrote: >> >> I think the only real confusion comes in when you look at the iPhone and >> think of it as a general-purpose computer -- an environment where you >> are used to downloading your own software. ?A better comparison is to a >> game console like a Nintendo Wii or a Microsoft XBox, where it has >> always been the case that only software sold under a license from the >> console manufacturer was available. ?In comparison, it's worth noting >> that Sony experimented with allowing third-party OS software to run on >> the PS3, and has since backed away from doing so. >> > > *Yawn* > > http://www.youtube.com/watch?v=uxjpmc8ZIxM The same is obviously true of the iPhone -- `jailbreak' kits are readily available, and tend to be updated promptly when a new phone or OS Version ships. But we're discussing the terms of Apple's user agreement, not what's technically achievable. (There are lively homebrew communities for the Nintendo Wii and Sony PSP as well, by the way.) -- Jim Wise jwise at draga.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 184 bytes Desc: not available URL: From raffaelcavallaro at mac.com Fri Jun 18 14:23:05 2010 From: raffaelcavallaro at mac.com (Raffael Cavallaro) Date: Fri, 18 Jun 2010 14:23:05 -0400 Subject: [racket] iPhone In-Reply-To: References: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com> <4C1B829C.4010806@neilvandyke.org> <4C1B8999.1060200@neilvandyke.org> <4C1B956C.1080606@neilvandyke.org> <87k4pwdz6k.fsf@gondolin.draga.com> Message-ID: On Jun 18, 2010, at 1:41 PM, John Clements wrote: > I think it's a good idea to be aware that the ability to compile and run arbitrary programs on the computers sold to us by Apple (or any other company) is not a constitutionally protected right, and that many if not all OS vendors would be delighted to move to a world where all applications required licensing fees and prior approval. My guess is that when this becomes feasible, it will happen. I won't say that Apple isn't foolish enough to shoot themselves in the foot in this way, but I think it's unlikely. Jobs himself compared laptops/desktops to trucks (as opposed to passenger cars) - very necessary, much more general purpose and more powerful machines, with a concomitantly limited user base. In this view there's no need to lock down the MacOS since it is no longer going to be targeted at consumers, but only at a restricted range of professionals - developers, professional content producers in film & publishing, research scientists, etc. - who don't need or want either the hand-holding or the content-filtering-nanny features of a consumer OS. If what you hypothesize were to happen, my guess is that open source OS usage among developers will skyrocket. I know I'd move to linux-intel from MacOS or Windows in a heartbeat if Apple and Microsoft ever restricted the apps I could run on MacOS and Windows to those approved for sale in an Apple or Microsoft App Store. To a certain extent, this is already happening in the smart phone market. Many developers feel as Neil Van Dyke does: On Jun 18, 2010, at 1:46 PM, Neil Van Dyke wrote: > The smartphone is a key ubiquitous computing device, and I believe that the app selection for iPhone/Android/etc. constitutes "general-purpose." > > I believe that keeping these platforms open is extremely important. So devs are voting with their feet - many are buying android phones, not iPhones or iPads. To bring this more on topic, I think a good approach to all these issues from a Racket perspective is to develop an HTML5 web-app framework that intelligently adjusts content for the device making the request. This way Racket apps could run across all platforms with a decent HTML5 browser, and we wouldn't have to worry about the restrictions of any mother-may-iOS. warmest regards, Ralph Raffael Cavallaro raffaelcavallaro at me.com From jwise at draga.com Fri Jun 18 14:27:32 2010 From: jwise at draga.com (Jim Wise) Date: Fri, 18 Jun 2010 14:27:32 -0400 Subject: [racket] iPhone In-Reply-To: (Karl Winterling's message of "Fri, 18 Jun 2010 10:40:16 -0700") References: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com> <4C1B829C.4010806@neilvandyke.org> <4C1B8999.1060200@neilvandyke.org> Message-ID: <8739wkdwmj.fsf@gondolin.draga.com> Karl Winterling writes: > I know this is a bit off-topic, but I wanted to see if anybody knows > of an iPad-like device that lets you install LaTeX and a PDF viewer > that supports annotations. Sadly, that would also be against the terms of Apple's end-user license (TeX would be a language interpreted on the device, after all), which is a shame, considering how perfect the iPad would be for such a purpose. Unfortunately, I don't know of any such project for Android or other moblie-oriented platforms either -- probably a NetBook running some Unix-alike or another is the closest you can get today... -- Jim Wise jwise at draga.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 184 bytes Desc: not available URL: From noelwelsh at gmail.com Fri Jun 18 14:55:38 2010 From: noelwelsh at gmail.com (Noel Welsh) Date: Fri, 18 Jun 2010 19:55:38 +0100 Subject: [racket] iPhone In-Reply-To: <8739wkdwmj.fsf@gondolin.draga.com> References: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com> <4C1B829C.4010806@neilvandyke.org> <4C1B8999.1060200@neilvandyke.org> <8739wkdwmj.fsf@gondolin.draga.com> Message-ID: > Karl Winterling writes: > >> I know this is a bit off-topic, but I wanted to see if anybody knows >> of an iPad-like device that lets you install LaTeX and a PDF viewer >> that supports annotations. > There are a tonne of ebook readers than run Linux (or Android): http://en.wikipedia.org/wiki/Comparison_of_e-book_readers HTH, N. From eli at barzilay.org Fri Jun 18 15:00:29 2010 From: eli at barzilay.org (Eli Barzilay) Date: Fri, 18 Jun 2010 15:00:29 -0400 Subject: [racket] [The Racket Blog] New comment on Racket. In-Reply-To: References: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com> Message-ID: <19483.49741.947366.912966@winooski.ccs.neu.edu> On Jun 18, Jens Axel S?gaard wrote: > > This means that if Racket gets an Arm port, it is possible to use > it. MzScheme used to have an Arm port, but I am somewhat unsure, > whether it has survived the test of time. Has it survived? Last time I tried a build on an Arm machine, it went through fine, including the gui. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From eli at barzilay.org Fri Jun 18 15:08:33 2010 From: eli at barzilay.org (Eli Barzilay) Date: Fri, 18 Jun 2010 15:08:33 -0400 Subject: [racket] iPhone (Was: [The Racket Blog] New comment on Racket.) In-Reply-To: <4C1B956C.1080606@neilvandyke.org> References: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com> <4C1B829C.4010806@neilvandyke.org> <4C1B8999.1060200@neilvandyke.org> <4C1B956C.1080606@neilvandyke.org> Message-ID: <19483.50225.955493.575688@winooski.ccs.neu.edu> 1. I cannot agree with Neil more strongly. I now have a ipad (for various reasons), and I think that the most obvious word that comes up to my mind seeing it is "fear". I view a future like John describes (computers running only approved apps) as a 1984-ish kind of hell -- and I think that if anyone will do it, Apple would definitely jump there first. 2. Regardless of all of this, this has very little to do with Racket specifically (beyond not being able to run it there, of course). There are other platforms where this is likely to be possible (a friend told me yesterday about a google nexus device he just got, which is apparently running an ubuntu-like environment -- so it seems like you can even hack your phone using shell scripts). 3. Please try to keep this on-topic -- I know how this subject can explode. On Jun 18, Neil Van Dyke wrote: > I have gotten a somewhat less favorable impression of Apple's motives > and methods... > > I believe that Apple has been in anticompetitive territory, such as > killing off apps when when they now compete with their own offerings or > partnerships, and prohibiting features that would let developers or > users add behavior that Apple could not kill off in this way when it > becomes competition. > > There is also anti-free-speech territory, with Apple prohibiting > "objectionable" content. Although sometimes they have disingenuously > used the "family values" line for anticompetitive purposes, such as > prohibiting a Project Gutenberg e-book viewer because that competes with > big-business selling e-books, or prohibiting independent apps with > bikini pictures but selling a Playboy app.) > > Google has a "don't be evil" policy, but Apple's new policy seems to be > more like, "be a fashionable rich kid, and you can get away with > anything." :) > > I believe that this is relevant to any Racket developers considering > whether or how they want to be investing in and supporting the iPhone > platform. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From dyoo at cs.wpi.edu Fri Jun 18 15:10:46 2010 From: dyoo at cs.wpi.edu (Danny Yoo) Date: Fri, 18 Jun 2010 15:10:46 -0400 Subject: [racket] segmentation fault while compiling mzscheme 4.2.5 on Xen environment Message-ID: I'm seeing the following error when trying to install mzscheme on a Xen-hosted virtual environment. In the middle of 'make', I see this: ##################################################################### make mzschemecgc make[4]: Entering directory `/home/dyoo/local/plt-4.2.5/src/mzscheme' gcc -I. -I./include -g -O2 -Wall -pthread -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DINITIAL_COLLECTS_DIRECTORY='"'"`cd ./../../collects; pwd`"'"' -c ./main.c -o main.o gcc -o mzschemecgc main.o libmzscheme.a libmzgc.a -pthread -ldl -lm -ldl -lm -rdynamic make[4]: Leaving directory `/home/dyoo/local/plt-4.2.5/src/mzscheme' make[3]: Leaving directory `/home/dyoo/local/plt-4.2.5/src/mzscheme' cd gc2; make all make[3]: Entering directory `/home/dyoo/local/plt-4.2.5/src/mzscheme/gc2' mkdir xsrc make xsrc/precomp.h make[4]: Entering directory `/home/dyoo/local/plt-4.2.5/src/mzscheme/gc2' env XFORM_PRECOMP=yes ../mzschemecgc -cqu ./xform.ss --setup . --cpp "gcc -E -I./.. -I./../include -pthread -DNEWGC_BTC_ACCOUNT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 " --keep-lines -o xsrc/precomp.h ./precomp.c Copying tree... make[4]: *** [xsrc/precomp.h] Segmentation fault make[4]: Leaving directory `/home/dyoo/local/plt-4.2.5/src/mzscheme/gc2' make[3]: *** [all] Error 2 make[3]: Leaving directory `/home/dyoo/local/plt-4.2.5/src/mzscheme/gc2' make[2]: *** [3m] Error 2 make[2]: Leaving directory `/home/dyoo/local/plt-4.2.5/src/mzscheme' make[1]: *** [3m] Error 2 make[1]: Leaving directory `/home/dyoo/local/plt-4.2.5/src' ##################################################################### Here's what uname says about my system: ################################################################ dyoo at go:~/local/plt-4.2.5/src$ uname -a Linux go 2.6.18-6-xen-686 #1 SMP Thu Nov 5 19:54:42 UTC 2009 i686 GNU/Linux ###################################################################### I'm seeing the same segmentation fault if I try compiling Racket as well: ####################################################################### make[4]: Entering directory `/home/dyoo/local/plt-5.0/src/racket/gc2' env XFORM_PRECOMP=yes ../racketcgc -cqu ./xform.rkt --setup . --cpp "gcc -E -I./.. -I./../include -pthread -DNEWGC_BTC_ACCOUNT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 " --keep-lines -o xsrc/precomp.h ./precomp.c Copying tree... make[4]: *** [xsrc/precomp.h] Segmentation fault make[4]: Leaving directory `/home/dyoo/local/plt-5.0/src/racket/gc2' make[3]: *** [all] Error 2 make[3]: Leaving directory `/home/dyoo/local/plt-5.0/src/racket/gc2' make[2]: *** [3m] Error 2 make[2]: Leaving directory `/home/dyoo/local/plt-5.0/src/racket' make[1]: *** [3m] Error 2 make[1]: Leaving directory `/home/dyoo/local/plt-5.0/src' make: *** [all] Error 2 ####################################################################### What other debugging information can I provide? From eli at barzilay.org Fri Jun 18 15:20:30 2010 From: eli at barzilay.org (Eli Barzilay) Date: Fri, 18 Jun 2010 15:20:30 -0400 Subject: [racket] segmentation fault while compiling mzscheme 4.2.5 on Xen environment In-Reply-To: References: Message-ID: <19483.50942.745932.274374@winooski.ccs.neu.edu> On Jun 18, Danny Yoo wrote: > What other debugging information can I provide? Create a core dump, then use gdb to get a stack trace. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From dyoo at cs.wpi.edu Fri Jun 18 15:22:57 2010 From: dyoo at cs.wpi.edu (Danny Yoo) Date: Fri, 18 Jun 2010 15:22:57 -0400 Subject: [racket] segmentation fault while compiling mzscheme 4.2.5 on Xen environment In-Reply-To: <19483.50942.745932.274374@winooski.ccs.neu.edu> References: <19483.50942.745932.274374@winooski.ccs.neu.edu> Message-ID: On Fri, Jun 18, 2010 at 3:20 PM, Eli Barzilay wrote: > On Jun 18, Danny Yoo wrote: >> What other debugging information can I provide? > > Create a core dump, then use gdb to get a stack trace. Ok, here's what I'm seeing: dyoo at go:~/local/plt-4.2.5/src/mzscheme/gc2$ gdb ../mzschemecgc core.29109 GNU gdb 6.8-debian Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i486-linux-gnu"... warning: Can't read pathname for load map: Input/output error. Reading symbols from /lib/i686/nosegneg/libdl.so.2...done. Loaded symbols for /lib/i686/nosegneg/libdl.so.2 Reading symbols from /lib/i686/nosegneg/libm.so.6...done. Loaded symbols for /lib/i686/nosegneg/libm.so.6 Reading symbols from /lib/i686/nosegneg/libpthread.so.0...done. Loaded symbols for /lib/i686/nosegneg/libpthread.so.0 Reading symbols from /lib/i686/nosegneg/libc.so.6...done. Loaded symbols for /lib/i686/nosegneg/libc.so.6 Reading symbols from /lib/ld-linux.so.2...done. Loaded symbols for /lib/ld-linux.so.2 Failed to read a valid object file image from memory. Core was generated by `../mzschemecgc -cqu ./xform.ss --setup . --cpp gcc -E -I./.. -I./../include -pt'. Program terminated with signal 11, Segmentation fault. [New process 29109] [New process 29110] #0 0x080c0a62 in scheme_jit_longjmp (b=0xbfb75ed8, v=1) at ./jit.c:12814 12814 while (stack_cache_stack_pos (gdb) bt #0 0x080c0a62 in scheme_jit_longjmp (b=0xbfb75ed8, v=1) at ./jit.c:12814 #1 0x08088d71 in scheme_do_eval (obj=0x1731e0, num_rands=1, rands=0xeccd0, get_value=-1) at ./eval.c:9101 #2 0x0808a4a9 in _scheme_apply_multi_from_native (rator=0xe, argc=1, argv=0xbfb75e9c) at ./schnapp.inc:84 #3 0xb7f7e44a in ?? () #4 0x00177930 in ?? () #5 0x00000001 in ?? () #6 0xbfb75e9c in ?? () #7 0x000edaf0 in ?? () #8 0xbfb7001d in ?? () #9 0x000c1488 in ?? () #10 0x00000000 in ?? () From eli at barzilay.org Fri Jun 18 15:28:47 2010 From: eli at barzilay.org (Eli Barzilay) Date: Fri, 18 Jun 2010 15:28:47 -0400 Subject: [racket] segmentation fault while compiling mzscheme 4.2.5 on Xen environment In-Reply-To: References: <19483.50942.745932.274374@winooski.ccs.neu.edu> Message-ID: <19483.51439.561467.723865@winooski.ccs.neu.edu> On Jun 18, Danny Yoo wrote: > On Fri, Jun 18, 2010 at 3:20 PM, Eli Barzilay wrote: > > On Jun 18, Danny Yoo wrote: > >> What other debugging information can I provide? > > > > Create a core dump, then use gdb to get a stack trace. > > Ok, here's what I'm seeing: > [...] Thanks -- this is likely to be helpful for Matthew to debug (looks like the problem is in the jit). -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From plt at davidb.org Sat Jun 19 01:37:10 2010 From: plt at davidb.org (David Brown) Date: Fri, 18 Jun 2010 22:37:10 -0700 Subject: [racket] iPhone In-Reply-To: <87k4pwdz6k.fsf@gondolin.draga.com> References: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com> <4C1B829C.4010806@neilvandyke.org> <4C1B8999.1060200@neilvandyke.org> <4C1B956C.1080606@neilvandyke.org> <87k4pwdz6k.fsf@gondolin.draga.com> Message-ID: <20100619053710.GA8821@arch.davidb.org> On Fri, Jun 18, 2010 at 01:32:19PM -0400, Jim Wise wrote: >Remember, this isn't even a question of what you can run on your iPhone >-- the (free!) iPhone developer kit lets you download software you >compile yourself from your computer to the iPhone. What you can't do is >upload that software to Apple's store. No, the free iPhone SDK doesn't let you send programs you write to your phone. You can only run them in a simulator. You have to pay money for the privilege of being able to run them on a real device. David From plt at davidb.org Sat Jun 19 01:48:35 2010 From: plt at davidb.org (David Brown) Date: Fri, 18 Jun 2010 22:48:35 -0700 Subject: [racket] [The Racket Blog] New comment on Racket. In-Reply-To: <19483.49741.947366.912966@winooski.ccs.neu.edu> References: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com> <19483.49741.947366.912966@winooski.ccs.neu.edu> Message-ID: <20100619054835.GB8821@arch.davidb.org> On Fri, Jun 18, 2010 at 03:00:29PM -0400, Eli Barzilay wrote: >On Jun 18, Jens Axel S?gaard wrote: >> >> This means that if Racket gets an Arm port, it is possible to use >> it. MzScheme used to have an Arm port, but I am somewhat unsure, >> whether it has survived the test of time. Has it survived? > >Last time I tried a build on an Arm machine, it went through fine, >including the gui. I'm not sure what Apple's userspace environment is like, since I can't see it, but at least for Android, there would probably be a good amount of work to port Racket to even a compiled app. The C library present is kind of hand crafted just to meet the needs of Android and is missing a lot of stuff. Gui stuff would have to be ported to the Android-specific GUI library. It is running a Linux kernel, though, so it certainly would be possible. Google does provide a native development kit to help with this kind of thing, so it is even a supported thing to do. David From eli at barzilay.org Sat Jun 19 01:50:53 2010 From: eli at barzilay.org (Eli Barzilay) Date: Sat, 19 Jun 2010 01:50:53 -0400 Subject: [racket] [The Racket Blog] New comment on Racket. In-Reply-To: <20100619054835.GB8821@arch.davidb.org> References: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com> <19483.49741.947366.912966@winooski.ccs.neu.edu> <20100619054835.GB8821@arch.davidb.org> Message-ID: <19484.23229.251692.940547@winooski.ccs.neu.edu> On Jun 18, David Brown wrote: > On Fri, Jun 18, 2010 at 03:00:29PM -0400, Eli Barzilay wrote: > > > >Last time I tried a build on an Arm machine, it went through fine, > >including the gui. > > I'm not sure what Apple's userspace environment is like, since I > can't see it, but at least for Android, there would probably be a > good amount of work to port Racket to even a compiled app. The C > library present is kind of hand crafted just to meet the needs of > Android and is missing a lot of stuff. Gui stuff would have to be > ported to the Android-specific GUI library. The machine I was trying it on was (IIRC) a plain ubuntu setup, nothing as different or as limited as a phone. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From plt at davidb.org Sat Jun 19 02:20:32 2010 From: plt at davidb.org (David Brown) Date: Fri, 18 Jun 2010 23:20:32 -0700 Subject: [racket] [The Racket Blog] New comment on Racket. In-Reply-To: <19484.23229.251692.940547@winooski.ccs.neu.edu> References: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com> <19483.49741.947366.912966@winooski.ccs.neu.edu> <20100619054835.GB8821@arch.davidb.org> <19484.23229.251692.940547@winooski.ccs.neu.edu> Message-ID: <20100619062031.GA8942@arch.davidb.org> On Sat, Jun 19, 2010 at 01:50:53AM -0400, Eli Barzilay wrote: >> I'm not sure what Apple's userspace environment is like, since I >> can't see it, but at least for Android, there would probably be a >> good amount of work to port Racket to even a compiled app. The C >> library present is kind of hand crafted just to meet the needs of >> Android and is missing a lot of stuff. Gui stuff would have to be >> ported to the Android-specific GUI library. > >The machine I was trying it on was (IIRC) a plain ubuntu setup, >nothing as different or as limited as a phone. You can even run a fairly ordinary Ubuntu on a Nexus One, although it isn't all that useful as a phone that way. Some people have expressed a desire to run Android on top of an ordinary Linux userspace, but I don't know if any progress has been made in making that happen. David From valery at digitalchile.net Sat Jun 19 05:00:27 2010 From: valery at digitalchile.net (Valeriya Pudova) Date: Sat, 19 Jun 2010 13:00:27 +0400 Subject: [racket] Metaprogramming with scheme Message-ID: Hello Good People I have the task to make the translator from metalanguage A to the metalanguage B. My app should open file "a.ss", parse and translate to the file "b.ss". At the translation time the app should: 1) Expand all macro definitions of the file "a.ss" and evaluate all definitions witch are just a scheme. 2) Generate the s-record structure witch represent the content of "b.ss" 3) In case if the "a.ss" have a syntax errors - printout error message with the line number at the file "a.ss" and the expression where happen the error. For example: File: --------------------------------------------------------------------- (define-syntax foo ;; This is macro definition in the 'a' file ) (define (bar ...) ;; This is a function definition of the 'a' file ) ;; meta language expression (define-fsm :name "trigger" (define-state :name "zero" (on-event "switch" (foo ...) ;; use macro definition (go "one"))) (define-state :name "one" ;;; N.B. the scheme expression can be used anywhere there can be (string-append "on" "e") (on-event "switch" (foo ...) ;; call the function (go "one"))))) Eof File --------------------------------------------------------------------- In case if was used not valid keyword "define-fsmZ" the error message should be: a.ss:L:C: unknown symbol "define-fsmM" in: (define-fsmZ :name "trigger" (define-state .... Where L and C are line and column numbers. The easiest way to do this task can be: Just evaluate the file "a.ss" in the name space where are defined methods "define-fsm", "define-state", "on-event" and "go" But this case each of those methods will not have the syntax object of the evaluated expression. And in case if it will find and error it could not message about error's location. Alternative way is to use syntax-case instead methods for the "define-fsm", "define-state", "on-event" and "go" definitions. The body of macro will have the syntax object for an expression. (define-syntax (define-fsm stx) (syntax-case stx () [(_ params ...) (let ([name (get-name stx)]) ;;; the method 'get-name' will return extracted name from the syntax #'('fsm name))])) ;;; this is expression of language B This code will not work because macro expansion could not have access to variable 'name' And I do not know how resolve this issue. Another alternative is: to use the patterns like a: (define-syntax (define-fsm stx) (syntax-case stx (:name) [(_ :name name params ...) #'('fsm name)])) But in case if there are will be bunch of parameters in random order: :name ... :param1 ... :param2 ... etc or :param2 ... :name ... :param1 ... etc As result the body of the macro can be awkward. I spent already allot of time to make this task. And I have several variants of translator. None of them is good. I am not a good scheme programmer and have no any friend who can help. That is why I address my question to the Racket community: "What is the best way to make this task with scheme?" -- Valeriya -------------- next part -------------- An HTML attachment was scrubbed... URL: From laurent.orseau at gmail.com Sat Jun 19 08:42:47 2010 From: laurent.orseau at gmail.com (Laurent) Date: Sat, 19 Jun 2010 14:42:47 +0200 Subject: [racket] Compilation and additional collections Message-ID: Hi all, I'm trying to compile a project (Racket 5.0, WinXP) into a distribution with gracket base. I get the following error message when compiling: <<< e:\projets\scheme-svn\towers\towers-gui.ss:3:9: ATHENS/board2: standard-module-name-resolver: collection not found: "ATHENS" in any of: (# #) in: ATHENS/board2 === context === standard-module-name-resolver M:\Program Files\Racket\collects\compiler\embed-unit.rkt:366:4: get-code M:\Program Files\Racket\collects\racket\private\map.rkt:45:11: for-each M:\Program Files\Racket\collects\compiler\embed-unit.rkt:765:4: do-write-module-bundle >>> and it refuses to compile. The fact is I use an additional personal collection path which contains ATHENS/board2.ss, and it works correctly when executing the project from within DrRacket. Am I doing things the wrong way? Thanks, Laurent -------------- next part -------------- An HTML attachment was scrubbed... URL: From a2alt at ya.ru Sat Jun 19 12:04:13 2010 From: a2alt at ya.ru (Groshev Dmitry) Date: Sat, 19 Jun 2010 20:04:13 +0400 Subject: [racket] Continuations tutorial Message-ID: <195271276963453@web105.yandex.ru> Hi. Is there any good continuations tutorial? I've read the reference, but there isn't many examples or explanations. Maybe I'm a bit dumb, but I really need some examples of call/cc / call/ec / dynamic-wind usage to get it right. From plt at synx.us.to Sat Jun 19 13:37:36 2010 From: plt at synx.us.to (synx) Date: Sat, 19 Jun 2010 10:37:36 -0700 Subject: [racket] context switching In-Reply-To: <4C16876A.80108@zenburn.net> References: <4C130FB3.2050100@synx.us.to> <4C16876A.80108@zenburn.net> Message-ID: <4C1D0060.6040209@synx.us.to> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 06/14/2010 12:47 PM, Jakub Piotr C?apa wrote: > Why do you want to have your context in parameters in the first place? Eh, I don't really. I just like how they clean themselves up after leaving a parameterization, without the attendant loss of tail-optimization that happens with dynamic-wind. The whole "parameters are thunks" thing is a bit clunky, but doesn't seem unreasonable. What I want is to make a syntax form (perhaps an entire language) that lists what identifiers are parameters on top, and munges the code to add the parentheses when the parameters are not being set or re-parameterized. I haven't quite figured exactly how to do that though. > If you want to use multithreading then using parameters the way you do > will result in a diverging world. The context of the world would remain the same though. I'm only thinking like, the context of the current room you're in, in the current environment, at the current time of day, or other changeable things like that. > I don't think raw PLT Scheme is dynamic enough for this. I think eval is dynamic enough for just about anything... > As I see it you should build a dynamic (maybe > Smalltalk like, you may check schemetalk from SCG.unibe.ch) object > system with support for loading classes from disk at runtime (easy) and > switching them without restarting the server. Or I could just use Racket's object system, which seems pretty nice. Just (sandbox-eval '(define current-room (new room% (description "...") (parent inside-environment) (contents bell book candle) ...))) then I have a room in my evaluation context whose identifier is "current-room" Perhaps more usefully, (sandbox-eval (send current-room get-property "some-program")) > You may also check the DGD > MUD driver (it is a MUD driver based on a new implementation of the LPC > language and really nice persistency features; it seems to have quite a > good overal design). Sure, but it's a totally different language. I wanted to make something written in Racket and extended in Racket. I bet LPC doesn't have re-entrant continuations, or optimize tail calls, or custom syntax forms. > You also really need some ways to protect yourself agains malicious and > runaway code. (threads and kill-thread are good but you must check that > all your code is kill-safe) Er, my plan was to run all code in various sandboxed evaluators, since I have to evaluate it anyway upon retrieval from disk. Shouldn't be overly dangerous. Most of the things in scheme/base such as make-directory, open-input-file, or tcp-connect are already disabled by default in a sandbox, and can always be enabled for authorized players. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJMHQBgAAoJECC/cKf8E7UIbyAIAIqlQg4HMfgen4mCaaengNep tH6eCsz+5i395/LPfUjG/W1/tR+KpiI5engxmcoSnPxCyNe7Iu+w6wtqfBR0zNv2 0X52CVoeJ4ke+uLUNx9LLHDlJTfMPgLgONTuoSGKZJIhNq/QGgv9AGdKZ4dzoo0i f2AldMjn2hO7OSyqU/Wxc8UY6ZK6eUjgcYRhf0y8yFBwhUbWmwl2uVUTiU+7o3s6 7ZSxzx2hPYQobVkjgpWYJnMYAaSJ7ybKui28dH0oVAcbaSVeKLFB09fu6I48BOt+ tY7eCHpwwpRzDDgWBCm49w0PiK/PH7nWAIfi2UvIE85Z6Wy6ExQEhW4ogLLnXWM= =eASo -----END PGP SIGNATURE----- From laurent.orseau at gmail.com Sat Jun 19 14:05:44 2010 From: laurent.orseau at gmail.com (Laurent) Date: Sat, 19 Jun 2010 20:05:44 +0200 Subject: [racket] install-pkg Message-ID: Hi, Is there a function in planet/util that does the same job as "fileinject"? There is a remove-pkg function but I don't see a install-pkg. Actually, I found one such (undocumented) function in "resolver.rkt", but I'm not sure how to use the 'pkg' argument : (install-pkg pkg path maj min) Can anyone help me? Thanks, Laurent -------------- next part -------------- An HTML attachment was scrubbed... URL: From jwise at draga.com Sat Jun 19 15:19:42 2010 From: jwise at draga.com (Jim Wise) Date: Sat, 19 Jun 2010 15:19:42 -0400 Subject: [racket] iPhone In-Reply-To: <20100619053710.GA8821@arch.davidb.org> (David Brown's message of "Fri, 18 Jun 2010 22:37:10 -0700") References: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com> <4C1B829C.4010806@neilvandyke.org> <4C1B8999.1060200@neilvandyke.org> <4C1B956C.1080606@neilvandyke.org> <87k4pwdz6k.fsf@gondolin.draga.com> <20100619053710.GA8821@arch.davidb.org> Message-ID: <87ocf6de41.fsf@gondolin.draga.com> David Brown writes: > On Fri, Jun 18, 2010 at 01:32:19PM -0400, Jim Wise wrote: > >>Remember, this isn't even a question of what you can run on your iPhone >>-- the (free!) iPhone developer kit lets you download software you >>compile yourself from your computer to the iPhone. What you can't do is >>upload that software to Apple's store. > > No, the free iPhone SDK doesn't let you send programs you write to > your phone. You can only run them in a simulator. You have to pay > money for the privilege of being able to run them on a real device. Yes, sorry, I misspoke -- while the tools are free, you do need to be registered as an Apple developer (if you are not already) to get a cert, and this registration costs $99.00. -- Jim Wise jwise at draga.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 184 bytes Desc: not available URL: From robby at eecs.northwestern.edu Sat Jun 19 17:30:18 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Sat, 19 Jun 2010 16:30:18 -0500 Subject: [racket] install-pkg In-Reply-To: References: Message-ID: It isn't clear to me why the functions are doing what they are doing in some of the details, but I've documented the relevant missing ones (now pushed, also as below). Here is an example to help you get going. #lang racket (require planet/util) (install-pkg (get-package-spec "planet" "test-connection.plt" 1 0) "test-connection.plt" ;; this is the .plt file (here as a relative path) 1 0) Robby @defproc[(install-pkg [pkg pkg-spec?] [file path-string?] [maj natural-number/c] [min natural-number/c]) (or/c pkg? #f)]{ Installs the package represented by the arguments, using only the @scheme[pkg-spec-path] and @racket[pkg-spec-name] fields of @scheme[pkg]. Returns a new @racket[pkg-spec?] corresponding to the package that was actually installed. } @defproc[(get-package-spec [owner string?] [pkg string?] [maj (or/c #f natural-number/c) #f] [min (or/c #f natural-number/c) #f]) pkg-spec?]{ Builds a @racket[pkg-spec?] corresponding to the package specified by @racket[owner], @racket[pkg], @scheme[maj], and @scheme[min]. } @defproc[(pkg-spec? [v any/c]) boolean?]{ Recognizes the result of @racket[get-package-spec]. } On Sat, Jun 19, 2010 at 1:05 PM, Laurent wrote: > Hi, > > Is there a function in planet/util that does the same job as "fileinject"? > There is a remove-pkg function but I don't see a install-pkg. > > Actually, I found one such (undocumented) function in "resolver.rkt", but > I'm not sure how to use the 'pkg' argument : > (install-pkg pkg path maj min) > > Can anyone help me? > > Thanks, > Laurent > > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > From laurent.orseau at gmail.com Sun Jun 20 05:19:22 2010 From: laurent.orseau at gmail.com (Laurent) Date: Sun, 20 Jun 2010 11:19:22 +0200 Subject: [racket] install-pkg In-Reply-To: References: Message-ID: On Sat, Jun 19, 2010 at 23:30, Robby Findler wrote: > It isn't clear to me why the functions are doing what they are doing > in some of the details, but I've documented the relevant missing ones > (now pushed, also as below). Here is an example to help you get going. > > #lang racket > (require planet/util) > (install-pkg > (get-package-spec "planet" > "test-connection.plt" > 1 0) > "test-connection.plt" ;; this is the .plt file (here as a relative path) > 1 0) > > > Robby > Thanks! That worked, but there is one annoying thing: it recompiled *all* the dependencies, including the whole Racket... Is there a way to avoid this with this function? Also, there should be somewhere in this function call where I should have put my username I guess, but where? I did: (install-pkg (get-package-spec "planet" ; no need to change that I suppose ? "mred-designer.plt" application-version-maj application-version-min) "../mred-designer.plt" ;; this is the .plt file (here as a relative path) application-version-maj application-version-min) -------------- next part -------------- An HTML attachment was scrubbed... URL: From laurent.orseau at gmail.com Sun Jun 20 05:31:09 2010 From: laurent.orseau at gmail.com (Laurent) Date: Sun, 20 Jun 2010 11:31:09 +0200 Subject: [racket] install-pkg In-Reply-To: References: Message-ID: > Also, there should be somewhere in this function call where I should have > put my username I guess, but where? > > [...] > (get-package-spec "planet" ; no need to change that I suppose ? > > Hmm, I changed "planet" to my username, which is made obvious in your documentation... But it still recompiles everything (so I prefer to close Racket and reinstall it, it's much faster...). -------------- next part -------------- An HTML attachment was scrubbed... URL: From laurent.orseau at gmail.com Sun Jun 20 05:55:18 2010 From: laurent.orseau at gmail.com (Laurent) Date: Sun, 20 Jun 2010 11:55:18 +0200 Subject: [racket] install-pkg In-Reply-To: References: Message-ID: I also used `remove-pkg', but it also seemed to recompile more than needed (although a lot less than install-pkg). This time I did not stop it. It removed the package, but then when I tried to re-execute the file where which holds my call to remove-pkg, I get the following error: procedure get-compiled-file-sha1: expects 1 argument, given 2: # # It did the same thing with install-pkg, but I thought that this was because I killed the compilation process. It can't be that now, because I didn't kill it this time. So I quit DrRacket, delete the compiled directory of my file, run DrRacket, execute the file, but I still get the error. Now I need to remove and reinstall Racket entirely again to have it work. Maybe this is my fault, but I don't know where. -------------- next part -------------- An HTML attachment was scrubbed... URL: From laurent.orseau at gmail.com Sun Jun 20 06:03:59 2010 From: laurent.orseau at gmail.com (Laurent) Date: Sun, 20 Jun 2010 12:03:59 +0200 Subject: [racket] install-pkg In-Reply-To: References: Message-ID: On Sun, Jun 20, 2010 at 11:55, Laurent wrote: > I also used `remove-pkg', but it also seemed to recompile more than needed > (although a lot less than install-pkg). This time I did not stop it. > It removed the package, but then when I tried to re-execute the file where > which holds my call to remove-pkg, I get the following error: > > procedure get-compiled-file-sha1: expects 1 argument, given 2: > # # > > It did the same thing with install-pkg, but I thought that this was because > I killed the compilation process. It can't be that now, because I didn't > kill it this time. > > So I quit DrRacket, delete the compiled directory of my file, run DrRacket, > execute the file, but I still get the error. > Now I need to remove and reinstall Racket entirely again to have it work. > > Maybe this is my fault, but I don't know where. > Although the "planet fileinject" and "planet remove" command line tools work just fine. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jensaxel at soegaard.net Sun Jun 20 07:22:32 2010 From: jensaxel at soegaard.net (=?UTF-8?Q?Jens_Axel_S=C3=B8gaard?=) Date: Sun, 20 Jun 2010 13:22:32 +0200 Subject: [racket] Continuations tutorial In-Reply-To: <195271276963453@web105.yandex.ru> References: <195271276963453@web105.yandex.ru> Message-ID: 2010/6/19 Groshev Dmitry : > Hi. Is there any good continuations tutorial? I've read the reference, but there isn't many examples or explanations. Maybe I'm a bit dumb, but I really need some examples of call/cc / call/ec / dynamic-wind usage to get it right. Try this one by Dan Friedman: http://www.cs.indiana.edu/~dfried/appcont.pdf I think Friedman has written another (non-ACM) text on continuations, but I might have missed at readsceme.org. -- Jens Axel S?gaard From robby at eecs.northwestern.edu Sun Jun 20 08:51:00 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Sun, 20 Jun 2010 07:51:00 -0500 Subject: [racket] install-pkg In-Reply-To: References: Message-ID: On Sun, Jun 20, 2010 at 4:19 AM, Laurent wrote: > That worked, but there is one annoying thing: it recompiled *all* the > dependencies, including the whole Racket... > Is there a way to avoid this with this function? This is a bad interaction between drracket's automatic compilation setup and the planet tools. In general, these planet functions expect to be called in a fairly clean environment and, when they are called via the planet command-line tool or when they are called by a `(require (planet ...))', they do get that clean environment, but when they are called directly here, they don't. I'm not really sure if this is fixable, but I have not looked carefully at it yet. (I will at least try to document the restriction if I cannot lift it.) The simplest thing, for now, is to just make sure you call these from, say, a racket command-line script. On Sun, Jun 20, 2010 at 4:55 AM, Laurent wrote: > I also used `remove-pkg', but it also seemed to recompile more than needed > (although a lot less than install-pkg). This time I did not stop it. > It removed the package, but then when I tried to re-execute the file where > which holds my call to remove-pkg, I get the following error: > > procedure get-compiled-file-sha1: expects 1 argument, given 2: > # # I've pushed a fix that likely fixes this bug. Robby From nicksterdomus at gmail.com Sun Jun 20 09:41:38 2010 From: nicksterdomus at gmail.com (Nick) Date: Sun, 20 Jun 2010 09:41:38 -0400 Subject: [racket] Calling collect-garbage does not work during a FFI call? Message-ID: Hi, I'm using MzScheme v4.2.4, and I'm trying to use the CUDD Binary Decision Diagram (BDD) library, which is implemented in C. CUDD manages all the BDDs with reference counting and its own garbage collector. In my scheme code I would like to have all the reference counting automated. What I did is have the functions create new BDDs to automatically increment the reference counts, and then use register-finalizer to decrement the reference count. I understand how to do all this, and it works. The problem is that I need to sync up the CUDD garbage collector and the Scheme garbage collector. I want the Scheme garbage collector to be called right before the CUDD garbage collector is called, so that when BDD nodes are unreachable by Scheme, their reference counts go to 0, and CUDD can collect them. CUDD provides a hook to have a function called right before garbage collection occurs, so I thought this should be simple. The problem is that the collect-garbage calls in the hook appear to do nothing. None of the finalizers are called when I rely on the hook, but if I explicitly call collect-garbage, then the finalizers are called. I know the finalizers are called because I print a message in them, and I know the hook function is being called, because I print out a message in the hook function. I cannot just call collect-garbage myself, because the CUDD garbage collection is called by the package itself at unknown times. Operations internal to the package can cause a garbage collection at any time. I have tried to call scheme_collect_garbage from C, in a hook function implemented in C. And, I have implemented the hook in scheme, and had passed the function to the C procedure that registers the hook. For both methods, the hook is called, and collect-garbage doesn't work. Is garbage collection disabled or something during a FFI call? Is there another solution? Thanks, Nick From robby at eecs.northwestern.edu Sun Jun 20 12:25:23 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Sun, 20 Jun 2010 11:25:23 -0500 Subject: [racket] install-pkg In-Reply-To: References: Message-ID: On Sun, Jun 20, 2010 at 7:51 AM, Robby Findler wrote: > On Sun, Jun 20, 2010 at 4:19 AM, Laurent wrote: >> That worked, but there is one annoying thing: it recompiled *all* the >> dependencies, including the whole Racket... >> Is there a way to avoid this with this function? > > This is a bad interaction between drracket's automatic compilation > setup and the planet tools. In general, these planet functions expect > to be called in a fairly clean environment and, when they are called > via the planet command-line tool or when they are called by a > `(require (planet ...))', they do get that clean environment, but when > they are called directly here, they don't. > > I'm not really sure if this is fixable, but I have not looked > carefully at it yet. (I will at least try to document the restriction > if I cannot lift it.) > > The simplest thing, for now, is to just make sure you call these from, > say, a racket command-line script. I've adjusted planet a little bit so that now this works like you'd expect. But please let me know if you see other problems with planet now compiling too much or too little in other situations.... Thanks, Robby From robby at eecs.northwestern.edu Sun Jun 20 12:28:51 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Sun, 20 Jun 2010 11:28:51 -0500 Subject: [racket] PLaneT and proxies In-Reply-To: References: Message-ID: Sorry for the delay in getting back to you on this (and sorry for the upcoming not so helpful reply. ....) I'm not really familiar with proxy setups and how to simulate them, but if you wanted to submit a patch that worked for you, I'm pretty sure that I could verify/adjust enough of it to be confident that it wouldn't break others stuff and I'd put it in.... Robby On Fri, Jun 18, 2010 at 4:02 AM, Norman Gray wrote: > > Greetings. > > PLaneT appears to have some difficulties with HTTP caches. > > When I require a PLaneT package, I get an error: > > csv2skos.rkt:3:9: require: PLaneT could not download the requested package: Internal error (unknown HTTP response code 403) in: (planet neil/csv:1:6/csv) > > This is probably due to the presence of the campus-wide HTTP cache (long may its bits rot). ?Installing the package manually does work, but is a bit of a fuss (that's using > > % curl `planet url neil csv.plt 1 6` >csv.plt > % planet fileinject neil csv.plt 1 6 > > ...for the archive's reference), and this has cropped up on 'this' list before , but the resolution there was simply 'yes, this is a proxy problem'. > > So: herewith the obvious feature request. ?Would it be feasible or reasonable for racket to respect the conventional $http_proxy environment variable (on Unix boxes, obviously, but I imagine there's a windows alternative)? ?Something along the lines of net/url's (current-proxy-servers (parse-proxy-string (getenv "http_proxy"))) would appear to be sufficient. > > Best wishes, > > Norman > > > -- > Norman Gray ?: ?http://nxg.me.uk > > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > From laurent.orseau at gmail.com Sun Jun 20 13:29:52 2010 From: laurent.orseau at gmail.com (Laurent) Date: Sun, 20 Jun 2010 19:29:52 +0200 Subject: [racket] install-pkg In-Reply-To: References: Message-ID: On Sun, Jun 20, 2010 at 18:25, Robby Findler wrote: > On Sun, Jun 20, 2010 at 7:51 AM, Robby Findler > wrote: > > On Sun, Jun 20, 2010 at 4:19 AM, Laurent > wrote: > >> That worked, but there is one annoying thing: it recompiled *all* the > >> dependencies, including the whole Racket... > >> Is there a way to avoid this with this function? > > > > This is a bad interaction between drracket's automatic compilation > > setup and the planet tools. In general, these planet functions expect > > to be called in a fairly clean environment and, when they are called > > via the planet command-line tool or when they are called by a > > `(require (planet ...))', they do get that clean environment, but when > > they are called directly here, they don't. > > > > I'm not really sure if this is fixable, but I have not looked > > carefully at it yet. (I will at least try to document the restriction > > if I cannot lift it.) > > > > The simplest thing, for now, is to just make sure you call these from, > > say, a racket command-line script. > > I've adjusted planet a little bit so that now this works like you'd expect. > > But please let me know if you see other problems with planet now > compiling too much or too little in other situations.... > Thanks for the replies, Robby. Btw, is http://pre.racket-lang.org/installers/ really pointing to the right thing? I don't see new nightly builds, but maybe there isn't one yet. -------------- next part -------------- An HTML attachment was scrubbed... URL: From robby at eecs.northwestern.edu Sun Jun 20 13:32:53 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Sun, 20 Jun 2010 12:32:53 -0500 Subject: [racket] install-pkg In-Reply-To: References: Message-ID: Yes, that's the right place; it appears to the results of a recent nightly build (not one with the change I pushed today tho). It still needs to be updated to the new website, tho. Not sure when that's going to happen; I'll alert the relevant folks. Thanks, Robby On Sun, Jun 20, 2010 at 12:29 PM, Laurent wrote: > > > On Sun, Jun 20, 2010 at 18:25, Robby Findler > wrote: >> >> On Sun, Jun 20, 2010 at 7:51 AM, Robby Findler >> wrote: >> > On Sun, Jun 20, 2010 at 4:19 AM, Laurent >> > wrote: >> >> That worked, but there is one annoying thing: it recompiled *all* the >> >> dependencies, including the whole Racket... >> >> Is there a way to avoid this with this function? >> > >> > This is a bad interaction between drracket's automatic compilation >> > setup and the planet tools. In general, these planet functions expect >> > to be called in a fairly clean environment and, when they are called >> > via the planet command-line tool or when they are called by a >> > `(require (planet ...))', they do get that clean environment, but when >> > they are called directly here, they don't. >> > >> > I'm not really sure if this is fixable, but I have not looked >> > carefully at it yet. (I will at least try to document the restriction >> > if I cannot lift it.) >> > >> > The simplest thing, for now, is to just make sure you call these from, >> > say, a racket command-line script. >> >> I've adjusted planet a little bit so that now this works like you'd >> expect. >> >> But please let me know if you see other problems with planet now >> compiling too much or too little in other situations.... > > Thanks for the replies, Robby. > > Btw, is http://pre.racket-lang.org/installers/ really pointing to the right > thing? > I don't see new nightly builds, but maybe there isn't one yet. > > From eli at barzilay.org Sun Jun 20 13:41:39 2010 From: eli at barzilay.org (Eli Barzilay) Date: Sun, 20 Jun 2010 13:41:39 -0400 Subject: [racket] install-pkg In-Reply-To: References: Message-ID: <19486.21203.768841.962449@winooski.ccs.neu.edu> On Jun 20, Robby Findler wrote: > Yes, that's the right place; it appears to the results of a recent > nightly build (not one with the change I pushed today tho). Yes, a new build happens once every day, starting around 4am EST. > It still needs to be updated to the new website, tho. Not sure when > that's going to happen; I'll alert the relevant folks. (The relevant folks are working on it...) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From norman at astro.gla.ac.uk Sun Jun 20 15:46:32 2010 From: norman at astro.gla.ac.uk (Norman Gray) Date: Sun, 20 Jun 2010 20:46:32 +0100 Subject: [racket] PLaneT and proxies In-Reply-To: References: Message-ID: <568B68FB-72D1-4CD1-86D9-824B2890CCCC@astro.gla.ac.uk> Robby, hello. On 2010 Jun 20, at 17:28, Robby Findler wrote: > I'm not really familiar with proxy setups and how to simulate them, > but if you wanted to submit a patch that worked for you, I'm pretty > sure that I could verify/adjust enough of it to be confident that it > wouldn't break others stuff and I'd put it in.... No probs. The following should basically work: % diff -c resolver.rkt{-orig,} *** resolver.rkt-orig 2010-06-06 11:19:13.000000000 +0100 --- resolver.rkt 2010-06-20 20:27:30.000000000 +0100 *************** *** 217,222 **** --- 217,232 ---- exn:fail:planet? make-exn:fail:planet) + ;; This is not the correct place for this... + (define (parse-proxy-string proxy-url-string) + (cond ((regexp-match #rx"^http://([a-zA-Z0-9.-]+):([0-9]+)" proxy-url-string) + => (? (l) `(("http" ,(cadr l) ,(string->number (caddr l)))))) + ((regexp-match #rx"^http://([a-zA-Z0-9.-]+)" proxy-url-string) + => (? (l) `(("http" ,(cadr l) 80)))) + (else (error (format "Can't parse proxy URL ~a" proxy-url-string))))) + (when (getenv "http_proxy") + (current-proxy-servers (parse-proxy-string (getenv "http_proxy")))) + ;; if #f, will not install packages and instead raise a exn:fail:install? error (define install? (make-parameter #t)) ;; if #f, will not download packages and instead raise a exn:fail:install? error (and attached as a patch file in case there's any list trouble). That sets the net/url proxy whenever the http_proxy environment variable is set. * It works for me. * This is clearly not the ideal place for this. * I presume something slightly different should happen on Windows -- I'll leave that to others * That regexp should match any sane hostname, but there can be in principle semi-pathological hostnames that it wouldn't match (but if anyone's doing that, they probably have other problems). Any comments on style cheerfully received. Best wishes, Norman -- Norman Gray : http://nxg.me.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: resolver.patch Type: application/octet-stream Size: 951 bytes Desc: not available URL: From eli at barzilay.org Sun Jun 20 15:49:57 2010 From: eli at barzilay.org (Eli Barzilay) Date: Sun, 20 Jun 2010 15:49:57 -0400 Subject: [racket] PLaneT and proxies In-Reply-To: <568B68FB-72D1-4CD1-86D9-824B2890CCCC@astro.gla.ac.uk> References: <568B68FB-72D1-4CD1-86D9-824B2890CCCC@astro.gla.ac.uk> Message-ID: <19486.28901.411085.890245@winooski.ccs.neu.edu> On Jun 20, Norman Gray wrote: > Robby, hello. > > On 2010 Jun 20, at 17:28, Robby Findler wrote: > > > I'm not really familiar with proxy setups and how to simulate them, > > but if you wanted to submit a patch that worked for you, I'm pretty > > sure that I could verify/adjust enough of it to be confident that it > > wouldn't break others stuff and I'd put it in.... > > No probs. > > The following should basically work: > > % diff -c resolver.rkt{-orig,} > [...] Does planet go through net/url? If so, then this is better done there. (And if it doesn't, then it should...) And IIRC, it already deals with proxy, only one that is set manually. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From norman at astro.gla.ac.uk Sun Jun 20 15:59:00 2010 From: norman at astro.gla.ac.uk (Norman Gray) Date: Sun, 20 Jun 2010 20:59:00 +0100 Subject: [racket] PLaneT and proxies In-Reply-To: <19486.28901.411085.890245@winooski.ccs.neu.edu> References: <568B68FB-72D1-4CD1-86D9-824B2890CCCC@astro.gla.ac.uk> <19486.28901.411085.890245@winooski.ccs.neu.edu> Message-ID: Eli and Robby, hello. On 2010 Jun 20, at 20:49, Eli Barzilay wrote: > On Jun 20, Norman Gray wrote: >> Robby, hello. >> >> On 2010 Jun 20, at 17:28, Robby Findler wrote: >> >>> I'm not really familiar with proxy setups and how to simulate them, >>> but if you wanted to submit a patch that worked for you, I'm pretty >>> sure that I could verify/adjust enough of it to be confident that it >>> wouldn't break others stuff and I'd put it in.... >> >> No probs. >> >> The following should basically work: >> >> % diff -c resolver.rkt{-orig,} >> [...] > > Does planet go through net/url? If so, then this is better done > there. (And if it doesn't, then it should...) It does. And yes (and yes, probably). > And IIRC, it already deals with proxy, only one that is set manually. I can't see any proxy-setup there, only the definition of the current-proxy-servers parameter. Best wishes, Norman -- Norman Gray : http://nxg.me.uk From norman at astro.gla.ac.uk Sun Jun 20 16:23:51 2010 From: norman at astro.gla.ac.uk (Norman Gray) Date: Sun, 20 Jun 2010 21:23:51 +0100 Subject: [racket] PLaneT and proxies In-Reply-To: References: <568B68FB-72D1-4CD1-86D9-824B2890CCCC@astro.gla.ac.uk> <19486.28901.411085.890245@winooski.ccs.neu.edu> Message-ID: <5CC92496-82F9-47A8-884F-4C14D9876FFE@astro.gla.ac.uk> Eli and Robby, hello. On 2010 Jun 20, at 20:59, Norman Gray wrote: >> Does planet go through net/url? If so, then this is better done >> there. (And if it doesn't, then it should...) > > It does. And yes (and yes, probably). Come to think of it, this is possibly something that should be sorted out (within or via net/url) at a slightly lower level. On OS X, for example, there is API support for detecting whether a proxy has been set in the Approved Fashion (that is, within the Network System Preference, either manually or via automatic proxy configuration, and with different values depending on the current 'location'). See for sample code. I presume there will be similar support on other unixes and on windows. The http_proxy variable is a leeeettle bit of a hack, and that's especially true on OS X, where it's really only set for the benefit of those unix-generic tools which don't know how to get the information directly from the OS. For what it's worth, I set http_proxy at shell startup time using the attached scsh script, which shows how one might extract the information from 'scutil --proxy' reasonably straightforwardly. Best wishes, Norman -- Norman Gray : http://nxg.me.uk -------------- next part -------------- A non-text attachment was scrubbed... Name: extract-http-proxy-info Type: application/octet-stream Size: 2022 bytes Desc: not available URL: From norman at astro.gla.ac.uk Sun Jun 20 17:22:00 2010 From: norman at astro.gla.ac.uk (Norman Gray) Date: Sun, 20 Jun 2010 22:22:00 +0100 Subject: [racket] PLaneT and proxies In-Reply-To: <5CC92496-82F9-47A8-884F-4C14D9876FFE@astro.gla.ac.uk> References: <568B68FB-72D1-4CD1-86D9-824B2890CCCC@astro.gla.ac.uk> <19486.28901.411085.890245@winooski.ccs.neu.edu> <5CC92496-82F9-47A8-884F-4C14D9876FFE@astro.gla.ac.uk> Message-ID: <6DC9EFEB-11D9-4737-8468-D61F1344E0C9@astro.gla.ac.uk> On 2010 Jun 20, at 21:23, Norman Gray wrote: > On 2010 Jun 20, at 20:59, Norman Gray wrote: > >>> Does planet go through net/url? If so, then this is better done >>> there. (And if it doesn't, then it should...) >> >> It does. And yes (and yes, probably). > > Come to think of it, this is possibly something that should be sorted out (within or via net/url) at a slightly lower level. On third thoughts (!), the sequence should probably be this: * if $http_proxy is set, then net/url should respect it unequivocally (also $no_proxy (where is this stuff documented?)). On most unixes, that'll be the beginning and end of it. * On OS X, I think that http_proxy will typically not be set (it'll only be set by people who use the command-line a lot). Instead, the system-wide proxy information can be obtained by using system APIs, or by parsing the output of /usr/sbin/scutil. That has to be reasonably dynamic, since someone might change the 'location' on a laptop, say, from 'at home' to 'at work', with consequent changes to the proxy. * I seem to recall that there's a Core Foundation 'read-from-uri' library call which gets all this nonsense correct, transparently, but that may not be an appropriate solution here. * ...plus whatever windows requires. Damn proxies. Sigh. Good night, Norman -- Norman Gray : http://nxg.me.uk From dvanhorn at ccs.neu.edu Sun Jun 20 20:10:29 2010 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Sun, 20 Jun 2010 20:10:29 -0400 Subject: [racket] Redex model of parallel one-step reduction Message-ID: <4C1EADF5.1090903@ccs.neu.edu> I've tried a few times to model the parallel one-step relation on page 55 in the Redex book as a reduction-relation, but I just can't seem to make it work. Has anyone else been able to do it? David From robby at eecs.northwestern.edu Sun Jun 20 21:10:28 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Sun, 20 Jun 2010 20:10:28 -0500 Subject: [racket] Redex model of parallel one-step reduction In-Reply-To: <4C1EADF5.1090903@ccs.neu.edu> References: <4C1EADF5.1090903@ccs.neu.edu> Message-ID: On Sun, Jun 20, 2010 at 7:10 PM, David Van Horn wrote: > I've tried a few times to model the parallel one-step relation on page 55 in > the Redex book as a reduction-relation, but I just can't seem to make it > work. ?Has anyone else been able to do it? I don't think that there is a good way to do this in redex. I guess the simplest, clearest thing would be to use continuations (ala amb) somehow. I did the below and it seems to work (altho you may find bugs in it!), but I will readily admit it is a hack (especially since it does not generalize to nary functions....). (I didn't include the usual iswim test suite, but if you want that, let me know.) Robby #lang racket (require redex) (define-language iswim ((M N L K) X (? X M) (M M) b (o2 M M) (o1 M)) (o o1 o2) (o1 add1 sub1 iszero) (o2 + - * ?) (b number) ((V U W) b X (? X M)) (E hole (V E) (E M) (o V ... E M ...)) ((X Y Z) variable-not-otherwise-mentioned)) (define-metafunction iswim [(? (iszero 0)) (? x (? y x))] [(? (iszero b)) (? x (? y y))] [(? (add1 b)) ,(add1 (term b))] [(? (sub1 b)) ,(sub1 (term b))] [(? (+ b_1 b_2)) ,(+ (term b_1) (term b_2))] [(? (- b_1 b_2)) ,(- (term b_1) (term b_2))] [(? (* b_1 b_2)) ,(* (term b_1) (term b_2))] [(? (? b_1 b_2)) ,(expt (term b_1) (term b_2))]) (define-metafunction iswim ;; 1. X_1 bound, so don't continue in ? body [(subst (? X_1 any_1) X_1 any_2) (? X_1 any_1)] ;; 2. do capture avoiding substitution ;; by generating a fresh name [(subst (? X_1 any_1) X_2 any_2) (? X_3 (subst (subst-var any_1 X_1 X_3) X_2 any_2)) (where X_3 ,(variable-not-in (term (X_2 any_1 any_2)) (term X_1)))] ;; 3. replace X_1 with any_1 [(subst X_1 X_1 any_1) any_1] ;; the last two cases just recur on ;; the tree structure of the term [(subst (any_2 ...) X_1 any_1) ((subst any_2 X_1 any_1) ...)] [(subst any_2 X_1 any_1) any_2]) (define-metafunction iswim [(subst-var (any_1 ...) variable_1 variable_2) ((subst-var any_1 variable_1 variable_2) ...)] [(subst-var variable_1 variable_1 variable_2) variable_2] [(subst-var any_1 variable_1 variable_2) any_1]) (define red (reduction-relation iswim (--> M M) (--> (o b ...) (? (o b ...))) (--> ((? X M) U) (subst M_2 X U_2) (where (M_1 ... M_2 M_3 ...) ,(apply-reduction-relation red (term M))) (where (U_1 ... U_2 U_3 ...) ,(apply-reduction-relation red (term U)))) (--> (M N) (M_2 N_2) (where (N_1 ... N_2 N_3 ...) ,(apply-reduction-relation red (term N))) (where (M_1 ... M_2 M_3 ...) ,(apply-reduction-relation red (term M)))) (--> (? X M) (? X M_2) (where (M_1 ... M_2 M_3 ...) ,(apply-reduction-relation red (term M)))) (--> (o1 M) (o1 M_2) (where (M_1 ... M_2 M_3 ...) ,(apply-reduction-relation red (term M)))) (--> (o2 N M) (o2 N_2 M_2) (where (N_1 ... N_2 N_3 ...) ,(apply-reduction-relation red (term N))) (where (M_1 ... M_2 M_3 ...) ,(apply-reduction-relation red (term M)))))) (test--> red (term (+ (+ 1 2) (+ 3 4))) (term (+ (+ 1 2) (+ 3 4))) (term (+ 3 (+ 3 4))) (term (+ (+ 1 2) 7)) (term (+ 3 7))) (test--> red (term (+ 1 2)) (term (+ 1 2)) (term 3)) (test--> red (term (? x (+ x (+ 1 2)))) (term (? x (+ x (+ 1 2)))) (term (? x (+ x 3)))) (test--> red (term ((? x (+ x (+ 2 3))) 1)) (term ((? x (+ x (+ 2 3))) 1)) (term ((? x (+ x 5)) 1)) (term (+ 1 (+ 2 3))) (term (+ 1 5))) (test--> red (term ((? x (+ x (+ 3 4))) (+ 1 2))) (term ((? x (+ x (+ 3 4))) (+ 1 2))) (term ((? x (+ x 7)) (+ 1 2))) (term ((? x (+ x (+ 3 4))) 3)) (term ((? x (+ x 7)) 3))) (test-results) From robby at eecs.northwestern.edu Sun Jun 20 21:12:43 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Sun, 20 Jun 2010 20:12:43 -0500 Subject: [racket] PLaneT and proxies In-Reply-To: References: <568B68FB-72D1-4CD1-86D9-824B2890CCCC@astro.gla.ac.uk> <19486.28901.411085.890245@winooski.ccs.neu.edu> Message-ID: Oh-- Eli pointed out something offlist: did you try starting up drracket, setting its proxy preferences and then trying to install something from planet? (If that works, then probably we'll just continue to wait for a more careful rewrite of net/url.) Robby On Sun, Jun 20, 2010 at 2:59 PM, Norman Gray wrote: > > Eli and Robby, hello. > > On 2010 Jun 20, at 20:49, Eli Barzilay wrote: > >> On Jun 20, Norman Gray wrote: >>> Robby, hello. >>> >>> On 2010 Jun 20, at 17:28, Robby Findler wrote: >>> >>>> I'm not really familiar with proxy setups and how to simulate them, >>>> but if you wanted to submit a patch that worked for you, I'm pretty >>>> sure that I could verify/adjust enough of it to be confident that it >>>> wouldn't break others stuff and I'd put it in.... >>> >>> No probs. >>> >>> The following should basically work: >>> >>> % diff -c resolver.rkt{-orig,} >>> [...] >> >> Does planet go through net/url? ?If so, then this is better done >> there. ?(And if it doesn't, then it should...) > > It does. ?And yes (and yes, probably). > >> And IIRC, it already deals with proxy, only one that is set manually. > > > I can't see any proxy-setup there, only the definition of the current-proxy-servers parameter. > > Best wishes, > > Norman > > > -- > Norman Gray ?: ?http://nxg.me.uk > > From toddobryan at gmail.com Sun Jun 20 22:33:21 2010 From: toddobryan at gmail.com (Todd O'Bryan) Date: Sun, 20 Jun 2010 22:33:21 -0400 Subject: [racket] struct should be a define-like keyword? Message-ID: At least it seems to be so in the docs, but isn't in my Definitions pane with 5.0. Todd From toddobryan at gmail.com Sun Jun 20 22:40:58 2010 From: toddobryan at gmail.com (Todd O'Bryan) Date: Sun, 20 Jun 2010 22:40:58 -0400 Subject: [racket] struct should be a define-like keyword? In-Reply-To: References: Message-ID: And I made a ticket: http://planet.racket-lang.org/trac/ticket/288 On Sun, Jun 20, 2010 at 10:33 PM, Todd O'Bryan wrote: > At least it seems to be so in the docs, but isn't in my Definitions > pane with 5.0. > > Todd > From eli at barzilay.org Sun Jun 20 22:43:40 2010 From: eli at barzilay.org (Eli Barzilay) Date: Sun, 20 Jun 2010 22:43:40 -0400 Subject: [racket] struct should be a define-like keyword? In-Reply-To: References: Message-ID: <19486.53724.708600.823504@winooski.ccs.neu.edu> That's the system for submitting bugs in planet packages -- for bugs in the main racket distribution you should use DrRacket (in the help menu) or bugs.racket-lang.org (which will soon get the new look too). On Jun 20, Todd O'Bryan wrote: > And I made a ticket: > > http://planet.racket-lang.org/trac/ticket/288 > > On Sun, Jun 20, 2010 at 10:33 PM, Todd O'Bryan wrote: > > At least it seems to be so in the docs, but isn't in my Definitions > > pane with 5.0. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From robby at eecs.northwestern.edu Sun Jun 20 23:01:02 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Sun, 20 Jun 2010 22:01:02 -0500 Subject: [racket] struct should be a define-like keyword? In-Reply-To: References: Message-ID: I've added struct in as a default to the preference, but it won't show up in yours unless you add it yourself (or reset your preferences). Robby On Sun, Jun 20, 2010 at 9:33 PM, Todd O'Bryan wrote: > At least it seems to be so in the docs, but isn't in my Definitions > pane with 5.0. > > Todd > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > From noelwelsh at gmail.com Mon Jun 21 06:31:53 2010 From: noelwelsh at gmail.com (Noel Welsh) Date: Mon, 21 Jun 2010 11:31:53 +0100 Subject: [racket] Metaprogramming with scheme In-Reply-To: References: Message-ID: On Sat, Jun 19, 2010 at 10:00 AM, Valeriya Pudova wrote: > The easiest way to do this task can be: Just evaluate the file "a.ss" in the > name space > where are defined methods "define-fsm", "define-state", "on-event" and "go" > > But this case each of those methods will not have the syntax object of the > evaluated expression. > And in case if it will find and error it could not message about error's > location. Have you tried eval-syntax, instead of eval? I think that will keep location information. HTH, N. From sbloch at adelphi.edu Mon Jun 21 06:51:07 2010 From: sbloch at adelphi.edu (Stephen Bloch) Date: Mon, 21 Jun 2010 06:51:07 -0400 Subject: [racket] [BULK] Re: iPhone In-Reply-To: References: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com><4C1B829C.4010806@neilvandyke.org><4C1B8999.1060200@neilvandyke.org><4C1B956C.1080606@neilvandyke.org> <87k4pwdz6k.fsf@gondolin.draga.com> Message-ID: <09C4996D-1589-4BF9-AFDB-75D61815AAB9@adelphi.edu> On Jun 18, 2010, at 2:17 PM, Paul Ojanen wrote: > >> Remember, this isn't even a question of what you can run on your >> iPhone >> -- the (free!) iPhone developer kit lets you download software you >> compile yourself from your computer to the iPhone. > > Their SDK runs on MY computer? Well, yes -- if you have an Intel Mac running OS 10.6. Doesn't everyone? Stephen Bloch sbloch at adelphi.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: From noelwelsh at gmail.com Mon Jun 21 07:17:32 2010 From: noelwelsh at gmail.com (Noel Welsh) Date: Mon, 21 Jun 2010 12:17:32 +0100 Subject: [racket] Metaprogramming with scheme In-Reply-To: References: Message-ID: Please reply to the list; you'll get more help that way. On Mon, Jun 21, 2010 at 12:14 PM, Valeriya Pudova wrote: > (eval-syntax (file->syntax "a.ss")) Look up read-syntax. > lets imagine the function 'define-fsm' was called. And "some-condition?" > informs that there are syntax error in the source expression. How i can > printout the line and column number of the source expression? http://docs.racket-lang.org/unstable/Source_Locations.html N. From noelwelsh at gmail.com Mon Jun 21 07:55:46 2010 From: noelwelsh at gmail.com (Noel Welsh) Date: Mon, 21 Jun 2010 12:55:46 +0100 Subject: [racket] Metaprogramming with scheme In-Reply-To: References: Message-ID: Please reply to the list; you'll get more help that way. (Also, I'll ignore your emails if you don't.) On Mon, Jun 21, 2010 at 12:29 PM, Valeriya Pudova wrote: > The question is: when in the eval-synax process there will be called some > function how that function can to reffer to the current syntax-object? foo.ss: (foo 1 2) Code: (with-input-from-file "foo.ss" (lambda () (parameterize ([error-display-handler (lambda (name . stuff) (printf "Got ~a ~a\n" name stuff))]) (eval-syntax (read-syntax 'foo.ss))))) Output: Got foo.ss::0: compile: unbound identifier (and no #%app syntax transformer is bound) at: foo in: (foo 1 2) (#(struct:exn:fail:syntax foo.ss::0: compile: unbound identifier (and no #%app syntax transformer is bound) at: foo in: (foo 1 2) # (#))) So the exception structure has the syntax object you want. N. From greghendershott at gmail.com Mon Jun 21 09:33:04 2010 From: greghendershott at gmail.com (Greg Hendershott) Date: Mon, 21 Jun 2010 09:33:04 -0400 Subject: [racket] iPhone In-Reply-To: References: <1276829002666.79e8c5cb-3b78-43e1-b97a-0905920ca76b@google.com> <4C1B829C.4010806@neilvandyke.org> <4C1B8999.1060200@neilvandyke.org> <4C1B956C.1080606@neilvandyke.org> <87k4pwdz6k.fsf@gondolin.draga.com> Message-ID: > To bring this more on topic, I think a good approach to all these issues from a Racket perspective is to develop an HTML5 web-app framework that intelligently adjusts content for the device making the request. This way Racket apps could run across all platforms with a decent HTML5 browser, and we wouldn't have to worry about the restrictions of any mother-may-iOS. Yes. On Fri, Jun 18, 2010 at 2:23 PM, Raffael Cavallaro wrote: > > On Jun 18, 2010, at 1:41 PM, John Clements wrote: > >> I think it's a good idea to be aware that the ability to compile and run arbitrary programs on the computers sold to us by Apple (or any other company) is not a constitutionally protected right, and that many if not all OS vendors would be delighted to move to a world where all applications required licensing fees and prior approval. ?My guess is that when this becomes feasible, it will happen. > > I won't say that Apple isn't foolish enough to shoot themselves in the foot in this way, but I think it's unlikely. Jobs himself compared laptops/desktops to trucks (as opposed to passenger cars) - very necessary, much more general purpose and more powerful machines, with a concomitantly limited user base. In this view there's no need to lock down the MacOS since it is no longer going to be targeted at consumers, but only at a restricted range of professionals - developers, professional content producers in film & publishing, research scientists, etc. - who don't need or want either the hand-holding or the content-filtering-nanny features of a consumer OS. > > If what you hypothesize were to happen, my guess is that open source OS usage among developers will skyrocket. I know I'd move to linux-intel from MacOS or Windows in a heartbeat if Apple and Microsoft ever restricted the apps I could run on MacOS and Windows to those approved for sale in an Apple or Microsoft App Store. To a certain extent, this is already happening in the smart phone market. Many developers feel as Neil Van Dyke does: > > On Jun 18, 2010, at 1:46 PM, Neil Van Dyke wrote: > >> The smartphone is a key ubiquitous computing device, and I believe that the app selection for iPhone/Android/etc. constitutes "general-purpose." >> >> I believe that keeping these platforms open is extremely important. > > > So devs are voting with their feet - many are buying android phones, not iPhones or iPads. > > To bring this more on topic, I think a good approach to all these issues from a Racket perspective is to develop an HTML5 web-app framework that intelligently adjusts content for the device making the request. This way Racket apps could run across all platforms with a decent HTML5 browser, and we wouldn't have to worry about the restrictions of any mother-may-iOS. > > > warmest regards, > > Ralph > > > Raffael Cavallaro > raffaelcavallaro at me.com > > > > > > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > From valery at digitalchile.net Mon Jun 21 09:41:00 2010 From: valery at digitalchile.net (Valeriya Pudova) Date: Mon, 21 Jun 2010 17:41:00 +0400 Subject: [racket] Metaprogramming with scheme Message-ID: > > name space > > where are defined methods "define-fsm", "define-state", "on-event" and > "go" > > > > But this case each of those methods will not have the syntax object of > the > > evaluated expression. > > And in case if it will find and error it could not message about error's > > location. The easiest way to do this task can be: Just evaluate the file > "a.ss" in the > Noel Welsh wrote: > Have you tried eval-syntax, instead of eval? I think that will keep > location information. > How? (eval-syntax (file->syntax "a.ss")) lets imagine the function 'define-fsm' was called. And "some-condition?" informs that there are syntax error in the source expression. How i can printout the line and column number of the source expression? (define (define-fsm params) (if (some-condition? params) (display "error message" ????? ) ) ) Noel Welsh wrote: > Look up read-syntax. Yes, In my example file->syntax was somthing like (define (file->syntax file-name) ;; read the file and convert it to the syntax object (let* ([in (open-input-file file-name)]) (port-count-lines! in) (begin0 (let loop ([rs '()] [r (read-syntax file-name in)]) (if (eof-object? r) (reverse rs) (loop (cons r rs) (read-syntax file-name in)))) (close-input-port in) ))) Noel Welsh wrote: > lets imagine the function 'define-fsm' was called. And "some-condition?" > informs that there are syntax error in the source expression. How i can > printout the line and column number of the source expression? > http://docs.racket-lang.org/unstable/Source_Locations.html The question is: when in the eval-synax process there will be called some function how that function can to reffer to the current syntax-object? Noel Welsh wrote: > foo.ss: > (foo 1 2) > Code: > (with-input-from-file "foo.ss" > (lambda () > (parameterize ([error-display-handler (lambda (name . stuff) > (printf "Got ~a ~a\n" name stuff))]) > (eval-syntax (read-syntax 'foo.ss))))) > Output: > Got foo.ss::0: compile: unbound identifier (and no #%app syntax > transformer is bound) at: foo in: (foo 1 2) (#(struct:exn:fail:syntax > foo.ss::0: compile: unbound identifier (and no #%app syntax > transformer is bound) at: foo in: (foo 1 2) # > (#))) > So the exception structure has the syntax object you want. There are two issues. First: what if the file foo.ss will have defined function foo. (define (foo a b) (+ a b))) (foo 1 2) It makes error: Got compile: unbound identifier (and no #%app syntax transformer is bound) (#(struct:exn:fail:syntax compile: unbound identifier (and no #%app syntax transformer is bound) # Second: When function foo is defined correctly and called from the eval process and errors occurs in foo, how can we find the caller's location in order to format an error message? -- Valeriya -------------- next part -------------- An HTML attachment was scrubbed... URL: From noelwelsh at gmail.com Mon Jun 21 10:25:20 2010 From: noelwelsh at gmail.com (Noel Welsh) Date: Mon, 21 Jun 2010 15:25:20 +0100 Subject: [racket] Metaprogramming with scheme In-Reply-To: References: Message-ID: On Mon, Jun 21, 2010 at 2:41 PM, Valeriya Pudova wrote: > There are two issues. > > First: > > what if the file foo.ss will have defined function foo. > > (define (foo a b) (+ a b))) > (foo 1 2) > > It makes error: > Got compile: unbound identifier (and no #%app syntax transformer is bound) > (#(struct:exn:fail:syntax compile: unbound identifier (and no #%app syntax > transformer is bound) # This is a namespace issue. You need to create a namespace (with, e.g., (make-base-namespace)) and pass that as the 2nd optional argument to eval-syntax. See the Guide and Reference for more detail. > Second: > When function foo is defined correctly and called from the eval process and > errors occurs in foo, how can we find the caller's location in order to > format an error message? I think whatever location information is available will be in the exception. N. From robby at eecs.northwestern.edu Mon Jun 21 10:32:56 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Mon, 21 Jun 2010 09:32:56 -0500 Subject: [racket] Metaprogramming with scheme In-Reply-To: References: Message-ID: I haven't followed this thread too closely but if you can tolerate your "a.ss" file having a "#lang" line at the top that may make your life overall much easier (the Racket tools all work better when you are explicit about the language you are programming in). Robby From valery at digitalchile.net Mon Jun 21 11:15:28 2010 From: valery at digitalchile.net (Valeriya Pudova) Date: Mon, 21 Jun 2010 19:15:28 +0400 Subject: [racket] Metaprogramming with scheme In-Reply-To: References: Message-ID: <4C1F8210.4040200@digitalchile.net> On 21.06.2010 18:32, Robby Findler wrote: > I haven't followed this thread too closely but if you can tolerate > your "a.ss" file having a "#lang" line at the top that may make your > life overall much easier (the Racket tools all work better when you > are explicit about the language you are programming in). > > Robby > The read-syntax does not support #lang : #lang expressions not currently enabled (#(struct:exn:fail:read read: #lang expressions not currently enabled # (#(struct:srcloc foo.ss #f #f 1 6)))) From valery at digitalchile.net Mon Jun 21 11:25:16 2010 From: valery at digitalchile.net (Valeriya Pudova) Date: Mon, 21 Jun 2010 19:25:16 +0400 Subject: [racket] Metaprogramming with scheme In-Reply-To: References: Message-ID: <4C1F845C.20906@digitalchile.net> On 21.06.2010 18:25, Noel Welsh wrote: > On Mon, Jun 21, 2010 at 2:41 PM, Valeriya Pudova > wrote: > >> There are two issues. >> >> First: >> >> what if the file foo.ss will have defined function foo. >> >> (define (foo a b) (+ a b))) >> (foo 1 2) >> >> It makes error: >> Got compile: unbound identifier (and no #%app syntax transformer is bound) >> (#(struct:exn:fail:syntax compile: unbound identifier (and no #%app syntax >> transformer is bound) # >> > This is a namespace issue. You need to create a namespace (with, e.g., > (make-base-namespace)) and pass that as the 2nd optional argument to > eval-syntax. See the Guide and Reference for more detail. > > Yes that helps >> Second: >> When function foo is defined correctly and called from the eval process and >> errors occurs in foo, how can we find the caller's location in order to >> format an error message? >> > I think whatever location information is available will be in the exception. > > That the problem. The location will be location inside foo but not location where foo was called from From robby at eecs.northwestern.edu Mon Jun 21 11:32:05 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Mon, 21 Jun 2010 10:32:05 -0500 Subject: [racket] Metaprogramming with scheme In-Reply-To: <4C1F8210.4040200@digitalchile.net> References: <4C1F8210.4040200@digitalchile.net> Message-ID: Actually it does but it is diasabled by default. But the point was that you would not do it that way but instead use the lang and macro system to implement your translation. Robby On Monday, June 21, 2010, Valeriya Pudova wrote: > On 21.06.2010 18:32, Robby Findler wrote: > > I haven't followed this thread too closely but if you can tolerate > your "a.ss" file having a "#lang" line at the top that may make your > life overall much easier (the Racket tools all work better when you > are explicit about the language you are programming in). > > Robby > > > > The read-syntax does not support #lang : > > #lang expressions not currently enabled (#(struct:exn:fail:read read: #lang expressions not currently enabled # (#(struct:srcloc foo.ss #f #f 1 6)))) > > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > From noelwelsh at gmail.com Tue Jun 22 01:31:39 2010 From: noelwelsh at gmail.com (Noel Welsh) Date: Tue, 22 Jun 2010 06:31:39 +0100 Subject: [racket] Metaprogramming with scheme In-Reply-To: <4C1F845C.20906@digitalchile.net> References: <4C1F845C.20906@digitalchile.net> Message-ID: On Mon, Jun 21, 2010 at 4:25 PM, Valeriya Pudova wrote: > That the problem. The location will be location inside foo but not location > where foo was called from The continuation marks included in the exception are effectively a stack trace, and you can convert them into locations. See the docs. That said, as I recall your initial post was about macro expansion -- for which Robby's post is relevant. If you just want to expand the macros the function 'expand' (and related functions) are what you want. N. From valery at digitalchile.net Tue Jun 22 01:55:36 2010 From: valery at digitalchile.net (Valeriya Pudova) Date: Tue, 22 Jun 2010 09:55:36 +0400 Subject: [racket] Metaprogramming with scheme In-Reply-To: References: <4C1F845C.20906@digitalchile.net> Message-ID: <4C205058.4040307@digitalchile.net> On 22.06.2010 9:31, Noel Welsh wrote: > On Mon, Jun 21, 2010 at 4:25 PM, Valeriya Pudova > wrote: > >> > That the problem. The location will be location inside foo but not location >> > where foo was called from >> > The continuation marks included in the exception are effectively a > stack trace, and you can convert them into locations. See the docs. > > :) Reading about continuation marks. > That said, as I recall your initial post was about macro expansion -- > for which Robby's post is relevant. If you just want to expand the > macros the function 'expand' (and related functions) are what you > want. > > Right. But now only macro expansion also expressions evaluation. Well, lets hope that "continuation marks" are help to get a backtrace that may help. -------------- next part -------------- An HTML attachment was scrubbed... URL: From valery at digitalchile.net Tue Jun 22 02:40:23 2010 From: valery at digitalchile.net (Valeriya Pudova) Date: Tue, 22 Jun 2010 10:40:23 +0400 Subject: [racket] Metaprogramming with scheme In-Reply-To: <4C205058.4040307@digitalchile.net> References: <4C1F845C.20906@digitalchile.net> <4C205058.4040307@digitalchile.net> Message-ID: <4C205AD7.3000409@digitalchile.net> >> The continuation marks included in the exception are effectively a >> stack trace, and you can convert them into locations. See the docs. >> >> > :) Reading about continuation marks. Great feature those continuation marks. But does not looks helpful this case. To be able to get mark i should set it before. Is it not? -------------- next part -------------- An HTML attachment was scrubbed... URL: From valery at digitalchile.net Tue Jun 22 02:52:21 2010 From: valery at digitalchile.net (Valeriya Pudova) Date: Tue, 22 Jun 2010 10:52:21 +0400 Subject: [racket] Metaprogramming with scheme In-Reply-To: <4C205AD7.3000409@digitalchile.net> References: <4C1F845C.20906@digitalchile.net> <4C205058.4040307@digitalchile.net> <4C205AD7.3000409@digitalchile.net> Message-ID: <4C205DA5.4040002@digitalchile.net> On 22.06.2010 10:40, Valeriya Pudova wrote: > >>> The continuation marks included in the exception are effectively a >>> stack trace, and you can convert them into locations. See the docs. >>> >>> >> :) Reading about continuation marks. > > Great feature those continuation marks. But does not looks helpful > this case. > To be able to get mark i should set it before. Is it not? Wow! (define (foo a b) (for-each (lambda (e) (display e)(newline)) (continuation-mark-set->context (current-continuation-marks)))) (define (bar a b) (foo a b)) (bar 1 2) => (foo . #(struct:srcloc c:\documents and settings\v\desktop\test.ss 2 0 2 127)) (call-with-exception-handler . #(struct:srcloc C:\Racket\collects\racket\private\more-scheme.rkt 274 2 9287 256)) (loop . #(struct:srcloc C:\Racket\collects\drracket\private\rep.rkt 1134 19 47088 797)) (call-with-break-parameterization . #(struct:srcloc C:\Racket\collects\racket\private\more-scheme.rkt 158 2 5099 519)) (#f . #(struct:srcloc C:\Racket\collects\drracket\private\rep.rkt 1115 9 46083 2670)) (loop . #(struct:srcloc C:\Racket\collects\drracket\private\rep.rkt 1375 17 58510 808)) Interesting. There are no the function bar in the backtrace. Why? -------------- next part -------------- An HTML attachment was scrubbed... URL: From eli at barzilay.org Tue Jun 22 03:34:50 2010 From: eli at barzilay.org (Eli Barzilay) Date: Tue, 22 Jun 2010 03:34:50 -0400 Subject: [racket] Metaprogramming with scheme In-Reply-To: <4C205DA5.4040002@digitalchile.net> References: <4C1F845C.20906@digitalchile.net> <4C205058.4040307@digitalchile.net> <4C205AD7.3000409@digitalchile.net> <4C205DA5.4040002@digitalchile.net> Message-ID: <19488.26522.269782.571729@winooski.ccs.neu.edu> On Jun 22, Valeriya Pudova wrote: > > (define (foo a b) > (for-each (lambda (e) (display e)(newline)) > (continuation-mark-set->context (current-continuation-marks)))) > > (define (bar a b) > (foo a b)) > > (bar 1 2) > [...] > > Interesting. There are no the function bar in the backtrace. Why? Because it's no longer there -- the tail call replaces it. Try to run this in DrRacket (exactly as is, don't reindent): (define (foo3 x) (/ x "1")) (define (foo2 x) (foo3 x)) (define (foo1 x) (list (foo2 x))) (define (foo0 x) (car (foo1 x))) (+ 1 (foo0 3)) and you'll see that the arrows skip `foo2'. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From valery at digitalchile.net Tue Jun 22 04:11:38 2010 From: valery at digitalchile.net (Valeriya Pudova) Date: Tue, 22 Jun 2010 12:11:38 +0400 Subject: [racket] Metaprogramming with scheme In-Reply-To: <19488.26522.269782.571729@winooski.ccs.neu.edu> References: <4C1F845C.20906@digitalchile.net> <4C205058.4040307@digitalchile.net> <4C205AD7.3000409@digitalchile.net> <4C205DA5.4040002@digitalchile.net> <19488.26522.269782.571729@winooski.ccs.neu.edu> Message-ID: <4C20703A.9070902@digitalchile.net> On 22.06.2010 11:34, Eli Barzilay wrote: > (define (foo3 x) > (/ x "1")) > > (define (foo2 x) > (foo3 x)) > (define (foo1 x) > (list (foo2 x))) > (define (foo0 x) > (car (foo1 x))) > > (+ 1 (foo0 3)) > Oh. Right. Thanks allot. From a2alt at ya.ru Tue Jun 22 13:25:20 2010 From: a2alt at ya.ru (Groshev Dmitry) Date: Tue, 22 Jun 2010 21:25:20 +0400 Subject: [racket] DrRacket and snippets Message-ID: <592781277227520@web140.yandex.ru> Is there any tool for add some snippets to DrRacket? I use some packets from PLaneT quite frequently, and it's very boring to copy and paste (require... ) again and again. Is there any way to make this more simple? From clklein at eecs.northwestern.edu Tue Jun 22 14:38:21 2010 From: clklein at eecs.northwestern.edu (Casey Klein) Date: Tue, 22 Jun 2010 13:38:21 -0500 Subject: [racket] [plt-scheme] [redex] matching question In-Reply-To: References: Message-ID: On Fri, Jun 4, 2010 at 1:48 PM, Casey Klein wrote: > On Fri, Jun 4, 2010 at 1:14 PM, Eric Tanter wrote: >> Hi, >> >> I have a subtype? metafunction where one clause is as follows: >> >> ((subtype? C_0 C_1 CT) >> ? #t >> ? (side-condition (not (equal? (term C_0) (term Object)))) >> ? (where (C_0 C_2 any_1 any_2) (class-lookup C_0 CT)) >> ? (side-condition (not (equal? (term C_0) (term C_1)))) >> ? (side-condition (equal? (term C_2) (term C_1)))) >> >> ie. C_0 is subtype of C_1 if C_0 directly inherits from C_1 >> >> I find it redundant that I have to write the above, ie. introducing C_2 in the where clause to then check that C_2 and C_1 are equal. >> >> At first I wrote: >> >> ((subtype? C_0 C_1 CT) >> ? #t >> ? (side-condition (not (equal? (term C_0) (term Object)))) >> ? (where (C_0 C_1 any_1 any_2) (class-lookup C_0 CT)) >> ? (side-condition (not (equal? (term C_0) (term C_1))))) >> >> putting C_1 directly in the pattern of the where clause, but it did not work (that is to say, it always matched, even if the superclass was different from C_1). >> >> Can someone explain me why this is so? >> > > John requested the same behavior a few months ago, and I agree it > would be very handy. ?I'll try to implement it in the next few weeks. > This change is in git now. Here's an example. (define-metafunction STLC [(? (e_1 e_2) ?) ?_2 (where (?_1 ? ?_2) (? e_1 ?)) (where ?_1 (? e_2 ?))] [(? x_i ((x_0 ?_0) ... (x_i ?_i) (x_i+1 ?_i+1) ...)) ?_i] [(? (? (x : ?) e) ((x_0 ?_0) ...)) (? ? ?_*) (where ?_* (? e ((x ?) (x_0 ?_0) ...)))] [(? number ?) Number] [(? e ?) no-type]) (define-language STLC (e (? (x : ?) e) (e e) x number) (? Number (? ? ?)) (x variable-not-otherwise-mentioned) (? ((x ?) ...))) From kwinterling at gmail.com Tue Jun 22 14:45:00 2010 From: kwinterling at gmail.com (Karl Winterling) Date: Tue, 22 Jun 2010 11:45:00 -0700 Subject: [racket] Web Application Deployment Message-ID: It appears that you need a PLT Web server running on your site's host to deploy Web applications. Is it possible to deploy applications on shared hosting with Apache and something like CGI or FastCGI? From neil at neilvandyke.org Tue Jun 22 15:21:51 2010 From: neil at neilvandyke.org (Neil Van Dyke) Date: Tue, 22 Jun 2010 15:21:51 -0400 Subject: [racket] Web Application Deployment In-Reply-To: References: Message-ID: <4C210D4F.8040701@neilvandyke.org> Racket comes with a CGI library. I recently ported a large legacy Racket (PLT Scheme) CGI-based application to SCGI using "http://www.neilvandyke.org/scgi-scheme/". For new development, consider using the PLT Web Server instead of SCGI or old CGI. Nowadays, virtual servers like Amazon EC2 are affordable, and you can make them do things that the cheapo CGI/PHP/Zope shared hosting of a few years ago didn't support. When undertaking a Web development project in Racket... in addition to the extensive Racket documentation and the help available on this email list, there are professional Racket consultants available for outsourcing. And, to borrow a line from an Asimov bio, they grow more handsome with each year. Karl Winterling wrote at 06/22/2010 02:45 PM: > It appears that you need a PLT Web server running on your site's host to deploy Web applications. Is it possible to deploy applications on shared hosting with Apache and something like CGI or FastCGI? -- http://www.neilvandyke.org/ From kwinterling at gmail.com Tue Jun 22 15:40:51 2010 From: kwinterling at gmail.com (Karl Winterling) Date: Tue, 22 Jun 2010 12:40:51 -0700 Subject: [racket] Web Application Deployment In-Reply-To: <4C210D4F.8040701@neilvandyke.org> References: <4C210D4F.8040701@neilvandyke.org> Message-ID: I'm a college student in California, so I can't afford a World of Warcraft account. However, I might try to design and "sell" a Racket application to my Co-op. so I'll need to avoid sounding mentally disturbed to the central IT staff. On Tue, Jun 22, 2010 at 12:21 PM, Neil Van Dyke wrote: > Racket comes with a CGI library. ?I recently ported a large legacy Racket > (PLT Scheme) CGI-based application to SCGI using > "http://www.neilvandyke.org/scgi-scheme/". > > For new development, consider using the PLT Web Server instead of SCGI or > old CGI. ?Nowadays, virtual servers like Amazon EC2 are affordable, and you > can make them do things that the cheapo CGI/PHP/Zope shared hosting of a few > years ago didn't support. > > When undertaking a Web development project in Racket... in addition to the > extensive Racket documentation and the help available on this email list, > there are professional Racket consultants available for outsourcing. ?And, > to borrow a line from an Asimov bio, they grow more handsome with each year. > > Karl Winterling wrote at 06/22/2010 02:45 PM: >> >> It appears that you need a PLT Web server running on your site's host to >> deploy Web applications. Is it possible to deploy applications on shared >> hosting with Apache and something like CGI or FastCGI? > > -- > http://www.neilvandyke.org/ > From matthias at ccs.neu.edu Tue Jun 22 15:55:32 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Tue, 22 Jun 2010 15:55:32 -0400 Subject: [racket] Web Application Deployment In-Reply-To: References: <4C210D4F.8040701@neilvandyke.org> Message-ID: <46BF804B-1DEA-4790-9E63-A6C75636E450@ccs.neu.edu> Go for the CGI library then, it works well and patches are welcome On Jun 22, 2010, at 3:40 PM, Karl Winterling wrote: > I'm a college student in California, so I can't afford a World of > Warcraft account. However, I might try to design and "sell" a Racket > application to my Co-op. so I'll need to avoid sounding mentally > disturbed to the central IT staff. > > On Tue, Jun 22, 2010 at 12:21 PM, Neil Van Dyke > wrote: >> Racket comes with a CGI library. I recently ported a large legacy >> Racket >> (PLT Scheme) CGI-based application to SCGI using >> "http://www.neilvandyke.org/scgi-scheme/". >> >> For new development, consider using the PLT Web Server instead of >> SCGI or >> old CGI. Nowadays, virtual servers like Amazon EC2 are affordable, >> and you >> can make them do things that the cheapo CGI/PHP/Zope shared hosting >> of a few >> years ago didn't support. >> >> When undertaking a Web development project in Racket... in addition >> to the >> extensive Racket documentation and the help available on this email >> list, >> there are professional Racket consultants available for >> outsourcing. And, >> to borrow a line from an Asimov bio, they grow more handsome with >> each year. >> >> Karl Winterling wrote at 06/22/2010 02:45 PM: >>> >>> It appears that you need a PLT Web server running on your site's >>> host to >>> deploy Web applications. Is it possible to deploy applications on >>> shared >>> hosting with Apache and something like CGI or FastCGI? >> >> -- >> http://www.neilvandyke.org/ >> > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From anton at appsolutions.com Tue Jun 22 16:49:13 2010 From: anton at appsolutions.com (Anton van Straaten) Date: Tue, 22 Jun 2010 16:49:13 -0400 Subject: [racket] Web Application Deployment In-Reply-To: References: <4C210D4F.8040701@neilvandyke.org> Message-ID: <4C2121C9.1030905@appsolutions.com> Karl Winterling wrote: > I'm a college student in California, so I can't afford a World of > Warcraft account. However, I might try to design and "sell" a Racket > application to my Co-op. so I'll need to avoid sounding mentally > disturbed to the central IT staff. Be aware that IT staff might be a bit reluctant to deploy traditional CGI applications these days. Traditional CGI invokes an executable on each request, which tends to put unnecessary load on servers, particularly if the application has many users, or if it's public and has search bots crawling it. The P languages, Perl/Python/PHP, have long since moved to using either modules integrated with the web server, or FCGI/SCGI approaches where you need a separate server running the application anyway. If FCGI or SCGI are options, then a third option that might be open to you is running a Racket web server on a non-standard port and having IT set up proxying to expose that server through their primary web server. That takes just a few lines of configuration on most major web servers, and it doesn't require any special protocols, libraries, or APIs. Anton From plt at synx.us.to Tue Jun 22 18:10:18 2010 From: plt at synx.us.to (synx) Date: Tue, 22 Jun 2010 15:10:18 -0700 Subject: [racket] Web Application Deployment In-Reply-To: References: Message-ID: <4C2134CA.608@synx.us.to> I looked over the FastCGI and SCGI protocols, and concluded that they weren't much more efficient than a protocol known as HTTP. Why not proxy your data to a webserver, using apache's proxy module? My apache2.conf has a lot of these in it: ProxyPass http://127.0.0.1:6666/ retry=10 If you can run a CGI program that launches Racket on some script file, then you also have the ability to run Racket as a little web server. If you can run Racket as a FastCGI server, or a SCGI server, then you also have the ability to run Racket as a little web server! From valery at digitalchile.net Wed Jun 23 00:39:23 2010 From: valery at digitalchile.net (Valeriya Pudova) Date: Wed, 23 Jun 2010 08:39:23 +0400 Subject: [racket] Metaprogramming with scheme In-Reply-To: References: Message-ID: <4C218FFB.7010408@digitalchile.net> > > (with-input-from-file "foo.ss" > > (lambda () > > (parameterize ([error-display-handler (lambda (name . stuff) > > (printf "Got ~a ~a\n" name stuff))]) > > (eval-syntax (read-syntax 'foo.ss))))) Last quoestion. Is there any way to define error-display-handler to printout the back trace even if there are default exception case? (define (foo a b) (+ a b)) (+ a1 "2") => producece exception and error-display-handler extract and print the back trace - Val. From noelwelsh at gmail.com Wed Jun 23 06:13:43 2010 From: noelwelsh at gmail.com (Noel Welsh) Date: Wed, 23 Jun 2010 11:13:43 +0100 Subject: [racket] Metaprogramming with scheme In-Reply-To: <4C218FFB.7010408@digitalchile.net> References: <4C218FFB.7010408@digitalchile.net> Message-ID: On Wed, Jun 23, 2010 at 5:39 AM, Valeriya Pudova wrote: > Last quoestion. Is there any way ?to define error-display-handler to > printout the back trace even if there are default exception case? I think I don't understand the question. Every exception contains continuations marks, so it should be straightforward to write your own error-display-handler to printout the trace. Does this help? N. From valery at digitalchile.net Wed Jun 23 07:38:33 2010 From: valery at digitalchile.net (Valeriya Pudova) Date: Wed, 23 Jun 2010 15:38:33 +0400 Subject: [racket] Metaprogramming with scheme In-Reply-To: References: <4C218FFB.7010408@digitalchile.net> Message-ID: <4C21F239.5040301@digitalchile.net> On 23.06.2010 14:13, Noel Welsh wrote: > On Wed, Jun 23, 2010 at 5:39 AM, Valeriya Pudova > wrote: > >> Last quoestion. Is there any way to define error-display-handler to >> printout the back trace even if there are default exception case? >> > I think I don't understand the question. Every exception contains > continuations marks, so it should be straightforward to write your own > error-display-handler to printout the trace. Does this help? > > N. > Oh! Guess I found the answer [error-display-handler (lambda (name . stuff) (for-each (lambda (e) (display e)(newline)) (continuation-mark-set->context (exn-continuation-marks (car stuff)))) )] Thank You From valery at digitalchile.net Wed Jun 23 08:44:16 2010 From: valery at digitalchile.net (Valeriya Pudova) Date: Wed, 23 Jun 2010 16:44:16 +0400 Subject: [racket] Metaprogramming with scheme In-Reply-To: <4C21F239.5040301@digitalchile.net> References: <4C218FFB.7010408@digitalchile.net> <4C21F239.5040301@digitalchile.net> Message-ID: <4C2201A0.5090903@digitalchile.net> I want share the my current test code. But this code have one issue. (define-syntax (baz stx) (syntax-case stx () ((_ a b) #'(* a b)))) (define (bar a b) (list (+ a b))) (define (foo a b) (car (bar a b))) (display (foo 1 2)) ;; can be (foo 1 "2") to produce exception (display (baz 12 22)) #lang scheme (define-namespace-anchor a) (define ns (namespace-anchor->namespace a)) (define (file->syntax file-name) ;; read the file and convert it to the syntax object (let* ([in (open-input-file file-name)]) (port-count-lines! in) (begin0 (let loop ([rs '()] [r (read-syntax file-name in)]) (if (eof-object? r) (reverse rs) (loop (cons r rs) (read-syntax file-name in)))) (close-input-port in) ))) (with-input-from-file "foo.ss" (lambda () (parameterize ([error-display-handler (lambda (name . stuff) (begin (printf "~a\n" name) (for-each (lambda (e) (printf "~a:~a:~a: ~a\n" (srcloc-source (cdr e)) (srcloc-line (cdr e)) (srcloc-column (cdr e)) (car e)) ) (continuation-mark-set->context (exn-continuation-marks (car stuff)))) ))]) (for-each (lambda (e) (eval e ns)) (file->syntax "foo.ss"))))) In case if foo.ss will have (display (foo 1 2)) the error message will be +: expects type as 2nd argument, given: "2"; other arguments were: 1 foo.ss:6:0: bar foo.ss:9:0: foo C:\Racket\collects\racket\private\map.rkt:45:11: for-each C:\Racket\test.ss:#f:#f: [running body] C:\Racket\collects\racket\private\more-scheme.rkt:274:2: call-with-exception-handler .... etc Looks not bad. But if error will be at the top level ;(display (foo 1 2)) ;(display (baz 12 22)) (+ 1 "2") Then error message is not informative +: expects type as 2nd argument, given: "2"; other arguments were: 1 C:\Racket\collects\racket\private\map.rkt:45:11: for-each C:\Racket\test.ss:#f:#f: [running body] .... etc It does not reffer to the error location. Can it be solved? From valery at digitalchile.net Wed Jun 23 08:46:31 2010 From: valery at digitalchile.net (Valeriya Pudova) Date: Wed, 23 Jun 2010 16:46:31 +0400 Subject: [racket] Metaprogramming with scheme In-Reply-To: <4C2201A0.5090903@digitalchile.net> References: <4C218FFB.7010408@digitalchile.net> <4C21F239.5040301@digitalchile.net> <4C2201A0.5090903@digitalchile.net> Message-ID: <4C220227.8010707@digitalchile.net> On 23.06.2010 16:44, Valeriya Pudova wrote: > In case if foo.ss will have (display (foo 1 2)) the error message will be should be text: In case if foo.ss will have (display (foo 1 "2")) the error message will be From ken at struys.ca Wed Jun 23 10:32:48 2010 From: ken at struys.ca (Ken Struys) Date: Wed, 23 Jun 2010 10:32:48 -0400 Subject: [racket] =?utf-8?q?Web_Application_Deployment?= Message-ID: <201006231432.o5NEWnVh001712@champlain.ccs.neu.edu> I use this company for VPS (Virtual Private Server) hosting. It's similar to the service EC2 provides, but it's only $17 a month. You get: - Any almost any OS you would want - root access to your vm (install whatever you want) - a dedicated IP - 256MB Ram - 200GB/month in bandwidth - 5GB disk space On Tue, 06/22/2010 at 6:10pm, "synx" wrote: > I looked over the FastCGI and SCGI protocols, and concluded that they > weren't much more efficient than a protocol known as HTTP. Why not proxy > your data to a webserver, using apache's proxy module? > > My apache2.conf has a lot of these in it: > > > ProxyPass http://127.0.0.1:6666/ retry=10 > > > If you can run a CGI program that launches Racket on some script file, > then you also have the ability to run Racket as a little web server. If > you can run Racket as a FastCGI server, or a SCGI server, then you also > have the ability to run Racket as a little web server! > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From ken at struys.ca Wed Jun 23 10:33:55 2010 From: ken at struys.ca (Ken Struys) Date: Wed, 23 Jun 2010 10:33:55 -0400 Subject: [racket] =?utf-8?q?Web_Application_Deployment?= Message-ID: <201006231434.o5NEY463001766@champlain.ccs.neu.edu> Oops forgot the link: http://pandela.com/ On Wed, 06/23/2010 at 10:32am, "Ken Struys" wrote: > I use this company for VPS (Virtual Private Server) hosting. It's similar to > the service EC2 provides, but it's only $17 a month. > > You get: > - Any almost any OS you would want > - root access to your vm (install whatever you want) > - a dedicated IP > - 256MB Ram > - 200GB/month in bandwidth > - 5GB disk space > > On Tue, 06/22/2010 at 6:10pm, "synx" wrote: >> I looked over the FastCGI and SCGI protocols, and concluded that they >> weren't much more efficient than a protocol known as HTTP. Why not proxy >> your data to a webserver, using apache's proxy module? >> >> My apache2.conf has a lot of these in it: >> >> >> ProxyPass http://127.0.0.1:6666/ retry=10 >> >> >> If you can run a CGI program that launches Racket on some script file, >> then you also have the ability to run Racket as a little web server. If >> you can run Racket as a FastCGI server, or a SCGI server, then you also >> have the ability to run Racket as a little web server! >> _________________________________________________ >> For list-related administrative tasks: >> http://lists.racket-lang.org/listinfo/users From sbloch at adelphi.edu Wed Jun 23 13:24:41 2010 From: sbloch at adelphi.edu (Stephen Bloch) Date: Wed, 23 Jun 2010 13:24:41 -0400 Subject: [racket] [plt-scheme] 2htdp/image questions In-Reply-To: <33D4D431-676C-4FD0-BEB4-F86EC3348AC3@adelphi.edu> References: <118F6143-DD10-4446-B1A8-CEE27CE01ED2@adelphi.edu> <33D4D431-676C-4FD0-BEB4-F86EC3348AC3@adelphi.edu> Message-ID: <2266CC90-0561-4B13-87AD-62FF2D43C888@adelphi.edu> In preparing my textbook, I ran into a really good application for map-image (which I still haven't got working :-() The publisher says it'll cost two or three times as much to produce the book in color than in B&W, so in order to make the book affordable, I plan to do all the pictures in the book in grayscale, with colored versions on the Web site. So I started converting (bitmap) images to grayscale. Unfortunately, grayscale is normally 8-bit, with no room for an alpha channel, so all the images that had transparent backgrounds lost them. In theory, one could create a 32-bit image with an alpha channel, all of whose colors happen to be grays, and in fact I found some Java code on the Web to do that... but it would be so much more convenient if I could just write a Racket function that takes in an image and spits out the same image with new.r=new.g=new.b=average(old.r,old.g,old.b) for each pixel, preserving the alpha channel. In fact, this would be an easy student exercise, if I had the "map-image" function (or an analogous "map-alpha-image" function) working. Anyway, back to the textbook. Stephen Bloch sbloch at adelphi.edu From iminsik at gmail.com Wed Jun 23 14:01:20 2010 From: iminsik at gmail.com (Insik Cho) Date: Wed, 23 Jun 2010 11:01:20 -0700 Subject: [racket] View HTML source code in racket Message-ID: hi buddies, I want to html source of an web page in racket. What module and functions shall I use? and How? Thanks in advance! Joe -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpc-ml at zenburn.net Wed Jun 23 14:35:09 2010 From: jpc-ml at zenburn.net (=?UTF-8?B?SmFrdWIgUGlvdHIgQ8WCYXBh?=) Date: Wed, 23 Jun 2010 20:35:09 +0200 Subject: [racket] Web Application Deployment In-Reply-To: <4C2134CA.608@synx.us.to> References: <4C2134CA.608@synx.us.to> Message-ID: <4C2253DD.9090406@zenburn.net> On 23.06.10 00:10, synx wrote: > I looked over the FastCGI and SCGI protocols, and concluded that they > weren't much more efficient than a protocol known as HTTP. Why not proxy > your data to a webserver, using apache's proxy module? I recently looked at FastCGI and came to the same conclusion. To be honest SCGI is somewhat simpler since it handles most of the validation and parsing for you. FastCGI is not since it adds much of it's own boilerplate. FastCGI can be used for some other task than simple HTTP proxying (e.g. delegating authentication) but AFAIK nobody is using it. > My apache2.conf has a lot of these in it: > > > ProxyPass http://127.0.0.1:6666/ retry=10 > > > If you can run a CGI program that launches Racket on some script file, > then you also have the ability to run Racket as a little web server. If > you can run Racket as a FastCGI server, or a SCGI server, then you also > have the ability to run Racket as a little web server! That is the approach I settled on too (with nginx as the proxy). Just remember to bind the racket app to "localhost"/127.0.0.1 and no to a public interface. -- regards, Jakub Piotr C?apa From neil at neilvandyke.org Wed Jun 23 14:52:32 2010 From: neil at neilvandyke.org (Neil Van Dyke) Date: Wed, 23 Jun 2010 14:52:32 -0400 Subject: [racket] Web Application Deployment In-Reply-To: <4C2253DD.9090406@zenburn.net> References: <4C2134CA.608@synx.us.to> <4C2253DD.9090406@zenburn.net> Message-ID: <4C2257F0.10909@neilvandyke.org> Jakub Piotr C?apa wrote at 06/23/2010 02:35 PM: > On 23.06.10 00:10, synx wrote: >> I looked over the FastCGI and SCGI protocols, and concluded that they >> weren't much more efficient than a protocol known as HTTP. Why not proxy >> your data to a webserver, using apache's proxy module? > > I recently looked at FastCGI and came to the same conclusion. To be > honest SCGI is somewhat simpler since it handles most of the > validation and parsing for you. FastCGI is not since it adds much of > it's own boilerplate. FastCGI can be used for some other task than > simple HTTP proxying (e.g. delegating authentication) but AFAIK nobody > is using it. The main reason not to use FastCGI is that it's a seriously ugly protocol. :) I had it almost completely implemented in PLT before I decided that a custom Apache module or HTTP proxying was more sane, and then I found the almost-too-simple SCGI protocol. We've had good success with moving a large legacy system to SCGI, and SCGI is proven by others (Ruby, Python, etc.). That said, HTTP proxying is better if you want to do *everything* in Racket code, since then your system is no longer dependent on mod_scgi and scgi.ss. Also, that keeps you closer to using the PLT Web Server, which is a good place to be the next time you need to rapidly whip up a new Web service or site or internal tool or something. -- http://www.neilvandyke.org/ From nadeem at acm.org Wed Jun 23 15:36:31 2010 From: nadeem at acm.org (Nadeem Abdul Hamid) Date: Wed, 23 Jun 2010 15:36:31 -0400 Subject: [racket] Quitting web servlet apps Message-ID: <73EDB964-1B90-4F95-A07F-A4D74901F344@acm.org> A couple of questions regarding quitting web apps, 1. I start up a servlet so: (serve/servlet my-dispatch #:quit? #t ...) Now, how come if I use a program like curl/wget to access the "/quit" URL, the server doesn't shut down, but accessing the same URL via a web browser does? Here's the terminal interaction with curl: $ curl http://localhost:8000/quit Server Stopped
Server Stopped

Return to DrRacket.

... The server continues running. Now if I visit the same url in a browser, it stops after displaying the same HTML above. Here's the log file for the servlet (the two requests look identical): 127.0.0.1 - - [23/Jun/2010:15:25:29 -0400] "GET /quit HTTP/1.1" 200 512 127.0.0.1 - - [23/Jun/2010:15:25:37 -0400] "GET /quit HTTP/1.1" 200 512 2. In general, is there a good way to set up a different URL to stop the server? E.g. suppose I want to set up a "/shutdown" URL that determines first if the current user is properly authenticated, and then shuts down the server. I was playing around putting in a request to "/quit" in the handler for the /shutdown URL: "(get-pure-port (string->url "http://localhost:8000/quit")) ... " but this, like with curl, returns the "Server Stopped" page but doesn't actually stop the server. How does the DrRacket "Stop" button stop a running web server nicely? I tried doing (break-thread (current-thread)) in the handler for /shutdown, but that didn't quit work either. Thanks in advance, --- nadeem From jay.mccarthy at gmail.com Wed Jun 23 16:33:12 2010 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Wed, 23 Jun 2010 14:33:12 -0600 Subject: [racket] Quitting web servlet apps In-Reply-To: <73EDB964-1B90-4F95-A07F-A4D74901F344@acm.org> References: <73EDB964-1B90-4F95-A07F-A4D74901F344@acm.org> Message-ID: Hi Nadeem, I'm not sure why curl and the Web browser behave differently. Is it possible to see a network trace? As for having a different shutdown URL... I'm curious why you want one for starters, because there may be a better way to do what you want. The shutdown URL with serve/servlet works by calling the shutdown function that serve returns. All that does is kill the custodian that the server was started with. So, you could do the same thing by knowing what the server's custodian. Jay On Wed, Jun 23, 2010 at 1:36 PM, Nadeem Abdul Hamid wrote: > A couple of questions regarding quitting web apps, > > 1. I start up a servlet so: > ? ?(serve/servlet my-dispatch #:quit? #t ...) > ?Now, how come if I use a program like curl/wget to access the "/quit" URL, the server doesn't shut down, but accessing the same URL via a web browser does? Here's the terminal interaction with curl: > > $ curl http://localhost:8000/quit > Server Stopped
Server Stopped

Return to DrRacket.

> > ... The server continues running. Now if I visit the same url in a browser, it stops after displaying the same HTML above. Here's the log file for the servlet (the two requests look identical): > > 127.0.0.1 - - [23/Jun/2010:15:25:29 -0400] "GET /quit HTTP/1.1" 200 512 > 127.0.0.1 - - [23/Jun/2010:15:25:37 -0400] "GET /quit HTTP/1.1" 200 512 > > > > 2. In general, is there a good way to set up a different URL to stop the server? E.g. suppose I want to set up a "/shutdown" URL that determines first if the current user is properly authenticated, and then shuts down the server. I was playing around putting in a request to "/quit" in the handler for the /shutdown URL: "(get-pure-port (string->url "http://localhost:8000/quit")) ... " but this, like with curl, returns the "Server Stopped" page but doesn't actually stop the server. ?How does the DrRacket "Stop" button stop a running web server nicely? I tried doing (break-thread (current-thread)) in the handler for /shutdown, but that didn't quit work either. > > > Thanks in advance, > --- nadeem > > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From noelwelsh at gmail.com Wed Jun 23 16:41:14 2010 From: noelwelsh at gmail.com (Noel Welsh) Date: Wed, 23 Jun 2010 21:41:14 +0100 Subject: [racket] View HTML source code in racket In-Reply-To: References: Message-ID: I don't really understand the question, but perhaps this tutorial covers what you want: http://docs.racket-lang.org/continue/index.html HTH, N. On Wed, Jun 23, 2010 at 7:01 PM, Insik Cho wrote: > hi buddies, > I want to html source of an web page in racket. > What module and functions shall I use? and How? > Thanks in advance! > Joe From noelwelsh at gmail.com Wed Jun 23 16:49:34 2010 From: noelwelsh at gmail.com (Noel Welsh) Date: Wed, 23 Jun 2010 21:49:34 +0100 Subject: [racket] Metaprogramming with scheme In-Reply-To: <4C2201A0.5090903@digitalchile.net> References: <4C218FFB.7010408@digitalchile.net> <4C21F239.5040301@digitalchile.net> <4C2201A0.5090903@digitalchile.net> Message-ID: On Wed, Jun 23, 2010 at 1:44 PM, Valeriya Pudova wrote: > Looks not bad. But if error will be at the top level ... > (+ 1 "2") > > Then error message is not informative > > +: expects type as 2nd argument, given: "2"; other arguments were: > 1 > C:\Racket\collects\racket\private\map.rkt:45:11: for-each ... > > It does not reffer to the error location. Can it be solved? I suppose the errortrace library might give you more location information. I have never used it so I can't say much more than read the docs and/or hope someone else replies. HTH, N. From neil at neilvandyke.org Wed Jun 23 16:55:42 2010 From: neil at neilvandyke.org (Neil Van Dyke) Date: Wed, 23 Jun 2010 16:55:42 -0400 Subject: [racket] View HTML source code in racket In-Reply-To: <4C225B1D.20802@neilvandyke.org> References: <4C225B1D.20802@neilvandyke.org> Message-ID: <4C2274CE.7030402@neilvandyke.org> (This message and Insik Cho's response didn't seem to make it to the list.) Neil Van Dyke wrote at 06/23/2010 03:06 PM: > Insik Cho wrote at 06/23/2010 02:01 PM: >> I want to html source of an web page in racket. >> >> What module and functions shall I use? and How? > > Do you want Racket to get a Web page for you, and then have your > program access the HTML of the Web page? > > Here is a way to do that: > > ;;;;; > > #lang racket > > (require net/url > (planet neil/htmlprag)) > > (define my-sxml-of-html-page (call/input-url (string->url > "http://m.google.com/") > get-pure-port > html->sxml)) > > my-sxml-of-html-page > > ;;;;; > > To have your program use the SXML representation of HTML that is in > variable "my-sxml-of-html-page", you should get comfortable > programming with lists in Racket. > > There are also tools you can use, such as SXPath. But I think you > should understand lists before using SXPath. > From zerosumz at nate.com Wed Jun 23 20:13:34 2010 From: zerosumz at nate.com (=?UTF-8?B?7J6l7Jyg7ZiE?=) Date: Thu, 24 Jun 2010 09:13:34 +0900 Subject: [racket] =?utf-8?q?_What_is_the_select_operation_in_MongoDB_ORM_f?= =?utf-8?q?unctions=3F?= Message-ID: <0fac31de55bcc322dcf1bb2bdf9a3366$218d5c5f@pcmail3.nate.com> An HTML attachment was scrubbed... URL: From jay.mccarthy at gmail.com Wed Jun 23 21:07:29 2010 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Wed, 23 Jun 2010 19:07:29 -0600 Subject: [racket] What is the select operation in MongoDB ORM functions? In-Reply-To: <0fac31de55bcc322dcf1bb2bdf9a3366$218d5c5f@pcmail3.nate.com> References: <0fac31de55bcc322dcf1bb2bdf9a3366$218d5c5f@pcmail3.nate.com> Message-ID: You can use mongo-dict-query. The mongo-structs are just mongo-dicts. Jay On Wed, Jun 23, 2010 at 6:13 PM, ??? wrote: > Hello there! > > I'm very inspired MongDB.plt and It's Quick Start Example. > > but this (make-post ...) insert a new collection only . > > I'll be happy if I can select atom of collection and update it. > > plz help me :'( > > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 -------------- next part -------------- An HTML attachment was scrubbed... URL: From greghendershott at gmail.com Wed Jun 23 22:11:09 2010 From: greghendershott at gmail.com (Greg Hendershott) Date: Wed, 23 Jun 2010 22:11:09 -0400 Subject: [racket] View HTML source code in racket In-Reply-To: References: Message-ID: How I've gotten an x-expression using solely the Racket libs: (require net/url html xml) (define (get-xexpr-from-url url-string) (call/input-url (string->url url-string) get-pure-port (lambda (p) (xml->xexpr (car (read-html-as-xml p)))))) ; example (get-xexpr-from-url "http://www.google.com/") To use the x-expression you'll probably want something like the following. (Just beware I'm a Lisp/Scheme/Racket n%b and someone will probably point out a smarter way to code this.) (define (find-elements xexpr tag-name) ;; Given an x-expression return a list of all the elements starting with tag-name. (if (empty? xexpr) '() (let ([x (first xexpr)]) (if (and (list? x) (not (empty? x))) (if (and (symbol? (first x)) (symbol=? (first x) tag-name)) (append (list x) ; found one! (find-elements x tag-name) ; drill down (find-elements (rest xexpr) tag-name)) ; iterate across (append (find-elements x tag-name) ; drill down (find-elements (rest xexpr) tag-name))) ; iterate across (find-elements (rest xexpr) tag-name))))) ; iterate across ; example: get a list of all the a.k.a 'a elements (find-elements (get-xexpr-from-url "http://www.google.com/") 'a) On Wed, Jun 23, 2010 at 2:01 PM, Insik Cho wrote: > hi buddies, > I want to html source of an web page in racket. > What module and functions shall I use? and How? > Thanks in advance! > Joe > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > From iminsik at gmail.com Thu Jun 24 01:12:47 2010 From: iminsik at gmail.com (Insik Cho) Date: Wed, 23 Jun 2010 22:12:47 -0700 Subject: [racket] View HTML source code in racket In-Reply-To: References: Message-ID: Cool! Thanks Greg! - Joe On 6/23/10, Greg Hendershott wrote: > How I've gotten an x-expression using solely the Racket libs: > > (require net/url html xml) > > (define (get-xexpr-from-url url-string) > (call/input-url (string->url url-string) > get-pure-port > (lambda (p) > (xml->xexpr (car (read-html-as-xml p)))))) > > ; example > (get-xexpr-from-url "http://www.google.com/") > > > To use the x-expression you'll probably want something like the > following. (Just beware I'm a Lisp/Scheme/Racket n%b and someone will > probably point out a smarter way to code this.) > > (define (find-elements xexpr tag-name) > ;; Given an x-expression return a list of all the elements starting > with tag-name. > (if (empty? xexpr) > '() > (let ([x (first xexpr)]) > (if (and (list? x) (not (empty? x))) > (if (and (symbol? (first x)) (symbol=? (first x) tag-name)) > (append (list x) ; found one! > (find-elements x tag-name) ; drill down > (find-elements (rest xexpr) tag-name)) ; iterate > across > (append (find-elements x tag-name) ; drill down > (find-elements (rest xexpr) tag-name))) ; iterate > across > (find-elements (rest xexpr) tag-name))))) ; iterate across > > ; example: get a list of all the a.k.a 'a elements > (find-elements (get-xexpr-from-url "http://www.google.com/") 'a) > > > On Wed, Jun 23, 2010 at 2:01 PM, Insik Cho wrote: >> hi buddies, >> I want to html source of an web page in racket. >> What module and functions shall I use? and How? >> Thanks in advance! >> Joe >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://lists.racket-lang.org/listinfo/users >> > From mcturra2000 at yahoo.co.uk Thu Jun 24 03:12:14 2010 From: mcturra2000 at yahoo.co.uk (Mark Carter) Date: Thu, 24 Jun 2010 07:12:14 +0000 (GMT) Subject: [racket] Sending s-expr to repl Message-ID: <720924.49884.qm@web27006.mail.ukl.yahoo.com> Scheme newbie here. I've always had a bee in my bonnet for the Lispy languages, but had never gotten into them fully for one reason or another. I've been playing with DrRacket, and have been able to plot graphs using it. Way cool! Anyway, my actual question is: using DrRacket, is there a way of sending the s-expr at the cursor to the repl, a la emacs? I think that would be a very nice feature. From jmj at fellowhuman.com Thu Jun 24 03:34:47 2010 From: jmj at fellowhuman.com (Jordan Johnson) Date: Thu, 24 Jun 2010 00:34:47 -0700 Subject: [racket] Sending s-expr to repl In-Reply-To: <720924.49884.qm@web27006.mail.ukl.yahoo.com> References: <720924.49884.qm@web27006.mail.ukl.yahoo.com> Message-ID: <1F6DC516-714F-45AA-84BE-D8EEF3DA9490@fellowhuman.com> See http://blog.racket-lang.org/2009/03/drscheme-repl-isnt-lisp.html for a detailed answer. Best, Jordan On Jun 24, 2010, at 12:12 AM, Mark Carter wrote: > Scheme newbie here. I've always had a bee in my bonnet for the Lispy > languages, but had never gotten into them fully for one reason or > another. I've been playing with DrRacket, and have been able to plot > graphs using it. Way cool! > > Anyway, my actual question is: using DrRacket, is there a way of > sending the s-expr at the cursor to the repl, a la emacs? I think > that would be a very nice feature. > > > > > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From iminsik at gmail.com Thu Jun 24 06:03:08 2010 From: iminsik at gmail.com (Insik Cho) Date: Thu, 24 Jun 2010 03:03:08 -0700 Subject: [racket] How can I save all the definitions in racket to a file? Message-ID: Hi buddies, I like a normal shell interactive environment. After I'm working in console 'racket,' I don't want to lose all the definitions I have made. How can I save the definitions to an external file, i.e., 'xxx.ss'? Thanks in advance. - Joe -------------- next part -------------- An HTML attachment was scrubbed... URL: From noelwelsh at gmail.com Thu Jun 24 06:25:44 2010 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu, 24 Jun 2010 11:25:44 +0100 Subject: [racket] How can I save all the definitions in racket to a file? In-Reply-To: References: Message-ID: It doesn't work that way. You should first save your defns in a file (as a module) and then load that file into racket. If you're working with command line racket you might want to look at the enter! function. N. On Thu, Jun 24, 2010 at 11:03 AM, Insik Cho wrote: > Hi buddies, > I like a normal shell interactive environment. > After I'm working in console 'racket,' I don't want to lose all the > definitions I have made. > How can I save the definitions to an external file, i.e., 'xxx.ss'? > Thanks in advance. > - Joe From iminsik at gmail.com Thu Jun 24 06:33:16 2010 From: iminsik at gmail.com (Insik Cho) Date: Thu, 24 Jun 2010 03:33:16 -0700 Subject: [racket] How can I save all the definitions in racket to a file? In-Reply-To: References: Message-ID: I see. Do you think if emacs is a good tool for editing, saving and executing racket programming? I prefer command-like environment to GUI. But, It's inconvenient to edit a file and enter! it separately in a shell. What environment or editor are you using for racket programming? - Joe On Thu, Jun 24, 2010 at 3:25 AM, Noel Welsh wrote: > It doesn't work that way. You should first save your defns in a file > (as a module) and then load that file into racket. If you're working > with command line racket you might want to look at the enter! > function. > > N. > > On Thu, Jun 24, 2010 at 11:03 AM, Insik Cho wrote: > > Hi buddies, > > I like a normal shell interactive environment. > > After I'm working in console 'racket,' I don't want to lose all the > > definitions I have made. > > How can I save the definitions to an external file, i.e., 'xxx.ss'? > > Thanks in advance. > > - Joe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From noelwelsh at gmail.com Thu Jun 24 06:57:33 2010 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu, 24 Jun 2010 11:57:33 +0100 Subject: [racket] How can I save all the definitions in racket to a file? In-Reply-To: References: Message-ID: I use Emacs. See http://monospaced.posterous.com/up-and-running-with-racket HTH, N. On Thu, Jun 24, 2010 at 11:33 AM, Insik Cho wrote: > I see. > Do you think if emacs is a good tool for editing, saving and executing > racket programming? > I prefer command-like environment to GUI. But, It's inconvenient to edit a > file and enter! it separately in a shell. > > What environment or editor are you using for racket programming? > - Joe From valery at digitalchile.net Thu Jun 24 08:31:12 2010 From: valery at digitalchile.net (Valeriya Pudova) Date: Thu, 24 Jun 2010 16:31:12 +0400 Subject: [racket] Keyword prefix or sufix ':' In-Reply-To: References: Message-ID: <4C235010.7080805@digitalchile.net> Is there any way to make symbols with the prefix ':' behave the same as the keywords? The document "Keyword and Optional Arguments in PLT Scheme" Has the next text in the chapter "7.7 Keyword Lexical Syntax" PLT Scheme uses a #: prefix. Chicken also supports a #: prefix in addition to a : suffix, though the keyword in both cases is equivalent to a symbol. The #: choice is natural for Scheme, since a # is normally used to extend the reader syntax, and : is normally allowed in symbols (i.e., some symbols and identifiers in existing code might break if a : prefix or suffix becomes the syntax of keywords). ..... An informal poll among PLT Scheme users suggested roughly equal support for all three choices (prefix #:, prefix :, and suffix :) with a slightly higher preference for #:?possibly reflecting the syntax that is already in place. In any case, PLT Scheme?s #lang notation would allow future modules to be written using a different syntax without affecting old modules From stamourv at ccs.neu.edu Thu Jun 24 08:42:08 2010 From: stamourv at ccs.neu.edu (Vincent St-Amour) Date: Thu, 24 Jun 2010 08:42:08 -0400 Subject: [racket] How can I save all the definitions in racket to a file? In-Reply-To: References: Message-ID: <87d3vg8uvz.wl%stamourv@ccs.neu.edu> At Thu, 24 Jun 2010 03:03:08 -0700, Insik Cho wrote: > After I'm working in console 'racket,' I don't want to lose all the > definitions I have made. > > How can I save the definitions to an external file, i.e., 'xxx.ss'? You can try running racket with rlwrap. In addition to giving it readline support, it will save all your interactions in ~/.racket_history It's a hack, but it works. Vincent From valery at digitalchile.net Thu Jun 24 09:07:43 2010 From: valery at digitalchile.net (Valeriya Pudova) Date: Thu, 24 Jun 2010 17:07:43 +0400 Subject: [racket] Keyword prefix or sufix ':' In-Reply-To: <4C235010.7080805@digitalchile.net> References: <4C235010.7080805@digitalchile.net> Message-ID: <4C23589F.5080505@digitalchile.net> There is other thread about this subject http://www.mail-archive.com/plt-dev at list.cs.brown.edu/msg00959.html On 24.06.2010 16:31, Valeriya Pudova wrote: > Is there any way to make symbols with the prefix ':' behave the same > as the keywords? > From nadeem at acm.org Thu Jun 24 09:11:07 2010 From: nadeem at acm.org (Nadeem Abdul Hamid) Date: Thu, 24 Jun 2010 09:11:07 -0400 Subject: [racket] DrRacket, Emacs, REPL [was: Sending s-expr to repl] In-Reply-To: <1F6DC516-714F-45AA-84BE-D8EEF3DA9490@fellowhuman.com> References: <720924.49884.qm@web27006.mail.ukl.yahoo.com> <1F6DC516-714F-45AA-84BE-D8EEF3DA9490@fellowhuman.com> Message-ID: <23A2AB79-9354-4435-8D51-D55A8BC84C02@acm.org> > See > http://blog.racket-lang.org/2009/03/drscheme-repl-isnt-lisp.html > for a detailed answer. > I see what the blog post above is saying, but (I know, "no when no if no but"), has anyone ever used editors for some of the proof assistants, like CoqIDE or ProofGeneral mode in Emacs for Coq? These support a seemingly nice compromise between the two styles. A minor annoyance I have with the DrRacket model of reloading the entire buffer is that if I have several working functions defined at the top of the file, and then a new function I'm working on below that has syntax errors or is in incomplete template form or whatever, running the file generates an error and no definitions at all are loaded into the REPL. So instead, in these proof editors, they have this feature where you can load the buffer up to a certain line/expression (assuming no syntax errors), and everything above there is then in a "locked" (uneditable) mode -- if you edit something, it rolls back the evaluated portion of the file. This way, you can have a bunch of messy/incomplete thoughts typed up at the bottom of your file, and have all good definitions up to a certain point in your file evaluated so that you can play with the evaluated definitions in the REPL, to help you fill in your unfinished thoughts. I know, this will get messy in the presence of effects (proof languages are purely functional), and probably a lot of work to implement, but something to think about... --- nadeem From jao at gnu.org Thu Jun 24 08:20:35 2010 From: jao at gnu.org (Jose A. Ortega Ruiz) Date: Thu, 24 Jun 2010 14:20:35 +0200 Subject: [racket] How can I save all the definitions in racket to a file? References: Message-ID: <876318ei5o.fsf@newton.homeunix.net> On Thu, Jun 24 2010, Insik Cho wrote: > I see. > > Do you think if emacs is a good tool for editing, saving and executing > racket programming? > > I prefer command-like environment to GUI. But, It's inconvenient to > edit a file and enter! it separately in a shell. > > What environment or editor are you using for racket programming? If you're familiar with Emacs, you might give Geiser a try (full disclosure: i'm Geiser's author). See http://www.nongnu.org/geiser for a bit of documentation (once i finish writing the user manual, i'll make the first relase; for now, you may consider it beta quality :)). (As an aside, and answering to another thread, Geiser let's you send individual sexps to the REPL, among other things). Cheers, jao From sk at cs.brown.edu Thu Jun 24 09:28:09 2010 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu, 24 Jun 2010 15:28:09 +0200 Subject: [racket] How can I save all the definitions in racket to a file? In-Reply-To: <876318ei5o.fsf@newton.homeunix.net> References: <876318ei5o.fsf@newton.homeunix.net> Message-ID: Is it running Racket underneath? On Thu, Jun 24, 2010 at 2:20 PM, Jose A. Ortega Ruiz wrote: > On Thu, Jun 24 2010, Insik Cho wrote: > >> I see. >> >> Do you think if emacs is a good tool for editing, saving and executing >> racket programming? >> >> I prefer command-like environment to GUI. But, It's inconvenient to >> edit a file and enter! it separately in a shell. >> >> What environment or editor are you using for racket programming? > > If you're familiar with Emacs, you might give Geiser a try (full > disclosure: i'm Geiser's author). See http://www.nongnu.org/geiser for a > bit of documentation (once i finish writing the user manual, i'll make > the first relase; for now, you may consider it beta quality :)). > > (As an aside, and answering to another thread, Geiser let's you send > individual sexps to the REPL, among other things). > > Cheers, > jao > > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > From samth at ccs.neu.edu Thu Jun 24 09:48:16 2010 From: samth at ccs.neu.edu (Sam Tobin-Hochstadt) Date: Thu, 24 Jun 2010 09:48:16 -0400 Subject: [racket] How can I save all the definitions in racket to a file? In-Reply-To: References: <876318ei5o.fsf@newton.homeunix.net> Message-ID: To quote from Jose's documentation: "I?ve concentrated initially in supporting those Schemes with the richest (to my knowledge) introspection capabilities, namely, Guile and Racket." I assume it's running mostly elisp underneath. :) On Thu, Jun 24, 2010 at 9:28 AM, Shriram Krishnamurthi wrote: > Is it running Racket underneath? > > On Thu, Jun 24, 2010 at 2:20 PM, Jose A. Ortega Ruiz wrote: >> On Thu, Jun 24 2010, Insik Cho wrote: >> >>> I see. >>> >>> Do you think if emacs is a good tool for editing, saving and executing >>> racket programming? >>> >>> I prefer command-like environment to GUI. But, It's inconvenient to >>> edit a file and enter! it separately in a shell. >>> >>> What environment or editor are you using for racket programming? >> >> If you're familiar with Emacs, you might give Geiser a try (full >> disclosure: i'm Geiser's author). See http://www.nongnu.org/geiser for a >> bit of documentation (once i finish writing the user manual, i'll make >> the first relase; for now, you may consider it beta quality :)). >> >> (As an aside, and answering to another thread, Geiser let's you send >> individual sexps to the REPL, among other things). >> >> Cheers, >> jao >> >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://lists.racket-lang.org/listinfo/users >> > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > -- sam th samth at ccs.neu.edu From jao at gnu.org Thu Jun 24 09:50:37 2010 From: jao at gnu.org (Jose A. Ortega Ruiz) Date: Thu, 24 Jun 2010 15:50:37 +0200 Subject: [racket] How can I save all the definitions in racket to a file? In-Reply-To: (Shriram Krishnamurthi's message of "Thu, 24 Jun 2010 15:28:09 +0200") References: <876318ei5o.fsf@newton.homeunix.net> Message-ID: <87tyosczf6.fsf@newton.homeunix.net> On Thu, Jun 24 2010, Shriram Krishnamurthi wrote: > Is it running Racket underneath? Yes. And, in fact, Racket is doing most of the work, not only for evaluation, but also when it comes to obtaining metadata for completions, showing arities and argument names, listing module exports, etc., etc. Emacs just starts a Racket process and asks it for the data it needs. And there's also an 'interactions window', with history &c. Cheers, jao From noelwelsh at gmail.com Thu Jun 24 10:07:27 2010 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu, 24 Jun 2010 15:07:27 +0100 Subject: [racket] Keyword prefix or sufix ':' In-Reply-To: <4C235010.7080805@digitalchile.net> References: <4C235010.7080805@digitalchile.net> Message-ID: On Thu, Jun 24, 2010 at 1:31 PM, Valeriya Pudova wrote: > Is there any way to make symbols with the prefix ':' behave the same as the > keywords? You'd have to write your own reader. Far less work is to adapt to the current syntax. N. From jao at gnu.org Thu Jun 24 10:12:55 2010 From: jao at gnu.org (Jose A. Ortega Ruiz) Date: Thu, 24 Jun 2010 16:12:55 +0200 Subject: [racket] How can I save all the definitions in racket to a file? In-Reply-To: (Sam Tobin-Hochstadt's message of "Thu, 24 Jun 2010 09:48:16 -0400") References: <876318ei5o.fsf@newton.homeunix.net> Message-ID: <87pqzgcye0.fsf@newton.homeunix.net> On Thu, Jun 24 2010, Sam Tobin-Hochstadt wrote: > To quote from Jose's documentation: > > "I?ve concentrated initially in supporting those Schemes with the > richest (to my knowledge) introspection capabilities, namely, Guile > and Racket." > > I assume it's running mostly elisp underneath. :) No, not really :). The stress is in doing everything that is possible in the scheme side. When Racket doesn't provide metadata i need (e.g. procedure arg names), i obtain it by means of racket code, rather than by 'source scrapping' in elisp. Emacs is just handling the presentation layer, i.e., the logic that does not depend on the scheme implementation. So all the interesting bits are computed by (modules implemented in) Racket (and that's why Geiser needs a pretty smart scheme implementation underneah to be really useful). As further examples, an Emacs interface to the macro stepper is already in my TODO list, and if some day Racket offers a way to introspect on contracts or types (meaning the ability to manipulate them as values), i'll rush to offer them in Geiser documentation windows. All that said, there's still a lot of elisp code in Geiser :) Cheers, jao From nowgate at yahoo.com Thu Jun 24 11:01:22 2010 From: nowgate at yahoo.com (michael rice) Date: Thu, 24 Jun 2010 08:01:22 -0700 (PDT) Subject: [racket] Need a namespace Message-ID: <871790.83869.qm@web31105.mail.mud.yahoo.com> How do I make an empty namespace in DrScheme? This doesn't seem to work: #lang scheme (define ns (make-base-namespace)) Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From noelwelsh at gmail.com Thu Jun 24 11:05:31 2010 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu, 24 Jun 2010 16:05:31 +0100 Subject: [racket] Need a namespace In-Reply-To: <871790.83869.qm@web31105.mail.mud.yahoo.com> References: <871790.83869.qm@web31105.mail.mud.yahoo.com> Message-ID: It works for me... N. On Thu, Jun 24, 2010 at 4:01 PM, michael rice wrote: > > How do I make an empty namespace in DrScheme? > > This doesn't seem to work: > > #lang scheme > > (define ns (make-base-namespace)) > > > Michael From matthias at ccs.neu.edu Thu Jun 24 11:06:08 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu, 24 Jun 2010 11:06:08 -0400 Subject: [racket] DrRacket, Emacs, REPL [was: Sending s-expr to repl] In-Reply-To: <23A2AB79-9354-4435-8D51-D55A8BC84C02@acm.org> References: <720924.49884.qm@web27006.mail.ukl.yahoo.com> <1F6DC516-714F-45AA-84BE-D8EEF3DA9490@fellowhuman.com> <23A2AB79-9354-4435-8D51-D55A8BC84C02@acm.org> Message-ID: <41474840-7AC1-443D-BD6A-9AED3A15A30B@ccs.neu.edu> Take a look at Dracula, the ACL2 support from DrScheme. It implements exactly that behavior. (You may even wish to take a look at our How to prove curriculum addition to HtDP. We teach freshmen how to prove theorems about graphical games.) Two points about it: 1. in the presence of true effects (not counting infinite loops), this model doesn't really work 2. and it is not a mid-point between the two extremes but a new, third point. What my blog post omits is a research attempt to explore a true midpoint between the two. Before we started the drscheme project in 1995, I worked with Rene Rodriguez and Bruce Duba on a transparent REPL for Emacs. We implemented it and used it with our freshman course for at least two semesters. Here is how it worked: use an ordinary emacs interaction mode control emacs interactions via a dependency analysis if sending an s-expression were to violate a dependency, re-load the entire buffer (or a lot of it) for I/O, we had a separate buffer that could differentiate between committed and preliminary output In the presence of HO and effectful computations, a dependency analysis is of course a conservative approximation. So this is highly approximate but for introductory classes it worked reasonably well. We gave up on this effort because we didn't get this repl to work for experienced users, it didn't really cope well with effects, and the effort had to replicate a lot of the work of the underlying compiler (Chez Scheme) so we had no research benefit. The drscheme project gave us a chance to try an even more radical approach, and I think it has worked well for beginners. To be honest, on and off I do think about a way to accommodate a Lisp-style repl or some flavor of it, but it sure isn't a high priority. -- Matthias On Jun 24, 2010, at 9:11 AM, Nadeem Abdul Hamid wrote: >> See >> http://blog.racket-lang.org/2009/03/drscheme-repl-isnt-lisp.html >> for a detailed answer. >> > > I see what the blog post above is saying, but (I know, "no when no if no but"), has anyone ever used editors for some of the proof assistants, like CoqIDE or ProofGeneral mode in Emacs for Coq? These support a seemingly nice compromise between the two styles. A minor annoyance I have with the DrRacket model of reloading the entire buffer is that if I have several working functions defined at the top of the file, and then a new function I'm working on below that has syntax errors or is in incomplete template form or whatever, running the file generates an error and no definitions at all are loaded into the REPL. So instead, in these proof editors, they have this feature where you can load the buffer up to a certain line/expression (assuming no syntax errors), and everything above there is then in a "locked" (uneditable) mode -- if you edit something, it rolls back the evaluated portion of the file. This way, you can have a bunch of messy/incomplete thoughts typed up at the bo! > ttom of your file, and have all good definitions up to a certain point in your file evaluated so that you can play with the evaluated definitions in the REPL, to help you fill in your unfinished thoughts. I know, this will get messy in the presence of effects (proof languages are purely functional), and probably a lot of work to implement, but something to think about... > > > --- nadeem > > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From nowgate at yahoo.com Thu Jun 24 11:14:19 2010 From: nowgate at yahoo.com (michael rice) Date: Thu, 24 Jun 2010 08:14:19 -0700 (PDT) Subject: [racket] Need a namespace In-Reply-To: Message-ID: <712116.49538.qm@web31107.mail.mud.yahoo.com> I'm getting this: define: not allowed in an expression context in: (define ns (make-base-namespace)) > Maybe it's my language setting, R5RS? Also, I'm using v 4.1.2 on Fedora 13. Michael --- On Thu, 6/24/10, Noel Welsh wrote: From: Noel Welsh Subject: Re: [racket] Need a namespace To: "michael rice" Cc: users at racket-lang.org Date: Thursday, June 24, 2010, 11:05 AM It works for me... N. On Thu, Jun 24, 2010 at 4:01 PM, michael rice wrote: > > How do I make an empty namespace in DrScheme? > > This doesn't seem to work: > > #lang scheme > > (define ns (make-base-namespace)) > > > Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From noelwelsh at gmail.com Thu Jun 24 11:27:35 2010 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu, 24 Jun 2010 16:27:35 +0100 Subject: [racket] Need a namespace In-Reply-To: <712116.49538.qm@web31107.mail.mud.yahoo.com> References: <712116.49538.qm@web31107.mail.mud.yahoo.com> Message-ID: You're using a define in a place where you aren't allowed to put a define. E.g., this will work: (define foo 1) This won't work: (define bar (define foo 1) foo) N. From nowgate at yahoo.com Thu Jun 24 11:44:34 2010 From: nowgate at yahoo.com (michael rice) Date: Thu, 24 Jun 2010 08:44:34 -0700 (PDT) Subject: [racket] Need a namespace In-Reply-To: Message-ID: <834258.9798.qm@web31105.mail.mud.yahoo.com> Are my docs incorrect or out outdated? Michael =================== From: file:///usr/share/plt/doc/guide/eval.html#%28tech._current._namespace%29 #lang scheme ? ? (eval '(cons 1 2)) This fails because the initial current namespace is empty. When you run mzscheme in interactive mode (see Interactive Mode), the initial namespace is initialized with the exports of the scheme module, but when you run a module directly, the initial namespace starts empty. In general, it?s a bad idea to use eval with whatever namespace happens to be installed. Instead, create a namespace explicitly and install it for the call to eval: ? #lang scheme ? ? (define ns (make-base-namespace)) ? (eval '(cons 1 2) ns) ; works --- On Thu, 6/24/10, Noel Welsh wrote: From: Noel Welsh Subject: Re: [racket] Need a namespace To: "michael rice" Cc: users at racket-lang.org Date: Thursday, June 24, 2010, 11:27 AM You're using a define in a place where you aren't allowed to put a define. E.g., this will work: (define foo 1) This won't work: (define bar (define foo 1) foo) N. -------------- next part -------------- An HTML attachment was scrubbed... URL: From noelwelsh at gmail.com Thu Jun 24 11:47:52 2010 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu, 24 Jun 2010 16:47:52 +0100 Subject: [racket] Need a namespace In-Reply-To: <834258.9798.qm@web31105.mail.mud.yahoo.com> References: <834258.9798.qm@web31105.mail.mud.yahoo.com> Message-ID: Nope, it works as documented. Trying changing the language then, from R5RS to Module. (But I don't see how you can get that error with the given program, so I suspect something else is going on.) HTH, N. On Thu, Jun 24, 2010 at 4:44 PM, michael rice wrote: > > Are my docs incorrect or out outdated? > > Michael From nowgate at yahoo.com Thu Jun 24 11:53:39 2010 From: nowgate at yahoo.com (michael rice) Date: Thu, 24 Jun 2010 08:53:39 -0700 (PDT) Subject: [racket] Need a namespace In-Reply-To: Message-ID: <17136.98587.qm@web31106.mail.mud.yahoo.com> That fixed it. Thanks, Michael --- On Thu, 6/24/10, Noel Welsh wrote: From: Noel Welsh Subject: Re: [racket] Need a namespace To: "michael rice" Cc: users at racket-lang.org Date: Thursday, June 24, 2010, 11:47 AM Nope, it works as documented. Trying changing the language then, from R5RS to Module. (But I don't see how you can get that error with the given program, so I suspect something else is going on.) HTH, N. On Thu, Jun 24, 2010 at 4:44 PM, michael rice wrote: > > Are my docs incorrect or out outdated? > > Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From eli at barzilay.org Thu Jun 24 12:16:06 2010 From: eli at barzilay.org (Eli Barzilay) Date: Thu, 24 Jun 2010 12:16:06 -0400 Subject: [racket] View HTML source code in racket In-Reply-To: References: Message-ID: <19491.33990.766097.240719@winooski.ccs.neu.edu> On Jun 23, Greg Hendershott wrote: > > (define (find-elements xexpr tag-name) > ;; Given an x-expression return a list of all the elements starting > with tag-name. > (if (empty? xexpr) > '() > (let ([x (first xexpr)]) > (if (and (list? x) (not (empty? x))) > (if (and (symbol? (first x)) (symbol=? (first x) tag-name)) > (append (list x) ; found one! > (find-elements x tag-name) ; drill down > (find-elements (rest xexpr) tag-name)) ; iterate across > (append (find-elements x tag-name) ; drill down > (find-elements (rest xexpr) tag-name))) ; iterate across > (find-elements (rest xexpr) tag-name))))) ; iterate across `match' is more convenient for such things: (define (find-links xexpr) (match xexpr [(list 'a _ ...) (list xexpr)] [(list xs ...) (append* (map find-links xs))] [_ '()])) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From kwinterling at gmail.com Thu Jun 24 13:08:35 2010 From: kwinterling at gmail.com (Karl Winterling) Date: Thu, 24 Jun 2010 10:08:35 -0700 Subject: [racket] Sending s-expr to repl In-Reply-To: <1F6DC516-714F-45AA-84BE-D8EEF3DA9490@fellowhuman.com> References: <720924.49884.qm@web27006.mail.ukl.yahoo.com> <1F6DC516-714F-45AA-84BE-D8EEF3DA9490@fellowhuman.com> Message-ID: Copy the definition, paste it into the REPL, and press return. Otherwise subx: if (bac >= 0.15) exit(-1); else { drink_beer(); hit_head_with_brick(&SELF); goto subx; } On Thu, Jun 24, 2010 at 12:34 AM, Jordan Johnson wrote: > See > ?http://blog.racket-lang.org/2009/03/drscheme-repl-isnt-lisp.html > for a detailed answer. > > Best, > Jordan > > > On Jun 24, 2010, at 12:12 AM, Mark Carter wrote: > >> Scheme newbie here. I've always had a bee in my bonnet for the Lispy >> languages, but had never gotten into them fully for one reason or another. >> I've been playing with DrRacket, and have been able to plot graphs using it. >> Way cool! >> >> Anyway, my actual question is: using DrRacket, is there a way of sending >> the s-expr at the cursor to the repl, a la emacs? I think that would be a >> very nice feature. >> >> >> >> >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://lists.racket-lang.org/listinfo/users > > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > From rafkind at cs.utah.edu Thu Jun 24 13:53:10 2010 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Thu, 24 Jun 2010 11:53:10 -0600 Subject: [racket] How can I save all the definitions in racket to a file? In-Reply-To: References: Message-ID: <4C239B86.4060002@cs.utah.edu> On 06/24/2010 04:03 AM, Insik Cho wrote: > Hi buddies, > > I like a normal shell interactive environment. > > After I'm working in console 'racket,' I don't want to lose all the > definitions I have made. > > How can I save the definitions to an external file, i.e., 'xxx.ss'? > > Thanks in advance. > > - Joe > > I hacked this together. Its a start but it needs some work. #lang racket (require (for-syntax syntax/parse racket/pretty)) (define-for-syntax (save-it foo) (with-output-to-file "definitions.rkt" #:exists 'append (lambda () (pretty-print (syntax->datum foo))))) (provide (except-out (all-from-out racket) #%top-interaction)) (provide (rename-out (my-top #%top-interaction))) (define-syntax (my-top stx) (syntax-parse stx [(_ . foo) (save-it #'foo) #'(#%top-interaction . foo)])) Ok so what to do with this code: put it in some place like ~/lib/top/main.rkt. When you run racket you will use this file as your top-level instead of the normal top-level. To get a new top-level use the -I switch. You also need to tell racket where to find this file using the -S switch. $ racket -S /home/user/lib -I top (note: you have to use an absolute path. there is a bug that is being fixed to use relative paths) Each time you enter something in the repl it will be saved to "definitions.rkt". An annoying issue with this top level is it saves a bunch of extra stuff that racket loads, but you can just ignore that for now. $ racket -S `pwd`/lib -I top -> 1 1 -> 2 2 -> 3 3 -> (define (foo x) (+ 1 2 x)) -> (x 5) reference to undefined identifier: x === context === /home/jon/bin/plt/collects/racket/private/misc.rkt:74:7 -> (foo 5) 8 $ cat definitions.rkt 1 2 3 '(define (foo x) (+ 1 2 x)) '(x 5) '(foo 5) From matthias at ccs.neu.edu Thu Jun 24 14:03:55 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu, 24 Jun 2010 14:03:55 -0400 Subject: [racket] tennis and programming, not completely off-topic Message-ID: <994E93CB-8ED3-4BAF-B812-37898B4D5BAE@ccs.neu.edu> Quote FAZ: > Vier Matchb?lle hatte Isner in der Partie vergeben, einen bei 10:9, zwei bei 33:32 und einen bei 59:58, Mahut wehrte alle ab. Bei 47:47 fiel die elektronische Anzeigetafel aus, weil so ein Spielstand nicht vorgesehen ist, im Internet war der Score auch nicht mehr zu verfolgen. I don't really care about tennis but this headline caught my attention because it is connected to CS, just like my rare post-Christmas shopping experiences in 2000. Two guys played some long tennis match. 3 days to be precise. The score in the fifth set got to 47:47. At that point the electronic board quit because ... you guessed it ... it wasn't prepared to display such scores. A bit later the sites internet ticker also quit. Same reason. I have no clue what the number 48 does to computer scientists. I would have understood 64 perhaps, but the game went even beyond that. In 2000 I went shopping with my wife (extremely rare at that point in my life) in the Houston Galleria. At the check out I watched a MX family buy two carts full of tree ornaments. After getting about halfway thru the first one, the checkout girl asked the family to pay the intermediate bill -- because the register wasn't program to keep track of more than 50 items per bill. Only partly amusing -- Matthias From raould at gmail.com Thu Jun 24 14:09:58 2010 From: raould at gmail.com (Raoul Duke) Date: Thu, 24 Jun 2010 11:09:58 -0700 Subject: [racket] tennis and programming, not completely off-topic In-Reply-To: <994E93CB-8ED3-4BAF-B812-37898B4D5BAE@ccs.neu.edu> References: <994E93CB-8ED3-4BAF-B812-37898B4D5BAE@ccs.neu.edu> Message-ID: On Thu, Jun 24, 2010 at 11:03 AM, Matthias Felleisen wrote: A bit later the sites internet ticker also quit. Same reason. I have no clue what the number 48 does to computer scientists. I would have understood 64 perhaps, but the game went even beyond that. for that kind of fun, i love/hate reading comp.risks :-) From barry at cs.sierracollege.edu Thu Jun 24 14:54:41 2010 From: barry at cs.sierracollege.edu (Barry Brown) Date: Thu, 24 Jun 2010 11:54:41 -0700 Subject: [racket] tennis and programming, not completely off-topic In-Reply-To: <994E93CB-8ED3-4BAF-B812-37898B4D5BAE@ccs.neu.edu> References: <994E93CB-8ED3-4BAF-B812-37898B4D5BAE@ccs.neu.edu> Message-ID: Here's a link to a NY Times blog entry about the match in question: http://straightsets.blogs.nytimes.com/2010/06/23/logistics-are-put-to-the-test-at-wimbledon/ One commenter pointed out that 48 in binary is 110000. More likely, those boards may be pretty old and the score is encoded in BCD, so 48 would be represented as 0100 1000. My question is: why were there IBM programmers at the match? -B On Jun 24, 2010, at 11:03 AM, Matthias Felleisen wrote: > > Two guys played some long tennis match. 3 days to be precise. The score in the fifth set got to 47:47. At that point the electronic board quit because ... you guessed it ... it wasn't prepared to display such scores. A bit later the sites internet ticker also quit. Same reason. I have no clue what the number 48 does to computer scientists. I would have understood 64 perhaps, but the game went even beyond that. > > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From neil at neilvandyke.org Thu Jun 24 15:18:14 2010 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu, 24 Jun 2010 15:18:14 -0400 Subject: [racket] tennis and programming, not completely off-topic In-Reply-To: References: <994E93CB-8ED3-4BAF-B812-37898B4D5BAE@ccs.neu.edu> Message-ID: <4C23AF76.1030203@neilvandyke.org> Barry Brown wrote at 06/24/2010 02:54 PM: > My question is: why were there IBM programmers at the match? They might've been systems engineers. Or system operators. I would guess that standard operating procedure was that they be there, ostensibly to make sure the systems work for the big event, even if something goes wrong. However, though they might've had spare parts ready to be swapped in, and such, apparently they couldn't handle this particular failure in a timely fashion. -- http://www.neilvandyke.org/ From iminsik at gmail.com Thu Jun 24 20:09:52 2010 From: iminsik at gmail.com (Insik Cho) Date: Thu, 24 Jun 2010 17:09:52 -0700 Subject: [racket] Can I refer a member variable of a structure instance as a reference? Message-ID: Hi buddies, When I make an instance of a structure, I want to modify of the value of members of the instance. So, can I refer a member of a structure as a referent to update it directly? - Joe -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.mccarthy at gmail.com Thu Jun 24 20:22:39 2010 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu, 24 Jun 2010 18:22:39 -0600 Subject: [racket] Can I refer a member variable of a structure instance as a reference? In-Reply-To: References: Message-ID: I have a very hard time parsing this question but you may be interested in using struct-copy. Jay On Thu, Jun 24, 2010 at 6:09 PM, Insik Cho wrote: > Hi buddies, > When I make an instance of a structure, I want to modify of the value of > members of the instance. > So, can I refer a member of a structure as a referent to update it directly? > - Joe > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > -- 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 Thu Jun 24 20:24:46 2010 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Thu, 24 Jun 2010 18:24:46 -0600 Subject: [racket] Can I refer a member variable of a structure instance as a reference? In-Reply-To: References: Message-ID: <4C23F74E.2070505@cs.utah.edu> #lang racket (define-struct foo (x y) #:mutable) (define foo-instance (make-foo 1 2)) (set-foo-x! foo-instance 5) (foo-x foo-instance) On 06/24/2010 06:09 PM, Insik Cho wrote: > Hi buddies, > > When I make an instance of a structure, I want to modify of the value of > members of the instance. > > So, can I refer a member of a structure as a referent to update it directly? > > - Joe > > > > > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users -------------- next part -------------- An HTML attachment was scrubbed... URL: From iminsik at gmail.com Thu Jun 24 20:39:47 2010 From: iminsik at gmail.com (Insik Cho) Date: Thu, 24 Jun 2010 17:39:47 -0700 Subject: [racket] Can I refer a member variable of a structure instance as a reference? In-Reply-To: <4C23F74E.2070505@cs.utah.edu> References: <4C23F74E.2070505@cs.utah.edu> Message-ID: It works well. Thanks! - Joe On Thu, Jun 24, 2010 at 5:24 PM, Jon Rafkind wrote: > #lang racket > > (define-struct foo (x y) #:mutable) > (define foo-instance (make-foo 1 2)) > (set-foo-x! foo-instance 5) > (foo-x foo-instance) > > > On 06/24/2010 06:09 PM, Insik Cho wrote: > > Hi buddies, > > When I make an instance of a structure, I want to modify of the value of > members of the instance. > > So, can I refer a member of a structure as a referent to update it directly? > > - Joe > > > > > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From valery at digitalchile.net Fri Jun 25 05:08:14 2010 From: valery at digitalchile.net (Valeriya Pudova) Date: Fri, 25 Jun 2010 13:08:14 +0400 Subject: [racket] Metaprogramming with scheme In-Reply-To: References: <4C218FFB.7010408@digitalchile.net> <4C21F239.5040301@digitalchile.net> <4C2201A0.5090903@digitalchile.net> Message-ID: <4C2471FE.6050706@digitalchile.net> > I suppose the errortrace library might give you more location > information. I have never used it so I can't say much more than read > the docs and/or hope someone else replies. > > HTH, > N. > The errortrace library is good but for development time not for this case. Also it does not tell error location for each function anyway. Probably because continuation created not for each function. But I found another interesting thing. The error message in DrRake and command line rake are different (I did not know that). And rake's messages more informative. That is good news for me. From valery at digitalchile.net Fri Jun 25 05:21:31 2010 From: valery at digitalchile.net (Valeriya Pudova) Date: Fri, 25 Jun 2010 13:21:31 +0400 Subject: [racket] Metaprogramming with scheme In-Reply-To: <4C2471FE.6050706@digitalchile.net> References: <4C218FFB.7010408@digitalchile.net> <4C21F239.5040301@digitalchile.net> <4C2201A0.5090903@digitalchile.net> <4C2471FE.6050706@digitalchile.net> Message-ID: <4C24751B.4060305@digitalchile.net> > The errortrace library is good but for development time not for this > case. Also it does not tell error location for each function anyway. > Probably because continuation created not for each function. > > But I found another interesting thing. The error message in DrRake and > command line rake are different (I did not know that). And rake's > messages more informative. That is good news for me. In the any case the errortrace display more info. From mflatt at cs.utah.edu Fri Jun 25 10:14:27 2010 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Fri, 25 Jun 2010 08:14:27 -0600 Subject: [racket] Calling collect-garbage does not work during a FFI call? In-Reply-To: References: Message-ID: <20100625141429.B96556500CB@mail-svr1.cs.utah.edu> Garbage collection is not disabled during an FFI call. In fact, it's difficult or impossible to disable GC at all. Finalizers registered with `register-finalizer', however, run in a separate Racket thread. So there's no particular guarantee that finalizers will run before a `collect-garbage' call returns. You might find that inserting a `sleep' call right after `collect-garbage' causes some of your finalizers to run. That doesn't seem like a great solution, though, and it may create other trouble if multiple Racket threads try to use BDD functions or kill off a thread using a BDD function. Another possibility is to use the lower-level functions provided in the C API, such as scheme_add_finalizer(). (If you register a Racket-implemented function that way, be sure to make it atomic, so that Racket-level threads do no swap during the call to the finalizer.) At Sun, 20 Jun 2010 09:41:38 -0400, Nick wrote: > Hi, > > I'm using MzScheme v4.2.4, and I'm trying to use the CUDD Binary > Decision Diagram (BDD) library, which is implemented in C. CUDD > manages all the BDDs with reference counting and its own garbage > collector. In my scheme code I would like to have all the reference > counting automated. What I did is have the functions create new BDDs > to automatically increment the reference counts, and then use > register-finalizer to decrement the reference count. I understand how > to do all this, and it works. > > The problem is that I need to sync up the CUDD garbage collector and > the Scheme garbage collector. I want the Scheme garbage collector to > be called right before the CUDD garbage collector is called, so that > when BDD nodes are unreachable by Scheme, their reference counts go to > 0, and CUDD can collect them. CUDD provides a hook to have a function > called right before garbage collection occurs, so I thought this > should be simple. The problem is that the collect-garbage calls in the > hook appear to do nothing. None of the finalizers are called when I > rely on the hook, but if I explicitly call collect-garbage, then the > finalizers are called. > > I know the finalizers are called because I print a message in them, > and I know the hook function is being called, because I print out a > message in the hook function. I cannot just call collect-garbage > myself, because the CUDD garbage collection is called by the package > itself at unknown times. Operations internal to the package can cause > a garbage collection at any time. I have tried to call > scheme_collect_garbage from C, in a hook function implemented in C. > And, I have implemented the hook in scheme, and had passed the > function to the C procedure that registers the hook. For both methods, > the hook is called, and collect-garbage doesn't work. > > Is garbage collection disabled or something during a FFI call? Is > there another solution? > > Thanks, > Nick > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From webmaster at ostgardr.org Fri Jun 25 11:12:53 2010 From: webmaster at ostgardr.org (Stephen Bloch) Date: Fri, 25 Jun 2010 11:12:53 -0400 Subject: [racket] confusing graphics primitives in 2htdp/image Message-ID: There are a whole lot of graphics operations in 2htdp/image, and many of them come in pairs: overlay/xy and place-image, add-line and scene +line, add-curve and scene+curve, etc. that differ mainly in whether or not they crop the result to the bounding box of one of the images. (They sometimes differ in how they interpret coordinates -- whether measured from the center or the top-left of one of the images.) Since the disappearance of pinholes, the "scene" datatype doesn't serve much purpose any more. Would it make sense to use a consistent and compositional naming scheme, e.g. add-line/crop, add- curve/crop, etc? Stephen Bloch sbloch at adelphi.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: From flaviostz at gmail.com Fri Jun 25 11:19:00 2010 From: flaviostz at gmail.com (Flavio Souza) Date: Fri, 25 Jun 2010 15:19:00 +0000 (UTC) Subject: [racket] Using Racket version 5.0 with ubuntu 10.04 Message-ID: Hi, I am a new user and I d like to use Racket 5.0 with ubuntu 10.04. How can I install it? Regards, Flavio From mflatt at cs.utah.edu Fri Jun 25 13:10:01 2010 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Fri, 25 Jun 2010 11:10:01 -0600 Subject: [racket] segmentation fault while compiling mzscheme 4.2.5 on Xen environment In-Reply-To: References: Message-ID: <20100625171002.0649465010F@mail-svr1.cs.utah.edu> At Fri, 18 Jun 2010 15:10:46 -0400, Danny Yoo wrote: > I'm seeing the following error when trying to install mzscheme on a > Xen-hosted virtual environment. As far as I can tell, the problem is some issue with Xen and thread-local variables at the OS level. The crash happens on the last instruction in the following sequence: 0x080c3080 : push %ebp 0x080c3081 : mov %esp,%ebp 0x080c3083 : push %edi 0x080c3084 : push %esi 0x080c3085 : push %ebx 0x080c3086 : sub $0xc,%esp 0x080c3089 : mov 0x8(%ebp),%eax 0x080c308c : mov 0x81ec174,%ebx 0x080c3092 : mov 0x9c(%eax),%edi 0x080c3098 : mov %gs:0x2d8(%ebx),%eax 0x080c309f : test %eax,%eax 0x080c30a1 : je 0x80c30f8 0x080c30a3 : lea 0xd(%eax),%edx 0x080c30a6 : mov %gs:0x0,%esi 0x080c30ad : mov %edx,%eax 0x080c30af : shl $0x4,%eax 0x080c30b2 : mov %gs:0xc(%eax,%ebx,1),%ecx That instruction is the access stack_cache_stack[stack_cache_stack_pos].stack_frame where both `stack_cache_stack' and `stack_cache_stack_pos' are thread-local variables. Accessing the former works fine (earlier in the sequence above), and it produces the right value. So it makes no sense that accessing from a statically-allocated array would fail. Google turns up Xen-related advice about changing "/lib/tls" to "/lib/tls.disabled", other pages about how you shouldn't have to do that anymore, and so on. For now, I don't have any explanation for the behavior that you're seeing other than the possibility that something about thread-local storage doesn't work right at the Xen/OS level. Advice from anyone who knows more would be welcome. Meanwhile, configure with `--disable-futures' to disable the use of thread-local variables in the run-time system, and then the build seems to work ok. From rafkind at cs.utah.edu Fri Jun 25 13:36:00 2010 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Fri, 25 Jun 2010 11:36:00 -0600 Subject: [racket] Using Racket version 5.0 with ubuntu 10.04 In-Reply-To: References: Message-ID: <4C24E900.6050301@cs.utah.edu> You can use the installer for ubuntu jaunty, other users claim it works fine with 10.04. There is a minor glitch with the installer about an extra README file which you will have to manually delete during the installer. Or you can get the source and build it which is usually painless. http://racket-lang.org/download/ On 06/25/2010 09:19 AM, Flavio Souza wrote: > Hi, > > I am a new user and I d like to use Racket 5.0 with ubuntu 10.04. > > How can I install it? > > Regards, > > Flavio > > > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From rafkind at cs.utah.edu Fri Jun 25 13:45:30 2010 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Fri, 25 Jun 2010 11:45:30 -0600 Subject: [racket] segmentation fault while compiling mzscheme 4.2.5 on Xen environment In-Reply-To: <20100625171002.0649465010F@mail-svr1.cs.utah.edu> References: <20100625171002.0649465010F@mail-svr1.cs.utah.edu> Message-ID: <4C24EB3A.1000605@cs.utah.edu> > Google turns up Xen-related advice about changing "/lib/tls" to > "/lib/tls.disabled", other pages about how you shouldn't have to do > that anymore, and so on. For now, I don't have any explanation for the > behavior that you're seeing other than the possibility that something > about thread-local storage doesn't work right at the Xen/OS level. > Advice from anyone who knows more would be welcome. > Supposedly using a xen friendly glibc works better for TLS. http://wiki.xensource.com/xenwiki/XenSpecificGlibc From a2alt at ya.ru Fri Jun 25 13:59:51 2010 From: a2alt at ya.ru (Groshev Dmitry) Date: Fri, 25 Jun 2010 21:59:51 +0400 Subject: [racket] Y-combinator perfomance Message-ID: <6971277488792@web51.yandex.ru> Here is the code: #lang racket (define-syntax U (syntax-rules () [(_ f) (f f)])) (define-syntax define/comb (syntax-rules () [(_ comb name (arg . args) f) (define name (comb (? (name) (? (arg . args) f))))])) (define (Z f) (U (? (g) (? x (apply (f (U g)) x))))) (define/comb Z comb-sum (l t) (if (empty? l) t (sum (rest l) (+ t (first l))))) (define (sum l t) (if (empty? l) t (sum (rest l) (+ t (first l))))) (time (comb-sum (make-list 10000000 1) 0)) (time (sum (make-list 10000000 1) 0)) Here is the result: cpu time: 4664 real time: 4656 gc time: 2278 10000000 cpu time: 3276 real time: 3326 gc time: 1014 10000000 Why so much overhead? Is there any way to avoid it without missing the combinator's power? From neil at neilvandyke.org Fri Jun 25 14:03:37 2010 From: neil at neilvandyke.org (Neil Van Dyke) Date: Fri, 25 Jun 2010 14:03:37 -0400 Subject: [racket] segmentation fault while compiling mzscheme 4.2.5 on Xen environment In-Reply-To: References: Message-ID: <4C24EF79.60102@neilvandyke.org> FWIW, it built and ran fine for me recently under (IIRC) CentOS 5.3 x86 32-bit under XenServer 5.5. BTW, this is not an endorsement of Xen, and I recommend KVM over Xen for most techie purposes. If you are able to switch to KVM, you might be able to do so with less effort than debugging this particular instance of Xen pain. -- http://www.neilvandyke.org/ From a2alt at ya.ru Fri Jun 25 14:07:31 2010 From: a2alt at ya.ru (Groshev Dmitry) Date: Fri, 25 Jun 2010 22:07:31 +0400 Subject: [racket] Y-combinator perfomance Message-ID: <8261277489251@web43.yandex.ru> I've mistyped. In fact things are even worse. #lang racket (define-syntax U (syntax-rules () [(_ f) (f f)])) (define-syntax define/comb (syntax-rules () [(_ comb name (arg . args) f) (define name (comb (? (name) (? (arg . args) f))))])) (define (Z f) (U (? (g) (? x (apply (f (U g)) x))))) (define/comb Z comb-sum (l t) (if (empty? l) t (comb-sum (rest l) (+ t (first l))))) (define (sum l t) (if (empty? l) t (sum (rest l) (+ t (first l))))) (time (comb-sum (make-list 10000000 1) 0)) (time (sum (make-list 10000000 1) 0)) Result: cpu time: 9922 real time: 10007 gc time: 3323 10000000 cpu time: 2762 real time: 2783 gc time: 469 10000000 From matthias at ccs.neu.edu Fri Jun 25 14:11:03 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Fri, 25 Jun 2010 14:11:03 -0400 Subject: [racket] confusing graphics primitives in 2htdp/image In-Reply-To: References: Message-ID: <2F6A85BA-E953-4834-9975-00B163910C6E@ccs.neu.edu> The names were chosen for backwards compatibility. -- Matthias On Jun 25, 2010, at 11:12 AM, Stephen Bloch wrote: > There are a whole lot of graphics operations in 2htdp/image, and many of them come in pairs: overlay/xy and place-image, add-line and scene+line, add-curve and scene+curve, etc. that differ mainly in whether or not they crop the result to the bounding box of one of the images. (They sometimes differ in how they interpret coordinates -- whether measured from the center or the top-left of one of the images.) Since the disappearance of pinholes, the "scene" datatype doesn't serve much purpose any more. Would it make sense to use a consistent and compositional naming scheme, e.g. add-line/crop, add-curve/crop, etc? > > Stephen Bloch > sbloch at adelphi.edu > > > > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthias at ccs.neu.edu Fri Jun 25 14:27:30 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Fri, 25 Jun 2010 14:27:30 -0400 Subject: [racket] Y-combinator perfomance In-Reply-To: <8261277489251@web43.yandex.ru> References: <8261277489251@web43.yandex.ru> Message-ID: <252B7C16-F5EB-4ADB-8B10-C35977A78996@ccs.neu.edu> I think you're comparing apples and oranges here. The use of _apply_ should make things a lost slower for comb-sum than for sum. Also, you should collect garbage before you run timed microbenchmarks. Otherwise you might have bad interactions. With that done, I get the following results: > [:~/Desktop] matthias% racket y.rkt > cpu time: 5127 real time: 5427 gc time: 1834 > 10000000 > cpu time: 4289 real time: 4557 gc time: 1369 > 10000000 > [:~/Desktop] matthias% !! > racket y.rkt > cpu time: 5129 real time: 5523 gc time: 1840 > 10000000 > cpu time: 4313 real time: 4658 gc time: 1373 > 10000000 > [:~/Desktop] matthias% !! > racket y.rkt > cpu time: 5113 real time: 5404 gc time: 1835 > 10000000 > cpu time: 4308 real time: 4622 gc time: 1376 > 10000000 As you can see, three runs produce a rough average of a 20% overhead. I think that's a fair price for an applicative vs an imperative recursion. -- Matthias CODE: #lang racket (define-syntax U (syntax-rules () [(_ f) (f f)])) (define-syntax define/comb (syntax-rules () [(_ comb name (arg1 arg2) body) (define name (comb (? (name) (? (arg1 arg2) body))))])) (define (Z f) (U (? (g) (? (x y) ((f (U g)) x y))))) (define/comb Z comb-sum (l t) (if (empty? l) t (comb-sum (rest l) (+ t (first l))))) (define (sum l t) (if (empty? l) t (sum (rest l) (+ t (first l))))) (collect-garbage)(collect-garbage) (time (comb-sum (make-list 10000000 1) 0)) (collect-garbage)(collect-garbage) (time (sum (make-list 10000000 1) 0)) On Jun 25, 2010, at 2:07 PM, Groshev Dmitry wrote: > I've mistyped. In fact things are even worse. > #lang racket > (define-syntax U > (syntax-rules () > [(_ f) (f f)])) > (define-syntax define/comb > (syntax-rules () > [(_ comb name (arg . args) f) > (define name > (comb (? (name) (? (arg . args) f))))])) > > (define (Z f) > (U (? (g) (? x > (apply (f (U g)) x))))) > > (define/comb Z comb-sum (l t) > (if (empty? l) t (comb-sum (rest l) (+ t (first l))))) > > (define (sum l t) > (if (empty? l) t (sum (rest l) (+ t (first l))))) > > (time (comb-sum (make-list 10000000 1) 0)) > (time (sum (make-list 10000000 1) 0)) > Result: > cpu time: 9922 real time: 10007 gc time: 3323 > 10000000 > cpu time: 2762 real time: 2783 gc time: 469 > 10000000 > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From mflatt at cs.utah.edu Fri Jun 25 14:50:34 2010 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Fri, 25 Jun 2010 12:50:34 -0600 Subject: [racket] Y-combinator perfomance In-Reply-To: <8261277489251@web43.yandex.ru> References: <8261277489251@web43.yandex.ru> Message-ID: <20100625185034.EB41C65010F@mail-svr1.cs.utah.edu> If you're interested in specially the overhead of combinator style, then your example still understates the overhead compared to relatively cheap operations. In addition to Matthias's change to get rid of `apply', I've revised your program (see below) to replace `first' and `rest' with `car' and `cdr' (which don't have to check that they're given lists) and to lift out the list creation (which becomes significant). With those changes, I get cpu time: 1655 real time: 1668 gc time: 1546 ; list creation cpu time: 422 real time: 426 gc time: 41 10000000 cpu time: 60 real time: 60 gc time: 0 10000000 The direct version is faster because the compiler can see the loop, so it can produce code with fewer jumps and less allocation of intermediate closures. I suppose that the general rule is that the compiler is more effective when you can use constructs that say more directly what you want. Compilers can't easily see through a Y combinator, and a factor of 8 or so difference is probably typical for Lisp compilers. (I tried Ikarus and Gambit to double check, and performance was about the same as with Racket.) ---------------------------------------- #lang racket (define-syntax U (syntax-rules () [(_ f) (f f)])) (define-syntax define/comb (syntax-rules () [(_ comb name (arg . args) f) (define name (comb (? (name) (? (arg . args) f))))])) (define (Z f) (U (? (g) (? (x y) ((f (U g)) x y))))) (define/comb Z comb-sum (l t) (if (null? l) t (comb-sum (cdr l) (+ t (car l))))) (define (sum l t) (if (null? l) t (sum (cdr l) (+ t (car l))))) (define l (time (make-list 10000000 1))) (time (comb-sum l 0)) (time (sum l 0)) From a2alt at ya.ru Fri Jun 25 14:59:18 2010 From: a2alt at ya.ru (Groshev Dmitry) Date: Fri, 25 Jun 2010 22:59:18 +0400 Subject: [racket] Y-combinator perfomance In-Reply-To: <20100625185034.EB41C65010F@mail-svr1.cs.utah.edu> References: <8261277489251@web43.yandex.ru> <20100625185034.EB41C65010F@mail-svr1.cs.utah.edu> Message-ID: <13281277492358@web79.yandex.ru> Is there any way to avoid this overhead? I'm really interested in combinator style, but if it makes programs 8 times slower, it is useless. Maybe some compiler/macro optimizations is possible? 25.06.10, 22:50, "Matthew Flatt" : > If you're interested in specially the overhead of combinator style, > then your example still understates the overhead compared to relatively > cheap operations. > > In addition to Matthias's change to get rid of `apply', I've revised > your program (see below) to replace `first' and `rest' with `car' and > `cdr' (which don't have to check that they're given lists) and to lift > out the list creation (which becomes significant). With those changes, > I get > > cpu time: 1655 real time: 1668 gc time: 1546 ; list creation > cpu time: 422 real time: 426 gc time: 41 > 10000000 > cpu time: 60 real time: 60 gc time: 0 > 10000000 > > The direct version is faster because the compiler can see the loop, so > it can produce code with fewer jumps and less allocation of > intermediate closures. I suppose that the general rule is that the > compiler is more effective when you can use constructs that say more > directly what you want. > > Compilers can't easily see through a Y combinator, and a factor of 8 or > so difference is probably typical for Lisp compilers. (I tried Ikarus > and Gambit to double check, and performance was about the same as with > Racket.) > > ---------------------------------------- > > #lang racket > (define-syntax U > (syntax-rules () > [(_ f) (f f)])) > (define-syntax define/comb > (syntax-rules () > [(_ comb name (arg . args) f) > (define name > (comb (? (name) (? (arg . args) f))))])) > > (define (Z f) > (U (? (g) (? (x y) > ((f (U g)) x y))))) > > (define/comb Z comb-sum (l t) > (if (null? l) t (comb-sum (cdr l) (+ t (car l))))) > > (define (sum l t) > (if (null? l) t (sum (cdr l) (+ t (car l))))) > > (define l (time (make-list 10000000 1))) > (time (comb-sum l 0)) > (time (sum l 0)) > > > From ryanc at ccs.neu.edu Fri Jun 25 14:58:03 2010 From: ryanc at ccs.neu.edu (Ryan Culpepper) Date: Fri, 25 Jun 2010 12:58:03 -0600 Subject: [racket] Y-combinator perfomance In-Reply-To: <13281277492358@web79.yandex.ru> References: <8261277489251@web43.yandex.ru> <20100625185034.EB41C65010F@mail-svr1.cs.utah.edu> <13281277492358@web79.yandex.ru> Message-ID: <4C24FC3B.5080406@ccs.neu.edu> On 06/25/2010 12:59 PM, Groshev Dmitry wrote: > Is there any way to avoid this overhead? I'm really interested in > combinator style, but if it makes programs 8 times slower, it is > useless. Maybe some compiler/macro optimizations is possible? You might find this version interesting: (define-syntax define/rec (syntax-rules () [(define/rec (name arg ...) body) (define name (let ([actual (? (self arg ...) (let-syntax ([name (syntax-rules () [(name name-arg (... ...)) (self self name-arg (... ...))])]) body))]) (lambda (arg ...) (actual actual arg ...))))])) The (... ...) escapes the ellipses, so they are interpreted as ellipses for the local 'name' macro, not the 'define/rec' macro. (define/rec (rec-sum l t) (if (empty? l) t (rec-sum (cdr l) (+ t (car l))))) Ryan > 25.06.10, 22:50, "Matthew Flatt" : > >> If you're interested in specially the overhead of combinator style, >> then your example still understates the overhead compared to relatively >> cheap operations. >> >> In addition to Matthias's change to get rid of `apply', I've revised >> your program (see below) to replace `first' and `rest' with `car' and >> `cdr' (which don't have to check that they're given lists) and to lift >> out the list creation (which becomes significant). With those changes, >> I get >> >> cpu time: 1655 real time: 1668 gc time: 1546 ; list creation >> cpu time: 422 real time: 426 gc time: 41 >> 10000000 >> cpu time: 60 real time: 60 gc time: 0 >> 10000000 >> >> The direct version is faster because the compiler can see the loop, so >> it can produce code with fewer jumps and less allocation of >> intermediate closures. I suppose that the general rule is that the >> compiler is more effective when you can use constructs that say more >> directly what you want. >> >> Compilers can't easily see through a Y combinator, and a factor of 8 or >> so difference is probably typical for Lisp compilers. (I tried Ikarus >> and Gambit to double check, and performance was about the same as with >> Racket.) >> >> ---------------------------------------- >> >> #lang racket >> (define-syntax U >> (syntax-rules () >> [(_ f) (f f)])) >> (define-syntax define/comb >> (syntax-rules () >> [(_ comb name (arg . args) f) >> (define name >> (comb (? (name) (? (arg . args) f))))])) >> >> (define (Z f) >> (U (? (g) (? (x y) >> ((f (U g)) x y))))) >> >> (define/comb Z comb-sum (l t) >> (if (null? l) t (comb-sum (cdr l) (+ t (car l))))) >> >> (define (sum l t) >> (if (null? l) t (sum (cdr l) (+ t (car l))))) >> >> (define l (time (make-list 10000000 1))) >> (time (comb-sum l 0)) >> (time (sum l 0)) >> >> >> > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From a2alt at ya.ru Fri Jun 25 15:19:29 2010 From: a2alt at ya.ru (Groshev Dmitry) Date: Fri, 25 Jun 2010 23:19:29 +0400 Subject: [racket] Y-combinator perfomance In-Reply-To: <4C24FC3B.5080406@ccs.neu.edu> References: <8261277489251@web43.yandex.ru> <20100625185034.EB41C65010F@mail-svr1.cs.utah.edu> <13281277492358@web79.yandex.ru> <4C24FC3B.5080406@ccs.neu.edu> Message-ID: <19481277493569@web124.yandex.ru> This version misses an explicit combinator passing. Z can be replaced by I, Z-memoize, Z-verbose or any other, this is the point. 25.06.10, 22:58, "Ryan Culpepper" : > On 06/25/2010 12:59 PM, Groshev Dmitry wrote: > > Is there any way to avoid this overhead? I'm really interested in > > combinator style, but if it makes programs 8 times slower, it is > > useless. Maybe some compiler/macro optimizations is possible? > > You might find this version interesting: > > (define-syntax define/rec > (syntax-rules () > [(define/rec (name arg ...) body) > (define name > (let ([actual > (? (self arg ...) > (let-syntax ([name > (syntax-rules () > [(name name-arg (... ...)) > (self self name-arg (... ...))])]) > body))]) > (lambda (arg ...) (actual actual arg ...))))])) > > The (... ...) escapes the ellipses, so they are interpreted as ellipses > for the local 'name' macro, not the 'define/rec' macro. > > (define/rec (rec-sum l t) > (if (empty? l) t (rec-sum (cdr l) (+ t (car l))))) > > Ryan > > > > 25.06.10, 22:50, "Matthew Flatt" : > > > >> If you're interested in specially the overhead of combinator style, > >> then your example still understates the overhead compared to relatively > >> cheap operations. > >> > >> In addition to Matthias's change to get rid of `apply', I've revised > >> your program (see below) to replace `first' and `rest' with `car' and > >> `cdr' (which don't have to check that they're given lists) and to lift > >> out the list creation (which becomes significant). With those changes, > >> I get > >> > >> cpu time: 1655 real time: 1668 gc time: 1546 ; list creation > >> cpu time: 422 real time: 426 gc time: 41 > >> 10000000 > >> cpu time: 60 real time: 60 gc time: 0 > >> 10000000 > >> > >> The direct version is faster because the compiler can see the loop, so > >> it can produce code with fewer jumps and less allocation of > >> intermediate closures. I suppose that the general rule is that the > >> compiler is more effective when you can use constructs that say more > >> directly what you want. > >> > >> Compilers can't easily see through a Y combinator, and a factor of 8 or > >> so difference is probably typical for Lisp compilers. (I tried Ikarus > >> and Gambit to double check, and performance was about the same as with > >> Racket.) > >> > >> ---------------------------------------- > >> > >> #lang racket > >> (define-syntax U > >> (syntax-rules () > >> [(_ f) (f f)])) > >> (define-syntax define/comb > >> (syntax-rules () > >> [(_ comb name (arg . args) f) > >> (define name > >> (comb (? (name) (? (arg . args) f))))])) > >> > >> (define (Z f) > >> (U (? (g) (? (x y) > >> ((f (U g)) x y))))) > >> > >> (define/comb Z comb-sum (l t) > >> (if (null? l) t (comb-sum (cdr l) (+ t (car l))))) > >> > >> (define (sum l t) > >> (if (null? l) t (sum (cdr l) (+ t (car l))))) > >> > >> (define l (time (make-list 10000000 1))) > >> (time (comb-sum l 0)) > >> (time (sum l 0)) > >> > >> > >> > > _________________________________________________ > > For list-related administrative tasks: > > http://lists.racket-lang.org/listinfo/users > > From dyoo at cs.wpi.edu Fri Jun 25 16:22:27 2010 From: dyoo at cs.wpi.edu (Danny Yoo) Date: Fri, 25 Jun 2010 16:22:27 -0400 Subject: [racket] segmentation fault while compiling mzscheme 4.2.5 on Xen environment In-Reply-To: <20100625171002.0649465010F@mail-svr1.cs.utah.edu> References: <20100625171002.0649465010F@mail-svr1.cs.utah.edu> Message-ID: > Meanwhile, configure with `--disable-futures' to disable the use of > thread-local variables in the run-time system, and then the build seems > to work ok. Thank you so much! Yes, this appears to work for me now. From dyoo at cs.wpi.edu Fri Jun 25 16:22:27 2010 From: dyoo at cs.wpi.edu (Danny Yoo) Date: Fri, 25 Jun 2010 16:22:27 -0400 Subject: [racket] segmentation fault while compiling mzscheme 4.2.5 on Xen environment In-Reply-To: <20100625171002.0649465010F@mail-svr1.cs.utah.edu> References: <20100625171002.0649465010F@mail-svr1.cs.utah.edu> Message-ID: > Meanwhile, configure with `--disable-futures' to disable the use of > thread-local variables in the run-time system, and then the build seems > to work ok. Thank you so much! Yes, this appears to work for me now. From engineer at alum.mit.edu Fri Jun 25 19:51:43 2010 From: engineer at alum.mit.edu (Paul Ojanen) Date: Fri, 25 Jun 2010 19:51:43 -0400 Subject: [racket] confusing graphics primitives in 2htdp/image In-Reply-To: References: Message-ID: <64753DEAAA5B4B44B5C9E505D4A9DFF7@ptab> I got the impression from past discussions that pinholes would return. _____ From: users-bounces at racket-lang.org [mailto:users-bounces at racket-lang.org] On Behalf Of Stephen Bloch Sent: Friday, June 25, 2010 11:13 AM To: PLT-Scheme Mailing List Subject: [racket] confusing graphics primitives in 2htdp/image There are a whole lot of graphics operations in 2htdp/image, and many of them come in pairs: overlay/xy and place-image, add-line and scene+line, add-curve and scene+curve, etc. that differ mainly in whether or not they crop the result to the bounding box of one of the images. (They sometimes differ in how they interpret coordinates -- whether measured from the center or the top-left of one of the images.) Since the disappearance of pinholes, the "scene" datatype doesn't serve much purpose any more. Would it make sense to use a consistent and compositional naming scheme, e.g. add-line/crop, add-curve/crop, etc? Stephen Bloch sbloch at adelphi.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: From robby at eecs.northwestern.edu Fri Jun 25 20:42:27 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Fri, 25 Jun 2010 19:42:27 -0500 Subject: [racket] confusing graphics primitives in 2htdp/image In-Reply-To: <64753DEAAA5B4B44B5C9E505D4A9DFF7@ptab> References: <64753DEAAA5B4B44B5C9E505D4A9DFF7@ptab> Message-ID: Pinholes are planned to return, indeed. But they will not return in the way that they once were there. That is, they will be a more advanced feature and will only come in if you explicitly start using them (details forthcoming). Robby On Fri, Jun 25, 2010 at 6:51 PM, Paul Ojanen wrote: > I got the impression from past discussions that pinholes would return. > > > > ________________________________ > > From: users-bounces at racket-lang.org [mailto:users-bounces at racket-lang.org] > On Behalf Of Stephen Bloch > Sent: Friday, June 25, 2010 11:13 AM > To: PLT-Scheme Mailing List > Subject: [racket] confusing graphics primitives in 2htdp/image > > > > There are a whole lot of graphics operations in 2htdp/image, and many of > them come in pairs: overlay/xy and place-image, add-line and scene+line, > add-curve and scene+curve, etc. that differ mainly in whether or not they > crop the result to the bounding box of one of the images. ?(They sometimes > differ in how they interpret coordinates -- whether measured from the center > or the top-left of one of the images.) ?Since the disappearance of pinholes, > the "scene" datatype doesn't serve much purpose any more. ?Would it make > sense to use a consistent and compositional naming scheme, e.g. > add-line/crop, add-curve/crop, etc? > > Stephen Bloch > > sbloch at adelphi.edu > > > > > > > > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > From clements at brinckerhoff.org Fri Jun 25 23:24:14 2010 From: clements at brinckerhoff.org (John Clements) Date: Fri, 25 Jun 2010 20:24:14 -0700 Subject: [racket] Web Application Deployment In-Reply-To: <201006231434.o5NEY463001766@champlain.ccs.neu.edu> References: <201006231434.o5NEY463001766@champlain.ccs.neu.edu> Message-ID: <512AAF2F-E042-4ABE-A4D9-A4F368D83C41@brinckerhoff.org> On Jun 23, 2010, at 7:33 AM, Ken Struys wrote: > Oops forgot the link: http://pandela.com/ FWIW dep't.: Linode ($20/month) sounds better than this (16 GB, 512 MB ram, etc.). John Clements -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4669 bytes Desc: not available URL: From stepnem at gmail.com Sat Jun 26 05:20:22 2010 From: stepnem at gmail.com (=?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?=) Date: Sat, 26 Jun 2010 11:20:22 +0200 Subject: [racket] Y-combinator perfomance In-Reply-To: <252B7C16-F5EB-4ADB-8B10-C35977A78996__44002.4535441355$1277490538$gmane$org@ccs.neu.edu> (Matthias Felleisen's message of "Fri, 25 Jun 2010 14:27:30 -0400") References: <8261277489251@web43.yandex.ru> <252B7C16-F5EB-4ADB-8B10-C35977A78996__44002.4535441355$1277490538$gmane$org@ccs.neu.edu> Message-ID: <87r5juup49.fsf@gmail.com> Matthias Felleisen writes: > CODE: > > #lang racket > > (define-syntax U > (syntax-rules () > [(_ f) (f f)])) > > (define-syntax define/comb > (syntax-rules () > [(_ comb name (arg1 arg2) body) > (define name > (comb (? (name) (? (arg1 arg2) body))))])) > > (define (Z f) > (U (? (g) (? (x y) ((f (U g)) x y))))) > > (define/comb Z comb-sum (l t) > (if (empty? l) t (comb-sum (rest l) (+ t (first l))))) > > (define (sum l t) > (if (empty? l) t (sum (rest l) (+ t (first l))))) > > (collect-garbage)(collect-garbage) > (time (comb-sum (make-list 10000000 1) 0)) > > (collect-garbage)(collect-garbage) > (time (sum (make-list 10000000 1) 0)) Why are the `collect-garbage' calls doubled? ?t?p?n From plt at synx.us.to Sat Jun 26 18:38:49 2010 From: plt at synx.us.to (synx) Date: Sat, 26 Jun 2010 15:38:49 -0700 Subject: [racket] regexp-replace* allows no sub-expressions? Message-ID: <4C268179.1030204@synx.us.to> Okay what. I've long relied on the behavior of regexp-replace* to single out a number of substrings within a big string, and let me mangle those substrings in a programmatic fashion. Example: (regexp-replace* #rx"([a-z]+) ([a-z]+)" "red fox, blue seal. red trout, blue trout!" (lambda (total color what) (cond ((equal? color "red") (string-append what " in socks")) ((equal? what "trout") (string-append color " fish")) (else (string-append color " " what))))) => "fox in socks, blue seal. trout in socks, blue fish!" Recently every program of mine that did that, they all started erroring out on contract errors. I took a look at the code and was shocked to find this in racket/private/string.rkt: (check replacement (sub buf mstart mend)) which effectively becomes (replacement (sub buf mstart mend)). It gives no access to subexpressions, and only matches on the entire pattern. For patterns like #rx"(someheader*)([0-9a-zA-Z]+)(somefooter*)" that's especially nasty, since I need those three fields separate, but there might not be a particular character sequence uniquely separating them. Is there no way to replace all instances of an expression in a string with some combination of its sub-expressions? I really can't use the "\\1 \\2" stuff since I'm replacing stuff that could either be a hex number, a decimal number, or a standard abbreviated name. Was this support removed for a reason, or was it just too much of a hassle to figure out? Is there some other procedure that does this now? From mflatt at cs.utah.edu Sat Jun 26 19:53:18 2010 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Sat, 26 Jun 2010 17:53:18 -0600 Subject: [racket] regexp-replace* allows no sub-expressions? In-Reply-To: <4C268179.1030204@synx.us.to> References: <4C268179.1030204@synx.us.to> Message-ID: <20100626235320.ECC686500C6@mail-svr1.cs.utah.edu> The change was not intentional, and I'll fix it soon. Thanks for the report! At Sat, 26 Jun 2010 15:38:49 -0700, synx wrote: > > Okay what. I've long relied on the behavior of regexp-replace* to single > out a number of substrings within a big string, and let me mangle those > substrings in a programmatic fashion. Example: > > (regexp-replace* > #rx"([a-z]+) ([a-z]+)" "red fox, blue seal. red trout, blue trout!" > (lambda (total color what) > (cond > ((equal? color "red") (string-append what " in socks")) > ((equal? what "trout") (string-append color " fish")) > (else (string-append color " " what))))) > > => "fox in socks, blue seal. trout in socks, blue fish!" > > Recently every program of mine that did that, they all started erroring > out on contract errors. I took a look at the code and was shocked to > find this in racket/private/string.rkt: > (check > replacement > (sub buf mstart mend)) > > which effectively becomes (replacement (sub buf mstart mend)). > > It gives no access to subexpressions, and only matches on the entire > pattern. For patterns like #rx"(someheader*)([0-9a-zA-Z]+)(somefooter*)" > that's especially nasty, since I need those three fields separate, but > there might not be a particular character sequence uniquely separating them. > > Is there no way to replace all instances of an expression in a string > with some combination of its sub-expressions? I really can't use the > "\\1 \\2" stuff since I'm replacing stuff that could either be a hex > number, a decimal number, or a standard abbreviated name. Was this > support removed for a reason, or was it just too much of a hassle to > figure out? Is there some other procedure that does this now? From iminsik at gmail.com Sun Jun 27 00:54:46 2010 From: iminsik at gmail.com (Insik Cho) Date: Sat, 26 Jun 2010 21:54:46 -0700 Subject: [racket] Can I trace calls of a function? Message-ID: Hi buddies, I want to trace calls of a function with (require trace), but it doesn't work. What can I do to trace calls of a function? - Joe -------------- next part -------------- An HTML attachment was scrubbed... URL: From wwall at yandex.ru Sun Jun 27 02:44:36 2010 From: wwall at yandex.ru (=?koi8-r?B?4s/NwsnOIPfBzMXO1MnO?=) Date: Sun, 27 Jun 2010 10:44:36 +0400 Subject: [racket] Example of statfull and stateless web application Message-ID: <122291277621076@web103.yandex.ru> Where i can see example of any stateful and stateless web application? example from docs already see With best regards Bombin Valentin From laurent.orseau at gmail.com Sun Jun 27 07:01:43 2010 From: laurent.orseau at gmail.com (Laurent) Date: Sun, 27 Jun 2010 13:01:43 +0200 Subject: [racket] create-embedding-executable Message-ID: Hi, I'm trying to use `create-embedding-executable' (DrRacket 5.0, WinXP and Vista), with this little module: #lang racket/gui (define f (new frame% [label "Test"])) (send f show #t) But I don't know exactly how to set the arguments to produce the same result as "raco exe --gui", which works fine. Going through the collections I found little help. The best I could do is this: (create-embedding-executable "test.exe" #:modules '((#f "test.rkt")) #:configure-via-first-module? #t #:literal-expression (parameterize ([current-namespace (make-base-namespace)]) (compile `(namespace-require ''test))) #:gracket? #t #:collects-path (current-library-collection-paths) #:verbose? #t ) which effectively creates test.exe, but running the latter fails on: link: namespace mismatch; reference (phase 0) to a module "M:\Program Files\Rack et\collects\errortrace\errortrace-key.rkt" that is not available (phase level 0) ; reference appears in module: 'test in: init-test-coverage === context === test: [running body] loop I have absolutely no clue of what is going on here. Can someone help me with this? Thanks, Laurent -------------- next part -------------- An HTML attachment was scrubbed... URL: From mcturra2000 at yahoo.co.uk Sun Jun 27 07:25:30 2010 From: mcturra2000 at yahoo.co.uk (Mark Carter) Date: Sun, 27 Jun 2010 11:25:30 +0000 (GMT) Subject: [racket] Racket collections Message-ID: <260054.51392.qm@web27002.mail.ukl.yahoo.com> Is thee a way of adding a directory to the 'collects' path, or some other way of specifying where Racket should look for collections? From laurent.orseau at gmail.com Sun Jun 27 07:31:30 2010 From: laurent.orseau at gmail.com (Laurent) Date: Sun, 27 Jun 2010 13:31:30 +0200 Subject: [racket] Racket collections In-Reply-To: <260054.51392.qm@web27002.mail.ukl.yahoo.com> References: <260054.51392.qm@web27002.mail.ukl.yahoo.com> Message-ID: On Sun, Jun 27, 2010 at 13:25, Mark Carter wrote: > Is thee a way of adding a directory to the 'collects' path, or some other > way of specifying where Racket should look for collections? > What you are looking for is in the Language dialog (bottom left button in DrRacket), advanced parameters. Laurent -------------- next part -------------- An HTML attachment was scrubbed... URL: From norman at astro.gla.ac.uk Sun Jun 27 07:54:04 2010 From: norman at astro.gla.ac.uk (Norman Gray) Date: Sun, 27 Jun 2010 12:54:04 +0100 Subject: [racket] Racket collections In-Reply-To: References: <260054.51392.qm@web27002.mail.ukl.yahoo.com> Message-ID: <42F54CA7-EE86-4322-B8D1-487106339E5A@astro.gla.ac.uk> Greetings. On 2010 Jun 27, at 12:31, Laurent wrote: > On Sun, Jun 27, 2010 at 13:25, Mark Carter wrote: > >> Is thee a way of adding a directory to the 'collects' path, or some other >> way of specifying where Racket should look for collections? > > What you are looking for is in the Language dialog (bottom left button in > DrRacket), advanced parameters. Or, if you're talking about the command-line version of Racket, rather than DrRacket, then you can add the extra directories to the PLTCOLLECTS environment variable. See the discussion in section 17.2 of the manual . Norman -- Norman Gray : http://nxg.me.uk From samth at ccs.neu.edu Sun Jun 27 08:35:15 2010 From: samth at ccs.neu.edu (Sam Tobin-Hochstadt) Date: Sun, 27 Jun 2010 08:35:15 -0400 Subject: [racket] Can I trace calls of a function? In-Reply-To: References: Message-ID: #lang racket (require racket/trace) (define (f x) (if (zero? x) "done" (f (sub1 x)))) (trace f) (f 100) On Sun, Jun 27, 2010 at 12:54 AM, Insik Cho wrote: > Hi buddies, > I want to trace calls of a function with (require trace), but it doesn't > work. > What can I do to trace calls of a function? > - Joe > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > -- sam th samth at ccs.neu.edu From laurent.orseau at gmail.com Sun Jun 27 08:40:50 2010 From: laurent.orseau at gmail.com (Laurent) Date: Sun, 27 Jun 2010 14:40:50 +0200 Subject: [racket] Can I trace calls of a function? In-Reply-To: References: Message-ID: On Sun, Jun 27, 2010 at 14:35, Sam Tobin-Hochstadt wrote: > #lang racket > > (require racket/trace) > > (define (f x) > (if (zero? x) "done" (f (sub1 x)))) > > (trace f) > > (f 100) > Is it possible to add this example to the docs? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mflatt at cs.utah.edu Sun Jun 27 09:19:35 2010 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Sun, 27 Jun 2010 07:19:35 -0600 Subject: [racket] create-embedding-executable In-Reply-To: References: Message-ID: <20100627131935.F17D26500BE@mail-svr1.cs.utah.edu> Does your call to `create-embedding-executable' work if you disable debugging in DrRacket or if you run from command-line Racket? I think the problem is that DrRacket configures the compiler to add errortrace-debugging instrumentation and to use ".zo" files that are instrumented, and that is interfering with executable creation. See also http://lists.racket-lang.org/users/archive/2010-May/039505.html Offhand, I'm not sure whether to blame errortrace for failing to set up appropriate dependencies or `create-embedding-executable' for not setting up a separate enough environment when building an executable. We'll have to work on this more. At Sun, 27 Jun 2010 13:01:43 +0200, Laurent wrote: > Hi, > > I'm trying to use `create-embedding-executable' (DrRacket 5.0, WinXP and > Vista), with this little module: > > #lang racket/gui > > (define f (new frame% [label "Test"])) > (send f show #t) > > > But I don't know exactly how to set the arguments to produce the same result > as "raco exe --gui", which works fine. > Going through the collections I found little help. > The best I could do is this: > > (create-embedding-executable > "test.exe" > #:modules '((#f "test.rkt")) > #:configure-via-first-module? #t > #:literal-expression > (parameterize ([current-namespace (make-base-namespace)]) > (compile `(namespace-require ''test))) > #:gracket? #t > #:collects-path (current-library-collection-paths) > #:verbose? #t > ) > > which effectively creates test.exe, but running the latter fails on: > > link: namespace mismatch; reference (phase 0) to a module "M:\Program > Files\Rack > et\collects\errortrace\errortrace-key.rkt" that is not available (phase > level 0) > ; reference appears in module: 'test in: init-test-coverage > > === context === > test: [running body] > loop > > I have absolutely no clue of what is going on here. > Can someone help me with this? > > Thanks, > Laurent > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From laurent.orseau at gmail.com Sun Jun 27 09:40:28 2010 From: laurent.orseau at gmail.com (Laurent) Date: Sun, 27 Jun 2010 15:40:28 +0200 Subject: [racket] create-embedding-executable In-Reply-To: <20100627131935.F17D26500BE@mail-svr1.cs.utah.edu> References: <20100627131935.F17D26500BE@mail-svr1.cs.utah.edu> Message-ID: On Sun, Jun 27, 2010 at 15:19, Matthew Flatt wrote: > Does your call to `create-embedding-executable' work if you disable > debugging in DrRacket or if you run from command-line Racket? > It works, thank you! Maybe it could be a good idea to add an example like this one in the docs, because it took quite some time to find out (but not really understand) that one. > > I think the problem is that DrRacket configures the compiler to add > errortrace-debugging instrumentation and to use ".zo" files that are > instrumented, and that is interfering with executable creation. See > also > > http://lists.racket-lang.org/users/archive/2010-May/039505.html > > Offhand, I'm not sure whether to blame errortrace for failing to set up > appropriate dependencies or `create-embedding-executable' for not > setting up a separate enough environment when building an executable. > We'll have to work on this more. > Maybe this is stupid, but could it be possible to disable debugging dynamically to parameterize the call to `create-embedding-executable' ? > > At Sun, 27 Jun 2010 13:01:43 +0200, Laurent wrote: > > Hi, > > > > I'm trying to use `create-embedding-executable' (DrRacket 5.0, WinXP and > > Vista), with this little module: > > > > #lang racket/gui > > > > (define f (new frame% [label "Test"])) > > (send f show #t) > > > > > > But I don't know exactly how to set the arguments to produce the same > result > > as "raco exe --gui", which works fine. > > Going through the collections I found little help. > > The best I could do is this: > > > > (create-embedding-executable > > "test.exe" > > #:modules '((#f "test.rkt")) > > #:configure-via-first-module? #t > > #:literal-expression > > (parameterize ([current-namespace (make-base-namespace)]) > > (compile `(namespace-require ''test))) > > #:gracket? #t > > #:collects-path (current-library-collection-paths) > > #:verbose? #t > > ) > > > > which effectively creates test.exe, but running the latter fails on: > > > > link: namespace mismatch; reference (phase 0) to a module "M:\Program > > Files\Rack > > et\collects\errortrace\errortrace-key.rkt" that is not available (phase > > level 0) > > ; reference appears in module: 'test in: init-test-coverage > > > > === context === > > test: [running body] > > loop > > > > I have absolutely no clue of what is going on here. > > Can someone help me with this? > > > > Thanks, > > Laurent > > _________________________________________________ > > For list-related administrative tasks: > > http://lists.racket-lang.org/listinfo/users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.mccarthy at gmail.com Sun Jun 27 10:04:52 2010 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Sun, 27 Jun 2010 08:04:52 -0600 Subject: [racket] Example of statfull and stateless web application In-Reply-To: <122291277621076@web103.yandex.ru> References: <122291277621076@web103.yandex.ru> Message-ID: There are a few packages on PLaneT that are Web applications, you can look at my github account, and there's the docs (as you mentioned.) What do you feel is lacking in the documentation and its examples that you hope to find elsewhere? (I'd like to know so I can just add something to satisfying your need in the docs themselves.) Jay On Sun, Jun 27, 2010 at 12:44 AM, ?????? ???????? wrote: > Where i can see example of any stateful and stateless web application? > example from docs already see > > > With best regards Bombin Valentin > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From zerosumz at nate.com Sun Jun 27 10:17:08 2010 From: zerosumz at nate.com (=?UTF-8?B?7J6l7Jyg7ZiE?=) Date: Sun, 27 Jun 2010 23:17:08 +0900 Subject: [racket] =?utf-8?q?shp=2Eplt_1=3A2_example_fail=2E=2E?= Message-ID: An HTML attachment was scrubbed... URL: From sean at monkeysnatchbanana.com Sun Jun 27 11:01:40 2010 From: sean at monkeysnatchbanana.com (Sean Allen) Date: Sun, 27 Jun 2010 11:01:40 -0400 Subject: [racket] Example of statfull and stateless web application In-Reply-To: References: <122291277621076@web103.yandex.ru> Message-ID: your github account is? On Sun, Jun 27, 2010 at 10:04 AM, Jay McCarthy wrote: > There are a few packages on PLaneT that are Web applications, you can > look at my github account, and there's the docs (as you mentioned.) > What do you feel is lacking in the documentation and its examples that > you hope to find elsewhere? (I'd like to know so I can just add > something to satisfying your need in the docs themselves.) > > Jay > > On Sun, Jun 27, 2010 at 12:44 AM, ?????? ???????? wrote: >> Where i can see example of any stateful and stateless web application? >> example from docs already see >> >> >> With best regards Bombin Valentin >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://lists.racket-lang.org/listinfo/users >> > > > > -- > 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://lists.racket-lang.org/listinfo/users From jay.mccarthy at gmail.com Sun Jun 27 11:05:59 2010 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Sun, 27 Jun 2010 09:05:59 -0600 Subject: [racket] Example of statfull and stateless web application In-Reply-To: References: <122291277621076@web103.yandex.ru> Message-ID: http://github.com/jeapostrophe/ On Sun, Jun 27, 2010 at 9:01 AM, Sean Allen wrote: > ?your github account is? > > On Sun, Jun 27, 2010 at 10:04 AM, Jay McCarthy wrote: >> There are a few packages on PLaneT that are Web applications, you can >> look at my github account, and there's the docs (as you mentioned.) >> What do you feel is lacking in the documentation and its examples that >> you hope to find elsewhere? (I'd like to know so I can just add >> something to satisfying your need in the docs themselves.) >> >> Jay >> >> On Sun, Jun 27, 2010 at 12:44 AM, ?????? ???????? wrote: >>> Where i can see example of any stateful and stateless web application? >>> example from docs already see >>> >>> >>> With best regards Bombin Valentin >>> _________________________________________________ >>> ?For list-related administrative tasks: >>> ?http://lists.racket-lang.org/listinfo/users >>> >> >> >> >> -- >> 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://lists.racket-lang.org/listinfo/users > -- 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 Sun Jun 27 13:05:10 2010 From: laurent.orseau at gmail.com (Laurent) Date: Sun, 27 Jun 2010 19:05:10 +0200 Subject: [racket] Compilation and additional collections In-Reply-To: References: Message-ID: On Sat, Jun 19, 2010 at 14:42, Laurent wrote: > Hi all, > > I'm trying to compile a project (Racket 5.0, WinXP) into a distribution > with gracket base. > I get the following error message when compiling: > <<< > e:\projets\scheme-svn\towers\towers-gui.ss:3:9: ATHENS/board2: > standard-module-name-resolver: collection not found: "ATHENS" in any of: > (# Data\Racket\5.0\collects> #) in: > ATHENS/board2 > > === context === > standard-module-name-resolver > M:\Program Files\Racket\collects\compiler\embed-unit.rkt:366:4: get-code > M:\Program Files\Racket\collects\racket\private\map.rkt:45:11: for-each > M:\Program Files\Racket\collects\compiler\embed-unit.rkt:765:4: > do-write-module-bundle > >>> > and it refuses to compile. > > The fact is I use an additional personal collection path which contains > ATHENS/board2.ss, and it works correctly when executing the project from > within DrRacket. > > Am I doing things the wrong way? > Answer to myself, if ever this can help someone else: This problem is fixed by using the correct argument to keyword `#:collects-path' for `create-embedded-executable'. But I don't know how to provide multiple collect-paths to "raco exe". -------------- next part -------------- An HTML attachment was scrubbed... URL: From laurent.orseau at gmail.com Sun Jun 27 13:34:02 2010 From: laurent.orseau at gmail.com (Laurent) Date: Sun, 27 Jun 2010 19:34:02 +0200 Subject: [racket] procedure get-compiled-file-sha1: expects 1 argument, given 2 Message-ID: Compilation issue again. As Matthew explained, I turned off debugging, also turned off "preserve stack trace". I executed the code in DrRacket and it works fine. Then I tried in the same interaction (if I am not mistaken): > (require compiler/embed) > (create-embedding-executable "towers.exe" #:modules '((#f "towers-gui.ss")) #:configure-via-first-module? #t #:literal-expression (parameterize ([current-namespace (make-base-namespace)]) (compile `(namespace-require ''towers-gui))) #:gracket? #t #:collects-path (current-library-collection-paths) ) It worked the first time. Then I wanted to add `#:aux '((ico . "img/favicon.ico"))' and it failed with the following error: . . M:\Program Files\Racket\collects\racket\private\promise.rkt:103:10: procedure get-compiled-file-sha1: expects 1 argument, given 2: # # And when I removed the #:aux line, it continued to fail with the same error! I could not consistently reproduce this problem on a smaller test file, so I don't have a clue where this comes from. I even reinstalled DrRacket, but no luck. Also, I tried with command line racket, so I wrote the above code in a #lang racket module. (If executed in DrRacket, it gives the same above error). However, from the command line, I get another error: <<< E:\Projets\Scheme-svn\towers>racket -S E:\Projets\Scheme-svn compile.rkt car: expects argument of type ; given '() === context === M:\Program Files\Racket\collects\compiler\private\winicon.rkt:514:44: loop M:\Program Files\Racket\collects\compiler\private\winicon.rkt:514:44: loop M:\Program Files\Racket\collects\compiler\private\winicon.rkt:514:44: loop M:\Program Files\Racket\collects\compiler\private\winicon.rkt:514:44: loop M:\Program Files\Racket\collects\compiler\private\winicon.rkt:511:32: loop M:\Program Files\Racket\collects\compiler\private\winicon.rkt:511:32: loop M:\Program Files\Racket\collects\compiler\private\winicon.rkt:499:25: get-lines M:\Program Files\Racket\collects\compiler\private\winicon.rkt:488:2: build-dib M:\Program Files\Racket\collects\compiler\private\winicon.rkt:180:21 M:\Program Files\Racket\collects\racket\private\map.rkt:45:11: for-each E:\Projets\Scheme-svn\towers\compile.rkt: [running body] >>> I don't know if these two errors are related. Probably. Anyone has a clue of what is going on here? Thanks, Laurent -------------- next part -------------- An HTML attachment was scrubbed... URL: From laurent.orseau at gmail.com Sun Jun 27 13:44:12 2010 From: laurent.orseau at gmail.com (Laurent) Date: Sun, 27 Jun 2010 19:44:12 +0200 Subject: [racket] procedure get-compiled-file-sha1: expects 1 argument, given 2 In-Reply-To: References: Message-ID: > However, from the command line, I get another error: > <<< > E:\Projets\Scheme-svn\towers>racket -S E:\Projets\Scheme-svn compile.rkt > car: expects argument of type ; given '() > > === context === > M:\Program Files\Racket\collects\compiler\private\winicon.rkt:514:44: loop > M:\Program Files\Racket\collects\compiler\private\winicon.rkt:514:44: loop > M:\Program Files\Racket\collects\compiler\private\winicon.rkt:514:44: loop > M:\Program Files\Racket\collects\compiler\private\winicon.rkt:514:44: loop > M:\Program Files\Racket\collects\compiler\private\winicon.rkt:511:32: loop > M:\Program Files\Racket\collects\compiler\private\winicon.rkt:511:32: loop > M:\Program Files\Racket\collects\compiler\private\winicon.rkt:499:25: > get-lines > M:\Program Files\Racket\collects\compiler\private\winicon.rkt:488:2: > build-dib > M:\Program Files\Racket\collects\compiler\private\winicon.rkt:180:21 > M:\Program Files\Racket\collects\racket\private\map.rkt:45:11: for-each > E:\Projets\Scheme-svn\towers\compile.rkt: [running body] > >>> > > I somehow missed the fact that it talks about "winicon"... By removing (again) the #:aux line, the command line compilation works fine. My bad. But I'd like to know how to compile correctly in DrRacket, if possible (this issue is not solved). And I don't know what is the problem with the icon. It is a 16x16, 32-bit file. -------------- next part -------------- An HTML attachment was scrubbed... URL: From laurent.orseau at gmail.com Sun Jun 27 14:11:46 2010 From: laurent.orseau at gmail.com (Laurent) Date: Sun, 27 Jun 2010 20:11:46 +0200 Subject: [racket] procedure get-compiled-file-sha1: expects 1 argument, given 2 In-Reply-To: References: Message-ID: > And I don't know what is the problem with the icon. It is a 16x16, 32-bit > file. > the problem was apparently with the ico file itself, which did not include *all* specified format, as said in the docs. (using SimplyIcon solved my problem, if anyone cares) Now remains the question of what the compilation problem in DrRacket. -------------- next part -------------- An HTML attachment was scrubbed... URL: From yayo23 at gmail.com Sun Jun 27 16:02:45 2010 From: yayo23 at gmail.com (Sayed) Date: Sun, 27 Jun 2010 16:02:45 -0400 Subject: [racket] (no subject) Message-ID: Hello, I am currently working on a website powered by racket and I am at a stage where I am trying to establish an authenticated presence on the website. The way I envision doing so is with an html form, comparing the inputting values (essentially username and password) against what I have in a mysql db- this part has already been established. The next step is where I am running into a snag- I am trying to issue a cookie to any authenticated users and then redirect to the 'authenticated area' of the website. Then all functions associated with this area will check for the valid cookie before rendering, and if it is not present then redirect to the login page. The trouble is that for some reason the cookie is not showing up after the redirect. Here is the relevant code. Esentially what is happening is 'cl-cookie' takes the value of empty. http://paste.lisp.org/display/111917 Any help would be appreciated, thanks. - sayed -------------- next part -------------- An HTML attachment was scrubbed... URL: From brad at longbrothers.net Sun Jun 27 08:06:52 2010 From: brad at longbrothers.net (Brad Long) Date: Sun, 27 Jun 2010 22:06:52 +1000 Subject: [racket] enter! not working? Message-ID: <5F16920B79C448B6B15A4CDEBA9DA8E7@ZEBRA> I am using DrRacket Version 5 on Windows. When I follow the example (see below) and get to the part where I am suppposed to use "enter!", I get this error: reference to an identifier before its definition: enter! Thanks for any help. Brad. ===> START #lang racket (define (extract str) (substring str 4 7)) If calling (extract "the boy") is part of the main action of your program, that would go in the definitions area, too. But if it was just an example expression that you were using to explore extract, then you'd more likely leave the definitions area as above, click Run, and then evaluate (extract "the boy") in the REPL. With racket, you'd save the above text in a file using your favorite editor. If you save it as "extract.rkt", then after starting racket in the same directory, you'd evaluate the following sequence: > (enter! "extract.rkt") > (extract "the gal out of the city") "gal" The enter! form both loads the code and switches the evaluation context to the inside of the module, just like DrRacket's Run button. =====> END From cobbe at ccs.neu.edu Sun Jun 27 17:49:46 2010 From: cobbe at ccs.neu.edu (Richard Cobbe) Date: Sun, 27 Jun 2010 17:49:46 -0400 Subject: [racket] raco-style command line parsing library? Message-ID: <20100627214946.GA11698@weatherwax.local> Is there an alternative to the `command-line' form that supports the use of raco-style (svn-style, cvs-style, etc.) command lines, where the first argument is a subcommand, and each subcommand takes a different set of arguments and options? I know that in v4, planet had such a library, but it started with a prominent disclaimer that it wasn't ready for prime time. From what I can see right now, raco uses ad-hoc logic to deal with this. I'm in the process of writing something similar to the existing `command-line' form that will handle this style of command line, and I wanted to avoid duplicating effort. Thanks, Richard From robby at eecs.northwestern.edu Sun Jun 27 19:14:59 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Sun, 27 Jun 2010 18:14:59 -0500 Subject: [racket] raco-style command line parsing library? In-Reply-To: <20100627214946.GA11698@weatherwax.local> References: <20100627214946.GA11698@weatherwax.local> Message-ID: I don't know of one. Planet has some code that might make a good starting point (Jacob wrote it). Robby On Sun, Jun 27, 2010 at 4:49 PM, Richard Cobbe wrote: > Is there an alternative to the `command-line' form that supports the use of > raco-style (svn-style, cvs-style, etc.) command lines, where the first > argument is a subcommand, and each subcommand takes a different set of > arguments and options? > > I know that in v4, planet had such a library, but it started with a > prominent disclaimer that it wasn't ready for prime time. ?From what I can > see right now, raco uses ad-hoc logic to deal with this. > > I'm in the process of writing something similar to the existing > `command-line' form that will handle this style of command line, and I > wanted to avoid duplicating effort. > > Thanks, > > Richard > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > From samth at ccs.neu.edu Sun Jun 27 19:32:43 2010 From: samth at ccs.neu.edu (Sam Tobin-Hochstadt) Date: Sun, 27 Jun 2010 19:32:43 -0400 Subject: [racket] Can I trace calls of a function? In-Reply-To: References: Message-ID: On Sun, Jun 27, 2010 at 8:40 AM, Laurent wrote: > > > On Sun, Jun 27, 2010 at 14:35, Sam Tobin-Hochstadt > wrote: >> >> #lang racket >> >> (require racket/trace) >> >> (define (f x) >> ?(if (zero? x) "done" (f (sub1 x)))) >> >> (trace f) >> >> (f 100) > > > Is it possible to add this example to the docs? Done (see the new "Debugging" section in the Reference). -- sam th samth at ccs.neu.edu From plt at synx.us.to Sun Jun 27 20:02:19 2010 From: plt at synx.us.to (synx) Date: Sun, 27 Jun 2010 17:02:19 -0700 Subject: [racket] Planet crashing, hanging upgade during compilation Message-ID: <4C27E68B.5090006@synx.us.to> So I was installing racket yesterday and noticed that the installation was hanging on the sub-installation of a planet package. I looked at the situation, tried removing any proxies I might have set up, but nothing I could do would install that package. So I used 'raco planet url' to find the URL of the package, and then did something like this: http_proxy= wget -c 'http://planet.racket-lang.org/servlets/planet-servlet.ss?lang=%225.0.0.1%22&name=%22date-tz.plt%22&maj=1&min-lo=0&min-hi=%23f&path=%28%22bzlib%22%29' Sure enough the file started coming in just fine, and then the server derped out somehow and left the connection hanging. I tried again, and discovered that planet does not support the HTTP Range header :c So I can partially download the file, anywhere from 10 to 20% of it, then my connection hangs. I don't think it's a problem on my side as I continue to browse other sites normally and this has been happening consistently only with planet.racket-lang.org for the last two days. Since the Range header isn't supported, I can't resume my download and have to start over every time. Ergo I cannot get the file, no matter what. A fix would be appreciated? ^.^; I dunno why it would be sending the file and just... stop partway through the connection. Out of memory error maybe? From yinso.chen at gmail.com Sun Jun 27 20:35:04 2010 From: yinso.chen at gmail.com (YC) Date: Sun, 27 Jun 2010 17:35:04 -0700 Subject: [racket] shp.plt 1:2 example fail.. In-Reply-To: References: Message-ID: SHP 1.2 expects the following directory structures in its site - - root (anywhere you specify) - shp - file - js - css - ... So in the example site that you used, the file sub directory does not exist and hence you are seeing the error. If you add the file sub directory to the example site or create your own site with the above structure the error will go away. This bug will be patched in the next version, which hopefully will come out in the next few weeks. On Sun, Jun 27, 2010 at 7:17 AM, ??? wrote: > I'm using plt-racket. > > and I tryed shp.plt example's web.ss to run. > > but I encounterd below error: > > ..\handler.ss:260:15: make-shp-handler: htdocs path C:\Documents and > Settings\Euhyen\Application > Data\Racket\planet\300\packages\bzlib\shp.plt\1\2\example\shp\..\file does > not exist. > > What's wrong with that? :'( > > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users > -- Cheers, yc Taming the software dragon - http://dragonmaestro.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From brad at longbrothers.net Sun Jun 27 21:32:00 2010 From: brad at longbrothers.net (Brad Long) Date: Mon, 28 Jun 2010 11:32:00 +1000 Subject: [racket] Loop in Racket Message-ID: <20100628113200.cu042wkxs00080gc@webmail.longbrothers.net> Dear racketeers, What is the reason for not offering a looping construct in racket? For example, something like: (loop (i 1 10) (print i)) Just for the masses, it seems simpler to use. Any comments? From robby at eecs.northwestern.edu Sun Jun 27 21:34:20 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Sun, 27 Jun 2010 20:34:20 -0500 Subject: [racket] Loop in Racket In-Reply-To: <20100628113200.cu042wkxs00080gc@webmail.longbrothers.net> References: <20100628113200.cu042wkxs00080gc@webmail.longbrothers.net> Message-ID: Please see 'for' in the docs. Here's the relevant section of the Guide: http://docs.racket-lang.org/guide/for.html Robby On Sun, Jun 27, 2010 at 8:32 PM, Brad Long wrote: > Dear racketeers, > > What is the reason for not offering a looping construct in racket? For > example, something like: > > (loop (i 1 10) (print i)) > > Just for the masses, it seems simpler to use. > > Any comments? > > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > From matthias at ccs.neu.edu Sun Jun 27 22:37:02 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Sun, 27 Jun 2010 22:37:02 -0400 Subject: [racket] Loop in Racket In-Reply-To: References: <20100628113200.cu042wkxs00080gc@webmail.longbrothers.net> Message-ID: <0C43DC4C-E624-4BDF-9340-765D9AABCC5F@ccs.neu.edu> Plus loops per se are evil -- opium for the masses if you so wish. -- Matthias On Jun 27, 2010, at 9:34 PM, Robby Findler wrote: > Please see 'for' in the docs. Here's the relevant section of the Guide: > > http://docs.racket-lang.org/guide/for.html > > Robby > > On Sun, Jun 27, 2010 at 8:32 PM, Brad Long wrote: >> Dear racketeers, >> >> What is the reason for not offering a looping construct in racket? For >> example, something like: >> >> (loop (i 1 10) (print i)) >> >> Just for the masses, it seems simpler to use. >> >> Any comments? >> >> _________________________________________________ >> For list-related administrative tasks: >> http://lists.racket-lang.org/listinfo/users >> > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From neil at neilvandyke.org Sun Jun 27 22:46:49 2010 From: neil at neilvandyke.org (Neil Van Dyke) Date: Sun, 27 Jun 2010 22:46:49 -0400 Subject: [racket] Loop in Racket In-Reply-To: References: <20100628113200.cu042wkxs00080gc@webmail.longbrothers.net> Message-ID: <4C280D19.6050603@neilvandyke.org> FWIW, I like to assert that the familiar "FOR A = 1 TO 10" is actually not often needed in idiomatic Scheme. More often, you're processing a sequence, or you're doing functional programming such that you need to recurse anyway to avoid mutation, or you need premature exits sometimes. One possible exception that comes to mind is if you're writing a matrix math library, but in that case you might make your own procedures or syntax for iterating/folding over matrices in different ways. Anyway, for the benefit of anyone new to syntax extensions, here is a syntax definition that supports the "for-loop" example (warning: it doesn't error-check as much as it should, because that would clutter the example). You can paste this into DrRacket and use the Macro Stepper to watch how it expands. #lang scheme/base (define-syntax for-loop (syntax-rules () ((_ (VAR START END) BODY0 BODY1 ...) (let ((end-val END)) (let loop ((VAR START)) (if (> VAR end-val) (void) (begin BODY0 BODY1 ... (loop (add1 VAR))))))))) (for-loop (i 1 10) (print i)) Robby Findler wrote at 06/27/2010 09:34 PM: > Please see 'for' in the docs. Here's the relevant section of the Guide: > > http://docs.racket-lang.org/guide/for.html > > Robby > > On Sun, Jun 27, 2010 at 8:32 PM, Brad Long wrote: > >> Dear racketeers, >> >> What is the reason for not offering a looping construct in racket? For >> example, something like: >> >> (loop (i 1 10) (print i)) >> >> Just for the masses, it seems simpler to use. >> >> Any comments? >> -- http://www.neilvandyke.org/ From neil at neilvandyke.org Sun Jun 27 23:07:16 2010 From: neil at neilvandyke.org (Neil Van Dyke) Date: Sun, 27 Jun 2010 23:07:16 -0400 Subject: [racket] current backtrace implications of JIT Message-ID: <4C2811E4.9000306@neilvandyke.org> What effect does the JIT currently have on debugging backtraces? Or, how can one get some or all of the benefit of the JIT, but still reliably get useful backtraces? I see that DrScheme now has an option for disabling some JIT optimizations. Should I just do whatever that checkbox is doing? Details on my particular system... A while ago, I had to disable the JIT for a large system so that we could reliably get useful backtraces at the time (i.e., not just our top-level entry point). After some performance testing with PLT 4.2.5 just now, I'm seeing the JIT give performance gains of over 19x for some functions (at least, in contrived tests with huge numbers of iterations). So, we would *really* like to be using the JIT, so long as we can keep our backtraces. We have a custom error escape handler, if that matters. -- http://www.neilvandyke.org/ From mflatt at cs.utah.edu Sun Jun 27 23:14:34 2010 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Sun, 27 Jun 2010 21:14:34 -0600 Subject: [racket] enter! not working? In-Reply-To: <5F16920B79C448B6B15A4CDEBA9DA8E7@ZEBRA> References: <5F16920B79C448B6B15A4CDEBA9DA8E7@ZEBRA> Message-ID: <20100628031436.349E76500BA@mail-svr1.cs.utah.edu> Are you working with the `racket' command-line program or within DrRacket? Within DrRacket, you don't need `enter!'. At Sun, 27 Jun 2010 22:06:52 +1000, "Brad Long" wrote: > I am using DrRacket Version 5 on Windows. When I follow the example (see > below) and get to the part where I am suppposed to use "enter!", I get this > error: > > reference to an identifier before its definition: enter! > > Thanks for any help. > > Brad. > > ===> START > > #lang racket > > (define (extract str) > (substring str 4 7)) > > If calling (extract "the boy") is part of the main action of your program, > that would go in the definitions area, too. But if it was just an example > expression that you were using to explore extract, then you'd more likely > leave the definitions area as above, click Run, and then evaluate (extract > "the boy") in the REPL. > > With racket, you'd save the above text in a file using your favorite editor. > If you save it as "extract.rkt", then after starting racket in the same > directory, you'd evaluate the following sequence: > > > (enter! "extract.rkt") > > (extract "the gal out of the city") > > "gal" > > The enter! form both loads the code and switches the evaluation context to > the inside of the module, just like DrRacket's Run button. > > =====> END > > > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From clements at brinckerhoff.org Sun Jun 27 23:21:26 2010 From: clements at brinckerhoff.org (John Clements) Date: Sun, 27 Jun 2010 20:21:26 -0700 Subject: [racket] Loop in Racket In-Reply-To: <20100628113200.cu042wkxs00080gc@webmail.longbrothers.net> References: <20100628113200.cu042wkxs00080gc@webmail.longbrothers.net> Message-ID: <7B2A4B68-1927-4D03-9797-BBDCE2B6C368@brinckerhoff.org> On Jun 27, 2010, at 6:32 PM, Brad Long wrote: > Dear racketeers, > > What is the reason for not offering a looping construct in racket? For example, something like: > > (loop (i 1 10) (print i)) > It's there: (for/list ([i (in-range 1 10)]) i) prints out '(1 2 3 4 5 6 7 8 9) ... also, note that 'for/list' contains no opiates. John -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4669 bytes Desc: not available URL: From mflatt at cs.utah.edu Sun Jun 27 23:23:06 2010 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Sun, 27 Jun 2010 21:23:06 -0600 Subject: [racket] current backtrace implications of JIT In-Reply-To: <4C2811E4.9000306@neilvandyke.org> References: <4C2811E4.9000306@neilvandyke.org> Message-ID: <20100628032307.D67426500BA@mail-svr1.cs.utah.edu> At Sun, 27 Jun 2010 23:07:16 -0400, Neil Van Dyke wrote: > What effect does the JIT currently have on debugging backtraces? Or, > how can one get some or all of the benefit of the JIT, but still > reliably get useful backtraces? The JIT backtraces have gotten slightly better in some corner cases, but not much overall on x86 or PPC. On x86_64, backtraces were originally limited or absent, but that was fixed a while ago. > I see that DrScheme now has an option for disabling some JIT > optimizations. Should I just do whatever that checkbox is doing? I hadn't noticed before, but the checkbox needs to be relabeled by dropping "JIT". It disables bytecode-compiler optimizations, which apply whether or not you are using the JIT. So, if you're getting useful info already without the JIT, then that checkbox isn't the right direction. > Details on my particular system... A while ago, I had to disable the JIT > for a large system so that we could reliably get useful backtraces at > the time (i.e., not just our top-level entry point). The difference between JIT and non-JIT backtraces usually isn't so big. Assuming that it's still a problem (i.e., it wasn't on x86_64 and long enough ago), then probably we need to fix something in the JIT backtrace implementation. From brad at longbrothers.net Sun Jun 27 23:26:33 2010 From: brad at longbrothers.net (Brad Long) Date: Mon, 28 Jun 2010 13:26:33 +1000 Subject: [racket] enter! not working? In-Reply-To: <20100628031436.349E76500BA@mail-svr1.cs.utah.edu> References: <5F16920B79C448B6B15A4CDEBA9DA8E7@ZEBRA> <20100628031436.349E76500BA@mail-svr1.cs.utah.edu> Message-ID: <20100628132633.g1xi6mjv1twkck00@webmail.longbrothers.net> Thankyou. My bad. Me newbie - guess you can tell! Quoting Matthew Flatt : > Are you working with the `racket' command-line program or within > DrRacket? > > Within DrRacket, you don't need `enter!'. > > At Sun, 27 Jun 2010 22:06:52 +1000, "Brad Long" wrote: >> I am using DrRacket Version 5 on Windows. When I follow the example (see >> below) and get to the part where I am suppposed to use "enter!", I get this >> error: >> >> reference to an identifier before its definition: enter! >> >> Thanks for any help. >> >> Brad. >> >> ===> START >> >> #lang racket >> >> (define (extract str) >> (substring str 4 7)) >> >> If calling (extract "the boy") is part of the main action of your program, >> that would go in the definitions area, too. But if it was just an example >> expression that you were using to explore extract, then you'd more likely >> leave the definitions area as above, click Run, and then evaluate (extract >> "the boy") in the REPL. >> >> With racket, you'd save the above text in a file using your favorite editor. >> If you save it as "extract.rkt", then after starting racket in the same >> directory, you'd evaluate the following sequence: >> >> > (enter! "extract.rkt") >> > (extract "the gal out of the city") >> >> "gal" >> >> The enter! form both loads the code and switches the evaluation context to >> the inside of the module, just like DrRacket's Run button. >> >> =====> END >> >> >> _________________________________________________ >> For list-related administrative tasks: >> http://lists.racket-lang.org/listinfo/users > From brad at longbrothers.net Sun Jun 27 23:27:47 2010 From: brad at longbrothers.net (Brad Long) Date: Mon, 28 Jun 2010 13:27:47 +1000 Subject: [racket] Fwd: Re: Loop in Racket Message-ID: <20100628132747.vf3edv8ygcoo4wk8@webmail.longbrothers.net> Thankyou for your responses re loop. ----- Forwarded message from brad at longbrothers.net ----- Date: Mon, 28 Jun 2010 11:44:25 +1000 From: Brad Long Reply-To: Brad Long Subject: Re: [racket] Loop in Racket To: Robby Findler Wow! Sorry, didn't realise they existed. These constructs will assist racket up-take. Cheers. Next time I'll RTFM. Quoting Robby Findler : > Please see 'for' in the docs. Here's the relevant section of the Guide: > > http://docs.racket-lang.org/guide/for.html > > Robby > > On Sun, Jun 27, 2010 at 8:32 PM, Brad Long wrote: >> Dear racketeers, >> >> What is the reason for not offering a looping construct in racket? For >> example, something like: >> >> (loop (i 1 10) (print i)) >> >> Just for the masses, it seems simpler to use. >> >> Any comments? >> >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://lists.racket-lang.org/listinfo/users >> > ----- End forwarded message ----- From mflatt at cs.utah.edu Sun Jun 27 23:28:08 2010 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Sun, 27 Jun 2010 21:28:08 -0600 Subject: [racket] enter! not working? In-Reply-To: <20100628132633.g1xi6mjv1twkck00@webmail.longbrothers.net> References: <5F16920B79C448B6B15A4CDEBA9DA8E7@ZEBRA> <20100628031436.349E76500BA@mail-svr1.cs.utah.edu> <20100628132633.g1xi6mjv1twkck00@webmail.longbrothers.net> Message-ID: <20100628032810.284826500C7@mail-svr1.cs.utah.edu> Ok --- I'll work on the Guide to try to make it clearer. Thanks, Matthew At Mon, 28 Jun 2010 13:26:33 +1000, Brad Long wrote: > Thankyou. My bad. Me newbie - guess you can tell! > > Quoting Matthew Flatt : > > > Are you working with the `racket' command-line program or within > > DrRacket? > > > > Within DrRacket, you don't need `enter!'. > > > > At Sun, 27 Jun 2010 22:06:52 +1000, "Brad Long" wrote: > >> I am using DrRacket Version 5 on Windows. When I follow the example (see > >> below) and get to the part where I am suppposed to use "enter!", I get this > >> error: > >> > >> reference to an identifier before its definition: enter! > >> > >> Thanks for any help. > >> > >> Brad. > >> > >> ===> START > >> > >> #lang racket > >> > >> (define (extract str) > >> (substring str 4 7)) > >> > >> If calling (extract "the boy") is part of the main action of your program, > >> that would go in the definitions area, too. But if it was just an example > >> expression that you were using to explore extract, then you'd more likely > >> leave the definitions area as above, click Run, and then evaluate (extract > >> "the boy") in the REPL. > >> > >> With racket, you'd save the above text in a file using your favorite editor. > >> If you save it as "extract.rkt", then after starting racket in the same > >> directory, you'd evaluate the following sequence: > >> > >> > (enter! "extract.rkt") > >> > (extract "the gal out of the city") > >> > >> "gal" > >> > >> The enter! form both loads the code and switches the evaluation context to > >> the inside of the module, just like DrRacket's Run button. > >> > >> =====> END > >> > >> > >> _________________________________________________ > >> For list-related administrative tasks: > >> http://lists.racket-lang.org/listinfo/users > > From neil at neilvandyke.org Sun Jun 27 23:38:51 2010 From: neil at neilvandyke.org (Neil Van Dyke) Date: Sun, 27 Jun 2010 23:38:51 -0400 Subject: [racket] current backtrace implications of JIT In-Reply-To: <20100628032307.D67426500BA@mail-svr1.cs.utah.edu> References: <4C2811E4.9000306@neilvandyke.org> <20100628032307.D67426500BA@mail-svr1.cs.utah.edu> Message-ID: <4C28194B.30205@neilvandyke.org> Thanks, Matthew. Sounds like I should experiment with my application and try to break JIT backtraces with 4.2.5. Hopefully they just work for me (and in production), because the JIT would be a big win for us. Matthew Flatt wrote at 06/27/2010 11:23 PM: > The difference between JIT and non-JIT backtraces usually isn't so big. Assuming that it's still a problem (i.e., it wasn't on x86_64 and long enough ago), then probably we need to fix something in the JIT backtrace implementation. -- http://www.neilvandyke.org/ From neil at neilvandyke.org Mon Jun 28 02:19:12 2010 From: neil at neilvandyke.org (Neil Van Dyke) Date: Mon, 28 Jun 2010 02:19:12 -0400 Subject: [racket] current backtrace implications of JIT In-Reply-To: <4C28194B.30205@neilvandyke.org> References: <4C2811E4.9000306@neilvandyke.org> <20100628032307.D67426500BA@mail-svr1.cs.utah.edu> <4C28194B.30205@neilvandyke.org> Message-ID: <4C283EE0.7030009@neilvandyke.org> I've been unable to break JIT backtraces in our large legacy application under PLT 4.2.5. This is great news, since the JIT should be a big win for us. Thanks, Matthew and the rest of PLT. Neil Van Dyke wrote at 06/27/2010 11:38 PM: > Thanks, Matthew. Sounds like I should experiment with my application > and try to break JIT backtraces with 4.2.5. Hopefully they just work > for me (and in production), because the JIT would be a big win for us. > > Matthew Flatt wrote at 06/27/2010 11:23 PM: >> The difference between JIT and non-JIT backtraces usually isn't so >> big. Assuming that it's still a problem (i.e., it wasn't on x86_64 >> and long enough ago), then probably we need to fix something in the >> JIT backtrace implementation. -- http://www.neilvandyke.org/ From wwall at yandex.ru Mon Jun 28 07:29:58 2010 From: wwall at yandex.ru (=?koi8-r?B?4s/NwsnOIPfBzMXO1MnO?=) Date: Mon, 28 Jun 2010 15:29:58 +0400 Subject: [racket] smoke error on run Message-ID: <20111277724598@web99.yandex.ru> I get smoke from git git clone git://github.com/untyped/smoke.git cd smoke ext update /build.ss compile on comiple have some error wall at linux-bnxm:~/src/scheme/untyped/smoke> ./build.ss compile | grep error module: identifier already imported from: slideshow at: local-require in: (rename (planet cce/scheme:6:3/scheme) local-require local-require) module: identifier already imported from: slideshow at: local-require in: (rename (planet cce/scheme:6:3/scheme) local-require local-require) setup-plt: error: during making for /cce/scheme.plt/6/3 (Scheme Utilities: (planet cce/scheme)) setup-plt: module: identifier already imported from: slideshow at: local-require in: (rename (planet cce/scheme:6:3/scheme) local-require local-require) setup-plt: error: during Building docs for /home/wall/src/scheme/untyped/smoke/planet/5.0/cache/cce/scheme.plt/6/3/reference/manual.scrbl setup-plt: module: identifier already imported from: slideshow at: local-require in: (rename (planet cce/scheme:6:3/scheme) local-require local-require) load-handler: expected a `module' declaration for `cache' in #, but found something else setup-plt: error: during making for /untyped/unlib.plt/3/23/planet/4.2.1.5 setup-plt: load-handler: expected a `module' declaration for `cache' in #, but found something else class.ss:15:9: module: identifier is already imported at: object/c in: (define-values (object/c) (new-lambda class-or-ifaces (apply and/c object? (map is-a?/c class-or-ifaces)))) class.ss:15:9: module: identifier is already imported at: object/c in: (define-values (object/c) (new-lambda class-or-ifaces (apply and/c object? (map is-a?/c class-or-ifaces)))) setup-plt: error: during making for /cce/scheme.plt/4/1 (Scheme Utilities: (planet cce/scheme)) setup-plt: class.ss:15:9: module: identifier is already imported at: object/c in: (define-values (object/c) (new-lambda class-or-ifaces (apply and/c object? (map is-a?/c class-or-ifaces)))) setup-plt: error: during Building docs for /home/wall/src/scheme/untyped/smoke/planet/5.0/cache/cce/scheme.plt/4/1/scribblings/main.scrbl setup-plt: class.ss:15:9: module: identifier is already imported at: object/c in: (define-values (object/c) (new-lambda class-or-ifaces (apply and/c object? (map is-a?/c class-or-ifaces)))) WARNING: collected information for key multiple times: '(index-entry (mod-path "(planet schematics/sake)")); values: (list '("(planet schematics/sake)") (list (sized-element ...)) #) (list '("(planet schematics/sake)") (list (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: (list '("(planet schematics/sake)") (list (sized-element ...)) #) (list '("(planet schematics/sake)") (list (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)")) tool.ss:3:18: only-in: identifier `language/macro-stepper<%>' not included in nested require spec at: macro-debugger/tool in: (only-in macro-debugger/tool language/macro-stepper<%>) default-load-handler: cannot open input file: "/home/wall/src/scheme/untyped/smoke/planetdev/mirrors/javascript/main.rkt" (No such file or directory; errno=2) setup-plt: error: during making for /dherman/javascript.plt/9/2/drscheme (JavaScript Language for DrScheme) setup-plt: tool.ss:3:18: only-in: identifier `language/macro-stepper<%>' not included in nested require spec at: macro-debugger/tool in: (only-in macro-debugger/tool language/macro-stepper<%>) setup-plt: error: during Building docs for /home/wall/src/scheme/untyped/smoke/planet/5.0/cache/dherman/javascript.plt/9/2/scribblings/javascript.scrbl setup-plt: default-load-handler: cannot open input file: "/home/wall/src/scheme/untyped/smoke/planetdev/mirrors/javascript/main.rkt" (No such file or directory; errno=2) if after it cd testapp/ drscheme main.ss and in IDE press F5 i have error ????: scheme/base. module: identifier is already imported module: identifier is already imported setup-plt: error: during making for /cce/scheme.plt/4/1 (Scheme Utilities: (planet cce/scheme)) setup-plt: module: identifier is already imported setup-plt: error: during Building docs for /home/wall/.racket/planet/300/5.0/cache/cce/scheme.plt/4/1/scribblings/main.scrbl setup-plt: module: identifier is already imported 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: (list '("(planet schematics/sake)") (list (sized-element ...)) #) (list '("(planet schematics/sake)") (list (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: (list '("(planet schematics/sake)") (list (sized-element ...)) #) (list '("(planet schematics/sake)") (list (sized-element ...)) #) module: identifier already imported from a different source module: identifier already imported from a different source setup-plt: error: during making for /cce/scheme.plt/6/3 (Scheme Utilities: (planet cce/scheme)) setup-plt: module: identifier already imported from a different source setup-plt: error: during Building docs for /home/wall/.racket/planet/300/5.0/cache/cce/scheme.plt/6/3/reference/manual.scrbl setup-plt: module: identifier already imported from a different source load-handler: expected a `module' declaration for `cache' in #, but found something else setup-plt: error: during making for /untyped/unlib.plt/3/23/planet/4.2.1.5 setup-plt: load-handler: expected a `module' declaration for `cache' in #, but found something else base.ss:9:9: require: PLaneT could not find the requested package: Server had no matching package: No package matched the specified criteria in: (planet untyped/dispatch:3) how i can correct error? From cobbe at ccs.neu.edu Mon Jun 28 07:46:22 2010 From: cobbe at ccs.neu.edu (Richard Cobbe) Date: Mon, 28 Jun 2010 07:46:22 -0400 Subject: [racket] raco-style command line parsing library? In-Reply-To: References: <20100627214946.GA11698@weatherwax.local> Message-ID: <20100628114622.GB276@weatherwax.local> On Sun, Jun 27, 2010 at 06:14:59PM -0500, Robby Findler wrote: > I don't know of one. Planet has some code that might make a good > starting point (Jacob wrote it). Ah, thanks for the pointer. I'll check that out and see if there's anything I can use. Richard From mflatt at cs.utah.edu Mon Jun 28 09:08:48 2010 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Mon, 28 Jun 2010 07:08:48 -0600 Subject: [racket] procedure get-compiled-file-sha1: expects 1 argument, given 2 In-Reply-To: References: Message-ID: <20100628130847.848D96500AC@mail-svr1.cs.utah.edu> At Sun, 27 Jun 2010 19:34:02 +0200, Laurent wrote: > . . M:\Program Files\Racket\collects\racket\private\promise.rkt:103:10: > procedure get-compiled-file-sha1: expects 1 argument, given 2: > # # This bug seems to have been fixed since v5.0. You could try a nightly build from http://pre.racket-lang.org/installers/ I think that re-installing didn't help because the bug is triggered by something in ".dep" files for your code. So, removing "compiled" directories may work around the problem. > E:\Projets\Scheme-svn\towers>racket -S E:\Projets\Scheme-svn compile.rkt > car: expects argument of type ; given '() Can you send me your old ".ico" file so that I can make replicate and fix this bug? Thanks, Matthew From sbloch at adelphi.edu Mon Jun 28 09:48:20 2010 From: sbloch at adelphi.edu (Stephen Bloch) Date: Mon, 28 Jun 2010 09:48:20 -0400 Subject: [racket] Loop in Racket In-Reply-To: References: <20100628113200.cu042wkxs00080gc@webmail.longbrothers.net> Message-ID: >> What is the reason for not offering a looping construct in racket? >> For >> example, something like: >> >> (loop (i 1 10) (print i)) >> >> Just for the masses, it seems simpler to use. Simpler than what? For what application? The classic C/C++/Java "for" loop was designed for, and is almost always used for, integer counters stepping through an array. In most of these applications, what you really want to do is "do something to each element of this array," or perhaps "do something to each element of this array until you find one that meets this criterion." One of my general principles of programming is "try to avoid introducing concepts in the solution that weren't part of the problem." In both of the above cases, the problem statement doesn't say anything about integer counters, indices, or mutation, so one should be able to solve the problem without those things. In a low-level language like C or Pascal, one can't hide the fact that arrays are indexed with integers, and the way to do something with various different integers is a for-loop. C++ starts to address the problem with "iterators", which still act like mutable counters and are still used in classic "for" loops, but at least they hide the array indexing. Java does the same thing with "Iterable" and goes a step farther with "foreach" loops, which partially hide the mutation as well... but anyone who's ever tried defining a class that implements Iterable found that it still has to use mutation internally. Scheme/Racket's list and sequence operations -- "map", "filter", "foldr", "for", "in-range", "in-naturals", "in-string", "stop-before", etc. -- are yet another step in the direction of eliminating concepts from the solution that weren't in the problem. In other words, what's "simpler" is to use a construct that says what you mean. If you want to print the integers 1 through 10 in increasing order (actually a fairly artificial problem whose main purpose is to test integer-counting for-loop constructs), use "for" and "in-range". If you want to do something to each element of a list and get a list of the results, use "map". If you want to extract the elements of a list that meet a particular criterion, use "filter". If you want to count the elements of a list that meet a particular criterion, use "count-if". And in the unlikely event that what you want to do doesn't match any of the defined constructs, Scheme/Racket allows you to write your own control constructs (indeed, I have assigned my CS0 students to write their own versions of "map", "filter", and "count-if"). Stephen Bloch sbloch at adelphi.edu -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.mccarthy at gmail.com Mon Jun 28 11:16:34 2010 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Mon, 28 Jun 2010 09:16:34 -0600 Subject: [racket] (no subject) In-Reply-To: References: Message-ID: The code you pasted is not a full program so I cannot test it. In particular, I don't see the definition of editor-cookie, so I'm not sure what it does. The example program from the documentation [1]: #lang web-server/insta (define (start req) (define cookies (request-cookies req)) (define id-cookie (findf (lambda (c) (string=? "id" (client-cookie-name c))) cookies)) (if id-cookie (hello (client-cookie-value id-cookie)) (redirect-to (url->string (request-uri req)) see-other #:headers (list (cookie->header (make-cookie "id" "joseph")))))) (define (hello who) `(html (head (title "Hello!")) (body (h1 "Hello " ,who)))) works for me in multiple browsers. The only thing different I see is that you are using 'first' while I am using 'findf'. Jay 1. http://pre.plt-scheme.org/docs/html/web-server/http.html#(part._cookie-parse) On Sun, Jun 27, 2010 at 2:02 PM, Sayed wrote: > Hello, I am currently working on a website powered by racket and I am at a > stage where I am > trying to establish an authenticated presence on the website. The way I > envision doing so is > with an html form, comparing the inputting values (essentially username and > password) against > what I have in a mysql db- this part has already been established. > > The next step is where I am running into a snag- I am trying to issue a > cookie to any authenticated > users and then redirect to the 'authenticated area' of the website. Then all > functions associated with this > area will check for the valid cookie before rendering, and if it is not > present then redirect to the login page. > The trouble is that for some reason the cookie is not showing up after the > redirect. Here is the relevant code. > > Esentially what is happening is 'cl-cookie' takes the value of empty. > > http://paste.lisp.org/display/111917 > > > Any help would be appreciated, thanks. > > - sayed > > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > -- 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 Mon Jun 28 11:37:35 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Mon, 28 Jun 2010 10:37:35 -0500 Subject: [racket] Planet crashing, hanging upgade during compilation In-Reply-To: <4C27E68B.5090006@synx.us.to> References: <4C27E68B.5090006@synx.us.to> Message-ID: I'm having trouble seeing the bad behavior you see. One thing is that installing racket doesn't install any planet packages, afaik. Perhaps you can say more carefully what it was you did exactly? Robby On Sun, Jun 27, 2010 at 7:02 PM, synx wrote: > > So I was installing racket yesterday and noticed that the installation > was hanging on the sub-installation of a planet package. I looked at the > situation, tried removing any proxies I might have set up, but nothing I > could do would install that package. So I used 'raco planet url' to find > the URL of the package, and then did something like this: > > http_proxy= wget -c > 'http://planet.racket-lang.org/servlets/planet-servlet.ss?lang=%225.0.0.1%22&name=%22date-tz.plt%22&maj=1&min-lo=0&min-hi=%23f&path=%28%22bzlib%22%29' > > Sure enough the file started coming in just fine, and then the server > derped out somehow and left the connection hanging. I tried again, and > discovered that planet does not support the HTTP Range header :c > > So I can partially download the file, anywhere from 10 to 20% of it, > then my connection hangs. I don't think it's a problem on my side as I > continue to browse other sites normally and this has been happening > consistently only with planet.racket-lang.org for the last two days. > Since the Range header isn't supported, I can't resume my download and > have to start over every time. Ergo I cannot get the file, no matter what. > > A fix would be appreciated? ^.^; I dunno why it would be sending the > file and just... stop partway through the connection. Out of memory > error maybe? > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > From d.j.gurnell at gmail.com Mon Jun 28 11:47:26 2010 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Mon, 28 Jun 2010 16:47:26 +0100 Subject: [racket] smoke error on run In-Reply-To: <20111277724598@web99.yandex.ru> References: <20111277724598@web99.yandex.ru> Message-ID: Hi Valentin, I'll repeat some of what I said to you offline for others' benefit: Unfortunately, you've caught me slightly off-guard. I'm currently moving all of the Untyped open source code onto Github and I'm not quite ready to document or announce it yet. Whiel Smoke is open source, it isn't yet stable enough for release on PLaneT. Please feel free to use the code, but please be wary of sudden changes to the API. Installing Smoke also requires a good knowledge of PLaneT and PLaneT development links, so I don't recommend using it unless you have a firm understanding of everything in my explanation below. Hope this helps! Best regards, -- Dave -------------------------------------------------- The first command you're running is "ext update" (http://nopugs.com/ext-tutorial). This downloads and installs local copies of the latest versions of the relevant Untyped packages to: /path/to/smoke/planetdev Some of the Untyped packages (like dispatch version 3) aren't yet on PLaneT. This gives you a copy of everything straight from Github. The second command you're running is build.ss. This script is intended as a tool for developing Smoke itself. It lets you compile and test Smoke against different versions of PLT without affecting the main installation on your computer. To be more precise, build.ss sets the PLTPLANETDIR environment variable to: /path/to/smoke/planet and then looks at the contents of autoplanet.ss to install development links for all of the packages you downloaded using ext. When build.ss finishes, you end up with a copy of Smoke that is completely self-contained and doesn't affect any of the other Racket or PLT related files on your computer. In other words, Smoke won't work with the usual tools like DrRacket unless you do one of the following: 1. point PLTPLANETDIR to /path/to/smoke/planet before you run DrRacket (this may not work on OS X); 2. install the missing Untyped libraries (including Smoke) manually in your main PLaneT cache. You can do option 1 using build.ss: $ source `build.ss envvars` $ drracket You can do option 2 by examining the contents of autoplanet.ss and using raco appropriately. -------------------------------------------------- On 28 Jun 2010, at 12:29, ?????? ???????? wrote: > I get smoke from git > > git clone git://github.com/untyped/smoke.git > cd smoke > ext update > /build.ss compile > > on comiple have some error > wall at linux-bnxm:~/src/scheme/untyped/smoke> ./build.ss compile | grep error > module: identifier already imported from: slideshow at: local-require in: (rename (planet cce/scheme:6:3/scheme) local-require local-require) > module: identifier already imported from: slideshow at: local-require in: (rename (planet cce/scheme:6:3/scheme) local-require local-require) > setup-plt: error: during making for /cce/scheme.plt/6/3 (Scheme Utilities: (planet cce/scheme)) > setup-plt: module: identifier already imported from: slideshow at: local-require in: (rename (planet cce/scheme:6:3/scheme) local-require local-require) > setup-plt: error: during Building docs for /home/wall/src/scheme/untyped/smoke/planet/5.0/cache/cce/scheme.plt/6/3/reference/manual.scrbl > setup-plt: module: identifier already imported from: slideshow at: local-require in: (rename (planet cce/scheme:6:3/scheme) local-require local-require) > load-handler: expected a `module' declaration for `cache' in #, but found something else > setup-plt: error: during making for /untyped/unlib.plt/3/23/planet/4.2.1.5 > setup-plt: load-handler: expected a `module' declaration for `cache' in #, but found something else > class.ss:15:9: module: identifier is already imported at: object/c in: (define-values (object/c) (new-lambda class-or-ifaces (apply and/c object? (map is-a?/c class-or-ifaces)))) > class.ss:15:9: module: identifier is already imported at: object/c in: (define-values (object/c) (new-lambda class-or-ifaces (apply and/c object? (map is-a?/c class-or-ifaces)))) > setup-plt: error: during making for /cce/scheme.plt/4/1 (Scheme Utilities: (planet cce/scheme)) > setup-plt: class.ss:15:9: module: identifier is already imported at: object/c in: (define-values (object/c) (new-lambda class-or-ifaces (apply and/c object? (map is-a?/c class-or-ifaces)))) > setup-plt: error: during Building docs for /home/wall/src/scheme/untyped/smoke/planet/5.0/cache/cce/scheme.plt/4/1/scribblings/main.scrbl > setup-plt: class.ss:15:9: module: identifier is already imported at: object/c in: (define-values (object/c) (new-lambda class-or-ifaces (apply and/c object? (map is-a?/c class-or-ifaces)))) > WARNING: collected information for key multiple times: '(index-entry (mod-path "(planet schematics/sake)")); values: (list '("(planet schematics/sake)") (list (sized-element ...)) #) (list '("(planet schematics/sake)") (list (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: (list '("(planet schematics/sake)") (list (sized-element ...)) #) (list '("(planet schematics/sake)") (list (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)")) > tool.ss:3:18: only-in: identifier `language/macro-stepper<%>' not included in nested require spec at: macro-debugger/tool in: (only-in macro-debugger/tool language/macro-stepper<%>) > default-load-handler: cannot open input file: "/home/wall/src/scheme/untyped/smoke/planetdev/mirrors/javascript/main.rkt" (No such file or directory; errno=2) > setup-plt: error: during making for /dherman/javascript.plt/9/2/drscheme (JavaScript Language for DrScheme) > setup-plt: tool.ss:3:18: only-in: identifier `language/macro-stepper<%>' not included in nested require spec at: macro-debugger/tool in: (only-in macro-debugger/tool language/macro-stepper<%>) > setup-plt: error: during Building docs for /home/wall/src/scheme/untyped/smoke/planet/5.0/cache/dherman/javascript.plt/9/2/scribblings/javascript.scrbl > setup-plt: default-load-handler: cannot open input file: "/home/wall/src/scheme/untyped/smoke/planetdev/mirrors/javascript/main.rkt" (No such file or directory; errno=2) > > if after it > cd testapp/ > drscheme main.ss > > and in IDE press F5 > i have error > > ????: scheme/base. > module: identifier is already imported > module: identifier is already imported > setup-plt: error: during making for /cce/scheme.plt/4/1 (Scheme Utilities: (planet cce/scheme)) > setup-plt: module: identifier is already imported > setup-plt: error: during Building docs for /home/wall/.racket/planet/300/5.0/cache/cce/scheme.plt/4/1/scribblings/main.scrbl > setup-plt: module: identifier is already imported > 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: (list '("(planet schematics/sake)") (list (sized-element ...)) #) (list '("(planet schematics/sake)") (list (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: (list '("(planet schematics/sake)") (list (sized-element ...)) #) (list '("(planet schematics/sake)") (list (sized-element ...)) #) > module: identifier already imported from a different source > module: identifier already imported from a different source > setup-plt: error: during making for /cce/scheme.plt/6/3 (Scheme Utilities: (planet cce/scheme)) > setup-plt: module: identifier already imported from a different source > setup-plt: error: during Building docs for /home/wall/.racket/planet/300/5.0/cache/cce/scheme.plt/6/3/reference/manual.scrbl > setup-plt: module: identifier already imported from a different source > load-handler: expected a `module' declaration for `cache' in #, but found something else > setup-plt: error: during making for /untyped/unlib.plt/3/23/planet/4.2.1.5 > setup-plt: load-handler: expected a `module' declaration for `cache' in #, but found something else > base.ss:9:9: require: PLaneT could not find the requested package: Server had no matching package: No package matched the specified criteria in: (planet untyped/dispatch:3) > > how i can correct error? > > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users -------------- next part -------------- An HTML attachment was scrubbed... URL: From laurent.orseau at gmail.com Mon Jun 28 13:54:57 2010 From: laurent.orseau at gmail.com (Laurent) Date: Mon, 28 Jun 2010 19:54:57 +0200 Subject: [racket] procedure get-compiled-file-sha1: expects 1 argument, given 2 In-Reply-To: <20100628130847.848D96500AC@mail-svr1.cs.utah.edu> References: <20100628130847.848D96500AC@mail-svr1.cs.utah.edu> Message-ID: On Mon, Jun 28, 2010 at 15:08, Matthew Flatt wrote: > At Sun, 27 Jun 2010 19:34:02 +0200, Laurent wrote: > > . . M:\Program Files\Racket\collects\racket\private\promise.rkt:103:10: > > procedure get-compiled-file-sha1: expects 1 argument, given 2: > > # # > > This bug seems to have been fixed since v5.0. You could try a nightly > build from > > http://pre.racket-lang.org/installers/ > > Ha nice, thanks. > I think that re-installing didn't help because the bug is triggered by > something in ".dep" files for your code. So, removing "compiled" > directories may work around the problem. > I tried that on my own compiled dirs, but you are probably referring to others? Or maybe I didn't do it right. > > E:\Projets\Scheme-svn\towers>racket -S E:\Projets\Scheme-svn compile.rkt > > car: expects argument of type ; given '() > > Can you send me your old ".ico" file so that I can make replicate and > fix this bug? > Here it is. Just a simple bmp file with only one icon inside. Also, while we are at it, the constraint in (send a-frame set-icon ....) about the mask having to be a monochrome xbm file is a bit cumbersome (WinXP). If it is easy for you to allow for PNG alpha masks, please don't hesitate ;) -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: favicon.ico Type: image/x-icon Size: 1150 bytes Desc: not available URL: From laurent.orseau at gmail.com Mon Jun 28 14:11:33 2010 From: laurent.orseau at gmail.com (Laurent) Date: Mon, 28 Jun 2010 20:11:33 +0200 Subject: [racket] raco-style command line parsing library? In-Reply-To: <20100628114622.GB276@weatherwax.local> References: <20100627214946.GA11698@weatherwax.local> <20100628114622.GB276@weatherwax.local> Message-ID: On Mon, Jun 28, 2010 at 13:46, Richard Cobbe wrote: > On Sun, Jun 27, 2010 at 06:14:59PM -0500, Robby Findler wrote: > > I don't know of one. Planet has some code that might make a good > > starting point (Jacob wrote it). > > Ah, thanks for the pointer. I'll check that out and see if there's > anything I can use. > > If you come up with something nice, please share, I'm quite interested in this too! As a related matter, do you or anyone know of a command-line textual UI with properties similar to Web forms? Not really like the Readline lib, but more like a question/answer interaction to the user, with validation of single inputs (numbers only, choices, list-box, etc.), validation of several inputs (like a Web form), etc. Being able to replace a Web applet with a textual UI would be ideal. I started to write a little thing like that, but I'd like to avoid duplication too... -------------- next part -------------- An HTML attachment was scrubbed... URL: From laurent.orseau at gmail.com Mon Jun 28 14:20:08 2010 From: laurent.orseau at gmail.com (Laurent) Date: Mon, 28 Jun 2010 20:20:08 +0200 Subject: [racket] Can I trace calls of a function? In-Reply-To: References: Message-ID: On Mon, Jun 28, 2010 at 01:32, Sam Tobin-Hochstadt wrote: > On Sun, Jun 27, 2010 at 8:40 AM, Laurent wrote: > > > > > > On Sun, Jun 27, 2010 at 14:35, Sam Tobin-Hochstadt > > wrote: > >> > >> #lang racket > >> > >> (require racket/trace) > >> > >> (define (f x) > >> (if (zero? x) "done" (f (sub1 x)))) > >> > >> (trace f) > >> > >> (f 100) > > > > > > Is it possible to add this example to the docs? > > Done (see the new "Debugging" section in the Reference). > > Thanks! This is really pleasant to have so helpful folks around here. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmarshall at alum.mit.edu Mon Jun 28 15:04:51 2010 From: jmarshall at alum.mit.edu (Joe Marshall) Date: Mon, 28 Jun 2010 12:04:51 -0700 Subject: [racket] Y-combinator perfomance In-Reply-To: <20100625185034.EB41C65010F@mail-svr1.cs.utah.edu> References: <8261277489251@web43.yandex.ru> <20100625185034.EB41C65010F@mail-svr1.cs.utah.edu> Message-ID: On Fri, Jun 25, 2010 at 11:50 AM, Matthew Flatt wrote: > > Compilers can't easily see through a Y combinator, and a factor of 8 or > so difference is probably typical for Lisp compilers. (I tried Ikarus > and Gambit to double check, and performance was about the same as with > Racket.) See @INPROCEEDINGS{Juan92tamingthe, author = {Guillermo Juan and Guillermo Juan Rozas}, title = {Taming the Y operator}, booktitle = {In ACM Conference on LISP and Functional Programming}, year = {1992}, pages = {226--234}, publisher = {ACM Press} } ``In this paper I present a set of conceptually simple but involved techniques used by Liar 1 , the MIT Scheme compiler, to generate good code when recursive procedures are specified in terms of suitable versions of the Y operator. The techniques presented are general-purpose analysis and optimization tools, similar to well-known techniques used in the analysis and optimization of applicative languages, that combine synergistically to enable Liar to generate identical machine code for ordinary recursive definitions written using letrec and those written using suitable forms of Y.'' ;; Allow compiler to inline standard procedures. (declare (usual-integrations)) (define-syntax U (syntax-rules () ((_ f) (f f)))) (define-syntax define/comb (syntax-rules () ((_ comb name (arg1 arg2) body) (define name (comb (lambda (name) (lambda (arg1 arg2) body))))))) ;; Allow compiler to inline Z (define-integrable (Z f) (U (lambda (g) (lambda (x y) ((f (U g)) x y))))) (define/comb Z comb-sum (l t) (if (null? l) t (comb-sum (cdr l) (+ t (car l))))) (define (sum l t) (if (null? l) t (sum (cdr l) (+ t (car l))))) (define (test1) (let ((start-time (runtime)) (l (make-list 10000000 1))) (let ((answer (comb-sum l 0))) (- (runtime) start-time)))) (define (test2) (let ((start-time (runtime)) (l (make-list 10000000 1))) (let ((answer (sum l 0))) (- (runtime) start-time)))) (test1) => .11 seconds (test2) => .11 seconds -- ~jrm From matthias at ccs.neu.edu Mon Jun 28 15:47:47 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Mon, 28 Jun 2010 15:47:47 -0400 Subject: [racket] Y-combinator perfomance In-Reply-To: References: <8261277489251@web43.yandex.ru> <20100625185034.EB41C65010F@mail-svr1.cs.utah.edu> Message-ID: <96DF3F29-E0C9-4D31-94DF-C70DB7F0A1B8@ccs.neu.edu> I pointed out Jinx's paper to Matthew last week. Not surprisingly, reality and theory never match with the MIT Scheme compiler. On Jun 28, 2010, at 3:04 PM, Joe Marshall wrote: > On Fri, Jun 25, 2010 at 11:50 AM, Matthew Flatt > wrote: >> >> Compilers can't easily see through a Y combinator, and a factor of >> 8 or >> so difference is probably typical for Lisp compilers. (I tried Ikarus >> and Gambit to double check, and performance was about the same as >> with >> Racket.) > > See > @INPROCEEDINGS{Juan92tamingthe, > author = {Guillermo Juan and Guillermo Juan Rozas}, > title = {Taming the Y operator}, > booktitle = {In ACM Conference on LISP and Functional Programming}, > year = {1992}, > pages = {226--234}, > publisher = {ACM Press} > } > ``In this paper I present a set of conceptually simple but involved > techniques used by Liar 1 , the MIT Scheme compiler, to generate good > code when recursive procedures are specified in terms of suitable > versions of the Y operator. The techniques presented are > general-purpose analysis and optimization tools, similar to well-known > techniques used in the analysis and optimization of applicative > languages, that combine synergistically to enable Liar to generate > identical machine code for ordinary recursive definitions written > using letrec and those written using suitable forms of Y.'' > > ;; Allow compiler to inline standard procedures. > (declare (usual-integrations)) > > (define-syntax U > (syntax-rules () > ((_ f) (f f)))) > > (define-syntax define/comb > (syntax-rules () > ((_ comb name (arg1 arg2) body) > (define name > (comb (lambda (name) (lambda (arg1 arg2) body))))))) > > ;; Allow compiler to inline Z > (define-integrable (Z f) > (U (lambda (g) (lambda (x y) ((f (U g)) x y))))) > > (define/comb Z comb-sum (l t) > (if (null? l) t (comb-sum (cdr l) (+ t (car l))))) > > (define (sum l t) > (if (null? l) t (sum (cdr l) (+ t (car l))))) > > (define (test1) > (let ((start-time (runtime)) > (l (make-list 10000000 1))) > (let ((answer (comb-sum l 0))) > (- (runtime) start-time)))) > > (define (test2) > (let ((start-time (runtime)) > (l (make-list 10000000 1))) > (let ((answer (sum l 0))) > (- (runtime) start-time)))) > > (test1) => .11 seconds > (test2) => .11 seconds > > > -- > ~jrm > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From a2alt at ya.ru Mon Jun 28 18:21:00 2010 From: a2alt at ya.ru (Groshev Dmitry) Date: Tue, 29 Jun 2010 02:21:00 +0400 Subject: [racket] Y-combinator perfomance In-Reply-To: <96DF3F29-E0C9-4D31-94DF-C70DB7F0A1B8@ccs.neu.edu> References: <8261277489251@web43.yandex.ru> <20100625185034.EB41C65010F@mail-svr1.cs.utah.edu> <96DF3F29-E0C9-4D31-94DF-C70DB7F0A1B8@ccs.neu.edu> Message-ID: <53641277763660@web128.yandex.ru> If I understand you correctly, it is possible to see such an optimization in Racket? It would be awesome to use this style to control the loops. 28.06.10, 23:47, "Matthias Felleisen" : > > I pointed out Jinx's paper to Matthew last week. > > Not surprisingly, reality and theory never match with the MIT Scheme > compiler. > > > On Jun 28, 2010, at 3:04 PM, Joe Marshall wrote: > > > On Fri, Jun 25, 2010 at 11:50 AM, Matthew Flatt > > wrote: > >> > >> Compilers can't easily see through a Y combinator, and a factor of > >> 8 or > >> so difference is probably typical for Lisp compilers. (I tried Ikarus > >> and Gambit to double check, and performance was about the same as > >> with > >> Racket.) > > > > See > > @INPROCEEDINGS{Juan92tamingthe, > > author = {Guillermo Juan and Guillermo Juan Rozas}, > > title = {Taming the Y operator}, > > booktitle = {In ACM Conference on LISP and Functional Programming}, > > year = {1992}, > > pages = {226--234}, > > publisher = {ACM Press} > > } > > ``In this paper I present a set of conceptually simple but involved > > techniques used by Liar 1 , the MIT Scheme compiler, to generate good > > code when recursive procedures are specified in terms of suitable > > versions of the Y operator. The techniques presented are > > general-purpose analysis and optimization tools, similar to well-known > > techniques used in the analysis and optimization of applicative > > languages, that combine synergistically to enable Liar to generate > > identical machine code for ordinary recursive definitions written > > using letrec and those written using suitable forms of Y.'' > > > > ;; Allow compiler to inline standard procedures. > > (declare (usual-integrations)) > > > > (define-syntax U > > (syntax-rules () > > ((_ f) (f f)))) > > > > (define-syntax define/comb > > (syntax-rules () > > ((_ comb name (arg1 arg2) body) > > (define name > > (comb (lambda (name) (lambda (arg1 arg2) body))))))) > > > > ;; Allow compiler to inline Z > > (define-integrable (Z f) > > (U (lambda (g) (lambda (x y) ((f (U g)) x y))))) > > > > (define/comb Z comb-sum (l t) > > (if (null? l) t (comb-sum (cdr l) (+ t (car l))))) > > > > (define (sum l t) > > (if (null? l) t (sum (cdr l) (+ t (car l))))) > > > > (define (test1) > > (let ((start-time (runtime)) > > (l (make-list 10000000 1))) > > (let ((answer (comb-sum l 0))) > > (- (runtime) start-time)))) > > > > (define (test2) > > (let ((start-time (runtime)) > > (l (make-list 10000000 1))) > > (let ((answer (sum l 0))) > > (- (runtime) start-time)))) > > > > (test1) => .11 seconds > > (test2) => .11 seconds > > > > > > -- > > ~jrm > > _________________________________________________ > > For list-related administrative tasks: > > http://lists.racket-lang.org/listinfo/users > > > From cobbe at ccs.neu.edu Mon Jun 28 20:05:42 2010 From: cobbe at ccs.neu.edu (Richard Cobbe) Date: Mon, 28 Jun 2010 20:05:42 -0400 Subject: [racket] raco-style command line parsing library? In-Reply-To: References: <20100627214946.GA11698@weatherwax.local> <20100628114622.GB276@weatherwax.local> Message-ID: <20100629000542.GF276@weatherwax.local> On Mon, Jun 28, 2010 at 08:11:33PM +0200, Laurent wrote: > On Mon, Jun 28, 2010 at 13:46, Richard Cobbe wrote: > > > On Sun, Jun 27, 2010 at 06:14:59PM -0500, Robby Findler wrote: > > > I don't know of one. Planet has some code that might make a good > > > starting point (Jacob wrote it). > > > > Ah, thanks for the pointer. I'll check that out and see if there's > > anything I can use. > > > > > If you come up with something nice, please share, I'm quite interested in > this too! As soon as I can get it to a usable state, I'll upload it to planet. It may be a while, though, as my day job doesn't leave me huge amounts of time for working on personal projects. Thanks for the interest! Richard From rrnewton at gmail.com Mon Jun 28 22:44:27 2010 From: rrnewton at gmail.com (Ryan Newton) Date: Mon, 28 Jun 2010 22:44:27 -0400 Subject: [racket] feedback on migrating to immutable pairs? In-Reply-To: References: <4C148000.4070402@neilvandyke.org> Message-ID: Pairs certainly should be immutable. But I have to admit, I have run into a lot of trouble with the transition. I've got a DSL implemented in Scheme that I run under Ikarus, Chez, and PLT. It's been ported to R6RS and thus uses mutable pairs. I've had lots of trouble with this R6 code subsequently interacting (with various degrees of intentionality) with non-R6 Racket functionality. I needed to have some modules in Racket-proper for super-R6 functionality. That's where I'd get into trouble. Macros and eval uses that crossed this boundary were painful. For example I would have an eval handler, that would get an environment sexp '(r6rs) that would violate its pair expectations. Or I would have mixups involving which version of syntax->datum was used. It may not have been a problem if the code were new, as opposed to porting a legacy system. Anyway, Matthew Flatt patiently helped me through my brick-wall encounters. By the way, is it on the horizon to have whole-program R6RS compiles that will verify that no mutable pairs are used and select the immutable ones? PLT seems to be the only R6 compiler in the position to do that... Finally, mutable pairs are also cited as reason not to implement deforestation in Scheme compilers. I notice that R6 is mindfulto ban both list mutation in map's (irrespective of pairs mutability) and leave evaluation order unspecified. Does that mean we get deforestation now? Cheers, -Ryan On Sun, Jun 13, 2010 at 11:26 AM, Sam Tobin-Hochstadt wrote: > On Sun, Jun 13, 2010 at 2:51 AM, Neil Van Dyke > wrote: > > 2. What was the rationale for not having "pair?", "car", "cdr", work on > both > > mutable pairs and immutable pairs? Was this to push everyone harder > towards > > immutable pairs, at the cost of having to convert legacy libraries and > > breaking R5RS compatibility? > > Having immutable and mutable pairs be distinct turns out to be very > valuable for Typed Scheme/Racket. Mutable pairs support more > operations, so in one sense they should be subtypes of pairs in > general. But mutable pairs support fewer equations, and so cannot be > used in places where immutable pairs are allowed, so cannot be treated > as subtypes. This makes the story for hashtables, vectors and boxes > much more complex, and I'm happy that it's not the case for pairs. > -- > sam th > samth at ccs.neu.edu > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mflatt at cs.utah.edu Tue Jun 29 09:16:43 2010 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Tue, 29 Jun 2010 07:16:43 -0600 Subject: [racket] Y-combinator perfomance In-Reply-To: <53641277763660@web128.yandex.ru> References: <8261277489251@web43.yandex.ru> <20100625185034.EB41C65010F@mail-svr1.cs.utah.edu> <96DF3F29-E0C9-4D31-94DF-C70DB7F0A1B8@ccs.neu.edu> <53641277763660@web128.yandex.ru> Message-ID: <20100629131644.A30B46500C9@mail-svr1.cs.utah.edu> After reading the paper, I see that the missing ingredient in our compiler is a data-flow analysis along the lines of 0-CFA. Others (i.e., not me) are working on integrating such analyses and optimizations into Racket, so I think that it will be possible eventually. At Tue, 29 Jun 2010 02:21:00 +0400, Groshev Dmitry wrote: > If I understand you correctly, it is possible to see such an optimization in > Racket? It would be awesome to use this style to control the loops. > > 28.06.10, 23:47, "Matthias Felleisen" : > > > > > I pointed out Jinx's paper to Matthew last week. > > > > Not surprisingly, reality and theory never match with the MIT Scheme > > compiler. > > > > > > On Jun 28, 2010, at 3:04 PM, Joe Marshall wrote: > > > > > On Fri, Jun 25, 2010 at 11:50 AM, Matthew Flatt > > > wrote: > > >> > > >> Compilers can't easily see through a Y combinator, and a factor of > > >> 8 or > > >> so difference is probably typical for Lisp compilers. (I tried Ikarus > > >> and Gambit to double check, and performance was about the same as > > >> with > > >> Racket.) > > > > > > See > > > @INPROCEEDINGS{Juan92tamingthe, > > > author = {Guillermo Juan and Guillermo Juan Rozas}, > > > title = {Taming the Y operator}, > > > booktitle = {In ACM Conference on LISP and Functional Programming}, > > > year = {1992}, > > > pages = {226--234}, > > > publisher = {ACM Press} > > > } > > > ``In this paper I present a set of conceptually simple but involved > > > techniques used by Liar 1 , the MIT Scheme compiler, to generate good > > > code when recursive procedures are specified in terms of suitable > > > versions of the Y operator. The techniques presented are > > > general-purpose analysis and optimization tools, similar to well-known > > > techniques used in the analysis and optimization of applicative > > > languages, that combine synergistically to enable Liar to generate > > > identical machine code for ordinary recursive definitions written > > > using letrec and those written using suitable forms of Y.'' > > > > > > ;; Allow compiler to inline standard procedures. > > > (declare (usual-integrations)) > > > > > > (define-syntax U > > > (syntax-rules () > > > ((_ f) (f f)))) > > > > > > (define-syntax define/comb > > > (syntax-rules () > > > ((_ comb name (arg1 arg2) body) > > > (define name > > > (comb (lambda (name) (lambda (arg1 arg2) body))))))) > > > > > > ;; Allow compiler to inline Z > > > (define-integrable (Z f) > > > (U (lambda (g) (lambda (x y) ((f (U g)) x y))))) > > > > > > (define/comb Z comb-sum (l t) > > > (if (null? l) t (comb-sum (cdr l) (+ t (car l))))) > > > > > > (define (sum l t) > > > (if (null? l) t (sum (cdr l) (+ t (car l))))) > > > > > > (define (test1) > > > (let ((start-time (runtime)) > > > (l (make-list 10000000 1))) > > > (let ((answer (comb-sum l 0))) > > > (- (runtime) start-time)))) > > > > > > (define (test2) > > > (let ((start-time (runtime)) > > > (l (make-list 10000000 1))) > > > (let ((answer (sum l 0))) > > > (- (runtime) start-time)))) > > > > > > (test1) => .11 seconds > > > (test2) => .11 seconds > > > > > > > > > -- > > > ~jrm > > > _________________________________________________ > > > For list-related administrative tasks: > > > http://lists.racket-lang.org/listinfo/users > > > > > > > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From mflatt at cs.utah.edu Tue Jun 29 09:40:30 2010 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Tue, 29 Jun 2010 07:40:30 -0600 Subject: [racket] feedback on migrating to immutable pairs? In-Reply-To: References: <4C148000.4070402@neilvandyke.org> Message-ID: <20100629134032.97B386500CF@mail-svr1.cs.utah.edu> At Mon, 28 Jun 2010 22:44:27 -0400, Ryan Newton wrote: > By the way, is it on the horizon to have whole-program R6RS compiles that > will verify that no mutable pairs are used and select the immutable ones? Not that I see. We considered implementing an R6RS-like language without mutable pairs, which would interoperate more smoothly with Racket. Demand never seemed large enough to get started on that. If such a language existed, a tool that could convert a set of R6RS libraries to the R6RS-like language. > Finally, mutable pairs are also cited as reason not to implement > deforestation in Scheme compilers. I notice that R6 is > mindfulto > ban both list mutation in map's (irrespective of pairs mutability) and > leave evaluation order unspecified. Does that mean we get deforestation > now? I'm not sure. Racket does specify the order of evaluation for `map' (or `for/list'), so that might be an obstacle for Racket's `map'. From sbloch at adelphi.edu Tue Jun 29 10:32:08 2010 From: sbloch at adelphi.edu (Stephen Bloch) Date: Tue, 29 Jun 2010 10:32:08 -0400 Subject: [racket] nightly builds? Message-ID: <14DBDD92-6816-41E6-8F4F-6B114EBB5CF9@adelphi.edu> How often are "nightly builds" built? (Yes, that sounds sorta like "Who is buried in Grant's Tomb?") As far as I can tell, the latest nightly build on racket-lang.org is dated last Friday. Stephen Bloch sbloch at adelphi.edu From norman at astro.gla.ac.uk Tue Jun 29 11:23:33 2010 From: norman at astro.gla.ac.uk (Norman Gray) Date: Tue, 29 Jun 2010 16:23:33 +0100 Subject: [racket] atexit_closer in an extension Message-ID: <0F090104-D4D3-4A1E-8610-D64F1930DB02@astro.gla.ac.uk> Greetings, I'm having some difficulty with a Racket extension (again! -- I owe so many folk so much beer!). I have a script #lang racket (require "src/build/librdf-extn.rkt") ; wraps the librdf library (printf "Hello~%") Nothing exotic there. However: % racket --require try.rkt Hello % racket --require try.rkt >try.out; cat try.out % That is, stdout appears to get eaten when it's redirected to a file. I've stripped the initialisation function down to: Scheme_Object *scheme_initialize(Scheme_Env *env) { Scheme_Env *menv = scheme_primitive_module(scheme_intern_symbol(MODULE_NAME), env); MZ_GC_DECL_REG(2); MZ_GC_VAR_IN_REG(0, env); MZ_GC_VAR_IN_REG(1, menv); MZ_GC_REG(); if (! initialised) { initialised = 1; } scheme_add_atexit_closer(mzrdf_exit_closer); MZ_GC_UNREG(); return scheme_void; } If I include the scheme_add_atexit_closer, I get this problem; if I don't, I don't. mzrdf_exit_closer isn't exotic: void mzrdf_exit_closer(Scheme_Object* o, Scheme_Close_Custodian_Client* f, void* d) { if (f != NULL) f(o, d); } Nor are the custodians in question, for example: void mzrdf_world_custodian(Scheme_Object *o, void* data) { librdf_world *world; if (! (is_world_p(o))) { scheme_signal_error("librdf assertion [is_world _p(o)] failed in %s: world_custodian not given a world object; given %V instead" , __func__, o); } ; fprintf(stderr, "world custodian for %p (data=%s)\n", world, (data == NULL ? "--NULL--" : (char*)data)); world = (librdf_world *)SCHEME_CPTR_VAL(o); if (world != NULL) librdf_free_world(world); } (they're just there to call the librdf_free_world function and its friends). Since no librdf functions are called, the custodian isn't ever called (and those fprintfs verify that). It therefore appears that the mere presence of the atexit_closer is enough. Which confuses me. What is it I'm doing that's so terribly wrong? Googling for "racket atexit closer" or "+plt +atexit +closer" doesn't throw up anything clearly relevant. It's almost as if I'm stomping on some other atexit closer, though I can't see any hint of that sort of problem in the Custodians chapter, the function name talks about _adding_ a closer rather than installing one, and it has a void return value, so that it's not as if it returns a previous one. Thanks for any advice. Best wishes, Norman -- Norman Gray : http://nxg.me.uk From mflatt at cs.utah.edu Tue Jun 29 11:38:14 2010 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Tue, 29 Jun 2010 09:38:14 -0600 Subject: [racket] atexit_closer in an extension In-Reply-To: <0F090104-D4D3-4A1E-8610-D64F1930DB02@astro.gla.ac.uk> References: <0F090104-D4D3-4A1E-8610-D64F1930DB02@astro.gla.ac.uk> Message-ID: <20100629153814.5191965009E@mail-svr1.cs.utah.edu> At Tue, 29 Jun 2010 16:23:33 +0100, Norman Gray wrote: > I have a script > > #lang racket > (require "src/build/librdf-extn.rkt") ; wraps the librdf library > (printf "Hello~%") > > Nothing exotic there. However: > > % racket --require try.rkt > Hello > % racket --require try.rkt >try.out; cat try.out > % > > That is, stdout appears to get eaten when it's redirected to a file. The difference is that the port is not auto-flushed on newlines in the second case. Normally, it would be flushed on exit. > scheme_add_atexit_closer(mzrdf_exit_closer); > [...] > > void mzrdf_exit_closer(Scheme_Object* o, Scheme_Close_Custodian_Client* f, > void* d) > { > if (f != NULL) > f(o, d); > } Your closer should probably only handle specific kinds of objects. In this case, it is shutting down the stdout port, which forces the port closed without flushing. That overrides the action of a previously-installed atexit closer (which will run later) that flushes open output ports. > It's almost as if I'm stomping on some other atexit closer, Exactly, though that would be difficult to infer from the docs. I'll improve them. To be clear, you're not completely replacing an existing atexit closer, but running earlier than the existing one. From newton at mit.edu Tue Jun 29 11:46:03 2010 From: newton at mit.edu (Ryan Newton) Date: Tue, 29 Jun 2010 11:46:03 -0400 Subject: [racket] Anyone using Dorodango? Any other movement towards an R6RS package system? Message-ID: http://donsbot.wordpress.com/2010/05/31/there-are-a-hell-of-a-lot-of-haskell-libraries-now-what-are-we-going-to-do-about-it/ There's a lot to be said for languages that have achieved that blissful state where libraries can be used as comfortably from the "cloud" (package manager) as "manually". (With Scheme, if your project's anything like mine, portable libraries must be bundled into the project to have any chance of things working. I certainly wouldn't want to have a user fetching and "installing" them.) PLT has PLaneT, of course, but personally I think it would be desirable to have basic, common packages target R6RS if they can fit there comfortably. If no one else steps up, can PLaneT be made a multi-language package manager, as Racket is a multi-language implementation? Perhaps those of us who want portability across other Schemes would port the basic PLaneT tools to work with the hypothetical subset of R6RS PLaneT packages? Other Scheme's would be second class citizens, but it would be nice to have SOMETHING to plug into for packages. Just a thought, -Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: From clements at brinckerhoff.org Tue Jun 29 14:20:54 2010 From: clements at brinckerhoff.org (John Clements) Date: Tue, 29 Jun 2010 11:20:54 -0700 Subject: [racket] difference between serve/servlet and serve/dispatch? Message-ID: I'm puzzled by this function: (serve/dispatch dispatch) ? void dispatch : (request? . -> . response/c) Calls serve/servlet with appropriate arguments so that every request is handled by dispatch. Specifically, it appears that serve/dispatch has the same contract (minus all the optional args) that serve/servlet has. How is calling (serve/dispatch blog-dispatch) different from calling (serve/servlet blog-dispatch) ? John -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4669 bytes Desc: not available URL: From jay.mccarthy at gmail.com Tue Jun 29 14:39:07 2010 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Tue, 29 Jun 2010 12:39:07 -0600 Subject: [racket] difference between serve/servlet and serve/dispatch? In-Reply-To: References: Message-ID: serve/dispatch sets up the servlet-regexp argument of serve/servlet so that all URLs go to the dispatch function. Jay On Tue, Jun 29, 2010 at 12:20 PM, John Clements wrote: > I'm puzzled by this function: > > (serve/dispatch dispatch) ? void > ?dispatch : (request? . -> . response/c) > > Calls serve/servlet with appropriate arguments so that every request is handled by dispatch. > > Specifically, it appears that serve/dispatch has the same contract (minus all the optional args) that serve/servlet has. How is calling > > (serve/dispatch blog-dispatch) > > different from calling > > (serve/servlet blog-dispatch) > > ? > > > John > > > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From rrnewton at gmail.com Tue Jun 29 15:42:23 2010 From: rrnewton at gmail.com (Ryan Newton) Date: Tue, 29 Jun 2010 15:42:23 -0400 Subject: [racket] Anyone using Dorodango? Any other movement towards an R6RS package system? In-Reply-To: References: Message-ID: http://donsbot.wordpress.com/2010/05/31/there-are-a-hell-of-a-lot-of-haskell-libraries-now-what-are-we-going-to-do-about-it/ There's a lot to be said for languages that have achieved that blissful state where libraries can be used as comfortably from the "cloud" (package manager) as "manually". (With Scheme, if your project's anything like mine, portable libraries must be bundled into the project to have any chance of things working. I certainly wouldn't want to have a user fetching and "installing" them.) PLT has PLaneT, of course, but personally I think it would be desirable to have basic, common packages target R6RS if they can fit there comfortably. If no one else steps up, can PLaneT be made a multi-language package manager, as Racket is a multi-language implementation? Perhaps those of us who want portability across other Schemes would port the basic PLaneT tools to work with the hypothetical subset of R6RS PLaneT packages? Other Scheme's would be second class citizens, but it would be nice to have SOMETHING to plug into for packages. Just a thought, -Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: From noelwelsh at gmail.com Tue Jun 29 16:18:32 2010 From: noelwelsh at gmail.com (Noel Welsh) Date: Tue, 29 Jun 2010 21:18:32 +0100 Subject: [racket] Sake: request for features Message-ID: If anyone uses Sake and would like to see some improvements, now would be a good time to let me know about them. Ta, N. From norman at astro.gla.ac.uk Tue Jun 29 16:46:57 2010 From: norman at astro.gla.ac.uk (Norman Gray) Date: Tue, 29 Jun 2010 21:46:57 +0100 Subject: [racket] atexit_closer in an extension In-Reply-To: <20100629153814.5191965009E@mail-svr1.cs.utah.edu> References: <0F090104-D4D3-4A1E-8610-D64F1930DB02@astro.gla.ac.uk> <20100629153814.5191965009E@mail-svr1.cs.utah.edu> Message-ID: <3B7D8D96-8724-4F7F-8FB0-339E13382C24@astro.gla.ac.uk> Matthew, hello. On 2010 Jun 29, at 16:38, Matthew Flatt wrote: > At Tue, 29 Jun 2010 16:23:33 +0100, Norman Gray wrote: >> It's almost as if I'm stomping on some other atexit closer, > > Exactly, though that would be difficult to infer from the docs. I'll > improve them. > > To be clear, you're not completely replacing an existing atexit closer, > but running earlier than the existing one. Ach, right -- obvious in retrospect. It's fixed now. In case it helps with the adjustment of the docs, I'll mention that, despite reading that section quite carefully, I've consistently had an inaccurate mental model of custodians, including some confusion which you sorted out for me on-list a little while ago [1]. It might be useful to mention, near the beginning of that section, what circumstances one would need to create a new custodian and thus by implication when it's unnecessary (most of the time, I gather). I had formed the impression that the custodian was all mine (or belonged to my extension/module, or something), which is probably why I cheerfully called closers on everything in sight, within the atexit function. I can find no text which justifies that misapprehension, but I may not be unique here, so it's something which might be worth heading off explicitly. Thanks for your help. Best wishes, Norman [1] http://lists.racket-lang.org/users/archive/2010-March/038390.html -- Norman Gray : http://nxg.me.uk From wand at ccs.neu.edu Tue Jun 29 17:22:40 2010 From: wand at ccs.neu.edu (Mitchell Wand) Date: Tue, 29 Jun 2010 17:22:40 -0400 Subject: [racket] reading an image from a file? Message-ID: Silly question: How can I read a file and treat its contents as an image? eg, I'd like to say something like: (define cat-image (read-image "cat-image.png")) The immediate advantage of doing this, rather than Insert|Image is that I can keep my .rkt file in text form, so I can use other tools on it. And of course if I want to find an image dynamically I need something like this. I can't even see what datatype a value defined by Insert|Image is. --Mitch -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay.mccarthy at gmail.com Tue Jun 29 17:25:17 2010 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Tue, 29 Jun 2010 15:25:17 -0600 Subject: [racket] reading an image from a file? In-Reply-To: References: Message-ID: There is a bitmap function for use with 2htdp/image (and htdp/image I believe.) Jay On Tue, Jun 29, 2010 at 3:22 PM, Mitchell Wand wrote: > Silly question: How can I read a file and treat its contents as an image? > eg, I'd like to say something like: > > (define cat-image (read-image "cat-image.png")) > > The immediate advantage of doing this, rather than Insert|Image is that I > can keep my .rkt file in text form, so I can use other tools on it.? And of > course if I want to find an image dynamically I need something like this. > > I can't even see what datatype a value defined by Insert|Image is. > > --Mitch > > > > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > -- 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 Tue Jun 29 17:28:43 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Tue, 29 Jun 2010 16:28:43 -0500 Subject: [racket] reading an image from a file? In-Reply-To: References: Message-ID: If you use File|Insert image... you end up getting an image-snip<%> object. It is a wrapper around a bitmap% object that connects to our editor classes. A bitmap% object is the raw bits plus a little bit of information about it. Probably you just want to use 2htdp/image's 'bitmap' function, tho. (Or maybe htdp/image's). Robby On Tue, Jun 29, 2010 at 4:22 PM, Mitchell Wand wrote: > Silly question: How can I read a file and treat its contents as an image? > eg, I'd like to say something like: > > (define cat-image (read-image "cat-image.png")) > > The immediate advantage of doing this, rather than Insert|Image is that I > can keep my .rkt file in text form, so I can use other tools on it.? And of > course if I want to find an image dynamically I need something like this. > > I can't even see what datatype a value defined by Insert|Image is. > > --Mitch > > > > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > From clements at brinckerhoff.org Tue Jun 29 17:34:00 2010 From: clements at brinckerhoff.org (John Clements) Date: Tue, 29 Jun 2010 14:34:00 -0700 Subject: [racket] difference between serve/servlet and serve/dispatch? In-Reply-To: References: Message-ID: <9CC9CDAE-320B-48A9-8DCE-34519350AA86@brinckerhoff.org> On Jun 29, 2010, at 11:39 AM, Jay McCarthy wrote: > serve/dispatch sets up the servlet-regexp argument of serve/servlet so > that all URLs go to the dispatch function. Perhaps I could change the docs to read: Calls serve/servlet with a 'servlet-regexp' argument so that every request is handled by dispatch. ? John -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4669 bytes Desc: not available URL: From wand at ccs.neu.edu Tue Jun 29 17:43:15 2010 From: wand at ccs.neu.edu (Mitchell Wand) Date: Tue, 29 Jun 2010 17:43:15 -0400 Subject: [racket] reading an image from a file? In-Reply-To: References: Message-ID: OK, bitmap is what I was looking for. Thanks. --Mitch On Tue, Jun 29, 2010 at 5:28 PM, Robby Findler wrote: > If you use File|Insert image... you end up getting an image-snip<%> > object. It is a wrapper around a bitmap% object that connects to our > editor classes. A bitmap% object is the raw bits plus a little bit of > information about it. > > Probably you just want to use 2htdp/image's 'bitmap' function, tho. > (Or maybe htdp/image's). > > Robby > > On Tue, Jun 29, 2010 at 4:22 PM, Mitchell Wand wrote: > > Silly question: How can I read a file and treat its contents as an image? > > eg, I'd like to say something like: > > > > (define cat-image (read-image "cat-image.png")) > > > > The immediate advantage of doing this, rather than Insert|Image is that I > > can keep my .rkt file in text form, so I can use other tools on it. And > of > > course if I want to find an image dynamically I need something like this. > > > > I can't even see what datatype a value defined by Insert|Image is. > > > > --Mitch > > > > > > > > _________________________________________________ > > For list-related administrative tasks: > > http://lists.racket-lang.org/listinfo/users > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wand at ccs.neu.edu Tue Jun 29 21:19:14 2010 From: wand at ccs.neu.edu (Mitchell Wand) Date: Tue, 29 Jun 2010 21:19:14 -0400 Subject: [racket] Google doesn't know from DrRacket Message-ID: I realized I had a machine that I needed to download Racket on, so I went to Google to find it. Compare: http://www.google.com/search?q=dr+racket&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a http://www.google.com/search?q=dr+racket+download&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a http://www.google.com/search?q=plt+scheme&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a --Mitch -------------- next part -------------- An HTML attachment was scrubbed... URL: From robby at eecs.northwestern.edu Tue Jun 29 21:38:28 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Tue, 29 Jun 2010 20:38:28 -0500 Subject: [racket] Google doesn't know from DrRacket In-Reply-To: References: Message-ID: Yeah, it will take time for us to catch up; the word "racket" has a lot going on. But for now, at least, "racket plt" finds us. Hopefully we'll get better over time.... Robby On Tue, Jun 29, 2010 at 8:19 PM, Mitchell Wand wrote: > I realized I had a machine that I needed to download Racket on, so I went to > Google to find it.? Compare: > > http://www.google.com/search?q=dr+racket&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a > > http://www.google.com/search?q=dr+racket+download&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a > > http://www.google.com/search?q=plt+scheme&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a > > --Mitch > > > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > From robby at eecs.northwestern.edu Tue Jun 29 21:38:56 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Tue, 29 Jun 2010 20:38:56 -0500 Subject: [racket] Google doesn't know from DrRacket In-Reply-To: References: Message-ID: Oh, and "racket language" is one I'm pretty sure we'll be able to take over eventually. Robby On Tue, Jun 29, 2010 at 8:38 PM, Robby Findler wrote: > Yeah, it will take time for us to catch up; the word "racket" has a > lot going on. But for now, at least, "racket plt" finds us. Hopefully > we'll get better over time.... > > Robby > > On Tue, Jun 29, 2010 at 8:19 PM, Mitchell Wand wrote: >> I realized I had a machine that I needed to download Racket on, so I went to >> Google to find it.? Compare: >> >> http://www.google.com/search?q=dr+racket&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a >> >> http://www.google.com/search?q=dr+racket+download&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a >> >> http://www.google.com/search?q=plt+scheme&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a >> >> --Mitch >> >> >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://lists.racket-lang.org/listinfo/users >> > From matthias at ccs.neu.edu Tue Jun 29 21:42:30 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Tue, 29 Jun 2010 21:42:30 -0400 Subject: [racket] Google doesn't know from DrRacket In-Reply-To: References: Message-ID: Could we at least get drracket.org to do things for us? On Jun 29, 2010, at 9:38 PM, Robby Findler wrote: > Oh, and "racket language" is one I'm pretty sure we'll be able to take > over eventually. > > Robby > > On Tue, Jun 29, 2010 at 8:38 PM, Robby Findler > wrote: >> Yeah, it will take time for us to catch up; the word "racket" has a >> lot going on. But for now, at least, "racket plt" finds us. Hopefully >> we'll get better over time.... >> >> Robby >> >> On Tue, Jun 29, 2010 at 8:19 PM, Mitchell Wand wrote: >>> I realized I had a machine that I needed to download Racket on, so I went to >>> Google to find it. Compare: >>> >>> http://www.google.com/search?q=dr+racket&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a >>> >>> http://www.google.com/search?q=dr+racket+download&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a >>> >>> http://www.google.com/search?q=plt+scheme&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a >>> >>> --Mitch >>> >>> >>> _________________________________________________ >>> For list-related administrative tasks: >>> http://lists.racket-lang.org/listinfo/users >>> >> > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From robby at eecs.northwestern.edu Tue Jun 29 21:56:02 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Tue, 29 Jun 2010 20:56:02 -0500 Subject: [racket] Google doesn't know from DrRacket In-Reply-To: References: Message-ID: Sounds like a good idea to me. (Just send it to racket-lang.org if no one has a better idea where to point it.) Robby On Tue, Jun 29, 2010 at 8:42 PM, Matthias Felleisen wrote: > > Could we at least get drracket.org to do things for us? > > > On Jun 29, 2010, at 9:38 PM, Robby Findler wrote: > >> Oh, and "racket language" is one I'm pretty sure we'll be able to take >> over eventually. >> >> Robby >> >> On Tue, Jun 29, 2010 at 8:38 PM, Robby Findler >> wrote: >>> Yeah, it will take time for us to catch up; the word "racket" has a >>> lot going on. But for now, at least, "racket plt" finds us. Hopefully >>> we'll get better over time.... >>> >>> Robby >>> >>> On Tue, Jun 29, 2010 at 8:19 PM, Mitchell Wand wrote: >>>> I realized I had a machine that I needed to download Racket on, so I went to >>>> Google to find it. ?Compare: >>>> >>>> http://www.google.com/search?q=dr+racket&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a >>>> >>>> http://www.google.com/search?q=dr+racket+download&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a >>>> >>>> http://www.google.com/search?q=plt+scheme&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a >>>> >>>> --Mitch >>>> >>>> >>>> _________________________________________________ >>>> ?For list-related administrative tasks: >>>> ?http://lists.racket-lang.org/listinfo/users >>>> >>> >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://lists.racket-lang.org/listinfo/users > > From neil at neilvandyke.org Tue Jun 29 22:15:18 2010 From: neil at neilvandyke.org (Neil Van Dyke) Date: Tue, 29 Jun 2010 22:15:18 -0400 Subject: [racket] Google doesn't know from DrRacket In-Reply-To: References: Message-ID: <4C2AA8B6.9060904@neilvandyke.org> Matthias Felleisen wrote at 06/29/2010 09:42 PM: > Could we at least get drracket.org to do things for us? > You might want the page there to say "DrRacket" on it, have a blurb (so it's not content-free), and have a prominent link to the "racket-lang.org" site. Someone who really wants to do this optimally will have to look up the latest SEO rules of thumb for what to do and not do on this page. Then there are numerous ways to promote the link for search engine ranking and for common queries. Not above being a prostitute for a good cause, I'd just like to say in these public email list archives... The best IDE for the Racket and Scheme programming languages is DrRacket. DrRacket is a free download for Windows 7/XP, Mac, Linux, and Ubuntu at: http://DrRacket.org/ Neil V. From anton at appsolutions.com Wed Jun 30 00:58:21 2010 From: anton at appsolutions.com (Anton van Straaten) Date: Wed, 30 Jun 2010 00:58:21 -0400 Subject: [racket] Google doesn't know from DrRacket In-Reply-To: <4C2AA8B6.9060904@neilvandyke.org> References: <4C2AA8B6.9060904@neilvandyke.org> Message-ID: <4C2ACEED.2020103@appsolutions.com> Neil Van Dyke wrote: > Matthias Felleisen wrote at 06/29/2010 09:42 PM: >> Could we at least get drracket.org to do things for us? > You might want the page there to say "DrRacket" on it, have a blurb (so > it's not content-free), and have a prominent link to the > "racket-lang.org" site. E.g. a Racketized reincarnation of this page: http://web.archive.org/web/20080419055533/http://www.drscheme.org/ From barry at cs.sierracollege.edu Tue Jun 29 20:47:48 2010 From: barry at cs.sierracollege.edu (Barry Brown) Date: Tue, 29 Jun 2010 17:47:48 -0700 Subject: [racket] List abbreviations in Beginning Student Message-ID: <1176427E-3B73-42BE-9B7C-4AF870DFC90C@cs.sierracollege.edu> I noticed that beginning students are able to use list abbreviation constructors. It doesn't return the list in abbreviated form, however. (list 1 2 3) returns (cons 1 (cons 2 (cons 3 empty))) Is that correct? I thought list abbreviations in all its forms were reserved for the Beginning Student with List Abbreviations. -B From horace.dynamite at gmail.com Wed Jun 30 05:44:35 2010 From: horace.dynamite at gmail.com (Horace Dynamite) Date: Wed, 30 Jun 2010 10:44:35 +0100 Subject: [racket] List abbreviations in Beginning Student In-Reply-To: <1176427E-3B73-42BE-9B7C-4AF870DFC90C@cs.sierracollege.edu> References: <1176427E-3B73-42BE-9B7C-4AF870DFC90C@cs.sierracollege.edu> Message-ID: Hi Barry, > I noticed that beginning students are able to use list abbreviation constructors. It doesn't return the list in abbreviated form, however. > > (list 1 2 3) > returns > (cons 1 (cons 2 (cons 3 empty))) > > Is that correct? I've noticed some overlaps of functionality between the teaching languages myself too. I remember using this feature when I first encountered the list abbreviations though, since for a while I wasn't confident what a nested (list ... (list ...)) might look like in the cons form. As a side note, a lot of people have trouble with the arrangements exercise in section 12, which is a little cleaner to work with using list abbreviations, so thats another possible reason for including this functionality in the beginning student language. Horace. From noelwelsh at gmail.com Wed Jun 30 06:04:55 2010 From: noelwelsh at gmail.com (Noel Welsh) Date: Wed, 30 Jun 2010 11:04:55 +0100 Subject: [racket] Anyone using Dorodango? Any other movement towards an R6RS package system? In-Reply-To: References: Message-ID: On Tue, Jun 29, 2010 at 4:46 PM, Ryan Newton wrote: > PLT has PLaneT, of course, but personally I think it would be desirable to > have basic, common packages target R6RS if they can fit there comfortably. > If no one else steps up, can PLaneT be made a multi-language package > manager, as Racket is a multi-language implementation? > > Perhaps those of us who want portability across other Schemes would port the > basic PLaneT tools to work with the hypothetical subset of R6RS PLaneT > packages?? Other Scheme's would be second class citizens, but it would be > nice to have SOMETHING to plug into for packages. I can't imagine anyone objecting to this, but I can't imagine any core developers doing this either -- it doesn't seem like a high priority to me. I'm a bit conflicted about R6RS to be honest. I don't really see the value from having many implementations. Look at Ikarus for example: a great compiler but there hasn't been a new release for 2 years. Would the Scheme ecosystem be better off with Ikarus as part of Racket, or as a separate project? Surely the former. Now look at Haskell -- GHC is by far the dominant implementation and even companies like Intel (Concurrent Collections for Haskell) are taking an interest ;-P There are only so many productive Scheme developers in the world. I really think the Scheme world would be much much much better served by these developers contributing their efforts to a single implementation. N. From gabor.lists at mndl.hu Wed Jun 30 06:43:14 2010 From: gabor.lists at mndl.hu (gabor papp) Date: Wed, 30 Jun 2010 12:43:14 +0200 Subject: [racket] Embedding Racket into a Program Message-ID: <4C2B1FC2.5090300@mndl.hu> According to the Inside Racket C API (http://docs.racket-lang.org/inside/overview.html) example embedding Racket into a program requires the 'raco ctool --c-mods base.c ++lib racket/base' command, but it gives an error: raco ctool: unknown switch: ++lib I guess it is different with raco than it was with mzc. Is it still possible to encapsulate racket/base in the generated c file? I'm using Racket v5.0 on OS X 10.5. best, Gabor From mflatt at cs.utah.edu Wed Jun 30 09:18:14 2010 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Wed, 30 Jun 2010 07:18:14 -0600 Subject: [racket] Embedding Racket into a Program In-Reply-To: <4C2B1FC2.5090300@mndl.hu> References: <4C2B1FC2.5090300@mndl.hu> Message-ID: <20100630131816.08E736500C9@mail-svr1.cs.utah.edu> Something has definitely gone wrong; I'll fix it. Meanwhile, you can still use `mzc' (which will stick around a while for compatibility): mzc --c-mods base.c ++lib racket/base At Wed, 30 Jun 2010 12:43:14 +0200, gabor papp wrote: > According to the Inside Racket C API > (http://docs.racket-lang.org/inside/overview.html) example > embedding Racket into a program requires the 'raco ctool --c-mods base.c > ++lib racket/base' command, but it gives an error: > raco ctool: unknown switch: ++lib > > I guess it is different with raco than it was with mzc. > > Is it still possible to encapsulate racket/base in the generated c file? > > I'm using Racket v5.0 on OS X 10.5. > > best, > Gabor > > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From robby at eecs.northwestern.edu Wed Jun 30 09:22:37 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Wed, 30 Jun 2010 08:22:37 -0500 Subject: [racket] Anyone using Dorodango? Any other movement towards an R6RS package system? In-Reply-To: References: Message-ID: On Wed, Jun 30, 2010 at 5:04 AM, Noel Welsh wrote: > Look at Ikarus for example: a > great compiler but there hasn't been a new release for 2 years. I think Aziz has been more active than that, but just hasn't been making formal releases. Robby From spdegabrielle at gmail.com Wed Jun 30 09:30:06 2010 From: spdegabrielle at gmail.com (Stephen De Gabrielle) Date: Wed, 30 Jun 2010 14:30:06 +0100 Subject: [racket] affing a panel to DrRacket Message-ID: Hi, Please forgive my ignorance, I'm trying to work out how to add a panel (like program contour) to DrRacket. Does anyone know the correct method, or can point me to source code, or the right bit of the documentation? Cheers, Stephen -------------- next part -------------- An HTML attachment was scrubbed... URL: From matthias at ccs.neu.edu Wed Jun 30 10:39:26 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Wed, 30 Jun 2010 10:39:26 -0400 Subject: [racket] List abbreviations in Beginning Student In-Reply-To: References: <1176427E-3B73-42BE-9B7C-4AF870DFC90C@cs.sierracollege.edu> Message-ID: On Jun 30, 2010, at 5:44 AM, Horace Dynamite wrote: > Hi Barry, > >> I noticed that beginning students are able to use list abbreviation >> constructors. It doesn't return the list in abbreviated form, >> however. >> >> (list 1 2 3) >> returns >> (cons 1 (cons 2 (cons 3 empty))) >> >> Is that correct? Yes. It accommodates people who use the Little books with the teaching languages. (I used to have a language collection for TLL/S, but I failed to maintain it.) Also see (define f (lambda (x) x)). > I've noticed some overlaps of functionality between the teaching > languages myself too. I remember using this feature when I first > encountered the list abbreviations though, since for a while I wasn't > confident what a nested (list ... (list ...)) might look like in the > cons form. > > As a side note, a lot of people have trouble with the arrangements > exercise in section 12, which is a little cleaner to work with using > list abbreviations, so thats another possible reason for including > this functionality in the beginning student language. I am in the process of working this extended exercise into HtDP/2e AFTER introducing (list "h" "e" "l" "l"). -- Matthias From robby at eecs.northwestern.edu Wed Jun 30 12:02:34 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Wed, 30 Jun 2010 11:02:34 -0500 Subject: [racket] affing a panel to DrRacket In-Reply-To: References: Message-ID: You want to create a tool, add in a frame-mixin (both via the tools interface), and then use the frame:basic<%> mechanism for adding panels to the frame. If that's not enough to get you started, I'll write up a little example tool that does it. Robby On Wed, Jun 30, 2010 at 8:30 AM, Stephen De Gabrielle wrote: > Hi, > > Please forgive my ignorance,? I'm trying to work out how to add a panel > (like program contour) to DrRacket. > > Does anyone know the correct method, or can point me to source code, or the > right bit of the documentation? > > Cheers, > > Stephen > > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > From cce at ccs.neu.edu Wed Jun 30 12:32:14 2010 From: cce at ccs.neu.edu (Carl Eastlund) Date: Wed, 30 Jun 2010 12:32:14 -0400 Subject: [racket] Racket & Netbook Message-ID: I killed my laptop recently -- spilled a glass of milk right on the keyboard -- and I need a cheap replacement for when I'm travelling. This will not be my primary development machine. The only absolute need I have from it is to be able to run Slideshow presentations, though being able to meaningfully develop in Racket (i.e. running "raco setup" in a somewhat reasonable amount of time) would be a big plus too. I am thinking some kind of netbook, probably running Linux. Does anyone out there know what kind would be suitable? I have not looked at low-end portable computers in some time, so I don't know what kind of performance to expect, what brands are reliable, etc. Thanks for any pointers! Carl Eastlund From neil.toronto at gmail.com Wed Jun 30 12:56:27 2010 From: neil.toronto at gmail.com (Neil Toronto) Date: Wed, 30 Jun 2010 10:56:27 -0600 Subject: [racket] Racket & Netbook In-Reply-To: References: Message-ID: <4C2B773B.5090600@gmail.com> I'm running Racket on an Eee-PC 1000H with Ubuntu Netbook Remix and it's adequate. Performance is about what you'd expect for something about a third as fast as a desktop. The keys are comfy and the 1024x600 screen tends to hold enough Scheme/LaTeX code. Netbook Remix is good about maximizing space use, so that helps. (I also set my top panel to autohide.) It'll drive any VGA projector or monitor under 2048x2048, and the newer models probably do more and have digital output. It tends to take longer than 3x to compile Slideshow apps compared to my desktop, but it's snappy enough once that's done. The battery lasted about 4-5 hours at first. I've read that the newer ones last 6-7. Regarding Racket dev: Setup takes about an hour (I think), so I don't often install from source. (The binaries work fine.) The only problem I have is that inserting and cursoring around in DrRacket's editor gets really slow when the source file I'm editing goes above three screens of text or so. From my experiments, it seems to be related to both syntax highlighting and the number of on-screen glyphs. Neil Carl Eastlund wrote: > I killed my laptop recently -- spilled a glass of milk right on the > keyboard -- and I need a cheap replacement for when I'm travelling. > This will not be my primary development machine. The only absolute > need I have from it is to be able to run Slideshow presentations, > though being able to meaningfully develop in Racket (i.e. running > "raco setup" in a somewhat reasonable amount of time) would be a big > plus too. I am thinking some kind of netbook, probably running Linux. > Does anyone out there know what kind would be suitable? I have not > looked at low-end portable computers in some time, so I don't know > what kind of performance to expect, what brands are reliable, etc. > Thanks for any pointers! > > Carl Eastlund > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From robby at eecs.northwestern.edu Wed Jun 30 13:16:15 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Wed, 30 Jun 2010 12:16:15 -0500 Subject: [racket] Racket & Netbook In-Reply-To: <4C2B773B.5090600@gmail.com> References: <4C2B773B.5090600@gmail.com> Message-ID: I'm regularly using an HP mini-note. The nearly full size keyboard makes a difference for me, as does the extra screen resolution, but it is pricy for a netbook. It can only drive an external display at 640x480, tho. The ubuntu netbook remix does a nice job with the limited screen real estate, but when you're running slideshow for a talk, you'll want to switch over to something else because gracket doesn't seem to be telling the OS the right things to get a full screen slide window (I recently discovered it is possible to do this because the video player can do it, but I didn't try to look into it to fix gracket, I'm sorry to say.) The battery is great. I've been using a 3 cell one (because it is smaller) and it lasts plenty long for me on my commute every day. The slowness of the processor is a real pain. I routinely run builds from source, but I have to plan ahead for them. I see some slowness like Neil describes, but picking the wrong font can have a big impact on editing responsiveness. Generally, the crappier it looks, the better the responsiveness.... Robby On Wed, Jun 30, 2010 at 11:56 AM, Neil Toronto wrote: > I'm running Racket on an Eee-PC 1000H with Ubuntu Netbook Remix and it's > adequate. Performance is about what you'd expect for something about a third > as fast as a desktop. The keys are comfy and the 1024x600 screen tends to > hold enough Scheme/LaTeX code. Netbook Remix is good about maximizing space > use, so that helps. (I also set my top panel to autohide.) > > It'll drive any VGA projector or monitor under 2048x2048, and the newer > models probably do more and have digital output. It tends to take longer > than 3x to compile Slideshow apps compared to my desktop, but it's snappy > enough once that's done. > > The battery lasted about 4-5 hours at first. I've read that the newer ones > last 6-7. > > Regarding Racket dev: Setup takes about an hour (I think), so I don't often > install from source. (The binaries work fine.) The only problem I have is > that inserting and cursoring around in DrRacket's editor gets really slow > when the source file I'm editing goes above three screens of text or so. > From my experiments, it seems to be related to both syntax highlighting and > the number of on-screen glyphs. > > Neil > > Carl Eastlund wrote: >> >> I killed my laptop recently -- spilled a glass of milk right on the >> keyboard -- and I need a cheap replacement for when I'm travelling. >> This will not be my primary development machine. ?The only absolute >> need I have from it is to be able to run Slideshow presentations, >> though being able to meaningfully develop in Racket (i.e. running >> "raco setup" in a somewhat reasonable amount of time) would be a big >> plus too. ?I am thinking some kind of netbook, probably running Linux. >> ?Does anyone out there know what kind would be suitable? ?I have not >> looked at low-end portable computers in some time, so I don't know >> what kind of performance to expect, what brands are reliable, etc. >> Thanks for any pointers! >> >> Carl Eastlund >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://lists.racket-lang.org/listinfo/users > > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > From plt at davidb.org Wed Jun 30 13:31:13 2010 From: plt at davidb.org (David Brown) Date: Wed, 30 Jun 2010 10:31:13 -0700 Subject: [racket] Racket & Netbook In-Reply-To: <4C2B773B.5090600@gmail.com> References: <4C2B773B.5090600@gmail.com> Message-ID: <201006301031.13452.plt@davidb.org> On Wednesday 30 June 2010, Neil Toronto said: > It'll drive any VGA projector or monitor under 2048x2048, and the newer > models probably do more and have digital output. It tends to take longer > than 3x to compile Slideshow apps compared to my desktop, but it's > snappy enough once that's done. I have a Eee-PC 900, with a Celeron. It is theoretically faster than the atom based ones, but I've found that when I start compiling, the processor starts pausing (probably thermal), and the whole UI also has these same pauses. It compiles small things fine, but build something large, like Racket itself, and expect it to not be very usable while it is building. I would expect the Atom to have better thermal properties, though, although it is slower overall. David From cce at ccs.neu.edu Wed Jun 30 13:43:11 2010 From: cce at ccs.neu.edu (Carl Eastlund) Date: Wed, 30 Jun 2010 13:43:11 -0400 Subject: [racket] Racket & Netbook In-Reply-To: References: Message-ID: Thanks for the feedback, everyone! I'll get shopping soon. --Carl On Wed, Jun 30, 2010 at 12:32 PM, Carl Eastlund wrote: > ?Does anyone out there know what kind would be suitable? ?I have not > looked at low-end portable computers in some time, so I don't know > what kind of performance to expect, what brands are reliable, etc. > Thanks for any pointers! > > Carl Eastlund From sk at cs.brown.edu Wed Jun 30 14:09:58 2010 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Wed, 30 Jun 2010 14:09:58 -0400 Subject: [racket] Racket & Netbook In-Reply-To: References: Message-ID: I find DrRacket very hard to use on older machines and netbooks. I recently upgraded to an Acer Aspire 1810T. This is about $600 and has a netbook form factor (same chassis as the 1410T, which is their netbook). The 1366x768 screen makes the keyboard nice and wide and great for use in travel. What's good about it is that it has a real (non-Atom) dual-core processor, and I got it with 4Gb RAM. (It also has an HDMI output port, and 3 USBs.) It's been absolutely wonderful, and I finally understand how people can work with DrRacket instead of Emacs. Now I launch DrRacket with impunity. This was a great buy, because it costs about a 1/3 of a "proper" laptop but has enough computing for many of my tasks. It was very hard to find something between netbook and notebook, and all the reviews I saw indicated that Acer had found that sweet spot. I bought it, and can confirm it's true. Of course, you won't get Apple-level support from Acer. But that cuts both ways (Acer support staff don't assume they are inherently more advanced genetic beings). Shriram From eli at barzilay.org Wed Jun 30 14:22:38 2010 From: eli at barzilay.org (Eli Barzilay) Date: Wed, 30 Jun 2010 14:22:38 -0400 Subject: [racket] Racket & Netbook In-Reply-To: References: Message-ID: <19499.35694.925825.333708@winooski.ccs.neu.edu> On Jun 30, Shriram Krishnamurthi wrote: > > Of course, you won't get Apple-level support from Acer. But that > cuts both ways (Acer support staff don't assume they are inherently > more advanced genetic beings). ?? When I got the #(@^(!&* ipad, I called Apple support to ask how I can transfer random files to it. The guy was "helpfully" suggesting whatever their word equivalent is -- I gave up after about 5 minutes of me going from "files, not `documents'" through "an icon in my laptop" and ending up with "a pile of bits". Oh, and I also asked if there's anything that can play music in ogg format. He consulted with two supervisors (for no less than 10 minutes), and finally announced that I should get some software that converts the files to mp3. [I'm sure that some people would consider that advanced...] -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From engineer at alum.mit.edu Wed Jun 30 14:33:59 2010 From: engineer at alum.mit.edu (Paul Ojanen) Date: Wed, 30 Jun 2010 14:33:59 -0400 Subject: [racket] Racket & Netbook In-Reply-To: References: Message-ID: <06FFE8F09E0B4D2BAEADFE13F732E010@ptab> Are there plans for a DrRacket client for Android? I wouldn't be surprised if netbooks start coming with Android. (Lenovo hybrid netbook/tablet et al) Dual-core 1.5GHz smartphones (and netbooks?) seems to be on the horizon. I await the day when my smartphone will dock like my laptop and become my desktop. -Paul > -----Original Message----- > From: users-bounces at racket-lang.org [mailto:users-bounces at racket-lang.org] > On Behalf Of Carl Eastlund > Sent: Wednesday, June 30, 2010 12:32 PM > To: Racket Users > Subject: [racket] Racket & Netbook > > I killed my laptop recently -- spilled a glass of milk right on the > keyboard -- and I need a cheap replacement for when I'm travelling. > This will not be my primary development machine. The only absolute > need I have from it is to be able to run Slideshow presentations, > though being able to meaningfully develop in Racket (i.e. running > "raco setup" in a somewhat reasonable amount of time) would be a big > plus too. I am thinking some kind of netbook, probably running Linux. > Does anyone out there know what kind would be suitable? I have not > looked at low-end portable computers in some time, so I don't know > what kind of performance to expect, what brands are reliable, etc. > Thanks for any pointers! > > Carl Eastlund > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From robby at eecs.northwestern.edu Wed Jun 30 14:37:31 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Wed, 30 Jun 2010 13:37:31 -0500 Subject: [racket] Racket & Netbook In-Reply-To: <19499.35694.925825.333708@winooski.ccs.neu.edu> References: <19499.35694.925825.333708@winooski.ccs.neu.edu> Message-ID: Sounds very advanced to me. In all seriousness, answers to those questions are not the kind of things I would pay money for anyways. The kinds of questions I pay money for are more like "make this thing work again; it is broken." (which isn't a question, I know. ...) Robby On Wed, Jun 30, 2010 at 1:22 PM, Eli Barzilay wrote: > On Jun 30, Shriram Krishnamurthi wrote: >> >> Of course, you won't get Apple-level support from Acer. ?But that >> cuts both ways (Acer support staff don't assume they are inherently >> more advanced genetic beings). > > ?? > > When I got the #(@^(!&* ipad, I called Apple support to ask how I can > transfer random files to it. ?The guy was "helpfully" suggesting > whatever their word equivalent is -- I gave up after about 5 minutes > of me going from "files, not `documents'" through "an icon in my > laptop" and ending up with "a pile of bits". > > Oh, and I also asked if there's anything that can play music in ogg > format. ?He consulted with two supervisors (for no less than 10 > minutes), and finally announced that I should get some software that > converts the files to mp3. > > [I'm sure that some people would consider that advanced...] > > -- > ? ? ? ? ?((lambda (x) (x x)) (lambda (x) (x x))) ? ? ? ? ?Eli Barzilay: > ? ? ? ? ? ? ? ? ? ?http://barzilay.org/ ? ? ? ? ? ? ? ? ? Maze is Life! > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > From matthias at ccs.neu.edu Wed Jun 30 14:40:52 2010 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Wed, 30 Jun 2010 14:40:52 -0400 Subject: [racket] Racket & Netbook In-Reply-To: References: <19499.35694.925825.333708@winooski.ccs.neu.edu> Message-ID: <7C4F5F70-129B-426A-9E3B-431C0566EA90@ccs.neu.edu> Well, a polite person would phrase this as "could you fix this ... please?" On Jun 30, 2010, at 2:37 PM, Robby Findler wrote: > Sounds very advanced to me. In all seriousness, answers to those > questions are not the kind of things I would pay money for anyways. > The kinds of questions I pay money for are more like "make this thing > work again; it is broken." (which isn't a question, I know. ...) > > Robby > > On Wed, Jun 30, 2010 at 1:22 PM, Eli Barzilay > wrote: >> On Jun 30, Shriram Krishnamurthi wrote: >>> >>> Of course, you won't get Apple-level support from Acer. But that >>> cuts both ways (Acer support staff don't assume they are inherently >>> more advanced genetic beings). >> >> ?? >> >> When I got the #(@^(!&* ipad, I called Apple support to ask how I can >> transfer random files to it. The guy was "helpfully" suggesting >> whatever their word equivalent is -- I gave up after about 5 minutes >> of me going from "files, not `documents'" through "an icon in my >> laptop" and ending up with "a pile of bits". >> >> Oh, and I also asked if there's anything that can play music in ogg >> format. He consulted with two supervisors (for no less than 10 >> minutes), and finally announced that I should get some software that >> converts the files to mp3. >> >> [I'm sure that some people would consider that advanced...] >> >> -- >> ((lambda (x) (x x)) (lambda (x) (x x))) Eli >> Barzilay: >> http://barzilay.org/ Maze is >> Life! >> _________________________________________________ >> For list-related administrative tasks: >> http://lists.racket-lang.org/listinfo/users >> > _________________________________________________ > For list-related administrative tasks: > http://lists.racket-lang.org/listinfo/users From eli at barzilay.org Wed Jun 30 14:43:33 2010 From: eli at barzilay.org (Eli Barzilay) Date: Wed, 30 Jun 2010 14:43:33 -0400 Subject: [racket] Racket & Netbook In-Reply-To: References: <19499.35694.925825.333708@winooski.ccs.neu.edu> Message-ID: <19499.36949.325512.989104@winooski.ccs.neu.edu> On Jun 30, Robby Findler wrote: > Sounds very advanced to me. In all seriousness, answers to those > questions are not the kind of things I would pay money for anyways. > The kinds of questions I pay money for are more like "make this > thing work again; it is broken." (which isn't a question, I > know. ...) Yes, I tried that too: "I have a file, I want to put it on the ipad". Those inevitably made him diverge to the purpose of the file (for example, if it's a pdf then obviously I need a viewer, if its an exe then obviously I'm stupid to want to put in something I can't use). But the ogg question was very purposeful in that sense. I even phrased it carefully as the kind of questions they're supposed to answer easily. (I'll avoid further replies which will probably make me complain about Apple and the kind of culture it is trying to foster with things like the ipad.) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From robby at eecs.northwestern.edu Wed Jun 30 14:43:30 2010 From: robby at eecs.northwestern.edu (Robby Findler) Date: Wed, 30 Jun 2010 13:43:30 -0500 Subject: [racket] Racket & Netbook In-Reply-To: <7C4F5F70-129B-426A-9E3B-431C0566EA90@ccs.neu.edu> References: <19499.35694.925825.333708@winooski.ccs.neu.edu> <7C4F5F70-129B-426A-9E3B-431C0566EA90@ccs.neu.edu> Message-ID: Man, politeness is such a racket. Robby On Wed, Jun 30, 2010 at 1:40 PM, Matthias Felleisen wrote: > > Well, a polite person would phrase this as "could you fix this ... please?" > > On Jun 30, 2010, at 2:37 PM, Robby Findler wrote: > >> Sounds very advanced to me. In all seriousness, answers to those >> questions are not the kind of things I would pay money for anyways. >> The kinds of questions I pay money for are more like "make this thing >> work again; it is broken." (which isn't a question, I know. ...) >> >> Robby >> >> On Wed, Jun 30, 2010 at 1:22 PM, Eli Barzilay wrote: >>> >>> On Jun 30, Shriram Krishnamurthi wrote: >>>> >>>> Of course, you won't get Apple-level support from Acer. ?But that >>>> cuts both ways (Acer support staff don't assume they are inherently >>>> more advanced genetic beings). >>> >>> ?? >>> >>> When I got the #(@^(!&* ipad, I called Apple support to ask how I can >>> transfer random files to it. ?The guy was "helpfully" suggesting >>> whatever their word equivalent is -- I gave up after about 5 minutes >>> of me going from "files, not `documents'" through "an icon in my >>> laptop" and ending up with "a pile of bits". >>> >>> Oh, and I also asked if there's anything that can play music in ogg >>> format. ?He consulted with two supervisors (for no less than 10 >>> minutes), and finally announced that I should get some software that >>> converts the files to mp3. >>> >>> [I'm sure that some people would consider that advanced...] >>> >>> -- >>> ? ? ? ? ((lambda (x) (x x)) (lambda (x) (x x))) ? ? ? ? ?Eli Barzilay: >>> ? ? ? ? ? ? ? ? ? http://barzilay.org/ ? ? ? ? ? ? ? ? ? Maze is Life! >>> _________________________________________________ >>> ?For list-related administrative tasks: >>> ?http://lists.racket-lang.org/listinfo/users >>> >> _________________________________________________ >> ?For list-related administrative tasks: >> ?http://lists.racket-lang.org/listinfo/users > > From stephen.degabrielle at acm.org Wed Jun 30 14:49:07 2010 From: stephen.degabrielle at acm.org (Stephen De Gabrielle) Date: Wed, 30 Jun 2010 19:49:07 +0100 Subject: [racket] Racket & Netbook In-Reply-To: References: Message-ID: I had drscheme up till February on an asus 4g 701 with a 7 inch screen, running the latest ubuntu 'full' (netbook remix doesn't fit on the small screen). I did upgrade the ram to 2gb, removed extra apps and had 4gb sd card salvaged from a camera, which is where I compiled drscheme(overnight). It was fine for running setup on individual collections, but not the whole of drscheme. The external VGA was fine for projectors, but looked silly on a big monitor The best thing was that it was really cheap and light, and two to three hours battery was fine for the ~1hr commute, though I did recharge where I could. It was nice for light duty. HTH, Cheers, Stephen On Wednesday, June 30, 2010, Shriram Krishnamurthi wrote: > I find DrRacket very hard to use on older machines and netbooks. > > I recently upgraded to an Acer Aspire 1810T. ?This is about $600 and > has a netbook form factor (same chassis as the 1410T, which is their > netbook). ?The 1366x768 screen makes the keyboard nice and wide and > great for use in travel. ?What's good about it is that it has a real > (non-Atom) dual-core processor, and I got it with 4Gb RAM. ?(It also > has an HDMI output port, and 3 USBs.) ?It's been absolutely wonderful, > and I finally understand how people can work with DrRacket instead of > Emacs. ?Now I launch DrRacket with impunity. > > This was a great buy, because it costs about a 1/3 of a "proper" > laptop but has enough computing for many of my tasks. ?It was very > hard to find something between netbook and notebook, and all the > reviews I saw indicated that Acer had found that sweet spot. ?I bought > it, and can confirm it's true. > > Of course, you won't get Apple-level support from Acer. ?But that cuts > both ways (Acer support staff don't assume they are inherently more > advanced genetic beings). > > Shriram > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > -- -- Stephen De Gabrielle stephen.degabrielle at acm.org Telephone +44 (0)20 85670911 Mobile +44 (0)79 85189045 http://www.degabrielle.name/stephen From sk at cs.brown.edu Wed Jun 30 15:08:08 2010 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Wed, 30 Jun 2010 15:08:08 -0400 Subject: [racket] two languages at a time in DrRacket Message-ID: Surely someone here has done something like this before, and I'd like advice on how to do it. We're in the process of converting Margrave, our security analysis tool, over to Racket, and to exploit DrRacket as its user environment. What we'd like to be able to do is this: in DrRacket, Interactions Window: Click Run to "load" this policy Definitions Window: That is, just as the REPL explores the values of the program in the definitions window, the policy query language explores the firewall policy in the definitions window. One analogy might be that it's like writing a Java program up top, and using Scheme in the REPL to explore it. But that's only an analogy as far as syntax goes. Semantically, our problem is worse (in the Java case, one could compile the Java into Scheme, a la ProfJ; we don't even have such a common intermediate language; the policy compiles to first-order models, and the query runs against them). Any thoughts on how to structure such an interaction? Shriram From krhari at ccs.neu.edu Wed Jun 30 15:21:19 2010 From: krhari at ccs.neu.edu (Hari Prashanth) Date: Wed, 30 Jun 2010 15:21:19 -0400 (EDT) Subject: [racket] Scribble question In-Reply-To: <5357039.362221277925596339.JavaMail.root@zimbra> Message-ID: <987207.362241277925679361.JavaMail.root@zimbra> Hi, I have a function by name map. For its documentation, I have something like @defproc[(map ...) (...)]{ @scheme[map] is similar to @scheme[map] } The want the latter @scheme[map] to refer map provided by lists. How can I do that? Can someone help me out with this? Thanks Hari From sk at cs.brown.edu Wed Jun 30 15:27:31 2010 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Wed, 30 Jun 2010 15:27:31 -0400 Subject: [racket] Racket & Netbook In-Reply-To: <06FFE8F09E0B4D2BAEADFE13F732E010@ptab> References: <06FFE8F09E0B4D2BAEADFE13F732E010@ptab> Message-ID: Paul, You can already run WeScheme on your Android: http://www.wescheme.org/ Due to a complete rewrite this summer, WeScheme and Racket will come ever closer together. But I may be misunderstanding what you mean by "client". Shriram From jay.mccarthy at gmail.com Wed Jun 30 15:42:56 2010 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Wed, 30 Jun 2010 13:42:56 -0600 Subject: [racket] two languages at a time in DrRacket In-Reply-To: References: Message-ID: This is very easy to do. If you take a look at http://github.com/plt/racket/blob/master/collects/datalog/lang/reader.rkt You'll see that there is one parser and compiler for the module body (this-read-syntax) and there is another for the REPL interactions (parse-statement). In this case one is a subset of the other, but it would be easy to have them be arbitrarily different. Your module language would set up a way to communicate with the REPL, which would use a special #%top-interaction macro to deal with it. Jay On Wed, Jun 30, 2010 at 1:08 PM, Shriram Krishnamurthi wrote: > Surely someone here has done something like this before, and I'd like > advice on how to do it. > > We're in the process of converting Margrave, our security analysis > tool, over to Racket, and to exploit DrRacket as its user environment. > > What we'd like to be able to do is this: in DrRacket, > > ?Interactions Window: > ? ? > > ?Click Run to "load" this policy > > ?Definitions Window: > ? ? > > That is, just as the REPL explores the values of the program in the > definitions window, the policy query language explores the firewall > policy in the definitions window. > > One analogy might be that it's like writing a Java program up top, and > using Scheme in the REPL to explore it. ?But that's only an analogy as > far as syntax goes. ?Semantically, our problem is worse (in the Java > case, one could compile the Java into Scheme, a la ProfJ; we don't > even have such a common intermediate language; the policy compiles to > first-order models, and the query runs against them). > > Any thoughts on how to structure such an interaction? > > Shriram > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From engineer at alum.mit.edu Wed Jun 30 15:45:55 2010 From: engineer at alum.mit.edu (Paul Ojanen) Date: Wed, 30 Jun 2010 15:45:55 -0400 Subject: [racket] Racket & Netbook In-Reply-To: References: <06FFE8F09E0B4D2BAEADFE13F732E010@ptab> Message-ID: Interesting and very cool. Instead of client I should have said IDE. Thanks. > -----Original Message----- > From: shriram at gmail.com [mailto:shriram at gmail.com] On Behalf Of Shriram > Krishnamurthi > Sent: Wednesday, June 30, 2010 3:28 PM > To: engineer at alum.mit.edu > Cc: Carl Eastlund; Racket Users > Subject: Re: [racket] Racket & Netbook > > Paul, > > You can already run WeScheme on your Android: > > http://www.wescheme.org/ > > Due to a complete rewrite this summer, WeScheme and Racket will come > ever closer together. > > But I may be misunderstanding what you mean by "client". > > Shriram From toddobryan at gmail.com Wed Jun 30 16:42:01 2010 From: toddobryan at gmail.com (Todd O'Bryan) Date: Wed, 30 Jun 2010 16:42:01 -0400 Subject: [racket] Scribble question In-Reply-To: <987207.362241277925679361.JavaMail.root@zimbra> References: <5357039.362221277925596339.JavaMail.root@zimbra> <987207.362241277925679361.JavaMail.root@zimbra> Message-ID: Have you considered naming your function blah-map, where blah is the kind of structure you expect it to work on, so that both your map and the built-in map for lists could be available without shadowing one another? Todd On Wed, Jun 30, 2010 at 3:21 PM, Hari Prashanth wrote: > Hi, > > I have a function by name map. For its documentation, I have > something like > > @defproc[(map ...) (...)]{ > @scheme[map] is similar to @scheme[map] > } > > The want the latter @scheme[map] to refer map provided by lists. > > How can I do that? Can someone help me out with this? > > Thanks > Hari > _________________________________________________ > ?For list-related administrative tasks: > ?http://lists.racket-lang.org/listinfo/users > From jmarshall at alum.mit.edu Wed Jun 30 16:43:12 2010 From: jmarshall at alum.mit.edu (Joe Marshall) Date: Wed, 30 Jun 2010 13:43:12 -0700 Subject: [racket] Google doesn't know from DrRacket In-Reply-To: <4C2AA8B6.9060904@neilvandyke.org> References: <4C2AA8B6.9060904@neilvandyke.org> Message-ID: On Tue, Jun 29, 2010 at 7:15 PM, Neil Van Dyke wrote: > > ?Someone who really wants to do this optimally will have to look up the > latest SEO rules of thumb for what to do and not do on this page. It'll take a small amount of time investment (perhaps ten total hours), but you ought to be able to get the ranking up where you want it. I'd be happy to help anyone that wants to spend the time. -- ~jrm From dvanhorn at ccs.neu.edu Wed Jun 30 16:50:35 2010 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Wed, 30 Jun 2010 16:50:35 -0400 Subject: [racket] Google doesn't know from DrRacket In-Reply-To: References: <4C2AA8B6.9060904@neilvandyke.org> Message-ID: <4C2BAE1B.9030508@ccs.neu.edu> On 6/30/10 4:43 PM, Joe Marshall wrote: > On Tue, Jun 29, 2010 at 7:15 PM, Neil Van Dyke wrote: >> >> Someone who really wants to do this optimally will have to look up the >> latest SEO rules of thumb for what to do and not do on this page. > > It'll take a small amount of time investment (perhaps ten total hours), but > you ought to be able to get the ranking up where you want it. I'd be happy > to help anyone that wants to spend the time. I think a lot of people on the list would be interested if you can sketch what's involved here. I remember Robby getting good advice for moving his page from Chicago to Northwestern, which I followed with positive results for my own move from Brandeis to Northeastern. http://lists.racket-lang.org/dev/archive/2009-October/001452.html David From eli at barzilay.org Wed Jun 30 16:54:31 2010 From: eli at barzilay.org (Eli Barzilay) Date: Wed, 30 Jun 2010 16:54:31 -0400 Subject: [racket] Google doesn't know from DrRacket In-Reply-To: References: <4C2AA8B6.9060904@neilvandyke.org> Message-ID: <19499.44807.784732.385186@winooski.ccs.neu.edu> On Jun 30, Joe Marshall wrote: > On Tue, Jun 29, 2010 at 7:15 PM, Neil Van Dyke wrote: > > > > Someone who really wants to do this optimally will have to look up > > the latest SEO rules of thumb for what to do and not do on this > > page. > > It'll take a small amount of time investment (perhaps ten total > hours), but you ought to be able to get the ranking up where you > want it. I'd be happy to help anyone that wants to spend the time. If you have any pointers for things we should do, I'll be happy to do them. Also, I think that Google uses dmoz for the search result blurbs, and I've got the "PLT Scheme" entry in the Programming/Languages/Lisp/Scheme/Implementations/ category to be updated. I also tried to get it as a new entry in Programming/Languages/Functional -- but got no reply, and when I tried to apply to be an editor it got rejected because I suggested sites that I'm involved with. I have no idea how to contact anyone there and get it done, but it looks odd that Racket is a scheme implementation, yet Arc has its own category -- if anyone can help with that, or tell me what needs to be done, please tell me. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From eli at barzilay.org Wed Jun 30 16:56:25 2010 From: eli at barzilay.org (Eli Barzilay) Date: Wed, 30 Jun 2010 16:56:25 -0400 Subject: [racket] Google doesn't know from DrRacket In-Reply-To: <4C2BAE1B.9030508@ccs.neu.edu> References: <4C2AA8B6.9060904@neilvandyke.org> <4C2BAE1B.9030508@ccs.neu.edu> Message-ID: <19499.44921.436004.930814@winooski.ccs.neu.edu> On Jun 30, David Van Horn wrote: > On 6/30/10 4:43 PM, Joe Marshall wrote: > > On Tue, Jun 29, 2010 at 7:15 PM, Neil Van Dyke wrote: > >> > >> Someone who really wants to do this optimally will have to look up the > >> latest SEO rules of thumb for what to do and not do on this page. > > > > It'll take a small amount of time investment (perhaps ten total hours), but > > you ought to be able to get the ranking up where you want it. I'd be happy > > to help anyone that wants to spend the time. > > I think a lot of people on the list would be interested if you can > sketch what's involved here. > > I remember Robby getting good advice for moving his page from Chicago to > Northwestern, which I followed with positive results for my own move > from Brandeis to Northeastern. > > http://lists.racket-lang.org/dev/archive/2009-October/001452.html This was a different situation, where his page has moved. We have a new page -- and we can't setup redirection from the old page. (Even if we do, I doubt that google would take that as a hint that the new site has the same rank as the old one.) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From samth at ccs.neu.edu Wed Jun 30 17:00:06 2010 From: samth at ccs.neu.edu (Sam Tobin-Hochstadt) Date: Wed, 30 Jun 2010 17:00:06 -0400 Subject: [racket] Google doesn't know from DrRacket In-Reply-To: <19499.44807.784732.385186@winooski.ccs.neu.edu> References: <4C2AA8B6.9060904@neilvandyke.org> <19499.44807.784732.385186@winooski.ccs.neu.edu> Message-ID: On Wed, Jun 30, 2010 at 4:54 PM, Eli Barzilay wrote: > > > Also, I think that Google uses dmoz for the search result blurbs, That definitely doesn't seem to be the case here, since Racket doesn't seem to be on dmoz at all. Google takes the snippet from the page directly. -- sam th samth at ccs.neu.edu From mflatt at cs.utah.edu Wed Jun 30 17:02:46 2010 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Wed, 30 Jun 2010 15:02:46 -0600 Subject: [racket] Scribble question In-Reply-To: <987207.362241277925679361.JavaMail.root@zimbra> References: <987207.362241277925679361.JavaMail.root@zimbra> Message-ID: <20100630210247.3AD586500E0@mail-svr1.cs.utah.edu> At Wed, 30 Jun 2010 15:21:19 -0400 (EDT), Hari Prashanth wrote: > I have a function by name map. For its documentation, I have > something like > > @defproc[(map ...) (...)]{ > @scheme[map] is similar to @scheme[map] > } > > The want the latter @scheme[map] to refer map provided by lists. > > How can I do that? Can someone help me out with this? The simplest solution is to create a new module: ;; other.rkt: #lang at-exp racket/base (require scribble/manual (for-label racket/base)) (define racket-map @racket[map]) (provide racket-map) And use it like this: #lang scribble/manual @(require (for-label lang/htdp-intermediate) "other.rkt") The ISL @racket[map] is similar to Racket's @|racket-map|. If you want everything in one module, you can play a trick with macro-introduced imports: #lang scribble/manual @(require (for-label lang/htdp-intermediate)) @(begin (define-syntax-rule (def racket-map) (begin (require (for-label racket/base)) (define racket-map @racket[map]))) (def racket-map)) The ISL @racket[map] is similar to Racket's @|racket-map|. There should be a better way to do this --- maybe a macro that packages up the macro-introduced-import trick. From eli at barzilay.org Wed Jun 30 17:08:08 2010 From: eli at barzilay.org (Eli Barzilay) Date: Wed, 30 Jun 2010 17:08:08 -0400 Subject: [racket] Google doesn't know from DrRacket In-Reply-To: References: <4C2AA8B6.9060904@neilvandyke.org> <19499.44807.784732.385186@winooski.ccs.neu.edu> Message-ID: <19499.45624.244072.763805@winooski.ccs.neu.edu> On Jun 30, Sam Tobin-Hochstadt wrote: > On Wed, Jun 30, 2010 at 4:54 PM, Eli Barzilay wrote: > > > > > > Also, I think that Google uses dmoz for the search result blurbs, > > That definitely doesn't seem to be the case here, Not with Racket, probably because it's new. Look for "plt scheme", then look for the blurb that it has (in double quotes). It's coming from dmoz. > Racket doesn't seem to be on dmoz at all. http://www.dmoz.org/Computers/Programming/Languages/Lisp/Scheme/Implementations/ -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://barzilay.org/ Maze is Life! From krhari at ccs.neu.edu Wed Jun 30 17:26:48 2010 From: krhari at ccs.neu.edu (Hari Prashanth) Date: Wed, 30 Jun 2010 17:26:48 -0400 (EDT) Subject: [racket] Scribble question In-Reply-To: <20100630210247.3AD586500E0@mail-svr1.cs.utah.edu> Message-ID: <19030958.364801277933208510.JavaMail.root@zimbra> First solution works well in my case as I have around 25 data structures all of which have map and fold functions. Thanks for the help. Hari ----- Original Message ----- From: "Matthew Flatt" To: "Hari Prashanth" Cc: "plt-scheme" Sent: Wednesday, June 30, 2010 5:02:46 PM GMT -05:00 US/Canada Eastern Subject: Re: [racket] Scribble question At Wed, 30 Jun 2010 15:21:19 -0400 (EDT), Hari Prashanth wrote: > I have a function by name map. For its documentation, I have > something like > > @defproc[(map ...) (...)]{ > @scheme[map] is similar to @scheme[map] > } > > The want the latter @scheme[map] to refer map provided by lists. > > How can I do that? Can someone help me out with this? The simplest solution is to create a new module: ;; other.rkt: #lang at-exp racket/base (require scribble/manual (for-label racket/base)) (define racket-map @racket[map]) (provide racket-map) And use it like this: #lang scribble/manual @(require (for-label lang/htdp-intermediate) "other.rkt") The ISL @racket[map] is similar to Racket's @|racket-map|. If you want everything in one module, you can play a trick with macro-introduced imports: #lang scribble/manual @(require (for-label lang/htdp-intermediate)) @(begin (define-syntax-rule (def racket-map) (begin (require (for-label racket/base)) (define racket-map @racket[map]))) (def racket-map)) The ISL @racket[map] is similar to Racket's @|racket-map|. There should be a better way to do this --- maybe a macro that packages up the macro-introduced-import trick. From jmarshall at alum.mit.edu Wed Jun 30 17:47:34 2010 From: jmarshall at alum.mit.edu (Joe Marshall) Date: Wed, 30 Jun 2010 14:47:34 -0700 Subject: [racket] Google doesn't know from DrRacket In-Reply-To: <4C2BAE1B.9030508@ccs.neu.edu> References: <4C2AA8B6.9060904@neilvandyke.org> <4C2BAE1B.9030508@ccs.neu.edu> Message-ID: On Wed, Jun 30, 2010 at 1:50 PM, David Van Horn wrote: > > I think a lot of people on the list would be interested if you can sketch > what's involved here. It's all spelled out on http://www.google.com/webmasters/ -- ~jrm From sk at cs.brown.edu Wed Jun 30 20:12:23 2010 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Wed, 30 Jun 2010 20:12:23 -0400 Subject: [racket] two languages at a time in DrRacket In-Reply-To: References: Message-ID: "easy" is great. I assume I should ignore the comment that says ; XXX This is almost certainly wrong. Shriram From jay.mccarthy at gmail.com Wed Jun 30 20:50:39 2010 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Wed, 30 Jun 2010 18:50:39 -0600 Subject: [racket] two languages at a time in DrRacket In-Reply-To: References: Message-ID: Ya :) It works but I don't think it is the right way to do it. Jay On Wed, Jun 30, 2010 at 6:12 PM, Shriram Krishnamurthi wrote: > "easy" is great. ?I assume I should ignore the comment that says > > ?; XXX This is almost certainly wrong. > > Shriram > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93