From jensaxel at soegaard.net Wed Oct 1 04:49:54 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:29:29 2009 Subject: [plt-scheme] rotate90 is clockwise on einstein; CCW on zorro In-Reply-To: <72ef860f0809301450n3adfb096u2e8f2fc1c20e29f6@mail.gmail.com> References: <72ef860f0809301031x228dc296p81e978db48366751@mail.gmail.com> <72ef860f0809301450n3adfb096u2e8f2fc1c20e29f6@mail.gmail.com> Message-ID: <48E339B2.2080503@soegaard.net> Fred G. Martin wrote: > Dear Henderson-users, > > OK, this one threw us for a loop. I loaded soegaard's version of the > Henderson stuff: > > (require (planet "sicp.ss" ("soegaard" "sicp.plt" 2 0))) > > Then I tried rotate90 on einstein and mark-of-zorro. > > einstein gets rotated clockwise, but mark-of-zorro is rotated > counter-clockwise (see attached). > It is clearly a bug. Rotate90 is supposed to rotate the image 90 degrees in the positive direction (i.e. anti-clockwise). > Here is another (related?) anomoly. In looking at the code for zorro, > it appears that (0,0) is in the lower-left and (1,) is in the > upper-right: > That sounds right. > (define mark-of-zorro > (let ((v1 (make-vect .1 .9)) > (v2 (make-vect .8 .9)) > (v3 (make-vect .1 .2)) > (v4 (make-vect .9 .3))) > (segments->painter > (list (make-segment v1 v2) > (make-segment v2 v3) > (make-segment v3 v4))))) > > > > (paint (segments->painter (list (make-segment (make-vect 0.0 0.0) (make-vect 0.5 0.5))))) [image with segment from lower left to the center] > (paint (rotate90 (segments->painter (list (make-segment (make-vect 0.0 0.0) (make-vect 0.5 0.5)))))) [image with segment from lower right to the center] Conclusion: rotate90 works for painters produced by segments->painter. Since rotate90 doesn't use the representation of the painter, the code for rotate90 must be correct. Therefore there must be a problem with the construction of a painter from a bitmap. > But when we tried the diagonal shader, it seems that (0,0) is in the > UPPER-left. my-diag performs the same as the provided > diagonal-shading: > (define my-diag > (procedure->painter (lambda (x y) (* 127 (+ x y))))) > > Another bug, the y-axis is reversed. I'm slightly puzzled. I think I/we already fixed these bugs before. I wonder whether I accidently uploaded an old version. I'll get back to you either later today or tomorrow. -- Jens Axel S?gaard From d.j.gurnell at gmail.com Wed Oct 1 07:10:25 2008 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Thu Mar 26 02:29:31 2009 Subject: [plt-scheme] Compile times under PLT 4.1 Message-ID: <1A7A5FDD-AB88-45AE-A848-4FD64126CBF0@gmail.com> I updated from 4.0.2.5 to 4.1.0.4 a few days ago, and I may be imagining this, but compilation to bytecode ("mzc -k foo.ss") seems to be a fair bit slower. It could well be my machine or something that I've done. Is this something anyone else has noticed? Cheers, -- Dave From jpc-ml at zenburn.net Wed Oct 1 08:40:11 2008 From: jpc-ml at zenburn.net (=?UTF-8?B?SmFrdWIgUGlvdHIgQ8WCYXBh?=) Date: Thu Mar 26 02:29:32 2009 Subject: [plt-scheme] (Delimited) continuations versus threads Message-ID: <48E36FAB.9080204@zenburn.net> 1. If I understand correctly the shift/reset operator could be implemented using threads. (reset starts a child thread and waits for a reply sent by shift; shift sends the reply and binds k to a procedure waiting for further replies). The only difference I can think of is when you try to use the function created by shift multiple times (it will not work with threads). Is it the only difference? 2. What is the best way to write a nonblocking parser receiving data from a subprocess. Using continuations and feeding new data received on a port or spawning a new thread and using blocking requests? I think that a simple thread would be better. Are continuations only useful when we want to serialize them to disk or restart the computation many times from the same break (as in HTTP)? And what if we had serializable threads? -- regards, Jakub Piotr C?apa From mflatt at cs.utah.edu Wed Oct 1 09:15:31 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:29:32 2009 Subject: [plt-scheme] for-label-based hyperlinks when building with scribble command-line executable In-Reply-To: References: Message-ID: <20081001131532.AFA136500C7@mail-svr1.cs.utah.edu> At Tue, 30 Sep 2008 14:55:50 -0500, "Casey Klein" wrote: > When I build the following with scribble --html, the identifier > `big-bang' in the typeset code is underlined in red: > > #lang scribble/doc > > @(require scribble/manual (for-label teachpack/htdp/world)) > @schemeblock[(big-bang width height r world0)] > > I apologize if I should be able to figure this out from the > documentation, but what do I need to do to turn identifiers like this > one to hyperlinks? Up to now, the only way was to put the document in a Planet package or collection and build it with `setup-plt'. Setup PLT knows about all the installed documentation, and it arranges for cross-reference information (which is embedded in "in.sxref" files) to be loaded when building a document. Scribble tools like `scribble', in contrast, are supposed to be independent from the specific application of Scribble to installed PLT Scheme documentation. In SVN, I've added `++xref-in' command-line flag to `scribble'. The new flag takes a module and identifier, and it calls the corresponding function to get cross-reference information (as defined by the `xref' type from `scribble/xref'). In particular, the `setup/xref' module provides `load-collections-xref', which is essentially the part of Setup PLT that finds all the cross-reference information for installed documentation. (Note the difference between the general interface `scribble/xref' and the application-specific glue `setup/xref'.) Use the new flag like this to build "doc.scrbl" with hyperlinks to installed docs: scribble --html ++xref-in setup/xref load-collections-xref doc.scrbl Matthew From mflatt at cs.utah.edu Wed Oct 1 09:28:23 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:29:32 2009 Subject: [plt-scheme] Is there any way to make a file writable? In-Reply-To: <5f07325f0809301152q4d84ee00sc54c0d5ef9510b43@mail.gmail.com> References: <5f07325f0809301152q4d84ee00sc54c0d5ef9510b43@mail.gmail.com> Message-ID: <20081001132824.D0B416500AF@mail-svr1.cs.utah.edu> At Tue, 30 Sep 2008 11:52:24 -0700, "Greg Woodhouse" wrote: > I see that you can get a file's permissions with > file-or-directory-permissions, but there doesn't seem to be any way to > change them. Am I missing something? There's currently no function in `scheme' to set file permissions. You could use the FFI to access chmod(): http://list.cs.brown.edu/pipermail/plt-scheme/2008-May/024704.html Matthew From goetter at mazama.net Wed Oct 1 10:34:01 2008 From: goetter at mazama.net (Ben Goetter) Date: Thu Mar 26 02:29:32 2009 Subject: [plt-scheme] Is there any way to make a file writable? In-Reply-To: <20081001132824.D0B416500AF@mail-svr1.cs.utah.edu> References: <5f07325f0809301152q4d84ee00sc54c0d5ef9510b43@mail.gmail.com> <20081001132824.D0B416500AF@mail-svr1.cs.utah.edu> Message-ID: <48E38A59.5020608@mazama.net> Matthew Flatt wrote: > There's currently no function in `scheme' to set file permissions. You > could use the FFI to access chmod(): > Or, under Windows, Get/SetFileAttributes: (define getperms (_bitmask '( error = #xffffffff archive = #x20 compressed = #x800 device = #x64 directory = #x10 encrypted = #x4000 hidden = #x2 normal = #x80 not-content-indexed = #x2000 offline = #x1000 read-only = #x1 reparse-point = #x400 sparse-file = #x200 system = #x4 temporary = #x100 virtual = #x10000 ) _ulong)) (define gfa (get-ffi-obj "GetFileAttributesW" (ffi-lib "KERNEL32") (_fun #:abi 'stdcall _string/utf-16 -> getperms))) (define setperms (_bitmask '( archive = #x20 hidden = #x2 normal = #x80 not-content-indexed = #x2000 offline = #x1000 read-only = #x1 system = #x4 temporary = #x100 ) _ulong)) (define sfa (get-ffi-obj "SetFileAttributesW" (ffi-lib "KERNEL32") (_fun #:abi 'stdcall _string/utf-16 setperms -> _bool))) ;; call iff gfa returns 'error or sfa returns #f (define gle (get-ffi-obj "GetLastError" (ffi-lib "KERNEL32") (_fun #:abi 'stdcall -> _ulong))) From fredm at cs.uml.edu Wed Oct 1 12:48:00 2008 From: fredm at cs.uml.edu (Fred G. Martin) Date: Thu Mar 26 02:29:33 2009 Subject: [plt-scheme] rotate90 is clockwise on einstein; CCW on zorro In-Reply-To: <48E339B2.2080503@soegaard.net> References: <72ef860f0809301031x228dc296p81e978db48366751@mail.gmail.com> <72ef860f0809301450n3adfb096u2e8f2fc1c20e29f6@mail.gmail.com> <48E339B2.2080503@soegaard.net> Message-ID: <72ef860f0810010948l156b7bedla2783de4bfff5e8c@mail.gmail.com> Jens, I deleted my install of the soegaard library and had DrScheme re-download the 2 0 version -- things are the same as before. I tried your segments->painter test and it worked properly (line segment from lower-left to center; anti-clockwise rotation). When I run diagonal-shading, I am definitely getting (0,0) in upper left, (1,1) in lower right, and clockwise rotation with rotate90. Thanks for looking into this... At least I know what the correct behavior is now; I'll pass this along to my students. Fred On Wed, Oct 1, 2008 at 4:49 AM, Jens Axel Soegaard wrote: > Fred G. Martin wrote: > >> Dear Henderson-users, >> >> OK, this one threw us for a loop. I loaded soegaard's version of the >> Henderson stuff: >> (require (planet "sicp.ss" ("soegaard" "sicp.plt" 2 0))) >> >> Then I tried rotate90 on einstein and mark-of-zorro. >> >> einstein gets rotated clockwise, but mark-of-zorro is rotated >> counter-clockwise (see attached). >> >> > It is clearly a bug. Rotate90 is supposed to rotate the image 90 degrees in > the positive direction (i.e. anti-clockwise). > >> Here is another (related?) anomoly. In looking at the code for zorro, >> it appears that (0,0) is in the lower-left and (1,) is in the >> upper-right: >> >> > That sounds right. > >> (define mark-of-zorro >> (let ((v1 (make-vect .1 .9)) >> (v2 (make-vect .8 .9)) >> (v3 (make-vect .1 .2)) >> (v4 (make-vect .9 .3))) >> (segments->painter >> (list (make-segment v1 v2) >> (make-segment v2 v3) >> (make-segment v3 v4))))) >> >> >> >> > > (paint (segments->painter > (list (make-segment (make-vect 0.0 0.0) > (make-vect 0.5 0.5))))) > [image with segment from lower left to the center] > > > (paint (rotate90 > (segments->painter > (list (make-segment (make-vect 0.0 0.0) > (make-vect 0.5 0.5)))))) > [image with segment from lower right to the center] > > Conclusion: rotate90 works for painters produced by segments->painter. > > Since rotate90 doesn't use the representation of the painter, > the code for rotate90 must be correct. Therefore there must be a problem > with the construction of a painter from a bitmap. > > But when we tried the diagonal shader, it seems that (0,0) is in the >> UPPER-left. my-diag performs the same as the provided >> diagonal-shading: >> > > (define my-diag >> (procedure->painter (lambda (x y) (* 127 (+ x y))))) >> >> >> > Another bug, the y-axis is reversed. > > > I'm slightly puzzled. I think I/we already fixed these bugs before. I > wonder whether I > accidently uploaded an old version. I'll get back to you either later today > or > tomorrow. > > -- > Jens Axel S?gaard > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081001/87f6c0e3/attachment.html From yinso.chen at gmail.com Wed Oct 1 20:56:51 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:29:33 2009 Subject: [plt-scheme] change default-web-root to a different path Message-ID: <779bf2730810011756r1f55340bte9abb5b802b09dcf@mail.gmail.com> Hi all - I did a quick googling but didn't find anything (sorry if I missed the manual somewhere) - so here it goes: How can I change the default-web-root so the web server doesn't run off of the install path? I'm thinking of moving the files to something more like a /var/web/... Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081001/9364ef9f/attachment.htm From jay.mccarthy at gmail.com Wed Oct 1 21:53:29 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:29:34 2009 Subject: [plt-scheme] change default-web-root to a different path In-Reply-To: <779bf2730810011756r1f55340bte9abb5b802b09dcf@mail.gmail.com> References: <779bf2730810011756r1f55340bte9abb5b802b09dcf@mail.gmail.com> Message-ID: When you run the web-server via plt-web-server you can pass an argument to specify the configuration file. That file determines where the paths are for everything: http://docs.plt-scheme.org/web-server/command-line-tools.html Jay On Wed, Oct 1, 2008 at 6:56 PM, YC wrote: > Hi all - > > I did a quick googling but didn't find anything (sorry if I missed the > manual somewhere) - so here it goes: > > How can I change the default-web-root so the web server doesn't run off of > the install path? I'm thinking of moving the files to something more like a > /var/web/... > > Thanks, > yc > > > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From mflatt at cs.utah.edu Thu Oct 2 07:53:04 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:29:34 2009 Subject: [plt-scheme] (Delimited) continuations versus threads In-Reply-To: <48E36FAB.9080204@zenburn.net> References: <48E36FAB.9080204@zenburn.net> Message-ID: <20081002115305.AA00D6500C7@mail-svr1.cs.utah.edu> At Wed, 01 Oct 2008 14:40:11 +0200, Jakub Piotr C?apa wrote: > 1. If I understand correctly the shift/reset operator could be > implemented using threads. (reset starts a child thread and waits for a > reply sent by shift; shift sends the reply and binds k to a procedure > waiting for further replies). The only difference I can think of is when > you try to use the function created by shift multiple times (it will not > work with threads). Is it the only difference? Yes, that sounds right. > 2. What is the best way to write a nonblocking parser receiving data > from a subprocess. Using continuations and feeding new data received on > a port or spawning a new thread and using blocking requests? > > I think that a simple thread would be better. I agree --- it sounds like a job for threads. > Are continuations only > useful when we want to serialize them to disk or restart the computation > many times from the same break (as in HTTP)? Mainly the latter, since we don't have serializable continuations in the PLT Scheme core. > And what if we had > serializable threads? Then they'd be continuations, because you could deserialize them multiple times to restart them. Matthew From kevin at hypotheticalabs.com Thu Oct 2 09:07:57 2008 From: kevin at hypotheticalabs.com (Kevin A. Smith) Date: Thu Mar 26 02:29:34 2009 Subject: [plt-scheme] (Delimited) continuations versus threads In-Reply-To: <20081002115305.AA00D6500C7@mail-svr1.cs.utah.edu> References: <48E36FAB.9080204@zenburn.net> <20081002115305.AA00D6500C7@mail-svr1.cs.utah.edu> Message-ID: On Oct 2, 2008, at 7:53 AM, Matthew Flatt wrote: > At Wed, 01 Oct 2008 14:40:11 +0200, Jakub Piotr C?apa wrote: >> 1. If I understand correctly the shift/reset operator could be >> implemented using threads. (reset starts a child thread and waits >> for a >> reply sent by shift; shift sends the reply and binds k to a procedure >> waiting for further replies). The only difference I can think of is >> when >> you try to use the function created by shift multiple times (it >> will not >> work with threads). Is it the only difference? > > Yes, that sounds right. > >> 2. What is the best way to write a nonblocking parser receiving data >> from a subprocess. Using continuations and feeding new data >> received on >> a port or spawning a new thread and using blocking requests? >> >> I think that a simple thread would be better. > > I agree --- it sounds like a job for threads. > >> Are continuations only >> useful when we want to serialize them to disk or restart the >> computation >> many times from the same break (as in HTTP)? > > Mainly the latter, since we don't have serializable continuations in > the PLT Scheme core. Are there any plans to introduce serializable continuations? --Kevin > > Matthew > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From jay.mccarthy at gmail.com Thu Oct 2 09:36:40 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:29:34 2009 Subject: [plt-scheme] (Delimited) continuations versus threads In-Reply-To: References: <48E36FAB.9080204@zenburn.net> <20081002115305.AA00D6500C7@mail-svr1.cs.utah.edu> Message-ID: On Thu, Oct 2, 2008 at 7:07 AM, Kevin A. Smith wrote: > Are there any plans to introduce serializable continuations? If you want serializable continuations for use in the Web server, they are available in the #lang web-server language documented here: http://docs.plt-scheme.org/web-server/lang.html Jay -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From dyrueta at gmail.com Thu Oct 2 12:23:12 2008 From: dyrueta at gmail.com (dave yrueta) Date: Thu Mar 26 02:29:34 2009 Subject: [plt-scheme] HtDP 17.7.1-4 - Diff between name-of-function and function-name Message-ID: <3d990956-9270-497e-bfb5-5eaf8b4446c6@h2g2000hsg.googlegroups.com> Hi All -- Two questions about exercises 17.4.*. The terms of these exercises suggests a significant difference between a function-name and name-of-function. Is a function-name a symbol and a name-of-function a variable, where A function-definition(fd) is a structure (make-fd f-name p-name f-body) where f-name is a symbol, p-name is a symbol and f-body is a scheme- expression, and; A name-of-function(fn) is the variable in the sentence (define fn fd) where define is a keyword, fn is a variable and fd is function- definition, and; A function-application (fa) is a structure, where (make-fa fn arg) where fn is a name-of-function and arg is a scheme-expression? If this is the case, then I have a follow-up question for exercise 17.7.4: what is the meaning of Step 2, which instructs "evaluate-with- defs" to "look up the definition of P is defs?" Example:, (define(f x) (+ 3 x) is translated to name-of-function (define f (make-fd 'f 'x (make-add 3 'x))), and; (define (h u) (f (* 2 u))) is translated to name-of-function (define h(make-fd 'h 'u(make-fa f (make-mul 2 'u)))) ;;evaluate-with-defs: scheme-expression list-of-defs > error or number ;;consumes a scheme-expression and a list-of-function-definitions: returns an error if the ;;original scheme-expression is not numeric, or if a function found as an arg for a function-;;application is not listed in the list-of-defs; otherwise, returns a number Examples: 1. (not(evaluate-with-defs 3 (list h))), since f is embedded in h, and f is not present in list-of-defs 2. (evaluate-with-defs 3 (list f h)) returns 12 3. (not(evaluate-with-defs (f 3) (list h))) 4. (evaluate-with-defs (f 3) (list f h))) returns 18 My initial solution to this problem is this: (define(evaluate-with-defs sx lofP) (cond [(empty? lofP)(evaluate-expression sx)] [else (evaluate-with-defs(evaluate-with-one-def sx (first lofP)) (rest lofP)))])) The second condition would begin by applying f to 3, returning 6, and then recurring. Next, it would apply h to 6. While doing so, it would find that h is defined as a function-application of f to (* 2 u). At that point, it would "look-up" f in lofP to find its' definition. However, f has already been tossed after the first recursive call, so it would presumably return an error, which is not correct. Is the solution to add a second parameter to evaluate-with-defs: "lofP- index" which would serve as a look-up index for all function- definitions listed in the original "lofP?" If this is the case, then all the previous functions would have to be retrofitted to carry this index parameter. That doesn't seem right. Further, what is the point of "looking-up" the function-definition f in lofP when the function-definition is present in the name-of- function attribute of the function-application? The only way this would make sense to me is if the name-of-function attribute was meant to be a symbol, and not a variable. If that's the case, then my approach to solving this and the previous exercise is wrong. For completeness, here are the rest of my data-definitions and my version of the solution to 17.7.3: Thanks, Dave Yrueta Data Defs: An "add" is a structure (make-add left right) where left and right are both Scheme-Expressions An "mul" is a structure (make-mul left right) where left and right are both Scheme-Expressions A Scheme-Expression (SX) is either 1. a number 2. a symbol 3. an add structure 4. a mul structure 5. a function-application (fa) ;;17.7.3 ;;evaluate-with-one-def: sx P > error or Scheme Expression ;;consumes a Scheme Expression and a Function-Definition, and returns either an 'error ;;or the evaluated Scheme Expression (define(evaluate-with-one-def sx P) (cond [(numeric? sx) (cond [(number? sx)(evaluate-expression(subs(fd-p-name P)sx(fd-f-body P)))] [else(evaluate-with-one-def (evaluate-expression sx)P)])] [else 'error])) ;;subst:symbol number scheme-expression > scheme-expression ;;consumes a symbol, number and scheme-expression, substitutes all instances of the ;;symbol appearing in the scheme-expression with the number, and then returns a ;;structurally equivalent expression. (define(subs sym num sx) (cond [(mul? sx)(make-mul (subs sym num (mul-left sx))(subs sym num (mul- right sx)))] [(add? sx)(make-add (subs sym num (add-left sx))(subs sym num (add- right sx)))] [(fa? sx) (evaluate-with-one-def(subs sym num (fa-arg sx))(fa-fn sx))] [(number? sx)sx] [(symbol=? sym sx)num] [else sx])) (define(numeric? sx) (cond [(number? sx)true] [(struct? sx)(test-struc sx)] [else false])) (define(test-struc sx) (cond [(mul? sx)(and(numeric? (mul-left sx))(numeric? (mul-right sx)))] [else (and(numeric? (add-left sx))(numeric? (add-right sx)))])) (define(evaluate-expression nx) (cond [(boolean=? (numeric? nx)false)'error] [else (process-nx nx)])) (define(process-nx nx) (cond [(number? nx)nx] [(mul? nx)(*(evaluate-expression (mul-left nx))(evaluate- expression (mul-right nx)))] [else (+(evaluate-expression (add-left nx))(evaluate-expression (add-right nx)))])) From jewulo at gmail.com Thu Oct 2 12:55:15 2008 From: jewulo at gmail.com (Joshua Ewulo) Date: Thu Mar 26 02:29:35 2009 Subject: [plt-scheme] Problem with require statements using PLT4.x Message-ID: <61436f8d0810020955n1cf17f94t7ce2838b6615a870@mail.gmail.com> Hello PLT, I have a PLT-Scheme 4.1 install on Windows XP and tried the following expressions all prefixed with #lang scheme: (require (planet "list.ss" ("dherman" "list.plt" 2 0))) (require (planet "sicp.ss" ("soegaard" "sicp.plt" 2 0))) (require (planet "pairing-heap.ss" ("wmfarr" "pairing-heap.plt" 1 0))) None of them worked, they all return the same error ... "string->number: expects argument of type ; given #f." I have no idea what that means, could any one be of assistance Thank you, Joshua Ewulo -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081002/c1f59288/attachment.html From jensaxel at soegaard.net Thu Oct 2 14:24:52 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:29:35 2009 Subject: [plt-scheme] rotate90 is clockwise on einstein; CCW on zorro In-Reply-To: <72ef860f0810010948l156b7bedla2783de4bfff5e8c@mail.gmail.com> References: <72ef860f0809301031x228dc296p81e978db48366751@mail.gmail.com> <72ef860f0809301450n3adfb096u2e8f2fc1c20e29f6@mail.gmail.com> <48E339B2.2080503@soegaard.net> <72ef860f0810010948l156b7bedla2783de4bfff5e8c@mail.gmail.com> Message-ID: <48E511F4.4010707@soegaard.net> I have found and fixed the bug(s). The new version is now available at PLaneT as version 2.1. A very small test suite is included. Please write if, you find more errors. #lang scheme (require (planet "test.ss" ("soegaard" "sicp.plt" 2 1))) -- Jens Axel S?gaard From robby at cs.uchicago.edu Thu Oct 2 14:29:04 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:29:35 2009 Subject: [plt-scheme] Problem with require statements using PLT4.x In-Reply-To: <61436f8d0810020955n1cf17f94t7ce2838b6615a870@mail.gmail.com> References: <61436f8d0810020955n1cf17f94t7ce2838b6615a870@mail.gmail.com> Message-ID: <932b2f1f0810021129w70f8a10cg5d75ee2419683941@mail.gmail.com> I've just tried this under vista using 4.1 and I'm not seeing that output. I'd guess that the XP/vista difference isn't significant and that there is something else wrong. Possibly the planet cache got out of sync somehow? Is this the first error you've seen? Do you get a stack trace with the error message? Thanks, Robby On Thu, Oct 2, 2008 at 11:55 AM, Joshua Ewulo wrote: > Hello PLT, > > I have a PLT-Scheme 4.1 install on Windows XP and tried the following > expressions all prefixed with #lang scheme: > (require (planet "list.ss" ("dherman" "list.plt" 2 0))) > (require (planet "sicp.ss" ("soegaard" "sicp.plt" 2 0))) > (require (planet "pairing-heap.ss" ("wmfarr" "pairing-heap.plt" 1 0))) > > None of them worked, they all return the same error ... "string->number: > expects argument of type ; given #f." > > I have no idea what that means, could any one be of assistance > > Thank you, > Joshua Ewulo > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From esmith at acanac.net Thu Oct 2 17:43:35 2008 From: esmith at acanac.net (Ernie Smith) Date: Thu Mar 26 02:29:35 2009 Subject: [plt-scheme] Where to find out that library objects like "chmod" are available in the underlying implementation? Message-ID: <48E54087.7020001@acanac.net> I picked this out of the thread: >Re: [plt-scheme] Is there any way to make a file writable? >> (If I need to make an ffi call to 'system', any hints on exactly >> which lib-ffi I need to load?) > >That's easy: > (require (lib "foreign.ss")) (unsafe!) > (define chmod (get-ffi-obj "chmod" #f (_fun _path _int -> _void))) > (chmod "some-path" #o644) Easy indeed. I tried it. It works. Now here are my questions: 1- Where would I have needed to look to find out that "chmod" is available like that when the lib argument is #f? 2- What other underlying system calls are available? The one that would suit me right now would be 'stat'. I'm attempting to write a script that traverses the file system on a specific device. (fold-files ..) almost does the trick but... I need to prune cross-device directory transitions. That would be easy enough by monitoring transitions in device number using "stat". I also need to ignore all the special files one tends to find on unix systems, i.e. filter for 'regular files' not named pipes, special device files etc.. The frustrating thought I've been having is that in order to implement (fold-files ...) the underlying software is likely using "stat". I'm hoping this post has two effects. 1- A nice quick easy answer like Eli Barzilay came up with for "chmod". 2- This inspires someone on the PLT team to come up with an improved (fold-files ..) that makes the desire for "stat" ffi calls at this level go away. BTW I'm still on 372 TIA From yinso.chen at gmail.com Fri Oct 3 01:37:14 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:29:36 2009 Subject: [plt-scheme] change default-web-root to a different path In-Reply-To: References: <779bf2730810011756r1f55340bte9abb5b802b09dcf@mail.gmail.com> Message-ID: <779bf2730810022237q4fe11833x3607679efc66a49e@mail.gmail.com> Hi - is there a way to retrieve the path of this configuration file? Within web-server/configuration/configuration-table I only find a default-configuration-table-path, which is not what I needed when a new configuration-table path is passed in. Is there a `(current-configuration-table-path)` or `(current-configuration-table)`? Thanks, yc On Wed, Oct 1, 2008 at 6:53 PM, Jay McCarthy wrote: > When you run the web-server via plt-web-server you can pass an > argument to specify the configuration file. That file determines where > the paths are for everything: > > http://docs.plt-scheme.org/web-server/command-line-tools.html > > Jay > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081002/af7557aa/attachment.htm From noelwelsh at gmail.com Fri Oct 3 02:45:00 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:29:36 2009 Subject: [plt-scheme] Where to find out that library objects like "chmod" are available in the underlying implementation? In-Reply-To: <48E54087.7020001@acanac.net> References: <48E54087.7020001@acanac.net> Message-ID: On Thu, Oct 2, 2008 at 10:43 PM, Ernie Smith wrote: > Now here are my questions: > > 1- Where would I have needed to look to find out that "chmod" is available > like that when the lib argument is #f? It isn't directly stated, but if you read: If path is #f, then the resulting foreign-library value represents all libraries loaded in the current process, including libraries previously opened with ffi-lib. In particular, use #f to access C-level functionality exported by the run-time system (as described in Inside: PLT Scheme C API). http://docs.plt-scheme.org/foreign/Loading_Foreign_Libraries.html you can make the reasonable inference that the C standard library libc (and the GNU extension glibc [http://en.wikipedia.org/wiki/Glibc]) will be there on Unix. > 2- What other underlying system calls are available? All of them. > 2- This inspires someone on the PLT team to come up with an improved > (fold-files ..) that makes the desire for "stat" ffi calls at this level > go away. > > BTW I'm still on 372 There's a contradiction here :) N. From noelwelsh at gmail.com Fri Oct 3 02:48:32 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:29:36 2009 Subject: [plt-scheme] change default-web-root to a different path In-Reply-To: <779bf2730810022237q4fe11833x3607679efc66a49e@mail.gmail.com> References: <779bf2730810011756r1f55340bte9abb5b802b09dcf@mail.gmail.com> <779bf2730810022237q4fe11833x3607679efc66a49e@mail.gmail.com> Message-ID: If you just want to run a single servlet and other static files, the instaservlet and instaweb packages on PLaneT will do all the configuration for you. HTH, Noel On Fri, Oct 3, 2008 at 6:37 AM, YC wrote: > Hi - > > is there a way to retrieve the path of this configuration file? > > Within web-server/configuration/configuration-table I only find a > default-configuration-table-path, which is not what I needed when a new > configuration-table path is passed in. > > Is there a `(current-configuration-table-path)` or > `(current-configuration-table)`? From yinso.chen at gmail.com Fri Oct 3 04:52:19 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:29:37 2009 Subject: [plt-scheme] change default-web-root to a different path In-Reply-To: References: <779bf2730810011756r1f55340bte9abb5b802b09dcf@mail.gmail.com> <779bf2730810022237q4fe11833x3607679efc66a49e@mail.gmail.com> Message-ID: <779bf2730810030152m15e90a9cnc5628f45555504da@mail.gmail.com> Thanks Noel - I actually have the needs to run multiple servlets so it appears instaweb won't be fitting in this case, but thanks for the suggestion. yc On Thu, Oct 2, 2008 at 11:48 PM, Noel Welsh wrote: > If you just want to run a single servlet and other static files, the > instaservlet and instaweb packages on PLaneT will do all the > configuration for you. > > HTH, > Noel > > On Fri, Oct 3, 2008 at 6:37 AM, YC wrote: > > Hi - > > > > is there a way to retrieve the path of this configuration file? > > > > Within web-server/configuration/configuration-table I only find a > > default-configuration-table-path, which is not what I needed when a new > > configuration-table path is passed in. > > > > Is there a `(current-configuration-table-path)` or > > `(current-configuration-table)`? > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081003/3d47aaa2/attachment.html From noelwelsh at gmail.com Fri Oct 3 06:49:52 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:29:37 2009 Subject: [plt-scheme] change default-web-root to a different path In-Reply-To: <779bf2730810030152m15e90a9cnc5628f45555504da@mail.gmail.com> References: <779bf2730810011756r1f55340bte9abb5b802b09dcf@mail.gmail.com> <779bf2730810022237q4fe11833x3607679efc66a49e@mail.gmail.com> <779bf2730810030152m15e90a9cnc5628f45555504da@mail.gmail.com> Message-ID: Just a thought -- you can use the dispatch package to get around this. N. On Fri, Oct 3, 2008 at 9:52 AM, YC wrote: > Thanks Noel - I actually have the needs to run multiple servlets so it > appears instaweb won't be fitting in this case, but thanks for the > suggestion. > > yc From jay.mccarthy at gmail.com Fri Oct 3 08:08:54 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:29:37 2009 Subject: [plt-scheme] change default-web-root to a different path In-Reply-To: <779bf2730810022237q4fe11833x3607679efc66a49e@mail.gmail.com> References: <779bf2730810011756r1f55340bte9abb5b802b09dcf@mail.gmail.com> <779bf2730810022237q4fe11833x3607679efc66a49e@mail.gmail.com> Message-ID: I'm confused. You want your servlet to know what the configuration table the server was run with? Jay On Thu, Oct 2, 2008 at 11:37 PM, YC wrote: > Hi - > > is there a way to retrieve the path of this configuration file? > > Within web-server/configuration/configuration-table I only find a > default-configuration-table-path, which is not what I needed when a new > configuration-table path is passed in. > > Is there a `(current-configuration-table-path)` or > `(current-configuration-table)`? > > Thanks, > yc > > > On Wed, Oct 1, 2008 at 6:53 PM, Jay McCarthy wrote: >> >> When you run the web-server via plt-web-server you can pass an >> argument to specify the configuration file. That file determines where >> the paths are for everything: >> >> http://docs.plt-scheme.org/web-server/command-line-tools.html >> >> Jay >> > > -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From d.j.gurnell at gmail.com Fri Oct 3 08:12:01 2008 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Thu Mar 26 02:29:37 2009 Subject: [plt-scheme] Objects, classes and match Message-ID: <440EADF2-D391-4868-8A0B-E621E88F02F0@gmail.com> Hi all, Is there any way to use match on an object? I can't see anything in the docs (although I may be missing something obvious). Something like: (match (new my-class%) [(struct my-class% (a b c)) ...]) I don't mind setting up a custom match-expander. I suppose I could convert the object to a vector and match on that. That doesn't seem like a particularly efficient solution, though. Cheers, -- Dave From egarrulo at gmail.com Fri Oct 3 08:28:44 2008 From: egarrulo at gmail.com (Elena Garrulo) Date: Thu Mar 26 02:29:38 2009 Subject: [plt-scheme] Win32 FFI: Handling structures. Message-ID: <9bd8a08a0810030528p71832894g1d6256464156c958@mail.gmail.com> Hi, I'm wrapping Win32 PC/SC and I don't understand how I should wrap structures. Here is my simplified header: ============= C HEADER ============= #define IN /* Tag for INPUT parameters */ #define OUT /* Tag for OUTPUT parameters */ typedef int DWORD; typedef int LONG; typedef LONG SCARDHANDLE; typedef unsigned char BYTE; typedef const BYTE* LPCBYTE; typedef DWORD* LPDWORD; typedef struct _SCARD_IO_REQUEST{ DWORD dwProtocol; // Protocol identifier DWORD cbPciLength; // Protocol Control Information Length } SCARD_IO_REQUEST, *PSCARD_IO_REQUEST, *LPSCARD_IO_REQUEST; typedef const SCARD_IO_REQUEST *LPCSCARD_IO_REQUEST; LONG SCardTransmit( IN SCARDHANDLE hCard, IN LPCSCARD_IO_REQUEST pioSendPci, IN LPCBYTE pbSendBuffer, IN DWORD cbSendLength, IN OUT LPSCARD_IO_REQUEST pioRecvPci, OUT LPBYTE pbRecvBuffer, IN OUT LPDWORD pcbRecvLength); ============= END OF C HEADER ============= Here is my conversion attempt: ============= SCHEME MODULE ============= ;; #lang mzscheme (module winscard mzscheme (require mzlib/foreign) (unsafe!) (define winscard (ffi-lib "winscard")) (define _DWORD _int) (define _LONG _int) (define _SCARDHANDLE _int) (provide scard-ok) (define (scard-ok scard-error) (= scard-error 0)) (provide make-SCARD_IO_REQUEST) (define-cstruct _SCARD_IO_REQUEST ([dwProtocol _DWORD];; // Protocol identifier [cbPciLength _DWORD])) ;; // Protocol Control Information Length #| LONG SCardTransmit( IN SCARDHANDLE hCard, IN LPCSCARD_IO_REQUEST pioSendPci, IN LPCBYTE pbSendBuffer, IN DWORD cbSendLength, IN OUT LPSCARD_IO_REQUEST pioRecvPci, OUT LPBYTE pbRecvBuffer, IN OUT LPDWORD pcbRecvLength); |# (provide scard-transmit) (define scard-transmit (get-ffi-obj "SCardTransmit" winscard (_fun (hCard : _SCARDHANDLE) ;; == IN SCARDHANDLE hCard (pioSendPci : _SCARD_IO_REQUEST-pointer) ;; == IN LPCSCARD_IO_REQUEST pioSendPci (pbSendBuffer : (_vector i _byte)) ;; == IN LPCBYTE pbSendBuffer (cbSendLength : _DWORD) ;; == IN DWORD cbSendLength (ioRecvPci : (_ptr io _SCARD_IO_REQUEST)) ;; == IN OUT LPSCARD_IO_REQUEST pioRecvPci (pbRecvBuffer : (_vector o _byte cbRecvLength)) ;; == OUT LPBYTE pbRecvBuffer (cbRecvLength : (_ptr io _DWORD)) ;; == IN OUT LPDWORD pcbRecvLength -> (error : _LONG) -> (if (scard-ok error) '(error ioRecvPci pbRecvBuffer cbRecvLength) #f) ))) ) ============= END OF SCHEME MODULE ============= ============= SCHEME PROGRAM ============= (require "winscard.ss") (require mzlib/foreign) (unsafe!) (define hCard 1) (define pioSendPci (make-SCARD_IO_REQUEST #x0002 8)) (define pbSendBuffer (make-vector 4 0)) (define cbSendLength 4) (define ioRecvPci (make-SCARD_IO_REQUEST #x0002 8)) (define cbRecvLength 4) (scard-transmit hCard pioSendPci pbSendBuffer cbSendLength ioRecvPci ;; pbRecvBuffer skipped since it's an output parameter cbRecvLength) ============= END OF SCHEME PROGRAM ============= Program fails with: "zero?: expects argument of type ; given #". Any hint? Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081003/de195146/attachment.htm From samth at ccs.neu.edu Fri Oct 3 09:16:54 2008 From: samth at ccs.neu.edu (Sam TH) Date: Thu Mar 26 02:29:38 2009 Subject: [plt-scheme] Objects, classes and match In-Reply-To: <440EADF2-D391-4868-8A0B-E621E88F02F0@gmail.com> References: <440EADF2-D391-4868-8A0B-E621E88F02F0@gmail.com> Message-ID: <63bb19ae0810030616s40fce259p668a213828a302b6@mail.gmail.com> On Fri, Oct 3, 2008 at 8:12 AM, Dave Gurnell wrote: > Hi all, > > Is there any way to use match on an object? I can't see anything in the docs > (although I may be missing something obvious). Something like: > > (match (new my-class%) > [(struct my-class% (a b c)) > ...]) > > I don't mind setting up a custom match-expander. I suppose I could convert > the object to a vector and match on that. That doesn't seem like a > particularly efficient solution, though. There isn't anything in match at the moment for this. If I was implementing this, I'd probably want this to do something like: (class [a x] [b y] [c z]) => (app (lambda (e) (list (send e a) (send e b) (send e c))) (list x y z)) maybe using `get-field' instead of `send'. If you have other ideas for the API, I'm happy to hear them. I haven't found anything I particularly like, and that's why there's nothing in `match' at the moment. Thanks, -- sam th samth@ccs.neu.edu From esmith at acanac.net Fri Oct 3 11:42:45 2008 From: esmith at acanac.net (Ernie Smith) Date: Thu Mar 26 02:29:38 2009 Subject: [plt-scheme] Where to find out that library objects like "chmod" are available in the underlying implementation? In-Reply-To: References: <48E54087.7020001@acanac.net> Message-ID: <48E63D75.1080108@acanac.net> Noel Welsh wrote: > It isn't directly stated, but if you read: > > If path is #f, then the resulting foreign-library value represents > all libraries loaded in the current process, including libraries > previously opened with ffi-lib. In particular, use #f to access > C-level functionality exported by the run-time system (as described in > Inside: PLT Scheme C API). > > http://docs.plt-scheme.org/foreign/Loading_Foreign_Libraries.html > Actually I did read that, after Noel's comment I read it again. I still cannot find indication regarding any libc or glibc functions or any other except those supplied by the implementation for spanning the C/Scheme divide. Maybe someone could show me where. > you can make the reasonable inference that the C standard library libc > (and the GNU extension glibc [http://en.wikipedia.org/wiki/Glibc]) > will be there on Unix. > Many reasonable inferences can be made, but one would find comfort in finding an assertion like the above somewhere in the documentation with or without caveats. The kind of comfort that permits you to make the bold assumption that this may continue in later versions. Otherwise the amount of maintenance and installation baggage that goes with a simple script goes up dramatically as well as the risks. Without some kind of confirmation in the documentation, allowing the #f argument option (as below) is just a really bad idea seeking someone to persecute? (define chmod (get-ffi-obj "chmod" #f (_fun _path _int -> _void))) Clearly there is an expectation of a specific behaviour and a specific interface from 'chmod'. With only #f, 'reasonable inference', and no confirmation in the docs, that is just a hope and prayer. Putting these words into scheme.. let me make a little mod to Eli's example: (require (lib "foreign.ss" )) (unsafe!) (define-syntax get-hope-and-pray-ffi-obj (syntax-rules () ((_ x y ...) (get-ffi-obj x #f y ...)))) ;; unsafe and insane (define chmod (get-hope-and-pray-ffi-obj "chmod" (_fun _path _int -> _void))) (chmod "foo" #o644) (display "I think I may have been lucky") (newline) ;; ;; I propose this sort of #f option usage for inclusion in the PLT wild-abandon-howto. ;; ;; Supplying the specific lib/version that the function is assumed to link to would be saner. ;; Of great usefulness to someone like me would be easy reliable access to knowledge of ;; which lib/versions the underlying implementation versions themselves rely on. ;; The exposure of a mapping of functions accessed by the implementation ;; to the libraries they link to in run time api would be bliss. (unsafe-but-sane!) ;; We could then differentiate (unsafe!) into (insane!) and (unsafe-but-sane!) From goetter at mazama.net Fri Oct 3 11:51:54 2008 From: goetter at mazama.net (Ben Goetter) Date: Thu Mar 26 02:29:38 2009 Subject: [plt-scheme] Win32 FFI: Handling structures. In-Reply-To: <9bd8a08a0810030528p71832894g1d6256464156c958@mail.gmail.com> References: <9bd8a08a0810030528p71832894g1d6256464156c958@mail.gmail.com> Message-ID: <48E63F9A.3000805@mazama.net> Elena Garrulo wrote: > Program fails with: "zero?: expects argument of type ; > given #". The problem stems from your declaration of pbRecvBuffer. cbRecvLength is already cpointer-ized by the time _vector gets its hands on it: > (_fun [...] > (pbRecvBuffer : (_vector o _byte cbRecvLength)) > (cbRecvLength : (_ptr io _DWORD)) > [...] ) Also, note that when the underlying scard call succeeds, you are returning a literal list of the four symbols error, ioRecvPci, pbRecvBuffer, and cbRecvLength: > -> (if (scard-ok error) '(error ioRecvPci > pbRecvBuffer cbRecvLength) #f) Ben From yinso.chen at gmail.com Fri Oct 3 13:31:07 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:29:39 2009 Subject: [plt-scheme] change default-web-root to a different path In-Reply-To: References: <779bf2730810011756r1f55340bte9abb5b802b09dcf@mail.gmail.com> <779bf2730810022237q4fe11833x3607679efc66a49e@mail.gmail.com> Message-ID: <779bf2730810031031j1862c439y4f2b8b97e4cbef2a@mail.gmail.com> This is a new issue after I switched the config table, because I made use of the `default-configuration-table-path`, sorry for the confusion. What I am doing is calculating the path in the url that belongs to the servlet's name (and the part that doesn't belong). The hack I came up with basically made use of `make-url->path` & `make-url->valid-path` to derive the paths, and the only path that I can pass to `make-url->path` was the `default-configuration-table-path`, but this appears to be hard coded. If there are other ways to achieve what I am doing that would work as well. Thanks, yc On Fri, Oct 3, 2008 at 5:08 AM, Jay McCarthy wrote: > I'm confused. You want your servlet to know what the configuration > table the server was run with? > > Jay > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081003/d2f7ae3b/attachment.html From toddobryan at gmail.com Fri Oct 3 14:12:48 2008 From: toddobryan at gmail.com (Todd O'Bryan) Date: Thu Mar 26 02:29:39 2009 Subject: [plt-scheme] HtDP 17.7.1-4 - Diff between name-of-function and function-name In-Reply-To: <3d990956-9270-497e-bfb5-5eaf8b4446c6@h2g2000hsg.googlegroups.com> References: <3d990956-9270-497e-bfb5-5eaf8b4446c6@h2g2000hsg.googlegroups.com> Message-ID: <904774730810031112j66424f09p9a576475725faced@mail.gmail.com> On Thu, Oct 2, 2008 at 12:23 PM, dave yrueta wrote: > Hi All -- > > Two questions about exercises 17.4.*. > > The terms of these exercises suggests a significant difference between > a function-name and name-of-function. > > Is a function-name a symbol and a name-of-function a variable, where > No, both are symbols. When you define a function, you give it a name (a symbol). When you use a function, you have to look up its definition by giving its name (also a symbol). > A function-definition(fd) is a structure > (make-fd f-name p-name f-body) where > f-name is a symbol, p-name is a symbol and f-body is a scheme- > expression, and; > > A name-of-function(fn) is the variable in the sentence > (define fn fd) > where define is a keyword, fn is a variable and fd is function- > definition, and; > Here's the problem. You don't write the name-of-function definition above. > A function-application (fa) is a structure, where > (make-fa fn arg) > where fn is a name-of-function and arg is a scheme-expression? > I actually hate this form of data/structure definition because it's wordy and unwieldy. When I went through the training, Kathi used the following form, which I hope will be the model for 2e. (Unless 2e uses something like Typed Scheme, which would be even better. Declaring types is a pain, but type checking is a lot of help for students.) For 17.7.1, I'd do something like: ;; A function-appl is: ;; (make-function-appl symbol scheme-expr) (define-struct function-appl (func-name argument)) Then for 17.7.2, I'd have: ;; A function-defn is: ;; (make-function-defn symbol symbol scheme-expr) (define-struct function-defn (func-name param-name body)) I think these are completely equivalent to what you have above, except that both func-names are symbols, not structures. > If this is the case, then I have a follow-up question for exercise > 17.7.4: what is the meaning of Step 2, which instructs "evaluate-with- > defs" to "look up the definition of P is defs?" > > Example:, > (define(f x) (+ 3 x) is translated to name-of-function > (define f (make-fd 'f 'x (make-add 3 'x))), and; > > (define (h u) (f (* 2 u))) is translated to name-of-function > (define h(make-fd 'h 'u(make-fa f (make-mul 2 'u)))) > Ah. Here's the problem. You're mixing real Scheme with the fake version of Scheme we're writing. (Maybe the next version should call this language Skeem or something, just to be clear that we're writing a language like Scheme in Scheme.) Here's a translation table: Scheme :: Skeem (+ 3 4) :: (make-add 3 4) (define (f x) (+ x 4)) :: (make-func-defn 'f 'x (make-add 'x 4)) (f 3) :: (make-function-appl 'f 3) Using your examples above, I'd have: (define(f x) (+ 3 x) :: (make-func-defn 'f 'x (make-add 3 'x) (define (h u) (f (* 2 u))) :: (make-func-defn 'h 'u (make-function-appl 'f (make-mul 2 'u))) So this explains why you have to look up the function's body--you just have the name (a symbol) when you're trying to do the application. You have to find the function's definition in the list of definitions by using the name, and then substitute correctly into its body. Does that make sense? Todd From noelwelsh at gmail.com Fri Oct 3 16:26:13 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:29:39 2009 Subject: [plt-scheme] Where to find out that library objects like "chmod" are available in the underlying implementation? In-Reply-To: <48E63D75.1080108@acanac.net> References: <48E54087.7020001@acanac.net> <48E63D75.1080108@acanac.net> Message-ID: On Fri, Oct 3, 2008 at 4:42 PM, Ernie Smith wrote: > Many reasonable inferences can be made, but one would find comfort in > finding an assertion > like the above somewhere in the documentation with or without caveats. You can't in general make many useful statements, as PLT can be compiled with or without many libraries (e.g. OpenGL, Cairo, etc... the options specified in the configure script). However you can almost surely rely on libc being linked in on Unix systems. I believe you can call the OS directly from assembler, but this is the only way I know to get around using libc, and it certainly isn't a time effective way to develop. It's called the standard library for a reason... any reasonable program that does an kind of system call (e.g. IO, threads, date/time, memory allocation, etc.) is going to link to it. If you don't like that assurance you can always load a copy of libc directly: > (require scheme/foreign) > (unsafe!) > (ffi-lib "libc") # and away you go. HTH, N. From jay.mccarthy at gmail.com Fri Oct 3 17:29:25 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:29:39 2009 Subject: [plt-scheme] change default-web-root to a different path In-Reply-To: <779bf2730810031031j1862c439y4f2b8b97e4cbef2a@mail.gmail.com> References: <779bf2730810011756r1f55340bte9abb5b802b09dcf@mail.gmail.com> <779bf2730810022237q4fe11833x3607679efc66a49e@mail.gmail.com> <779bf2730810031031j1862c439y4f2b8b97e4cbef2a@mail.gmail.com> Message-ID: A user goes to the URL http://server/path/to/servlet.ss and you want servlet.ss Isn't that this-expression-file-name? http://docs.plt-scheme.org/mzlib/mzlib_etc.html#(form._((lib._mzlib/etc..ss)._this-expression-file-name)) Jay On Fri, Oct 3, 2008 at 11:31 AM, YC wrote: > This is a new issue after I switched the config table, because I made use of > the `default-configuration-table-path`, sorry for the confusion. > > What I am doing is calculating the path in the url that belongs to the > servlet's name (and the part that doesn't belong). The hack I came up with > basically made use of `make-url->path` & `make-url->valid-path` to derive > the paths, and the only path that I can pass to `make-url->path` was the > `default-configuration-table-path`, but this appears to be hard coded. > > If there are other ways to achieve what I am doing that would work as well. > > Thanks, > yc > > On Fri, Oct 3, 2008 at 5:08 AM, Jay McCarthy wrote: >> >> I'm confused. You want your servlet to know what the configuration >> table the server was run with? >> >> Jay >> > > -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From yinso.chen at gmail.com Fri Oct 3 17:41:33 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:29:40 2009 Subject: [plt-scheme] change default-web-root to a different path In-Reply-To: References: <779bf2730810011756r1f55340bte9abb5b802b09dcf@mail.gmail.com> <779bf2730810022237q4fe11833x3607679efc66a49e@mail.gmail.com> <779bf2730810031031j1862c439y4f2b8b97e4cbef2a@mail.gmail.com> Message-ID: <779bf2730810031441s2060f1e6g4d90a7e46c6130c2@mail.gmail.com> A user goes to the URL http://server/path/to/servlet.ss/something/else/afterwards I want to know 1) /path/to/servlet.ss as the virtual path for the servlet so I can calculate 2) /sometihng/else/afterwards as the path info `this-expression-file-name` doesn't tell me how many levels down is the server's root directory, so it's a bit more difficult to do relative path calculation. Thanks, yc On Fri, Oct 3, 2008 at 2:29 PM, Jay McCarthy wrote: > A user goes to the URL > > http://server/path/to/servlet.ss > > and you want > > servlet.ss > > Isn't that this-expression-file-name? > > > http://docs.plt-scheme.org/mzlib/mzlib_etc.html#(form._((lib._mzlib/etc..ss)._this-expression-file-name)) > > Jay > > On Fri, Oct 3, 2008 at 11:31 AM, YC wrote: > > This is a new issue after I switched the config table, because I made use > of > > the `default-configuration-table-path`, sorry for the confusion. > > > > What I am doing is calculating the path in the url that belongs to the > > servlet's name (and the part that doesn't belong). The hack I came up > with > > basically made use of `make-url->path` & `make-url->valid-path` to derive > > the paths, and the only path that I can pass to `make-url->path` was the > > `default-configuration-table-path`, but this appears to be hard coded. > > > > If there are other ways to achieve what I am doing that would work as > well. > > > > Thanks, > > yc > > > > On Fri, Oct 3, 2008 at 5:08 AM, Jay McCarthy > wrote: > >> > >> I'm confused. You want your servlet to know what the configuration > >> table the server was run with? > >> > >> Jay > >> > > > > > > > > -- > Jay McCarthy > Assistant Professor / Brigham Young University > http://jay.teammccarthy.org > > "The glory of God is Intelligence" - D&C 93 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081003/8c63a16f/attachment.htm From geb_a at yahoo.com Fri Oct 3 21:27:41 2008 From: geb_a at yahoo.com (geb a) Date: Thu Mar 26 02:29:40 2009 Subject: [plt-scheme] html parsing and maintaining structure... In-Reply-To: <20081003160039.BF9D2402B7@qua.cs.brown.edu> Message-ID: <518141.67225.qm@web50902.mail.re2.yahoo.com> Hello, I'm trying to maintain the structure of a table in xhtml. Unfortunately, I'm having trouble understanding matching structures and in particular the structures defined in the html library. In particular, I'm not understanding the documentation here. (struct (body html-full)()) A body is (make-body (listof attribute) (listof Contents-of-body)) How are the listof attributes accessed? How about the contents? There don't seem to be any accessor functions (at least, I'm unable to pull the information out of the structure). The following (modified) example would help to understand what's going on. How can I pull out just the table with its structure intact? (module html-example scheme ; Some of the symbols in html and xml conflict with ; each other and with scheme/base language, so we prefix ; to avoid namespace conflict. (require (prefix-in h: html) (prefix-in x: xml)) (define an-html (h:read-xhtml (open-input-string (string-append "My title" "

Hello world

Testing!

" "
first cell second cell
" "")))) ; extract-pcdata: html-content -> (listof string) ; Pulls out the pcdata strings from some-content. (define (extract-pcdata some-content) (cond [(x:pcdata? some-content) (list (x:pcdata-string some-content))] [(x:entity? some-content) (list)] [else (extract-pcdata-from-element some-content)])) ; extract-pcdata-from-element: html-element -> (listof string) ; Pulls out the pcdata strings from an-html-element. (define (extract-pcdata-from-element an-html-element) (match an-html-element [(struct h:html-full (content)) (map extract-pcdata content)] [(struct h:html-element (attributes))'()] [else an-html-element])) ;(struct (html html-full) ()) ;[(struct h:body ))) From noelwelsh at gmail.com Sat Oct 4 05:13:32 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:29:40 2009 Subject: [plt-scheme] html parsing and maintaining structure... In-Reply-To: <518141.67225.qm@web50902.mail.re2.yahoo.com> References: <20081003160039.BF9D2402B7@qua.cs.brown.edu> <518141.67225.qm@web50902.mail.re2.yahoo.com> Message-ID: On Sat, Oct 4, 2008 at 2:27 AM, geb a wrote: > The following (modified) example would help to understand what's going on. How can I pull out just the table with its structure intact? I'd use the SSAX tools: http://schemecookbook.org/Cookbook/XMLRecipeXPath http://schemecookbook.org/Cookbook/XMLRecipeXMLToData N. From robby at cs.uchicago.edu Sat Oct 4 08:05:52 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:29:41 2009 Subject: [plt-scheme] html parsing and maintaining structure... In-Reply-To: <518141.67225.qm@web50902.mail.re2.yahoo.com> References: <20081003160039.BF9D2402B7@qua.cs.brown.edu> <518141.67225.qm@web50902.mail.re2.yahoo.com> Message-ID: <932b2f1f0810040505y3cbf3e05md08104ad699889f5@mail.gmail.com> You probably want to use xexprs instead of xml. You write something like this: `(table (tr (td "a" "b" "c") (td "e")) (tr (td ((colspan "2")) "pqr"))) and then use xexpr->xml and display-xml/content to render it. But when you're building them you just stick with x-expressions (ie, s-expressions that represent xml). Or just use SSAX. Robby On Fri, Oct 3, 2008 at 8:27 PM, geb a wrote: > Hello, > > I'm trying to maintain the structure of a table in xhtml. Unfortunately, I'm having trouble understanding matching structures and in particular the structures defined in the html library. > > In particular, I'm not understanding the documentation here. > (struct (body html-full)()) > A body is (make-body (listof attribute) (listof Contents-of-body)) > > How are the listof attributes accessed? How about the contents? There don't seem to be any accessor functions (at least, I'm unable to pull the information out of the structure). > > The following (modified) example would help to understand what's going on. How can I pull out just the table with its structure intact? > > (module html-example scheme > > ; Some of the symbols in html and xml conflict with > ; each other and with scheme/base language, so we prefix > ; to avoid namespace conflict. > > (require (prefix-in h: html) > (prefix-in x: xml)) > > > (define an-html > (h:read-xhtml > (open-input-string > (string-append > "My title" > "

Hello world

Testing!

" > "
first cell second cell
" > "")))) > > ; extract-pcdata: html-content -> (listof string) > ; Pulls out the pcdata strings from some-content. > (define (extract-pcdata some-content) > (cond [(x:pcdata? some-content) > (list (x:pcdata-string some-content))] > [(x:entity? some-content) (list)] > [else (extract-pcdata-from-element some-content)])) > > > ; extract-pcdata-from-element: html-element -> (listof string) > ; Pulls out the pcdata strings from an-html-element. > (define (extract-pcdata-from-element an-html-element) > (match an-html-element > [(struct h:html-full (content)) (map extract-pcdata content)] > [(struct h:html-element (attributes))'()] > [else an-html-element])) > ;(struct (html html-full) ()) > ;[(struct h:body ))) > > > > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From matthias at ccs.neu.edu Sat Oct 4 10:39:29 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:29:41 2009 Subject: [plt-scheme] HtDP 17.7.1-4 - Diff between name-of-function and function-name In-Reply-To: <3d990956-9270-497e-bfb5-5eaf8b4446c6@h2g2000hsg.googlegroups.com> References: <3d990956-9270-497e-bfb5-5eaf8b4446c6@h2g2000hsg.googlegroups.com> Message-ID: <1D778C47-E668-4EF1-B577-2890455F28B7@ccs.neu.edu> 1. You are over-interpreting the distinction of "function name" and "name of a function" in English. Same thing. 2. One of the purposes of this exercise is to learn to keep "information" (real Scheme) separate from "data" (your chosen representation of Scheme expressions). I don't have time to comment in detail. Good luck -- Matthias On Oct 2, 2008, at 12:23 PM, dave yrueta wrote: > Hi All -- > > Two questions about exercises 17.4.*. > > The terms of these exercises suggests a significant difference between > a function-name and name-of-function. > > Is a function-name a symbol and a name-of-function a variable, where > > A function-definition(fd) is a structure > (make-fd f-name p-name f-body) where > f-name is a symbol, p-name is a symbol and f-body is a scheme- > expression, and; > > A name-of-function(fn) is the variable in the sentence > (define fn fd) > where define is a keyword, fn is a variable and fd is function- > definition, and; > > A function-application (fa) is a structure, where > (make-fa fn arg) > where fn is a name-of-function and arg is a scheme-expression? > > If this is the case, then I have a follow-up question for exercise > 17.7.4: what is the meaning of Step 2, which instructs "evaluate- > with- > defs" to "look up the definition of P is defs?" > > Example:, > (define(f x) (+ 3 x) is translated to name-of-function > (define f (make-fd 'f 'x (make-add 3 'x))), and; > > (define (h u) (f (* 2 u))) is translated to name-of-function > (define h(make-fd 'h 'u(make-fa f (make-mul 2 'u)))) > > ;;evaluate-with-defs: scheme-expression list-of-defs > error or number > ;;consumes a scheme-expression and a list-of-function-definitions: > returns an error if the ;;original scheme-expression is not numeric, > or if a function found as an arg for a function-;;application is not > listed in the list-of-defs; otherwise, returns a number > > Examples: > 1. (not(evaluate-with-defs 3 (list h))), since f is embedded in h, and > f is not present in list-of-defs > 2. (evaluate-with-defs 3 (list f h)) returns 12 > 3. (not(evaluate-with-defs (f 3) (list h))) > 4. (evaluate-with-defs (f 3) (list f h))) returns 18 > > My initial solution to this problem is this: > (define(evaluate-with-defs sx lofP) > (cond > [(empty? lofP)(evaluate-expression sx)] > [else (evaluate-with-defs(evaluate-with-one-def sx (first lofP)) > (rest lofP)))])) > > The second condition would begin by applying f to 3, returning 6, and > then recurring. Next, it would apply h to 6. While doing so, it > would find that h is defined as a function-application of f to (* 2 > u). At that point, it would "look-up" f in lofP to find its' > definition. However, f has already been tossed after the first > recursive call, so it would presumably return an error, which is not > correct. > > Is the solution to add a second parameter to evaluate-with-defs: > "lofP- > index" which would serve as a look-up index for all function- > definitions listed in the original "lofP?" If this is the case, then > all the previous functions would have to be retrofitted to carry this > index parameter. That doesn't seem right. > > Further, what is the point of "looking-up" the function-definition f > in lofP when the function-definition is present in the name-of- > function attribute of the function-application? The only way this > would make sense to me is if the name-of-function attribute was meant > to be a symbol, and not a variable. If that's the case, then my > approach to solving this and the previous exercise is wrong. > > For completeness, here are the rest of my data-definitions and my > version of the solution to 17.7.3: > > Thanks, > Dave Yrueta > > Data Defs: > An "add" is a structure > (make-add left right) > where left and right are both Scheme-Expressions > > An "mul" is a structure > (make-mul left right) > where left and right are both Scheme-Expressions > > A Scheme-Expression (SX) is either > 1. a number > 2. a symbol > 3. an add structure > 4. a mul structure > 5. a function-application (fa) > > ;;17.7.3 > ;;evaluate-with-one-def: sx P > error or Scheme Expression > ;;consumes a Scheme Expression and a Function-Definition, and returns > either an 'error ;;or the evaluated Scheme Expression > (define(evaluate-with-one-def sx P) > (cond > [(numeric? sx) > (cond > [(number? sx)(evaluate-expression(subs(fd-p-name P)sx(fd-f-body > P)))] > [else(evaluate-with-one-def (evaluate-expression sx)P)])] > [else 'error])) > > ;;subst:symbol number scheme-expression > scheme-expression > ;;consumes a symbol, number and scheme-expression, substitutes all > instances of the ;;symbol appearing in the scheme-expression with the > number, and then returns a ;;structurally equivalent expression. > (define(subs sym num sx) > (cond > [(mul? sx)(make-mul (subs sym num (mul-left sx))(subs sym num > (mul- > right sx)))] > [(add? sx)(make-add (subs sym num (add-left sx))(subs sym num > (add- > right sx)))] > [(fa? sx) (evaluate-with-one-def(subs sym num (fa-arg sx))(fa-fn > sx))] > [(number? sx)sx] > [(symbol=? sym sx)num] > [else sx])) > > (define(numeric? sx) > (cond > [(number? sx)true] > [(struct? sx)(test-struc sx)] > [else false])) > > (define(test-struc sx) > (cond > [(mul? sx)(and(numeric? (mul-left sx))(numeric? (mul-right sx)))] > [else (and(numeric? (add-left sx))(numeric? (add-right sx)))])) > > (define(evaluate-expression nx) > (cond > [(boolean=? (numeric? nx)false)'error] > [else (process-nx nx)])) > > (define(process-nx nx) > (cond > [(number? nx)nx] > [(mul? nx)(*(evaluate-expression (mul-left nx))(evaluate- > expression (mul-right nx)))] > [else (+(evaluate-expression (add-left nx))(evaluate-expression > (add-right nx)))])) > > > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From sergey.khorev at gmail.com Sat Oct 4 11:02:42 2008 From: sergey.khorev at gmail.com (Sergey Khorev) Date: Thu Mar 26 02:29:41 2009 Subject: [plt-scheme] Code for catching exceptions in embedding applications Message-ID: <48E78592.1060400@gmail.com> Hi, While trying to migrate an application to PLT 4.1, I stuck with exception handling. Code below (basically it has been extracted from PLT documentation) crashes with #f::0: compile: bad syntax; function application is not allowed, because no #%app syntax transformer is bound in: (lambda (thunk) (with-handlers ((void (lambda(exn) (cons #f exn)))) (cons #t (thunk)))) Seg fault (internal error) at 4 Do I need to `require' some module for this to work? #define MZ_PRECISE_GC 1 #include /* #include "base.c" */ static Scheme_Env *environment = NULL; static int scheme_main(void *data) { char *e = "(lambda (thunk) " "(with-handlers ([void (lambda (exn) (cons #f exn))]) " "(cons #t (thunk))))"; Scheme_Env *env = NULL; Scheme_Object *exn_catching_apply = NULL; Scheme_Object *sym = NULL; MZ_GC_DECL_REG(3); MZ_GC_VAR_IN_REG(0, env); MZ_GC_VAR_IN_REG(1, exn_catching_apply); MZ_GC_VAR_IN_REG(2, sym); MZ_GC_REG(); MZ_REGISTER_STATIC(environment); environment = scheme_basic_env(); /* declare_modules(environment); sym = scheme_intern_symbol("scheme/base"); scheme_namespace_require(sym); */ env = (Scheme_Env *)scheme_make_namespace(0, NULL); exn_catching_apply = scheme_eval_string(e, env); MZ_GC_UNREG(); return 1; } int main() { return scheme_main_stack_setup(1, scheme_main, NULL); } From spdegabrielle at gmail.com Sat Oct 4 18:19:21 2008 From: spdegabrielle at gmail.com (Stephen De Gabrielle) Date: Thu Mar 26 02:29:41 2009 Subject: [plt-scheme] capturing composite mouse events in mred Message-ID: <595b9ab20810041519x33166ee7i54c67ceae6a74d99@mail.gmail.com> Hi, I'm trying to capture a click on an empty pasteboard, but mouse events only seem to exist in their most basic form. ('mouse-down 'enter 'exit etc.) [I can't be the first person to want to do this?] Have I missed something in the documentation, is there a library, or should I roll my own? Stephen From kyung8653 at gmail.com Sat Oct 4 13:11:43 2008 From: kyung8653 at gmail.com (Geneve) Date: Thu Mar 26 02:29:41 2009 Subject: [plt-scheme] Scheme Programming Question (Making an error message) Message-ID: Can anyone do this? This is my homework, and I am really having trouble with it. Can any smart scientist do this? Question Details: Exercise 13. For Assignment 4, you defined the procedure reverse-list. A call to your version of reverse-list probably resulted in the following sort of error when passed an invalid argument. ------------------------------- (define combine-lists (lambda (a b) (if (null? a) b (combine-lists (cdr a) (cons (car a) b))))) (define reverse-list (lambda (ls) (combine-lists ls '()))) --------------------------------- > (reverse-list 3) Error in cdr: 3 is not a pair. > (reverse-list '(a b . c)) Error in cdr: c is not a pair. Define reverse-list using an internally defined help procedure. Have the help procedure signal an error if the incoming argument is not a pair or empty list. Your solution should make only one pass through the list. In particular, you should not use list?, proper-list?, or the equivalent to first check if the list is proper, since this would count as an additional pass through the list. (Of course, you may use the built-in pair? predicate.) (Naturally, you may not use the built- in reverse procedure since the point of the exercise is to implement that procedure.) Identify the error as coming from reverse-list, not from the helper, and show the original input to reverse-list in the error message, even if the error occurs some iterations into the loop. > (reverse-list 3) Error in reverse-list: 3 is not a proper list. > (reverse-list '(a . b)) Error in reverse-list: (a . b) is not a proper list. > (reverse-list '(a b . c)) Error in reverse-list: (a b . c) is not a proper list. > (reverse-list '(should it work? this does)) (does this work? it should) Hint: The text of this exercise tells exactly how to detect the error. From kyung8653 at gmail.com Sat Oct 4 13:19:52 2008 From: kyung8653 at gmail.com (Geneve) Date: Thu Mar 26 02:29:41 2009 Subject: [plt-scheme] I really think this is such a great group! Message-ID: I like it! From kyung8653 at gmail.com Sat Oct 4 13:13:17 2008 From: kyung8653 at gmail.com (Geneve) Date: Thu Mar 26 02:29:41 2009 Subject: [plt-scheme] Scheme Programming Question (Boolean Connectives) Message-ID: <94cc789d-7f9b-46dd-a2e2-4728a1736f03@d1g2000hsg.googlegroups.com> This is another problem that I am having trouble with. I really need your help. Question Details: Exercise 7. The built-in predicate stringlist in your solution, but do not use the built-in string (string (string (string (string (string (string (string (string Hi, I sometimes copy paste code from the docs into DrScheme; a really frustrating thing happens - every line in the docs is replaces by 10 lines in DrScheme. (see example below) I've attached a picture of the table structure used. Would it be a problem If I looked into other ways of getting the same layout without tables? Cheers, Stephen -- Example source html for on-load-file (five lines)

(send an-editor on-load-file

 

filename

 

 

 

 

 

 

format)

 

?

 

void?

  filename : path?

  

format

 

:

 

(one-of/c 'guess 'same 'copy 'standard

          'text 'text-force-cr)

-- example of pasting editor-snip because I can't remember all the attributes :-) -- (new editor-snip% [ [editor editor] [with-border? with-border?] [left-margin left-margin] [top-margin top-margin] [right-margin right-margin] [bottom-margin bottom-margin] [left-inset left-inset] [top-inset top-inset] [right-inset right-inset] [bottom-inset bottom-inset] [min-width min-width] [max-width max-width] [min-height min-height] [max-height max-height]]) --- -------------- next part -------------- A non-text attachment was scrubbed... Name: Picture 5.png Type: image/png Size: 19865 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081005/408f558f/Picture5.png From s.degabrielle at cs.ucl.ac.uk Sun Oct 5 04:14:00 2008 From: s.degabrielle at cs.ucl.ac.uk (Stephen De Gabrielle) Date: Thu Mar 26 02:29:42 2009 Subject: [plt-scheme] Scheme Programming Question (Boolean Connectives) In-Reply-To: <94cc789d-7f9b-46dd-a2e2-4728a1736f03@d1g2000hsg.googlegroups.com> References: <94cc789d-7f9b-46dd-a2e2-4728a1736f03@d1g2000hsg.googlegroups.com> Message-ID: <595b9ab20810050114w7a4d00e7t80926a5eafec7eda@mail.gmail.com> Um, It helps if you provide a little more information on how far you have got working it out for yourself? I think looing at http://www.htdp.org/ and http://www.scheme.com/tspl3/ (How to Design Programs and The Scheme Programming Language in online versions) provide valuable advice and examples that should help. Cheers, Stephen -- Stephen De Gabrielle s.degabrielle@cs.ucl.ac.uk Telephone +44 (0)20 7679 0693 (x30693) Mobile 079 851 890 45 Project: Making Sense of Information (MaSI) Work:http://www.uclic.ucl.ac.uk/annb/MaSI.html Home:http://www.degabrielle.name/stephen UCL Interaction Centre MPEB 8th floor University College London Gower Street London WC1E 6BT On Sat, Oct 4, 2008 at 6:13 PM, Geneve wrote: > This is another problem that I am having trouble with. > I really need your help. > > > Question Details: > Exercise 7. The built-in predicate string returns true if its arguments are given in lexicographic order, i.e., > "alphabetical order," where our alphabet includes numeric and special > characters as well as alphbetic characters. That is, (string evaluates to true if s1 is a proper prefix of s2 or if there is a > character c1 in s1 and c2 in s2 where (char empty) prefix of s1 up to (but not including) c1 is equal to the > prefix of s2 up to (but not including) c2. > > > > Define a procedure string and the built-in procedures charlist in your > solution, but do not use the built-in string comparison predicates. Experiment with test cases of your own using > the built-in string > > >> (string > #f > >> (string > #t > >> (string > #t > >> (string > #f > >> (string > #f > >> (string > #t > >> (string > #f > >> (string > #t > > > > Hint: Use a local help procedure that expects two lists of characters. > Remember that the two lists may have different lengths, and think > carefully about termination conditions in different cases. If neither > list is empty, the help procedure compares the first characters of the > two lists, and loops only if the two characters are equal. Using and > and or should simplify your code. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From kbohdan at mail.ru Sun Oct 5 06:35:02 2008 From: kbohdan at mail.ru (kbohdan@mail.ru) Date: Thu Mar 26 02:29:43 2009 Subject: [plt-scheme] apply vs dot notation syntax Message-ID: Hi all, Probably it was discussed ages ago but could not find any links regarding the following question. Why scheme has 'apply' primitive instead of simple dot notation ? i.e. we can use (f arg1 arg2 . rest-of-args-list) instead of standard: (apply f arg1 arg2 rest-of-args-list) The former looks similar to the 'define' syntax and has advantage to be processed by a compiler in some special way. For example, optimizer can remove some unused arguments. Doing the same optimization with standard approach looks unnatural from the compiler design perspective : compiler [lower layer] should know about function primitives [higher level]. Thanks. -- Bohdan From jos.koot at telefonica.net Sun Oct 5 06:39:13 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:29:43 2009 Subject: [plt-scheme] Scheme Programming Question (Boolean Connectives) References: <94cc789d-7f9b-46dd-a2e2-4728a1736f03@d1g2000hsg.googlegroups.com> Message-ID: (define (string To: Sent: Saturday, October 04, 2008 7:13 PM Subject: [plt-scheme] Scheme Programming Question (Boolean Connectives) > This is another problem that I am having trouble with. > I really need your help. > > > Question Details: > Exercise 7. The built-in predicate string returns true if its arguments are given in lexicographic order, i.e., > "alphabetical order," where our alphabet includes numeric and special > characters as well as alphbetic characters. That is, (string evaluates to true if s1 is a proper prefix of s2 or if there is a > character c1 in s1 and c2 in s2 where (char empty) prefix of s1 up to (but not including) c1 is equal to the > prefix of s2 up to (but not including) c2. > > > > Define a procedure string and the built-in procedures charlist in your > solution, but do not use the built-in string comparison predicates. Experiment with test cases of your own using > the built-in string > > >> (string > #f > >> (string > #t > >> (string > #t > >> (string > #f > >> (string > #f > >> (string > #t > >> (string > #f > >> (string > #t > > > > Hint: Use a local help procedure that expects two lists of characters. > Remember that the two lists may have different lengths, and think > carefully about termination conditions in different cases. If neither > list is empty, the help procedure compares the first characters of the > two lists, and loops only if the two characters are equal. Using and > and or should simplify your code. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From jos.koot at telefonica.net Sun Oct 5 06:49:59 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:29:43 2009 Subject: [plt-scheme] Scheme Programming Question (Making an error message) References: Message-ID: In procedure two cases are discerned (either is empty or it is something else) You should discern more cases. How do you check an object to be a list without using predicate ? You may want to first design procedure , before incorporating its body in . Jos ----- Original Message ----- From: "Geneve" To: Sent: Saturday, October 04, 2008 7:11 PM Subject: [plt-scheme] Scheme Programming Question (Making an error message) > Can anyone do this? This is my homework, and I am really having > trouble with it. > Can any smart scientist do this? > > > > > Question Details: > Exercise 13. For Assignment 4, you defined the procedure reverse-list. > A call to your version of reverse-list probably resulted in the > following sort of error when passed an invalid argument. > > > > ------------------------------- > > (define combine-lists > > (lambda (a b) > > (if (null? a) b (combine-lists (cdr a) (cons (car a) b))))) > > > > (define reverse-list > > (lambda (ls) > > (combine-lists ls '()))) > > --------------------------------- > > > >> (reverse-list 3) > > > > Error in cdr: 3 is not a pair. > >> (reverse-list '(a b . c)) > > > > Error in cdr: c is not a pair. > > > > Define reverse-list using an internally defined help procedure. Have > the help procedure signal an error if the incoming argument is not a > pair or empty list. Your solution should make only one pass through > the list. In particular, you should not use list?, proper-list?, or > the equivalent to first check if the list is proper, since this would > count as an additional pass through the list. (Of course, you may use > the built-in pair? predicate.) (Naturally, you may not use the built- > in reverse procedure since the point of the exercise is to implement > that procedure.) > > > > Identify the error as coming from reverse-list, not from the helper, > and show the original input to reverse-list in the error message, even > if the error occurs some iterations into the loop. > > > >> (reverse-list 3) > > > > Error in reverse-list: 3 is not a proper list. > >> (reverse-list '(a . b)) > > > > Error in reverse-list: (a . b) is not a proper list. > >> (reverse-list '(a b . c)) > > > > Error in reverse-list: (a b . c) is not a proper list. > >> (reverse-list '(should it work? this does)) > > (does this work? it should) > > > > Hint: The text of this exercise tells exactly how to detect the error. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From dave at pawfal.org Sun Oct 5 07:09:23 2008 From: dave at pawfal.org (Dave Griffiths) Date: Thu Mar 26 02:29:43 2009 Subject: [plt-scheme] Fluxus + video processing In-Reply-To: References: Message-ID: <1223204963.7682.5.camel@daves-laptop> Hi Noel, Sorry for the delay in getting back to you... Fluxus is not designed for processing video on a pixel by pixel basis, it's primarily a 3D game engine, and so it's mainly concerned with objects, vertices, shaders etc. Pure data has good support for video processing, and you can use osc to communicate between fluxus and pure data if you want to do that too... cheers, dave On Sat, 2008-09-20 at 22:02 +0100, Noel Welsh wrote: > Hi all, > > I've almost built up the courage to attempt installing fluxus. Before > doing so, I have a question about video processing. I'm primarily > interested in turning video streams into audio, via extracting, e.g. > movement. Am I correct in thinking that fluxus has no libraries for > doing so at the moment? Does anyone know a package (pure data?) that > does support this? I'll probably still play around with fluxus, but > I'd like to get a quick idea of what is feasible. > > Thanks, > Noel > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From jos.koot at telefonica.net Sun Oct 5 07:55:32 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:29:44 2009 Subject: [plt-scheme] apply vs dot notation syntax References: Message-ID: I think we would have a problem when writing (f a b . (g c d)). This always should mean the same thing as (f a b g c d). Although PLT scheme makes it possible to discern (f a b . (g c d)) from (f a b g c d), when read as syntax, it seems undesirable to make this distinction, I think. It certainly is going to cause problems in code that relies on the equivalence of (a . (b)) and (a b), for instance in the expansion of non primitive syntaxes. The distinction can be made as follows: Language Pretty Big: (module my-app scheme (define-syntax (my-app stx) (define (head-and-tail e) (let loop ((e e) (h '())) (cond ((null? e) (values (reverse h) (syntax '( )))) ((pair? e) (loop (cdr e) (cons (car e) h))) (else (values (reverse h) e))))) (syntax-case stx () ((_ . x) (let-values (((head tail) (head-and-tail (syntax-e #'x)))) #`(#%app apply #,@head #,tail))))) (provide (rename-out (my-app #%app)))) (require 'my-app) (define x (list 1 2 3)) (define (f c) (+ c . x)) (f 4) ; --> 10 (define (g c) (+ c . (list 1 2 3))) (g 4) ; --> 10 Jos ----- Original Message ----- From: To: Sent: Sunday, October 05, 2008 12:35 PM Subject: [plt-scheme] apply vs dot notation syntax > Hi all, > > Probably it was discussed ages ago but could not find any links > regarding the following question. > Why scheme has 'apply' primitive instead of simple dot > notation ? i.e. we can use > > (f arg1 arg2 . rest-of-args-list) > > instead of standard: > > (apply f arg1 arg2 rest-of-args-list) > > The former looks similar to the 'define' syntax > and has advantage to be processed by a compiler > in some special way. For example, optimizer can remove > some unused arguments. Doing the same optimization with > standard approach looks unnatural from the compiler design > perspective : compiler [lower layer] should know about function primitives > [higher level]. > > Thanks. > > -- > Bohdan > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From kbohdan at mail.ru Sun Oct 5 09:26:14 2008 From: kbohdan at mail.ru (kbohdan@mail.ru) Date: Thu Mar 26 02:29:44 2009 Subject: [plt-scheme] Re: apply vs dot notation syntax In-Reply-To: References: Message-ID: Jos Koot wrote: > I think we would have a problem when writing (f a b . (g c d)). > This always should mean the same thing as (f a b g c d). Right, thx. Just curious, who should be responsible for this similarity: reader? Guessing other possibilities: Following was not accepted because of additional parsing overhead?: (f a b *: (g c d)) -- Bohdan From jos.koot at telefonica.net Sun Oct 5 10:13:23 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:29:44 2009 Subject: [plt-scheme] Re: apply vs dot notation syntax References: Message-ID: <4B40FE474ED246859AE98C7007C2114C@uw2b2dff239c4d> The following holds for PLT Scheme: When reading data procedure is responsible. When reading code, the dot notation is preserved by read-syntax. In this case the designer of the transformers is responsible. (f a b *: (g c d)). I don't understand this. What does *: do? Please explain in terms of regular scheme how(f a b *: (g c d)) should be expanded. Jos ----- Original Message ----- From: To: Sent: Sunday, October 05, 2008 3:26 PM Subject: [plt-scheme] Re: apply vs dot notation syntax > Jos Koot wrote: >> I think we would have a problem when writing (f a b . (g c d)). >> This always should mean the same thing as (f a b g c d). > > Right, thx. > Just curious, who should be responsible for this similarity: reader? > > Guessing other possibilities: > Following was not accepted because of additional parsing overhead?: > > (f a b *: (g c d)) > > -- > Bohdan > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From matthias at ccs.neu.edu Sun Oct 5 10:17:16 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:29:44 2009 Subject: [plt-scheme] Scheme Programming Question (Making an error message) In-Reply-To: References: Message-ID: <332611F9-EF48-49BF-B646-EFF12A2EE220@ccs.neu.edu> On Oct 4, 2008, at 1:11 PM, Geneve wrote: > Can anyone do this? Yes, pretty much anyone can do this with a little bit of training. > This is my homework, and I am really having > trouble with it. > Can any smart scientist do this? Absolutely. Smart scientists can solve this problem. Hope this answers your questions -- Matthias From matthias at ccs.neu.edu Sun Oct 5 10:22:12 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:29:44 2009 Subject: [plt-scheme] Scheme Programming Question (Boolean Connectives) In-Reply-To: <94cc789d-7f9b-46dd-a2e2-4728a1736f03@d1g2000hsg.googlegroups.com> References: <94cc789d-7f9b-46dd-a2e2-4728a1736f03@d1g2000hsg.googlegroups.com> Message-ID: 1. HtDP, Section 17. Read up on all three cases. 2. docs: string->list Good luck -- Matthias On Oct 4, 2008, at 1:13 PM, Geneve wrote: > This is another problem that I am having trouble with. > I really need your help. > > > Question Details: > Exercise 7. The built-in predicate string returns true if its arguments are given in lexicographic order, i.e., > "alphabetical order," where our alphabet includes numeric and special > characters as well as alphbetic characters. That is, (string evaluates to true if s1 is a proper prefix of s2 or if there is a > character c1 in s1 and c2 in s2 where (char empty) prefix of s1 up to (but not including) c1 is equal to the > prefix of s2 up to (but not including) c2. > > > > Define a procedure string and the built-in procedures charlist in your > solution, but do not use the built-in string comparison predicates. Experiment with test cases of your own using > the built-in string > > >> (string > #f > >> (string > #t > >> (string > #t > >> (string > #f > >> (string > #f > >> (string > #t > >> (string > #f > >> (string > #t > > > > Hint: Use a local help procedure that expects two lists of characters. > Remember that the two lists may have different lengths, and think > carefully about termination conditions in different cases. If neither > list is empty, the help procedure compares the first characters of the > two lists, and loops only if the two characters are equal. Using and > and or should simplify your code. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From sk at cs.brown.edu Sun Oct 5 10:26:58 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:29:44 2009 Subject: [plt-scheme] Scheme Programming Question (Making an error message) In-Reply-To: References: Message-ID: Jos, You're wasting your effort in the wrong place. This person (or a classmate of theirs, "Scholar") has already posted the question to cramster.com: http://qaboard.cramster.com/computer-science-topic-5-339232-cpi0.aspx Cramster says: No one has answered this question yet. Be the first to answer. Earn up to 13 karma points. But even better: Bonus Point Alert! Earn +4 *additional* karma points for helping this annual member. Why are you answering questions on plt-scheme, when you could be preparing for the afterlife? Shriram PS: What I'd really like to know is what crackpot professor put out a question like this. Any ideas? From jos.koot at telefonica.net Sun Oct 5 10:59:23 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:29:45 2009 Subject: [plt-scheme] Scheme Programming Question (Making an error message) References: Message-ID: <5D7BA1D0D4944BE6A088ABDA49CCEC29@uw2b2dff239c4d> Thanks for warning me. My karma probably is a lack of a sound portion of paranoia. I am not preparing for afterlife, I am wasting my time on my present life. I am *rather* sure there is no afterlife, but I can't be *quite* sure there is no such thing (unless nil is to be considered to be an afterlife too) Anyway, I am not going to chase karma-points. Jos ----- Original Message ----- From: "Shriram Krishnamurthi" To: "Jos Koot" Cc: "Geneve" ; Sent: Sunday, October 05, 2008 4:26 PM Subject: Re: [plt-scheme] Scheme Programming Question (Making an error message) > Jos, > > You're wasting your effort in the wrong place. This person (or a > classmate of theirs, "Scholar") has already posted the question to > cramster.com: > > http://qaboard.cramster.com/computer-science-topic-5-339232-cpi0.aspx > > Cramster says: > > No one has answered this question yet. > Be the first to answer. Earn up to 13 karma points. > > But even better: > > Bonus Point Alert! Earn +4 *additional* karma points for helping > this annual member. > > Why are you answering questions on plt-scheme, when you could be > preparing for the afterlife? > > Shriram > > PS: What I'd really like to know is what crackpot professor put out > a question like this. Any ideas? > From jos.koot at telefonica.net Sun Oct 5 11:20:38 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:29:45 2009 Subject: [plt-scheme] Scheme Programming Question (Making an error message) References: Message-ID: <09A2FF1649AC4FECB84D2965D32B5155@uw2b2dff239c4d> ----- Original Message ----- From: "Shriram Krishnamurthi" > snip > PS: What I'd really like to know is what crackpot professor put out > a question like this. Any ideas? The exersise does seem to be "constructed" by its instructions which primitives can an which ones must not be used. If the student is given a language in which string boolean, construct a procedure list boolean, where etc. Jos From kbohdan at mail.ru Sun Oct 5 11:41:19 2008 From: kbohdan at mail.ru (kbohdan@mail.ru) Date: Thu Mar 26 02:29:45 2009 Subject: [plt-scheme] Re: apply vs dot notation syntax In-Reply-To: <4B40FE474ED246859AE98C7007C2114C@uw2b2dff239c4d> References: <4B40FE474ED246859AE98C7007C2114C@uw2b2dff239c4d> Message-ID: Jos Koot wrote: > The following holds for PLT Scheme: > When reading data procedure is responsible. > When reading code, the dot notation is preserved by read-syntax. In this > case the designer of the transformers is responsible. > > (f a b *: (g c d)). I don't understand this. > What does *: do? > Please explain in terms of regular scheme how(f a b *: (g c d)) should > be expanded. Oops, flying too high, sorry. The same as (f a b . (g c d)) before, but using "*:" keyword instead of ".". In terms of regular scheme: (f a b *: (g c d)) -> (apply f a b (g c d)) Just syntax proposal instead of standard (apply ...). -- Bohdan From kbohdan at mail.ru Sun Oct 5 12:04:02 2008 From: kbohdan at mail.ru (kbohdan@mail.ru) Date: Thu Mar 26 02:29:45 2009 Subject: [plt-scheme] Re: apply vs dot notation syntax In-Reply-To: References: <4B40FE474ED246859AE98C7007C2114C@uw2b2dff239c4d> Message-ID: kbohdan@mail.ru wrote: > (f a b *: (g c d)) -> (apply f a b (g c d)) Actually i like python function application syntax : f(arg1, arg2, *args, **kwargs) where args is a list, and kwargs is a dictionary of keyword arguments. Function definition in python can have similar syntax: def f(arg1, arg2, *args, **kwargs): ... I understand that this idea is not very applicable to scheme and would like to know all reasons for this. -- Bohdan From grettke at acm.org Sun Oct 5 12:13:03 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:29:45 2009 Subject: [plt-scheme] Scheme Programming Question (Making an error message) In-Reply-To: References: Message-ID: <756daca50810050913s3c3a2d1es8fde66cf1e25bd17@mail.gmail.com> > You're wasting your effort in the wrong place. This person (or a > classmate of theirs, "Scholar") has already posted the question to > cramster.com: > > http://qaboard.cramster.com/computer-science-topic-5-339232-cpi0.aspx I've never heard of cramster (or anything like it). Since you knew about it, and found the problem, I take it that sites like this are something that you teachers must have to deal with? Man oh man... > Why are you answering questions on plt-scheme, when you could be > preparing for the afterlife? If that worked I will go answer some questions, but I am more worried about my current life at the moment hehe. > PS: What I'd really like to know is what crackpot professor put out > a question like this. Any ideas? Funny the cramster post is indexed by google, but not the original assignment. From cce at ccs.neu.edu Sun Oct 5 12:19:29 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:29:45 2009 Subject: [plt-scheme] Re: apply vs dot notation syntax In-Reply-To: References: <4B40FE474ED246859AE98C7007C2114C@uw2b2dff239c4d> Message-ID: <990e0c030810050919r552d4d60m5aeabb82b8734d5e@mail.gmail.com> On Sun, Oct 5, 2008 at 12:04 PM, wrote: > kbohdan@mail.ru wrote: > >> (f a b *: (g c d)) -> (apply f a b (g c d)) > > Actually i like python function application syntax : > f(arg1, arg2, *args, **kwargs) > where args is a list, and kwargs is a dictionary of keyword arguments. > Function definition in python can have similar syntax: > def f(arg1, arg2, *args, **kwargs): > ... > I understand that this idea is not very applicable to scheme and would like > to know all reasons for this. I don't know much about Python. If args = list(a,b,c) and kwargs = dict(d=1,e=2), then does f(arg1,arg2,*args,**kwargs) mean f(arg1,arg2,a,b,c,d=1,e=2)? If so, then Scheme has about the same thing as keyword-apply. You can express (f x y a b c #:d 1 #:e 2) as (keyword-apply f (list '#:d '#:e) (list 1 2) x y (list a b c)). The use of apply or keyword-apply signals that you're not doing direct application, whereas in Python you look at *s in front of arguments to figure it out. Same idea, just slightly different ways of writing it down. Does that answer your question? -- Carl Eastlund From kbohdan at mail.ru Sun Oct 5 12:33:48 2008 From: kbohdan at mail.ru (kbohdan@mail.ru) Date: Thu Mar 26 02:29:46 2009 Subject: [plt-scheme] Re: apply vs dot notation syntax In-Reply-To: <990e0c030810050919r552d4d60m5aeabb82b8734d5e@mail.gmail.com> References: <4B40FE474ED246859AE98C7007C2114C@uw2b2dff239c4d> <990e0c030810050919r552d4d60m5aeabb82b8734d5e@mail.gmail.com> Message-ID: Carl Eastlund wrote: > I don't know much about Python. If args = list(a,b,c) and kwargs = > dict(d=1,e=2), then does f(arg1,arg2,*args,**kwargs) mean > f(arg1,arg2,a,b,c,d=1,e=2)? Exactly > If so, then Scheme has about the same > thing as keyword-apply. You can express (f x y a b c #:d 1 #:e 2) as > (keyword-apply f (list '#:d '#:e) (list 1 2) x y (list a b c)). The > use of apply or keyword-apply signals that you're not doing direct > application, whereas in Python you look at *s in front of arguments to > figure it out. Shame to me. Missed keyword-apply when looking in docs. Thx. > Same idea, just slightly different ways of writing it down. Rigth (with some minor differences). > Does that answer your question? Not exactly. The answer is clear for PLT, but why this all is not in r6rs? If this question sounds too OT, please ignore it. -- Bohdan From cce at ccs.neu.edu Sun Oct 5 12:41:42 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:29:46 2009 Subject: [plt-scheme] Re: apply vs dot notation syntax In-Reply-To: References: <4B40FE474ED246859AE98C7007C2114C@uw2b2dff239c4d> <990e0c030810050919r552d4d60m5aeabb82b8734d5e@mail.gmail.com> Message-ID: <990e0c030810050941o729b2461l38634a746df3b196@mail.gmail.com> On Sun, Oct 5, 2008 at 12:33 PM, wrote: > >> Does that answer your question? > > Not exactly. The answer is clear for PLT, but why this all is not in r6rs? > If this question sounds too OT, please ignore it. Well, keyword arguments are very new in PLT Scheme; I don't know if other Schemes have them at all. The R6RS mostly specifies features that were present in many Scheme implementations at the time of its writing. Heck, we haven't even been using keywords in Scheme long enough to be sure we've "got them right", so it's not necessarily time to start nailing them down formally yet. -- Carl Eastlund From plragde at uwaterloo.ca Sun Oct 5 12:59:24 2008 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:29:46 2009 Subject: [plt-scheme] Scheme Programming Question (Making an error message) In-Reply-To: Message-ID: <48E8F26C.8040805@uwaterloo.ca> Shriram wrote: > PS: What I'd really like to know is what crackpot professor put out > a question like this. Any ideas? The basic concept of the question is fine, though it could be phrased much better (clearly the author has not heard of HtDP). But regardless of any infelicities, I'm sure the author would be interested in knowing the ways in which their students are attempting to solve the question... --PR From gregory.woodhouse at gmail.com Sun Oct 5 13:23:04 2008 From: gregory.woodhouse at gmail.com (Woodhouse Gregory) Date: Thu Mar 26 02:29:47 2009 Subject: [plt-scheme] Re: apply vs dot notation syntax In-Reply-To: <990e0c030810050941o729b2461l38634a746df3b196@mail.gmail.com> References: <4B40FE474ED246859AE98C7007C2114C@uw2b2dff239c4d> <990e0c030810050919r552d4d60m5aeabb82b8734d5e@mail.gmail.com> <990e0c030810050941o729b2461l38634a746df3b196@mail.gmail.com> Message-ID: When I first read about keyword arguments, I pretty much expected that I'd have to jump through some hoops to use them (e.g., declaring them in a separate module), but the Guide suggests that you can just use them as in > (define (f #:foo a #:bar b) (- a b)) > (f #:foo 8 #:bar 9) -1 That's a bit unnerving, at least at first blush. I guess I need to do some more reading. I hear and I forget. I see and I remember. I do and I understand. --Attributed to Confucius, 500 BCE http://www.gwoodhouse.com http://GregWoodhouse.ImageKind.com On Oct 5, 2008, at 9:41 AM, Carl Eastlund wrote: > Well, keyword arguments are very new in PLT Scheme; I don't know if > other Schemes have them at all. The R6RS mostly specifies features > that were present in many Scheme implementations at the time of its > writing. Heck, we haven't even been using keywords in Scheme long > enough to be sure we've "got them right", so it's not necessarily time > to start nailing them down formally yet. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081005/57553aec/attachment.htm From gregory.woodhouse at gmail.com Sun Oct 5 13:40:15 2008 From: gregory.woodhouse at gmail.com (Woodhouse Gregory) Date: Thu Mar 26 02:29:47 2009 Subject: [plt-scheme] When does eqv? differ from eq? , from equal? Message-ID: I almost always perform tests with eq? or equal?, seldom (if ever) with eqv? . The Reference is a bit mysterious, saying (in section 3.1) Two values are eqv? if and only if they are eq?, unless otherwise specified for a particular datatype. That doesn't help much. Well, it does help, but only by telling me that they are usually the same. Heuristically, I think of eq? as being similar to comparing pointers in C and equal? as a test that might involve library call that could run in time proportional to the size of the objects (e.g., strcmp). What is the intuition behind eqv? "In the human mind, one-sidedness has always been the rule and many-sidedness the exception. Hence, even in revolutions of thought, one part of the truth usually sets while another rises." --John Stuart Mill http://www.gwoodhouse.com http://GregWoodhouse.ImageKind.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081005/0fc9f504/attachment.html From matthias at ccs.neu.edu Sun Oct 5 14:11:53 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:29:48 2009 Subject: [plt-scheme] Scheme Programming Question (Making an error message) In-Reply-To: <48E8F26C.8040805@uwaterloo.ca> References: <48E8F26C.8040805@uwaterloo.ca> Message-ID: <0C80506F-E2B3-4348-9519-FAD8071C64C9@ccs.neu.edu> Correct: this could be couched in the language of HtDP 7.5(?) on errors: Suppose you want to enforce the contract for reverse. You could proceed as in 7.5: ;; Any -> [Listof Any] ;; reverse the given list ;; effect: signal an error for non-lists (define (checked-reverse l) (cond [(list? l) (reverse-list l)] [else (error 'reverse "proper list expected, given ~e" l)])) This would, however, have the disadvantage that checked-reverse must traverse proper lists _twice_. Is it possible to issue the same error message without traversing the list twice? Put differently, design the function reverse as specified above without using list?. -- Matthias On Oct 5, 2008, at 12:59 PM, Prabhakar Ragde wrote: > Shriram wrote: > >> PS: What I'd really like to know is what crackpot professor put out >> a question like this. Any ideas? > > The basic concept of the question is fine, though it could be > phrased much better (clearly the author has not heard of HtDP). But > regardless of any infelicities, I'm sure the author would be > interested in knowing the ways in which their students are > attempting to solve the question... --PR > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From sk at cs.brown.edu Sun Oct 5 14:51:18 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:29:48 2009 Subject: [plt-scheme] When does eqv? differ from eq? , from equal? In-Reply-To: References: Message-ID: > Heuristically, I think of eq? as being similar to > comparing pointers in C and equal? as a test that might involve library call > that could run in time proportional to the size of the objects (e.g., > strcmp). That's a good way to think about the difference. Or you can think of them as object equality versus structural equality. > What is the intuition behind eqv? Beats me. I've never used EQV? in my life. Shriram From sk at cs.brown.edu Sun Oct 5 14:56:41 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:29:48 2009 Subject: [plt-scheme] Scheme Programming Question (Making an error message) In-Reply-To: <756daca50810050913s3c3a2d1es8fde66cf1e25bd17@mail.gmail.com> References: <756daca50810050913s3c3a2d1es8fde66cf1e25bd17@mail.gmail.com> Message-ID: On Sun, Oct 5, 2008 at 11:13 AM, Grant Rettke wrote: >> http://qaboard.cramster.com/computer-science-topic-5-339232-cpi0.aspx > > I've never heard of cramster (or anything like it). > > Since you knew about it, and found the problem, I take it that sites > like this are something that you teachers must have to deal with? Actually I just found the site through a Google search (I was trying to figure out who the prof of the assignment was). But you don't have to look far to find these sites. If you use Google Mail, you'll periodically see ads for homework services. > Man oh man... Au contraire. I've been quite tempted to, when I'm really bored, hire some of these homework services for the assignments I hand out, and then grade the result. I'd be surprised if any of them even passed. Shriram From samth at ccs.neu.edu Sun Oct 5 14:57:10 2008 From: samth at ccs.neu.edu (Sam TH) Date: Thu Mar 26 02:29:48 2009 Subject: [plt-scheme] When does eqv? differ from eq? , from equal? In-Reply-To: References: Message-ID: <63bb19ae0810051157y443d3a05j6418905e0b36bb8e@mail.gmail.com> On Sun, Oct 5, 2008 at 1:40 PM, Woodhouse Gregory wrote: > > I almost always perform tests with eq? or equal?, seldom (if ever) with eqv? > . The Reference is a bit mysterious, saying (in section 3.1) > > Two values are eqv? if and only if they are eq?, unless otherwise specified > for a particular datatype. > > That doesn't help much. Well, it does help, but only by telling me that they > are usually the same. Heuristically, I think of eq? as being similar to > comparing pointers in C and equal? as a test that might involve library call > that could run in time proportional to the size of the objects (e.g., > strcmp). What is the intuition behind eqv? `eqv?' is intended to mean 'the same thing', without reference to the implementation, whereas `eq?' means 'refers to the same thing in the heap. In particular, two numbers (or strings or characters) may be eqv? without being eq?. -- sam th samth@ccs.neu.edu From spdegabrielle at gmail.com Sun Oct 5 15:04:18 2008 From: spdegabrielle at gmail.com (Stephen De Gabrielle) Date: Thu Mar 26 02:29:48 2009 Subject: [plt-scheme] copy-paste from scribble html docs to drscheme In-Reply-To: <756daca50810050906ib62afaal43179e1b871f37f3@mail.gmail.com> References: <595b9ab20810050107g275568beye66254573fbc3702@mail.gmail.com> <756daca50810050906ib62afaal43179e1b871f37f3@mail.gmail.com> Message-ID: <595b9ab20810051204u33e18006i8789457c903b079c@mail.gmail.com> Thanks for the tip Grant It' irks me, but you are probably right, my css attempt is even more flawed as it puts an asterix before each item, (my flawed attempt is below) Cheers, Stephen ---
  • (new editor-snip% [
    • [editor editor]
    • [with-border? with-border?]
    • [left-margin left-margin]
    • [top-margin top-margin]
    • [right-margin right-margin]
    • [bottom-margin bottom-margin]
    ])
From goetter at mazama.net Sun Oct 5 15:06:01 2008 From: goetter at mazama.net (Ben Goetter) Date: Thu Mar 26 02:29:48 2009 Subject: [plt-scheme] When does eqv? differ from eq? , from equal? In-Reply-To: <63bb19ae0810051157y443d3a05j6418905e0b36bb8e@mail.gmail.com> References: <63bb19ae0810051157y443d3a05j6418905e0b36bb8e@mail.gmail.com> Message-ID: <48E91019.3050706@mazama.net> Sam TH wrote: > In particular, two numbers (or strings or characters) may be > eqv? without being eq?. > Per r5rs, non-empty strings will be eqv? if and only if they are eq?. (for what little it's worth) From workmin at ccs.neu.edu Sun Oct 5 15:07:03 2008 From: workmin at ccs.neu.edu (Jon Rafkind) Date: Thu Mar 26 02:29:48 2009 Subject: [plt-scheme] When does eqv? differ from eq? , from equal? In-Reply-To: References: Message-ID: <48E91057.50502@ccs.neu.edu> Woodhouse Gregory wrote: > > I almost always perform tests with eq? or equal?, seldom (if ever) > with eqv? . The Reference is a bit mysterious, saying (in section 3.1) > > Two values are eqv? > > if and only if they are eq? > , > unless otherwise specified for a particular datatype. > > That doesn't help much. Well, it /does/ help, but only by telling me > that they are usually the same. Heuristically, I think of eq? as being > similar to comparing pointers in C and equal? as a test that might > involve library call that could run in time proportional to the size > of the objects (e.g., strcmp). What is the intuition behind eqv? > I looked at the source for eqv and it seems to only be useful in a very small set of cases, mostly for numbers. I've added some comments below: int scheme_eqv (Scheme_Object *obj1, Scheme_Object *obj2) { Scheme_Type t1, t2; /* test if the objects are eq? */ if (SAME_OBJ(obj1, obj2)) return 1; t1 = SCHEME_TYPE(obj1); t2 = SCHEME_TYPE(obj2); /* if they aren't the same type then #f */ if (NOT_SAME_TYPE(t1, t2)) { #ifdef MZ_USE_SINGLE_FLOATS /* If one is a float and the other is a double, coerce to double */ if ((t1 == scheme_float_type) && (t2 == scheme_double_type)) return double_eqv(SCHEME_FLT_VAL(obj1), SCHEME_DBL_VAL(obj2)); else if ((t2 == scheme_float_type) && (t1 == scheme_double_type)) return double_eqv(SCHEME_DBL_VAL(obj1), SCHEME_FLT_VAL(obj2)); #endif return 0; #ifdef MZ_USE_SINGLE_FLOATS } else if (t1 == scheme_float_type) { return double_eqv(SCHEME_FLT_VAL(obj1), SCHEME_FLT_VAL(obj2)); #endif /* otherwise if the two types are double, complex, rational, or a char then do some equality testing, otherwise #f */ } else if (t1 == scheme_double_type) { return double_eqv(SCHEME_DBL_VAL(obj1), SCHEME_DBL_VAL(obj2)); } else if (t1 == scheme_bignum_type) return scheme_bignum_eq(obj1, obj2); else if (t1 == scheme_rational_type) return scheme_rational_eq(obj1, obj2); else if (t1 == scheme_complex_type) { Scheme_Complex *c1 = (Scheme_Complex *)obj1; Scheme_Complex *c2 = (Scheme_Complex *)obj2; return scheme_eqv(c1->r, c2->r) && scheme_eqv(c1->i, c2->i); } else if (t1 == scheme_char_type) return SCHEME_CHAR_VAL(obj1) == SCHEME_CHAR_VAL(obj2); else return 0; } From neil at neilvandyke.org Sun Oct 5 15:20:22 2008 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:29:49 2009 Subject: [plt-scheme] Scheme Programming Question (Making an error message) In-Reply-To: References: <756daca50810050913s3c3a2d1es8fde66cf1e25bd17@mail.gmail.com> Message-ID: <48E91376.9000909@neilvandyke.org> Shriram Krishnamurthi wrote at 10/05/2008 02:56 PM: > Au contraire. I've been quite tempted to, when I'm really bored, hire > some of these homework services for the assignments I hand out, and > then grade the result. I'd be surprised if any of them even passed. What I'm hearing here is that there's an untapped market for a premium-priced Scheme homework service. From esmith at acanac.net Sun Oct 5 16:03:11 2008 From: esmith at acanac.net (Ernie Smith) Date: Thu Mar 26 02:29:49 2009 Subject: [plt-scheme] tools and practises to derice FFI types from C type declarations? Message-ID: <48E91D7F.2060900@acanac.net> I'm hoping this isn't the wrong place to be asking this kind of question, if so please redirect me to the right place. I'm trying to access the 'lstat' function within libgc In order to perform some straightforward file attribute tests for a script which hinges on the 'fold-files' function from file.ss. In order to do so I must interface to a stat function and a 'stat' structure declared in include files for that function call. . The foreign interface manual explains well enough how to interact with c structures once you know the primitive types they use. However typical library functions, rather than declare structures using primitive types, tend to use intermediate sub-types, and how these sub-types boil down to primitives is partly dependent on compile time switch conditions. So in short, what primitives they boil down to is installation dependent. It's easy enough to trace things these back to primitives on a given system, (the C preprocessor cpp helps a lot), but that only really supplies that information on a given installation. It really should be computed wherever a PLT scheme script is installed. At this stage I'm starting to feel like I'm reinventing the wheel. Again!. And this time only to accomplish a script. Someone else has already had to cope with this issue and written some useful tools for generating compatible scheme code from C structure declarations. If I had been responsible for any part of PLT scheme, I know I would have done something along those lines. Surely someone else has? For perspective, here is the output of the cpp preprocessor's version of the stat structure on my system. struct stat { __dev_t st_dev; unsigned short int __pad1; __ino_t st_ino; __mode_t st_mode; __nlink_t st_nlink; __uid_t st_uid; __gid_t st_gid; __dev_t st_rdev; unsigned short int __pad2; __off_t st_size; __blksize_t st_blksize; __blkcnt_t st_blocks; struct timespec st_atim; struct timespec st_mtim; struct timespec st_ctim; unsigned long int __unused4; unsigned long int __unused5; }; In the interest of brevity, I clipped the upper part of the preprocessor output where for instance these translations can be gleaned: __dev_t to 'unsigned long long int' __ino_t to 'unsigned long int' __mode_t to 'unsigned int' Is there an existing PLT recommended practise for dealing with these sorts of installation issues? Are there existing recommended tools for deriving necessary scheme interface data from stand library include files? If not are there existing workaround tools and practices being used until recommended ones emerge? From eli at barzilay.org Sun Oct 5 16:14:16 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:29:49 2009 Subject: [plt-scheme] PLT Scheme v4.1.1 Message-ID: <200810052014.m95KEFQ0009396@winooski.ccs.neu.edu> PLT Scheme version 4.1.1 is now available from http://plt-scheme.org/ This is mostly a bug-fix release. Notable changes: * web-server: New servlet development tutorial; quick launching of servlets from DrScheme via the `web-server/insta' language; new form abstraction through formlets. * misc: mzc can "decompile" bytecode files; `#lang' lines wired to the top of DrScheme's definition window; improved searching in DrScheme; some foreign interface extensions. [Note that mirror sites can take a while to catch up with the new downloads.] Feedback Welcome, -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From foolsmart2005 at gmail.com Sun Oct 5 10:56:13 2008 From: foolsmart2005 at gmail.com (SamuelXiao) Date: Thu Mar 26 02:29:49 2009 Subject: [plt-scheme] Combining two definition into one only Message-ID: <24e4c951-54c9-4c74-9a84-f4b3ddb8ea5c@v39g2000pro.googlegroups.com> I am a scheme newbie, could anyone tell me how can i combine this following 2 definition into one? ----------------------------------------------------------------------------------------------------------------------------- (define insert-number (lambda (new-element sorted) (cond ((null? sorted) (list new-element)) ((<= new-element (car sorted)) (cons new-element sorted)) (else (cons (car sorted) (insert-number new-element (cdr sorted))))))) (define insertion-sort-numbers (lambda (numbers) (let helper ((unsorted numbers) ; The remaining unsorted values (sorted '())) ; The sorted values (if (null? unsorted) sorted (helper (cdr unsorted) (insert-number (car unsorted) sorted)))))) From workmin at ccs.neu.edu Sun Oct 5 16:50:32 2008 From: workmin at ccs.neu.edu (Jon Rafkind) Date: Thu Mar 26 02:29:49 2009 Subject: [plt-scheme] Combining two definition into one only In-Reply-To: <24e4c951-54c9-4c74-9a84-f4b3ddb8ea5c@v39g2000pro.googlegroups.com> References: <24e4c951-54c9-4c74-9a84-f4b3ddb8ea5c@v39g2000pro.googlegroups.com> Message-ID: <48E92898.2000800@ccs.neu.edu> SamuelXiao wrote: > I am a scheme newbie, could anyone tell me how can i combine this > following 2 definition into one? > ----------------------------------------------------------------------------------------------------------------------------- > (define insertion-sort-numbers (lambda (numbers) (define insert-number (lambda (new-element sorted) (cond ((null? sorted) (list new-element)) ((<= new-element (car sorted)) (cons new-element sorted)) (else (cons (car sorted) (insert-number new-element (cdr sorted))))))) (let helper ((unsorted numbers) ; The remaining unsorted values (sorted '())) ; The sorted values (if (null? unsorted) sorted (helper (cdr unsorted) (insert-number (car unsorted) sorted)))))) From jensaxel at soegaard.net Sun Oct 5 17:40:12 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:29:49 2009 Subject: [plt-scheme] When does eqv? differ from eq? , from equal? In-Reply-To: References: Message-ID: <48E9343C.6040407@soegaard.net> Woodhouse Gregory wrote: > > I almost always perform tests with eq? or equal?, seldom (if ever) > with eqv? . The Reference is a bit mysterious, saying (in section 3.1) > > Two values are eqv? > > if and only if they are eq? > , > unless otherwise specified for a particular datatype. > Which means you ought to use eqv? for characters and numbers. A heuristic: If a members of a datatype have a unique representation on the machine level, then it is safe to use eq?. If two different representations can represent the same (abstract) value, then use eqv?. For floating point numbers +0.0 and -0.0 have different representaions, but both represent zero. The fixnum 0 and the bignum 0 also have different representation, but represent the same number. Conclusion: Always use eqv? instead of eq? when comparing numbers. Exception: If you in an algorithm can prove all numbers are representable as, say, fixnums, then you can use eq? -- but remember that the range of fixnums may be different on other implementations. Characters can also have different representations - at least in some implementations. The subject pops up once in a while in comp.lang.scheme. One example of such a thread is: http://groups.google.com/group/comp.lang.scheme/browse_thread/thread/201fd2d0723731c5/c57f5868525aa811?lnk=gst&q=eq%3F+eqv%3F#c57f5868525aa811 -- Jens Axel S?gaard From mflatt at cs.utah.edu Sun Oct 5 20:19:52 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:29:50 2009 Subject: [plt-scheme] Code for catching exceptions in embedding applications In-Reply-To: <48E78592.1060400@gmail.com> References: <48E78592.1060400@gmail.com> Message-ID: <20081006001954.2D0A965008C@mail-svr1.cs.utah.edu> At Sat, 04 Oct 2008 19:02:42 +0400, Sergey Khorev wrote: > While trying to migrate an application to PLT 4.1, I stuck with > exception handling. > > Code below (basically it has been extracted from PLT documentation) > crashes with > #f::0: compile: bad syntax; function application is not allowed, because > no #%app syntax transformer is bound in: (lambda (thunk) (with-handlers > ((void (lambda(exn) (cons #f exn)))) (cons #t (thunk)))) > > Seg fault (internal error) at 4 > > Do I need to `require' some module for this to work? Yes. The initial namespace is empty; it doesn't even have syntax for `lambda' or for function application. So, you need to require something like `scheme/base'. Matthew From andre.mayers at usherbrooke.ca Sun Oct 5 21:35:06 2008 From: andre.mayers at usherbrooke.ca (Andre Mayers) Date: Thu Mar 26 02:29:50 2009 Subject: [plt-scheme] What is wrong with this program ? References: <1220651136.19066.36.camel@daves-laptop> Message-ID: <000301c92753$c32d8940$49889bc0$@mayers@usherbrooke.ca> #lang scheme (define cont (call/cc (lambda (k) (display 'bonjour) (newline) k))) (cont (lambda (var) (display 'bonsoir) (newline) var)) ==RESULT== Bienvenue dans DrScheme, version 4.1.1 [3m]. Langage: Module personnalis?; memory limit: 256 megabytes. bonjour define-values: cannot re-define a constant: cont > From jadudm at gmail.com Sun Oct 5 22:06:12 2008 From: jadudm at gmail.com (Matt Jadud) Date: Thu Mar 26 02:29:50 2009 Subject: [plt-scheme] Combining two definition into one only In-Reply-To: <24e4c951-54c9-4c74-9a84-f4b3ddb8ea5c@v39g2000pro.googlegroups.com> References: <24e4c951-54c9-4c74-9a84-f4b3ddb8ea5c@v39g2000pro.googlegroups.com> Message-ID: On Sun, Oct 5, 2008 at 10:56 AM, SamuelXiao wrote: > I am a scheme newbie, could anyone tell me how can i combine this > following 2 definition into one? This question[1] looks like it might be related to a set of problems issued at Grinnell in the Spring of 2007[2]. I've CC:'d Samuel Rebelsky at Grinnell, as a lab of his was the only page Google could find with the words "insert-number" and "insertion-sort-numbers" that wasn't the Google Groups version of the original posting. And, if I've completely missed the mark, "oops." Cheers, Matt [1] http://groups.google.com/group/plt-scheme/browse_thread/thread/ff785ce068f5d838?pli=1 [2] http://www.cs.grinnell.edu/~rebelsky/Courses/CS151/2007S/Labs/insertion-sort.html From jos.koot at telefonica.net Mon Oct 6 05:47:57 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:29:50 2009 Subject: [plt-scheme] What is wrong with this program ? References: <1220651136.19066.36.camel@daves-laptop> <000301c92753$c32d8940$49889bc0$@mayers@usherbrooke.ca> Message-ID: <21B83EF825014D26AF03AF2F2365D666@uw2b2dff239c4d> See further below how to avoid the problem. The original value of cont is a continuation that finishes the definition of variable cont. This means that when the continuation is called the definition is finished for a second time, which apparently is detected as a redefinition. At module top level, no variable can be defined more than once. Note that results depend on how promts are handled. When using debug, the results are: Welcome to DrScheme, version 4.1.1 [3m]. Language: Module; memory limit: 800 megabytes. bonjour bonsoir # > In this case (cont (lambda (var) ...)) is evaluated twice. (cont (lambda (var) ...)) is included in the original continuation. The redefinition is not detected and the definition is finished twice. # signifies the value of (lambda (var) ...)). I assume the PLT team is aware of the different behaviour of run and debug for #lang scheme. The debugger necessarily has to use other prompts and cannot optimize as well as run. Nevertheless run and debug should treat refinishing a definition in the same way, I think. When removing the line "#lang scheme" and using language Pretty Big, the results are: Welcome to DrScheme, version 4.1.1 [3m]. Language: Pretty Big; memory limit: 800 megabytes. bonjour > In this case (cont (lambda (var) ...)) is executed once. It is not included in the original continuation. Pretty Big does allow redefinition at top level (not to be confused with module top level) and it does not include subsequent top level forms in its continuations. You can avoid the problem as follows: #lang scheme (define cont #f) (set! cont (call/cc (lambda (k) (display 'bonjour) (newline) k))) (cont (lambda (var) (display 'bonsoir) (newline) var)) Jos ----- Original Message ----- From: "Andre Mayers" To: Sent: Monday, October 06, 2008 3:35 AM Subject: [plt-scheme] What is wrong with this program ? #lang scheme (define cont (call/cc (lambda (k) (display 'bonjour) (newline) k))) (cont (lambda (var) (display 'bonsoir) (newline) var)) ==RESULT== Bienvenue dans DrScheme, version 4.1.1 [3m]. Langage: Module personnalis?; memory limit: 256 megabytes. bonjour define-values: cannot re-define a constant: cont > _________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-scheme From aghuloum at cs.indiana.edu Mon Oct 6 08:05:20 2008 From: aghuloum at cs.indiana.edu (Abdulaziz Ghuloum) Date: Thu Mar 26 02:29:50 2009 Subject: [plt-scheme] Scheme Programming Question (Making an error message) In-Reply-To: References: Message-ID: <35480028-E2AA-42BD-A410-3D170880293F@cs.indiana.edu> On Oct 5, 2008, at 10:26 AM, Shriram Krishnamurthi wrote: > PS: What I'd really like to know is what crackpot professor put out > a question like this. Any ideas? Way to go Shriram! Keep up the superior attitude! Never doubted you for a second and never expected less from you. And yes, your identification is right-on. The person in question might have been a professor since before you were an undergrad. Did you figure it out? Have a good day now. Aziz,,, From matthias at ccs.neu.edu Mon Oct 6 09:14:02 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:29:50 2009 Subject: [plt-scheme] Scheme Programming Question (Making an error message) In-Reply-To: <35480028-E2AA-42BD-A410-3D170880293F@cs.indiana.edu> References: <35480028-E2AA-42BD-A410-3D170880293F@cs.indiana.edu> Message-ID: On Oct 6, 2008, at 8:05 AM, Abdulaziz Ghuloum wrote: > The person in question might have been a professor since before you > were an undergrad. That describes me :-) Aziz, age, in research education as well as majority, does not make things right. The Scheme community spent years destroying its capital when SICP was hot, not realizing that teaching freshmen wasn't about teaching a programming language, and that it never ever could have been about Scheme per se. When we teach freshmen, we must ensure that they (eventually) understand how it applies to other languages. So this particular question, if posed to freshmen, could be reformulated as I demonstrated later on the mailing list. If it wasn't about freshmen, the instructor could have asked about the O(.) performance of one algorithm compared to another, the constant for the n, and then requested that students rewrite it. Indeed, one could have added "is this a Scheme-specific problem" as a final sentence/question. -- Matthias From alan at alan-watson.org Mon Oct 6 09:15:20 2008 From: alan at alan-watson.org (Alan Watson) Date: Thu Mar 26 02:29:50 2009 Subject: [plt-scheme] When does eqv? differ from eq? , from equal? In-Reply-To: References: Message-ID: <22DDDE4E-5201-4CF4-AEB1-6B357323A8C8@alan-watson.org> >> What is the intuition behind eqv? > > Beats me. I've never used EQV? in my life. Really? You're never used the "case" syntax? :-) Think of eqv? as the fundamental identity predicate. If two data structures are eqv?, then the only way you can tell them apart is by using eq?. And using eq? is cheating because in some circumstances it can differ from implementation to implementation. Think of eq? as being a short-cut for eqv? for certain data structures (for example, those that can be side effected) but depending on the implementation for others (for example, characters and numbers). IMHO, if you are using eq? in your programs, you are probably guilty of premature optimization. Regards, Alan P.S. If Scheme is defined as "doing the right thing and damning the torpedoes", I would assert that eq? should not be part of Scheme. -- Alan Watson http://www.alan-watson.org/ From matthias at ccs.neu.edu Mon Oct 6 09:20:35 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:29:51 2009 Subject: [plt-scheme] When does eqv? differ from eq? , from equal? In-Reply-To: <22DDDE4E-5201-4CF4-AEB1-6B357323A8C8@alan-watson.org> References: <22DDDE4E-5201-4CF4-AEB1-6B357323A8C8@alan-watson.org> Message-ID: On Oct 6, 2008, at 9:15 AM, Alan Watson wrote: > If Scheme is defined as "doing the right thing and damning the > torpedoes", I would assert that eq? should not be part of Scheme. But that depends on what the right thing is :-) What is it in your opinion? -- Matthias From big_tidus at msn.com Mon Oct 6 11:32:55 2008 From: big_tidus at msn.com (Gilles PHAN) Date: Thu Mar 26 02:29:51 2009 Subject: [plt-scheme] Need information for create en executable with DrScheme (with windows) Message-ID: Hello. I'm a student using world.ss and want to build an executable for windows. Someone can help me please ? ( I'm beginner ... ) Thank everybody for answer. Phan. _________________________________________________________________ Connect to the next generation of MSN Messenger? http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081006/c5f5bb13/attachment.htm From czhu at cs.utah.edu Mon Oct 6 11:41:08 2008 From: czhu at cs.utah.edu (Chongkai Zhu) Date: Thu Mar 26 02:29:51 2009 Subject: [plt-scheme] Need information for create en executable with DrScheme (with windows) In-Reply-To: References: Message-ID: <48EA3194.1010203@cs.utah.edu> In DrScheme, use "Scheme" menu, "Create Executable ...". Chongkai Gilles PHAN wrote: > Hello. > > I'm a student using world.ss and want to build an executable for > windows. Someone can help me please ? ( I'm beginner ... ) > Thank everybody for answer. > > Phan. > > ------------------------------------------------------------------------ > Connect to the next generation of MSN Messenger Get it now! > > > ------------------------------------------------------------------------ > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From big_tidus at msn.com Mon Oct 6 12:05:57 2008 From: big_tidus at msn.com (Gilles PHAN) Date: Thu Mar 26 02:29:52 2009 Subject: [plt-scheme] Need information for create en executable with DrScheme (with windows) Message-ID: Yes but I have this probleme : http://img517.imageshack.us/img517/2735/screenyv2.jpg I try with a (define (toto x) x), but don't know what i can add for vreate an executable.. >In DrScheme, use "Scheme" menu, "Create Executable ...".>>Chongkai>>Gilles PHAN wrote:>> Hello.>> >> I'm a student using world.ss and want to build an executable for >> windows. Someone can help me please ? ( I'm beginner ... )>> Thank everybody for answer.>> >> Phan.>> _________________________________________________________________ Connect to the next generation of MSN Messenger? http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081006/0632c78b/attachment.html From morazanm at gmail.com Mon Oct 6 12:28:21 2008 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:29:52 2009 Subject: [plt-scheme] When does eqv? differ from eq? , from equal? In-Reply-To: <63bb19ae0810051157y443d3a05j6418905e0b36bb8e@mail.gmail.com> References: <63bb19ae0810051157y443d3a05j6418905e0b36bb8e@mail.gmail.com> Message-ID: <9b1fff280810060928y7591f538nc0283a45d74c98db@mail.gmail.com> On Sun, Oct 5, 2008 at 2:57 PM, Sam TH wrote: > On Sun, Oct 5, 2008 at 1:40 PM, Woodhouse Gregory > wrote: >> >> I almost always perform tests with eq? or equal?, seldom (if ever) with eqv? >> . The Reference is a bit mysterious, saying (in section 3.1) >> >> Two values are eqv? if and only if they are eq?, unless otherwise specified >> for a particular datatype. >> The question now is how does the average programmer determine what the expected behavior is for a particular datatype. Clearly, eqv? and eq? are not the same: > (eq? 10000000000 10000000000) false > (eqv? 10000000000 10000000000) true My real question is why is there a difference for datatypes that are not mutable? AFAIK, for example, I can not dissect a bignum and make assignments to individual bigits. Would it not make more sense for eq? on two numbers to turn into a call to = ? > (= 10000000000 10000000000) true -- Cheers, Marco From czhu at cs.utah.edu Mon Oct 6 12:41:22 2008 From: czhu at cs.utah.edu (Chongkai Zhu) Date: Thu Mar 26 02:29:52 2009 Subject: [plt-scheme] Need information for create en executable with DrScheme (with windows) In-Reply-To: References: Message-ID: <48EA3FB2.8050308@cs.utah.edu> Should be a bug. The same happened on my v4.1.0.4 using teaching language and teachpack. Chongkai Gilles PHAN wrote: > Yes but I have this probleme : > http://img517.imageshack.us/img517/2735/screenyv2.jpg > I try with a (define (toto x) x), but don't know what i can add for > vreate an executable.. > > > >In DrScheme, use "Scheme" menu, "Create Executable ...". > > > >Chongkai > > > >Gilles PHAN wrote: > >>/ Hello. > />>/ > />>/ I'm a student using world.ss and want to build an executable for > />>/ windows. Someone can help me please ? ( I'm beginner ... ) > />>/ Thank everybody for answer. > />>/ > />>/ Phan. > />>/ > / > > ------------------------------------------------------------------------ > Connect to the next generation of MSN Messenger Get it now! > > > ------------------------------------------------------------------------ > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From jensaxel at soegaard.net Mon Oct 6 13:00:24 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:29:52 2009 Subject: [plt-scheme] When does eqv? differ from eq? , from equal? In-Reply-To: <9b1fff280810060928y7591f538nc0283a45d74c98db@mail.gmail.com> References: <63bb19ae0810051157y443d3a05j6418905e0b36bb8e@mail.gmail.com> <9b1fff280810060928y7591f538nc0283a45d74c98db@mail.gmail.com> Message-ID: <48EA4428.9010306@soegaard.net> Marco Morazan wrote: > My real question is why is there a difference for datatypes that are > not mutable? AFAIK, for example, I can not dissect a bignum and make > assignments to individual bigits. Would it not make more sense for eq? > on two numbers to turn into a call to = ? > The comparison operator eq? has a sligthly strange semantics in order to allow implementations to make eq? really, really fast. For immediate datatypes, whose values can be kept in a single machine register, an eq?-comparison can be done by comparing two machine registers. If eq? to behave differently for numbers, then all eq?-comparisons need to make that extra check. Thus eq? is implementable as a simple register/pointer comparison (no matter which kind of values it is given). Due to the odd semantics of eq? the operator eqv? was included. That behaves as you suggest. Btw - this discussion om whether to choose eq? or eqv? to compare numbers, is related to the choice between eq-hashtables and equal-hashtables where numbers are used as keys. If some of the numbers are bignums, then it is important to choose equal-hashtables. -- Jens Axel S?gaard From cce at ccs.neu.edu Mon Oct 6 13:01:02 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:29:53 2009 Subject: [plt-scheme] When does eqv? differ from eq? , from equal? In-Reply-To: <9b1fff280810060928y7591f538nc0283a45d74c98db@mail.gmail.com> References: <63bb19ae0810051157y443d3a05j6418905e0b36bb8e@mail.gmail.com> <9b1fff280810060928y7591f538nc0283a45d74c98db@mail.gmail.com> Message-ID: <990e0c030810061001k29b8b9f7kcde2a4aff57e9aa8@mail.gmail.com> On Mon, Oct 6, 2008 at 12:28 PM, Marco Morazan wrote: > > My real question is why is there a difference for datatypes that are > not mutable? AFAIK, for example, I can not dissect a bignum and make > assignments to individual bigits. Would it not make more sense for eq? > on two numbers to turn into a call to = ? > >> (= 10000000000 10000000000) > true The raison d'etre of eq?, as I understand it, is constant-time operation; eqv? and = do not have this property. Bignums can take arbitrary time to compare. -- Carl Eastlund From clements at brinckerhoff.org Mon Oct 6 13:04:26 2008 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:29:53 2009 Subject: [plt-scheme] When does eqv? differ from eq? , from equal? In-Reply-To: <22DDDE4E-5201-4CF4-AEB1-6B357323A8C8@alan-watson.org> References: <22DDDE4E-5201-4CF4-AEB1-6B357323A8C8@alan-watson.org> Message-ID: On Oct 6, 2008, at 6:15 AM, Alan Watson wrote: > P.S. If Scheme is defined as "doing the right thing and damning the > torpedoes", I would assert that eq? should not be part of Scheme It depends on what torpedoes you're damning. The torpedo of simplicity? The torpedo of slow execution? The torpedo of "real-world" nonconformity? (I damn that last torpedo on a daily basis.) Scheme is hardly the most high-minded language out there: we've got mutation, a dynamic type system, and a useful module system (ooh, ouch, sorry). I also feel the need to note that Farragut isn't actually venerated for uttering "Damn the torpedoes, Do the Right Thing!" :) John Clements -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2484 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081006/62198db1/smime.bin From samdphillips at gmail.com Mon Oct 6 14:32:21 2008 From: samdphillips at gmail.com (Sam Phillips) Date: Thu Mar 26 02:29:53 2009 Subject: [plt-scheme] Objects, classes and match In-Reply-To: <63bb19ae0810030616s40fce259p668a213828a302b6@mail.gmail.com> References: <440EADF2-D391-4868-8A0B-E621E88F02F0@gmail.com> <63bb19ae0810030616s40fce259p668a213828a302b6@mail.gmail.com> Message-ID: <73b251310810061132p6922296bs9fe892103d2f2de5@mail.gmail.com> On Fri, Oct 3, 2008 at 6:16 AM, Sam TH wrote: > On Fri, Oct 3, 2008 at 8:12 AM, Dave Gurnell wrote: >> Hi all, >> >> Is there any way to use match on an object? I can't see anything in the docs >> (although I may be missing something obvious). Something like: >> >> (match (new my-class%) >> [(struct my-class% (a b c)) >> ...]) >> >> I don't mind setting up a custom match-expander. I suppose I could convert >> the object to a vector and match on that. That doesn't seem like a >> particularly efficient solution, though. > > There isn't anything in match at the moment for this. If I was > implementing this, I'd probably want this to do something like: > > (class [a x] [b y] [c z]) => (app (lambda (e) (list (send e a) (send e > b) (send e c))) (list x y z)) > > maybe using `get-field' instead of `send'. > > If you have other ideas for the API, I'm happy to hear them. I > haven't found anything I particularly like, and that's why there's > nothing in `match' at the moment. I wrote an experimental matcher for doing this recently and found that it's nice to match using both get-field and send (because some classes, like point% in scheme/gui iirc) don't work with just get-field. The syntax that I had worked out looked something like: object-pat := (object class-expr [pat] obj-sub-pat ...) obj-sub-pat := (field-id pat) | ((message arg ...) pat) The "danger" of matching on a send though is that the send should probably not mutate the object. Cheers, Sam From deepankar.sharma at gmail.com Mon Oct 6 15:37:45 2008 From: deepankar.sharma at gmail.com (Deep) Date: Thu Mar 26 02:29:54 2009 Subject: [plt-scheme] ARM support Message-ID: <87be3745-bb38-4466-9085-94fe298fd4f2@y29g2000hsf.googlegroups.com> I have been using DrScheme to build some game prototypes. I recently preordered a Pandora game console - http://www.openpandora.org to be able to develop games on it. The openpandora is basically an open console and has an ARM cpu and runs linux. I wanted to know if DrScheme has a maintained arm port ? Also - just as an aside have people tried getting DrScheme (or any other scheme) to work on the iPhone (also an ARM device). From andre.mayers at usherbrooke.ca Mon Oct 6 16:29:13 2008 From: andre.mayers at usherbrooke.ca (Andre Mayers) Date: Thu Mar 26 02:29:54 2009 Subject: [plt-scheme] What is wrong with this program ? In-Reply-To: <21B83EF825014D26AF03AF2F2365D666@uw2b2dff239c4d> References: <1220651136.19066.36.camel@daves-laptop> <000301c92753$c32d8940$49889bc0$@mayers@usherbrooke.ca> <21B83EF825014D26AF03AF2F2365D666@uw2b2dff239c4d> Message-ID: <003c01c927f2$32903410$97b09c30$@mayers@usherbrooke.ca> Good day Jos, Thank you, it is now clear. Andre -----Message d'origine----- De?: Jos Koot [mailto:jos.koot@telefonica.net] Envoy??: October-06-08 5:48 AM ??: andre.mayers@usherbrooke.ca; plt-scheme@list.cs.brown.edu Objet?: Re: [plt-scheme] What is wrong with this program ? See further below how to avoid the problem. The original value of cont is a continuation that finishes the definition of variable cont. This means that when the continuation is called the definition is finished for a second time, which apparently is detected as a redefinition. At module top level, no variable can be defined more than once. Note that results depend on how promts are handled. When using debug, the results are: Welcome to DrScheme, version 4.1.1 [3m]. Language: Module; memory limit: 800 megabytes. bonjour bonsoir # > In this case (cont (lambda (var) ...)) is evaluated twice. (cont (lambda (var) ...)) is included in the original continuation. The redefinition is not detected and the definition is finished twice. # signifies the value of (lambda (var) ...)). I assume the PLT team is aware of the different behaviour of run and debug for #lang scheme. The debugger necessarily has to use other prompts and cannot optimize as well as run. Nevertheless run and debug should treat refinishing a definition in the same way, I think. When removing the line "#lang scheme" and using language Pretty Big, the results are: Welcome to DrScheme, version 4.1.1 [3m]. Language: Pretty Big; memory limit: 800 megabytes. bonjour > In this case (cont (lambda (var) ...)) is executed once. It is not included in the original continuation. Pretty Big does allow redefinition at top level (not to be confused with module top level) and it does not include subsequent top level forms in its continuations. You can avoid the problem as follows: #lang scheme (define cont #f) (set! cont (call/cc (lambda (k) (display 'bonjour) (newline) k))) (cont (lambda (var) (display 'bonsoir) (newline) var)) Jos ----- Original Message ----- From: "Andre Mayers" To: Sent: Monday, October 06, 2008 3:35 AM Subject: [plt-scheme] What is wrong with this program ? #lang scheme (define cont (call/cc (lambda (k) (display 'bonjour) (newline) k))) (cont (lambda (var) (display 'bonsoir) (newline) var)) ==RESULT== Bienvenue dans DrScheme, version 4.1.1 [3m]. Langage: Module personnalis?; memory limit: 256 megabytes. bonjour define-values: cannot re-define a constant: cont > _________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-scheme From alan at alan-watson.org Mon Oct 6 16:38:14 2008 From: alan at alan-watson.org (Alan Watson) Date: Thu Mar 26 02:29:54 2009 Subject: [plt-scheme] When does eqv? differ from eq? , from equal? In-Reply-To: References: <22DDDE4E-5201-4CF4-AEB1-6B357323A8C8@alan-watson.org> Message-ID: > What is it in your opinion? That eq? belongs in Common Lisp but not in Scheme. (I think this is a variant of Godwin's law: all discussions of judgement in Scheme will end up at some point invoking Common Lisp.) Or, being more up to date, that eq? belongs in the R6RS, along with the fixnum and flonum libraries. Does anyone have any (correct and real) code that is too slow with eqv? but fast enough with eq? Regards, Alan -- Alan Watson http://www.alan-watson.org/ From cce at ccs.neu.edu Mon Oct 6 16:53:33 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:29:54 2009 Subject: [plt-scheme] When does eqv? differ from eq? , from equal? In-Reply-To: References: <22DDDE4E-5201-4CF4-AEB1-6B357323A8C8@alan-watson.org> Message-ID: <990e0c030810061353v642d8f25if0228b675ac6dccd@mail.gmail.com> On Mon, Oct 6, 2008 at 4:38 PM, Alan Watson wrote: >> What is it in your opinion? > > That eq? belongs in Common Lisp but not in Scheme. (I think this is a > variant of Godwin's law: all discussions of judgement in Scheme will end up > at some point invoking Common Lisp.) Or, being more up to date, that eq? > belongs in the R6RS, along with the fixnum and flonum libraries. > > Does anyone have any (correct and real) code that is too slow with eqv? but > fast enough with eq? Interesting. I always thought eqv? was the odd man out -- it takes the time to equate 10000000000 with 10000000000, but not (list 1 2 3) with (list 1 2 3). Whereas equal? and eq? seem to be fairly consistent ends of the spectrum: equal? is extensional equality (recursive comparison of values) and eq? is intensional equality (direct comparison of pointers). I see eqv? as an ad hoc "happy medium" between the two, taking the time to perform extensional equality on bignums because it is often useful and rarely too costly, but not anything else for reversed reasons. At first glance, eqv? does seem equivalent to (or "close enough" to) intensional equality on bignums, since we can't observe their components by mutation. However, we can observe the differences in space consumption between a list of bignums that are all eq? (not much space used), versus a list of bignums that are all eqv? but not eq? (potentially lots of space used). Practically, I only use eq? when I really, really mean it; I use = for (exact) numeric comparisons and try not to use equal? except in test suites. -- Carl Eastlund From sk at cs.brown.edu Mon Oct 6 18:17:31 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:29:54 2009 Subject: [plt-scheme] ARM support In-Reply-To: <87be3745-bb38-4466-9085-94fe298fd4f2@y29g2000hsf.googlegroups.com> References: <87be3745-bb38-4466-9085-94fe298fd4f2@y29g2000hsf.googlegroups.com> Message-ID: For simple animations that use the World teachpack, we have a compiler (with support for a good chunk of Scheme primitives) to Java so the programs can be run on cell phones w/ a JVM. Release coming up in the near future. On Mon, Oct 6, 2008 at 2:37 PM, Deep wrote: > I have been using DrScheme to build some game prototypes. I recently > preordered a Pandora game console - http://www.openpandora.org to be > able to develop games on it. The openpandora is basically an open > console and has an ARM cpu and runs linux. I wanted to know if > DrScheme has a maintained arm port ? > > Also - just as an aside have people tried getting DrScheme (or any > other scheme) to work on the iPhone (also an ARM device). > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From jaortega at gmail.com Mon Oct 6 17:10:50 2008 From: jaortega at gmail.com (Jose A. Ortega Ruiz) Date: Thu Mar 26 02:29:55 2009 Subject: [plt-scheme] upgrading installed planet packages Message-ID: <87wsglbfad.fsf@mithrandir.homeunix.net> Hi, I track PLT using svn, re-building it from source every now and then, which is a rather painless procedure. I usually choose the in-place build/install, linking the binaries to somewhere in my PATH. But everytime the version number of PLT changes, all my downloaded planet packages (living in ~/.plt) are forgotten, because they live in version-specific folders. Is there away of automating their re-installation after an upgrade? I've got the feeling that this is a FAQ, in which case i apologise and will be happy with a link to the relevant discussion or document. Thanks a lot! jao From alan at alan-watson.org Mon Oct 6 18:53:34 2008 From: alan at alan-watson.org (Alan Watson) Date: Thu Mar 26 02:29:55 2009 Subject: [plt-scheme] When does eqv? differ from eq? , from equal? In-Reply-To: <990e0c030810061353v642d8f25if0228b675ac6dccd@mail.gmail.com> References: <22DDDE4E-5201-4CF4-AEB1-6B357323A8C8@alan-watson.org> <990e0c030810061353v642d8f25if0228b675ac6dccd@mail.gmail.com> Message-ID: <82A51E21-4574-40C0-BDAA-968429CC777B@alan-watson.org> Assuming that "it takes time" means "is not a pointer comparison", then: > it takes time to equate 10000000000 with 10000000000 Not with 61-bit fixnums. :-) > but not (list 1 2 3) with (list 1 2 3) Not if all exact integers are represented as bignums or otherwise boxed. :-) > However, we can observe the differences in > space consumption between a list of bignums that are all eq? (not much > space used), versus a list of bignums that are all eqv? but not eq? > (potentially lots of space used). Whether two numerical values that are eqv? are also eq? depends on the implementation. If an implementation hashes boxed numerical values, they can easily be eq? even if they are the result of different expressions. And I am not making this up; MACLISP did precisely this. > I only use eq? when I really, really mean it But what do you really, really mean? For any arguments for which eq? gives a reliable result (by which I mean, a result that does not depend on the implementation), eqv? will give you the same result. Regards, Alan -- Alan Watson http://www.alan-watson.org/ From chico.mono at gmail.com Mon Oct 6 20:29:38 2008 From: chico.mono at gmail.com (Eli Nistal) Date: Thu Mar 26 02:29:55 2009 Subject: [plt-scheme] regexp-match a full line Message-ID: <12f46ab20810061729s1e9db1c1r287fb3dfae4d3828@mail.gmail.com> How do I pull an entire line from a file that contains the regular expression I am looking for e.g. like grep? regexp-match* pulls all the instances of a regular expression from an open file. How can I get regexp-match to pull the whole line? Thanks. -- EMN You can meet at his location, but you better come with cash. -- Cake -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081006/81ab1258/attachment.html From deepankar.sharma at gmail.com Mon Oct 6 20:36:20 2008 From: deepankar.sharma at gmail.com (Deep) Date: Thu Mar 26 02:29:56 2009 Subject: [plt-scheme] Re: ARM support In-Reply-To: References: <87be3745-bb38-4466-9085-94fe298fd4f2@y29g2000hsf.googlegroups.com> Message-ID: The Scheme2Java compiler is great news. Having said that - I wanted to return to my original question - is ARM a supported platform for DrScheme ? If not are the changes to port DrScheme to ARM trivial ? I searched the board for ARM but the only posts that come up talk about a broken libffi arm port. On Oct 6, 6:17?pm, "Shriram Krishnamurthi" wrote: > For simple animations that use the World teachpack, we have a compiler > (with support for a good chunk of Scheme primitives) to Java so the > programs can be run on cell phones w/ a JVM. ?Release coming up in the > near future. > > On Mon, Oct 6, 2008 at 2:37 PM, Deep wrote: > > I have been using DrScheme to build some game prototypes. I recently > > preordered a Pandora game console -http://www.openpandora.orgto be > > able to develop games on it. The openpandora is basically an open > > console and has an ARM cpu and runs linux. I wanted to know if > > DrScheme has a maintained arm port ? > > > Also - just as an aside have people tried getting DrScheme (or any > > other scheme) to work on the iPhone (also an ARM device). > > _________________________________________________ > > ?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 cce at ccs.neu.edu Mon Oct 6 20:40:16 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:29:56 2009 Subject: [plt-scheme] When does eqv? differ from eq? , from equal? In-Reply-To: <82A51E21-4574-40C0-BDAA-968429CC777B@alan-watson.org> References: <22DDDE4E-5201-4CF4-AEB1-6B357323A8C8@alan-watson.org> <990e0c030810061353v642d8f25if0228b675ac6dccd@mail.gmail.com> <82A51E21-4574-40C0-BDAA-968429CC777B@alan-watson.org> Message-ID: <990e0c030810061740n33a00052s959a706f1052fd0@mail.gmail.com> On Mon, Oct 6, 2008 at 6:53 PM, Alan Watson wrote: > Assuming that "it takes time" means "is not a pointer comparison", then: > >> it takes time to equate 10000000000 with 10000000000 > > Not with 61-bit fixnums. :-) > >> but not (list 1 2 3) with (list 1 2 3) > > Not if all exact integers are represented as bignums or otherwise boxed. :-) By "it takes time", I meant "eqv? will take more than constant time, if it has to". That is, eqv? will take an arbitrary amount of time to compare big enough bignums, but other structures -- even if immutable -- it will not. >> However, we can observe the differences in >> space consumption between a list of bignums that are all eq? (not much >> space used), versus a list of bignums that are all eqv? but not eq? >> (potentially lots of space used). > > Whether two numerical values that are eqv? are also eq? depends on the > implementation. If an implementation hashes boxed numerical values, they can > easily be eq? even if they are the result of different expressions. And I am > not making this up; MACLISP did precisely this. Hashing breaks down the extensional/intensional distinction. If your implementation hashes its values, a lot of these issues become moot and more cases of eq?, eqv?, and equal? become indistinguishable. >> I only use eq? when I really, really mean it > > But what do you really, really mean? For any arguments for which eq? gives a > reliable result (by which I mean, a result that does not depend on the > implementation), eqv? will give you the same result. What I meant was, I only use eq? when I really mean "pointer equality" -- generally for comparing two mutable structures, though I also use it for symbols. In those cases I don't really care about bignum equality, so eqv? is a non-issue. When I want to compare the contents of values, I use a typed comparison like = or string=? if I can, otherwise I use equal?. -- Carl Eastlund From eli at barzilay.org Mon Oct 6 21:02:10 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:29:56 2009 Subject: [plt-scheme] Re: ARM support In-Reply-To: References: <87be3745-bb38-4466-9085-94fe298fd4f2@y29g2000hsf.googlegroups.com> Message-ID: <18666.46354.169623.133665@arabic.ccs.neu.edu> On Oct 6, Deep wrote: > The Scheme2Java compiler is great news. > Having said that - I wanted to return to my original question - is ARM > a supported platform for DrScheme ? If not are the changes to port > DrScheme to ARM trivial ? I searched the board for ARM but the only > posts that come up talk about a broken libffi arm port. There was one case where we tried a full build on an ARM machine, IIRC, it was one that had an Ubuntu installation. There were no problems with the build and everything went fine (but the full build took a really long time to build -- several hours I think). The only problem in the tests were in passing some particular set of arguments to a foreign function, something that looked like an alignment issue. But the system as a whole should be usable. If anything, you might have problems due to the OS that you're using, unless it is some variant of a known OS. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From eli at barzilay.org Mon Oct 6 21:06:13 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:29:56 2009 Subject: [plt-scheme] regexp-match a full line In-Reply-To: <12f46ab20810061729s1e9db1c1r287fb3dfae4d3828@mail.gmail.com> References: <12f46ab20810061729s1e9db1c1r287fb3dfae4d3828@mail.gmail.com> Message-ID: <18666.46597.695226.931838@arabic.ccs.neu.edu> On Oct 6, Eli Nistal wrote: > How do I pull an entire line from a file that contains the regular > expression I am looking for e.g. like grep? regexp-match* pulls all > the instances of a regular expression from an open file. How can I > get regexp-match to pull the whole line? Sounds like you want use the "multi-mode" regexp. For example: (regexp-match #rx"(?m:.*some pattern.*)" (open-input-file "some-file")) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From noelwelsh at gmail.com Mon Oct 6 21:06:27 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:29:56 2009 Subject: [plt-scheme] regexp-match a full line In-Reply-To: <12f46ab20810061729s1e9db1c1r287fb3dfae4d3828@mail.gmail.com> References: <12f46ab20810061729s1e9db1c1r287fb3dfae4d3828@mail.gmail.com> Message-ID: You could make your regexp match to the end of the line (using the $ symbol IIRC) or you could convert the file to a list of strings and match on those. For the later the port->string-list function in the port.plt package on PLaneT will help. N. On Tue, Oct 7, 2008 at 1:29 AM, Eli Nistal wrote: > How do I pull an entire line from a file that contains the regular > expression I am looking for e.g. like grep? regexp-match* pulls all the > instances of a regular expression from an open file. How can I get > regexp-match to pull the whole line? > > Thanks. > > -- EMN > > You can meet at his location, > but you better come with cash. > -- Cake > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From deepankar.sharma at gmail.com Mon Oct 6 21:11:47 2008 From: deepankar.sharma at gmail.com (Deepankar Sharma) Date: Thu Mar 26 02:29:57 2009 Subject: [plt-scheme] Re: ARM support In-Reply-To: <18666.46354.169623.133665@arabic.ccs.neu.edu> References: <87be3745-bb38-4466-9085-94fe298fd4f2@y29g2000hsf.googlegroups.com> <18666.46354.169623.133665@arabic.ccs.neu.edu> Message-ID: The OS being used on the pandora is Linux. I still dont know what variant it would be though Ubuntu is a possibility. On Mon, Oct 6, 2008 at 9:02 PM, Eli Barzilay wrote: > On Oct 6, Deep wrote: > > The Scheme2Java compiler is great news. > > Having said that - I wanted to return to my original question - is ARM > > a supported platform for DrScheme ? If not are the changes to port > > DrScheme to ARM trivial ? I searched the board for ARM but the only > > posts that come up talk about a broken libffi arm port. > > There was one case where we tried a full build on an ARM machine, > IIRC, it was one that had an Ubuntu installation. There were no > problems with the build and everything went fine (but the full build > took a really long time to build -- several hours I think). The only > problem in the tests were in passing some particular set of arguments > to a foreign function, something that looked like an alignment issue. > But the system as a whole should be usable. > > If anything, you might have problems due to the OS that you're using, > unless it is some variant of a known OS. > > -- > ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: > http://www.barzilay.org/ Maze is Life! > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081006/8270ec57/attachment.htm From eli at barzilay.org Mon Oct 6 21:25:34 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:29:57 2009 Subject: [plt-scheme] regexp-match a full line In-Reply-To: References: <12f46ab20810061729s1e9db1c1r287fb3dfae4d3828@mail.gmail.com> Message-ID: <18666.47758.170087.949526@arabic.ccs.neu.edu> On Oct 7, Noel Welsh wrote: > You could make your regexp match to the end of the line (using the $ > symbol IIRC) or you could convert the file to a list of strings and > match on those. For the later the port->string-list function in the > port.plt package on PLaneT will help. As a side note, that function is easy to define using either `for/list': (define (port->string-list port) (for/list ([l (in-lines port)]) l)) or `regexp-split': (define (port->string-list port) (map bytes->string/utf-8 (regexp-split #rx"\r?\n" port))) And, as long as I'm looking at that file, the quick-n-dirty hack can fail in unexpected ways: > (port->sexp-list (open-input-string "1 2 3) 4")) (1 2 3) > (port->sexp-list (open-input-string "#z 1 2 3")) UNKNOWN::1: read: bad syntax `#z' the location is off-by-1 in that last example. > (port->sexp-list (open-input-string "1 2 3 #")) UNKNOWN::7: read: bad syntax `#)' > (port->sexp-list (open-input-string "1 2 3 [")) UNKNOWN::8: read: unexpected `)' these examples expose the fake parens. And finally, all of these: (port->sexp-list (open-input-string "1 2 3 (")) (port->sexp-list (open-input-string "1 2 3 #\")) (port->sexp-list (open-input-string "1 2 3 \\")) (port->sexp-list (open-input-string "1 2 3 \"")) will just get stuck. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From eli at barzilay.org Mon Oct 6 21:26:53 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:29:58 2009 Subject: [plt-scheme] Re: ARM support In-Reply-To: References: <87be3745-bb38-4466-9085-94fe298fd4f2@y29g2000hsf.googlegroups.com> <18666.46354.169623.133665@arabic.ccs.neu.edu> Message-ID: <18666.47837.753204.562748@arabic.ccs.neu.edu> On Oct 6, Deepankar Sharma wrote: > The OS being used on the pandora is Linux. I still dont know what > variant it would be though Ubuntu is a possibility. You should be fine then. And re the cell phone -- I didn't hear so far about phones that were powerful enough to run PLT... -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From morazanm at gmail.com Mon Oct 6 21:32:41 2008 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:29:58 2009 Subject: [plt-scheme] When does eqv? differ from eq? , from equal? In-Reply-To: <990e0c030810061740n33a00052s959a706f1052fd0@mail.gmail.com> References: <22DDDE4E-5201-4CF4-AEB1-6B357323A8C8@alan-watson.org> <990e0c030810061353v642d8f25if0228b675ac6dccd@mail.gmail.com> <82A51E21-4574-40C0-BDAA-968429CC777B@alan-watson.org> <990e0c030810061740n33a00052s959a706f1052fd0@mail.gmail.com> Message-ID: <9b1fff280810061832l62dab0c0q915003b7bde77b8d@mail.gmail.com> > What I meant was, I only use eq? when I really mean "pointer equality" > -- generally for comparing two mutable structures, though I also use > it for symbols. This is an interesting point. So, does eq? not break the abstraction provided by functional languages? I think we have lost a battle if functional programmers are thinking in terms of pointers! IMHO, this should never be the case. I know, of course, there is always the efficiency argument, but that needs to be supported by strong empirical evidence indicating that it makes a tremendous difference in performance. Anything that forces functional programmers to think about the implementation details is a likely candidate to be left out in the future (one would hope!), no? -- Cheers, Marco From sk at cs.brown.edu Mon Oct 6 21:43:24 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:29:58 2009 Subject: [plt-scheme] When does eqv? differ from eq? , from equal? In-Reply-To: <9b1fff280810061832l62dab0c0q915003b7bde77b8d@mail.gmail.com> References: <22DDDE4E-5201-4CF4-AEB1-6B357323A8C8@alan-watson.org> <990e0c030810061353v642d8f25if0228b675ac6dccd@mail.gmail.com> <82A51E21-4574-40C0-BDAA-968429CC777B@alan-watson.org> <990e0c030810061740n33a00052s959a706f1052fd0@mail.gmail.com> <9b1fff280810061832l62dab0c0q915003b7bde77b8d@mail.gmail.com> Message-ID: Marco, I would say that is a distinction between a purist and a pragmatist view of functional languages (and I'm a pragmatist, though I've been called much worse -- eg, a "worse is better guy" by someone else who was a prof while I was still an undergrad <-;). Actually, that sounds like I'm conceding too much. So let me make a different claim: modern computer science cannot survive without cost models. There are of course layers and layers of cost models -- does what the GC is doing count? does what the compiler is doing count? does whether my constant-time equality predicate been couched up in several layers of contract unwrappers count? -- but ultimately, programmers need to know. (This is being driven home to me all the time as I spent more and more time working with Internet-scale datasets.) That is, in the extensional universe of computer science, performance cannot be treated purely as an intension. [As an orthogonal issue, Matthias has persuasively argued for a long time that state -- which underlies some of this discussion -- is an essential kind of modularity.] Shriram From chico.mono at gmail.com Mon Oct 6 22:12:36 2008 From: chico.mono at gmail.com (Eli Nistal) Date: Thu Mar 26 02:29:59 2009 Subject: [plt-scheme] regexp-match a full line In-Reply-To: <18666.47758.170087.949526@arabic.ccs.neu.edu> References: <12f46ab20810061729s1e9db1c1r287fb3dfae4d3828@mail.gmail.com> <18666.47758.170087.949526@arabic.ccs.neu.edu> Message-ID: <12f46ab20810061912w79389a23lb48da42fcb13c7c5@mail.gmail.com> On Mon, Oct 6, 2008 at 7:25 PM, Eli Barzilay wrote: > On Oct 7, Noel Welsh wrote: > > You could make your regexp match to the end of the line (using the $ > > symbol IIRC) or you could convert the file to a list of strings and > > match on those. For the later the port->string-list function in the > > port.plt package on PLaneT will help. > > As a side note, that function is easy to define using either > `for/list': > > (define (port->string-list port) > (for/list ([l (in-lines port)]) l)) > > or `regexp-split': > > (define (port->string-list port) > (map bytes->string/utf-8 (regexp-split #rx"\r?\n" port))) > > > And, as long as I'm looking at that file, the quick-n-dirty hack can > fail in unexpected ways: > > > (port->sexp-list (open-input-string "1 2 3) 4")) > (1 2 3) > > (port->sexp-list (open-input-string "#z 1 2 3")) > UNKNOWN::1: read: bad syntax `#z' > > the location is off-by-1 in that last example. > > > (port->sexp-list (open-input-string "1 2 3 #")) > UNKNOWN::7: read: bad syntax `#)' > > (port->sexp-list (open-input-string "1 2 3 [")) > UNKNOWN::8: read: unexpected `)' > > these examples expose the fake parens. > > And finally, all of these: > > (port->sexp-list (open-input-string "1 2 3 (")) > (port->sexp-list (open-input-string "1 2 3 #\")) > (port->sexp-list (open-input-string "1 2 3 \\")) > (port->sexp-list (open-input-string "1 2 3 \"")) > > will just get stuck. > > -- > ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: > http://www.barzilay.org/ Maze is Life! > Thanks for the info. I'll go play with this now. -- Eli You can meet at his location, but you better come with cash. -- Cake -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081006/92e0b97c/attachment.html From morazanm at gmail.com Mon Oct 6 22:28:02 2008 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:29:59 2009 Subject: [plt-scheme] When does eqv? differ from eq? , from equal? In-Reply-To: References: <22DDDE4E-5201-4CF4-AEB1-6B357323A8C8@alan-watson.org> <990e0c030810061353v642d8f25if0228b675ac6dccd@mail.gmail.com> <82A51E21-4574-40C0-BDAA-968429CC777B@alan-watson.org> <990e0c030810061740n33a00052s959a706f1052fd0@mail.gmail.com> <9b1fff280810061832l62dab0c0q915003b7bde77b8d@mail.gmail.com> Message-ID: <9b1fff280810061928u6d46b0au5f7787cc29b694a4@mail.gmail.com> Dear Shriram, > I would say that is a distinction between a purist and a pragmatist > view of functional languages (and I'm a pragmatist, though I've been > called much worse -- eg, a "worse is better guy" by someone else who > was a prof while I was still an undergrad <-;). Well, I am not in the business of name calling nor do I wish to be involved in such exchanges. > different claim: modern computer science cannot survive without cost > models. I do believe that the basic thesis you profess is sound. Cost models are essential to our discipline. This, however, does not mean that we must abandon our abstractions every time a small gain can be made. Such a greedy approach, in general, is likely to ignore better solutions that take longer to be developed. So, is thinking in terms of pointer equality really desirable in this case? In a very pragmatic sense, is the difference in performance large enough to justify maintaining a primitive that forces us to think about pointers? If the answer to this is yes, then let's see the numbers....the empirical studies. Point me to them. I am sure I can navigate the issues from there. I am really not trying to be rhetorical or a purists here nor am I attacking a position. I am seeking to understand how strong the evidence is that drives implementors to break the abstraction barrier provided by Scheme. In other words, how do we justify having to think about pointers in this case? Why not just have eqv? and be done with it? What sense does the test below make? > (eq? 10000000000 10000000000) false It only makes sense if we think about pointers and that seems unfortunate, but maybe you can present evidence that makes this a necessary compromise. Does the comparison of two registers in constant time provide us with significantly superior performance over what eqv? must do for typical applications? -- Cheers, Marco From sk at cs.brown.edu Mon Oct 6 22:36:29 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:29:59 2009 Subject: [plt-scheme] When does eqv? differ from eq? , from equal? In-Reply-To: <9b1fff280810061928u6d46b0au5f7787cc29b694a4@mail.gmail.com> References: <22DDDE4E-5201-4CF4-AEB1-6B357323A8C8@alan-watson.org> <990e0c030810061353v642d8f25if0228b675ac6dccd@mail.gmail.com> <82A51E21-4574-40C0-BDAA-968429CC777B@alan-watson.org> <990e0c030810061740n33a00052s959a706f1052fd0@mail.gmail.com> <9b1fff280810061832l62dab0c0q915003b7bde77b8d@mail.gmail.com> <9b1fff280810061928u6d46b0au5f7787cc29b694a4@mail.gmail.com> Message-ID: Using numbers to drive a wedge between EQ? and EQV? doesn't really do much to persuade me. I never use EQ? for numbers, only =. I only use EQ? when comparing structured (and inevitably mutable) objects, for which EQ? is a semantically meaningful operation. Shriram From david.vanderson at gmail.com Mon Oct 6 22:52:41 2008 From: david.vanderson at gmail.com (David Vanderson) Date: Thu Mar 26 02:29:59 2009 Subject: [plt-scheme] When does eqv? differ from eq? , from equal? In-Reply-To: References: Message-ID: <48EACEF9.3070808@gmail.com> Woodhouse Gregory wrote: > > I almost always perform tests with eq? or equal?, seldom (if ever) with > eqv? . The Reference is a bit mysterious, saying (in section 3.1) Can someone enlighten me about make-hash and make-hasheq? It would seem that if eqv? is necessary, then make-hasheqv would also be necessary. Or is it that the number and character distinction between eq? and eqv? is rarely needed in hashes? Or am I missing something obvious? Thanks, Dave From s.degabrielle at cs.ucl.ac.uk Tue Oct 7 01:59:18 2008 From: s.degabrielle at cs.ucl.ac.uk (Stephen De Gabrielle) Date: Thu Mar 26 02:29:59 2009 Subject: [plt-scheme] ARM support In-Reply-To: <18666.47837.753204.562748@arabic.ccs.neu.edu> References: <87be3745-bb38-4466-9085-94fe298fd4f2@y29g2000hsf.googlegroups.com> <18666.46354.169623.133665@arabic.ccs.neu.edu> <18666.47837.753204.562748@arabic.ccs.neu.edu> Message-ID: <595b9ab20810062259m18e311dv24449dc61b314ac0@mail.gmail.com> I built mzscheme for my nokia 770 once(2004), which is roughly as powerfull as a smartphone, with an debian derivative os. I assume the iphone should be at least as powerful. On 10/7/08, Eli Barzilay wrote: > On Oct 6, Deepankar Sharma wrote: >> The OS being used on the pandora is Linux. I still dont know what >> variant it would be though Ubuntu is a possibility. > > You should be fine then. > > And re the cell phone -- I didn't hear so far about phones that were > powerful enough to run PLT... > > -- > ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: > http://www.barzilay.org/ Maze is Life! > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Sent from Google Mail for mobile | mobile.google.com Cheers, Stephen -- Stephen De Gabrielle s.degabrielle@cs.ucl.ac.uk Telephone +44 (0)20 7679 0693 (x30693) Mobile 079 851 890 45 Project: Making Sense of Information (MaSI) Work:http://www.uclic.ucl.ac.uk/annb/MaSI.html Home:http://www.degabrielle.name/stephen UCL Interaction Centre MPEB 8th floor University College London Gower Street London WC1E 6BT From neil at neilvandyke.org Tue Oct 7 02:05:43 2008 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:29:59 2009 Subject: Google Android (Was: [plt-scheme] ARM support) In-Reply-To: <595b9ab20810062259m18e311dv24449dc61b314ac0@mail.gmail.com> References: <87be3745-bb38-4466-9085-94fe298fd4f2@y29g2000hsf.googlegroups.com> <18666.46354.169623.133665@arabic.ccs.neu.edu> <18666.47837.753204.562748@arabic.ccs.neu.edu> <595b9ab20810062259m18e311dv24449dc61b314ac0@mail.gmail.com> Message-ID: <48EAFC37.8040300@neilvandyke.org> I'm hoping clever people will be inspired to put Schemes on the Android platform. It's looking like Android will be very popular, as well as developer-friendly. -- http://www.neilvandyke.org/ From eli at barzilay.org Tue Oct 7 02:21:31 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:30:00 2009 Subject: [plt-scheme] tools and practises to derice FFI types from C type declarations? In-Reply-To: <48E91D7F.2060900@acanac.net> References: <48E91D7F.2060900@acanac.net> Message-ID: <18666.65515.984356.976890@arabic.ccs.neu.edu> On Oct 5, Ernie Smith wrote: > [...] > It really should be computed wherever a PLT scheme script is > installed. At this stage I'm starting to feel like I'm reinventing > the wheel. Again!. And this time only to accomplish a script. There are several possible approaches to solve this problem: 1. Make a C parser than can do the equivalent of `gcc -E' and grab the details from the result. This has been suggested several times but nobody tried to implement it. But given the alternatives below, I doubt that it is a good approach, for example, it depends on having the header files available in the first place. 2. Use SWIG to generate Scheme glue code. AFAIK, the mzscheme backend in SWIG is generating C glue code instead, and it should be near trivial to write a new Scheme-code generation backend. Again, I think that there are better alternatives. 3. Write some C code that generates the information you need. For example, write-compile-and-run a C program that prints just writes the offset and size of a particular field, then use that in Scheme to pull out the value from the struct. You can also do all of that in a macro so there is no run-time penalty; the disadtvantage is that you get platform-dependent byte-code (since the numbers will be written into it), but the advantage is that the zo file can be used in places where no compiler is available. This is how the SGL collection is detecting the different GL data sizes. (And also something the Felix wrote about in the context of Larceny recently: http://www.ccs.neu.edu/home/will/scheme2008/abstract.klock.html) 4. The best solution, IMO, is to write a small C file that does the trivial work, but has a simple foreign-friendly interface. In your case, it will have a function that runs lstat and returns just the result you're interested in. It might seem like a bad idea initially, but it is really as portable as the previous solutions, the only difference is that you need a C compiler -- in #1 you don't need one, but you need the header files. Also, you replace the platform dependent Scheme code of #2 or #3 by platform dependent library, but it's the same kind of dependency. (BTW, I plan to switch the SGL collection to doing something like this, getting rid of the platform dependent .zo file.) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From kbohdan at mail.ru Tue Oct 7 02:20:58 2008 From: kbohdan at mail.ru (kbohdan@mail.ru) Date: Thu Mar 26 02:30:00 2009 Subject: [plt-scheme] Re: When does eqv? differ from eq? , from equal? In-Reply-To: <48EA4428.9010306@soegaard.net> References: <63bb19ae0810051157y443d3a05j6418905e0b36bb8e@mail.gmail.com> <9b1fff280810060928y7591f538nc0283a45d74c98db@mail.gmail.com> <48EA4428.9010306@soegaard.net> Message-ID: Jens Axel Soegaard wrote: > Thus eq? is implementable as a simple register/pointer comparison (no > matter > which kind of values it is given). Does it mean that eq? implementation is platform specific? Looks worse than worse which is better :) -- Bohdan From cce at ccs.neu.edu Tue Oct 7 02:28:59 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:30:00 2009 Subject: [plt-scheme] Re: When does eqv? differ from eq? , from equal? In-Reply-To: References: <63bb19ae0810051157y443d3a05j6418905e0b36bb8e@mail.gmail.com> <9b1fff280810060928y7591f538nc0283a45d74c98db@mail.gmail.com> <48EA4428.9010306@soegaard.net> Message-ID: <990e0c030810062328j5330c217m26d3a9aa70e4e5d3@mail.gmail.com> On Tue, Oct 7, 2008 at 2:20 AM, wrote: > Jens Axel Soegaard wrote: > >> >> Thus eq? is implementable as a simple register/pointer comparison (no >> matter >> which kind of values it is given). > > > > Does it mean that eq? implementation is platform specific? > Looks worse than worse which is better :) Everything's implementation is platform specific... isn't it? I thought that was the whole idea of platforms and implementations. Are you asking something slightly different than that? -- Carl Eastlund From kbohdan at mail.ru Tue Oct 7 02:30:31 2008 From: kbohdan at mail.ru (kbohdan@mail.ru) Date: Thu Mar 26 02:30:00 2009 Subject: [plt-scheme] Re: When does eqv? differ from eq? , from equal? In-Reply-To: <990e0c030810062328j5330c217m26d3a9aa70e4e5d3@mail.gmail.com> References: <63bb19ae0810051157y443d3a05j6418905e0b36bb8e@mail.gmail.com> <9b1fff280810060928y7591f538nc0283a45d74c98db@mail.gmail.com> <48EA4428.9010306@soegaard.net> <990e0c030810062328j5330c217m26d3a9aa70e4e5d3@mail.gmail.com> Message-ID: Carl Eastlund wrote: > On Tue, Oct 7, 2008 at 2:20 AM, wrote: >> Jens Axel Soegaard wrote: >> >>> Thus eq? is implementable as a simple register/pointer comparison (no >>> matter >>> which kind of values it is given). >> >> >> Does it mean that eq? implementation is platform specific? >> Looks worse than worse which is better :) > > Everything's implementation is platform specific... isn't it? I > thought that was the whole idea of platforms and implementations. Are > you asking something slightly different than that? Sure. I mean eq? behavior, not internals. -- Bohdan From eli at barzilay.org Tue Oct 7 02:43:04 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:30:00 2009 Subject: [plt-scheme] Where to find out that library objects like "chmod" are available in the underlying implementation? In-Reply-To: <48E63D75.1080108@acanac.net> References: <48E54087.7020001@acanac.net> <48E63D75.1080108@acanac.net> Message-ID: <18667.1272.298391.546955@arabic.ccs.neu.edu> [Adding a little on top of what Noel said] On Oct 3, Ernie Smith wrote: > Many reasonable inferences can be made, but one would find comfort > in finding an assertion like the above somewhere in the > documentation with or without caveats. The kind of comfort that > permits you to make the bold assumption that this may continue in > later versions. Otherwise the amount of maintenance and > installation baggage that goes with a simple script goes up > dramatically as well as the risks. Relying on something like the standard C library being included is pretty much guaranteed. Dumping it is as practical as it is to reimplement mzscheme on top of a different VM. > (define chmod (get-ffi-obj "chmod" #f (_fun _path _int -> _void))) But for things that you suspect are more Linux/Mac/Windows specific, you can of course just name the dynamic library directly. In the `chmod' case, you'll probably need different code anyway on Windows. Buut don't forget that there is another use for #f as the library -- it's the way to use internal MzScheme functionality (stuff that is described in the inside mzscheme manual) from inside Scheme. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From jacobm at cs.uchicago.edu Tue Oct 7 03:57:46 2008 From: jacobm at cs.uchicago.edu (Jacob Matthews) Date: Thu Mar 26 02:30:00 2009 Subject: [plt-scheme] Re: When does eqv? differ from eq? , from equal? In-Reply-To: References: <63bb19ae0810051157y443d3a05j6418905e0b36bb8e@mail.gmail.com> <9b1fff280810060928y7591f538nc0283a45d74c98db@mail.gmail.com> <48EA4428.9010306@soegaard.net> Message-ID: <46b603df0810070057k2c769321r8a7dcdee4a47173b@mail.gmail.com> On Mon, Oct 6, 2008 at 11:20 PM, wrote: > Does it mean that eq? [behavior] is platform specific? > Looks worse than worse which is better :) Depends on what you mean by eq's behavior -- you have to distinguish between the behavior it's guaranteed to exhibit and behavior it may happen to exhibit. eq? is defined by R6RS to be #t or #f in some cases, and is undefined in many other cases. For instance, (eq? '() '()) is defined to be #t (eq? (list 1) (list 1)) is defined to be #f (let ([x (list 1)]) (eq? x x)) is defined to be #t (eq? (lambda (x) 1) (lambda (x) 2)) is defined to be #f (boolean? (eq? X Y)) is defined to be #t for any values X, Y (eq? (expt 10 100) (expt 10 100)) is undefined (eq? 2 2) is undefined (eq? (lambda (x) x) (lambda (x) x)) is undefined (eq? (lambda (x) x) (lambda (y) y)) is undefined (let ([x (lambda () 1)]) (eq? x x)) is undefined (eq? (lambda (x) 72) (lambda (x) (if (valid-claim? fermats-last-theorem) 72 43))) is undefined (eq? (lambda () #f) (lambda () (valid-claim? p-equals-np))) is conjectured but not proven to be undefined mzscheme (and every other Scheme implementation) returns _something_ for all those undefined cases. But a portable program should never rely on that return value. If you write programs that only use eq? in the cases where it is defined by R6RS (which is probably a good practice, even if you're only intending your program to run in mzscheme), then its behavior is totally implementation-independent. Otherwise you're on your own. -jacob PS I say these things to explain eq?, not defend it. I'm not too happy myself with the fact that equal? means "happens to be the same at this moment" but eq? doesn't really mean "necessarily equal," or much of anything else in particular. And eqv?, the function that started this whole topic, is useless as near as I can tell, since it is defined to be eq? unless you know the values you're comparing are numbers or characters (or a handful of "empty" values) in which case you're better off using a type-specific comparison function. But then again, every programming language I know of has at least a few frustrating dark corners when it comes to equality. It's a much harder problem than it appears. This is especially true in the presence of mutation, where the notions "happens to be the same right now" and "necessarily equal" are very often conflated. But even in totally pure settings, "equality" is overloaded to mean lots of different, similar-but-sometimes-slightly-different things. I was reminded of this most recently when I wrote a bit of graph-traversal code in Haskell, with the data representation something like "data Vertex = V [(Char, Vertex)]", and graph cycles constructed with tricks like "let aStar = Vertex [('a', aStar)] in aStar". This is a perfectly legitimate way to define a graph in Haskell, but how do you tell if you've already traversed a given node? From jos.koot at telefonica.net Tue Oct 7 07:54:41 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:30:01 2009 Subject: [plt-scheme] Re: When does eqv? differ from eq? , from equal? References: <63bb19ae0810051157y443d3a05j6418905e0b36bb8e@mail.gmail.com><9b1fff280810060928y7591f538nc0283a45d74c98db@mail.gmail.com><48EA4428.9010306@soegaard.net> <46b603df0810070057k2c769321r8a7dcdee4a47173b@mail.gmail.com> Message-ID: <5FF8AD313C054C0B815FBCACDCC18947@uw2b2dff239c4d> I am going to split hairs a little bit.Where (eq? X Y) is undefined ('unspecified' in the R6RS document), R6RS yet requires eq? to return either #t or #f. Apparently 'unspecified' can have slighly different meanings at various places in the R6RS document. R5RS requires (let ((x (lambda ( ) '( )))) (eq? x x)) to yield #t, whereas according to R6RS it may return #t or #f (may be even inconsistently). I wonder why R6RS dropped the requirement made in R5RS. Allowing inlining? Boy oh boy, two references to the same variable are no longer required to be *eq?* in all cases, even without side effects lying around. In practice we have: (define-struct x (y)) (define sxa (make-x 1)) (eq? (sxa (begin (set-x-y! sxa 2) sxa))) ; probably --> #t (eq? implemented as pointer comparison) (define sxb (make-x 1)) (equal? (sxb (begin (set-x-y! sxb 2) sxb))) ; probably --> #f (equal? implemented as recursive content comparator) So here we have an example where an implementation may return #t for eq? and yet return #f for equal?. This seems counterintuitive. Also look at "we change, therefore we are the same" in the Seasoned Schemer. I don't know the answers, but a fundamental theoreme of lambda calculus states that there are no complete non trivial predicates. This also negates the existence of complete non trivial equivalence relations. As (eq? var-x var-x) is not even required to return #t, we even loose on reflexivity. So much is clear though: there are several ways to define equaility, but in practice all of them may fail when compared to the abstract mathematical notion of equality (which probably is a cumbersome subject too) In mathematics you may see axioms like x=x, but can we be sure this is true? When we dress x with information on its place in the text (left or right of the equal sign) it can also be argued that x=x cannot be true. Hence much depends on how we interpret variable references or more generally how we deal with symbols (in the mathematical sense, I mean) Jos ----- Original Message ----- From: "Jacob Matthews" To: Cc: Sent: Tuesday, October 07, 2008 9:57 AM Subject: Re: [plt-scheme] Re: When does eqv? differ from eq? , from equal? > On Mon, Oct 6, 2008 at 11:20 PM, wrote: > >> Does it mean that eq? [behavior] is platform specific? >> Looks worse than worse which is better :) > > Depends on what you mean by eq's behavior -- you have to distinguish > between the behavior it's guaranteed to exhibit and behavior it may > happen to exhibit. eq? is defined by R6RS to be #t or #f in some > cases, and is undefined in many other cases. For instance, > > (eq? '() '()) is defined to be #t > (eq? (list 1) (list 1)) is defined to be #f > (let ([x (list 1)]) (eq? x x)) is defined to be #t > (eq? (lambda (x) 1) (lambda (x) 2)) is defined to be #f > (boolean? (eq? X Y)) is defined to be #t for any values X, Y > > (eq? (expt 10 100) (expt 10 100)) is undefined > (eq? 2 2) is undefined > (eq? (lambda (x) x) (lambda (x) x)) is undefined > (eq? (lambda (x) x) (lambda (y) y)) is undefined > (let ([x (lambda () 1)]) (eq? x x)) is undefined > (eq? (lambda (x) 72) (lambda (x) (if (valid-claim? > fermats-last-theorem) 72 43))) is undefined > (eq? (lambda () #f) (lambda () (valid-claim? p-equals-np))) is > conjectured but not proven to be undefined > > mzscheme (and every other Scheme implementation) returns _something_ > for all those undefined cases. But a portable program should never > rely on that return value. If you write programs that only use eq? in > the cases where it is defined by R6RS (which is probably a good > practice, even if you're only intending your program to run in > mzscheme), then its behavior is totally implementation-independent. > Otherwise you're on your own. > > -jacob > > PS I say these things to explain eq?, not defend it. I'm not too happy > myself with the fact that equal? means "happens to be the same at this > moment" but eq? doesn't really mean "necessarily equal," or much of > anything else in particular. And eqv?, the function that started this > whole topic, is useless as near as I can tell, since it is defined to > be eq? unless you know the values you're comparing are numbers or > characters (or a handful of "empty" values) in which case you're > better off using a type-specific comparison function. > > But then again, every programming language I know of has at least a > few frustrating dark corners when it comes to equality. It's a much > harder problem than it appears. This is especially true in the > presence of mutation, where the notions "happens to be the same right > now" and "necessarily equal" are very often conflated. But even in > totally pure settings, "equality" is overloaded to mean lots of > different, similar-but-sometimes-slightly-different things. I was > reminded of this most recently when I wrote a bit of graph-traversal > code in Haskell, with the data representation something like "data > Vertex = V [(Char, Vertex)]", and graph cycles constructed with tricks > like "let aStar = Vertex [('a', aStar)] in aStar". This is a perfectly > legitimate way to define a graph in Haskell, but how do you tell if > you've already traversed a given node? > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From alan at alan-watson.org Tue Oct 7 08:29:00 2008 From: alan at alan-watson.org (Alan Watson) Date: Thu Mar 26 02:30:01 2009 Subject: [plt-scheme] Re: When does eqv? differ from eq? , from equal? In-Reply-To: <46b603df0810070057k2c769321r8a7dcdee4a47173b@mail.gmail.com> References: <63bb19ae0810051157y443d3a05j6418905e0b36bb8e@mail.gmail.com> <9b1fff280810060928y7591f538nc0283a45d74c98db@mail.gmail.com> <48EA4428.9010306@soegaard.net> <46b603df0810070057k2c769321r8a7dcdee4a47173b@mail.gmail.com> Message-ID: <98C49B0D-9D0C-4F9E-9355-C6BC06FCC13F@alan-watson.org> > And eqv?, the function that started this > whole topic, is useless as near as I can tell, since it is defined to > be eq? unless you know the values you're comparing are numbers or > characters (or a handful of "empty" values) in which case you're > better off using a type-specific comparison function. Um, eqv? is the fundamental identity predicate for data structures in Scheme. That is, if two data structures are eqv?, they cannot be distinguished by any finite composition of standard Scheme procedures except eq?, which, as I have said, is cheating. So, eqv? seems pretty useful to me. Or, like Shriram, do you also never use case? :-) Regards, Alan -- Alan Watson http://www.alan-watson.org/ From foolsmart2005 at gmail.com Mon Oct 6 12:53:49 2008 From: foolsmart2005 at gmail.com (SamuelXiao) Date: Thu Mar 26 02:30:01 2009 Subject: [plt-scheme] Re: Combining two definition into one only In-Reply-To: References: <24e4c951-54c9-4c74-9a84-f4b3ddb8ea5c@v39g2000pro.googlegroups.com> Message-ID: <94d8b005-46af-4137-ab50-3dde4df57dd2@c22g2000prc.googlegroups.com> Yes, you are right, actually, i am studying the scheme by taking his notes because in my school, the teacher's example is a bit simple. On Oct 6, 10:06?am, "Matt Jadud" wrote: > On Sun, Oct 5, 2008 at 10:56 AM, SamuelXiao wrote: > > I am a scheme newbie, could anyone tell me how can i combine this > > following 2 definition into one? > > This question[1] looks like it might be related to a set of problems > issued at Grinnell in the Spring of 2007[2]. > > I've CC:'d Samuel Rebelsky at Grinnell, as a lab of his was the only > page Google could find with the words "insert-number" and > "insertion-sort-numbers" that wasn't the Google Groups version of the > original posting. > > And, if I've completely missed the mark, "oops." > > Cheers, > Matt > > [1]http://groups.google.com/group/plt-scheme/browse_thread/thread/ff785c... > [2]http://www.cs.grinnell.edu/~rebelsky/Courses/CS151/2007S/Labs/inserti... > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme From cce at ccs.neu.edu Tue Oct 7 09:01:49 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:30:01 2009 Subject: [plt-scheme] Re: When does eqv? differ from eq? , from equal? In-Reply-To: <98C49B0D-9D0C-4F9E-9355-C6BC06FCC13F@alan-watson.org> References: <63bb19ae0810051157y443d3a05j6418905e0b36bb8e@mail.gmail.com> <9b1fff280810060928y7591f538nc0283a45d74c98db@mail.gmail.com> <48EA4428.9010306@soegaard.net> <46b603df0810070057k2c769321r8a7dcdee4a47173b@mail.gmail.com> <98C49B0D-9D0C-4F9E-9355-C6BC06FCC13F@alan-watson.org> Message-ID: <990e0c030810070601q6d59ec27pb1e5ada6a47ff1d9@mail.gmail.com> On Tue, Oct 7, 2008 at 8:29 AM, Alan Watson wrote: >> And eqv?, the function that started this >> whole topic, is useless as near as I can tell, since it is defined to >> be eq? unless you know the values you're comparing are numbers or >> characters (or a handful of "empty" values) in which case you're >> better off using a type-specific comparison function. > > Um, eqv? is the fundamental identity predicate for data structures in > Scheme. That is, if two data structures are eqv?, they cannot be > distinguished by any finite composition of standard Scheme procedures except > eq?, which, as I have said, is cheating. > > So, eqv? seems pretty useful to me. Or, like Shriram, do you also never use > case? :-) Fundamental? No, eqv? is basically eq? with a tweak for numbers. It does not perform extensional comparisons on any other immutable data structures such as immutable lists, immutable strings, uninterned symbols, or all kinds of other things that can only be distinguished by eq? or eqv?. If you want something truly fundamental, you have to go farther than eqv?. There's a broad spectrum between eq? and a "fundamental" comparison that equates anything that cannot be distinguished by other means, and eqv? is only one tiny step away from eq? toward the other end. As for case, I rarely use it; when I do, I'd be happy to have it use equal?. -- Carl Eastlund From jos.koot at telefonica.net Tue Oct 7 09:33:34 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:30:01 2009 Subject: [plt-scheme] Re: When does eqv? differ from eq? , from equal? References: <63bb19ae0810051157y443d3a05j6418905e0b36bb8e@mail.gmail.com><9b1fff280810060928y7591f538nc0283a45d74c98db@mail.gmail.com><48EA4428.9010306@soegaard.net> <46b603df0810070057k2c769321r8a7dcdee4a47173b@mail.gmail.com> <5FF8AD313C054C0B815FBCACDCC18947@uw2b2dff239c4d> <0E399D8C-A0D8-473E-8696-4AD39E914763@ccs.neu.edu> <49F3A6007716493DAAA815F70623AC74@uw2b2dff239c4d> <34A34D44-F771-4624-B6F4-43FD5D702A77@ccs.neu.edu> Message-ID: ----- Original Message ----- From: "Felix S Klock II" To: "Jos Koot" Sent: Tuesday, October 07, 2008 3:17 PM Subject: Re: [plt-scheme] Re: When does eqv? differ from eq? , from equal? > Jos- > > On Oct 7, 2008, at 8:44 AM, Jos Koot wrote: > >> You're right: >> 1: I did not check the syntax. (I have now) >> 2: After correction of the syntax I find #t for both eq? and equal? >> (#lang scheme of PLT) >> Thanks. > > >> Yet a content oriented implementation of equal? could produce #f, or is >> it prohibited to produce #f when eq? returns #t? To me this is not >> immediately clear when looking into R6RS. But then, R6RS does say >> nothing about equality of structures (or records, or does it?) > Felix: > No, equal? can not produce #f for your second example. > > ---- > > I think you are misunderstanding either the evaluation model or the > value/object model of Scheme, or both. I cannot tell which is the case, > so I will summarize answers for each potential misunderstanding below. > > 1.) Scheme's evaluation model for invocations is Call-By-Value (CBV), as > opposed to Call-By-Name or Lazy. Therefore all of the expressions given > as operands to an invocation of the equal? procedure must be evaluated > down to values before equal? is itself invoked. Therefore the invocation > of set-x-y! is going to take place before equal? is invoked. Me: Correct. I mean, I was mistaken in this respect. After both actual arguments have been evaluated, they have the same content. I feel silly :(. Thanks again :) Felix: > > 2.) Scheme's value/object model says identifiers denote locations on the > heap. Thus when you evaluate the identifier sxa or sxb, it evaluates to > a reference to a heap-allocated structure; it does *not* make a new copy > of the structure. > > Therefore the expressions <> and <<(begin (set-x-y! sxb 2) sxb)>> > both actually evaluate to the *same* value: the location on the heap > denoted by the identifier sxb. > > ---- > > If Scheme's evaluation model were Call-By-Name, then the internal > operation of equal? might inspect the structure of sxb both before and > after it is mutated, and thus observe a difference in the internal > structure. (Though the implementations of equal? that are most obvious > to me would traverse the structure of the first and second operands in > parallel, and thus even in a Call-By-Name variant of Scheme, equal? could > still return #t; but the point is that it might not.) > > If Scheme's value/object model were such that identifiers denoted complex > structures directly, rather than locations on the heap, then the > evaluation of sxb could very well create a copy of the structure that was > distinct from the one yielded by the expression > (begin (set-x-y! sxb 2) sxb) > In this case, the left and right actual arguments in the invocation of > equal? might be distinct structures. Or they might be the same, > depending on what order the two expressions were evaluated in. (For > example, if the operand expressions were evaluated right-to-left, then > equal? would still return #t for this particular example.) > Me: >> PS, You are free to expose my mistakes/errors to the PLT list :) > Felix: > I wanted to give you the opportunity to correct the error on your own. Me: Hence now I do expose myself to the list by cc-ing this message, your exposure of my mistake included. Thanks for your kind gesture in your previous mail and the hint in the latest one Jos > > -Felix > > > From jos.koot at telefonica.net Tue Oct 7 09:54:47 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:30:01 2009 Subject: [plt-scheme] Re: When does eqv? differ from eq? , from equal? References: <63bb19ae0810051157y443d3a05j6418905e0b36bb8e@mail.gmail.com><9b1fff280810060928y7591f538nc0283a45d74c98db@mail.gmail.com><48EA4428.9010306@soegaard.net><46b603df0810070057k2c769321r8a7dcdee4a47173b@mail.gmail.com><5FF8AD313C054C0B815FBCACDCC18947@uw2b2dff239c4d><0E399D8C-A0D8-473E-8696-4AD39E914763@ccs.neu.edu><49F3A6007716493DAAA815F70623AC74@uw2b2dff239c4d><34A34D44-F771-4624-B6F4-43FD5D702A77@ccs.neu.edu> Message-ID: This reminds me of the question: "is a person the same one some time later?" His/her state almost certainly has changed. Hence in some respects the two are not the same. Nevertheless I am inclined to attribute a common feature to both the former and the later. I have had trouble with this questuion before. See the thread "peasant revolt against Scheme: in the archives of the PLT scheme discussion list) Jos From sbloch at adelphi.edu Tue Oct 7 09:04:38 2008 From: sbloch at adelphi.edu (Stephen Bloch) Date: Thu Mar 26 02:30:02 2009 Subject: [plt-scheme] world.ss in 4.1.1 Message-ID: <896FA4E0-C8EE-46C4-AA92-07277BDB1ACF@adelphi.edu> Is there a reason the default stop-when callback changed from (lambda (w) #f) to (lambda () #f) ? And is any serious consideration being given to switching the world API to something more functional and less stateful, like sb-world? Stephen Bloch sbloch@adelphi.edu From morazanm at gmail.com Tue Oct 7 10:16:47 2008 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:30:02 2009 Subject: [plt-scheme] Re: When does eqv? differ from eq? , from equal? In-Reply-To: References: <48EA4428.9010306@soegaard.net> <46b603df0810070057k2c769321r8a7dcdee4a47173b@mail.gmail.com> <5FF8AD313C054C0B815FBCACDCC18947@uw2b2dff239c4d> <0E399D8C-A0D8-473E-8696-4AD39E914763@ccs.neu.edu> <49F3A6007716493DAAA815F70623AC74@uw2b2dff239c4d> <34A34D44-F771-4624-B6F4-43FD5D702A77@ccs.neu.edu> Message-ID: <9b1fff280810070716j3a1ed9cei46f57b0e50932a3a@mail.gmail.com> On Tue, Oct 7, 2008 at 9:54 AM, Jos Koot wrote: > This reminds me of the question: "is a person the same one some time later?" > His/her state almost certainly has changed. Hence in some respects the two > are not the same. Nevertheless I am inclined to attribute a common feature > to both the former and the later. I have had trouble with this questuion > before. See the thread "peasant revolt against Scheme: in the archives of > the PLT scheme discussion list) Well, if we define a person as a stream then yes s/he is the same person and no need for state. :-) -- Cheers, Marco From jos.koot at telefonica.net Tue Oct 7 10:34:49 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:30:02 2009 Subject: [plt-scheme] Re: When does eqv? differ from eq? , from equal? References: <48EA4428.9010306@soegaard.net> <46b603df0810070057k2c769321r8a7dcdee4a47173b@mail.gmail.com> <5FF8AD313C054C0B815FBCACDCC18947@uw2b2dff239c4d> <0E399D8C-A0D8-473E-8696-4AD39E914763@ccs.neu.edu> <49F3A6007716493DAAA815F70623AC74@uw2b2dff239c4d> <34A34D44-F771-4624-B6F4-43FD5D702A77@ccs.neu.edu> <9b1fff280810070716j3a1ed9cei46f57b0e50932a3a@mail.gmail.com> Message-ID: <894C0AF3FE104532B0C65463A0E48634@uw2b2dff239c4d> If the stream strm does not have state, then (read strm) should always return the same result, but frequently it does not. Jos ----- Original Message ----- From: "Marco Morazan" To: "Jos Koot" Cc: Sent: Tuesday, October 07, 2008 4:16 PM Subject: Re: [plt-scheme] Re: When does eqv? differ from eq? , from equal? > On Tue, Oct 7, 2008 at 9:54 AM, Jos Koot wrote: >> This reminds me of the question: "is a person the same one some time >> later?" >> His/her state almost certainly has changed. Hence in some respects the >> two >> are not the same. Nevertheless I am inclined to attribute a common >> feature >> to both the former and the later. I have had trouble with this questuion >> before. See the thread "peasant revolt against Scheme: in the archives of >> the PLT scheme discussion list) > > Well, if we define a person as a stream then yes s/he is the same > person and no need for state. :-) > > -- > > Cheers, > > Marco > From mflatt at cs.utah.edu Tue Oct 7 11:21:21 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:30:02 2009 Subject: [plt-scheme] When does eqv? differ from eq? , from equal? In-Reply-To: <48EACEF9.3070808@gmail.com> References: <48EACEF9.3070808@gmail.com> Message-ID: <20081007152121.AAF3F6500B1@mail-svr1.cs.utah.edu> At Mon, 06 Oct 2008 19:52:41 -0700, David Vanderson wrote: > > Can someone enlighten me about make-hash and make-hasheq? It would seem > that if eqv? is necessary, then make-hasheqv would also be necessary. > > Or is it that the number and character distinction between eq? and eqv? > is rarely needed in hashes? Or am I missing something obvious? You're right --- we really should add `eqv?'-based hash tables. Matthew From grettke at acm.org Tue Oct 7 11:28:39 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:30:02 2009 Subject: [plt-scheme] Re: When does eqv? differ from eq? , from equal? In-Reply-To: References: <48EA4428.9010306@soegaard.net> <46b603df0810070057k2c769321r8a7dcdee4a47173b@mail.gmail.com> <5FF8AD313C054C0B815FBCACDCC18947@uw2b2dff239c4d> <0E399D8C-A0D8-473E-8696-4AD39E914763@ccs.neu.edu> <49F3A6007716493DAAA815F70623AC74@uw2b2dff239c4d> <34A34D44-F771-4624-B6F4-43FD5D702A77@ccs.neu.edu> Message-ID: <756daca50810070828j24f5ef58x14eb95006d1a71de@mail.gmail.com> > See the thread "peasant revolt against Scheme: in the archives of the PLT scheme discussion list) http://www.cs.utah.edu/plt/mailarch/plt-scheme-2001/msg00066.html From mflatt at cs.utah.edu Tue Oct 7 12:04:35 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:30:02 2009 Subject: [plt-scheme] Need information for create en executable with DrScheme (with windows) In-Reply-To: <48EA3FB2.8050308@cs.utah.edu> References: <48EA3FB2.8050308@cs.utah.edu> Message-ID: <20081007160436.799FA6500AC@mail-svr1.cs.utah.edu> This is fixed in SVN for the next version. Thanks for the report! Matthew At Mon, 06 Oct 2008 10:41:22 -0600, Chongkai Zhu wrote: > Should be a bug. The same happened on my v4.1.0.4 using teaching > language and teachpack. > > Chongkai > > Gilles PHAN wrote: > > Yes but I have this probleme : > > http://img517.imageshack.us/img517/2735/screenyv2.jpg > > I try with a (define (toto x) x), but don't know what i can add for > > vreate an executable.. > > > > > > >In DrScheme, use "Scheme" menu, "Create Executable ...". > > > > > >Chongkai > > > > > >Gilles PHAN wrote: > > >>/ Hello. > > />>/ > > />>/ I'm a student using world.ss and want to build an executable for > > />>/ windows. Someone can help me please ? ( I'm beginner ... ) > > />>/ Thank everybody for answer. > > />>/ > > />>/ Phan. > > />>/ > > / From gregory.woodhouse at gmail.com Tue Oct 7 12:33:28 2008 From: gregory.woodhouse at gmail.com (Greg Woodhouse) Date: Thu Mar 26 02:30:03 2009 Subject: [plt-scheme] Re: When does eqv? differ from eq? , from equal? In-Reply-To: <756daca50810070828j24f5ef58x14eb95006d1a71de@mail.gmail.com> References: <46b603df0810070057k2c769321r8a7dcdee4a47173b@mail.gmail.com> <5FF8AD313C054C0B815FBCACDCC18947@uw2b2dff239c4d> <0E399D8C-A0D8-473E-8696-4AD39E914763@ccs.neu.edu> <49F3A6007716493DAAA815F70623AC74@uw2b2dff239c4d> <34A34D44-F771-4624-B6F4-43FD5D702A77@ccs.neu.edu> <756daca50810070828j24f5ef58x14eb95006d1a71de@mail.gmail.com> Message-ID: <5f07325f0810070933h4c35bc86u556281d271b10047@mail.gmail.com> I'm sure that all has to do with the perception (perhaps valid) that knowing C is an essential job skill. But remember that these are first year students: I wouldn't have expected them to have developed a sense that learning a language like Scheme can be valuable for its own sake. Well, that's not quite true: it is disappointing that at the end of the course they are still focused what they can put on their resumes. What bothers me is that professional developers focus so much on tools and languages without really thinking critically about the problems they are trying to solve. I work on message based interfaces between healthcare applications (mostly on the Java side), and it's awfully difficult to get people to think in terms of, say, the contract a service provider needs to support. On Tue, Oct 7, 2008 at 8:28 AM, Grant Rettke wrote: > > See the thread "peasant revolt against Scheme: in the archives of the PLT > scheme discussion list) > > http://www.cs.utah.edu/plt/mailarch/plt-scheme-2001/msg00066.html > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081007/0fe5257c/attachment.htm From grettke at acm.org Tue Oct 7 12:42:13 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:30:03 2009 Subject: [plt-scheme] Need information for create en executable with DrScheme (with windows) In-Reply-To: <20081007160436.799FA6500AC@mail-svr1.cs.utah.edu> References: <48EA3FB2.8050308@cs.utah.edu> <20081007160436.799FA6500AC@mail-svr1.cs.utah.edu> Message-ID: <756daca50810070942i67884431j7f20733d943d2cab@mail.gmail.com> On Tue, Oct 7, 2008 at 11:04 AM, Matthew Flatt wrote: > This is fixed in SVN for the next version. Giles if you would like to run DrScheme with this fix before the next version release, nightly builds are available here: http://pre.plt-scheme.org/installers/ From alan at alan-watson.org Tue Oct 7 14:13:24 2008 From: alan at alan-watson.org (Alan Watson) Date: Thu Mar 26 02:30:03 2009 Subject: [plt-scheme] Re: When does eqv? differ from eq? , from equal? In-Reply-To: <990e0c030810070601q6d59ec27pb1e5ada6a47ff1d9@mail.gmail.com> References: <63bb19ae0810051157y443d3a05j6418905e0b36bb8e@mail.gmail.com> <9b1fff280810060928y7591f538nc0283a45d74c98db@mail.gmail.com> <48EA4428.9010306@soegaard.net> <46b603df0810070057k2c769321r8a7dcdee4a47173b@mail.gmail.com> <98C49B0D-9D0C-4F9E-9355-C6BC06FCC13F@alan-watson.org> <990e0c030810070601q6d59ec27pb1e5ada6a47ff1d9@mail.gmail.com> Message-ID: <612D539B-FE97-4979-A498-612B4B34A65C@alan-watson.org> > Fundamental? No, eqv? is basically eq? with a tweak for numbers. It > does not perform extensional comparisons on any other immutable data > structures such as immutable lists, immutable strings, uninterned > symbols, or all kinds of other things that can only be distinguished > by eq? or eqv?. Standard Scheme does not have real immutable lists, real immutable strings, or uninterned symbols. (If it did, I would agree that eqv? should compare them extensionally.) When I say that eq? is not the fundamental identity predicate, I do not mean to say that you cannot write eqv? in terms of eq? and the rest of Scheme. I mean to say that if you want a predicate that tells you if two data structures are "fundamentally identical", you should use eqv? not eq?. By "fundamentally identical", I mean "indistinguishable except possibly by using eq? because the only differences detected by eq? but not eqv? are accidents of the implementation". Let's imagine we have two identity predicates on numbers. One is the standard "=" and the other is "maybe-=", which returns the same as "=" except when one or both of the arguments is zero, in which case it can return either #t or #f. Which would you throw out of the language? Regards, Alan P.S. My "maybe-=" procedure is not completely contrived; think of IEEE floating-point formats and comparing either the bits or the values according to the IEEE equality predicate. -- Alan Watson http://www.alan-watson.org/ From esmith at acanac.net Tue Oct 7 14:29:32 2008 From: esmith at acanac.net (Ernie Smith) Date: Thu Mar 26 02:30:04 2009 Subject: [plt-scheme] When does eqv? differ from eq? , from equal? In-Reply-To: <9b1fff280810061928u6d46b0au5f7787cc29b694a4@mail.gmail.com> References: <22DDDE4E-5201-4CF4-AEB1-6B357323A8C8@alan-watson.org> <990e0c030810061353v642d8f25if0228b675ac6dccd@mail.gmail.com> <82A51E21-4574-40C0-BDAA-968429CC777B@alan-watson.org> <990e0c030810061740n33a00052s959a706f1052fd0@mail.gmail.com> <9b1fff280810061832l62dab0c0q915003b7bde77b8d@mail.gmail.com> <9b1fff280810061928u6d46b0au5f7787cc29b694a4@mail.gmail.com> Message-ID: <48EBAA8C.5090705@acanac.net> Marco Morazan wrote: > >> (eq? 10000000000 10000000000) >> > false > > It only makes sense if we think about pointers and that seems > unfortunate, but maybe you can present evidence that makes this a > necessary compromise. Does the comparison of two registers in constant > time provide us with significantly superior performance over what eqv? > must do for typical applications? > > Your point is a good argument against the choice of names for eq? . eq? is indeed an unfortunate choice of names. But if we can tolerate car and cdr, we can probably tolerate eq? I do disagree with the rest of your assertion. eq? certainly does not evoke thoughts of pointers, not at all, not even in me, a refugee C programmer to whom the term 'pointer' evokes precise meaning. I think you'd be a little harder pressed to argue in favor of outlawing an identity function? Without one, before long, we'd all be shooting ourselves in the foot. That is the notion of sameness that eq? evokes in me. I'd be sorry to see it go. Not of the same value, not of equivalent value, but are they the same one? No pointers involved. Achieve it by assigning a unique signature to each object and testing those signatures for value equivalence if you like. Only then is the notion of pointer evoked in me, as I think to myself, that's probably sub-optimal implementation since he likely already has a value with the necessary properties, the item's location. And because I'm an old C programmer, the location concept evokes pointer. regards From zeppieri at gmail.com Tue Oct 7 14:29:27 2008 From: zeppieri at gmail.com (Jon Zeppieri) Date: Thu Mar 26 02:30:04 2009 Subject: [plt-scheme] Re: When does eqv? differ from eq? , from equal? In-Reply-To: <612D539B-FE97-4979-A498-612B4B34A65C@alan-watson.org> References: <63bb19ae0810051157y443d3a05j6418905e0b36bb8e@mail.gmail.com> <9b1fff280810060928y7591f538nc0283a45d74c98db@mail.gmail.com> <48EA4428.9010306@soegaard.net> <46b603df0810070057k2c769321r8a7dcdee4a47173b@mail.gmail.com> <98C49B0D-9D0C-4F9E-9355-C6BC06FCC13F@alan-watson.org> <990e0c030810070601q6d59ec27pb1e5ada6a47ff1d9@mail.gmail.com> <612D539B-FE97-4979-A498-612B4B34A65C@alan-watson.org> Message-ID: <7622cdaf0810071129y3a6df0c6j34d91869e9866697@mail.gmail.com> On Tue, Oct 7, 2008 at 2:13 PM, Alan Watson wrote: > > Standard Scheme does not have real immutable lists, real immutable strings, > or uninterned symbols. (If it did, I would agree that eqv? should compare > them extensionally.) > I suppose that depends on the standard. R6RS (and, I believe, R5RS) does have immutable strings. Or do you mean something by "real" that I'm missing here? From vyzo at media.mit.edu Tue Oct 7 14:29:40 2008 From: vyzo at media.mit.edu (Dimitris Vyzovitis) Date: Thu Mar 26 02:30:04 2009 Subject: [plt-scheme] build segfault Message-ID: make segfaults with svn-11966 ./configure [--enable-shared] make ... cd gc2; make all make[3]: Entering directory `/usr/local/src/plt-svn/plt/src/mzscheme/gc2' make xsrc/precomp.h make[4]: Entering directory `/usr/local/src/plt-svn/plt/src/mzscheme/gc2' env XFORM_PRECOMP=yes ../mzschemecgc -cqu ./xform.ss --setup . --cpp "gcc -E -DNEWGC_BTC_ACCOUNT -DMZ_USES_SHARED_LIB -I./.. -I./../include" -o xsrc/precomp.h ./precomp.c make[4]: *** [xsrc/precomp.h] Segmentation fault make[4]: Leaving directory `/usr/local/src/plt-svn/plt/src/mzscheme/gc2' make[3]: *** [all] Error 2 make[3]: Leaving directory `/usr/local/src/plt-svn/plt/src/mzscheme/gc2' make[2]: *** [3m] Error 2 make[2]: Leaving directory `/usr/local/src/plt-svn/plt/src/mzscheme' make[1]: *** [3m] Error 2 make[1]: Leaving directory `/usr/local/src/plt-svn/plt/src' make: *** [all] Error 2 Any ideas? Crashes with or without --enable-shared. gnu x86-64, gentoo, gcc version 4.1.2 (Gentoo 4.1.2 p1.0.2) -- vyzo PS: this crash also appears in gentoo's bugzilla for drscheme-4.1 as well: http://bugs.gentoo.org/show_bug.cgi?id=237508] but the CFLAGS=-02 fix suggested there does not work From alan at alan-watson.org Tue Oct 7 15:05:02 2008 From: alan at alan-watson.org (Alan Watson) Date: Thu Mar 26 02:30:04 2009 Subject: [plt-scheme] Re: When does eqv? differ from eq? , from equal? In-Reply-To: <7622cdaf0810071129y3a6df0c6j34d91869e9866697@mail.gmail.com> References: <63bb19ae0810051157y443d3a05j6418905e0b36bb8e@mail.gmail.com> <9b1fff280810060928y7591f538nc0283a45d74c98db@mail.gmail.com> <48EA4428.9010306@soegaard.net> <46b603df0810070057k2c769321r8a7dcdee4a47173b@mail.gmail.com> <98C49B0D-9D0C-4F9E-9355-C6BC06FCC13F@alan-watson.org> <990e0c030810070601q6d59ec27pb1e5ada6a47ff1d9@mail.gmail.com> <612D539B-FE97-4979-A498-612B4B34A65C@alan-watson.org> <7622cdaf0810071129y3a6df0c6j34d91869e9866697@mail.gmail.com> Message-ID: Both the R5RS and R6RS have mutable strings. However, in order to obtain access to the mutators in the R6RS, you have to import the mutable-strings library. When I said that standard Scheme does not have "real" mutable strings, I meant that while string literals in programs or obtained from read should not be modified, there are no distinctions between such strings and other strings except for the possibility of bad things happening if you attempt to mutate them. In particular, there is no safe and portable means to tell if a string is mutable or immutable. Ditto with lists in standard Scheme. Now, PLT Scheme has real immutable pairs and real immutable strings, which is nice as far as it goes. It's a shame that eqv? doesn't do the Right Thing on them, but I guess the PLTers were scared off by the torpedoes :-) Regards, Alan -- Alan Watson http://www.alan-watson.org/ From mflatt at cs.utah.edu Tue Oct 7 15:14:54 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:30:04 2009 Subject: [plt-scheme] Re: When does eqv? differ from eq? , from equal? In-Reply-To: References: <63bb19ae0810051157y443d3a05j6418905e0b36bb8e@mail.gmail.com> <9b1fff280810060928y7591f538nc0283a45d74c98db@mail.gmail.com> <48EA4428.9010306@soegaard.net> <46b603df0810070057k2c769321r8a7dcdee4a47173b@mail.gmail.com> <98C49B0D-9D0C-4F9E-9355-C6BC06FCC13F@alan-watson.org> <990e0c030810070601q6d59ec27pb1e5ada6a47ff1d9@mail.gmail.com> <612D539B-FE97-4979-A498-612B4B34A65C@alan-watson.org> <7622cdaf0810071129y3a6df0c6j34d91869e9866697@mail.gmail.com> Message-ID: <20081007191454.795966500B9@mail-svr1.cs.utah.edu> Can we please move this thread to comp.lang.scheme? Thanks, Matthew From mflatt at cs.utah.edu Tue Oct 7 15:29:09 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:30:05 2009 Subject: [plt-scheme] build segfault In-Reply-To: References: Message-ID: <20081007192909.6C6016500BC@mail-svr1.cs.utah.edu> I introduced a bug this morning for platforms that need explicit execute permission set on memory that's allocated for code by the JIT. Now fixed in SVN. At Tue, 7 Oct 2008 14:29:40 -0400 (EDT), Dimitris Vyzovitis wrote: > make segfaults with svn-11966 > ./configure [--enable-shared] > make > ... > cd gc2; make all > make[3]: Entering directory `/usr/local/src/plt-svn/plt/src/mzscheme/gc2' > make xsrc/precomp.h > make[4]: Entering directory `/usr/local/src/plt-svn/plt/src/mzscheme/gc2' > env XFORM_PRECOMP=yes ../mzschemecgc -cqu ./xform.ss --setup . --cpp "gcc > -E -DNEWGC_BTC_ACCOUNT -DMZ_USES_SHARED_LIB -I./.. -I./../include" -o > xsrc/precomp.h ./precomp.c > make[4]: *** [xsrc/precomp.h] Segmentation fault > make[4]: Leaving directory `/usr/local/src/plt-svn/plt/src/mzscheme/gc2' > make[3]: *** [all] Error 2 > make[3]: Leaving directory `/usr/local/src/plt-svn/plt/src/mzscheme/gc2' > make[2]: *** [3m] Error 2 > make[2]: Leaving directory `/usr/local/src/plt-svn/plt/src/mzscheme' > make[1]: *** [3m] Error 2 > make[1]: Leaving directory `/usr/local/src/plt-svn/plt/src' > make: *** [all] Error 2 > > Any ideas? > Crashes with or without --enable-shared. > gnu x86-64, gentoo, gcc version 4.1.2 (Gentoo 4.1.2 p1.0.2) > > -- vyzo > > PS: this crash also appears in gentoo's bugzilla for drscheme-4.1 as well: > http://bugs.gentoo.org/show_bug.cgi?id=237508] > but the CFLAGS=-02 fix suggested there does not work > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From kbohdan at mail.ru Tue Oct 7 16:17:57 2008 From: kbohdan at mail.ru (kbohdan@mail.ru) Date: Thu Mar 26 02:30:05 2009 Subject: [plt-scheme] Re: When does eqv? differ from eq? , from equal? In-Reply-To: <5f07325f0810070933h4c35bc86u556281d271b10047@mail.gmail.com> References: <46b603df0810070057k2c769321r8a7dcdee4a47173b@mail.gmail.com> <5FF8AD313C054C0B815FBCACDCC18947@uw2b2dff239c4d> <0E399D8C-A0D8-473E-8696-4AD39E914763@ccs.neu.edu> <49F3A6007716493DAAA815F70623AC74@uw2b2dff239c4d> <34A34D44-F771-4624-B6F4-43FD5D702A77@ccs.neu.edu> <756daca50810070828j24f5ef58x14eb95006d1a71de@mail.gmail.com> <5f07325f0810070933h4c35bc86u556281d271b10047@mail.gmail.com> Message-ID: Greg Woodhouse wrote: > What bothers me is that professional developers focus so much on tools > and languages without really thinking critically about the problems they > are trying to solve. I work on message based interfaces between > healthcare applications (mostly on the Java side), and it's awfully > difficult to get people to think in terms of, say, the contract a > service provider needs to support. Amount of pending complex projects in world constantly grows and AFAIK only lisp/scheme based approaches offer simple/clean solutions. Ex: DSL interpreter/compiler implementation in scheme is a piece of cake comparing to the traditional approaches (flex/bison, ANTLR, XML etc.). Here is a link to the basic idea: http://lispm.dyndns.org/news?ID=NEWS-2005-07-08-1 Scheme is not only good in explaining programming to students, but it also has HUGE practical value. Programmers in our company were poisoned by SICP and we already (6 monthes after) have 2 projects using lisp/scheme for DSL support and this is only the begining ... Other application area of scheme is modern Web Ajax programming. In this case you can write scheme->javascript compiler and use single programming language for both client&server sides and even for HTML/XML resources. This approach is a magnitude more efficient comparing to the current MS/Adobe approaches. I can continue this list, but a lot of experienced schemers here can say much more than newbie like me :) -- Bohdan From samdphillips at gmail.com Tue Oct 7 19:06:08 2008 From: samdphillips at gmail.com (Sam Phillips) Date: Thu Mar 26 02:30:05 2009 Subject: [plt-scheme] Accessing class in method? Message-ID: <73b251310810071606l5e462bb9r5b2cc9a5b13133d5@mail.gmail.com> Ok, I'm not sure how clearly I can word this... I'm trying to write a method that creates an instance of the class that it is a method on, and I'm not sure how to go about it. Here's an example: > (define a% (class object% (super-new) (define/public (make) (make-object a%)))) > (make-object a%) #(struct:object:a% ...) > (send (make-object a%) make) #(struct:object:a% ...) So far so good. > (define b% (class a% (super-new))) > (make-object b%) #(struct:object:b% ...) > (send (make-object b%) make) #(struct:object:a% ...) What I want is a way for calling "make" on b% to return an instance of b% not of a%. Cheers, Sam From cce at ccs.neu.edu Tue Oct 7 19:23:02 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:30:05 2009 Subject: [plt-scheme] Accessing class in method? In-Reply-To: <73b251310810071606l5e462bb9r5b2cc9a5b13133d5@mail.gmail.com> References: <73b251310810071606l5e462bb9r5b2cc9a5b13133d5@mail.gmail.com> Message-ID: <990e0c030810071623m39069123u82ca1cb7cab5302c@mail.gmail.com> Off the top of my head there are two ways to go about this, neither perfect. One is the OO method: have B override A. Any subclass of A will have to do this. The drawback: lots of duplicated code, and it goes wrong if you forget to override somewhere. The other is reflection: use object-info in the make method to extract the class of the current object. The drawback: not only is object-info not guaranteed to be able to access the class of the current object, but you have no guarantee your subclasses don't introduce constructor arguments you don't know about. This isn't an easy problem, much as it seems like it should be; because subclasses have so much power to change their behavior, automatically generating factory methods for them is nontrivial. Choosing the best way to solve this will depend a lot on what you're trying to do with your factory method and the structure of your classes. If you have more specific information, post it and maybe someone can help you narrow down a better solution. Good luck! --Carl On Tue, Oct 7, 2008 at 7:06 PM, Sam Phillips wrote: > Ok, I'm not sure how clearly I can word this... I'm trying to write a > method that creates an instance of the class that it is a method on, and > I'm not sure how to go about it. Here's an example: > >> (define a% > (class object% > (super-new) > (define/public (make) > (make-object a%)))) >> (make-object a%) > #(struct:object:a% ...) >> (send (make-object a%) make) > #(struct:object:a% ...) > > So far so good. > >> (define b% > (class a% (super-new))) >> (make-object b%) > #(struct:object:b% ...) >> (send (make-object b%) make) > #(struct:object:a% ...) > > What I want is a way for calling "make" on b% to return an instance of > b% not of a%. > > Cheers, > Sam From mark.engelberg at gmail.com Tue Oct 7 19:27:47 2008 From: mark.engelberg at gmail.com (Mark Engelberg) Date: Thu Mar 26 02:30:05 2009 Subject: [plt-scheme] eq-hash-code Message-ID: The documentation says: "Returns an exact integer; for any two eq? values, the returned integer is the same. Furthermore, for the result integer k and any other exact integer j, (= k j) implies (eq? k j)." But it is always true that (= k j) implies (eq? k j) purely by definition of = and eq?. So this statement appears to say nothing useful. What is really meant here? --Mark From zeppieri at gmail.com Tue Oct 7 19:35:32 2008 From: zeppieri at gmail.com (Jon Zeppieri) Date: Thu Mar 26 02:30:05 2009 Subject: [plt-scheme] eq-hash-code In-Reply-To: References: Message-ID: <7622cdaf0810071635g7296840ao7ec169e78b11e3d6@mail.gmail.com> On Tue, Oct 7, 2008 at 7:27 PM, Mark Engelberg wrote: > > But it is always true that (= k j) implies (eq? k j) purely by > definition of = and eq?. But that's not true. The text you quoted is basically saying (in implementation terms), that the result will always be a fixnum. From mark.engelberg at gmail.com Tue Oct 7 19:41:58 2008 From: mark.engelberg at gmail.com (Mark Engelberg) Date: Thu Mar 26 02:30:05 2009 Subject: [plt-scheme] eq-hash-code In-Reply-To: <7622cdaf0810071635g7296840ao7ec169e78b11e3d6@mail.gmail.com> References: <7622cdaf0810071635g7296840ao7ec169e78b11e3d6@mail.gmail.com> Message-ID: Ok, I was forgetting that eq? doesn't necessarily return true for large equal numbers. Just out of curiosity, what are the odds that two structs which are not eq? return the same eq-hash-code? --Mark On Tue, Oct 7, 2008 at 4:35 PM, Jon Zeppieri wrote: > On Tue, Oct 7, 2008 at 7:27 PM, Mark Engelberg wrote: >> >> But it is always true that (= k j) implies (eq? k j) purely by >> definition of = and eq?. > > But that's not true. > The text you quoted is basically saying (in implementation terms), > that the result will always be a fixnum. > From samdphillips at gmail.com Tue Oct 7 20:14:32 2008 From: samdphillips at gmail.com (Sam Phillips) Date: Thu Mar 26 02:30:06 2009 Subject: [plt-scheme] Accessing class in method? In-Reply-To: <990e0c030810071623m39069123u82ca1cb7cab5302c@mail.gmail.com> References: <73b251310810071606l5e462bb9r5b2cc9a5b13133d5@mail.gmail.com> <990e0c030810071623m39069123u82ca1cb7cab5302c@mail.gmail.com> Message-ID: <73b251310810071714g5eb571bcr4c1395d32c457fe5@mail.gmail.com> On Tue, Oct 7, 2008 at 4:23 PM, Carl Eastlund wrote: > Off the top of my head there are two ways to go about this, neither perfect. > > One is the OO method: have B override A. Any subclass of A will have > to do this. The drawback: lots of duplicated code, and it goes wrong > if you forget to override somewhere. I pretty much had discarded this solution for the exact reasons you said. > The other is reflection: use object-info in the make method to extract > the class of the current object. The drawback: not only is > object-info not guaranteed to be able to access the class of the > current object, but you have no guarantee your subclasses don't > introduce constructor arguments you don't know about. I saw object-info, but wasn't sure if there was a better way of doing things. > This isn't an easy problem, much as it seems like it should be; > because subclasses have so much power to change their behavior, > automatically generating factory methods for them is nontrivial. > Choosing the best way to solve this will depend a lot on what you're > trying to do with your factory method and the structure of your > classes. If you have more specific information, post it and maybe > someone can help you narrow down a better solution. I was mostly curious coming from a Smalltalk/Python background and being new to the PLT class system. Both Smalltalk and Python let you get a hold of the current class and from there call methods on it (like constructors.) From what little I remember from swindle/tinyclos you can do something similar with those systems. Cheers, Sam From czhu at cs.utah.edu Tue Oct 7 21:38:16 2008 From: czhu at cs.utah.edu (Chongkai Zhu) Date: Thu Mar 26 02:30:06 2009 Subject: [plt-scheme] eq-hash-code In-Reply-To: References: <7622cdaf0810071635g7296840ao7ec169e78b11e3d6@mail.gmail.com> Message-ID: <48EC0F08.3080404@cs.utah.edu> Mark Engelberg wrote: > Just out of curiosity, what are the odds that two structs which are > not eq? return the same eq-hash-code? > > --Mark > > Very small, but not zero. I guess you just need to find out the range of eq-hash-code to get a decent guess. Chongkai From grettke at acm.org Tue Oct 7 22:05:07 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:30:06 2009 Subject: [plt-scheme] How to tell DrScheme not to syntax color non Scheme files? Message-ID: <756daca50810071905j32136d44r70d563829f415232@mail.gmail.com> How does one tell DrScheme not to syntax color non Scheme files? Text files, for example. From robby at cs.uchicago.edu Tue Oct 7 22:06:26 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:30:06 2009 Subject: [plt-scheme] How to tell DrScheme not to syntax color non Scheme files? In-Reply-To: <756daca50810071905j32136d44r70d563829f415232@mail.gmail.com> References: <756daca50810071905j32136d44r70d563829f415232@mail.gmail.com> Message-ID: <932b2f1f0810071906h36b8f263gdc95db2480787f43@mail.gmail.com> Did you try setting the file to text mode? Robby On Tue, Oct 7, 2008 at 9:05 PM, Grant Rettke wrote: > How does one tell DrScheme not to syntax color non Scheme files? > > Text files, for example. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From mflatt at cs.utah.edu Tue Oct 7 22:22:22 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:30:06 2009 Subject: [plt-scheme] eq-hash-code In-Reply-To: References: <7622cdaf0810071635g7296840ao7ec169e78b11e3d6@mail.gmail.com> Message-ID: <20081008022224.0531A6500C6@mail-svr1.cs.utah.edu> At Tue, 7 Oct 2008 16:41:58 -0700, "Mark Engelberg" wrote: > Just out of curiosity, what are the odds that two structs which are > not eq? return the same eq-hash-code? On a 32-bit platform, using 3m, the current implementation uses 24 bits in each object to keep a hash code, or 22 bits under Windows. On a 64-bit platform, it's 55 or 57 bits. The number of bits varies because they're essentially leftover bits in object headers, and Windows has a different allocation granularity. Hash codes are generated on demand, essentially by incrementing a counter; one bit in the counter has a different use, though, so it's essentially discarded. If you create 2^25 struct instances on a 32-bit non-Windows machine with 3m, and if you force the hash code on each of them, then you're likely to create 2 structs with the same hash code as a given other struct (or 8 of them on a 32-bit Windows machine). To confirm, on my 32-bit non-Windows machine, the program below prints collision at 33550335; #
= # collision at 33554431; # = # collision at 67104767; # = # collision at 67108863; # = # ... The answer is simpler with CGC. Objects don't move in memory, so the address is used as the hash code; the bottom two bits are dropped, since they're always 0, so the interesting part of the address fits into a fixnum. And since two objects can't be at the same address, the hash code is always different for any two objects (as long as neither has been GCed). Matthew ---------------------------------------- #lang scheme (define-struct a ()) (let* ([a1 (make-a)] [h1 (eq-hash-code a1)]) (let loop ([i 0]) (let ([a2 (make-a)]) (when (= (eq-hash-code a2) h1) (printf "collision at ~a; ~s = ~s\n" i a1 a2))) (loop (add1 i)))) From grettke at acm.org Tue Oct 7 22:34:27 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:30:06 2009 Subject: [plt-scheme] How to tell DrScheme not to syntax color non Scheme files? In-Reply-To: <932b2f1f0810071906h36b8f263gdc95db2480787f43@mail.gmail.com> References: <756daca50810071905j32136d44r70d563829f415232@mail.gmail.com> <932b2f1f0810071906h36b8f263gdc95db2480787f43@mail.gmail.com> Message-ID: <756daca50810071934m16c6de79v7cbeb3b3dff60bda@mail.gmail.com> On Tue, Oct 7, 2008 at 9:06 PM, Robby Findler wrote: > Did you try setting the file to text mode? No, that works. How do I get DrScheme to do that for me every time a .txt files is opened? From matthias at ccs.neu.edu Tue Oct 7 22:46:42 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:30:06 2009 Subject: [plt-scheme] Accessing class in method? In-Reply-To: <73b251310810071714g5eb571bcr4c1395d32c457fe5@mail.gmail.com> References: <73b251310810071606l5e462bb9r5b2cc9a5b13133d5@mail.gmail.com> <990e0c030810071623m39069123u82ca1cb7cab5302c@mail.gmail.com> <73b251310810071714g5eb571bcr4c1395d32c457fe5@mail.gmail.com> Message-ID: <24767367-FD9E-467B-8B2D-255EFAFE4AEB@ccs.neu.edu> On Oct 7, 2008, at 8:14 PM, Sam Phillips wrote: > Both Smalltalk and Python let you > get a hold of the current class and from there call methods on it > (like > constructors.) From what little I remember from swindle/tinyclos you > can do something similar with those systems. Look for object-info in the Docs (F1). It works as expected and, yes, I have needed this many times. -- Matthias From mark.engelberg at gmail.com Tue Oct 7 23:58:43 2008 From: mark.engelberg at gmail.com (Mark Engelberg) Date: Thu Mar 26 02:30:07 2009 Subject: [plt-scheme] eq-hash-code In-Reply-To: <20081008022224.0531A6500C6@mail-svr1.cs.utah.edu> References: <7622cdaf0810071635g7296840ao7ec169e78b11e3d6@mail.gmail.com> <20081008022224.0531A6500C6@mail-svr1.cs.utah.edu> Message-ID: Very interesting. If you don't care about the value fitting into a fixnum, is there any way to generate a hash code that is guaranteed to be unique? For example, does Scheme have some sort of internal "address" of each allocation that stays consistent even when 3m actually moves around the objects in real memory? If so, is there a way to grab that address from a Scheme function call? Thanks, Mark From mflatt at cs.utah.edu Wed Oct 8 08:07:32 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:30:07 2009 Subject: [plt-scheme] eq-hash-code In-Reply-To: References: <7622cdaf0810071635g7296840ao7ec169e78b11e3d6@mail.gmail.com> <20081008022224.0531A6500C6@mail-svr1.cs.utah.edu> Message-ID: <20081008120734.141BA6500BE@mail-svr1.cs.utah.edu> At Tue, 7 Oct 2008 20:58:43 -0700, "Mark Engelberg" wrote: > If you don't care about the value fitting into a > fixnum, is there any way to generate a hash code that is guaranteed to > be unique? No. The amount of available information fits into a fixnum anyway. > For example, does Scheme have some sort of internal > "address" of each allocation that stays consistent even when 3m > actually moves around the objects in real memory? Not other than the hash code. Matthew From alan at alan-watson.org Wed Oct 8 10:08:31 2008 From: alan at alan-watson.org (Alan Watson) Date: Thu Mar 26 02:30:07 2009 Subject: [plt-scheme] eq-hash-code In-Reply-To: <20081008120734.141BA6500BE@mail-svr1.cs.utah.edu> References: <7622cdaf0810071635g7296840ao7ec169e78b11e3d6@mail.gmail.com> <20081008022224.0531A6500C6@mail-svr1.cs.utah.edu> <20081008120734.141BA6500BE@mail-svr1.cs.utah.edu> Message-ID: <124306A4-97BF-4548-BABE-270B71A7EFE3@alan-watson.org> You probably know this, but you could fake this by generating unique hash codes yourself and associating them with objects using weak hash tables or weak boxes. Of course, you would have to arrange to make the association yourself as objects are created, which might well be unworkable. Regards, Alan -- Alan Watson http://www.alan-watson.org/ From rebelsky at grinnell.edu Wed Oct 8 12:47:22 2008 From: rebelsky at grinnell.edu (Samuel Rebelsky) Date: Thu Mar 26 02:30:07 2009 Subject: [plt-scheme] If expressions in Embedded PLT Scheme Message-ID: <67D22FA7-7C38-4123-B0B8-97E32105B029@grinnell.edu> I am embedding MzScheme/PLT Scheme in a program. In MzScheme (v372 is the one I had been using), it was permissible to write if expressions without an alternate, as in (if (> x 1) (display x)) When I embed the new PLT Scheme (v401, I think), for the same expression, I get an error message that it 'must have an "else" expression'. R6RS seems to suggest that the no-alternate form is still valid http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-14.html#node_sec_11.4.3 Is there a way to turn off the "require alternate" behavior in embedded PLT Scheme? Thanks! -- Sam Rebelsky From cce at ccs.neu.edu Wed Oct 8 13:14:00 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:30:07 2009 Subject: [plt-scheme] If expressions in Embedded PLT Scheme In-Reply-To: <67D22FA7-7C38-4123-B0B8-97E32105B029@grinnell.edu> References: <67D22FA7-7C38-4123-B0B8-97E32105B029@grinnell.edu> Message-ID: <990e0c030810081014leb641eewbf7c816b62811df6@mail.gmail.com> If you use "when" in place of "if", you'll get the one-clause if behavior, or you can use the legacy mzscheme behavior by putting "#lang mzscheme" at the top of your program (instead of "#lang scheme"). --Carl On Wed, Oct 8, 2008 at 12:47 PM, Samuel Rebelsky wrote: > I am embedding MzScheme/PLT Scheme in a program. > > In MzScheme (v372 is the one I had been using), it was permissible to write > if expressions without an alternate, as in > > (if (> x 1) (display x)) > > When I embed the new PLT Scheme (v401, I think), for the same expression, I > get an error message that it 'must have an "else" expression'. > > R6RS seems to suggest that the no-alternate form is still valid > > http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-14.html#node_sec_11.4.3 > > Is there a way to turn off the "require alternate" behavior in embedded PLT > Scheme? > > Thanks! > > -- Sam Rebelsky From lunarc.lists at gmail.com Wed Oct 8 13:16:20 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:30:08 2009 Subject: [plt-scheme] If expressions in Embedded PLT Scheme In-Reply-To: <67D22FA7-7C38-4123-B0B8-97E32105B029@grinnell.edu> References: <67D22FA7-7C38-4123-B0B8-97E32105B029@grinnell.edu> Message-ID: 2008/10/8 Samuel Rebelsky > > I am embedding MzScheme/PLT Scheme in a program. > > In MzScheme (v372 is the one I had been using), it was permissible to write if expressions without an alternate, as in > > (if (> x 1) (display x)) > > When I embed the new PLT Scheme (v401, I think), for the same expression, I get an error message that it 'must have an "else" expression'. > > R6RS seems to suggest that the no-alternate form is still valid > > http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-14.html#node_sec_11.4.3 > > Is there a way to turn off the "require alternate" behavior in embedded PLT Scheme? It's generally recommended to use 'when' instead in this case. Henk From nowgate at yahoo.com Wed Oct 8 14:11:13 2008 From: nowgate at yahoo.com (michael rice) Date: Thu Mar 26 02:30:08 2009 Subject: [plt-scheme] SRFI 41 Message-ID: <209967.29400.qm@web31107.mail.mud.yahoo.com> There's a stream-member function given in SRFI 41 that doesn't seem to work as expected. ================= (require srfi/41) (define s1 (stream-cons 'a (stream-cons 'b stream-null))) (define-stream (stream-member eql? obj strm) ? (stream-let loop ((strm strm)) ??? (cond ((stream-null? strm) #f) ????????? ((eql? obj (stream-car strm)) strm) ????????? (else (loop (stream-cdr strm)))))) =================== Welcome to DrScheme, version 4.1 [3m]. Language: Swindle; memory limit: 128 megabytes. > (stream-member equal? 'c s1) # > =================== Shouldn't the answer be #f? Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081008/180c8ece/attachment.html From jensaxel at soegaard.net Wed Oct 8 14:42:01 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:30:08 2009 Subject: [plt-scheme] SRFI 41 In-Reply-To: <209967.29400.qm@web31107.mail.mud.yahoo.com> References: <209967.29400.qm@web31107.mail.mud.yahoo.com> Message-ID: <48ECFEF9.7040405@soegaard.net> michael rice skrev: > There's a stream-member function given in SRFI 41 that doesn't seem to > work as expected. > > ================= > > (require srfi/41) > > (define s1 (stream-cons 'a (stream-cons 'b stream-null))) > > (define-stream (stream-member eql? obj strm) > (stream-let loop ((strm strm)) > (cond ((stream-null? strm) #f) > ((eql? obj (stream-car strm)) strm) > (else (loop (stream-cdr strm)))))) > > =================== > > Welcome to DrScheme, version 4.1 [3m]. > Language: Swindle; memory limit: 128 megabytes. > > (stream-member equal? 'c s1) > # > > > > =================== > > Shouldn't the answer be #f? > > Michael > > The documentation for srfi 41 says: (stream-let tag ((var expr) ...) body) ... stream-let evaluates the expressions in its body in an environment containing the newly-bound variables, returning the value of the last expression evaluated, which must yield a stream. Since #f is not a stream, the behaviour is undefined. Note that evaluating (stream-car (stream-member equal? 'c s1)) gives #f. But... The example rises a few questions: Is PLT using the reference implementation of srfi 41? If not, it would be a worth chaning the behaviour of stream-let to match the reference implementation. Was it intentional that this behaviour is undefined? If it is unintentional, maybe an error message would be better than matching the behaviour of the reference implementation? -- Jens Axel S?gaard From yinso.chen at gmail.com Wed Oct 8 14:56:08 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:30:09 2009 Subject: [plt-scheme] parallel planet versions? Message-ID: <779bf2730810081156r59fe97e9tb231b6e93a8530a7@mail.gmail.com> Hi all - does (require (planet module:version)) locks the module to load from a specific version? I have multiple versions of a module (development link) running on a single server, and it seems that changes to the latest version impacts modules that are supposed to load from an earlier version. What is the expected behavior here? Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081008/4d4dbc5a/attachment.htm From robby at cs.uchicago.edu Wed Oct 8 14:58:59 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:30:09 2009 Subject: [plt-scheme] parallel planet versions? In-Reply-To: <779bf2730810081156r59fe97e9tb231b6e93a8530a7@mail.gmail.com> References: <779bf2730810081156r59fe97e9tb231b6e93a8530a7@mail.gmail.com> Message-ID: <932b2f1f0810081158o7d4d46e3l352d2eb0f91c709@mail.gmail.com> On Wed, Oct 8, 2008 at 1:56 PM, YC wrote: > Hi all - > > does (require (planet module:version)) locks the module to load from a > specific version? Yes. > I have multiple versions of a module (development link) running on a single > server, and it seems that changes to the latest version impacts modules that > are supposed to load from an earlier version. But a version specification like you write above is considered satisfied by any version where the major version is the same and the minor version is bigger than what you request. You can lock in a specific minor version with the = specifier (using the more verbose syntax for planet requires). (require (planet ("f.ss" ("me" "x.plt" 1 (= 2)))) > What is the expected behavior here? > > Thanks, > yc > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From nowgate at yahoo.com Wed Oct 8 15:07:54 2008 From: nowgate at yahoo.com (michael rice) Date: Thu Mar 26 02:30:10 2009 Subject: [plt-scheme] SRFI 41 In-Reply-To: <48ECFEF9.7040405@soegaard.net> Message-ID: <604600.14705.qm@web31103.mail.mud.yahoo.com> Thanks. That clears it up somewhat. I sent a copy of my message to the SRFI 41 mail site. Is there anything else I should do, such as forward your comments to them? Michael --- On Wed, 10/8/08, Jens Axel Soegaard wrote: From: Jens Axel Soegaard Subject: Re: [plt-scheme] SRFI 41 To: nowgate@yahoo.com Cc: plt-scheme@list.cs.brown.edu Date: Wednesday, October 8, 2008, 2:42 PM michael rice skrev: > There's a stream-member function given in SRFI 41 that doesn't seem to > work as expected. > > ================= > > (require srfi/41) > > (define s1 (stream-cons 'a (stream-cons 'b stream-null))) > > (define-stream (stream-member eql? obj strm) > (stream-let loop ((strm strm)) > (cond ((stream-null? strm) #f) > ((eql? obj (stream-car strm)) strm) > (else (loop (stream-cdr strm)))))) > > =================== > > Welcome to DrScheme, version 4.1 [3m]. > Language: Swindle; memory limit: 128 megabytes. > > (stream-member equal? 'c s1) > # > > > > =================== > > Shouldn't the answer be #f? > > Michael > > The documentation for srfi 41 says: (stream-let tag ((var expr) ...) body) ... stream-let evaluates the expressions in its body in an environment containing the newly-bound variables, returning the value of the last expression evaluated, which must yield a stream. Since #f is not a stream, the behaviour is undefined. Note that evaluating (stream-car (stream-member equal? 'c s1)) gives #f. But... The example rises a few questions: Is PLT using the reference implementation of srfi 41? If not, it would be a worth chaning the behaviour of stream-let to match the reference implementation. Was it intentional that this behaviour is undefined? If it is unintentional, maybe an error message would be better than matching the behaviour of the reference implementation? -- Jens Axel S?gaard -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081008/bf3b047a/attachment.html From pbewig at gmail.com Wed Oct 8 15:20:10 2008 From: pbewig at gmail.com (Phil Bewig) Date: Thu Mar 26 02:30:11 2009 Subject: [plt-scheme] SRFI 41 In-Reply-To: <209967.29400.qm@web31107.mail.mud.yahoo.com> References: <209967.29400.qm@web31107.mail.mud.yahoo.com> Message-ID: The definition of stream-member given in the text of SRFI-41 is incorrect. The problem is inconsistent typing: one branch of the cond returns #f, which is not a stream, while another branch of the cond returns strm, which is a stream. Here is a definition of stream-member? which returns either #t or #f; it uses normal define, not stream-define, and normal let, not stream-let: (define (stream-member? eql? obj strm) (let loop ((strm strm)) (cond ((stream-null? strm) #f) ((eql? (stream-car strm) obj) #t) (else (loop (stream-cdr strm)))))) Given that, (stream-member? equal? 'c (stream 'a 'b)) evaluates to #f, as you expect. Another definition of stream-member, the one that was intended by SRFI-41, is: (define-stream (stream-member eql? obj strm) (stream-let loop ((strm strm)) (cond ((stream-null? strm) (stream #f)) ((eql? obj (stream-car strm)) strm) (else (loop (stream-cdr strm)))))) That definition type-checks because both branches of the cond evaluate to a stream. Given that definition, (stream-car (stream-member equal? 'c (stream 'a 'b))) evaluates to #f, and (stream-car (stream-member equal? 'a (stream 'a 'b))) evaluates to a. Note that stream-member is not defined in SRFI-41; it is just an example in the text (worse, it is an incorrect example in the text). If PLT includes stream-member in its version of SRFI-41, that is an extension of SRFI-41. If PLT wants to extend SRFI-41, it would be better to define the library in such a way that it is loaded by (require srfi/41-extended-by-PLT) or some such mechanism. By taking the liberty of extending the base definition of SRFI-41, PLT confuses users and makes code written using its extended version of SRFI-41 non-portable to other Scheme systems that adhere to SRFI-41 as it is written. I will forward this note to the SRFI-41 mailing list. Phil On Wed, Oct 8, 2008 at 1:11 PM, michael rice wrote: > There's a stream-member function given in SRFI 41 that doesn't seem to > work as expected. > > ================= > > (require srfi/41) > > (define s1 (stream-cons 'a (stream-cons 'b stream-null))) > > (define-stream (stream-member eql? obj strm) > (stream-let loop ((strm strm)) > (cond ((stream-null? strm) #f) > ((eql? obj (stream-car strm)) strm) > (else (loop (stream-cdr strm)))))) > > =================== > > Welcome to DrScheme, version 4.1 [3m]. > Language: Swindle; memory limit: 128 megabytes. > > (stream-member equal? 'c s1) > # > > > > =================== > > Shouldn't the answer be #f? > > Michael > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081008/919d4155/attachment.htm From jos.koot at telefonica.net Wed Oct 8 15:40:35 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:30:11 2009 Subject: [plt-scheme] SRFI 41 References: <209967.29400.qm@web31107.mail.mud.yahoo.com> <48ECFEF9.7040405@soegaard.net> Message-ID: <22758BE8507C49ABAC1466CEB76E6DB6@uw2b2dff239c4d> SRFI 41 in PLT is almost an identical copy of the reference implementation. I did not yet know it was adopted in PLT, but I am glad to see it there. It does not include procedure stream-member. This procedure is given as an example in the document. Clearly the example is incorrect. I suggest: #lang scheme (require "streams.ss") (define (stream-member eql? obj strm) (let/ec ec (stream-let loop ((strm strm)) (cond ((stream-null? strm) strm) ((eql? obj (stream-car strm)) strm) (else (loop (stream-cdr strm))))))) (define s1 (stream-cons 'a (stream-cons 'b stream-null))) (stream->list (stream-member eq? 'a s1)) ; --> (a b) (stream->list (stream-member eq? 'b s1)) ; --> (b) (stream->list (stream-member eq? 'c s1)) ; --> ( ) ; signals that the element is not found. The solution given by Phil goes wrong on (stream-member eqv? #f (make-stream #f)) and (stream-member eqv? #f stream-null) because it returns (stream #f) in both cases. It does not show whether the returned value, i.e (stream #f), is the last cdr of the stream or a signal that the element has not been found. Since the result cannot be empty if the element is found it is better to return null-stream in this case. Jos ----- Original Message ----- From: "Jens Axel Soegaard" To: Cc: Sent: Wednesday, October 08, 2008 8:42 PM Subject: Re: [plt-scheme] SRFI 41 > michael rice skrev: >> There's a stream-member function given in SRFI 41 that doesn't seem to >> work as expected. >> >> ================= >> >> (require srfi/41) >> >> (define s1 (stream-cons 'a (stream-cons 'b stream-null))) >> >> (define-stream (stream-member eql? obj strm) >> (stream-let loop ((strm strm)) >> (cond ((stream-null? strm) #f) >> ((eql? obj (stream-car strm)) strm) >> (else (loop (stream-cdr strm)))))) >> >> =================== >> >> Welcome to DrScheme, version 4.1 [3m]. >> Language: Swindle; memory limit: 128 megabytes. >> > (stream-member equal? 'c s1) >> # >> > >> >> =================== >> >> Shouldn't the answer be #f? >> >> Michael >> >> > > The documentation for srfi 41 says: > > (stream-let tag ((var expr) ...) body) > > ... stream-let evaluates the expressions in its body in an environment > containing > the newly-bound variables, returning the value of the last expression > evaluated, > which must yield a stream. > > Since #f is not a stream, the behaviour is undefined. > > Note that evaluating (stream-car (stream-member equal? 'c s1)) gives #f. > > But... The example rises a few questions: > > Is PLT using the reference implementation of srfi 41? > > If not, it would be a worth chaning the behaviour of stream-let to > match the reference implementation. > > Was it intentional that this behaviour is undefined? > > If it is unintentional, maybe an error message would be better > than matching the behaviour of the reference implementation? > > > > -- > Jens Axel S?gaard > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From yinso.chen at gmail.com Wed Oct 8 15:43:43 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:30:11 2009 Subject: [plt-scheme] parallel planet versions? In-Reply-To: <932b2f1f0810081158o7d4d46e3l352d2eb0f91c709@mail.gmail.com> References: <779bf2730810081156r59fe97e9tb231b6e93a8530a7@mail.gmail.com> <932b2f1f0810081158o7d4d46e3l352d2eb0f91c709@mail.gmail.com> Message-ID: <779bf2730810081243m732e0b20l1f2d90dc444f1e85@mail.gmail.com> On Wed, Oct 8, 2008 at 11:58 AM, Robby Findler wrote: > > But a version specification like you write above is considered > satisfied by any version where the major version is the same and the > minor version is bigger than what you request. > > You can lock in a specific minor version with the = specifier (using > the more verbose syntax for planet requires). > > (require (planet ("f.ss" ("me" "x.plt" 1 (= 2)))) > > I see - thanks! yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081008/f984b62d/attachment.html From pbewig at gmail.com Wed Oct 8 15:43:51 2008 From: pbewig at gmail.com (Phil Bewig) Date: Thu Mar 26 02:30:12 2009 Subject: [plt-scheme] SRFI 41 In-Reply-To: <22758BE8507C49ABAC1466CEB76E6DB6@uw2b2dff239c4d> References: <209967.29400.qm@web31107.mail.mud.yahoo.com> <48ECFEF9.7040405@soegaard.net> <22758BE8507C49ABAC1466CEB76E6DB6@uw2b2dff239c4d> Message-ID: Agreed. I purposely returned (stream #f) because the original poster expected #f. By the way, it is easier to write (stream 'a 'b) than (stream-cons 'a (stream-cons 'b stream-null)). On Wed, Oct 8, 2008 at 2:40 PM, Jos Koot wrote: > SRFI 41 in PLT is almost an identical copy of the reference implementation. > I did not yet know it was adopted in PLT, but I am glad to see it there. It > does not include procedure stream-member. This procedure is given as an > example in the document. Clearly the example is incorrect. > > I suggest: > > #lang scheme > (require "streams.ss") > > (define (stream-member eql? obj strm) > (let/ec ec > (stream-let loop ((strm strm)) > (cond > ((stream-null? strm) strm) > ((eql? obj (stream-car strm)) strm) > (else (loop (stream-cdr strm))))))) > > (define s1 (stream-cons 'a (stream-cons 'b stream-null))) > > (stream->list (stream-member eq? 'a s1)) ; --> (a b) > (stream->list (stream-member eq? 'b s1)) ; --> (b) > (stream->list (stream-member eq? 'c s1)) ; --> ( ) ; signals that the > element is not found. > > The solution given by Phil goes wrong on > (stream-member eqv? #f (make-stream #f)) and > (stream-member eqv? #f stream-null) > because it returns (stream #f) in both cases. It does not show whether the > returned value, i.e (stream #f), is the last cdr of the stream or a signal > that the element has not been found. Since the result cannot be empty if the > element is found it is better to return null-stream in this case. > > Jos > ----- Original Message ----- From: "Jens Axel Soegaard" < > jensaxel@soegaard.net> > To: > Cc: > Sent: Wednesday, October 08, 2008 8:42 PM > Subject: Re: [plt-scheme] SRFI 41 > > > michael rice skrev: >> >>> There's a stream-member function given in SRFI 41 that doesn't seem to >>> work as expected. >>> >>> ================= >>> >>> (require srfi/41) >>> >>> (define s1 (stream-cons 'a (stream-cons 'b stream-null))) >>> >>> (define-stream (stream-member eql? obj strm) >>> (stream-let loop ((strm strm)) >>> (cond ((stream-null? strm) #f) >>> ((eql? obj (stream-car strm)) strm) >>> (else (loop (stream-cdr strm)))))) >>> >>> =================== >>> >>> Welcome to DrScheme, version 4.1 [3m]. >>> Language: Swindle; memory limit: 128 megabytes. >>> > (stream-member equal? 'c s1) >>> # >>> > >>> >>> =================== >>> >>> Shouldn't the answer be #f? >>> >>> Michael >>> >>> >>> >> The documentation for srfi 41 says: >> >> (stream-let tag ((var expr) ...) body) >> >> ... stream-let evaluates the expressions in its body in an environment >> containing >> the newly-bound variables, returning the value of the last expression >> evaluated, >> which must yield a stream. >> >> Since #f is not a stream, the behaviour is undefined. >> >> Note that evaluating (stream-car (stream-member equal? 'c s1)) gives #f. >> >> But... The example rises a few questions: >> >> Is PLT using the reference implementation of srfi 41? >> >> If not, it would be a worth chaning the behaviour of stream-let to >> match the reference implementation. >> >> Was it intentional that this behaviour is undefined? >> >> If it is unintentional, maybe an error message would be better >> than matching the behaviour of the reference implementation? >> >> >> >> -- >> Jens Axel S?gaard >> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081008/0f20720d/attachment.htm From jos.koot at telefonica.net Wed Oct 8 15:43:52 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:30:12 2009 Subject: [plt-scheme] SRFI 41 References: <209967.29400.qm@web31107.mail.mud.yahoo.com><48ECFEF9.7040405@soegaard.net> <22758BE8507C49ABAC1466CEB76E6DB6@uw2b2dff239c4d> Message-ID: <6CFD3B5BEB2C4404934841271DE35372@uw2b2dff239c4d> Sorry, the let/ec can be omitted. It stems from an earlier trial. Jos ----- Original Message ----- From: "Jos Koot" To: "Jens Axel Soegaard" ; ; "Phil Bewig" Cc: Sent: Wednesday, October 08, 2008 9:40 PM Subject: Re: [plt-scheme] SRFI 41 > SRFI 41 in PLT is almost an identical copy of the reference > implementation. I did not yet know it was adopted in PLT, but I am glad to > see it there. It does not include procedure stream-member. This procedure > is given as an example in the document. Clearly the example is incorrect. > > I suggest: > > #lang scheme > (require "streams.ss") > > (define (stream-member eql? obj strm) > (let/ec ec > (stream-let loop ((strm strm)) > (cond > ((stream-null? strm) strm) > ((eql? obj (stream-car strm)) strm) > (else (loop (stream-cdr strm))))))) > > (define s1 (stream-cons 'a (stream-cons 'b stream-null))) > > (stream->list (stream-member eq? 'a s1)) ; --> (a b) > (stream->list (stream-member eq? 'b s1)) ; --> (b) > (stream->list (stream-member eq? 'c s1)) ; --> ( ) ; signals that the > element is not found. > > The solution given by Phil goes wrong on > (stream-member eqv? #f (make-stream #f)) and > (stream-member eqv? #f stream-null) > because it returns (stream #f) in both cases. It does not show whether the > returned value, i.e (stream #f), is the last cdr of the stream or a signal > that the element has not been found. Since the result cannot be empty if > the element is found it is better to return null-stream in this case. > > Jos > ----- Original Message ----- > From: "Jens Axel Soegaard" > To: > Cc: > Sent: Wednesday, October 08, 2008 8:42 PM > Subject: Re: [plt-scheme] SRFI 41 > > >> michael rice skrev: >>> There's a stream-member function given in SRFI 41 that doesn't seem to >>> work as expected. >>> >>> ================= >>> >>> (require srfi/41) >>> >>> (define s1 (stream-cons 'a (stream-cons 'b stream-null))) >>> >>> (define-stream (stream-member eql? obj strm) >>> (stream-let loop ((strm strm)) >>> (cond ((stream-null? strm) #f) >>> ((eql? obj (stream-car strm)) strm) >>> (else (loop (stream-cdr strm)))))) >>> >>> =================== >>> >>> Welcome to DrScheme, version 4.1 [3m]. >>> Language: Swindle; memory limit: 128 megabytes. >>> > (stream-member equal? 'c s1) >>> # >>> > >>> >>> =================== >>> >>> Shouldn't the answer be #f? >>> >>> Michael >>> >>> >> >> The documentation for srfi 41 says: >> >> (stream-let tag ((var expr) ...) body) >> >> ... stream-let evaluates the expressions in its body in an environment >> containing >> the newly-bound variables, returning the value of the last expression >> evaluated, >> which must yield a stream. >> >> Since #f is not a stream, the behaviour is undefined. >> >> Note that evaluating (stream-car (stream-member equal? 'c s1)) gives #f. >> >> But... The example rises a few questions: >> >> Is PLT using the reference implementation of srfi 41? >> >> If not, it would be a worth chaning the behaviour of stream-let to >> match the reference implementation. >> >> Was it intentional that this behaviour is undefined? >> >> If it is unintentional, maybe an error message would be better >> than matching the behaviour of the reference implementation? >> >> >> >> -- >> Jens Axel S?gaard >> >> _________________________________________________ >> 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 jpc-ml at zenburn.net Wed Oct 8 16:55:54 2008 From: jpc-ml at zenburn.net (=?UTF-8?B?SmFrdWIgUGlvdHIgQ8WCYXBh?=) Date: Thu Mar 26 02:30:13 2009 Subject: [plt-scheme] PLaneT require form Message-ID: <48ED1E5A.8000005@zenburn.net> The manual seems to say that this should be equivalent: (require (planet "soegaard/bit-io/bit-io.scm")) (require (planet "bit-io.scm" ("soegaard" "bit-io.plt" 2 0))) Unfortunately the first one throws this: open-input-file: cannot open input file: "/Users/jpc/Library/PLT Scheme/planet/300/4.1.1/cache/soegaard/bit-io.plt/2/0/bit-io.scm.ss" (No such file or directory; errno=2) The manual says that it should use .scm as the extension when I use the string (and not the symbol) form. Is this a bug or am I missing something? -- regards, Jakub Piotr C?apa From cce at ccs.neu.edu Wed Oct 8 17:04:40 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:30:13 2009 Subject: [plt-scheme] PLaneT require form In-Reply-To: <48ED1E5A.8000005@zenburn.net> References: <48ED1E5A.8000005@zenburn.net> Message-ID: <990e0c030810081404v308a395bj1a6a77b21e89af7c@mail.gmail.com> The current implementation appears to treat symbols and strings identically; either the docs or the code are wrong. The code just applies symbol->string if necessary and moves along, there's no separate code for handling extensions. --Carl On Wed, Oct 8, 2008 at 4:55 PM, Jakub Piotr C?apa wrote: > The manual seems to say that this should be equivalent: > (require (planet "soegaard/bit-io/bit-io.scm")) > (require (planet "bit-io.scm" ("soegaard" "bit-io.plt" 2 0))) > > Unfortunately the first one throws this: > open-input-file: cannot open input file: "/Users/jpc/Library/PLT > Scheme/planet/300/4.1.1/cache/soegaard/bit-io.plt/2/0/bit-io.scm.ss" (No > such file or directory; errno=2) > > The manual says that it should use .scm as the extension when I use the > string (and not the symbol) form. > > Is this a bug or am I missing something? > > -- > regards, > Jakub Piotr C?apa From yinso.chen at gmail.com Wed Oct 8 17:39:29 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:30:13 2009 Subject: [plt-scheme] net/cookie and IE Message-ID: <779bf2730810081439vfee4468x9ca573f239f828f4@mail.gmail.com> Hi - I just found a problem with the interaction between net/cookie and IE (I tested on IE7). Basically - when generating a cookie with `(cookie:add-path cookie "/")`, it generates the following cookie: key=value; Path="/"; Version=1 The Path spec works in Firefox, but not in IE. IE expects Path=/ (without the double quotes) instead, and it drops the cookie (and breaks cookie-based session) in response. >From RFC 2109, this appears to be an IE bug, but changing IE's behavior might be beyond us ... :) p.s. this might be related the thread http://www.cs.brown.edu/pipermail/plt-scheme/2007-July/019420.html Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081008/e163493d/attachment.html From rob.hunter at gmail.com Wed Oct 8 17:44:24 2008 From: rob.hunter at gmail.com (Rob Hunter) Date: Thu Mar 26 02:30:13 2009 Subject: [plt-scheme] net/cookie and IE In-Reply-To: <779bf2730810081439vfee4468x9ca573f239f828f4@mail.gmail.com> References: <779bf2730810081439vfee4468x9ca573f239f828f4@mail.gmail.com> Message-ID: Could be related to this issue that I had too: http://list.cs.brown.edu/pipermail/plt-scheme/2008-January/022721.html Honestly, I can't remember how I fixed this, but I can probably reconstruct what I did if it would be helpful. --rob On Wed, Oct 8, 2008 at 2:39 PM, YC wrote: > Hi - > > I just found a problem with the interaction between net/cookie and IE (I > tested on IE7). > > Basically - when generating a cookie with `(cookie:add-path cookie "/")`, it > generates the following cookie: > > key=value; Path="/"; Version=1 > > The Path spec works in Firefox, but not in IE. IE expects Path=/ (without > the double quotes) instead, and it drops the cookie (and breaks cookie-based > session) in response. > > From RFC 2109, this appears to be an IE bug, but changing IE's behavior > might be beyond us ... :) > > p.s. this might be related the thread > http://www.cs.brown.edu/pipermail/plt-scheme/2007-July/019420.html > > Thanks, > yc > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From grettke at acm.org Wed Oct 8 17:54:33 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:30:14 2009 Subject: [plt-scheme] Re: When does eqv? differ from eq? , from equal? In-Reply-To: <5f07325f0810070933h4c35bc86u556281d271b10047@mail.gmail.com> References: <46b603df0810070057k2c769321r8a7dcdee4a47173b@mail.gmail.com> <5FF8AD313C054C0B815FBCACDCC18947@uw2b2dff239c4d> <0E399D8C-A0D8-473E-8696-4AD39E914763@ccs.neu.edu> <49F3A6007716493DAAA815F70623AC74@uw2b2dff239c4d> <34A34D44-F771-4624-B6F4-43FD5D702A77@ccs.neu.edu> <756daca50810070828j24f5ef58x14eb95006d1a71de@mail.gmail.com> <5f07325f0810070933h4c35bc86u556281d271b10047@mail.gmail.com> Message-ID: <756daca50810081454i22b86884ta321ea0c1736de9@mail.gmail.com> On Tue, Oct 7, 2008 at 11:33 AM, Greg Woodhouse wrote: > I'm sure that all has to do with the perception (perhaps valid) that knowing > C is an essential job skill. But remember that these are first year > students: Since when do first year students get a say in anything?! > What bothers me is that professional developers focus so much on tools and > languages without really thinking critically about the problems they are > trying to solve. Is this in the entire world, or just the U.S.A.? From gregory.woodhouse at gmail.com Wed Oct 8 18:25:38 2008 From: gregory.woodhouse at gmail.com (Greg Woodhouse) Date: Thu Mar 26 02:30:14 2009 Subject: [plt-scheme] Re: When does eqv? differ from eq? , from equal? In-Reply-To: <756daca50810081454i22b86884ta321ea0c1736de9@mail.gmail.com> References: <5FF8AD313C054C0B815FBCACDCC18947@uw2b2dff239c4d> <0E399D8C-A0D8-473E-8696-4AD39E914763@ccs.neu.edu> <49F3A6007716493DAAA815F70623AC74@uw2b2dff239c4d> <34A34D44-F771-4624-B6F4-43FD5D702A77@ccs.neu.edu> <756daca50810070828j24f5ef58x14eb95006d1a71de@mail.gmail.com> <5f07325f0810070933h4c35bc86u556281d271b10047@mail.gmail.com> <756daca50810081454i22b86884ta321ea0c1736de9@mail.gmail.com> Message-ID: <5f07325f0810081525y779cae75ta1aa804e2c4c5772@mail.gmail.com> Well, I'm in the U.S. I don't mean to paint with too broad a stroke here, but my comments reflect my own experience with development projects where people end up focusing so much on tools or trendy methods (like UML and the Rational Unified Process) that they don't stop and ask themselves what problem they're trying to solve. Here's an example: in HL7 (an application protocol frequently used in healthcare applications) there is often an implicit assumption that messages will be received in the order sent with no dropped or duplicate messages. That's often an appropriate constraint, but sometimes each message together with its acknowledgment is an independent unit of work, and there is no reason messages of a certain type cannot be delivered out of order. Now, message delivery can often be slow (as you can imagine it would be, given the stop and waith protocol being employed). I've suggested dropping the sequenced delivery constraint, or at the very least, allowing a send window of more than one message in certain performance critical applications. Now, I understand the importance of having a consistent architecture and of being able to use "off the shelf" software. But there are times when I just wish people could stop and think about the problem and consider a relatively simple software solution instead of investing in bandwidth with a new PVC (and note that bandwidth isn't evn the problem here, it's latency!) or investing in a product that isn't really needed. Okay, I'll stop now (and wait). On Wed, Oct 8, 2008 at 2:54 PM, Grant Rettke wrote: > On Tue, Oct 7, 2008 at 11:33 AM, Greg Woodhouse > wrote: > > I'm sure that all has to do with the perception (perhaps valid) that > knowing > > C is an essential job skill. But remember that these are first year > > students: > > Since when do first year students get a say in anything?! > > > What bothers me is that professional developers focus so much on tools > and > > languages without really thinking critically about the problems they are > > trying to solve. > > Is this in the entire world, or just the U.S.A.? > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081008/aed0e7c1/attachment.htm From sk at cs.brown.edu Wed Oct 8 19:36:30 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:30:14 2009 Subject: [plt-scheme] Re: When does eqv? differ from eq? , from equal? In-Reply-To: <756daca50810081454i22b86884ta321ea0c1736de9@mail.gmail.com> References: <5FF8AD313C054C0B815FBCACDCC18947@uw2b2dff239c4d> <0E399D8C-A0D8-473E-8696-4AD39E914763@ccs.neu.edu> <49F3A6007716493DAAA815F70623AC74@uw2b2dff239c4d> <34A34D44-F771-4624-B6F4-43FD5D702A77@ccs.neu.edu> <756daca50810070828j24f5ef58x14eb95006d1a71de@mail.gmail.com> <5f07325f0810070933h4c35bc86u556281d271b10047@mail.gmail.com> <756daca50810081454i22b86884ta321ea0c1736de9@mail.gmail.com> Message-ID: Hey, folks: Matthew Flatt said, Can we please move this thread to comp.lang.scheme? I suggest we respect his wish given how far this has strayed from having anything to do with plt-scheme. Thanks, Shriram On Wed, Oct 8, 2008 at 4:54 PM, Grant Rettke wrote: > On Tue, Oct 7, 2008 at 11:33 AM, Greg Woodhouse > wrote: >> I'm sure that all has to do with the perception (perhaps valid) that knowing >> C is an essential job skill. But remember that these are first year >> students: > > Since when do first year students get a say in anything?! > >> What bothers me is that professional developers focus so much on tools and >> languages without really thinking critically about the problems they are >> trying to solve. > > Is this in the entire world, or just the U.S.A.? > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From morazanm at gmail.com Thu Oct 9 00:28:18 2008 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:30:15 2009 Subject: [plt-scheme] world.ss ke=? Message-ID: <9b1fff280810082128j57e0d9dfj225d605a8746f1f0@mail.gmail.com> Dear All, In the world.ss documentation I see: (ke=? x y) $B"*(B boolean? x : key-event? y : key-event? compares two KeyEvent for equality DrScheme, however, complains about referencing an identifier before its definition: > ke=? reference to an identifier before its definition: ke=? The world.ss teachpack has been added. Has ke=? been renamed? If so, what is it called now? If not, a combination of char?, char=?, symbol?, and symbol=? works, but is much more cumbersome. Any pointers will be appreciated. -- Cheers, Marco From noelwelsh at gmail.com Thu Oct 9 03:08:24 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:30:15 2009 Subject: [plt-scheme] define-values/invoke-unit in an internal definition context Message-ID: I'm trying to abstract over both macros and normal values, but having a problem that define-values/invoke-unit doesn't seem to work in a local definition context. A simple example is below. Reading the code is perhaps easier than explaining in words what I'm doing, so I won't go into detail here. Can anyone tell me how to get it working? Thanks, Noel #lang scheme/base (require (for-syntax scheme/base) scheme/unit (planet schematics/schemeunit:3)) (define-signature sig^ (a b c)) (define unit@ (unit (import) (export sig^) (define a 0) (define b 1) (define c 2))) (define-syntax macro1 (syntax-rules () [(_) (display "hello")])) (define-syntax macro2 (syntax-rules () [(_) (display "o hai")])) ;; Here we abstract over macros and the unit (define-syntax use-unit@ (syntax-rules () [(_ macro) ((lambda (unit) (define-values/invoke-unit unit (import) (export sig^)) (macro) (printf " ~a ~a ~a\n" a b c)))])) '((use-unit@ macro1) unit@) ((use-unit@ macro2) unit@) From sk at cs.brown.edu Thu Oct 9 08:20:29 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:30:15 2009 Subject: [plt-scheme] Re: [plt-edu] world.ss ke=? In-Reply-To: <9b1fff280810082128j57e0d9dfj225d605a8746f1f0@mail.gmail.com> References: <9b1fff280810082128j57e0d9dfj225d605a8746f1f0@mail.gmail.com> Message-ID: key=? 2008/10/8 Marco Morazan : > Dear All, > > In the world.ss documentation I see: > > (ke=? x y) $B"*(B boolean? > > x : key-event? > > y : key-event? > > compares two KeyEvent for equality > > > DrScheme, however, complains about referencing an identifier before > its definition: > >> ke=? > reference to an identifier before its definition: ke=? > > The world.ss teachpack has been added. Has ke=? been renamed? If so, > what is it called now? If not, a combination of char?, char=?, > symbol?, and symbol=? works, but is much more cumbersome. Any pointers > will be appreciated. > > -- > > Cheers, > > Marco > _________________________________________________ > PLT Educators mailing list > plt-edu@list.cs.brown.edu > http://list.cs.brown.edu/mailman/listinfo/plt-edu > From mflatt at cs.utah.edu Thu Oct 9 09:03:54 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:30:15 2009 Subject: [plt-scheme] define-values/invoke-unit in an internal definition context In-Reply-To: References: Message-ID: <20081009130355.74B5E6500B1@mail-svr1.cs.utah.edu> Looks like a macro-expander bug to me. A few weeks ago, I adjusted the way that identifier bindings are determined in internal-definition contexts, and that change appears to be interacting badly with the `unit' macros in this case. I'll have to investigate more. Matthew At Thu, 9 Oct 2008 08:08:24 +0100, "Noel Welsh" wrote: > I'm trying to abstract over both macros and normal values, but having > a problem that define-values/invoke-unit doesn't seem to work in a > local definition context. A simple example is below. Reading the > code is perhaps easier than explaining in words what I'm doing, so I > won't go into detail here. Can anyone tell me how to get it working? > > Thanks, > Noel > > > #lang scheme/base > > (require (for-syntax scheme/base) > scheme/unit > (planet schematics/schemeunit:3)) > > (define-signature sig^ (a b c)) > > (define unit@ > (unit > (import) > (export sig^) > > (define a 0) > (define b 1) > (define c 2))) > > (define-syntax macro1 > (syntax-rules () > [(_) (display "hello")])) > > (define-syntax macro2 > (syntax-rules () > [(_) (display "o hai")])) > > ;; Here we abstract over macros and the unit > (define-syntax use-unit@ > (syntax-rules () > [(_ macro) > ((lambda (unit) > (define-values/invoke-unit unit (import) (export sig^)) > (macro) (printf " ~a ~a ~a\n" a b c)))])) > > '((use-unit@ macro1) unit@) > ((use-unit@ macro2) unit@) > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From morazanm at gmail.com Thu Oct 9 09:05:40 2008 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:30:15 2009 Subject: [plt-scheme] Re: [plt-edu] world.ss ke=? In-Reply-To: References: <9b1fff280810082128j57e0d9dfj225d605a8746f1f0@mail.gmail.com> Message-ID: <9b1fff280810090605m2dd05947w3cac1e09d4770da5@mail.gmail.com> Thanks Danny and Shriram. Works like a charm! :-) While on this, would it be a little simpler to treat all keystrokes as either all chars xor all symbols? As it is now, the arrows are symbols and the other keys are chars. Some of my (weaker) students seem stressed over this and anything to make their life easier helps. Cheers, Marco 2008/10/9 Shriram Krishnamurthi : > key=? > > 2008/10/8 Marco Morazan : >> Dear All, >> >> In the world.ss documentation I see: >> >> (ke=? x y) $B"*(B boolean? >> >> x : key-event? >> >> y : key-event? >> >> compares two KeyEvent for equality >> >> >> DrScheme, however, complains about referencing an identifier before >> its definition: >> >>> ke=? >> reference to an identifier before its definition: ke=? >> >> The world.ss teachpack has been added. Has ke=? been renamed? If so, >> what is it called now? If not, a combination of char?, char=?, >> symbol?, and symbol=? works, but is much more cumbersome. Any pointers >> will be appreciated. >> >> -- >> >> Cheers, >> >> Marco >> _________________________________________________ >> PLT Educators mailing list >> plt-edu@list.cs.brown.edu >> http://list.cs.brown.edu/mailman/listinfo/plt-edu >> > -- Cheers, Marco From cce at ccs.neu.edu Thu Oct 9 09:23:37 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:30:15 2009 Subject: [plt-scheme] Re: [plt-edu] world.ss ke=? In-Reply-To: <9b1fff280810090605m2dd05947w3cac1e09d4770da5@mail.gmail.com> References: <9b1fff280810082128j57e0d9dfj225d605a8746f1f0@mail.gmail.com> <9b1fff280810090605m2dd05947w3cac1e09d4770da5@mail.gmail.com> Message-ID: <990e0c030810090623u64d9efebud511716891a4b1a4@mail.gmail.com> 2008/10/9 Marco Morazan : > > While on this, would it be a little simpler to treat all keystrokes as > either all chars xor all symbols? As it is now, the arrows are symbols > and the other keys are chars. Some of my (weaker) students seem > stressed over this and anything to make their life easier helps. Some applications need that distinction. We had a student here write a simple text editor, for which he needed to distinguish "typing" keystrokes (characters) from "navigation" keystrokes (symbols). It would be hard to make that distinction if they were all symbols (or characters, or strings); as it is, we give students both a predicate and a template to help with it. On the other hand, an "on-typing-event" hook that processed only the character keystrokes, for applications that didn't need the symbols, might allow some choice of the level of complexity. Pro: the simplest key-processing program becomes simpler. Con: the World API becomes more complex due to the either-or event handlers. -- Carl Eastlund From andre at het.brown.edu Wed Oct 8 17:37:32 2008 From: andre at het.brown.edu (Andre van Tonder) Date: Thu Mar 26 02:30:15 2009 Subject: [plt-scheme] SRFI 41 In-Reply-To: References: <209967.29400.qm@web31107.mail.mud.yahoo.com> Message-ID: The typing you describe is in fact consistent with that of ordinary (R5RS) member, which does not end in a question mark. On Wed, 8 Oct 2008, Phil Bewig wrote: > The definition of stream-member given in the text of SRFI-41 is incorrect. > The problem is inconsistent typing: one branch of the cond returns #f, which > is not a stream, while another branch of the cond returns strm, which is a > stream. Here is a definition of stream-member? which returns either #t or > #f; it uses normal define, not stream-define, and normal let, not > stream-let: > > (define (stream-member? eql? obj strm) > (let loop ((strm strm)) > (cond ((stream-null? strm) #f) > ((eql? (stream-car strm) obj) #t) > (else (loop (stream-cdr strm)))))) > > Given that, (stream-member? equal? 'c (stream 'a 'b)) evaluates to #f, as > you expect. > > Another definition of stream-member, the one that was intended by SRFI-41, > is: > > (define-stream (stream-member eql? obj strm) > (stream-let loop ((strm strm)) > (cond ((stream-null? strm) (stream #f)) > ((eql? obj (stream-car strm)) strm) > (else (loop (stream-cdr strm)))))) > > That definition type-checks because both branches of the cond evaluate to a > stream. Given that definition, (stream-car (stream-member equal? 'c (stream > 'a 'b))) evaluates to #f, and (stream-car (stream-member equal? 'a (stream > 'a 'b))) evaluates to a. > > Note that stream-member is not defined in SRFI-41; it is just an example in > the text (worse, it is an incorrect example in the text). If PLT includes > stream-member in its version of SRFI-41, that is an extension of SRFI-41. > If PLT wants to extend SRFI-41, it would be better to define the library in > such a way that it is loaded by (require srfi/41-extended-by-PLT) or some > such mechanism. By taking the liberty of extending the base definition of > SRFI-41, PLT confuses users and makes code written using its extended > version of SRFI-41 non-portable to other Scheme systems that adhere to > SRFI-41 as it is written. > > I will forward this note to the SRFI-41 mailing list. > > Phil > > On Wed, Oct 8, 2008 at 1:11 PM, michael rice wrote: > >> There's a stream-member function given in SRFI 41 that doesn't seem to >> work as expected. >> >> ================= >> >> (require srfi/41) >> >> (define s1 (stream-cons 'a (stream-cons 'b stream-null))) >> >> (define-stream (stream-member eql? obj strm) >> (stream-let loop ((strm strm)) >> (cond ((stream-null? strm) #f) >> ((eql? obj (stream-car strm)) strm) >> (else (loop (stream-cdr strm)))))) >> >> =================== >> >> Welcome to DrScheme, version 4.1 [3m]. >> Language: Swindle; memory limit: 128 megabytes. >>> (stream-member equal? 'c s1) >> # >>> >> >> =================== >> >> Shouldn't the answer be #f? >> >> Michael >> >> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> > From REBELSKY at Grinnell.EDU Thu Oct 9 11:12:46 2008 From: REBELSKY at Grinnell.EDU (Samuel Rebelsky) Date: Thu Mar 26 02:30:16 2009 Subject: [plt-scheme] If expressions in Embedded PLT Scheme In-Reply-To: <990e0c030810081014leb641eewbf7c816b62811df6@mail.gmail.com> References: <67D22FA7-7C38-4123-B0B8-97E32105B029@grinnell.edu> <990e0c030810081014leb641eewbf7c816b62811df6@mail.gmail.com> Message-ID: <02045722-D782-47EF-B52A-3B0EE6E09BDD@Grinnell.EDU> Clearly, I wasn't clear. So, let's try again: (1) I've embedded PLT Scheme (previously MzScheme) in an application. (2) The application is being used with a number of "legacy" Scheme files, some of which I don't have permission to modify. (Others also use the application, so I don't even know about all of the files.) (3) Those "legacy" Scheme files often use the two-parameter (no- alternative) if. I'm trying to deal with #3 in the context of #2 and #1. * Because of #2, I can't replace "if" by "when". * Because of #2, I can't just put "#lang mzscheme" at the top of the Scheme programs. * In the embedded PLT Scheme application, there are also calls to "inside PLT" C functions like scheme_apply and scheme_eval_string; I'm not sure how to put "#lang mzscheme" in those. I'm attaching a sample application (which is much simpler than the real application; I can't just rewrite everything in Scheme). Are there suggestions of what I could add/change to make it happily load the "legacy" Scheme files, many of which use the "no-alternative" form of "if"? Note that I've tried making copies of the Scheme files and adding "#lang mzscheme" to the top. However, then the embedded intepreter does't seem to have access to the procedures defined in the file. Thanks! -- Sam Rebelsky --- START OF PROGRAM CODE --- /* sample.c Given a Scheme "program" with a main procedure, loads that program and applies the procedure named 'main' to the values given on the command line (including the name of the scheme program). Compiling: Requires -lmzscheme -lmzgc -ldl -lm */ #include #include #include int main (int argc, char **argv) { Scheme_Env *e; mz_jmp_buf * volatile save, fresh; scheme_set_stack_base (NULL, 1); /* Set up the Scheme environment. */ e = scheme_basic_env (); scheme_set_collects_path (scheme_make_path ("/usr/local/plt/lib/plt/ collects")); scheme_init_collection_paths (e, scheme_null); scheme_namespace_require (scheme_intern_symbol ("scheme/base")); /* Set up application-specific stuff. */ /* Elided. */ /* Prepare to execute code. */ save = scheme_current_thread->error_buf; scheme_current_thread->error_buf = &fresh; if (scheme_setjmp (scheme_error_buf)) { /* It failed. Give up. */ exit (1); } else { int i; Scheme_Object **args; Scheme_Object *result; /* Load the Scheme file. */ scheme_load (argv[1]); /* Build the list of actual parameters. */ args = malloc ((argc-1) * sizeof (Scheme_Object *)); for (i = 1; i < argc; i++) { args[i-1] = scheme_make_locale_string (argv[i]); } /* for */ /* Apply the main procedure, and print the result. */ result = scheme_apply (scheme_eval_string ("main", e), (argc-1), args); printf ("%s\n", scheme_display_to_string (result, NULL)); } exit (0); } /* main */ ---- END OF PROGRAM CODE ---- On Oct 8, 2008, at 12:14 PM, Carl Eastlund wrote: > If you use "when" in place of "if", you'll get the one-clause if > behavior, or you can use the legacy mzscheme behavior by putting > "#lang mzscheme" at the top of your program (instead of "#lang > scheme"). > > --Carl From grettke at acm.org Thu Oct 9 11:17:08 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:30:16 2009 Subject: [plt-scheme] If expressions in Embedded PLT Scheme In-Reply-To: <02045722-D782-47EF-B52A-3B0EE6E09BDD@Grinnell.EDU> References: <67D22FA7-7C38-4123-B0B8-97E32105B029@grinnell.edu> <990e0c030810081014leb641eewbf7c816b62811df6@mail.gmail.com> <02045722-D782-47EF-B52A-3B0EE6E09BDD@Grinnell.EDU> Message-ID: <756daca50810090817v14df1d8fyc1c91b01949b60d5@mail.gmail.com> On Thu, Oct 9, 2008 at 10:12 AM, Samuel Rebelsky wrote: > (2) The application is being used with a number of "legacy" Scheme files, > some of which I don't have permission to modify. (Others also use the > application, so I don't even know about all of the files.) > > (3) Those "legacy" Scheme files often use the two-parameter (no-alternative) > if. Sounds like the best option for you is to add one armed 'if' back to the language. From morazanm at gmail.com Thu Oct 9 12:12:46 2008 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:30:16 2009 Subject: [plt-scheme] Re: [plt-edu] world.ss ke=? In-Reply-To: <990e0c030810090623u64d9efebud511716891a4b1a4@mail.gmail.com> References: <9b1fff280810082128j57e0d9dfj225d605a8746f1f0@mail.gmail.com> <9b1fff280810090605m2dd05947w3cac1e09d4770da5@mail.gmail.com> <990e0c030810090623u64d9efebud511716891a4b1a4@mail.gmail.com> Message-ID: <9b1fff280810090912l7c403397ha1ef0ba3d437188@mail.gmail.com> Hi Carl, On Thu, Oct 9, 2008 at 9:23 AM, Carl Eastlund wrote: > > Some applications need that distinction. We had a student here write > a simple text editor, for which he needed to distinguish "typing" > keystrokes (characters) from "navigation" keystrokes (symbols). It > would be hard to make that distinction if they were all symbols (or > characters, or strings); as it is, we give students both a predicate > and a template to help with it. > Hmm....I can see the need. However, if all symbols (or whatever) for keystrokes are unique then distinguishing is not that difficult. Some symbols are typing keystrokes and some symbols are navigation keystrokes. So, I guess I am not following how making the distinction is hard. In any case, it is a suggestion to think about. I will get my students over this minor hump. Thanks for responding. -- Cheers, Marco From REBELSKY at Grinnell.EDU Thu Oct 9 19:23:21 2008 From: REBELSKY at Grinnell.EDU (Samuel Rebelsky) Date: Thu Mar 26 02:30:16 2009 Subject: [plt-scheme] If expressions in Embedded PLT Scheme In-Reply-To: <756daca50810090817v14df1d8fyc1c91b01949b60d5@mail.gmail.com> References: <67D22FA7-7C38-4123-B0B8-97E32105B029@grinnell.edu> <990e0c030810081014leb641eewbf7c816b62811df6@mail.gmail.com> <02045722-D782-47EF-B52A-3B0EE6E09BDD@Grinnell.EDU> <756daca50810090817v14df1d8fyc1c91b01949b60d5@mail.gmail.com> Message-ID: <68DAED16-284F-4E5E-AC08-0920EBAF120B@Grinnell.EDU> So, we're back to a variant of the question: How does one tell an embedded PLT Scheme interpreter (as described in http://docs.plt-scheme.org/inside/) to use a different variant of Scheme (e.g., the legacy MzScheme) or to permit "one-armed 'if""? It strikes me that some sort of "backwards compatibility" mode should be available. Thanks! -- Sam Rebelsky On Oct 9, 2008, at 10:17 AM, Grant Rettke wrote: > On Thu, Oct 9, 2008 at 10:12 AM, Samuel Rebelsky > wrote: >> (2) The application is being used with a number of "legacy" Scheme >> files, >> some of which I don't have permission to modify. (Others also use >> the >> application, so I don't even know about all of the files.) >> >> (3) Those "legacy" Scheme files often use the two-parameter (no- >> alternative) >> if. > > Sounds like the best option for you is to add one armed 'if' back to > the language. From eli at barzilay.org Thu Oct 9 20:26:13 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:30:16 2009 Subject: [plt-scheme] If expressions in Embedded PLT Scheme In-Reply-To: <68DAED16-284F-4E5E-AC08-0920EBAF120B@Grinnell.EDU> References: <67D22FA7-7C38-4123-B0B8-97E32105B029@grinnell.edu> <990e0c030810081014leb641eewbf7c816b62811df6@mail.gmail.com> <02045722-D782-47EF-B52A-3B0EE6E09BDD@Grinnell.EDU> <756daca50810090817v14df1d8fyc1c91b01949b60d5@mail.gmail.com> <68DAED16-284F-4E5E-AC08-0920EBAF120B@Grinnell.EDU> Message-ID: <18670.41253.899336.737546@arabic.ccs.neu.edu> On Oct 9, Samuel Rebelsky wrote: > So, we're back to a variant of the question: How does one tell an > embedded PLT Scheme interpreter (as described in > http://docs.plt-scheme.org/inside/) to use a different variant of > Scheme (e.g., the legacy MzScheme) or to permit "one-armed 'if""? > It strikes me that some sort of "backwards compatibility" mode > should be available. If the code is in modules, you should just use (or keep using) `mzscheme' as the language for the module; if it's toplevel code, then you should require the `mzscheme' module into the toplevel namespace. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From technorapture at gmail.com Thu Oct 9 21:40:01 2008 From: technorapture at gmail.com (Shrutarshi Basu) Date: Thu Mar 26 02:30:17 2009 Subject: [plt-scheme] Binary tree Traversals Message-ID: <376fbdcf0810091840m5e63174fn502a89f8b1ddf99c@mail.gmail.com> I've written some scheme code for traversing binary trees. Here is my code: (define (atom? x) (not (pair? x))) ;;Functions to manipulate a binary tree (define (leaf? node) (atom? node)) (define (left node) (cadr node)) (define (right node) (caddr node)) (define (label node) (if (leaf? node) node (car node))) ;; Preorder Traversal (define (pre-order node) (cons (label node) (if (leaf? node) '() (append (pre-order (left node)) (pre-order (right node)))))) ;;Post-order traversal (define (post-order node) (list (if (leaf? node) '() (append (post-order (left node)) (post-order (right node)))) (label node))) ;;in-order traversal (define (in-order node) (if (leaf? node) (label node) (list (in-order (left node)) (cons (label node) (in-order (right node)))))) (define tree '(A (B C D)(E (F G H) I))) (pre-order tree) (post-order tree) (in-order tree) Though they do work, the post and in-order traversals output as deeply nested lists and not a simple flat list. Can someone how to get results in flattened lists (without running a separate flatten routine on the returned results)? Thanks Basu -- The ByteBaker : http://www.bytebaker.com From DekuDekuplex at Yahoo.com Thu Oct 9 23:26:30 2008 From: DekuDekuplex at Yahoo.com (Benjamin L.Russell) Date: Thu Mar 26 02:30:17 2009 Subject: [plt-scheme] hint for debugging file navigator freezing bug in DrScheme 4.1.1, english, on Windows XP Professional, Service Pack 2 Message-ID: <4lhte4hs754lbvg9srag91ndi6lkialgkf@4ax.com> As has already been discussed on this mailing list, there remains a bug in DrScheme on Windows XP Professional, Service Pack 2, that periodically causes the file navigator (the dialog box that opens to navigate directories whenever opening or saving a file) to freeze for a few seconds when navigating directories. It has been causing much frustration when saving files in a busy, time-pressured environment. This bug has been persisting since at least v372, and has not yet been resolved in v4.1.1, either. This is the problem: In DrScheme on Windows XP Professional, Service Pack 2, when I try to open or save a file and need to navigate through a folder hierarchy, at first the file navigator seems to work fine. But after navigating through, say, five or six directories, suddenly the file navigator will freeze and not respond to mouse input for several seconds (the exact number of seconds varies between three to eleven or so seconds). Then it will respond again, only to freeze again in the same manner after several more seconds. This causes much pain and grief when rushing to save files before running to catch the train on my way back home from work (I often study programming in my spare time after work before running home), and can cause a risk of missing the train if the freezing becomes too severe. Previously, discussion of this bug had led to the hypothesis that perhaps it had been caused by Windows itself as a result of navigating through local folders on a networked computer. However, two days ago, I happened to install and try out a very similar programming tool, newLISP v.9.4.5, which has an almost identical file navigator, and discovered that that tool does not freeze under the same conditions. Therefore, it seems that this bug is not caused by Windows. Therefore, apparently it must be some kind of bug in DrScheme itself. Given that the same bug does not occur in a very similar file navigator in a very similar programming tool for a very similar language, newLISP v.9.4.5, can anybody use this information to figure out a way to debug this bug? Is there any process in DrScheme that runs periodically every few seconds that could cause the file navigator to freeze for several seconds on Windows XP, Service Pack 2? I enjoy working with DrScheme, and would work with it more if I didn't have to worry about losing time repeatedly (and possibly missing a train) because of this frustrating file navigator bug. -- Benjamin L. Russell From eli at barzilay.org Thu Oct 9 23:42:42 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:30:17 2009 Subject: [plt-scheme] hint for debugging file navigator freezing bug in DrScheme 4.1.1, english, on Windows XP Professional, Service Pack 2 In-Reply-To: <4lhte4hs754lbvg9srag91ndi6lkialgkf@4ax.com> References: <4lhte4hs754lbvg9srag91ndi6lkialgkf@4ax.com> Message-ID: <18670.53042.500490.297479@arabic.ccs.neu.edu> On Oct 10, Benjamin L.Russell wrote: > > Previously, discussion of this bug had led to the hypothesis that > perhaps it had been caused by Windows itself as a result of > navigating through local folders on a networked computer. That still sounds like the most likely option -- the save dialog on Windows is the standard Windows dialog, and while the dialog is up, there is no Scheme code that does anything with it. Now, it might be that things are setup in a way that causes such delays. But to be able to start debugging it, we need some practical way to recreate the problem. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From rflug05 at gmail.com Thu Oct 9 23:54:49 2008 From: rflug05 at gmail.com (Nick Allen) Date: Thu Mar 26 02:30:17 2009 Subject: [plt-scheme] Schemers in India? Message-ID: Hello, I'm a Common Lisper trying to learn about PLT on the rare occasions that I have any free time. I'm an American (bay area) but am working in Bangalore until the beginning of November. If there are any Schemers in Bangalore, Chennai, or Hyderabad ping me and let's schedule a meetup! Cheers! Nick From DekuDekuplex at Yahoo.com Fri Oct 10 01:11:32 2008 From: DekuDekuplex at Yahoo.com (Benjamin L.Russell) Date: Thu Mar 26 02:30:17 2009 Subject: [plt-scheme] Re: hint for debugging file navigator freezing bug in DrScheme 4.1.1, english, on Windows XP Professional, Service Pack 2 References: <4lhte4hs754lbvg9srag91ndi6lkialgkf@4ax.com> <4lhte4hs754lbvg9srag91ndi6lkialgkf-e09XROE/p8c@public.gmane.org> <18670.53042.500490.297479@arabic.ccs.neu.edu> Message-ID: <0lmte4tmen55amedhp121goon9tsbbnl5f@4ax.com> On Thu, 9 Oct 2008 23:42:42 -0400, Eli Barzilay wrote: >On Oct 10, Benjamin L.Russell wrote: >> >> Previously, discussion of this bug had led to the hypothesis that >> perhaps it had been caused by Windows itself as a result of >> navigating through local folders on a networked computer. > >That still sounds like the most likely option -- the save dialog on >Windows is the standard Windows dialog, and while the dialog is up, >there is no Scheme code that does anything with it. Aha! That's why! I just visually compared the file navigators for DrScheme and newLISP, and discovered that while the navigator for DrScheme is the standard Windows dialog, the one for newLISP apparently seems a part of newLISP itself, and behaves as a separate window for a Windows application program. For example, the upper-left corner of the DrScheme navigator is just part of the title bar, but the upper-left corner of the newLISP navigator has a newLISP icon that behaves in exactly the same way as for a Windows application program, opening a sub-menu with such options as Restore, Move, Minimize, Maximize, Close, etc. when clicked (in particular, see the third snapshot below). Here are links to hosted snapshots of the three files: DrScheme file navigator snapshot: DrScheme_file_navigator_snapshot.20081010.1334.JPG http://www.sendmefile.com/00651026 newLISP file navigator snapshot (some of the titles are in Japanese, because it is running on a Japanese-localized version of Windows XP Professional, Service Pack 2, but since I had the same freezing problem before on an English-language version of Windows XP Professional on another computer, too, the localization cannot be the cause of the problem): newLISP_file_navigator_snapshot.20081010.1335.JPG http://www.sendmefile.com/00651027 newLISP file navigator with sub-menu opened snapshot: newLISP_file_navigator_with_sub-menu_opened_snapshot.20081010.1346.JPG http://www.sendmefile.com/00651029 Probably the newLISP developers ran into exactly the same problem with the Windows file navigator, and decided to re-create a non-buggy version of the file navigator to avoid this specific problem. Their navigator runs as a separate Windows application program, and not as the standard Windows dialog box. Somehow, this resolves the problem, and their file navigator does not hang. >Now, it might be that things are setup in a way that causes such >delays. But to be able to start debugging it, we need some practical >way to recreate the problem. To recreate the problem, just start DrScheme on Windows XP Professional, Service Pack 2, and start navigating through a dozen or so directories. At some point, your standard Windows navigator will suddenly freeze for a few seconds. Then try their custom file navigator (go to http://www.newlisp.org/index.cgi?page=Downloads, download and install newLISP, and try navigating through a dozen or so directories in their file navigator for comparison). In particular, click in the upper-left corner of both navigators: You'll notice that the difference is that your standard Windows file navigator will not respond to this input, but that their custom version will behave as a separate Windows application, and will open a sub-menu with such options as Restore, Move, Minimize, Maximize, Close, etc. Apparently, they aren't using the standard Windows file navigator. You probably need to avoid relying on the standard Windows file navigator to resolve this problem--that may be the reason for their choice of creating a custom file navigator. Basically, just create a separate dialog box that is part of DrScheme itself using the Windows API (do not use the (apparently buggy) standard Windows file navigator), and give it the same functionality as the newLISP file navigator, which has the same functionality as the Windows file navigator, sans the freezing bug. Voila`! Now you'll have a DrScheme file navigator that no longer freezes, and that allows convenient opening/saving of files! -- Benjamin L. Russell From DekuDekuplex at Yahoo.com Fri Oct 10 01:24:52 2008 From: DekuDekuplex at Yahoo.com (Benjamin L.Russell) Date: Thu Mar 26 02:30:17 2009 Subject: [plt-scheme] Re: hint for debugging file navigator freezing bug in DrScheme 4.1.1, english, on Windows XP Professional, Service Pack 2 References: <4lhte4hs754lbvg9srag91ndi6lkialgkf@4ax.com> <4lhte4hs754lbvg9srag91ndi6lkialgkf-e09XROE/p8c@public.gmane.org> <18670.53042.500490.297479@arabic.ccs.neu.edu> <0lmte4tmen55amedhp121goon9tsbbnl5f@4ax.com> Message-ID: On Fri, 10 Oct 2008 14:11:32 +0900, Benjamin L.Russell wrote: >[...] > >Basically, just create a >separate dialog box that is part of DrScheme itself using the Windows >API (do not use the (apparently buggy) standard Windows file >navigator), and give it the same functionality as the newLISP file >navigator, which has the same functionality as the Windows file >navigator, sans the freezing bug. I just thought of an even easier solution: Since their application is open-source and is licensed under the GNU GPL (Version 3), just copy and modify their source code for their navigator, and apply it to DrScheme. No need to reinvent the wheel! -- Benjamin L. Russell From diggerrrrr at gmail.com Fri Oct 10 05:13:29 2008 From: diggerrrrr at gmail.com (Veer) Date: Thu Mar 26 02:30:18 2009 Subject: [plt-scheme] TCP example not working Message-ID: The example below is given in the guide hangs around (read-line s-in) . (define server (tcp-listen 12345)) (define-values (c-in c-out) (tcp-connect "localhost" 12345)) (define-values (s-in s-out) (tcp-accept server)) (display "hello\n" c-out) (read-line s-in) (close-output-port c-out) (read-line s-in) My drscheme environment is: Welcome to DrScheme, version 4.1 [3m]. Language: Pretty Big. From chust at web.de Fri Oct 10 05:28:31 2008 From: chust at web.de (Thomas Chust) Date: Thu Mar 26 02:30:18 2009 Subject: [plt-scheme] Re: hint for debugging file navigator freezing bug in DrScheme 4.1.1, english, on Windows XP Professional, Service Pack 2 In-Reply-To: References: <4lhte4hs754lbvg9srag91ndi6lkialgkf@4ax.com> <4lhte4hs754lbvg9srag91ndi6lkialgkf-e09XROE/p8c@public.gmane.org> <18670.53042.500490.297479@arabic.ccs.neu.edu> <0lmte4tmen55amedhp121goon9tsbbnl5f@4ax.com> Message-ID: <48EF203F.8040007@web.de> Benjamin L.Russell schrieb: > On Fri, 10 Oct 2008 14:11:32 +0900, Benjamin L.Russell > wrote: > >> [...] >> >> Basically, just create a >> separate dialog box that is part of DrScheme itself using the Windows >> API (do not use the (apparently buggy) standard Windows file >> navigator), and give it the same functionality as the newLISP file >> navigator, which has the same functionality as the Windows file >> navigator, sans the freezing bug. > > I just thought of an even easier solution: Since their application is > open-source and is licensed under the GNU GPL (Version 3), just copy > and modify their source code for their navigator, and apply it to > DrScheme. No need to reinvent the wheel! > [...] Hello, newLISP renders its GUI using a server process written in Java. It would be close to impossible to integrate that approach with PLT's wxWidgets based GUI toolkit in a sensible way. And it would introduce a very heavy weight dependency. Furthermore, using the native file open dialog for whichever platform you're running on is usually a good idea. It improves integration with the rest of the operating system and using it doesn't feel awkward for the person in front of the screen... cu, Thomas From eli at barzilay.org Fri Oct 10 05:57:25 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:30:18 2009 Subject: [plt-scheme] TCP example not working In-Reply-To: References: Message-ID: <18671.9989.641663.35287@arabic.ccs.neu.edu> On Oct 10, Veer wrote: > The example below is given in the guide hangs around (read-line s-in) . > > (define server (tcp-listen 12345)) > (define-values (c-in c-out) (tcp-connect "localhost" 12345)) > (define-values (s-in s-out) (tcp-accept server)) > (display "hello\n" c-out) > (read-line s-in) > (close-output-port c-out) > (read-line s-in) You're right -- the problem is that nothing actually goes out on the connection because it is buffered. One way to make it work is to add (flush-output c-out) after the `display' line, and another is to move (close-output-port c-out) one line up to before the `read-line' (because closing the port also flushes it). I committed the last change to the guide. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From jos.koot at telefonica.net Fri Oct 10 07:12:44 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:30:18 2009 Subject: [plt-scheme] Binary tree Traversals References: <376fbdcf0810091840m5e63174fn502a89f8b1ddf99c@mail.gmail.com> Message-ID: <612B1EDBC4F549C8B3126BE4DA920A20@uw2b2dff239c4d> In post-order you use append in the wrong way. In in-order you use list, but you should use append here too. What type of arguments does append expect in order to act as you want? Jos ----- Original Message ----- From: "Shrutarshi Basu" To: Sent: Friday, October 10, 2008 3:40 AM Subject: [plt-scheme] Binary tree Traversals > I've written some scheme code for traversing binary trees. Here is my > code: > > > (define (atom? x) > (not (pair? x))) > > > ;;Functions to manipulate a binary tree > (define (leaf? node) (atom? node)) > (define (left node) (cadr node)) > (define (right node) (caddr node)) > (define (label node) (if (leaf? node) node (car node))) > > ;; Preorder Traversal > > (define (pre-order node) > (cons > (label node) > (if (leaf? node) > '() > (append > (pre-order (left node)) > (pre-order (right node)))))) > > ;;Post-order traversal > (define (post-order node) > (list > (if (leaf? node) '() > (append > (post-order (left node)) > (post-order (right node)))) > (label node))) > > ;;in-order traversal > (define (in-order node) > (if (leaf? node) (label node) > (list > (in-order (left node)) > (cons > (label node) > (in-order (right node)))))) > > (define tree '(A (B C D)(E (F G H) I))) > (pre-order tree) > (post-order tree) > (in-order tree) > > > > Though they do work, the post and in-order traversals output as deeply > nested lists and not a simple flat list. Can someone how to get > results in flattened lists (without running a separate flatten routine > on the returned results)? > Thanks > Basu > > -- > The ByteBaker : > http://www.bytebaker.com > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From jadudm at gmail.com Fri Oct 10 08:50:31 2008 From: jadudm at gmail.com (Matt Jadud) Date: Thu Mar 26 02:30:18 2009 Subject: [plt-scheme] How best to use PLaneT? Message-ID: Hi everyone, I generally find coding against PLaneT to be a frustrating experience. This is probably due to the way I use it. For this reason, it becomes a question of practice. Question: Should I always code against a specific library version? I find that if I code against (say) "instaservlet", I have to hope that the library maintainers do major revisions when things change substantially. I choose this example because, in late August, I wrote a script using this library. Since then, PLT Scheme went from 4.0.3 to 4.1.x. Instaservlet went from (1 3) to (1 7). Not long ago, while my server was live and running, it started throwing errors: instaservlet was failing in a live, running app. So, I blew away my cache and updated; this now is producing a stream of errors regarding scribble and other parts of the system. Obviously, I cannot use the most recent PLaneT packages on 4.0.3, because many of them have been updated for 4.1. In short, 4.0.3 is too old to interact with PLaneT at this point. At least, that seems to be the case with respect to some libraries. My solution seems to be to write my code using very explicit versions on PLaneT repository objects. (require (planet "instaservlet.ss" ("untyped" "instaservlet.plt" 1 (= 3)))) was the require statement I should have used. This prevents the library from moving underneath me, and means that if the library maintainer does not increment their library version with the language version (eg. version (1 6) should perhaps have become (2 0) to reflect the change from compatibility with PLT 4.0 to 4.1). So, that's the long story, and I believe the lesson I learned (or should have known) was "code against specific library versions." Should I have taken anything else away? Cheers, Matt From robby at cs.uchicago.edu Fri Oct 10 08:59:06 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:30:18 2009 Subject: [plt-scheme] How best to use PLaneT? In-Reply-To: References: Message-ID: <932b2f1f0810100559u541b19a0xfeb5539f7dbdb262@mail.gmail.com> I'm not sure this is really planet-specific, so much as it is a fact of life when writing programs that use other's programs that are changing over time. Planet does its best to help you avoid such problems with its versioning policy, but there is only so much it can do. One of the things we've been thinking about along these lines is including test suites in planet packages and then running them as the package is downloaded, refusing to install the package if the tests fail (as they probably would have in the cases you describe below). That's still a little while off, tho. In the meantime, I suggest that you first test before you deploy updates to at least avoid some of the frustration. Sorry, Robby On Fri, Oct 10, 2008 at 7:50 AM, Matt Jadud wrote: > Hi everyone, > > I generally find coding against PLaneT to be a frustrating experience. > This is probably due to the way I use it. For this reason, it becomes > a question of practice. > > Question: Should I always code against a specific library version? > > I find that if I code against (say) "instaservlet", I have to hope > that the library maintainers do major revisions when things change > substantially. I choose this example because, in late August, I wrote > a script using this library. Since then, PLT Scheme went from 4.0.3 to > 4.1.x. Instaservlet went from (1 3) to (1 7). Not long ago, while my > server was live and running, it started throwing errors: instaservlet > was failing in a live, running app. So, I blew away my cache and > updated; this now is producing a stream of errors regarding scribble > and other parts of the system. Obviously, I cannot use the most recent > PLaneT packages on 4.0.3, because many of them have been updated for > 4.1. > > In short, 4.0.3 is too old to interact with PLaneT at this point. At > least, that seems to be the case with respect to some libraries. > > My solution seems to be to write my code using very explicit versions > on PLaneT repository objects. > > (require (planet "instaservlet.ss" ("untyped" "instaservlet.plt" 1 (= 3)))) > > was the require statement I should have used. This prevents the > library from moving underneath me, and means that if the library > maintainer does not increment their library version with the language > version (eg. version (1 6) should perhaps have become (2 0) to reflect > the change from compatibility with PLT 4.0 to 4.1). > > So, that's the long story, and I believe the lesson I learned (or > should have known) was "code against specific library versions." > Should I have taken anything else away? > > Cheers, > Matt > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From grettke at acm.org Fri Oct 10 10:22:35 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:30:19 2009 Subject: [plt-scheme] How best to use PLaneT? In-Reply-To: References: Message-ID: <756daca50810100722l33e4a2bfw93770fc9a9df3dbc@mail.gmail.com> On Fri, Oct 10, 2008 at 7:50 AM, Matt Jadud wrote: > My solution seems to be to write my code using very explicit versions > on PLaneT repository objects. > > (require (planet "instaservlet.ss" ("untyped" "instaservlet.plt" 1 (= 3)))) > > was the require statement I should have used. This prevents the > library from moving underneath me To your point, yes you should be locking your version at the exact one you want! :) In PLT, this feature is sort of under-stated, or another way to put it is under-appreciated. You can't even do this in Java (yet). From jacobm at cs.uchicago.edu Fri Oct 10 11:07:03 2008 From: jacobm at cs.uchicago.edu (Jacob Matthews) Date: Thu Mar 26 02:30:19 2009 Subject: [plt-scheme] How best to use PLaneT? In-Reply-To: References: Message-ID: <46b603df0810100807o7da81dceg1f2bd398ea23a676@mail.gmail.com> On Fri, Oct 10, 2008 at 5:50 AM, Matt Jadud wrote: > Hi everyone, > > I generally find coding against PLaneT to be a frustrating experience. > This is probably due to the way I use it. For this reason, it becomes > a question of practice. > > Question: Should I always code against a specific library version? > > I find that if I code against (say) "instaservlet", I have to hope > that the library maintainers do major revisions when things change > substantially. I choose this example because, in late August, I wrote > a script using this library. Since then, PLT Scheme went from 4.0.3 to > 4.1.x. Instaservlet went from (1 3) to (1 7). Not long ago, while my > server was live and running, it started throwing errors: instaservlet > was failing in a live, running app. So, I blew away my cache and > updated; this now is producing a stream of errors regarding scribble > and other parts of the system. Obviously, I cannot use the most recent > PLaneT packages on 4.0.3, because many of them have been updated for > 4.1. > > In short, 4.0.3 is too old to interact with PLaneT at this point. At > least, that seems to be the case with respect to some libraries. > > My solution seems to be to write my code using very explicit versions > on PLaneT repository objects. > > (require (planet "instaservlet.ss" ("untyped" "instaservlet.plt" 1 (= 3)))) > > was the require statement I should have used. This prevents the > library from moving underneath me, and means that if the library > maintainer does not increment their library version with the language > version (eg. version (1 6) should perhaps have become (2 0) to reflect > the change from compatibility with PLT 4.0 to 4.1). I don't understand --- using that require line would've just meant you'd need to edit the code to fix the problem. Without it, blowing away cache _could_ have worked, and you can also march through all the versions of instaservlet from 1.4 to 1.7 to see if any of them solve the problem. In the specific case you're describing I don't see the advantage of changing the require line in the way you suggest. More generally, major-version increments are supposed to reflect interface changes, not PLT version compatibility changes. In this case the instaservlet library should've used the required-core-version facility to indicate that the newer version only supports v4.1; in fact they can still do that by adjusting its meta-information through the planet web page. (Though planet is not as smart as it could be on this front, for instance if package A depends on package B which has no versions that support v4.0, planet could conclude that package A doesn't support v4.0 either. It does not do so at present.) > So, that's the long story, and I believe the lesson I learned (or > should have known) was "code against specific library versions." > Should I have taken anything else away? This is always a trade-off. Whenever you allow multiple versions to satisfy the same requirement, there's the possibility that one of them will break something that the others don't. In the case of a program you're going to be running on your own web server, I actually wouldn't lock in a specific version in the code; I'd prefer using the commandline tool to install the particular version I wanted instead. It gets trickier when you're distributing code to others --- on the one hand, a new release of a third-party planet package might introduce a bug (which argues for locking in a particular version), but on the other hand it might fix one (which argues against locking in a particular version). As Robby says, judgment calls like these don't really have anything to do with planet, they're just a fact of using other peoples' code. I don't know of any general 'best' policy to apply in these situations. -jacob From jensaxel at soegaard.net Fri Oct 10 11:34:53 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:30:19 2009 Subject: [plt-scheme] How best to use PLaneT? In-Reply-To: References: Message-ID: <48EF761D.3000607@soegaard.net> Matt Jadud skrev: > Hi everyone, > > I generally find coding against PLaneT to be a frustrating experience. > This is probably due to the way I use it. For this reason, it becomes > a question of practice. > > Question: Should I always code against a specific library version? > That's what I do now. There is just one small catch (correct me if I am wrong - in fact I hop I am wrong): A program can only use one version of a PLaneT package at a time. This matters if you use library A and B, and library A uses a different version of library B than you do. -- Jens Axel S?gaard From robby at cs.uchicago.edu Fri Oct 10 11:40:39 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:30:19 2009 Subject: [plt-scheme] How best to use PLaneT? In-Reply-To: <48EF761D.3000607@soegaard.net> References: <48EF761D.3000607@soegaard.net> Message-ID: <932b2f1f0810100840t58b344ddjee29f3a74726ffa0@mail.gmail.com> On Fri, Oct 10, 2008 at 10:34 AM, Jens Axel Soegaard wrote: > Matt Jadud skrev: >> >> Hi everyone, >> >> I generally find coding against PLaneT to be a frustrating experience. >> This is probably due to the way I use it. For this reason, it becomes >> a question of practice. >> >> Question: Should I always code against a specific library version? >> > > That's what I do now. > > There is just one small catch (correct me if I am wrong - in fact I hop I am > wrong): > A program can only use one version of a PLaneT package at a time. > This matters if you use library A and B, and library A uses a different > version > of library B than you do. That is right by default. But a planet author can also declare that a planet package does not use any external state and thereby free the clients to have multiple versions instantiated at once. (Or, if you really really want to, you can also set up multiple namespaces. The constraint is one version per namespace.) Robby From noelwelsh at gmail.com Fri Oct 10 11:50:56 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:30:19 2009 Subject: [plt-scheme] How best to use PLaneT? In-Reply-To: <756daca50810100722l33e4a2bfw93770fc9a9df3dbc@mail.gmail.com> References: <756daca50810100722l33e4a2bfw93770fc9a9df3dbc@mail.gmail.com> Message-ID: On Fri, Oct 10, 2008 at 3:22 PM, Grant Rettke wrote: > To your point, yes you should be locking your version at the exact one > you want! :) All this is crazy talk. What you should do it live on the svn trunk and update packages as required. Of course it helps if 1) You're livin' the dream -- that is, spending most days programming in PLT Scheme 2) Maintaining most of the packages you use N. From cce at ccs.neu.edu Fri Oct 10 12:38:37 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:30:20 2009 Subject: [plt-scheme] How best to use PLaneT? In-Reply-To: <756daca50810100722l33e4a2bfw93770fc9a9df3dbc@mail.gmail.com> References: <756daca50810100722l33e4a2bfw93770fc9a9df3dbc@mail.gmail.com> Message-ID: <990e0c030810100938t11e06018qc33ed1a96bca461a@mail.gmail.com> On Fri, Oct 10, 2008 at 10:22 AM, Grant Rettke wrote: > On Fri, Oct 10, 2008 at 7:50 AM, Matt Jadud wrote: >> My solution seems to be to write my code using very explicit versions >> on PLaneT repository objects. >> >> (require (planet "instaservlet.ss" ("untyped" "instaservlet.plt" 1 (= 3)))) >> >> was the require statement I should have used. This prevents the >> library from moving underneath me > > To your point, yes you should be locking your version at the exact one > you want! :) Careful, that can still cause problems. If you demand *exactly* A:1.1, and A requires *at least* B:2.2, you can still get behavior changes when B releases 2.3. Basically, everything only "works" if you stay consistent with all your upstream suppliers: either everyone requiring *exact* minor numbers, or everyone allowing upgrades and also releasing only bug fixes as minor releases (and bumping the major number for every interface change, no matter how small). Since the Planet mechanism is designed specifically to support the latter approach, I currently think the best approach is to allow minor version upgrades, but to bump major numbers frequently and to put pressure on other package maintainers to do so (that is, if they release an interface change as a minor release, report it as a bug - because it is). If we have a schism, and two different interpretations of version numbers floating around, we're likely to build up all kinds of incompatibility. -- Carl Eastlund From jadudm at gmail.com Fri Oct 10 14:06:31 2008 From: jadudm at gmail.com (Matt Jadud) Date: Thu Mar 26 02:30:20 2009 Subject: [plt-scheme] How best to use PLaneT? In-Reply-To: References: <756daca50810100722l33e4a2bfw93770fc9a9df3dbc@mail.gmail.com> Message-ID: On Fri, Oct 10, 2008 at 11:50 AM, Noel Welsh wrote: > All this is crazy talk. What you should do it live on the svn trunk > and update packages as required. Of course it helps if > > 1) You're livin' the dream -- that is, spending most days programming > in PLT Scheme > 2) Maintaining most of the packages you use As much as I appreciate the wisdom Robby shared, and Jacob's experience as the primary author of PLaneT, I think Noel has it right. However, he forgot: 3) There is no three! Profit! ;) Many thanks, all. I sorta knew this too, but I surprised myself today by watching my script break in the way described. It was just sloppy practice, and I certainly was not attempting to pin things on PLaneT. Hearing what some other people here do was useful. Thanks, Matt From grettke at acm.org Fri Oct 10 14:19:11 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:30:20 2009 Subject: [plt-scheme] How best to use PLaneT? In-Reply-To: <990e0c030810100938t11e06018qc33ed1a96bca461a@mail.gmail.com> References: <756daca50810100722l33e4a2bfw93770fc9a9df3dbc@mail.gmail.com> <990e0c030810100938t11e06018qc33ed1a96bca461a@mail.gmail.com> Message-ID: <756daca50810101119n5b1e50a6v25f678276de3d59@mail.gmail.com> On Fri, Oct 10, 2008 at 11:38 AM, Carl Eastlund wrote: > On Fri, Oct 10, 2008 at 10:22 AM, Grant Rettke wrote: >> To your point, yes you should be locking your version at the exact one >> you want! :) > > Careful, that can still cause problems. If you demand *exactly* A:1.1, > and A requires *at least* B:2.2, you can still get behavior changes > when B releases 2.3. Basically, everything only "works" if you stay > consistent with all your upstream suppliers: either everyone requiring > *exact* minor numbers, or everyone allowing upgrades and also > releasing only bug fixes as minor releases (and bumping the major > number for every interface change, no matter how small). > > Since the Planet mechanism is designed specifically to support the > latter approach, "Component Deployment with PLaneT You Want it Where?" is required reading for anyone publishing to PLaneT: http://scheme2006.cs.uchicago.edu/04-matthews.pdf > I currently think the best approach is to allow minor > version upgrades, but to bump major numbers frequently and to put > pressure on other package maintainers to do so (that is, if they > release an interface change as a minor release, report it as a bug - > because it is). If we have a schism, and two different > interpretations of version numbers floating around, we're likely to > build up all kinds of incompatibility. That is, as the paper explains, the best possible model for some for a given audience. I prefer the model of linking against a single version of a library, testing it, and relying on it from here forward. Why allow for a supposedly compatible upgrade? If you didn't test that release, you can't count on it without testing, period. From cce at ccs.neu.edu Fri Oct 10 14:41:59 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:30:20 2009 Subject: [plt-scheme] How best to use PLaneT? In-Reply-To: <756daca50810101119n5b1e50a6v25f678276de3d59@mail.gmail.com> References: <756daca50810100722l33e4a2bfw93770fc9a9df3dbc@mail.gmail.com> <990e0c030810100938t11e06018qc33ed1a96bca461a@mail.gmail.com> <756daca50810101119n5b1e50a6v25f678276de3d59@mail.gmail.com> Message-ID: <990e0c030810101141i5067f7fepd3dee0178d3449ee@mail.gmail.com> On Fri, Oct 10, 2008 at 2:19 PM, Grant Rettke wrote: > On Fri, Oct 10, 2008 at 11:38 AM, Carl Eastlund wrote: > >> I currently think the best approach is to allow minor >> version upgrades, but to bump major numbers frequently and to put >> pressure on other package maintainers to do so (that is, if they >> release an interface change as a minor release, report it as a bug - >> because it is). If we have a schism, and two different >> interpretations of version numbers floating around, we're likely to >> build up all kinds of incompatibility. > > That is, as the paper explains, the best possible model for some for a > given audience. > > I prefer the model of linking against a single version of a library, > testing it, and relying on it from here forward. > > Why allow for a supposedly compatible upgrade? If you didn't test that > release, you can't count on it without testing, period. Absolutely. However, (a) we don't actually have a way to do that right now, (b) you can fool yourself by trying to fake it, and (c) I'll add that PLT Scheme is a changing language target; often packages are upgraded to keep up with the language, and a version that doesn't change with them becomes incompatible precisely because it won't upgrade. The last time that happened (a change to the contract library affected several planet packages I use) I started allowing automatic upgrades. I think it's important to understand both approaches, and I won't claim either is a 100% solution. Use whichever you think is best and be aware of its drawbacks. -- Carl Eastlund From grettke at acm.org Fri Oct 10 15:14:03 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:30:20 2009 Subject: [plt-scheme] How best to use PLaneT? In-Reply-To: <990e0c030810101141i5067f7fepd3dee0178d3449ee@mail.gmail.com> References: <756daca50810100722l33e4a2bfw93770fc9a9df3dbc@mail.gmail.com> <990e0c030810100938t11e06018qc33ed1a96bca461a@mail.gmail.com> <756daca50810101119n5b1e50a6v25f678276de3d59@mail.gmail.com> <990e0c030810101141i5067f7fepd3dee0178d3449ee@mail.gmail.com> Message-ID: <756daca50810101214s7dbb607axe1f5e1a288065521@mail.gmail.com> On Fri, Oct 10, 2008 at 1:41 PM, Carl Eastlund wrote: > On Fri, Oct 10, 2008 at 2:19 PM, Grant Rettke wrote: >> I prefer the model of linking against a single version of a library, >> testing it, and relying on it from here forward. > Absolutely. However, (a) we don't actually have a way to do that > right now, (b) you can fool yourself by trying to fake it Per another thread: you could do this manually by allowing PLT to download the desired versions into the cache, checking that code into version control (aka vendor branches), setting all of the dependencies to exact versions, and then installing that everywhere you deploy your app. It actually doesn't sound so bad when you think of it, at least if you care about guaranteeing the version. From domeshek at stottlerhenke.com Fri Oct 10 17:42:36 2008 From: domeshek at stottlerhenke.com (Eric Domeshek) Date: Thu Mar 26 02:30:20 2009 Subject: [plt-scheme] WXME Decoding Error Message-ID: <48EFCC4C.6000903@stottlerhenke.com> Hi Gang, I've been messing around with the MrEd GUI and the associated application framework in an attempt to quickly prototype a simple Entity-Relationship diagram editor. I've learned a lot about frames, pasteboards, snips, etc.--enough to get something basic running (with just a few display update bugs, about which, perhaps more some other time). But today I seem to have run into a bit of a brick wall in attempting to use the WXME encoding/decoding piece of the framework to save and reload my diagrams. I've gotten a far as saving the data (writing a file with seven types of custom snips). Unfortunately, I can't load the data back in, and the error message/trace is not helping me much. Here's what comes up in the console window when I try to load one of these saved files by invoking the default File|Open command: > insert-file in text%: error loading the file > > === context === > C:\PLT\collects\mred\private\editor.ss:168:35 > C:\PLT\collects\mred\private\editor.ss:162:29 > C:\PLT\collects\framework\private\frame.ss:1007:2 > C:\PLT\collects\scheme\private\class-internal.ss:2592:2: > continue-make-object > C:\PLT\collects\scheme\private\class-internal.ss:2592:2: > continue-make-object > C:\PLT\collects\scheme\private\class-internal.ss:2592:2: > continue-make-object > C:\PLT\collects\scheme\private\class-internal.ss:2514:4: make-object > C:\PLT\collects\framework\private\handler.ss:73:3 > ...amework/gui-utils.ss:391:8 > C:\PLT\collects\framework\private\handler.ss:202:0: open-recent-list-item > C:\PLT\collects\mred\private\mrmenu.ss:243:17: command method in > basic-selectable-menu-item% > C:\PLT\collects\scheme\private\more-scheme.ss:155:2: > call-with-break-parameterization > C:\PLT\collects\scheme\private\more-scheme.ss:260:2: > call-with-exception-handler > Can anyone suggest a way forward? For starters, I'm not sure why there's a text% floating around. I've only been dealing with pasteboard%s. If anyone is sufficiently interested, I can send the actual file that was written (and not read). Also, while I'm asking questions... As I read in my data, I need to create some custom structures that get wrapped inside my snips (i.e. "nodes" and "links" in an underlying graph structure). That custom data all needs to be attached to a diagram-level object (the "graph"). But I don't see how the read methods in my various snip-class%es can best get hold of the diagram object (which is stashed in the frame%, which holds the pasteboard%, which will contain the snip%s that get created by those snip-class% read methods). For now, I've got a pasteboard% on-load-file method setting a global variable so my various read methods can get hold of that shared diagram. This seem ugly. Any better ideas? Thanks, --Eric ========================================================================= Eric Domeshek Phone: 617-902-2223 AI Project Manager Fax: 617-902-2225 Stottler Henke Associates, Inc. EMail: domeshek@stottlerhenke.com 86 Sherman St., Cambridge, MA 02140 Web: www.stottlerhenke.com ========================================================================= From mflatt at cs.utah.edu Sat Oct 11 07:17:09 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:30:20 2009 Subject: [plt-scheme] define-values/invoke-unit in an internal definition context In-Reply-To: <20081009130355.74B5E6500B1@mail-svr1.cs.utah.edu> References: <20081009130355.74B5E6500B1@mail-svr1.cs.utah.edu> Message-ID: <20081011111711.4C3036500BD@mail-svr1.cs.utah.edu> Well, it's not a bug in the implementation. (Also, I now see that this code behaves the same way in older versions; I should have tried that in the first place.) Here's a slightly simplified version with the same problem: #lang scheme/base (require scheme/unit) (define-signature sig^ (a)) (define unit@ (unit (import) (export sig^) (define a 0))) (define-syntax use-unit@ (syntax-rules () [(_) (let () (define-values/invoke-unit unit@ (import) (export sig^)) (printf " ~a\n" a))])) (use-unit@) You might think that since `sig^' and `a' are introduced by the macro, the former effectively binds the latter. That would make sense if the elements of a signature were symbols, in which case they could take on the lexical context of the use of a signature. But signature elements are instead identifiers that already have their own lexical context. The `sig^' above acts more like a reference, and it pulls the original identifiers of the signature (i.e., without further "marking") into the expansion to create new bindings. The content of `sig^' consists of identifiers not introduced by the macro, so it fails to bind `a'. In other words, the above example is analogous to (define-syntax-rule (ex id) (let ([id 5]) a)) (ex a) which doesn't bind the `a' introduced by the macro. The only solution I see is to introduce `a' non-hygienically: (define-syntax (use-unit@ stx) (syntax-case stx () [(_) (with-syntax ([a (syntax-local-introduce #'a)]) #'(let () (define-values/invoke-unit unit@ (import) (export sig^)) (printf " ~a\n" a)))])) I'd be happier with a solution that made the original code work, but I don't yet see how to do that. Matthew At Thu, 9 Oct 2008 08:03:54 -0500, Matthew Flatt wrote: > Looks like a macro-expander bug to me. A few weeks ago, I adjusted the > way that identifier bindings are determined in internal-definition > contexts, and that change appears to be interacting badly with the > `unit' macros in this case. I'll have to investigate more. > > Matthew > > At Thu, 9 Oct 2008 08:08:24 +0100, "Noel Welsh" wrote: > > I'm trying to abstract over both macros and normal values, but having > > a problem that define-values/invoke-unit doesn't seem to work in a > > local definition context. A simple example is below. Reading the > > code is perhaps easier than explaining in words what I'm doing, so I > > won't go into detail here. Can anyone tell me how to get it working? > > > > Thanks, > > Noel > > > > > > #lang scheme/base > > > > (require (for-syntax scheme/base) > > scheme/unit > > (planet schematics/schemeunit:3)) > > > > (define-signature sig^ (a b c)) > > > > (define unit@ > > (unit > > (import) > > (export sig^) > > > > (define a 0) > > (define b 1) > > (define c 2))) > > > > (define-syntax macro1 > > (syntax-rules () > > [(_) (display "hello")])) > > > > (define-syntax macro2 > > (syntax-rules () > > [(_) (display "o hai")])) > > > > ;; Here we abstract over macros and the unit > > (define-syntax use-unit@ > > (syntax-rules () > > [(_ macro) > > ((lambda (unit) > > (define-values/invoke-unit unit (import) (export sig^)) > > (macro) (printf " ~a ~a ~a\n" a b c)))])) > > > > '((use-unit@ macro1) unit@) > > ((use-unit@ macro2) unit@) > > _________________________________________________ > > 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 mflatt at cs.utah.edu Sat Oct 11 07:39:23 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:30:21 2009 Subject: [plt-scheme] WXME Decoding Error In-Reply-To: <48EFCC4C.6000903@stottlerhenke.com> References: <48EFCC4C.6000903@stottlerhenke.com> Message-ID: <20081011113924.E6D086500BD@mail-svr1.cs.utah.edu> At Fri, 10 Oct 2008 17:42:36 -0400, Eric Domeshek wrote: > But today I seem to have run into a bit of a brick wall in attempting to > use the WXME encoding/decoding piece of the framework to save and reload > my diagrams. I've gotten a far as saving the data (writing a file with > seven types of custom snips). Unfortunately, I can't load the data back > in, and the error message/trace is not helping me much. Here's what > comes up in the console window when I try to load one of these saved > files by invoking the default File|Open command: > > > insert-file in text%: error loading the file > > > > [...] > > > Can anyone suggest a way forward? For starters, I'm not sure why > there's a text% floating around. I've only been dealing with > pasteboard%s. I don't have any great ideas, but you might try parsing the file using the `wxme' library, which might give better information about decoding problems. I'm puzzled by the "insert-file in text%" message, too. Looking at the source where that message can be reported, it seems to be always within a `text%' object, and never in a `pasteboard%'. If you're able and willing to send me code so I can see the problem on my machine, I would try it out. > Also, while I'm asking questions... As I read in my data, I need to > create some custom structures that get wrapped inside my snips (i.e. > "nodes" and "links" in an underlying graph structure). That custom data > all needs to be attached to a diagram-level object (the "graph"). But I > don't see how the read methods in my various snip-class%es can best get > hold of the diagram object (which is stashed in the frame%, which holds > the pasteboard%, which will contain the snip%s that get created by those > snip-class% read methods). For now, I've got a pasteboard% on-load-file > method setting a global variable so my various read methods can get hold > of that shared diagram. This seem ugly. Any better ideas? I'm not sure I understand, but I wonder whether the information should instead reside in the pasteboard so that it's written and restored though `write-editor-global-footer' and `read-editor-global-footer'? Matthew From aghuloum at cs.indiana.edu Sat Oct 11 13:03:27 2008 From: aghuloum at cs.indiana.edu (Abdulaziz Ghuloum) Date: Thu Mar 26 02:30:21 2009 Subject: [plt-scheme] define-values/invoke-unit in an internal definition context In-Reply-To: <20081011111711.4C3036500BD@mail-svr1.cs.utah.edu> References: <20081009130355.74B5E6500B1@mail-svr1.cs.utah.edu> <20081011111711.4C3036500BD@mail-svr1.cs.utah.edu> Message-ID: <852C0B97-88ED-42F8-A870-E6890A802DC1@cs.indiana.edu> On Oct 11, 2008, at 7:17 AM, Matthew Flatt wrote: > Well, it's not a bug in the implementation. (Also, I now see that this > code behaves the same way in older versions; I should have tried that > in the first place.) > > > Here's a slightly simplified version with the same problem: > > #lang scheme/base > > (require scheme/unit) > > (define-signature sig^ (a)) > > (define unit@ > (unit > (import) > (export sig^) > (define a 0))) > > (define-syntax use-unit@ > (syntax-rules () > [(_) > (let () > (define-values/invoke-unit unit@ (import) (export sig^)) > (printf " ~a\n" a))])) > > (use-unit@) > > You might think that since `sig^' and `a' are introduced by the macro, > the former effectively binds the latter. I would, yes (sorry for jumping in). > The `sig^' above acts more like a reference, and > it pulls the original identifiers of the signature (i.e., without > further "marking") into the expansion to create new bindings. The > content of `sig^' consists of identifiers not introduced by the macro, > so it fails to bind `a'. This is a problem because the identifiers introduced by that macro (or by sig^) will (1) not bind to identifiers that were introduced in the same macro step, and (2) bind identifiers that were *not* introduced by the macro step. So, it does exactly the opposite of what hygienic macros do. So, this works because the "a" introduced by sig^ is unmarked, and the "a" passed to use-unit@ is also unmarked. (define-syntax use-unit@ (syntax-rules () [(_ id) (let () (define-values/invoke-unit unit@ (import) (export sig^)) (printf " ~a\n" id))])) (use-unit@ a) Aziz,,, Side Note: Ikarus has an internal module form that was borrowed from Chez and is described in Oscar Waddel's dissertation. My implementation had a similar problem. This example, similar to the one on top using sigs has a macro that expands to an import and a reference. It didn't work at first but now it now correctly and produces a=12. (let () (module M (a) (define a 12)) (define-syntax f (syntax-rules () [(_) (let () (import M) (printf "a=~s\n" a))])) (f)) The counter example is the following where you have a macro that expands to an import wrapping an expression that contains module identifiers. This doesn't work now (and it shouldn't because import should be hygienic) but it used to work in the broken implementation of Ikarus. This is essentially how the use-unit@ macros works (above) and how it will break once the signatures are fixed. (let () (module M (a) (define a 12)) (define-syntax f (syntax-rules () [(_ id) (let () (import M) (printf "a=~s\n" id))])) (f a)) From barry at cs.sierracollege.edu Sat Oct 11 16:32:53 2008 From: barry at cs.sierracollege.edu (Barry Brown) Date: Thu Mar 26 02:30:21 2009 Subject: [plt-scheme] Porting DrScheme/MzScheme to Adobe Flex Message-ID: Has anyone looked into porting the DrScheme environment to Adobe Flex? If it were feasible, I see several major benefits: * Can run in a web browser. No software to download and install. * Can run as a standalone app (Adobe AIR). * Cross platform. Just one codebase to maintain. * Built-in access to rich audio, video, and graphics. * Access to multimedia peripherals, such as webcam and microphone. As of version 3.0, Adobe has open-sourced Flex. The Flex Builder Eclipse plug-in is free to educators and students. What would be the challenges to porting DrScheme to ActionScript, the JavaScript-like language that powers Flex/Flash? -B From sk at cs.brown.edu Sat Oct 11 16:40:54 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:30:21 2009 Subject: [plt-scheme] Porting DrScheme/MzScheme to Adobe Flex In-Reply-To: References: Message-ID: David Van Horn has a preliminary Beginner Scheme-to-JavaScript compiler. But a full-blown port is a very non-trivial effort. There are numerous features in PLT Scheme that have no straightforward counterpart in ActionScript or JavaScript or any other language. So the challenge would be in implementing all these features. Shriram From matthias at ccs.neu.edu Sat Oct 11 16:56:12 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:30:21 2009 Subject: [plt-scheme] Porting DrScheme/MzScheme to Adobe Flex In-Reply-To: References: Message-ID: <3ACA1929-FCC4-4FE3-8824-71F499541AAE@ccs.neu.edu> You may wish to consider a re-implementation. Start with Scheme Esquire (ICFP 1999, Flatt et al) and demo it it to the group. That would be real progress. -- Matthias On Oct 11, 2008, at 4:32 PM, Barry Brown wrote: > Has anyone looked into porting the DrScheme environment to Adobe > Flex? If it were feasible, I see several major benefits: > > * Can run in a web browser. No software to download and install. > * Can run as a standalone app (Adobe AIR). > * Cross platform. Just one codebase to maintain. > * Built-in access to rich audio, video, and graphics. > * Access to multimedia peripherals, such as webcam and microphone. > > As of version 3.0, Adobe has open-sourced Flex. The Flex Builder > Eclipse plug-in is free to educators and students. > > What would be the challenges to porting DrScheme to ActionScript, > the JavaScript-like language that powers Flex/Flash? > > -B > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From barry at cs.sierracollege.edu Sat Oct 11 16:59:44 2008 From: barry at cs.sierracollege.edu (Barry Brown) Date: Thu Mar 26 02:30:22 2009 Subject: [plt-scheme] Porting DrScheme/MzScheme to Adobe Flex In-Reply-To: References: Message-ID: <91138E50-5C57-4002-9190-4210264D32D1@cs.sierracollege.edu> I'm not talking about taking a Scheme program and compiling it down to JavaScript or some other language. What I'm proposing is porting the whole DrScheme IDE, including the MzScheme interpreter and VM, over to ActionScript. MzScheme is written in C, correct? Is there some feature of C that has no implementable counterpart in ActionScript? (Besides pointer and memory corruption. :) -B On Oct 11, 2008, at 1:40 PM, Shriram Krishnamurthi wrote: > David Van Horn has a preliminary Beginner Scheme-to-JavaScript > compiler. > > But a full-blown port is a very non-trivial effort. There are > numerous features in PLT Scheme that have no straightforward > counterpart in ActionScript or JavaScript or any other language. So > the challenge would be in implementing all these features. > > Shriram From noelwelsh at gmail.com Sat Oct 11 17:02:49 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:30:22 2009 Subject: [plt-scheme] Porting DrScheme/MzScheme to Adobe Flex In-Reply-To: References: Message-ID: It is an intriguing idea. Here are some thoughts: - A major thrust (well, Dave Herman can correct me if I'm wrong) of the new Javascript spec is to make Javascript suitable as a compilation target for other languages. In particular, adding tail calls makes JS a suitable backend for functional languages. Adobe seems quite heavily involved in the new JS spec, so I assume their JS VM will support tail calls at some point. - Trying to implement Scheme as defined by PLT Scheme or R6RS on a JS VM is probably the wrong thing to do. The models of computation and libraries are different enough that it would be painful to use, much like the various languages that have been ported to the JVM. For example, in JS land you really want associative arrays to be your default data structure. - PLT Scheme supports multiple interacting languages, so you could define a Javascript like Scheme and have graceful interoperation with real Scheme, much like Typed Scheme achieves. N. On Sat, Oct 11, 2008 at 9:32 PM, Barry Brown wrote: > Has anyone looked into porting the DrScheme environment to Adobe Flex? If it > were feasible, I see several major benefits: > > * Can run in a web browser. No software to download and install. > * Can run as a standalone app (Adobe AIR). > * Cross platform. Just one codebase to maintain. > * Built-in access to rich audio, video, and graphics. > * Access to multimedia peripherals, such as webcam and microphone. > > As of version 3.0, Adobe has open-sourced Flex. The Flex Builder Eclipse > plug-in is free to educators and students. > > What would be the challenges to porting DrScheme to ActionScript, the > JavaScript-like language that powers Flex/Flash? > > -B From noelwelsh at gmail.com Sat Oct 11 17:46:21 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:30:22 2009 Subject: [plt-scheme] define-values/invoke-unit in an internal definition context In-Reply-To: <20081011111711.4C3036500BD@mail-svr1.cs.utah.edu> References: <20081009130355.74B5E6500B1@mail-svr1.cs.utah.edu> <20081011111711.4C3036500BD@mail-svr1.cs.utah.edu> Message-ID: On Sat, Oct 11, 2008 at 12:17 PM, Matthew Flatt wrote: > Well, it's not a bug in the implementation. (Also, I now see that this > code behaves the same way in older versions; I should have tried that > in the first place.) ... Thanks for the detailed explanation and work around. I'll hack up a solution for now. N. From noelwelsh at gmail.com Sat Oct 11 17:47:37 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:30:22 2009 Subject: [plt-scheme] Porting DrScheme/MzScheme to Adobe Flex In-Reply-To: <91138E50-5C57-4002-9190-4210264D32D1@cs.sierracollege.edu> References: <91138E50-5C57-4002-9190-4210264D32D1@cs.sierracollege.edu> Message-ID: On Sat, Oct 11, 2008 at 9:59 PM, Barry Brown wrote: > MzScheme is written in C, correct? Is there some feature of C that has no > implementable counterpart in ActionScript? (Besides pointer and memory > corruption. :) Probably you could do it, but you'd pay in performance, vendor lock-in, and opportunity cost. N. From sk at cs.brown.edu Sat Oct 11 19:26:11 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:30:22 2009 Subject: [plt-scheme] Porting DrScheme/MzScheme to Adobe Flex In-Reply-To: <91138E50-5C57-4002-9190-4210264D32D1@cs.sierracollege.edu> References: <91138E50-5C57-4002-9190-4210264D32D1@cs.sierracollege.edu> Message-ID: MzScheme is not a "naive" C interpreter. Some days it isn't even an interpreter: it's a JIT compiler. Even if an ActionScript implementation had a JIT, the level of indirection would make it impossible to get the same level of performance. Plus, I would not expect an ActionScript implementation to at all be optimized to the mutation-minimal, mostly-functional style of most Scheme programs. If you're imagining MzScheme as a few hundred lines (a la a textbook interpreter), that's not what it is. The port itself would be a very non-trivial effort (for someone like me, anyway). Shriram From lunarc.lists at gmail.com Sat Oct 11 21:02:28 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:30:23 2009 Subject: [plt-scheme] Macro-expansion-time structs Message-ID: I want to define a struct to use in a macro at expansion time, but since define-struct defines the construction/utility functions itself, I cannot use define-for-syntax. As a workaround I have put the structure definition in a separate module and require it with for-syntax, but is there a better way to do this? Henk From lunarc.lists at gmail.com Sat Oct 11 21:12:39 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:30:23 2009 Subject: [plt-scheme] Non-syntax-rules macros in scheme/base Message-ID: The following works: #lang scheme --- #lang scheme (provide test) (define-syntax test (lambda (stx) #'2)) --- henk@korhal ~ $ mzscheme -i -t test.ss Welcome to MzScheme v4.1 [3m], Copyright (c) 2004-2008 PLT Scheme Inc. > (test) 2 --- However, if I switch the above to use #lang scheme/base, I get the following: --- henk@korhal ~ $ mzscheme -i -t test.ss Welcome to MzScheme v4.1 [3m], Copyright (c) 2004-2008 PLT Scheme Inc. test.ss:6:2: compile: bad syntax; function application is not allowed, because no #%app syntax transformer is bound in: (lambda (stx) (syntax 2)) --- Is this a bug, or is there something in #lang scheme which I need to require when using #lang scheme/base? Thanks, Henk From eli at barzilay.org Sat Oct 11 21:14:50 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:30:23 2009 Subject: [plt-scheme] Macro-expansion-time structs In-Reply-To: References: Message-ID: <18673.20362.740555.979124@arabic.ccs.neu.edu> On Oct 11, Henk Boom wrote: > I want to define a struct to use in a macro at expansion time, but > since define-struct defines the construction/utility functions > itself, I cannot use define-for-syntax. As a workaround I have put > the structure definition in a separate module and require it with > for-syntax, but is there a better way to do this? On Oct 11, Henk Boom wrote: > [...] > However, if I switch the above to use #lang scheme/base, I get the > following: > [...] The answer to both of these questions is that you should use (require (for-syntax scheme/base)) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From cce at ccs.neu.edu Sat Oct 11 21:28:29 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:30:23 2009 Subject: [plt-scheme] Non-syntax-rules macros in scheme/base In-Reply-To: References: Message-ID: <990e0c030810111828p3b08ffcas8e32f3bef442a65@mail.gmail.com> #lang scheme/base ;; You need to add the following line: (require (for-syntax scheme/base)) (provide test) (define-syntax test (lambda (stx) #'2)) On Sat, Oct 11, 2008 at 9:12 PM, Henk Boom wrote: > The following works: > #lang scheme > > --- > #lang scheme > > (provide test) > > (define-syntax test > (lambda (stx) > #'2)) > --- > henk@korhal ~ $ mzscheme -i -t test.ss > Welcome to MzScheme v4.1 [3m], Copyright (c) 2004-2008 PLT Scheme Inc. >> (test) > 2 > --- > > However, if I switch the above to use #lang scheme/base, I get the following: > > --- > henk@korhal ~ $ mzscheme -i -t test.ss > Welcome to MzScheme v4.1 [3m], Copyright (c) 2004-2008 PLT Scheme Inc. > test.ss:6:2: compile: bad syntax; function application is not allowed, > because no #%app syntax transformer is bound in: (lambda (stx) (syntax > 2)) > --- > > Is this a bug, or is there something in #lang scheme which I need to > require when using #lang scheme/base? > > Thanks, > Henk From lunarc.lists at gmail.com Sat Oct 11 22:00:20 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:30:23 2009 Subject: [plt-scheme] Non-syntax-rules macros in scheme/base In-Reply-To: <990e0c030810111828p3b08ffcas8e32f3bef442a65@mail.gmail.com> References: <990e0c030810111828p3b08ffcas8e32f3bef442a65@mail.gmail.com> Message-ID: 2008/10/11 Carl Eastlund : > #lang scheme/base > ;; You need to add the following line: > (require (for-syntax scheme/base)) > > (provide test) > > (define-syntax test > (lambda (stx) > #'2)) > Thank you! Is this because #lang scheme automatically does the require-for-syntax? Henk From lunarc.lists at gmail.com Sat Oct 11 22:10:36 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:30:24 2009 Subject: [plt-scheme] Macro-expansion-time structs In-Reply-To: <18673.20362.740555.979124@arabic.ccs.neu.edu> References: <18673.20362.740555.979124@arabic.ccs.neu.edu> Message-ID: 2008/10/11 Eli Barzilay : > The answer to both of these questions is that you should use > > (require (for-syntax scheme/base)) Thank you for the quick reply! This solves one of the problems. However, something like this still doesn't work: --- #lang scheme/base (require (for-syntax scheme/base)) (provide test) (define-struct my-box (val)) (define-syntax test (lambda (stx) #`#,(my-box-val (make-my-box 2)))) --- henk@korhal ~ $ mzscheme -i -t test.ss Welcome to MzScheme v4.1 [3m], Copyright (c) 2004-2008 PLT Scheme Inc. test.ss:11:9: compile: unbound variable in module (in the transformer environment, which does not include the run-time definition) in: my-box-val --- define-struct really seems to be a runtime thing. . . Henk From cce at ccs.neu.edu Sat Oct 11 23:10:15 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:30:24 2009 Subject: [plt-scheme] Non-syntax-rules macros in scheme/base In-Reply-To: References: <990e0c030810111828p3b08ffcas8e32f3bef442a65@mail.gmail.com> Message-ID: <990e0c030810112010q4ab49b66yc3b951407249a973@mail.gmail.com> On Sat, Oct 11, 2008 at 10:00 PM, Henk Boom wrote: > 2008/10/11 Carl Eastlund : >> #lang scheme/base >> ;; You need to add the following line: >> (require (for-syntax scheme/base)) >> >> (provide test) >> >> (define-syntax test >> (lambda (stx) >> #'2)) >> > > Thank you! > > Is this because #lang scheme automatically does the require-for-syntax? Yep. I believe it requires all its bindings into both normal and transformer environments. Whereas scheme/base is built for quicker compiling and fewer dependencies, so it doesn't put anything into the transformer environment. -- Carl Eastlund From cce at ccs.neu.edu Sat Oct 11 23:14:47 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:30:24 2009 Subject: [plt-scheme] Macro-expansion-time structs In-Reply-To: References: <18673.20362.740555.979124@arabic.ccs.neu.edu> Message-ID: <990e0c030810112014y89ac32cub36c0fa74aff0573@mail.gmail.com> On Sat, Oct 11, 2008 at 10:10 PM, Henk Boom wrote: > 2008/10/11 Eli Barzilay : >> The answer to both of these questions is that you should use >> >> (require (for-syntax scheme/base)) > > Thank you for the quick reply! > > This solves one of the problems. However, something like this still > doesn't work: > > --- > #lang scheme/base > > (require (for-syntax scheme/base)) > > (provide test) > > (define-struct my-box (val)) > > (define-syntax test > (lambda (stx) > #`#,(my-box-val (make-my-box 2)))) > --- > henk@korhal ~ $ mzscheme -i -t test.ss > Welcome to MzScheme v4.1 [3m], Copyright (c) 2004-2008 PLT Scheme Inc. > test.ss:11:9: compile: unbound variable in module (in the transformer > environment, which does not include the run-time definition) in: > my-box-val > --- > > define-struct really seems to be a runtime thing. . . > > Henk You've defined the struct in the runtime environment. You need to define it in the transformer environment if you want transformers to use it. You might accomplish that like this (though this makes a local definition other transformers won't be able to use): #lang scheme/base (require (for-syntax scheme/base)) (provide test) (define-syntax test (let () (define-struct my-box (val)) (lambda (stx) #`#,(my-box-val (make-my-box 2))))) -- Carl Eastlund From lunarc.lists at gmail.com Sat Oct 11 23:22:31 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:30:24 2009 Subject: [plt-scheme] Macro-expansion-time structs In-Reply-To: <990e0c030810112014y89ac32cub36c0fa74aff0573@mail.gmail.com> References: <18673.20362.740555.979124@arabic.ccs.neu.edu> <990e0c030810112014y89ac32cub36c0fa74aff0573@mail.gmail.com> Message-ID: 2008/10/11 Carl Eastlund : > You've defined the struct in the runtime environment. You need to > define it in the transformer environment if you want transformers to > use it. You might accomplish that like this (though this makes a > local definition other transformers won't be able to use): > > #lang scheme/base > > (require (for-syntax scheme/base)) > > (provide test) > > (define-syntax test > (let () > (define-struct my-box (val)) > (lambda (stx) > #`#,(my-box-val (make-my-box 2))))) I see. It's a pity that (begin-for-syntax (define-struct . . .)) doesn't work. Thanks for the info! Henk From cce at ccs.neu.edu Sun Oct 12 00:37:47 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:30:24 2009 Subject: [plt-scheme] Macro-expansion-time structs In-Reply-To: References: <18673.20362.740555.979124@arabic.ccs.neu.edu> <990e0c030810112014y89ac32cub36c0fa74aff0573@mail.gmail.com> Message-ID: <990e0c030810112137o263337d7u1d8091cb27706a8e@mail.gmail.com> If you want the my-box struct bound at the module level, you can create another module, use define-struct normally, then import it for syntax. Or you can use define-values-for-syntax like this (which won't get the struct's syntax binding, but will get anything else you need): #lang scheme/base (require (for-syntax scheme/base)) (provide test) (define-values-for-syntax (make-my-box my-box-val my-box?) (let () (define-struct my-box (val)) (values make-my-box my-box-val my-box?))) (define-syntax test (lambda (stx) #`#,(my-box-val (make-my-box 2)))) On Sat, Oct 11, 2008 at 11:22 PM, Henk Boom wrote: > 2008/10/11 Carl Eastlund : >> You've defined the struct in the runtime environment. You need to >> define it in the transformer environment if you want transformers to >> use it. You might accomplish that like this (though this makes a >> local definition other transformers won't be able to use): >> >> #lang scheme/base >> >> (require (for-syntax scheme/base)) >> >> (provide test) >> >> (define-syntax test >> (let () >> (define-struct my-box (val)) >> (lambda (stx) >> #`#,(my-box-val (make-my-box 2))))) > > I see. It's a pity that (begin-for-syntax (define-struct . . .)) doesn't work. > > Thanks for the info! > Henk From technorapture at gmail.com Sun Oct 12 01:28:48 2008 From: technorapture at gmail.com (Shrutarshi Basu) Date: Thu Mar 26 02:30:24 2009 Subject: [plt-scheme] Binary tree Traversals In-Reply-To: <612B1EDBC4F549C8B3126BE4DA920A20@uw2b2dff239c4d> References: <376fbdcf0810091840m5e63174fn502a89f8b1ddf99c@mail.gmail.com> <612B1EDBC4F549C8B3126BE4DA920A20@uw2b2dff239c4d> Message-ID: <376fbdcf0810112228i1b32419fq2a03604c04033a75@mail.gmail.com> Veer's solution worked. Thanks. I was under the impression that list accepted only two inputs and then combined them. I can see that append might give problems in my original code, because it would not always get a list as input. Doing (cons (label node) '()) takes care of this, I think. I'm still not sure I quite understand list and append though. Could someone give me a brief rundown? Thanks, Basu -- The ByteBaker : http://www.bytebaker.com From jos.koot at telefonica.net Sun Oct 12 04:06:22 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:30:25 2009 Subject: [plt-scheme] Macro-expansion-time structs References: <18673.20362.740555.979124@arabic.ccs.neu.edu><990e0c030810112014y89ac32cub36c0fa74aff0573@mail.gmail.com> <990e0c030810112137o263337d7u1d8091cb27706a8e@mail.gmail.com> Message-ID: <90CDEC08D27B468FB956A532A91F21F6@uw2b2dff239c4d> Would (begin-for-syntax (define-struct etc ())) not work as well? Jos ----- Original Message ----- From: "Carl Eastlund" To: "Henk Boom" Cc: "Eli Barzilay" ; Sent: Sunday, October 12, 2008 6:37 AM Subject: Re: [plt-scheme] Macro-expansion-time structs > If you want the my-box struct bound at the module level, you can > create another module, use define-struct normally, then import it for > syntax. Or you can use define-values-for-syntax like this (which > won't get the struct's syntax binding, but will get anything else you > need): > > #lang scheme/base > > (require (for-syntax scheme/base)) > > (provide test) > > (define-values-for-syntax (make-my-box my-box-val my-box?) > (let () > (define-struct my-box (val)) > (values make-my-box my-box-val my-box?))) > > (define-syntax test > (lambda (stx) > #`#,(my-box-val (make-my-box 2)))) > > On Sat, Oct 11, 2008 at 11:22 PM, Henk Boom > wrote: >> 2008/10/11 Carl Eastlund : >>> You've defined the struct in the runtime environment. You need to >>> define it in the transformer environment if you want transformers to >>> use it. You might accomplish that like this (though this makes a >>> local definition other transformers won't be able to use): >>> >>> #lang scheme/base >>> >>> (require (for-syntax scheme/base)) >>> >>> (provide test) >>> >>> (define-syntax test >>> (let () >>> (define-struct my-box (val)) >>> (lambda (stx) >>> #`#,(my-box-val (make-my-box 2))))) >> >> I see. It's a pity that (begin-for-syntax (define-struct . . .)) doesn't >> work. >> >> Thanks for the info! >> Henk > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From mflatt at cs.utah.edu Sun Oct 12 07:11:02 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:30:25 2009 Subject: [plt-scheme] Macro-expansion-time structs In-Reply-To: <90CDEC08D27B468FB956A532A91F21F6@uw2b2dff239c4d> References: <18673.20362.740555.979124@arabic.ccs.neu.edu><990e0c030810112014y89ac32cub36c0fa74aff0573@mail.gmail.com> <990e0c030810112137o263337d7u1d8091cb27706a8e@mail.gmail.com> <90CDEC08D27B468FB956A532A91F21F6@uw2b2dff239c4d> Message-ID: <20081012111104.2B91A6500BE@mail-svr1.cs.utah.edu> At Sun, 12 Oct 2008 10:06:22 +0200, "Jos Koot" wrote: > Would (begin-for-syntax (define-struct etc ())) not work as well? The problem with #lang scheme/base (require (for-syntax scheme/base)) (begin-for-syntax (define-struct etc ())) is that `define-struct' expands to both `define' and `define-syntax', and `define-syntax' forms are not currently supported within `begin-for-syntax' (i.e., there's not `define-syntax-for-syntax'). You can write #lang scheme/base (require (for-syntax scheme/base)) (begin-for-syntax (define-struct etc () #:omit-define-syntaxes)) which doesn't define `etc', so the structure type doesn't work with `match' or other forms that need expand-time information about the structure type. But it does define `make-etc', `etc?', and so on, which is enough for many purposes. Matthew > ----- Original Message ----- > From: "Carl Eastlund" > To: "Henk Boom" > Cc: "Eli Barzilay" ; > Sent: Sunday, October 12, 2008 6:37 AM > Subject: Re: [plt-scheme] Macro-expansion-time structs > > > > If you want the my-box struct bound at the module level, you can > > create another module, use define-struct normally, then import it for > > syntax. Or you can use define-values-for-syntax like this (which > > won't get the struct's syntax binding, but will get anything else you > > need): > > > > #lang scheme/base > > > > (require (for-syntax scheme/base)) > > > > (provide test) > > > > (define-values-for-syntax (make-my-box my-box-val my-box?) > > (let () > > (define-struct my-box (val)) > > (values make-my-box my-box-val my-box?))) > > > > (define-syntax test > > (lambda (stx) > > #`#,(my-box-val (make-my-box 2)))) > > > > On Sat, Oct 11, 2008 at 11:22 PM, Henk Boom > > wrote: > >> 2008/10/11 Carl Eastlund : > >>> You've defined the struct in the runtime environment. You need to > >>> define it in the transformer environment if you want transformers to > >>> use it. You might accomplish that like this (though this makes a > >>> local definition other transformers won't be able to use): > >>> > >>> #lang scheme/base > >>> > >>> (require (for-syntax scheme/base)) > >>> > >>> (provide test) > >>> > >>> (define-syntax test > >>> (let () > >>> (define-struct my-box (val)) > >>> (lambda (stx) > >>> #`#,(my-box-val (make-my-box 2))))) > >> > >> I see. It's a pity that (begin-for-syntax (define-struct . . .)) doesn't > >> work. > >> > >> Thanks for the info! > >> Henk > > _________________________________________________ > > 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 jos.koot at telefonica.net Sun Oct 12 07:40:20 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:30:25 2009 Subject: [plt-scheme] Macro-expansion-time structs References: <18673.20362.740555.979124@arabic.ccs.neu.edu><990e0c030810112014y89ac32cub36c0fa74aff0573@mail.gmail.com><990e0c030810112137o263337d7u1d8091cb27706a8e@mail.gmail.com> <90CDEC08D27B468FB956A532A91F21F6@uw2b2dff239c4d> <20081012111104.2B91A6500BE@mail-svr1.cs.utah.edu> Message-ID: <43A7893C26364F578E743C85684106CE@uw2b2dff239c4d> That's clear now. Thanks. Jos ----- Original Message ----- From: "Matthew Flatt" To: "Jos Koot" Cc: "Carl Eastlund" ; "Henk Boom" ; "Eli Barzilay" ; Sent: Sunday, October 12, 2008 1:11 PM Subject: Re: [plt-scheme] Macro-expansion-time structs > At Sun, 12 Oct 2008 10:06:22 +0200, "Jos Koot" wrote: >> Would (begin-for-syntax (define-struct etc ())) not work as well? > > The problem with > > #lang scheme/base > (require (for-syntax scheme/base)) > (begin-for-syntax > (define-struct etc ())) > > is that `define-struct' expands to both `define' and `define-syntax', > and `define-syntax' forms are not currently supported within > `begin-for-syntax' (i.e., there's not `define-syntax-for-syntax'). > > > You can write > > #lang scheme/base > (require (for-syntax scheme/base)) > > (begin-for-syntax > (define-struct etc () #:omit-define-syntaxes)) > > which doesn't define `etc', so the structure type doesn't work with > `match' or other forms that need expand-time information about the > structure type. But it does define `make-etc', `etc?', and so on, which > is enough for many purposes. > > > Matthew > > >> ----- Original Message ----- >> From: "Carl Eastlund" >> To: "Henk Boom" >> Cc: "Eli Barzilay" ; >> Sent: Sunday, October 12, 2008 6:37 AM >> Subject: Re: [plt-scheme] Macro-expansion-time structs >> >> >> > If you want the my-box struct bound at the module level, you can >> > create another module, use define-struct normally, then import it for >> > syntax. Or you can use define-values-for-syntax like this (which >> > won't get the struct's syntax binding, but will get anything else you >> > need): >> > >> > #lang scheme/base >> > >> > (require (for-syntax scheme/base)) >> > >> > (provide test) >> > >> > (define-values-for-syntax (make-my-box my-box-val my-box?) >> > (let () >> > (define-struct my-box (val)) >> > (values make-my-box my-box-val my-box?))) >> > >> > (define-syntax test >> > (lambda (stx) >> > #`#,(my-box-val (make-my-box 2)))) >> > >> > On Sat, Oct 11, 2008 at 11:22 PM, Henk Boom >> > wrote: >> >> 2008/10/11 Carl Eastlund : >> >>> You've defined the struct in the runtime environment. You need to >> >>> define it in the transformer environment if you want transformers to >> >>> use it. You might accomplish that like this (though this makes a >> >>> local definition other transformers won't be able to use): >> >>> >> >>> #lang scheme/base >> >>> >> >>> (require (for-syntax scheme/base)) >> >>> >> >>> (provide test) >> >>> >> >>> (define-syntax test >> >>> (let () >> >>> (define-struct my-box (val)) >> >>> (lambda (stx) >> >>> #`#,(my-box-val (make-my-box 2))))) >> >> >> >> I see. It's a pity that (begin-for-syntax (define-struct . . .)) >> >> doesn't >> >> work. >> >> >> >> Thanks for the info! >> >> Henk >> > _________________________________________________ >> > 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 kbohdan at mail.ru Sun Oct 12 07:58:04 2008 From: kbohdan at mail.ru (kbohdan@mail.ru) Date: Thu Mar 26 02:30:25 2009 Subject: [plt-scheme] Re: Porting DrScheme/MzScheme to Adobe Flex In-Reply-To: References: Message-ID: Shriram Krishnamurthi wrote: > David Van Horn has a preliminary Beginner Scheme-to-JavaScript compiler. Any links/articles/sources ? Will appreciate any resources even if still on early stages. > But a full-blown port is a very non-trivial effort. There are > numerous features in PLT Scheme that have no straightforward > counterpart in ActionScript or JavaScript or any other language. So > the challenge would be in implementing all these features. -- Bohdan From sk at cs.brown.edu Sun Oct 12 08:08:41 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:30:25 2009 Subject: [plt-scheme] Re: Porting DrScheme/MzScheme to Adobe Flex In-Reply-To: References: Message-ID: David's on this list; I trust he'll reply if he thinks it's worth sharing. Meanwhile, if you want a hardcore Scheme/JavaScript interface, check out Manuel Serrano's Hop. Shriram On Sun, Oct 12, 2008 at 6:58 AM, wrote: > Shriram Krishnamurthi wrote: >> >> David Van Horn has a preliminary Beginner Scheme-to-JavaScript compiler. > > Any links/articles/sources ? Will appreciate any resources even if still on > early stages. > >> But a full-blown port is a very non-trivial effort. There are >> numerous features in PLT Scheme that have no straightforward >> counterpart in ActionScript or JavaScript or any other language. So >> the challenge would be in implementing all these features. > > -- > Bohdan > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From matthias at ccs.neu.edu Sun Oct 12 09:55:57 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:30:25 2009 Subject: [plt-scheme] Binary tree Traversals In-Reply-To: <376fbdcf0810112228i1b32419fq2a03604c04033a75@mail.gmail.com> References: <376fbdcf0810091840m5e63174fn502a89f8b1ddf99c@mail.gmail.com> <612B1EDBC4F549C8B3126BE4DA920A20@uw2b2dff239c4d> <376fbdcf0810112228i1b32419fq2a03604c04033a75@mail.gmail.com> Message-ID: <3A6C5C8B-A6FC-4D1D-B2EF-1FE6CCD2080B@ccs.neu.edu> There are plenty of books that explain list and cons and how they differ. Have you worked thru the examples? On Oct 12, 2008, at 1:28 AM, Shrutarshi Basu wrote: > Veer's solution worked. Thanks. I was under the impression that list > accepted only two inputs and then combined them. I can see that append > might give problems in my original code, because it would not always > get a list as input. Doing (cons (label node) '()) takes care of this, > I think. I'm still not sure I quite understand list and append though. > Could someone give me a brief rundown? > Thanks, > Basu > > -- > The ByteBaker : > http://www.bytebaker.com > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From neil at neilvandyke.org Sun Oct 12 10:58:11 2008 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:30:25 2009 Subject: Google Android (Was: [plt-scheme] ARM support) In-Reply-To: <48EAFC37.8040300@neilvandyke.org> References: <87be3745-bb38-4466-9085-94fe298fd4f2@y29g2000hsf.googlegroups.com> <18666.46354.169623.133665@arabic.ccs.neu.edu> <18666.47837.753204.562748@arabic.ccs.neu.edu> <595b9ab20810062259m18e311dv24449dc61b314ac0@mail.gmail.com> <48EAFC37.8040300@neilvandyke.org> Message-ID: <48F21083.8000005@neilvandyke.org> The first Android device is selling like hotcakes, and there are more devices in the pipeline. I'd love to see PLT on Android. http://www.engadget.com/2008/10/12/1-5-million-t-mobile-g1s-already-pre-ordered/ (The only unfortunate thing is that a PLT Scheme for Android can't be named with an Asmovian prefix, as "R. Scheme", since there is already an RScheme.) Neil Van Dyke wrote at 10/07/2008 02:05 AM: > I'm hoping clever people will be inspired to put Schemes on the > Android platform. > > It's looking like Android will be very popular, as well as > developer-friendly. > From goetter at mazama.net Sun Oct 12 11:16:15 2008 From: goetter at mazama.net (Ben Goetter) Date: Thu Mar 26 02:30:26 2009 Subject: Google Android (Was: [plt-scheme] ARM support) In-Reply-To: <48F21083.8000005@neilvandyke.org> References: <87be3745-bb38-4466-9085-94fe298fd4f2@y29g2000hsf.googlegroups.com> <18666.46354.169623.133665@arabic.ccs.neu.edu> <18666.47837.753204.562748@arabic.ccs.neu.edu> <595b9ab20810062259m18e311dv24449dc61b314ac0@mail.gmail.com> <48EAFC37.8040300@neilvandyke.org> <48F21083.8000005@neilvandyke.org> Message-ID: <48F214BF.4000904@mazama.net> Unlikely, as Android apps are Java code bundles. http://code.google.com/android/kb/general.html#c Neil Van Dyke wrote: > The first Android device is selling like hotcakes, and there are more > devices in the pipeline. I'd love to see PLT on Android. From neil at neilvandyke.org Sun Oct 12 11:47:57 2008 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:30:26 2009 Subject: Google Android (Was: [plt-scheme] ARM support) Message-ID: SISC has shown that Scheme can run well on the JVM. From sk at cs.brown.edu Sun Oct 12 12:05:29 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:30:26 2009 Subject: Google Android (Was: [plt-scheme] ARM support) In-Reply-To: <48F21083.8000005@neilvandyke.org> References: <87be3745-bb38-4466-9085-94fe298fd4f2@y29g2000hsf.googlegroups.com> <18666.46354.169623.133665@arabic.ccs.neu.edu> <18666.47837.753204.562748@arabic.ccs.neu.edu> <595b9ab20810062259m18e311dv24449dc61b314ac0@mail.gmail.com> <48EAFC37.8040300@neilvandyke.org> <48F21083.8000005@neilvandyke.org> Message-ID: We have a Scheme->Java compiler being actively developed for deployment on mobile phones. We already have some world.ss applications (such as all the ones mentioned in HtDW -- see world.cs.brown.edu) compiling at the push of a button and running on multiple phones. Danny Yoo is hard at work on this, adding a few more primitives to his compiler every week until we can support the full Beginner Scheme language. Shriram On Sun, Oct 12, 2008 at 9:58 AM, Neil Van Dyke wrote: > The first Android device is selling like hotcakes, and there are more > devices in the pipeline. I'd love to see PLT on Android. > > http://www.engadget.com/2008/10/12/1-5-million-t-mobile-g1s-already-pre-ordered/ > > (The only unfortunate thing is that a PLT Scheme for Android can't be named > with an Asmovian prefix, as "R. Scheme", since there is already an RScheme.) > > Neil Van Dyke wrote at 10/07/2008 02:05 AM: >> >> I'm hoping clever people will be inspired to put Schemes on the Android >> platform. >> >> It's looking like Android will be very popular, as well as >> developer-friendly. >> > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From dvanhorn at ccs.neu.edu Sun Oct 12 12:20:01 2008 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Thu Mar 26 02:30:26 2009 Subject: [plt-scheme] Re: Porting DrScheme/MzScheme to Adobe Flex In-Reply-To: References: Message-ID: <48F223B1.4010209@ccs.neu.edu> kbohdan@mail.ru wrote: > Shriram Krishnamurthi wrote: >> David Van Horn has a preliminary Beginner Scheme-to-JavaScript compiler. > > Any links/articles/sources ? Will appreciate any resources even if still > on early stages. It is still too early to release anything, but I have a "compliler" that translates representative Advanced Student programs into JavaScript. My goal was to get demos of games written with the World teachpack on the web---Malcom X style---by any means necessary. JavaScript and Advanced Student are close enough that a simple transliteration will do (for correct programs that can get by on the JS impoverished numbers). So the compiler is more of a pretty printer, with a little bit of World teachpack support hacked together in JavaScript. You can see an example here, which demos a game from the recent release of HtDW: http://www.ccs.neu.edu/home/dvanhorn/tmp/version9/ I'd like to turn this into a real AS to JS compiler that could be used as a tool within DrScheme, but that will take work. It needs support for more complicated control flow (to handle check-expect). And there are numerous distinctions between JS and Scheme semantics that have to be worked around. Numbers. Etc. This is also not a priority of mine (I have a moral imperative at the moment), but I think it's a good project. What I'd really like to do is give it to an ambitious student to develop. David From noelwelsh at gmail.com Sun Oct 12 18:59:17 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:30:26 2009 Subject: Google Android (Was: [plt-scheme] ARM support) In-Reply-To: <48F21083.8000005@neilvandyke.org> References: <87be3745-bb38-4466-9085-94fe298fd4f2@y29g2000hsf.googlegroups.com> <18666.46354.169623.133665@arabic.ccs.neu.edu> <18666.47837.753204.562748@arabic.ccs.neu.edu> <595b9ab20810062259m18e311dv24449dc61b314ac0@mail.gmail.com> <48EAFC37.8040300@neilvandyke.org> <48F21083.8000005@neilvandyke.org> Message-ID: On Sun, Oct 12, 2008 at 3:58 PM, Neil Van Dyke wrote: > The first Android device is selling like hotcakes, and there are more > devices in the pipeline. I'd love to see PLT on Android. PLT Scheme, or a Scheme-like language? 'cause Scheme doesn't match the JVM that well. For example, strings are immutable in Java but not in Scheme. (Although PLT has immutable strings -- just take this as a simple example of impedance mismatch.) I'd love to see a Scheme-like language that compiles to Java bytecodes and which was hosted in PLT Scheme, so one could benefit from the macro system. If you don't want macros Scala is a fairly compelling language. N. From lunarc.lists at gmail.com Sun Oct 12 19:47:41 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:30:26 2009 Subject: [plt-scheme] Macros in Macros Message-ID: The following works: --- #lang scheme/base (require (for-syntax scheme/base (for-syntax scheme/base))) (provide test) (define-syntax (test stx) (define-syntax (foo stx) #`#,2) #`#,(foo stx)) --- I have two questions. First, is nesting for-syntax clauses the right way to be able to write these sorts of macros? Secondly, is there a way to define the 'foo' macro globally for the module? I'm prohibited from including it in a begin-for-syntax clause. Henk From cce at ccs.neu.edu Sun Oct 12 19:59:25 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:30:27 2009 Subject: [plt-scheme] Macros in Macros In-Reply-To: References: Message-ID: <990e0c030810121659u16d9bb2cr6e47cae32a1e20b7@mail.gmail.com> On Sun, Oct 12, 2008 at 7:47 PM, Henk Boom wrote: > The following works: > > --- > #lang scheme/base > > (require (for-syntax scheme/base > (for-syntax scheme/base))) > (provide test) > > (define-syntax (test stx) > (define-syntax (foo stx) > #`#,2) > #`#,(foo stx)) > --- > > I have two questions. First, is nesting for-syntax clauses the right > way to be able to write these sorts of macros? Secondly, is there a > way to define the 'foo' macro globally for the module? I'm prohibited > from including it in a begin-for-syntax clause. If you split your program up into separate modules, you can define the foo macro in one, and require it for syntax in the other, and you will then have a transformer-time macro available in the entirety of the second module. -- Carl Eastlund From lunarc.lists at gmail.com Sun Oct 12 21:02:47 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:30:27 2009 Subject: [plt-scheme] Macros in Macros In-Reply-To: <990e0c030810121659u16d9bb2cr6e47cae32a1e20b7@mail.gmail.com> References: <990e0c030810121659u16d9bb2cr6e47cae32a1e20b7@mail.gmail.com> Message-ID: 2008/10/12 Carl Eastlund : > If you split your program up into separate modules, you can define the > foo macro in one, and require it for syntax in the other, and you will > then have a transformer-time macro available in the entirety of the > second module. I see, thanks! Fortunately splitting into multiple modules is more appropriate in this case than it was when I was trying to define structures for macro use. Henk From martindemello at gmail.com Sun Oct 12 21:09:06 2008 From: martindemello at gmail.com (Martin DeMello) Date: Thu Mar 26 02:30:27 2009 Subject: Google Android (Was: [plt-scheme] ARM support) In-Reply-To: References: <87be3745-bb38-4466-9085-94fe298fd4f2@y29g2000hsf.googlegroups.com> <18666.46354.169623.133665@arabic.ccs.neu.edu> <18666.47837.753204.562748@arabic.ccs.neu.edu> <595b9ab20810062259m18e311dv24449dc61b314ac0@mail.gmail.com> <48EAFC37.8040300@neilvandyke.org> <48F21083.8000005@neilvandyke.org> Message-ID: On Sun, Oct 12, 2008 at 3:59 PM, Noel Welsh wrote: > On Sun, Oct 12, 2008 at 3:58 PM, Neil Van Dyke wrote: >> The first Android device is selling like hotcakes, and there are more >> devices in the pipeline. I'd love to see PLT on Android. > > PLT Scheme, or a Scheme-like language? 'cause Scheme doesn't match > the JVM that well. For example, strings are immutable in Java but not > in Scheme. (Although PLT has immutable strings -- just take this as a > simple example of impedance mismatch.) > > I'd love to see a Scheme-like language that compiles to Java bytecodes > and which was hosted in PLT Scheme, so one could benefit from the > macro system. If you don't want macros Scala is a fairly compelling > language. If you want a nice Schemelike JVM language with decent performance, Clojure comes closer than Scala does. martin From lunarc.lists at gmail.com Sun Oct 12 22:53:49 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:30:27 2009 Subject: Google Android (Was: [plt-scheme] ARM support) In-Reply-To: References: <87be3745-bb38-4466-9085-94fe298fd4f2@y29g2000hsf.googlegroups.com> <18666.46354.169623.133665@arabic.ccs.neu.edu> <18666.47837.753204.562748@arabic.ccs.neu.edu> <595b9ab20810062259m18e311dv24449dc61b314ac0@mail.gmail.com> <48EAFC37.8040300@neilvandyke.org> <48F21083.8000005@neilvandyke.org> Message-ID: 2008/10/12 Martin DeMello : > If you want a nice Schemelike JVM language with decent performance, > Clojure comes closer than Scala does. (sorry multiple copies of this got sent out, they were sent from the wrong mailing address, so I re-sent to have it appear on the list) Clojure's neat =). Re: Android though, last I heard Clojure compiles directly to JVM bytecode, which (I hear) is incompatible with Android bytecode, so there would probably be significant porting efforts needed there as well. Henk From kbohdan at mail.ru Mon Oct 13 01:47:22 2008 From: kbohdan at mail.ru (kbohdan@mail.ru) Date: Thu Mar 26 02:30:27 2009 Subject: [plt-scheme] Re: Porting DrScheme/MzScheme to Adobe Flex In-Reply-To: <48F223B1.4010209@ccs.neu.edu> References: <48F223B1.4010209@ccs.neu.edu> Message-ID: Thanks. Writing games is the most exciting way to activate student brains. Aren't you going to write real scheme compiler ? At least with call/cc. Some time ago I've tried to implement r5rs->javascript compiler, but lack of theory knowledges forced me to pause project and start studying some theory. AFAIK "call/cc" is incredibly useful for asynchronous communication with web server via XMLHTTPRequest, so i decided not to ignore it in my compiler. Will appreciate if you can give me any hints here. -- Bohdan David Van Horn wrote: > It is still too early to release anything, but I have a "compliler" that > translates representative Advanced Student programs into JavaScript. My > goal was to get demos of games written with the World teachpack on the > web---Malcom X style---by any means necessary. JavaScript and Advanced > Student are close enough that a simple transliteration will do (for > correct programs that can get by on the JS impoverished numbers). So > the compiler is more of a pretty printer, with a little bit of World > teachpack support hacked together in JavaScript. > > You can see an example here, which demos a game from the recent release > of HtDW: > > http://www.ccs.neu.edu/home/dvanhorn/tmp/version9/ > > I'd like to turn this into a real AS to JS compiler that could be used > as a tool within DrScheme, but that will take work. It needs support > for more complicated control flow (to handle check-expect). And there > are numerous distinctions between JS and Scheme semantics that have to > be worked around. Numbers. Etc. > > This is also not a priority of mine (I have a moral imperative at the > moment), but I think it's a good project. What I'd really like to do is > give it to an ambitious student to develop. > > David > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From noelwelsh at gmail.com Mon Oct 13 04:56:38 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:30:28 2009 Subject: Google Android (Was: [plt-scheme] ARM support) In-Reply-To: References: <87be3745-bb38-4466-9085-94fe298fd4f2@y29g2000hsf.googlegroups.com> <18666.46354.169623.133665@arabic.ccs.neu.edu> <18666.47837.753204.562748@arabic.ccs.neu.edu> <595b9ab20810062259m18e311dv24449dc61b314ac0@mail.gmail.com> <48EAFC37.8040300@neilvandyke.org> <48F21083.8000005@neilvandyke.org> Message-ID: "The dx tool lets you generate Android bytecode from .class files. The tool converts target files and/or directories to Dalvik executable format (.dex) files, so that they can run in the Android environment. It can also dump the class files in a human-readable format and run a target unit test. You can get the usage and options for this tool by using dx -help." http://code.google.com/android/reference/othertools.html#dx Clojure compiles on-the-fly but I don't think it would be too hard to get it to output the bytecode it generates. That said I don't think Clojure is a great language for a mobile phone. I don't think concurrency is such an issue for a phone app, and I expect Clojure's model is, by default, a bit inefficient (= more power consumption). Also, its macro system is weak sauce. N. On Mon, Oct 13, 2008 at 2:16 AM, Henk Boom wrote: > 2008/10/12 Martin DeMello : >> If you want a nice Schemelike JVM language with decent performance, >> Clojure comes closer than Scala does. > > Clojure's neat =). Re: Android though, last I heard Clojure compiles > directly to JVM bytecode, which (I hear) is incompatible with Android > bytecode, so there would probably be significant porting efforts > needed there as well. > > Henk > From mflatt at cs.utah.edu Mon Oct 13 08:13:11 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:30:28 2009 Subject: [plt-scheme] copy-paste from scribble html docs to drscheme In-Reply-To: <595b9ab20810050107g275568beye66254573fbc3702@mail.gmail.com> References: <595b9ab20810050107g275568beye66254573fbc3702@mail.gmail.com> Message-ID: <20081013121315.844A96500AF@mail-svr1.cs.utah.edu> At Sun, 5 Oct 2008 09:07:04 +0100, "Stephen De Gabrielle" wrote: > I sometimes copy paste code from the docs into DrScheme; > > a really frustrating thing happens - every line in the docs is > replaces by 10 lines in DrScheme. (see example below) The latest doc build should work better with copy and paste. Matthew From wdmeuter at vub.ac.be Mon Oct 13 08:58:50 2008 From: wdmeuter at vub.ac.be (Wolfgang De Meuter) Date: Thu Mar 26 02:30:28 2009 Subject: [plt-scheme] unit testing in r6rs Message-ID: <44986279-57F8-4120-8AFD-EC2F892AE96B@vub.ac.be> Hello, I'm a bit puzzled with all the languages and module/unit/library- variations. I'm developing R6RS and would like to write unit tests for my libraries. Which libraries do I need to include to do so, and which documentation should I read? Thanks in advance Wolf From mflatt at cs.utah.edu Mon Oct 13 09:11:02 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:30:28 2009 Subject: [plt-scheme] define-values/invoke-unit in an internal definition context In-Reply-To: <852C0B97-88ED-42F8-A870-E6890A802DC1@cs.indiana.edu> References: <20081009130355.74B5E6500B1@mail-svr1.cs.utah.edu> <20081011111711.4C3036500BD@mail-svr1.cs.utah.edu> <852C0B97-88ED-42F8-A870-E6890A802DC1@cs.indiana.edu> Message-ID: <20081013131105.3C2F06500B2@mail-svr1.cs.utah.edu> At Sat, 11 Oct 2008 13:03:27 -0400, Abdulaziz Ghuloum wrote: > Side Note: Ikarus has an internal module form that was borrowed > from Chez and is described in Oscar Waddel's dissertation. My > implementation had a similar problem. > > This example, similar to the one on top using sigs has a macro > that expands to an import and a reference. It didn't work at > first but now it now correctly and produces a=12. > > (let () > (module M (a) > (define a 12)) > (define-syntax f > (syntax-rules () > [(_) > (let () > (import M) > (printf "a=~s\n" a))])) > (f)) > > The counter example is the following where you have a macro > that expands to an import wrapping an expression that contains > module identifiers. This doesn't work now (and it shouldn't > because import should be hygienic) but it used to work in the > broken implementation of Ikarus. This is essentially how the > use-unit@ macros works (above) and how it will break once the > signatures are fixed. > > (let () > (module M (a) > (define a 12)) > (define-syntax f > (syntax-rules () > [(_ id) > (let () > (import M) > (printf "a=~s\n" id))])) > (f a)) Thanks very much for your note! I must say that I was confused about this message for a while. I thought you meant that you incorrectly implemented the algorithm that Oscar defined. But from my earlier study of Oscar's system, I expected the examples above to behave in exactly the way that you claim is broken. The again, `petite' (v7.3) as well as `ikarus' (current from bzr) gave your predicted result. It eventually dawned on me that someone fixed Oscar's algorithm itself, perhaps since v6.9 of `petite' that I was using originally. You didn't say how the algorithm was fixed, but after a few more experiments, it was easy enough to guess: the expander takes a diff of the lexical context on the use of a module id compared to the binding of the module, and it applies that diff to the module's exported ids when they're unpacked by `import'. Sure enough, when I look at "psyntax.expander.ss", I see the diff-transferring operation in `module-interface-exp-id*'. And in "psyntax.ss" from Kent's page, I see that `lookup-import-binding-name' acquired a new `new-marks' argument between versions 6.9 and 7.0. Is that all correct? You're completely right that the treatment of bindings with units was based on Oscar's (old) `module', and that's why we have the (old) bug. I will look into adding a context-diff-and-apply operation to PLT Scheme's macro system. Thanks, Matthew From dvanhorn at ccs.neu.edu Mon Oct 13 10:34:20 2008 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Thu Mar 26 02:30:29 2009 Subject: [plt-scheme] Re: Porting DrScheme/MzScheme to Adobe Flex In-Reply-To: References: <48F223B1.4010209@ccs.neu.edu> Message-ID: <48F35C6C.6020507@ccs.neu.edu> kbohdan@mail.ru wrote: > Thanks. Writing games is the most exciting way to activate student brains. > > Aren't you going to write real scheme compiler ? At least with call/cc. > Some time ago I've tried to implement r5rs->javascript compiler, but > lack of theory knowledges forced me to pause project and start studying > some theory. > AFAIK "call/cc" is incredibly useful for asynchronous communication > with web server via XMLHTTPRequest, so i decided not to ignore it in my > compiler. > > Will appreciate if you can give me any hints here. There are standard textbook treatments of how to implement first-class control operators (PLAI, EOPL, etc). Try writing a slimmed-down Scheme to Scheme compiler that emits code in CPS. Adding call/cc will be a one-liner added to the initial environment. And from there you can grow the compiler into an R5RS to JavaScript compiler in a straightforward and incremental way. David From neil at neilvandyke.org Mon Oct 13 11:27:54 2008 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:30:29 2009 Subject: Google Android (Was: [plt-scheme] ARM support) In-Reply-To: References: <87be3745-bb38-4466-9085-94fe298fd4f2@y29g2000hsf.googlegroups.com> <18666.46354.169623.133665@arabic.ccs.neu.edu> <18666.47837.753204.562748@arabic.ccs.neu.edu> <595b9ab20810062259m18e311dv24449dc61b314ac0@mail.gmail.com> <48EAFC37.8040300@neilvandyke.org> <48F21083.8000005@neilvandyke.org> Message-ID: <48F368FA.6020808@neilvandyke.org> Noel Welsh wrote at 10/12/2008 06:59 PM: >> I'd love to see PLT on Android. >> > > PLT Scheme, or a Scheme-like language? Scheme enough that we can use libraries written in Scheme. A bunch of people have put a lot of work into writing good libraries for Scheme. For me to move to a Scheme-like language that can't reuse our Scheme library investment would seem masochistic. I'd be fine with a Scheme that had all of R5RS except for "call/cc" and mutability of strings. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081013/aee1f315/attachment.html From deepankar.sharma at gmail.com Mon Oct 13 12:44:34 2008 From: deepankar.sharma at gmail.com (Deep) Date: Thu Mar 26 02:30:29 2009 Subject: [plt-scheme] print-object equivalent Message-ID: <01867e46-bbbc-4b72-978e-acbe67287022@d1g2000hsg.googlegroups.com> I have merrily hacking using DrScheme and wanted to know if theres some way to define what controls the printed representation of objects of a given class. I am looking for plt schemes equivalent to the print- object generic function from lisp. Also I was looking for advice to implement logging in an application which uses objects. Is it possible using some metaclass based magic to get all defined classes in my application to log all messages they receive ? PS: Thanks for the great *searchable* documentation that comes with DrScheme. It makes DrScheme one of the most productive environments ive used in a long time. From d.j.gurnell at gmail.com Mon Oct 13 12:55:40 2008 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Thu Mar 26 02:30:30 2009 Subject: [plt-scheme] print-object equivalent In-Reply-To: <01867e46-bbbc-4b72-978e-acbe67287022@d1g2000hsg.googlegroups.com> References: <01867e46-bbbc-4b72-978e-acbe67287022@d1g2000hsg.googlegroups.com> Message-ID: <5EAA94CB-908F-48BA-86EB-855E9F8F8E52@gmail.com> Hi Deep, This was a quite recent addition to PLT. Someone can correct me if I'm wrong, but I think you have to be running a Subversion build from some time in the last month for this to work. All you have to do is implement the printable<%> interface and the custom-display and custom-write methods in your class. Untested example follows: (define my-class% (class* object% (printable<%>) ; output-port -> void (define/public (custom-display out) (display "[Instance of my-class%]" out)) ; output-port -> void (define/public (custom-write out) (display "[Instance of my-class%]" out)))) Cheers, -- Dave > I have merrily hacking using DrScheme and wanted to know if theres > some way to define what controls the printed representation of objects > of a given class. I am looking for plt schemes equivalent to the > print- > object generic function from lisp. > > Also I was looking for advice to implement logging in an application > which uses objects. Is it possible using some metaclass based magic to > get all defined classes in my application to log all messages they > receive ? > > PS: Thanks for the great *searchable* documentation that comes with > DrScheme. It makes DrScheme one of the most productive environments > ive used in a long time. From foolsmart2005 at gmail.com Fri Oct 10 01:26:38 2008 From: foolsmart2005 at gmail.com (SamuelXiao) Date: Thu Mar 26 02:30:30 2009 Subject: [plt-scheme] Re: Combining two definition into one only In-Reply-To: <94d8b005-46af-4137-ab50-3dde4df57dd2@c22g2000prc.googlegroups.com> References: <24e4c951-54c9-4c74-9a84-f4b3ddb8ea5c@v39g2000pro.googlegroups.com> <94d8b005-46af-4137-ab50-3dde4df57dd2@c22g2000prc.googlegroups.com> Message-ID: <31b4af81-ee19-4923-9bdf-5b401f06a344@a18g2000pra.googlegroups.com> Excuse, I want to ask one more question, actually, for the let statement: (let helper ((unsorted numbers) ; The remaining unsorted values (sorted '())) ; The sorted values (if (null? unsorted) sorted (helper (cdr unsorted) (insert-number (car unsorted) sorted))))) (let helper (( )())) ----> what does this means? because in my notes and even the online materials: ( let ( {[ ?id? ?expr? ]}* ) ?expr?+ ) the let statement should be sth like the above one. what is the helper standing for? On Oct 7, 12:53?am, SamuelXiao wrote: > Yes, you are right, actually, i am studying the scheme by taking his > notes because in my school, the teacher's example is a bit simple. > > On Oct 6, 10:06?am, "Matt Jadud" wrote: > > > On Sun, Oct 5, 2008 at 10:56 AM, SamuelXiao wrote: > > > I am a scheme newbie, could anyone tell me how can i combine this > > > following 2 definition into one? > > > This question[1] looks like it might be related to a set of problems > > issued at Grinnell in the Spring of 2007[2]. > > > I've CC:'d Samuel Rebelsky at Grinnell, as a lab of his was the only > > page Google could find with the words "insert-number" and > > "insertion-sort-numbers" that wasn't the Google Groups version of the > > original posting. > > > And, if I've completely missed the mark, "oops." > > > Cheers, > > Matt > > > [1]http://groups.google.com/group/plt-scheme/browse_thread/thread/ff785c... > > [2]http://www.cs.grinnell.edu/~rebelsky/Courses/CS151/2007S/Labs/inserti... > > _________________________________________________ > > ? 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 foolsmart2005 at gmail.com Sat Oct 11 05:15:06 2008 From: foolsmart2005 at gmail.com (SamuelXiao) Date: Thu Mar 26 02:30:30 2009 Subject: [plt-scheme] How to make the following code more clear? Message-ID: <372f1da8-d335-4366-9168-92ff288a37c4@b2g2000prf.googlegroups.com> Here is my program: -------------------------------------------------------------- (define (selectionsort lst) (define(largest lst) (define larger(lambda (x y) (if (> x y) x y))) (if(null? (cdr lst)) (car lst) (larger(car lst)(largest(cdr lst))))) (define(remove lst val) (if(eq? val (car lst)) (cdr lst) (cons (car lst)(remove(cdr lst)val)))) (define selectionhelper (lambda(largestval lst) (cons largestval (selectionsort(remove lst largestval))))) (if (null? lst) '() (selectionhelper (largest lst) lst))) ------------------------------------------------------------------------------------------------------- As you can see, it's a bit hard to read, could anyone tell me how to combine the defines into only one define and make it more clear? My program is selection sort. it's now in descending order, i want to make it in ascending order, how could i do it? i don't want to change to larger into smaller although it's work. I tried use reverse but it gives me uncorrect order. From jos.koot at telefonica.net Mon Oct 13 14:39:52 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:30:30 2009 Subject: [plt-scheme] Re: Combining two definition into one only References: <24e4c951-54c9-4c74-9a84-f4b3ddb8ea5c@v39g2000pro.googlegroups.com> <94d8b005-46af-4137-ab50-3dde4df57dd2@c22g2000prc.googlegroups.com> <31b4af81-ee19-4923-9bdf-5b401f06a344@a18g2000pra.googlegroups.com> Message-ID: <8EA66A80E9434BE29216CCA557ED3781@uw2b2dff239c4d> SamuelXiao wrote: (let helper (( )())) ----> what does this means? (let procname ((var value) ...) definition ... expr ...) This is a named let form, quite something else than a plain let. Look for "named let" in your notes. May be in a section about iterations. Or look ifor named let in the index of "The Scheme Programming Language" by R. Kent Dybvig or any other book about Scheme. In your example procname is "helper" and is called recursively in the last line. Jos ----- Original Message ----- From: "SamuelXiao" To: Sent: Friday, October 10, 2008 7:26 AM Subject: [plt-scheme] Re: Combining two definition into one only Excuse, I want to ask one more question, actually, for the let statement: (let helper ((unsorted numbers) ; The remaining unsorted values (sorted '())) ; The sorted values (if (null? unsorted) sorted (helper (cdr unsorted) (insert-number (car unsorted) sorted))))) (let helper (( )())) ----> what does this means? because in my notes and even the online materials: ( let ( {[ ?id? ?expr? ]}* ) ?expr?+ ) the let statement should be sth like the above one. what is the helper standing for? On Oct 7, 12:53 am, SamuelXiao wrote: > Yes, you are right, actually, i am studying the scheme by taking his > notes because in my school, the teacher's example is a bit simple. > > On Oct 6, 10:06 am, "Matt Jadud" wrote: > > > On Sun, Oct 5, 2008 at 10:56 AM, SamuelXiao > > wrote: > > > I am a scheme newbie, could anyone tell me how can i combine this > > > following 2 definition into one? > > > This question[1] looks like it might be related to a set of problems > > issued at Grinnell in the Spring of 2007[2]. > > > I've CC:'d Samuel Rebelsky at Grinnell, as a lab of his was the only > > page Google could find with the words "insert-number" and > > "insertion-sort-numbers" that wasn't the Google Groups version of the > > original posting. > > > And, if I've completely missed the mark, "oops." > > > Cheers, > > Matt > > > [1]http://groups.google.com/group/plt-scheme/browse_thread/thread/ff785c... > > [2]http://www.cs.grinnell.edu/~rebelsky/Courses/CS151/2007S/Labs/inserti... > > _________________________________________________ > > For list-related administrative tasks: > > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme _________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-scheme From matthias at ccs.neu.edu Mon Oct 13 14:44:24 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:30:30 2009 Subject: [plt-scheme] How to make the following code more clear? In-Reply-To: <372f1da8-d335-4366-9168-92ff288a37c4@b2g2000prf.googlegroups.com> References: <372f1da8-d335-4366-9168-92ff288a37c4@b2g2000prf.googlegroups.com> Message-ID: #lang typed-scheme (: selectionsort (? (?) ((Listof ?) (? ? -> Boolean) -> (Listof ?)))) ;; gen. rec.: repeatedly pick/remove the largest value wrt <=, create lists from it (define (selectionsort l0 <=) (: max (? ? -> ?)) (define (max n m) (if (<= n m) m n)) (: = (? ? -> Boolean)) (define (= n m) (and (<= n m) (<= m n))) (: largest ((cons ? (Listof ?)) -> ?)) ;; pick the largest value from the list (define (largest lst) (foldr max (car lst) (cdr lst))) (: remove ((Listof ?) ? -> (Listof ?))) ;; remove the given value from the list (define (remove lst val) (cond [(= (car lst) val) (cdr lst)] [else (cons (car lst) (remove (cdr lst) val))])) (: aux ((Listof ?) -> (Listof ?))) (define (aux l) (cond [(null? l) '()] [else (let ([m (largest l)]) (cons m (aux (remove l m))))])) (aux l0)) (equal? (selectionsort '(2 1 4 3) <=) '(4 3 2 1)) (equal? (selectionsort '(2 1 4 3) >=) '(1 2 3 4)) From etanter at dcc.uchile.cl Mon Oct 13 15:23:55 2008 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Thu Mar 26 02:30:31 2009 Subject: [plt-scheme] How to make the following code more clear? In-Reply-To: References: <372f1da8-d335-4366-9168-92ff288a37c4@b2g2000prf.googlegroups.com> Message-ID: <27276409-983C-4BDC-A460-E1D5D93E3822@dcc.uchile.cl> > #lang typed-scheme > [...] > (: largest ((cons ? (Listof ?)) -> ?)) > ;; pick the largest value from the list > (define (largest lst) > (foldr max (car lst) (cdr lst))) any reason why you used (cons a (Listof a)) instead of simply (Listof a) in the type signature of largest? -- ?ric From grettke at acm.org Mon Oct 13 15:26:59 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:30:31 2009 Subject: [plt-scheme] print-object equivalent In-Reply-To: <5EAA94CB-908F-48BA-86EB-855E9F8F8E52@gmail.com> References: <01867e46-bbbc-4b72-978e-acbe67287022@d1g2000hsg.googlegroups.com> <5EAA94CB-908F-48BA-86EB-855E9F8F8E52@gmail.com> Message-ID: <756daca50810131226kc3da07cy7b9b7bda1bc9c5e7@mail.gmail.com> On Mon, Oct 13, 2008 at 11:55 AM, Dave Gurnell wrote: > This was a quite recent addition to PLT. Someone can correct me if I'm > wrong, but I think you have to be running a Subversion build from some time > in the last month for this to work. > > All you have to do is implement the printable<%> interface and the > custom-display and custom-write methods in your class. Untested example > follows: Thanks Dave. Here is the tested version: #lang scheme (define my-class% (class* object% (printable<%>) ; output-port -> void (define/public (custom-display out) (display "[Instance of my-class%]" out)) ; output-port -> void (define/public (custom-write out) (display "[Instance of my-class%]" out)) (super-new))) (define c (make-object my-class%)) (printf "The object c is an: ~a~n" c) From czhu at cs.utah.edu Mon Oct 13 15:28:01 2008 From: czhu at cs.utah.edu (Chongkai Zhu) Date: Thu Mar 26 02:30:31 2009 Subject: [plt-scheme] How to make the following code more clear? In-Reply-To: <27276409-983C-4BDC-A460-E1D5D93E3822@dcc.uchile.cl> References: <372f1da8-d335-4366-9168-92ff288a37c4@b2g2000prf.googlegroups.com> <27276409-983C-4BDC-A460-E1D5D93E3822@dcc.uchile.cl> Message-ID: <48F3A141.8020205@cs.utah.edu> Because `largest' doesn't work on empty list. Chongkai Eric Tanter wrote: >> #lang typed-scheme >> [...] >> (: largest ((cons ? (Listof ?)) -> ?)) >> ;; pick the largest value from the list >> (define (largest lst) >> (foldr max (car lst) (cdr lst))) > > any reason why you used (cons a (Listof a)) instead of simply (Listof > a) in the type signature of largest? > > -- ?ric_________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From matthias at ccs.neu.edu Mon Oct 13 15:33:34 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:30:31 2009 Subject: [plt-scheme] How to make the following code more clear? In-Reply-To: <48F3A141.8020205@cs.utah.edu> References: <372f1da8-d335-4366-9168-92ff288a37c4@b2g2000prf.googlegroups.com> <27276409-983C-4BDC-A460-E1D5D93E3822@dcc.uchile.cl> <48F3A141.8020205@cs.utah.edu> Message-ID: <3E7CCBE2-2F45-4945-9E63-ADF772B710DB@ccs.neu.edu> I wish this were the reason. Turns out car and cdr are applicable to (Listof X) just as much as they are in ML and Haskell. These aren't type errors but variant errors. I, however, prefer to express the stronger theorem when the language accommodates it. In this regard, Chongkai is correct, -- Matthias On Oct 13, 2008, at 3:28 PM, Chongkai Zhu wrote: > Because `largest' doesn't work on empty list. > > Chongkai > > Eric Tanter wrote: >>> #lang typed-scheme >>> [...] >>> (: largest ((cons ? (Listof ?)) -> ?)) >>> ;; pick the largest value from the list >>> (define (largest lst) >>> (foldr max (car lst) (cdr lst))) >> >> any reason why you used (cons a (Listof a)) instead of simply >> (Listof a) in the type signature of largest? >> >> -- ?ric_________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From jos.koot at telefonica.net Mon Oct 13 15:38:00 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:30:31 2009 Subject: [plt-scheme] How to make the following code more clear? References: <372f1da8-d335-4366-9168-92ff288a37c4@b2g2000prf.googlegroups.com> Message-ID: Your response came in while I was still preparing some comments and it make my comments superfluous. However, I am not sure it such a good idea to have students write inefficient code like this. I think a warning that designing a good sorter is far from trivial, not for a beginner actually. Also a warning that the algorithm is far from optimal is in place, I think. Asking the student how to avoid traversing the list twice (largest: full traversal, remove: partial traversal) is probably asked far too much to a beginning student. (This would be asking to invent linear sort) Jos ----- Original Message ----- From: "Matthias Felleisen" To: "SamuelXiao" Cc: Sent: Monday, October 13, 2008 8:44 PM Subject: Re: [plt-scheme] How to make the following code more clear? #lang typed-scheme (: selectionsort (? (?) ((Listof ?) (? ? -> Boolean) -> (Listof ?)))) ;; gen. rec.: repeatedly pick/remove the largest value wrt <=, create lists from it (define (selectionsort l0 <=) (: max (? ? -> ?)) (define (max n m) (if (<= n m) m n)) (: = (? ? -> Boolean)) (define (= n m) (and (<= n m) (<= m n))) (: largest ((cons ? (Listof ?)) -> ?)) ;; pick the largest value from the list (define (largest lst) (foldr max (car lst) (cdr lst))) (: remove ((Listof ?) ? -> (Listof ?))) ;; remove the given value from the list (define (remove lst val) (cond [(= (car lst) val) (cdr lst)] [else (cons (car lst) (remove (cdr lst) val))])) (: aux ((Listof ?) -> (Listof ?))) (define (aux l) (cond [(null? l) '()] [else (let ([m (largest l)]) (cons m (aux (remove l m))))])) (aux l0)) (equal? (selectionsort '(2 1 4 3) <=) '(4 3 2 1)) (equal? (selectionsort '(2 1 4 3) >=) '(1 2 3 4))_________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-scheme From morazanm at gmail.com Mon Oct 13 15:51:12 2008 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:30:32 2009 Subject: [plt-scheme] some world questions.... Message-ID: <9b1fff280810131251l33c19987qfbefa413ba64978e@mail.gmail.com> Dear All, Can someone point me in the right direction? 1) Can we distinguish between the left and right mouse buttons using world.ss? 2) What are MouseEvents 'enter and 'leave? Thanks! -- Cheers, Marco From jinsongliang at gmail.com Mon Oct 13 15:54:12 2008 From: jinsongliang at gmail.com (Jinsong Liang) Date: Thu Mar 26 02:30:32 2009 Subject: [plt-scheme] How to make the following code more clear? In-Reply-To: <372f1da8-d335-4366-9168-92ff288a37c4@b2g2000prf.googlegroups.com> References: <372f1da8-d335-4366-9168-92ff288a37c4@b2g2000prf.googlegroups.com> Message-ID: <4adc57ca0810131254w2b9cd74al70038a1d16955f31@mail.gmail.com> Hi, How can I get the type info of a variable? For example, I want something like the following (get-type a-variable) => "list" or "vector" or "number" or "string" Thank you! Jinsong From grettke at acm.org Mon Oct 13 15:58:09 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:30:32 2009 Subject: [plt-scheme] print-object equivalent In-Reply-To: <756daca50810131226kc3da07cy7b9b7bda1bc9c5e7@mail.gmail.com> References: <01867e46-bbbc-4b72-978e-acbe67287022@d1g2000hsg.googlegroups.com> <5EAA94CB-908F-48BA-86EB-855E9F8F8E52@gmail.com> <756daca50810131226kc3da07cy7b9b7bda1bc9c5e7@mail.gmail.com> Message-ID: <756daca50810131258j43489717xf0f9bc5ff9c3bd82@mail.gmail.com> > On Mon, Oct 13, 2008 at 11:55 AM, Dave Gurnell wrote: > This was a quite recent addition to PLT. Someone can correct me if I'm > wrong, but I think you have to be running a Subversion build from some time > in the last month for this to work. It works in the latest release, 4.1.1. From eli at barzilay.org Mon Oct 13 17:36:22 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:30:32 2009 Subject: [plt-scheme] Re: hint for debugging file navigator freezing bug in DrScheme 4.1.1, english, on Windows XP Professional, Service Pack 2 In-Reply-To: <0lmte4tmen55amedhp121goon9tsbbnl5f@4ax.com> References: <4lhte4hs754lbvg9srag91ndi6lkialgkf@4ax.com> <4lhte4hs754lbvg9srag91ndi6lkialgkf-e09XROE/p8c@public.gmane.org> <18670.53042.500490.297479@arabic.ccs.neu.edu> <0lmte4tmen55amedhp121goon9tsbbnl5f@4ax.com> Message-ID: <18675.48982.521332.900416@arabic.ccs.neu.edu> On Oct 10, Benjamin L.Russell wrote: > On Thu, 9 Oct 2008 23:42:42 -0400, Eli Barzilay > wrote: > > >On Oct 10, Benjamin L.Russell wrote: > >> > >> Previously, discussion of this bug had led to the hypothesis that > >> perhaps it had been caused by Windows itself as a result of > >> navigating through local folders on a networked computer. > > > >That still sounds like the most likely option -- the save dialog on > >Windows is the standard Windows dialog, and while the dialog is up, > >there is no Scheme code that does anything with it. > > Aha! That's why! I just visually compared the file navigators for > DrScheme and newLISP, and discovered that while the navigator for > DrScheme is the standard Windows dialog, the one for newLISP > apparently seems a part of newLISP itself, and behaves as a separate > window for a Windows application program. That's why it's better to use the native Windows dialog. > Here are links to hosted snapshots of the three files: > [...] It looks like they're also using the native Windows dialog. > Probably the newLISP developers ran into exactly the same problem > with the Windows file navigator, and decided to re-create a > non-buggy version of the file navigator to avoid this specific > problem. Their navigator runs as a separate Windows application > program, and not as the standard Windows dialog box. Somehow, this > resolves the problem, and their file navigator does not hang. I'm not sure that this is what motivated any kind of change. The fact is that the most popular platform PLT is used on is Windows (unsurprisingly), but I have not heard of such issues until your message. (I'm also using Windows on occasions, and never had such a problem.) > >Now, it might be that things are setup in a way that causes such > >delays. But to be able to start debugging it, we need some > >practical way to recreate the problem. > > To recreate the problem, just start DrScheme on Windows XP > Professional, Service Pack 2, and start navigating through a dozen > or so directories. At some point, your standard Windows navigator > will suddenly freeze for a few seconds. I've done that. Just in case, I re-did it now, and I counted at least a 100 directory changes with no visible freeze. (I did go to system directories, directories with many scheme files and few scheme files, directories with big files, the root, "my computer", etc.) My system is also XP with SP2. On Oct 10, Benjamin L.Russell wrote: > > I just thought of an even easier solution: Since their application > is open-source and is licensed under the GNU GPL (Version 3), just > copy and modify their source code for their navigator, and apply it > to DrScheme. No need to reinvent the wheel! We have a Scheme-version of the open/save dialogs -- they're being used on the Unix platforms. But still the advantages of a native dialog are greater than being able to tweak the code. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From aghuloum at cs.indiana.edu Mon Oct 13 17:52:25 2008 From: aghuloum at cs.indiana.edu (Abdulaziz Ghuloum) Date: Thu Mar 26 02:30:32 2009 Subject: [plt-scheme] define-values/invoke-unit in an internal definition context In-Reply-To: <20081013131105.3C2F06500B2@mail-svr1.cs.utah.edu> References: <20081009130355.74B5E6500B1@mail-svr1.cs.utah.edu> <20081011111711.4C3036500BD@mail-svr1.cs.utah.edu> <852C0B97-88ED-42F8-A870-E6890A802DC1@cs.indiana.edu> <20081013131105.3C2F06500B2@mail-svr1.cs.utah.edu> Message-ID: <405802C1-E825-4A79-A3EF-65D8152C8928@cs.indiana.edu> On Oct 13, 2008, at 9:11 AM, Matthew Flatt wrote: > Thanks very much for your note! Sure thing. > I must say that I was confused about this message for a while. I > thought you meant that you incorrectly implemented the algorithm that > Oscar defined. But from my earlier study of Oscar's system, I expected > the examples above to behave in exactly the way that you claim is > broken. The again, `petite' (v7.3) as well as `ikarus' (current from > bzr) gave your predicted result. Sorry about my confusing message. You're right, Oscar's original algorithm did not account for these exact marks. Kent corrected it later. > It eventually dawned on me that someone fixed Oscar's algorithm > itself, > perhaps since v6.9 of `petite' that I was using originally. You didn't > say how the algorithm was fixed, but after a few more experiments, it > was easy enough to guess: the expander takes a diff of the lexical > context on the use of a module id compared to the binding of the > module, and it applies that diff to the module's exported ids when > they're unpacked by `import'. Sure enough, when I look at > "psyntax.expander.ss", I see the diff-transferring operation in > `module-interface-exp-id*'. And in "psyntax.ss" from Kent's page, I > see > that `lookup-import-binding-name' acquired a new `new-marks' argument > between versions 6.9 and 7.0. > > Is that all correct? This is all exactly correct. Since the module identifier (or the sig identifier) may get extra marks from the point in which it was defined to the point in which it is used, the identifiers that get pulled from the module/signature record should behave as if they'd undergone the same transformations (by acquiring the diff of the marks). > You're completely right that the treatment of bindings with units was > based on Oscar's (old) `module', and that's why we have the (old) bug. > I will look into adding a context-diff-and-apply operation to PLT > Scheme's macro system. This may break some code that depends on the bug, but better to fix it now than later. Aziz,,, From matthias at ccs.neu.edu Mon Oct 13 20:47:27 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:30:32 2009 Subject: [plt-scheme] Re: [plt-edu] some world questions.... In-Reply-To: <9b1fff280810131251l33c19987qfbefa413ba64978e@mail.gmail.com> References: <9b1fff280810131251l33c19987qfbefa413ba64978e@mail.gmail.com> Message-ID: <1FA1E9C4-3CE7-4B2B-9618-65770738C2F1@ccs.neu.edu> On Oct 13, 2008, at 3:51 PM, Marco Morazan wrote: > Dear All, > > Can someone point me in the right direction? > > 1) Can we distinguish between the left and right mouse buttons > using world.ss? No, I am using a Mac :-) > 2) What are MouseEvents 'enter and 'leave? The events signal that the mouse has "entered" or "left" the canvas. -- Matthias > > Thanks! > > -- > > Cheers, > > Marco > _________________________________________________ > PLT Educators mailing list > plt-edu@list.cs.brown.edu > http://list.cs.brown.edu/mailman/listinfo/plt-edu From robby at cs.uchicago.edu Mon Oct 13 20:49:48 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:30:33 2009 Subject: [plt-scheme] Re: [plt-edu] some world questions.... In-Reply-To: <1FA1E9C4-3CE7-4B2B-9618-65770738C2F1@ccs.neu.edu> References: <9b1fff280810131251l33c19987qfbefa413ba64978e@mail.gmail.com> <1FA1E9C4-3CE7-4B2B-9618-65770738C2F1@ccs.neu.edu> Message-ID: <932b2f1f0810131749r37e2e9fkda9b08732ef0c36a@mail.gmail.com> On Mon, Oct 13, 2008 at 7:47 PM, Matthias Felleisen wrote: > > On Oct 13, 2008, at 3:51 PM, Marco Morazan wrote: > >> Dear All, >> >> Can someone point me in the right direction? >> >> 1) Can we distinguish between the left and right mouse buttons using >> world.ss? > > No, I am using a Mac :-) FWIW, control-clicking on a mac is the same as right-clicking on other platforms and macs nowadays come with mice that have right-mouse buttons! (Those ones with the little tiny ball built into them are sensitive to which side of them you click on, I believe.) Robby From matthias at ccs.neu.edu Mon Oct 13 20:59:25 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:30:33 2009 Subject: [plt-scheme] Re: [plt-edu] some world questions.... In-Reply-To: <932b2f1f0810131749r37e2e9fkda9b08732ef0c36a@mail.gmail.com> References: <9b1fff280810131251l33c19987qfbefa413ba64978e@mail.gmail.com> <1FA1E9C4-3CE7-4B2B-9618-65770738C2F1@ccs.neu.edu> <932b2f1f0810131749r37e2e9fkda9b08732ef0c36a@mail.gmail.com> Message-ID: <7EF4E055-F162-46E7-A7B9-3A15F31D94B5@ccs.neu.edu> On Oct 13, 2008, at 8:49 PM, Robby Findler wrote: > On Mon, Oct 13, 2008 at 7:47 PM, Matthias Felleisen > wrote: >> >> On Oct 13, 2008, at 3:51 PM, Marco Morazan wrote: >> >>> Dear All, >>> >>> Can someone point me in the right direction? >>> >>> 1) Can we distinguish between the left and right mouse buttons using >>> world.ss? >> >> No, I am using a Mac :-) > > FWIW, control-clicking on a mac is the same as right-clicking on other > platforms and macs nowadays come with mice that have right-mouse > buttons! (Those ones with the little tiny ball built into them are > sensitive to which side of them you click on, I believe.) (Even I know that, which is why I added the :-) From morazanm at gmail.com Mon Oct 13 22:08:08 2008 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:30:33 2009 Subject: [plt-scheme] Re: [plt-edu] some world questions.... In-Reply-To: <1FA1E9C4-3CE7-4B2B-9618-65770738C2F1@ccs.neu.edu> References: <9b1fff280810131251l33c19987qfbefa413ba64978e@mail.gmail.com> <1FA1E9C4-3CE7-4B2B-9618-65770738C2F1@ccs.neu.edu> Message-ID: <9b1fff280810131908q27ab2ca0id5307e4cad340564@mail.gmail.com> >> >> 1) Can we distinguish between the left and right mouse buttons using >> world.ss? > > No, I am using a Mac :-) > :-( , but OK (on the no). > >> 2) What are MouseEvents 'enter and 'leave? > > The events signal that the mouse has "entered" or "left" the canvas. > This is what I thought.....I will double check the code written by my students. Has anyone reported leaving the canvas not being detected? I have received some claims like this. I just tested it and it seems to work just fine for me. Thanks! -- Cheers, Marco From deepankar.sharma at gmail.com Tue Oct 14 01:07:20 2008 From: deepankar.sharma at gmail.com (Deep) Date: Thu Mar 26 02:30:33 2009 Subject: [plt-scheme] cannot profile code Message-ID: I cannot profile an application that I am currently working on. I am using DrScheme 4.1.1 on windows. Here is the error trace I get - require: namespace mismatch; reference (phase 0) to a module "C: \Program Files\PLT\collects\scheme\private\kw.ss" that is not available (phase level 0) in: #%app Anyway to debug this error ? From deepankar.sharma at gmail.com Tue Oct 14 01:22:20 2008 From: deepankar.sharma at gmail.com (Deep) Date: Thu Mar 26 02:30:33 2009 Subject: [plt-scheme] Re: cannot profile code In-Reply-To: References: Message-ID: <196230b2-abe2-4590-8202-4b6a8d6cef8e@p49g2000hsd.googlegroups.com> Just wanted to clarify - When i choose the "Debugging" under Dynamic Properties of the module language, things work just fine. However if i change the to Dynamic Properties to "Debugging and Profiling" i get the error message pasted above. On Oct 14, 1:07?am, Deep wrote: > I cannot profile an application that I am currently working on. I am > using DrScheme 4.1.1 on windows. > Here is the error trace I get - > require: namespace mismatch; reference (phase 0) to a module "C: > \Program Files\PLT\collects\scheme\private\kw.ss" that is not > available (phase level 0) in: #%app > > Anyway to debug this error ? > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme From DekuDekuplex at Yahoo.com Tue Oct 14 03:11:07 2008 From: DekuDekuplex at Yahoo.com (Benjamin L.Russell) Date: Thu Mar 26 02:30:33 2009 Subject: [plt-scheme] What is the type of the "hello_world" function in Typed Scheme? Message-ID: As an experiment, I would like to write the "hello_world" function in Typed Scheme, but am having difficulty with the type annotation. This is the function in the regular #scheme Module language: #lang scheme (define hello_world (display "Hello, world!\n")) However, although I browsed through the following Typed Scheme manual: Typed Scheme: Scheme with Static Types http://docs.plt-scheme.org/typed-scheme/ it wasn't clear how to define a function that does not take any input. Does anybody know how to define the above-mentioned function in Typed Scheme? -- Benjamin L. Russell From noelwelsh at gmail.com Tue Oct 14 05:26:47 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:30:33 2009 Subject: [plt-scheme] What is the type of the "hello_world" function in Typed Scheme? In-Reply-To: References: Message-ID: On Tue, Oct 14, 2008 at 8:11 AM, Benjamin L. Russell wrote: > As an experiment, I would like to write the "hello_world" function in > Typed Scheme, but am having difficulty with the type annotation. Scheme style is hello-world, not hello_world. Anyway, here's the answer: #lang typed-scheme (: hello-world Void) (define hello-world (display "Hello, world")) (: hello-world-function (-> Void)) (define (hello-world-function) (display "Hello world.")) N. From foolsmart2005 at gmail.com Tue Oct 14 05:57:58 2008 From: foolsmart2005 at gmail.com (SamuelXiao) Date: Thu Mar 26 02:30:33 2009 Subject: [plt-scheme] Re: How to make the following code more clear? In-Reply-To: References: <372f1da8-d335-4366-9168-92ff288a37c4@b2g2000prf.googlegroups.com> Message-ID: <36ca22b8-1a85-4fb1-8585-cf31a5b3b619@q26g2000prq.googlegroups.com> Thanks very much. On Oct 14, 2:44 am, Matthias Felleisen wrote: > #lang typed-scheme > > (: selectionsort ($B"O(B ($B&A(B) ((Listof $B&A(B) ($B&A(B $B&A(B -> Boolean) -> (Listof > $B&A(B)))) > ;; gen. rec.: repeatedly pick/remove the largest value wrt <=, create > lists from it > (define (selectionsort l0 <=) > (: max ($B&A(B $B&A(B -> $B&A(B)) > (define (max n m) (if (<= n m) m n)) > > (: = ($B&A(B $B&A(B -> Boolean)) > (define (= n m) (and (<= n m) (<= m n))) > > (: largest ((cons $B&A(B (Listof $B&A(B)) -> $B&A(B)) > ;; pick the largest value from the list > (define (largest lst) > (foldr max (car lst) (cdr lst))) > > (: remove ((Listof $B&A(B) $B&A(B -> (Listof $B&A(B))) > ;; remove the given value from the list > (define (remove lst val) > (cond > [(= (car lst) val) (cdr lst)] > [else (cons (car lst) (remove (cdr lst) val))])) > > (: aux ((Listof $B&A(B) -> (Listof $B&A(B))) > (define (aux l) > (cond > [(null? l) '()] > [else (let ([m (largest l)]) (cons m (aux (remove l m))))])) > > (aux l0)) > > (equal? (selectionsort '(2 1 4 3) <=) '(4 3 2 1)) > (equal? (selectionsort '(2 1 4 3) >=) '(1 2 3 4))_________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From DekuDekuplex at Yahoo.com Tue Oct 14 06:39:41 2008 From: DekuDekuplex at Yahoo.com (Benjamin L.Russell) Date: Thu Mar 26 02:30:34 2009 Subject: [plt-scheme] Re: What is the type of the "hello_world" function in Typed Scheme? References: Message-ID: <0ns8f41gk7dngfn8j9nss45sgcc3hhmoad@4ax.com> On Tue, 14 Oct 2008 10:26:47 +0100, "Noel Welsh" wrote: >On Tue, Oct 14, 2008 at 8:11 AM, Benjamin L. Russell > wrote: >> As an experiment, I would like to write the "hello_world" function in >> Typed Scheme, but am having difficulty with the type annotation. > >Scheme style is hello-world, not hello_world. Oops! You're right! You got me there.... :-P > Anyway, here's the answer: > >#lang typed-scheme > >(: hello-world Void) >(define hello-world > (display "Hello, world")) A minor point: The result is identical, whether "\n" appears at the end of the displayed string, or not. I got the same result with "printf" as well. With "write," the "\n" is displayed as the escape sequence itself (rather than the newline indicated by the escape sequence) if specified. Do you know any way to display exactly the characters specified in the argument string, without automatically appending a newline at the end? >(: hello-world-function (-> Void)) >(define (hello-world-function) > (display "Hello world.")) I tried this one out, but it didn't print anything. The same result occurred when "display" was substituted with "write," and with "printf," as well. Do you know how to rewrite this function in a way that its behavior is identical to "hello-world"; i.e., in a way that actually prints the argument string specified? -- Benjamin L. Russell From d.j.gurnell at gmail.com Tue Oct 14 07:03:20 2008 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Thu Mar 26 02:30:34 2009 Subject: [plt-scheme] Re: What is the type of the "hello_world" function in Typed Scheme? In-Reply-To: <0ns8f41gk7dngfn8j9nss45sgcc3hhmoad@4ax.com> References: <0ns8f41gk7dngfn8j9nss45sgcc3hhmoad@4ax.com> Message-ID: <6593EDF5-0C07-412C-B72D-009199EF1B87@gmail.com> Benjamin Russell wrote: > A minor point: The result is identical, whether "\n" appears at the > end of the displayed string, or not. I got the same result with > "printf" as well. With "write," the "\n" is displayed as the escape > sequence itself (rather than the newline indicated by the escape > sequence) if specified. > > Do you know any way to display exactly the characters specified in the > argument string, without automatically appending a newline at the end? You're running this in DrScheme, right? I think you're seeing this because DrScheme automatically moves to a newline when it puts the prompt up in the interactions window. Newlines are printed as prescribed except on the last line of output from your function/ program. Here's a demo: #lang typed-scheme (display "Hi") (display "Hi\n") (display "Hi\n\n") (display "Hi\n\n\n") (display "Hi\n\n\n\n") when I run this program in DrScheme I get the following (comments added afterwards): HiHi ; <- No newline here Hi Hi Hi > ; <- DrScheme prompt I think if you were to run your code from the command line, everything would work as expected. -- Dave From eli at barzilay.org Tue Oct 14 07:05:11 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:30:34 2009 Subject: [plt-scheme] Re: What is the type of the "hello_world" function in Typed Scheme? In-Reply-To: <0ns8f41gk7dngfn8j9nss45sgcc3hhmoad@4ax.com> References: <0ns8f41gk7dngfn8j9nss45sgcc3hhmoad@4ax.com> Message-ID: <18676.31975.637989.523766@arabic.ccs.neu.edu> On Oct 14, Benjamin L.Russell wrote: > On Tue, 14 Oct 2008 10:26:47 +0100, "Noel Welsh" > wrote: > > > Anyway, here's the answer: > > > >#lang typed-scheme > > > >(: hello-world Void) > >(define hello-world > > (display "Hello, world")) > > A minor point: The result is identical, whether "\n" appears at the > end of the displayed string, or not. I got the same result with > "printf" as well. With "write," the "\n" is displayed as the escape > sequence itself (rather than the newline indicated by the escape > sequence) if specified. This is due to the way that DrScheme shows its prompt -- always on a new line. (It wouldn't make sense for it to show the prompt on the same line after some random output.) > Do you know any way to display exactly the characters specified in the > argument string, without automatically appending a newline at the end? Because the newline is part of DrScheme's REPL presentation there is no way to avoid the newline. But if you add a second newline, you will see an empty line. > >(: hello-world-function (-> Void)) > >(define (hello-world-function) > > (display "Hello world.")) > > I tried this one out, but it didn't print anything. The same result > occurred when "display" was substituted with "write," and with > "printf," as well. > > Do you know how to rewrite this function in a way that its behavior is > identical to "hello-world"; i.e., in a way that actually prints the > argument string specified? You still need to call the function: #lang typed-scheme (: hello-world-function (-> Void)) (define (hello-world-function) (display "Hello world.")) (hello-world-function) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From lunarc.lists at gmail.com Tue Oct 14 08:46:35 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:30:34 2009 Subject: [plt-scheme] Re: What is the type of the "hello_world" function in Typed Scheme? In-Reply-To: <0ns8f41gk7dngfn8j9nss45sgcc3hhmoad@4ax.com> References: <0ns8f41gk7dngfn8j9nss45sgcc3hhmoad@4ax.com> Message-ID: 2008/10/14 Benjamin L. Russell : >>(: hello-world-function (-> Void)) >>(define (hello-world-function) >> (display "Hello world.")) > > I tried this one out, but it didn't print anything. The same result > occurred when "display" was substituted with "write," and with > "printf," as well. > > Do you know how to rewrite this function in a way that its behavior is > identical to "hello-world"; i.e., in a way that actually prints the > argument string specified? (Sorry! I didn't reply to list the first time. . .) You have to call the function: (: hello-world-function (-> Void)) (define (hello-world-function) (display "Hello world.")) (hello-world-function) Henk From mflatt at cs.utah.edu Tue Oct 14 09:29:28 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:30:34 2009 Subject: [plt-scheme] define-values/invoke-unit in an internal definition context In-Reply-To: <405802C1-E825-4A79-A3EF-65D8152C8928@cs.indiana.edu> References: <20081009130355.74B5E6500B1@mail-svr1.cs.utah.edu> <20081011111711.4C3036500BD@mail-svr1.cs.utah.edu> <852C0B97-88ED-42F8-A870-E6890A802DC1@cs.indiana.edu> <20081013131105.3C2F06500B2@mail-svr1.cs.utah.edu> <405802C1-E825-4A79-A3EF-65D8152C8928@cs.indiana.edu> Message-ID: <20081014132930.2662B6500A9@mail-svr1.cs.utah.edu> At Mon, 13 Oct 2008 17:52:25 -0400, Abdulaziz Ghuloum wrote: > > You're completely right that the treatment of bindings with units was > > based on Oscar's (old) `module', and that's why we have the (old) bug. > > I will look into adding a context-diff-and-apply operation to PLT > > Scheme's macro system. > > This may break some code that depends on the bug, but better to fix > it now than later. Right --- done in SVN. Except for a new syntax primitive, the changes affect only forms exported by `scheme/unit' (and `mzlib/unit'). Noel: the program in your original message now compiles as expected. Matthew From noelwelsh at gmail.com Tue Oct 14 10:24:30 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:30:34 2009 Subject: [plt-scheme] define-values/invoke-unit in an internal definition context In-Reply-To: <20081014132930.2662B6500A9@mail-svr1.cs.utah.edu> References: <20081009130355.74B5E6500B1@mail-svr1.cs.utah.edu> <20081011111711.4C3036500BD@mail-svr1.cs.utah.edu> <852C0B97-88ED-42F8-A870-E6890A802DC1@cs.indiana.edu> <20081013131105.3C2F06500B2@mail-svr1.cs.utah.edu> <405802C1-E825-4A79-A3EF-65D8152C8928@cs.indiana.edu> <20081014132930.2662B6500A9@mail-svr1.cs.utah.edu> Message-ID: On Tue, Oct 14, 2008 at 2:29 PM, Matthew Flatt wrote: > Right --- done in SVN. Except for a new syntax primitive, the changes > affect only forms exported by `scheme/unit' (and `mzlib/unit'). > > > Noel: the program in your original message now compiles as expected. Thanks! N. From sk at cs.brown.edu Tue Oct 14 11:33:28 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:30:35 2009 Subject: [plt-scheme] Re: [plt-edu] Should computer programming be mandatory In-Reply-To: <101420081521.4927.48F4B900000706F10000133F22064244139F9F9F059D0E@comcast.net> References: <101420081521.4927.48F4B900000706F10000133F22064244139F9F9F059D0E@comcast.net> Message-ID: Alvin, The US is obsessed about "energy security", which is the idea that the country needs to wean itself of excessive dependence on foreign countries for its energy needs. (This isn't the forum to discuss whether it's possible or even wise to become *completely* independent, but certainly *reducing dependence* seems wise.) The US needs to likewise be thinking about its "intellectual security", i.e., the ability to grow enough STEM (science, technology, engineering, mathematics) talent at home so that it doesn't need to keep importing the likes of Matthias and me. Because, you know, one day that supply will dry up, too. Shriram From domeshek at stottlerhenke.com Tue Oct 14 12:08:42 2008 From: domeshek at stottlerhenke.com (Eric Domeshek) Date: Thu Mar 26 02:30:35 2009 Subject: [plt-scheme] WXME Decoding Error In-Reply-To: <20081011113924.E6D086500BD@mail-svr1.cs.utah.edu> References: <48EFCC4C.6000903@stottlerhenke.com> <20081011113924.E6D086500BD@mail-svr1.cs.utah.edu> Message-ID: <48F4C40A.5090105@stottlerhenke.com> Matthew, Thanks for the suggestion on my WMXE file-reading problem. In the end, I seem to have squashed (most of) that bug by more careful study of additional parts of the Framework docs. I hadn't read the Handler chapter, so I was getting a default editor. Now I've got appropriate calls to handler:insert-format-handler and handler:current-create-new-window so I get the right kind of window, which gives me my pasteboard% subclass as expected (and thus eliminates the unexpected text% editor). I've still got a few residual questions: 1- I also found the Finder chapter, and have calls to set up finder:default-extension and finder:default-filters. However, these seem to only affect the Save/Save-As dialogs. The Open dialog still comes up with "Any" as its only filter. Is there a comparably simple way to set default filters on that dialog as well? 2- After my now (mostly) successful file load, I'm still getting the following error message: > send: no such method: set-position for class: eer-pasteboard% Based on searching the docs, this method seems to be associated with scroll-event%s and text% editors. So maybe there's somewhere else in the framework that is still expecting a text% object? Any thoughts on what else I might have overlooked as a PLT GUI newbie? 3- Let me take another shot at the other query I threw into my initial email: Where should I be stashing, and how should I be accessing, global (for a given editor's diagram or graph structure) state-objects, such that the specialized "read" methods of my specialized snip-class%s can find that state-object (say, in order to log the newly created snip%s into that object, or look up previously created snip%s or other underlying application objects that a new snip is supposed to connect up with)? My current (bogus-feeling) approach is to count on the read method being called after on-file-load has run (and before any other on-file-load has run) so I can set up a global variable with a state-object for the file's contents. As I said, this feels bogus, but I don't see how to make such shared data accessible to the read methods of these snip-class%s... I started down the header/footer path at one point, but there's really no more data that needs to be stored in the file format--what I need to know is all part of (of reconstructible from) the snip data. I suppose after the read methods complete there is an implicit call to the editor%'s insert method. Is that the place to put any such editor-state-dependent code? That seems a little funky, as I think of the state-management as being part of the creation of a complete/consistent snip% object (which seems like the job of read). I'd also have to overhaul the editor-actions that create the snip%s so that they rely on the same magic insert behavior to complete the snip% data structures. Then of course there's figuring out if what I really want is to tack this onto on-insert or after-insert, and what to do about edit-sequences... Somehow I was hoping for a simpler solution. 4- One final info-access style question: What is the right way to figure out the directory from which a module is being loaded? My problem here is that I want my custom editor app to use some custom icons, so I've got an icons sub-directory beneath the directory that holds my code, but I don't know how to establish dynamically the directory that the code is loading from. This seems like there must be a simple straightforward call. Oh yes... I doubt it matters for these queries, but I forgot to say in my original note: I'm working with PLT 4.1.1 on Windows XP. Thanks as always for the great support here. --Eric Matthew Flatt wrote: > At Fri, 10 Oct 2008 17:42:36 -0400, Eric Domeshek wrote: > >> But today I seem to have run into a bit of a brick wall in attempting to >> use the WXME encoding/decoding piece of the framework to save and reload >> my diagrams. I've gotten a far as saving the data (writing a file with >> seven types of custom snips). Unfortunately, I can't load the data back >> in, and the error message/trace is not helping me much. Here's what >> comes up in the console window when I try to load one of these saved >> files by invoking the default File|Open command: >> >> >>> insert-file in text%: error loading the file >>> >>> [...] >>> >>> >> Can anyone suggest a way forward? For starters, I'm not sure why >> there's a text% floating around. I've only been dealing with >> pasteboard%s. >> > > I don't have any great ideas, but you might try parsing the file using > the `wxme' library, which might give better information about decoding > problems. > > I'm puzzled by the "insert-file in text%" message, too. Looking at the > source where that message can be reported, it seems to be always within > a `text%' object, and never in a `pasteboard%'. > > If you're able and willing to send me code so I can see the problem on > my machine, I would try it out. > > > >> Also, while I'm asking questions... As I read in my data, I need to >> create some custom structures that get wrapped inside my snips (i.e. >> "nodes" and "links" in an underlying graph structure). That custom data >> all needs to be attached to a diagram-level object (the "graph"). But I >> don't see how the read methods in my various snip-class%es can best get >> hold of the diagram object (which is stashed in the frame%, which holds >> the pasteboard%, which will contain the snip%s that get created by those >> snip-class% read methods). For now, I've got a pasteboard% on-load-file >> method setting a global variable so my various read methods can get hold >> of that shared diagram. This seem ugly. Any better ideas? >> > > I'm not sure I understand, but I wonder whether the information should > instead reside in the pasteboard so that it's written and restored > though `write-editor-global-footer' and `read-editor-global-footer'? > > > Matthew > From robby at cs.uchicago.edu Tue Oct 14 12:40:25 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:30:35 2009 Subject: [plt-scheme] WXME Decoding Error In-Reply-To: <48F4C40A.5090105@stottlerhenke.com> References: <48EFCC4C.6000903@stottlerhenke.com> <20081011113924.E6D086500BD@mail-svr1.cs.utah.edu> <48F4C40A.5090105@stottlerhenke.com> Message-ID: <932b2f1f0810140940k5b91425u19a2f0676acdf35@mail.gmail.com> On Tue, Oct 14, 2008 at 11:08 AM, Eric Domeshek wrote: > 1- I also found the Finder chapter, and have calls to set up > finder:default-extension and finder:default-filters. However, these seem to > only affect the Save/Save-As dialogs. The Open dialog still comes up with > "Any" as its only filter. Is there a comparably simple way to set default > filters on that dialog as well? I recommend you just call the mred-level dialogs, instead of the framework ones. The framework ones are legacy code now -- most (all?) of the functionality is now at the mred layer. > 2- After my now (mostly) successful file load, I'm still getting the > following error message: >> >> send: no such method: set-position for class: eer-pasteboard% > > Based on searching the docs, this method seems to be associated with > scroll-event%s and text% editors. So maybe there's somewhere else in the > framework that is still expecting a text% object? Any thoughts on what else > I might have overlooked as a PLT GUI newbie? This could easily be a bug in the framework. Do you get a stack trace? Or perhaps do you have a small program that reproduces the problem? > 4- One final info-access style question: What is the right way to figure out > the directory from which a module is being loaded? My problem here is that > I want my custom editor app to use some custom icons, so I've got an icons > sub-directory beneath the directory that holds my code, but I don't know how > to establish dynamically the directory that the code is loading from. This > seems like there must be a simple straightforward call. I think you want define-runtime-path. Robby From domeshek at stottlerhenke.com Tue Oct 14 13:40:09 2008 From: domeshek at stottlerhenke.com (Eric Domeshek) Date: Thu Mar 26 02:30:35 2009 Subject: [plt-scheme] WXME Decoding Error In-Reply-To: <932b2f1f0810140940k5b91425u19a2f0676acdf35@mail.gmail.com> References: <48EFCC4C.6000903@stottlerhenke.com> <20081011113924.E6D086500BD@mail-svr1.cs.utah.edu> <48F4C40A.5090105@stottlerhenke.com> <932b2f1f0810140940k5b91425u19a2f0676acdf35@mail.gmail.com> Message-ID: <48F4D979.9070605@stottlerhenke.com> Robby Findler wrote: > On Tue, Oct 14, 2008 at 11:08 AM, Eric Domeshek > wrote: > >> 1- I also found the Finder chapter, and have calls to set up >> finder:default-extension and finder:default-filters. However, these seem to >> only affect the Save/Save-As dialogs. The Open dialog still comes up with >> "Any" as its only filter. Is there a comparably simple way to set default >> filters on that dialog as well? >> > > I recommend you just call the mred-level dialogs, instead of the > framework ones. The framework ones are legacy code now -- most (all?) > of the functionality is now at the mred layer. > Interesting... Is the whole Framework now considered deprecated legacy code, or just its file dialogs? I was using the Framework in an attempt to get a lot of basic functionality taken care of quickly. In particular, I liked that it gave me all the basic menus with mostly sensible versions of their actions. Is the recommendation that I use the Framework menus and the method file-menu:open-callback in order to set up a variant of handler:open-file that uses the GUI-level get-file and then calls "handler:edit-file to open the file, once the user has chosen it."? >> 2- After my now (mostly) successful file load, I'm still getting the >> following error message: >> >>> send: no such method: set-position for class: eer-pasteboard% >>> >> Based on searching the docs, this method seems to be associated with >> scroll-event%s and text% editors. So maybe there's somewhere else in the >> framework that is still expecting a text% object? Any thoughts on what else >> I might have overlooked as a PLT GUI newbie? >> > > This could easily be a bug in the framework. Do you get a stack trace? > Or perhaps do you have a small program that reproduces the problem? > I'm not getting much of a useful error-report / stack-trace, which may be because of some try/catch forms I've got wrapped in various places. I'll probably come back to this one another day, either to try to get a better trace and/or to build a simplified case... >> 4- One final info-access style question: What is the right way to figure out >> the directory from which a module is being loaded? My problem here is that >> I want my custom editor app to use some custom icons, so I've got an icons >> sub-directory beneath the directory that holds my code, but I don't know how >> to establish dynamically the directory that the code is loading from. This >> seems like there must be a simple straightforward call. >> > > I think you want define-runtime-path. > Thanks. I think I've got that working now. > Robb --Eric From robby at cs.uchicago.edu Tue Oct 14 13:45:31 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:30:35 2009 Subject: [plt-scheme] WXME Decoding Error In-Reply-To: <48F4D979.9070605@stottlerhenke.com> References: <48EFCC4C.6000903@stottlerhenke.com> <20081011113924.E6D086500BD@mail-svr1.cs.utah.edu> <48F4C40A.5090105@stottlerhenke.com> <932b2f1f0810140940k5b91425u19a2f0676acdf35@mail.gmail.com> <48F4D979.9070605@stottlerhenke.com> Message-ID: <932b2f1f0810141045x56bace75oe47755eefdcc268f@mail.gmail.com> On Tue, Oct 14, 2008 at 12:40 PM, Eric Domeshek wrote: > Robby Findler wrote: >> >> On Tue, Oct 14, 2008 at 11:08 AM, Eric Domeshek >> wrote: >> >>> >>> 1- I also found the Finder chapter, and have calls to set up >>> finder:default-extension and finder:default-filters. However, these seem >>> to >>> only affect the Save/Save-As dialogs. The Open dialog still comes up >>> with >>> "Any" as its only filter. Is there a comparably simple way to set >>> default >>> filters on that dialog as well? >>> >> >> I recommend you just call the mred-level dialogs, instead of the >> framework ones. The framework ones are legacy code now -- most (all?) >> of the functionality is now at the mred layer. >> > > Interesting... Is the whole Framework now considered deprecated legacy > code, or just its file dialogs? Just the file dialogs -- well there may be another corner I'd disrecommend, but nothign comes to mind right away. > I was using the Framework in an attempt to > get a lot of basic functionality taken care of quickly. In particular, I > liked that it gave me all the basic menus with mostly sensible versions of > their actions. Is the recommendation that I use the Framework menus and the > method file-menu:open-callback in order to set up a variant of > handler:open-file that uses the GUI-level get-file and then calls > "handler:edit-file to open the file, once the user has chosen it."? handler:* is still good, yep. >>> 2- After my now (mostly) successful file load, I'm still getting the >>> following error message: >>> >>>> >>>> send: no such method: set-position for class: eer-pasteboard% >>>> >>> >>> Based on searching the docs, this method seems to be associated with >>> scroll-event%s and text% editors. So maybe there's somewhere else in the >>> framework that is still expecting a text% object? Any thoughts on what >>> else >>> I might have overlooked as a PLT GUI newbie? >>> >> >> This could easily be a bug in the framework. Do you get a stack trace? >> Or perhaps do you have a small program that reproduces the problem? >> > > I'm not getting much of a useful error-report / stack-trace, which may be > because of some try/catch forms I've got wrapped in various places. I'll > probably come back to this one another day, either to try to get a better > trace and/or to build a simplified case... Okay. I'll keep my eyes open too. I tried to be careful to keep the generic editor-level functionality separate from the text- and pasteboard- stuff, but the pasteboard-based stuff doesn't get used as much so I could easily have made a mistake. Robby From matthias at ccs.neu.edu Tue Oct 14 14:25:08 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:30:35 2009 Subject: [plt-scheme] Re: [plt-edu] Should computer programming be mandatory In-Reply-To: References: <101420081521.4927.48F4B900000706F10000133F22064244139F9F9F059D0E@comcast.net> Message-ID: <586ED94A-A94D-4F2D-AD89-92B8ECA50788@ccs.neu.edu> Two comments: 1. On the false dichotomy: HtDP's first three teaching languages are basically mathematics, ignoring the parentheses. We use -- arithmetic, for many different forms of data -- algebra, for (potentially conditional) function definitions -- pre-calculus, for induction and recursion (these things converge, like series) Forgive me if I got the American names wrong for these subjects. In short, when you 'program' HtDP reactive worlds and soon distributed worlds, you are solving mathematical problems and you are learning mathematics. 2. On learning a second language: I recently exchanged email with a mathematics professor at BYU who studies education. He had dug out large-scale studies (involving an entire school district in Indianapolis and part of a second school district elsewhere) that compared high school students who took course in English plus Latin with those who took only English courses. In several standard tests on English, the English+Latin students outscored the English-only students by leaps and bounds. -- The effect carries over to other __formal__ instruction on second languages, but it isn't as large. (I felt pretty good after reading his write-up, because I had defended the study of a second language in the Houston school district many times on this basis, but had always been rejected.) -- If given the chance, I'd love to prove this conjecture for TeachScheme! at the same scale. -- Matthias On Oct 14, 2008, at 1:16 PM, Bruce Boyes wrote: > At 09:21 10/14/2008, arkppp@comcast.net wrote: >> Some food for thought.... >> >> http://weblog.infoworld.com/fatalexception/archives/2008/10/ >> mandatory_compu.html > > Interesting... yes I agree with the early statement in the HtDP > text that 'programming' (as defined in HtDP) should be a part of > every liberal arts education... not just for techies. > > Everyone should learn to think critically and apply algebra to > everyday problems. > > It's interesting reading some of the comments too. For example one > ready bemoans studying Latin, never "using" it later, and thus > "losing" it. I don't agree with that statement... no one speaks > Latin, or has for a few centuries, but it it's still the basis for > all the Romance languages - http://en.wikipedia.org/wiki/ > Romance_languages - so you don't ever lose it or stop using it, > really. > > I actually enjoyed taking two years of Latin in high school (it was > not mandatory and in fact these were the last two years it was > offered...), which brings to mind this doggerel: > > Latin is a dead language > Dead as dead can be! > It killed off all the Romans > And now it's killing me! > > Bruce > > ------- WWW.SYSTRONIX.COM ---------- > Real embedded Java and much more > +1-801-534-1017 Salt Lake City, USA > > _________________________________________________ > PLT Educators mailing list > plt-edu@list.cs.brown.edu > http://list.cs.brown.edu/mailman/listinfo/plt-edu From noelwelsh at gmail.com Tue Oct 14 19:13:49 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:30:36 2009 Subject: [plt-scheme] unit testing in r6rs In-Reply-To: <44986279-57F8-4120-8AFD-EC2F892AE96B@vub.ac.be> References: <44986279-57F8-4120-8AFD-EC2F892AE96B@vub.ac.be> Message-ID: On Mon, Oct 13, 2008 at 1:58 PM, Wolfgang De Meuter wrote: > Hello, > > I'm a bit puzzled with all the languages and module/unit/library-variations. > > I'm developing R6RS and would like to write unit tests for my libraries. > > Which libraries do I need to include to do so, and which documentation > should I read? SchemeUnit is a unit testing framework for PLT Scheme. Here's a small example showing how you can use SchemeUnit from PLT Scheme's R6RS language: #lang r6rs (import (only (scheme base) require planet)) (require (planet schematics/schemeunit:3/test)) (check-equal? 1 2) HTH, Noel From dvanhorn at ccs.neu.edu Tue Oct 14 21:50:24 2008 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Thu Mar 26 02:30:36 2009 Subject: [plt-scheme] Embedded images in planet packages Message-ID: <48F54C60.3080904@ccs.neu.edu> I can't seem to install a planet package that has an image embedded in the source code (via Insert Image). When I try to inject the package, I get: write: cannot marshal constant that is embedded in compiled code: #(struct:object:image% ...) Any idea on how to work around this? Should this be considered a bug? David How to recreate in 4.1.1.3-svn14oct2008: planet create img/ planet fileinject dvanhorn img.plt 1 0 ;; ------------ ;; img/main.ss #lang scheme (provide img) (define img #|INSERTIMAGE|#) ;; eg, http://plt-scheme.org/logo.png ;; ------------- ;; img/info.ss #lang setup/infotab (define name "Embedded image test.") (define categories '(misc)) (define required-core-version "4.1.0") (define repositories (list "4.x")) (define primary-file '("main.ss")) (define blurb (list '(div "Just an embedded image."))) From thule124 at yahoo.com Tue Oct 14 21:50:47 2008 From: thule124 at yahoo.com (n n) Date: Thu Mar 26 02:30:36 2009 Subject: [plt-scheme] Linking Minikanren for The Reasoned Schemer in Mzscheme Message-ID: <823057.1714.qm@web55004.mail.re4.yahoo.com> Hello -- I think this is not a smart question, and I apologise; but it seems for me all the hard problems are either undecidable or involve linking... I recently discovered The Reasoned Schemer, and have been trying to follow it in mzscheme. I am quite new to the PLT implementation, and I seem to be having trouble getting the REPL to process the minikanren code, and then mine subsequently. At the moment, I am doing something like this: (using the Windows brand operating system from Microsoft Corporation) C:\download\ss> "c:\program files\plt\mzscheme.exe" ;;;(mzscheme turn on) >(enter! "minikanren.ss") ;;; minikanren code in the local directory, copied from the world wide web ;;; now I have no trouble running unification style queries like (run #f (q) (== q 5)) >(enter! "reasonedschemer.ss") ;;;my implementations of the book's definitions ;;; I get this error message: ;;; reasonedschemer.ss:6:28: compile: unbound variable in module in: fresh Apparently my reasonedschemer.ss file is not seeing the definitions available to me on the REPL. I have tried various combinations of (require ...) but am not sure if my local paths are causing problems with this. I have also tried simply appending my own definitions to minikanren.ss, but this also seemed to cause problems whose nature were quite obscure to me. I have been able to implement up to Ch. 4 from the REPL, but I would like to use the Notepad brand integrated development environment instead, if possible. Is there a preferred way to load minikanren once and and then be able to use (enter! ...) to update my own definitions from the file as I change them? If I recall, this was roughly how I did the other Lisper series books. Thank you very much! Eric PS: I apologise if this may produce a double posting; embarrassingly I cannot even claim to be bad with the world wide web, since this is just email.. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081014/6a0be46d/attachment.htm From fredm at cs.uml.edu Tue Oct 14 22:59:45 2008 From: fredm at cs.uml.edu (Fred G. Martin) Date: Thu Mar 26 02:30:37 2009 Subject: [plt-scheme] can't run SICP "generic operations" code in PLT Scheme 4.1 Message-ID: <72ef860f0810141959w7e829809ub8610021514a6d87@mail.gmail.com> Hey all, I can't figure out which language pack/ include statement / other setting is necessary to run the generic operations package from SICP. Here are two samples of the code I'm trying to run: http://www.cs.uml.edu/~holly/91.301/ps6-code.ss http://rlai.cs.ualberta.ca/325assignment5.html The code works fine in PLT-Scheme 3.72 (setting "Textual (MzScheme, includes R5RS)" but I am stumped trying to get it to run in 4.1. In general 4.1 seems to not like redefining stuff... I must admit I am mystified by all the language choices. Thanks for your help, Fred From gregory.woodhouse at gmail.com Tue Oct 14 23:19:43 2008 From: gregory.woodhouse at gmail.com (Woodhouse Gregory) Date: Thu Mar 26 02:30:37 2009 Subject: [plt-scheme] can't run SICP "generic operations" code in PLT Scheme 4.1 In-Reply-To: <72ef860f0810141959w7e829809ub8610021514a6d87@mail.gmail.com> References: <72ef860f0810141959w7e829809ub8610021514a6d87@mail.gmail.com> Message-ID: <1613E743-F66E-4A6B-BBAA-794DFAF2DA22@gmail.com> Since pairs are no longer mutable in PLT Scheme, you can't use set- cdr! You probably want to use mutable pairs instead. "The art of asking the right questions in mathematics is more important than the art of solving them." --Georg Cantor http://www.gwoodhouse.com http://GregWoodhouse.ImageKind.com On Oct 14, 2008, at 7:59 PM, Fred G. Martin wrote: > Hey all, > > I can't figure out which language pack/ include statement / other > setting is necessary to run the generic operations package from SICP. > > Here are two samples of the code I'm trying to run: > > http://www.cs.uml.edu/~holly/91.301/ps6-code.ss > http://rlai.cs.ualberta.ca/325assignment5.html > > The code works fine in PLT-Scheme 3.72 (setting "Textual (MzScheme, > includes R5RS)" but I am stumped trying to get it to run in 4.1. > > In general 4.1 seems to not like redefining stuff... I must admit I am > mystified by all the language choices. > > Thanks for your help, > Fred > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081014/b610d170/attachment.html From fredm at cs.uml.edu Wed Oct 15 00:33:06 2008 From: fredm at cs.uml.edu (Fred G. Martin) Date: Thu Mar 26 02:30:37 2009 Subject: [plt-scheme] can't run SICP "generic operations" code in PLT Scheme 4.1 In-Reply-To: <1613E743-F66E-4A6B-BBAA-794DFAF2DA22@gmail.com> References: <72ef860f0810141959w7e829809ub8610021514a6d87@mail.gmail.com> <1613E743-F66E-4A6B-BBAA-794DFAF2DA22@gmail.com> Message-ID: <72ef860f0810142133n29ffd7c8n645bb13426992f04@mail.gmail.com> Mmm OK, I modified the make-table procedure to use mutable-pairs and lists, and it works now. I also found the nice blog entry about why mutable pairs (at least the default ones) are bad -- http://blog.plt-scheme.org/2007/11/getting-rid-of-set-car-and-set-cdr.html. Is this code really the right way to go? Or is there a much simpler (built-in?) version of this? (code below). Fred (define (make-table) (let ((local-table (mlist '*table*))) (define (lookup key-1 key-2) (let ((subtable (massoc key-1 (mcdr local-table)))) (if subtable (let ((record (massoc key-2 (mcdr subtable)))) (if record (mcdr record) #f)) #f))) (define (insert! key-1 key-2 value) (let ((subtable (massoc key-1 (mcdr local-table)))) (if subtable (let ((record (massoc key-2 (mcdr subtable)))) (if record (set-mcdr! record value) (set-mcdr! subtable (mcons (mcons key-2 value) (mcdr subtable))))) (set-mcdr! local-table (mcons (mlist key-1 (mcons key-2 value)) (mcdr local-table))))) 'ok) (define (dispatch m) (cond ((eq? m 'lookup-proc) lookup) ((eq? m 'insert-proc!) insert!) (else (error "Unknown operation -- TABLE" m)))) dispatch)) (define operation-table (make-table)) (define get (operation-table 'lookup-proc)) (define put (operation-table 'insert-proc!)) On Tue, Oct 14, 2008 at 11:19 PM, Woodhouse Gregory wrote: > Since pairs are no longer mutable in PLT Scheme, you can't use set-cdr! You > probably want to use mutable pairs instead. > > > "The art of asking the right questions in mathematics is more important than > the art of solving them." > --Georg Cantor > http://www.gwoodhouse.com > http://GregWoodhouse.ImageKind.com > > > > > On Oct 14, 2008, at 7:59 PM, Fred G. Martin wrote: > > Hey all, > I can't figure out which language pack/ include statement / other > setting is necessary to run the generic operations package from SICP. > Here are two samples of the code I'm trying to run: > http://www.cs.uml.edu/~holly/91.301/ps6-code.ss > http://rlai.cs.ualberta.ca/325assignment5.html > The code works fine in PLT-Scheme 3.72 (setting "Textual (MzScheme, > includes R5RS)" but I am stumped trying to get it to run in 4.1. > In general 4.1 seems to not like redefining stuff... I must admit I am > mystified by all the language choices. > Thanks for your help, > Fred > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From noelwelsh at gmail.com Wed Oct 15 03:58:58 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:30:38 2009 Subject: [plt-scheme] Linking Minikanren for The Reasoned Schemer in Mzscheme In-Reply-To: <823057.1714.qm@web55004.mail.re4.yahoo.com> References: <823057.1714.qm@web55004.mail.re4.yahoo.com> Message-ID: Try this: At the top of minikanren.ss add a line #lang scheme if it isn't there already. At the bottom add a line (provide (all-defined-out)) Now in reasonedschemer.ss add two lines at the top: #lang scheme (require "minikanren.ss") Maybe that will get it working. On Wed, Oct 15, 2008 at 2:50 AM, n n wrote: > but I would like to > use the Notepad brand integrated development environment instead, if > possible. Is there a preferred way to load minikanren once and and then be > able to use (enter! ...) to update my own definitions from the file as I > change them? If I recall, this was roughly how I did the other Lisper > series books. You might want to try the DrScheme brand IDE. N. From DekuDekuplex at Yahoo.com Wed Oct 15 04:43:35 2008 From: DekuDekuplex at Yahoo.com (Benjamin L.Russell) Date: Thu Mar 26 02:30:38 2009 Subject: [plt-scheme] Re: Linking Minikanren for The Reasoned Schemer in Mzscheme References: <823057.1714.qm@web55004.mail.re4.yahoo.com> Message-ID: <7h9bf4dv0l5g32ebslem8lc30tfd8rs6h9@4ax.com> On Tue, 14 Oct 2008 18:50:47 -0700 (PDT), n n wrote: >Hello -- > >I think this is not a smart question, and I apologise; but it seems for me all the hard problems are either undecidable or involve linking... There is no need to apologize. One of the purposes of a mailing list it to provide a discussion forum for solving problems of this nature. >I recently discovered The Reasoned Schemer, and have been trying to follow it in mzscheme. I am quite new to the PLT implementation, and I seem to be having trouble getting the REPL to process the minikanren code, and then mine subsequently. At the moment, I am doing something like this: > >(using the Windows brand operating system from Microsoft Corporation) > >C:\download\ss> "c:\program files\plt\mzscheme.exe" >;;;(mzscheme turn on) >>(enter! "minikanren.ss") ;;; minikanren code in the local directory, copied from the world wide web >;;; now I have no trouble running unification style queries like (run #f (q) (== q 5)) >>(enter! "reasonedschemer.ss") ;;;my implementations of the book's definitions >;;; I get this error message: >;;; reasonedschemer.ss:6:28: compile: unbound variable in module in: fresh > >Apparently my reasonedschemer.ss file is not seeing the definitions available to me on the REPL. I have tried various combinations of (require ...) but am not sure if my local paths are causing problems with this. I have also tried simply appending my own definitions to minikanren.ss, but this also seemed to cause problems whose nature were quite obscure to me. I have been able to implement up to Ch. 4 from the REPL, but I would like to use the Notepad brand integrated development environment instead, if possible. Is there a preferred way to load minikanren once and and then be able to use (enter! ...) to update my own definitions from the file as I change them? If I recall, this was roughly how I did the other Lisper series books. Would it be possible to request you to provide the code in your following files, so that somebody on this list can reproduce the problem: 1) minikanren.ss 2) reasonedschemer.ss >PS: I apologise if this may produce a double posting; embarrassingly I cannot even claim to be bad with the world wide web, since this is just email.. Again, there is no need to apologize; this did not result in any double posting. Double postings occur occasionally in practice, and in any event, are no reason for one to "claim to be bad with ... email"; many people who use e-mail frequently occasionally make double postings as well. -- Benjamin L. Russell P.S. Incidentally, the "Notepad brand integrated development environment" that you referred to is actually a text editor, and not a complete integrated development environment. In order to facilitate your editing and debugging experience, since you already seem relatively familiar with the MzScheme core virtual machine for the PLT Scheme implementation of the Scheme programming language, you may wish to investigate either the DrScheme programming environment at the Web page linked to by the http://download.plt-scheme.org/drscheme/ URL, or the GNU Emacs extensible, customizable text editor at the Web page linked to by the http://www.gnu.org/software/emacs/ URL. In addition, if you decide to use the GNU Emacs editor, please keep in mind the Quack editor mode at the Web page linked to by the http://www.neilvandyke.org/quack/ URL. Further, when setting up the GNU Emacs editor for use with the PLT Scheme implementation of the Scheme programming language, you may find useful the "Setting up Emacs for use with PLT Scheme on Windows or Mac OS X" Web-based textual instruction page available at the Web page linked to by the http://bc.tech.coop/scheme/scheme-emacs.htm URL. From robby at cs.uchicago.edu Wed Oct 15 07:23:14 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:30:38 2009 Subject: [plt-scheme] can't run SICP "generic operations" code in PLT Scheme 4.1 In-Reply-To: <72ef860f0810142133n29ffd7c8n645bb13426992f04@mail.gmail.com> References: <72ef860f0810141959w7e829809ub8610021514a6d87@mail.gmail.com> <1613E743-F66E-4A6B-BBAA-794DFAF2DA22@gmail.com> <72ef860f0810142133n29ffd7c8n645bb13426992f04@mail.gmail.com> Message-ID: <932b2f1f0810150423m7596087q44682515e1cc2c19@mail.gmail.com> Did you consider make-hash, hash-get, and hash-set! and friends? Robby On Tue, Oct 14, 2008 at 11:33 PM, Fred G. Martin wrote: > Mmm OK, I modified the make-table procedure to use mutable-pairs and > lists, and it works now. > > I also found the nice blog entry about why mutable pairs (at least the > default ones) are bad -- > http://blog.plt-scheme.org/2007/11/getting-rid-of-set-car-and-set-cdr.html. > > Is this code really the right way to go? Or is there a much simpler > (built-in?) version of this? (code below). > > Fred > > > (define (make-table) > (let ((local-table (mlist '*table*))) > (define (lookup key-1 key-2) > (let ((subtable (massoc key-1 (mcdr local-table)))) > (if subtable > (let ((record (massoc key-2 (mcdr subtable)))) > (if record > (mcdr record) > #f)) > #f))) > (define (insert! key-1 key-2 value) > (let ((subtable (massoc key-1 (mcdr local-table)))) > (if subtable > (let ((record (massoc key-2 (mcdr subtable)))) > (if record > (set-mcdr! record value) > (set-mcdr! subtable > (mcons (mcons key-2 value) > (mcdr subtable))))) > (set-mcdr! local-table > (mcons (mlist key-1 > (mcons key-2 value)) > (mcdr local-table))))) > 'ok) > (define (dispatch m) > (cond ((eq? m 'lookup-proc) lookup) > ((eq? m 'insert-proc!) insert!) > (else (error "Unknown operation -- TABLE" m)))) > dispatch)) > > (define operation-table (make-table)) > (define get (operation-table 'lookup-proc)) > (define put (operation-table 'insert-proc!)) > > > On Tue, Oct 14, 2008 at 11:19 PM, Woodhouse Gregory > wrote: >> Since pairs are no longer mutable in PLT Scheme, you can't use set-cdr! You >> probably want to use mutable pairs instead. >> >> >> "The art of asking the right questions in mathematics is more important than >> the art of solving them." >> --Georg Cantor >> http://www.gwoodhouse.com >> http://GregWoodhouse.ImageKind.com >> >> >> >> >> On Oct 14, 2008, at 7:59 PM, Fred G. Martin wrote: >> >> Hey all, >> I can't figure out which language pack/ include statement / other >> setting is necessary to run the generic operations package from SICP. >> Here are two samples of the code I'm trying to run: >> http://www.cs.uml.edu/~holly/91.301/ps6-code.ss >> http://rlai.cs.ualberta.ca/325assignment5.html >> The code works fine in PLT-Scheme 3.72 (setting "Textual (MzScheme, >> includes R5RS)" but I am stumped trying to get it to run in 4.1. >> In general 4.1 seems to not like redefining stuff... I must admit I am >> mystified by all the language choices. >> Thanks for your help, >> Fred >> _________________________________________________ >> 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 cs.uchicago.edu Wed Oct 15 07:31:26 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:30:38 2009 Subject: [plt-scheme] Embedded images in planet packages In-Reply-To: <48F54C60.3080904@ccs.neu.edu> References: <48F54C60.3080904@ccs.neu.edu> Message-ID: <932b2f1f0810150431i6c18d02du5ea77d64aa898f4f@mail.gmail.com> This is a shortcoming in our compiler, I'm sorry to say. If you want to use images in planet packages, I think the best thing I can offer you now is to use define-runtime-path to point to the image and then (make-object bitmap% ....), which gives you the same kind of a value as the embedded image would, but without embedding it. Robby On Tue, Oct 14, 2008 at 8:50 PM, David Van Horn wrote: > I can't seem to install a planet package that has an image embedded in the > source code (via Insert Image). When I try to inject the package, I get: > > write: cannot marshal constant that is embedded in compiled code: > #(struct:object:image% ...) > > Any idea on how to work around this? Should this be considered a bug? > > David > > How to recreate in 4.1.1.3-svn14oct2008: > > planet create img/ > planet fileinject dvanhorn img.plt 1 0 > > ;; ------------ > ;; img/main.ss > #lang scheme > (provide img) > (define img #|INSERTIMAGE|#) ;; eg, http://plt-scheme.org/logo.png > > ;; ------------- > ;; img/info.ss > #lang setup/infotab > (define name "Embedded image test.") > (define categories '(misc)) > (define required-core-version "4.1.0") > (define repositories (list "4.x")) > (define primary-file '("main.ss")) > (define blurb (list '(div "Just an embedded image."))) > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From jadudm at gmail.com Wed Oct 15 08:23:12 2008 From: jadudm at gmail.com (Matt Jadud) Date: Thu Mar 26 02:30:38 2009 Subject: [plt-scheme] can't run SICP "generic operations" code in PLT Scheme 4.1 In-Reply-To: <932b2f1f0810150423m7596087q44682515e1cc2c19@mail.gmail.com> References: <72ef860f0810141959w7e829809ub8610021514a6d87@mail.gmail.com> <1613E743-F66E-4A6B-BBAA-794DFAF2DA22@gmail.com> <72ef860f0810142133n29ffd7c8n645bb13426992f04@mail.gmail.com> <932b2f1f0810150423m7596087q44682515e1cc2c19@mail.gmail.com> Message-ID: On Wed, Oct 15, 2008 at 7:23 AM, Robby Findler wrote: > Did you consider make-hash, hash-get, and hash-set! and friends? Having just recently spent a day (finally) updating a library from v372 to v4.1.1, I can understand Fred's frustration. It isn't so much a question of "considering" as sitting there asking "now what?" I have the benefit of having followed the list closely through the transition, and being able to harass the Untyped crew by AIM. But if you come in now, from another Scheme, the little edges of PLT Scheme that are different can derail you. For Fred (and others coming to the PLT 4.x game late), the things that took me by surprise yesterday: 1. Hash table operations have all had name changes. A. Mutators are gone from structures. (define-struct foo (a b)) no longer yields "set-foo-a!". Yes, they can be introduced at definition-time, but not if they're being provided by a library. "struct-copy", I think, was the functional way to update a structure. (Apologies if I just got that wrong.) 2. 'require' and 'provide' specifications have changed. 3. Scribble failures in PLaneT installations can be noisy, making me wonder if things are OK. 4. Because the language is changing fairly rapidly, syntax errors can creep into libraries where they probably didn't exist when the library was contributed. (Eg. Under 4.1.1, WebIt has a syntax error in private/excess.ss regarding the invocation of a unit. I'll double-check that, and submit a ticket. I have no idea if my hack-fix was correct, but "it runs.") 5. When developing a library for distribution on PLaneT, make sure it is in a directory named for what you want the .plt file to be called. "trunk" is probably a bad directory name. (In short, I now understand the Untyped SVN repository layout.) 6. Creating local development links while working with PLaneT libraries is critical. My previous question on the list (locking PLaneT library versions) was inspired by my own question of whether I would just run old code against old versions of libraries, or update. It turned out to be more difficult to figure out what libraries were current when the code was written (2006) than to update to the latest-and-greatest. In short, lots of great lessons were learned recently... even though I was mostly in a hurry, and not interested in lessons. Noel will be happy to know that my unit tests made the update process easier. That, and SchemeUnit 3 was a painless transition from version 1 dot something. :) I guess my point was: "Fred, just keep asking questions." Most of the differences I encountered were approaching "edge cases," but you can get lost in those if you're not careful. Cheers, Matt From robby at cs.uchicago.edu Wed Oct 15 08:32:17 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:30:39 2009 Subject: [plt-scheme] can't run SICP "generic operations" code in PLT Scheme 4.1 In-Reply-To: References: <72ef860f0810141959w7e829809ub8610021514a6d87@mail.gmail.com> <1613E743-F66E-4A6B-BBAA-794DFAF2DA22@gmail.com> <72ef860f0810142133n29ffd7c8n645bb13426992f04@mail.gmail.com> <932b2f1f0810150423m7596087q44682515e1cc2c19@mail.gmail.com> Message-ID: <932b2f1f0810150532j7075e05cgf826c20febc87fe7@mail.gmail.com> On Wed, Oct 15, 2008 at 7:23 AM, Matt Jadud wrote: > For Fred (and others coming to the PLT 4.x game late), the things that > took me by surprise yesterday: > > 1. Hash table operations have all had name changes. > A. Mutators are gone from structures. (define-struct foo (a b)) no > longer yields "set-foo-a!". Yes, they can be introduced at > definition-time, but not if they're being provided by a library. > "struct-copy", I think, was the functional way to update a structure. > (Apologies if I just got that wrong.) Yes, struct-copy (note that copy-struct is the old one). > 2. 'require' and 'provide' specifications have changed. Just in case you didn't find it yet, more along the lines of the above can be found in the plt distribution: plt/doc/release-notes/mzscheme/MzScheme_4.txt The latest version of that file is here: http://svn.plt-scheme.org/plt/trunk/doc/release-notes/mzscheme/MzScheme_4.txt Robby From robby at cs.uchicago.edu Wed Oct 15 08:41:26 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:30:39 2009 Subject: [plt-scheme] Re: cannot profile code In-Reply-To: <196230b2-abe2-4590-8202-4b6a8d6cef8e@p49g2000hsd.googlegroups.com> References: <196230b2-abe2-4590-8202-4b6a8d6cef8e@p49g2000hsd.googlegroups.com> Message-ID: <932b2f1f0810150541l434e246dk9ad4169680c9569c@mail.gmail.com> That sounds like a bug. I tried some simple things and wasn't able to reproduce it, tho. Do you mind sending a (hopefully small) program that illustrates the problem? Also, if you wanted to submit a PR (via the "Submit Bug Report" menu item in the "Help" menu), that would be appropriate. Thanks, Robby On Tue, Oct 14, 2008 at 12:22 AM, Deep wrote: > Just wanted to clarify - > > When i choose the "Debugging" under Dynamic Properties of the module > language, things work just fine. > However if i change the to Dynamic Properties to "Debugging and > Profiling" i get the error message pasted above. > > > On Oct 14, 1:07 am, Deep wrote: >> I cannot profile an application that I am currently working on. I am >> using DrScheme 4.1.1 on windows. >> Here is the error trace I get - >> require: namespace mismatch; reference (phase 0) to a module "C: >> \Program Files\PLT\collects\scheme\private\kw.ss" that is not >> available (phase level 0) in: #%app >> >> Anyway to debug this error ? >> _________________________________________________ >> 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 sbloch at adelphi.edu Wed Oct 15 09:12:14 2008 From: sbloch at adelphi.edu (Stephen Bloch) Date: Thu Mar 26 02:30:39 2009 Subject: [plt-scheme] Re: [plt-edu] Should computer programming be mandatory In-Reply-To: <586ED94A-A94D-4F2D-AD89-92B8ECA50788@ccs.neu.edu> References: <101420081521.4927.48F4B900000706F10000133F22064244139F9F9F059D0E@comcast.net> <586ED94A-A94D-4F2D-AD89-92B8ECA50788@ccs.neu.edu> Message-ID: <18D4E050-69FE-4816-8936-3C556F06DF71@adelphi.edu> On Oct 14, 2008, at 2:25 PM, Matthias Felleisen wrote: > I recently exchanged email with a mathematics professor at BYU who > studies education. He had dug out large-scale studies (involving > an entire school district in Indianapolis and part of a second > school district elsewhere) that compared high school students who > took course in English plus Latin with those who took only English > courses. In several standard tests on English, the English+Latin > students outscored the English-only students by leaps and bounds. > -- The effect carries over to other __formal__ instruction on > second languages, but it isn't as large. (I felt pretty good after > reading his write-up, because I had defended the study of a second > language in the Houston school district many times on this basis, > but had always been rejected.) -- > > If given the chance, I'd love to prove this conjecture for > TeachScheme! at the same scale. So would I. The obvious people to address it are at Brown, where they have two interchangeable beginning-programming sequences, one functional-first and one objects-first, and they have enough students to (potentially) get statistically significant results. I don't have the sample size, and (as of a few weeks ago) I don't have the opportunity to teach functional-first to students who are going on to subsequent programming courses. So, Shriram, how about it? How difficult would it be to get and analyze the data? Stephen Bloch sbloch@adelphi.edu From sk at cs.brown.edu Wed Oct 15 09:43:58 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:30:39 2009 Subject: [plt-scheme] Re: [plt-edu] Should computer programming be mandatory In-Reply-To: <18D4E050-69FE-4816-8936-3C556F06DF71@adelphi.edu> References: <101420081521.4927.48F4B900000706F10000133F22064244139F9F9F059D0E@comcast.net> <586ED94A-A94D-4F2D-AD89-92B8ECA50788@ccs.neu.edu> <18D4E050-69FE-4816-8936-3C556F06DF71@adelphi.edu> Message-ID: True, but: - Anecdotally, we haven't seen a huge difference amongst the students coming out of these classes. - More to the point, there are very significant secondary effects that are hard to control. The courses are interchangeable curricularly, but not socially. -- For instance, the functional-first class tends to attract more mathematically-minded students. -- The objects-first class is a bit of a circus (live videotaping, skits, etc.). This attracts some students, while it drives others away (I personally find some of this risible). -- The objects-first class is much more graphics-oriented (our functional-first folks are pointlessly ascetic, though historically it's easy to see why: their course emerged as a *reaction* to the other course). -- Some of us, including me, certainly believe that the functional-first sequence tends to attract more elite students, and that that trend is growing. -- In the minds of its designers, the variety of PLs is only one feature functional-first approach; equally important to them is what they call the "integrated" introduction (algorithms + programming throughout the year, rather than a traditional CS1/CS2 split). -- Students in most parts of America don't generally pick up additional languages just by assimilation. But that's not true of computer languages. So we would have to somehow control for those who went through the objects-first approach AND learned no other languages subsequently. So what would we be measuring, exactly? As we've said repeatedly on this forum, the great thing about social studies is that if you don't like the outcome of the one you're presented with, you can simply study the parameters -- do so long enough and you can show why it doesn't apply to you. This is a standard problem with educational literature and its adoption. Shriram From matthias at ccs.neu.edu Wed Oct 15 09:44:52 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:30:39 2009 Subject: [plt-scheme] Re: [plt-edu] Should computer programming be mandatory In-Reply-To: <18D4E050-69FE-4816-8936-3C556F06DF71@adelphi.edu> References: <101420081521.4927.48F4B900000706F10000133F22064244139F9F9F059D0E@comcast.net> <586ED94A-A94D-4F2D-AD89-92B8ECA50788@ccs.neu.edu> <18D4E050-69FE-4816-8936-3C556F06DF71@adelphi.edu> Message-ID: On Oct 15, 2008, at 9:12 AM, Stephen Bloch wrote: > > On Oct 14, 2008, at 2:25 PM, Matthias Felleisen wrote: > >> I recently exchanged email with a mathematics professor at BYU who >> studies education. He had dug out large-scale studies (involving >> an entire school district in Indianapolis and part of a second >> school district elsewhere) that compared high school students who >> took course in English plus Latin with those who took only English >> courses. In several standard tests on English, the English+Latin >> students outscored the English-only students by leaps and bounds. >> -- The effect carries over to other __formal__ instruction on >> second languages, but it isn't as large. (I felt pretty good after >> reading his write-up, because I had defended the study of a second >> language in the Houston school district many times on this basis, >> but had always been rejected.) -- >> >> If given the chance, I'd love to prove this conjecture for >> TeachScheme! at the same scale. > > So would I. The obvious people to address it are at Brown, where > they have two interchangeable beginning-programming sequences, one > functional-first and one objects-first, and they have enough > students to (potentially) get statistically significant results. I > don't have the sample size, and (as of a few weeks ago) I don't > have the opportunity to teach functional-first to students who are > going on to subsequent programming courses. > > So, Shriram, how about it? How difficult would it be to get and > analyze the data? I am not Shriram but I will say that the LATIN test involved 16,000 students. -- Matthias From icfp.publicity at googlemail.com Wed Oct 15 10:17:15 2008 From: icfp.publicity at googlemail.com (Matthew Fluet (ICFP Publicity Chair)) Date: Thu Mar 26 02:30:39 2009 Subject: [plt-scheme] ICFP09: Call for Workshop Proposals Message-ID: <53ff55480810150717k7b777587i8fde8764933e0587@mail.gmail.com> CALL FOR WORKSHOP PROPOSALS ICFP 2009 14th ACM SIGPLAN International Conference on Functional Programming 31st August - 2nd September, 2009 Edinburgh, Scotland http://www.icfpconference.org/icfp2009 The 14th ACM SIGPLAN International Conference on Functional Programming will be held in Edinburgh, Scotland from 31st August to 2nd September 2009. ICFP provides a forum for researchers and developers to hear about the latest work on the design, implementations, principles, and uses of functional programming. Proposals are invited for workshops to be affiliated with ICFP 2009 and sponsored by SIGPLAN. These workshops should be more informal and focused than ICFP itself, include sessions that enable interaction among the workshop attendees, and be fairly low cost. The preference is for one-day workshops, but other schedules can also be considered. The workshops themselves will be held between August 30th and September 5th, as capacity allows. ---------------------------------------------------------------------- Submission details Deadline for submission: 19th November 2008 Notification of acceptance: 17th December 2008 Prospective workshop organisers are invited to submit a completed workshop proposal form in plain text format to the ICFP 2009 workshop co-chairs (Chris Stone and Mike Sperber), via email to icfp09-workshops at cs.hmc.edu by 19th November 2008. Please note that this is a firm deadline. Organisers will be notified if their proposal is accepted by 17th December 2008, and if successful are required to produce a final report after the workshop has taken place that is suitable for publication in SIGPLAN Notices. The proposal form is available at: http://www.icfpconference.org/icfp2009/workshops/icfp09-workshops-form.txt Further information about SIGPLAN sponsorship is available at: http://acm.org/sigplan/sigplan_workshop_proposal.htm ---------------------------------------------------------------------- Selection committee The workshop proposals will be evaluated by a committee comprising the following members of the ICFP 2009 organising committee, together with the members of the SIGPLAN executive committee. Chris Stone Harvey Mudd College Workshops co-chair Mike Sperber DeinProgramm Workshops co-chair Graham Hutton University of Nottingham General Chair Andrew Tolmach Portland State University Program Chair ---------------------------------------------------------------------- Further information Any queries regarding ICFP 2009 workshop proposals should be addressed to the workshops co-chairs (Chris Stone and Mike Sperber), via email to icfp09-workshops at cs.hmc.edu From arkppp at comcast.net Tue Oct 14 11:21:36 2008 From: arkppp at comcast.net (arkppp@comcast.net) Date: Thu Mar 26 02:30:40 2009 Subject: [plt-scheme] Should computer programming be mandatory Message-ID: <101420081521.4927.48F4B900000706F10000133F22064244139F9F9F059D0E@comcast.net> Some food for thought.... http://weblog.infoworld.com/fatalexception/archives/2008/10/mandatory_compu.html Alvin Kroon Kamiak HS -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081014/596eba89/attachment.htm From seth.reichelson at ocps.net Tue Oct 14 11:56:02 2008 From: seth.reichelson at ocps.net (Reichelson, Seth) Date: Thu Mar 26 02:30:40 2009 Subject: [plt-scheme] RE: [plt-edu] Should computer programming be mandatory In-Reply-To: References: <101420081521.4927.48F4B900000706F10000133F22064244139F9F9F059D0E@comcast.net> Message-ID: Cutting out the computer science AB doesn't help. -----Original Message----- From: plt-edu-bounces@list.cs.brown.edu [mailto:plt-edu-bounces@list.cs.brown.edu] On Behalf Of Shriram Krishnamurthi Sent: Tuesday, October 14, 2008 11:33 AM To: arkppp@comcast.net Cc: Robby Findler; Scheme PLT; plt edu; Matthias Felleisen Subject: Re: [plt-edu] Should computer programming be mandatory Alvin, The US is obsessed about "energy security", which is the idea that the country needs to wean itself of excessive dependence on foreign countries for its energy needs. (This isn't the forum to discuss whether it's possible or even wise to become *completely* independent, but certainly *reducing dependence* seems wise.) The US needs to likewise be thinking about its "intellectual security", i.e., the ability to grow enough STEM (science, technology, engineering, mathematics) talent at home so that it doesn't need to keep importing the likes of Matthias and me. Because, you know, one day that supply will dry up, too. Shriram _________________________________________________ PLT Educators mailing list plt-edu@list.cs.brown.edu http://list.cs.brown.edu/mailman/listinfo/plt-edu ---------------------------------------------------------------------- The information contained in this e-mail message is intended solely for the recipient(s) and may contain privileged information. Tampering with or altering the contents of this message is prohibited. This information is the same as any written document and may be subject to all rules governing public information according to Florida Statutes. Any message that falls under Chapter 119 shall not be altered in a manner that misrepresents the activities of Orange County Public Schools. [References: Florida State Constitution I.24, Florida State Statutes Chapter 119, and OCPS Management Directive A-9.] If you have received this message in error, or are not the named recipient notify the sender and delete this message from your computer. From rcleis at mac.com Wed Oct 15 10:47:10 2008 From: rcleis at mac.com (Richard Cleis) Date: Thu Mar 26 02:30:40 2009 Subject: [plt-scheme] Re: [plt-edu] Should computer programming be mandatory Message-ID: <33627230985994279911578971084682882099-Webmail2@me.com> On Wednesday, October 15, 2008, at 06:12AM, "Stephen Bloch" wrote: > >On Oct 14, 2008, at 2:25 PM, Matthias Felleisen wrote: > >> I recently exchanged email with a mathematics professor at BYU who >> studies education. He had dug out large-scale studies (involving >> an entire school district in Indianapolis and part of a second >> school district elsewhere) that compared high school students who >> took course in English plus Latin with those who took only English >> courses. In several standard tests on English, the English+Latin >> students outscored the English-only students by leaps and bounds. >> -- The effect carries over to other __formal__ instruction on >> second languages, but it isn't as large. (I felt pretty good after >> reading his write-up, because I had defended the study of a second >> language in the Houston school district many times on this basis, >> but had always been rejected.) -- >> >> If given the chance, I'd love to prove this conjecture for >> TeachScheme! at the same scale. > >So would I. The obvious people to address it are at Brown, where >they have two interchangeable beginning-programming sequences, one >functional-first and one objects-first, and they have enough students >to (potentially) get statistically significant results. I don't have >the sample size, and (as of a few weeks ago) I don't have the >opportunity to teach functional-first to students who are going on to >subsequent programming courses. Is performance in subsequent programming courses the only issue? What if programming courses are mandatory because they can be used to generally teach how to solve problems whether or not a student is 'technical' at all, let alone a mathematician or a computer scientist? In that light, comparing the effectiveness of teaching methods would require the evaluation of success in all courses. rac p.s. I can't read the other list, so forgive me if this comment is out of place. > >So, Shriram, how about it? How difficult would it be to get and >analyze the data? > > >Stephen Bloch >sbloch@adelphi.edu > >_________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From thule124 at yahoo.com Wed Oct 15 11:18:47 2008 From: thule124 at yahoo.com (n n) Date: Thu Mar 26 02:30:41 2009 Subject: [plt-scheme] Linking Minikanren for The Reasoned Schemer in Mzscheme Message-ID: <565535.73813.qm@web55003.mail.re4.yahoo.com> I appreciate both of your replies very much. I had been using the #lang scheme directive and exporting all of the definitions with (provide ...), though I did try moving the latter from the top of the file to the bottom. I will certainly use DrScheme if this exercise becomes too difficult, but all things being the same I would prefer to use MzScheme because its appearance gives me a (presumably false) sense of security. Also-- I have never used Emacs in Windows, nor heard of Quack, and this suggestion reminds me it is something I might try sooner rather than later. Since I still seem to be having trouble, I am grateful for the suggestion to include my files here. I have attempted to do this with a web-site called yousendit.com. Please find these enclosed. reasonedschemer.ss http://rcpt.yousendit.com/615491953/666854be14d904961ff9678ed6d1fe3b minikanren.ss: http://rcpt.yousendit.com/615491499/ff9126abcba6a9f0b85d69b41ff117c1 Thank you, again, for the help-- Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081015/edb3a66d/attachment.html From sbloch at adelphi.edu Wed Oct 15 12:15:25 2008 From: sbloch at adelphi.edu (Stephen Bloch) Date: Thu Mar 26 02:30:42 2009 Subject: [plt-scheme] Re: [plt-edu] Should computer programming be mandatory In-Reply-To: <33627230985994279911578971084682882099-Webmail2@me.com> References: <33627230985994279911578971084682882099-Webmail2@me.com> Message-ID: <573D0959-A960-422C-891D-978E8DBCF04A@adelphi.edu> On Oct 15, 2008, at 10:47 AM, Richard Cleis wrote: > Is performance in subsequent programming courses the only issue? > What if programming courses are mandatory because they can be used > to generally teach how to solve problems whether or not a student > is 'technical' at all, let alone a mathematician or a computer > scientist? In that light, comparing the effectiveness of teaching > methods would require the evaluation of success in all courses. Absolutely, but that's even more difficult, and will have even more "noise" in the signal, than evaluating performance in subsequent programming courses. Stephen Bloch sbloch@adelphi.edu From acowley at seas.upenn.edu Wed Oct 15 12:59:56 2008 From: acowley at seas.upenn.edu (Anthony Cowley) Date: Thu Mar 26 02:30:42 2009 Subject: [plt-scheme] Linking Minikanren for The Reasoned Schemer in Mzscheme In-Reply-To: <565535.73813.qm@web55003.mail.re4.yahoo.com> References: <565535.73813.qm@web55003.mail.re4.yahoo.com> Message-ID: <81addec70810150959y4b093141rf25e174cd667ba41@mail.gmail.com> Eric, You're missing parentheses around all-defined-out, it should be (provide (all-defined-out)). Anthony On Wed, Oct 15, 2008 at 11:18 AM, n n wrote: > I appreciate both of your replies very much. I had been using the #lang > scheme directive and exporting all of the definitions with (provide ...), > though I did try moving the latter from the top of the file to the bottom. > > I will certainly use DrScheme if this exercise becomes too difficult, but > all things being the same I would prefer to use MzScheme because its > appearance gives me a (presumably false) sense of security. Also-- I have > never used Emacs in Windows, nor heard of Quack, and this suggestion reminds > me it is something I might try sooner rather than later. > > Since I still seem to be having trouble, I am grateful for the suggestion > to include my files here. I have attempted to do this with a web-site > called yousendit.com. Please find these enclosed. > > reasonedschemer.ss > http://rcpt.yousendit.com/615491953/666854be14d904961ff9678ed6d1fe3b > > minikanren.ss: > http://rcpt.yousendit.com/615491499/ff9126abcba6a9f0b85d69b41ff117c1 > > Thank you, again, for the help-- > > Eric > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081015/83be571a/attachment.htm From gregory.woodhouse at gmail.com Wed Oct 15 13:00:27 2008 From: gregory.woodhouse at gmail.com (Greg Woodhouse) Date: Thu Mar 26 02:30:43 2009 Subject: [plt-scheme] Re: [plt-edu] Should computer programming be mandatory In-Reply-To: References: <101420081521.4927.48F4B900000706F10000133F22064244139F9F9F059D0E@comcast.net> <586ED94A-A94D-4F2D-AD89-92B8ECA50788@ccs.neu.edu> <18D4E050-69FE-4816-8936-3C556F06DF71@adelphi.edu> Message-ID: <5f07325f0810151000u77e9306dva2a5e2b551f46c6a@mail.gmail.com> Well, there's more to the story. What is now called VistA (an electronic health record solution that is currently used by the U.S. Veterans Health Administration) got its start when healthcare professionals starting automating their work "on the sly". You can read the story of this "underground railroad" at http://www.hardhats.org/history/hardhats.html My co-worker (or colleague, or friend) was one of the original hardhats. I came along shortly afterwards, but with an academic background in mathematics, becoming both something of a VistA expert and an outsider. There is a tension, often quite palpable, between VistA pioneers who work in "the field" (i.e., at VA medical centers/hospitals) and people like me who work in office buildings. My friend's comment might reasonably be paraphrased as "we've always done fine without you (pl.) and we don't need you now." In any case, you really hit the nail on the head: I recall just a few years ago developing a parser driven tool that would work it's way through the entire code base and build a dependency graph as best it could. (MUMPS is a dynamically scoped language, and side-effcts can live a long time.) One thing I've been arguing for a long time is that the code has grown far too tightly coupled and needs to be reworked/refactored, but that can bed a real hot button issue, particularly with the VistA pioneers. Most current work is being done in Java, and even now I'm busy trying to disentagle some undocumented Java code. I don't have to tell you that a new language is a panacea, but I think there are still people that think it is. But to get back to the original story, there's a real sense of bitterness among the MUMPSters, who feel betrayed (and sometimes angry) over the shift to Java. Now me, I'd love to work in Scheme (or another functional language). If PLT Scheme had standardized database support, a few library editions (particularly in networking and I/O) and (perhaps) a richer GUI library, it could easily be my first choice of platforms. (I say "perhaps" because I'm still learning, and the fact that I don't know how to do something doesn't mean the capability isn't there. In addition, this probably is not the top priority. I'm still a little cautious with regard to web interfaces, but they seem to be where the industry is headed now.) On Wed, Oct 15, 2008 at 6:43 AM, Shriram Krishnamurthi wrote: > True, but: > > - Anecdotally, we haven't seen a huge difference amongst the students > coming out of these classes. > > - More to the point, there are very significant secondary effects that > are hard to control. The courses are interchangeable curricularly, > but not socially. > > -- For instance, the functional-first class tends to attract more > mathematically-minded students. > > -- The objects-first class is a bit of a circus (live videotaping, > skits, etc.). This attracts some students, while it drives others > away (I personally find some of this risible). > > -- The objects-first class is much more graphics-oriented (our > functional-first folks are pointlessly ascetic, though historically > it's easy to see why: their course emerged as a *reaction* to the > other course). > > -- Some of us, including me, certainly believe that the > functional-first sequence tends to attract more elite students, and > that that trend is growing. > > -- In the minds of its designers, the variety of PLs is only one > feature functional-first approach; equally important to them is what > they call the "integrated" introduction (algorithms + programming > throughout the year, rather than a traditional CS1/CS2 split). > > -- Students in most parts of America don't generally pick up > additional languages just by assimilation. But that's not true of > computer languages. So we would have to somehow control for those who > went through the objects-first approach AND learned no other languages > subsequently. > > So what would we be measuring, exactly? > > As we've said repeatedly on this forum, the great thing about social > studies is that if you don't like the outcome of the one you're > presented with, you can simply study the parameters -- do so long > enough and you can show why it doesn't apply to you. This is a > standard problem with educational literature and its adoption. > > Shriram > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081015/af960991/attachment.html From thule124 at yahoo.com Wed Oct 15 13:28:42 2008 From: thule124 at yahoo.com (n n) Date: Thu Mar 26 02:30:43 2009 Subject: [plt-scheme] Linking Minikanren for The Reasoned Schemer in Mzscheme In-Reply-To: <81addec70810150959y4b093141rf25e174cd667ba41@mail.gmail.com> Message-ID: <666597.97892.qm@web55008.mail.re4.yahoo.com> Anthony, Thank you so much; that solved it for me. Thanks to all for the help. Best regards, Eric Anthony Cowley wrote: Eric, You're missing parentheses around all-defined-out, it should be (provide (all-defined-out)). Anthony On Wed, Oct 15, 2008 at 11:18 AM, n n wrote: I appreciate both of your replies very much. I had been using the #lang scheme directive and exporting all of the definitions with (provide ...), though I did try moving the latter from the top of the file to the bottom. I will certainly use DrScheme if this exercise becomes too difficult, but all things being the same I would prefer to use MzScheme because its appearance gives me a (presumably false) sense of security. Also-- I have never used Emacs in Windows, nor heard of Quack, and this suggestion reminds me it is something I might try sooner rather than later. Since I still seem to be having trouble, I am grateful for the suggestion to include my files here. I have attempted to do this with a web-site called yousendit.com. Please find these enclosed. reasonedschemer.ss http://rcpt.yousendit.com/615491953/666854be14d904961ff9678ed6d1fe3b minikanren.ss: http://rcpt.yousendit.com/615491499/ff9126abcba6a9f0b85d69b41ff117c1 Thank you, again, for the help-- Eric _________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-scheme -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081015/31756337/attachment.htm From dvanhorn at ccs.neu.edu Wed Oct 15 15:30:52 2008 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Thu Mar 26 02:30:44 2009 Subject: [plt-scheme] Re: Embedded images in planet packages In-Reply-To: <932b2f1f0810150431i6c18d02du5ea77d64aa898f4f@mail.gmail.com> References: <48F54C60.3080904@ccs.neu.edu> <932b2f1f0810150431i6c18d02du5ea77d64aa898f4f@mail.gmail.com> Message-ID: <48F644EC.4080302@ccs.neu.edu> Robby Findler wrote: > This is a shortcoming in our compiler, I'm sorry to say. If you want > to use images in planet packages, I think the best thing I can offer > you now is to use define-runtime-path to point to the image and then > (make-object bitmap% ....), which gives you the same kind of a value > as the embedded image would, but without embedding it. Is there a way to turn a bitmap% object into a htdp/world image? (I don't mind replacing the embedded image with define-runtime-path and make-object---although it would be nice if I didn't have to---but I don't want to rewrite my program to use the GUI toolkit instead of the World teachpack.) David From robby at cs.uchicago.edu Wed Oct 15 15:36:36 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:30:44 2009 Subject: [plt-scheme] Re: Embedded images in planet packages In-Reply-To: <48F644EC.4080302@ccs.neu.edu> References: <48F54C60.3080904@ccs.neu.edu> <932b2f1f0810150431i6c18d02du5ea77d64aa898f4f@mail.gmail.com> <48F644EC.4080302@ccs.neu.edu> Message-ID: <932b2f1f0810151236p3e6f4294l6b0754025f96af1e@mail.gmail.com> bitmap%s are htdp/world images. (htdp/world image are not all bitmaps, tho.) Robby On Wed, Oct 15, 2008 at 2:30 PM, David Van Horn wrote: > Robby Findler wrote: >> >> This is a shortcoming in our compiler, I'm sorry to say. If you want >> to use images in planet packages, I think the best thing I can offer >> you now is to use define-runtime-path to point to the image and then >> (make-object bitmap% ....), which gives you the same kind of a value >> as the embedded image would, but without embedding it. > > Is there a way to turn a bitmap% object into a htdp/world image? (I don't > mind replacing the embedded image with define-runtime-path and > make-object---although it would be nice if I didn't have to---but I don't > want to rewrite my program to use the GUI toolkit instead of the World > teachpack.) > > David > > From dvanhorn at ccs.neu.edu Wed Oct 15 15:38:42 2008 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Thu Mar 26 02:30:44 2009 Subject: [plt-scheme] Re: Embedded images in planet packages In-Reply-To: <932b2f1f0810151236p3e6f4294l6b0754025f96af1e@mail.gmail.com> References: <48F54C60.3080904@ccs.neu.edu> <932b2f1f0810150431i6c18d02du5ea77d64aa898f4f@mail.gmail.com> <48F644EC.4080302@ccs.neu.edu> <932b2f1f0810151236p3e6f4294l6b0754025f96af1e@mail.gmail.com> Message-ID: <48F646C2.3070006@ccs.neu.edu> Robby Findler wrote: > bitmap%s are htdp/world images. (htdp/world image are not all bitmaps, tho.) Then what am I doing wrong here? #lang scheme (require htdp/world) (require scheme/runtime-path scheme/gui) (define-runtime-path img-path "somegoofyimage.jpg") (define img (make-object bitmap% img-path)) (image-height img) image-height: expected as first argument, given: # David From robby at cs.uchicago.edu Wed Oct 15 15:43:39 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:30:44 2009 Subject: [plt-scheme] Re: Embedded images in planet packages In-Reply-To: <48F646C2.3070006@ccs.neu.edu> References: <48F54C60.3080904@ccs.neu.edu> <932b2f1f0810150431i6c18d02du5ea77d64aa898f4f@mail.gmail.com> <48F644EC.4080302@ccs.neu.edu> <932b2f1f0810151236p3e6f4294l6b0754025f96af1e@mail.gmail.com> <48F646C2.3070006@ccs.neu.edu> Message-ID: <932b2f1f0810151243o758bb35fgb94433f7fda78eef@mail.gmail.com> Oh, duh! Sorry. They image-snip%s, not bitmaps. This is what you want. #lang scheme (require htdp/world) (require scheme/runtime-path scheme/gui) (define-runtime-path img-path '(lib "plt.jpg" "icons")) (define img (make-object image-snip% (make-object bitmap% img-path))) (image-height img) On Wed, Oct 15, 2008 at 2:38 PM, David Van Horn wrote: > Robby Findler wrote: >> >> bitmap%s are htdp/world images. (htdp/world image are not all bitmaps, >> tho.) > > Then what am I doing wrong here? > > #lang scheme > (require htdp/world) > (require scheme/runtime-path scheme/gui) > (define-runtime-path img-path "somegoofyimage.jpg") > (define img (make-object bitmap% img-path)) > (image-height img) > > image-height: expected as first argument, given: # > > David > > From fredm at cs.uml.edu Wed Oct 15 19:21:21 2008 From: fredm at cs.uml.edu (Fred G. Martin) Date: Thu Mar 26 02:30:44 2009 Subject: [plt-scheme] can't run SICP "generic operations" code in PLT Scheme 4.1 In-Reply-To: <932b2f1f0810150532j7075e05cgf826c20febc87fe7@mail.gmail.com> References: <72ef860f0810141959w7e829809ub8610021514a6d87@mail.gmail.com> <1613E743-F66E-4A6B-BBAA-794DFAF2DA22@gmail.com> <72ef860f0810142133n29ffd7c8n645bb13426992f04@mail.gmail.com> <932b2f1f0810150423m7596087q44682515e1cc2c19@mail.gmail.com> <932b2f1f0810150532j7075e05cgf826c20febc87fe7@mail.gmail.com> Message-ID: <72ef860f0810151621h7dec109bpf77322f9e62702aa@mail.gmail.com> Hey, I rewrote the make-table routine using the hash procedures, and it is definitely happier! See below. Thanks too for the pointer to that Version 4.x FAQ. It is long, but clearly discussing the critical issues in a concise fashion. A big help. Fred ;SICP generic operations table re-written with hash (define (make-table) (let ((local-table (make-hash))) (define (lookup key-1 key-2) (hash-ref local-table (list key-1 key-2) #f)) (define (insert! key-1 key-2 value) (hash-set! local-table (list key-1 key-2) value) 'ok) (define (dispatch m) (cond ((eq? m 'lookup-proc) lookup) ((eq? m 'insert-proc!) insert!) (else (error "Unknown operation -- TABLE" m)))) dispatch)) (define operation-table (make-table)) (define get (operation-table 'lookup-proc)) (define put (operation-table 'insert-proc!)) On Wed, Oct 15, 2008 at 8:32 AM, Robby Findler wrote: > On Wed, Oct 15, 2008 at 7:23 AM, Matt Jadud wrote: >> For Fred (and others coming to the PLT 4.x game late), the things that >> took me by surprise yesterday: >> >> 1. Hash table operations have all had name changes. >> A. Mutators are gone from structures. (define-struct foo (a b)) no >> longer yields "set-foo-a!". Yes, they can be introduced at >> definition-time, but not if they're being provided by a library. >> "struct-copy", I think, was the functional way to update a structure. >> (Apologies if I just got that wrong.) > > Yes, struct-copy (note that copy-struct is the old one). > >> 2. 'require' and 'provide' specifications have changed. > > Just in case you didn't find it yet, more along the lines of the above > can be found in the plt distribution: > > plt/doc/release-notes/mzscheme/MzScheme_4.txt > > The latest version of that file is here: > > http://svn.plt-scheme.org/plt/trunk/doc/release-notes/mzscheme/MzScheme_4.txt > > Robby > From jmarshall at alum.mit.edu Wed Oct 15 20:06:22 2008 From: jmarshall at alum.mit.edu (Joe Marshall) Date: Thu Mar 26 02:30:44 2009 Subject: [plt-scheme] Re: [plt-edu] Should computer programming be mandatory In-Reply-To: <5f07325f0810151000u77e9306dva2a5e2b551f46c6a@mail.gmail.com> References: <101420081521.4927.48F4B900000706F10000133F22064244139F9F9F059D0E@comcast.net> <586ED94A-A94D-4F2D-AD89-92B8ECA50788@ccs.neu.edu> <18D4E050-69FE-4816-8936-3C556F06DF71@adelphi.edu> <5f07325f0810151000u77e9306dva2a5e2b551f46c6a@mail.gmail.com> Message-ID: On Wed, Oct 15, 2008 at 10:00 AM, Greg Woodhouse wrote: > > In any case, you really hit the nail on the head: I recall just a few years > ago developing a parser driven tool that would work it's way through the > entire code base and build a dependency graph as best it could. (MUMPS is a > dynamically scoped language, and side-effcts can live a long time.) If I recall correctly, it is a common practice for MUMPS programs to side-effect their own source code during execution. -- ~jrm From jmarshall at alum.mit.edu Wed Oct 15 20:07:56 2008 From: jmarshall at alum.mit.edu (Joe Marshall) Date: Thu Mar 26 02:30:44 2009 Subject: [plt-scheme] Re: [plt-edu] Should computer programming be mandatory In-Reply-To: <586ED94A-A94D-4F2D-AD89-92B8ECA50788@ccs.neu.edu> References: <101420081521.4927.48F4B900000706F10000133F22064244139F9F9F059D0E@comcast.net> <586ED94A-A94D-4F2D-AD89-92B8ECA50788@ccs.neu.edu> Message-ID: On Tue, Oct 14, 2008 at 11:25 AM, Matthias Felleisen wrote: > > If given the chance, I'd love to prove this conjecture for TeachScheme! at > the same scale. While it would be fascinating to try to learn Scheme in Latin, I don't think I'd like to take that kind of course for credit. -- ~jrm From david.vanderson at gmail.com Wed Oct 15 20:33:04 2008 From: david.vanderson at gmail.com (David Vanderson) Date: Thu Mar 26 02:30:45 2009 Subject: [plt-scheme] padding numbers Message-ID: <48F68BC0.3020906@gmail.com> Hello, The other day I wanted to convert an rgb triplet (say 0, 255, 0) into a hex representation padded with zeros (#00ff00). I expected to be able to do something like (format "~02x~02x~02x" r g b), analogous to printf in C. My attempts: - srfi 48 format ~F only outputs in base 10, always pads with spaces - srfi 54 cat automatically prepends "#o" - srfi 13 string-pad: #lang scheme (require srfi/13) (apply string-append (map (lambda (e) (string-pad (format "~x" e) 2 #\0)) '(0 255 0))) This was the best I could think of. Is there a simpler way? Thanks, Dave From lunarc.lists at gmail.com Wed Oct 15 20:36:37 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:30:45 2009 Subject: [plt-scheme] Warnings from macros? Message-ID: This is for a homework assignment, but the assignment was to write a parser for a grammar (in a language of our choice), and I decided to write a parser generator as a scheme macro instead, (much more fun =D) so this question is really outside the scope of the assignment. I have a macro parser-from-grammar, and I want to flag detected ambiguities based on overlaps between calculated first and follow sets. I can call "error", but that will only give one error before dying. Is there a way to emit the equivalent of compilation warnings from a macro? It seems output from printf gets ignored. Henk From robby at cs.uchicago.edu Wed Oct 15 20:54:16 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:30:45 2009 Subject: [plt-scheme] can't run SICP "generic operations" code in PLT Scheme 4.1 In-Reply-To: <72ef860f0810151621h7dec109bpf77322f9e62702aa@mail.gmail.com> References: <72ef860f0810141959w7e829809ub8610021514a6d87@mail.gmail.com> <1613E743-F66E-4A6B-BBAA-794DFAF2DA22@gmail.com> <72ef860f0810142133n29ffd7c8n645bb13426992f04@mail.gmail.com> <932b2f1f0810150423m7596087q44682515e1cc2c19@mail.gmail.com> <932b2f1f0810150532j7075e05cgf826c20febc87fe7@mail.gmail.com> <72ef860f0810151621h7dec109bpf77322f9e62702aa@mail.gmail.com> Message-ID: <932b2f1f0810151754k61c8ae65n3553c55612a0d0a@mail.gmail.com> You could write this even more simply as: (define (make-table) (let ([ht (make-hash)]) (values (? (k1 k2) (hash-ref ht (list k1 k2) #f)) (? (k1 k2 v) (hash-set! ht (list k1 k2) v))))) (define-values (get put) (make-table2)) Or, if you actually wanted to use objects, you'd write something like this: (define table% (class object% (define local-table (make-hash)) (define/public (get k1 k2) (hash-ref local-table (list k1 k2) #f)) (define/public (put k1 k2 v) (hash-set! local-table (list k1 k2) v)) (super-new))) (define operation-table (new table%)) (define (get k1 k2) (send operation-table get k1 k2)) (define (put k1 k2 v) (send operation-table put k1 k2 v)) Robby On Wed, Oct 15, 2008 at 6:21 PM, Fred G. Martin wrote: > Hey, I rewrote the make-table routine using the hash procedures, and > it is definitely happier! See below. > > Thanks too for the pointer to that Version 4.x FAQ. It is long, but > clearly discussing the critical issues in a concise fashion. A big > help. > > Fred > > ;SICP generic operations table re-written with hash > (define (make-table) > (let ((local-table (make-hash))) > (define (lookup key-1 key-2) > (hash-ref local-table (list key-1 key-2) #f)) > (define (insert! key-1 key-2 value) > (hash-set! local-table (list key-1 key-2) value) > 'ok) > (define (dispatch m) > (cond ((eq? m 'lookup-proc) lookup) > ((eq? m 'insert-proc!) insert!) > (else (error "Unknown operation -- TABLE" m)))) > dispatch)) > > (define operation-table (make-table)) > (define get (operation-table 'lookup-proc)) > (define put (operation-table 'insert-proc!)) > > > > On Wed, Oct 15, 2008 at 8:32 AM, Robby Findler wrote: >> On Wed, Oct 15, 2008 at 7:23 AM, Matt Jadud wrote: >>> For Fred (and others coming to the PLT 4.x game late), the things that >>> took me by surprise yesterday: >>> >>> 1. Hash table operations have all had name changes. >>> A. Mutators are gone from structures. (define-struct foo (a b)) no >>> longer yields "set-foo-a!". Yes, they can be introduced at >>> definition-time, but not if they're being provided by a library. >>> "struct-copy", I think, was the functional way to update a structure. >>> (Apologies if I just got that wrong.) >> >> Yes, struct-copy (note that copy-struct is the old one). >> >>> 2. 'require' and 'provide' specifications have changed. >> >> Just in case you didn't find it yet, more along the lines of the above >> can be found in the plt distribution: >> >> plt/doc/release-notes/mzscheme/MzScheme_4.txt >> >> The latest version of that file is here: >> >> http://svn.plt-scheme.org/plt/trunk/doc/release-notes/mzscheme/MzScheme_4.txt >> >> Robby >> > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From deepankar.sharma at gmail.com Wed Oct 15 21:22:00 2008 From: deepankar.sharma at gmail.com (Deepankar Sharma) Date: Thu Mar 26 02:30:46 2009 Subject: [plt-scheme] Re: cannot profile code In-Reply-To: <932b2f1f0810150541l434e246dk9ad4169680c9569c@mail.gmail.com> References: <196230b2-abe2-4590-8202-4b6a8d6cef8e@p49g2000hsd.googlegroups.com> <932b2f1f0810150541l434e246dk9ad4169680c9569c@mail.gmail.com> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: kw-phase0.zip Type: application/zip Size: 650 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081015/fff268fc/kw-phase0.zip From robby at cs.uchicago.edu Wed Oct 15 21:50:36 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:30:46 2009 Subject: [plt-scheme] Re: cannot profile code In-Reply-To: References: <196230b2-abe2-4590-8202-4b6a8d6cef8e@p49g2000hsd.googlegroups.com> <932b2f1f0810150541l434e246dk9ad4169680c9569c@mail.gmail.com> Message-ID: <932b2f1f0810151850w2636af52s9d878681144c4f38@mail.gmail.com> Thanks! That's very helpful. I simplified a little bit further (mostly just to get rid of DrScheme from the picture) and submitted a PR to our bug report tracking system. http://bugs.plt-scheme.org/query/?cmd=view&pr=9838 I've marked you as an interested party, so I think you'll get a message when the bug is fixed. Thanks again, Robby On Wed, Oct 15, 2008 at 8:22 PM, Deepankar Sharma wrote: > I have narrowed the problem down to a minimal piece of code. I am attaching > two files - main.ss and seedgen.ss. > seedgen.ss has mzscheme as the language implementation name. main.ss has > scheme as the language implementation. I dont know if running code across > different implementation names is supposed to work. The code as is works > when "Debugging" is chosen as the dynamic properties for module. The code > does not work when "Debugging and Profiling" is selected. > If I change the implementation name in seedgen.ss to scheme, the code begins > to work. > > I have to admit I have not read much about modules, so I might be missing > something obvious here. > > On Wed, Oct 15, 2008 at 8:41 AM, Robby Findler > wrote: >> >> That sounds like a bug. I tried some simple things and wasn't able to >> reproduce it, tho. Do you mind sending a (hopefully small) program >> that illustrates the problem? >> >> Also, if you wanted to submit a PR (via the "Submit Bug Report" menu >> item in the "Help" menu), that would be appropriate. >> >> Thanks, >> Robby >> >> On Tue, Oct 14, 2008 at 12:22 AM, Deep wrote: >> > Just wanted to clarify - >> > >> > When i choose the "Debugging" under Dynamic Properties of the module >> > language, things work just fine. >> > However if i change the to Dynamic Properties to "Debugging and >> > Profiling" i get the error message pasted above. >> > >> > >> > On Oct 14, 1:07 am, Deep wrote: >> >> I cannot profile an application that I am currently working on. I am >> >> using DrScheme 4.1.1 on windows. >> >> Here is the error trace I get - >> >> require: namespace mismatch; reference (phase 0) to a module "C: >> >> \Program Files\PLT\collects\scheme\private\kw.ss" that is not >> >> available (phase level 0) in: #%app >> >> >> >> Anyway to debug this error ? >> >> _________________________________________________ >> >> For list-related administrative tasks: >> >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > _________________________________________________ >> > For list-related administrative tasks: >> > http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > >> > > > From matthias at ccs.neu.edu Wed Oct 15 22:51:40 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:30:46 2009 Subject: [plt-scheme] Warnings from macros? In-Reply-To: References: Message-ID: <6EC03A8F-3CA6-4A6D-B40F-7B073C8F15F4@ccs.neu.edu> On Oct 15, 2008, at 8:36 PM, Henk Boom wrote: > This is for a homework assignment, but the assignment was to write a > parser for a grammar (in a language of our choice), and I decided to > write a parser generator as a scheme macro instead, (much more fun =D) > so this question is really outside the scope of the assignment. > > I have a macro parser-from-grammar, and I want to flag detected > ambiguities based on overlaps between calculated first and follow > sets. I can call "error", but that will only give one error before > dying. Is there a way to emit the equivalent of compilation warnings > from a macro? It seems output from printf gets ignored. Do you mean this kind of thing? -- Matthias > > #lang scheme > > > (define-syntax (parser stx) > (syntax-case stx () > [(parser a b) > (let* ((f (lambda (x) x)) > (bad? (lambda (x) #t)) > [x (f (syntax a))]) > (if (bad? x) > (begin > (printf "warning !\n") > (syntax '())) > (syntax (list b b b))))])) > > (parser 1 2) > From robby at cs.uchicago.edu Wed Oct 15 22:56:20 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:30:46 2009 Subject: [plt-scheme] Warnings from macros? In-Reply-To: <6EC03A8F-3CA6-4A6D-B40F-7B073C8F15F4@ccs.neu.edu> References: <6EC03A8F-3CA6-4A6D-B40F-7B073C8F15F4@ccs.neu.edu> Message-ID: <932b2f1f0810151956p7d688a52x1dfc5f7586c2cff5@mail.gmail.com> Another thing you can do is create a syntax exception with multiple source locations and raise it, if you want to insist that there not be any ambiguities, but also want to signal them all at once. Robby On Wed, Oct 15, 2008 at 9:51 PM, Matthias Felleisen wrote: > > On Oct 15, 2008, at 8:36 PM, Henk Boom wrote: > >> This is for a homework assignment, but the assignment was to write a >> parser for a grammar (in a language of our choice), and I decided to >> write a parser generator as a scheme macro instead, (much more fun =D) >> so this question is really outside the scope of the assignment. >> >> I have a macro parser-from-grammar, and I want to flag detected >> ambiguities based on overlaps between calculated first and follow >> sets. I can call "error", but that will only give one error before >> dying. Is there a way to emit the equivalent of compilation warnings >> from a macro? It seems output from printf gets ignored. > > Do you mean this kind of thing? -- Matthias > > > >> >> #lang scheme >> >> >> (define-syntax (parser stx) >> (syntax-case stx () >> [(parser a b) >> (let* ((f (lambda (x) x)) >> (bad? (lambda (x) #t)) >> [x (f (syntax a))]) >> (if (bad? x) >> (begin >> (printf "warning !\n") >> (syntax '())) >> (syntax (list b b b))))])) >> >> (parser 1 2) >> > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From lunarc.lists at gmail.com Thu Oct 16 00:13:36 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:30:47 2009 Subject: [plt-scheme] Warnings from macros? In-Reply-To: <6EC03A8F-3CA6-4A6D-B40F-7B073C8F15F4@ccs.neu.edu> References: <6EC03A8F-3CA6-4A6D-B40F-7B073C8F15F4@ccs.neu.edu> Message-ID: 2008/10/15 Matthias Felleisen : > Do you mean this kind of thing? -- Matthias Indeed! It's strange, I was pretty sure I had tried printf-ing from the macro and seeing that it didn't output, but when I try again it works. Thanks for the help! Henk From kbohdan at mail.ru Thu Oct 16 03:23:43 2008 From: kbohdan at mail.ru (kbohdan@mail.ru) Date: Thu Mar 26 02:30:47 2009 Subject: [plt-scheme] Re: Warnings from macros? In-Reply-To: <932b2f1f0810151956p7d688a52x1dfc5f7586c2cff5@mail.gmail.com> References: <6EC03A8F-3CA6-4A6D-B40F-7B073C8F15F4@ccs.neu.edu> <932b2f1f0810151956p7d688a52x1dfc5f7586c2cff5@mail.gmail.com> Message-ID: Robby Findler wrote: > Another thing you can do is create a syntax exception with multiple > source locations and raise it, if you want to insist that there not be > any ambiguities, but also want to signal them all at once. Have related question: How to emit output identical to multiple syntax exceptions? I mean multiple messages each with nice red buttons (in DrScheme) to display related source code. This can be very useful to show multiple failed test cases or multiple grammar ambiguities in original question. BTW is it possible in DrScheme to show warning messages with buttons similar to ones in error messages ? -- Bohdan From sperber at deinprogramm.de Thu Oct 16 04:22:47 2008 From: sperber at deinprogramm.de (Michael Sperber) Date: Thu Mar 26 02:30:47 2009 Subject: [plt-scheme] syntax-case vs. #lang scheme/base Message-ID: I'm probably being wayyyy stupid: So I'm trying to write some code with #lang scheme/base and syntax-case, following the guide, as far as I know: #lang scheme/base (define-syntax foo (lambda (stx) (syntax-case stx () ((_ ?bar) ?bar)))) I get: . compile: bad syntax; function application is not allowed, because no #%app syntax transformer is bound in: (lambda (stx) (syntax-case stx () ((_ ?bar) ?bar))) Following suggestions from previous posts, I've tried various incantations of `require-for-syntax' and `require-for-template', but to no avail. Help would be much appreciated! -- Cheers =8-} Mike Friede, V?lkerverst?ndigung und ?berhaupt blabla From cce at ccs.neu.edu Thu Oct 16 05:10:31 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:30:47 2009 Subject: [plt-scheme] syntax-case vs. #lang scheme/base In-Reply-To: References: Message-ID: <990e0c030810160210g2a5ef15ve681ca63728c1608@mail.gmail.com> If you insert "(require (for-syntax scheme/base))", your error message "upgrades" to "?bar: pattern variable cannot be used outside of a template in: ?bar". Or you could just use "#lang scheme" (which gets the same results, without the require). #lang scheme/base (require (for-syntax scheme/base)) (define-syntax foo (lambda (stx) (syntax-case stx () ((_ ?bar) ?bar)))) On Thu, Oct 16, 2008 at 4:22 AM, Michael Sperber wrote: > > I'm probably being wayyyy stupid: > > So I'm trying to write some code with #lang scheme/base and syntax-case, > following the guide, as far as I know: > > #lang scheme/base > > (define-syntax foo > (lambda (stx) > (syntax-case stx () > ((_ ?bar) ?bar)))) > > I get: > > . compile: bad syntax; function application is not allowed, because no #%app syntax transformer is bound in: (lambda (stx) (syntax-case stx () ((_ ?bar) ?bar))) > > Following suggestions from previous posts, I've tried various > incantations of `require-for-syntax' and `require-for-template', but to > no avail. > > Help would be much appreciated! > > -- > Cheers =8-} Mike > Friede, V?lkerverst?ndigung und ?berhaupt blabla -- Carl Eastlund From d.j.gurnell at gmail.com Thu Oct 16 05:15:10 2008 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Thu Mar 26 02:30:47 2009 Subject: [plt-scheme] syntax-case vs. #lang scheme/base In-Reply-To: References: Message-ID: <75374D46-1CE5-452D-AC71-BF5000CAFC58@gmail.com> Michael Sperber wrote: > [...] > > Following suggestions from previous posts, I've tried various > incantations of `require-for-syntax' and `require-for-template', but > to > no avail. Ah, that old chestnut. The incantation you are seeking is: #lang scheme/base (require (for-syntax scheme/base)) (define-syntax foo (lambda (stx) (syntax-case stx () ((_ ?bar) #'?bar)))) Hope this helps, Cheers, -- Dave From sperber at deinprogramm.de Thu Oct 16 05:19:43 2008 From: sperber at deinprogramm.de (Michael Sperber) Date: Thu Mar 26 02:30:47 2009 Subject: [plt-scheme] syntax-case vs. #lang scheme/base In-Reply-To: <75374D46-1CE5-452D-AC71-BF5000CAFC58@gmail.com> (Dave Gurnell's message of "Thu, 16 Oct 2008 10:15:10 +0100") References: <75374D46-1CE5-452D-AC71-BF5000CAFC58@gmail.com> Message-ID: Dave Gurnell writes: > Ah, that old chestnut. The incantation you are seeking is: > > #lang scheme/base > > (require (for-syntax scheme/base)) Thanks for the quick answers, Carl and Dave! Now, I did try this: (require-for-syntax scheme/base) which doesn't work, but which I always assumed to be synonymous to the above. How is it different? -- Cheers =8-} Mike Friede, V?lkerverst?ndigung und ?berhaupt blabla From cce at ccs.neu.edu Thu Oct 16 05:24:33 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:30:48 2009 Subject: [plt-scheme] syntax-case vs. #lang scheme/base In-Reply-To: References: <75374D46-1CE5-452D-AC71-BF5000CAFC58@gmail.com> Message-ID: <990e0c030810160224k3511c0ddh6719b716d386e139@mail.gmail.com> On Thu, Oct 16, 2008 at 5:19 AM, Michael Sperber wrote: > > Thanks for the quick answers, Carl and Dave! Now, I did try this: > > (require-for-syntax scheme/base) > > which doesn't work, but which I always assumed to be synonymous to the > above. How is it different? It's obsolete - require-for-syntax is a PLT v3xx-ism; (require (for-syntax ...)) is a PLT 4.x-ism. -- Carl Eastlund From sperber at deinprogramm.de Thu Oct 16 05:28:59 2008 From: sperber at deinprogramm.de (Michael Sperber) Date: Thu Mar 26 02:30:48 2009 Subject: [plt-scheme] syntax-case vs. #lang scheme/base In-Reply-To: <990e0c030810160224k3511c0ddh6719b716d386e139@mail.gmail.com> (Carl Eastlund's message of "Thu, 16 Oct 2008 05:24:33 -0400") References: <75374D46-1CE5-452D-AC71-BF5000CAFC58@gmail.com> <990e0c030810160224k3511c0ddh6719b716d386e139@mail.gmail.com> Message-ID: "Carl Eastlund" writes: > On Thu, Oct 16, 2008 at 5:19 AM, Michael Sperber > wrote: >> >> Thanks for the quick answers, Carl and Dave! Now, I did try this: >> >> (require-for-syntax scheme/base) >> >> which doesn't work, but which I always assumed to be synonymous to the >> above. How is it different? > > It's obsolete - require-for-syntax is a PLT v3xx-ism; (require > (for-syntax ...)) is a PLT 4.x-ism. Arglll ... I see that it's not even bound in scheme/base, but the #%app error message keeps me from even seeing that. Thanks! -- Cheers =8-} Mike Friede, V?lkerverst?ndigung und ?berhaupt blabla From DekuDekuplex at Yahoo.com Thu Oct 16 06:11:07 2008 From: DekuDekuplex at Yahoo.com (Benjamin L.Russell) Date: Thu Mar 26 02:30:48 2009 Subject: [plt-scheme] type signature for a multi-parameter function of a fixed number of arguments in Typed Scheme? Message-ID: This time, I would like to write a type signature for a multi-parameter function of a fixed number of arguments in Typed Scheme, but the documentation ("Typed Scheme: Scheme with Static Types" at http://docs.plt-scheme.org/typed-scheme/) is not clear on this. I know how to write a type signature for a function of one argument; e.g.: #lang typed-scheme (: fac (Number -> Number)) (define (fac n) (if (= n 0) 1 (* n (fac (- n 1))))) > (fac 5) - : Number 120 > I also know how to write a type signature for a function of zero arguments; e.g.: #lang typed-scheme (: hello-world-function (-> Void)) (define (hello-world-function) (display "Hello, world!\n")) > (hello-world-function) Hello, world! > Additionally, I know how to write a type signature for a function of a variable number of arguments: #lang typed-scheme (: my-plus-variable (Number * -> Number)) (define (my-plus-variable . ns) (if (null? ns) 0 (+ (car ns) (apply my-plus-variable (cdr ns))))) > (my-plus-variable) - : Number 0 > (my-plus-variable 1 2) - : Number 3 > (my-plus-variable 1 2 3) - : Number 6 > However, I don't know how to write a type signature for a function of a fixed number n of arguments, where n > 1. Here are my attempts to write a function, my-plus, which takes exactly two arguments n1 and n2, and returns their sum: #lang typed-scheme (: my-plus Number -> Number -> Number) (define (my-plus n1 n2) (+ n1 n2)) . :3:0: type declaration: too many arguments in: (: my-plus Number -> Number -> Number) Here's another attempt: #lang typed-scheme (: my-plus (Number -> (Number -> Number))) (define (my-plus n1 n2) (+ n1 n2)) . :4:0: typecheck: Expected function with 1 argument, but got function with 2 arguments in: (define (my-plus n1 n2) (+ n1 n2)) . I want to pass my-plus two separate arguments of type Number, n1 and n2, and return their sum. This is how my function is written in regular #lang scheme: #lang scheme (define (my-plus n1 n2) (+ n1 n2)) > (my-plus 1 2) 3 > Can somebody please explain how I can write this function in Typed Scheme? Also, does Typed Scheme support currying (from the results that I have seen so far, apparently it doesn't)? -- Benjamin L. Russell From cce at ccs.neu.edu Thu Oct 16 06:31:48 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:30:48 2009 Subject: [plt-scheme] type signature for a multi-parameter function of a fixed number of arguments in Typed Scheme? In-Reply-To: References: Message-ID: <990e0c030810160331q1b30b65aq47266f03826f7fc2@mail.gmail.com> You can write both multiple-argument and curried functions in Typed Scheme, but you have to remember to distinguish the two in your definitions and type specifications. A multiple argument function is applied once to multiple arguments, and uses a type signature like (A B -> C). A curried function is applied multiple times, usually to one argument each, and uses a type signature like (A -> (B -> C)). Here is code for both that runs without error in Typed Scheme: #lang typed-scheme (: regular-plus (Number Number -> Number)) (define (regular-plus a b) (+ a b)) (: curried-plus (Number -> (Number -> Number))) (define ((curried-plus a) b) (+ a b)) On Thu, Oct 16, 2008 at 6:11 AM, Benjamin L. Russell wrote: > This time, I would like to write a type signature for a > multi-parameter function of a fixed number of arguments in Typed > Scheme, but the documentation ("Typed Scheme: Scheme with Static > Types" at http://docs.plt-scheme.org/typed-scheme/) is not clear on > this. > > I know how to write a type signature for a function of one argument; > e.g.: > > #lang typed-scheme > > (: fac (Number -> Number)) > (define (fac n) > (if (= n 0) > 1 > (* n (fac (- n 1))))) > >> (fac 5) > - : Number > 120 >> > > I also know how to write a type signature for a function of zero > arguments; e.g.: > > #lang typed-scheme > > (: hello-world-function (-> Void)) > (define (hello-world-function) > (display "Hello, world!\n")) > >> (hello-world-function) > Hello, world! >> > > Additionally, I know how to write a type signature for a function of a > variable number of arguments: > > #lang typed-scheme > > (: my-plus-variable (Number * -> Number)) > (define (my-plus-variable . ns) > (if (null? ns) > 0 > (+ (car ns) (apply my-plus-variable (cdr ns))))) > >> (my-plus-variable) > - : Number > 0 >> (my-plus-variable 1 2) > - : Number > 3 >> (my-plus-variable 1 2 3) > - : Number > 6 >> > > However, I don't know how to write a type signature for a function of > a fixed number n of arguments, where n > 1. Here are my attempts to > write a function, my-plus, which takes exactly two arguments n1 and > n2, and returns their sum: > > #lang typed-scheme > > (: my-plus Number -> Number -> Number) > (define (my-plus n1 n2) > (+ n1 n2)) > > . :3:0: type declaration: too many arguments in: (: > my-plus Number -> Number -> Number) > > Here's another attempt: > > #lang typed-scheme > > (: my-plus (Number -> (Number -> Number))) > (define (my-plus n1 n2) > (+ n1 n2)) > > . :4:0: typecheck: Expected function with 1 argument, > but got function with 2 arguments in: (define (my-plus n1 n2) (+ n1 > n2)) > . > > I want to pass my-plus two separate arguments of type Number, n1 and > n2, and return their sum. This is how my function is written in > regular #lang scheme: > > #lang scheme > > (define (my-plus n1 n2) > (+ n1 n2)) > >> (my-plus 1 2) > 3 >> > > Can somebody please explain how I can write this function in Typed > Scheme? > > Also, does Typed Scheme support currying (from the results that I have > seen so far, apparently it doesn't)? > > -- Benjamin L. Russell -- Carl Eastlund From robby at cs.uchicago.edu Thu Oct 16 07:21:50 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:30:48 2009 Subject: [plt-scheme] Re: Warnings from macros? In-Reply-To: References: <6EC03A8F-3CA6-4A6D-B40F-7B073C8F15F4@ccs.neu.edu> <932b2f1f0810151956p7d688a52x1dfc5f7586c2cff5@mail.gmail.com> Message-ID: <932b2f1f0810160421i4837dd64xc6a28a6f606e6dc3@mail.gmail.com> On Thu, Oct 16, 2008 at 2:23 AM, wrote: > Robby Findler wrote: >> >> Another thing you can do is create a syntax exception with multiple >> source locations and raise it, if you want to insist that there not be >> any ambiguities, but also want to signal them all at once. > > > > Have related question: How to emit output identical to multiple syntax > exceptions? I mean multiple messages each with nice red buttons (in > DrScheme) to display related source code. This can be very useful to show > multiple failed test cases or multiple grammar ambiguities in original > question. > BTW is it possible in DrScheme to show warning messages with buttons similar > to ones in error messages ? At the moment, the only real option is to create a syntax error that might have multiple source locations. typed scheme actually creates separate threads to be able to raise multiple exceptions, but I'm not sure if that's really going to work long term. Robby From DekuDekuplex at Yahoo.com Thu Oct 16 07:50:28 2008 From: DekuDekuplex at Yahoo.com (Benjamin L.Russell) Date: Thu Mar 26 02:30:48 2009 Subject: [plt-scheme] Re: type signature for a multi-parameter function of a fixed number of arguments in Typed Scheme? References: <990e0c030810160331q1b30b65aq47266f03826f7fc2@mail.gmail.com> Message-ID: On Thu, 16 Oct 2008 06:31:48 -0400, "Carl Eastlund" wrote: >You can write both multiple-argument and curried functions in Typed >Scheme, but you have to remember to distinguish the two in your >definitions and type specifications. A multiple argument function is >applied once to multiple arguments, and uses a type signature like (A >B -> C). A curried function is applied multiple times, usually to one >argument each, and uses a type signature like (A -> (B -> C)). Here >is code for both that runs without error in Typed Scheme: > >#lang typed-scheme > >(: regular-plus (Number Number -> Number)) >(define (regular-plus a b) > (+ a b)) This works fine: > (regular-plus 1 2) - : Number 3 > >(: curried-plus (Number -> (Number -> Number))) >(define ((curried-plus a) b) > (+ a b)) This requires some care in use. If I try using it in the same was as regular-plus, it causes an error message; viz.: > (curried-plus 1 2) . typecheck: Too many arguments to function, expected 1, got 2 in: (curried-plus 1 2) However, if I treat (curried-plus 1) as a function to be applied to an argument, say 2, then it works: > ((curried-plus 1) 2) - : Number 3 > Thank you! That is exactly what I was seeking. Now I can write a Typed Scheme version of Towers of Hanoi: #lang typed-scheme (: hanoi-typed (Number -> Void)) (define (hanoi-typed n) (hanoi-helper-typed 'A 'B 'C n)) (: hanoi-helper-typed (Symbol Symbol Symbol Number -> Void)) (define (hanoi-helper-typed source using destination n) (cond ((= n 1) (printf "Moving from disc ~a to ~a.\n" source destination)) (else (hanoi-helper-typed source destination using (- n 1)) (hanoi-helper-typed source using destination 1) (hanoi-helper-typed using source destination (- n 1))))) > (hanoi-typed 1) Moving from disc A to C. > (hanoi-typed 2) Moving from disc A to B. Moving from disc A to C. Moving from disc B to C. > (hanoi-typed 3) Moving from disc A to C. Moving from disc A to B. Moving from disc C to B. Moving from disc A to C. Moving from disc B to A. Moving from disc B to C. Moving from disc A to C. > Now, here is a curried Typed Scheme version of Towers of Hanoi: #lang typed-scheme (: hanoi-curried (Number -> Void)) (define (hanoi-curried n) ((((hanoi-helper-curried 'A) 'B) 'C) n)) (: hanoi-helper-curried (Symbol -> (Symbol -> (Symbol -> (Number -> Void))))) (define ((((hanoi-helper-curried source) using) destination) n) (cond ((= n 1) (printf "Moving from disc ~a to ~a.\n" source destination)) (else ((((hanoi-helper-curried source) destination) using) (- n 1)) ((((hanoi-helper-curried source) using) destination) 1) ((((hanoi-helper-curried using) source) destination) (- n 1))))) > (hanoi-curried 1) Moving from disc A to C. > (hanoi-curried 2) Moving from disc A to B. Moving from disc A to C. Moving from disc B to C. > (hanoi-curried 3) Moving from disc A to C. Moving from disc A to B. Moving from disc C to B. Moving from disc A to C. Moving from disc B to A. Moving from disc B to C. Moving from disc A to C. > This is fun! If only curried-rice were so easy as curried-hanoi ;-). -- Benjamin L. Russell >On Thu, Oct 16, 2008 at 6:11 AM, Benjamin L. Russell > wrote: >> This time, I would like to write a type signature for a >> multi-parameter function of a fixed number of arguments in Typed >> Scheme, but the documentation ("Typed Scheme: Scheme with Static >> Types" at http://docs.plt-scheme.org/typed-scheme/) is not clear on >> this. >> >> I know how to write a type signature for a function of one argument; >> e.g.: >> >> #lang typed-scheme >> >> (: fac (Number -> Number)) >> (define (fac n) >> (if (= n 0) >> 1 >> (* n (fac (- n 1))))) >> >>> (fac 5) >> - : Number >> 120 >>> >> >> I also know how to write a type signature for a function of zero >> arguments; e.g.: >> >> #lang typed-scheme >> >> (: hello-world-function (-> Void)) >> (define (hello-world-function) >> (display "Hello, world!\n")) >> >>> (hello-world-function) >> Hello, world! >>> >> >> Additionally, I know how to write a type signature for a function of a >> variable number of arguments: >> >> #lang typed-scheme >> >> (: my-plus-variable (Number * -> Number)) >> (define (my-plus-variable . ns) >> (if (null? ns) >> 0 >> (+ (car ns) (apply my-plus-variable (cdr ns))))) >> >>> (my-plus-variable) >> - : Number >> 0 >>> (my-plus-variable 1 2) >> - : Number >> 3 >>> (my-plus-variable 1 2 3) >> - : Number >> 6 >>> >> >> However, I don't know how to write a type signature for a function of >> a fixed number n of arguments, where n > 1. Here are my attempts to >> write a function, my-plus, which takes exactly two arguments n1 and >> n2, and returns their sum: >> >> #lang typed-scheme >> >> (: my-plus Number -> Number -> Number) >> (define (my-plus n1 n2) >> (+ n1 n2)) >> >> . :3:0: type declaration: too many arguments in: (: >> my-plus Number -> Number -> Number) >> >> Here's another attempt: >> >> #lang typed-scheme >> >> (: my-plus (Number -> (Number -> Number))) >> (define (my-plus n1 n2) >> (+ n1 n2)) >> >> . :4:0: typecheck: Expected function with 1 argument, >> but got function with 2 arguments in: (define (my-plus n1 n2) (+ n1 >> n2)) >> . >> >> I want to pass my-plus two separate arguments of type Number, n1 and >> n2, and return their sum. This is how my function is written in >> regular #lang scheme: >> >> #lang scheme >> >> (define (my-plus n1 n2) >> (+ n1 n2)) >> >>> (my-plus 1 2) >> 3 >>> >> >> Can somebody please explain how I can write this function in Typed >> Scheme? >> >> Also, does Typed Scheme support currying (from the results that I have >> seen so far, apparently it doesn't)? >> >> -- Benjamin L. Russell From pedro.e.pinto at gmail.com Thu Oct 16 09:43:38 2008 From: pedro.e.pinto at gmail.com (pp) Date: Thu Mar 26 02:30:48 2009 Subject: [plt-scheme] system function and threads Message-ID: <20a68e7e-f7e4-4830-a9bf-07ce691ddf19@b1g2000hsg.googlegroups.com> Hi there, The following snippet: #lang scheme (require scheme/system) (define t (thread (lambda() (system "pause")))) (sleep 1) (kill-thread t) When run in DrScheme, on XP SP3, works as expected on the first run, with control returning to the interaction window after 1 sec, but on the next run will leave DrScheme unresponive. Any thoughts? -pp From noelwelsh at gmail.com Thu Oct 16 10:08:47 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:30:49 2009 Subject: [plt-scheme] padding numbers In-Reply-To: <48F68BC0.3020906@gmail.com> References: <48F68BC0.3020906@gmail.com> Message-ID: On Thu, Oct 16, 2008 at 1:33 AM, David Vanderson wrote: > The other day I wanted to convert an rgb triplet (say 0, 255, 0) into a hex > representation padded with zeros (#00ff00). I expected to be able to do > something like (format "~02x~02x~02x" r g b), analogous to printf in C. ... > #lang scheme > (require srfi/13) > (apply string-append (map (lambda (e) > (string-pad (format "~x" e) 2 #\0)) > '(0 255 0))) I would use number->string instead of format, but otherwise this is how I would do it. N. From jensaxel at soegaard.net Thu Oct 16 10:43:22 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:30:49 2009 Subject: [plt-scheme] padding numbers In-Reply-To: <48F68BC0.3020906@gmail.com> References: <48F68BC0.3020906@gmail.com> Message-ID: <48F7530A.2090807@soegaard.net> David Vanderson wrote: > #lang scheme > (require srfi/13) > (apply string-append (map (lambda (e) > (string-pad (format "~x" e) 2 #\0)) > '(0 255 0))) This was the best I could think of. Is there a simpler way? Not really. I'd probably make a little helper function, but basically it is the same solution. (define (pad2 s) (string-pad (format "~x" s) 2 #\0)) (apply format "~a~a~a" (map pad2 (list 0 255 0))) -- Jens Axel From jos.koot at telefonica.net Thu Oct 16 11:50:14 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:30:49 2009 Subject: [plt-scheme] contract questions Message-ID: Hi (define stream/c (promise/c (or/c null? (cons/c any/c stream/c)))) error: reference to an identifier before its definition: stream/c (define stream/c (flat-rec-contract strm (promise/c null?) (promise/c (cons/c any/c strm)))) error: flat-rec-contract: expected flat contracts as arguments, got # I guess beacuse (promise/c expr) does not yield a flat contract. Is what I want possible? If yes, how? Thanks, Jos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081016/20682621/attachment.html From jpc-ml at zenburn.net Thu Oct 16 14:17:25 2008 From: jpc-ml at zenburn.net (=?UTF-8?B?SmFrdWIgUGlvdHIgQ8WCYXBh?=) Date: Thu Mar 26 02:30:49 2009 Subject: [plt-scheme] syntax-case vs. #lang scheme/base In-Reply-To: References: <75374D46-1CE5-452D-AC71-BF5000CAFC58@gmail.com> <990e0c030810160224k3511c0ddh6719b716d386e139@mail.gmail.com> Message-ID: <48F78535.2050602@zenburn.net> Michael Sperber wrote: > "Carl Eastlund" writes: > >> On Thu, Oct 16, 2008 at 5:19 AM, Michael Sperber >> wrote: >>> Thanks for the quick answers, Carl and Dave! Now, I did try this: >>> >>> (require-for-syntax scheme/base) >>> >>> which doesn't work, but which I always assumed to be synonymous to the >>> above. How is it different? >> It's obsolete - require-for-syntax is a PLT v3xx-ism; (require >> (for-syntax ...)) is a PLT 4.x-ism. > > Arglll ... I see that it's not even bound in scheme/base, but the #%app > error message keeps me from even seeing that. Thanks! This is probably a common mistake when migrating from 3xx. I was bitten by that as well. Maybe a special case could be made to detect require-for-syntax? -- regards, Jakub Piotr C?apa From robby at cs.uchicago.edu Thu Oct 16 14:44:48 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:30:50 2009 Subject: [plt-scheme] contract questions In-Reply-To: References: Message-ID: <932b2f1f0810161144m7f5c361dha4bda2044cb9ed44@mail.gmail.com> The first error is because the contract combinators all evaluate their arguments immediately. They don't delay things. So if you want recursive contract like that, you need to explicitly put in where the delays go, like this: (define stream/c (promise/c (or/c null? (cons/c 1 (recursive-contract stream/c))))) (I used "1" in teh contract just so that I could test it a little) As for the second, that won't work because a flat contract is a contract that can be immediately evaluated (once and for all) on the value in question. This would mean, in the case of a stream, that the entire stream is immediately explored, not what you want. The error message comes about because promise does not produce a flat contract, and flat-rec-contract expects a flat contract. hth, Robby On Thu, Oct 16, 2008 at 10:50 AM, Jos Koot wrote: > Hi > > (define stream/c > (promise/c > (or/c > null? > (cons/c any/c stream/c)))) > > error: reference to an identifier before its definition: stream/c > > (define stream/c > (flat-rec-contract strm > (promise/c null?) > (promise/c (cons/c any/c strm)))) > > error: flat-rec-contract: expected flat contracts as arguments, got > # > I guess beacuse (promise/c expr) does not yield a flat contract. > > Is what I want possible? If yes, how? > > Thanks, Jos > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From noelwelsh at gmail.com Thu Oct 16 15:57:51 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:30:50 2009 Subject: [plt-scheme] Scheme Hackathon at ICFP 2009? Message-ID: Hi all, At ICFP 2007 the Haskell guys organised a "Hackathon": http://www.haskell.org/haskellwiki/Hac_2007_II "It is a coding festival, focusing on producing and improving Haskell libraries, tools and infrastructure." I wonder if the same, or similar, could be organised for (PLT) Scheme at ICFP 2009, which will be in Edinburgh? There are two issues here: 1. Are there enough people interested? (I think about 10 would be enough, 20 would be great) If you're interested, let me know. 2. Would it be worthwhile to run tutorial sessions? I get the impression many people don't know how to develop efficiently using PLT Scheme. E.g. how to use PLaneT development links, how to package code for release, how to test, how to use Scribble. Stuff like Typed Scheme would also be worth presenting tutorials on. If you'd be interested in tutorials, please let me know what kind. A quick note for Scheme UK people: Ewan Higgs has revived Scheme UK. A new Yahoo group has been started. Please sign up at http://tech.groups.yahoo.com/group/schemeuk/ if you have not done so already. Cheers, Noel From raould at gmail.com Thu Oct 16 16:02:04 2008 From: raould at gmail.com (Raoul Duke) Date: Thu Mar 26 02:30:50 2009 Subject: [plt-scheme] modules 4 newbies Message-ID: <91a2ba3e0810161302t471b922ey3f64c17c7fd22ac5@mail.gmail.com> hi, i'm a plt-clueless newbie trying to do some basic module stuff. i sorta figured out why things weren't working, but i still haven't managed to figure it all out yet and get it all working, so i'd like to ask for help! (A) comment on a newbie user experience: figuring out how to be able to write modules is way harder than it should be. i think it is due to: 1) how you write a module in a file depends on context. as i recently finally figured out, if you use "#lang scheme" then you do not use "(module..." [otherwise you get error messages which are not very helpful to the newbie :-]. 2) the documentation which a newbie finds by googling around for things like "plt scheme module" do not explain that; it was only out of sheer luck and desperation that i finally checked http://docs.plt-scheme.org/quick/#(part._.Modules). 3) the complexity of the subject is probably the kind of thing that is hard to explain well in a static html/ascii form, rather than in person, and maybe plt scheme is 99% used in situations where there's a TA available? nevertheless if i ever figure out the nuances then hopefully future folks will google and stumble across this thread :-) (B) unfortunately, even though i now know why my use of "(module..." which is what the overwhelming majority of all docs i found told me to use was not right given that i had #lang scheme in there, which i was also doing because seemingly most all the intro docs told me to, i'm *still* lost as to how to make a module that works. if i remove the "#lang scheme" and try to (require scheme) i still get errors (like "expand: unbound variable in module in: new" because i'm trying to use scheme/gui/base's new frame%, new canvas%, etc.), and if i try to use "#lang scheme" instead then i don't see how i can actually create a new namespace for my stuff. any edification would be appreciated. thank you! From jensaxel at soegaard.net Thu Oct 16 16:05:55 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:30:50 2009 Subject: [plt-scheme] modules 4 newbies In-Reply-To: <91a2ba3e0810161302t471b922ey3f64c17c7fd22ac5@mail.gmail.com> References: <91a2ba3e0810161302t471b922ey3f64c17c7fd22ac5@mail.gmail.com> Message-ID: <48F79EA3.3020401@soegaard.net> Raoul Duke wrote: > i'm a plt-clueless newbie trying to do some basic module stuff. i > sorta figured out why things weren't working, but i still haven't > managed to figure it all out yet and get it all working, so i'd like > to ask for help! > > (A) comment on a newbie user experience: figuring out how to be able > to write modules is way harder than it should be. i think it is due > to: > > 1) how you write a module in a file depends on context. as i recently > finally figured out, if you use "#lang scheme" then you do not use > "(module..." [otherwise you get error messages which are not very > helpful to the newbie :-]. Most likely it is a matter of the correct syntax. Please attach your source files, this makes it easier to pinpoint the error. -- Jens Axel S?gaard From acowley at seas.upenn.edu Thu Oct 16 16:08:54 2008 From: acowley at seas.upenn.edu (Anthony Cowley) Date: Thu Mar 26 02:30:51 2009 Subject: [plt-scheme] modules 4 newbies In-Reply-To: <91a2ba3e0810161302t471b922ey3f64c17c7fd22ac5@mail.gmail.com> References: <91a2ba3e0810161302t471b922ey3f64c17c7fd22ac5@mail.gmail.com> Message-ID: <81addec70810161308s2daebad1v91356e87db19b736@mail.gmail.com> I found Chapter 6 of the Guide to be helpful with this material. Anthony On Thu, Oct 16, 2008 at 4:02 PM, Raoul Duke wrote: > hi, > > i'm a plt-clueless newbie trying to do some basic module stuff. i > sorta figured out why things weren't working, but i still haven't > managed to figure it all out yet and get it all working, so i'd like > to ask for help! > > (A) comment on a newbie user experience: figuring out how to be able > to write modules is way harder than it should be. i think it is due > to: > > 1) how you write a module in a file depends on context. as i recently > finally figured out, if you use "#lang scheme" then you do not use > "(module..." [otherwise you get error messages which are not very > helpful to the newbie :-]. > > 2) the documentation which a newbie finds by googling around for > things like "plt scheme module" do not explain that; it was only out > of sheer luck and desperation that i finally checked > http://docs.plt-scheme.org/quick/#(part._.Modules). > > 3) the complexity of the subject is probably the kind of thing that is > hard to explain well in a static html/ascii form, rather than in > person, and maybe plt scheme is 99% used in situations where there's a > TA available? nevertheless if i ever figure out the nuances then > hopefully future folks will google and stumble across this thread :-) > > (B) unfortunately, even though i now know why my use of "(module..." > which is what the overwhelming majority of all docs i found told me to > use was not right given that i had #lang scheme in there, which i was > also doing because seemingly most all the intro docs told me to, i'm > *still* lost as to how to make a module that works. if i remove the > "#lang scheme" and try to (require scheme) i still get errors (like > "expand: unbound variable in module in: new" because i'm trying to use > scheme/gui/base's new frame%, new canvas%, etc.), and if i try to use > "#lang scheme" instead then i don't see how i can actually create a > new namespace for my stuff. > > any edification would be appreciated. > thank you! > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081016/9bf4320f/attachment.htm From robby at cs.uchicago.edu Thu Oct 16 16:08:55 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:30:51 2009 Subject: [plt-scheme] modules 4 newbies In-Reply-To: <91a2ba3e0810161302t471b922ey3f64c17c7fd22ac5@mail.gmail.com> References: <91a2ba3e0810161302t471b922ey3f64c17c7fd22ac5@mail.gmail.com> Message-ID: <932b2f1f0810161308k4e5d419djf821178a6b8c197a@mail.gmail.com> Probably tou want #lang scheme/gui Also, I recommend that you start reading with what looks interesting directly at docs.plt-scheme.org/ and instead of trying to use google to search thru the docs, use the search bar at the top of that window. Google is not very effective for this specialized search (and we try to make our keyword-based search effective). Robby On Thu, Oct 16, 2008 at 3:02 PM, Raoul Duke wrote: > hi, > > i'm a plt-clueless newbie trying to do some basic module stuff. i > sorta figured out why things weren't working, but i still haven't > managed to figure it all out yet and get it all working, so i'd like > to ask for help! > > (A) comment on a newbie user experience: figuring out how to be able > to write modules is way harder than it should be. i think it is due > to: > > 1) how you write a module in a file depends on context. as i recently > finally figured out, if you use "#lang scheme" then you do not use > "(module..." [otherwise you get error messages which are not very > helpful to the newbie :-]. > > 2) the documentation which a newbie finds by googling around for > things like "plt scheme module" do not explain that; it was only out > of sheer luck and desperation that i finally checked > http://docs.plt-scheme.org/quick/#(part._.Modules). > > 3) the complexity of the subject is probably the kind of thing that is > hard to explain well in a static html/ascii form, rather than in > person, and maybe plt scheme is 99% used in situations where there's a > TA available? nevertheless if i ever figure out the nuances then > hopefully future folks will google and stumble across this thread :-) > > (B) unfortunately, even though i now know why my use of "(module..." > which is what the overwhelming majority of all docs i found told me to > use was not right given that i had #lang scheme in there, which i was > also doing because seemingly most all the intro docs told me to, i'm > *still* lost as to how to make a module that works. if i remove the > "#lang scheme" and try to (require scheme) i still get errors (like > "expand: unbound variable in module in: new" because i'm trying to use > scheme/gui/base's new frame%, new canvas%, etc.), and if i try to use > "#lang scheme" instead then i don't see how i can actually create a > new namespace for my stuff. > > any edification would be appreciated. > thank you! > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From grettke at acm.org Thu Oct 16 16:12:18 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:30:51 2009 Subject: [plt-scheme] modules 4 newbies In-Reply-To: <91a2ba3e0810161302t471b922ey3f64c17c7fd22ac5@mail.gmail.com> References: <91a2ba3e0810161302t471b922ey3f64c17c7fd22ac5@mail.gmail.com> Message-ID: <756daca50810161312r2046ed62hd58a773fb4d6f57e@mail.gmail.com> Hi Raoul, It sounds like you will have a more pleasurable experience if you start by reading the documentation on modules that comes with PLT. From raould at gmail.com Thu Oct 16 16:15:06 2008 From: raould at gmail.com (Raoul Duke) Date: Thu Mar 26 02:30:51 2009 Subject: [plt-scheme] modules 4 newbies In-Reply-To: <932b2f1f0810161308k4e5d419djf821178a6b8c197a@mail.gmail.com> References: <91a2ba3e0810161302t471b922ey3f64c17c7fd22ac5@mail.gmail.com> <932b2f1f0810161308k4e5d419djf821178a6b8c197a@mail.gmail.com> Message-ID: <91a2ba3e0810161315qf31bab0lf4266678a5d9314a@mail.gmail.com> > Google is not very effective for this specialized search (and we try > to make our keyword-based search effective). ok, that sounds like good advice, i will try to approach things that way. (if the PLT group can do anything to make the stuff show up better in google, however, that would probably be good for newbies ;-) sincerely. From roger at stat.Berkeley.EDU Thu Oct 16 02:54:13 2008 From: roger at stat.Berkeley.EDU (roger@stat.Berkeley.EDU) Date: Thu Mar 26 02:30:51 2009 Subject: [plt-scheme] Re: [plt-edu] Should computer programming be mandatory Message-ID: <37347.66.245.141.124.1224140053.squirrel@www.stat.berkeley.edu> >From the comments here it isn't clear how the two groups of students: those who only took English those who took "English plus Latin" were formed. If it was a matter of self selection, the students who choose to take Latin could be very different from the students who do not make the choice. That difference might be the reason for the better scores, not the activity of learning Latin. This is a very old point. If I missed it here, I apologize for the repetition. Roger Purves From jadudm at gmail.com Thu Oct 16 17:01:33 2008 From: jadudm at gmail.com (Matt Jadud) Date: Thu Mar 26 02:30:52 2009 Subject: [plt-scheme] modules 4 newbies In-Reply-To: <91a2ba3e0810161315qf31bab0lf4266678a5d9314a@mail.gmail.com> References: <91a2ba3e0810161302t471b922ey3f64c17c7fd22ac5@mail.gmail.com> <932b2f1f0810161308k4e5d419djf821178a6b8c197a@mail.gmail.com> <91a2ba3e0810161315qf31bab0lf4266678a5d9314a@mail.gmail.com> Message-ID: On Thu, Oct 16, 2008 at 4:15 PM, Raoul Duke wrote: > (if the PLT group can do anything to make the stuff show up better in > google, however, that would probably be good for newbies ;-) Another hint: #lang scheme sets the language of the module you are writing. Good. Now, if you want to include some libraries, you can do that: (require net/url) would load the "url" library in the "net" collection into your module. Likewise, you can load the GUI stuff in as well. (require mred/mred) At that point, I think you can write things like (define f (new frame% (label "Hi"))) (send f show #t) and get an empty frame on the screen. So, if you've been reading about namespaces, go ahead and relax: it doesn't require that level of complexity so soon! Really, your module language is likely to be "scheme" or "scheme/base", and from there, you can require in the pieces that you need. Or, as has been mentioned, you can use some of the other language combos (eg. scheme/gui) which, I imagine, is effectively the same as requiring in the appropriate libraries. I'd also follow the advice of the previous posters about the documentation, how to search it reliably, and so on. Cheers, Matt From matthias at ccs.neu.edu Thu Oct 16 17:02:13 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:30:52 2009 Subject: [plt-scheme] Re: [plt-edu] Should computer programming be mandatory In-Reply-To: <37347.66.245.141.124.1224140053.squirrel@www.stat.berkeley.edu> References: <37347.66.245.141.124.1224140053.squirrel@www.stat.berkeley.edu> Message-ID: <6D69E092-D0BC-4925-B4F2-41911A63134A@ccs.neu.edu> Yes, this is an old point and I got the impression that the people who studied this question with some 16,000 students thought of it -- Matthias On Oct 16, 2008, at 2:54 AM, roger@stat.Berkeley.EDU wrote: >> From the comments here it isn't clear > how the two groups of students: > > those who only took English > those who took "English plus Latin" > > were formed. If it was a matter of > self selection, the students who > choose to take Latin could be > very different from the students > who do not make the choice. > That difference might be the > reason for the better scores, > not the activity of learning Latin. > > This is a very old point. If I missed > it here, I apologize for the repetition. > > Roger Purves > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From robby at cs.uchicago.edu Thu Oct 16 17:03:42 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:30:52 2009 Subject: [plt-scheme] modules 4 newbies In-Reply-To: References: <91a2ba3e0810161302t471b922ey3f64c17c7fd22ac5@mail.gmail.com> <932b2f1f0810161308k4e5d419djf821178a6b8c197a@mail.gmail.com> <91a2ba3e0810161315qf31bab0lf4266678a5d9314a@mail.gmail.com> Message-ID: <932b2f1f0810161403s5749a8e2wca763894fd934de4@mail.gmail.com> (Just one note: if you use #lang scheme/gui as your first line, you'll get the gui and class libraries right away without the extra require line.) Robby On Thu, Oct 16, 2008 at 4:01 PM, Matt Jadud wrote: > On Thu, Oct 16, 2008 at 4:15 PM, Raoul Duke wrote: >> (if the PLT group can do anything to make the stuff show up better in >> google, however, that would probably be good for newbies ;-) > > Another hint: > > #lang scheme > > sets the language of the module you are writing. Good. > > Now, if you want to include some libraries, you can do that: > > (require net/url) > > would load the "url" library in the "net" collection into your module. > Likewise, you can load the GUI stuff in as well. > > (require mred/mred) > > At that point, I think you can write things like > > (define f (new frame% (label "Hi"))) > (send f show #t) > > and get an empty frame on the screen. > > So, if you've been reading about namespaces, go ahead and relax: it > doesn't require that level of complexity so soon! Really, your module > language is likely to be "scheme" or "scheme/base", and from there, > you can require in the pieces that you need. Or, as has been > mentioned, you can use some of the other language combos (eg. > scheme/gui) which, I imagine, is effectively the same as requiring in > the appropriate libraries. > > I'd also follow the advice of the previous posters about the > documentation, how to search it reliably, and so on. > > Cheers, > Matt > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From clements at brinckerhoff.org Thu Oct 16 17:08:39 2008 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:30:52 2009 Subject: [plt-scheme] syntax-case vs. #lang scheme/base In-Reply-To: <48F78535.2050602@zenburn.net> References: <75374D46-1CE5-452D-AC71-BF5000CAFC58@gmail.com> <990e0c030810160224k3511c0ddh6719b716d386e139@mail.gmail.com> <48F78535.2050602@zenburn.net> Message-ID: <0CB58633-7CE2-42F3-8376-5ED13B95AE40@brinckerhoff.org> On Oct 16, 2008, at 11:17 AM, Jakub Piotr C?apa wrote: > Michael Sperber wrote: >> "Carl Eastlund" writes: >>> On Thu, Oct 16, 2008 at 5:19 AM, Michael Sperber >>> wrote: >>>> Thanks for the quick answers, Carl and Dave! Now, I did try this: >>>> >>>> (require-for-syntax scheme/base) >>>> >>>> which doesn't work, but which I always assumed to be synonymous >>>> to the >>>> above. How is it different? >>> It's obsolete - require-for-syntax is a PLT v3xx-ism; (require >>> (for-syntax ...)) is a PLT 4.x-ism. >> Arglll ... I see that it's not even bound in scheme/base, but the # >> %app >> error message keeps me from even seeing that. Thanks! > > This is probably a common mistake when migrating from 3xx. I was > bitten by that as well. > > Maybe a special case could be made to detect require-for-syntax? I've also been bitten by this several times; unfortunately, it seems like the hidden piece of information here lives only in the programmer's mind: "This require-for-syntax thing is not a runtime animal: if it's unbound, I want to know about it before you report any other syntax errors." John -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2484 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081016/99deeb17/smime.bin From raould at gmail.com Thu Oct 16 17:18:44 2008 From: raould at gmail.com (Raoul Duke) Date: Thu Mar 26 02:30:53 2009 Subject: [plt-scheme] modules 4 newbies In-Reply-To: <932b2f1f0810161403s5749a8e2wca763894fd934de4@mail.gmail.com> References: <91a2ba3e0810161302t471b922ey3f64c17c7fd22ac5@mail.gmail.com> <932b2f1f0810161308k4e5d419djf821178a6b8c197a@mail.gmail.com> <91a2ba3e0810161315qf31bab0lf4266678a5d9314a@mail.gmail.com> <932b2f1f0810161403s5749a8e2wca763894fd934de4@mail.gmail.com> Message-ID: <91a2ba3e0810161418i63ae18dfo6a34449b5c921fd2@mail.gmail.com> ja, the issue is that i want to write some code which uses the gui library, but then all that is wrapped up in my own module. i want my module to use other standard modules. From eli at barzilay.org Thu Oct 16 17:45:29 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:30:53 2009 Subject: [plt-scheme] modules 4 newbies In-Reply-To: <91a2ba3e0810161315qf31bab0lf4266678a5d9314a@mail.gmail.com> References: <91a2ba3e0810161302t471b922ey3f64c17c7fd22ac5@mail.gmail.com> <932b2f1f0810161308k4e5d419djf821178a6b8c197a@mail.gmail.com> <91a2ba3e0810161315qf31bab0lf4266678a5d9314a@mail.gmail.com> Message-ID: <18679.46585.628606.33797@arabic.ccs.neu.edu> On Oct 16, Raoul Duke wrote: > > (if the PLT group can do anything to make the stuff show up better > in google, however, that would probably be good for newbies ;-) We do try that, but it's much more difficult than it sounds. The best thing you can do to get accurate documentation is to use `f1' in drscheme or run `plt-help' from the command-line. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From eli at barzilay.org Thu Oct 16 17:47:47 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:30:53 2009 Subject: [plt-scheme] modules 4 newbies In-Reply-To: <91a2ba3e0810161418i63ae18dfo6a34449b5c921fd2@mail.gmail.com> References: <91a2ba3e0810161302t471b922ey3f64c17c7fd22ac5@mail.gmail.com> <932b2f1f0810161308k4e5d419djf821178a6b8c197a@mail.gmail.com> <91a2ba3e0810161315qf31bab0lf4266678a5d9314a@mail.gmail.com> <932b2f1f0810161403s5749a8e2wca763894fd934de4@mail.gmail.com> <91a2ba3e0810161418i63ae18dfo6a34449b5c921fd2@mail.gmail.com> Message-ID: <18679.46723.179888.183953@arabic.ccs.neu.edu> On Oct 16, Raoul Duke wrote: > ja, the issue is that i want to write some code which uses the gui > library, but then all that is wrapped up in my own module. i want my > module to use other standard modules. The advice that you were given before (and on your blog) still holds: use #lang scheme/gui at the beginning of source files (no (module ...) needed), use (require foo/bar) to require stuff from standard modules, and use (require "foo/bar.ss") to require stuff from your modules, with a path relative to the file holding the `require'. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From jpc-ml at zenburn.net Thu Oct 16 17:56:40 2008 From: jpc-ml at zenburn.net (=?UTF-8?B?SmFrdWIgUGlvdHIgQ8WCYXBh?=) Date: Thu Mar 26 02:30:53 2009 Subject: [plt-scheme] modules 4 newbies In-Reply-To: <91a2ba3e0810161418i63ae18dfo6a34449b5c921fd2@mail.gmail.com> References: <91a2ba3e0810161302t471b922ey3f64c17c7fd22ac5@mail.gmail.com> <932b2f1f0810161308k4e5d419djf821178a6b8c197a@mail.gmail.com> <91a2ba3e0810161315qf31bab0lf4266678a5d9314a@mail.gmail.com> <932b2f1f0810161403s5749a8e2wca763894fd934de4@mail.gmail.com> <91a2ba3e0810161418i63ae18dfo6a34449b5c921fd2@mail.gmail.com> Message-ID: <48F7B898.1000209@zenburn.net> Raoul Duke wrote: > ja, the issue is that i want to write some code which uses the gui > library, but then all that is wrapped up in my own module. i want my > module to use other standard modules. This is not a problem. Using #lang scheme/gui gives you the same result as using #lang scheme and importing the gui libraries. That is, you don't lose anything from the `scheme' language. Maybe a small note about the whole #lang thing will help you (since you've been reading the old docs): #lang scheme is equivalent to inserting the file contents inside (module "file-name-where-the-lang-was-found" scheme ... ) And this is even how it is implemented. Think of #lang as a syntactic sugar for the old modules. The scheme/gui (and mred/mred) is a new syntax for requires but this also has a simple mapping to the old method (which is still valid). Check the new Guide and Reference (on docs.pld-scheme.org). -- regards, Jakub Piotr C?apa From eli at barzilay.org Thu Oct 16 18:04:54 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:30:53 2009 Subject: [plt-scheme] modules 4 newbies In-Reply-To: <48F7B898.1000209@zenburn.net> References: <91a2ba3e0810161302t471b922ey3f64c17c7fd22ac5@mail.gmail.com> <932b2f1f0810161308k4e5d419djf821178a6b8c197a@mail.gmail.com> <91a2ba3e0810161315qf31bab0lf4266678a5d9314a@mail.gmail.com> <932b2f1f0810161403s5749a8e2wca763894fd934de4@mail.gmail.com> <91a2ba3e0810161418i63ae18dfo6a34449b5c921fd2@mail.gmail.com> <48F7B898.1000209@zenburn.net> Message-ID: <18679.47750.472560.839757@arabic.ccs.neu.edu> On Oct 16, Jakub Piotr C?apa wrote: > Maybe a small note about the whole #lang thing will help you (since > you've been reading the old docs): > #lang scheme > is equivalent to inserting the file contents inside > (module "file-name-where-the-lang-was-found" scheme > ... > ) > And this is even how it is implemented. Think of #lang as a syntactic > sugar for the old modules. You can even try it out -- run this program and see what gets printed: #lang scheme '#lang scheme/gui (define blah "blah") -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From raould at gmail.com Thu Oct 16 22:54:14 2008 From: raould at gmail.com (Raoul Duke) Date: Thu Mar 26 02:30:53 2009 Subject: [plt-scheme] Re: modules 4 newbies In-Reply-To: <91a2ba3e0810161302t471b922ey3f64c17c7fd22ac5@mail.gmail.com> References: <91a2ba3e0810161302t471b922ey3f64c17c7fd22ac5@mail.gmail.com> Message-ID: <91a2ba3e0810161954m2d9694c9p5cedfff085688a48@mail.gmail.com> hi, thanks to you all for your notes! but, ok, it still seems to me to be designed to confused newbies :-) (0) if the newbie starts with the "in pictures" docs and goes through all of them from start to finish, then they might not get screwed up. otherwise, the main things which confused me are: (A) "(module..." vs. "#lang" and (B) when using #lang, how to 'name' the module. i think it is easy for a newbie to get confused about it all because: (1) seems most intros start the newbie off with "#lang" which is incompatible with the "(module..." way. (2) but the 'real' plt scheme docs talk about using "(module..." still and don't mention how "#lang" factors into that. http://download.plt-scheme.org/doc/4.1/html/reference/eval-model.html#(part._module-eval-model) maybe if somebody could update the plt docs to cross-reference from module to notes about "#lang" such as http://download.plt-scheme.org/doc/4.1/html/quick/index.html#(part._.Modules) that would probably be good for newbies? tho i'd say that even that isn't complete since it doesn't explicitly say what the name of the module is in the latter case, whereas it is explicitly typed in by the developer when they use the "(module..." form. i assume that the name of the module via the "#lang" approach is whatever the name of the file it is saved in happens to be, minus the extension (and ignoring issues of path depth). (and then there's the further thing about what the search paths are for libraries, which is a usability thing in my mind, but that's another story.) sincerely. From DekuDekuplex at Yahoo.com Thu Oct 16 22:54:37 2008 From: DekuDekuplex at Yahoo.com (Benjamin L.Russell) Date: Thu Mar 26 02:30:54 2009 Subject: [plt-scheme] Re: Scheme Hackathon at ICFP 2009? References: Message-ID: On Thu, 16 Oct 2008 20:57:51 +0100, "Noel Welsh" wrote: >Stuff like Typed >Scheme would also be worth presenting tutorials on. Agreed! If you create any online versions, please let me know! I would be especially interested in a list of advantages of "#lang typed-scheme" over "#lang scheme," and how these advantages could be best utilized. Another useful document would be a guide to Typed Scheme for functional programmers who also use Haskell, highlighting, in particular, differences in currying. -- Benjamin L. Russell From jos.koot at telefonica.net Fri Oct 17 04:08:16 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:30:54 2009 Subject: [plt-scheme] contract questions References: <932b2f1f0810161144m7f5c361dha4bda2044cb9ed44@mail.gmail.com> Message-ID: Thanks very much, I'll try it out. Your explanation confirms what I already guessed. Looking around in the docs I did not cross *recursive-contract* by myself. Apparently I am not a good doc server, for it's there allright. Thanks again, Jos ----- Original Message ----- From: "Robby Findler" To: "Jos Koot" Cc: Sent: Thursday, October 16, 2008 8:44 PM Subject: Re: [plt-scheme] contract questions > The first error is because the contract combinators all evaluate their > arguments immediately. They don't delay things. So if you want > recursive contract like that, you need to explicitly put in where the > delays go, like this: > > (define stream/c > (promise/c > (or/c > null? > (cons/c 1 > (recursive-contract stream/c))))) > > (I used "1" in teh contract just so that I could test it a little) > > As for the second, that won't work because a flat contract is a > contract that can be immediately evaluated (once and for all) on the > value in question. This would mean, in the case of a stream, that the > entire stream is immediately explored, not what you want. The error > message comes about because promise does not produce a flat contract, > and flat-rec-contract expects a flat contract. > > hth, > Robby > > On Thu, Oct 16, 2008 at 10:50 AM, Jos Koot > wrote: >> Hi >> >> (define stream/c >> (promise/c >> (or/c >> null? >> (cons/c any/c stream/c)))) >> >> error: reference to an identifier before its definition: stream/c >> >> (define stream/c >> (flat-rec-contract strm >> (promise/c null?) >> (promise/c (cons/c any/c strm)))) >> >> error: flat-rec-contract: expected flat contracts as arguments, got >> # >> I guess beacuse (promise/c expr) does not yield a flat contract. >> >> Is what I want possible? If yes, how? >> >> Thanks, Jos >> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> > From spdegabrielle at gmail.com Fri Oct 17 06:12:08 2008 From: spdegabrielle at gmail.com (Stephen De Gabrielle) Date: Thu Mar 26 02:30:54 2009 Subject: [plt-scheme] getting argument identifiers Message-ID: <595b9ab20810170312u7fdb5b08jca8010ecf6961d1e@mail.gmail.com> Hi, I was wondering if there is a way of defining a function or macro that could get the identifiers for the arguments it is passed, > (define x 2) > (print-identifier-and-value x) x:2 > Please forgive me if this is the dumb question I suspect it is. What I was trying to do was define a macro that would dump whatever I stuffed into it. (instead of using printf functions all through my code) It can get unwieldy so I wanted to print the identifiers too. (define-syntax dump-all (syntax-rules () [(_ x ...) (begin (printf "Dump:~N") (for-each (lambda (i) (printf "item:~n~v~n" i)) (list x ...)) (printf "Dump End~n") )])) (define x "dfd") (dump-all 2 4 x) Cheers, Stephen From jensaxel at soegaard.net Fri Oct 17 06:18:42 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:30:54 2009 Subject: [plt-scheme] getting argument identifiers In-Reply-To: <595b9ab20810170312u7fdb5b08jca8010ecf6961d1e@mail.gmail.com> References: <595b9ab20810170312u7fdb5b08jca8010ecf6961d1e@mail.gmail.com> Message-ID: <48F86682.6010108@soegaard.net> Stephen De Gabrielle wrote: > What I was trying to do was define a macro that would dump whatever I > stuffed into it. (instead of using printf functions all through my > code) > It can get unwieldy so I wanted to print the identifiers too. > > (define-syntax dump-all > (syntax-rules () > [(_ x ...) > (begin > (printf "Dump:~N") > (for-each > (lambda (i) (printf "item:~n~v~n" i)) > (list x ...)) > (printf "Dump End~n") > )])) > > (define x "dfd") > (dump-all 2 4 x) > Do you mean something like this? #lang scheme (define-syntax dump-all (syntax-rules () [(_ x ...) (begin (for-each (lambda (e v) (printf "expression: ~v value: ~v ~n" e v)) '(x ...) (list x ...)))])) (define x "dfd") (dump-all 2 4 x) which prints expression: 2 value: 2 expression: 4 value: 4 expression: x value: "dfd" ? -- Jens Axel S?gaard From spdegabrielle at gmail.com Fri Oct 17 06:26:02 2008 From: spdegabrielle at gmail.com (Stephen De Gabrielle) Date: Thu Mar 26 02:30:54 2009 Subject: [plt-scheme] getting argument identifiers In-Reply-To: <48F86682.6010108@soegaard.net> References: <595b9ab20810170312u7fdb5b08jca8010ecf6961d1e@mail.gmail.com> <48F86682.6010108@soegaard.net> Message-ID: <595b9ab20810170326y6cc073b6q2f9a903e595c7b58@mail.gmail.com> yes exactly! Thanks Stephen -- From noelwelsh at gmail.com Fri Oct 17 07:53:12 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:30:54 2009 Subject: [plt-scheme] getting argument identifiers In-Reply-To: <595b9ab20810170312u7fdb5b08jca8010ecf6961d1e@mail.gmail.com> References: <595b9ab20810170312u7fdb5b08jca8010ecf6961d1e@mail.gmail.com> Message-ID: The debug functions in unlib do what you want, I think. N . On Fri, Oct 17, 2008 at 11:12 AM, Stephen De Gabrielle wrote: > Hi, > > I was wondering if there is a way of defining a function or macro that > could get the identifiers for the arguments it is passed, ... From noelwelsh at gmail.com Fri Oct 17 08:35:56 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:30:55 2009 Subject: [plt-scheme] upgrading installed planet packages In-Reply-To: <87wsglbfad.fsf@mithrandir.homeunix.net> References: <87wsglbfad.fsf@mithrandir.homeunix.net> Message-ID: On Mon, Oct 6, 2008 at 10:10 PM, Jose A. Ortega Ruiz wrote: > I track PLT using svn, re-building it from source every now and then, > which is a rather painless procedure. I usually choose the in-place > build/install, linking the binaries to somewhere in my PATH. But > everytime the version number of PLT changes, all my downloaded planet > packages (living in ~/.plt) are forgotten, because they live in > version-specific folders. Is there away of automating their > re-installation after an upgrade? There is no way I know of, but it isn't an issue I've had. Next time I run my tests, which is usually the first thing I do when I start developing, they all get downloaded and installed again. *shrug* Works for me. N. From d.j.gurnell at gmail.com Fri Oct 17 09:55:51 2008 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Thu Mar 26 02:30:55 2009 Subject: [plt-scheme] getting argument identifiers In-Reply-To: References: <595b9ab20810170312u7fdb5b08jca8010ecf6961d1e@mail.gmail.com> Message-ID: > The debug functions in unlib do what you want, I think. Yes. The Unlib "debug.ss" module is basically a bunch of glorified print statements that do this kind of thing. Check out the docs to see if it fits your requirements: http://planet.plt-scheme.org/package-source/untyped/unlib.plt/3/8/planet-docs/unlib/debug.html -- Dave From matthias at ccs.neu.edu Fri Oct 17 10:03:46 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:30:55 2009 Subject: [plt-scheme] Scheme Hackathon at ICFP 2009? In-Reply-To: References: Message-ID: You might wish to consider porting as many Planet packages (and even core libraries) as possible to Typed Scheme, first with adapter modules then going into them. Warning: we do not have polymorphism under control and we don't support class.ss yet (on the class definition side). We could advertise it as 'adding types to one untyped language in 36 hours'. -- Matthias On Oct 16, 2008, at 3:57 PM, Noel Welsh wrote: > Hi all, > > At ICFP 2007 the Haskell guys organised a "Hackathon": > > http://www.haskell.org/haskellwiki/Hac_2007_II > > "It is a coding festival, focusing on producing and improving Haskell > libraries, tools and infrastructure." > > I wonder if the same, or similar, could be organised for (PLT) Scheme > at ICFP 2009, which will be in Edinburgh? There are two issues here: > > 1. Are there enough people interested? (I think about 10 would be > enough, 20 would be great) If you're interested, let me know. > > 2. Would it be worthwhile to run tutorial sessions? I get the > impression many people don't know how to develop efficiently using PLT > Scheme. E.g. how to use PLaneT development links, how to package code > for release, how to test, how to use Scribble. Stuff like Typed > Scheme would also be worth presenting tutorials on. If you'd be > interested in tutorials, please let me know what kind. > > A quick note for Scheme UK people: Ewan Higgs has revived Scheme UK. > A new Yahoo group has been started. Please sign up at > http://tech.groups.yahoo.com/group/schemeuk/ if you have not done so > already. > > Cheers, > Noel > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From esmith at acanac.net Fri Oct 17 10:06:35 2008 From: esmith at acanac.net (Ernie Smith) Date: Thu Mar 26 02:30:55 2009 Subject: [plt-scheme] Should computer programming be mandatory In-Reply-To: <101420081521.4927.48F4B900000706F10000133F22064244139F9F9F059D0E@comcast.net> References: <101420081521.4927.48F4B900000706F10000133F22064244139F9F9F059D0E@comcast.net> Message-ID: <48F89BEB.1040603@acanac.net> arkppp@comcast.net wrote: > Some food for thought.... > > http://weblog.infoworld.com/fatalexception/archives/2008/10/mandatory_compu.html > > If there is decline in the quality of education, perhaps it is a consequence of a misguided propensity to equate the goal of education with the goal of training a workforce. If food for thought is what you are after try this.. http://www.preservenet.com/theory/Illich/Silence.html From eli at barzilay.org Fri Oct 17 10:10:27 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:30:55 2009 Subject: [plt-scheme] Re: modules 4 newbies In-Reply-To: <91a2ba3e0810161954m2d9694c9p5cedfff085688a48@mail.gmail.com> References: <91a2ba3e0810161302t471b922ey3f64c17c7fd22ac5@mail.gmail.com> <91a2ba3e0810161954m2d9694c9p5cedfff085688a48@mail.gmail.com> Message-ID: <18680.40147.182019.624619@arabic.ccs.neu.edu> On Oct 16, Raoul Duke wrote: > hi, > > thanks to you all for your notes! > > but, ok, it still seems to me to be designed to confused newbies :-) > > (0) if the newbie starts with the "in pictures" docs and goes through > all of them from start to finish, then they might not get screwed up. > > otherwise, the main things which confused me are: (A) "(module..." > vs. "#lang" and (B) when using #lang, how to 'name' the module. IIUC, the thing that confused you was old pieces of documentation and other material that you found via google. If you just hit F1 in drscheme when the cursor is on the `#lang', or just hit F1 and enter `#lang' in the search you get one reference entry that specifies it, and one guide entry that explicitly talks about how `#lang' is read in as a (module ...) expression. > i think it is easy for a newbie to get confused about it all > because: > > (1) seems most intros start the newbie off with "#lang" which is > incompatible with the "(module..." way. They're not incompatible, they're just similar ways to specify the language of a file. `#lang' is preferred since it can do more (ie, make the module use a different reader). It's good that all intros use it -- it should be a strong hint that you should use it too. > (2) but the 'real' plt scheme docs talk about using "(module..." still > and don't mention how "#lang" factors into that. > http://download.plt-scheme.org/doc/4.1/html/reference/eval-model.html#(part._module-eval-model) The "Evaluation Model" is most definitely not something that a newbie should start from. This is why the first entries on the documentation page are all "guide" manuals. But it seems that none of that would help if your approach is to use google to find documentation. If you just ran `plt-help', you'd see those guides first, and I suspect that much of your confusion would never have happened. > tho i'd say that even that isn't complete since it doesn't > explicitly say what the name of the module is in the latter case, > whereas it is explicitly typed in by the developer when they use the > "(module..." form. i assume that the name of the module via the > "#lang" approach is whatever the name of the file it is saved in > happens to be, minus the extension (and ignoring issues of path > depth). Right. As a *newbie* you shouldn't even care about such details. This is why `#lang' is doing what it's doing -- all you need to do is prefix your file with `#lang scheme' (or `#lang scheme/gui') and start writing code. (And in the initial stages of experimenting with the environment you shouldn't even care about the fact that your file is a "module" -- that should come later.) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From spdegabrielle at gmail.com Fri Oct 17 10:46:26 2008 From: spdegabrielle at gmail.com (Stephen De Gabrielle) Date: Thu Mar 26 02:30:55 2009 Subject: [plt-scheme] getting argument identifiers In-Reply-To: References: <595b9ab20810170312u7fdb5b08jca8010ecf6961d1e@mail.gmail.com> Message-ID: <595b9ab20810170746w589c2c53nd41e1f455c55ed28@mail.gmail.com> Thanks Guys, Cheers, Stephen From grettke at acm.org Fri Oct 17 11:04:51 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:30:56 2009 Subject: [plt-scheme] Scheme Hackathon at ICFP 2009? In-Reply-To: References: Message-ID: <756daca50810170804g3c90c68cnea37a05a81d3fb3f@mail.gmail.com> On Fri, Oct 17, 2008 at 9:03 AM, Matthias Felleisen wrote: > You might wish to consider porting as many Planet packages (and even core > libraries) as possible to Typed Scheme, first with adapter modules then > going into them. Warning: we do not have polymorphism under control and we > don't support class.ss yet (on the class definition side). Do you have a standard approach for doing so like: 1. Write unit tests. 2. Add contracts. 2. Port it over. ...? From matthias at ccs.neu.edu Fri Oct 17 11:10:27 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:30:56 2009 Subject: [plt-scheme] Scheme Hackathon at ICFP 2009? In-Reply-To: <756daca50810170804g3c90c68cnea37a05a81d3fb3f@mail.gmail.com> References: <756daca50810170804g3c90c68cnea37a05a81d3fb3f@mail.gmail.com> Message-ID: <601A2D46-1C92-47C7-A2A3-2E886D8CF1B4@ccs.neu.edu> understand, capture your understanding in unit tests, assign types, run type checker, inspect surprises. On Oct 17, 2008, at 11:04 AM, Grant Rettke wrote: > On Fri, Oct 17, 2008 at 9:03 AM, Matthias Felleisen > wrote: >> You might wish to consider porting as many Planet packages (and >> even core >> libraries) as possible to Typed Scheme, first with adapter modules >> then >> going into them. Warning: we do not have polymorphism under >> control and we >> don't support class.ss yet (on the class definition side). > > Do you have a standard approach for doing so like: > > 1. Write unit tests. > 2. Add contracts. > 2. Port it over. > ...? From dvanhorn at ccs.neu.edu Fri Oct 17 11:17:45 2008 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Thu Mar 26 02:30:56 2009 Subject: testing and types [was Re: [plt-scheme] Scheme Hackathon at ICFP 2009?] In-Reply-To: <601A2D46-1C92-47C7-A2A3-2E886D8CF1B4@ccs.neu.edu> References: <756daca50810170804g3c90c68cnea37a05a81d3fb3f@mail.gmail.com> <601A2D46-1C92-47C7-A2A3-2E886D8CF1B4@ccs.neu.edu> Message-ID: <48F8AC99.1010909@ccs.neu.edu> Matthias Felleisen wrote: > > understand, capture your understanding in unit tests, assign types, run > type checker, inspect surprises. It's unfortunate, at least the last time I checked, check-expect and Typed Scheme don't play together. David From plragde at uwaterloo.ca Fri Oct 17 11:33:03 2008 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:30:56 2009 Subject: [plt-scheme] Scheme Hackathon at ICFP 2009? In-Reply-To: Message-ID: <48F8B02F.205@uwaterloo.ca> Matthias wrote: > Warning: we do not have polymorphism > under control Then again, who does? --PR From pocm at soton.ac.uk Fri Oct 17 12:09:47 2008 From: pocm at soton.ac.uk (Paulo J. Matos) Date: Thu Mar 26 02:30:56 2009 Subject: [plt-scheme] Scheme Hackathon at ICFP 2009? In-Reply-To: References: Message-ID: <200810171709.47294.pocm@soton.ac.uk> On Friday 17 October 2008 15:03:46 Matthias Felleisen wrote: > You might wish to consider porting as many Planet packages (and even > core libraries) as possible to Typed Scheme, first with adapter > modules then going into them. Warning: we do not have polymorphism > under control and we don't support class.ss yet (on the class > definition side). > Does this mean that programming using typed scheme is preferable to doing it untyped? I don't try typed scheme for long now (maybe since 37x), is there any status page of what is supported or not or class.ss is the only thing not supported yet? Cheers, Paulo Matos > We could advertise it as 'adding types to one untyped language in 36 > hours'. -- Matthias > > On Oct 16, 2008, at 3:57 PM, Noel Welsh wrote: > > Hi all, > > > > At ICFP 2007 the Haskell guys organised a "Hackathon": > > > > http://www.haskell.org/haskellwiki/Hac_2007_II > > > > "It is a coding festival, focusing on producing and improving > > Haskell libraries, tools and infrastructure." > > > > I wonder if the same, or similar, could be organised for (PLT) > > Scheme at ICFP 2009, which will be in Edinburgh? There are two > > issues here: > > > > 1. Are there enough people interested? (I think about 10 would be > > enough, 20 would be great) If you're interested, let me know. > > > > 2. Would it be worthwhile to run tutorial sessions? I get the > > impression many people don't know how to develop efficiently using > > PLT Scheme. E.g. how to use PLaneT development links, how to > > package code for release, how to test, how to use Scribble. Stuff > > like Typed Scheme would also be worth presenting tutorials on. If > > you'd be interested in tutorials, please let me know what kind. > > > > A quick note for Scheme UK people: Ewan Higgs has revived Scheme > > UK. A new Yahoo group has been started. Please sign up at > > http://tech.groups.yahoo.com/group/schemeuk/ if you have not done > > so already. > > > > Cheers, > > Noel > > _________________________________________________ > > 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 -- Paulo Jorge Matos - pocm at soton.ac.uk http://www.personal.soton.ac.uk/pocm PhD Student @ ECS University of Southampton, UK From spdegabrielle at gmail.com Fri Oct 17 12:21:11 2008 From: spdegabrielle at gmail.com (Stephen De Gabrielle) Date: Thu Mar 26 02:30:56 2009 Subject: [plt-scheme] Scheme Hackathon at ICFP 2009? In-Reply-To: <200810171709.47294.pocm@soton.ac.uk> References: <200810171709.47294.pocm@soton.ac.uk> Message-ID: <595b9ab20810170921x13671406u1d833403e8a38220@mail.gmail.com> On Fri, Oct 17, 2008 at 5:09 PM, Paulo J. Matos wrote: > On Friday 17 October 2008 15:03:46 Matthias Felleisen wrote: >> You might wish to consider porting as many Planet packages (and even >> core libraries) as possible to Typed Scheme, first with adapter >> modules then going into them. Warning: we do not have polymorphism >> under control and we don't support class.ss yet (on the class >> definition side). >> > > Does this mean that programming using typed scheme is preferable to > doing it untyped? Does this mean that DrScheme is being ported to typed scheme? Stephen > I don't try typed scheme for long now (maybe since 37x), is there any > status page of what is supported or not or class.ss is the only thing > not supported yet? > > Cheers, > > Paulo Matos > >> We could advertise it as 'adding types to one untyped language in 36 >> hours'. -- Matthias >> >> On Oct 16, 2008, at 3:57 PM, Noel Welsh wrote: >> > Hi all, >> > >> > At ICFP 2007 the Haskell guys organised a "Hackathon": >> > >> > http://www.haskell.org/haskellwiki/Hac_2007_II >> > >> > "It is a coding festival, focusing on producing and improving >> > Haskell libraries, tools and infrastructure." >> > >> > I wonder if the same, or similar, could be organised for (PLT) >> > Scheme at ICFP 2009, which will be in Edinburgh? There are two >> > issues here: >> > >> > 1. Are there enough people interested? (I think about 10 would be >> > enough, 20 would be great) If you're interested, let me know. >> > >> > 2. Would it be worthwhile to run tutorial sessions? I get the >> > impression many people don't know how to develop efficiently using >> > PLT Scheme. E.g. how to use PLaneT development links, how to >> > package code for release, how to test, how to use Scribble. Stuff >> > like Typed Scheme would also be worth presenting tutorials on. If >> > you'd be interested in tutorials, please let me know what kind. >> > >> > A quick note for Scheme UK people: Ewan Higgs has revived Scheme >> > UK. A new Yahoo group has been started. Please sign up at >> > http://tech.groups.yahoo.com/group/schemeuk/ if you have not done >> > so already. >> > >> > Cheers, >> > Noel >> > _________________________________________________ >> > 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 > > -- > Paulo Jorge Matos - pocm at soton.ac.uk > http://www.personal.soton.ac.uk/pocm > PhD Student @ ECS > University of Southampton, UK > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From raould at gmail.com Fri Oct 17 13:06:59 2008 From: raould at gmail.com (Raoul Duke) Date: Thu Mar 26 02:30:56 2009 Subject: [plt-scheme] Re: modules 4 newbies In-Reply-To: <18680.40147.182019.624619@arabic.ccs.neu.edu> References: <91a2ba3e0810161302t471b922ey3f64c17c7fd22ac5@mail.gmail.com> <91a2ba3e0810161954m2d9694c9p5cedfff085688a48@mail.gmail.com> <18680.40147.182019.624619@arabic.ccs.neu.edu> Message-ID: <91a2ba3e0810171006u363cbad8ucc942f4afad345a2@mail.gmail.com> > Right. As a *newbie* you shouldn't even care about such details. > This is why `#lang' is doing what it's doing -- all you need to do is > prefix your file with `#lang scheme' (or `#lang scheme/gui') and start > writing code. (And in the initial stages of experimenting with the > environment you shouldn't even care about the fact that your file is a > "module" -- that should come later.) it is a good point - there are many kinds of newbies, basically. i've done plenty of programming, including scheme back in the day, so to me i'm a newbie to plt, but not to the concepts. so i was definitely trying to skip ahead and get modules going very quickly. so when i say newbie i am not doing a good job of really explaining the situation, and i'm in some smaller %age equivalence class of the population than a real newbie would be. sincerely. From feeley at iro.umontreal.ca Fri Oct 17 14:04:54 2008 From: feeley at iro.umontreal.ca (Marc Feeley) Date: Thu Mar 26 02:30:57 2009 Subject: [plt-scheme] Scheme workshop survey Message-ID: The Scheme workshop has been held every year since 2000 (http://www.schemeworkshop.org/ ). It is one of the main venues where the Scheme community can come together to discuss the Scheme programming language. Traditionally the workshop is co-located with the ICFP conference (the only exception is in 2003 when it was held in Boston). The Scheme workshop steering committee (http://www.schemeworkshop.org/sc.html ) which oversees the organization of the workshop is searching for ways to increase the level of participation from the Scheme community. For this reason we are conducting a survey to determine at what location and time the next workshop should be held. One important issue is whether we should continue co-location with the ICFP conference. Please take a few minutes of your time to complete the online survey at the following URL (before the deadline of midnight friday October 31): http://dynamo.iro.umontreal.ca/sw/survey Your feedback is very much appreciated! Marc Feeley for the Scheme workshop steering committee P.S. My apologies if you get this message multiple times. From matthias at ccs.neu.edu Fri Oct 17 14:10:31 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:30:57 2009 Subject: [plt-scheme] Scheme Hackathon at ICFP 2009? In-Reply-To: <595b9ab20810170921x13671406u1d833403e8a38220@mail.gmail.com> References: <200810171709.47294.pocm@soton.ac.uk> <595b9ab20810170921x13671406u1d833403e8a38220@mail.gmail.com> Message-ID: <5A8F0D1A-0B1B-43A3-B95C-4EA3C3F41BAF@ccs.neu.edu> Here is the basic idea of porting, with check-expect because someone asked: > #lang scheme/load > > (module original scheme > ;; f (Symbol -> Boolean) > (define (f s) > (cond > [(eq? 'true s) #t] > [(eq? 'false s) #f] > [else (error 'f "bad symbol")])) > > (provide f)) converted module > (module a typed-scheme > (: f (Symbol -> Boolean)) > (define (f s) > (cond > [(eq? 'true s) #t] > [(eq? 'false s) #f] > [else (error 'f "bad symbol")])) > > (provide f)) > design separate external test module > (module b scheme > (require 'original) ;; <== change this from 'original to 'a > (require htdp/testing) > > (check-expect (f 'true) #t) > (check-expect (f 'false) #f) > (check-error (f 'wahr) "f: bad symbol") > > (generate-report)) > > (require 'b) ;; --- > Does this mean that programming using typed scheme is preferable to > doing it untyped? This is and will remain your choice. ;; --- > Does this mean that DrScheme is being ported to typed scheme? Sam TH's dissertation includes a large software experiment to validate that Typed Scheme is widely useful. He has already ported parts of a couple of modules and he may do more. He may port more of drscheme or of other PLT Scheme applications. Our real goal is to create adapters for as many plain Scheme modules as possible in order to make programming in Typed Scheme as easy as it is in PLT Scheme. -- Matthias From sk at cs.brown.edu Fri Oct 17 15:07:23 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:30:57 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: References: Message-ID: Dear Marc, I am deeply disappointed to find out that the survey's designer does not know Scheme. Apparently (car '((a b c) x y z)) does NOT evaluate to '(a b c) (It apparently also doesn't evaluate to (cons 'a (cons 'b (cons 'c empty))) or to various other expressions that use call/cc, but I can excuse those. The first error is unacceptable.) Cheers, Shriram On Fri, Oct 17, 2008 at 1:04 PM, Marc Feeley wrote: > The Scheme workshop has been held every year since 2000 > (http://www.schemeworkshop.org/). It is one of the main venues where the > Scheme community can come together to discuss the Scheme programming > language. Traditionally the workshop is co-located with the ICFP conference > (the only exception is in 2003 when it was held in Boston). > > The Scheme workshop steering committee > (http://www.schemeworkshop.org/sc.html) which oversees the organization of > the workshop is searching for ways to increase the level of participation > from the Scheme community. For this reason we are conducting a survey to > determine at what location and time the next workshop should be held. One > important issue is whether we should continue co-location with the ICFP > conference. > > Please take a few minutes of your time to complete the online survey at the > following URL (before the deadline of midnight friday October 31): > > http://dynamo.iro.umontreal.ca/sw/survey > > Your feedback is very much appreciated! > > Marc Feeley > for the Scheme workshop steering committee > > P.S. My apologies if you get this message multiple times. > > From grettke at acm.org Fri Oct 17 15:14:32 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:30:57 2009 Subject: [plt-scheme] How do you maintain DrScheme? Message-ID: <756daca50810171214j7b54d5a6x42ad26baecd9e08a@mail.gmail.com> Is DrScheme viewed primarily as a pedagogical tool, or more? Do you guys use DrScheme to maintain DrScheme, or Emacs, or Vi? Of course, you have the right not to incriminate yourself :) From wand at ccs.neu.edu Fri Oct 17 15:15:08 2008 From: wand at ccs.neu.edu (Mitchell Wand) Date: Thu Mar 26 02:30:58 2009 Subject: [plt-scheme] [Scheme Steering Committee announcements] Scheme workshop survey In-Reply-To: References: Message-ID: <1bd18ad50810171215v7aee2d51r73cd464f68b48517@mail.gmail.com> Skipped content of type multipart/alternative-------------- next part -------------- _______________________________________________ Scheme-announcements mailing list Scheme-announcements@lists.ccs.neu.edu https://lists.ccs.neu.edu/bin/listinfo/scheme-announcements From wand at ccs.neu.edu Fri Oct 17 15:15:08 2008 From: wand at ccs.neu.edu (Mitchell Wand) Date: Thu Mar 26 02:30:59 2009 Subject: [plt-scheme] [Scheme Steering Committee announcements] Scheme workshop survey In-Reply-To: References: Message-ID: <1bd18ad50810171215v7aee2d51r73cd464f68b48517@mail.gmail.com> Skipped content of type multipart/alternative-------------- next part -------------- _______________________________________________ Scheme-announcements mailing list Scheme-announcements@lists.ccs.neu.edu https://lists.ccs.neu.edu/bin/listinfo/scheme-announcements From matthias at ccs.neu.edu Fri Oct 17 15:24:37 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:30:59 2009 Subject: [plt-scheme] How do you maintain DrScheme? In-Reply-To: <756daca50810171214j7b54d5a6x42ad26baecd9e08a@mail.gmail.com> References: <756daca50810171214j7b54d5a6x42ad26baecd9e08a@mail.gmail.com> Message-ID: <4F27808C-EE44-4E65-84A3-C29B4321B0F1@ccs.neu.edu> On Oct 17, 2008, at 3:14 PM, Grant Rettke wrote: > Is DrScheme viewed primarily as a pedagogical tool, or more? We don't view DrScheme that way and routinely develop commercial-like software in it. > Do you guys use DrScheme to maintain DrScheme, or Emacs, or Vi? Several of us load DrScheme in DrScheme for debugging. > > Of course, you have the right not to incriminate yourself :) > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From feeley at iro.umontreal.ca Fri Oct 17 15:48:34 2008 From: feeley at iro.umontreal.ca (Marc Feeley) Date: Thu Mar 26 02:30:59 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: References: Message-ID: <11255F7E-2812-4B10-9C09-DC96023518C5@iro.umontreal.ca> On 17-Oct-08, at 3:07 PM, Shriram Krishnamurthi wrote: > Dear Marc, > > I am deeply disappointed to find out that the survey's designer does > not know Scheme. Apparently > > (car '((a b c) x y z)) > > does NOT evaluate to > > '(a b c) > > (It apparently also doesn't evaluate to > > (cons 'a (cons 'b (cons 'c empty))) > > or to various other expressions that use call/cc, but I can excuse > those. The first error is unacceptable.) Wow! I did not know you were a reductionist... I thought those folks died off a long time ago. But hey there is still hope for you... you could come to the next Scheme workshop to try to convince the rest of the Scheme community you are right (or be assimilated). Can I count on you? Marc P.S. I did handle the whitespace, case-sensitivity, square-bracket and dotted pair issues so that the following is accepted: [ A b . ( C)] From sk at cs.brown.edu Fri Oct 17 15:50:31 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:30:59 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: <11255F7E-2812-4B10-9C09-DC96023518C5@iro.umontreal.ca> References: <11255F7E-2812-4B10-9C09-DC96023518C5@iro.umontreal.ca> Message-ID: Not bad. I would have expected you to just sandbox the expression and run it. Surely that's not hard to do in Gambit, and then you could have accepted the various call/cc responses you're going to get, too. On Fri, Oct 17, 2008 at 2:48 PM, Marc Feeley wrote: > > On 17-Oct-08, at 3:07 PM, Shriram Krishnamurthi wrote: > >> Dear Marc, >> >> I am deeply disappointed to find out that the survey's designer does >> not know Scheme. Apparently >> >> (car '((a b c) x y z)) >> >> does NOT evaluate to >> >> '(a b c) >> >> (It apparently also doesn't evaluate to >> >> (cons 'a (cons 'b (cons 'c empty))) >> >> or to various other expressions that use call/cc, but I can excuse >> those. The first error is unacceptable.) > > Wow! I did not know you were a reductionist... I thought those folks died > off a long time ago. But hey there is still hope for you... you could come > to the next Scheme workshop to try to convince the rest of the Scheme > community you are right (or be assimilated). Can I count on you? > > Marc > > P.S. I did handle the whitespace, case-sensitivity, square-bracket and > dotted pair issues so that the following is accepted: [ A b . ( C)] > > From feeley at iro.umontreal.ca Fri Oct 17 15:54:49 2008 From: feeley at iro.umontreal.ca (Marc Feeley) Date: Thu Mar 26 02:30:59 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: References: <11255F7E-2812-4B10-9C09-DC96023518C5@iro.umontreal.ca> Message-ID: <594E18FF-D877-4E12-8D5C-3CF8BFF68CF8@iro.umontreal.ca> On 17-Oct-08, at 3:50 PM, Shriram Krishnamurthi wrote: > Not bad. I would have expected you to just sandbox the expression and > run it. Surely that's not hard to do in Gambit, and then you could > have accepted the various call/cc responses you're going to get, too. Sorry to say but call/cc does not exist in Scheme... I can hear you chanting "call-with-current-continuation is dead, long live call/cc". Marc From matthias at ccs.neu.edu Fri Oct 17 15:55:33 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:30:59 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: <11255F7E-2812-4B10-9C09-DC96023518C5@iro.umontreal.ca> References: <11255F7E-2812-4B10-9C09-DC96023518C5@iro.umontreal.ca> Message-ID: <9FB54957-3CFC-434A-95F6-A936525B7D13@ccs.neu.edu> Reductionist dying out? You must be kidding Marc; everyone here tried that! On Oct 17, 2008, at 3:48 PM, Marc Feeley wrote: > > On 17-Oct-08, at 3:07 PM, Shriram Krishnamurthi wrote: > >> Dear Marc, >> >> I am deeply disappointed to find out that the survey's designer does >> not know Scheme. Apparently >> >> (car '((a b c) x y z)) >> >> does NOT evaluate to >> >> '(a b c) >> >> (It apparently also doesn't evaluate to >> >> (cons 'a (cons 'b (cons 'c empty))) >> >> or to various other expressions that use call/cc, but I can excuse >> those. The first error is unacceptable.) > > Wow! I did not know you were a reductionist... I thought those > folks died off a long time ago. But hey there is still hope for > you... you could come to the next Scheme workshop to try to > convince the rest of the Scheme community you are right (or be > assimilated). Can I count on you? > > Marc > > P.S. I did handle the whitespace, case-sensitivity, square-bracket > and dotted pair issues so that the following is accepted: [ A b . > ( C)] > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From gregory.woodhouse at gmail.com Fri Oct 17 16:03:10 2008 From: gregory.woodhouse at gmail.com (Woodhouse Gregory) Date: Thu Mar 26 02:31:00 2009 Subject: [plt-scheme] Should computer programming be mandatory In-Reply-To: <48F89BEB.1040603@acanac.net> References: <101420081521.4927.48F4B900000706F10000133F22064244139F9F9F059D0E@comcast.net> <48F89BEB.1040603@acanac.net> Message-ID: I don't really blame the students. They want every advantage they can get when it comes to simply getting hired. I'm less sympathetic when it comes to the hiring practices that emphasize short term gains at the expense of a better educated workforce, and therefore a workforce that will be more productive in the long run. A theme that comes up time and again is that there are a few developers whose code always seems to work and who are able to solve problems that would lead most everyone else to throw up their hands and say "it's impossible". Oddly, these are not the same developers as those that know Java EE backwards and forwards and seemingly can do anything with WebLogic or Oracle. Don't get me wrong, developers in this second group are very valuable, but when their code can be cryptic or convoluted, and when they run out of design patterns, they can start tto run out of steam, and productivity (of the enterprise as a whole) falls off. These are the highly trained technicians that we as a society have always sought for and reward the most. The developers in the first group are critical thinkers and generally the most innovative workers. Ironically, when we REALLY get into a bind, we are forced to turn to the first group, but it's the second group that is rewarded both with respect and the largest salaries. Maybe it's time for a rethink. I hear and I forget. I see and I remember. I do and I understand. --Attributed to Confucius, 500 BCE http://www.gwoodhouse.com http://GregWoodhouse.ImageKind.com On Oct 17, 2008, at 7:06 AM, Ernie Smith wrote: > > If there is decline in the quality of education, perhaps it is a > consequence of a misguided > propensity to equate the goal of education with the goal of > training a workforce. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081017/07a67360/attachment.htm From sk at cs.brown.edu Fri Oct 17 16:10:06 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:31:00 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: <594E18FF-D877-4E12-8D5C-3CF8BFF68CF8@iro.umontreal.ca> References: <11255F7E-2812-4B10-9C09-DC96023518C5@iro.umontreal.ca> <594E18FF-D877-4E12-8D5C-3CF8BFF68CF8@iro.umontreal.ca> Message-ID: Touche. That would have been an acceptable response. [Sorry, no more silliness from me on this thread.] On Fri, Oct 17, 2008 at 2:54 PM, Marc Feeley wrote: > > On 17-Oct-08, at 3:50 PM, Shriram Krishnamurthi wrote: > >> Not bad. I would have expected you to just sandbox the expression and >> run it. Surely that's not hard to do in Gambit, and then you could >> have accepted the various call/cc responses you're going to get, too. > > Sorry to say but call/cc does not exist in Scheme... I can hear you > chanting "call-with-current-continuation is dead, long live call/cc". > > Marc > > From feeley at iro.umontreal.ca Fri Oct 17 16:15:32 2008 From: feeley at iro.umontreal.ca (Marc Feeley) Date: Thu Mar 26 02:31:00 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: <9FB54957-3CFC-434A-95F6-A936525B7D13@ccs.neu.edu> References: <11255F7E-2812-4B10-9C09-DC96023518C5@iro.umontreal.ca> <9FB54957-3CFC-434A-95F6-A936525B7D13@ccs.neu.edu> Message-ID: <2275D3B7-B5C7-4304-A047-C98270142346@iro.umontreal.ca> On 17-Oct-08, at 3:55 PM, Matthias Felleisen wrote: > Reductionist dying out? You must be kidding Marc; everyone here > tried that! All jokes aside, reductionism is quite intuitive and solves some fundamental "user interface" issues. Gambit uses it when displaying environments and continuation frames (see example below). It just doesn't use it to print results at the REPL, mainly because historically most Scheme textbooks do not use it. Marc Gambit v4.2.9 > (define (f g x) (g x y)) > (f (lambda (a b) (+ (car a) (car b))) '(1 2 3)) *** ERROR IN f, (console)@1.22 -- Unbound variable: y 1> ,e g = (lambda (a b) (+ (car a) (car b))) x = '(1 2 3) From grettke at acm.org Fri Oct 17 16:44:26 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:31:01 2009 Subject: [plt-scheme] Should computer programming be mandatory In-Reply-To: References: <101420081521.4927.48F4B900000706F10000133F22064244139F9F9F059D0E@comcast.net> <48F89BEB.1040603@acanac.net> Message-ID: <756daca50810171344n1b4b6b4q9a2c636fd3c1cd85@mail.gmail.com> On Fri, Oct 17, 2008 at 3:03 PM, Woodhouse Gregory wrote: > A theme that comes up time and again is that there are a few developers > whose code always seems to work and who are able to solve problems that > would lead most everyone else to throw up their hands and say "it's > impossible". Oddly, these are not the same developers as those that know > Java EE backwards and forwards and seemingly can do anything with WebLogic > or Oracle. What about developers who code well that are also JEE experts?! From yinso.chen at gmail.com Fri Oct 17 17:22:32 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:31:01 2009 Subject: [plt-scheme] planet down? Message-ID: <779bf2730810171422k269d6a4bqd5eb741a117429a9@mail.gmail.com> Hi - getting the following error when trying to connect to http://planet.plt-scheme.org for a while - Is it down for maintenance? Thanks, yc Proxy Error The proxy server received an invalid response from an upstream server. The proxy server could not handle the request *GET /display.ss *. Reason: *Could not connect to remote machine: Connection refused* -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081017/2bed12f5/attachment.html From gregory.woodhouse at gmail.com Fri Oct 17 18:19:54 2008 From: gregory.woodhouse at gmail.com (Woodhouse Gregory) Date: Thu Mar 26 02:31:02 2009 Subject: [plt-scheme] Should computer programming be mandatory In-Reply-To: <756daca50810171344n1b4b6b4q9a2c636fd3c1cd85@mail.gmail.com> References: <101420081521.4927.48F4B900000706F10000133F22064244139F9F9F059D0E@comcast.net> <48F89BEB.1040603@acanac.net> <756daca50810171344n1b4b6b4q9a2c636fd3c1cd85@mail.gmail.com> Message-ID: <9B5DB08D-DEEF-4EAE-A04F-0E9D551FB7A5@gmail.com> Fair enough: I certainly didn't mean to suggest that the groups were mutually exclusive! Getting back to the topic of this thread (or at least I hope so): my two basic points were 1) It's not enough to just teach "programming", it's important that students be exposed to computing at a deeper level. and 2) The marketplace is currently providing something of a disincentive for studying theory (or even Scheme). This won't change until the people making hiring decisions are persuaded that it is in their interest to hire people with a good grounding in theory, even at the expense of some specialist knowledge. Unfortunately, it's hard to see this happening in a world dominated by contracting, and especially fixed cost contracts. "In the human mind, one-sidedness has always been the rule and many-sidedness the exception. Hence, even in revolutions of thought, one part of the truth usually sets while another rises." --John Stuart Mill http://www.gwoodhouse.com http://GregWoodhouse.ImageKind.com On Oct 17, 2008, at 1:44 PM, Grant Rettke wrote: > On Fri, Oct 17, 2008 at 3:03 PM, Woodhouse Gregory > wrote: > >> A theme that comes up time and again is that there are a few >> developers >> whose code always seems to work and who are able to solve problems >> that >> would lead most everyone else to throw up their hands and say "it's >> impossible". Oddly, these are not the same developers as those >> that know >> Java EE backwards and forwards and seemingly can do anything with >> WebLogic >> or Oracle. > > What about developers who code well that are also JEE experts?! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081017/1a5954ba/attachment.htm From pocm at soton.ac.uk Fri Oct 17 18:27:36 2008 From: pocm at soton.ac.uk (Paulo J. Matos) Date: Thu Mar 26 02:31:02 2009 Subject: [plt-scheme] Scheme Hackathon at ICFP 2009? In-Reply-To: References: <595b9ab20810170921x13671406u1d833403e8a38220@mail.gmail.com> Message-ID: <200810172327.37390.pocm@soton.ac.uk> On Friday 17 October 2008 19:10:31 you wrote: > Sam TH's dissertation includes a large software experiment to > validate that Typed Scheme is widely useful. He has already ported > parts of a couple of modules and he may do more. He may port more of > drscheme or of other PLT Scheme applications. > Is this dissertation available for general public consumption? > Our real goal is to create adapters for as many plain Scheme modules > as possible in order to make programming in Typed Scheme as easy as > it is in PLT Scheme. > > -- Matthias -- Paulo Jorge Matos - pocm at soton.ac.uk http://www.personal.soton.ac.uk/pocm PhD Student @ ECS University of Southampton, UK From morazanm at gmail.com Fri Oct 17 20:17:37 2008 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:31:02 2009 Subject: [plt-scheme] Should computer programming be mandatory In-Reply-To: <9B5DB08D-DEEF-4EAE-A04F-0E9D551FB7A5@gmail.com> References: <101420081521.4927.48F4B900000706F10000133F22064244139F9F9F059D0E@comcast.net> <48F89BEB.1040603@acanac.net> <756daca50810171344n1b4b6b4q9a2c636fd3c1cd85@mail.gmail.com> <9B5DB08D-DEEF-4EAE-A04F-0E9D551FB7A5@gmail.com> Message-ID: <9b1fff280810171717g57788663r5dbf4e22f70c5cef@mail.gmail.com> On Fri, Oct 17, 2008 at 6:19 PM, Woodhouse Gregory wrote: > 1) It's not enough to just teach "programming", it's important that students > be exposed to computing at a deeper level. Is teaching *good* programming a realistic and the best goal we can achieve at this point in time? In fact, does not teaching *good* programming expose students to the limits of our knowledge in a very real sense (mind you, this can not be done in one or two semesters)? > 2) The marketplace is currently providing something of a disincentive for > studying theory (or even Scheme). I am not clear that this is the case. Some of the best programmers coming out of good universities are being hired by Wall Street (at least no so long ago when Wall Street meant something) and large corporations. -- Cheers, Marco From raould at gmail.com Fri Oct 17 20:41:51 2008 From: raould at gmail.com (Raoul Duke) Date: Thu Mar 26 02:31:02 2009 Subject: [plt-scheme] possibly evil drscheme ui thought Message-ID: <91a2ba3e0810171741p3321d48u65f0b74ab1c6802c@mail.gmail.com> i think it would be neat (this will presumably incur the wrath of folks who already can sight-read parens and who will tell me that everybody should learn that and not lean on ui crutches :-) if matching parens were subtly background hilighted at all times, not just when there is a cursor there. i'm not 100% sure how it would work, but basically i think if it was black-on-white text then the background hilight would be very light grays. and each new inner level would be a slightly darker gray. or maybe even different pastel hues could be utilized. From robby at cs.uchicago.edu Fri Oct 17 22:00:12 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:31:03 2009 Subject: [plt-scheme] How do you maintain DrScheme? In-Reply-To: <756daca50810171214j7b54d5a6x42ad26baecd9e08a@mail.gmail.com> References: <756daca50810171214j7b54d5a6x42ad26baecd9e08a@mail.gmail.com> Message-ID: <932b2f1f0810171900r14a6d90fs8a2d99701cedc038@mail.gmail.com> I maintain DrScheme using DrScheme. Robby On Fri, Oct 17, 2008 at 2:14 PM, Grant Rettke wrote: > Is DrScheme viewed primarily as a pedagogical tool, or more? > > Do you guys use DrScheme to maintain DrScheme, or Emacs, or Vi? > > Of course, you have the right not to incriminate yourself :) > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From robby at cs.uchicago.edu Fri Oct 17 22:08:25 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:31:03 2009 Subject: [plt-scheme] possibly evil drscheme ui thought In-Reply-To: <91a2ba3e0810171741p3321d48u65f0b74ab1c6802c@mail.gmail.com> References: <91a2ba3e0810171741p3321d48u65f0b74ab1c6802c@mail.gmail.com> Message-ID: <932b2f1f0810171908y32c31e94kf0542fe6a2fbd7db@mail.gmail.com> See the 'Parenthesis color scheme' drop-down menu in the preferences (under Colors > Background Color). It isn't what you're asking for exactly, but it is something. I think have permanent colors like you ask wouldn't work as well, since there are too many colors and often parens are off-by-one so probably you want some kind of color alternation. Anyways, the season'd schemers around here will probably tell you that the parens eventually fade away. It is really the indentation that clues you in to where things match up. Robby On Fri, Oct 17, 2008 at 7:41 PM, Raoul Duke wrote: > i think it would be neat (this will presumably incur the wrath of > folks who already can sight-read parens and who will tell me that > everybody should learn that and not lean on ui crutches :-) if > matching parens were subtly background hilighted at all times, not > just when there is a cursor there. i'm not 100% sure how it would > work, but basically i think if it was black-on-white text then the > background hilight would be very light grays. and each new inner level > would be a slightly darker gray. or maybe even different pastel hues > could be utilized. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From grettke at acm.org Fri Oct 17 22:44:51 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:31:03 2009 Subject: [plt-scheme] possibly evil drscheme ui thought In-Reply-To: <932b2f1f0810171908y32c31e94kf0542fe6a2fbd7db@mail.gmail.com> References: <91a2ba3e0810171741p3321d48u65f0b74ab1c6802c@mail.gmail.com> <932b2f1f0810171908y32c31e94kf0542fe6a2fbd7db@mail.gmail.com> Message-ID: <756daca50810171944g42448265l9a4df81c3fd30f2@mail.gmail.com> On Fri, Oct 17, 2008 at 9:08 PM, Robby Findler wrote: Check this out: http://www.wisdomandwonder.com/link/51/visualizing-lisp-without-parentheses > Anyways, the season'd schemers around here will probably tell you that > the parens eventually fade away. It is really the indentation that > clues you in to where things match up. You may not believe it now, but that is true; it does happen. From alan at alan-watson.org Sat Oct 18 00:56:17 2008 From: alan at alan-watson.org (Alan Watson) Date: Thu Mar 26 02:31:03 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: References: Message-ID: Shriram, (car '((a b c) x y z)) does not evaluate to (quote (a b c)). You are confusing a value with a literal datum that evaluates to the same value. Regards, Alan -- Alan Watson http://www.alan-watson.org/ From eli at barzilay.org Sat Oct 18 01:06:10 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:31:04 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: References: Message-ID: <18681.28354.555743.369277@arabic.ccs.neu.edu> On Oct 17, Alan Watson wrote: > Shriram, > > (car '((a b c) x y z)) does not evaluate to (quote (a b c)). You are > confusing a value with a literal datum that evaluates to the same > value. Actually, you're confusing scheme_make_pair( scheme_intern_symbol("a"), scheme_make_pair( scheme_intern_symbol("b"), scheme_make_pair( scheme_intern_symbol("c"), scheme_null))) with its printed representation. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From wiwatatscape at gmail.com Fri Oct 17 20:07:51 2008 From: wiwatatscape at gmail.com (Wiwat Ruengmee) Date: Thu Mar 26 02:31:04 2009 Subject: [plt-scheme] Changing style of DrScheme definition editor Message-ID: <48F928D7.2060605@gmail.com> hi, i am implementing a drscheme tool. this tool needs to change background of text in the (drscheme) editor. i tried to use style-delta% and change-style. but seem like drcheme does not let me change text style. any info or pointers to this issue will be great. thank you. From matthias at ccs.neu.edu Sat Oct 18 07:49:22 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:31:04 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: References: Message-ID: Alan, Marc didn't ask for us to evaluate the thing, which in any case is Scheme-specific silliness. He asked what is the value of (car ...) and the value -- as opposed to what you see on the screen -- is definitely '(a b c). After all, it is possible to take the car of that value again, yet one thing you wouldn't want to do is to run (car (a b c)) because that goes nowhere. Lispers and Schemers have failed to really articulate semantics properly for a long time now. Read Wadler's Calculating is better than Scheming. He's right. -- Matthias On Oct 18, 2008, at 12:56 AM, Alan Watson wrote: > Shriram, > > (car '((a b c) x y z)) does not evaluate to (quote (a b c)). You > are confusing a value with a literal datum that evaluates to the > same value. > > Regards, > > Alan > -- > Alan Watson > http://www.alan-watson.org/ > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From sk at cs.brown.edu Sat Oct 18 08:18:41 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:31:04 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: References: Message-ID: > Alan, Marc didn't ask for us to evaluate the thing, which in any case is > Scheme-specific silliness. He asked what is the value of (car ...) and the > value -- as opposed to what you see on the screen -- is definitely '(a b c). > After all, it is possible to take the car of that value again, yet one thing > you wouldn't want to do is to run (car (a b c)) because that goes nowhere. Put differently, that car don't run. S. From robby at cs.uchicago.edu Sat Oct 18 08:34:21 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:31:04 2009 Subject: [plt-scheme] Changing style of DrScheme definition editor In-Reply-To: <48F928D7.2060605@gmail.com> References: <48F928D7.2060605@gmail.com> Message-ID: <932b2f1f0810180534q272856a2h414f8c3c4b160a78@mail.gmail.com> DrScheme is continuously changing the style to do syntax coloring. You'd need to disable that. I would try starting in the framework docs, looking at scheme:text-mixin and the things it requires as input. hth, Robby On Fri, Oct 17, 2008 at 7:07 PM, Wiwat Ruengmee wrote: > hi, > > i am implementing a drscheme tool. this tool needs to change background of > text in the (drscheme) editor. i tried to use style-delta% and change-style. > but seem like drcheme does not let me change text style. any info or > pointers to this issue will be great. > > thank you. > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From marek at xivilization.net Sat Oct 18 09:04:50 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:31:04 2009 Subject: [plt-scheme] possibly evil drscheme ui thought In-Reply-To: <932b2f1f0810171908y32c31e94kf0542fe6a2fbd7db@mail.gmail.com> References: <91a2ba3e0810171741p3321d48u65f0b74ab1c6802c@mail.gmail.com> <932b2f1f0810171908y32c31e94kf0542fe6a2fbd7db@mail.gmail.com> Message-ID: <20081018150450.44ee7b71@halmanfloyd.lan.local> On Fri, 17 Oct 2008 21:08:25 -0500 "Robby Findler" wrote: > Anyways, the season'd schemers around here will probably tell you that > the parens eventually fade away. It is really the indentation that > clues you in to where things match up. There was once an image comparing "how I see Lisp" with "how others see Lisp" showing the same code where in one the parens were light grey and in the other the code was in light grey. Anyone know where to find it? I forgot to bookmark it. regards, Marek From spdegabrielle at gmail.com Sat Oct 18 10:52:15 2008 From: spdegabrielle at gmail.com (Stephen De Gabrielle) Date: Thu Mar 26 02:31:04 2009 Subject: [plt-scheme] hosting Message-ID: <595b9ab20810180752i7c0a9631m598091ff3798360d@mail.gmail.com> Hi, I just noticed the 'Lisp friendly we hosting' page on the alu wiki ( http://wiki.alu.org/Lisp-friendly_Web_Hosting ) I anyone aware of any PLT-Scheme friendly web hosts? (apart from building my own machine image for amazon EC2) Cheers, Stephen From mflatt at cs.utah.edu Sat Oct 18 12:43:28 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:31:05 2009 Subject: [plt-scheme] system function and threads In-Reply-To: <20a68e7e-f7e4-4830-a9bf-07ce691ddf19@b1g2000hsg.googlegroups.com> References: <20a68e7e-f7e4-4830-a9bf-07ce691ddf19@b1g2000hsg.googlegroups.com> Message-ID: <20081018164345.824A665008C@mail-svr1.cs.utah.edu> At Thu, 16 Oct 2008 06:43:38 -0700 (PDT), pp wrote: > The following snippet: > > #lang scheme > > (require scheme/system) > (define t (thread (lambda() (system "pause")))) > (sleep 1) > (kill-thread t) > > > When run in DrScheme, on XP SP3, works as expected on the first run, > with control returning to the interaction window after 1 sec, but on > the next run will leave DrScheme unresponive. > > Any thoughts? This is now fixed in SVN. Matthew From esmith at acanac.net Sat Oct 18 15:19:42 2008 From: esmith at acanac.net (Ernie Smith) Date: Thu Mar 26 02:31:05 2009 Subject: [plt-scheme] Should computer programming be mandatory In-Reply-To: References: <101420081521.4927.48F4B900000706F10000133F22064244139F9F9F059D0E@comcast.net> <48F89BEB.1040603@acanac.net> Message-ID: <48FA36CE.3070504@acanac.net> Woodhouse Gregory wrote: > I don't really blame the students. They want every advantage they can > get when it comes to simply getting hired. I'm less sympathetic when > it comes to the hiring practices that emphasize short term gains at > the expense of a better educated workforce, and therefore a workforce > that will be more productive in the long run. > On Oct 17, 2008, at 7:06 AM, Ernie Smith wrote: > >> >> If there is decline in the quality of education, perhaps it is a >> consequence of a misguided >> >> propensity to equate the goal of education with the goal of training >> a workforce. >> >> > My point was that quality of work force is an utterly inappropriate metric for quality of education, yet you persist in framing your thoughts in the context of 'quality of work force'. So I must conclude a segway has taken place. Regardless.. we're running off topic. Regards From raould at gmail.com Sat Oct 18 20:24:35 2008 From: raould at gmail.com (Raoul Duke) Date: Thu Mar 26 02:31:05 2009 Subject: [plt-scheme] possibly evil drscheme ui thought In-Reply-To: <932b2f1f0810171908y32c31e94kf0542fe6a2fbd7db@mail.gmail.com> References: <91a2ba3e0810171741p3321d48u65f0b74ab1c6802c@mail.gmail.com> <932b2f1f0810171908y32c31e94kf0542fe6a2fbd7db@mail.gmail.com> Message-ID: <91a2ba3e0810181724id35f630y8058a18436f64ed2@mail.gmail.com> > See the 'Parenthesis color scheme' drop-down menu in the preferences > (under Colors > Background Color). It isn't what you're asking for darned close! thanks, i will try it out for a while. From alan at alan-watson.org Sat Oct 18 22:07:16 2008 From: alan at alan-watson.org (Alan Watson) Date: Thu Mar 26 02:31:05 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: References: Message-ID: First, Eli, I did not mention the printed representation of anything, so I fail to see how I could be confusing it with the value of the expression in hand. Furthermore, replacing a Scheme expression that produces a value with a C expression that produces a value does not really more us forward; both are expressions and neither are values. Second, Matthias, the value of (car ...) is most certainly not '(...), although both are expressions that give the same value (where same means the same according to equal? or according to write) but not according to the poxy side-effect-ridden semantics of Scheme. Third, Sri, yes, that car don't run, but I program in Scheme to avoid bus errors, not car errors. Fourth, Matthew, yes, we will take this to comp.lang.scheme. Finally, Matthias again, is PLT just a cunning plan to cripple the next generation of programmers in the US? That is, and here I am serious, if Wadler is right and Scheme hopelessly confuses beginning programmers, why did you decide to teach programming using Scheme? Regards, Alan -- Alan Watson http://www.alan-watson.org/ From robby at cs.uchicago.edu Sat Oct 18 22:11:43 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:31:05 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: References: Message-ID: <932b2f1f0810181911n26066603m18ff28f2bcf3f5f5@mail.gmail.com> No one here teaches beginning programmers using Scheme. (Thank god.) Robby On Sat, Oct 18, 2008 at 9:07 PM, Alan Watson wrote: > First, Eli, I did not mention the printed representation of anything, so I > fail to see how I could be confusing it with the value of the expression in > hand. Furthermore, replacing a Scheme expression that produces a value with > a C expression that produces a value does not really more us forward; both > are expressions and neither are values. > > Second, Matthias, the value of (car ...) is most certainly not '(...), > although both are expressions that give the same value (where same means the > same according to equal? or according to write) but not according to the > poxy side-effect-ridden semantics of Scheme. > > Third, Sri, yes, that car don't run, but I program in Scheme to avoid bus > errors, not car errors. > > Fourth, Matthew, yes, we will take this to comp.lang.scheme. > > Finally, Matthias again, is PLT just a cunning plan to cripple the next > generation of programmers in the US? That is, and here I am serious, if > Wadler is right and Scheme hopelessly confuses beginning programmers, why > did you decide to teach programming using Scheme? > > Regards, > > Alan > -- > Alan Watson > http://www.alan-watson.org/ > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From sk at cs.brown.edu Sat Oct 18 22:58:14 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:31:05 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: References: Message-ID: > Third, Sri, yes, that car don't run, but I program in Scheme to avoid bus > errors, not car errors. Perfect. But you do get the general point, right? You're just playing obtuse on the Internets? > Fourth, Matthew, yes, we will take this to comp.lang.scheme. For now, this seems like a perfectly good venue: this is a PLT question because -- > Finally, Matthias again, is PLT just a cunning plan to cripple the next > generation of programmers in the US? That is, and here I am serious, if > Wadler is right and Scheme hopelessly confuses beginning programmers, why > did you decide to teach programming using Scheme? -- because (as Robby said in his Zen-like fashion), we don't teach Scheme: we teach DrScheme Beginning Student (at the beginning). Shriram From robby at cs.uchicago.edu Sat Oct 18 23:09:36 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:31:06 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: References: Message-ID: <932b2f1f0810182009p9abc89eg4a7eafdcd0876cdc@mail.gmail.com> How many hands must we clap before the tree falls? Robby On Sat, Oct 18, 2008 at 9:58 PM, Shriram Krishnamurthi wrote: >> Third, Sri, yes, that car don't run, but I program in Scheme to avoid bus >> errors, not car errors. > > Perfect. > > But you do get the general point, right? You're just playing obtuse > on the Internets? > >> Fourth, Matthew, yes, we will take this to comp.lang.scheme. > > For now, this seems like a perfectly good venue: this is a PLT > question because -- > >> Finally, Matthias again, is PLT just a cunning plan to cripple the next >> generation of programmers in the US? That is, and here I am serious, if >> Wadler is right and Scheme hopelessly confuses beginning programmers, why >> did you decide to teach programming using Scheme? > > -- because (as Robby said in his Zen-like fashion), we don't teach > Scheme: we teach DrScheme Beginning Student (at the beginning). > > Shriram > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From alan at alan-watson.org Sat Oct 18 23:40:02 2008 From: alan at alan-watson.org (Alan Watson) Date: Thu Mar 26 02:31:06 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: References: Message-ID: I think what you're saying is that you arrange that print and the REPL print "(list a b c)" when handed (car ...), thereby unifying external representations and expressions. Yeah, that is smart, very smart. Still, and bear with me here because I'm not trying to be obtuse just for the sake of it, I am still not sure that the "value" of "(car ...)" is "(list a b c)". Again, it seems that that's an external representation of the required value or an expression that evaluates to a value that is equal? to the required value. Frankly, it seems that the question as posed is not answerable. If it were "what is the external representation of the value of (car ...)" or "give a different expression which gives a value that is equal? to (car ...)", then your answers would be great. Robby, falling trees and other side effects appear to be forbidden in the Beginning Student language. Regards, Alan -- Alan Watson http://www.alan-watson.org/ From sk at cs.brown.edu Sun Oct 19 00:37:49 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:31:06 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: References: Message-ID: > Still, and bear with me here because I'm not trying to be obtuse > just for the sake of it [...] That's fine. Humor doesn't convey well over the Internet, so I wanted to make sure we understood where you stand to avoid being serious where you were being ironic. So, let's take this seriously. The original question, as I recall it, was phrased as, "The value of ... is [blank box]". So it depends on what your meaning of "is" is. You might mean, "what does it print as?". In that case, there are many answers; '(a b c) is one of them, (a b c) is another. But there might be all sorts of ways of printing that answer (imagine a box-based graphical syntax, for instance), so choosing this meaning would result in highly non-canonical answers -- and the set of representations is boundless. So it would be an unwise meaning to have in mind for the question. You might say it means "what value does it reduce to?". In that case, it depends on how you write Scheme values. It is conventional to consider values to be a subset of expressions that do not require further evaluation. Is the expression '(a b c) a value? For sure. How about: (list 'a 'b 'c) ? For sure (just treat LIST as a constructor; if you don't like that, expand it out into nested CONSes). But what about: (a b c) ? To me, that expression sure looks like the application of the (hopefully) procedure bound to A to two values, namely those bound to B and to C. That's not a value, that's a procedure application. Finally, you might say it means "what expression[s] is it equal to?". This depends on your notion of equality. A common notion is observational equivalence. Again, assuming CAR refers to the primitive (and hence cannot be re-bound), the original expression is observationally equivalent to any of the above value representations, but it is not to (a b c) [because there exist contexts that bind A, B and C unfavorably]. So the question is not "unaswerable"; it's merely ambiguous. But under the two standard interpretations one might take -- what does it reduce to, and what is it equal to -- the answer we're favoring is right, whereas the unquoted (ie, old-fashioned print) representation is not. > I am still not sure that the "value" of "(car ...)" is "(list a b > c)". Again, it seems that that's an external representation of the > required value or an expression that evaluates to a value that is > equal? to the required value. Eli already foresaw this. That's why he wrote what he did. What is "the value", really? In PLT Scheme, it's the thing (pointer) you get by evaluating his expression. If you really want to think of that pointer as the value, fine -- but then, (a b c) is definitely not that pointer! Shriram From jensaxel at soegaard.net Sun Oct 19 08:18:19 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:31:06 2009 Subject: [plt-scheme] hosting In-Reply-To: <595b9ab20810180752i7c0a9631m598091ff3798360d@mail.gmail.com> References: <595b9ab20810180752i7c0a9631m598091ff3798360d@mail.gmail.com> Message-ID: <48FB258B.1050403@soegaard.net> Stephen De Gabrielle skrev: > I just noticed the 'Lisp friendly we hosting' page on the alu wiki ( > http://wiki.alu.org/Lisp-friendly_Web_Hosting ) > > I anyone aware of any PLT-Scheme friendly web hosts? > (apart from building my own machine image for amazon EC2) > Some of the solutions on the 'Lisp friendly we hosting' page will also work with PLT Scheme. Take a closer look at Bytemark Hosting and Lycos VDS. I believe Amazon's EC2 is a bit expensive for a private web-site. -- Jens Axel S?gaard From noelwelsh at gmail.com Sun Oct 19 08:58:55 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:31:06 2009 Subject: [plt-scheme] hosting In-Reply-To: <595b9ab20810180752i7c0a9631m598091ff3798360d@mail.gmail.com> References: <595b9ab20810180752i7c0a9631m598091ff3798360d@mail.gmail.com> Message-ID: Untyped uses Bytemark, first a linux vm and now a dedicated server. N. On Sat, Oct 18, 2008 at 3:52 PM, Stephen De Gabrielle wrote: > Hi, > > I just noticed the 'Lisp friendly we hosting' page on the alu wiki ( > http://wiki.alu.org/Lisp-friendly_Web_Hosting ) > > I anyone aware of any PLT-Scheme friendly web hosts? > (apart from building my own machine image for amazon EC2) > > > Cheers, > > Stephen From lunarc.lists at gmail.com Sun Oct 19 10:37:21 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:31:06 2009 Subject: [plt-scheme] hosting In-Reply-To: <595b9ab20810180752i7c0a9631m598091ff3798360d@mail.gmail.com> References: <595b9ab20810180752i7c0a9631m598091ff3798360d@mail.gmail.com> Message-ID: 2008/10/18 Stephen De Gabrielle : > Hi, > > I just noticed the 'Lisp friendly we hosting' page on the alu wiki ( > http://wiki.alu.org/Lisp-friendly_Web_Hosting ) > > I anyone aware of any PLT-Scheme friendly web hosts? > (apart from building my own machine image for amazon EC2) I'm using Webfaction (though I'm no longer running the PLT Web Server on it). When I was host shopping I thought I was going to need a VPS to run the PLT Web Server, but webfaction lets you run long-running processes on their shared hosting plans, so it was a cheap choice =). The only time I had to ask them for online support, I got a reply in 20 minutes, so they seem good in that regard as well. Henk From marek at xivilization.net Sun Oct 19 12:28:19 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:31:06 2009 Subject: [plt-scheme] hosting In-Reply-To: <595b9ab20810180752i7c0a9631m598091ff3798360d@mail.gmail.com> References: <595b9ab20810180752i7c0a9631m598091ff3798360d@mail.gmail.com> Message-ID: <20081019182819.32036d19@halmanfloyd.lan.local> On Sat, 18 Oct 2008 15:52:15 +0100 "Stephen De Gabrielle" wrote: > I anyone aware of any PLT-Scheme friendly web hosts? > (apart from building my own machine image for amazon EC2) Depending on what you need, you might want to talk to this guy: (pipe it through the Google translator and write him in english if you don't know german). He provides access to his machine for free, so I think you might be able to arrange with him so he'll let you run the PLT web server (maybe through the equivalent of mod_proxy in Lighttpd). Of course, I wouldn't expect commercial-grade performance, but for trying out, it might be the easiest possibility. regards, Marek From alan at alan-watson.org Sun Oct 19 15:57:23 2008 From: alan at alan-watson.org (Alan Watson) Date: Thu Mar 26 02:31:07 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: References: Message-ID: The question at http://dynamo.iro.umontreal.ca/sw/survey/ has been changed. The problem with regarding the (original) question as "what value does it reduce to?" and the convention that we "consider values to be a subset of expressions that do not require further evaluation" is that there is no standard means to write such an expression that will be eqv? to the required expression. Even Eli's answer doesn't get us there, as his expression produces a value that will be equal? to the required value, but once again not necessarily eqv?. That's why I say the original question is unanswerable. If the original question had been, "what is the value of (car '(a b c)), we could regard 'a as a correct reply under these assumptions, because the values of both expressions will be eqv?. Now, this depends on interpreting "is" as meaning "eqv?" rather than "equal?". However, one would not say that two different calls to (list 'a 'b 'c) produced the same value (in Standard Scheme), so I think eqv? is this correct predicate here. Regards, Alan -- Alan Watson http://www.alan-watson.org/ From matthias at ccs.neu.edu Sun Oct 19 16:20:27 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:31:07 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: References: Message-ID: <59BE12F0-E615-46BB-95B5-64BC27A9F48E@ccs.neu.edu> Alan, you may also wish to read up on reduction semantics, e.g., Findler and Matthews's appendix to the R6RS and their paper on R5RS. On Oct 19, 2008, at 3:57 PM, Alan Watson wrote: > The question at http://dynamo.iro.umontreal.ca/sw/survey/ has been > changed. > > The problem with regarding the (original) question as "what value > does it reduce to?" and the convention that we "consider values to > be a subset of expressions that do not require > further evaluation" is that there is no standard means to write > such an expression that will be eqv? to the required expression. > Even Eli's answer doesn't get us there, as his expression produces > a value that will be equal? to the required value, but once again > not necessarily eqv?. That's why I say the original question is > unanswerable. > > If the original question had been, "what is the value of (car '(a b > c)), we could regard 'a as a correct reply under these assumptions, > because the values of both expressions will be eqv?. > > Now, this depends on interpreting "is" as meaning "eqv?" rather > than "equal?". However, one would not say that two different calls > to (list 'a 'b 'c) produced the same value (in Standard Scheme), so > I think eqv? is this correct predicate here. > > Regards, > > Alan > -- > Alan Watson > http://www.alan-watson.org/ > From zen1986 at gmail.com Sun Oct 19 03:57:39 2008 From: zen1986 at gmail.com (zen1986@gmail.com) Date: Thu Mar 26 02:31:07 2009 Subject: [plt-scheme] how to use import struct in FFI? Message-ID: Hi, If this seems trivial, please bear with me... How can I use struct defined in C in my scheme code? I spent hours googled it and looked at manual but still no result. I know in Lisp there is a :EXTERNAL and :TYPEDEF option to import struct in header file and local file what is the equivalents in scheme? Thanks. From rcleis at me.com Sun Oct 19 17:31:29 2008 From: rcleis at me.com (Richard Cleis) Date: Thu Mar 26 02:31:07 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: References: Message-ID: <713FB9EA-8F9B-4FB2-BFD2-13419AC13CEA@me.com> Does the following progression make sense, by ordinary standards of Ameringlish? (car '((a b c) x y z)) is '(a b c) The value of (car '((a b c) x y z)) is (a b c) rac On Oct 19, 2008, at 1:57 PM, Alan Watson wrote: > The question at http://dynamo.iro.umontreal.ca/sw/survey/ has been > changed. > > The problem with regarding the (original) question as "what value > does it reduce to?" and the convention that we "consider values to > be a subset of expressions that do not require > further evaluation" is that there is no standard means to write > such an expression that will be eqv? to the required expression. > Even Eli's answer doesn't get us there, as his expression produces a > value that will be equal? to the required value, but once again not > necessarily eqv?. That's why I say the original question is > unanswerable. > > If the original question had been, "what is the value of (car '(a b > c)), we could regard 'a as a correct reply under these assumptions, > because the values of both expressions will be eqv?. > > Now, this depends on interpreting "is" as meaning "eqv?" rather than > "equal?". However, one would not say that two different calls to > (list 'a 'b 'c) produced the same value (in Standard Scheme), so I > think eqv? is this correct predicate here. > > Regards, > > Alan > -- > Alan Watson > http://www.alan-watson.org/ > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From rcleis at mac.com Sun Oct 19 17:40:29 2008 From: rcleis at mac.com (Richard Cleis) Date: Thu Mar 26 02:31:08 2009 Subject: [plt-scheme] Re: Scheme workshop survey Message-ID: <1DAEB62B-9BF3-45C9-B38C-BEB4FFB4B530@mac.com> Does the following progression make sense, by ordinary standards of Ameringlish? (car '((a b c) x y z)) is '(a b c) The value of (car '((a b c) x y z)) is (a b c) rac On Oct 19, 2008, at 1:57 PM, Alan Watson wrote: > The question at http://dynamo.iro.umontreal.ca/sw/survey/ has been > changed. > > The problem with regarding the (original) question as "what value > does it reduce to?" and the convention that we "consider values to > be a subset of expressions that do not require > further evaluation" is that there is no standard means to write > such an expression that will be eqv? to the required expression. > Even Eli's answer doesn't get us there, as his expression produces a > value that will be equal? to the required value, but once again not > necessarily eqv?. That's why I say the original question is > unanswerable. > > If the original question had been, "what is the value of (car '(a b > c)), we could regard 'a as a correct reply under these assumptions, > because the values of both expressions will be eqv?. > > Now, this depends on interpreting "is" as meaning "eqv?" rather than > "equal?". However, one would not say that two different calls to > (list 'a 'b 'c) produced the same value (in Standard Scheme), so I > think eqv? is this correct predicate here. > > Regards, > > Alan > -- > Alan Watson > http://www.alan-watson.org/ > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme _________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-scheme -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081019/2cb507ec/attachment.html From noelwelsh at gmail.com Sun Oct 19 17:44:53 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:31:08 2009 Subject: [plt-scheme] how to use import struct in FFI? In-Reply-To: References: Message-ID: Look at the foreign library in the PLT documentation. A search for "foreign" will find it. N. On Sun, Oct 19, 2008 at 8:57 AM, zen1986@gmail.com wrote: > Hi, > If this seems trivial, please bear with me... > How can I use struct defined in C in my scheme code? > I spent hours googled it and looked at manual but still no result. > I know in Lisp there is a :EXTERNAL and :TYPEDEF option to import > struct in header file and local file what is the equivalents in > scheme? > Thanks. From jos.koot at telefonica.net Sun Oct 19 17:44:52 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:31:08 2009 Subject: [plt-scheme] Re: Scheme workshop survey References: <59BE12F0-E615-46BB-95B5-64BC27A9F48E@ccs.neu.edu> Message-ID: Is'nt this just a question about how to denote uses, quotations and unquotations? The question was already asked and quite adequately dealt with about a century ago by W. V. Quine. For Scheme the notation proposed in R5RS usually is satisfactory, I think. But the notation can only be useful and rightly understood if we agree on it. For example I might say that is not because they occur on two different locations in the text. As a matter of fact they do, but is a syntactical variable (or constants) referring to one and the very same thing whenever ocurring within the same scope. Saying that would not be the same as would not be convenient (although it requires a common understanding of notation) Jos ----- Original Message ----- From: "Matthias Felleisen" To: "Alan Watson" Cc: "Shriram Krishnamurthi" ; "Scheme PLT" Sent: Sunday, October 19, 2008 10:20 PM Subject: Re: [plt-scheme] Re: Scheme workshop survey > > Alan, you may also wish to read up on reduction semantics, e.g., Findler > and Matthews's appendix to the R6RS and their paper on R5RS. > > On Oct 19, 2008, at 3:57 PM, Alan Watson wrote: > >> The question at http://dynamo.iro.umontreal.ca/sw/survey/ has been >> changed. >> >> The problem with regarding the (original) question as "what value does >> it reduce to?" and the convention that we "consider values to be a >> subset of expressions that do not require >> further evaluation" is that there is no standard means to write such an >> expression that will be eqv? to the required expression. Even Eli's >> answer doesn't get us there, as his expression produces a value that >> will be equal? to the required value, but once again not necessarily >> eqv?. That's why I say the original question is unanswerable. >> >> If the original question had been, "what is the value of (car '(a b c)), >> we could regard 'a as a correct reply under these assumptions, because >> the values of both expressions will be eqv?. >> >> Now, this depends on interpreting "is" as meaning "eqv?" rather than >> "equal?". However, one would not say that two different calls to (list >> 'a 'b 'c) produced the same value (in Standard Scheme), so I think eqv? >> is this correct predicate here. >> >> Regards, >> >> Alan >> -- >> Alan Watson >> http://www.alan-watson.org/ >> > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From sk at cs.brown.edu Sun Oct 19 17:45:41 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:31:08 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: <713FB9EA-8F9B-4FB2-BFD2-13419AC13CEA@me.com> References: <713FB9EA-8F9B-4FB2-BFD2-13419AC13CEA@me.com> Message-ID: On Sun, Oct 19, 2008 at 4:31 PM, Richard Cleis wrote: > Does the following progression make sense, by ordinary standards of > Ameringlish? > > (car '((a b c) x y z)) is '(a b c) > > The value of (car '((a b c) x y z)) is (a b c) Not to me. (a b c) is an expression, not a value. It may also be the print representation chosen by some particular implementation for some particular value, but then so is /---+---+---\ | a | b | c | \---+---+---/ (Do you see my point?) Shriram From goetter at mazama.net Sun Oct 19 17:47:13 2008 From: goetter at mazama.net (Ben Goetter) Date: Thu Mar 26 02:31:09 2009 Subject: [plt-scheme] how to use import struct in FFI? In-Reply-To: References: Message-ID: <48FBAAE1.7030206@mazama.net> Specifically, look therein for 3.7 ("C Struct types"). Then study the collects/ffi/sndfile example. Noel Welsh wrote: > Look at the foreign library in the PLT documentation. A search for > "foreign" will find it. > > N. > > On Sun, Oct 19, 2008 at 8:57 AM, zen1986@gmail.com wrote: > >> Hi, >> If this seems trivial, please bear with me... >> How can I use struct defined in C in my scheme code? >> I spent hours googled it and looked at manual but still no result. >> I know in Lisp there is a :EXTERNAL and :TYPEDEF option to import >> struct in header file and local file what is the equivalents in >> scheme? >> Thanks. >> From jos.koot at telefonica.net Sun Oct 19 17:54:39 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:31:09 2009 Subject: [plt-scheme] Re: Scheme workshop survey References: <713FB9EA-8F9B-4FB2-BFD2-13419AC13CEA@me.com> Message-ID: You are pressing things, I think. It's a matter of notation. I am quite happy with: (car (cons )) --> $ where $ means "the value of ". Jos ----- Original Message ----- From: "Shriram Krishnamurthi" To: "Richard Cleis" Cc: "PLT Scheme" Sent: Sunday, October 19, 2008 11:45 PM Subject: Re: [plt-scheme] Re: Scheme workshop survey > On Sun, Oct 19, 2008 at 4:31 PM, Richard Cleis wrote: >> Does the following progression make sense, by ordinary standards of >> Ameringlish? >> >> (car '((a b c) x y z)) is '(a b c) >> >> The value of (car '((a b c) x y z)) is (a b c) > > Not to me. > > (a b c) > > is an expression, not a value. It may also be the print > representation chosen by some particular implementation for some > particular value, but then so is > > /---+---+---\ > | a | b | c | > \---+---+---/ > > (Do you see my point?) > > Shriram > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From jos.koot at telefonica.net Sun Oct 19 17:59:52 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:31:09 2009 Subject: [plt-scheme] Re: Scheme workshop survey References: <713FB9EA-8F9B-4FB2-BFD2-13419AC13CEA@me.com> Message-ID: <15557A7F375B432B9EA29C7016604787@uw2b2dff239c4d> In the message shown below, I offended the rules of W. V. Quine. Sorry. But if you see which error I made, then may be it may help. Jos ----- Original Message ----- From: "Jos Koot" To: "Shriram Krishnamurthi" ; "Richard Cleis" Cc: "PLT Scheme" Sent: Sunday, October 19, 2008 11:54 PM Subject: Re: [plt-scheme] Re: Scheme workshop survey > You are pressing things, I think. It's a matter of notation. > I am quite happy with: > (car (cons )) --> $ > where $ means "the value of ". > Jos > > ----- Original Message ----- > From: "Shriram Krishnamurthi" > To: "Richard Cleis" > Cc: "PLT Scheme" > Sent: Sunday, October 19, 2008 11:45 PM > Subject: Re: [plt-scheme] Re: Scheme workshop survey > > >> On Sun, Oct 19, 2008 at 4:31 PM, Richard Cleis wrote: >>> Does the following progression make sense, by ordinary standards of >>> Ameringlish? >>> >>> (car '((a b c) x y z)) is '(a b c) >>> >>> The value of (car '((a b c) x y z)) is (a b c) >> >> Not to me. >> >> (a b c) >> >> is an expression, not a value. It may also be the print >> representation chosen by some particular implementation for some >> particular value, but then so is >> >> /---+---+---\ >> | a | b | c | >> \---+---+---/ >> >> (Do you see my point?) >> >> Shriram >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From plragde at uwaterloo.ca Sun Oct 19 19:58:06 2008 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:31:09 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: Message-ID: <48FBC98E.40302@uwaterloo.ca> Alan Watson wrote: > The question at http://dynamo.iro.umontreal.ca/sw/survey/ has been > changed. Though not without a mean-spirited snark at those who, from the surveyor's point of view, seem to be deliberately misinterpreting the question. I attended the Scheme Workshop last month as a paying guest, and I would have in good faith answered '(a b c) to the question, and been denied. I would not have guessed that (a b c) was the required answer. I gather that my participation is not appreciated. --PR From rcleis at mac.com Sun Oct 19 19:18:48 2008 From: rcleis at mac.com (Richard Cleis) Date: Thu Mar 26 02:31:09 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: References: <713FB9EA-8F9B-4FB2-BFD2-13419AC13CEA@me.com> Message-ID: On Oct 19, 2008, at 3:45 PM, Shriram Krishnamurthi wrote: > On Sun, Oct 19, 2008 at 4:31 PM, Richard Cleis wrote: >> Does the following progression make sense, by ordinary standards of >> Ameringlish? >> >> (car '((a b c) x y z)) is '(a b c) >> >> The value of (car '((a b c) x y z)) is (a b c) > > Not to me. > > (a b c) > > is an expression, not a value. It may also be the print > representation chosen by some particular implementation for some > particular value, but then so is > > /---+---+---\ > | a | b | c | > \---+---+---/ > > (Do you see my point?) I see your point and agree with it. However, we were presented with a question that needed to be answered without arbitration involving computer scientists. The questionable wording indicated to me that the author simply meant: the car of ... is ___. Learning Scheme is complicated by these issues of wording; I suppose it is an argument for rigorous representation. RAC > > > Shriram > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From rcleis at mac.com Sun Oct 19 20:19:30 2008 From: rcleis at mac.com (Richard Cleis) Date: Thu Mar 26 02:31:09 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: <48FBC98E.40302@uwaterloo.ca> References: <48FBC98E.40302@uwaterloo.ca> Message-ID: At our current Lisp party, I posed the question on a white board. The answers were not unanimous. Now, to eat pie in celebration of 50 years of such controversial expression. RAC On Oct 19, 2008, at 5:58 PM, Prabhakar Ragde wrote: > Alan Watson wrote: > >> The question at http://dynamo.iro.umontreal.ca/sw/survey/ has been >> changed. > > Though not without a mean-spirited snark at those who, from the > surveyor's point of view, seem to be deliberately misinterpreting > the question. > > I attended the Scheme Workshop last month as a paying guest, and I > would have in good faith answered '(a b c) to the question, and been > denied. I would not have guessed that (a b c) was the required > answer. I gather that my participation is not appreciated. --PR > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From robby at cs.uchicago.edu Sun Oct 19 20:38:27 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:31:10 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: <48FBC98E.40302@uwaterloo.ca> References: <48FBC98E.40302@uwaterloo.ca> Message-ID: <932b2f1f0810191738g21092582vb9a06f7ee634727c@mail.gmail.com> Your participation is most certainly appreciated. Marc is just probably just thinking to himself "start up any ordinary Scheme, type this thing in, and copy and paste the result back (or figure it out yourself) and stop complaining already!". Even mzscheme will do this (and DrScheme in some of its modes). I'm quite sure Marc does not mean any malice towards you. Please do send in your results. Best, Robby On Sun, Oct 19, 2008 at 6:58 PM, Prabhakar Ragde wrote: > Alan Watson wrote: > >> The question at http://dynamo.iro.umontreal.ca/sw/survey/ has been >> changed. > > Though not without a mean-spirited snark at those who, from the surveyor's > point of view, seem to be deliberately misinterpreting the question. > > I attended the Scheme Workshop last month as a paying guest, and I would > have in good faith answered '(a b c) to the question, and been denied. I > would not have guessed that (a b c) was the required answer. I gather that > my participation is not appreciated. --PR > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From fredm at cs.uml.edu Sun Oct 19 21:10:26 2008 From: fredm at cs.uml.edu (Fred G. Martin) Date: Thu Mar 26 02:31:10 2009 Subject: [plt-scheme] adventure game code ported to PLT 4 ? Message-ID: <72ef860f0810191810p47ba4c76i78b44bae4fa7b859@mail.gmail.com> Hi all, Has anyone ported the MIT adventure game code to PLT version 4? thanks, Fred -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081019/67e85b66/attachment.htm From feeley at iro.umontreal.ca Sun Oct 19 21:32:13 2008 From: feeley at iro.umontreal.ca (Marc Feeley) Date: Thu Mar 26 02:31:10 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: <932b2f1f0810191738g21092582vb9a06f7ee634727c@mail.gmail.com> References: <48FBC98E.40302@uwaterloo.ca> <932b2f1f0810191738g21092582vb9a06f7ee634727c@mail.gmail.com> Message-ID: <83644CD3-0F84-49AE-A8C1-E71219838A75@iro.umontreal.ca> On 19-Oct-08, at 8:38 PM, Robby Findler wrote: > Your participation is most certainly appreciated. Marc is just > probably just thinking to himself "start up any ordinary Scheme, type > this thing in, and copy and paste the result back (or figure it out > yourself) and stop complaining already!". > > Even mzscheme will do this (and DrScheme in some of its modes). > > I'm quite sure Marc does not mean any malice towards you. Please do > send in your results. Robby, thank you for clarifying my remark. It is sad that as a community we can't even agree on such a fundamental thing. I should have gone with my gut feeling and asked for the value of (+ 1 2), but I decided to make it more interesting and asked a (reworded) question out of the Little Schemer. "Le mieux est l'ennemi du bien." Let me also take a moment to say: You guys have got to be kidding! The Scheme workshop's future is at stake and the steering committee is asking for your feedback to help bring the community together and all you can talk about is how ill conceived the skill testing question was. Honestly, this is shameful behavior. How about a discussion on the Scheme workshop itself? Does anyone really care? Good night. Marc From matthias at ccs.neu.edu Sun Oct 19 21:40:57 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:31:11 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: <83644CD3-0F84-49AE-A8C1-E71219838A75@iro.umontreal.ca> References: <48FBC98E.40302@uwaterloo.ca> <932b2f1f0810191738g21092582vb9a06f7ee634727c@mail.gmail.com> <83644CD3-0F84-49AE-A8C1-E71219838A75@iro.umontreal.ca> Message-ID: On Oct 19, 2008, at 9:32 PM, Marc Feeley wrote: > Does anyone really care? Do you really want a public answer from the person who started it? -- Matthias From ccshan at post.harvard.edu Sun Oct 19 21:43:53 2008 From: ccshan at post.harvard.edu (Chung-chieh Shan) Date: Thu Mar 26 02:31:11 2009 Subject: [plt-scheme] Re: Scheme Hackathon at ICFP 2009? References: <48F8B02F.205@uwaterloo.ca> Message-ID: Prabhakar Ragde wrote in article <48F8B02F.205@uwaterloo.ca> in gmane.lisp.scheme.plt: > Matthias wrote: > > Warning: we do not have polymorphism > > under control > Then again, who does? --PR Yukiyoshi Kameyama and Takuo Yonezawa have polymorphism under control: Their FLOPS 2008 paper introduces a type system for control/prompt with let-bound polymorphism. *duck* -- Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig Grammar is a complementary analytical tool for understanding how language is used in a statute to convey meaning. District Court Judge Jonathan Jasper from Minnesota From sk at cs.brown.edu Sun Oct 19 22:02:14 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:31:11 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: <83644CD3-0F84-49AE-A8C1-E71219838A75@iro.umontreal.ca> References: <48FBC98E.40302@uwaterloo.ca> <932b2f1f0810191738g21092582vb9a06f7ee634727c@mail.gmail.com> <83644CD3-0F84-49AE-A8C1-E71219838A75@iro.umontreal.ca> Message-ID: Hi Marc, Please, relax. I was the one who started the "complaint". It was meant to be somewhat light-hearted. It got away from that. Sorry. But this thread has NOT been complaining about your Web site. It has mostly been about a question of semantics: what is a value, what is equality, what is the difference between printing and evaluating. I like to think that at least a few people are being provoked to think about things they took for granted about Scheme. Someone may have even learned something -- if nothing else, better understood why they believed what they believed. I don't think that's a bad thing. There has really been only one message (in the latter part of the thread) focused exclusively on the Web site. In fact, in a thread of about 40 messages, the only messages about the Web site are: - your initial message about the survey - my response - Prabhakar's message (#38 or so) - Robby's response (#39 or so) - your last message That's a pretty good s/n ratio. It's true that none of these messages are focusing on "the Scheme community". That is because: - This thread has become about values and semantics, not about the Scheme community. It did so from message #3 onward, so it's not even like some "Scheme community discussion" got hijacked. - It's not clear this is the right venue to discuss the Scheme community in general. - I didn't know we were *having* a discussion about the Scheme community. All I know is there was a request to fill in a survey, and I did so immediately (incidentally, *before* I posted that message). I have not seen any survey results to discuss. So I don't know what there is to talk about, really. If you think there is value in having a specific discussion about something community-oriented (but also PLT-related), then please enlighten us. Start a thread on that topic, and there's a decent chance we'll stay focused to discuss it. But please don't get upset. It's not personal, and I don't think the situation is quite so bad as you're suggesting. Cheers, Shriram From gregory.woodhouse at gmail.com Sun Oct 19 22:02:43 2008 From: gregory.woodhouse at gmail.com (Woodhouse Gregory) Date: Thu Mar 26 02:31:11 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: References: <713FB9EA-8F9B-4FB2-BFD2-13419AC13CEA@me.com> Message-ID: <8B45F8C8-697B-480D-9653-1546C2A29A9F@gmail.com> Don't you think the problem ultimately comes down to the limits of natural language? After all, the question was posed in English. In "The Little Schemer" there is a chapter (9?) where a great deal of emphasis is placed on the differing typefaces used (in that book) for atoms and bits of Scheme code. By introducing this convention, TLS is, in effect, using an artificial language to circumvent some of the difficulties of ordinary English (even as used to discuss languages like Scheme). I would have answered (a b c), but I appreciate the arguments for using '(a b c) and, to me, it seems that both are a kind of compromise. "Interaction is the mind-body problem of computing." --Philip L. Wadler http://www.gwoodhouse.com http://GregWoodhouse.ImageKind.com On Oct 19, 2008, at 2:45 PM, Shriram Krishnamurthi wrote: > On Sun, Oct 19, 2008 at 4:31 PM, Richard Cleis wrote: >> Does the following progression make sense, by ordinary standards of >> Ameringlish? >> >> (car '((a b c) x y z)) is '(a b c) >> >> The value of (car '((a b c) x y z)) is (a b c) > > Not to me. > > (a b c) > > is an expression, not a value. It may also be the print > representation chosen by some particular implementation for some > particular value, but then so is > > /---+---+---\ > | a | b | c | > \---+---+---/ > > (Do you see my point?) > > Shriram -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081019/770280be/attachment.html From matthias at ccs.neu.edu Sun Oct 19 22:04:36 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:31:12 2009 Subject: [plt-scheme] Re: Scheme Hackathon at ICFP 2009? In-Reply-To: References: <48F8B02F.205@uwaterloo.ca> Message-ID: Boy, if it were just that trivial. On Oct 19, 2008, at 9:43 PM, Chung-chieh Shan wrote: > Prabhakar Ragde wrote in article <48F8B02F. > 205@uwaterloo.ca> in gmane.lisp.scheme.plt: >> Matthias wrote: >>> Warning: we do not have polymorphism >>> under control >> Then again, who does? --PR > > Yukiyoshi Kameyama and Takuo Yonezawa have polymorphism under control: > Their FLOPS 2008 paper introduces a type system for control/prompt > with > let-bound polymorphism. > > *duck* > > -- > Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig > Grammar is a complementary analytical tool for understanding how > language is used in a statute to convey meaning. > District Court Judge Jonathan Jasper from Minnesota > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From fredm at cs.uml.edu Sun Oct 19 22:24:28 2008 From: fredm at cs.uml.edu (Fred G. Martin) Date: Thu Mar 26 02:31:12 2009 Subject: [plt-scheme] Re: adventure game code ported to PLT 4 ? In-Reply-To: <72ef860f0810191810p47ba4c76i78b44bae4fa7b859@mail.gmail.com> References: <72ef860f0810191810p47ba4c76i78b44bae4fa7b859@mail.gmail.com> Message-ID: <72ef860f0810191924j63add3d8sa9779c190d7addef@mail.gmail.com> Well, this was actually pretty easy, with one exception... the "show" procedure. It seems to use MIT Scheme-specific features (environment->package, fluid-let, environment-bindings)... Is this portable to PLT? Thanks all, Fred (define (show thing) (define (global-environment? frame) (environment->package frame)) (define (pp-binding name value width) (let ((value* (with-string-output-port (lambda (port) (if (pair? value) (pretty-print value port #F (+ width 2)) (display value port)))))) (newline) (display name) (display ": ") (display (make-string (- width (string-length name)) #\Space)) (if (pair? value) (display (substring value* (+ width 2) (string-length value*))) (display value*)))) (define (show-frame frame) (if (global-environment? frame) (display "\nGlobal Environment") (let* ((bindings (environment-bindings frame)) (parent (environment-parent frame)) (names (cons "Parent frame" (map symbol->string (map car bindings)))) (values (cons (if (global-environment? parent) 'global-environment parent) (map cadr bindings))) (width (reduce max 0 (map string-length names)))) (for-each (lambda (n v) (pp-binding n v width)) names values)))) (define (show-procedure proc) (fluid-let ((*unparser-list-depth-limit* 4) (*unparser-list-breadth-limit* 4)) (newline) (display "Frame:") (newline) (display " ") (if (global-environment? (procedure-environment proc)) (display "Global Environment") (display (procedure-environment proc))) (newline) (display "Body:") (newline) (pretty-print (procedure-lambda proc) (current-output-port) #T 2))) (define (print-nicely thing) (newline) (display thing) (cond ((false? thing) 'uninteresting) ((environment? thing) (show-frame thing)) ((compound-procedure? thing) (show-procedure thing)) (else 'uninteresting))) (print-nicely (or (if (exact-integer? thing) (object-unhash thing) thing) thing))) On Sun, Oct 19, 2008 at 9:10 PM, Fred G. Martin wrote: > > Hi all, > Has anyone ported the MIT adventure game code to PLT version 4? > thanks, > Fred From matthias at ccs.neu.edu Sun Oct 19 22:33:17 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:31:12 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: <8B45F8C8-697B-480D-9653-1546C2A29A9F@gmail.com> References: <713FB9EA-8F9B-4FB2-BFD2-13419AC13CEA@me.com> <8B45F8C8-697B-480D-9653-1546C2A29A9F@gmail.com> Message-ID: The TLS is plain old wrong. Take it from its author/co. * When Dan wrote TLL(1), people had just scratched the surface of semantics. Dan wrote down what people saw and whenever he wrote "what is the value of", he meant "what does a conventional Lisp/Scheme interpreter print when you type this into its repl." * I left it alone because Dan wanted a light-hearted introduction to "heavy" topics. Changing that would have pushed it way far away from "sit down with an interpreter and play" atmosphere. * For a semanticist, however, all of this is nonsense. A syntactic way of "doing semantics" is to find some SUBSET of the language of expressions that represents "things that we no longer have to calculate with because the answer is obvious" aka VALUES, and to come up with relations that map programs to elements of this set. In this spirit, (a b c) is by no means a value. It is an expression that applies a to the arguments b and c. On the other hand '(a b c) IS an expression, it IS obvious what it means, and so it IS natural to think of it as a value, though I tend to think of it as a short-hand for a value. A model-oriented way of "doing semantics" would certainly represent '(a b c) as some 'object that stores three symbols.' (Whatever the object is: a record in some language, an element of a tuple space in the Scott-domain world.) Again, there is NO WAY to equate this object with (a b c), which would denote the result of an application. So enough said. I am tuning out. -- Matthias On Oct 19, 2008, at 10:02 PM, Woodhouse Gregory wrote: > Don't you think the problem ultimately comes down to the limits of > natural language? After all, the question was posed in English. In > "The Little Schemer" there is a chapter (9?) where a great deal of > emphasis is placed on the differing typefaces used (in that book) > for atoms and bits of Scheme code. By introducing this convention, > TLS is, in effect, using an artificial language to circumvent some > of the difficulties of ordinary English (even as used to discuss > languages like Scheme). > > I would have answered (a b c), but I appreciate the arguments for > using '(a b c) and, to me, it seems that both are a kind of > compromise. > > > "Interaction is the mind-body problem > of computing." --Philip L. Wadler > > http://www.gwoodhouse.com > http://GregWoodhouse.ImageKind.com > > > > > > > On Oct 19, 2008, at 2:45 PM, Shriram Krishnamurthi wrote: > >> On Sun, Oct 19, 2008 at 4:31 PM, Richard Cleis wrote: >>> Does the following progression make sense, by ordinary standards of >>> Ameringlish? >>> >>> (car '((a b c) x y z)) is '(a b c) >>> >>> The value of (car '((a b c) x y z)) is (a b c) >> >> Not to me. >> >> (a b c) >> >> is an expression, not a value. It may also be the print >> representation chosen by some particular implementation for some >> particular value, but then so is >> >> /---+---+---\ >> | a | b | c | >> \---+---+---/ >> >> (Do you see my point?) >> >> Shriram > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081019/178369da/attachment.htm From morazanm at gmail.com Mon Oct 20 00:11:41 2008 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:31:13 2009 Subject: [plt-scheme] Re: Scheme workshop survey In-Reply-To: References: <713FB9EA-8F9B-4FB2-BFD2-13419AC13CEA@me.com> <8B45F8C8-697B-480D-9653-1546C2A29A9F@gmail.com> Message-ID: <9b1fff280810192111u51e6fac3l8f29b6851e790e6c@mail.gmail.com> > So enough said. I am tuning out. -- Matthias > May I suggest we all follow Matthias' lead and tune out? I think that we have gotten all we can possibly get out of '(a b c) or (a b c) or whatever other printable representation you choose for the value of (car ____). Gee whiz, let's let it go. I think we all got the point. -- Cheers, Marco From DekuDekuplex at Yahoo.com Mon Oct 20 01:32:33 2008 From: DekuDekuplex at Yahoo.com (Benjamin L.Russell) Date: Thu Mar 26 02:31:13 2009 Subject: [plt-scheme] puzzling bug with (extremely simple) curried Typed Scheme program Message-ID: <6u4of4trsthnt6qre8stgs4ge26j18r2jv@4ax.com> Just for fun, I decided to try currying a very simple Typed Scheme program to wish the user good luck, using the person's name supplied as an argument to the function. The uncurried version works; the curried one doesn't; I have no idea why. Here's the uncurried Typed Scheme version, which works: #lang typed-scheme (: good-luck-typed (String -> Void)) (define (good-luck-typed name) (if (string=? name "Nobody") (printf "You are ~a." name) (good-luck-helper-typed name "Good Luck"))) (: good-luck-helper-typed (String String -> Void)) (define (good-luck-helper-typed a b) (printf "~a, ~a!" a b)) Here's a sample session using this program: Welcome to DrScheme, version 4.1.1 [3m]. Language: Module. > (good-luck-typed "Benjamin") Benjamin, Good Luck! > (good-luck-typed "Nobody") You are Nobody. > So far, so good. But then the following curried version generates a bug, as follows: #lang typed-scheme (: good-luck-curried (String -> Void)) (define (good-luck-curried name) (if (string=? name "Nobody") (printf "You are ~a." name) (good-luck-helper-curried name "Good Luck"))) (: good-luck-helper-curried (String (String -> Void))) (define ((good-luck-helper-curried a) b) (printf "~a, ~a!" a b)) Here's the error generated when I try to run the program: Welcome to DrScheme, version 4.1.1 [3m]. Language: Module. . typecheck: untyped var: a in: a > The term "a" in the definition "((good-luck-helper-curried a) b)" is then highlighted in pink. Apparently, Scheme seems unable to understand that 'a' is of type String, even though I have already supplied a type annotation documenting this type. However, this syntax seems correct, considering the following uncurried and curried versions of hanoi, which I had created earlier: Uncurried Typed Scheme version of hanoi, followed by sample output: #lang typed-scheme (: hanoi-typed (Number -> Void)) (define (hanoi-typed n) (hanoi-helper-typed 'A 'B 'C n)) (: hanoi-helper-typed (Symbol Symbol Symbol Number -> Void)) (define (hanoi-helper-typed source using destination n) (cond ((= n 1) (printf "Moving from disc ~a to ~a.\n" source destination)) (else (hanoi-helper-typed source destination using (- n 1)) (hanoi-helper-typed source using destination 1) (hanoi-helper-typed using source destination (- n 1))))) Welcome to DrScheme, version 4.1.1 [3m]. Language: Module. > (hanoi-typed 3) Moving from disc A to C. Moving from disc A to B. Moving from disc C to B. Moving from disc A to C. Moving from disc B to A. Moving from disc B to C. Moving from disc A to C. > Curried Typed Scheme version of hanoi, followed by sample output: #lang typed-scheme (: hanoi-curried (Number -> Void)) (define (hanoi-curried n) ((((hanoi-helper-curried 'A) 'B) 'C) n)) (: hanoi-helper-curried (Symbol -> (Symbol -> (Symbol -> (Number -> Void))))) (define ((((hanoi-helper-curried source) using) destination) n) (cond ((= n 1) (printf "Moving from disc ~a to ~a.\n" source destination)) (else ((((hanoi-helper-curried source) destination) using) (- n 1)) ((((hanoi-helper-curried source) using) destination) 1) ((((hanoi-helper-curried using) source) destination) (- n 1))))) Welcome to DrScheme, version 4.1.1 [3m]. Language: Module. > (hanoi-curried 3) Moving from disc A to C. Moving from disc A to B. Moving from disc C to B. Moving from disc A to C. Moving from disc B to A. Moving from disc B to C. Moving from disc A to C. > Am I missing something terribly elementary, or is there some other reason for the above-mentioned apparent bug? I can't understand the reason that while Scheme can understand that "source" is of type Symbol using the type annotation for hanoi-helper-curred above, it cannot understand that 'a' is of type String in the type annotation for good-luck-helper-curried previously -- Benjamin L. Russell From eli at barzilay.org Mon Oct 20 01:58:28 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:31:13 2009 Subject: [plt-scheme] puzzling bug with (extremely simple) curried Typed Scheme program In-Reply-To: <6u4of4trsthnt6qre8stgs4ge26j18r2jv@4ax.com> References: <6u4of4trsthnt6qre8stgs4ge26j18r2jv@4ax.com> Message-ID: <18684.7684.522946.501535@arabic.ccs.neu.edu> On Oct 20, Benjamin L.Russell wrote: > > #lang typed-scheme > > (: good-luck-curried (String -> Void)) > (define (good-luck-curried name) > (if (string=? name "Nobody") > (printf "You are ~a." name) > (good-luck-helper-curried name "Good Luck"))) You're missing an extra set of parens in the above. > (: good-luck-helper-curried (String (String -> Void))) And here you're missing an arrow: (: good-luck-helper-curried (String -> (String -> Void))) (There is a real problem here: typed-scheme does not complain early enough about your badly formed type, so the error is confusing. It should have said something about not being able to apply the `String' type.) > (define ((good-luck-helper-curried a) b) > (printf "~a, ~a!" a b)) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From raould at gmail.com Mon Oct 20 02:15:26 2008 From: raould at gmail.com (Raoul Duke) Date: Thu Mar 26 02:31:13 2009 Subject: [plt-scheme] define-struct and auto fields Message-ID: <91a2ba3e0810192315h7887d190w29fa9a8172fd9746@mail.gmail.com> hi, what i think i get from the docs is that there's only one auto value per struct, and that value is used to init any auto fields no mattery how many different auto fields there might be. i don't understand why i can't specify an auto value for each auto field. like, what if one is supposed to hold a number, and another is supposed to hold a list? (is plt's implementation of structs very different from that of other schemes?) thanks. From eli at barzilay.org Mon Oct 20 02:22:59 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:31:13 2009 Subject: [plt-scheme] define-struct and auto fields In-Reply-To: <91a2ba3e0810192315h7887d190w29fa9a8172fd9746@mail.gmail.com> References: <91a2ba3e0810192315h7887d190w29fa9a8172fd9746@mail.gmail.com> Message-ID: <18684.9155.248237.275842@arabic.ccs.neu.edu> On Oct 19, Raoul Duke wrote: > hi, > > what i think i get from the docs is that there's only one auto value > per struct, and that value is used to init any auto fields no > mattery how many different auto fields there might be. i don't > understand why i can't specify an auto value for each auto > field. like, what if one is supposed to hold a number, and another > is supposed to hold a list? You can always write your own constructor function that wraps the actual constructor, using misc defaults and/or keyword arguments. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From raould at gmail.com Mon Oct 20 02:25:35 2008 From: raould at gmail.com (Raoul Duke) Date: Thu Mar 26 02:31:13 2009 Subject: [plt-scheme] define-struct and auto fields In-Reply-To: <18684.9155.248237.275842@arabic.ccs.neu.edu> References: <91a2ba3e0810192315h7887d190w29fa9a8172fd9746@mail.gmail.com> <18684.9155.248237.275842@arabic.ccs.neu.edu> Message-ID: <91a2ba3e0810192325o36d8118dn67b3d0114355927a@mail.gmail.com> > You can always write your own constructor function that wraps the > actual constructor, using misc defaults and/or keyword arguments. ah, i see, thanks. From raould at gmail.com Mon Oct 20 02:27:52 2008 From: raould at gmail.com (Raoul Duke) Date: Thu Mar 26 02:31:14 2009 Subject: [plt-scheme] "implicitly mutable"? Message-ID: <91a2ba3e0810192327n730d4c62u246745aa3d75b4c7@mail.gmail.com> http://docs.plt-scheme.org/guide/define-struct.html "#:auto-value auto-expr Specifies a value to be used for all automatic fields in the structure type, where an automatic field is indicated by the #:auto field option. The constructor procedure does not accept arguments for automatic fields, and they are implicitly mutable." but, apparently there's no mutating set procedure created unless i also mark it as #:mutable, so i don't grok what it means for them to be implicitly mutable, if i can't mutate them. thanks. From mvanier42 at gmail.com Mon Oct 20 02:46:11 2008 From: mvanier42 at gmail.com (Michael Vanier) Date: Thu Mar 26 02:31:14 2009 Subject: [plt-scheme] Using a teachpack from the module language level Message-ID: <48FC2933.1050908@cs.caltech.edu> Hi everyone, Apologies if this has been answered before, but is it possible to use one of the teaching language teachpacks from the module language level, and if so, how do you do it? Thanks in advance, Mike From marek at xivilization.net Mon Oct 20 03:29:39 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:31:14 2009 Subject: [plt-scheme] Usability: delete whole line in DrScheme Message-ID: <20081020092939.31fa9612@halmanfloyd.lan.local> Hi, I hope it's okay when I post some more usability things to the list. My last suggestion was implemented very fast and it has improved the usability for me quite a lot. In this mail I'll talk about deleting the whole line in the DrScheme interactions window/REPL. The problem occurs, when trying to delete a lne from an arbitary position to the beginning of the line. Most of the time I use Shift-Home to select from the current position to the beginning of the line and delete using backspace. As it turns out, this doesn't work in DrScheme, because there is the > prompt which gets selected but cannot be deleted. So you have to unselect it and the following space to delete the line. My proposal would be either to make it deletable if at least one character of the selection is code (if nothing is selected, it should stay as is and if someone selects the prompt and the space, it shouldn't be deletable either) and then immediatele re-insert it (or never delete it really) or make Home go only to the position after the space, so the prompt won't get selected. regards, Marek From noelwelsh at gmail.com Mon Oct 20 03:53:42 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:31:14 2009 Subject: [plt-scheme] "implicitly mutable"? In-Reply-To: <91a2ba3e0810192327n730d4c62u246745aa3d75b4c7@mail.gmail.com> References: <91a2ba3e0810192327n730d4c62u246745aa3d75b4c7@mail.gmail.com> Message-ID: I think it means that you can mutate the field via the struct-type-info, assuming you can get hold of said info. See: http://docs.plt-scheme.org/reference/inspectors.html N. On Mon, Oct 20, 2008 at 7:27 AM, Raoul Duke wrote: ... > but, apparently there's no mutating set procedure created unless i > also mark it as #:mutable, so i don't grok what it means for them to > be implicitly mutable, if i can't mutate them. > > thanks. From noelwelsh at gmail.com Mon Oct 20 04:12:11 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:31:14 2009 Subject: [plt-scheme] Re: adventure game code ported to PLT 4 ? In-Reply-To: <72ef860f0810191924j63add3d8sa9779c190d7addef@mail.gmail.com> References: <72ef860f0810191810p47ba4c76i78b44bae4fa7b859@mail.gmail.com> <72ef860f0810191924j63add3d8sa9779c190d7addef@mail.gmail.com> Message-ID: On Mon, Oct 20, 2008 at 3:24 AM, Fred G. Martin wrote: > Well, this was actually pretty easy, with one exception... the "show" procedure. > > It seems to use MIT Scheme-specific features (environment->package, > fluid-let, environment-bindings)... Is this portable to PLT? Look at namespaces and parameters for the PLT equivalent (well, nearest match). N. From eli at barzilay.org Mon Oct 20 04:39:25 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:31:14 2009 Subject: [plt-scheme] Using a teachpack from the module language level In-Reply-To: <48FC2933.1050908@cs.caltech.edu> References: <48FC2933.1050908@cs.caltech.edu> Message-ID: <18684.17341.804996.400289@arabic.ccs.neu.edu> On Oct 19, Michael Vanier wrote: > Hi everyone, > > Apologies if this has been answered before, but is it possible to > use one of the teaching language teachpacks from the module language > level, and if so, how do you do it? Something like: #lang s-exp lang/htdp-beginner ... They're not proper languages at this point (that is, you can't just use `#lang lang/htdp-beginner') but they will be. Also, there's a bunch of stuff that they won't do -- mostly customization of the input (obviously -- the `#lang s-exp' means that you're using the default reader) and the output. (These would also be done, eventually.) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From dekudekuplex at yahoo.com Mon Oct 20 04:33:58 2008 From: dekudekuplex at yahoo.com (Benjamin L. Russell) Date: Thu Mar 26 02:31:15 2009 Subject: [plt-scheme] puzzling bug with (extremely simple) curried Typed Scheme program In-Reply-To: <18684.7684.522946.501535@arabic.ccs.neu.edu> Message-ID: <920708.54092.qm@web30201.mail.mud.yahoo.com> --- On Mon, 10/20/08, Eli Barzilay wrote: > On Oct 20, Benjamin L.Russell wrote: > > > > #lang typed-scheme > > > > (: good-luck-curried (String -> Void)) > > (define (good-luck-curried name) > > (if (string=? name "Nobody") > > (printf "You are ~a." name) > > (good-luck-helper-curried name "Good > Luck"))) > > You're missing an extra set of parens in the above. (smack-self-head 'Benjamin) Aha! Instead of (good-luck-helper-curried name "Good Luck") , it should have been ((good-luck-helper-curried name) "Good Luck") ! > > (: good-luck-helper-curried (String (String -> > Void))) > > And here you're missing an arrow: > > (: good-luck-helper-curried (String -> (String -> > Void))) Yep. I see the problem now. Instead of (: good-luck-helper-curried (String (String -> Void))) , it should have been (: good-luck-helper-curried (String -> (String -> Void))) . > (There is a real problem here: typed-scheme does not > complain early > enough about your badly formed type, so the error is > confusing. It > should have said something about not being able to apply > the `String' > type.) > > > (define ((good-luck-helper-curried a) b) > > (printf "~a, ~a!" a b)) Just for reference, I wrote the following similar Haskell program, and then intentionally made a similar error to see what type of type error message GHCi would generate. First, here's the correct version of the program, coupled with its output: module Main where mainHelper :: String -> IO String mainHelper prompt = do putStr prompt getLine main :: IO () main = do name <- mainHelper "What is your name? " let greeting = "Good Luck" if name == "Nobody" then putStrLn ("You are " ++ name ++ ".") else do putStrLn (greeting ++ ", " ++ name ++ "!") Prelude> :l main.hs [1 of 1] Compiling Main ( main.hs, interpreted ) Ok, modules loaded: Main. *Main> main What is your name? Benjamin Good Luck, Benjamin! *Main> main What is your name? Nobody You are Nobody. *Main> Then, I intentionally created a type error by changing the following type annotation: mainHelper :: String -> IO String to the following badly formed type annotation: mainHelper :: String IO String The error message generated is as follows: *Main> :l main.hs [1 of 1] Compiling Main ( main.hs, interpreted ) main.hs:3:14: Kind error: `String' is applied to too many type arguments In the type `String IO String' In the type signature for `mainHelper': mainHelper :: String IO String Failed, modules loaded: none. Prelude> :e main.hs For reference, it may be helpful if Typed Scheme were to return a similar type error message in this case. -- Benjamin L. Russell From eli at barzilay.org Mon Oct 20 04:41:47 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:31:15 2009 Subject: [plt-scheme] puzzling bug with (extremely simple) curried Typed Scheme program In-Reply-To: <920708.54092.qm@web30201.mail.mud.yahoo.com> References: <18684.7684.522946.501535@arabic.ccs.neu.edu> <920708.54092.qm@web30201.mail.mud.yahoo.com> Message-ID: <18684.17483.798444.427269@arabic.ccs.neu.edu> On Oct 20, Benjamin L. Russell wrote: > [...] > > main.hs:3:14: > Kind error: `String' is applied to too many type arguments > [...] > For reference, it may be helpful if Typed Scheme were to return a > similar type error message in this case. It does provide a similar error message, try this: (: blah (String (String -> Void))) (define blah 1) The problem is that it reported the other error first, so it never got to this one. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From spdegabrielle at gmail.com Mon Oct 20 06:58:44 2008 From: spdegabrielle at gmail.com (Stephen De Gabrielle) Date: Thu Mar 26 02:31:15 2009 Subject: [plt-scheme] using Scheme Boxes to embed data in attributes withitn XML Boxes Message-ID: <595b9ab20810200358p62dad2b7r425912e4e33d8065@mail.gmail.com> Hi, I just found this behaviour; using Scheme Boxes to embed data in attributes within XML Boxes causes an error Module Language: invalid module text read-char: non-character in an unsupported context, from port: # I understand that "These expressions are evaluated and their contents are placed into the containing XML box's xexpr." and that the quotes around the expression value that the scheme box is embedded into are the cause. Does anyone have a simple way around the problem? Can I 'escape' my way out of this? Cheers, Stephen --- #lang scheme (require xml) (let ((astring "daasda" )) {xml-box} s{/xml-box} ) From plragde at uwaterloo.ca Mon Oct 20 07:48:28 2008 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:31:15 2009 Subject: [plt-scheme] puzzling bug with (extremely simple) curried, Typed Scheme program In-Reply-To: <6u4of4trsthnt6qre8stgs4ge26j18r2jv@4ax.com> Message-ID: <48FC700C.70506@uwaterloo.ca> Benjamin wrote: > (define ((good-luck-helper-curried a) b) > (printf "~a, ~a!" a b)) I had never seen this style of curried definition before, and would have bet that it would raise an error [1], but in fact it works fine in #lang scheme. I can find justification for it in PLT Reference 2.14, but not in R6RS. I'm curious as to its utility -- does it help in writing contracts for higher-order functions? Thanks. --PR [1] A few days ago I was explaining CPS to a student reading EOPL, and I wrote out sum-list/k as an example, and said, "Do you understand?" and she said, "No, what is `first'?" So perhaps the HtDP authors are correct, and I have not actually learned Scheme. From matthias at ccs.neu.edu Mon Oct 20 08:41:47 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:31:15 2009 Subject: [plt-scheme] Using a teachpack from the module language level In-Reply-To: <48FC2933.1050908@cs.caltech.edu> References: <48FC2933.1050908@cs.caltech.edu> Message-ID: On Oct 20, 2008, at 2:46 AM, Michael Vanier wrote: > Hi everyone, > > Apologies if this has been answered before, but is it possible to > use one of the teaching language teachpacks from the module > language level, and if so, how do you do it? If you want to use the world teachpack, for example, #lang scheme (require htdp/world) will work. -- Matthias From pltscheme at pnkfx.org Mon Oct 20 08:45:42 2008 From: pltscheme at pnkfx.org (Felix Klock's PLT scheme proxy) Date: Thu Mar 26 02:31:15 2009 Subject: [plt-scheme] Re: adventure game code ported to PLT 4 ? In-Reply-To: References: <72ef860f0810191810p47ba4c76i78b44bae4fa7b859@mail.gmail.com> <72ef860f0810191924j63add3d8sa9779c190d7addef@mail.gmail.com> Message-ID: <3C863565-D236-42A4-8116-FC608B51006B@pnkfx.org> On Oct 20, 2008, at 4:12 AM, Noel Welsh wrote: > On Mon, Oct 20, 2008 at 3:24 AM, Fred G. Martin > wrote: >> Well, this was actually pretty easy, with one exception... the >> "show" procedure. >> >> It seems to use MIT Scheme-specific features (environment->package, >> fluid-let, environment-bindings)... Is this portable to PLT? > > Look at namespaces and parameters for the PLT equivalent (well, > nearest match). Its probably going to need more than that; it looks to me like that selectors like procedure-environment are extracting the lexical environment that procedure objects are closed over. Namespaces model global environments; I do not know if PLT has anything for reifying the local bindings. However, it also looks to me like the show procedure may only be there for, mmm, "debugging" purposes? (Or at least for easy interactive inspection of "object" structure at the REPL; the point is, show is not called from game.scm or world.scm...) Or are we talking about a different adventure game code than the one at: http://mitpress.mit.edu/sicp/psets/ps6/readme.html -Felix From robby at cs.uchicago.edu Mon Oct 20 09:25:33 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:31:16 2009 Subject: [plt-scheme] using Scheme Boxes to embed data in attributes withitn XML Boxes In-Reply-To: <595b9ab20810200358p62dad2b7r425912e4e33d8065@mail.gmail.com> References: <595b9ab20810200358p62dad2b7r425912e4e33d8065@mail.gmail.com> Message-ID: <932b2f1f0810200625t72f26492m7ab7527d05ed9c8a@mail.gmail.com> If the entire attribute's value is in the scheme box, you should be okay, ie: s Robby On Mon, Oct 20, 2008 at 5:58 AM, Stephen De Gabrielle wrote: > Hi, > > I just found this behaviour; > > using Scheme Boxes to embed data in attributes within XML Boxes causes an error > > Module Language: invalid module text > read-char: non-character in an unsupported context, from port: > # > > I understand that "These expressions are evaluated and their contents > are placed into the containing XML box's xexpr." > and that the quotes around the expression value that the scheme box is > embedded into are the cause. > > Does anyone have a simple way around the problem? Can I 'escape' my > way out of this? > > > Cheers, > > Stephen > > > --- > > #lang scheme > (require xml) > > (let ((astring "daasda" )) > {xml-box} s{/xml-box} > ) > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From eli at barzilay.org Mon Oct 20 09:25:44 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:31:16 2009 Subject: [plt-scheme] puzzling bug with (extremely simple) curried, Typed Scheme program In-Reply-To: <48FC700C.70506@uwaterloo.ca> References: <6u4of4trsthnt6qre8stgs4ge26j18r2jv@4ax.com> <48FC700C.70506@uwaterloo.ca> Message-ID: <18684.34520.440349.444940@arabic.ccs.neu.edu> On Oct 20, Prabhakar Ragde wrote: > Benjamin wrote: > > > (define ((good-luck-helper-curried a) b) > > (printf "~a, ~a!" a b)) > > I had never seen this style of curried definition before, and would > have bet that it would raise an error [1], but in fact it works fine > in #lang scheme. I can find justification for it in PLT Reference > 2.14, but not in R6RS. I'm curious as to its utility -- does it help > in writing contracts for higher-order functions? There are some cases where I find it useful, for example, when you discover that it's more convenient to have a curried definition then the edit is quick, or when you want to write a function that returns a handler function. (Both are not really deep arguments.) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From spdegabrielle at gmail.com Mon Oct 20 09:41:48 2008 From: spdegabrielle at gmail.com (Stephen De Gabrielle) Date: Thu Mar 26 02:31:16 2009 Subject: [plt-scheme] using Scheme Boxes to embed data in attributes withitn XML Boxes In-Reply-To: <932b2f1f0810200625t72f26492m7ab7527d05ed9c8a@mail.gmail.com> References: <595b9ab20810200358p62dad2b7r425912e4e33d8065@mail.gmail.com> <932b2f1f0810200625t72f26492m7ab7527d05ed9c8a@mail.gmail.com> Message-ID: <595b9ab20810200641u7386674ay634b542324748b8d@mail.gmail.com> Yeah, I'm using SVG for this project, and the path d attribute has it's own sub-language. (embedded language? I don't remember the right term). I suppose it comes with the territory; pretty well every other language I've used has sub languages, and because it's a sub-language I should probably generate it separately. Cheers, Stephen -- On Mon, Oct 20, 2008 at 2:25 PM, Robby Findler wrote: > s From raould at gmail.com Mon Oct 20 14:20:09 2008 From: raould at gmail.com (Raoul Duke) Date: Thu Mar 26 02:31:16 2009 Subject: [plt-scheme] "implicitly mutable"? In-Reply-To: References: <91a2ba3e0810192327n730d4c62u246745aa3d75b4c7@mail.gmail.com> Message-ID: <91a2ba3e0810201120m31693eadi9eddfe06c805fa54@mail.gmail.com> > I think it means that you can mutate the field via the > struct-type-info, assuming you can get hold of said info. See: > http://docs.plt-scheme.org/reference/inspectors.html learn something new every day, thanks. :) From blockstack at gmail.com Mon Oct 20 15:51:45 2008 From: blockstack at gmail.com (blockstack) Date: Thu Mar 26 02:31:16 2009 Subject: [plt-scheme] Simple procedure building question Message-ID: <6f630e84-ddd7-431f-802d-7e3d1076a976@l33g2000pri.googlegroups.com> I want to be able to pass a list of function names and create a procedure lst would be something like (f g m n) where f, g, m, and n are names of functions (define (B lst x y) (if (null? lst) x ((car lst) x (B (cdr lst) x y)))) I want to end up with a list like (f x (g x (m x (n x y)))) I know that my current procedure won't return a list, but I know that it must be really simple to make it do so. I've tried different ways of using 'list' and cons, but I just can't get it. any help? From blockstack at gmail.com Mon Oct 20 15:56:15 2008 From: blockstack at gmail.com (blockstack) Date: Thu Mar 26 02:31:16 2009 Subject: [plt-scheme] Re: Simple procedure building question In-Reply-To: <6f630e84-ddd7-431f-802d-7e3d1076a976@l33g2000pri.googlegroups.com> References: <6f630e84-ddd7-431f-802d-7e3d1076a976@l33g2000pri.googlegroups.com> Message-ID: <3ee3452b-e9bf-4645-a109-f49eaf23edb0@b31g2000prb.googlegroups.com> correction: i meant to have y for the then-expr (define (B lst x y) (if (null? lst) y ((car lst) x (B (cdr lst) x y)))) On Oct 20, 2:51?pm, blockstack wrote: > I want to be able to pass a list of function names and create a > procedure > lst would be something like (f g m n) where f, g, m, and n are names > of functions > > (define (B lst x y) > ? ?(if (null? lst) > ? ? ? ?x > ? ?((car lst) x (B (cdr lst) x y)))) > > I want to end up with a list like > (f x (g x (m x (n x y)))) > > I know that my current procedure won't return a list, but I know that > it must be really simple to make it do so. > > I've tried different ways of using 'list' and cons, but I just can't > get it. > any help? > > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme From andre.mayers at usherbrooke.ca Mon Oct 20 16:02:30 2008 From: andre.mayers at usherbrooke.ca (Andre Mayers) Date: Thu Mar 26 02:31:16 2009 Subject: [plt-scheme] Re: Simple procedure building question In-Reply-To: <3ee3452b-e9bf-4645-a109-f49eaf23edb0@b31g2000prb.googlegroups.com> References: <6f630e84-ddd7-431f-802d-7e3d1076a976@l33g2000pri.googlegroups.com> <3ee3452b-e9bf-4645-a109-f49eaf23edb0@b31g2000prb.googlegroups.com> Message-ID: <007901c932ee$c8a3c0f0$59eb42d0$@mayers@usherbrooke.ca> (define (B lst x y) (if (null? lst) y `(,(car lst) ,x ,(B (cdr lst) x y)))) -----Message d'origine----- De?: plt-scheme-bounces@list.cs.brown.edu [mailto:plt-scheme-bounces@list.cs.brown.edu] De la part de blockstack Envoy??: October-20-08 3:56 PM ??: plt-scheme@list.cs.brown.edu Objet?: [plt-scheme] Re: Simple procedure building question correction: i meant to have y for the then-expr (define (B lst x y) (if (null? lst) y ((car lst) x (B (cdr lst) x y)))) On Oct 20, 2:51?pm, blockstack wrote: > I want to be able to pass a list of function names and create a > procedure > lst would be something like (f g m n) where f, g, m, and n are names > of functions > > (define (B lst x y) > ? ?(if (null? lst) > ? ? ? ?x > ? ?((car lst) x (B (cdr lst) x y)))) > > I want to end up with a list like > (f x (g x (m x (n x y)))) > > I know that my current procedure won't return a list, but I know that > it must be really simple to make it do so. > > I've tried different ways of using 'list' and cons, but I just can't > get it. > any help? > > _________________________________________________ > ? 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 blockstack at gmail.com Mon Oct 20 16:19:36 2008 From: blockstack at gmail.com (blockstack) Date: Thu Mar 26 02:31:17 2009 Subject: [plt-scheme] Re: Simple procedure building question In-Reply-To: <007901c932ee$c8a3c0f0$59eb42d0$@mayers@usherbrooke.ca> References: <6f630e84-ddd7-431f-802d-7e3d1076a976@l33g2000pri.googlegroups.com> <3ee3452b-e9bf-4645-a109-f49eaf23edb0@b31g2000prb.googlegroups.com> <007901c932ee$c8a3c0f0$59eb42d0$@mayers@usherbrooke.ca> Message-ID: <11abef9e-8dbb-425b-a619-e9c4bf45b7c3@n33g2000pri.googlegroups.com> doesn't the quote prevent the inner procedures in the else-expr from being evaluated? On Oct 20, 3:02?pm, "Andre Mayers" wrote: > (define (B lst x y) > ? (if (null? lst) > ? ? ? y > ? ? ? `(,(car lst) ,x ,(B (cdr lst) x y)))) > > -----Message d'origine----- > De?: plt-scheme-boun...@list.cs.brown.edu > [mailto:plt-scheme-boun...@list.cs.brown.edu] De la part de blockstack > Envoy??: October-20-08 3:56 PM > ??: plt-sch...@list.cs.brown.edu > Objet?: [plt-scheme] Re: Simple procedure building question > > correction: i meant to have y for the then-expr > > (define (B lst x y) > ? ? (if (null? lst) > ? ? ? ? y > ? ? ((car lst) x (B (cdr lst) x y)))) > > On Oct 20, 2:51?pm, blockstack wrote: > > > I want to be able to pass a list of function names and create a > > procedure > > lst would be something like (f g m n) where f, g, m, and n are names > > of functions > > > (define (B lst x y) > > ? ?(if (null? lst) > > ? ? ? ?x > > ? ?((car lst) x (B (cdr lst) x y)))) > > > I want to end up with a list like > > (f x (g x (m x (n x y)))) > > > I know that my current procedure won't return a list, but I know that > > it must be really simple to make it do so. > > > I've tried different ways of using 'list' and cons, but I just can't > > get it. > > any help? > > > _________________________________________________ > > ? For list-related administrative tasks: > > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme From andre.mayers at usherbrooke.ca Mon Oct 20 16:34:14 2008 From: andre.mayers at usherbrooke.ca (Andre Mayers) Date: Thu Mar 26 02:31:17 2009 Subject: [plt-scheme] Re: Simple procedure building question In-Reply-To: <11abef9e-8dbb-425b-a619-e9c4bf45b7c3@n33g2000pri.googlegroups.com> References: <6f630e84-ddd7-431f-802d-7e3d1076a976@l33g2000pri.googlegroups.com> <3ee3452b-e9bf-4645-a109-f49eaf23edb0@b31g2000prb.googlegroups.com> <007901c932ee$c8a3c0f0$59eb42d0$@mayers@usherbrooke.ca> <11abef9e-8dbb-425b-a619-e9c4bf45b7c3@n33g2000pri.googlegroups.com> Message-ID: <007d01c932f3$3794cc30$a6be6490$@mayers@usherbrooke.ca> I was thinking that you want to end up with the list (f x (g x (m x (n x y)))). But if you want to eval the expression (f x (g x (m x (n x y)))) you just do (define (B lst x y) (if (null? lst) y ((car lst) x (B (cdr lst) x y)))) -----Message d'origine----- De?: plt-scheme-bounces@list.cs.brown.edu [mailto:plt-scheme-bounces@list.cs.brown.edu] De la part de blockstack Envoy??: October-20-08 4:20 PM ??: plt-scheme@list.cs.brown.edu Objet?: [plt-scheme] Re: Simple procedure building question doesn't the quote prevent the inner procedures in the else-expr from being evaluated? On Oct 20, 3:02?pm, "Andre Mayers" wrote: > (define (B lst x y) > ? (if (null? lst) > ? ? ? y > ? ? ? `(,(car lst) ,x ,(B (cdr lst) x y)))) > > -----Message d'origine----- > De?: plt-scheme-boun...@list.cs.brown.edu > [mailto:plt-scheme-boun...@list.cs.brown.edu] De la part de blockstack > Envoy??: October-20-08 3:56 PM > ??: plt-sch...@list.cs.brown.edu > Objet?: [plt-scheme] Re: Simple procedure building question > > correction: i meant to have y for the then-expr > > (define (B lst x y) > ? ? (if (null? lst) > ? ? ? ? y > ? ? ((car lst) x (B (cdr lst) x y)))) > > On Oct 20, 2:51?pm, blockstack wrote: > > > I want to be able to pass a list of function names and create a > > procedure > > lst would be something like (f g m n) where f, g, m, and n are names > > of functions > > > (define (B lst x y) > > ? ?(if (null? lst) > > ? ? ? ?x > > ? ?((car lst) x (B (cdr lst) x y)))) > > > I want to end up with a list like > > (f x (g x (m x (n x y)))) > > > I know that my current procedure won't return a list, but I know that > > it must be really simple to make it do so. > > > I've tried different ways of using 'list' and cons, but I just can't > > get it. > > any help? > > > _________________________________________________ > > ? For list-related administrative tasks: > > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme _________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-scheme From matthias at ccs.neu.edu Mon Oct 20 16:36:10 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:31:17 2009 Subject: [plt-scheme] Re: Simple procedure building question In-Reply-To: <11abef9e-8dbb-425b-a619-e9c4bf45b7c3@n33g2000pri.googlegroups.com> References: <6f630e84-ddd7-431f-802d-7e3d1076a976@l33g2000pri.googlegroups.com> <3ee3452b-e9bf-4645-a109-f49eaf23edb0@b31g2000prb.googlegroups.com> <007901c932ee$c8a3c0f0$59eb42d0$@mayers@usherbrooke.ca> <11abef9e-8dbb-425b-a619-e9c4bf45b7c3@n33g2000pri.googlegroups.com> Message-ID: <414ED92D-8C10-4B8F-9470-F7F8AFCD25D1@ccs.neu.edu> Quote in Scheme is just like apostrophe in English. I tell my sons, if you have trouble with its vs it's, don't use the latter. Expand it. Same here. -- Matthias On Oct 20, 2008, at 4:19 PM, blockstack wrote: > doesn't the quote prevent the inner procedures in the else-expr from > being evaluated? > > On Oct 20, 3:02 pm, "Andre Mayers" > wrote: >> (define (B lst x y) >> (if (null? lst) >> y >> `(,(car lst) ,x ,(B (cdr lst) x y)))) >> >> -----Message d'origine----- >> De : plt-scheme-boun...@list.cs.brown.edu >> [mailto:plt-scheme-boun...@list.cs.brown.edu] De la part de >> blockstack >> Envoy? : October-20-08 3:56 PM >> ? : plt-sch...@list.cs.brown.edu >> Objet : [plt-scheme] Re: Simple procedure building question >> >> correction: i meant to have y for the then-expr >> >> (define (B lst x y) >> (if (null? lst) >> y >> ((car lst) x (B (cdr lst) x y)))) >> >> On Oct 20, 2:51 pm, blockstack wrote: >> >>> I want to be able to pass a list of function names and create a >>> procedure >>> lst would be something like (f g m n) where f, g, m, and n are names >>> of functions >> >>> (define (B lst x y) >>> (if (null? lst) >>> x >>> ((car lst) x (B (cdr lst) x y)))) >> >>> I want to end up with a list like >>> (f x (g x (m x (n x y)))) >> >>> I know that my current procedure won't return a list, but I know >>> that >>> it must be really simple to make it do so. >> >>> I've tried different ways of using 'list' and cons, but I just can't >>> get it. >>> any help? >> >>> _________________________________________________ >>> For list-related administrative tasks: >>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From blockstack at gmail.com Mon Oct 20 17:05:48 2008 From: blockstack at gmail.com (blockstack) Date: Thu Mar 26 02:31:17 2009 Subject: [plt-scheme] Re: Simple procedure building question In-Reply-To: <007d01c932f3$3794cc30$a6be6490$@mayers@usherbrooke.ca> References: <6f630e84-ddd7-431f-802d-7e3d1076a976@l33g2000pri.googlegroups.com> <3ee3452b-e9bf-4645-a109-f49eaf23edb0@b31g2000prb.googlegroups.com> <007901c932ee$c8a3c0f0$59eb42d0$@mayers@usherbrooke.ca> <11abef9e-8dbb-425b-a619-e9c4bf45b7c3@n33g2000pri.googlegroups.com> <007d01c932f3$3794cc30$a6be6490$@mayers@usherbrooke.ca> Message-ID: <13a6bac0-95e0-47c0-9edb-6d97c1071817@i20g2000prf.googlegroups.com> I figured it out. Thanks for the help. I needed to use list instead of quote. (define (B lst x y) (if (null? lst) '(y) (cons (car lst) (cons x (list (B (cdr lst) x y)))))) On Oct 20, 3:34?pm, "Andre Mayers" wrote: > I was thinking that you want to end up with the list (f x (g x (m x (n x > y)))). > But if you want to eval the expression (f x (g x (m x (n x y)))) you just do > > (define (B lst x y) > ? (if (null? lst) > ? ? ? y > ? ? ? ((car lst) x (B (cdr lst) x y)))) > > -----Message d'origine----- > De?: plt-scheme-boun...@list.cs.brown.edu > [mailto:plt-scheme-boun...@list.cs.brown.edu] De la part de blockstack > Envoy??: October-20-08 4:20 PM > ??: plt-sch...@list.cs.brown.edu > Objet?: [plt-scheme] Re: Simple procedure building question > > doesn't the quote prevent the inner procedures in the else-expr from > being evaluated? > > On Oct 20, 3:02?pm, "Andre Mayers" > wrote: > > > (define (B lst x y) > > ? (if (null? lst) > > ? ? ? y > > ? ? ? `(,(car lst) ,x ,(B (cdr lst) x y)))) > > > -----Message d'origine----- > > De?: plt-scheme-boun...@list.cs.brown.edu > > [mailto:plt-scheme-boun...@list.cs.brown.edu] De la part de blockstack > > Envoy??: October-20-08 3:56 PM > > ??: plt-sch...@list.cs.brown.edu > > Objet?: [plt-scheme] Re: Simple procedure building question > > > correction: i meant to have y for the then-expr > > > (define (B lst x y) > > ? ? (if (null? lst) > > ? ? ? ? y > > ? ? ((car lst) x (B (cdr lst) x y)))) > > > On Oct 20, 2:51?pm, blockstack wrote: > > > > I want to be able to pass a list of function names and create a > > > procedure > > > lst would be something like (f g m n) where f, g, m, and n are names > > > of functions > > > > (define (B lst x y) > > > ? ?(if (null? lst) > > > ? ? ? ?x > > > ? ?((car lst) x (B (cdr lst) x y)))) > > > > I want to end up with a list like > > > (f x (g x (m x (n x y)))) > > > > I know that my current procedure won't return a list, but I know that > > > it must be really simple to make it do so. > > > > I've tried different ways of using 'list' and cons, but I just can't > > > get it. > > > any help? > > > > _________________________________________________ > > > ? For list-related administrative tasks: > > > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > > _________________________________________________ > > ? For list-related administrative tasks: > > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > > _________________________________________________ > > ? For list-related administrative tasks: > > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme From matthias at ccs.neu.edu Mon Oct 20 17:55:58 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:31:17 2009 Subject: [plt-scheme] Re: Simple procedure building question In-Reply-To: <13a6bac0-95e0-47c0-9edb-6d97c1071817@i20g2000prf.googlegroups.com> References: <6f630e84-ddd7-431f-802d-7e3d1076a976@l33g2000pri.googlegroups.com> <3ee3452b-e9bf-4645-a109-f49eaf23edb0@b31g2000prb.googlegroups.com> <007901c932ee$c8a3c0f0$59eb42d0$@mayers@usherbrooke.ca> <11abef9e-8dbb-425b-a619-e9c4bf45b7c3@n33g2000pri.googlegroups.com> <007d01c932f3$3794cc30$a6be6490$@mayers@usherbrooke.ca> <13a6bac0-95e0-47c0-9edb-6d97c1071817@i20g2000prf.googlegroups.com> Message-ID: Unless I am reading this backwards, don't use quote. On Oct 20, 2008, at 5:05 PM, blockstack wrote: > I figured it out. Thanks for the help. > I needed to use list instead of quote. > > (define (B lst x y) > (if (null? lst) > '(y) > (cons (car lst) (cons x (list (B (cdr lst) x y)))))) > > On Oct 20, 3:34 pm, "Andre Mayers" > wrote: >> I was thinking that you want to end up with the list (f x (g x (m >> x (n x >> y)))). >> But if you want to eval the expression (f x (g x (m x (n x y)))) >> you just do >> >> (define (B lst x y) >> (if (null? lst) >> y >> ((car lst) x (B (cdr lst) x y)))) >> >> -----Message d'origine----- >> De : plt-scheme-boun...@list.cs.brown.edu >> [mailto:plt-scheme-boun...@list.cs.brown.edu] De la part de >> blockstack >> Envoy? : October-20-08 4:20 PM >> ? : plt-sch...@list.cs.brown.edu >> Objet : [plt-scheme] Re: Simple procedure building question >> >> doesn't the quote prevent the inner procedures in the else-expr from >> being evaluated? >> >> On Oct 20, 3:02 pm, "Andre Mayers" >> wrote: >> >>> (define (B lst x y) >>> (if (null? lst) >>> y >>> `(,(car lst) ,x ,(B (cdr lst) x y)))) >> >>> -----Message d'origine----- >>> De : plt-scheme-boun...@list.cs.brown.edu >>> [mailto:plt-scheme-boun...@list.cs.brown.edu] De la part de >>> blockstack >>> Envoy? : October-20-08 3:56 PM >>> ? : plt-sch...@list.cs.brown.edu >>> Objet : [plt-scheme] Re: Simple procedure building question >> >>> correction: i meant to have y for the then-expr >> >>> (define (B lst x y) >>> (if (null? lst) >>> y >>> ((car lst) x (B (cdr lst) x y)))) >> >>> On Oct 20, 2:51 pm, blockstack wrote: >> >>>> I want to be able to pass a list of function names and create a >>>> procedure >>>> lst would be something like (f g m n) where f, g, m, and n are >>>> names >>>> of functions >> >>>> (define (B lst x y) >>>> (if (null? lst) >>>> x >>>> ((car lst) x (B (cdr lst) x y)))) >> >>>> I want to end up with a list like >>>> (f x (g x (m x (n x y)))) >> >>>> I know that my current procedure won't return a list, but I know >>>> that >>>> it must be really simple to make it do so. >> >>>> I've tried different ways of using 'list' and cons, but I just >>>> can't >>>> get it. >>>> any help? >> >>>> _________________________________________________ >>>> For list-related administrative tasks: >>>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >>> _________________________________________________ >>> For list-related administrative tasks: >>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >>> _________________________________________________ >>> For list-related administrative tasks: >>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> _________________________________________________ >> 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 pltscheme at pnkfx.org Mon Oct 20 18:13:39 2008 From: pltscheme at pnkfx.org (Felix Klock's PLT scheme proxy) Date: Thu Mar 26 02:31:17 2009 Subject: [plt-scheme] Re: adventure game code ported to PLT 4 ? In-Reply-To: <3C863565-D236-42A4-8116-FC608B51006B@pnkfx.org> References: <72ef860f0810191810p47ba4c76i78b44bae4fa7b859@mail.gmail.com> <72ef860f0810191924j63add3d8sa9779c190d7addef@mail.gmail.com> <3C863565-D236-42A4-8116-FC608B51006B@pnkfx.org> Message-ID: <8099274A-F181-41A4-9912-58CE8C4CFBF9@pnkfx.org> On Oct 20, 2008, at 8:45 AM, Felix Klock's PLT scheme proxy wrote: > > On Oct 20, 2008, at 4:12 AM, Noel Welsh wrote: > >> On Mon, Oct 20, 2008 at 3:24 AM, Fred G. Martin >> wrote: >>> Well, this was actually pretty easy, with one exception... the >>> "show" procedure. >>> >>> It seems to use MIT Scheme-specific features (environment->package, >>> fluid-let, environment-bindings)... Is this portable to PLT? >> >> Look at namespaces and parameters for the PLT equivalent (well, >> nearest match). > > Its probably going to need more than that; it looks to me like that > selectors like procedure-environment are extracting the lexical > environment that procedure objects are closed over. Namespaces > model global environments; I do not know if PLT has anything for > reifying the local bindings. > > However, it also looks to me like the show procedure may only be > there for, mmm, "debugging" purposes? (Or at least for easy > interactive inspection of "object" structure at the REPL; the point > is, show is not called from game.scm or world.scm...) I was inspired this morning to try to hack up an approximation of this. After some messing around (trying to do the hard stuff myself), SamTH pointed me at the key. (I asked him "how do I get the free variables of locally expanded code" and he said "Use free-vars from syntax/free-vars; look in the Help Desk.") Fred: in particular, you may be able to adapt this to get similar inspection routines of the "objects" in the Adventure Game code, although I do not immediately see a "good" way to extract the implicit environment frame structure. Enjoy! (Sorry that the documentation is longer than the code!) -Felix #lang scheme #| This code is a big ol' hack to emulate MIT Scheme's ability to inspect the lexical environment of procedure objects. One big distinction is that it only allows you to inspect the free lexical variables of procedures defined via the LAMBDA/INSPECTABLE form (defined below); you cannot use it to inspect arbitrary closures generated from other code. (Felix does not think PLT offers an interface to get at that information, justifiably so.) Another big distinction between this and the environment objects of MIT Scheme is that this currently does not tell you anything about the frame structure; all of the free (but lexically bound) variables of a lambda/inspectable expression are given equal treatment, as opposed to giving the client the ability to observe how many frames up a free variable is bound. Also, on a related note, only referenced variables of a lambda/inspectable expression are captured, *not* all "available" variables. E.g. x is not free in: (lambda () 3) so the implicit environment [x := 5] is not captured by ((lambda (x) (lambda/inspectable () 3)) 5) even though it is captured by ((lambda (x) (lambda/inspectable () x)) 5) Finally, this code exposes the free variables as symbols rather than identifier objects, with the obvious ambiguity problems. Sorry; I went with "Worse is Better" here. Example usage: > (define g (lambda/inspectable (x) (lambda/inspectable (y) (+ x y)))) > (define add3 (g 3)) > (define add7 (g 7)) > (add3 10) 13 > (add7 10) 17 > (procedure? g) #t > (procedure? add3) #t > (annotated-proc? g) #t > (annotated-proc-free-vars g) () > (annotated-proc-free-vars add3) (x) > (annotated-proc-free-vars add7) (x) > ((annotated-proc-var-ref add3) 'x) 3 > ((annotated-proc-var-ref add7) 'x) 7 |# (require (for-syntax syntax/free-vars)) (define-struct annotated-proc (base free-vars var-ref) #:property prop:procedure (struct-field-index base)) (define-syntax lambda/inspectable (lambda (stx) (syntax-case stx () ((_ ARGL BODY ...) (let* ((free-vars (lambda (stx) (call-with-values (lambda () (syntax-local-expand-expression stx)) (lambda (expanded opaque) (free-vars expanded))))) (fv (free-vars #'(lambda ARGL BODY ...))) (var-symbols (map syntax->datum fv)) (var-syntaxs fv)) #`(let* ((clos (lambda ARGL BODY ...)) (names (quote #,var-symbols)) (entries (list #,@(map (lambda (var-sym var-stx) #`(list (quote #,var-sym) (lambda () #,var-stx))) var-symbols var-syntaxs)))) (make-annotated-proc clos names (lambda (var) ((cadr (assoc var entries))))))))))) From mvanier at cs.caltech.edu Mon Oct 20 19:35:53 2008 From: mvanier at cs.caltech.edu (Michael Vanier) Date: Thu Mar 26 02:31:18 2009 Subject: [plt-scheme] Using a teachpack from the module language level In-Reply-To: References: <48FC2933.1050908@cs.caltech.edu> Message-ID: <48FD15D9.9000809@cs.caltech.edu> Matthias Felleisen wrote: > > > On Oct 20, 2008, at 2:46 AM, Michael Vanier wrote: > >> Hi everyone, >> >> Apologies if this has been answered before, but is it possible to use >> one of the teaching language teachpacks from the module language >> level, and if so, how do you do it? > > > If you want to use the world teachpack, for example, > > #lang scheme > (require htdp/world) > > will work. -- Matthias > Great! It's nice when things work the way you expect ;-) Mike From dyoo at cs.wpi.edu Mon Oct 20 23:07:17 2008 From: dyoo at cs.wpi.edu (Danny Yoo) Date: Thu Mar 26 02:31:18 2009 Subject: [plt-scheme] begin-for-syntax in beginner-level Message-ID: I'm trying to write a macro that introduces a begin-for-syntax to maintain compile-time registration information. Here's a simplification of the situation I'm seeing: imagine a 'reg' form that remembers identifiers that we pass to it. ;;; #lang scheme/base (require (for-syntax scheme/base)) (begin-for-syntax (define names '())) (define-for-syntax (register! name-stx) (set! names (cons name-stx names))) ;; Registers a new thing. (define-syntax (reg stx) (syntax-case stx () [(_ a-name) (syntax/loc stx (begin (begin-for-syntax (register! #'a-name)) a-name))])) ;; prints out all registered things (define-syntax (print-regs stx) (syntax-case stx () [(_) (with-syntax ([(names ...) names]) (syntax/loc stx (begin (display (quote (names ...))) (newline))))])) (provide reg print-regs) ;;; When I try to use this in a program in Module language, this seems to work ok. Under Beginner Language, the context appears not to allow this. Here's the program in Beginner Language level: ;;; (require "test.ss") (define x 42) (reg x) (print-regs) ;;; I see the following error messsage when I try checking this for syntax. define-values-for-syntax: illegal use (not at top-level) in: (define-values-for-syntax () (begin (#%app register! (syntax x)) (values))) I suspect that Beginner Level is introducing a layer of syntax that prevents me from injecting something via begin-for-syntax. I can work around this by using let-syntax: (define-syntax (reg stx) (syntax-case stx () [(_ a-name) (syntax/loc stx (begin (let-syntax ([foo (lambda (stx-2) (register! #'a-name) (syntax/loc stx-2 (void)))]) (foo) a-name)))])) but I was wondering if I'm interpreting the error message correctly, and if my workaround is sound. Thanks for any help! From rflug05 at gmail.com Mon Oct 20 23:28:43 2008 From: rflug05 at gmail.com (Nick Allen) Date: Thu Mar 26 02:31:18 2009 Subject: [plt-scheme] Scheme/Functional programming event Saturday, October 25th in Bangalore Message-ID: There will be a small Scheme/Functional programming event at 2pm on Saturday, October 25th in Bangalore. The program is intended to give an introduction to functional programing and Scheme, as well as provide forum for the creation of a regular Scheme/Functional group in Bangalore. Program: 2:00 PM: An Incomplete Introduction to Functional Programming. [Nick Allen] 2:30 PM: Short break for QA, discussions and refreshments. 2:45 PM: Building abstractions in Scheme. [Vijay Mathew] 3:15 PM: QA, parting remarks. Venue: DIGIBEE MOBILE LTD. #7,1st Main Road, Domlur 2nd Stage, Indiranagar, Bangalore ? 560071, Tel: +91 80 41482345/46/47, Fax: + 91 80 41155912. All who are interested are warmly invited to attend this first session. Please RSVP to "nallen05" ++ "at" ++ "gmail.com" so we have a general idea how many people are coming. Cheers! Nick and Vijay From jos.koot at telefonica.net Tue Oct 21 06:45:27 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:31:18 2009 Subject: [plt-scheme] begin-for-syntax in beginner-level References: Message-ID: <944E202D160740F89C1813623179AE0C@uw2b2dff239c4d> Do you mean? ;; Registers a new thing. (define-syntax (reg stx) (syntax-case stx () [(_ a-name) (begin (register! #'a-name) (syntax/loc stx 'a-name))])) Jos ----- Original Message ----- From: "Danny Yoo" To: "PLT-list" Sent: Tuesday, October 21, 2008 5:07 AM Subject: [plt-scheme] begin-for-syntax in beginner-level > I'm trying to write a macro that introduces a begin-for-syntax to > maintain compile-time registration information. Here's a > simplification of the situation I'm seeing: imagine a 'reg' form that > remembers identifiers that we pass to it. > > ;;; > #lang scheme/base > (require (for-syntax scheme/base)) > > (begin-for-syntax > (define names '())) > > (define-for-syntax (register! name-stx) > (set! names (cons name-stx names))) > > ;; Registers a new thing. > (define-syntax (reg stx) > (syntax-case stx () > [(_ a-name) > (syntax/loc stx > (begin > (begin-for-syntax > (register! #'a-name)) > a-name))])) > > ;; prints out all registered things > (define-syntax (print-regs stx) > (syntax-case stx () > [(_) > (with-syntax ([(names ...) names]) > (syntax/loc stx > (begin (display (quote (names ...))) > (newline))))])) > > (provide reg print-regs) > ;;; > > > When I try to use this in a program in Module language, this seems to > work ok. Under Beginner Language, the context appears not to allow > this. Here's the program in Beginner Language level: > > ;;; > (require "test.ss") > (define x 42) > (reg x) > (print-regs) > ;;; > > I see the following error messsage when I try checking this for syntax. > > define-values-for-syntax: illegal use (not at top-level) in: > (define-values-for-syntax () (begin (#%app register! (syntax x)) > (values))) > > > I suspect that Beginner Level is introducing a layer of syntax that > prevents me from injecting something via begin-for-syntax. I can work > around this by using let-syntax: > > (define-syntax (reg stx) > (syntax-case stx () > [(_ a-name) > (syntax/loc stx > (begin > (let-syntax ([foo (lambda (stx-2) > (register! #'a-name) > (syntax/loc stx-2 (void)))]) > (foo) > a-name)))])) > > but I was wondering if I'm interpreting the error message correctly, > and if my workaround is sound. > > > Thanks for any help! > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From mflatt at cs.utah.edu Tue Oct 21 07:26:50 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:31:18 2009 Subject: [plt-scheme] begin-for-syntax in beginner-level In-Reply-To: References: Message-ID: <20081021112702.660C2650085@mail-svr1.cs.utah.edu> At Mon, 20 Oct 2008 23:07:17 -0400, "Danny Yoo" wrote: > I suspect that Beginner Level is introducing a layer of syntax that > prevents me from injecting something via begin-for-syntax. Right --- fixed in SVN. Matthew From maurizio.ferreira at seling.it Tue Oct 21 05:38:08 2008 From: maurizio.ferreira at seling.it (Ferreira Maurizio) Date: Thu Mar 26 02:31:18 2009 Subject: [plt-scheme] Puzzled by procedure ordering. Message-ID: <863055B715B9D04CB4320CFCDEE0837FF8E480@mailing.selesta.it> In the following example, the procedure "Work" has no problem in 'seeing the procedure "genproc". However if I move the procedure in the indicated place, Drscheme complains with the following error: reference to an identifier before its definition: work Any explanation ? Regards Maurizio #lang scheme/gui (define (work x y) (let ((fun (genproc 3))) (display (fun 5)))) (define (genproc n) (lambda (x) (+ x n))) (define frame (new frame% [label "test"])) (define btok (new button% [parent frame] [label "ok"] [callback work])) ;; ---- move work here and get an error. (send frame show #t) From cce at ccs.neu.edu Tue Oct 21 08:33:14 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:31:19 2009 Subject: [plt-scheme] Puzzled by procedure ordering. In-Reply-To: <863055B715B9D04CB4320CFCDEE0837FF8E480@mailing.selesta.it> References: <863055B715B9D04CB4320CFCDEE0837FF8E480@mailing.selesta.it> Message-ID: <990e0c030810210533l16230447kadd3f538529c286@mail.gmail.com> It's ok to write a forward reference, so long as it doesn't actually run until the variable has been defined. When you refer to genproc in work, you aren't actually running it yet, so there's no problem. Once you define genproc, all the references are defined and it's safe to run either procedure. When you move work below btok, the reference to work in [callback work] gets run before the definition of work. Now you have a problem; the callback you're passing to btok hasn't been defined yet. In general, you can define procedures in any order you like, but you can't (safely) call a procedure until all its dependencies have been defined. I hope this helps clarify the issue. On Tue, Oct 21, 2008 at 5:38 AM, Ferreira Maurizio wrote: > In the following example, the procedure "Work" has no problem > in 'seeing the procedure "genproc". > However if I move the procedure in the indicated place, > Drscheme complains with the following error: > > reference to an identifier before its definition: work > > Any explanation ? > > Regards > Maurizio > > #lang scheme/gui > > (define (work x y) > (let ((fun (genproc 3))) > (display (fun 5)))) > > (define (genproc n) > (lambda (x) (+ x n))) > > (define frame (new frame% [label "test"])) > (define btok (new button% [parent frame] [label "ok"] [callback work])) > > ;; ---- move work here and get an error. > > (send frame show #t) -- Carl Eastlund From gherson at snet.net Tue Oct 21 10:09:00 2008 From: gherson at snet.net (George Herson) Date: Thu Mar 26 02:31:19 2009 Subject: [plt-scheme] More document (newbie) Message-ID: <295289.51556.qm@web81304.mail.mud.yahoo.com> Hi, Penultimate paragraph of http://docs.plt-scheme.org/quick/index.html (kudos on Quick, by the way) is "To continue touring PLT Scheme, but from a systems-oriented perspective instead of pictures, your next stop is More: Systems Programming with PLT Scheme." What planet are you guys from? PLaneT? Seriously, I'm a long time full time programmer who's been "touring" PLT Scheme for years and the More document is way over my head. There has to be a better way to introduce things like parameterize (section 7 of 12, not "the last couple of sections [that are] considered difficult") into a newbie tutorial. When you teach students the items therein, what are their questions? Can your answers be incorporated into documents like this one? With a great, free IDE like DrScheme, the only reason it isn't used more is the perception (or maybe its the reality) that the capabilities on offer aren't worth the time it takes to competently wield them. The learning curve must be flattened, either by simplifying the language or improving its presentation, IMHO. thank you, George From matthias at ccs.neu.edu Tue Oct 21 10:23:47 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:31:19 2009 Subject: [plt-scheme] More document (newbie) In-Reply-To: <295289.51556.qm@web81304.mail.mud.yahoo.com> References: <295289.51556.qm@web81304.mail.mud.yahoo.com> Message-ID: <412819D5-5E47-47A2-BEE1-5376AF963AEC@ccs.neu.edu> Thanks for your honest feedback. We don't use More with students, and it obviously shows. So I guess it's time for us to go back to the drawing board. -- Matthias On Oct 21, 2008, at 10:09 AM, George Herson wrote: > Hi, > > Penultimate paragraph of http://docs.plt-scheme.org/quick/ > index.html (kudos on Quick, by the way) is "To continue touring PLT > Scheme, but from a systems-oriented > perspective instead of pictures, your next stop is More: Systems > Programming with PLT Scheme." What planet are you guys from? > PLaneT? Seriously, I'm a long time full time programmer who's been > "touring" PLT Scheme for years and the More document is way over my > head. There has to be a better way to introduce things like > parameterize (section 7 of 12, not "the last couple of sections > [that are] considered difficult") into a newbie tutorial. When you > teach students the items therein, what are their questions? Can > your answers be incorporated into documents like this one? > > With a great, free IDE like DrScheme, the only reason it isn't used > more is the perception (or maybe its the reality) that the > capabilities on offer aren't worth the time it takes to competently > wield them. The learning curve must be flattened, either by > simplifying the language or improving its presentation, IMHO. > > thank you, > George > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From morazanm at gmail.com Tue Oct 21 11:14:45 2008 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:31:19 2009 Subject: [plt-scheme] DrScheme quote in Latex? Message-ID: <9b1fff280810210814h598ad8edt3941f8d7140b1976@mail.gmail.com> Dear All, How can I get Latex (i.e. Miktex using WinEdt) to print DrScheme's (straight) ' instead of a curly quote? Verbatim and $'$ don't quite work although $'$ is closer than anything else I have tried. Your kind pointers are much appreciated. -- Cheers, Marco From david.vanderson at gmail.com Tue Oct 21 12:59:59 2008 From: david.vanderson at gmail.com (David Vanderson) Date: Thu Mar 26 02:31:19 2009 Subject: [plt-scheme] More document (newbie) In-Reply-To: <412819D5-5E47-47A2-BEE1-5376AF963AEC@ccs.neu.edu> References: <295289.51556.qm@web81304.mail.mud.yahoo.com> <412819D5-5E47-47A2-BEE1-5376AF963AEC@ccs.neu.edu> Message-ID: <48FE0A8F.6020701@gmail.com> Matthias Felleisen wrote: > > Thanks for your honest feedback. We don't use More with students, and it > obviously shows. So I guess it's time for us to go back to the drawing > board. -- Matthias > > Even though More was over my head as well (I'm sure it can be improved), it was inspiring to see a showcase of PLT Scheme's power in a domain that resonates with application developers (webapps). It motivated me to seriously work through Htdp, as well as read the PLT papers referenced. I wanted to thank everyone in PLT for the immense effort that has and is being poured into documentation. Thank you! Dave From raould at gmail.com Tue Oct 21 13:04:52 2008 From: raould at gmail.com (Raoul Duke) Date: Thu Mar 26 02:31:19 2009 Subject: [plt-scheme] More document (newbie) In-Reply-To: <48FE0A8F.6020701@gmail.com> References: <295289.51556.qm@web81304.mail.mud.yahoo.com> <412819D5-5E47-47A2-BEE1-5376AF963AEC@ccs.neu.edu> <48FE0A8F.6020701@gmail.com> Message-ID: <91a2ba3e0810211004y7a7f5e61s16cfedde1aa2cf0f@mail.gmail.com> > I wanted to thank everyone in PLT for the immense effort that has and is > being poured into documentation. even though i've had some issues with PLT docs, mostly as a result of my local minima as a specific type of user, i have to say the fact that there are docs at all and of such detail is a zillion times better than cough cough certain other Scheme implementations i have tried to look at and experiment with and learn. (and by "certain" i seem to mean "everything not PLT" :-) so another thanks from a struggling newbie-ish. From deepankar.sharma at gmail.com Tue Oct 21 13:19:49 2008 From: deepankar.sharma at gmail.com (Deep) Date: Thu Mar 26 02:31:19 2009 Subject: [plt-scheme] Profiling code Message-ID: <54649e8e-ec42-484f-9d3d-7316afdeb8a9@q9g2000hsb.googlegroups.com> My game prototype in DrScheme is now feature complete and I would like to optimise it to make things run faster. The inbuilt profiler is wonderfully well integrated and has already helped me remove some bottlenecks. However there are a few functions in my code that get called very often and have a very small execution time. I want to know if there is an additional cost in terms of "function call overhead" that exists for functions beyond their actual execution time. On a more general note, I wanted to know how I can observe what my code is doing at a slightly lower level of detail. Things I would be interested in 1) How much memory is being consed. 2) When does GC get invoked. 3) What kind of assembly code is getting generated for my functions. 4) Am I hitting some inefficient execution paths with DrScheme. Any pointers if this is possible at all ? From deepankar.sharma at gmail.com Tue Oct 21 13:39:14 2008 From: deepankar.sharma at gmail.com (Deep) Date: Thu Mar 26 02:31:20 2009 Subject: [plt-scheme] Re: More document (newbie) In-Reply-To: <91a2ba3e0810211004y7a7f5e61s16cfedde1aa2cf0f@mail.gmail.com> References: <295289.51556.qm@web81304.mail.mud.yahoo.com> <412819D5-5E47-47A2-BEE1-5376AF963AEC@ccs.neu.edu> <48FE0A8F.6020701@gmail.com> <91a2ba3e0810211004y7a7f5e61s16cfedde1aa2cf0f@mail.gmail.com> Message-ID: <0c80beab-da8d-4f9c-a1c9-11375f987f7e@m32g2000hsf.googlegroups.com> I second the "I wanted to thank everyone in PLT for the immense effort that has and is being poured into documentation. " DrScheme seems to be the onlyh lisp implmentation where i dont feel that one of my arms is tied behind my back. The documentation is incredibly detailed and very educational. On Oct 21, 1:04?pm, "Raoul Duke" wrote: > > I wanted to thank everyone in PLT for the immense effort that has and is > > being poured into documentation. > > even though i've had some issues with PLT docs, mostly as a result of > my local minima as a specific type of user, i have to say the fact > that there are docs at all and of such detail is a zillion times > better than cough cough certain other Scheme implementations i have > tried to look at and experiment with and learn. (and by "certain" i > seem to mean "everything not PLT" :-) > > so another thanks from a struggling newbie-ish. > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme From marek at xivilization.net Tue Oct 21 14:24:44 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:31:20 2009 Subject: [plt-scheme] More document (newbie) In-Reply-To: <295289.51556.qm@web81304.mail.mud.yahoo.com> References: <295289.51556.qm@web81304.mail.mud.yahoo.com> Message-ID: <20081021202444.1a6d8480@halmanfloyd.lan.local> Hi, On Tue, 21 Oct 2008 07:09:00 -0700 (PDT) George Herson wrote: > With a great, free IDE like DrScheme, the only reason it isn't used > more is the perception (or maybe its the reality) that the > capabilities on offer aren't worth the time it takes to competently > wield them. Uh, yeah, I believe that in some years, when I have sharpened my Scheme skills, I'll be able to cut through metal, walls of concrete and Java code :) I haven't yet read More, I'm currently on my way through Continue and progressing every night some little steps. So far it has been quite enjoyable, since I have never used continuations (I'm coming from languages that usually don't support continuations) I begin to understand what one can do with them. The only thing that has been non-intuitive was the contracts-stuff. I tried playing with contracts, but haven't found a way to validate a data structure against a contract in the REPL. So I have skipped that part. regards, Marek From robby at cs.uchicago.edu Tue Oct 21 17:24:29 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:31:20 2009 Subject: [plt-scheme] More document (newbie) In-Reply-To: <20081021202444.1a6d8480@halmanfloyd.lan.local> References: <295289.51556.qm@web81304.mail.mud.yahoo.com> <20081021202444.1a6d8480@halmanfloyd.lan.local> Message-ID: <932b2f1f0810211424k1b66afafh6f3b9315299d4a47@mail.gmail.com> On Tue, Oct 21, 2008 at 1:24 PM, Marek Kubica wrote: > The only thing that has been non-intuitive was the contracts-stuff. I > tried playing with contracts, but haven't found a way to validate a > data structure against a contract in the REPL. So I have skipped that > part. I've added something to the guide about this. The below is the new text. hth, Robby All of the contracts and module in this chapter (excluding those just following) are written using the standard #lang syntax for describing modules. Thus, if you extract examples from this chapter in order to experiment with the behavior of the contract system, you would have to make multiple files. To rectify this, PLT Scheme provides a special language, called scheme/load. The contents of such a module is other modules (and require statements), using the parenthesized syntax for a module. For example, to try the example earlier in this section, you would write: #lang scheme/load (module m scheme (define amount 150) (provide/contract [amount (and/c number? positive?)])) (module n scheme (require 'm) (+ amount 10)) (require 'n) Each of the modules and their contracts are wrapped in parenthesis with the module keyword at the front. The first argument to module should be the name of the module, so it can be used in a subsequent require statement (note that in the require, the name of the module must be prefixed with a quote). The second argument to module is the language (what would have come lang #lang in the usual notation), and the remaining arguments are the body of the module. After all of the modules, there must a require to kick things off. From marek at xivilization.net Tue Oct 21 17:36:55 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:31:20 2009 Subject: [plt-scheme] More document (newbie) In-Reply-To: <932b2f1f0810211424k1b66afafh6f3b9315299d4a47@mail.gmail.com> References: <295289.51556.qm@web81304.mail.mud.yahoo.com> <20081021202444.1a6d8480@halmanfloyd.lan.local> <932b2f1f0810211424k1b66afafh6f3b9315299d4a47@mail.gmail.com> Message-ID: <20081021233655.543ec97e@halmanfloyd.lan.local> On Tue, 21 Oct 2008 16:24:29 -0500 "Robby Findler" wrote: > On Tue, Oct 21, 2008 at 1:24 PM, Marek Kubica > wrote: > > The only thing that has been non-intuitive was the contracts-stuff. > > I tried playing with contracts, but haven't found a way to validate > > a data structure against a contract in the REPL. So I have skipped > > that part. > > I've added something to the guide about this. The below is the new > text. Ok, this makes stuff more understandable, thanks a lot! The only way I was able to test contracs was to create a module and run it, but of course the possibility to play with it in the REPL is way more convenient; especially for learning/understanding. regards, Marek From cobbe at ccs.neu.edu Tue Oct 21 17:40:42 2008 From: cobbe at ccs.neu.edu (Richard Cobbe) Date: Thu Mar 26 02:31:20 2009 Subject: [plt-scheme] DrScheme quote in Latex? In-Reply-To: <9b1fff280810210814h598ad8edt3941f8d7140b1976@mail.gmail.com> References: <9b1fff280810210814h598ad8edt3941f8d7140b1976@mail.gmail.com> Message-ID: <20081021214042.GB793@angua.local> On Tue, Oct 21, 2008 at 11:14:45AM -0400, Marco Morazan wrote: > Dear All, > > How can I get Latex (i.e. Miktex using WinEdt) to print DrScheme's > (straight) ' instead of a curly quote? Verbatim and $'$ don't quite > work although $'$ is closer than anything else I have tried. This is purely a font issue; you'll need to find a font for use with Mictex that contains that particular rendering of the ' character. From cobbe at ccs.neu.edu Tue Oct 21 17:44:43 2008 From: cobbe at ccs.neu.edu (Richard Cobbe) Date: Thu Mar 26 02:31:21 2009 Subject: [plt-scheme] DrScheme quote in Latex? In-Reply-To: <20081021214042.GB793@angua.local> References: <9b1fff280810210814h598ad8edt3941f8d7140b1976@mail.gmail.com> <20081021214042.GB793@angua.local> Message-ID: <20081021214443.GC793@angua.local> On Tue, Oct 21, 2008 at 05:40:42PM -0400, Richard Cobbe wrote: > On Tue, Oct 21, 2008 at 11:14:45AM -0400, Marco Morazan wrote: > > Dear All, > > > > How can I get Latex (i.e. Miktex using WinEdt) to print DrScheme's > > (straight) ' instead of a curly quote? Verbatim and $'$ don't quite > > work although $'$ is closer than anything else I have tried. > > This is purely a font issue; you'll need to find a font for use with Mictex > that contains that particular rendering of the ' character. Sorry, hit "send" too soon. Short answer that isn't guaranteed to work: change your monospaced font by putting \usepackage{courier} in the preamble; that'll get you straight single quote marks. If that doesn't work, or for further information, I'd strongly recommend checking out a TeX discussion forum. The newsgroup comp.text.tex is a good place to start, and I'd bet there are Miktex-specific mailing lists or web fora or something as well. HTH, Richard From robby at cs.uchicago.edu Tue Oct 21 19:04:51 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:31:21 2009 Subject: [plt-scheme] Usability: delete whole line in DrScheme In-Reply-To: <20081020092939.31fa9612@halmanfloyd.lan.local> References: <20081020092939.31fa9612@halmanfloyd.lan.local> Message-ID: <932b2f1f0810211604w18d8d1c6jf3d307bedfddaa89@mail.gmail.com> I've been asked for this one for years and ... well, its finally time to do it. Anyways, I've added something in to SVN to make control-a and the home key respect the prompt in the interactions window. It isn't quite right, tho, since the level I added it doesn't have access to the proper selection extension information, but it should work well for what you describe below. Robby On Mon, Oct 20, 2008 at 2:29 AM, Marek Kubica wrote: > Hi, > > I hope it's okay when I post some more usability things to the list. My > last suggestion was implemented very fast and it has improved the > usability for me quite a lot. > > In this mail I'll talk about deleting the whole line in the DrScheme > interactions window/REPL. The problem occurs, when trying to delete a > lne from an arbitary position to the beginning of the line. Most of the > time I use Shift-Home to select from the current position to the > beginning of the line and delete using backspace. As it turns out, this > doesn't work in DrScheme, because there is the > prompt which gets > selected but cannot be deleted. So you have to unselect it and the > following space to delete the line. > > My proposal would be either to make it deletable if at least one > character of the selection is code (if nothing is selected, it should > stay as is and if someone selects the prompt and the space, it > shouldn't be deletable either) and then immediatele re-insert it (or > never delete it really) or make Home go only to the position after the > space, so the prompt won't get selected. > > regards, > Marek > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From jpc-ml at zenburn.net Tue Oct 21 19:32:10 2008 From: jpc-ml at zenburn.net (=?UTF-8?B?SmFrdWIgUGlvdHIgQ8WCYXBh?=) Date: Thu Mar 26 02:31:21 2009 Subject: [OT] Re: [plt-scheme] DrScheme quote in Latex? In-Reply-To: <9b1fff280810210814h598ad8edt3941f8d7140b1976@mail.gmail.com> References: <9b1fff280810210814h598ad8edt3941f8d7140b1976@mail.gmail.com> Message-ID: <48FE667A.4050205@zenburn.net> Marco Morazan wrote: > Dear All, > > How can I get Latex (i.e. Miktex using WinEdt) to print DrScheme's > (straight) ' instead of a curly quote? Verbatim and $'$ don't quite > work although $'$ is closer than anything else I have tried. Apart from the font change solution from Richard (which is IMHO the best way but may be not the easiest if you don't find a good existing font) you could try (especially if you use pdf(la)tex) to use tikz and draw the quote mark yourself. I've done this once to draw my own symbol when breaking long lines in listings. \usepackage{tikz} \newcommand{\br}{\tikz[baseline=-1.5ex] \draw[rounded corners=.3ex,->] (0ex,0ex) -- (0ex,-1.2ex) -- (-1.1ex,-1.2ex);} OTOH I don't know how difficult would it be to plug this as a default handler for ' so you wouldn't have to replace ' with \q (or some other command) everywhere. -- regards, Jakub Piotr C?apa From grettke at acm.org Tue Oct 21 20:47:30 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:31:21 2009 Subject: [plt-scheme] Usability: delete whole line in DrScheme In-Reply-To: <932b2f1f0810211604w18d8d1c6jf3d307bedfddaa89@mail.gmail.com> References: <20081020092939.31fa9612@halmanfloyd.lan.local> <932b2f1f0810211604w18d8d1c6jf3d307bedfddaa89@mail.gmail.com> Message-ID: <756daca50810211747u5fb1670ej558d4eccce731b9a@mail.gmail.com> On Tue, Oct 21, 2008 at 6:04 PM, Robby Findler wrote: > I've been asked for this one for years and ... well, its finally time to do it. Thanks. From esmith at acanac.net Tue Oct 21 21:09:40 2008 From: esmith at acanac.net (Ernie Smith) Date: Thu Mar 26 02:31:21 2009 Subject: [plt-scheme] More document (newbie) In-Reply-To: <295289.51556.qm@web81304.mail.mud.yahoo.com> References: <295289.51556.qm@web81304.mail.mud.yahoo.com> Message-ID: <48FE7D54.40701@acanac.net> Simplifying the language?? That would be a challenge. I don't think languages get much simpler. The only bloat, if any, can be attributed to that double edged sword standardization. The problem I find with getting up to speed isn't the language at all. It's me. 25 years of bloated languages addles the brain. Maybe you are experiencing something similar. Try not to think in terms of what you already know, come at it fresh. It's the unlearning curve that needs flattening. From eko.hermiyanto at gmail.com Wed Oct 22 04:03:31 2008 From: eko.hermiyanto at gmail.com (eko hermiyanto) Date: Thu Mar 26 02:31:21 2009 Subject: [plt-scheme] On MRED questions Message-ID: Dear PLT Schemers, 1. In DRScheme, there are four buttons which so beautiful; debug button, check syntax button, run button, and stop button. I am not quite sure whether they are button% because there is no such style for button. Are they in fact just merely button% or are they other widget? Or perhaps, they are button% but using techniques which are explained on drawing and editor toolbox sections on the MRED manual? I am very sorry because it is my second days of my MRED learning, and I am not yet read those sections of the manual. 2. Below menubar, there are two choice-like widgets. But, they are more beautiful than choice%. What is the name of the widget? 3. Is there any standard icon in DRScheme which I can use? For example a floppy disk icon to be used on a button with the purpose to save a file. 4. How to create horizontal line in frame? For example I want to make a frame, the top one for viewing a given data, and the bottom one to edit the data. And I want to create separation line between them, is it possible? I have tried to emulate such line using message% with label "----" but the result is extremelly ugly. 5. For example, I want to create several text-field% vertically in the same vertical panel. Because the labels of those text-field% are different in length, the field of those text-field% are not vertically in line. I have tried to emulate with giving more spaces on the labels, and so far, it is work good enough. Nevertheless, is there a way to do that without giving more spaces on the label? 6. I want to create a message% with bold label. I know I must create font% object in order to manipulate the label to be bold. I have tried to create the font% object with instantiate and make-object, but, both of them failed. My failed definitions are: (define bold-message-font-object (make-object font% () (size 12) (family '(default)) (style '(normal)) (weight '(bold)))) and (define bold-message-font-object (make-object font% (size 12) (family '(default)) (style '(normal)) (weight '(bold)))) and (define bold-message-font-object (instantiate font% () (size 12) (family '(default)) (style '(normal)) (weight '(bold)))) 7. As far as I read on MRED manual, there is no table widget. Is there any standard way to emulate such widget? For example, I have created a program to record books(well, I am quite a good book reader, you know). When I want to search all of my books with certain criteria, I think it is quite useful if I could represent the result with the following order: books name | Author | ISDN | Publisher | printed on year By the way, How to design program is very great and beautiful literary work. My brother and I enjoy it very much as we enjoy Victor Hugo's Les Miserables. Even, HTDP is easier to understand than many discourses in Les Miserables(with part on Generative Recursion as the only exception). Regards, Eko Hermiyanto From marek at xivilization.net Wed Oct 22 03:42:19 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:31:22 2009 Subject: [plt-scheme] Usability: delete whole line in DrScheme In-Reply-To: <932b2f1f0810211604w18d8d1c6jf3d307bedfddaa89@mail.gmail.com> References: <20081020092939.31fa9612@halmanfloyd.lan.local> <932b2f1f0810211604w18d8d1c6jf3d307bedfddaa89@mail.gmail.com> Message-ID: <20081022094219.385ab98e@halmanfloyd.lan.local> On Tue, 21 Oct 2008 18:04:51 -0500 "Robby Findler" wrote: > I've been asked for this one for years and ... well, its finally time > to do it. > > Anyways, I've added something in to SVN to make control-a and the home > key respect the prompt in the interactions window. Thanks, I'll take a look into it. It's nice to see that the DrScheme developers are really quick on improving the usability of the IDE. regards, Marek From marek at xivilization.net Wed Oct 22 03:52:20 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:31:22 2009 Subject: [plt-scheme] Usability: Macro stepper Message-ID: <20081022095220.526879ab@halmanfloyd.lan.local> Hi, These issues are quite minor, but I believe it is useful to care for the details so even beginners can say "well, at first it was intimidating, but it's all logical and well thought". My suggestions this time are all pretty small changes. So, this time I looked at the macro stepper. The menus seem to be inconsistend with their use of separators: the "File" menu uses a seperator above the "Quit", as does the "Edit" menu. No other menu in DrScheme does this. The "Edit" menu uses double-separators, which no other DrScheme menu does, not even other menus in the stepper. Besides this, the "Help" menu is empty, when I click on it I get an empty menu which is a bit like "Here you can find help... oh, right, there's no help for this" ;) Anyway, thanks for DrScheme - while I didn't like it initially, it gets better and better the more I use it. regards, Marek From filcab at gmail.com Wed Oct 22 06:28:17 2008 From: filcab at gmail.com (Filipe Cabecinhas) Date: Thu Mar 26 02:31:22 2009 Subject: [plt-scheme] Usability: delete whole line in DrScheme In-Reply-To: <932b2f1f0810211604w18d8d1c6jf3d307bedfddaa89@mail.gmail.com> References: <20081020092939.31fa9612@halmanfloyd.lan.local> <932b2f1f0810211604w18d8d1c6jf3d307bedfddaa89@mail.gmail.com> Message-ID: On Wed, Oct 22, 2008 at 00:04, Robby Findler wrote: > I've been asked for this one for years and ... well, its finally time to do it. > > Anyways, I've added something in to SVN to make control-a and the home > key respect the prompt in the interactions window. Thank you! I've been waiting for that... But I can't complain much, I didn't ask for it, nor file a bug nor complain about it here :-P -- - F Joan Rivers - "The first time I see a jogger smiling, I'll consider it." From luther.huffman at gmail.com Wed Oct 22 07:10:15 2008 From: luther.huffman at gmail.com (Luther Huffman) Date: Thu Mar 26 02:31:22 2009 Subject: [plt-scheme] On MRED questions In-Reply-To: References: Message-ID: Yes, Victor Hugo's discussion of generative recursion in Les Mis is quite miserable. You should instead try his much better "Callback of Notre Dame". I apologize. I'll go back to lurking now. > By the way, How to design program is very great and beautiful literary > work. My brother and I enjoy it very much as we enjoy Victor Hugo's > Les Miserables. Even, HTDP is easier to understand than many > discourses in Les Miserables(with part on Generative Recursion as the > only exception). From robby at cs.uchicago.edu Wed Oct 22 07:08:07 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:31:22 2009 Subject: [plt-scheme] Usability: delete whole line in DrScheme In-Reply-To: <20081022094219.385ab98e@halmanfloyd.lan.local> References: <20081020092939.31fa9612@halmanfloyd.lan.local> <932b2f1f0810211604w18d8d1c6jf3d307bedfddaa89@mail.gmail.com> <20081022094219.385ab98e@halmanfloyd.lan.local> Message-ID: <932b2f1f0810220408o1de1019ao9398173a658464e5@mail.gmail.com> On Wed, Oct 22, 2008 at 2:42 AM, Marek Kubica wrote: > On Tue, 21 Oct 2008 18:04:51 -0500 > "Robby Findler" wrote: > >> I've been asked for this one for years and ... well, its finally time >> to do it. >> >> Anyways, I've added something in to SVN to make control-a and the home >> key respect the prompt in the interactions window. > > Thanks, I'll take a look into it. It's nice to see that the DrScheme > developers are really quick on improving the usability of the IDE. Well, it was fast for you, but in this one instance, some people have been waiting a looong time. :) Robby From robby at cs.uchicago.edu Wed Oct 22 07:21:59 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:31:22 2009 Subject: [plt-scheme] On MRED questions In-Reply-To: References: Message-ID: <932b2f1f0810220421s6add5705x98a15cf8dc842687@mail.gmail.com> On Wed, Oct 22, 2008 at 3:03 AM, eko hermiyanto wrote: > Dear PLT Schemers, > > 1. In DRScheme, there are four buttons which so beautiful; debug > button, check syntax button, run button, and stop button. I am not > quite sure whether they are button% because there is no such style for > button. Are they in fact just merely button% or are they other widget? > Or perhaps, they are button% but using techniques which are explained > on drawing and editor toolbox sections on the MRED manual? I am very > sorry because it is my second days of my MRED learning, and I am not > yet read those sections of the manual. They are not button% objects. They are switchable-button% objects (which uses canvas% and do all the drawing at the Scheme level). > 2. Below menubar, there are two choice-like widgets. But, they are > more beautiful than choice%. What is the name of the widget? They use name-message%. > 3. Is there any standard icon in DRScheme which I can use? For example > a floppy disk icon to be used on a button with the purpose to save a > file. The icons drscheme use are in plt/collects/icons/. See plt/collects/drscheme/private/unit.ss, the definition of save-bitmap for how they are used. > 4. How to create horizontal line in frame? For example I want to make > a frame, the top one for viewing a given data, and the bottom one to > edit the data. And I want to create separation line between them, is > it possible? I have tried to emulate such line using message% with > label "----" but the result is extremelly ugly. The editor-canvas% object already has a builtin line around its edge. Is that enough? If not, you probably are going to have to use canvas% and make up your own drawing procedure. > 5. For example, I want to create several text-field% vertically in the > same vertical panel. Because the labels of those text-field% are > different in length, the field of those text-field% are not vertically > in line. I have tried to emulate with giving more spaces on the > labels, and so far, it is work good enough. Nevertheless, is there a > way to do that without giving more spaces on the label? The easiest way is to use message% objects instead of the text-field%s label and then figure out the width of the widest one and then set all of their widths to the width of the widest one. You will want to use the reflow-container method and do this computation before calling the show method of the frame. > 6. I want to create a message% with bold label. I know I must create > font% object in order to manipulate the label to be bold. I have tried > to create the font% object with instantiate and make-object, but, both > of them failed. > My failed definitions are: > (define bold-message-font-object (make-object font% () (size 12) > (family '(default)) (style '(normal)) (weight '(bold)))) > and > (define bold-message-font-object (make-object font% (size 12) (family > '(default)) (style '(normal)) (weight '(bold)))) > and > (define bold-message-font-object (instantiate font% () (size 12) > (family '(default)) (style '(normal)) (weight '(bold)))) #lang scheme/gui (define f (new frame% [label ""])) (define msg (new message% [label "A bold message"] [parent f] [font (send the-font-list find-or-create-font (send normal-control-font get-point-size) (send normal-control-font get-family) (send normal-control-font get-style) 'bold (send normal-control-font get-underlined) (send normal-control-font get-smoothing))])) (define gb (new grow-box-spacer-pane% [parent f])) (send f show #t) > 7. As far as I read on MRED manual, there is no table widget. Is there > any standard way to emulate such widget? For example, I have created a > program to record books(well, I am quite a good book reader, you > know). When I want to search all of my books with certain criteria, I > think it is quite useful if I could represent the result with the > following order: > books name | Author | ISDN | Publisher | printed on year No, sorry. For now, you have to simulate that using the widths technique I suggest above, or if you want something more sophisticated, you're back to the very low-level canvas%. > By the way, How to design program is very great and beautiful literary > work. My brother and I enjoy it very much as we enjoy Victor Hugo's > Les Miserables. Even, HTDP is easier to understand than many > discourses in Les Miserables(with part on Generative Recursion as the > only exception). A great pairing! :) Robby From gherson at snet.net Wed Oct 22 08:34:58 2008 From: gherson at snet.net (George Herson) Date: Thu Mar 26 02:31:22 2009 Subject: [plt-scheme] More document (newbie) Message-ID: <622402.49402.qm@web81306.mail.mud.yahoo.com> When you read http://docs.plt-scheme.org/reference/ are you struck by the simplicity, or glad that you now have a http://docs.plt-scheme.org/guide/? How would you explain the parameterize command, at least as used in http://docs.plt-scheme.org/more/? BTW, I agree with the other emails of countervailing support arising in my complaint's aftermath; i see potential here or I would be elsewhere. thanks, george ----- Original Message ---- From: Ernie Smith To: George Herson ; PLT Scheme List Sent: Tuesday, October 21, 2008 9:09:40 PM Subject: Re: [plt-scheme] More document (newbie) Simplifying the language?? That would be a challenge. I don't think languages get much simpler. The only bloat, if any, can be attributed to that double edged sword standardization. The problem I find with getting up to speed isn't the language at all. It's me. 25 years of bloated languages addles the brain. Maybe you are experiencing something similar. Try not to think in terms of what you already know, come at it fresh. It's the unlearning curve that needs flattening. From robby at cs.uchicago.edu Wed Oct 22 08:59:32 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:31:23 2009 Subject: [plt-scheme] More document (newbie) In-Reply-To: <622402.49402.qm@web81306.mail.mud.yahoo.com> References: <622402.49402.qm@web81306.mail.mud.yahoo.com> Message-ID: <932b2f1f0810220559h297a5557wf6070e64d3b5619d@mail.gmail.com> Are you after a better writup in more, or are you still interested in learning what parameterize is for yourself? Robby On Wed, Oct 22, 2008 at 7:34 AM, George Herson wrote: > When you read http://docs.plt-scheme.org/reference/ are you struck by the simplicity, or glad that you now have a http://docs.plt-scheme.org/guide/? > > How would you explain the parameterize command, at least as used in http://docs.plt-scheme.org/more/? > > BTW, I agree with the other emails of countervailing support arising in my complaint's aftermath; i see potential here or I would be elsewhere. > > thanks, > george > > > > ----- Original Message ---- > From: Ernie Smith > To: George Herson ; PLT Scheme List > Sent: Tuesday, October 21, 2008 9:09:40 PM > Subject: Re: [plt-scheme] More document (newbie) > > Simplifying the language?? > > That would be a challenge. > I don't think languages get much simpler. > The only bloat, if any, can be attributed to that double edged sword > standardization. > > The problem I find with getting up to speed isn't the language at all. > It's me. > 25 years of bloated languages addles the brain. > Maybe you are experiencing something similar. > Try not to think in terms of what you already know, come at it fresh. > > It's the unlearning curve that needs flattening. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From michael at schuerig.de Wed Oct 22 09:14:22 2008 From: michael at schuerig.de (Michael Schuerig) Date: Thu Mar 26 02:31:23 2009 Subject: [plt-scheme] Re: More document (newbie) In-Reply-To: <622402.49402.qm@web81306.mail.mud.yahoo.com> References: <622402.49402.qm@web81306.mail.mud.yahoo.com> Message-ID: <200810221514.23327.michael@schuerig.de> On Wednesday 22 October 2008, George Herson wrote: > How would you explain the parameterize command, at least as used in > http://docs.plt-scheme.org/more/? It looks a lot like what is called thread-local storage in other systems, extended to continuations. I may be wrong, I only skimmed the docs. Michael -- Michael Schuerig mailto:michael@schuerig.de http://www.schuerig.de/michael/ From robby at cs.uchicago.edu Wed Oct 22 09:35:36 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:31:23 2009 Subject: [plt-scheme] Re: More document (newbie) In-Reply-To: <200810221514.23327.michael@schuerig.de> References: <622402.49402.qm@web81306.mail.mud.yahoo.com> <200810221514.23327.michael@schuerig.de> Message-ID: <932b2f1f0810220635s162b0839l46bac3737adc1f91@mail.gmail.com> On Wed, Oct 22, 2008 at 8:14 AM, Michael Schuerig wrote: > On Wednesday 22 October 2008, George Herson wrote: >> How would you explain the parameterize command, at least as used in >> http://docs.plt-scheme.org/more/? > > It looks a lot like what is called thread-local storage in other > systems, extended to continuations. I may be wrong, I only skimmed the > docs. That is what it is, yes. If you want a precise explanation (for people who understand such words as the above), see: http://people.cs.uchicago.edu/~robby/pubs/papers/icfp2007-fyff.pdf Robby From plragde at uwaterloo.ca Wed Oct 22 09:46:00 2008 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:31:23 2009 Subject: [plt-scheme] On MRED questions In-Reply-To: Message-ID: <48FF2E98.1090408@uwaterloo.ca> > Yes, Victor Hugo's discussion of generative recursion in Les Mis is > quite miserable. You should instead try his much better "Callback of > Notre Dame". Is that the book whose protagonist is named Quasiquotemodo? --PR [To add some meaningful content to this message, I have often wondered whether it would be worth "translating" Teach Yourself Scheme in Fixnum Days into PLT Scheme. I suppose I don't mean "translating" so much as providing a similar document whose audience would be those who have learned the teaching languages via HtDP. I have written a couple of these for specialized audiences -- students entering a second-year course we teach, programming contest masochists.] From dvanhorn at ccs.neu.edu Wed Oct 22 10:05:23 2008 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Thu Mar 26 02:31:23 2009 Subject: [plt-scheme] Type scheme annotations and macros Message-ID: <48FF3323.10409@ccs.neu.edu> A couple quick questions on Typed Scheme: 1) Why does the first type-check while the latter does not? #lang typed-scheme (if #f (add1 "dog") 'ok) #; (if (ann #f #f) (add1 "dog") 'ok) 2) How can I write a `bif' macro that works like Typed Scheme's if (ie. types its branches with occurrence typing), but forces the conditional value to be a Boolean and nothing but a Boolean? (define-syntax bif (syntax-rules () [(bif e0 e1 e2) (if (ann e0 Boolean) e1 e2)])) This enforces a Boolean type on e0, but seems to destroy the occurrence typing of e1 and e2. Thanks, David From grettke at acm.org Wed Oct 22 10:27:00 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:31:23 2009 Subject: [plt-scheme] Usability: Macro stepper In-Reply-To: <20081022095220.526879ab@halmanfloyd.lan.local> References: <20081022095220.526879ab@halmanfloyd.lan.local> Message-ID: <756daca50810220727k3b94561au391f9e184f197765@mail.gmail.com> On Wed, Oct 22, 2008 at 2:52 AM, Marek Kubica wrote: > Anyway, thanks for DrScheme - while I didn't like it initially, it gets > better and better the more I use it. It is a great editor, and is generally very under-appreciated. From matthias at ccs.neu.edu Wed Oct 22 10:31:56 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:31:23 2009 Subject: [plt-scheme] On MRED questions In-Reply-To: References: Message-ID: On Oct 22, 2008, at 4:03 AM, eko hermiyanto wrote: > By the way, How to design program is very great and beautiful literary > work. My brother and I enjoy it very much as we enjoy Victor Hugo's > Les Miserables. Even, HTDP is easier to understand than many > discourses in Les Miserables(with part on Generative Recursion as the > only exception). Thanks :-) -- Matthias From samth at ccs.neu.edu Wed Oct 22 10:34:05 2008 From: samth at ccs.neu.edu (Sam TH) Date: Thu Mar 26 02:31:24 2009 Subject: [plt-scheme] Type scheme annotations and macros In-Reply-To: <48FF3323.10409@ccs.neu.edu> References: <48FF3323.10409@ccs.neu.edu> Message-ID: <63bb19ae0810220734k38dc5eelf8973a998abfd0d7@mail.gmail.com> On Wed, Oct 22, 2008 at 10:05 AM, David Van Horn wrote: > A couple quick questions on Typed Scheme: > > 1) Why does the first type-check while the latter does not? > > #lang typed-scheme > (if #f > (add1 "dog") > 'ok) > > #; > (if (ann #f #f) > (add1 "dog") > 'ok) That looks like a bug. Can you file it in the bug database? > 2) How can I write a `bif' macro that works like Typed Scheme's if (ie. > types its branches with occurrence typing), but forces the conditional value > to be a Boolean and nothing but a Boolean? > > (define-syntax bif > (syntax-rules () > [(bif e0 e1 e2) > (if (ann e0 Boolean) > e1 > e2)])) > > This enforces a Boolean type on e0, but seems to destroy the occurrence > typing of e1 and e2. This is tricky, because the type of `e0' is what contains the occurence typing information, so annotating it with `Boolean' loses that information. I'll have to think about this more. Thanks, -- sam th samth@ccs.neu.edu From noelwelsh at gmail.com Wed Oct 22 10:57:08 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:31:24 2009 Subject: [plt-scheme] Profiling code In-Reply-To: <54649e8e-ec42-484f-9d3d-7316afdeb8a9@q9g2000hsb.googlegroups.com> References: <54649e8e-ec42-484f-9d3d-7316afdeb8a9@q9g2000hsb.googlegroups.com> Message-ID: If you lower the log level (search for "Logging" in the docs) GC stats and other information will become available. This might help you. N. On Tue, Oct 21, 2008 at 6:19 PM, Deep wrote: > My game prototype in DrScheme is now feature complete and I would like > to optimise it to make things run faster. The inbuilt profiler is > wonderfully well integrated and has already helped me remove some > bottlenecks. > > However there are a few functions in my code that get called very > often and have a very small execution time. I want to know if there is > an additional cost in terms of "function call overhead" that exists > for functions beyond their actual execution time. > > On a more general note, I wanted to know how I can observe what my > code is doing at a slightly lower level of detail. Things I would be > interested in > > 1) How much memory is being consed. > 2) When does GC get invoked. > 3) What kind of assembly code is getting generated for my functions. > 4) Am I hitting some inefficient execution paths with DrScheme. > > Any pointers if this is possible at all ? > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From robby at cs.uchicago.edu Wed Oct 22 11:33:25 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:31:24 2009 Subject: [plt-scheme] Type scheme annotations and macros In-Reply-To: <63bb19ae0810220734k38dc5eelf8973a998abfd0d7@mail.gmail.com> References: <48FF3323.10409@ccs.neu.edu> <63bb19ae0810220734k38dc5eelf8973a998abfd0d7@mail.gmail.com> Message-ID: <932b2f1f0810220833k39b91bffm6ca14f3f31302ed2@mail.gmail.com> What about (bif e1 e2 e3) => (if (and e1 #t) e2 e3) Robby On Wed, Oct 22, 2008 at 9:34 AM, Sam TH wrote: > On Wed, Oct 22, 2008 at 10:05 AM, David Van Horn wrote: >> A couple quick questions on Typed Scheme: >> >> 1) Why does the first type-check while the latter does not? >> >> #lang typed-scheme >> (if #f >> (add1 "dog") >> 'ok) >> >> #; >> (if (ann #f #f) >> (add1 "dog") >> 'ok) > > That looks like a bug. Can you file it in the bug database? > >> 2) How can I write a `bif' macro that works like Typed Scheme's if (ie. >> types its branches with occurrence typing), but forces the conditional value >> to be a Boolean and nothing but a Boolean? >> >> (define-syntax bif >> (syntax-rules () >> [(bif e0 e1 e2) >> (if (ann e0 Boolean) >> e1 >> e2)])) >> >> This enforces a Boolean type on e0, but seems to destroy the occurrence >> typing of e1 and e2. > > This is tricky, because the type of `e0' is what contains the > occurence typing information, so annotating it with `Boolean' loses > that information. I'll have to think about this more. > > Thanks, > -- > sam th > samth@ccs.neu.edu > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From dvanhorn at ccs.neu.edu Wed Oct 22 11:53:25 2008 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Thu Mar 26 02:31:24 2009 Subject: [plt-scheme] Type scheme annotations and macros In-Reply-To: <932b2f1f0810220833k39b91bffm6ca14f3f31302ed2@mail.gmail.com> References: <48FF3323.10409@ccs.neu.edu> <63bb19ae0810220734k38dc5eelf8973a998abfd0d7@mail.gmail.com> <932b2f1f0810220833k39b91bffm6ca14f3f31302ed2@mail.gmail.com> Message-ID: <48FF4C75.6040802@ccs.neu.edu> Robby Findler wrote: > What about > > (bif e1 e2 e3) => (if (and e1 #t) e2 e3) But this doesn't force e1 to have type Boolean. #lang typed-scheme (if (and "Not a Boolean" #t) 'a 'b) I want a form of if which will reject the following: (if "Not a Boolean" 'a 'b) David From robby at cs.uchicago.edu Wed Oct 22 12:05:14 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:31:24 2009 Subject: [plt-scheme] Type scheme annotations and macros In-Reply-To: <48FF4C75.6040802@ccs.neu.edu> References: <48FF3323.10409@ccs.neu.edu> <63bb19ae0810220734k38dc5eelf8973a998abfd0d7@mail.gmail.com> <932b2f1f0810220833k39b91bffm6ca14f3f31302ed2@mail.gmail.com> <48FF4C75.6040802@ccs.neu.edu> Message-ID: <932b2f1f0810220905ma4967dencc82b9e7c5b9500d@mail.gmail.com> Oh, right. Duh. On Wed, Oct 22, 2008 at 10:53 AM, David Van Horn wrote: > Robby Findler wrote: >> >> What about >> >> (bif e1 e2 e3) => (if (and e1 #t) e2 e3) > > But this doesn't force e1 to have type Boolean. > > #lang typed-scheme > (if (and "Not a Boolean" #t) > 'a > 'b) > > I want a form of if which will reject the following: > > (if "Not a Boolean" > 'a > 'b) > > David > > From jpc-ml at zenburn.net Wed Oct 22 14:23:42 2008 From: jpc-ml at zenburn.net (=?UTF-8?B?SmFrdWIgUGlvdHIgQ8WCYXBh?=) Date: Thu Mar 26 02:31:24 2009 Subject: [plt-scheme] DrScheme colors Message-ID: <48FF6FAE.6060600@zenburn.net> Since there seems to be some kind of wishlist ;] going I thought I could share my 2 cents about colors. I've recently switched to a Zenburn[1] like (dark) color scheme for DrScheme and apart from the big contrast between the text and the GUI controls (which would be quite hard to fix) there are some things I would love to see improved: 1. You can't change the text background (which is a nice thing for paren-matching and errors/comments/todos). 2. The selection and error background colors can't be changed. 3. Keywords and parenthesis share the same highlight color. Thanks for the great tool and keep up good work. :) [1] http://slinky.imukuppi.org/zenburn/ PS. Do you like the design of the editor framework in MrEd? It is quite difficult to understand (especially since there is no guide about their usage) and I have a feeling that the editing problem could be solved easier. I'm curious what's your view on this, since you've implemented quite a lot using the editor framework. With hindsight, are there things you would have done differently? -- regards, Jakub Piotr C?apa From robby at cs.uchicago.edu Wed Oct 22 14:37:08 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:31:25 2009 Subject: [plt-scheme] DrScheme colors In-Reply-To: <48FF6FAE.6060600@zenburn.net> References: <48FF6FAE.6060600@zenburn.net> Message-ID: <932b2f1f0810221137t5476be49j920e5ab1fd4ebd64@mail.gmail.com> I believe the selection color is something you can change via the OS (at least on the mac it is). If you (or anyone else!) have the energy to submit patches for the other color configurations, I'd welcome them. I'm sorry I won't be able to get to it soon myself, tho. Robby On Wed, Oct 22, 2008 at 1:23 PM, Jakub Piotr C?apa wrote: > Since there seems to be some kind of wishlist ;] going I thought I could > share my 2 cents about colors. > > I've recently switched to a Zenburn[1] like (dark) color scheme for DrScheme > and apart from the big contrast between the text and the GUI controls (which > would be quite hard to fix) there are some things I would love to see > improved: > > 1. You can't change the text background (which is a nice thing for > paren-matching and errors/comments/todos). > 2. The selection and error background colors can't be changed. > 3. Keywords and parenthesis share the same highlight color. > > Thanks for the great tool and keep up good work. :) > > [1] http://slinky.imukuppi.org/zenburn/ > > PS. Do you like the design of the editor framework in MrEd? It is quite > difficult to understand (especially since there is no guide about their > usage) and I have a feeling that the editing problem could be solved easier. > I'm curious what's your view on this, since you've implemented quite a lot > using the editor framework. With hindsight, are there things you would have > done differently? > > -- > regards, > Jakub Piotr C?apa > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From deepankar.sharma at gmail.com Wed Oct 22 15:25:40 2008 From: deepankar.sharma at gmail.com (Deep) Date: Thu Mar 26 02:31:25 2009 Subject: [plt-scheme] Re: Profiling code In-Reply-To: References: <54649e8e-ec42-484f-9d3d-7316afdeb8a9@q9g2000hsb.googlegroups.com> Message-ID: <56920092-a148-4414-abfd-ec06acaae9c7@v30g2000hsa.googlegroups.com> Thanks for the input, I will try this out tonight. On Oct 22, 10:57?am, "Noel Welsh" wrote: > If you lower the log level (search for "Logging" in the docs) GC stats > and other information will become available. ?This might help you. > > N. > > > > > > On Tue, Oct 21, 2008 at 6:19 PM, Deep wrote: > > My game prototype in DrScheme is now feature complete and I would like > > to optimise it to make things run faster. The inbuilt profiler is > > wonderfully well integrated and has already helped me remove some > > bottlenecks. > > > However there are a few functions in my code that get called very > > often and have a very small execution time. I want to know if there is > > an additional cost in terms of "function call overhead" that exists > > for functions beyond their actual execution time. > > > On a more general note, I wanted to know how I can observe what my > > code is doing at a slightly lower level of detail. Things I would be > > interested in > > > 1) How much memory is being consed. > > 2) When does GC get invoked. > > 3) What kind of assembly code is getting generated for my functions. > > 4) Am I hitting some inefficient execution paths with DrScheme. > > > Any pointers if this is possible at all ? > > _________________________________________________ > > ?For list-related administrative tasks: > > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme- Hide quoted text - > > - Show quoted text - From marek at xivilization.net Wed Oct 22 18:56:07 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:31:25 2009 Subject: [plt-scheme] Proxying the PLT web server? Message-ID: <20081023005607.0a7ff675@halmanfloyd.lan.local> Hi, I'm planning to write an application using the PLT web server, that will be run behind an Apache server which takes care about SSL client certificate authentifaction and puts the user name into the REMOTE_USER variable. Now I'd like to put the PLT web server behind the Apache server via mod_proxy. Has someone ever tried doing this? Is this going to work? My primary concern are the URLs, I need to generate URLs that point to my Apache server and not to the PLT server. Any recommendations, hints or opinions appreciated! regards, Marek From marek at xivilization.net Wed Oct 22 19:02:20 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:31:25 2009 Subject: [plt-scheme] Proxying the PLT web server? In-Reply-To: <20081023005607.0a7ff675@halmanfloyd.lan.local> References: <20081023005607.0a7ff675@halmanfloyd.lan.local> Message-ID: <20081023010220.6371f0c1@halmanfloyd.lan.local> On Thu, 23 Oct 2008 00:56:07 +0200 Marek Kubica wrote: > I'm planning to write an application using the PLT web server, that > will be run behind an Apache server which takes care about SSL client > certificate authentifaction and puts the user name into the > REMOTE_USER variable. I picture says more then a hundred words. Even if it's ASCII. User's browser (with a client certificate and uername bob) | | v Apache (gets the HTTPS request) | | v mod_ssl (verifies the certificate against the CA, sets REMOTE_USER to bob) | | v mod_headers (sets some HTTP request header to the value of REMOTE_USER) | | v mod_proxy (forwards the modified request via HTTP internally) | | v PLT web server (accesses the user name from the header and runs app) My question is whether the PLT web server can handle something like this. regards, Marek From yinso.chen at gmail.com Wed Oct 22 19:18:59 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:31:26 2009 Subject: [plt-scheme] Proxying the PLT web server? In-Reply-To: <20081023010220.6371f0c1@halmanfloyd.lan.local> References: <20081023005607.0a7ff675@halmanfloyd.lan.local> <20081023010220.6371f0c1@halmanfloyd.lan.local> Message-ID: <779bf2730810221618j59ea5037l746ddcbaa744f99@mail.gmail.com> I have done such a setup. The effort isn't in getting PLT to work, rather it's in getting mod_proxy to work correctly. You likely need to do some URL munging, and for that you'll also need mod_proxy_html. - A tutorial on using Apache+SSL as PLT Frontend - mod_proxy_html - Home to mod_proxy_html that can be used for in page link translation - Reverse Proxy Tutorial - An older tutorial on how to setup mod_proxy as a reverse proxy - ProxyPassReverseCookieDomain- The directive to ensure cookie also works across proxy calls - Installing mod_proxy_html Also read up about selinux to ensure that your apache server can access network... Cheers, On Wed, Oct 22, 2008 at 4:02 PM, Marek Kubica wrote: > On Thu, 23 Oct 2008 00:56:07 +0200 > Marek Kubica wrote: > > > I'm planning to write an application using the PLT web server, that > > will be run behind an Apache server which takes care about SSL client > > certificate authentifaction and puts the user name into the > > REMOTE_USER variable. > > I picture says more then a hundred words. Even if it's ASCII. > > User's browser (with a client certificate and uername bob) > | > | > v > Apache (gets the HTTPS request) > | > | > v > mod_ssl (verifies the certificate against the CA, sets REMOTE_USER to > bob) > | > | > v > mod_headers (sets some HTTP request header to the value of REMOTE_USER) > | > | > v > mod_proxy (forwards the modified request via HTTP internally) > | > | > v > PLT web server (accesses the user name from the header and runs app) > > My question is whether the PLT web server can handle something like > this. > > regards, > Marek > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081022/3492a8b6/attachment.html From derick.eddington at gmail.com Wed Oct 22 19:22:08 2008 From: derick.eddington at gmail.com (Derick Eddington) Date: Thu Mar 26 02:31:26 2009 Subject: [plt-scheme] Multiple file syntactic test suite coverage Message-ID: <1224717728.6347.29.camel@eep> I really like DrScheme's "syntactic test suite coverage" feature. As far as I know (I'm using 4.1.1.1-svn11oct2008), it does not work across multiple files. I'd like to request it be made to work across multiple files, similar to what the debugger does of asking if it should include files that are open. I'd especially like this so I can run my unit test programs and see what they've covered in the module they test. I imagine other people would find this useful as well. Thanks for considering, -- : Derick ---------------------------------------------------------------- From goetter at mazama.net Wed Oct 22 20:46:59 2008 From: goetter at mazama.net (Ben Goetter) Date: Thu Mar 26 02:31:26 2009 Subject: [plt-scheme] Cyclic dependencies Message-ID: <48FFC983.9050207@mazama.net> Compiling the following brief program "buga.ss" within DrScheme puts it (released version 4.1.1, Win XP SP3) in a loop. Eventually it aborts compilation, having hit its 384 Mb heap limit. ---file "buga.ss"--- #lang scheme (require "bugb.ss") (provide foo) (define (foo) 'ziggy) (define (bar) (baz)) ---end of file--- ---file "bugb.ss"--- #lang scheme (require (only-in "buga.ss" foo)) (provide baz) (define (baz) (foo)) ---end of file--- From mflatt at cs.utah.edu Wed Oct 22 21:30:33 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:31:26 2009 Subject: [plt-scheme] Cyclic dependencies In-Reply-To: <48FFC983.9050207@mazama.net> References: <48FFC983.9050207@mazama.net> Message-ID: <20081023013035.7B6B965008C@mail-svr1.cs.utah.edu> Now fixed in SVN. (This was reported a couple of times, and I kept forgetting about it.) Thanks, Matthew At Wed, 22 Oct 2008 17:46:59 -0700, Ben Goetter wrote: > Compiling the following brief program "buga.ss" within DrScheme puts it > (released version 4.1.1, Win XP SP3) in a loop. Eventually it aborts > compilation, having hit its 384 Mb heap limit. > > ---file "buga.ss"--- > #lang scheme > (require "bugb.ss") > (provide foo) > (define (foo) 'ziggy) > (define (bar) (baz)) > ---end of file--- > ---file "bugb.ss"--- > #lang scheme > (require (only-in "buga.ss" foo)) > (provide baz) > (define (baz) (foo)) > ---end of file--- > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From maxigas at anargeek.net Wed Oct 22 22:19:19 2008 From: maxigas at anargeek.net (maxigas) Date: Thu Mar 26 02:31:27 2009 Subject: [plt-scheme] Proxying the PLT web server? In-Reply-To: <779bf2730810221618j59ea5037l746ddcbaa744f99@mail.gmail.com> References: <20081023005607.0a7ff675@halmanfloyd.lan.local> <20081023010220.6371f0c1@halmanfloyd.lan.local> <779bf2730810221618j59ea5037l746ddcbaa744f99@mail.gmail.com> Message-ID: <20081023.041919.154259935.maxigas@anargeek.net> hi! i don't have much experience but for what i know after reading the docs is that PLT web server can does HTTPS (this is SSL with certs, no?) and also authentication, so you can possibly do it more simply and more in native scheme: http://docs.plt-scheme.org/web-server/Troubleshooting.html Here, see the sections on: 11.2 How do I use Apache with the PLT Web Server? 11.5 How do I set up the server to use HTTPS? ps: if there is some problem with this solution, i'd like to know briefly and learn from it. :) maxigas From: YC Subject: Re: [plt-scheme] Proxying the PLT web server? Date: Wed, 22 Oct 2008 16:18:59 -0700 > I have done such a setup. The effort isn't in getting PLT to work, rather it's in getting mod_proxy to work correctly. > > You likely need to do some URL munging, and for that you'll also need mod_proxy_html. > > ? A tutorial on using Apache+SSL as PLT Frontend > > ? mod_proxy_html - Home to mod_proxy_html that can be used for in page link translation > > ? Reverse Proxy Tutorial - An older tutorial on how to setup mod_proxy as a reverse proxy > > ? ProxyPassReverseCookieDomain - The directive to ensure cookie also works across proxy calls > > ? Installing mod_proxy_html > > Also read up about selinux to ensure that your apache server can access network... > > Cheers, > > On Wed, Oct 22, 2008 at 4:02 PM, Marek Kubica wrote: > > On Thu, 23 Oct 2008 00:56:07 +0200 > Marek Kubica wrote: > > > I'm planning to write an application using the PLT web server, that > > will be run behind an Apache server which takes care about SSL client > > certificate authentifaction and puts the user name into the > > REMOTE_USER variable. > > I picture says more then a hundred words. Even if it's ASCII. > > User's browser (with a client certificate and uername bob) > | > | > v > Apache (gets the HTTPS request) > | > | > v > mod_ssl (verifies the certificate against the CA, sets REMOTE_USER to > bob) > | > | > v > mod_headers (sets some HTTP request header to the value of REMOTE_USER) > | > | > v > mod_proxy (forwards the modified request via HTTP internally) > | > | > v > PLT web server (accesses the user name from the header and runs app) > > My question is whether the PLT web server can handle something like > this. > > regards, > Marek > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From yinso.chen at gmail.com Thu Oct 23 01:43:55 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:31:27 2009 Subject: [plt-scheme] Proxying the PLT web server? In-Reply-To: <20081023.041919.154259935.maxigas@anargeek.net> References: <20081023005607.0a7ff675@halmanfloyd.lan.local> <20081023010220.6371f0c1@halmanfloyd.lan.local> <779bf2730810221618j59ea5037l746ddcbaa744f99@mail.gmail.com> <20081023.041919.154259935.maxigas@anargeek.net> Message-ID: <779bf2730810222243i78929a18s34c67b7add9723f2@mail.gmail.com> On Wed, Oct 22, 2008 at 7:19 PM, maxigas wrote: > > Here, see the sections on: > > 11.2 How do I use Apache with the PLT Web Server? > mod_rewrite is another possible solution with Apache, but if your outputs contain links that need to be rewritten (i.e. removing prefixes such as /servlets/), than you probably need more than just mod_rewrite. > > 11.5 How do I set up the server to use HTTPS? > I do not have experience with native PLT HTTPS - Jay and others would have to chime in. I think a good part depends on what you are familiar with, and at this point I am still more familiar with configuring Apache :) YMMV. Cheers, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081022/45024843/attachment.htm From marek at xivilization.net Thu Oct 23 02:17:49 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:31:27 2009 Subject: [plt-scheme] Proxying the PLT web server? In-Reply-To: <20081023.041919.154259935.maxigas@anargeek.net> References: <20081023005607.0a7ff675@halmanfloyd.lan.local> <20081023010220.6371f0c1@halmanfloyd.lan.local> <779bf2730810221618j59ea5037l746ddcbaa744f99@mail.gmail.com> <20081023.041919.154259935.maxigas@anargeek.net> Message-ID: <20081023081749.7d6c1b24@halmanfloyd.lan.local> On Thu, 23 Oct 2008 04:19:19 +0200 (CEST) maxigas wrote: > i don't have much experience but for what i know after reading the > docs is that PLT web server can does HTTPS (this is SSL with certs, > no?) and also authentication, I know that it supports HTTPS, but I haven't seen anything on client certificate authentication. Just HTTP basic auth. > Here, see the sections on: > > 11.2 How do I use Apache with the PLT Web Server? Looks interesting. But I'm not sure whether I can pass variables like REMOTE_USER to the PLT Server. I need to write a small app for testing stuff. > ps: if there is some problem with this solution, i'd like to know > briefly and learn from it. :) I wouldn't want to have another http server running on some port other than 80. I'm currently in search of the best solution, I'll wirte a mail once I figure it out for myself. regards, Marek From marek at xivilization.net Thu Oct 23 02:21:28 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:31:27 2009 Subject: [plt-scheme] Proxying the PLT web server? In-Reply-To: <779bf2730810221618j59ea5037l746ddcbaa744f99@mail.gmail.com> References: <20081023005607.0a7ff675@halmanfloyd.lan.local> <20081023010220.6371f0c1@halmanfloyd.lan.local> <779bf2730810221618j59ea5037l746ddcbaa744f99@mail.gmail.com> Message-ID: <20081023082128.388b70de@halmanfloyd.lan.local> On Wed, 22 Oct 2008 16:18:59 -0700 YC wrote: > I have done such a setup. The effort isn't in getting PLT to work, > rather it's in getting mod_proxy to work correctly. Glad to hear that I'm not alone :) > You likely need to do some URL munging, and for that you'll also need > mod_proxy_html. The best solution would be the PLT server outputting URLs that point to Apache rather than itself, so URL munging wouldn't be neccessary. Has anyone ever tried it? > A tutorial on using Apache+SSL as PLT > Frontend > - > mod_proxy_html - Home > to mod_proxy_html that can be used for in page link translation > - > Reverse Proxy Tutorial > - An older tutorial > on how to setup > mod_proxy as a reverse proxy > - > ProxyPassReverseCookieDomain- > The directive to ensure cookie also works across proxy calls > - > Installing mod_proxy_html > Thanks for all these links, I'll read through and try to set it up in the afternoon. > Also read up about selinux to ensure that your apache server can > access network... Debian Etch does not currently enforce any SELinux profiles, so that should be safe. :) regards, Marek From noelwelsh at gmail.com Thu Oct 23 02:59:46 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:31:28 2009 Subject: [plt-scheme] Proxying the PLT web server? In-Reply-To: <20081023005607.0a7ff675@halmanfloyd.lan.local> References: <20081023005607.0a7ff675@halmanfloyd.lan.local> Message-ID: On Wed, Oct 22, 2008 at 11:56 PM, Marek Kubica wrote: > Now I'd like to put the PLT web server behind the Apache > server via mod_proxy. Has someone ever tried doing this? Is this going > to work? My primary concern are the URLs, I need to generate URLs that > point to my Apache server and not to the PLT server. This is how we normally run things at Untyped, except we use mod_rewrite. Here is an example section from an Apache configuration file: RewriteEngine On RewriteLog "/var/log/apache2/rewrite.log" RewriteLogLevel 1 These rules catch stuff we want Apache to serve RewriteRule ^/error(/?.*)$ /error$1 [L] RewriteRule ^/help(/?.*)$ /help$1 [L] RewriteRule ^/images(/?.*)$ /images$1 [L] RewriteRule ^/style(/?.*)$ /style$1 [L] ... Finally, send everything else to the PLT web server, which runs on port 8765 RewriteRule ^(/?.*)$ http://localhost:8765$1 [P] YC wrote: > (i.e. removing prefixes such as /servlets/) If you have this issue you should look at, for example, the dispatch.plt package on PLaneT. N. From mflatt at cs.utah.edu Thu Oct 23 08:22:40 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:31:28 2009 Subject: [plt-scheme] Profiling code In-Reply-To: <54649e8e-ec42-484f-9d3d-7316afdeb8a9@q9g2000hsb.googlegroups.com> References: <54649e8e-ec42-484f-9d3d-7316afdeb8a9@q9g2000hsb.googlegroups.com> Message-ID: <20081023122241.D0D1D65008C@mail-svr1.cs.utah.edu> At Tue, 21 Oct 2008 10:19:49 -0700 (PDT), Deep wrote: > However there are a few functions in my code that get called very > often and have a very small execution time. I want to know if there is > an additional cost in terms of "function call overhead" that exists > for functions beyond their actual execution time. The overhead for a function call small. Also, if the function is in the same module as the function call, there's a good chance that a small function gets inlined. > On a more general note, I wanted to know how I can observe what my > code is doing at a slightly lower level of detail. Things I would be > interested in > > 1) How much memory is being consed. > 2) When does GC get invoked. I agree with Noel's suggestion for these. > 3) What kind of assembly code is getting generated for my functions. Although there's no facility to show you assembly code, you might try using `mzc --decompile' on the bytecode form of your code. That would let you see, for example, whether a function call was inlined. > 4) Am I hitting some inefficient execution paths with DrScheme. No idea. Matthew From noelwelsh at gmail.com Thu Oct 23 12:13:20 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:31:28 2009 Subject: [plt-scheme] Binding transformers in a macro Message-ID: Oh Great Gods of Syntax Transformation! I am trying to define a form of units that 1. Is linked at expansion time (so there is no indirection at evaluation time; i.e. defunctorisation) 2. Allow macro (aka transformer) imports The second one is tripping me up. I call tell if an import is a transformer with this piece of code: (define-for-syntax (transformer? id) (if (and (identifier? id) (syntax-local-value id (lambda () #f))) #t #f)) I thought I could define imports using the following piece of code: (define-for-syntax (make-define-form import-id real-import-id context) (if (transformer? real-import-id) (let ([transformer (syntax-local-value real-import-id)]) (datum->syntax context `(define-syntax ,import-id ,transformer))) (datum->syntax context `(define ,import-id ,real-import-id)))) But alas! I get an error: compile: bad syntax; literal data is not allowed, because no #%datum syntax transformer is bound in: # Here is the complete code: #lang scheme/base (require (for-syntax scheme/base)) (define-for-syntax (transformer? id) (if (and (identifier? id) (syntax-local-value id (lambda () #f))) #t #f)) (define-for-syntax (make-define-form import-id real-import-id context) (if (transformer? real-import-id) (let ([transformer (syntax-local-value real-import-id)]) (datum->syntax context `(define-syntax ,import-id ,transformer))) (datum->syntax context `(define ,import-id ,real-import-id)))) (define-syntax (define-unet stx) (syntax-case stx (import export) [(define-unet name (import import-id ...) (export export-id ...) impl-expr ...) (syntax (define-syntax (name stx) (syntax-case stx (import export) [(_ (import real-import-id (... ...)) (export real-export-id (... ...))) (with-syntax ([(import (... ...)) (map (lambda (id real-id) (make-define-form id real-id stx)) (syntax->list (syntax (import-id ...))) (syntax->list (syntax (real-import-id (... ...)))))]) (syntax (begin import (... ...) (define-values (real-export-id (... ...)) (let () impl-expr ... (values export-id ...))) )))])))])) (provide define-unet) #lang scheme/base (require (planet schematics/schemeunit:3) "unet.ss") (define-unet basic-unet (import foo bar) (export baz quux) (define baz foo) (define quux bar)) (basic-unet (import (lambda () 'foo) (lambda () 'bar)) (export basic-baz basic-quux)) (basic-unet (import (lambda () 'burp) (lambda () 'belch)) (export burp-baz burp-quux)) (define-unet macro-unet (import parameterize-form) (export foo) (define (foo) (let ([op (open-output-string)]) (parameterize-form ([current-output-port op]) (display "foo")) (get-output-string op)))) (macro-unet (import parameterize) (export macro-foo)) (define/provide-test-suite unet-tests (test-case "basic unet" (check-eq? (basic-baz) 'foo) (check-eq? (basic-quux) 'bar) (check-eq? (burp-baz) 'burp) (check-eq? (burp-quux) 'belch)) (test-case "macro unet" (check-equal? "foo" (foo)))) Your help, as always, is much appreciated. N. From mflatt at cs.utah.edu Thu Oct 23 12:27:16 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:31:28 2009 Subject: [plt-scheme] Binding transformers in a macro In-Reply-To: References: Message-ID: <20081023162717.39BB665008C@mail-svr1.cs.utah.edu> At Thu, 23 Oct 2008 17:13:20 +0100, "Noel Welsh" wrote: > Oh Great Gods of Syntax Transformation! They've never answered me... > I thought I could define imports using the following piece of code: > > (define-for-syntax (make-define-form import-id real-import-id context) > (if (transformer? real-import-id) > (let ([transformer (syntax-local-value real-import-id)]) > (datum->syntax context > `(define-syntax ,import-id ,transformer))) > (datum->syntax context > `(define ,import-id ,real-import-id)))) > > But alas! I get an error: > > compile: bad syntax; literal data is not allowed, because no #%datum > syntax transformer is bound in: # The immediate problem is that you're using `context' to get the lexical context, but the syntax object bound to `context' doesn't have a `(require (for-syntax scheme/base))' in its context. Why not just #`(define-syntax #,import-id #,transformer) ? Also, 3-D syntax (injecting the procedure bound to `transformer') is probably a bad idea. If I understand, then #`(define-syntax #,import-id (make-rename-transformer #'#,real-import-id)) is probably better. You meant `(macro-foo)' and not `(foo)' at the end of your test, right? From mflatt at cs.utah.edu Thu Oct 23 12:32:03 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:31:28 2009 Subject: [plt-scheme] Binding transformers in a macro In-Reply-To: <20081023162717.39BB665008C@mail-svr1.cs.utah.edu> References: <20081023162717.39BB665008C@mail-svr1.cs.utah.edu> Message-ID: <20081023163203.A89C0650091@mail-svr1.cs.utah.edu> Actually, I think you always want just #`(define-syntax #,import-id (make-rename-transformer #'#,real-import-id)) That will work whether `real-import-id' has a regular or transformer binding, so you don't need the `transformer?' test. At Thu, 23 Oct 2008 17:13:20 +0100, "Noel Welsh" wrote: > (define-for-syntax (make-define-form import-id real-import-id context) > (if (transformer? real-import-id) > (let ([transformer (syntax-local-value real-import-id)]) > (datum->syntax context > `(define-syntax ,import-id ,transformer))) > (datum->syntax context > `(define ,import-id ,real-import-id)))) From pedro.e.pinto at gmail.com Thu Oct 23 14:28:02 2008 From: pedro.e.pinto at gmail.com (pp) Date: Thu Mar 26 02:31:28 2009 Subject: [plt-scheme] Bug in process function call? Message-ID: Hi there, I have been unable to kill a process started through the "process" call on Windows XP. The snippet below illustrates. I used notepad as an example but launching mzscheme itself also presents the same problem - except that mzscheme does get killed when stdin is closed. tia, -pp #lang scheme (require scheme/system) (define l (process "notepad")) (define stdout (first l)) (define stdin (second l)) (define ex (third l)) (define stderr (fourth l)) (define ctrl (fifth l)) (define (pause) (read-line) (void)) (ctrl 'status) (pause) (printf "Kill~n") (ctrl 'kill) (ctrl 'status) (pause) (printf "close stdout~n") (close-input-port stdout) (ctrl 'status) (pause) (printf "close stderr~n") (close-input-port stderr) (ctrl 'status) (pause) (printf "close stdin~n") (close-output-port stdin) (ctrl 'status) (pause) From mflatt at cs.utah.edu Thu Oct 23 17:39:13 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:31:28 2009 Subject: [plt-scheme] Bug in process function call? In-Reply-To: References: Message-ID: <20081023213914.533C46500A2@mail-svr1.cs.utah.edu> At Thu, 23 Oct 2008 11:28:02 -0700 (PDT), pp wrote: > I have been unable to kill a process started through the "process" > call on Windows XP. The snippet below illustrates. I used notepad as > an example but launching mzscheme itself also presents the same > problem - except that mzscheme does get killed when stdin is closed. When you use `process' or `system', the immediate subprocess is a shell (i.e., cmd.exe). So you're killing the shell that started Notepad, but not Notepad itself. If you use `(process* "c:/windows/notepad.exe")', then the 'kill control should work as you expect. Meanwhile, MzScheme exits when its stdin is closed, so that's why MzScheme exits when you close the ports. Matthew From gherson at snet.net Thu Oct 23 18:15:35 2008 From: gherson at snet.net (George Herson) Date: Thu Mar 26 02:31:29 2009 Subject: [plt-scheme] More document (newbie) Message-ID: <302141.98522.qm@web81304.mail.mud.yahoo.com> A better writeup in More, please, including of parameterize (which also should be in the Guide (or, if it already is, under mixins, can it be made clearer that this is the same command?)). Excellent choice of subject (web service), just not nearly clear enough yet, thanks alot. Thanks also, Ernie and Michael, for your info. I'll need to work with it... george ----- Original Message ---- From: Robby Findler To: George Herson Cc: Ernie Smith ; PLT Scheme List Sent: Wednesday, October 22, 2008 8:59:32 AM Subject: Re: [plt-scheme] More document (newbie) Are you after a better writup in more, or are you still interested in learning what parameterize is for yourself? Robby On Wed, Oct 22, 2008 at 7:34 AM, George Herson wrote: > When you read http://docs.plt-scheme.org/reference/ are you struck by the simplicity, or glad that you now have a http://docs.plt-scheme.org/guide/? > > How would you explain the parameterize command, at least as used in http://docs.plt-scheme.org/more/? > > BTW, I agree with the other emails of countervailing support arising in my complaint's aftermath; i see potential here or I would be elsewhere. > > thanks, > george > > > > ----- Original Message ---- > From: Ernie Smith > To: George Herson ; PLT Scheme List > Sent: Tuesday, October 21, 2008 9:09:40 PM > Subject: Re: [plt-scheme] More document (newbie) > > Simplifying the language?? > > That would be a challenge. > I don't think languages get much simpler. > The only bloat, if any, can be attributed to that double edged sword > standardization. > > The problem I find with getting up to speed isn't the language at all. > It's me. > 25 years of bloated languages addles the brain. > Maybe you are experiencing something similar. > Try not to think in terms of what you already know, come at it fresh. > > It's the unlearning curve that needs flattening. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From noelwelsh at gmail.com Thu Oct 23 20:22:46 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:31:29 2009 Subject: [plt-scheme] Binding transformers in a macro In-Reply-To: <20081023162717.39BB665008C@mail-svr1.cs.utah.edu> References: <20081023162717.39BB665008C@mail-svr1.cs.utah.edu> Message-ID: On Thu, Oct 23, 2008 at 5:27 PM, Matthew Flatt wrote: > At Thu, 23 Oct 2008 17:13:20 +0100, "Noel Welsh" wrote: >> Oh Great Gods of Syntax Transformation! > > They've never answered me... > Well, it worked for me... > #`(define-syntax #,import-id (make-rename-transformer #'#,real-import-id)) > > is probably better. This works, but I don't fully understand why. In particular I don't understand what the #'#, does. I understand is produces syntax like (unsyntax ) but what is it that then interprets the unsyntax? The reader, when it reads the expanded code from the syntax transformer I guess. This is necessary to give the real-import-id the correct context, but I thought syntax carried its context with it (I assumed this is how hygiene works). I suppose I need to do some reading. > You meant `(macro-foo)' and not `(foo)' at the end of your test, right? Yes. Thanks again, Noel From marek at xivilization.net Fri Oct 24 02:35:48 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:31:29 2009 Subject: [plt-scheme] Build failures on Debian Etch Message-ID: <20081024083548.58ff889f@halmanfloyd.lan.local> Hi, I just tried building PLT 4.1.1 on Debian Etch and while ./confure runs fine, make fails to build the JIT when I activate the pthread & places options (not sure which one of these exactly, I built it once with both and once without). pthreads are probably rather important, no idea what places is, though. When trying to make install, it runs for quite some time and finally exits like this: setup-plt: rendering: algol60/algol60.scrbl setup-plt: rendering: browser/browser.scrbl setup-plt: rendering: games/cards/cards.scrbl setup-plt: rendering: compiler/cffi.scrbl setup-plt: rendering: config/config.scrbl setup-plt: rendering: scribblings/drscheme/drscheme.scrbl setup-plt: rendering: dynext/dynext.scrbl setup-plt: rendering: embedded-gui/scribblings/embedded-gui.scrbl setup-plt: rendering: eopl/eopl.scrbl setup-plt: rendering: scribblings/foreign/foreign.scrbl setup-plt: rendering: scribblings/framework/framework.scrbl make[1]: *** [install-3m] Killed make[1]: Leaving directory `/home/marek/plt/plt-4.1.1/src' make: *** [install] Error 2 Let me know if you need more information. regards, Marek From noelwelsh at gmail.com Fri Oct 24 02:51:01 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:31:29 2009 Subject: [plt-scheme] Build failures on Debian Etch In-Reply-To: <20081024083548.58ff889f@halmanfloyd.lan.local> References: <20081024083548.58ff889f@halmanfloyd.lan.local> Message-ID: On Fri, Oct 24, 2008 at 7:35 AM, Marek Kubica wrote: > I just tried building PLT 4.1.1 on Debian Etch and while ./confure runs > fine, make fails to build the JIT when I activate the pthread & places > options (not sure which one of these exactly, I built it once with > both and once without). > pthreads are probably rather important, no idea what places is, though. Can you build without these options? I've never needed to explicitly set either, and it is possible these options are suffering from bit-rot. N. From marek at xivilization.net Fri Oct 24 03:08:10 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:31:29 2009 Subject: [plt-scheme] Build failures on Debian Etch In-Reply-To: References: <20081024083548.58ff889f@halmanfloyd.lan.local> Message-ID: <20081024090810.03f36cb9@halmanfloyd.lan.local> On Fri, 24 Oct 2008 07:51:01 +0100 "Noel Welsh" wrote: > Can you build without these options? I've never needed to explicitly > set either, and it is possible these options are suffering from > bit-rot. Yes, I can build it. make install fails, though (se my first email for the error message). It seems to get killed while rendering docs, so it installs *something*, but that's not really a successful installation when make just exists due to problems. Here's what I needed to reproduce the build failure (--enable-pthread works, it is just this --enable-places-thing which makes the build fail) ./configure --prefix=$HOME/plt --enable-shared --disable-mred --disable-gl --disable-xrender --disable-xft --disable-cairo --enable-places (works) make (works quite some time, then fails) gcc -g -O2 -Wall -DMZ_USE_PLACES -DMZ_USES_SHARED_LIB -I./.. -I./../include -c ./jit.c -fPIC -DPIC -o .libs/jit.o ./jit.c: In function 'generate_direct_prim_tail_call': ./jit.c:1594: warning: cast from pointer to integer of different size ./jit.c: In function 'generate_tail_call': ./jit.c:1632: warning: cast from pointer to integer of different size ./jit.c:1698: warning: cast from pointer to integer of different size ./jit.c:1714: warning: cast from pointer to integer of different size ./jit.c: In function 'generate_direct_prim_non_tail_call': ./jit.c:1775: warning: cast from pointer to integer of different size ./jit.c: In function 'generate_retry_call': ./jit.c:1814: warning: cast from pointer to integer of different size ./jit.c:1822: warning: cast from pointer to integer of different size ./jit.c: In function 'generate_non_tail_call': ./jit.c:1901: warning: cast from pointer to integer of different size ./jit.c:1960: warning: cast from pointer to integer of different size ./jit.c:2010: warning: cast from pointer to integer of different size ./jit.c:2036: warning: cast from pointer to integer of different size ./jit.c:2085: warning: cast from pointer to integer of different size ./jit.c: In function 'generate_app': ./jit.c:2530: warning: cast from pointer to integer of different size ./jit.c: In function 'generate_inlined_binary': ./jit.c:4391: warning: cast from pointer to integer of different size ./jit.c:4420: warning: cast from pointer to integer of different size ./jit.c: In function 'generate_closure': ./jit.c:4659: warning: cast from pointer to integer of different size ./jit.c: In function 'generate_case_closure': ./jit.c:4756: warning: cast from pointer to integer of different size ./jit.c: In function 'generate_non_tail_mark_pos_prefix': ./jit.c:4802: warning: cast from pointer to integer of different size ./jit.c:4804: warning: cast from pointer to integer of different size ./jit.c: In function 'generate_non_tail_mark_pos_suffix': ./jit.c:4810: warning: cast from pointer to integer of different size ./jit.c:4812: warning: cast from pointer to integer of different size ./jit.c: In function 'generate_non_tail': ./jit.c:4837: warning: cast from pointer to integer of different size ./jit.c:4874: warning: cast from pointer to integer of different size ./jit.c: In function 'generate': ./jit.c:5062: warning: cast from pointer to integer of different size ./jit.c:5096: warning: cast from pointer to integer of different size ./jit.c:5137: warning: cast from pointer to integer of different size ./jit.c:5200: warning: cast from pointer to integer of different size ./jit.c:5203: warning: cast from pointer to integer of different size ./jit.c:5247: warning: cast from pointer to integer of different size ./jit.c:5293: warning: cast from pointer to integer of different size ./jit.c:5340: warning: cast from pointer to integer of different size ./jit.c:5615: warning: cast from pointer to integer of different size ./jit.c:5634: warning: cast from pointer to integer of different size ./jit.c:5682: warning: cast from pointer to integer of different size ./jit.c:5806: warning: cast from pointer to integer of different size ./jit.c: In function 'generate_function_prolog': ./jit.c:5908: warning: cast from pointer to integer of different size ./jit.c: In function 'do_generate_common': ./jit.c:6003: warning: cast from pointer to integer of different size ./jit.c:6018: warning: cast from pointer to integer of different size ./jit.c:6054: warning: cast from pointer to integer of different size ./jit.c:6110: warning: cast from pointer to integer of different size ./jit.c:6160: warning: cast from pointer to integer of different size ./jit.c:6221: warning: cast from pointer to integer of different size ./jit.c:6230: warning: cast from pointer to integer of different size ./jit.c:6260: warning: cast from pointer to integer of different size ./jit.c:6271: warning: cast from pointer to integer of different size ./jit.c:6288: warning: cast from pointer to integer of different size ./jit.c:6305: warning: cast from pointer to integer of different size ./jit.c:6320: warning: cast from pointer to integer of different size ./jit.c:6385: warning: cast from pointer to integer of different size ./jit.c:6400: warning: cast from pointer to integer of different size ./jit.c:6510: warning: cast from pointer to integer of different size ./jit.c:6527: warning: cast from pointer to integer of different size ./jit.c:6646: warning: cast from pointer to integer of different size ./jit.c:6728: warning: cast from pointer to integer of different size ./jit.c:6739: warning: cast from pointer to integer of different size ./jit.c: In function 'do_generate_closure': ./jit.c:6999: warning: cast from pointer to integer of different size ./jit.c: In function 'generate_case_lambda_dispatch': ./jit.c:7420: warning: cast from pointer to integer of different size /home/marek/plt/plt-4.1.1/src/lt/libtool --mode=compile --tag=CC gcc -g -O2 -Wall -DMZ_USE_PLACES -DMZ_USES_SHARED_LIB -I./.. -I./../include -c ./list.c -o list.lo gcc -g -O2 -Wall -DMZ_USE_PLACES -DMZ_USES_SHARED_LIB -I./.. -I./../include -c ./list.c -fPIC -DPIC -o .libs/list.o /home/marek/plt/plt-4.1.1/src/lt/libtool --mode=compile --tag=CC gcc -g -O2 -Wall -DMZ_USE_PLACES -DMZ_USES_SHARED_LIB -I./.. -I./../include -c ./module.c -o module.lo gcc -g -O2 -Wall -DMZ_USE_PLACES -DMZ_USES_SHARED_LIB -I./.. -I./../include -c ./module.c -fPIC -DPIC -o .libs/module.o /home/marek/plt/plt-4.1.1/src/lt/libtool --mode=compile --tag=CC gcc -g -O2 -Wall -DMZ_USE_PLACES -DMZ_USES_SHARED_LIB -I./.. -I./../include -c ./mzrt.c -o mzrt.lo gcc -g -O2 -Wall -DMZ_USE_PLACES -DMZ_USES_SHARED_LIB -I./.. -I./../include -c ./mzrt.c -fPIC -DPIC -o .libs/mzrt.o ./mzrt.c: In function 'mz_proc_thread_create': ./mzrt.c:174: warning: implicit declaration of function 'GC_pthread_create' ./mzrt.c: In function 'mz_proc_thread_wait': ./mzrt.c:191: warning: implicit declaration of function 'GC_pthread_join' ./mzrt.c: At top level: ./mzrt.c:212: error: expected specifier-qualifier-list before 'pthread_rwlock_t' ./mzrt.c: In function 'mzrt_rwlock_create': ./mzrt.c:217: warning: implicit declaration of function 'pthread_rwlock_init' ./mzrt.c:217: error: 'mzrt_rwlock' has no member named 'lock' ./mzrt.c: In function 'mzrt_rwlock_rdlock': ./mzrt.c:221: warning: implicit declaration of function 'pthread_rwlock_rdlock' ./mzrt.c:221: error: 'mzrt_rwlock' has no member named 'lock' ./mzrt.c: In function 'mzrt_rwlock_wrlock': ./mzrt.c:225: warning: implicit declaration of function 'pthread_rwlock_wrlock' ./mzrt.c:225: error: 'mzrt_rwlock' has no member named 'lock' ./mzrt.c: In function 'mzrt_rwlock_tryrdlock': ./mzrt.c:229: warning: implicit declaration of function 'pthread_rwlock_tryrdlock' ./mzrt.c:229: error: 'mzrt_rwlock' has no member named 'lock' ./mzrt.c: In function 'mzrt_rwlock_trywrlock': ./mzrt.c:233: warning: implicit declaration of function 'pthread_rwlock_trywrlock' ./mzrt.c:233: error: 'mzrt_rwlock' has no member named 'lock' ./mzrt.c: In function 'mzrt_rwlock_unlock': ./mzrt.c:236: warning: implicit declaration of function 'pthread_rwlock_unlock' ./mzrt.c:236: error: 'mzrt_rwlock' has no member named 'lock' ./mzrt.c: In function 'mzrt_rwlock_destroy': ./mzrt.c:240: warning: implicit declaration of function 'pthread_rwlock_destroy' ./mzrt.c:240: error: 'mzrt_rwlock' has no member named 'lock' make[6]: *** [mzrt.lo] Error 1 make[6]: Leaving directory `/home/marek/plt/plt-4.1.1/src/mzscheme/src' make[5]: *** [all] Error 2 make[5]: Leaving directory `/home/marek/plt/plt-4.1.1/src/mzscheme/src' make[4]: *** [mzlibrary] Error 2 make[4]: Leaving directory `/home/marek/plt/plt-4.1.1/src/mzscheme' make[3]: *** [cgc] Error 2 make[3]: Leaving directory `/home/marek/plt/plt-4.1.1/src/mzscheme' make[2]: *** [3m] Error 2 make[2]: Leaving directory `/home/marek/plt/plt-4.1.1/src/mzscheme' make[1]: *** [3m] Error 2 make[1]: Leaving directory `/home/marek/plt/plt-4.1.1/src' make: *** [all] Error 2 regards, Marek From marek at xivilization.net Fri Oct 24 10:05:01 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:31:29 2009 Subject: [plt-scheme] Build failures on Debian Etch In-Reply-To: <20081024130011.98E076500AF@mail-svr1.cs.utah.edu> References: <20081024083548.58ff889f@halmanfloyd.lan.local> <20081024130011.98E076500AF@mail-svr1.cs.utah.edu> Message-ID: <20081024160501.2874dfc3@halmanfloyd.lan.local> On Fri, 24 Oct 2008 07:00:10 -0600 Matthew Flatt wrote: > Do you have any memory-use limits set? In 4.1.1, setup-plt can start > using a lot more memory around this point --- well over 200 MB. Also, > "Killed" above suggests that an external agent terminated the build. Indeed. It seems to have run out of memory and got killed by the kernel OOM. I don't really have self-imposed memory restrictions, the limit are 768 MB RAM of the virtual server. Didn't expect that building the docs would take so much memory. > Memory use for building documentation is improved in our current > sources and the upcoming release, so that setup-plt stays below 200 > MB. You might want to try a more recent pre-release version from here: > > http://pre.plt-scheme.org/installers/ Nice, with the 4.1.1.3 installer it compiles and works. Although the memory usage was still quite high, I observed peaks of 285m and 319m (RES) in top. That probably comes at the cost of using amd64. Thanks for pointing me to the pre-release. I seem to be quite lucky so that my problems are usually fixed by the following PLT release :) regards, Marek From wand at ccs.neu.edu Fri Oct 24 11:28:21 2008 From: wand at ccs.neu.edu (Mitchell Wand) Date: Thu Mar 26 02:31:30 2009 Subject: [plt-scheme] [Scheme Steering Committee announcements] Scheme Language Steering Committee election: comment period is open Message-ID: <1bd18ad50810240828v1072f12l1861fa84dcea7845@mail.gmail.com> Skipped content of type multipart/alternative-------------- next part -------------- _______________________________________________ Scheme-announcements mailing list Scheme-announcements@lists.ccs.neu.edu https://lists.ccs.neu.edu/bin/listinfo/scheme-announcements From wand at ccs.neu.edu Fri Oct 24 11:28:21 2008 From: wand at ccs.neu.edu (Mitchell Wand) Date: Thu Mar 26 02:31:31 2009 Subject: [plt-scheme] [Scheme Steering Committee announcements] Scheme Language Steering Committee election: comment period is open Message-ID: <1bd18ad50810240828v1072f12l1861fa84dcea7845@mail.gmail.com> Skipped content of type multipart/alternative-------------- next part -------------- _______________________________________________ Scheme-announcements mailing list Scheme-announcements@lists.ccs.neu.edu https://lists.ccs.neu.edu/bin/listinfo/scheme-announcements From marek at xivilization.net Fri Oct 24 12:10:51 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:31:31 2009 Subject: [plt-scheme] Proxying the PLT web server? In-Reply-To: <779bf2730810222243i78929a18s34c67b7add9723f2@mail.gmail.com> References: <20081023005607.0a7ff675@halmanfloyd.lan.local> <20081023010220.6371f0c1@halmanfloyd.lan.local> <779bf2730810221618j59ea5037l746ddcbaa744f99@mail.gmail.com> <20081023.041919.154259935.maxigas@anargeek.net> <779bf2730810222243i78929a18s34c67b7add9723f2@mail.gmail.com> Message-ID: <20081024181051.67adc2fa@halmanfloyd.lan.local> On Wed, 22 Oct 2008 22:43:55 -0700 YC wrote: > mod_rewrite is another possible solution with Apache, but if your > outputs contain links that need to be rewritten (i.e. removing > prefixes such as /servlets/), than you probably need more than just > mod_rewrite. I have yet to try what happens with URLs that the web server generates, but I got that stuff running now. mod_ssl was a big problematic, since I've got cascaded CAs, but once it found all certificates, logging in was easy. Then I just added mod_headers to add a X-UserName header and mod_proxy(_http) to forward the connections to the internal PLT web server. Works like a charm now, awesome! I decided against using the HTTPS server that is provided by PLT since setting up such routine stuff can be made in Apache without problems and when I update to 2.2.8 I'll be able to use SNI (=multiple VHosts) without problems. Now I need to set up the PLT server properly, so I can use more then just one servlet at a time, but that should be really easy now. Thanks for the help! If anyone is interested in the configuration, I can mail it. regards, Marek From clements at brinckerhoff.org Fri Oct 24 17:50:14 2008 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:31:32 2009 Subject: [plt-scheme] Science collection docs: fantastic! Message-ID: <8E55DA5C-93B5-401A-8E68-DCF5EBA34B1C@brinckerhoff.org> Your scribble docs for the science.plt collection are really well-done. Thanks! John Clements -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2484 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081024/32de78f1/smime.bin From yinso.chen at gmail.com Fri Oct 24 19:33:22 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:31:32 2009 Subject: [plt-scheme] dynamic-*un*-require? Message-ID: <779bf2730810241633i82aaf4bj9f3fa15535553c70@mail.gmail.com> Hi all - is there a way to achieve the opposite of dynamic-require? i.e. unload a previously loaded module. I am interested in "reloading" a dynamic loaded module, but it appears that once a module is loaded, it cannot be reloaded, so I'm wondering how it can be achieved. Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081024/8434fcd6/attachment.htm From robby at cs.uchicago.edu Fri Oct 24 21:04:20 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:31:32 2009 Subject: [plt-scheme] dynamic-*un*-require? In-Reply-To: <779bf2730810241633i82aaf4bj9f3fa15535553c70@mail.gmail.com> References: <779bf2730810241633i82aaf4bj9f3fa15535553c70@mail.gmail.com> Message-ID: <932b2f1f0810241804l246bcf2dvb16aee0d80e573a8@mail.gmail.com> There used to be something where if you were to evaluate the code for the module it would be instantiated right away in the namespace where it was previously. I don't know if that still works. But anyways, that seems hard to use effectively. A better approach is probably to create a new namespace (possibly one that shares some modules with another namespace if that is safe) and just reload the module there. Robby On Fri, Oct 24, 2008 at 6:33 PM, YC wrote: > Hi all - > > is there a way to achieve the opposite of dynamic-require? i.e. unload a > previously loaded module. > > I am interested in "reloading" a dynamic loaded module, but it appears that > once a module is loaded, it cannot be reloaded, so I'm wondering how it can > be achieved. > > Thanks, > yc > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From robertjparks at gmail.com Fri Oct 24 21:31:22 2008 From: robertjparks at gmail.com (rob) Date: Thu Mar 26 02:31:32 2009 Subject: [plt-scheme] XML schema equivalent but for scheme s-expressions Message-ID: <1264e773-401f-4f1a-a5f7-4a9a3d5aea5e@f37g2000pri.googlegroups.com> Hi all, I am working on a project where I want to use s-expressions to store some complex configuration information and I want an easy way to validate it. If the configuration was in XML I would simply write an XML schema and use a validating XML parser to validate it. Is there anything like this out there for normal scheme s-expressions? Also, is there an easy way to get line numbers when reading in an external file of s-expressions? For example, if I determine there is a problem with some part of the configuration, is there a way that I can get the line number to print a message to the user where the problem occurred? Thanks and sorry if these are easy questions. I am new to lisp/scheme. -Rob From mflatt at cs.utah.edu Fri Oct 24 21:53:41 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:31:33 2009 Subject: [plt-scheme] dynamic-*un*-require? In-Reply-To: <779bf2730810241633i82aaf4bj9f3fa15535553c70@mail.gmail.com> References: <779bf2730810241633i82aaf4bj9f3fa15535553c70@mail.gmail.com> Message-ID: <20081025015344.8B7486500A2@mail-svr1.cs.utah.edu> At Fri, 24 Oct 2008 16:33:22 -0700, YC wrote: > I am interested in "reloading" a dynamic loaded module, but it appears that > once a module is loaded, it cannot be reloaded, so I'm wondering how it can > be achieved. The `enter!' form of `scheme/enter' re-loads a module when its file timestamp changes --- as long as the module was originally loaded via `enter!'. I imagine that's not exactly what you need, but the implementation in "collects/scheme/enter.ss" might give you some ideas. Matthew From yinso.chen at gmail.com Sat Oct 25 07:43:44 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:31:33 2009 Subject: [plt-scheme] dynamic-*un*-require? In-Reply-To: <20081025015344.8B7486500A2@mail-svr1.cs.utah.edu> References: <779bf2730810241633i82aaf4bj9f3fa15535553c70@mail.gmail.com> <20081025015344.8B7486500A2@mail-svr1.cs.utah.edu> Message-ID: <779bf2730810250443k508967eeu958388760041178c@mail.gmail.com> On Fri, Oct 24, 2008 at 6:53 PM, Matthew Flatt wrote: > > The `enter!' form of `scheme/enter' re-loads a module when its file > timestamp changes --- as long as the module was originally loaded via > `enter!'. > Matthew - this is way cool! From the implementation it seems that the core ideas are: 1. use custom load/used-compiled-handler to keep track of module dependencies and timestamps 2. when loading a module, verify that its dependency also needs to be reloaded. 3. `eval` *is* what causes the module to be recompiled. The part where I don't understand the usage of `module->namespace` to reset `current-namespace`. Doesn't that mean if I have symbols introduced via other means they are no longer visible? Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081025/5a840d31/attachment.html From yinso.chen at gmail.com Sat Oct 25 07:43:53 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:31:34 2009 Subject: [plt-scheme] dynamic-*un*-require? In-Reply-To: <932b2f1f0810241804l246bcf2dvb16aee0d80e573a8@mail.gmail.com> References: <779bf2730810241633i82aaf4bj9f3fa15535553c70@mail.gmail.com> <932b2f1f0810241804l246bcf2dvb16aee0d80e573a8@mail.gmail.com> Message-ID: <779bf2730810250443n1812edaaj9127a1d64e903c3d@mail.gmail.com> On Fri, Oct 24, 2008 at 6:04 PM, Robby Findler wrote: > There used to be something where if you were to evaluate the code for > the module it would be instantiated right away in the namespace where > it was previously. I don't know if that still works. But anyways, that > seems hard to use effectively. A better approach is probably to create > a new namespace (possibly one that shares some modules with another > namespace if that is safe) and just reload the module there. > > Thanks for the tip Robby - a couple of follow up questions 1. how do I use code from another namespace within the current namespace? I can think of parameterizing current-namespace, but that means I would have to remember which function belongs in which namespace... 2. does the namespace (and the loaded module) gets garbage collected automatically if I delete the reference to them? Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081025/00feb8ca/attachment.htm From mflatt at cs.utah.edu Sat Oct 25 08:03:30 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:31:34 2009 Subject: [plt-scheme] dynamic-*un*-require? In-Reply-To: <779bf2730810250443k508967eeu958388760041178c@mail.gmail.com> References: <779bf2730810241633i82aaf4bj9f3fa15535553c70@mail.gmail.com> <20081025015344.8B7486500A2@mail-svr1.cs.utah.edu> <779bf2730810250443k508967eeu958388760041178c@mail.gmail.com> Message-ID: <20081025120332.DD02C6500A2@mail-svr1.cs.utah.edu> At Sat, 25 Oct 2008 04:43:44 -0700, YC wrote: > On Fri, Oct 24, 2008 at 6:53 PM, Matthew Flatt wrote: > > > > > The `enter!' form of `scheme/enter' re-loads a module when its file > > timestamp changes --- as long as the module was originally loaded via > > `enter!'. > > > > Matthew - this is way cool! From the implementation it seems that the core > ideas are: > > 1. use custom load/used-compiled-handler to keep track of module > dependencies and timestamps > > 2. when loading a module, verify that its dependency also needs to be > reloaded. > > 3. `eval` *is* what causes the module to be recompiled. Yes, essentially. More precisely, the `get-module-code' function actually recompiles the module. The `eval' call takes that compiled code and registers it as the module's declaration. > The part where I don't understand the usage of `module->namespace` to reset > `current-namespace`. Doesn't that mean if I have symbols introduced via > other means they are no longer visible? Right --- but that's what `enter!' is supposed to do. It supposed to "enter" the module body by switching the current namespace to the module's namespace. Probably you want something like `enter!', but without switching the namespace. Matthew From mflatt at cs.utah.edu Sat Oct 25 08:06:06 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:31:34 2009 Subject: [plt-scheme] dynamic-*un*-require? In-Reply-To: <779bf2730810250443n1812edaaj9127a1d64e903c3d@mail.gmail.com> References: <779bf2730810241633i82aaf4bj9f3fa15535553c70@mail.gmail.com> <932b2f1f0810241804l246bcf2dvb16aee0d80e573a8@mail.gmail.com> <779bf2730810250443n1812edaaj9127a1d64e903c3d@mail.gmail.com> Message-ID: <20081025120608.CBA996500A2@mail-svr1.cs.utah.edu> At Sat, 25 Oct 2008 04:43:53 -0700, YC wrote: > On Fri, Oct 24, 2008 at 6:04 PM, Robby Findler wrote: > > > There used to be something where if you were to evaluate the code for > > the module it would be instantiated right away in the namespace where > > it was previously. I don't know if that still works. But anyways, that > > seems hard to use effectively. A better approach is probably to create > > a new namespace (possibly one that shares some modules with another > > namespace if that is safe) and just reload the module there. > > > Thanks for the tip Robby - a couple of follow up questions > > 1. how do I use code from another namespace within the current namespace? > I can think of parameterizing current-namespace, but that means I would have > to remember which function belongs in which namespace... Right. > 2. does the namespace (and the loaded module) gets garbage collected > automatically if I delete the reference to them? Yes. Matthew From yinso.chen at gmail.com Sat Oct 25 08:15:14 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:31:35 2009 Subject: [plt-scheme] dynamic-*un*-require? In-Reply-To: <20081025120332.DD02C6500A2@mail-svr1.cs.utah.edu> References: <779bf2730810241633i82aaf4bj9f3fa15535553c70@mail.gmail.com> <20081025015344.8B7486500A2@mail-svr1.cs.utah.edu> <779bf2730810250443k508967eeu958388760041178c@mail.gmail.com> <20081025120332.DD02C6500A2@mail-svr1.cs.utah.edu> Message-ID: <779bf2730810250515n22a70cc6jedd43605121d19ec@mail.gmail.com> On Sat, Oct 25, 2008 at 5:03 AM, Matthew Flatt wrote: > > > The part where I don't understand the usage of `module->namespace` to > reset > > `current-namespace`. Doesn't that mean if I have symbols introduced via > > other means they are no longer visible? > > Right --- but that's what `enter!' is supposed to do. It supposed to > "enter" the module body by switching the current namespace to the > module's namespace. > > Probably you want something like `enter!', but without switching the > namespace. > Thanks Matthew for the explanation - this gives me ideas on how to go about handling reloading the modules ;) Very appreciated! yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081025/316d5a32/attachment.html From robby at cs.uchicago.edu Sat Oct 25 09:20:15 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:31:35 2009 Subject: [plt-scheme] dynamic-*un*-require? In-Reply-To: <779bf2730810250443n1812edaaj9127a1d64e903c3d@mail.gmail.com> References: <779bf2730810241633i82aaf4bj9f3fa15535553c70@mail.gmail.com> <932b2f1f0810241804l246bcf2dvb16aee0d80e573a8@mail.gmail.com> <779bf2730810250443n1812edaaj9127a1d64e903c3d@mail.gmail.com> Message-ID: <932b2f1f0810250620n2c3f8803y61e2268fb85755fd@mail.gmail.com> On Sat, Oct 25, 2008 at 6:43 AM, YC wrote: > > > On Fri, Oct 24, 2008 at 6:04 PM, Robby Findler > wrote: >> >> There used to be something where if you were to evaluate the code for >> the module it would be instantiated right away in the namespace where >> it was previously. I don't know if that still works. But anyways, that >> seems hard to use effectively. A better approach is probably to create >> a new namespace (possibly one that shares some modules with another >> namespace if that is safe) and just reload the module there. >> > Thanks for the tip Robby - a couple of follow up questions > > 1. how do I use code from another namespace within the current namespace? > I can think of parameterizing current-namespace, but that means I would have > to remember which function belongs in which namespace... Instead of by function, you'd do it by module. You can use namespace-attach-module to bring a module over from one namespace to another. > 2. does the namespace (and the loaded module) gets garbage collected > automatically if I delete the reference to them? Yes. Robby > Thanks, > yc > > From marek at xivilization.net Sat Oct 25 09:44:40 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:31:35 2009 Subject: [plt-scheme] plt-web-server configuration Message-ID: <20081025154440.3db7ac75@halmanfloyd.lan.local> Hi, I am trying to set up the PLT web server so that it works for me. For that I need some adjustments to the default configuration. Currently, the server is using the path /home/marek/plt/lib/plt/collects/web-server/default-web-root/ for everything. But I want to tell the server always to start on port 4113, listen on localhost, serve servlets from my own servlet directory, use a specific prefix (the URL to my Apache, which then forwards to PLT) for the automatically generated URLs etc. I saw that plt-web-server accepts the -f option and found out what the current configuration-table is: ((port 80) (max-waiting 40) (initial-connection-timeout 30) (default-host-table (host-table (default-indices "index.html" "index.htm") (log-format parenthesized-default) (messages (servlet-message "servlet-error.html") (authentication-message "forbidden.html") (servlets-refreshed "servlet-refresh.html") (passwords-refreshed "passwords-refresh.html") (file-not-found-message "not-found.html") (protocol-message "protocol-error.html") (collect-garbage "collect-garbage.html")) (timeouts (default-servlet-timeout 30) (password-connection-timeout 300) (servlet-connection-timeout 86400) (file-per-byte-connection-timeout 1/20) (file-base-connection-timeout 30)) (paths (configuration-root "conf") (host-root ".") (log-file-path "log") (file-root "htdocs") (servlet-root ".") (mime-types "mime.types") (password-authentication "passwords")))) (virtual-host-table)) Now, how can I load this configuration table, modify some values like the servlet-path and feed it into the web server? regards, Marek From jay.mccarthy at gmail.com Sat Oct 25 10:33:54 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:31:35 2009 Subject: [plt-scheme] XML schema equivalent but for scheme s-expressions In-Reply-To: <1264e773-401f-4f1a-a5f7-4a9a3d5aea5e@f37g2000pri.googlegroups.com> References: <1264e773-401f-4f1a-a5f7-4a9a3d5aea5e@f37g2000pri.googlegroups.com> Message-ID: First, xexprs (an s-expression representation of xml) might be useful. Look at the xml library. Second, if you read-syntax, rather than read, then you get line numbers. Third, sometimes when I want to do this sort of thing, I make the configuration a program that returns a configuration object of my program. Then, PLT Scheme does the work of parsing and validating, etc. But this is not "safe". Jay On Fri, Oct 24, 2008 at 7:31 PM, rob wrote: > Hi all, I am working on a project where I want to use s-expressions to > store some complex configuration information and I want an easy way to > validate it. If the configuration was in XML I would simply write an > XML schema and use a validating XML parser to validate it. Is there > anything like this out there for normal scheme s-expressions? Also, is > there an easy way to get line numbers when reading in an external file > of s-expressions? For example, if I determine there is a problem with > some part of the configuration, is there a way that I can get the > line number to print a message to the user where the problem occurred? > Thanks and sorry if these are easy questions. I am new to lisp/scheme. > -Rob > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From jay.mccarthy at gmail.com Sat Oct 25 10:38:19 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:31:35 2009 Subject: [plt-scheme] plt-web-server configuration In-Reply-To: <20081025154440.3db7ac75@halmanfloyd.lan.local> References: <20081025154440.3db7ac75@halmanfloyd.lan.local> Message-ID: On Sat, Oct 25, 2008 at 7:44 AM, Marek Kubica wrote: > Hi, > > I am trying to set up the PLT web server so that it works for me. For > that I need some adjustments to the default configuration. > > Currently, the server is using the path > /home/marek/plt/lib/plt/collects/web-server/default-web-root/ > for everything. > > But I want to tell the server always to start on port 4113, listen on > localhost, serve servlets from my own servlet directory, use a specific > prefix (the URL to my Apache, which then forwards to PLT) for the > automatically generated URLs etc. > > I saw that plt-web-server accepts the -f option and found out what the > current configuration-table is: > > ((port 80) > (max-waiting 40) > (initial-connection-timeout 30) > (default-host-table > (host-table > (default-indices "index.html" "index.htm") > (log-format parenthesized-default) > (messages > (servlet-message "servlet-error.html") > (authentication-message "forbidden.html") > (servlets-refreshed "servlet-refresh.html") > (passwords-refreshed "passwords-refresh.html") > (file-not-found-message "not-found.html") > (protocol-message "protocol-error.html") > (collect-garbage "collect-garbage.html")) > (timeouts > (default-servlet-timeout 30) > (password-connection-timeout 300) > (servlet-connection-timeout 86400) > (file-per-byte-connection-timeout 1/20) > (file-base-connection-timeout 30)) > (paths > (configuration-root "conf") > (host-root ".") > (log-file-path "log") > (file-root "htdocs") > (servlet-root ".") > (mime-types "mime.types") > (password-authentication "passwords")))) > (virtual-host-table)) > > Now, how can I load this configuration table, modify some values like > the servlet-path and feed it into the web server? Copy the file to a new location. Change the appropriate values. Start running the web-server via "plt-web-server -f your/new/config" The docs (Sec 1 on running and Sec 5 on the config format) may be useful. I feel like I'm misunderstanding your question. Jay > > regards, > Marek > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From grettke at acm.org Sat Oct 25 10:47:08 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:31:36 2009 Subject: [plt-scheme] XML schema equivalent but for scheme s-expressions In-Reply-To: References: <1264e773-401f-4f1a-a5f7-4a9a3d5aea5e@f37g2000pri.googlegroups.com> Message-ID: <756daca50810250747k7b63ad92mdbb22c6d13236546@mail.gmail.com> On Sat, Oct 25, 2008 at 9:33 AM, Jay McCarthy wrote: > Third, sometimes when I want to do this sort of thing, I make the > configuration a program that returns a configuration object of my > program. Then, PLT Scheme does the work of parsing and validating, > etc. But this is not "safe". Is it safe if you evalaute it within a limited namespace? From jay.mccarthy at gmail.com Sat Oct 25 10:50:33 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:31:36 2009 Subject: [plt-scheme] XML schema equivalent but for scheme s-expressions In-Reply-To: <756daca50810250747k7b63ad92mdbb22c6d13236546@mail.gmail.com> References: <1264e773-401f-4f1a-a5f7-4a9a3d5aea5e@f37g2000pri.googlegroups.com> <756daca50810250747k7b63ad92mdbb22c6d13236546@mail.gmail.com> Message-ID: Yea, and scheme/sandbox helps you define such environments. However, I continually worry about "getting it right". Luckily, I don't write any apps that need an untrusted config. Jay On Sat, Oct 25, 2008 at 8:47 AM, Grant Rettke wrote: > On Sat, Oct 25, 2008 at 9:33 AM, Jay McCarthy wrote: >> Third, sometimes when I want to do this sort of thing, I make the >> configuration a program that returns a configuration object of my >> program. Then, PLT Scheme does the work of parsing and validating, >> etc. But this is not "safe". > > Is it safe if you evalaute it within a limited namespace? > -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From marek at xivilization.net Sat Oct 25 14:18:05 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:31:36 2009 Subject: [plt-scheme] plt-web-server configuration In-Reply-To: References: <20081025154440.3db7ac75@halmanfloyd.lan.local> Message-ID: <20081025201805.23048499@halmanfloyd.lan.local> Hi, On Sat, 25 Oct 2008 08:38:19 -0600 "Jay McCarthy" wrote: > Copy the file to a new location. > Change the appropriate values. > Start running the web-server via "plt-web-server -f your/new/config" > > The docs (Sec 1 on running and Sec 5 on the config format) may be > useful. > > I feel like I'm misunderstanding your question. Maybe I was a bit unclear. I would like to get it programmatically and change it. Because when something changes in the format of the struct, it would break. If I kind-of "inherit" from the default configuration my configuration will be both shorter and more robust. The problem is that -f takes a file containing an S-Expression, so I can't just (require web-server/configuration/configuration-table) and modify the list. Or am I getting it completely wrong? regards, Marek From marek at xivilization.net Sat Oct 25 14:23:15 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:31:36 2009 Subject: [plt-scheme] XML schema equivalent but for scheme s-expressions In-Reply-To: <756daca50810250747k7b63ad92mdbb22c6d13236546@mail.gmail.com> References: <1264e773-401f-4f1a-a5f7-4a9a3d5aea5e@f37g2000pri.googlegroups.com> <756daca50810250747k7b63ad92mdbb22c6d13236546@mail.gmail.com> Message-ID: <20081025202315.3e958e73@halmanfloyd.lan.local> On Sat, 25 Oct 2008 09:47:08 -0500 "Grant Rettke" wrote: > On Sat, Oct 25, 2008 at 9:33 AM, Jay McCarthy > wrote: > > Third, sometimes when I want to do this sort of thing, I make the > > configuration a program that returns a configuration object of my > > program. Then, PLT Scheme does the work of parsing and validating, > > etc. But this is not "safe". > > Is it safe if you evalaute it within a limited namespace? I absolutely understand the concerns about safety, but using Scheme source has also some big advantages against everything else like ease of use (debugging, line numbers etc.) as well as flexibility. In Python-world this is quite common. As long as the program doesn't get compiled it seems to me a valid choice. With sandboxing it would be even better. regards, Marek From jay.mccarthy at gmail.com Sat Oct 25 14:26:07 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:31:36 2009 Subject: [plt-scheme] plt-web-server configuration In-Reply-To: <20081025201805.23048499@halmanfloyd.lan.local> References: <20081025154440.3db7ac75@halmanfloyd.lan.local> <20081025201805.23048499@halmanfloyd.lan.local> Message-ID: Ah, I see. You can use read-configuration-table [1] to read it in, change it, then use configuration-table->web-config@ [2] to get a web-config to link with the web-server unit. Look at the code for the launcher to see how it does it. Jay 1. http://docs.plt-scheme.org/web-server/configuration-table_ss.html 2. http://docs.plt-scheme.org/web-server/web-config-unit_ss.html#(part._.Configuration_.Units) On Sat, Oct 25, 2008 at 12:18 PM, Marek Kubica wrote: > Hi, > > On Sat, 25 Oct 2008 08:38:19 -0600 > "Jay McCarthy" wrote: > >> Copy the file to a new location. >> Change the appropriate values. >> Start running the web-server via "plt-web-server -f your/new/config" >> >> The docs (Sec 1 on running and Sec 5 on the config format) may be >> useful. >> >> I feel like I'm misunderstanding your question. > > Maybe I was a bit unclear. I would like to get it programmatically and > change it. Because when something changes in the format of the struct, > it would break. If I kind-of "inherit" from the default configuration my > configuration will be both shorter and more robust. > > The problem is that -f takes a file containing an S-Expression, so I > can't just (require web-server/configuration/configuration-table) and > modify the list. Or am I getting it completely wrong? > > regards, > Marek > -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From noelwelsh at gmail.com Sat Oct 25 17:08:30 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:31:36 2009 Subject: [plt-scheme] plt-web-server configuration In-Reply-To: <20081025201805.23048499@halmanfloyd.lan.local> References: <20081025154440.3db7ac75@halmanfloyd.lan.local> <20081025201805.23048499@halmanfloyd.lan.local> Message-ID: On Sat, Oct 25, 2008 at 7:18 PM, Marek Kubica wrote: > Maybe I was a bit unclear. I would like to get it programmatically and > change it. Have you looked at instaweb? Perhaps it does what you want. N. From maxigas at anargeek.net Sat Oct 25 18:59:48 2008 From: maxigas at anargeek.net (maxigas) Date: Thu Mar 26 02:31:37 2009 Subject: [plt-scheme] documentation/continue/help Message-ID: <20081026.005948.255012738.maxigas@anargeek.net> hi! please help me debug this attempt at the Continue... tutorial. i am stuck at "9: Breaking Up the Display" whole day. i am on terminal so i don't do it from drscheme just start the webserver on one screen, emacs with code on another and elinks in a third, but so far this was not a problem as long as i rewrote the #lang... part. but now, i don't understand this error message because the things after "given:" look very much like a proper "response". :o maxigas ---8k--{cut here}--- Servlet (@ /servlets/stratobe/stratobe1.ss) exception: (file "/usr/local/plt/lib/plt/collects/web-server/default-web-root/././servlets/stratobe/stratobe1.ss") broke the contract (-> (-> (->* ((-> request? any/c)) ((or/c (-> request? response?) #f)) string?) response?) any/c) on send/suspend/dispatch; expected , given: (html (head (title "Stratified Blog")) (body (h1 "Stratified Blog") (div ((class "posts")) (h2 "Posts") (hr) (div ((class "post")) (b (a ((href "/servlets;1*1*27550801/stratobe/stratobe1.ss") "Hello World!"))) (p "First post on the blog powered by a sch... ---8k--{cut here}--- ;;; --- BOOT --- #lang scheme (require web-server/servlet) (provide (all-defined-out)) (define interface-version 'v1) (define timeout +inf.0) ;;; --- DATA STRUCTURES --- (define-struct blog (posts) #:mutable) (define-struct post (title body comments) #:mutable) ;;; --- SAMPLE DATA --- (define BLOG (make-blog (list (make-post "Hello World!" "First post on the blog powered by a scheme engine." (list "hey" "ho" "yo")) (make-post "Hello China!" "Second post on the blog powered by a scheme engine." '())))) ;;; --- DATA HANDLERS --- (define (blog-insert-post! apost) (set-blog-posts! BLOG (cons apost (blog-posts BLOG)))) (define (post-insert-comment! apost acomment) (set-post-comments! apost (cons acomment (post-comments apost)))) ;;; --- FUNCTIONS --- (define (start request) (render-blog request)) ;; --- RENDERERS --- (define (render-blog request) (local ((define (response-generator make-url) `(html (head (title "Stratified Blog")) (body (h1 "Stratified Blog") ,(render-posts make-url request) (form ((action ,(make-url insert-post-hander))) (input ((name "title"))) (input ((name "body"))) (input ((type "submit"))))))) (define (insert-post-hander request) (blog-insert-post! (parse-post (request-bindings request)) (render-blog request)))) (send/suspend/dispatch response-generator))) (define (render-posts make-url request) (local ((define (render-post/make-url apost) (render-post apost make-url request))) `(div ((class "posts")) (h2 "Posts") (hr) ,@(map render-post/make-url (blog-posts BLOG))))) (define (render-post apost make-url request) (local ((define (view-post-handler request) (render-post-detail-page apost request))) `(div ((class "post")) (b (a ((href ,(make-url view-post-handler)) ,(post-title apost)))) (p ,(post-body apost)) (div ,(number->string (length (post-comments apost)))) " comment(s)"))) (define (render-post-detail-page apost request) (local ((define (response-generator make-url) `(html (head (title "Post")) (body (h1 "Post") (h2 ,(post-title apost)) (p ,(post-body apost)) (ul ,@(map render-comments (post-comments apost))) (form ((action ,(make-url insert-comment-handler))) (input ((name "comment"))) (input ((type "submit"))))))) (define (insert-comment-handler request) (post-insert-comment! apost (extract-binding/single 'comment (request-bindings request))) (render-post-detail-page apost request))) (send/suspend/dispatch response-generator))) (define (render-comments acomment) `(li ,acomment)) ;; --- PARSERS --- (define (can-parse-post? bindings) (and (exists-binding? 'title bindings) (exists-binding? 'body bindings))) (define (parse-post bindings) ; -> post (if (can-parse-post? bindings) (make-post (extract-binding/single 'title bindings) (extract-binding/single 'body bindings) '()) #f)) From jay.mccarthy at gmail.com Sat Oct 25 19:48:31 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:31:37 2009 Subject: [plt-scheme] documentation/continue/help In-Reply-To: <20081026.005948.255012738.maxigas@anargeek.net> References: <20081026.005948.255012738.maxigas@anargeek.net> Message-ID: You think you are returning a valid Xexpr, but you are not. I have annotated below. On Sat, Oct 25, 2008 at 4:59 PM, maxigas wrote: > ;;; --- BOOT --- > > #lang scheme > (require web-server/servlet) > (provide (all-defined-out)) > (define interface-version 'v1) > (define timeout +inf.0) > > ;;; --- DATA STRUCTURES --- > > (define-struct blog (posts) #:mutable) > > (define-struct post (title body comments) #:mutable) > > ;;; --- SAMPLE DATA --- > > (define BLOG (make-blog (list > (make-post "Hello World!" "First post on the blog powered by a scheme engine." (list "hey" "ho" "yo")) > (make-post "Hello China!" "Second post on the blog powered by a scheme engine." '())))) > > ;;; --- DATA HANDLERS --- > > (define (blog-insert-post! apost) > (set-blog-posts! BLOG (cons apost (blog-posts BLOG)))) > > (define (post-insert-comment! apost acomment) > (set-post-comments! apost (cons acomment (post-comments apost)))) > > ;;; --- FUNCTIONS --- > > (define (start request) > (render-blog request)) > > ;; --- RENDERERS --- > > (define (render-blog request) > (local ((define (response-generator make-url) > `(html (head (title "Stratified Blog")) > (body (h1 "Stratified Blog") > ,(render-posts make-url request) > (form ((action ,(make-url insert-post-hander))) > (input ((name "title"))) > (input ((name "body"))) > (input ((type "submit"))))))) > (define (insert-post-hander request) > (blog-insert-post! (parse-post (request-bindings request)) > (render-blog request)))) > (send/suspend/dispatch response-generator))) > > (define (render-posts make-url request) > (local ((define (render-post/make-url apost) > (render-post apost make-url request))) > `(div ((class "posts")) (h2 "Posts") (hr) > ,@(map render-post/make-url (blog-posts BLOG))))) > > (define (render-post apost make-url request) > (local ((define (view-post-handler request) > (render-post-detail-page apost request))) > `(div ((class "post")) > (b (a ((href ,(make-url view-post-handler)) ,(post-title apost)))) Right here. You have (a ([href ,(make-url ...)] ,(post-title ...))) Rather than (a ([href ,(make-url ...)]) ,(post-title ...)) An attribute list must have the form ([symbol? string?] ...) Jay > (p ,(post-body apost)) > (div ,(number->string (length (post-comments apost)))) > " comment(s)"))) > > (define (render-post-detail-page apost request) > (local ((define (response-generator make-url) > `(html (head (title "Post")) > (body (h1 "Post") > (h2 ,(post-title apost)) > (p ,(post-body apost)) > (ul ,@(map render-comments (post-comments apost))) > (form ((action ,(make-url insert-comment-handler))) > (input ((name "comment"))) > (input ((type "submit"))))))) > > (define (insert-comment-handler request) > (post-insert-comment! apost (extract-binding/single 'comment (request-bindings request))) > (render-post-detail-page apost request))) > > (send/suspend/dispatch response-generator))) > > (define (render-comments acomment) > `(li ,acomment)) > > ;; --- PARSERS --- > > (define (can-parse-post? bindings) > (and (exists-binding? 'title bindings) (exists-binding? 'body bindings))) > > (define (parse-post bindings) ; -> post > (if (can-parse-post? bindings) > (make-post (extract-binding/single 'title bindings) (extract-binding/single 'body bindings) '()) > #f)) > > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From marek at xivilization.net Sat Oct 25 20:10:17 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:31:37 2009 Subject: [plt-scheme] plt-web-server configuration In-Reply-To: References: <20081025154440.3db7ac75@halmanfloyd.lan.local> <20081025201805.23048499@halmanfloyd.lan.local> Message-ID: <20081026021017.42056e15@halmanfloyd.lan.local> Hi, Thanks for your fast answer. Unfortunately I still have some problems. On Sat, 25 Oct 2008 12:26:07 -0600 "Jay McCarthy" wrote: > Ah, I see. You can use read-configuration-table [1] to read it in, > change it, then use configuration-table->web-config@ [2] to get a > web-config to link with the web-server unit. Look at the code for the > launcher to see how it does it. Ok, I can read it in, change the port (haven't yet tried the rest but ok) and then.. well, I'm stuck. I was able to convert the configuration-table to a sexpr (because configuration-table->web-config@ did not take a configuration-table but rather a path to a file which contains a sexpr which is a configuration table) and converted it to a web-config@. That's where I got stuck. I thought I can feed my web-config into web-server@ from web-server/web-server-unit, but unfortunately I'm too much of a beginner to understand what web-server@ wants to get as a parameter. I looked into the launcher, but had trouble understanding what actually happens with web-server@. And by the way, could someone explain what @ and ^ mean? I know that it's standard in Scheme to use / -> ? and ! (which, except for the / are easily understood), MzScheme extends that to % for classes but adding more and more characters reminds me a bit of the string functions in some Basic dialects or PEP 3117[1]. Thanks in advance! regards, Marek [1] If you have a bit of spare time, this is BASIC's $ functions on crack: http://www.python.org/dev/peps/pep-3117/ From marek at xivilization.net Sat Oct 25 20:13:22 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:31:37 2009 Subject: [plt-scheme] plt-web-server configuration In-Reply-To: References: <20081025154440.3db7ac75@halmanfloyd.lan.local> <20081025201805.23048499@halmanfloyd.lan.local> Message-ID: <20081026021322.2f969a0e@halmanfloyd.lan.local> On Sat, 25 Oct 2008 22:08:30 +0100 "Noel Welsh" wrote: > On Sat, Oct 25, 2008 at 7:18 PM, Marek Kubica > wrote: > > > Maybe I was a bit unclear. I would like to get it programmatically > > and change it. > > Have you looked at instaweb? Perhaps it does what you want. I just took a look into the documentation - looks promising. I'll try it out tomorrow, thanks for the information. Until now I confused it with instaservlet which is doing the opposite of what I'm up to :) regards, Marek From maxigas at anargeek.net Sat Oct 25 20:22:13 2008 From: maxigas at anargeek.net (maxigas) Date: Thu Mar 26 02:31:37 2009 Subject: [plt-scheme] documentation/continue/help In-Reply-To: References: <20081026.005948.255012738.maxigas@anargeek.net> Message-ID: <20081026.022213.118861757.maxigas@anargeek.net> hi! From: "Jay McCarthy" Subject: Re: [plt-scheme] documentation/continue/help Date: Sat, 25 Oct 2008 17:48:31 -0600 > You think you are returning a valid Xexpr, but you are not. I have > annotated below. > > On Sat, Oct 25, 2008 at 4:59 PM, maxigas wrote: > > (define (render-post apost make-url request) > > (local ((define (view-post-handler request) > > (render-post-detail-page apost request))) > > `(div ((class "post")) > > (b (a ((href ,(make-url view-post-handler)) ,(post-title apost)))) > > Right here. > > You have (a ([href ,(make-url ...)] ,(post-title ...))) > > Rather than > > (a ([href ,(make-url ...)]) ,(post-title ...)) > > An attribute list must have the form ([symbol? string?] ...) > > Jay Thank you! It works now! "Surprisingly" it was a missing parenthesis, and i could have discovered it looking at the code. :P It's totally wonderful to receive reply so fast and efficient, especially if one tries to grasp things alone without a local community (i am based in budapest and am a humanities student, so not many lispers around me). maxigas From workmin at ccs.neu.edu Sat Oct 25 20:45:04 2008 From: workmin at ccs.neu.edu (Jon Rafkind) Date: Thu Mar 26 02:31:37 2009 Subject: [plt-scheme] creating new readers Message-ID: <4903BD90.1070901@ccs.neu.edu> I am trying to understand how to write a new reader that can be used with #lang. I have an empty x.ss with #lang foo and foo/lang/reader.ss with --snip-- #lang scheme (provide (rename-out (my-read read) (my-read-syntax read-syntax))) (define (my-read port) (syntax->datum (my-read-syntax #f port))) (define (my-read-syntax name port) (let* ((p-name (object-name port)) (name (if (path? p-name) (let-values (((base name dir?) (split-path p-name))) (string->symbol (path->string (path-replace-suffix name #"")))) 'page))) #`(module #,name scheme #,(foo)))) (define (foo) #'(begin (define q 1) (+ q 2))) --end snip-- But when I run x.ss I get lang/reader.ss:20:9: compile: unbound identifier in module in: q I'm not sure what category of things to look into.. syntax marks, certificates, module-begin? From fahree at gmail.com Fri Oct 24 01:10:17 2008 From: fahree at gmail.com (=?ISO-8859-1?Q?Far=E9?=) Date: Thu Mar 26 02:31:37 2009 Subject: [plt-scheme] Next Boston Lisp Meeting: Monday October 27th 2008, 6pm at MIT 32-124 In-Reply-To: <653bea160810232209y24bfc7eepe218f47e7f97e6d@mail.gmail.com> References: <653bea160810232209y24bfc7eepe218f47e7f97e6d@mail.gmail.com> Message-ID: <653bea160810232210i7b5cf0c4j23bd1cf3a2d5bae9@mail.gmail.com> Next Boston Lisp Meeting: Monday October 27th 2008, 6pm at MIT 32-124 http://fare.livejournal.com/136510.html NB: ITA Software, a fine employer of Lisp hackers (disclosure: I work there), is kindly purchasing a buffet to accompany our Monthly Boston Lisp Meeting. Anyone who attends is welcome to partake. We appreciate it if you let us know you're coming, and what food taboos you have, so that we can order the right amount of food. Tell us by sending email to boston-lisp-meeting-register at common-lisp.net. We won't send any acknowledgment unless requested; importantly, we'll keep your identity and address confidential and won't communicate any such information to anyone, not even to our sponsors. * Tim McNerney will give a talk about Verifying the Correctness of Compiler Transformations on Basic Blocks using Abstract Interpretation. Tim McNerney, currently software engineer at ITA Software, will discuss some work he did years ago at Thinking Machines Corporations on a native code parallel Fortran compiler for the Connection Machine. The compiler used abstract interpretation to verify correctness of some program transformations relating to register allocation. This actually helped systematically detect and eliminate a class of subtle bugs that was previously crippling the compiler. * * The Lisp Meeting will take place on Monday October 27th at MIT, Room 32-124. As the numbers indicate, this is in Building 32, on the 1st floor. That's the Stata Center, the funny looking building at the corner of Main St and Vassar St. Note that this location is different from the usual location in adjacent building 34. MIT map: http://whereis.mit.edu/bin/map?selection=32 Google map: http://maps.google.com/maps?q=32+Vassar+St,+Cambridge,+MA+02139,+USA Many thanks go to Alexey Radul for arranging for the room, and to MIT for welcoming us. * * * The previous Boston Lisp Meeting on September 29th had over 60 participants. Rich Hickey had two standing ovations, and you can see the talk on http://clojure.blip.tv/. We're always looking for more speakers. The call for speakers and all the other details are at http://fare.livejournal.com/120393.html Please forward this information to people you think would be interested. Please accept my apologies for your receiving this message multiple times. For more information, see our new web site boston-lisp.org. For posts related to the Boston Lisp meetings in general, follow this link: http://fare.livejournal.com/tag/boston-lisp-meeting or subscribe to our RSS feed: http://fare.livejournal.com/data/rss?tag=boston-lisp-meeting My apologies for this late announce. We had some difficulties regarding the room that I took too long to resolve. My apologies also if this announce gets posted to a list where it shouldn't, or fails to get posted to a list where it should. I'm using a new set of Bcc: for distribution. Feedback welcome by private reply. [ Fran?ois-Ren? ?VB Rideau | Reflection&Cybernethics | http://fare.tunes.org ] If you call a tail a leg, how many legs has a dog? Five? No! Calling a tail a leg doesn't make it a leg. -- Abraham Lincoln, explaining the difference between lexical scoping and dynamic scoping From workmin at ccs.neu.edu Sun Oct 26 01:09:40 2008 From: workmin at ccs.neu.edu (Jon Rafkind) Date: Thu Mar 26 02:31:38 2009 Subject: [plt-scheme] creating new readers In-Reply-To: <4903BD90.1070901@ccs.neu.edu> References: <4903BD90.1070901@ccs.neu.edu> Message-ID: <4903FB94.5000502@ccs.neu.edu> Jon Rafkind wrote: > I am trying to understand how to write a new reader that can be used > with #lang. Eli showed me how to do this, so no worries. From marek at xivilization.net Sun Oct 26 06:21:41 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:31:38 2009 Subject: [plt-scheme] plt-web-server configuration In-Reply-To: <20081026021322.2f969a0e@halmanfloyd.lan.local> References: <20081025154440.3db7ac75@halmanfloyd.lan.local> <20081025201805.23048499@halmanfloyd.lan.local> <20081026021322.2f969a0e@halmanfloyd.lan.local> Message-ID: <20081026112141.7c0e1acb@halmanfloyd.lan.local> On Sun, 26 Oct 2008 02:13:22 +0200 Marek Kubica wrote: > On Sat, 25 Oct 2008 22:08:30 +0100 > "Noel Welsh" wrote: > > > On Sat, Oct 25, 2008 at 7:18 PM, Marek Kubica > > wrote: > > > > > Maybe I was a bit unclear. I would like to get it programmatically > > > and change it. > > > > Have you looked at instaweb? Perhaps it does what you want. > > I just took a look into the documentation - looks promising. I'll try > it out tomorrow, thanks for the information. Ok, I tried it, but as far as I see it is meant to serve single servlets in an easy way. What I want is basically the same as what plt-web-server does, serving all servlets (and htdocs etc.) from some web-root. Si I'm still stuck at the web-config@, which I converted from my configuration-table. launcher.ss contains the following: (define-compound-unit launch@ (import (T : tcp^)) (export S) (link [((C : web-config^)) configuration@] [((S : web-server^)) web-server@ T C])) (define-values/invoke-unit launch@ (import tcp^) (export web-server^)) So configuration@ returns a web-config@ and that one is somehow applied to a web-server@ along with a tcp^. But what does it mean? I only want a simple launcher, not something as elaborated as this is. regards, Marek From noelwelsh at gmail.com Sun Oct 26 08:02:13 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:31:38 2009 Subject: [plt-scheme] plt-web-server configuration In-Reply-To: <20081026112141.7c0e1acb@halmanfloyd.lan.local> References: <20081025154440.3db7ac75@halmanfloyd.lan.local> <20081025201805.23048499@halmanfloyd.lan.local> <20081026021322.2f969a0e@halmanfloyd.lan.local> <20081026112141.7c0e1acb@halmanfloyd.lan.local> Message-ID: On Sun, Oct 26, 2008 at 10:21 AM, Marek Kubica wrote: > Ok, I tried it, but as far as I see it is meant to serve single > servlets in an easy way. What I want is basically the same as what > plt-web-server does, serving all servlets (and htdocs etc.) from some > web-root. When creating instaweb we had to choose between supporting a single servlet or many servlets. We realised that anything that we could do with multiple servlets we could do just as easily with a single servlet (since a servlet is just a function and it easy to write a function that chooses other functions based on some property (e.g. URL)) and supporting only a single servlet made instaweb much easier to write. So to solve your problem I would write some master "dispatch" servlet that calls all your current servlet based on URL. We have written another library, dispatch.plt, for just this purpose. HTH, Noel From marek at xivilization.net Sun Oct 26 13:10:34 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:31:38 2009 Subject: [plt-scheme] plt-web-server configuration In-Reply-To: References: <20081025154440.3db7ac75@halmanfloyd.lan.local> <20081025201805.23048499@halmanfloyd.lan.local> <20081026021322.2f969a0e@halmanfloyd.lan.local> <20081026112141.7c0e1acb@halmanfloyd.lan.local> Message-ID: <20081026181034.558da293@halmanfloyd.lan.local> Hi Noel, thanks for your help, On Sun, 26 Oct 2008 12:02:13 +0000 "Noel Welsh" wrote: > When creating instaweb we had to choose between supporting a single > servlet or many servlets. We realised that anything that we could do > with multiple servlets we could do just as easily with a single > servlet (since a servlet is just a function and it easy to write a > function that chooses other functions based on some property (e.g. > URL)) and supporting only a single servlet made instaweb much easier > to write. Understandable. > So to solve your problem I would write some master "dispatch" > servlet that calls all your current servlet based on URL. We have > written another library, dispatch.plt, for just this purpose. I just took a look at dispatch.plt. It reminds me of the dispatchers known in other languages and might be quite useful when writing entire sites which have more elaborate control-flow. But thats too much for me at the moment - it seems too compilcated to write a dispatcher that dispatches urls to files[1] containing the servlets when the normal web server does exactly that. The only problem with the server is, that I seem to be unable to launch it with my customized settings, as described in my other mail. regards & thanks for the untyped-code which might be indeed useful if I decide to write bigger stuff in Scheme, Marek [1] I know PHP-style is definitely not elegant, but "drop the file in the directory to get it served" is often quite convenient From jadudm at gmail.com Sun Oct 26 15:02:52 2008 From: jadudm at gmail.com (Matt Jadud) Date: Thu Mar 26 02:31:38 2009 Subject: [plt-scheme] plt-web-server configuration In-Reply-To: <20081026181034.558da293@halmanfloyd.lan.local> References: <20081025154440.3db7ac75@halmanfloyd.lan.local> <20081025201805.23048499@halmanfloyd.lan.local> <20081026021322.2f969a0e@halmanfloyd.lan.local> <20081026112141.7c0e1acb@halmanfloyd.lan.local> <20081026181034.558da293@halmanfloyd.lan.local> Message-ID: On Sun, Oct 26, 2008 at 1:10 PM, Marek Kubica wrote: > sites which have more elaborate control-flow. But thats too much for me > at the moment - it seems too compilcated to write a dispatcher that > dispatches urls to files[1] containing the servlets when the normal web > server does exactly that. The only problem with the server is, that I > seem to be unable to l Hi Marek, About two months ago, I wanted a quick little RESTful server for a hack project. I have programmed against the PLT server in the past, and had not yet used the Untyped "dispatch" library. I created a dispatcher with one dispatch branch, wrote the function that corresponded to it, and was done. The only trouble I had was when I decided not to follow the example in the documentation, and did something I thought would work. Then, I realized that the example is actually minimal and clean---it does the right thing. I don't mean to start some kind of A vs. B discussion here, but I did want to challenge your notion that dispatch.plt is only for large sites. It made writing a small, simple RESTful servlet an easy thing. Your mileage may vary, not a lawyer, etc. Cheers, Matt From hendrik at topoi.pooq.com Sun Oct 26 14:57:55 2008 From: hendrik at topoi.pooq.com (Hendrik Boom) Date: Thu Mar 26 02:31:39 2009 Subject: [plt-scheme] Re: creating new readers References: <4903BD90.1070901@ccs.neu.edu> <4903FB94.5000502@ccs.neu.edu> Message-ID: On Sat, 25 Oct 2008 23:09:40 -0600, Jon Rafkind wrote: > Jon Rafkind wrote: >> I am trying to understand how to write a new reader that can be used >> with #lang. > Eli showed me how to do this, so no worries. Any chance you could enlighten the rest of us? -- hendrik From eli at barzilay.org Sun Oct 26 18:37:03 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:31:39 2009 Subject: [plt-scheme] Re: creating new readers In-Reply-To: References: <4903BD90.1070901@ccs.neu.edu> <4903FB94.5000502@ccs.neu.edu> Message-ID: <18692.61711.646347.891033@arabic.ccs.neu.edu> On Oct 26, Hendrik Boom wrote: > On Sat, 25 Oct 2008 23:09:40 -0600, Jon Rafkind wrote: > > > Jon Rafkind wrote: > >> I am trying to understand how to write a new reader that can be used > >> with #lang. > > Eli showed me how to do this, so no worries. > > Any chance you could enlighten the rest of us? The main problem that Jon had was returning a syntax value like #'(begin ...) which is a problem, since that syntax already has the lexical context of the reader module. Instead, it should return a context-less syntax like (datum->syntax #f '(begin ...) ...) (There was another minor issue: it is really better to use `syntax/module-reader' to create a reader rather than doing so directly.) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From anesward at mac.com Sun Oct 26 20:21:56 2008 From: anesward at mac.com (mike) Date: Thu Mar 26 02:31:39 2009 Subject: [plt-scheme] sound.ss Message-ID: I am working through htdp on my own and just finished exercises of section 10.1; I wanted to tackle the ' simply challenge ' problem but it seems that the sound.ss teachpack is not available. Is it still available? thanks, mike From matthias at ccs.neu.edu Sun Oct 26 20:55:22 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:31:39 2009 Subject: [plt-scheme] sound.ss In-Reply-To: References: Message-ID: http://www.ccs.neu.edu/home/matthias/HtDP/Sound/ -- Matthias On Oct 26, 2008, at 8:21 PM, mike wrote: > I am working through htdp on my own and just finished exercises of > section 10.1; I wanted to tackle the ' simply challenge ' problem but > it seems that the sound.ss teachpack is not available. Is it still > available? > thanks, mike > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From workmin at ccs.neu.edu Mon Oct 27 00:25:34 2008 From: workmin at ccs.neu.edu (Jon Rafkind) Date: Thu Mar 26 02:31:39 2009 Subject: [plt-scheme] Re: creating new readers In-Reply-To: References: <4903BD90.1070901@ccs.neu.edu> <4903FB94.5000502@ccs.neu.edu> Message-ID: <490542BE.6040907@ccs.neu.edu> Hendrik Boom wrote: > On Sat, 25 Oct 2008 23:09:40 -0600, Jon Rafkind wrote: > > >> Jon Rafkind wrote: >> >>> I am trying to understand how to write a new reader that can be used >>> with #lang. >>> >> Eli showed me how to do this, so no worries. >> > > Any chance you could enlighten the rest of us? > > Heh, I was pretty sure someone would want to see the solution. I won't get to it tonight, but I'll post an example tommorow morning or so. From deepankar.sharma at gmail.com Mon Oct 27 11:42:35 2008 From: deepankar.sharma at gmail.com (Deep) Date: Thu Mar 26 02:31:39 2009 Subject: [plt-scheme] opengrok hosted instance with DrScheme sources. Message-ID: <2d9ff85a-017b-44b4-94d3-aa306b280d30@v30g2000hsa.googlegroups.com> Would it be possible to add an opengrok instance to the www.drscheme.org website with the latest DrScheme repository sources in it. This makes understanding the mzscheme sources much easier. I have setup an instance at home and have been using it, but unfortunately I cannot access my home network install of opengrok remotely. Short description of opengrok: (from the opengrok website) "OpenGrok is a fast and usable source code search and cross reference engine. It helps you search, cross-reference and navigate your source tree. It can understand various program file formats and version control histories like Mercurial, Git, SCCS, RCS, CVS, Subversion, Teamware, ClearCase, Perforce and Bazaar. In other words it lets you grok (profoundly understand) the open source, hence the name OpenGrok. It is written in Java. " From eli at barzilay.org Mon Oct 27 12:13:51 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:31:39 2009 Subject: [plt-scheme] opengrok hosted instance with DrScheme sources. In-Reply-To: <2d9ff85a-017b-44b4-94d3-aa306b280d30@v30g2000hsa.googlegroups.com> References: <2d9ff85a-017b-44b4-94d3-aa306b280d30@v30g2000hsa.googlegroups.com> Message-ID: <18693.59583.714910.131782@arabic.ccs.neu.edu> On Oct 27, Deep wrote: > Would it be possible to add an opengrok instance to the > www.drscheme.org website with the latest DrScheme repository sources > in it. This would be more fit to svn.plt-scheme.org, where we currently use ViewVC. > This makes understanding the mzscheme sources much easier. I have > setup an instance at home and have been using it, but unfortunately > I cannot access my home network install of opengrok remotely. The question is how easy it is to install it. This can range from being very unintrusive (for example, a tool that expects a single URL and will crawl over it and do the right thing), to something that requires lots of configurations, hooking into the web server in a particular way, requiring access to the directory and/or the repository files, etc. And example of a very easy to use facility is Google's code search (http://www.google.com/codesearch), which might actually be good enough to use. I just submitted the subversion link to it, so it'll probably take a while to get there. It would be nice if there was a way to have a "custom code search", but I don't see one on a quick look. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From deepankar.sharma at gmail.com Mon Oct 27 12:50:03 2008 From: deepankar.sharma at gmail.com (Deep) Date: Thu Mar 26 02:31:40 2009 Subject: [plt-scheme] Re: opengrok hosted instance with DrScheme sources. In-Reply-To: <18693.59583.714910.131782@arabic.ccs.neu.edu> References: <2d9ff85a-017b-44b4-94d3-aa306b280d30@v30g2000hsa.googlegroups.com> <18693.59583.714910.131782@arabic.ccs.neu.edu> Message-ID: <12efa09c-0269-4abd-a1b7-7730add4887c@r66g2000hsg.googlegroups.com> The big plus that opengrok has over google codesearch that it has cross linking. So you can click on function calls/datastructures to get to the definition of the function/datastructure. This makes code discovery very easy. I think opengrok supports svn repositories nativeley. So you can just point it to the repository and it will index things. It also has an inbuilt web frontend which requires apache tomcat (or any other java application server ). Installation is straightforward. If there are any questions I will try to answer them to the best of my knowledge and try to find answers for things that I dont know. An example of a hosted opengrok instance is http://opengrok.netbsd.org/source/ . Just try searching for "fprintf" (without the quotation marks) and browse through the files that come up. On Oct 27, 12:13?pm, Eli Barzilay wrote: > On Oct 27, Deep wrote: > > > Would it be possible to add an opengrok instance to the > >www.drscheme.orgwebsite with the latest DrScheme repository sources > > in it. > > This would be more fit to svn.plt-scheme.org, where we currently use > ViewVC. > > > This makes understanding the mzscheme sources much easier. I have > > setup an instance at home and have been using it, but unfortunately > > I cannot access my home network install of opengrok remotely. > > The question is how easy it is to install it. ?This can range from > being very unintrusive (for example, a tool that expects a single URL > and will crawl over it and do the right thing), to something that > requires lots of configurations, hooking into the web server in a > particular way, requiring access to the directory and/or the > repository files, etc. > > And example of a very easy to use facility is Google's code search > (http://www.google.com/codesearch), which might actually be good > enough to use. ?I just submitted the subversion link to it, so it'll > probably take a while to get there. ?It would be nice if there was a > way to have a "custom code search", but I don't see one on a quick > look. > > -- > ? ? ? ? ? ((lambda (x) (x x)) (lambda (x) (x x))) ? ? ? ? ?Eli Barzilay: > ? ? ? ? ? ? ? ? ?http://www.barzilay.org/? ? ? ? ? ? ? ? Maze is Life! > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme From robby at cs.uchicago.edu Mon Oct 27 12:52:12 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:31:40 2009 Subject: [plt-scheme] Re: opengrok hosted instance with DrScheme sources. In-Reply-To: <12efa09c-0269-4abd-a1b7-7730add4887c@r66g2000hsg.googlegroups.com> References: <2d9ff85a-017b-44b4-94d3-aa306b280d30@v30g2000hsa.googlegroups.com> <18693.59583.714910.131782@arabic.ccs.neu.edu> <12efa09c-0269-4abd-a1b7-7730add4887c@r66g2000hsg.googlegroups.com> Message-ID: <932b2f1f0810270952x5cc99570kdf25571942a9b6e6@mail.gmail.com> For things written in Scheme, check syntax also does that (and I suspect that opengrok doesn't really get it right PLT Scheme code). Check Syntax doesn't work with SVN, tho, so you can't look at the history or anything like that. Robby On Mon, Oct 27, 2008 at 11:50 AM, Deep wrote: > The big plus that opengrok has over google codesearch that it has > cross linking. So you can click on function calls/datastructures to > get to the definition of the function/datastructure. This makes code > discovery very easy. > > I think opengrok supports svn repositories nativeley. So you can just > point it to the repository and it will index things. > > It also has an inbuilt web frontend which requires apache tomcat (or > any other java application server ). Installation is straightforward. > > If there are any questions I will try to answer them to the best of my > knowledge and try to find answers for things that I dont know. > > An example of a hosted opengrok instance is http://opengrok.netbsd.org/source/ > . > Just try searching for "fprintf" (without the quotation marks) and > browse through the files that come up. > > > On Oct 27, 12:13 pm, Eli Barzilay wrote: >> On Oct 27, Deep wrote: >> >> > Would it be possible to add an opengrok instance to the >> >www.drscheme.orgwebsite with the latest DrScheme repository sources >> > in it. >> >> This would be more fit to svn.plt-scheme.org, where we currently use >> ViewVC. >> >> > This makes understanding the mzscheme sources much easier. I have >> > setup an instance at home and have been using it, but unfortunately >> > I cannot access my home network install of opengrok remotely. >> >> The question is how easy it is to install it. This can range from >> being very unintrusive (for example, a tool that expects a single URL >> and will crawl over it and do the right thing), to something that >> requires lots of configurations, hooking into the web server in a >> particular way, requiring access to the directory and/or the >> repository files, etc. >> >> And example of a very easy to use facility is Google's code search >> (http://www.google.com/codesearch), which might actually be good >> enough to use. I just submitted the subversion link to it, so it'll >> probably take a while to get there. It would be nice if there was a >> way to have a "custom code search", but I don't see one on a quick >> look. >> >> -- >> ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: >> http://www.barzilay.org/ Maze is Life! >> _________________________________________________ >> 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 deepankar.sharma at gmail.com Mon Oct 27 13:08:04 2008 From: deepankar.sharma at gmail.com (Deep) Date: Thu Mar 26 02:31:40 2009 Subject: [plt-scheme] Re: opengrok hosted instance with DrScheme sources. In-Reply-To: <932b2f1f0810270952x5cc99570kdf25571942a9b6e6@mail.gmail.com> References: <2d9ff85a-017b-44b4-94d3-aa306b280d30@v30g2000hsa.googlegroups.com> <18693.59583.714910.131782@arabic.ccs.neu.edu> <12efa09c-0269-4abd-a1b7-7730add4887c@r66g2000hsg.googlegroups.com> <932b2f1f0810270952x5cc99570kdf25571942a9b6e6@mail.gmail.com> Message-ID: Yes for the scheme code opengrok doesnt work well. (No cross links supported / search falls back to text search). But all the sources under the src directory in drscheme sources seems to be plain c files and would hence benefit from opengrok indexing. On Oct 27, 12:52?pm, "Robby Findler" wrote: > For things written in Scheme, check syntax also does that (and I > suspect that opengrok doesn't really get it right PLT Scheme code). > Check Syntax doesn't work with SVN, tho, so you can't look at the > history or anything like that. > > Robby > > > > > > On Mon, Oct 27, 2008 at 11:50 AM, Deep wrote: > > The big plus that opengrok has over google codesearch that it has > > cross linking. So you can click on function calls/datastructures to > > get to the definition of the function/datastructure. This makes code > > discovery very easy. > > > I think opengrok supports svn repositories nativeley. So you can just > > point it to the repository and it will index things. > > > It also has an inbuilt web frontend which requires apache tomcat (or > > any other java application server ). Installation is straightforward. > > > If there are any questions I will try to answer them to the best of my > > knowledge and try to find answers for things that I dont know. > > > An example of a hosted opengrok instance ishttp://opengrok.netbsd.org/source/ > > . > > Just try searching for "fprintf" (without the quotation marks) and > > browse through the files that come up. > > > On Oct 27, 12:13 pm, Eli Barzilay wrote: > >> On Oct 27, Deep wrote: > > >> > Would it be possible to add an opengrok instance to the > >> >www.drscheme.orgwebsitewith the latest DrScheme repository sources > >> > in it. > > >> This would be more fit to svn.plt-scheme.org, where we currently use > >> ViewVC. > > >> > This makes understanding the mzscheme sources much easier. I have > >> > setup an instance at home and have been using it, but unfortunately > >> > I cannot access my home network install of opengrok remotely. > > >> The question is how easy it is to install it. ?This can range from > >> being very unintrusive (for example, a tool that expects a single URL > >> and will crawl over it and do the right thing), to something that > >> requires lots of configurations, hooking into the web server in a > >> particular way, requiring access to the directory and/or the > >> repository files, etc. > > >> And example of a very easy to use facility is Google's code search > >> (http://www.google.com/codesearch), which might actually be good > >> enough to use. ?I just submitted the subversion link to it, so it'll > >> probably take a while to get there. ?It would be nice if there was a > >> way to have a "custom code search", but I don't see one on a quick > >> look. > > >> -- > >> ? ? ? ? ? ((lambda (x) (x x)) (lambda (x) (x x))) ? ? ? ? ?Eli Barzilay: > >> ? ? ? ? ? ? ? ? ?http://www.barzilay.org/? ? ? ? ? ? ? ?Maze is Life! > >> _________________________________________________ > >> ? For list-related administrative tasks: > >> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > > ?For list-related administrative tasks: > > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme- Hide quoted text - > > - Show quoted text - From jay.mccarthy at gmail.com Mon Oct 27 14:17:49 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:31:40 2009 Subject: [plt-scheme] plt-web-server configuration In-Reply-To: <20081026021017.42056e15@halmanfloyd.lan.local> References: <20081025154440.3db7ac75@halmanfloyd.lan.local> <20081025201805.23048499@halmanfloyd.lan.local> <20081026021017.42056e15@halmanfloyd.lan.local> Message-ID: On Sat, Oct 25, 2008 at 6:10 PM, Marek Kubica wrote: > Hi, > > Thanks for your fast answer. Unfortunately I still have some problems. > > On Sat, 25 Oct 2008 12:26:07 -0600 > "Jay McCarthy" wrote: > >> Ah, I see. You can use read-configuration-table [1] to read it in, >> change it, then use configuration-table->web-config@ [2] to get a >> web-config to link with the web-server unit. Look at the code for the >> launcher to see how it does it. > > Ok, I can read it in, change the port (haven't yet tried the rest but > ok) and then.. well, I'm stuck. I was able to convert the > configuration-table to a sexpr (because > configuration-table->web-config@ did not take a configuration-table but > rather a path to a file which contains a sexpr which is a configuration > table) and converted it to a web-config@. That's where I got stuck. > > I thought I can feed my web-config into web-server@ from > web-server/web-server-unit, but unfortunately I'm too much of a > beginner to understand what web-server@ wants to get as a parameter. I > looked into the launcher, but had trouble understanding what actually > happens with web-server@. > > And by the way, could someone explain what @ and ^ mean? I know that > it's standard in Scheme to use / -> ? and ! (which, except for the / > are easily understood), MzScheme extends that to % for classes but > adding more and more characters reminds me a bit of the string > functions in some Basic dialects or PEP 3117[1]. @ is a unit. ^ is a unit signature. A unit is (essentially) a parameterized module. In this case, the web-server@ is parameterized over its configuration, which is represented by another unit with a bunch of functions and values that define its behavior. You want to look at web-server/private/launch.ss and essentially change configuration@ to whatever web-config@ you get from parsing the configuration table. Jay -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From raould at gmail.com Mon Oct 27 14:21:47 2008 From: raould at gmail.com (Raoul Duke) Date: Thu Mar 26 02:31:40 2009 Subject: [plt-scheme] re: thanks for docs Message-ID: <91a2ba3e0810271121g56260360pdef5428213899a2f@mail.gmail.com> also, many thanks to folks who worked on http://world.cs.brown.edu/1/ and made it freely available. the subject of FP with interactivity is, i think, interesting and important wrt making FP something non-FPers might some day consider and grok the benefits of, hopefully leading to better systems overall. From sk at cs.brown.edu Mon Oct 27 14:46:12 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:31:40 2009 Subject: [plt-scheme] re: thanks for docs In-Reply-To: <91a2ba3e0810271121g56260360pdef5428213899a2f@mail.gmail.com> References: <91a2ba3e0810271121g56260360pdef5428213899a2f@mail.gmail.com> Message-ID: Thanks for your kind words. We have several additional exercises in the pipeline and hope to release them over the coming months. Feeback is always welcome. Shriram On Mon, Oct 27, 2008 at 1:21 PM, Raoul Duke wrote: > also, many thanks to folks who worked on http://world.cs.brown.edu/1/ > and made it freely available. the subject of FP with interactivity is, > i think, interesting and important wrt making FP something non-FPers > might some day consider and grok the benefits of, hopefully leading to > better systems overall. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From morazanm at gmail.com Mon Oct 27 15:38:40 2008 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:31:41 2009 Subject: [plt-scheme] testing.ss in 4.1.1[3m] Message-ID: <9b1fff280810271238g45590e1i67a87c02de0435f1@mail.gmail.com> Dear All, Has the operational behavior of testing.ss changed for version 4.1.1? Students can add the testing.ss teachpack, but no messages of success or failure are being generated. In version 4.1, these messages are generated. -- Cheers, Marco From eli at barzilay.org Mon Oct 27 15:48:05 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:31:41 2009 Subject: [plt-scheme] Re: opengrok hosted instance with DrScheme sources. In-Reply-To: <12efa09c-0269-4abd-a1b7-7730add4887c@r66g2000hsg.googlegroups.com> References: <2d9ff85a-017b-44b4-94d3-aa306b280d30@v30g2000hsa.googlegroups.com> <18693.59583.714910.131782@arabic.ccs.neu.edu> <12efa09c-0269-4abd-a1b7-7730add4887c@r66g2000hsg.googlegroups.com> <932b2f1f0810270952x5cc99570kdf25571942a9b6e6@mail.gmail.com> Message-ID: <18694.6901.758605.967666@arabic.ccs.neu.edu> On Oct 27, Deep wrote: > The big plus that opengrok has over google codesearch that it has > cross linking. So you can click on function calls/datastructures to > get to the definition of the function/datastructure. This makes code > discovery very easy. > > I think opengrok supports svn repositories nativeley. So you can > just point it to the repository and it will index things. That's good. > It also has an inbuilt web frontend which requires apache tomcat (or > any other java application server ). Installation is > straightforward. That's one thing that worries me -- I try to keep the web-related packages on the server to a minimum... (It doesn't use php or perl, for example, and having a java installation tends to be a sticky issue...) > If there are any questions I will try to answer them to the best of > my knowledge and try to find answers for things that I dont know. > > An example of a hosted opengrok instance is > http://opengrok.netbsd.org/source/ . Just try searching for > "fprintf" (without the quotation marks) and browse through the files > that come up. Thanks, it does look interesting. On Oct 27, Deep wrote: > Yes for the scheme code opengrok doesnt work well. (No cross links > supported / search falls back to text search). But all the sources > under the src directory in drscheme sources seems to be plain c > files and would hence benefit from opengrok indexing. That's a major problem. Rudimentary Scheme support would be nice, but of course a proper solution is one that will analyze the actual require and binding-structure and create real links... -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From matthias at ccs.neu.edu Mon Oct 27 16:22:57 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:31:41 2009 Subject: [plt-scheme] testing.ss in 4.1.1[3m] In-Reply-To: <9b1fff280810271238g45590e1i67a87c02de0435f1@mail.gmail.com> References: <9b1fff280810271238g45590e1i67a87c02de0435f1@mail.gmail.com> Message-ID: <4516E963-4175-46A6-A192-41310BF05E4F@ccs.neu.edu> On Oct 27, 2008, at 3:38 PM, Marco Morazan wrote: > Dear All, > > Has the operational behavior of testing.ss changed for version 4.1.1? > > Students can add the testing.ss teachpack, but no messages of success > or failure are being generated. In version 4.1, these messages are > generated. Same for 4.1.1. There is no need to require testing.ss It should just work in the teaching languages. From sbloch at adelphi.edu Mon Oct 27 16:31:55 2008 From: sbloch at adelphi.edu (Stephen Bloch) Date: Thu Mar 26 02:31:41 2009 Subject: [BULK] [plt-scheme] testing.ss in 4.1.1[3m] In-Reply-To: <9b1fff280810271238g45590e1i67a87c02de0435f1@mail.gmail.com> References: <9b1fff280810271238g45590e1i67a87c02de0435f1@mail.gmail.com> Message-ID: <6B331367-40FC-43D5-BA14-9A4388D694B2@adelphi.edu> On Oct 27, 2008, at 15:38, "Marco Morazan" wrote: > Dear All, > > Has the operational behavior of testing.ss changed for version 4.1.1? > > Students can add the testing.ss teachpack, but no messages of success > or failure are being generated. In version 4.1, these messages are > generated. In version 4.1, you shouldn't need testing.ss at al (check-expect and friends are built into the language)l, and you no longer need to call generate-report explicitly (it happens automatically at the end of a Run). Steve Bloch From marek at xivilization.net Mon Oct 27 17:26:41 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:31:41 2009 Subject: [plt-scheme] plt-web-server configuration In-Reply-To: References: <20081025154440.3db7ac75@halmanfloyd.lan.local> <20081025201805.23048499@halmanfloyd.lan.local> <20081026021322.2f969a0e@halmanfloyd.lan.local> <20081026112141.7c0e1acb@halmanfloyd.lan.local> <20081026181034.558da293@halmanfloyd.lan.local> Message-ID: <20081027222641.632dceb2@halmanfloyd.lan.local> On Sun, 26 Oct 2008 15:02:52 -0400 "Matt Jadud" wrote: > I don't mean to start some kind of A vs. B discussion here, but I did > want to challenge your notion that dispatch.plt is only for large > sites. It made writing a small, simple RESTful servlet an easy thing. Ok, I was generalizing a bit too much. I'm absolutely sure that instaweb.plt and (especially) dispatch.plt are quite useful but you have to understand that now that I eally started doing stuff in Scheme, there's quite a lot of concepts which wait to be mastered. I just thought that it's not that smart to reinvent the PLT web server dispatching again using dispatch.plt. And I believe that I'm now really close to get the default server dispatching to work as I want it to. regards, Marek From marek at xivilization.net Mon Oct 27 17:25:44 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:31:41 2009 Subject: [plt-scheme] plt-web-server configuration In-Reply-To: References: <20081025154440.3db7ac75@halmanfloyd.lan.local> <20081025201805.23048499@halmanfloyd.lan.local> <20081026021017.42056e15@halmanfloyd.lan.local> Message-ID: <20081027222544.6f4de3ac@halmanfloyd.lan.local> On Mon, 27 Oct 2008 12:17:49 -0600 "Jay McCarthy" wrote: > @ is a unit. > > ^ is a unit signature. > > A unit is (essentially) a parameterized module. In this case, the > web-server@ is parameterized over its configuration, which is > represented by another unit with a bunch of functions and values that > define its behavior. Thanks. I tried asking in #scheme, but except for Eli and Grant didn't see anybody I know from the PLT mailing list. > You want to look at web-server/private/launch.ss and essentially > change configuration@ to whatever web-config@ you get from parsing the > configuration table. Right, several copy&paste, trying stuff in the interpreter etc. I got this to work: #lang scheme (require web-server/configuration/configuration-table web-server/configuration/configuration-table-structs web-server/web-config-unit web-server/web-config-sig web-server/web-server-unit web-server/web-server-sig net/tcp-sig (only-in web-server/web-server do-not-return)) (define current-configuration-table (read-configuration-table default-configuration-table-path)) (set-configuration-table-port! current-configuration-table 4113) (define current-configuration-sexpr (configuration-table->sexpr current-configuration-table)) (define configuration@ (configuration-table-sexpr->web-config@ current-configuration-sexpr)) (define-compound-unit launch@ (import (T : tcp^)) (export S) (link [((C : web-config^)) configuration@] [((S : web-server^)) web-server@ T C])) (define-values/invoke-unit launch@ (import tcp^) (export web-server^)) (provide serve) (void (serve)) (do-not-return) It starts the server properly, but unfortunately the server does not find any servlets. Or anything else in the directory containing the launcher. The relevant entry from the configuration-table would probably be (paths (configuration-root "conf") (host-root ".") (log-file-path "log") (file-root "htdocs") (servlet-root ".") (mime-types "mime.types") (password-authentication "passwords")))) so when I have a servlet headers.scm I should be able to access it through http://server:port/headers.scm right? I also tried copying the file to a servlets subdirectory in the same way like the default server does, but it still doesn't work as expected. I would appreciate any hints! regards, Marek From jay.mccarthy at gmail.com Mon Oct 27 17:35:14 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:31:42 2009 Subject: [plt-scheme] plt-web-server configuration In-Reply-To: <20081027222544.6f4de3ac@halmanfloyd.lan.local> References: <20081025154440.3db7ac75@halmanfloyd.lan.local> <20081025201805.23048499@halmanfloyd.lan.local> <20081026021017.42056e15@halmanfloyd.lan.local> <20081027222544.6f4de3ac@halmanfloyd.lan.local> Message-ID: On Mon, Oct 27, 2008 at 3:25 PM, Marek Kubica wrote: > Right, several copy&paste, trying stuff in the interpreter etc. I got > this to work: > > #lang scheme > (require web-server/configuration/configuration-table > web-server/configuration/configuration-table-structs > web-server/web-config-unit > web-server/web-config-sig > web-server/web-server-unit > web-server/web-server-sig > net/tcp-sig > (only-in web-server/web-server do-not-return)) > > (define current-configuration-table > (read-configuration-table default-configuration-table-path)) > > (set-configuration-table-port! current-configuration-table > 4113) > > (define current-configuration-sexpr > (configuration-table->sexpr current-configuration-table)) > > (define configuration@ (configuration-table-sexpr->web-config@ > current-configuration-sexpr)) > > (define-compound-unit launch@ > (import (T : tcp^)) > (export S) > (link > [((C : web-config^)) configuration@] > [((S : web-server^)) web-server@ T C])) > > (define-values/invoke-unit > launch@ > (import tcp^) > (export web-server^)) > > (provide serve) > (void (serve)) > (do-not-return) > > It starts the server properly, but unfortunately the server does not > find any servlets. Or anything else in the directory containing the > launcher. > > The relevant entry from the configuration-table would probably be > > (paths > (configuration-root "conf") > (host-root ".") > (log-file-path "log") > (file-root "htdocs") > (servlet-root ".") > (mime-types "mime.types") > (password-authentication "passwords")))) > > so when I have a servlet headers.scm I should be able to access it > through http://server:port/headers.scm right? I also tried copying the > file to a servlets subdirectory in the same way like the default server > does, but it still doesn't work as expected. One of the unfortunate things about the configuration table format is that the 'servlet-root' doesn't say where in 'htdocs' servlets are searched for. Instead, it says where relative to 'host-root' the "servlets" directory should be. The name "servlets" is hard-coded. Jay -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From jay.mccarthy at gmail.com Mon Oct 27 17:36:25 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:31:42 2009 Subject: [plt-scheme] plt-web-server configuration In-Reply-To: <20081027222641.632dceb2@halmanfloyd.lan.local> References: <20081025154440.3db7ac75@halmanfloyd.lan.local> <20081025201805.23048499@halmanfloyd.lan.local> <20081026021322.2f969a0e@halmanfloyd.lan.local> <20081026112141.7c0e1acb@halmanfloyd.lan.local> <20081026181034.558da293@halmanfloyd.lan.local> <20081027222641.632dceb2@halmanfloyd.lan.local> Message-ID: As an aside, dispatch.plt definitely DOES NOT reinvent the web server (in particular, you use the web-server with it.) It provides a way of writing PHP-style Web applications in Scheme, which can be very useful, if you aren't going to use the continuation features of the server. Jay On Mon, Oct 27, 2008 at 3:26 PM, Marek Kubica wrote: > On Sun, 26 Oct 2008 15:02:52 -0400 > "Matt Jadud" wrote: > >> I don't mean to start some kind of A vs. B discussion here, but I did >> want to challenge your notion that dispatch.plt is only for large >> sites. It made writing a small, simple RESTful servlet an easy thing. > > Ok, I was generalizing a bit too much. I'm absolutely sure that > instaweb.plt and (especially) dispatch.plt are quite useful but you > have to understand that now that I eally started doing stuff in Scheme, > there's quite a lot of concepts which wait to be mastered. I just > thought that it's not that smart to reinvent the PLT web server > dispatching again using dispatch.plt. And I believe that I'm now really > close to get the default server dispatching to work as I want it to. > > regards, > Marek > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From yinso.chen at gmail.com Mon Oct 27 17:41:37 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:31:42 2009 Subject: [plt-scheme] plt-web-server configuration In-Reply-To: <20081027222641.632dceb2@halmanfloyd.lan.local> References: <20081025154440.3db7ac75@halmanfloyd.lan.local> <20081025201805.23048499@halmanfloyd.lan.local> <20081026021322.2f969a0e@halmanfloyd.lan.local> <20081026112141.7c0e1acb@halmanfloyd.lan.local> <20081026181034.558da293@halmanfloyd.lan.local> <20081027222641.632dceb2@halmanfloyd.lan.local> Message-ID: <779bf2730810271441w550904a5n6f03fd60efbeb383@mail.gmail.com> Hi Marek - On Mon, Oct 27, 2008 at 2:26 PM, Marek Kubica wrote: > > Ok, I was generalizing a bit too much. I'm absolutely sure that > instaweb.plt and (especially) dispatch.plt are quite useful but you > have to understand that now that I eally started doing stuff in Scheme, > there's quite a lot of concepts which wait to be mastered. I just > thought that it's not that smart to reinvent the PLT web server > dispatching again using dispatch.plt. And I believe that I'm now really > close to get the default server dispatching to work as I want it to. > If you are concerned about reinventing the wheel, my 2 cents are one of the following will help you get going faster: 1) try to use the plt-web-server AS IS, or 2) try to use instaweb (and dispatch.plt) Both approaches' learning curve is lower than what you are trying to grok at once, as customizing plt-web-server's behavior (which instaweb does) would require you to understand a lot of PLT's concepts. Cheers, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081027/b7ee9293/attachment.htm From maxigas at anargeek.net Mon Oct 27 17:39:43 2008 From: maxigas at anargeek.net (maxigas) Date: Thu Mar 26 02:31:42 2009 Subject: [plt-scheme] plt-web-server configuration In-Reply-To: References: <20081027222544.6f4de3ac@halmanfloyd.lan.local> Message-ID: <20081027.223943.242624649.maxigas@anargeek.net> hi! > > so when I have a servlet headers.scm I should be able to access it > > through http://server:port/headers.scm right? I also tried copying the > > file to a servlets subdirectory in the same way like the default server > > does, but it still doesn't work as expected. shouldn't servlets end with .ss instead of the usual PLT Scheme .scm? also, in my default setup the servlets directory is ...collects/web-server/default-web-root/htdocs/ and the servlets directory is ...collects/web-server/default-web-root/servlets/ so servlets is in the *same* directory as htdocs and not below. hth, maxigas From marek at xivilization.net Mon Oct 27 17:51:03 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:31:43 2009 Subject: [plt-scheme] plt-web-server configuration In-Reply-To: References: <20081025154440.3db7ac75@halmanfloyd.lan.local> <20081025201805.23048499@halmanfloyd.lan.local> <20081026021322.2f969a0e@halmanfloyd.lan.local> <20081026112141.7c0e1acb@halmanfloyd.lan.local> <20081026181034.558da293@halmanfloyd.lan.local> <20081027222641.632dceb2@halmanfloyd.lan.local> Message-ID: <20081027225103.41f8902d@halmanfloyd.lan.local> On Mon, 27 Oct 2008 15:36:25 -0600 "Jay McCarthy" wrote: > As an aside, dispatch.plt definitely DOES NOT reinvent the web server > (in particular, you use the web-server with it.) It provides a way of > writing PHP-style Web applications in Scheme, which can be very > useful, if you aren't going to use the continuation features of the > server. The continuation-features of the web server are the very reason why I'm trying to use it. It is for learning new stuff. I'm pretty satisfied with the frameworks I normally use, but I decided to give continuation based web development a try. regards, Marek From marek at xivilization.net Mon Oct 27 17:57:15 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:31:43 2009 Subject: [plt-scheme] plt-web-server configuration In-Reply-To: <20081027.223943.242624649.maxigas@anargeek.net> References: <20081027222544.6f4de3ac@halmanfloyd.lan.local> <20081027.223943.242624649.maxigas@anargeek.net> Message-ID: <20081027225715.685fd535@halmanfloyd.lan.local> On Mon, 27 Oct 2008 22:39:43 +0100 (CET) maxigas wrote: > shouldn't servlets end with .ss instead of the usual PLT Scheme .scm? I haven't yet understood what the difference between .scm and .ss is. So far, they seemed to be equivalent. > also, in my default setup the servlets directory is > > ...collects/web-server/default-web-root/htdocs/ > > and the servlets directory is > > ...collects/web-server/default-web-root/servlets/ > > so servlets is in the *same* directory as htdocs and not below. Right. I have a directory with the creative name "plt" which contains my launcher which I cobbled together. I would like this "plt" directory to be the equivalent of the "default-web-root". It contains a servlets-directory and a headers.scm. When I rename it to headers.ss I still get a 404. regards, Marek From marek at xivilization.net Mon Oct 27 17:59:43 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:31:43 2009 Subject: [plt-scheme] plt-web-server configuration In-Reply-To: References: <20081025154440.3db7ac75@halmanfloyd.lan.local> <20081025201805.23048499@halmanfloyd.lan.local> <20081026021017.42056e15@halmanfloyd.lan.local> <20081027222544.6f4de3ac@halmanfloyd.lan.local> Message-ID: <20081027225943.1906e24f@halmanfloyd.lan.local> Hi, On Mon, 27 Oct 2008 15:35:14 -0600 "Jay McCarthy" wrote: > One of the unfortunate things about the configuration table format is > that the 'servlet-root' doesn't say where in 'htdocs' servlets are > searched for. Instead, it says where relative to 'host-root' the > "servlets" directory should be. The name "servlets" is hard-coded. That's no problem. What wonders me is that although I have (host-root ".") and start my launcher from the directory containing the servlet direcotry, I still get a 404 error when trying to access my servlet via a browser. regards, Marek From andre.mayers at usherbrooke.ca Mon Oct 27 21:08:39 2008 From: andre.mayers at usherbrooke.ca (Andre Mayers) Date: Thu Mar 26 02:31:43 2009 Subject: [plt-scheme] I try to understand the use and the nature of pattern variables and identifier in syntax-case In-Reply-To: <20081026181034.558da293@halmanfloyd.lan.local> References: <20081025154440.3db7ac75@halmanfloyd.lan.local> <20081025201805.23048499@halmanfloyd.lan.local> <20081026021322.2f969a0e@halmanfloyd.lan.local> <20081026112141.7c0e1acb@halmanfloyd.lan.local> <20081026181034.558da293@halmanfloyd.lan.local> Message-ID: <000c01c93899$b66601e0$233205a0$@mayers@usherbrooke.ca> Hi,=20 As an exercise, I try to define a macro, named for-each.=20 (define-syntax for-each (=A6=CB (stx) (let ([stx-ici (quote-syntax ici)]) (syntax-case stx () [(_ fn ls)=20 (stx-null? (syntax ls)) #''termin=A8=A6] [(_ fn ls) (datum->syntax stx-ici (list #'begin (list (stx-cadr stx) (stx-car (stx-caddr stx))) (list #'for-each (stx-cadr stx) (stx-cdr (stx-caddr stx)))))])))) This macro works well but I want to express the result-expression of the second clause in terms of pattern variables fn and ls. I know that = for-each macro can be programmed more simply the following way=20 (define-syntax for-each (=A6=CB (stx) (syntax-case stx () [(_ fn ())=20 #''termin=A8=A6] [(_ fn (e0 e1 ...)) (syntax=20 (begin (fn e0) (for-each fn (e1 ...))))]))) however, my purpose is to understand what I can do with pattern = variables and identifiers.=20 Below you will find the definition of procedures used in this macro and = one expression using for-each.=20 (require (for-syntax syntax/stx)) (define stx-cadr (=A6=CB (p) (stx-car (stx-cdr p)))) (define stx-caddr (=A6=CB (p) (stx-car (stx-cdr (stx-cdr p))))) (for-each (lambda (x) (display x) (newline))=20 (1 2 3)) any help will be very appreciated.=20 Andr=A8=A6 Mayers, Ph.D., M. Ps. professeur agr=A8=A6g=A8=A6 D=A8=A6partement d'informatique Universit=A8=A6 de Sherbrooke Sherbrooke (Qu=A8=A6bec) Canada J1K 2R1 t=A8=A6l: +1 819-821-8000 poste 62041 fax: +1 819-821-8200 andre.mayers@usherbrooke.ca http://www.dmi.usherb.ca/~amayersw.dmi.usherb.ca/~amayers From deepankar.sharma at gmail.com Mon Oct 27 22:43:34 2008 From: deepankar.sharma at gmail.com (Deep) Date: Thu Mar 26 02:31:43 2009 Subject: [plt-scheme] Re: opengrok hosted instance with DrScheme sources. In-Reply-To: <18694.6901.758605.967666@arabic.ccs.neu.edu> References: <2d9ff85a-017b-44b4-94d3-aa306b280d30@v30g2000hsa.googlegroups.com> <18693.59583.714910.131782@arabic.ccs.neu.edu> <12efa09c-0269-4abd-a1b7-7730add4887c@r66g2000hsg.googlegroups.com> <932b2f1f0810270952x5cc99570kdf25571942a9b6e6@mail.gmail.com> <18694.6901.758605.967666@arabic.ccs.neu.edu> Message-ID: <21e084ab-f7b6-4274-88ce-516914334134@u65g2000hsc.googlegroups.com> I find the opengrok installation pretty useful for understanding the mzscheme internals. I will try to get a publicly accessible opengrok installation available for public use. If people find it useful in its current state then maybe we can revisit the topic of adding it to the drscheme website. On Oct 27, 3:48?pm, Eli Barzilay wrote: > On Oct 27, Deep wrote: > > > The big plus that opengrok has over google codesearch that it has > > cross linking. So you can click on function calls/datastructures to > > get to the definition of the function/datastructure. This makes code > > discovery very easy. > > > I think opengrok supports svn repositories nativeley. So you can > > just point it to the repository and it will index things. > > That's good. > > > It also has an inbuilt web frontend which requires apache tomcat (or > > any other java application server ). Installation is > > straightforward. > > That's one thing that worries me -- I try to keep the web-related > packages on the server to a minimum... ?(It doesn't use php or perl, > for example, and having a java installation tends to be a sticky > issue...) > > > If there are any questions I will try to answer them to the best of > > my knowledge and try to find answers for things that I dont know. > > > An example of a hosted opengrok instance is > >http://opengrok.netbsd.org/source/. ?Just try searching for > > "fprintf" (without the quotation marks) and browse through the files > > that come up. > > Thanks, it does look interesting. > > On Oct 27, Deep wrote: > > > Yes for the scheme code opengrok doesnt work well. (No cross links > > supported / search falls back to text search). But all the sources > > under the src directory in drscheme sources seems to be plain c > > files and would hence benefit from opengrok indexing. > > That's a major problem. ?Rudimentary Scheme support would be nice, but > of course a proper solution is one that will analyze the actual > require and binding-structure and create real links... > > -- > ? ? ? ? ? ((lambda (x) (x x)) (lambda (x) (x x))) ? ? ? ? ?Eli Barzilay: > ? ? ? ? ? ? ? ? ?http://www.barzilay.org/? ? ? ? ? ? ? ? Maze is Life! > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme From sbloch at adelphi.edu Mon Oct 27 23:30:38 2008 From: sbloch at adelphi.edu (Stephen Bloch) Date: Thu Mar 26 02:31:44 2009 Subject: [plt-scheme] provide/contract In-Reply-To: <21e084ab-f7b6-4274-88ce-516914334134@u65g2000hsc.googlegroups.com> References: <2d9ff85a-017b-44b4-94d3-aa306b280d30@v30g2000hsa.googlegroups.com> <18693.59583.714910.131782@arabic.ccs.neu.edu> <12efa09c-0269-4abd-a1b7-7730add4887c@r66g2000hsg.googlegroups.com> <932b2f1f0810270952x5cc99570kdf25571942a9b6e6@mail.gmail.com> <18694.6901.758605.967666@arabic.ccs.neu.edu> <21e084ab-f7b6-4274-88ce-516914334134@u65g2000hsc.googlegroups.com> Message-ID: <0BFB2D76-AE28-4400-949C-CC4B49E53E44@adelphi.edu> Trying to learn about these enforced-contract things by adding "provide/contract" to some of my teachpacks. For example, (provide/contract (show-pinhole (-> image? image?)) (crop-top (-> image? number? image?)) (image-beside? (->* (image? image?) () #:rest (listof image?) image?) ...) Unfortunately, this doesn't pass a syntax check: as soon as there is even one (simple, like show-pinhole) provide/contract involving images, it says "unbound variable in module in: image?" This is especially puzzling as I've been using image-library functions throughout the rest of the source file with no difficulty; it seems only provide/contract that can't find them. I've already got .. (require (lib "image.ss" "htdp")) .. (provide (all-from (lib "image.ss" "htdp"))) .. What more do I have to do for provide/contract to know what an "image?" is? Stephen Bloch sbloch@adelphi.edu From farr at mit.edu Mon Oct 27 23:37:35 2008 From: farr at mit.edu (Will Farr) Date: Thu Mar 26 02:31:44 2009 Subject: [plt-scheme] provide/contract In-Reply-To: <0BFB2D76-AE28-4400-949C-CC4B49E53E44@adelphi.edu> References: <2d9ff85a-017b-44b4-94d3-aa306b280d30@v30g2000hsa.googlegroups.com> <18693.59583.714910.131782@arabic.ccs.neu.edu> <12efa09c-0269-4abd-a1b7-7730add4887c@r66g2000hsg.googlegroups.com> <932b2f1f0810270952x5cc99570kdf25571942a9b6e6@mail.gmail.com> <18694.6901.758605.967666@arabic.ccs.neu.edu> <21e084ab-f7b6-4274-88ce-516914334134@u65g2000hsc.googlegroups.com> <0BFB2D76-AE28-4400-949C-CC4B49E53E44@adelphi.edu> Message-ID: Stephen, Do you include the (require ...) line for image.ss *before* you have the (provide/contract ...) form? I've found contracts to be sensitive to the order in which things are defined---any function definitions used in the contracts (in this case image?, in my normal use case a structure predicate) must be defined before the (provide/contract ...) form is encountered. I don't really know why this is the case, but I assume it's hard to fix, or the PLT people would have fixed it already. Will On Mon, Oct 27, 2008 at 11:30 PM, Stephen Bloch wrote: > Trying to learn about these enforced-contract things by adding > "provide/contract" to some of my teachpacks. For example, > > (provide/contract (show-pinhole (-> image? image?)) > (crop-top (-> image? number? image?)) > (image-beside? (->* (image? image?) () #:rest > (listof image?) image?) > ...) > > Unfortunately, this doesn't pass a syntax check: as soon as there is even > one (simple, like show-pinhole) provide/contract involving images, it says > "unbound variable in module in: image?" This is especially puzzling as I've > been using image-library functions throughout the rest of the source file > with no difficulty; it seems only provide/contract that can't find them. > I've already got > .. > (require (lib "image.ss" "htdp")) > .. > (provide (all-from (lib "image.ss" "htdp"))) > .. > What more do I have to do for provide/contract to know what an "image?" is? > > > > > Stephen Bloch > sbloch@adelphi.edu > > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From workmin at ccs.neu.edu Tue Oct 28 00:13:55 2008 From: workmin at ccs.neu.edu (Jon Rafkind) Date: Thu Mar 26 02:31:44 2009 Subject: [plt-scheme] Re: creating new readers In-Reply-To: <490542BE.6040907@ccs.neu.edu> References: <4903BD90.1070901@ccs.neu.edu> <4903FB94.5000502@ccs.neu.edu> <490542BE.6040907@ccs.neu.edu> Message-ID: <49069183.5030701@ccs.neu.edu> >> Any chance you could enlighten the rest of us? >> >> > Heh, I was pretty sure someone would want to see the solution. I won't > get to it tonight, but I'll post an example tommorow morning or so. I attempted to create a new language in mzscheme through the #lang interface and this is a summary of my experience. New languages seem to consist of 2 things: a reader and a base language. Of course that is not strictly true, you can use mzscheme's reader and a new base language or your own reader and mzscheme's base language but I was trying not to re-use mzscheme. The directory structure should be something like this: newlang/ * lang/ * * reader.ss * main.ss Where reader.ss is your reader and main.ss is the base language. The reader should export two functions: `read' and `read-syntax'. `read' returns a datum while `read-syntax' returns a syntax object. I'm not sure what `read' is supposed to do other than just convert the result of `read-syntax' to a datum so thats all I had it doing. (define (read port) (syntax->datum (read-syntax #f port))) So then I defined `read-syntax' to invoke my custom parser and wrap the resulting syntax object in a module expression. (define (read-syntax name port) (let* ((p-name (object-name port)) (name (if (path? p-name) (let-values (((base name dir?) (split-path p-name))) (string->symbol (path->string (path-replace-suffix name #"")))) 'page))) #`(module #,name newlang #,(custom-parser)))) The `name' object will be the name of the file that has the #lang in it, otherwise it will be 'page if there is no name for the current file such as when editing a file in drscheme without having saved it. The full reader so far is -- #lang