From noelwelsh at gmail.com Mon Dec 1 02:54:01 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:34:46 2009 Subject: [plt-scheme] Setup and teardown in SchemeUnit In-Reply-To: <5e8b0f6b0811301517m44a1be04mff1ce402832d50b1@mail.gmail.com> References: <5e8b0f6b0811301405n55f1ba9pc5e2a4e71979e738@mail.gmail.com> <5e8b0f6b0811301447v49ee5195m54222f9760124d72@mail.gmail.com> <5e8b0f6b0811301517m44a1be04mff1ce402832d50b1@mail.gmail.com> Message-ID: And it's a brand new day... Abstract over a test-case with the setup you want: (define-syntax my-test-case (syntax-rules () [(my-test-case name expr ...) (test-case name (before (my-before-expr) expr ...))])) (my-test-case (+ 1 1)) (my-test-case (+ 2 2)) ... A class is the main unit of abstraction in Java/Python, with overloading the main method of extension. In Scheme its a functions and function parameterisation respectively, so the mechanism of setup/teardown changes to match the language (and I use a macro above for reasons that aren't really important). Adding setup/teardown arguments to test-begin/test-case is something that might be worth doing. In my experience I don't need this often enough to justify it. N. From maurizio.ferreira at seling.it Mon Dec 1 04:48:07 2008 From: maurizio.ferreira at seling.it (Ferreira Maurizio) Date: Thu Mar 26 02:34:50 2009 Subject: [plt-scheme] Unexpected error using "static-files-path" Message-ID: <863055B715B9D04CB4320CFCDEE0837F010C523B@mailing.selesta.it> I tried the following example, taken from the tutorial "Continue: Web Applications in PLT Scheme " As i start the program I receive the following error: procedure application: procedure: #; does not expect an argument with keyword #:extra-files-path; arguments were: # #:extra-files-path # #:launch-browser? #t Any suggestion ? Regards Maurizio. #lang web-server/insta (define (start request) '(html (head (title "Testing")) (link ((rel "stylesheet") (href "/test-static.css") (type "text/css"))) (body (h1 "Testing") (h2 "This is a header") (p "This is " (span ((class "hot")) "hot") ".")))) (static-files-path "htdocs") From noelwelsh at gmail.com Mon Dec 1 10:11:02 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:34:52 2009 Subject: [plt-scheme] Unexpected error using "static-files-path" In-Reply-To: <863055B715B9D04CB4320CFCDEE0837F010C523B@mailing.selesta.it> References: <863055B715B9D04CB4320CFCDEE0837F010C523B@mailing.selesta.it> Message-ID: Possibly your installation of PLT Scheme is out of date. Check you have the latest version (including the minor version number). N. On Mon, Dec 1, 2008 at 9:48 AM, Ferreira Maurizio wrote: > I tried the following example, taken from the > tutorial "Continue: Web Applications in PLT Scheme " > As i start the program I receive the following error: > > procedure application: procedure: #; > does not expect an argument with keyword #:extra-files-path; > arguments were: # #:extra-files-path # > #:launch-browser? #t ... From maurizio.ferreira at seling.it Mon Dec 1 10:37:58 2008 From: maurizio.ferreira at seling.it (Ferreira Maurizio) Date: Thu Mar 26 02:34:52 2009 Subject: R: [plt-scheme] Unexpected error using "static-files-path" Message-ID: <863055B715B9D04CB4320CFCDEE0837F010C5509@mailing.selesta.it> Noel Welsh wrote: >Possibly your installation of PLT Scheme is out of date. Check you have the latest version (including the minor version number). I'm triyng with a fresh installation of Plt scheme 4.1.3 [3m], under windows 2000. The problem still persists. Regards Maurizio. From jay.mccarthy at gmail.com Mon Dec 1 10:58:46 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:34:53 2009 Subject: [plt-scheme] Unexpected error using "static-files-path" In-Reply-To: <863055B715B9D04CB4320CFCDEE0837F010C523B@mailing.selesta.it> References: <863055B715B9D04CB4320CFCDEE0837F010C523B@mailing.selesta.it> Message-ID: There was a bug in the insta module. It is fixed in SVN now. If you want to fix it on your installation, change line 64 in web-server/insta/insta.ss from #:extra-files-path extra-files-path to #:extra-files-paths (list extra-files-path) I apologize for the inconvenience Jay On Mon, Dec 1, 2008 at 2:48 AM, Ferreira Maurizio wrote: > I tried the following example, taken from the > tutorial "Continue: Web Applications in PLT Scheme " > As i start the program I receive the following error: > > procedure application: procedure: #; > does not expect an argument with keyword #:extra-files-path; > arguments were: # #:extra-files-path # > #:launch-browser? #t > > Any suggestion ? > Regards > Maurizio. > > #lang web-server/insta > (define (start request) > '(html (head (title "Testing")) > (link ((rel "stylesheet") > (href "/test-static.css") > (type "text/css"))) > (body (h1 "Testing") > (h2 "This is a header") > (p "This is " (span ((class "hot")) "hot") ".")))) > > (static-files-path "htdocs") > _________________________________________________ > 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 chust at web.de Mon Dec 1 11:08:54 2008 From: chust at web.de (Thomas Chust) Date: Thu Mar 26 02:34:53 2009 Subject: [plt-scheme] Unexpected error using "static-files-path" In-Reply-To: <863055B715B9D04CB4320CFCDEE0837F010C523B@mailing.selesta.it> References: <863055B715B9D04CB4320CFCDEE0837F010C523B@mailing.selesta.it> Message-ID: <49340C16.4070609@web.de> Ferreira Maurizio schrieb: > [...] > procedure application: procedure: #; > does not expect an argument with keyword #:extra-files-path; > arguments were: # #:extra-files-path # > #:launch-browser? #t > [...] Hello, a quick glance at the contents of collects/web-server/servlet-env.ss and at the documentation confirms that from PLT Scheme 4.1.2 to 4.1.3 the signature of serve/servlet changed. In version 4.1.2 serve/servlet accepted a keyword parameter #:extra-files-path with contract path?, in version 4.1.3 the keyword parameter is now called #:extra-files-paths with contract (listof path?). However, the change was probably not correctly reflected in the instant servlet customization API. You can work around that problem by calling serve/servlet directly from your code. Replace #lang web-server/insta by #lang scheme (require web-server/servlet-env) and add (serve/servlet start #:extra-files-paths (list (build-path "htdocs"))) to the bottom of your code. cu, Thomas From eddieSull at hotmail.com Mon Dec 1 11:16:53 2008 From: eddieSull at hotmail.com (Eddie Sullivan) Date: Thu Mar 26 02:34:53 2009 Subject: [plt-scheme] Serializing/deserializing in a servlet References: <932b2f1f0811282126r3eabff32ya2eb665748f2f04a@mail.gmail.com> Message-ID: Thanks, guys, for the replies. I'm not sure I understand the explanation about namespaces (since there's only one servelet), but using a prefab structure did the trick. -Eddie ----- Original Message ----- From: "Jay McCarthy" To: "Robby Findler" Cc: "Eddie Sullivan" ; Sent: Friday, November 28, 2008 9:32 PM Subject: Re: [plt-scheme] Serializing/deserializing in a servlet >I believe that they wouldn't be interfered with by the separate > namespaces. But if the "real" structs Eddie wants have properties, > then IIRC, prefab'd structs can't have them. > > Jay > > On Fri, Nov 28, 2008 at 10:26 PM, Robby Findler > wrote: >> Would a #:prefab struct help? >> >> Robby >> >> On Fri, Nov 28, 2008 at 11:23 PM, Jay McCarthy >> wrote: >>> Servlets don't share namespaces, in particular, this means that >>> servlets can't interact with each other through structs, which are >>> generative. You can solve this by passing the #:make-servlet-namespace >>> argument to serve/servlet passing in the module spec of the source of >>> the struct. I could debug this program tomorrow, but I don't have time >>> right now. >>> >>> Jay >>> >>> On Fri, Nov 28, 2008 at 12:45 PM, Eddie Sullivan >>> wrote: >>>> Hi. >>>> The following simple code works well normally, but when run in a >>>> servlet >>>> causes a strange error: >>>> >>>> #lang scheme >>>> >>>> (require scheme/serialize >>>> web-server/servlet-env) >>>> >>>> (define-serializable-struct test-struct >>>> (a)) >>>> >>>> (define (test-serialize) >>>> (let* ([s (make-test-struct >>>> "Eddie Sullivan")] >>>> [serialized-s (serialize s)] >>>> [new-s (deserialize serialized-s)]) >>>> (display (format "test-serialize: Saved a: ~a" (test-struct-a >>>> new-s))))) >>>> >>>> >>>> (define (go) >>>> (serve/servlet start)) >>>> >>>> (define (start request) >>>> (test-serialize)) >>>> >>>> >>>> In DrScheme (Windows, vs 4.1.3), if I call (test-serialize), I see the >>>> expected result: >>>> >>>> test-serialize: Saved a: Eddie Sullivan >>>> >>>> On the other hand, if I call (go), I see the following error: >>>> >>>> Servlet (@ /servlets/standalone.ss) exception: >>>> test-struct-a: expects args of type ; given >>>> instance of >>>> a different >>>> >>>> Any tips? >>>> Thanks. >>>> -Eddie Sullivan >>>> >>>> >>>> >>>> _________________________________________________ >>>> 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 >>> _________________________________________________ >>> 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 gregory.woodhouse at gmail.com Mon Dec 1 13:26:16 2008 From: gregory.woodhouse at gmail.com (Greg Woodhouse) Date: Thu Mar 26 02:34:53 2009 Subject: [plt-scheme] Re: The Philosophy of DrScheme In-Reply-To: <184222e50811270552h4202af02h7c879915e3d08778@mail.gmail.com> References: <756daca50811211340o2b50303ck6bec191de87338fd@mail.gmail.com> <756daca50811211340o2b50303ck6bec191de87338fd-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> <49274148.4090700@uwaterloo.ca> <2tvmi4pbovk1kn1vlf5pm93qsn2ibsb8um@4ax.com> <261ni4t0ai4dg3kbjf9a03u0minn8ca1m1@4ax.com> <184222e50811261837u46cf38f9u381a686e86e49164@mail.gmail.com> <184222e50811270552h4202af02h7c879915e3d08778@mail.gmail.com> Message-ID: <5f07325f0812011026n33be8dd7q569a75c50dfe52cc@mail.gmail.com> A minor nit: There is no reason why mathematics cannot be taught as an active process of discovery. The problem (well, one problem) is that the only way to really learn mathematics is by doing, and that means calculating. Still, there is no reason it can't be interesting. I'll give you an example: one thing that always intrigued me, even as a child, is that there are only 5 regular polyhedra (the tetrahedron, octahedron, cube, dodecahedron and icosohedron), but I didn't realize until much later how accessible a result it really is. You could almost make it a homework exercise! Start with Euler's famous formula V - E + F = 2 (for a topological sphere) and then suppose you have refgular polyhedron the faces of which are n-gons. It all comes down to counting: If there are m of them, how many times will you count each vertex in m times n vertices per face? How many times will you count each edge? What happens if you plug these numbers in Euler's formula? Even if youer students take euler's formula on faith, the result is still impressive. On Thu, Nov 27, 2008 at 5:52 AM, Eduardo Bellani wrote: > Well, I guess great minds think alike :) > >From what I'm seeing so far the target population are a bit different, > yours being mostly the undergrad students, Papert's being children, > but I guess the goal is pretty much the same: > > "We therefore believe that the study of program design deserves the same > central > role in general education as mathematics and English. Or, put more > succinctly, > everyone should learn how to design programs. On one hand, program design > teaches the same analytical skills as mathematics. But, unlike mathematics, > working with programs is an active approach to learning." - HtDP > > "In many schools today, the phrase "computer-aided instruction" > means making the computer teach the child. One might say the > computer is being used to program the child. In my vision, the > child programs the computer and, in doing so, both acquires a > sense of mastery over a piece of the most modern and powerful > technology and establishes an intimate contact with some of the > deepest ideas from science, from mathematics, and from the art of > intellectual model building." - Mindstorms, Children, Computers and > Powerful Ideas > > Just by curiosity > > I ran into Logo and the book a year after I finished most of HtDP. > What book are you talking about? > > -- > Eduardo Bellani > > www.cnxs.com.br > > "What is hateful to you, do not to your fellow men. That is the entire > Law; all the rest is commentary." The Talmud > _________________________________________________ > 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/20081201/a3effb45/attachment.htm From rob.hunter at gmail.com Mon Dec 1 13:38:42 2008 From: rob.hunter at gmail.com (Rob Hunter) Date: Thu Mar 26 02:34:54 2009 Subject: [plt-scheme] abstracting over (PLaneT) requires Message-ID: Is there any way to abstract over requires? In particular, I'm interested in abstracting over the version of a PLaneT package that I require. Something like (require (planet "some-file.ss" ("joe" "a-package.plt" MAJOR (= MINOR)))) where MAJOR and MINOR could be bound in exactly one spot. Thus, I could easily do a system-wide change of which version of a-package.plt I am including. Thanks! Rob From jay.mccarthy at gmail.com Mon Dec 1 13:50:03 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:34:54 2009 Subject: [plt-scheme] abstracting over (PLaneT) requires In-Reply-To: References: Message-ID: Here's a simple way: my-lib.ss: (require (planet "some-file.ss" ("joe" "a-package.plt" MAJOR (= MINOR)))) (provide (all-from-out (planet "some-file.ss" ("joe" "a-package.plt" MAJOR (= MINOR))))) my-old-other-lib.ss: (require (planet "some-file.ss" ("joe" "a-package.plt" MAJOR (= MINOR)))) my-other-lib.ss: (require "my-lib.ss") Jay On Mon, Dec 1, 2008 at 11:38 AM, Rob Hunter wrote: > Is there any way to abstract over requires? In particular, I'm > interested in abstracting over the version of a PLaneT package that I > require. Something like > > (require (planet "some-file.ss" ("joe" "a-package.plt" MAJOR (= MINOR)))) > > where MAJOR and MINOR could be bound in exactly one spot. Thus, I > could easily do a system-wide change of which version of a-package.plt > I am including. > > Thanks! > > 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 d.j.gurnell at gmail.com Mon Dec 1 13:53:34 2008 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Thu Mar 26 02:34:54 2009 Subject: [plt-scheme] abstracting over (PLaneT) requires In-Reply-To: References: Message-ID: You can re-provide required elements with all-from-out. I tend to do this in a module called base.ss that is used by all other modules in the code: -- base.ss -- #lang scheme (require (planet foo/bar:1)) (provide (all-from-out (planet foo/bar:1))) -- other.ss -- #lang scheme (require "base.ss") The module acts as the abstraction. -- Dave > Is there any way to abstract over requires? In particular, I'm > interested in abstracting over the version of a PLaneT package that I > require. Something like > > (require (planet "some-file.ss" ("joe" "a-package.plt" MAJOR (= > MINOR)))) > > where MAJOR and MINOR could be bound in exactly one spot. Thus, I > could easily do a system-wide change of which version of a-package.plt > I am including. > > Thanks! > > Rob > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From ebellani at gmail.com Mon Dec 1 14:13:36 2008 From: ebellani at gmail.com (Eduardo Bellani) Date: Thu Mar 26 02:34:54 2009 Subject: [plt-scheme] Re: The Philosophy of DrScheme In-Reply-To: <5f07325f0812011026n33be8dd7q569a75c50dfe52cc@mail.gmail.com> References: <756daca50811211340o2b50303ck6bec191de87338fd@mail.gmail.com> <756daca50811211340o2b50303ck6bec191de87338fd-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> <49274148.4090700@uwaterloo.ca> <2tvmi4pbovk1kn1vlf5pm93qsn2ibsb8um@4ax.com> <261ni4t0ai4dg3kbjf9a03u0minn8ca1m1@4ax.com> <184222e50811261837u46cf38f9u381a686e86e49164@mail.gmail.com> <184222e50811270552h4202af02h7c879915e3d08778@mail.gmail.com> <5f07325f0812011026n33be8dd7q569a75c50dfe52cc@mail.gmail.com> Message-ID: <184222e50812011113h4f1bd80dh178e5ee2bccd8e82@mail.gmail.com> Hey. Learning by discovery, or appropriation is one of the major tenets of constructionism. I seriously recommend Mindstorms as one revolutionary book (followed by any other Papert work, like the turtle hurdles videos, his ideas are mind blowing in their simplicity and impact). Hugs -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFJNDcsTGtma8x8sd4RAh7xAJ9R+iMP+yN/10DWskQmETvwydSDXACgtE0O gztweQtrKK968IavGvmiLI4= =UUZ2 -----END PGP SIGNATURE----- On Mon, Dec 1, 2008 at 4:26 PM, Greg Woodhouse wrote: > A minor nit: There is no reason why mathematics cannot be taught as an > active process of discovery. The problem (well, one problem) is that the > only way to really learn mathematics is by doing, and that means > calculating. Still, there is no reason it can't be interesting. I'll give > you an example: one thing that always intrigued me, even as a child, is that > there are only 5 regular polyhedra (the tetrahedron, octahedron, cube, > dodecahedron and icosohedron), but I didn't realize until much later how > accessible a result it really is. You could almost make it a homework > exercise! Start with Euler's famous formula V - E + F = 2 (for a topological > sphere) and then suppose you have refgular polyhedron the faces of which are > n-gons. It all comes down to counting: If there are m of them, how many > times will you count each vertex in m times n vertices per face? How many > times will you count each edge? What happens if you plug these numbers in > Euler's formula? Even if youer students take euler's formula on faith, the > result is still impressive. > > On Thu, Nov 27, 2008 at 5:52 AM, Eduardo Bellani wrote: >> >> Well, I guess great minds think alike :) >> >From what I'm seeing so far the target population are a bit different, >> yours being mostly the undergrad students, Papert's being children, >> but I guess the goal is pretty much the same: >> >> "We therefore believe that the study of program design deserves the same >> central >> role in general education as mathematics and English. Or, put more >> succinctly, >> everyone should learn how to design programs. On one hand, program design >> teaches the same analytical skills as mathematics. But, unlike >> mathematics, >> working with programs is an active approach to learning." - HtDP >> >> "In many schools today, the phrase "computer-aided instruction" >> means making the computer teach the child. One might say the >> computer is being used to program the child. In my vision, the >> child programs the computer and, in doing so, both acquires a >> sense of mastery over a piece of the most modern and powerful >> technology and establishes an intimate contact with some of the >> deepest ideas from science, from mathematics, and from the art of >> intellectual model building." - Mindstorms, Children, Computers and >> Powerful Ideas >> >> Just by curiosity >> > I ran into Logo and the book a year after I finished most of HtDP. >> What book are you talking about? >> >> -- >> Eduardo Bellani >> >> www.cnxs.com.br >> >> "What is hateful to you, do not to your fellow men. That is the entire >> Law; all the rest is commentary." The Talmud >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > -- Eduardo Bellani www.cnxs.com.br "What is hateful to you, do not to your fellow men. That is the entire Law; all the rest is commentary." The Talmud From rob.hunter at gmail.com Mon Dec 1 14:54:03 2008 From: rob.hunter at gmail.com (Rob Hunter) Date: Thu Mar 26 02:34:55 2009 Subject: [plt-scheme] abstracting over (PLaneT) requires In-Reply-To: References: Message-ID: Alright, cool. Thanks, all. --rob On Mon, Dec 1, 2008 at 10:53 AM, Dave Gurnell wrote: > You can re-provide required elements with all-from-out. > > I tend to do this in a module called base.ss that is used by all other > modules in the code: > > -- base.ss -- > > #lang scheme > (require (planet foo/bar:1)) > (provide (all-from-out (planet foo/bar:1))) > > -- other.ss -- > > #lang scheme > (require "base.ss") > > The module acts as the abstraction. > > -- Dave > >> Is there any way to abstract over requires? In particular, I'm >> interested in abstracting over the version of a PLaneT package that I >> require. Something like >> >> (require (planet "some-file.ss" ("joe" "a-package.plt" MAJOR (= MINOR)))) >> >> where MAJOR and MINOR could be bound in exactly one spot. Thus, I >> could easily do a system-wide change of which version of a-package.plt >> I am including. >> >> Thanks! >> >> Rob >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From noelwelsh at gmail.com Mon Dec 1 15:26:45 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:34:55 2009 Subject: [plt-scheme] abstracting over (PLaneT) requires In-Reply-To: References: Message-ID: There is also Ryan Culpepper's require.plt N. On Mon, Dec 1, 2008 at 6:38 PM, Rob Hunter wrote: > Is there any way to abstract over requires? From ce.rohan at gmail.com Mon Dec 1 16:20:48 2008 From: ce.rohan at gmail.com (Rohan Golwala) Date: Thu Mar 26 02:34:55 2009 Subject: [plt-scheme] Web Application Message-ID: Hi, I have to start a PLT Scheme project on Web application such as developing a web form and putting some controls such as buttons, textbox, etc and then connect that form to a database..... Can anyone help me or provide me with some starter code or please send me a link or any document from where I can start....? Thanks, -- Rohan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081201/0f080541/attachment.html From constant.beta at gmail.com Mon Dec 1 16:24:10 2008 From: constant.beta at gmail.com (=?ISO-8859-2?Q?Micha=B3_Kwiatkowski?=) Date: Thu Mar 26 02:34:56 2009 Subject: [plt-scheme] Setup and teardown in SchemeUnit In-Reply-To: References: <5e8b0f6b0811301405n55f1ba9pc5e2a4e71979e738@mail.gmail.com> <5e8b0f6b0811301447v49ee5195m54222f9760124d72@mail.gmail.com> <5e8b0f6b0811301517m44a1be04mff1ce402832d50b1@mail.gmail.com> Message-ID: <5e8b0f6b0812011324g361321b8g8f717fb4ffd3299b@mail.gmail.com> On Mon, Dec 1, 2008 at 8:54 AM, Noel Welsh wrote: > And it's a brand new day... > > Abstract over a test-case with the setup you want: > > (define-syntax my-test-case > (syntax-rules () > [(my-test-case name expr ...) > (test-case name (before (my-before-expr) expr ...))])) > > (my-test-case (+ 1 1)) > (my-test-case (+ 2 2)) > ... That isn't much of an improvement, as I'd have to make a macro for each fixture and tests using the same fixture won't be bundled together. I was thinking more of something looking like this: (test-suite "Test suite with a fixture." #:setup (lambda () (display "Setup\n")) #:teardown (lambda () (display "Teardown\n")) (test-case "Test case 1" (display "#1\n")) (test-case "Test case 2" (display "#2\n"))) Running this test would then print: Setup #1 Teardown Setup #2 Teardown > A class is the main unit of abstraction in Java/Python, with > overloading the main method of extension. In Scheme its a functions > and function parameterisation respectively, so the mechanism of > setup/teardown changes to match the language (and I use a macro above > for reasons that aren't really important). I don't see how available methods of abstraction affect this use case. I use Scheme and I still need the setup/teardown behavior. I'm surprised this pattern isn't included in SchemeUnit by default, as it's common when testing for side-effects. > Adding setup/teardown arguments to test-begin/test-case is something > that might be worth doing. In my experience I don't need this often > enough to justify it. What about adding adding setup/teardown arguments to test-suite, as shown in an example above? Is there a chance it would be included in the next release of SchemeUnit if I implemented this myself? Cheers, mk From jensaxel at soegaard.net Mon Dec 1 16:27:46 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:34:56 2009 Subject: [plt-scheme] Web Application In-Reply-To: References: Message-ID: <493456D2.30301@soegaard.net> Rohan Golwala wrote: > > I have to start a PLT Scheme project on Web application such as > developing a web form and putting some controls such as buttons, > textbox, etc and then connect that form to a database..... > Can anyone help me or provide me with some starter code or please send > me a link or any document from where I can start....? http://docs.plt-scheme.org/continue/index.html -- Jens Axel S?gaard From robert.matovinovic at web.de Mon Dec 1 17:11:45 2008 From: robert.matovinovic at web.de (Robert Matovinovic) Date: Thu Mar 26 02:34:56 2009 Subject: AW: [plt-scheme] Help intigrating C/C++ into Scheme In-Reply-To: Message-ID: <584A5A79A1EB46529449F0309885433E@LENO> Quiet a while ago I had a similar problem. After I looked at the example of http://schemecookbook.org/Cookbook/ForeignInterfaceBasics and really understood it (which took me some time I admit), it wasn't as difficult as I thought. Since you are writing the C program yourself, I assume you should be able to write and compile it into a dynamic link library, which you can use than as shown in the example. The dll exports the data input functions, which you can access via the foreign function interface. As others mentioned, if you can be more precise you'll get better help. Only use C, if there is no other way to get what you want, Scheme is so much more comfortable. Robert -----Urspr?ngliche Nachricht----- Von: plt-scheme-bounces@list.cs.brown.edu [mailto:plt-scheme-bounces@list.cs.brown.edu] Im Auftrag von Zukowski, Steven D Gesendet: Samstag, 29. November 2008 22:59 An: plt-scheme@list.cs.brown.edu Betreff: [plt-scheme] Help intigrating C/C++ into Scheme I'm not sure the correct terminology for this, so I will just explain what I'm trying to accomplish. I am trying to have a Scheme program take input from the user, store that, and then send that off to a C/C++ program for processing. Once the data has been processed and worked I want to send it back to the waiting Scheme program where it will then be displayed. I want the user to start the Scheme Program which then brings up the GUI interface I'm building, input the data and hit enter. Once the user hits enter I want the Scheme part to call the C program and give it the user provided parameters. The C program works them, then returns the result to Scheme and shuts down. I am stuck at the part where I give data to a C/C++ program and then get it back. I have tried exploring Scheme's Foreign Language Interface but I can't get things working. I have tried reading over the documentation supplied in the PLT docs on the PLT Scheme C API but I just can't follow them. In short, I am completely stuck and I have no idea how to proceed. Please, can someone tell me how to interface to a C program or link one in with Scheme, I'm not sure the right way to say it. Or can someone please point me to a in-depth tutorial for doing this? The instructions on the PLT docs was not helpful because they were over my head. Steven Zukowski -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081201/820d0121/attachment.htm From danprager at optusnet.com.au Tue Dec 2 04:27:46 2008 From: danprager at optusnet.com.au (Daniel Prager) Date: Thu Mar 26 02:34:56 2009 Subject: [plt-scheme] The Philosophy of DrScheme In-Reply-To: <5f07325f0812011026n33be8dd7q569a75c50dfe52cc@mail.gmail.com> References: <756daca50811211340o2b50303ck6bec191de87338fd@mail.gmail.com> <756daca50811211340o2b50303ck6bec191de87338fd-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> <49274148.4090700@uwaterloo.ca> <2tvmi4pbovk1kn1vlf5pm93qsn2ibsb8um@4ax.com> <261ni4t0ai4dg3kbjf9a03u0minn8ca1m1@4ax.com> <184222e50811261837u46cf38f9u381a686e86e49164@mail.gmail.com> <184222e50811270552h4202af02h7c879915e3d08778@mail.gmail.com> <5f07325f0812011026n33be8dd7q569a75c50dfe52cc@mail.gmail.com> Message-ID: <4D270698-6B53-42AA-9D07-DB4F06EF1F32@optusnet.com.au> On 02/12/2008, at 5:26 AM, Greg Woodhouse wrote: > A minor nit: There is no reason why mathematics cannot be taught as > an active process of discovery. The problem (well, one problem) is > that the only way to really learn mathematics is by doing, and that > means calculating. Still, there is no reason it can't be > interesting. I'll give you an example: one thing that always > intrigued me, even as a child, is that there are only 5 regular > polyhedra (the tetrahedron, octahedron, cube, dodecahedron and > icosohedron), but I didn't realize until much later how accessible a > result it really is. You could almost make it a homework exercise! > Start with Euler's famous formula V - E + F = 2 (for a topological > sphere) and then suppose you have refgular polyhedron the faces of > which are n-gons. It all comes down to counting: If there are m of > them, how many times will you count each vertex in m times n > vertices per face? How many times will you count each edge? What > happens if you plug these numbers in Euler's formula? Even if youer > students take euler's formula on faith, the result is still > impressive. > An aside: Greg's example of Euler's formula is used to good effect in a wonderful book by Lakatos, "Proofs and Refutations", that reads almost like a play about what an idealised mathematical classroom might look like. [If you "look inside" on Amazon, you can read the first few pages, which gives the flavor of the book.] From sharkbrainguy at gmail.com Tue Dec 2 03:27:02 2008 From: sharkbrainguy at gmail.com (SweetwaterDixon) Date: Thu Mar 26 02:34:57 2009 Subject: [plt-scheme] Missing some libraries, trying to use LeftParen Message-ID: <8d775dae-3bcf-4756-a2fa-0120e309183d@g38g2000yqn.googlegroups.com> I installed plt scheme 4.1.3 today and I tried to follow this tutorial: http://planet.plt-scheme.org/package-source/vegashacker/leftparen.plt/2/2/planet-docs/leftparen/index.html but when I tried to do: mzscheme -e '(require (planet "bootstrap.scm" ("vegashacker" "leftparen.plt" 2 2)))' project hello-world I got this error: default-load-handler: cannot open input file: "/home/gerard/plt/ collects/web-server/private/response-structs.ss" (No such file or directory; errno=2) I did a locate for "response-struct.ss" and found it in: /home/gerard/ plt/collects/web-server/http so of course I take the first special-class thing that comes to mind and I: cp http/* private/* then left-paren installed without errors... but when I follow the next bit and try to start up the server: default-load-handler: cannot open input file: "/home/gerard/plt/ collects/web-server/dispatchers/dispatch-lang.ss" (No such file or directory; errno=2) Please, if someone could tell me what's going on and help me get this going it would be great. From jay.mccarthy at gmail.com Tue Dec 2 09:16:43 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:34:57 2009 Subject: [plt-scheme] Missing some libraries, trying to use LeftParen In-Reply-To: <8d775dae-3bcf-4756-a2fa-0120e309183d@g38g2000yqn.googlegroups.com> References: <8d775dae-3bcf-4756-a2fa-0120e309183d@g38g2000yqn.googlegroups.com> Message-ID: It looks like LeftParen is incompatible with some of the reorganization that went on before 4.1.3 came out. I would suggest using 4.1.2 until LeftParen is updated. Jay On Tue, Dec 2, 2008 at 1:27 AM, SweetwaterDixon wrote: > I installed plt scheme 4.1.3 today and I tried to follow this > tutorial: > http://planet.plt-scheme.org/package-source/vegashacker/leftparen.plt/2/2/planet-docs/leftparen/index.html > > but when I tried to do: > mzscheme -e '(require (planet "bootstrap.scm" ("vegashacker" > "leftparen.plt" 2 2)))' project hello-world > I got this error: > default-load-handler: cannot open input file: "/home/gerard/plt/ > collects/web-server/private/response-structs.ss" (No such file or > directory; errno=2) > > I did a locate for "response-struct.ss" and found it in: /home/gerard/ > plt/collects/web-server/http > > so of course I take the first special-class thing that comes to mind > and I: > cp http/* private/* > > then left-paren installed without errors... but when I follow the next > bit and try to start up the server: > default-load-handler: cannot open input file: "/home/gerard/plt/ > collects/web-server/dispatchers/dispatch-lang.ss" (No such file or > directory; errno=2) > > Please, if someone could tell me what's going on and help me get this > going it would be great. > _________________________________________________ > 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 rob.hunter at gmail.com Tue Dec 2 10:54:37 2008 From: rob.hunter at gmail.com (Rob Hunter) Date: Thu Mar 26 02:34:57 2009 Subject: [plt-scheme] Missing some libraries, trying to use LeftParen In-Reply-To: References: <8d775dae-3bcf-4756-a2fa-0120e309183d@g38g2000yqn.googlegroups.com> Message-ID: Sorry about that. I'll check out 4.1.3 and then push another LeftParen update ASAP. Thanks, Rob On Tue, Dec 2, 2008 at 6:16 AM, Jay McCarthy wrote: > It looks like LeftParen is incompatible with some of the > reorganization that went on before 4.1.3 came out. I would suggest > using 4.1.2 until LeftParen is updated. > > Jay > > On Tue, Dec 2, 2008 at 1:27 AM, SweetwaterDixon wrote: >> I installed plt scheme 4.1.3 today and I tried to follow this >> tutorial: >> http://planet.plt-scheme.org/package-source/vegashacker/leftparen.plt/2/2/planet-docs/leftparen/index.html >> >> but when I tried to do: >> mzscheme -e '(require (planet "bootstrap.scm" ("vegashacker" >> "leftparen.plt" 2 2)))' project hello-world >> I got this error: >> default-load-handler: cannot open input file: "/home/gerard/plt/ >> collects/web-server/private/response-structs.ss" (No such file or >> directory; errno=2) >> >> I did a locate for "response-struct.ss" and found it in: /home/gerard/ >> plt/collects/web-server/http >> >> so of course I take the first special-class thing that comes to mind >> and I: >> cp http/* private/* >> >> then left-paren installed without errors... but when I follow the next >> bit and try to start up the server: >> default-load-handler: cannot open input file: "/home/gerard/plt/ >> collects/web-server/dispatchers/dispatch-lang.ss" (No such file or >> directory; errno=2) >> >> Please, if someone could tell me what's going on and help me get this >> going it would be great. >> _________________________________________________ >> 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 > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From ebellani at gmail.com Tue Dec 2 11:04:35 2008 From: ebellani at gmail.com (Eduardo Bellani) Date: Thu Mar 26 02:34:57 2009 Subject: [plt-scheme] The Philosophy of DrScheme In-Reply-To: <4D270698-6B53-42AA-9D07-DB4F06EF1F32@optusnet.com.au> References: <756daca50811211340o2b50303ck6bec191de87338fd@mail.gmail.com> <756daca50811211340o2b50303ck6bec191de87338fd-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> <49274148.4090700@uwaterloo.ca> <2tvmi4pbovk1kn1vlf5pm93qsn2ibsb8um@4ax.com> <261ni4t0ai4dg3kbjf9a03u0minn8ca1m1@4ax.com> <184222e50811261837u46cf38f9u381a686e86e49164@mail.gmail.com> <184222e50811270552h4202af02h7c879915e3d08778@mail.gmail.com> <5f07325f0812011026n33be8dd7q569a75c50dfe52cc@mail.gmail.com> <4D270698-6B53-42AA-9D07-DB4F06EF1F32@optusnet.com.au> Message-ID: <184222e50812020804w59bc52caje5103641a8475793@mail.gmail.com> Hey, looks like a cool book, thanks for sharing it. On Tue, Dec 2, 2008 at 7:27 AM, Daniel Prager wrote: > > On 02/12/2008, at 5:26 AM, Greg Woodhouse wrote: > >> A minor nit: There is no reason why mathematics cannot be taught as an >> active process of discovery. The problem (well, one problem) is that the >> only way to really learn mathematics is by doing, and that means >> calculating. Still, there is no reason it can't be interesting. I'll give >> you an example: one thing that always intrigued me, even as a child, is that >> there are only 5 regular polyhedra (the tetrahedron, octahedron, cube, >> dodecahedron and icosohedron), but I didn't realize until much later how >> accessible a result it really is. You could almost make it a homework >> exercise! Start with Euler's famous formula V - E + F = 2 (for a topological >> sphere) and then suppose you have refgular polyhedron the faces of which are >> n-gons. It all comes down to counting: If there are m of them, how many >> times will you count each vertex in m times n vertices per face? How many >> times will you count each edge? What happens if you plug these numbers in >> Euler's formula? Even if youer students take euler's formula on faith, the >> result is still impressive. >> > > An aside: > > Greg's example of Euler's formula is used to good effect in a wonderful book > by Lakatos, "Proofs and Refutations", that reads almost like a play about > what an idealised mathematical classroom might look like. [If you "look > inside" on Amazon, you can read the first few pages, which gives the flavor > of the book.] > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Eduardo Bellani www.cnxs.com.br "What is hateful to you, do not to your fellow men. That is the entire Law; all the rest is commentary." The Talmud From d.j.gurnell at gmail.com Tue Dec 2 11:09:52 2008 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Thu Mar 26 02:34:57 2009 Subject: [plt-scheme] Missing some libraries, trying to use LeftParen In-Reply-To: References: <8d775dae-3bcf-4756-a2fa-0120e309183d@g38g2000yqn.googlegroups.com> Message-ID: <945258B0-624B-4EAA-8279-B567AE810401@gmail.com> There are also problems with the Untyped/Schematics web stuff, some of which is used in LeftParen. Unfortunately we've got customer demos Wed and Thu so I won't be able to update until Friday. I'll almost certainly get on it before the weekend though. Here's a short breakdown: - Dispatch doesn't work but the fix is trivial (require statement); - Mirrors is in a similar state; - Instaweb and Instaservlet are pretty much redundant at this point. I need to ask Jay about some stuff and then I'll retire them. Porting to serve/servlet or web-server/insta should be trivial... I'll post migration pointers to the list soon. - Delirium depends on Instaweb so it'll change a bit... not sure how much but probably not much. - Snooze is probably unaffected. Cheers, -- Dave > Sorry about that. I'll check out 4.1.3 and then push another > LeftParen update ASAP. > > Thanks, > Rob > >> It looks like LeftParen is incompatible with some of the >> reorganization that went on before 4.1.3 came out. I would suggest >> using 4.1.2 until LeftParen is updated. >> >> Jay >> >>> I installed plt scheme 4.1.3 today and I tried to follow this >>> tutorial: >>> http://planet.plt-scheme.org/package-source/vegashacker/leftparen.plt/2/2/planet-docs/leftparen/index.html >>> >>> but when I tried to do: >>> mzscheme -e '(require (planet "bootstrap.scm" ("vegashacker" >>> "leftparen.plt" 2 2)))' project hello-world >>> I got this error: >>> default-load-handler: cannot open input file: "/home/gerard/plt/ >>> collects/web-server/private/response-structs.ss" (No such file or >>> directory; errno=2) >>> >>> I did a locate for "response-struct.ss" and found it in: /home/ >>> gerard/ >>> plt/collects/web-server/http >>> >>> so of course I take the first special-class thing that comes to mind >>> and I: >>> cp http/* private/* >>> >>> then left-paren installed without errors... but when I follow the >>> next >>> bit and try to start up the server: >>> default-load-handler: cannot open input file: "/home/gerard/plt/ >>> collects/web-server/dispatchers/dispatch-lang.ss" (No such file or >>> directory; errno=2) >>> >>> Please, if someone could tell me what's going on and help me get >>> this >>> going it would be great. >>> _________________________________________________ >>> 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 >> _________________________________________________ >> 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 gregory.woodhouse at gmail.com Tue Dec 2 11:40:06 2008 From: gregory.woodhouse at gmail.com (Greg Woodhouse) Date: Thu Mar 26 02:34:58 2009 Subject: [plt-scheme] The Philosophy of DrScheme In-Reply-To: <4D270698-6B53-42AA-9D07-DB4F06EF1F32@optusnet.com.au> References: <756daca50811211340o2b50303ck6bec191de87338fd@mail.gmail.com> <756daca50811211340o2b50303ck6bec191de87338fd-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> <49274148.4090700@uwaterloo.ca> <2tvmi4pbovk1kn1vlf5pm93qsn2ibsb8um@4ax.com> <261ni4t0ai4dg3kbjf9a03u0minn8ca1m1@4ax.com> <184222e50811261837u46cf38f9u381a686e86e49164@mail.gmail.com> <184222e50811270552h4202af02h7c879915e3d08778@mail.gmail.com> <5f07325f0812011026n33be8dd7q569a75c50dfe52cc@mail.gmail.com> <4D270698-6B53-42AA-9D07-DB4F06EF1F32@optusnet.com.au> Message-ID: <5f07325f0812020840v4f320442w4de6734e53c9f19d@mail.gmail.com> I actually didn't know that. I remember "Proffs and Refutations" being optional reading for a course I took in mathematical logic, but (contrary to my usual practice) I never got around to reading it. Sounds interesting. On Tue, Dec 2, 2008 at 1:27 AM, Daniel Prager wrote: > > On 02/12/2008, at 5:26 AM, Greg Woodhouse wrote: > > A minor nit: There is no reason why mathematics cannot be taught as an >> active process of discovery. The problem (well, one problem) is that the >> only way to really learn mathematics is by doing, and that means >> calculating. Still, there is no reason it can't be interesting. I'll give >> you an example: one thing that always intrigued me, even as a child, is that >> there are only 5 regular polyhedra (the tetrahedron, octahedron, cube, >> dodecahedron and icosohedron), but I didn't realize until much later how >> accessible a result it really is. You could almost make it a homework >> exercise! Start with Euler's famous formula V - E + F = 2 (for a topological >> sphere) and then suppose you have refgular polyhedron the faces of which are >> n-gons. It all comes down to counting: If there are m of them, how many >> times will you count each vertex in m times n vertices per face? How many >> times will you count each edge? What happens if you plug these numbers in >> Euler's formula? Even if youer students take euler's formula on faith, the >> result is still impressive. >> >> > An aside: > > Greg's example of Euler's formula is used to good effect in a wonderful > book by Lakatos, "Proofs and Refutations", that reads almost like a play > about what an idealised mathematical classroom might look like. [If you > "look inside" on Amazon, you can read the first few pages, which gives the > flavor of the book.] > > _________________________________________________ > 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/20081202/196209a5/attachment.html From geb_a at yahoo.com Tue Dec 2 11:55:01 2008 From: geb_a at yahoo.com (geb a) Date: Thu Mar 26 02:34:58 2009 Subject: [plt-scheme] seasoned schemer In-Reply-To: <20081130232053.5BECF402F7@qua.cs.brown.edu> Message-ID: <104374.52609.qm@web50910.mail.re2.yahoo.com> In the seasoned schemer is '() considered an atom? Thanks for the help. Dan From matthias at ccs.neu.edu Tue Dec 2 12:03:07 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:34:59 2009 Subject: [plt-scheme] seasoned schemer In-Reply-To: <104374.52609.qm@web50910.mail.re2.yahoo.com> References: <104374.52609.qm@web50910.mail.re2.yahoo.com> Message-ID: <34FE9EE4-BA86-4864-9322-D525AEA90C74@ccs.neu.edu> Yes. On Dec 2, 2008, at 11:55 AM, geb a wrote: > In the seasoned schemer is '() considered an atom? > > Thanks for the help. > > Dan > > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From gregory.woodhouse at gmail.com Tue Dec 2 12:43:02 2008 From: gregory.woodhouse at gmail.com (Greg Woodhouse) Date: Thu Mar 26 02:34:59 2009 Subject: [plt-scheme] In-line LaTeX in REPL Message-ID: <5f07325f0812020943r3c38334ap745bc6dde316fd85@mail.gmail.com> Is it possibl,e to display in-line LaTeX in the DrScheme REPL? If that is not feasible, what about using LaTeX for text in, say, a label in a GUI application? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081202/7366ad9b/attachment.htm From noelwelsh at gmail.com Tue Dec 2 13:19:25 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:34:59 2009 Subject: [plt-scheme] Setup and teardown in SchemeUnit In-Reply-To: <5e8b0f6b0812011324g361321b8g8f717fb4ffd3299b@mail.gmail.com> References: <5e8b0f6b0811301405n55f1ba9pc5e2a4e71979e738@mail.gmail.com> <5e8b0f6b0811301447v49ee5195m54222f9760124d72@mail.gmail.com> <5e8b0f6b0811301517m44a1be04mff1ce402832d50b1@mail.gmail.com> <5e8b0f6b0812011324g361321b8g8f717fb4ffd3299b@mail.gmail.com> Message-ID: On Mon, Dec 1, 2008 at 9:24 PM, Micha? Kwiatkowski wrote: >> Adding setup/teardown arguments to test-begin/test-case is something >> that might be worth doing. In my experience I don't need this often >> enough to justify it. > > What about adding adding setup/teardown arguments to test-suite, as > shown in an example above? Is there a chance it would be included in > the next release of SchemeUnit if I implemented this myself? After some thought I don't think this is the right match to the existing SchemeUnit model. Probably some kind of parameter (like the current "contexts" in SchemeUnit) is the way to go. I'm busy till Friday so sorry for the terse response. If you implemented it (it = something I think matches the model), yes, I'd add it. N. From marek at xivilization.net Tue Dec 2 13:20:15 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:35:00 2009 Subject: [plt-scheme] Foreign not working on Solaris 10 Message-ID: <20081202192015.7df5db07@halmanfloyd.lan.local> Hi, I tried building PLT Scheme 4.1.3 on our Solaris 10 system (the installer failed, complaining abou ``test``) and it didn't work out of the box. ./configure worked fine once I removed gcc 4 from my $PATH (it was complaining that g++ 4 was unable to create binaries, which in fact, didn't work). But when I called ``make`` it ran for some time and finally aborted with some compiler errors. So I re-ran it with ``--disable-foreign`` and it built without further problems. This is not a big problem for me, just wanted you to know that either FFI does not work properly or the FFI detection in configure is broken on the Solaris 10 I tested it on. If you are interested I can re-run the build and post the errors. regards, Marek P.S.: The problem with ``test`` might be because I have a strange mix of original Solaris tools + some GNU tools and that could create problems. From marek at xivilization.net Tue Dec 2 15:05:24 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:35:00 2009 Subject: [plt-scheme] Foreign not working on Solaris 10 In-Reply-To: <20081202192015.7df5db07@halmanfloyd.lan.local> References: <20081202192015.7df5db07@halmanfloyd.lan.local> Message-ID: <20081202210524.685b9882@halmanfloyd.lan.local> On Tue, 2 Dec 2008 19:20:15 +0100 Marek Kubica wrote: > But when I called ``make`` it ran for some time and finally aborted > with some compiler errors. So I re-ran it with ``--disable-foreign`` > and it built without further problems. It built correnctly but ``make install`` aborted at the end. I don't think this is critical, but it shouldn't fail if it was configured with --disable-foreign: setup-plt: error: during making for ffi (Sample FFIs) setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during making for games setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during making for games/checkers setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during making for games/doors setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during making for games/gl-board-game setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during making for games/gobblet setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during making for games/jewel setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during making for htdp (HtDP Teachpacks) setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during making for mzlib setup-plt: foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during making for mzlib/scribblings setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during making for net setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during making for net/scribblings setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during making for openssl setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during making for plot setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during making for readline setup-plt: mzrl.ss:3:32: only-in: identifier `ffi-obj' not included in nested require spec at: (quote #%foreign) in: (only-in (quote #%foreign) ffi-obj) setup-plt: error: during making for scheme setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during making for scribblings/foreign setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during making for sgl setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during making for sgl/scribblings setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during making for srfi setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during making for srfi/63 setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during making for srfi/74 setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during making for teachpack/htdp setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during making for web-server setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during making for web-server/insta setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during making for web-server/private setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during Building docs for /u/halle/kubica/home_sun/plt/lib/plt/collects/scribblings/foreign/foreign.scrbl setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during Building docs for /u/halle/kubica/home_sun/plt/lib/plt/collects/games/gl-board-game/gl-board-game.scrbl setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during Building docs for /u/halle/kubica/home_sun/plt/lib/plt/collects/openssl/openssl.scrbl setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during Building docs for /u/halle/kubica/home_sun/plt/lib/plt/collects/plot/plot.scrbl setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during Building docs for /u/halle/kubica/home_sun/plt/lib/plt/collects/readline/readline.scrbl setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during Building docs for /u/halle/kubica/home_sun/plt/lib/plt/collects/net/scribblings/net.scrbl setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during Building docs for /u/halle/kubica/home_sun/plt/lib/plt/collects/sgl/scribblings/sgl.scrbl setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during Building docs for /u/halle/kubica/home_sun/plt/lib/plt/collects/web-server/scribblings/web-server.scrbl setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 setup-plt: error: during Building docs for /u/halle/kubica/home_sun/plt/lib/plt/collects/web-server/scribblings/tutorial/continue.scrbl setup-plt: /u/halle/kubica/home_sun/plt/lib/plt/collects/mzlib/foreign.ss:79:17: compile: unbound identifier in module in: _int8 *** Error code 1 make: Fatal error: Command failed for target `install-3m' Current working directory /u/halle/kubica/home_sun/plt/plt-4.1.3/src *** Error code 1 make: Fatal error: Command failed for target `install' regards, Marek From marek at xivilization.net Tue Dec 2 15:07:10 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:35:00 2009 Subject: [plt-scheme] Foreign not working on Solaris 10 In-Reply-To: <20081202210524.685b9882@halmanfloyd.lan.local> References: <20081202192015.7df5db07@halmanfloyd.lan.local> <20081202210524.685b9882@halmanfloyd.lan.local> Message-ID: <20081202210710.0987dc58@halmanfloyd.lan.local> On Tue, 2 Dec 2008 21:05:24 +0100 Marek Kubica wrote: > It built correnctly but ``make install`` aborted at the end. I don't > think this is critical, but it shouldn't fail if it was configured > with --disable-foreign Ok, it is somehow critical, because it doesn't create all neccessary stuff to run it. regards, Marek From m.douglas.williams at gmail.com Tue Dec 2 15:23:11 2008 From: m.douglas.williams at gmail.com (Doug Williams) Date: Thu Mar 26 02:35:01 2009 Subject: [plt-scheme] In-line LaTeX in REPL In-Reply-To: <5f07325f0812020943r3c38334ap745bc6dde316fd85@mail.gmail.com> References: <5f07325f0812020943r3c38334ap745bc6dde316fd85@mail.gmail.com> Message-ID: It would be good to have no only for this but as something like @equation{...} in Scribble to extend the current @math{...}. For example, in the science collection documentation I used off-line tools to create gif or png files with the equations and then use the files as images. I did a quick search and found Roger's Online Equation Editor ( http://rogercortesi.com/eqn/index.php) would do it for you. Not sure that is what you're looking for though. On Tue, Dec 2, 2008 at 10:43 AM, Greg Woodhouse wrote: > Is it possibl,e to display in-line LaTeX in the DrScheme REPL? If that is > not feasible, what about using LaTeX for text in, say, a label in a GUI > application? > _________________________________________________ > 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/20081202/51a23d32/attachment.html From mark.engelberg at gmail.com Tue Dec 2 16:06:02 2008 From: mark.engelberg at gmail.com (Mark Engelberg) Date: Thu Mar 26 02:35:01 2009 Subject: [plt-scheme] In-line LaTeX in REPL In-Reply-To: <5f07325f0812020943r3c38334ap745bc6dde316fd85@mail.gmail.com> References: <5f07325f0812020943r3c38334ap745bc6dde316fd85@mail.gmail.com> Message-ID: I recently needed to do something like this. First, I noticed that there is a website that will generate a latex gif from a URL with latex appended to the end. For example, http://www.codecogs.com/eq.latex?1+sin(x) gives you a gif of 1+sin(x). See http://www.codecogs.com/components/equationeditor/equation_install.php for details. So I shelled out to a program (curl) to download the gif by URL to a temp directory, and then in Scheme converted it to an image snip, so it would appear in the REPL. I would like a better way, but this worked for me. --Mark On Tue, Dec 2, 2008 at 9:43 AM, Greg Woodhouse wrote: > Is it possibl,e to display in-line LaTeX in the DrScheme REPL? If that is > not feasible, what about using LaTeX for text in, say, a label in a GUI > application? > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From mark.engelberg at gmail.com Tue Dec 2 16:32:07 2008 From: mark.engelberg at gmail.com (Mark Engelberg) Date: Thu Mar 26 02:35:01 2009 Subject: [plt-scheme] In-line LaTeX in REPL In-Reply-To: References: <5f07325f0812020943r3c38334ap745bc6dde316fd85@mail.gmail.com> Message-ID: BTW, my code looks like this: #lang scheme (require scheme/system) (require scheme/gui/base) (define (latex str) (let ([escaped-str (regexp-replace* #rx" " str "%20")]) (system (format "C:\\temp\\curl \"http://www.codecogs.com/eq.latex?~a\" -o C:\\temp\\latex.gif" escaped-str)) (make-object image-snip% "c:\\temp\\latex.gif"))) I keep the curl executable in my temp directory. So you can do something like (latex "3 \\geq 2") and it will produce the latex output for that. While it's downloading the latex gif, the repl displays a read input box. I'm not sure how to suppress that. From acowley at seas.upenn.edu Tue Dec 2 18:21:41 2008 From: acowley at seas.upenn.edu (Anthony Cowley) Date: Thu Mar 26 02:35:01 2009 Subject: [plt-scheme] In-line LaTeX in REPL In-Reply-To: References: <5f07325f0812020943r3c38334ap745bc6dde316fd85@mail.gmail.com> Message-ID: <81addec70812021521l38f50eefq29bba68c0f7e5edf@mail.gmail.com> Here's a version of Mark's code that does the processing locally. It needs some attention regarding the system calls depending on your setup, as it calls pdflatex and convert (ImageMagick) as well as creates a couple temporary files. ;;; Create an image snip object from a latex equation. ;;; Technique from http://dererumnatura.us/archives/2008/02/rendering-equat-1.html #lang scheme (require scheme/system) (require scheme/gui/base) (define latex (let ((template-head (string-join '("\\documentclass{article}" "\\usepackage{amsmath}" "\\pagestyle{empty}" "\\begin{document}" "\\Huge" "\\[") "~n")) (template-foot (string-join '("\\]" "\\end{document}") "~n"))) (lambda (str) (call-with-output-file "/tmp/latex.tex" (lambda (f) (fprintf f (string-join (list template-head str template-foot) "~n"))) #:mode 'text #:exists 'replace) (system "PATH=/sw/bin:$PATH pdflatex -output-directory /tmp latex.tex > /dev/null") (system "PATH=/sw/bin:$PATH convert /tmp/latex.pdf -trim +repage /tmp/latex.png") (make-object image-snip% "/tmp/latex.png")))) ;; Example ; (latex "\\sum_{i=0}^{\\infty}\\lambda_i") Anthony On Tue, Dec 2, 2008 at 4:32 PM, Mark Engelberg wrote: > BTW, my code looks like this: > #lang scheme > (require scheme/system) > (require scheme/gui/base) > (define (latex str) > (let ([escaped-str (regexp-replace* #rx" " str "%20")]) > (system (format "C:\\temp\\curl > \"http://www.codecogs.com/eq.latex?~a\" -o C:\\temp\\latex.gif" > escaped-str)) > (make-object image-snip% "c:\\temp\\latex.gif"))) > > I keep the curl executable in my temp directory. > > So you can do something like (latex "3 \\geq 2") and it will produce > the latex output for that. > > While it's downloading the latex gif, the repl displays a read input > box. I'm not sure how to suppress that. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From gregory.woodhouse at gmail.com Tue Dec 2 18:34:03 2008 From: gregory.woodhouse at gmail.com (Greg Woodhouse) Date: Thu Mar 26 02:35:02 2009 Subject: [plt-scheme] Named let example from The Guide (sec. 4.6) Message-ID: <5f07325f0812021534k2837610ep3b1ed1244b023c07@mail.gmail.com> The Guide contains th following example illustrating the use of named let: (define (duplicate pos lst) (let dup ([i 0] [lst lst]) (cond [(= i pos) (cons (car lst) lst)] [else (cons (car lst) (dup (+ i 1) (cdr lst)))]))) > (duplicate 1 (list "apple" "cheese burger!" "banana")) ("apple" "cheese burger!" "cheese burger!" "banana") I can see that i is initially bound to 0, but [lst lst] looks odd. The equivalent letrec (letrec ([proc-id (lambda (arg-id ...) body ...+)]) (proc-id init-expr ...)) helps, because it shows that lst needs to appear (with some binding) to be an argument to th elambda expression bound to dup. At least that's my reading. I don't use named let much (which is why I was looking it up), and so this may not be a good example, but since this is The Guide, I wonder if providing an example along the lines of (define (factorial n) (let fact ([i 0] [result 1]) (if (= i n) result (fact (+ i 1) (* (+ i 1) result))))) first might make it seem a bit less mysterious. (Wow, that was all one sentence!) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081202/76eb3c0e/attachment.htm From gregory.woodhouse at gmail.com Tue Dec 2 18:43:32 2008 From: gregory.woodhouse at gmail.com (Greg Woodhouse) Date: Thu Mar 26 02:35:03 2009 Subject: [plt-scheme] In-line LaTeX in REPL In-Reply-To: <81addec70812021521l38f50eefq29bba68c0f7e5edf@mail.gmail.com> References: <5f07325f0812020943r3c38334ap745bc6dde316fd85@mail.gmail.com> <81addec70812021521l38f50eefq29bba68c0f7e5edf@mail.gmail.com> Message-ID: <5f07325f0812021543y1c786f54mda33948f2d0d41aa@mail.gmail.com> I like it. To be honest, I use TeXShop and don't generally deal with command-line utilities, but that's okay. There is a manual. :) Right now, I'm working on a matrix algebra module, and I'd like to be able to work with rings of polynomials, exponential polynomials and so forth, but it would be nice to display the output to the the user in some comprehensible format. For now, I'm thinking about just displaying unprocessed LaTeX and worrying about typesetting later. On Tue, Dec 2, 2008 at 3:21 PM, Anthony Cowley wrote: > Here's a version of Mark's code that does the processing locally. It > needs some attention regarding the system calls depending on your > setup, as it calls pdflatex and convert (ImageMagick) as well as > creates a couple temporary files. > > ;;; Create an image snip object from a latex equation. > ;;; Technique from > http://dererumnatura.us/archives/2008/02/rendering-equat-1.html > #lang scheme > (require scheme/system) > (require scheme/gui/base) > (define latex > (let ((template-head (string-join '("\\documentclass{article}" > "\\usepackage{amsmath}" > "\\pagestyle{empty}" > "\\begin{document}" > "\\Huge" > "\\[") > "~n")) > (template-foot (string-join '("\\]" > "\\end{document}") > "~n"))) > (lambda (str) > (call-with-output-file "/tmp/latex.tex" > (lambda (f) (fprintf f (string-join (list template-head str > template-foot) "~n"))) > #:mode 'text > #:exists 'replace) > (system "PATH=/sw/bin:$PATH pdflatex -output-directory /tmp > latex.tex > /dev/null") > (system "PATH=/sw/bin:$PATH convert /tmp/latex.pdf -trim +repage > /tmp/latex.png") > (make-object image-snip% "/tmp/latex.png")))) > > ;; Example > ; (latex "\\sum_{i=0}^{\\infty}\\lambda_i") > > Anthony > > On Tue, Dec 2, 2008 at 4:32 PM, Mark Engelberg > wrote: > > BTW, my code looks like this: > > #lang scheme > > (require scheme/system) > > (require scheme/gui/base) > > (define (latex str) > > (let ([escaped-str (regexp-replace* #rx" " str "%20")]) > > (system (format "C:\\temp\\curl > > \"http://www.codecogs.com/eq.latex?~a\" -o C:\\temp\\latex.gif" > > escaped-str)) > > (make-object image-snip% "c:\\temp\\latex.gif"))) > > > > I keep the curl executable in my temp directory. > > > > So you can do something like (latex "3 \\geq 2") and it will produce > > the latex output for that. > > > > While it's downloading the latex gif, the repl displays a read input > > box. I'm not sure how to suppress that. > > _________________________________________________ > > 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/20081202/9c6f1686/attachment.html From dvanhorn at ccs.neu.edu Tue Dec 2 18:50:50 2008 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Thu Mar 26 02:35:03 2009 Subject: [plt-scheme] In-line LaTeX in REPL In-Reply-To: <5f07325f0812021543y1c786f54mda33948f2d0d41aa@mail.gmail.com> References: <5f07325f0812020943r3c38334ap745bc6dde316fd85@mail.gmail.com> <81addec70812021521l38f50eefq29bba68c0f7e5edf@mail.gmail.com> <5f07325f0812021543y1c786f54mda33948f2d0d41aa@mail.gmail.com> Message-ID: <4935C9DA.4020105@ccs.neu.edu> Greg Woodhouse wrote: > I like it. To be honest, I use TeXShop and don't generally deal with > command-line utilities, but that's okay. There is a manual. :) > > Right now, I'm working on a matrix algebra module, and I'd like to be > able to work with rings of polynomials, exponential polynomials and so > forth, but it would be nice to display the output to the the user in > some comprehensible format. For now, I'm thinking about just displaying > unprocessed LaTeX and worrying about typesetting later. For this sort of thing, I'd prefer to be able to copy and paste back into the definitions or interactions window (ie. constructor style output). Then add a whatever->latex function that would render whatever as a string that could be fed into latex. If later you wanted to add whatever->image, you could do that to. David From mark.engelberg at gmail.com Tue Dec 2 18:57:23 2008 From: mark.engelberg at gmail.com (Mark Engelberg) Date: Thu Mar 26 02:35:03 2009 Subject: [plt-scheme] In-line LaTeX in REPL In-Reply-To: <81addec70812021521l38f50eefq29bba68c0f7e5edf@mail.gmail.com> References: <5f07325f0812020943r3c38334ap745bc6dde316fd85@mail.gmail.com> <81addec70812021521l38f50eefq29bba68c0f7e5edf@mail.gmail.com> Message-ID: Anthony's variation works on my machine too (I already have latex and imagemagick installed and in the path). I like the trick of sending the output to /dev/null or NUL on windows. Any way to suppress the read input box that shows up during processing? From yinso.chen at gmail.com Tue Dec 2 20:07:48 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:35:04 2009 Subject: [plt-scheme] local planet mirror/repository? Message-ID: <779bf2730812021707k262b5e41t67ce0c546340500f@mail.gmail.com> Hi - is it possible to setup local planet mirror/repository? What would this require? Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081202/f9b132f1/attachment.htm From workmin at ccs.neu.edu Tue Dec 2 22:10:54 2008 From: workmin at ccs.neu.edu (Jon Rafkind) Date: Thu Mar 26 02:35:04 2009 Subject: [plt-scheme] Foreign not working on Solaris 10 In-Reply-To: <20081202210710.0987dc58@halmanfloyd.lan.local> References: <20081202192015.7df5db07@halmanfloyd.lan.local> <20081202210524.685b9882@halmanfloyd.lan.local> <20081202210710.0987dc58@halmanfloyd.lan.local> Message-ID: <4935F8BE.9040306@ccs.neu.edu> Marek Kubica wrote: > On Tue, 2 Dec 2008 21:05:24 +0100 > Marek Kubica wrote: > > >> It built correnctly but ``make install`` aborted at the end. I don't >> think this is critical, but it shouldn't fail if it was configured >> with --disable-foreign >> > > Ok, it is somehow critical, because it doesn't create all neccessary > stuff to run it. > > FWIW today's latest revision in svn built properly on opensolaris snv_89. I couldn't build mred, though, because opensolaris doesn't have libXaw (fixed in snv 101) but I didn't get any errors about the foreign stuff. I only installed gcc so I don't think I'm mixing solaris + gnu tools. From yinso.chen at gmail.com Wed Dec 3 00:57:44 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:35:04 2009 Subject: [plt-scheme] local planet mirror/repository? In-Reply-To: <932b2f1f0812021914t7017b524q7ef07db9144b50d7@mail.gmail.com> References: <779bf2730812021707k262b5e41t67ce0c546340500f@mail.gmail.com> <932b2f1f0812021914t7017b524q7ef07db9144b50d7@mail.gmail.com> Message-ID: <779bf2730812022157o1724558xf1bda1e1a7a34878@mail.gmail.com> On Tue, Dec 2, 2008 at 7:14 PM, Robby Findler wrote: > That's something that has long been on the todo list but that isn't there > yet. > > Could this be done via a modification of a variable (i.e. the host of planet site)? Is this variable exposed (via resource file or environment variable, etc)? Are my assumption of planet's architecture below correct? - each package is located according to an URI structure (i.e. author/package/version/ ...) - packages are downloaded via HTTP - a planet spec translates to a specific URI Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081202/512df48a/attachment.html From robby at cs.uchicago.edu Wed Dec 3 01:03:09 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:35:05 2009 Subject: [plt-scheme] local planet mirror/repository? In-Reply-To: <779bf2730812022157o1724558xf1bda1e1a7a34878@mail.gmail.com> References: <779bf2730812021707k262b5e41t67ce0c546340500f@mail.gmail.com> <932b2f1f0812021914t7017b524q7ef07db9144b50d7@mail.gmail.com> <779bf2730812022157o1724558xf1bda1e1a7a34878@mail.gmail.com> Message-ID: <932b2f1f0812022203v71edff23nebf488b7a93fe751@mail.gmail.com> If it isn't in the docs, then I don't think it is in the client implementation. But I'd have to go look at it myself to answer those questions and I suspect you'd be just as good as I would for that. Robby On Tue, Dec 2, 2008 at 11:57 PM, YC wrote: > > On Tue, Dec 2, 2008 at 7:14 PM, Robby Findler wrote: >> >> That's something that has long been on the todo list but that isn't there >> yet. >> > > Could this be done via a modification of a variable (i.e. the host of planet > site)? Is this variable exposed (via resource file or environment variable, > etc)? > > Are my assumption of planet's architecture below correct? > > each package is located according to an URI structure (i.e. > author/package/version/ ...) > packages are downloaded via HTTP > a planet spec translates to a specific URI > > Thanks, > yc > > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From yinso.chen at gmail.com Wed Dec 3 01:51:21 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:35:05 2009 Subject: [plt-scheme] local planet mirror/repository? In-Reply-To: <932b2f1f0812022203v71edff23nebf488b7a93fe751@mail.gmail.com> References: <779bf2730812021707k262b5e41t67ce0c546340500f@mail.gmail.com> <932b2f1f0812021914t7017b524q7ef07db9144b50d7@mail.gmail.com> <779bf2730812022157o1724558xf1bda1e1a7a34878@mail.gmail.com> <932b2f1f0812022203v71edff23nebf488b7a93fe751@mail.gmail.com> Message-ID: <779bf2730812022251g40103f6fu4eb3bd5a82cb218a@mail.gmail.com> On Tue, Dec 2, 2008 at 10:03 PM, Robby Findler wrote: > If it isn't in the docs, then I don't think it is in the client > implementation. But I'd have to go look at it myself to answer those > questions and I suspect you'd be just as good as I would for that. > Thanks for the pointer - based on http://docs.plt-scheme.org/planet/Utility_Libraries.html, it seems that planet can use either HTTP or a "custom" planet protocol. Also it seems that planet does read from a config.ss file, which can potentially facilitate reading from a local mirror site. The config.ss in my installation shows that by default plt uses the http protocol. The doc doesn't discuss how to setup a local mirror of planet.plt-scheme.org. Based on running planet url ..., it does seem that a servlet called planet-servlet.ss is required to access the packages correctly. Hence I would imagine that setting up a local mirror including having the planet-servlet.ss available. Are there additional requirements for setting up a mirror? Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081202/a117f0be/attachment.htm From sharkbrainguy at gmail.com Wed Dec 3 02:53:19 2008 From: sharkbrainguy at gmail.com (SweetwaterDixon) Date: Thu Mar 26 02:35:05 2009 Subject: [plt-scheme] Re: Missing some libraries, trying to use LeftParen In-Reply-To: <945258B0-624B-4EAA-8279-B567AE810401@gmail.com> References: <8d775dae-3bcf-4756-a2fa-0120e309183d@g38g2000yqn.googlegroups.com> <945258B0-624B-4EAA-8279-B567AE810401@gmail.com> Message-ID: <06ce21d9-8eb6-4f51-b3aa-331894f3dde8@v42g2000yqv.googlegroups.com> Hey, thanks alot guys. It installed without a problem on 4.1.2 ( The rest of this message is me pretending people care about my adventures in breaking things ) When I started up the example webapp, it complained that it couldn't find libcrypto.so even after I did "apt-get install libcrypto*" ( which may not have been the best idea ) but then locate found libcrypto.so.0.9.8, and I symlinked it to libcrypto.so and now everything is working fine as far as I can tell. I guess the naming is a quirk of ubuntu? Anyway, thanks for the quick/helpful/friendly responses. On Dec 3, 5:09?am, Dave Gurnell wrote: > There are also problems with the Untyped/Schematics web stuff, some of ? > which is used in LeftParen. > > Unfortunately we've got customer demos Wed and Thu so I won't be able ? > to update until Friday. I'll almost certainly get on it before the ? > weekend though. > > Here's a short breakdown: > > ? ?- Dispatch doesn't work but the fix is trivial (require statement); > > ? ?- Mirrors is in a similar state; > > ? ?- Instaweb and Instaservlet are pretty much redundant at this ? > point. I need to ask Jay about some stuff and then I'll retire them. ? > Porting to serve/servlet or web-server/insta should be trivial... I'll ? > post migration pointers to the list soon. > > ? ?- Delirium depends on Instaweb so it'll change a bit... not sure ? > how much but probably not much. > > ? ?- Snooze is probably unaffected. > > Cheers, > > -- Dave > > > > > Sorry about that. ?I'll check out 4.1.3 and then push another > > LeftParen update ASAP. > > > Thanks, > > Rob > > >> It looks like LeftParen is incompatible with some of the > >> reorganization that went on before 4.1.3 came out. I would suggest > >> using 4.1.2 until LeftParen is updated. > > >> Jay > > >>> I installed plt scheme 4.1.3 today and I tried to follow this > >>> tutorial: > >>>http://planet.plt-scheme.org/package-source/vegashacker/leftparen.plt... > > >>> but when I tried to do: > >>> mzscheme -e '(require (planet "bootstrap.scm" ("vegashacker" > >>> "leftparen.plt" 2 2)))' project hello-world > >>> I got this error: > >>> default-load-handler: cannot open input file: "/home/gerard/plt/ > >>> collects/web-server/private/response-structs.ss" (No such file or > >>> directory; errno=2) > > >>> I did a locate for "response-struct.ss" and found it in: /home/ > >>> gerard/ > >>> plt/collects/web-server/http > > >>> so of course I take the first special-class thing that comes to mind > >>> and I: > >>> cp http/* private/* > > >>> then left-paren installed without errors... but when I follow the ? > >>> next > >>> bit and try to start up the server: > >>> default-load-handler: cannot open input file: "/home/gerard/plt/ > >>> collects/web-server/dispatchers/dispatch-lang.ss" (No such file or > >>> directory; errno=2) > > >>> Please, if someone could tell me what's going on and help me get ? > >>> this > >>> going it would be great. > >>> _________________________________________________ > >>> 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 > >> _________________________________________________ > >> 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 robby at cs.uchicago.edu Wed Dec 3 08:41:51 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:35:05 2009 Subject: [plt-scheme] local planet mirror/repository? In-Reply-To: <779bf2730812022251g40103f6fu4eb3bd5a82cb218a@mail.gmail.com> References: <779bf2730812021707k262b5e41t67ce0c546340500f@mail.gmail.com> <932b2f1f0812021914t7017b524q7ef07db9144b50d7@mail.gmail.com> <779bf2730812022157o1724558xf1bda1e1a7a34878@mail.gmail.com> <932b2f1f0812022203v71edff23nebf488b7a93fe751@mail.gmail.com> <779bf2730812022251g40103f6fu4eb3bd5a82cb218a@mail.gmail.com> Message-ID: <932b2f1f0812030541l54ea56deo57ece1aded932664@mail.gmail.com> On Wed, Dec 3, 2008 at 12:51 AM, YC wrote: > Are there additional requirements for setting up a mirror? I'm not sure. Robby From geoff at knauth.org Wed Dec 3 09:55:19 2008 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Thu Mar 26 02:35:06 2009 Subject: [plt-scheme] Missing some libraries, trying to use LeftParen In-Reply-To: <945258B0-624B-4EAA-8279-B567AE810401@gmail.com> References: <8d775dae-3bcf-4756-a2fa-0120e309183d@g38g2000yqn.googlegroups.com> <945258B0-624B-4EAA-8279-B567AE810401@gmail.com> Message-ID: <8B50247B-28A9-4065-A11E-D59B3F97B199@knauth.org> On Dec 2, 2008, at 11:09, Dave Gurnell wrote: > Instaweb and Instaservlet are pretty much redundant at this point. I > need to ask Jay about some stuff and then I'll retire them. You might want to keep them around for people still using earlier PLT versions. Just put a note saying after version such-and-such you can find this functionality in PLT. Maybe also put in a PLT version check that tells users when they're using redundant functionality. From matthias at ccs.neu.edu Wed Dec 3 10:22:27 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:35:06 2009 Subject: [plt-scheme] In-line LaTeX in REPL In-Reply-To: <81addec70812021521l38f50eefq29bba68c0f7e5edf@mail.gmail.com> References: <5f07325f0812020943r3c38334ap745bc6dde316fd85@mail.gmail.com> <81addec70812021521l38f50eefq29bba68c0f7e5edf@mail.gmail.com> Message-ID: Nice. Here is a small improvement. #lang scheme ;;; Create an image snip object from a latex equation. ;;; Technique from http://dererumnatura.us/archives/2008/02/rendering- equat-1.html (require scheme/system) (require scheme/gui/base) (define TEMPLATE #< /dev/null") (system "PATH=/sw/bin:$PATH convert latex.pdf -trim +repage latex.png") (make-object image-snip% "latex.png")) (delete-directory/files latex))) ;; Example (latex #< Here's a version of Mark's code that does the processing locally. It > needs some attention regarding the system calls depending on your > setup, as it calls pdflatex and convert (ImageMagick) as well as > creates a couple temporary files. > > ;;; Create an image snip object from a latex equation. > ;;; Technique from > http://dererumnatura.us/archives/2008/02/rendering-equat-1.html > #lang scheme > (require scheme/system) > (require scheme/gui/base) > (define latex > (let ((template-head (string-join '("\\documentclass{article}" > "\\usepackage{amsmath}" > "\\pagestyle{empty}" > "\\begin{document}" > "\\Huge" > "\\[") > "~n")) > (template-foot (string-join '("\\]" > "\\end{document}") > "~n"))) > (lambda (str) > (call-with-output-file "/tmp/latex.tex" > (lambda (f) (fprintf f (string-join (list template-head str > template-foot) "~n"))) > #:mode 'text > #:exists 'replace) > (system "PATH=/sw/bin:$PATH pdflatex -output-directory /tmp > latex.tex > /dev/null") > (system "PATH=/sw/bin:$PATH convert /tmp/latex.pdf -trim +repage > /tmp/latex.png") > (make-object image-snip% "/tmp/latex.png")))) > > ;; Example > ; (latex "\\sum_{i=0}^{\\infty}\\lambda_i") > > Anthony > > On Tue, Dec 2, 2008 at 4:32 PM, Mark Engelberg > wrote: >> BTW, my code looks like this: >> #lang scheme >> (require scheme/system) >> (require scheme/gui/base) >> (define (latex str) >> (let ([escaped-str (regexp-replace* #rx" " str "%20")]) >> (system (format "C:\\temp\\curl >> \"http://www.codecogs.com/eq.latex?~a\" -o C:\\temp\\latex.gif" >> escaped-str)) >> (make-object image-snip% "c:\\temp\\latex.gif"))) >> >> I keep the curl executable in my temp directory. >> >> So you can do something like (latex "3 \\geq 2") and it will produce >> the latex output for that. >> >> While it's downloading the latex gif, the repl displays a read input >> box. I'm not sure how to suppress that. >> _________________________________________________ >> 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 vyzo at media.mit.edu Wed Dec 3 11:59:36 2008 From: vyzo at media.mit.edu (Dimitris Vyzovitis) Date: Thu Mar 26 02:35:06 2009 Subject: [plt-scheme] mzscheme x86-64 doesn't build Message-ID: Problems with linking unwind? gcc-4.1.2, GNU/Linux-amd64, svn 12687 $ make ... gcc -o .libs/mzschemecgc .libs/main.o -rdynamic ./.libs/libmzscheme.so ./.libs/libmzgc.so -ldl -lm -Wl,--rpath -Wl,/usr/local/plt/lib ./.libs/libmzscheme.so: undefined reference to `unw_get_ip' ./.libs/libmzscheme.so: undefined reference to `unw_get_frame_pointer' ./.libs/libmzscheme.so: undefined reference to `unw_reset_bad_ptr_flag' ./.libs/libmzscheme.so: undefined reference to `_ULx86_64_step' ./.libs/libmzscheme.so: undefined reference to `unw_manual_step' ./.libs/libmzscheme.so: undefined reference to `unw_set_safe_pointer_range' ./.libs/libmzscheme.so: undefined reference to `_ULx86_64_init_local' collect2: ld returned 1 exit status make[4]: *** [mzschemecgc] Error 1 make[4]: Leaving directory `/usr/local/src/plt-svn/plt/src/mzscheme' make[3]: *** [cgc] Error 2 make[3]: Leaving directory `/usr/local/src/plt-svn/plt/src/mzscheme' 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 -- vyzo From mflatt at cs.utah.edu Wed Dec 3 12:00:42 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:35:06 2009 Subject: [plt-scheme] mzscheme x86-64 doesn't build In-Reply-To: References: Message-ID: <20081203170043.52EF36500D7@mail-svr1.cs.utah.edu> You re-ran `configure', right? At Wed, 3 Dec 2008 11:59:36 -0500 (EST), Dimitris Vyzovitis wrote: > Problems with linking unwind? > gcc-4.1.2, GNU/Linux-amd64, svn 12687 > $ make > ... > gcc -o .libs/mzschemecgc .libs/main.o -rdynamic ./.libs/libmzscheme.so > ./.libs/libmzgc.so -ldl -lm -Wl,--rpath -Wl,/usr/local/plt/lib > ./.libs/libmzscheme.so: undefined reference to `unw_get_ip' > ./.libs/libmzscheme.so: undefined reference to `unw_get_frame_pointer' > ./.libs/libmzscheme.so: undefined reference to `unw_reset_bad_ptr_flag' > ./.libs/libmzscheme.so: undefined reference to `_ULx86_64_step' > ./.libs/libmzscheme.so: undefined reference to `unw_manual_step' > ./.libs/libmzscheme.so: undefined reference to > `unw_set_safe_pointer_range' > ./.libs/libmzscheme.so: undefined reference to `_ULx86_64_init_local' > collect2: ld returned 1 exit status > make[4]: *** [mzschemecgc] Error 1 > make[4]: Leaving directory `/usr/local/src/plt-svn/plt/src/mzscheme' > make[3]: *** [cgc] Error 2 > make[3]: Leaving directory `/usr/local/src/plt-svn/plt/src/mzscheme' > 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 > > -- vyzo > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From vyzo at media.mit.edu Wed Dec 3 12:10:59 2008 From: vyzo at media.mit.edu (Dimitris Vyzovitis) Date: Thu Mar 26 02:35:06 2009 Subject: [plt-scheme] mzscheme x86-64 doesn't build In-Reply-To: <20081203170043.52EF36500D7@mail-svr1.cs.utah.edu> References: <20081203170043.52EF36500D7@mail-svr1.cs.utah.edu> Message-ID: On Wed, 3 Dec 2008, Matthew Flatt wrote: > You re-ran `configure', right? Uhm no, just make clean. After rerunning configure, so far it has passed linking the cgc version so I guess that was it. Btw, is unwind enabled by default? -- vyzo From mflatt at cs.utah.edu Wed Dec 3 12:23:46 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:35:06 2009 Subject: [plt-scheme] mzscheme x86-64 doesn't build In-Reply-To: References: <20081203170043.52EF36500D7@mail-svr1.cs.utah.edu> Message-ID: <20081203172346.EEB8D6500C9@mail-svr1.cs.utah.edu> At Wed, 3 Dec 2008 12:10:59 -0500 (EST), Dimitris Vyzovitis wrote: > Btw, is unwind enabled by default? Yes, for x86_64 Linux. (There's no way to disable it, and no particular reason you'd want to, as far as I can tell.) Matthew From grettke at acm.org Wed Dec 3 13:39:20 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:35:07 2009 Subject: [plt-scheme] local planet mirror/repository? In-Reply-To: <932b2f1f0812030541l54ea56deo57ece1aded932664@mail.gmail.com> References: <779bf2730812021707k262b5e41t67ce0c546340500f@mail.gmail.com> <932b2f1f0812021914t7017b524q7ef07db9144b50d7@mail.gmail.com> <779bf2730812022157o1724558xf1bda1e1a7a34878@mail.gmail.com> <932b2f1f0812022203v71edff23nebf488b7a93fe751@mail.gmail.com> <779bf2730812022251g40103f6fu4eb3bd5a82cb218a@mail.gmail.com> <932b2f1f0812030541l54ea56deo57ece1aded932664@mail.gmail.com> Message-ID: <756daca50812031039s716f3b4al59d5fb6fe71c2119@mail.gmail.com> > On Wed, Dec 3, 2008 at 12:51 AM, YC wrote: > Are there additional requirements for setting up a mirror? How big are the contents of PLaneT? From neil at neilvandyke.org Wed Dec 3 14:25:43 2008 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:35:07 2009 Subject: [plt-scheme] raising and catching exceptions inside an exception handler Message-ID: <4936DD37.6090500@neilvandyke.org> We haven't observed any problems, so just checking before I do something stupid... In PLT 4.x exception handlers, are there any restrictions on new exceptions raised and caught while in the exception handler, as compared to when not inside the exception handler? I'm thinking C longjump quirks on some platforms/compilers/runtimes, debugging info buffers getting reused, otherwise non-reentrant code, etc. (I'd like to get more ambitious with how much application-specific information my custom default exception handler tries to fetch and report, but that can generate its own exceptions, which I'll want to catch and handle differently.) Thanks, Neil -- http://www.neilvandyke.org/ From mflatt at cs.utah.edu Wed Dec 3 15:02:33 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:35:07 2009 Subject: [plt-scheme] raising and catching exceptions inside an exception handler In-Reply-To: <4936DD37.6090500@neilvandyke.org> References: <4936DD37.6090500@neilvandyke.org> Message-ID: <20081203200234.8FAA76500C7@mail-svr1.cs.utah.edu> At Wed, 03 Dec 2008 14:25:43 -0500, Neil Van Dyke wrote: > In PLT 4.x exception handlers, are there any restrictions on new > exceptions raised and caught while in the exception handler, as compared > to when not inside the exception handler? > I'm thinking C longjump quirks on some platforms/compilers/runtimes, > debugging info buffers getting reused, otherwise non-reentrant code, etc. No, that should all be fine. The only difference is that breaks are initially disabled when a handler procedure is called (but you can re-enable breaks if it makes sense). Matthew From yinso.chen at gmail.com Wed Dec 3 15:24:45 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:35:08 2009 Subject: [plt-scheme] local planet mirror/repository? In-Reply-To: <932b2f1f0812030541l54ea56deo57ece1aded932664@mail.gmail.com> References: <779bf2730812021707k262b5e41t67ce0c546340500f@mail.gmail.com> <932b2f1f0812021914t7017b524q7ef07db9144b50d7@mail.gmail.com> <779bf2730812022157o1724558xf1bda1e1a7a34878@mail.gmail.com> <932b2f1f0812022203v71edff23nebf488b7a93fe751@mail.gmail.com> <779bf2730812022251g40103f6fu4eb3bd5a82cb218a@mail.gmail.com> <932b2f1f0812030541l54ea56deo57ece1aded932664@mail.gmail.com> Message-ID: <779bf2730812031224u586048dcx1d0019b7097b22a0@mail.gmail.com> On Wed, Dec 3, 2008 at 5:41 AM, Robby Findler wrote: > On Wed, Dec 3, 2008 at 12:51 AM, YC wrote: > > Are there additional requirements for setting up a mirror? > > I'm not sure. > Are planet-servlet.ss available for distribution then? Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081203/9a8938dd/attachment.html From kinch1967 at gmail.com Tue Dec 2 21:55:02 2008 From: kinch1967 at gmail.com (bullockbefriending bard) Date: Thu Mar 26 02:35:08 2009 Subject: [plt-scheme] Re: Named let example from The Guide (sec. 4.6) In-Reply-To: <5f07325f0812021534k2837610ep3b1ed1244b023c07@mail.gmail.com> References: <5f07325f0812021534k2837610ep3b1ed1244b023c07@mail.gmail.com> Message-ID: <1c5c68c1-828c-41ce-82e7-a664c2fe477d@t39g2000prh.googlegroups.com> On Dec 3, 6:34?am, "Greg Woodhouse" wrote: > The Guide contains th following example illustrating the use of named let: > > (define (duplicate pos lst) > ? ? (let dup ([i 0] > ? ? ? ? ? ? ? [lst lst]) > ? ? ?(cond > ? ? ? [(= i pos) (cons (car lst) lst)] > ? ? ? [else (cons (car lst) (dup (+ i 1) (cdr lst)))]))) > > ? > (duplicate 1 (list "apple" "cheese burger!" "banana")) > ? ("apple" "cheese burger!" "cheese burger!" "banana") > > I can see that i is initially bound to 0, but [lst lst] looks odd. The > equivalent letrec > > ? (letrec ([proc-id (lambda (arg-id ...) > ? ? ? ? ? ? ? ? ? ? ? ?body ...+)]) > ? ? (proc-id init-expr ...)) > > helps, because it shows that lst needs to appear (with some binding) to be > an argument to th elambda expression bound to dup. At least that's my > reading. > > I don't use named let much (which is why I was looking it up), and so this > may not be a good example, but since this is The Guide, I wonder if > providing an example along the lines of > > (define (factorial n) > ? ? (let fact ([i 0] [result 1]) > ? ? ? (if (= i n) > ? ? ? ? ? result > ? ? ? ? ? (fact (+ i 1) (* (+ i 1) result))))) > > first might make it seem a bit less mysterious. (Wow, that was all one > sentence!) > > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme I guess this is where 'standard idiom' and 'understanding what you are doing with a language' bump together. Presumably new users should be introduced to the concepts of bindings and shadowing very early on... long before they need to go looking up how to use a named let. However, there is a case to be made for some commentary in that section of the guide saying that with respect to what we assume you already know about binding in scheme, you will certainly understand why (let loop ([fred fred]) blah) works and is in fact a common idiom. That's my $0.02 worth as someone who has taken up Scheme only in the last 9 months. From portugyrocker at gmail.com Wed Dec 3 13:36:41 2008 From: portugyrocker at gmail.com (Dave) Date: Thu Mar 26 02:35:08 2009 Subject: [plt-scheme] music in scheme Message-ID: I was wondering what libraries are used in scheme to produce some form of sound. Im writing a c++ code that has embedded in it scheme in for which then plays sound, but im not sure on which libraries are used for such a program. Any suggestions??...thank you in advance From robby at cs.uchicago.edu Wed Dec 3 16:45:15 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:35:08 2009 Subject: [plt-scheme] local planet mirror/repository? In-Reply-To: <779bf2730812031224u586048dcx1d0019b7097b22a0@mail.gmail.com> References: <779bf2730812021707k262b5e41t67ce0c546340500f@mail.gmail.com> <932b2f1f0812021914t7017b524q7ef07db9144b50d7@mail.gmail.com> <779bf2730812022157o1724558xf1bda1e1a7a34878@mail.gmail.com> <932b2f1f0812022203v71edff23nebf488b7a93fe751@mail.gmail.com> <779bf2730812022251g40103f6fu4eb3bd5a82cb218a@mail.gmail.com> <932b2f1f0812030541l54ea56deo57ece1aded932664@mail.gmail.com> <779bf2730812031224u586048dcx1d0019b7097b22a0@mail.gmail.com> Message-ID: <932b2f1f0812031345p4f037abfwb10c3a9afc4267da@mail.gmail.com> On Wed, Dec 3, 2008 at 2:24 PM, YC wrote: > > On Wed, Dec 3, 2008 at 5:41 AM, Robby Findler wrote: >> >> On Wed, Dec 3, 2008 at 12:51 AM, YC wrote: >> > Are there additional requirements for setting up a mirror? >> >> I'm not sure. > > Are planet-servlet.ss available for distribution then? I don't understand the question, but I think the answer is "no". I have not set anything up so that you can download all of the packages and the contents of the database, if that's what you're asking. Robby From robby at cs.uchicago.edu Wed Dec 3 16:45:57 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:35:08 2009 Subject: [plt-scheme] local planet mirror/repository? In-Reply-To: <932b2f1f0812031345p4f037abfwb10c3a9afc4267da@mail.gmail.com> References: <779bf2730812021707k262b5e41t67ce0c546340500f@mail.gmail.com> <932b2f1f0812021914t7017b524q7ef07db9144b50d7@mail.gmail.com> <779bf2730812022157o1724558xf1bda1e1a7a34878@mail.gmail.com> <932b2f1f0812022203v71edff23nebf488b7a93fe751@mail.gmail.com> <779bf2730812022251g40103f6fu4eb3bd5a82cb218a@mail.gmail.com> <932b2f1f0812030541l54ea56deo57ece1aded932664@mail.gmail.com> <779bf2730812031224u586048dcx1d0019b7097b22a0@mail.gmail.com> <932b2f1f0812031345p4f037abfwb10c3a9afc4267da@mail.gmail.com> Message-ID: <932b2f1f0812031345k59207147q5be48277c03081ac@mail.gmail.com> Let me ask a question: are you running into stability problems that a mirror or local cache of some kind would solve? Robby From yinso.chen at gmail.com Wed Dec 3 17:25:17 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:35:09 2009 Subject: [plt-scheme] local planet mirror/repository? In-Reply-To: <932b2f1f0812031345k59207147q5be48277c03081ac@mail.gmail.com> References: <779bf2730812021707k262b5e41t67ce0c546340500f@mail.gmail.com> <932b2f1f0812021914t7017b524q7ef07db9144b50d7@mail.gmail.com> <779bf2730812022157o1724558xf1bda1e1a7a34878@mail.gmail.com> <932b2f1f0812022203v71edff23nebf488b7a93fe751@mail.gmail.com> <779bf2730812022251g40103f6fu4eb3bd5a82cb218a@mail.gmail.com> <932b2f1f0812030541l54ea56deo57ece1aded932664@mail.gmail.com> <779bf2730812031224u586048dcx1d0019b7097b22a0@mail.gmail.com> <932b2f1f0812031345p4f037abfwb10c3a9afc4267da@mail.gmail.com> <932b2f1f0812031345k59207147q5be48277c03081ac@mail.gmail.com> Message-ID: <779bf2730812031425w7b8a083fkb6045d7aa821f516@mail.gmail.com> On Wed, Dec 3, 2008 at 1:45 PM, Robby Findler wrote: > > Are planet-servlet.ss available for distribution then? > > I don't understand the question, but I think the answer is "no". I > have not set anything up so that you can download all of the packages > and the contents of the database, if that's what you're asking. > planet-servlet.ss appears to be the servlet that distributes the right packages when planet client connects. It's probably not hard to figure out what it does under the hood. On Wed, Dec 3, 2008 at 1:45 PM, Robby Findler wrote: > Let me ask a question: are you running into stability problems that a > mirror or local cache of some kind would solve? > Yes. I think I have some ideas on how this could work. I'll do some experiments on my end. Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081203/666c1cf7/attachment.htm From clements at brinckerhoff.org Wed Dec 3 17:46:55 2008 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:35:10 2009 Subject: [plt-scheme] Re: The Philosophy of DrScheme In-Reply-To: <184222e50811261837u46cf38f9u381a686e86e49164@mail.gmail.com> References: <756daca50811211340o2b50303ck6bec191de87338fd@mail.gmail.com> <756daca50811211340o2b50303ck6bec191de87338fd-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> <49274148.4090700@uwaterloo.ca> <2tvmi4pbovk1kn1vlf5pm93qsn2ibsb8um@4ax.com> <261ni4t0ai4dg3kbjf9a03u0minn8ca1m1@4ax.com> <184222e50811261837u46cf38f9u381a686e86e49164@mail.gmail.com> Message-ID: <417B2797-93F7-46CE-9A8C-129E050EE19D@brinckerhoff.org> On Nov 26, 2008, at 6:37 PM, Eduardo Bellani wrote: > One doubt that I'm having while immersing myself on the scheme world > through > htdp, (going at it alone some time after graduation, so I'm not > exactly the main target market :P ), > specially after reading The Structure and Interpretation of the > Computer Science Curriculum, is that I'm > seeing a lot of parallels with Seymour Papert's Logo (and consequently > Alan Kay's Squeak ST), which > would be of course parallels with contructionism itself. > Was that intentional? Or am I seeing things? (I swear I'm clean :D I suspect the connection is simply that all of these works include thinking about the language itself, by people with some mathematical insight, rather than simply taking an existing (assembly+sugar) one for granted. 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/20081203/054b1363/smime.bin From robby at cs.uchicago.edu Wed Dec 3 18:13:45 2008 From: robby at cs.uchicago.edu (robby@cs.uchicago.edu) Date: Thu Mar 26 02:35:10 2009 Subject: [plt-scheme] local planet mirror/repository? In-Reply-To: <779bf2730812031425w7b8a083fkb6045d7aa821f516@mail.gmail.com> References: <779bf2730812021707k262b5e41t67ce0c546340500f@mail.gmail.com> <932b2f1f0812021914t7017b524q7ef07db9144b50d7@mail.gmail.com> <779bf2730812022157o1724558xf1bda1e1a7a34878@mail.gmail.com> <932b2f1f0812022203v71edff23nebf488b7a93fe751@mail.gmail.com> <779bf2730812022251g40103f6fu4eb3bd5a82cb218a@mail.gmail.com> <932b2f1f0812030541l54ea56deo57ece1aded932664@mail.gmail.com> <779bf2730812031224u586048dcx1d0019b7097b22a0@mail.gmail.com> <932b2f1f0812031345p4f037abfwb10c3a9afc4267da@mail.gmail.com> <932b2f1f0812031345k59207147q5be48277c03081ac@mail.gmail.com> <779bf2730812031425w7b8a083fkb6045d7aa821f516@mail.gmail.com> Message-ID: <932b2f1f0812031513p611542c8ha1b37fde91e9bf12@mail.gmail.com> On 12/3/08, YC wrote: > On Wed, Dec 3, 2008 at 1:45 PM, Robby Findler wrote: > >> > Are planet-servlet.ss available for distribution then? >> >> I don't understand the question, but I think the answer is "no". I >> have not set anything up so that you can download all of the packages >> and the contents of the database, if that's what you're asking. >> > > planet-servlet.ss appears to be the servlet that distributes the right > packages when planet client connects. It's probably not hard to figure out > what it does under the hood. I am quite familiar with it. > On Wed, Dec 3, 2008 at 1:45 PM, Robby Findler wrote: > >> Let me ask a question: are you running into stability problems that a >> mirror or local cache of some kind would solve? >> > > Yes. I think I have some ideas on how this could work. I'll do some > experiments on my end. This discussion has, in my mind, been difficult because I don't know what you are after. As I said there is more to do with planet. Are you simply urging me to get to work? (which is fine, btw!) Robby > Thanks, > yc > From jpc-ml at zenburn.net Wed Dec 3 18:37:09 2008 From: jpc-ml at zenburn.net (=?UTF-8?B?SmFrdWIgUGlvdHIgQ8WCYXBh?=) Date: Thu Mar 26 02:35:10 2009 Subject: [plt-scheme] local planet mirror/repository? In-Reply-To: <779bf2730812021707k262b5e41t67ce0c546340500f@mail.gmail.com> References: <779bf2730812021707k262b5e41t67ce0c546340500f@mail.gmail.com> Message-ID: <49371825.7070409@zenburn.net> YC wrote: > is it possible to setup local planet mirror/repository? What would this > require? And what about using a HTTP caching proxy? -- regards, Jakub Piotr C?apa From jpc-ml at zenburn.net Wed Dec 3 18:43:24 2008 From: jpc-ml at zenburn.net (=?UTF-8?B?SmFrdWIgUGlvdHIgQ8WCYXBh?=) Date: Thu Mar 26 02:35:10 2009 Subject: [plt-scheme] music in scheme In-Reply-To: References: Message-ID: <4937199C.7030203@zenburn.net> Dave wrote: > I was wondering what libraries are used in scheme to produce some form > of sound. Im writing a c++ code that has embedded in it scheme in for > which then plays sound, but im not sure on which libraries are used > for such a program. Any suggestions??...thank you in advance I think that it should be easier to do from C/C++ than from Scheme. Maybe using PortAudio or some simple sound playing API (it depends on whether you need this cross-platform and such). PS. libsndfile is wrapped using the FFI (look in the collects/ffi/examples dir) but this only allows for reading and writing various (uncompressed) audio file formats. -- regards, Jakub Piotr C?apa From yinso.chen at gmail.com Wed Dec 3 18:47:36 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:35:11 2009 Subject: [plt-scheme] local planet mirror/repository? In-Reply-To: <932b2f1f0812031513p611542c8ha1b37fde91e9bf12@mail.gmail.com> References: <779bf2730812021707k262b5e41t67ce0c546340500f@mail.gmail.com> <779bf2730812022157o1724558xf1bda1e1a7a34878@mail.gmail.com> <932b2f1f0812022203v71edff23nebf488b7a93fe751@mail.gmail.com> <779bf2730812022251g40103f6fu4eb3bd5a82cb218a@mail.gmail.com> <932b2f1f0812030541l54ea56deo57ece1aded932664@mail.gmail.com> <779bf2730812031224u586048dcx1d0019b7097b22a0@mail.gmail.com> <932b2f1f0812031345p4f037abfwb10c3a9afc4267da@mail.gmail.com> <932b2f1f0812031345k59207147q5be48277c03081ac@mail.gmail.com> <779bf2730812031425w7b8a083fkb6045d7aa821f516@mail.gmail.com> <932b2f1f0812031513p611542c8ha1b37fde91e9bf12@mail.gmail.com> Message-ID: <779bf2730812031547u541fb884i3cdba3c21a423103@mail.gmail.com> On Wed, Dec 3, 2008 at 3:13 PM, wrote: > > > > planet-servlet.ss appears to be the servlet that distributes the right > > packages when planet client connects. It's probably not hard to figure > out > > what it does under the hood. > > I am quite familiar with it. > I don't mean to imply you not knowing it - I am asking whether the servlet is available for setting up our own mirrors - I apologize for not being clear. When I said "it's probably not hard to figure out..." I meant I can probably determine what it does without access to the source code (in case I need to hack something for my own mirror). > > > On Wed, Dec 3, 2008 at 1:45 PM, Robby Findler > wrote: > > > >> Let me ask a question: are you running into stability problems that a > >> mirror or local cache of some kind would solve? > >> > > > > Yes. I think I have some ideas on how this could work. I'll do some > > experiments on my end. > > This discussion has, in my mind, been difficult because I don't know > what you are after. As I said there is more to do with planet. Are you > simply urging me to get to work? (which is fine, btw!) > I am simply trying to figure out the easiest way to setup a local cache/mirror, withot a ton of work on your end or my end ;) I am experimenting to see if I can redirect the planet through a proxy servlet - if this is possible, then the work is probably minimal... Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081203/c37eb432/attachment.htm From yinso.chen at gmail.com Wed Dec 3 18:48:36 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:35:11 2009 Subject: [plt-scheme] local planet mirror/repository? In-Reply-To: <49371825.7070409@zenburn.net> References: <779bf2730812021707k262b5e41t67ce0c546340500f@mail.gmail.com> <49371825.7070409@zenburn.net> Message-ID: <779bf2730812031548wd4793bbne4f98d280d84edb7@mail.gmail.com> On Wed, Dec 3, 2008 at 3:37 PM, Jakub Piotr C?apa wrote: > YC wrote: > >> is it possible to setup local planet mirror/repository? What would this >> require? >> > > And what about using a HTTP caching proxy? > Yeah I am playing with an approach along this line of thinking... thanks! yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081203/1942bcf6/attachment.html From eli at barzilay.org Wed Dec 3 19:28:31 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:35:11 2009 Subject: [plt-scheme] In-line LaTeX in REPL In-Reply-To: References: <5f07325f0812020943r3c38334ap745bc6dde316fd85@mail.gmail.com> <81addec70812021521l38f50eefq29bba68c0f7e5edf@mail.gmail.com> Message-ID: <18743.9263.232873.628059@arabic.ccs.neu.edu> On Dec 3, Matthias Felleisen wrote: > > Nice. Here is a small improvement. Here is an even better version: * Uses the latex magic that deals with utf-8 * Redirects the input so drscheme doesn't show the input box * Throws an error if a process failed, and show the output if this happens * Uses scribble syntax ------------------------------------------------------------------------------- #reader scribble/reader #lang scheme (require scheme/system scheme/gui/base) (define str string-append) (define TEMPLATE @str{\documentclass{article} \usepackage[mathletters]{ucs} \usepackage[utf8x]{inputenc} \usepackage{amsmath} \pagestyle{empty} \begin{document} \Huge\[ ~a \] \end{document}}) (define COMMANDS @str{pdflatex x.tex convert -density 96x96 x.pdf -trim +repage x.png}) (define (latex . strs) (define latex (make-temporary-file "latex~a" 'directory)) (define (run) (parameterize ([current-directory latex] [current-input-port (open-input-bytes #"")] [current-output-port (open-output-string)]) (call-with-output-file* "x.tex" #:exists 'truncate (lambda (o) (fprintf o TEMPLATE (string-append* strs)))) (unless (system (regexp-replace #rx"\n+" COMMANDS " \\&\\& ")) (display (get-output-string (current-output-port)) (current-error-port)) (error 'latex "commands did not run successfully, see above output")) (make-object image-snip% "x.png"))) (define (cleanup) (delete-directory/files latex)) (dynamic-wind void run cleanup)) ;; Examples @latex{\sum_{i=0}^{\infty}\lambda_i} (let ([self @str{\lambda x . x x}]) @latex{(@self) (@self)}) ------------------------------------------------------------------------------- -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From ebellani at gmail.com Wed Dec 3 20:13:29 2008 From: ebellani at gmail.com (Eduardo Bellani) Date: Thu Mar 26 02:35:11 2009 Subject: [plt-scheme] Re: The Philosophy of DrScheme In-Reply-To: <417B2797-93F7-46CE-9A8C-129E050EE19D@brinckerhoff.org> References: <756daca50811211340o2b50303ck6bec191de87338fd@mail.gmail.com> <756daca50811211340o2b50303ck6bec191de87338fd-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> <49274148.4090700@uwaterloo.ca> <2tvmi4pbovk1kn1vlf5pm93qsn2ibsb8um@4ax.com> <261ni4t0ai4dg3kbjf9a03u0minn8ca1m1@4ax.com> <184222e50811261837u46cf38f9u381a686e86e49164@mail.gmail.com> <417B2797-93F7-46CE-9A8C-129E050EE19D@brinckerhoff.org> Message-ID: <184222e50812031713k6419dc83tfedf955b2a8037f2@mail.gmail.com> Perhaps, but perhaps the is some inspiration on there too. I think I got an indication on that on through this list, someone pasted a link to http://www.cs.indiana.edu/dfried_celebration.html where I downloaded Sussman's "The role of programming in the formulation of ideas" presentation, http://video.google.com/videoplay?docid=-2726904509434151616&hl=en If you watch 24:37 there is a cool dedication :) Hugs -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFJNy6LTGtma8x8sd4RAvTuAJ4keAXTaD6I+zosX97r7KaCofKwTACZASC1 fLtOnJTLf1MquMDVn4sMhqk= =w8I7 -----END PGP SIGNATURE----- On Wed, Dec 3, 2008 at 8:46 PM, John Clements wrote: > > On Nov 26, 2008, at 6:37 PM, Eduardo Bellani wrote: > >> One doubt that I'm having while immersing myself on the scheme world >> through >> htdp, (going at it alone some time after graduation, so I'm not >> exactly the main target market :P ), >> specially after reading The Structure and Interpretation of the >> Computer Science Curriculum, is that I'm >> seeing a lot of parallels with Seymour Papert's Logo (and consequently >> Alan Kay's Squeak ST), which >> would be of course parallels with contructionism itself. >> Was that intentional? Or am I seeing things? (I swear I'm clean :D > > I suspect the connection is simply that all of these works include thinking > about the language itself, by people with some mathematical insight, rather > than simply taking an existing (assembly+sugar) one for granted. > > John Clements > > > -- Eduardo Bellani www.cnxs.com.br "What is hateful to you, do not to your fellow men. That is the entire Law; all the rest is commentary." The Talmud From robby at cs.uchicago.edu Wed Dec 3 21:11:49 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:35:12 2009 Subject: [plt-scheme] local planet mirror/repository? In-Reply-To: <779bf2730812031547u541fb884i3cdba3c21a423103@mail.gmail.com> References: <779bf2730812021707k262b5e41t67ce0c546340500f@mail.gmail.com> <932b2f1f0812022203v71edff23nebf488b7a93fe751@mail.gmail.com> <779bf2730812022251g40103f6fu4eb3bd5a82cb218a@mail.gmail.com> <932b2f1f0812030541l54ea56deo57ece1aded932664@mail.gmail.com> <779bf2730812031224u586048dcx1d0019b7097b22a0@mail.gmail.com> <932b2f1f0812031345p4f037abfwb10c3a9afc4267da@mail.gmail.com> <932b2f1f0812031345k59207147q5be48277c03081ac@mail.gmail.com> <779bf2730812031425w7b8a083fkb6045d7aa821f516@mail.gmail.com> <932b2f1f0812031513p611542c8ha1b37fde91e9bf12@mail.gmail.com> <779bf2730812031547u541fb884i3cdba3c21a423103@mail.gmail.com> Message-ID: <932b2f1f0812031811s121fdd55kabface1d619857ed@mail.gmail.com> Oh, I see. Thanks for clarifying. The only problem I see is that the results that the planet server gives depend on the packages that have been uploaded, a naive cache won't work. But if you go stale at reasonable intervals, you'll probably be okay. If you know something about how to interpret the requests, you can do better. I'd be happy to send you the source code. Robby On Wed, Dec 3, 2008 at 5:47 PM, YC wrote: > > On Wed, Dec 3, 2008 at 3:13 PM, wrote: >> >> > planet-servlet.ss appears to be the servlet that distributes the right >> > packages when planet client connects. It's probably not hard to figure >> > out >> > what it does under the hood. >> >> I am quite familiar with it. > > I don't mean to imply you not knowing it - I am asking whether the servlet > is available for setting up our own mirrors - I apologize for not being > clear. When I said "it's probably not hard to figure out..." I meant I can > probably determine what it does without access to the source code (in case I > need to hack something for my own mirror). > >> >> > On Wed, Dec 3, 2008 at 1:45 PM, Robby Findler >> > wrote: >> > >> >> Let me ask a question: are you running into stability problems that a >> >> mirror or local cache of some kind would solve? >> >> >> > >> > Yes. I think I have some ideas on how this could work. I'll do some >> > experiments on my end. >> >> This discussion has, in my mind, been difficult because I don't know >> what you are after. As I said there is more to do with planet. Are you >> simply urging me to get to work? (which is fine, btw!) > > I am simply trying to figure out the easiest way to setup a local > cache/mirror, withot a ton of work on your end or my end ;) > > I am experimenting to see if I can redirect the planet through a proxy > servlet - if this is possible, then the work is probably minimal... > > Thanks, > yc > > > > > From vyzo at media.mit.edu Wed Dec 3 21:20:05 2008 From: vyzo at media.mit.edu (Dimitris Vyzovitis) Date: Thu Mar 26 02:35:12 2009 Subject: [plt-scheme] local planet mirror/repository? In-Reply-To: <932b2f1f0812031811s121fdd55kabface1d619857ed@mail.gmail.com> References: <779bf2730812021707k262b5e41t67ce0c546340500f@mail.gmail.com> <932b2f1f0812022203v71edff23nebf488b7a93fe751@mail.gmail.com> <779bf2730812022251g40103f6fu4eb3bd5a82cb218a@mail.gmail.com> <932b2f1f0812030541l54ea56deo57ece1aded932664@mail.gmail.com> <779bf2730812031224u586048dcx1d0019b7097b22a0@mail.gmail.com> <932b2f1f0812031345p4f037abfwb10c3a9afc4267da@mail.gmail.com> <932b2f1f0812031345k59207147q5be48277c03081ac@mail.gmail.com> <779bf2730812031425w7b8a083fkb6045d7aa821f516@mail.gmail.com> <932b2f1f0812031513p611542c8ha1b37fde91e9bf12@mail.gmail.com> <779bf2730812031547u541fb884i3cdba3c21a423103@mail.gmail.com> <932b2f1f0812031811s121fdd55kabface1d619857ed@mail.gmail.com> Message-ID: On Wed, 3 Dec 2008, Robby Findler wrote: > I'd be happy to send you the source code. > > Robby How about publishing the code repo, perhaps in the plt svn? This way people can send you patches instead of bugging you with feature requests :p -- vyzo From robby at cs.uchicago.edu Wed Dec 3 21:47:02 2008 From: robby at cs.uchicago.edu (robby@cs.uchicago.edu) Date: Thu Mar 26 02:35:12 2009 Subject: [plt-scheme] local planet mirror/repository? In-Reply-To: References: <779bf2730812021707k262b5e41t67ce0c546340500f@mail.gmail.com> <932b2f1f0812030541l54ea56deo57ece1aded932664@mail.gmail.com> <779bf2730812031224u586048dcx1d0019b7097b22a0@mail.gmail.com> <932b2f1f0812031345p4f037abfwb10c3a9afc4267da@mail.gmail.com> <932b2f1f0812031345k59207147q5be48277c03081ac@mail.gmail.com> <779bf2730812031425w7b8a083fkb6045d7aa821f516@mail.gmail.com> <932b2f1f0812031513p611542c8ha1b37fde91e9bf12@mail.gmail.com> <779bf2730812031547u541fb884i3cdba3c21a423103@mail.gmail.com> <932b2f1f0812031811s121fdd55kabface1d619857ed@mail.gmail.com> Message-ID: <932b2f1f0812031847i2d448ce9sfd8d6602cb5e0b71@mail.gmail.com> It is in iplt part of the tree. Perhaps it should be made public. I wouldn't object but I don't know how much trouble I'd be causing Eli. Robby On 12/3/08, Dimitris Vyzovitis wrote: > On Wed, 3 Dec 2008, Robby Findler wrote: > >> I'd be happy to send you the source code. >> >> Robby > > How about publishing the code repo, perhaps in the plt svn? > This way people can send you patches instead of bugging you with feature > requests :p > > -- vyzo > > From yinso.chen at gmail.com Wed Dec 3 22:58:52 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:35:13 2009 Subject: [plt-scheme] local planet mirror/repository? In-Reply-To: <932b2f1f0812031847i2d448ce9sfd8d6602cb5e0b71@mail.gmail.com> References: <779bf2730812021707k262b5e41t67ce0c546340500f@mail.gmail.com> <779bf2730812031224u586048dcx1d0019b7097b22a0@mail.gmail.com> <932b2f1f0812031345p4f037abfwb10c3a9afc4267da@mail.gmail.com> <932b2f1f0812031345k59207147q5be48277c03081ac@mail.gmail.com> <779bf2730812031425w7b8a083fkb6045d7aa821f516@mail.gmail.com> <932b2f1f0812031513p611542c8ha1b37fde91e9bf12@mail.gmail.com> <779bf2730812031547u541fb884i3cdba3c21a423103@mail.gmail.com> <932b2f1f0812031811s121fdd55kabface1d619857ed@mail.gmail.com> <932b2f1f0812031847i2d448ce9sfd8d6602cb5e0b71@mail.gmail.com> Message-ID: <779bf2730812031958r78c23620l52ec8b6663e533cf@mail.gmail.com> On Wed, Dec 3, 2008 at 6:11 PM, Robby Findler wrote: > Oh, I see. Thanks for clarifying. The only problem I see is that the > results that the planet server gives depend on the packages that have > been uploaded, a naive cache won't work. But if you go stale at > reasonable intervals, you'll probably be okay. Yeah - agreed. > If you know something > about how to interpret the requests, you can do better. I'd be happy > to send you the source code. > On Wed, Dec 3, 2008 at 6:47 PM, wrote: > It is in iplt part of the tree. Perhaps it should be made public. I > wouldn't object but I don't know how much trouble I'd be causing Eli. > I would be interested to get access to the source code - and I am not familiar with where the svn access is. If it doesn't cause too much trouble for Eli (or others) - please let me know how/where to get access. Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081203/0b3e3924/attachment.htm From patricklozzi at gmail.com Thu Dec 4 00:57:20 2008 From: patricklozzi at gmail.com (Patrick Lozzi) Date: Thu Mar 26 02:35:13 2009 Subject: [plt-scheme] Recommendations for parsing HTML Message-ID: <3d02d2f50812032157m6558251ck7b7b40eb1591cc26@mail.gmail.com> It appears I'm really at a loss without the planet's htmlprag library, I tried to set the file to R5RS but it wouldn't allow me to use the planet's htmlprag library as it came up with "reference to undefined identifier: require"... mustn't the file be set to module in order to use require? That's the impression I'm getting. In other words, whenever I received this error in the past, I realized the current file wasn't set to module, so simply setting it to module corrected this error... but if I set it back to module, I'm back at square one with the mutable cons cells problem that plagues > v4 versions combined with htmlprag. In summary, here's what I have been trying and I'm open to your suggestions: * I put the htmlprag.ss file locally, which is set to module... if I reload it(F5), I get: "expand: unbound identifier in module in: set-cdr!" * If this same file is r5rs, then I get: "define-syntax: not allowed in an expression context in: (define-syntax %htmlprag:testeez (syntax-rules () ((_ x ...) (error "Tests disabled."))))" * In the calling file, I tried to call the library from the planet with the require statement but this calling file had to be set to module, as far as I know... and the error I received was the same set-cdr! as above. * If I set the calling file to r5rs, I further cannot 'load' the local file and I receive the define-syntax error stated above. * I rolled back to < v4, specifically 372 and had the same define-syntax errors as above. Can you recommend either a solution to this problem or maybe a different way to parse html than this library altogether? I've tried a few other libraries, like SSAX from here: http://okmij.org/ftp/Scheme/xml.html#HTML-parser but this produces undefined errors in the provided source, such as symbols being used but nowhere in the file are they defined... and I checked for possible dependencies and didn't find any. I'm trying to collect all available urls in the html and queue them for analysis. The html should be allowed to be ill-constructed, or in other words, I would like to acquire a library that is permissive of a few missing html tags if the html is indeed missing them, which was my original intention with SSAX(permissive parser), and further I had hoped I could get htmlprag to work... Thank you for your time and I look forward to your ideas, -Patrick -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081204/4ea58337/attachment.html From robby at cs.uchicago.edu Thu Dec 4 01:46:42 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:35:13 2009 Subject: [plt-scheme] Recommendations for parsing HTML In-Reply-To: <3d02d2f50812032157m6558251ck7b7b40eb1591cc26@mail.gmail.com> References: <3d02d2f50812032157m6558251ck7b7b40eb1591cc26@mail.gmail.com> Message-ID: <932b2f1f0812032246o7536b1ddme4b105825c1d3658@mail.gmail.com> Did you try read-html-as-xml? Robby On Wed, Dec 3, 2008 at 11:57 PM, Patrick Lozzi wrote: > It appears I'm really at a loss without the planet's htmlprag library, I > tried to set the file to R5RS but it wouldn't allow me to use the planet's > htmlprag library as it came up with "reference to undefined identifier: > require"... mustn't the file be set to module in order to use require? > That's the impression I'm getting. In other words, whenever I received this > error in the past, I realized the current file wasn't set to module, so > simply setting it to module corrected this error... but if I set it back to > module, I'm back at square one with the mutable cons cells problem that > plagues > v4 versions combined with htmlprag. > > In summary, here's what I have been trying and I'm open to your suggestions: > * I put the htmlprag.ss file locally, which is set to module... if I > reload it(F5), I get: "expand: unbound identifier in module in: set-cdr!" > * If this same file is r5rs, then I get: "define-syntax: not allowed in an > expression context in: (define-syntax %htmlprag:testeez (syntax-rules () ((_ > x ...) (error "Tests disabled."))))" > * In the calling file, I tried to call the library from the planet with > the require statement but this calling file had to be set to module, as far > as I know... and the error I received was the same set-cdr! as above. > * If I set the calling file to r5rs, I further cannot 'load' the local > file and I receive the define-syntax error stated above. > * I rolled back to < v4, specifically 372 and had the same define-syntax > errors as above. > > Can you recommend either a solution to this problem or maybe a different way > to parse html than this library altogether? I've tried a few other > libraries, like SSAX from here: > http://okmij.org/ftp/Scheme/xml.html#HTML-parser > but this produces undefined errors in the provided source, such as symbols > being used but nowhere in the file are they defined... and I checked for > possible dependencies and didn't find any. > > I'm trying to collect all available urls in the html and queue them for > analysis. The html should be allowed to be ill-constructed, or in other > words, I would like to acquire a library that is permissive of a few missing > html tags if the html is indeed missing them, which was my original > intention with SSAX(permissive parser), and further I had hoped I could get > htmlprag to work... > > Thank you for your time and I look forward to your ideas, > -Patrick > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From clements at brinckerhoff.org Thu Dec 4 03:51:25 2008 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:35:14 2009 Subject: [plt-scheme] Recommendations for parsing HTML In-Reply-To: <932b2f1f0812032246o7536b1ddme4b105825c1d3658@mail.gmail.com> References: <3d02d2f50812032157m6558251ck7b7b40eb1591cc26@mail.gmail.com> <932b2f1f0812032246o7536b1ddme4b105825c1d3658@mail.gmail.com> Message-ID: <49266E85-6951-4E3D-92AF-15252A139694@brinckerhoff.org> On Dec 3, 2008, at 10:46 PM, Robby Findler wrote: > Did you try read-html-as-xml? I'm deeply relieved to report that this doesn't work on things like "abc", which htmlprag does. 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/20081204/b238b85f/smime.bin From neil at neilvandyke.org Thu Dec 4 04:11:05 2008 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:35:14 2009 Subject: [plt-scheme] Recommendations for parsing HTML In-Reply-To: <2AF58799-8472-408F-BC13-7E1FD844A359@brinckerhoff.org> References: <3d02d2f50812032157m6558251ck7b7b40eb1591cc26@mail.gmail.com> <2AF58799-8472-408F-BC13-7E1FD844A359@brinckerhoff.org> Message-ID: <49379EA9.4000903@neilvandyke.org> John Clements wrote at 12/04/2008 03:46 AM: > > Because... well, because I had so many *other* things that I should > have been doing instead, I took a crack at updating htmlprag to work > with 4.0. Thank you, John! I am crunching on a client's project at this hour, but I will take a look at your changes shortly. (I've been slacking on HtmlPrag because I have several new packages that replace it, sitting around waiting for the finishing touches. My consulting clients have had other priorities for my time. Anyone should please feel free to yell at me if I don't make time for HtmlPrag this weekend.) By the way, I couldn't agree with you more about the headache caused by the list mutations. HtmlPrag was the first Scheme library that I wrote, and I'd say that the code style is more idiomatic of non-Scheme Lisp and C. Neil -- http://www.neilvandyke.org/ From clements at brinckerhoff.org Thu Dec 4 04:39:03 2008 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:35:15 2009 Subject: Fwd: [plt-scheme] Recommendations for parsing HTML References: <2AF58799-8472-408F-BC13-7E1FD844A359@brinckerhoff.org> Message-ID: <57218D89-AABB-4A99-9E82-017518D17F02@brinckerhoff.org> Whoops... bigger than the 50K limit with the attachment. If my original message doesn't get approved, let me know and I'll send you the .plt file separately. John Clements Begin forwarded message: > From: John Clements > Date: December 4, 2008 12:46:55 AM PST > To: Patrick Lozzi > Cc: PLT-list List , neil@neilvandyke.org > Subject: Re: [plt-scheme] Recommendations for parsing HTML > > > On Dec 3, 2008, at 9:57 PM, Patrick Lozzi wrote: > >> It appears I'm really at a loss without the planet's htmlprag >> library, I tried to set the file to R5RS but it wouldn't allow me >> to use the planet's htmlprag library as it came up with "reference >> to undefined identifier: require"... mustn't the file be set to >> module in order to use require? That's the impression I'm >> getting. In other words, whenever I received this error in the >> past, I realized the current file wasn't set to module, so simply >> setting it to module corrected this error... but if I set it back >> to module, I'm back at square one with the mutable cons cells >> problem that plagues > v4 versions combined with htmlprag. > > Because... well, because I had so many *other* things that I should > have been doing instead, I took a crack at updating htmlprag to > work with 4.0. > > Let me just say... BLECCH! This is not a comment about this code, > per se; it's just that trying to get a handle on the flow of values > in a world with mutable pairs is a horrible awful nightmare. > > I tried not to let the mutable pairs bleed into everything too > much, but I wouldn't claim the result is anything but a hack job. > Perhaps it will convince Neil to take a look at it himself! > > Anyhow, it works, in the sense that it passes the built-in 146 tests. > > For what it's worth, this would have been a twenty-hour project > rather than a two-hour project if it weren't for that test suite. > > Attached please find an updated planet package. > > If Neil likes it, he can update the planet server. Until then, you > can inject it yourself by putting it in /tmp, say, and running > > planet fileinject neil /tmp/htmlprag.plt 1 4 > > Finally, you'd then require it by saying something like: > > (require (planet neil/htmlprag:1:4/htmlprag)) > > Okay, *now* someone can tell me that there's a perfectly good > alternative to htmlprag. > > All the best, > > John Clements > -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2484 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081204/df8ed886/smime.bin From s.degabrielle at cs.ucl.ac.uk Thu Dec 4 04:39:46 2008 From: s.degabrielle at cs.ucl.ac.uk (Stephen De Gabrielle) Date: Thu Mar 26 02:35:15 2009 Subject: [plt-scheme] music in scheme In-Reply-To: <4937199C.7030203@zenburn.net> References: <4937199C.7030203@zenburn.net> Message-ID: <595b9ab20812040139i6d59732ep20d8a1956316a148@mail.gmail.com> the fluxus project has some links to tools for using scheme for sound generation. http://www.pawfal.org/fluxus/ s. On Wed, Dec 3, 2008 at 11:43 PM, Jakub Piotr C?apa wrote: > Dave wrote: > >> I was wondering what libraries are used in scheme to produce some form >> of sound. Im writing a c++ code that has embedded in it scheme in for >> which then plays sound, but im not sure on which libraries are used >> for such a program. Any suggestions??...thank you in advance >> > > I think that it should be easier to do from C/C++ than from Scheme. Maybe > using PortAudio or some simple sound playing API (it depends on whether you > need this cross-platform and such). > > PS. libsndfile is wrapped using the FFI (look in the collects/ffi/examples > dir) but this only allows for reading and writing various (uncompressed) > audio file formats. > > -- > regards, > Jakub Piotr C?apa > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081204/3e2dc96b/attachment.htm From roger at stat.Berkeley.EDU Thu Dec 4 01:33:26 2008 From: roger at stat.Berkeley.EDU (roger@stat.Berkeley.EDU) Date: Thu Mar 26 02:35:16 2009 Subject: [plt-scheme] music in scheme Message-ID: <40240.66.245.49.110.1228372406.squirrel@www.stat.berkeley.edu> >From the site: http://impromptu.moso.com.au/ "Impromptu is an OSX programming environment for composers, sound artists, VJ's and graphic artists with an interest in live or interactive programming. Impromptu is a Scheme language environment . . . " This was unknown terrain for me but I really enjoyed visiting the site. Roger Purves From clements at brinckerhoff.org Thu Dec 4 03:46:55 2008 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:35:17 2009 Subject: [plt-scheme] Recommendations for parsing HTML In-Reply-To: <3d02d2f50812032157m6558251ck7b7b40eb1591cc26@mail.gmail.com> References: <3d02d2f50812032157m6558251ck7b7b40eb1591cc26@mail.gmail.com> Message-ID: <2AF58799-8472-408F-BC13-7E1FD844A359@brinckerhoff.org> Skipped content of type multipart/mixed-------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2484 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081204/745299cb/smime.bin From dave at pawfal.org Thu Dec 4 05:11:28 2008 From: dave at pawfal.org (Dave Griffiths) Date: Thu Mar 26 02:35:17 2009 Subject: [plt-scheme] music in scheme In-Reply-To: <595b9ab20812040139i6d59732ep20d8a1956316a148@mail.gmail.com> References: <4937199C.7030203@zenburn.net> <595b9ab20812040139i6d59732ep20d8a1956316a148@mail.gmail.com> Message-ID: Fluxus comes with a synthesis and sample playback server with a scheme api for controlling it, eg: (play-now (mul (adsr 0 0.1 0 0) (sine 440))) Will play a short sine tone at 440hz However, it's not really very mature, only works on linux and osx, and I'm still working on the documentation - so I'd really recommend rsc, for using plt scheme with supercollider (a very well used and mature synth): http://www.slavepianos.org/rd/f/149683/ > the fluxus project has some links to tools for using scheme for sound > generation. > http://www.pawfal.org/fluxus/ > s. > > On Wed, Dec 3, 2008 at 11:43 PM, Jakub Piotr C??apa > wrote: > >> Dave wrote: >> >>> I was wondering what libraries are used in scheme to produce some form >>> of sound. Im writing a c++ code that has embedded in it scheme in for >>> which then plays sound, but im not sure on which libraries are used >>> for such a program. Any suggestions??...thank you in advance >>> >> >> I think that it should be easier to do from C/C++ than from Scheme. >> Maybe >> using PortAudio or some simple sound playing API (it depends on whether >> you >> need this cross-platform and such). >> >> PS. libsndfile is wrapped using the FFI (look in the >> collects/ffi/examples >> dir) but this only allows for reading and writing various (uncompressed) >> audio file formats. >> >> -- >> regards, >> Jakub Piotr C??apa >> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > > > > -- > 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 > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From dave at pawfal.org Thu Dec 4 06:27:42 2008 From: dave at pawfal.org (Dave Griffiths) Date: Thu Mar 26 02:35:17 2009 Subject: [plt-scheme] livecoding updates Message-ID: Hi all, I thought I'd post an update on scheme, fluxus and the world of livecoding... Firstly I've been running an art installation recently using fluxus, and therefore mzscheme - fairly intensively, in one case it's been running continuously for over two months, in the Alhambra in Granada: http://www.fundacionbiacs.com/biacs3/index.php http://www.pawfal.org/dave/index.cgi?Projects/Al%20Jazari The other news is that I've recently been implementing something a little bit like scratch, for scheme and using it for audio livecoding: http://www.pawfal.org/dave/index.cgi?Projects/Scheme%20Bricks It needs a lot of work, but I managed to use it last weekend (see the video). So, just a quick thanks for PLT, and helping all this to be possible! I need to look into making planet packages for making this stuff easier for you lot to pick up... cheers, dave From marek at xivilization.net Thu Dec 4 06:41:34 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:35:17 2009 Subject: [plt-scheme] livecoding updates In-Reply-To: References: Message-ID: <20081204124134.069a5500@halmanfloyd.lan.local> On Thu, 4 Dec 2008 11:27:42 -0000 (GMT) "Dave Griffiths" wrote: > So, just a quick thanks for PLT, and helping all this to be possible! Thank you for your livecoding stuff, it looks totally awesome! One of the nicest ways to show others that Scheme rocks. regards, Marek From jensaxel at soegaard.net Thu Dec 4 15:13:10 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:35:17 2009 Subject: [plt-scheme] In-line LaTeX in REPL In-Reply-To: <18743.9263.232873.628059@arabic.ccs.neu.edu> References: <5f07325f0812020943r3c38334ap745bc6dde316fd85@mail.gmail.com> <81addec70812021521l38f50eefq29bba68c0f7e5edf@mail.gmail.com> <18743.9263.232873.628059@arabic.ccs.neu.edu> Message-ID: <493839D6.1070901@soegaard.net> Hi All, First of all: This is brilliant. Second: A small observation: At first the shell that DrScheme starts couldn't find any of pdflatex, convert, and gs since they weren't on the path. (I normally use spotlight to start DrScheme) Starting DrScheme from a terminal solves all of this. Last, but most importantly: I saved Eli's version in latex.ss > #reader scribble/reader > #lang scheme > (require scheme/system scheme/gui/base) > ... > ;; Examples > @latex{\sum_{i=0}^{\infty}\lambda_i} > (let ([self @str{\lambda x . x x}]) > @latex{(@self) (@self)}) > And the I run them I get nice formulas in the REPL. But! If I enter the following in the REPL (let ([self @str{\lambda x . x x}]) @latex{(@self) (@self)}) I get the following error from the reader: read: illegal use of `.' Should the REPL of the module language use the reader specified in the source file? -- Jens Axel S?gaard From samth at ccs.neu.edu Fri Dec 5 13:44:28 2008 From: samth at ccs.neu.edu (Sam TH) Date: Thu Mar 26 02:35:18 2009 Subject: [plt-scheme] attaching object names to values Message-ID: <63bb19ae0812051044n5e6f8bdet11ce1eb403a4d239@mail.gmail.com> The contract system uses the `object-name' of predicates to print out their names in error messages. But this can be useless if the predicate itself is wrapped in a contract. This program shows the problem pretty well: #lang scheme (define x? (contract (-> any/c boolean?) (lambda (x) #t) 'here 'there)) (define my/c (-> x? x?)) (contract my/c 5 'foo 'bar) It gives a contract error referencing "unsaved-editorx:y:z", instead of "x?". Unfortunately, there seems to be nothing that I can do to change the object-name of the contract value (except eta-expand). Notably, the inferred-name syntax property doesn't work, since the actual lambda expression isn't available (it's in the contract library). Is there a solution here I'm missing? Thanks, -- sam th samth@ccs.neu.edu From robby at cs.uchicago.edu Fri Dec 5 15:48:53 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:35:18 2009 Subject: [plt-scheme] local planet mirror/repository? In-Reply-To: <779bf2730812042313k4ea79d29k44835fe01ffa3c27@mail.gmail.com> References: <779bf2730812021707k262b5e41t67ce0c546340500f@mail.gmail.com> <932b2f1f0812021914t7017b524q7ef07db9144b50d7@mail.gmail.com> <779bf2730812022157o1724558xf1bda1e1a7a34878@mail.gmail.com> <932b2f1f0812022203v71edff23nebf488b7a93fe751@mail.gmail.com> <779bf2730812022251g40103f6fu4eb3bd5a82cb218a@mail.gmail.com> <46b603df0812042228y4a9bae16x818a9230ecc85cc4@mail.gmail.com> <779bf2730812042313k4ea79d29k44835fe01ffa3c27@mail.gmail.com> Message-ID: <932b2f1f0812051248s2871e587ia0885d09b77e109a@mail.gmail.com> I can look into that at some poitn, but it would be nice to hear more about the actual problem you're experiencing. Are you finding that just downloading everything from Chicago is slow? (including, say, the PLT Scheme mirror for downloading the basic installation)? Thanks, Robby On Fri, Dec 5, 2008 at 1:13 AM, YC wrote: > > On Thu, Dec 4, 2008 at 10:28 PM, Jacob Matthews > wrote: >> >> Most of the code in the planet server is dedicated to the second task. >> If you only wanted to worry about the first task (as presumably is >> what you'd want to do with a local mirror), you could use the code in >> collects/planet/private/planet-shared.ss, probably starting with >> lookup-package. > > Thanks for the pointer, Jacob. >> >> The other part of the task would be downloading the complete index of >> planet packages regularly. That I can't help you with. >> > > I noticed that planet server doesn't handle 304 (Etag, If-Non-Match, > If-Modified-Since) caching. While I imagine bandwidth isn't an issue for > uchicago, it can help a proxy to identify whether to download the package > again (and save bandwidth). This would be a feature request ;) > > Thanks, > yc > > From yinso.chen at gmail.com Fri Dec 5 02:14:01 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:35:19 2009 Subject: [plt-scheme] Re: plt version number issues? In-Reply-To: <779bf2730812041738u3305bf12u94fe8af3a9b7afbd@mail.gmail.com> References: <779bf2730812041738u3305bf12u94fe8af3a9b7afbd@mail.gmail.com> Message-ID: <779bf2730812042314r7ed46575webde637df7dad9d1@mail.gmail.com> Seems like I wrote this email in haste... upon deeper examination, the particular package below is not marked as available for 4.xx tree, so that's probably why the package is unavailable - the error message of "too old" misdirected me ;) Thanks, yc On Thu, Dec 4, 2008 at 5:38 PM, YC wrote: > Hi - > > it seems that the version number change from 3xx into 4.xx are causing some > logic issues. I came across this issue trying to require > cce/parameter-utils, and below are the results (note the "too old"): > > Welcome to MzScheme v4.0 [3m], Copyright (c) 2004-2008 PLT Scheme Inc. > > (require (planet cce/parameter-utils:1:0)) > stdin::9: require: PLaneT could not find the requested package: Server had > no matching package: Your version of PLT Scheme is *too old* to run the > specified package in: (planet cce/parameter-utils:1:0) > > Obviously, 4.0 is pretty new. I then generated the planet url via `planet > url` command, and paste into browser, and then change the 4.0 part into 372, > and of course I was able to download the package. > > > http://planet.plt-scheme.org/servlets/planet-servlet.ss?lang=%22372%22&name=%22parameter-utils.plt%22&maj=1&min-lo=0&min-hi=%23f&path=%28%22cce%22%29 > > So - the comparison of planet versioning is done on pure numbers (and hence > 372 is greater than 4.0, even though the build is older). While this is a > bug, perhaps switching the versioning convention causes unnecessary > headaches? > > yc > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081204/c23f0137/attachment.html From grettke at acm.org Thu Dec 4 22:22:48 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:35:19 2009 Subject: [plt-scheme] http://www.htdp.org/ is down Message-ID: <756daca50812041922w41d66054g1a9773d9de5844dd@mail.gmail.com> http://www.htdp.org/ is down is it just for me? From eli at barzilay.org Thu Dec 4 17:19:24 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:35:19 2009 Subject: [plt-scheme] In-line LaTeX in REPL In-Reply-To: <493839D6.1070901@soegaard.net> References: <5f07325f0812020943r3c38334ap745bc6dde316fd85@mail.gmail.com> <81addec70812021521l38f50eefq29bba68c0f7e5edf@mail.gmail.com> <18743.9263.232873.628059@arabic.ccs.neu.edu> <493839D6.1070901@soegaard.net> Message-ID: <18744.22380.341174.253274@arabic.ccs.neu.edu> On Dec 4, Jens Axel Soegaard wrote: > And the I run them I get nice formulas in the REPL. > > But! If I enter the following in the REPL > > (let ([self @str{\lambda x . x x}]) > @latex{(@self) (@self)}) > > I get the following error from the reader: > > read: illegal use of `.' > > Should the REPL of the module language use the reader > specified in the source file? Yes, the repl currently just reads plain s-expressions (both drscheme and mzscheme). The basic functionality to make it use the properties of the language are there, but someone (*cough*) needs to use it and implement a layer that will provide these properties. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From yinso.chen at gmail.com Fri Dec 5 02:13:13 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:35:20 2009 Subject: [plt-scheme] local planet mirror/repository? In-Reply-To: <46b603df0812042228y4a9bae16x818a9230ecc85cc4@mail.gmail.com> References: <779bf2730812021707k262b5e41t67ce0c546340500f@mail.gmail.com> <932b2f1f0812021914t7017b524q7ef07db9144b50d7@mail.gmail.com> <779bf2730812022157o1724558xf1bda1e1a7a34878@mail.gmail.com> <932b2f1f0812022203v71edff23nebf488b7a93fe751@mail.gmail.com> <779bf2730812022251g40103f6fu4eb3bd5a82cb218a@mail.gmail.com> <46b603df0812042228y4a9bae16x818a9230ecc85cc4@mail.gmail.com> Message-ID: <779bf2730812042313k4ea79d29k44835fe01ffa3c27@mail.gmail.com> On Thu, Dec 4, 2008 at 10:28 PM, Jacob Matthews wrote: > > Most of the code in the planet server is dedicated to the second task. > If you only wanted to worry about the first task (as presumably is > what you'd want to do with a local mirror), you could use the code in > collects/planet/private/planet-shared.ss, probably starting with > lookup-package. > Thanks for the pointer, Jacob. > > The other part of the task would be downloading the complete index of > planet packages regularly. That I can't help you with. > > I noticed that planet server doesn't handle 304 (Etag, If-Non-Match, If-Modified-Since) caching. While I imagine bandwidth isn't an issue for uchicago, it can help a proxy to identify whether to download the package again (and save bandwidth). This would be a feature request ;) Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081204/03c96c53/attachment.htm From jacobm at cs.uchicago.edu Fri Dec 5 01:28:47 2008 From: jacobm at cs.uchicago.edu (Jacob Matthews) Date: Thu Mar 26 02:35:20 2009 Subject: [plt-scheme] local planet mirror/repository? In-Reply-To: <779bf2730812022251g40103f6fu4eb3bd5a82cb218a@mail.gmail.com> References: <779bf2730812021707k262b5e41t67ce0c546340500f@mail.gmail.com> <932b2f1f0812021914t7017b524q7ef07db9144b50d7@mail.gmail.com> <779bf2730812022157o1724558xf1bda1e1a7a34878@mail.gmail.com> <932b2f1f0812022203v71edff23nebf488b7a93fe751@mail.gmail.com> <779bf2730812022251g40103f6fu4eb3bd5a82cb218a@mail.gmail.com> Message-ID: <46b603df0812042228y4a9bae16x818a9230ecc85cc4@mail.gmail.com> On Tue, Dec 2, 2008 at 10:51 PM, YC wrote: > On Tue, Dec 2, 2008 at 10:03 PM, Robby Findler > wrote: >> >> If it isn't in the docs, then I don't think it is in the client >> implementation. But I'd have to go look at it myself to answer those >> questions and I suspect you'd be just as good as I would for that. > > Thanks for the pointer - based on > http://docs.plt-scheme.org/planet/Utility_Libraries.html, it seems that > planet can use either HTTP or a "custom" planet protocol. Also it seems that > planet does read from a config.ss file, which can potentially facilitate > reading from a local mirror site. The config.ss in my installation shows > that by default plt uses the http protocol. Yes. Just use the HTTP protocol. The custom protocol is best forgotten about. (I wrote it because I didn't yet understand how problematic it is for some users on some networks when you write a service that doesn't use a standard protocol.) > The doc doesn't discuss how to setup a local mirror of > planet.plt-scheme.org. Based on running planet url ..., it > does seem that a servlet called planet-servlet.ss is required to access the > packages correctly. Hence I would imagine that setting up a local mirror > including having the planet-servlet.ss available. The planet server running at planet.plt-scheme.org does two important things: 1. Serve planet packages 2. Handle uploads, management, display, etc Most of the code in the planet server is dedicated to the second task. If you only wanted to worry about the first task (as presumably is what you'd want to do with a local mirror), you could use the code in collects/planet/private/planet-shared.ss, probably starting with lookup-package. [planet-shared.ss is so named because originally it was the shared library for both client and server to look up the appropriate package to handle a particular request. The server doesn't do it that way anymore, but the name remained.] The other part of the task would be downloading the complete index of planet packages regularly. That I can't help you with. -jacob From noelwelsh at gmail.com Fri Dec 5 03:24:22 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:35:20 2009 Subject: [plt-scheme] audio in Scheme In-Reply-To: <0287797A-0018-4EC9-87F8-AAAE917D2C83@adelphi.edu> References: <0287797A-0018-4EC9-87F8-AAAE917D2C83@adelphi.edu> Message-ID: On Thu, Dec 4, 2008 at 2:48 PM, Stephen Bloch wrote: > So what would I need? > > 1) I'd like to be able to copy and paste audio clips from, say, a Web page > or a file into DrScheme, as I can currently copy and paste images. I don't > know how this would work, or whether it's already possible :-) Is there an > audio data type analogous to image-snip% ? I dunno about copy and paste. libsndfile can read just about every file format *except* MP3. MAD supports MP3. portaudio gives you cross-platform audio output and (I think) microphone input. > 2) Obvious easy operations on audio clips: concatenate, reverse (in the time > dimension), increase/decrease volume (i.e. scalar multiplication of > amplitude), play simultaneously (i.e. add pointwise), amplitude-modulate > (i.e. multiply pointwise), speed up and slow down (i.e. scalar > multiplication in the time domain), find peak amplitude. Do this in Scheme. It should be fast enough, at least for simple problems. > 3) Easy primitives: sine, square, and triangle waves of specified frequency > and duration. Do this in Scheme. > 4) Not quite so trivial operations: transpose up or down without changing > durations, change durations without changing pitch, invert pitches, apply a > specified volume envelope (e.g. ADSR), convolve with a specified impulse > response (e.g. to apply echo and reverb effects; is this actually the same > operation?) Hmmm... Try Scheme. N. From geoff at knauth.org Thu Dec 4 22:11:29 2008 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Thu Mar 26 02:35:20 2009 Subject: [plt-scheme] Database In-Reply-To: References: Message-ID: On Dec 4, 2008, at 19:54, Rohan Golwala wrote: > Ya I have used PostgreSQL. So can I go forward now... do u suggest > something....? I (and others) can suggest lots of things, but it would be best if I knew what you wanted to do. Here are some examples using SQLite: http://scheme.dk/blog/2007/01/introduction-to-web-development-with.html Snooze uses SQLite/PostgreSQL: http://planet.plt-scheme.org/package-source/untyped/snooze.plt/1/4/snooze.ss http://planet.plt-scheme.org/package-source/untyped/snooze.plt/2/3/planet-docs/snooze/index.html Underneath, I believe Snooze uses SPGSQL: http://planet.plt-scheme.org/package-source/schematics/spgsql.plt/2/3/doc.txt From yinso.chen at gmail.com Thu Dec 4 20:38:49 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:35:21 2009 Subject: [plt-scheme] plt version number issues? Message-ID: <779bf2730812041738u3305bf12u94fe8af3a9b7afbd@mail.gmail.com> Hi - it seems that the version number change from 3xx into 4.xx are causing some logic issues. I came across this issue trying to require cce/parameter-utils, and below are the results (note the "too old"): Welcome to MzScheme v4.0 [3m], Copyright (c) 2004-2008 PLT Scheme Inc. > (require (planet cce/parameter-utils:1:0)) stdin::9: require: PLaneT could not find the requested package: Server had no matching package: Your version of PLT Scheme is *too old* to run the specified package in: (planet cce/parameter-utils:1:0) Obviously, 4.0 is pretty new. I then generated the planet url via `planet url` command, and paste into browser, and then change the 4.0 part into 372, and of course I was able to download the package. http://planet.plt-scheme.org/servlets/planet-servlet.ss?lang=%22372%22&name=%22parameter-utils.plt%22&maj=1&min-lo=0&min-hi=%23f&path=%28%22cce%22%29 So - the comparison of planet versioning is done on pure numbers (and hence 372 is greater than 4.0, even though the build is older). While this is a bug, perhaps switching the versioning convention causes unnecessary headaches? yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081204/1a89467f/attachment.html From jensaxel at soegaard.net Thu Dec 4 15:58:08 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:35:21 2009 Subject: [plt-scheme] Confused about current-print Message-ID: <49384460.1010807@soegaard.net> I was expecting the output of the following expressions to be the same (and specifically be the same as the latter). What am I missing? Welcome to DrScheme, version 4.1.3 [3m]. Language: Module; memory limit: 384 megabytes. > (list (with-output-to-string (? () (let ([print (current-print)]) (print 42))))) 42 ("") > (list (with-output-to-string (? () (print 42)))) ("42") My expectation came from the documentation on current-print: (current-print) ? (any/c -> any) (current-print proc) ? void? proc : (any/c -> any) A parameter that determines the print handler that is called by read-eval-print-loop to print the result of an evaluation (and the result is ignored). The default print handler prints the value to the current output port (as determined by the current-output-port parameter) and then outputs a newline, except that it prints nothing when the value is #. -- Jens Axel S?gaard From vyzo at media.mit.edu Fri Dec 5 00:07:51 2008 From: vyzo at media.mit.edu (Dimitris Vyzovitis) Date: Thu Mar 26 02:35:21 2009 Subject: [plt-scheme] exception in local variable access from augmented method Message-ID: I am trying to mutate a local variable from an augmented method, but all I get is a horrible exception. Here is an example: (define Frame% (class frame% (define foo 0) (define (can-close?) (printf "~a~n" foo) (set! foo (add1 foo)) #t) (augment can-close?) (super-new))) (define xx (new Frame% (label "Foo") (width 300) (height 300))) (send xx show #t) (yield 'wait) 0 procedure application: expected procedure, given: 0; arguments were: 0 1 -- vyzo From jacobm at cs.uchicago.edu Fri Dec 5 01:12:46 2008 From: jacobm at cs.uchicago.edu (Jacob Matthews) Date: Thu Mar 26 02:35:22 2009 Subject: [plt-scheme] audio in Scheme In-Reply-To: <0287797A-0018-4EC9-87F8-AAAE917D2C83@adelphi.edu> References: <0287797A-0018-4EC9-87F8-AAAE917D2C83@adelphi.edu> Message-ID: <46b603df0812042212h78e50e1cr6cafe9ed2c994d4a@mail.gmail.com> Last year, when I got Paul Hudak's "The Haskell School of Expression", I started working my way through his Haskore example using Scheme instead of Haskell. My haskore variation had primitives similar to Stephen's: ;; music ::= (make-note pitch duration) ;; | (make-rst duration) ;; | (seq (listof music)) ;; | (par (listof music)) I.e., music is a note, a rest, some musics played one after the other, or some musics played in parallel. The hard part of this program was the MIDI file output, which is why I think it's worth mailing it out rather than just telling people to look at Hudak's book. [He doesn't explain how to write the low-level output library, he just provides one. The MIDI file format turns out to be pretty hairy.] I'm attaching the file I wrote then here, with the warning that it was uncommented and possibly incomplete, and I don't really remember how it worked anymore. It probably has bugs, and if it does I can't fix them. That said, I just verified that you can do > (music->midi (make-seq (list (Gmaj 1) (Gmaj 1) (Dmaj 2) (Cmaj 1) (Gmaj 2))) "testing.midi") and it makes testing.midi contain a sound file that sounds like you'd expect. (Verified against the version of PLT Scheme in SVN as of November 8.) I send this out in case someone wants to take it and do something with it. -jacob On Thu, Dec 4, 2008 at 6:48 AM, Stephen Bloch wrote: > I'm very interested in this audio stuff for a pedagogical reason: I'd like > to supplement the "tiles" and "image" teachpacks with audio analogues (for > the benefit of visually-impaired students or just those who learn better > aurally than visually). > > So what would I need? > > 1) I'd like to be able to copy and paste audio clips from, say, a Web page > or a file into DrScheme, as I can currently copy and paste images. I don't > know how this would work, or whether it's already possible :-) Is there an > audio data type analogous to image-snip% ? > > 2) Obvious easy operations on audio clips: concatenate, reverse (in the time > dimension), increase/decrease volume (i.e. scalar multiplication of > amplitude), play simultaneously (i.e. add pointwise), amplitude-modulate > (i.e. multiply pointwise), speed up and slow down (i.e. scalar > multiplication in the time domain), find peak amplitude. > > 3) Easy primitives: sine, square, and triangle waves of specified frequency > and duration. > > 4) Not quite so trivial operations: transpose up or down without changing > durations, change durations without changing pitch, invert pitches, apply a > specified volume envelope (e.g. ADSR), convolve with a specified impulse > response (e.g. to apply echo and reverb effects; is this actually the same > operation?) > > And of course, all of this needs to have a simple enough interface to be > accessible to non-CS-major students who have been programming for only a few > days. :-) > > Once we've got this, it would be nice to modify the animation teachpack so > the "display" has both a visual and an audio track, both computed by > user-provided functions on the model.... > > Stephen Bloch > sbloch@adelphi.edu > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > -------------- next part -------------- A non-text attachment was scrubbed... Name: midi.ss Type: application/octet-stream Size: 8615 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081204/9cccafbf/midi.obj From alexshinn at gmail.com Sat Dec 6 01:34:08 2008 From: alexshinn at gmail.com (Alex Shinn) Date: Thu Mar 26 02:35:22 2009 Subject: [plt-scheme] Recommendations for parsing HTML In-Reply-To: (Alex Shinn's message of "Fri\, 05 Dec 2008 02\:05\:18 +0900") References: <3d02d2f50812032157m6558251ck7b7b40eb1591cc26@mail.gmail.com> <2AF58799-8472-408F-BC13-7E1FD844A359@brinckerhoff.org> Message-ID: Alex Shinn writes: > John Clements writes: > >> Okay, *now* someone can tell me that there's a perfectly good >> alternative to htmlprag. > > There's an old, unpublished library at > > http://synthcode.com/scheme/html-parser.scm OK, this is now uploaded as a Planet package - for anyone who wants to try it out just do (require (planet ashinn/html-parser:1:0/html-parser)) If all you used before was html->sxml and sxml->html it should serve as a drop-in replacement for htmlprag. -- Alex From yinso.chen at gmail.com Fri Dec 5 18:35:45 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:35:23 2009 Subject: reorganizations ==> Re: [plt-scheme] Missing some libraries, trying to use LeftParen Message-ID: <779bf2730812051535i253f645bxed9f342a6003b89e@mail.gmail.com> Hi Jay - is there a release notes about the refactoring changes from 4.1.2 & 4.1.3? Would be great for figuring out how to keep apps working across both versions. Thanks! yc On Tue, Dec 2, 2008 at 6:16 AM, Jay McCarthy wrote: > It looks like LeftParen is incompatible with some of the > reorganization that went on before 4.1.3 came out. I would suggest > using 4.1.2 until LeftParen is updated. > > Jay > > On Tue, Dec 2, 2008 at 1:27 AM, SweetwaterDixon > wrote: > > I installed plt scheme 4.1.3 today and I tried to follow this > > tutorial: > > > http://planet.plt-scheme.org/package-source/vegashacker/leftparen.plt/2/2/planet-docs/leftparen/index.html > > > > but when I tried to do: > > mzscheme -e '(require (planet "bootstrap.scm" ("vegashacker" > > "leftparen.plt" 2 2)))' project hello-world > > I got this error: > > default-load-handler: cannot open input file: "/home/gerard/plt/ > > collects/web-server/private/response-structs.ss" (No such file or > > directory; errno=2) > > > > I did a locate for "response-struct.ss" and found it in: /home/gerard/ > > plt/collects/web-server/http > > > > so of course I take the first special-class thing that comes to mind > > and I: > > cp http/* private/* > > > > then left-paren installed without errors... but when I follow the next > > bit and try to start up the server: > > default-load-handler: cannot open input file: "/home/gerard/plt/ > > collects/web-server/dispatchers/dispatch-lang.ss" (No such file or > > directory; errno=2) > > > > Please, if someone could tell me what's going on and help me get this > > going it would be great. > > _________________________________________________ > > 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 > _________________________________________________ > 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/20081205/3f349c47/attachment.html From yinso.chen at gmail.com Fri Dec 5 16:12:00 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:35:23 2009 Subject: [plt-scheme] local planet mirror/repository? In-Reply-To: <932b2f1f0812051248s2871e587ia0885d09b77e109a@mail.gmail.com> References: <779bf2730812021707k262b5e41t67ce0c546340500f@mail.gmail.com> <932b2f1f0812021914t7017b524q7ef07db9144b50d7@mail.gmail.com> <779bf2730812022157o1724558xf1bda1e1a7a34878@mail.gmail.com> <932b2f1f0812022203v71edff23nebf488b7a93fe751@mail.gmail.com> <779bf2730812022251g40103f6fu4eb3bd5a82cb218a@mail.gmail.com> <46b603df0812042228y4a9bae16x818a9230ecc85cc4@mail.gmail.com> <779bf2730812042313k4ea79d29k44835fe01ffa3c27@mail.gmail.com> <932b2f1f0812051248s2871e587ia0885d09b77e109a@mail.gmail.com> Message-ID: <779bf2730812051312i240271b1kbb76b391ce566f78@mail.gmail.com> On Fri, Dec 5, 2008 at 12:48 PM, Robby Findler wrote: > I can look into that at some poitn, but it would be nice to hear more > about the actual problem you're experiencing. Are you finding that > just downloading everything from Chicago is slow? (including, say, the > PLT Scheme mirror for downloading the basic installation)? > No - that's not the issue (although my wan connection is certainly not fast) right now. The issue I am experiencing is that I have a few different versions of PLT Scheme on my computers, and downloading planet packages depend on the language version. So the caching proxy currently has to download the same package multiple times even if the package happens to be the same for the different versions. Without a cryptohash ETag it would require the full download and sha1 to determine whether the file has changed. With ETag & 304 it can be bypassed. Thus, when new PLT versions comes out, my cache doesn't have to download the packages that did not change for the new version. I am simply trying to be a nice net citizen by not hogging more bandwidth than necessary ;) Lastly, in the future if there are others besides me doing local caching, they can also save bandwidth for you ;) Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081205/73e6f142/attachment.htm From rafkind at cs.utah.edu Thu Dec 4 21:42:52 2008 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Thu Mar 26 02:35:24 2009 Subject: [plt-scheme] htdp.org is down Message-ID: <4938952C.5080307@cs.utah.edu> Someone on #scheme noticed that htdp.org shows a blank page. As of 7:42pm MST 12/4 it's still blank. From hendrik at topoi.pooq.com Fri Dec 5 11:35:58 2008 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:35:24 2009 Subject: [plt-scheme] Re: audio in Scheme In-Reply-To: <88906492-CE91-47E5-A4CC-83887240D7DF@knauth.org> References: <88906492-CE91-47E5-A4CC-83887240D7DF@knauth.org> Message-ID: <20081205163558.GA13924@topoi.pooq.com> On Thu, Dec 04, 2008 at 11:25:16AM -0500, Geoffrey S. Knauth wrote: > On Dec 4, 2008, at 11:01, Eli Barzilay wrote: > >BTW#2, the main technical problem with getting a good interface to > >work is obvious: finding the common+practical functionality that can > >be used on Windows/Mac/Linux. Another problem for dealing with the > >"cool" aspect of sounds in a world-like way is that they can eaily be > >much more resource hungry than images. > > There's also the question of notation(s) to support. abc? LilyPond? > MIDI? MusicXML? NeumeXML? Support for music from India, China, Japan, > Indonesia...? > > I wonder if it's possible to layer the functionality to support > different types of sounds and cultural conventions. What you need is the primitives you can use to construct other stuff. The other stuff (like abc, LilyPond, etc.) doesn't have to be built in. Given the primitives, the rest will arrive. -- hendrik From matthias at ccs.neu.edu Sat Dec 6 09:39:28 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:35:24 2009 Subject: [plt-scheme] Re: [plt-edu] FW: graphing language? In-Reply-To: <002601c95679$15915f50$40b41df0$@net> References: <001801c955a9$50aa1e90$f1fe5bb0$@net> <002601c95679$15915f50$40b41df0$@net> Message-ID: On Dec 4, 2008, at 8:30 PM, Renee Ciezki wrote: > By the way, I can't access www.htdp.org Brown had a "melt down" (server, mailing lists and all) and is apparently still down, though thanks to Eli and Matthew we are up and running again with some emergency "re-direction". -- Matthias From sk at cs.brown.edu Sat Dec 6 09:53:55 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:35:24 2009 Subject: [plt-scheme] http://www.htdp.org/ is down In-Reply-To: <756daca50812041922w41d66054g1a9773d9de5844dd@mail.gmail.com> References: <756daca50812041922w41d66054g1a9773d9de5844dd@mail.gmail.com> Message-ID: No, Brown had a total meltdown. That's why you're also seeing the list be eerily quiet. It's all coming back up, slowly. From jos.koot at telefonica.net Sat Dec 6 11:27:58 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:35:24 2009 Subject: [plt-scheme] http://www.htdp.org/ is down References: <756daca50812041922w41d66054g1a9773d9de5844dd@mail.gmail.com> Message-ID: <269DBCA71BCB416FB7444FC3D807E3B9@uw2b2dff239c4d> I get a fully blank page. Jos ----- Original Message ----- From: "Grant Rettke" To: "PLT-Scheme Mailing List" Sent: Friday, December 05, 2008 4:22 AM Subject: [plt-scheme] http://www.htdp.org/ is down > http://www.htdp.org/ is down > > is it just for me? > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From mflatt at cs.utah.edu Sat Dec 6 11:28:14 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:35:24 2009 Subject: [plt-scheme] exception in local variable access from augmented method In-Reply-To: References: Message-ID: <20081206162815.EE8C36500AA@mail-svr1.cs.utah.edu> At Fri, 5 Dec 2008 00:07:51 -0500 (EST), Dimitris Vyzovitis wrote: > I am trying to mutate a local variable from an augmented method, but all I > get is a horrible exception. Here is an example: > (define Frame% > (class frame% > (define foo 0) > (define (can-close?) > (printf "~a~n" foo) > (set! foo (add1 foo)) > #t) > (augment can-close?) > (super-new))) > > (define xx (new Frame% (label "Foo") (width 300) (height 300))) > (send xx show #t) > (yield 'wait) > > > 0 > procedure application: expected procedure, given: 0; arguments were: 0 1 I haven't been able to get that error when running the code above, either under Mac OS X or X11. I put "#lang scheme/gui" at the beginning of the code and tried running in both DrScheme (Module language) and MrEd. I'm assuming that "" means clicking to close the frame. Is there more to the program or a different way I should run it? Matthew From robby at cs.uchicago.edu Sat Dec 6 11:54:54 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:35:24 2009 Subject: [plt-scheme] In-line LaTeX in REPL In-Reply-To: <18744.22380.341174.253274@arabic.ccs.neu.edu> References: <5f07325f0812020943r3c38334ap745bc6dde316fd85@mail.gmail.com> <81addec70812021521l38f50eefq29bba68c0f7e5edf@mail.gmail.com> <18743.9263.232873.628059@arabic.ccs.neu.edu> <493839D6.1070901@soegaard.net> <18744.22380.341174.253274@arabic.ccs.neu.edu> Message-ID: <932b2f1f0812060854g4930964fp292ba2057c966d0@mail.gmail.com> I was waiting for some "here is the parser from a lang line to the reader to use" documentation to show up. Apologies if I missed it. Can you help me find it? Robby On Thu, Dec 4, 2008 at 4:19 PM, Eli Barzilay wrote: > On Dec 4, Jens Axel Soegaard wrote: >> And the I run them I get nice formulas in the REPL. >> >> But! If I enter the following in the REPL >> >> (let ([self @str{\lambda x . x x}]) >> @latex{(@self) (@self)}) >> >> I get the following error from the reader: >> >> read: illegal use of `.' >> >> Should the REPL of the module language use the reader >> specified in the source file? > > Yes, the repl currently just reads plain s-expressions (both drscheme > and mzscheme). The basic functionality to make it use the properties > of the language are there, but someone (*cough*) needs to use it and > implement a layer that will provide these properties. > > -- > ((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 Sat Dec 6 11:55:55 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:35:25 2009 Subject: [plt-scheme] attaching object names to values In-Reply-To: <63bb19ae0812051044n5e6f8bdet11ce1eb403a4d239@mail.gmail.com> References: <63bb19ae0812051044n5e6f8bdet11ce1eb403a4d239@mail.gmail.com> Message-ID: <932b2f1f0812060855g6bd3022k6acf97eaad7dc8c2@mail.gmail.com> I think there isn't one, but if you see how to make one, please let me know. FWIW, provide/contract does a better job than just `contract' and I believe would do what you want. Robby On Fri, Dec 5, 2008 at 12:44 PM, Sam TH wrote: > The contract system uses the `object-name' of predicates to print out > their names in error messages. But this can be useless if the > predicate itself is wrapped in a contract. This program shows the > problem pretty well: > > #lang scheme > > (define x? (contract (-> any/c boolean?) (lambda (x) #t) 'here 'there)) > > (define my/c (-> x? x?)) > > (contract my/c 5 'foo 'bar) > > > It gives a contract error referencing "unsaved-editorx:y:z", instead > of "x?". Unfortunately, there seems to be nothing that I can do to > change the object-name of the contract value (except eta-expand). > Notably, the inferred-name syntax property doesn't work, since the > actual lambda expression isn't available (it's in the contract > library). Is there a solution here I'm missing? > > Thanks, > -- > sam th > samth@ccs.neu.edu > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From vyzo at media.mit.edu Sat Dec 6 12:42:10 2008 From: vyzo at media.mit.edu (Dimitris Vyzovitis) Date: Thu Mar 26 02:35:25 2009 Subject: [plt-scheme] exception in local variable access from augmented method In-Reply-To: <20081206162815.EE8C36500AA@mail-svr1.cs.utah.edu> References: <20081206162815.EE8C36500AA@mail-svr1.cs.utah.edu> Message-ID: On Sat, 6 Dec 2008, Matthew Flatt wrote: > At Fri, 5 Dec 2008 00:07:51 -0500 (EST), Dimitris Vyzovitis wrote: >> I am trying to mutate a local variable from an augmented method, but all I >> get is a horrible exception. Here is an example: >> (define Frame% >> (class frame% >> (define foo 0) >> (define (can-close?) >> (printf "~a~n" foo) >> (set! foo (add1 foo)) >> #t) >> (augment can-close?) >> (super-new))) >> >> (define xx (new Frame% (label "Foo") (width 300) (height 300))) >> (send xx show #t) >> (yield 'wait) >> >> >> 0 >> procedure application: expected procedure, given: 0; arguments were: 0 1 > > I haven't been able to get that error when running the code above, > either under Mac OS X or X11. I put "#lang scheme/gui" at the beginning > of the code and tried running in both DrScheme (Module language) and > MrEd. I'm assuming that "" means clicking to close the frame. yes. I am running with 'mred -iqz', X11 > > Is there more to the program or a different way I should run it? Aha, there is: there was a set! replacement that was loaded that I forgot was there. The said set! replacement does expand to the built-in set! (of course) and in general has worked for me as expected -- expect when I try to mutate local variables inside lifted class methods (it happens with override as well, not just augment). So, after some digging, the problem is coming from the set!-transformer expansion; here is a distilled version that triggers the problem: (module test scheme/base (require (for-syntax scheme/base)) (provide (rename-out (~set! set!))) (define-syntax (~set! stx) (syntax-case stx () ((_ tgt v) (and (identifier? #'tgt) (set!-transformer? (syntax-local-value #'tgt (lambda () #f)))) ((set!-transformer-procedure (syntax-local-value #'tgt)) stx)) ((_ tgt v) (datum->syntax stx (syntax-e #'(set! tgt v))))))) (require 'test) (define Frame% ...) ; as before (define xx (new Frame% (label "Foo") (width 300) (height 300))) (send xx show #t) (yield 'wait) ; close the window 0 procedure application: expected procedure, given: 0; arguments were: 0 1 It seems the culprit here is the set! renaming breaking the transformer syntax-id-rules (they match with free-identifier=?, don't they?) -- vyzo From vyzo at media.mit.edu Sat Dec 6 12:46:14 2008 From: vyzo at media.mit.edu (Dimitris Vyzovitis) Date: Thu Mar 26 02:35:25 2009 Subject: [plt-scheme] exception in local variable access from augmented method In-Reply-To: References: <20081206162815.EE8C36500AA@mail-svr1.cs.utah.edu> Message-ID: On Sat, 6 Dec 2008, Dimitris Vyzovitis wrote: > On Sat, 6 Dec 2008, Matthew Flatt wrote: > ((_ tgt v) > (datum->syntax stx (syntax-e #'(set! tgt v))))))) this is a useless part (from debugging), should be just #'(set! tgt v) -- vyzo From mflatt at cs.utah.edu Sat Dec 6 12:54:57 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:35:25 2009 Subject: [plt-scheme] exception in local variable access from augmented method In-Reply-To: References: <20081206162815.EE8C36500AA@mail-svr1.cs.utah.edu> Message-ID: <20081206175458.E1F126500B1@mail-svr1.cs.utah.edu> At Sat, 6 Dec 2008 12:42:10 -0500 (EST), Dimitris Vyzovitis wrote: > (define-syntax (~set! stx) > (syntax-case stx () > ((_ tgt v) > (and (identifier? #'tgt) > (set!-transformer? (syntax-local-value #'tgt (lambda () #f)))) > ((set!-transformer-procedure (syntax-local-value #'tgt)) stx)) > > [...] > > > It seems the culprit here is the set! renaming breaking the transformer > syntax-id-rules (they match with free-identifier=?, don't they?) Yes, that's right. The transformer procedure is expecting a syntax object that matches (set! id ....) ; where `set!' is free-identifier=? to the usual one but it's getting an object that matches (~set! id ....) ; where `~set!' is not free-identifier=? to `set!' In other words, you're breaking a contract (that should be) on the procedure of a `set!-transformer'. For the particular transformer procedure inside the class system, since the `set!' pattern doesn't match, the transformer assumes that it must be getting a pattern of the form `(id ....)', and so it expands to a procedure application. Matthew From vyzo at media.mit.edu Sat Dec 6 13:26:52 2008 From: vyzo at media.mit.edu (Dimitris Vyzovitis) Date: Thu Mar 26 02:35:25 2009 Subject: [plt-scheme] exception in local variable access from augmented method In-Reply-To: <20081206175458.E1F126500B1@mail-svr1.cs.utah.edu> References: <20081206162815.EE8C36500AA@mail-svr1.cs.utah.edu> <20081206175458.E1F126500B1@mail-svr1.cs.utah.edu> Message-ID: On Sat, 6 Dec 2008, Matthew Flatt wrote: > At Sat, 6 Dec 2008 12:42:10 -0500 (EST), Dimitris Vyzovitis wrote: >> (define-syntax (~set! stx) >> (syntax-case stx () >> ((_ tgt v) >> (and (identifier? #'tgt) >> (set!-transformer? (syntax-local-value #'tgt (lambda () #f)))) >> ((set!-transformer-procedure (syntax-local-value #'tgt)) stx)) >> >> [...] >> >> >> It seems the culprit here is the set! renaming breaking the transformer >> syntax-id-rules (they match with free-identifier=?, don't they?) > > Yes, that's right. The transformer procedure is expecting a syntax > object that matches > > (set! id ....) ; where `set!' is free-identifier=? to the usual one > > but it's getting an object that matches > > (~set! id ....) ; where `~set!' is not free-identifier=? to `set!' > > In other words, you're breaking a contract (that should be) on the > procedure of a `set!-transformer'. So what is a custom set! expander to do here? It cannot judge smudge the syntax to use the built-in set! by passing #'(set! tgt v), since the transformer may be from a context where set! is itself (the custom expander) and/or does a recursive expansion. Even if the aforementioned contract is 'all set!-transformers shall receive #%kernel set! to denote mutator expansion', things will still break; the set!-transformer is passed through but then syntax-id-rules written with the new set! breaks in the lower layer. > > For the particular transformer procedure inside the class system, since > the `set!' pattern doesn't match, the transformer assumes that it must > be getting a pattern of the form `(id ....)', and so it expands to a > procedure application. So, why isn't this the fault of the class systems set!-transformer? It lifts code out of user code, so by matching the builtin set! (and not the context's set!) it changes the semantics of the lifted code. In a sense it breaks a contract by not respecting the context specific set! [modulo the elusive 'set!-transformer contract'] -- vyzo From mflatt at cs.utah.edu Sat Dec 6 13:38:59 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:35:25 2009 Subject: [plt-scheme] exception in local variable access from augmented method In-Reply-To: References: <20081206162815.EE8C36500AA@mail-svr1.cs.utah.edu> <20081206175458.E1F126500B1@mail-svr1.cs.utah.edu> Message-ID: <20081206183901.0A61865008C@mail-svr1.cs.utah.edu> At Sat, 6 Dec 2008 13:26:52 -0500 (EST), Dimitris Vyzovitis wrote: > On Sat, 6 Dec 2008, Matthew Flatt wrote: > > > At Sat, 6 Dec 2008 12:42:10 -0500 (EST), Dimitris Vyzovitis wrote: > >> (define-syntax (~set! stx) > >> (syntax-case stx () > >> ((_ tgt v) > >> (and (identifier? #'tgt) > >> (set!-transformer? (syntax-local-value #'tgt (lambda () #f)))) > >> ((set!-transformer-procedure (syntax-local-value #'tgt)) stx)) > >> > >> [...] > >> > >> > >> It seems the culprit here is the set! renaming breaking the transformer > >> syntax-id-rules (they match with free-identifier=?, don't they?) > > > > Yes, that's right. The transformer procedure is expecting a syntax > > object that matches > > > > (set! id ....) ; where `set!' is free-identifier=? to the usual one > > > > but it's getting an object that matches > > > > (~set! id ....) ; where `~set!' is not free-identifier=? to `set!' > > > > In other words, you're breaking a contract (that should be) on the > > procedure of a `set!-transformer'. > > So what is a custom set! expander to do here? It cannot judge smudge the > syntax to use the built-in set! by passing #'(set! tgt v), Yes, it should. > since the > transformer may be from a context where set! is itself (the > custom expander) and/or does a recursive expansion. No, `set!' transformers are called at the point where the normal `set!' is expanded. If a different `set!' wants to cooperate with transformers different from ones that expect `set!', then it should introduce its own kind of transformer (e.g., `make-~set!-transformer'). > > For the particular transformer procedure inside the class system, since > > the `set!' pattern doesn't match, the transformer assumes that it must > > be getting a pattern of the form `(id ....)', and so it expands to a > > procedure application. > > So, why isn't this the fault of the class systems set!-transformer? Because it's intended to have a contract that allows only `set!' (the usual one) expressions, applications of the transformer's identifier, and the transformer's identifier by itself. > It > lifts code out of user code, so by matching the builtin set! (and not > the context's set!) it changes the semantics of the lifted code. In a > sense it breaks a contract by not respecting the context specific set! > [modulo the elusive 'set!-transformer contract'] Hopefully it's clearer now that a transformer created with `make-set!-transformer' is intended (by the caller of `make-set!-transformer) to work specifically with the usual `set!'. We don't currently have anything like `make-set!-transformer' that is intended to work with context-specific notions of `set!'. Matthew From vyzo at media.mit.edu Sat Dec 6 14:02:52 2008 From: vyzo at media.mit.edu (Dimitris Vyzovitis) Date: Thu Mar 26 02:35:26 2009 Subject: [plt-scheme] exception in local variable access from augmented method In-Reply-To: <20081206183901.0A61865008C@mail-svr1.cs.utah.edu> References: <20081206162815.EE8C36500AA@mail-svr1.cs.utah.edu> <20081206175458.E1F126500B1@mail-svr1.cs.utah.edu> <20081206183901.0A61865008C@mail-svr1.cs.utah.edu> Message-ID: On Sat, 6 Dec 2008, Matthew Flatt wrote: >> So what is a custom set! expander to do here? It cannot judge smudge the >> syntax to use the built-in set! by passing #'(set! tgt v), > > Yes, it should. Ok - or perhaps just ignore the set!-transformers altogether and pass them through in the default expansion to set!. > Hopefully it's clearer now that a transformer created with > `make-set!-transformer' is intended (by the caller of > `make-set!-transformer) to work specifically with the usual `set!'. Yes, thank you. > We > don't currently have anything like `make-set!-transformer' that is > intended to work with context-specific notions of `set!'. > I guess syntax-id-rules can be coaxed to do the job by explicitly requiring the builtin set! to use as a keyword. -- vyzo From eli at barzilay.org Sat Dec 6 15:31:33 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:35:26 2009 Subject: [plt-scheme] In-line LaTeX in REPL In-Reply-To: <932b2f1f0812060854g4930964fp292ba2057c966d0@mail.gmail.com> References: <5f07325f0812020943r3c38334ap745bc6dde316fd85@mail.gmail.com> <81addec70812021521l38f50eefq29bba68c0f7e5edf@mail.gmail.com> <18743.9263.232873.628059@arabic.ccs.neu.edu> <493839D6.1070901@soegaard.net> <18744.22380.341174.253274@arabic.ccs.neu.edu> <932b2f1f0812060854g4930964fp292ba2057c966d0@mail.gmail.com> Message-ID: <18746.57637.443367.573393@arabic.ccs.neu.edu> On Dec 6, Robby Findler wrote: > I was waiting for some "here is the parser from a lang line to the > reader to use" documentation to show up. Apologies if I missed > it. Can you help me find it? It's not there yet. When it's there, it will roughly have two flavors: get a property for the language in a port, or for the language in a bytecode file. > On Thu, Dec 4, 2008 at 4:19 PM, Eli Barzilay wrote: > > On Dec 4, Jens Axel Soegaard wrote: > >> And the I run them I get nice formulas in the REPL. > >> > >> But! If I enter the following in the REPL > >> > >> (let ([self @str{\lambda x . x x}]) > >> @latex{(@self) (@self)}) > >> > >> I get the following error from the reader: > >> > >> read: illegal use of `.' > >> > >> Should the REPL of the module language use the reader > >> specified in the source file? > > > > Yes, the repl currently just reads plain s-expressions (both drscheme > > and mzscheme). The basic functionality to make it use the properties > > of the language are there, but someone (*cough*) needs to use it and > > implement a layer that will provide these properties. > > > > -- > > ((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 > > > > -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From shimoco at gmail.com Sat Dec 6 00:16:46 2008 From: shimoco at gmail.com (skc) Date: Thu Mar 26 02:35:26 2009 Subject: [plt-scheme] Re: PLT Scheme v4.1.3 In-Reply-To: <200811211554.mALFsASw005702@winooski.ccs.neu.edu> References: <200811211554.mALFsASw005702@winooski.ccs.neu.edu> Message-ID: Hi Now plt-web-server ignore the configuration table pointed by the -f command line option. regards, Shimon. On Nov 21, 5:54 pm, Eli Barzilay wrote: > PLT Scheme version 4.1.3 is now available from > > http://plt-scheme.org/ > > This is mostly a bug-fix release. > > Notable changes: > > * Web Server: > - Documentation rewritten to separate servlet APIs and server > extension APIs > - HTTPS supported on the "plt-web-server" command-line with "--ssl" > option > - Stateless servlets supported in default configuration through > 'stateless interface-version > - `web-server/servlet-env' supports top-level servlets through > #:servlet-path > - Servlets are served from anywhere in the htdocs directory by > default > - A template system based on the Scribble syntax has been added, see > web-server/templates in the documentation > And many other internal modifications to make extension easier! > > [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! > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From lunarc.lists at gmail.com Sat Dec 6 17:16:09 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:35:26 2009 Subject: [plt-scheme] Faster CGI Message-ID: I am looking for a way to serve many small sites (for 1-2 week school projects) running servlets in Scheme. In the past I have been using PHP, since it is very easy to deploy because of the built-in functionality provided by the hosting company. I would really prefer to use Scheme, though. The PLT Web Server seems to use too much memory for a shared hosting environment (they start to complain when I break ~80MiB). Using the PLT Web Server also makes me either use one instance per site (again giving memory issues), or mess with my the configuration for each new site I put up. (with CGI and PHP I only need to do the configuration in one place: my host's control panel). I like to play around with lots of small sites, often for 1-2 week school projects which get left up permanently afterwards, so this gets a little awkward. I want to make sure it's clear that I'm not complaining about the PLT Web Server, I just don't think it was designed with a use like mine in mind. Please correct me if you disagree. CGI scripts, on the other hand, are very easy to deploy, and take no memory when not in use, but are too slow because of the start-up time. The lack of persistent continuations is not a problem for me, since I am not planning to make use of that feature in these small projects. I'm thinking that I could implement a Scheme 'launcher', to avoid the servlet startup cost. The launcher would accept signals containing a filename, and would use dynamic-require to run a specific function of that module in a separate thread. Then, the #! line in my servlets would invoke a command to send a message to this launcher. Given that the modules could use parameters instead of global variables, this doesn't sound difficult to me. On the other hand, it sounds like part of the PLT Web Server's purpose is to implement something similar, so would I end up with similar memory issues? Alternatively, I have heard of a FastCGI interface for Scheme, but haven't actually seen anything concrete. Does anyone know more? Henk From samth at ccs.neu.edu Sat Dec 6 17:57:32 2008 From: samth at ccs.neu.edu (Sam TH) Date: Thu Mar 26 02:35:26 2009 Subject: [plt-scheme] attaching object names to values In-Reply-To: <932b2f1f0812060855g6bd3022k6acf97eaad7dc8c2@mail.gmail.com> References: <63bb19ae0812051044n5e6f8bdet11ce1eb403a4d239@mail.gmail.com> <932b2f1f0812060855g6bd3022k6acf97eaad7dc8c2@mail.gmail.com> Message-ID: <63bb19ae0812061457x76f10fc6p73d0aba7e5920f2f@mail.gmail.com> On Sat, Dec 6, 2008 at 11:55 AM, Robby Findler wrote: > I think there isn't one, but if you see how to make one, please let me know. It seems like a procedure that just changes the `object-name' of value would be valuable. > FWIW, provide/contract does a better job than just `contract' and I > believe would do what you want. Unfortunately, this is in the implementation of a `require/contract' form, so I can't use `provide/contract'. Thanks, sam th > > Robby > > On Fri, Dec 5, 2008 at 12:44 PM, Sam TH wrote: >> The contract system uses the `object-name' of predicates to print out >> their names in error messages. But this can be useless if the >> predicate itself is wrapped in a contract. This program shows the >> problem pretty well: >> >> #lang scheme >> >> (define x? (contract (-> any/c boolean?) (lambda (x) #t) 'here 'there)) >> >> (define my/c (-> x? x?)) >> >> (contract my/c 5 'foo 'bar) >> >> >> It gives a contract error referencing "unsaved-editorx:y:z", instead >> of "x?". Unfortunately, there seems to be nothing that I can do to >> change the object-name of the contract value (except eta-expand). >> Notably, the inferred-name syntax property doesn't work, since the >> actual lambda expression isn't available (it's in the contract >> library). Is there a solution here I'm missing? >> >> Thanks, >> -- >> sam th >> samth@ccs.neu.edu >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> > -- sam th samth@ccs.neu.edu From robby at cs.uchicago.edu Sat Dec 6 18:06:45 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:35:26 2009 Subject: [plt-scheme] attaching object names to values In-Reply-To: <63bb19ae0812061457x76f10fc6p73d0aba7e5920f2f@mail.gmail.com> References: <63bb19ae0812051044n5e6f8bdet11ce1eb403a4d239@mail.gmail.com> <932b2f1f0812060855g6bd3022k6acf97eaad7dc8c2@mail.gmail.com> <63bb19ae0812061457x76f10fc6p73d0aba7e5920f2f@mail.gmail.com> Message-ID: <932b2f1f0812061506h117aa45doe2d617cadf004b2e@mail.gmail.com> require/contract is given a name tho, isn't it? Why not use that name? Robby On Sat, Dec 6, 2008 at 4:57 PM, Sam TH wrote: > On Sat, Dec 6, 2008 at 11:55 AM, Robby Findler wrote: >> I think there isn't one, but if you see how to make one, please let me know. > > It seems like a procedure that just changes the `object-name' of value > would be valuable. > >> FWIW, provide/contract does a better job than just `contract' and I >> believe would do what you want. > > Unfortunately, this is in the implementation of a `require/contract' > form, so I can't use `provide/contract'. > > Thanks, > sam th > >> >> Robby >> >> On Fri, Dec 5, 2008 at 12:44 PM, Sam TH wrote: >>> The contract system uses the `object-name' of predicates to print out >>> their names in error messages. But this can be useless if the >>> predicate itself is wrapped in a contract. This program shows the >>> problem pretty well: >>> >>> #lang scheme >>> >>> (define x? (contract (-> any/c boolean?) (lambda (x) #t) 'here 'there)) >>> >>> (define my/c (-> x? x?)) >>> >>> (contract my/c 5 'foo 'bar) >>> >>> >>> It gives a contract error referencing "unsaved-editorx:y:z", instead >>> of "x?". Unfortunately, there seems to be nothing that I can do to >>> change the object-name of the contract value (except eta-expand). >>> Notably, the inferred-name syntax property doesn't work, since the >>> actual lambda expression isn't available (it's in the contract >>> library). Is there a solution here I'm missing? >>> >>> Thanks, >>> -- >>> sam th >>> samth@ccs.neu.edu >>> _________________________________________________ >>> For list-related administrative tasks: >>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>> >>> >> > > > > -- > sam th > samth@ccs.neu.edu > > From samth at ccs.neu.edu Sat Dec 6 18:18:08 2008 From: samth at ccs.neu.edu (Sam TH) Date: Thu Mar 26 02:35:26 2009 Subject: [plt-scheme] attaching object names to values In-Reply-To: <932b2f1f0812061506h117aa45doe2d617cadf004b2e@mail.gmail.com> References: <63bb19ae0812051044n5e6f8bdet11ce1eb403a4d239@mail.gmail.com> <932b2f1f0812060855g6bd3022k6acf97eaad7dc8c2@mail.gmail.com> <63bb19ae0812061457x76f10fc6p73d0aba7e5920f2f@mail.gmail.com> <932b2f1f0812061506h117aa45doe2d617cadf004b2e@mail.gmail.com> Message-ID: <63bb19ae0812061518q647a8957pdd9c3cc23755afc5@mail.gmail.com> On Sat, Dec 6, 2008 at 6:06 PM, Robby Findler wrote: > require/contract is given a name tho, isn't it? Why not use that name? That's what I'm trying to figure out how to do. Is there some way to pass the name to the contract constructors? Would that work even though the contract is an arbitrary expression? Thanks again, sam th > > Robby > > On Sat, Dec 6, 2008 at 4:57 PM, Sam TH wrote: >> On Sat, Dec 6, 2008 at 11:55 AM, Robby Findler wrote: >>> I think there isn't one, but if you see how to make one, please let me know. >> >> It seems like a procedure that just changes the `object-name' of value >> would be valuable. >> >>> FWIW, provide/contract does a better job than just `contract' and I >>> believe would do what you want. >> >> Unfortunately, this is in the implementation of a `require/contract' >> form, so I can't use `provide/contract'. >> >> Thanks, >> sam th >> >>> >>> Robby >>> >>> On Fri, Dec 5, 2008 at 12:44 PM, Sam TH wrote: >>>> The contract system uses the `object-name' of predicates to print out >>>> their names in error messages. But this can be useless if the >>>> predicate itself is wrapped in a contract. This program shows the >>>> problem pretty well: >>>> >>>> #lang scheme >>>> >>>> (define x? (contract (-> any/c boolean?) (lambda (x) #t) 'here 'there)) >>>> >>>> (define my/c (-> x? x?)) >>>> >>>> (contract my/c 5 'foo 'bar) >>>> >>>> >>>> It gives a contract error referencing "unsaved-editorx:y:z", instead >>>> of "x?". Unfortunately, there seems to be nothing that I can do to >>>> change the object-name of the contract value (except eta-expand). >>>> Notably, the inferred-name syntax property doesn't work, since the >>>> actual lambda expression isn't available (it's in the contract >>>> library). Is there a solution here I'm missing? >>>> >>>> Thanks, >>>> -- >>>> sam th >>>> samth@ccs.neu.edu >>>> _________________________________________________ >>>> For list-related administrative tasks: >>>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>>> >>>> >>> >> >> >> >> -- >> sam th >> samth@ccs.neu.edu >> >> > -- sam th samth@ccs.neu.edu From robby at cs.uchicago.edu Sat Dec 6 18:47:43 2008 From: robby at cs.uchicago.edu (robby@cs.uchicago.edu) Date: Thu Mar 26 02:35:27 2009 Subject: [plt-scheme] attaching object names to values In-Reply-To: <63bb19ae0812061518q647a8957pdd9c3cc23755afc5@mail.gmail.com> References: <63bb19ae0812051044n5e6f8bdet11ce1eb403a4d239@mail.gmail.com> <932b2f1f0812060855g6bd3022k6acf97eaad7dc8c2@mail.gmail.com> <63bb19ae0812061457x76f10fc6p73d0aba7e5920f2f@mail.gmail.com> <932b2f1f0812061506h117aa45doe2d617cadf004b2e@mail.gmail.com> <63bb19ae0812061518q647a8957pdd9c3cc23755afc5@mail.gmail.com> Message-ID: <932b2f1f0812061547q7352ed22u61c4d0b1b4ab1d8b@mail.gmail.com> It should work to put a let around the contract itself. Robby On 12/6/08, Sam TH wrote: > On Sat, Dec 6, 2008 at 6:06 PM, Robby Findler wrote: >> require/contract is given a name tho, isn't it? Why not use that name? > > That's what I'm trying to figure out how to do. Is there some way to > pass the name to the contract constructors? Would that work even > though the contract is an arbitrary expression? > > Thanks again, > sam th > >> >> Robby >> >> On Sat, Dec 6, 2008 at 4:57 PM, Sam TH wrote: >>> On Sat, Dec 6, 2008 at 11:55 AM, Robby Findler >>> wrote: >>>> I think there isn't one, but if you see how to make one, please let me >>>> know. >>> >>> It seems like a procedure that just changes the `object-name' of value >>> would be valuable. >>> >>>> FWIW, provide/contract does a better job than just `contract' and I >>>> believe would do what you want. >>> >>> Unfortunately, this is in the implementation of a `require/contract' >>> form, so I can't use `provide/contract'. >>> >>> Thanks, >>> sam th >>> >>>> >>>> Robby >>>> >>>> On Fri, Dec 5, 2008 at 12:44 PM, Sam TH wrote: >>>>> The contract system uses the `object-name' of predicates to print out >>>>> their names in error messages. But this can be useless if the >>>>> predicate itself is wrapped in a contract. This program shows the >>>>> problem pretty well: >>>>> >>>>> #lang scheme >>>>> >>>>> (define x? (contract (-> any/c boolean?) (lambda (x) #t) 'here 'there)) >>>>> >>>>> (define my/c (-> x? x?)) >>>>> >>>>> (contract my/c 5 'foo 'bar) >>>>> >>>>> >>>>> It gives a contract error referencing "unsaved-editorx:y:z", instead >>>>> of "x?". Unfortunately, there seems to be nothing that I can do to >>>>> change the object-name of the contract value (except eta-expand). >>>>> Notably, the inferred-name syntax property doesn't work, since the >>>>> actual lambda expression isn't available (it's in the contract >>>>> library). Is there a solution here I'm missing? >>>>> >>>>> Thanks, >>>>> -- >>>>> sam th >>>>> samth@ccs.neu.edu >>>>> _________________________________________________ >>>>> For list-related administrative tasks: >>>>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>>>> >>>>> >>>> >>> >>> >>> >>> -- >>> sam th >>> samth@ccs.neu.edu >>> >>> >> > > > > -- > sam th > samth@ccs.neu.edu > > From kumar_lista at mac.com Sat Dec 6 22:07:16 2008 From: kumar_lista at mac.com (kumar) Date: Thu Mar 26 02:35:27 2009 Subject: [plt-scheme] Two questions regarding scribble .. Message-ID: <65EF7DE0-7A42-4E14-80D4-0E0D3DE03740@mac.com> Hi guys, Scribble is awesomely convenient for generating documentation containing lots of scheme examples. I'm stuck on two aspects though - 1. How do I do tables in scribble? 2. How do I get the search box to work when the generated documentation is installed independent of a plt-installation? Basically, I think this means "how do I generate the index?". I *have* looked at the documentation and didn't find any notes on these topics. Thanks for all the great stuff :) -Kumar From neil at neilvandyke.org Sun Dec 7 05:20:22 2008 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:35:27 2009 Subject: [plt-scheme] default file for planet shorthand "require"s, other than "main.ss" Message-ID: <493BA366.7050903@neilvandyke.org> For the shorthand form of "planet" "require", which currently permits the file name to default to "main.ss", would it be possible to make that default to a file specified in "info.ss" (e.g., the existing "primary-file" field)? I think it's the usual case that we want a default file, but it's also the usual case (at least when editing multiple PLaneT packages in Emacs simultaneously), that we want to name the default files something other than "main.ss". -- http://www.neilvandyke.org/ From mflatt at cs.utah.edu Sun Dec 7 08:41:02 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:35:27 2009 Subject: [plt-scheme] default file for planet shorthand "require"s, other than "main.ss" In-Reply-To: <493BA366.7050903@neilvandyke.org> References: <493BA366.7050903@neilvandyke.org> Message-ID: <20081207134105.69E006500B7@mail-svr1.cs.utah.edu> At Sun, 07 Dec 2008 05:20:22 -0500, Neil Van Dyke wrote: > For the shorthand form of "planet" "require", which currently permits > the file name to default to "main.ss", would it be possible to make that > default to a file specified in "info.ss" (e.g., the existing > "primary-file" field)? It's possible, and it sounds easy, but I think it would create new problems for tracking compilation dependencies and managing bytecode. I can't quite put my finger on what could go wrong, but this change would be something like adding a search path, and search paths always seem to create trouble. > I think it's the usual case that we want a default file, but it's also > the usual case (at least when editing multiple PLaneT packages in Emacs > simultaneously), that we want to name the default files something other > than "main.ss". I see what you mean, but how about treating "main.ss" like "info.ss"? That is, just have it re-export the content of whatever module you'd rather have been the main module: #lang scheme/base (require "actual-main.ss") (provide (all-from-out "actual-main.ss")) Instead of putting the mapping in "info.ss", this pushes the indirection all the way down into the module system. I think that's why it works better than trying to manage the indirection at the "info.ss" layer. Matthew From mflatt at cs.utah.edu Sun Dec 7 08:50:27 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:35:27 2009 Subject: [plt-scheme] Two questions regarding scribble .. In-Reply-To: <65EF7DE0-7A42-4E14-80D4-0E0D3DE03740@mac.com> References: <65EF7DE0-7A42-4E14-80D4-0E0D3DE03740@mac.com> Message-ID: <20081207135029.E6F1A6500AE@mail-svr1.cs.utah.edu> At Sun, 07 Dec 2008 11:07:16 +0800, kumar wrote: > Scribble is awesomely convenient for generating > documentation containing lots of scheme examples. > I'm stuck on two aspects though - > > 1. How do I do tables in scribble? Currently, the only way is to use `make-table' to create a `table' struct directly. Here are some examples in the PLT tree: collects/eopl/eopl.scrbl collects/net/scribblings/imap.scrbl collects/scribblings/drscheme/printing.scrbl There should be a higher-level `table' function in `scribble/manual', but we haven't yet gotten around to adding one. > 2. How do I get the search box to work when the generated > documentation is installed independent of a plt-installation? > Basically, I think this means "how do I generate the index?". I don't think we have a good answer to this one. The search page is currently built as a separate installed document, and it works by processing the cross-reference information of all other documents. Probably we should make that process work over a given set of documents, so that you could build your own search pages. Meanwhile, you can use `index-section' to generate a conventional index. You get hyperlinks for index entries, but not a search box. Matthew From jensaxel at soegaard.net Sun Dec 7 17:49:23 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:35:27 2009 Subject: [plt-scheme] Units and macros Message-ID: <493C52F3.7000603@soegaard.net> Hi all, Below the macro with-ring doesn't give the result I want. The macros with-ring-ver2 and with-ring-ver3 give the correct result, but are actually correct? /Jens Axel #lang scheme (provide ring^) (define-signature ring^ (member? inj zero zero? one one? + * =)) (require (prefix-in mz: scheme)) (define (make-Zn@ n) (unit (import) (export ring^) (define member? integer?) (define (inj z) (unless (integer? z) (error)) (modulo z n)) (define zero 0) (define (zero? o) (and (integer? o) (mz:= o 0))) (define one 1) (define (one? o) (and (integer? o) (mz:= o 1))) (define (+ a b) (modulo (mz:+ a b) n)) (define (* a b) (modulo (mz:* a b) n)) (define = mz:=))) (define Z5@ (make-Zn@ 5)) (let () (define-values/invoke-unit Z5@ (import) (export ring^)) (+ 5 2)) ; => 2 (define-syntax (with-ring stx) (syntax-case stx () [(_ ring-unit expr ...) #'(let () (define-values/invoke-unit ring-unit (import) (export ring^)) expr ...)])) (with-ring Z5@ (+ 5 2)) ;=> 7 ; but expected 2 (define-syntax (with-ring-ver2 stx) (syntax-case stx () [(_ ring-unit expr ...) #`(let () #,(syntax-local-introduce #'(define-values/invoke-unit ring-unit (import) (export ring^))) expr ...)])) (with-ring-ver2 Z5@ (+ 5 2)) ;=> 0 as expected (define-syntax (with-ring-ver3 stx) (syntax-case stx () [(_ ring-unit expr ...) #`(let () (define-values/invoke-unit ring-unit (import) (export ring^)) #,@(syntax-local-introduce #'(expr ...)))])) (with-ring-ver3 Z5@ (+ 5 2)) ;=> 0 as expected From jensaxel at soegaard.net Sun Dec 7 18:35:46 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:35:27 2009 Subject: [plt-scheme] Macros and define-package Message-ID: <493C5DD2.1050304@soegaard.net> I was playing around with the scheme/package from todays svn-build. Is it possible to modify define-Zn below, so that open-package can recognize the identifer later on? /Jens Axel S?gaard #lang scheme (require scheme/package (prefix-in mz: scheme)) #;(define-package Z5 (+ *) (define (+ a b) (modulo (mz:+ a b) 5)) (define (* a b) (modulo (mz:* a b) 5))) (define-syntax (define-Zn stx) (syntax-case stx () [(_ pkg-id n-expr) #`(let ([n n-expr]) (define-package pkg-id (+ *) (define (+ a b) (modulo (mz:+ a b) n)) (define (* a b) (modulo (mz:* a b) n))) (void))])) (define-Zn Z5 5) (+ 5 2) (let () (open-package Z5) ; open-package: identifier is not bound to a package in: Z5 (+ 5 2)) (+ 5 2) From czhu at cs.utah.edu Sun Dec 7 18:37:35 2008 From: czhu at cs.utah.edu (Chongkai Zhu) Date: Thu Mar 26 02:35:28 2009 Subject: [plt-scheme] Units and macros In-Reply-To: <493C52F3.7000603@soegaard.net> References: <493C52F3.7000603@soegaard.net> Message-ID: <493C5E3F.3060201@cs.utah.edu> As suggested my Matthew, only syntax-local-introduce the export signature: (define-syntax (with-ring stx) (syntax-case stx () [(_ ring-unit expr ...) #`(let () (define-values/invoke-unit ring-unit (import) (export #,(syntax-local-introduce #'ring^))) expr ...)])) Chongkai Jens Axel Soegaard wrote: > Hi all, > > Below the macro with-ring doesn't give the result I want. > The macros with-ring-ver2 and with-ring-ver3 give the > correct result, but are actually correct? > > /Jens Axel > > From mflatt at cs.utah.edu Sun Dec 7 18:53:22 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:35:28 2009 Subject: [plt-scheme] Units and macros In-Reply-To: <493C5E3F.3060201@cs.utah.edu> References: <493C52F3.7000603@soegaard.net> <493C5E3F.3060201@cs.utah.edu> Message-ID: <20081207235324.263D06500B2@mail-svr1.cs.utah.edu> Right. This is a change from an earlier version of the unit system, where the identifiers in the signature were introduced as bindings by `define-values/invoke-unit' independent of the way that the signature identifier itself might bind. Now, the way that the signature identifier would bind is propagates to the components of the signature. http://list.cs.brown.edu/pipermail/plt-scheme/2008-October/027663.html At Sun, 07 Dec 2008 16:37:35 -0700, Chongkai Zhu wrote: > As suggested my Matthew, only syntax-local-introduce the export signature: > > (define-syntax (with-ring stx) > (syntax-case stx () > [(_ ring-unit expr ...) > #`(let () > (define-values/invoke-unit ring-unit > (import) (export #,(syntax-local-introduce #'ring^))) > expr ...)])) > > Chongkai > > > Jens Axel Soegaard wrote: > > Hi all, > > > > Below the macro with-ring doesn't give the result I want. > > The macros with-ring-ver2 and with-ring-ver3 give the > > correct result, but are actually correct? > > > > /Jens Axel > > > > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From mflatt at cs.utah.edu Sun Dec 7 19:01:23 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:35:28 2009 Subject: [plt-scheme] Macros and define-package In-Reply-To: <493C5DD2.1050304@soegaard.net> References: <493C5DD2.1050304@soegaard.net> Message-ID: <20081208000124.99F236500B2@mail-svr1.cs.utah.edu> At Mon, 08 Dec 2008 00:35:46 +0100, Jens Axel Soegaard wrote: > (define-syntax (define-Zn stx) > (syntax-case stx () > [(_ pkg-id n-expr) > #`(let ([n n-expr]) > (define-package pkg-id (+ *) > (define (+ a b) (modulo (mz:+ a b) n)) > (define (* a b) (modulo (mz:* a b) n))) > (void))])) One problem is that `define-package' is like any other definition form: if you put it under `let', then it's not visible outside the `let' form. Another issue is that this macro introduces `+' and `*' bindings, so by the usual scoping rules, they're not visible to expressions that weren't also introduced by the macro. One solution is to introduce them non-hygienically: (define-syntax (define-Zn stx) (syntax-case stx () [(_ pkg-id n-expr) (with-syntax ([+ (datum->syntax #'pkg-id '+)] [* (datum->syntax #'pkg-id '*)]) #`(define-package pkg-id (+ *) (define n n-expr) (define (+ a b) (modulo (mz:+ a b) n)) (define (* a b) (modulo (mz:* a b) n))))])) Matthew From grettke at acm.org Sun Dec 7 21:58:30 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:35:28 2009 Subject: [plt-scheme] htdp.org is up now Message-ID: <756daca50812071858r4508221s420387a9b345e609@mail.gmail.com> htdp.org is up now From eli at barzilay.org Sun Dec 7 22:13:39 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:35:28 2009 Subject: [plt-scheme] htdp.org is up now In-Reply-To: <756daca50812071858r4508221s420387a9b345e609@mail.gmail.com> References: <756daca50812071858r4508221s420387a9b345e609@mail.gmail.com> Message-ID: <18748.37091.302078.783355@arabic.ccs.neu.edu> On Dec 7, Grant Rettke wrote: > htdp.org is up now Yes, after the brown meltdown we moved the DNS entry to a temporary server, but that server stopped responding very shortly after that. Brown is now back up and I restored the DNS entry, so it's a matter of hours until the change propagates. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From jay.mccarthy at gmail.com Mon Dec 8 10:00:40 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:35:28 2009 Subject: [plt-scheme] Re: PLT Scheme v4.1.3 In-Reply-To: References: <200811211554.mALFsASw005702@winooski.ccs.neu.edu> Message-ID: Hmm, I can't recreate the problem you mention. Perhaps what you are noticing is that it ignores the port option in the file and uses the one from the command-line or 80. Jay On Fri, Dec 5, 2008 at 10:16 PM, skc wrote: > Hi > > Now plt-web-server ignore the configuration table pointed by the -f > command line option. > > regards, > Shimon. > > On Nov 21, 5:54 pm, Eli Barzilay wrote: >> PLT Scheme version 4.1.3 is now available from >> >> http://plt-scheme.org/ >> >> This is mostly a bug-fix release. >> >> Notable changes: >> >> * Web Server: >> - Documentation rewritten to separate servlet APIs and server >> extension APIs >> - HTTPS supported on the "plt-web-server" command-line with "--ssl" >> option >> - Stateless servlets supported in default configuration through >> 'stateless interface-version >> - `web-server/servlet-env' supports top-level servlets through >> #:servlet-path >> - Servlets are served from anywhere in the htdocs directory by >> default >> - A template system based on the Scribble syntax has been added, see >> web-server/templates in the documentation >> And many other internal modifications to make extension easier! >> >> [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! >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From jay.mccarthy at gmail.com Mon Dec 8 10:02:26 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:35:29 2009 Subject: [plt-scheme] Faster CGI In-Reply-To: References: Message-ID: Hi Henk, If you are worried about memory usage and the Web Server, there are two approaches you can take: * Use the LRU manager that lets you set a bound on memory usage. http://docs.plt-scheme.org/web-server/lru_ss.html * Use the stateless language that uses no memory for continuations http://docs.plt-scheme.org/web-server/stateless-servlets.html Jay On Sat, Dec 6, 2008 at 3:16 PM, Henk Boom wrote: > I am looking for a way to serve many small sites (for 1-2 week school > projects) running servlets in Scheme. In the past I have been using > PHP, since it is very easy to deploy because of the built-in > functionality provided by the hosting company. I would really prefer > to use Scheme, though. > > The PLT Web Server seems to use too much memory for a shared hosting > environment (they start to complain when I break ~80MiB). Using the > PLT Web Server also makes me either use one instance per site (again > giving memory issues), or mess with my the configuration for each new > site I put up. (with CGI and PHP I only need to do the configuration > in one place: my host's control panel). I like to play around with > lots of small sites, often for 1-2 week school projects which get left > up permanently afterwards, so this gets a little awkward. > > I want to make sure it's clear that I'm not complaining about the PLT > Web Server, I just don't think it was designed with a use like mine in > mind. Please correct me if you disagree. > > CGI scripts, on the other hand, are very easy to deploy, and take no > memory when not in use, but are too slow because of the start-up time. > The lack of persistent continuations is not a problem for me, since I > am not planning to make use of that feature in these small projects. > > I'm thinking that I could implement a Scheme 'launcher', to avoid the > servlet startup cost. The launcher would accept signals containing a > filename, and would use dynamic-require to run a specific function of > that module in a separate thread. Then, the #! line in my servlets > would invoke a command to send a message to this launcher. > > Given that the modules could use parameters instead of global > variables, this doesn't sound difficult to me. On the other hand, it > sounds like part of the PLT Web Server's purpose is to implement > something similar, so would I end up with similar memory issues? > > Alternatively, I have heard of a FastCGI interface for Scheme, but > haven't actually seen anything concrete. Does anyone know more? > > Henk > _________________________________________________ > 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 rafkind at cs.utah.edu Mon Dec 8 11:43:52 2008 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Thu Mar 26 02:35:29 2009 Subject: [plt-scheme] planet trac login Message-ID: <493D4EC8.2050108@cs.utah.edu> I can't seem to login to the Trac server for planet. I'm using the same username/password I use on planet (my username is kazzmir). Is there something I have to do other than have a valid planet login to use trac? From rob.hunter at gmail.com Mon Dec 8 12:38:20 2008 From: rob.hunter at gmail.com (Rob Hunter) Date: Thu Mar 26 02:35:29 2009 Subject: [plt-scheme] planet trac login In-Reply-To: <493D4EC8.2050108@cs.utah.edu> References: <493D4EC8.2050108@cs.utah.edu> Message-ID: <773A910F-937A-40CA-9B58-8092EC9DDFA6@gmail.com> Try resetting your password within PLaneT (even to the same thing). As I recall, that's what we were told to do when trac came out. --rob On Dec 8, 2008, at 8:43 AM, Jon Rafkind wrote: > I can't seem to login to the Trac server for planet. I'm using the > same username/password I use on planet (my username is kazzmir). > > Is there something I have to do other than have a valid planet login > to use trac? > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From rafkind at cs.utah.edu Mon Dec 8 14:10:44 2008 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Thu Mar 26 02:35:29 2009 Subject: [plt-scheme] planet trac login In-Reply-To: <773A910F-937A-40CA-9B58-8092EC9DDFA6@gmail.com> References: <493D4EC8.2050108@cs.utah.edu> <773A910F-937A-40CA-9B58-8092EC9DDFA6@gmail.com> Message-ID: <493D7134.6020808@cs.utah.edu> Thanks, that worked. Rob Hunter wrote: > Try resetting your password within PLaneT (even to the same thing). > As I recall, that's what we were told to do when trac came out. > > --rob > > On Dec 8, 2008, at 8:43 AM, Jon Rafkind wrote: > >> I can't seem to login to the Trac server for planet. I'm using the >> same username/password I use on planet (my username is kazzmir). >> >> Is there something I have to do other than have a valid planet login >> to use trac? >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme From wdmeuter at vub.ac.be Mon Dec 8 14:53:29 2008 From: wdmeuter at vub.ac.be (Wolfgang De Meuter) Date: Thu Mar 26 02:35:29 2009 Subject: [plt-scheme] bug with callcc? Message-ID: Hello, I think the following code should produce an infinite loop. (begin (define k '()) (* 5 (call-with-current-continuation (lambda (cont) (set! k cont) 2))) (k 3)) In R6RS is does, but in PrettyBig it produces 15. A bug? From clements at brinckerhoff.org Mon Dec 8 15:07:09 2008 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:35:30 2009 Subject: [plt-scheme] bug with callcc? In-Reply-To: References: Message-ID: On Dec 8, 2008, at 11:53 AM, Wolfgang De Meuter wrote: > Hello, > > I think the following code should produce an infinite loop. > > (begin > (define k '()) > (* 5 (call-with-current-continuation > (lambda (cont) > (set! k cont) > 2))) > (k 3)) > > In R6RS is does, but in PrettyBig it produces 15. A bug? I believe that the top-level in Pretty Big (in whatever version you're using) wraps a prompt around top-level expressions, and that a begin at top level is treated as two separate top-level expressions. 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/20081208/c510828a/smime.bin From grettke at acm.org Mon Dec 8 15:36:56 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:35:30 2009 Subject: [plt-scheme] bug with callcc? In-Reply-To: References: Message-ID: <756daca50812081236u1ef3e7ffic800c278fb786492@mail.gmail.com> On Mon, Dec 8, 2008 at 2:07 PM, John Clements wrote: > I believe that the top-level in Pretty Big (in whatever version you're > using) wraps a prompt around top-level expressions, and that a begin at top > level is treated as two separate top-level expressions. Yes it came up in this thread: http://list.cs.brown.edu/pipermail/plt-scheme/2008-July/026005.html From shimoco at gmail.com Mon Dec 8 18:55:10 2008 From: shimoco at gmail.com (Shimon Cohen) Date: Thu Mar 26 02:35:31 2009 Subject: [plt-scheme] Re: PLT Scheme v4.1.3 In-Reply-To: References: <200811211554.mALFsASw005702@winooski.ccs.neu.edu> Message-ID: <92e13fb30812081555x71bc8962k3b0b9efc400bcc40@mail.gmail.com> Hi Thanks for your answer. Yes. It ignores the port option. (Why is that?) Shimon On Mon, Dec 8, 2008 at 5:00 PM, Jay McCarthy wrote: > Hmm, I can't recreate the problem you mention. Perhaps what you are > noticing is that it ignores the port option in the file and uses the > one from the command-line or 80. > > Jay > > On Fri, Dec 5, 2008 at 10:16 PM, skc wrote: > > Hi > > > > Now plt-web-server ignore the configuration table pointed by the -f > > command line option. > > > > regards, > > Shimon. > > > > On Nov 21, 5:54 pm, Eli Barzilay wrote: > >> PLT Scheme version 4.1.3 is now available from > >> > >> http://plt-scheme.org/ > >> > >> This is mostly a bug-fix release. > >> > >> Notable changes: > >> > >> * Web Server: > >> - Documentation rewritten to separate servlet APIs and server > >> extension APIs > >> - HTTPS supported on the "plt-web-server" command-line with "--ssl" > >> option > >> - Stateless servlets supported in default configuration through > >> 'stateless interface-version > >> - `web-server/servlet-env' supports top-level servlets through > >> #:servlet-path > >> - Servlets are served from anywhere in the htdocs directory by > >> default > >> - A template system based on the Scribble syntax has been added, see > >> web-server/templates in the documentation > >> And many other internal modifications to make extension easier! > >> > >> [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! > >> _________________________________________________ > >> For list-related administrative tasks: > >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > > For list-related administrative tasks: > > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > > > > > -- > Jay McCarthy > Assistant Professor / Brigham Young University > http://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/20081209/985ac8ec/attachment.htm From ce.rohan at gmail.com Mon Dec 8 20:15:23 2008 From: ce.rohan at gmail.com (Rohan Golwala) Date: Thu Mar 26 02:35:31 2009 Subject: [plt-scheme] Concept Message-ID: Hi, Can anyone tell me which concept is used when we implement the scheme language with the PostGRESQL....? By concepts, I mean data abstraction, Symbolic logic, etc.........? Thanks... -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081208/7fd5c468/attachment.html From PatrickLozzi at gmail.com Mon Dec 8 21:09:07 2008 From: PatrickLozzi at gmail.com (Patrick) Date: Thu Mar 26 02:35:32 2009 Subject: [plt-scheme] Possible bug getting requests from non-complete urls. Message-ID: I'm experiencing a weird issue... Here's a test case: #lang scheme (require net/url) (require (planet ashinn/html-parser:1:0/html-parser)) (define site-url "http://www.circuitcity.com") (define (my-ext-port) (lambda (site-url) (get-pure-port (string->url site-url)))) (define (get-page) (lambda (my-port) (html->sxml my-port))) ; run with: ((get-page) ((my-ext-port) site-url)) And the interpreter responds more or less with: "Your browser sent a request that this server could not understand." However, if I change site-url to: (define site-url "http://www.circuitycity.com/") ;note the extra forward slash Then it responds normally and in this case, retrieving for me the full sxml tree. I contacted some nice folks in #Scheme and then were pretty strongly of the belief that this is a bug and that I should contact this list... they believed, paraphrasing, that the HTTP library should not send bogus requests to the server, but either make the request sensible or signal an error. I brought this up because many sites are of this form, or at least, contain links that very likely do not contain the last forward slash and I couldn't see a way around this. I'm open to any suggestions. Regards, -Patrick From lunarc.lists at gmail.com Mon Dec 8 21:15:31 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:35:32 2009 Subject: [plt-scheme] Faster CGI In-Reply-To: References: Message-ID: 2008/12/8 Jay McCarthy : > Hi Henk, > > If you are worried about memory usage and the Web Server, there are > two approaches you can take: > > * Use the LRU manager that lets you set a bound on memory usage. > > http://docs.plt-scheme.org/web-server/lru_ss.html > > * Use the stateless language that uses no memory for continuations > > http://docs.plt-scheme.org/web-server/stateless-servlets.html Thanks for the reply! As far as I know these two measures only effect the management of continuations, correct? I'm not using continuations in my servlets. Henk From eli at barzilay.org Mon Dec 8 21:45:40 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:35:32 2009 Subject: [plt-scheme] Possible bug getting requests from non-complete urls. In-Reply-To: References: Message-ID: <18749.56276.807521.446465@arabic.ccs.neu.edu> On Dec 8, Patrick wrote: > I'm experiencing a weird issue... > > Here's a test case: > #lang scheme > ... > (define site-url "http://www.circuitcity.com") That's the problem -- net/url sends a line like: GET HTTP/1.0 which is bogus, according to the HTTP RFC -- I fixed it to use "/" if the path is empty, following what the RFC says: Note that the absolute path cannot be empty; if none is present in the original URI, it must be given as "/" (the server root). -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From karsten at patzwaldt.org Mon Dec 8 22:01:45 2008 From: karsten at patzwaldt.org (Karsten Patzwaldt) Date: Thu Mar 26 02:35:32 2009 Subject: [plt-scheme] web-server question Message-ID: <181935880812081901k32550c03y77cfe841e3bbc707@mail.gmail.com> Hi. I'm looking for a convenient way to embed links to certain actions into my servlet code. What I want to do is something like this: (let ((p )) `(a ((ref ,(make-url (lambda (request) (remove-post! p) '(html (body "Post removed")))))) "Remove post " ,(post-title p))) That's pretty similar to send/suspend, only that it would work the other way round. Does something like this exist in the PLT web server? Thanks, Karsten From sk at cs.brown.edu Mon Dec 8 22:07:34 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:35:33 2009 Subject: [plt-scheme] Faster CGI In-Reply-To: References: Message-ID: Yes, that's correct. But the point is that they make it much more friendly to use continuations if you so desire (ie, if you haven't used the server w/ continuations in a year or two, you may want to check whether these additions pass your necessary benchmarking). On Mon, Dec 8, 2008 at 9:15 PM, Henk Boom wrote: > 2008/12/8 Jay McCarthy : >> Hi Henk, >> >> If you are worried about memory usage and the Web Server, there are >> two approaches you can take: >> >> * Use the LRU manager that lets you set a bound on memory usage. >> >> http://docs.plt-scheme.org/web-server/lru_ss.html >> >> * Use the stateless language that uses no memory for continuations >> >> http://docs.plt-scheme.org/web-server/stateless-servlets.html > > Thanks for the reply! > > As far as I know these two measures only effect the management of > continuations, correct? I'm not using continuations in my servlets. > > Henk > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From lunarc.lists at gmail.com Mon Dec 8 22:27:25 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:35:33 2009 Subject: [plt-scheme] Faster CGI In-Reply-To: References: Message-ID: 2008/12/8 Shriram Krishnamurthi : > Yes, that's correct. But the point is that they make it much more > friendly to use continuations if you so desire (ie, if you haven't > used the server w/ continuations in a year or two, you may want to > check whether these additions pass your necessary benchmarking). Ok, I see that point. If I am going to use the PLT Web Server then it makes sense to investigate those options to make using continuations affordable. The problem I was running into, though, was unaffordable memory usage even in the absence of continuations. Henk From sk at cs.brown.edu Mon Dec 8 22:33:12 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:35:33 2009 Subject: [plt-scheme] Faster CGI In-Reply-To: References: Message-ID: I understand. In that case you would indeed be best off looking into a FastCGI-based alternative. Shriram On Mon, Dec 8, 2008 at 10:27 PM, Henk Boom wrote: > 2008/12/8 Shriram Krishnamurthi : >> Yes, that's correct. But the point is that they make it much more >> friendly to use continuations if you so desire (ie, if you haven't >> used the server w/ continuations in a year or two, you may want to >> check whether these additions pass your necessary benchmarking). > > Ok, I see that point. If I am going to use the PLT Web Server then it > makes sense to investigate those options to make using continuations > affordable. The problem I was running into, though, was unaffordable > memory usage even in the absence of continuations. > > Henk > From jay.mccarthy at gmail.com Mon Dec 8 22:43:11 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:35:33 2009 Subject: [plt-scheme] web-server question In-Reply-To: <181935880812081901k32550c03y77cfe841e3bbc707@mail.gmail.com> References: <181935880812081901k32550c03y77cfe841e3bbc707@mail.gmail.com> Message-ID: I think you are looking for send/suspend/dispatch: (send/suspend/dispatch (lambda (embed/url) (let ([p ....]) `(a ([href ,(embed/url (lambda (req) (remove-post! p) ....))]) ....))) http://docs.plt-scheme.org/web-server/web_ss.html#(def._((lib._web-server/servlet/web..ss)._send/suspend/dispatch)) Jay On Mon, Dec 8, 2008 at 8:01 PM, Karsten Patzwaldt wrote: > Hi. > > I'm looking for a convenient way to embed links to certain actions > into my servlet code. What I want to do is something like this: > > (let ((p )) > `(a ((ref ,(make-url (lambda (request) (remove-post! p) '(html (body > "Post removed")))))) "Remove post " ,(post-title p))) > > That's pretty similar to send/suspend, only that it would work the > other way round. Does something like this exist in the PLT web server? > > Thanks, > > Karsten > _________________________________________________ > 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 Mon Dec 8 22:46:18 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:35:34 2009 Subject: [plt-scheme] Faster CGI In-Reply-To: References: Message-ID: Ah, I understand now. Yes, I would recommend writing something like a FastCGI wrapper, I imagine that the protocol is fairly simple, if you'd like me to look it over and give any tips on controlling resources (i.e., with custodians), I'd be happy to. Jay On Mon, Dec 8, 2008 at 8:27 PM, Henk Boom wrote: > 2008/12/8 Shriram Krishnamurthi : >> Yes, that's correct. But the point is that they make it much more >> friendly to use continuations if you so desire (ie, if you haven't >> used the server w/ continuations in a year or two, you may want to >> check whether these additions pass your necessary benchmarking). > > Ok, I see that point. If I am going to use the PLT Web Server then it > makes sense to investigate those options to make using continuations > affordable. The problem I was running into, though, was unaffordable > memory usage even in the absence of continuations. > > Henk > -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From clements at brinckerhoff.org Mon Dec 8 23:32:27 2008 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:35:34 2009 Subject: [plt-scheme] why no send/suspend in tutorial? (was: Re: web-server question) In-Reply-To: References: <181935880812081901k32550c03y77cfe841e3bbc707@mail.gmail.com> Message-ID: On Dec 8, 2008, at 7:43 PM, Jay McCarthy wrote: > I think you are looking for send/suspend/dispatch: > > (send/suspend/dispatch > (lambda (embed/url) > (let ([p ....]) > `(a ([href ,(embed/url (lambda (req) (remove-post! > p) ....))]) ....))) > > http://docs.plt-scheme.org/web-server/web_ss.html#(def._((lib._web- > server/servlet/web..ss)._send/suspend/dispatch)) I've been thinking about this for a few weeks now, but this prompts me (er, so to speak) to write: Send/suspend/dispatch seems like a sometimes-useful function, but that exclusive use of send/suspend/dispatch (as the new tutorial exemplifies) makes impossible the "nice" thing that continuations enable. In particular, I'm thinking of code like this, from my solution to one of Shriram's assignments: (let loop () (let ([new-post (get-post)]) (when (confirm-post? new-post) (add-post! new-post)) (loop)) The idea is that get-post and confirm-post? both use send/suspend. However, if you try to rewrite these to use send/suspend/dispatch, then you lose the ability to write the program this way without using hidden fields, which is really the raison d'etre of the PLT web server, IIUC. 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/20081208/fdd075fc/smime.bin From clements at brinckerhoff.org Mon Dec 8 23:35:01 2008 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:35:35 2009 Subject: [plt-scheme] http://www.htdp.org/ is down In-Reply-To: <756daca50812041922w41d66054g1a9773d9de5844dd@mail.gmail.com> References: <756daca50812041922w41d66054g1a9773d9de5844dd@mail.gmail.com> Message-ID: On Dec 4, 2008, at 7:22 PM, Grant Rettke wrote: > http://www.htdp.org/ is down > > is it just for me? Along these lines, questions of this form can usually be answered by this site: http://downforeveryoneorjustme.com/ John "thanks, Dan Sandler" 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/20081208/03aa66fd/smime.bin From jay.mccarthy at gmail.com Mon Dec 8 23:54:49 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:35:35 2009 Subject: [plt-scheme] Re: why no send/suspend in tutorial? (was: Re: web-server question) In-Reply-To: References: <181935880812081901k32550c03y77cfe841e3bbc707@mail.gmail.com> Message-ID: Everything you can do with s/s you can do with s/s/d (and vice versa), because send/suspend/dispatch returns the result of the request handler to its continuation. Send/suspend can be derived from s/s/d: (define (send/suspend response-generator) (send/suspend/dispatch (lambda (embed/url) (response-generator (embed/url (lambda (x) x)))))) In my implementation, s/s/d is derived from s/s: (define (send/suspend/dispatch response-generator) (let/cc k1 (response-generator (lambda (proc) (let/ec k2 (k1 (proc (send/suspend k2)))))))) As you can see, if proc = id, then s/s/d is just s/s. I do agree that s/s/d encourages you to write your web app as set of mutually recursive tail-calling functions, rather than linear computation with send/suspend standing in for `read'. But, I think that the s/s/d approach better matches most web apps, which is why I used it in the tutorial. Jay On Mon, Dec 8, 2008 at 9:32 PM, John Clements wrote: > > On Dec 8, 2008, at 7:43 PM, Jay McCarthy wrote: > >> I think you are looking for send/suspend/dispatch: >> >> (send/suspend/dispatch >> (lambda (embed/url) >> (let ([p ....]) >> `(a ([href ,(embed/url (lambda (req) (remove-post! p) ....))]) ....))) >> >> >> http://docs.plt-scheme.org/web-server/web_ss.html#(def._((lib._web-server/servlet/web..ss)._send/suspend/dispatch)) > > I've been thinking about this for a few weeks now, but this prompts me (er, > so to speak) to write: > > Send/suspend/dispatch seems like a sometimes-useful function, but that > exclusive use of send/suspend/dispatch (as the new tutorial exemplifies) > makes impossible the "nice" thing that continuations enable. In particular, > I'm thinking of code like this, from my solution to one of Shriram's > assignments: > > (let loop () > (let ([new-post (get-post)]) > (when (confirm-post? new-post) > (add-post! new-post)) > (loop)) > > The idea is that get-post and confirm-post? both use send/suspend. However, > if you try to rewrite these to use send/suspend/dispatch, then you lose the > ability to write the program this way without using hidden fields, which is > really the raison d'etre of the PLT web server, IIUC. > > John Clements > > -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From clements at brinckerhoff.org Tue Dec 9 00:52:20 2008 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:35:36 2009 Subject: [plt-scheme] Re: why no send/suspend in tutorial? (was: Re: web-server question) In-Reply-To: References: <181935880812081901k32550c03y77cfe841e3bbc707@mail.gmail.com> Message-ID: On Dec 8, 2008, at 8:54 PM, Jay McCarthy wrote: > Everything you can do with s/s you can do with s/s/d (and vice versa), > because send/suspend/dispatch returns the result of the request > handler to its continuation. Ah, I see. The idiomatic use is so close to the CPSed style required by most web apps that I assumed that it didn't return to the existing continuation. Thanks! John -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2484 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081208/aed8710d/smime.bin From sk at cs.brown.edu Tue Dec 9 01:02:02 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:35:36 2009 Subject: [plt-scheme] Re: why no send/suspend in tutorial? (was: Re: web-server question) In-Reply-To: References: <181935880812081901k32550c03y77cfe841e3bbc707@mail.gmail.com> Message-ID: I agree. This is worth describing more explicitly in documentation with actual examples, because John's assumption is absolutely the natural one to make. On Tue, Dec 9, 2008 at 12:52 AM, John Clements wrote: > > On Dec 8, 2008, at 8:54 PM, Jay McCarthy wrote: > >> Everything you can do with s/s you can do with s/s/d (and vice versa), >> because send/suspend/dispatch returns the result of the request >> handler to its continuation. > > Ah, I see. The idiomatic use is so close to the CPSed style required by most > web apps that I assumed that it didn't return to the existing continuation. > Thanks! > > John > > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From noelwelsh at gmail.com Tue Dec 9 04:37:18 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:35:36 2009 Subject: [plt-scheme] Concept In-Reply-To: References: Message-ID: All of these and more! I don't really understand this question -- it seems like homework, or do you have some particular point in mind? N. On Tue, Dec 9, 2008 at 1:15 AM, Rohan Golwala wrote: > Hi, > > Can anyone tell me which concept is used when we implement the scheme > language with the PostGRESQL....? > By concepts, I mean data abstraction, Symbolic logic, etc.........? > Thanks... > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From marek at xivilization.net Tue Dec 9 04:46:15 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:35:36 2009 Subject: [plt-scheme] foldl, map, filter with sequences? Message-ID: <20081209104615.43e01b4b@halmanfloyd.lan.local> Hi, I have a rather large list which would be handled best if I wouldn't need to create it as one big thing but rather compute on need (it is the output of string-tokenize applied on a 350 MB file). As I am using foldl in my program, I don't need all items at once. Is there a way to feed a sequence into foldl? Or maybe there a sequence-foldl? regards, Marek From jos.koot at telefonica.net Tue Dec 9 06:10:05 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:35:36 2009 Subject: [plt-scheme] foldl, map, filter with sequences? References: <20081209104615.43e01b4b@halmanfloyd.lan.local> Message-ID: If I understand well you need port->stream-of-tokens. Then you could use stream-fold. However, srfi 41 has port->stream, but not port->stream-of-tokens. The latter should not take too much work to make by yourself. Jos ----- Original Message ----- From: "Marek Kubica" To: Sent: Tuesday, December 09, 2008 10:46 AM Subject: [plt-scheme] foldl, map, filter with sequences? > Hi, > > I have a rather large list which would be handled best if I wouldn't > need to create it as one big thing but rather compute on need (it is > the output of string-tokenize applied on a 350 MB file). As I am using > foldl in my program, I don't need all items at once. Is there a way to > feed a sequence into foldl? Or maybe there a sequence-foldl? > > regards, > Marek > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From jay.mccarthy at gmail.com Tue Dec 9 09:47:40 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:35:36 2009 Subject: [plt-scheme] Re: why no send/suspend in tutorial? (was: Re: web-server question) In-Reply-To: References: <181935880812081901k32550c03y77cfe841e3bbc707@mail.gmail.com> Message-ID: The documentation [1] says this: Calls make-response with a function that, when called with a procedure from request? to any/c will generate a URL, that when invoked will call the function with the request? object and [HERE]return the result to the caller of send/suspend/dispatch.[/HERE] The section marked "[HERE]" says that s/s/d returns the result to its caller. The only example that is given uses this feature: (define (count-dot-com i) (count-dot-com (send/suspend/dispatch (lambda (embed/url) `(html (head (title "Count!")) (body (h2 (a ([href ,(embed/url (lambda (req) (sub1 i)))]) "-")) (h1 ,(number->string i)) (h2 (a ([href ,(embed/url (lambda (req) (add1 i)))]) "+")))))))) I'm not sure what else you think I should do. Do you mean mention that (embed/url identity) recreates s/s? Jay 1. http://docs.plt-scheme.org/web-server/web_ss.html#(def._((lib._web-server/servlet/web..ss)._send/suspend/dispatch)) On Mon, Dec 8, 2008 at 11:02 PM, Shriram Krishnamurthi wrote: > I agree. This is worth describing more explicitly in documentation > with actual examples, because John's assumption is absolutely the > natural one to make. > > On Tue, Dec 9, 2008 at 12:52 AM, John Clements > wrote: >> >> On Dec 8, 2008, at 8:54 PM, Jay McCarthy wrote: >> >>> Everything you can do with s/s you can do with s/s/d (and vice versa), >>> because send/suspend/dispatch returns the result of the request >>> handler to its continuation. >> >> Ah, I see. The idiomatic use is so close to the CPSed style required by most >> web apps that I assumed that it didn't return to the existing continuation. >> Thanks! >> >> John >> >> >> >> _________________________________________________ >> 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 noelwelsh at gmail.com Tue Dec 9 10:59:12 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:35:36 2009 Subject: [plt-scheme] Re: why no send/suspend in tutorial? (was: Re: web-server question) In-Reply-To: References: <181935880812081901k32550c03y77cfe841e3bbc707@mail.gmail.com> Message-ID: On Tue, Dec 9, 2008 at 2:47 PM, Jay McCarthy wrote: > The documentation [1] says this: > > Calls make-response with a function that, when called with a procedure > from request? to any/c will generate a URL, that when invoked will > call the function with the request? object and [HERE]return the result > to the caller of send/suspend/dispatch.[/HERE] > Make it explicit. "Therefore s/s/d can actually be used anywhere that s/s is used by using the identity function as the handler: example here" I lot of the documentation (the web server is generally better in this regard) reads like a maths textbook. It tells you stuff but doesn't tell you the implications or why you should care. I know this is intentional in the reference, and is being addressed in the guides. N. From jensaxel at soegaard.net Tue Dec 9 11:32:26 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:35:37 2009 Subject: [plt-scheme] foldl, map, filter with sequences? In-Reply-To: <20081209104615.43e01b4b@halmanfloyd.lan.local> References: <20081209104615.43e01b4b@halmanfloyd.lan.local> Message-ID: <493E9D9A.8020406@soegaard.net> Marek Kubica wrote: > I have a rather large list which would be handled best if I wouldn't > need to create it as one big thing but rather compute on need (it is > the output of string-tokenize applied on a 350 MB file). As I am using > foldl in my program, I don't need all items at once. Is there a way to > feed a sequence into foldl? Or maybe there a sequence-foldl? > Maybe you it is time to try comprehensions? http://docs.plt-scheme.org/guide/for.html -- Jens Axel S?gaard From marek at xivilization.net Tue Dec 9 14:48:32 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:35:37 2009 Subject: [plt-scheme] foldl, map, filter with sequences? In-Reply-To: References: <20081209104615.43e01b4b@halmanfloyd.lan.local> Message-ID: <20081209204832.00aeb22e@halmanfloyd.lan.local> On Tue, 9 Dec 2008 12:10:05 +0100 "Jos Koot" wrote: > If I understand well you need port->stream-of-tokens. > Then you could use stream-fold. > However, srfi 41 has port->stream, but not port->stream-of-tokens. > The latter should not take too much work to make by yourself. Yes, this looks exactly like what I want. I'll take a look at the implementation of port->stream, shouldn't be too hard. Thanks for pointing me in the right direction! regards, Marek From marek at xivilization.net Tue Dec 9 14:46:13 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:35:37 2009 Subject: [plt-scheme] foldl, map, filter with sequences? In-Reply-To: <493E9D9A.8020406@soegaard.net> References: <20081209104615.43e01b4b@halmanfloyd.lan.local> <493E9D9A.8020406@soegaard.net> Message-ID: <20081209204613.3f1e5a8e@halmanfloyd.lan.local> On Tue, 09 Dec 2008 17:32:26 +0100 Jens Axel Soegaard wrote: > Marek Kubica wrote: > > I have a rather large list which would be handled best if I wouldn't > > need to create it as one big thing but rather compute on need (it is > > the output of string-tokenize applied on a 350 MB file). As I am > > using foldl in my program, I don't need all items at once. Is there > > a way to feed a sequence into foldl? Or maybe there a > > sequence-foldl? > > Maybe you it is time to try comprehensions? > > http://docs.plt-scheme.org/guide/for.html I already know comprehensions from Python and while they are a very useful tool I found it fascinating that I was able to solve a task completely by using immutable data structures and foldl. Maybe I'll write a version using comprehensions later, to check the performance of that, but first I'll try streams. Thanks for the suggestion! Considering sequences I have a small suggestion: please put a note that to access the data of a sequence, one has to use comprehensions. I wasn't able to find out what to do with the mysterious # so I needed to ask in IRC where I was told that comprehensions are the way to go. regards, Marek From ce.rohan at gmail.com Tue Dec 9 18:43:51 2008 From: ce.rohan at gmail.com (Rohan Golwala) Date: Thu Mar 26 02:35:38 2009 Subject: [plt-scheme] Complex Application With Database Message-ID: Hi, I am working on a project using Scheme language and PostGRESQL. Can anyone suggest some higher or complex operations to be performed using SQL database...? Can anyone help me with any topic or idea and provide an understandingor a document on it to understand it...? Thanks, -- Rohan. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081209/ac63da1b/attachment.html From vyzo at media.mit.edu Tue Dec 9 18:44:03 2008 From: vyzo at media.mit.edu (Dimitris Vyzovitis) Date: Thu Mar 26 02:35:38 2009 Subject: [plt-scheme] reliable exit handlers for foreign functions Message-ID: Is there any reliable way to register atexit callbacks with ffi? I am trying to register a native thunk with atexit, but I am not getting anywhere: > (get-ffi-obj "atexit" #f _pointer) ffi-obj: couldn't get "atexit" from #f (/usr/local/plt/bin/mzscheme: undefined symbol: atexit) Trying libc doesn't go very far either: > (get-ffi-obj "atexit" "libc" _pointer) ffi-lib: couldn't open "libc.so" (/usr/lib64/libc.so: invalid ELF header) ;; huh? > (get-ffi-obj "atexit" "/lib/libc.so.6" _pointer) ffi-obj: couldn't get "atexit" from "/lib/libc.so.6" (/lib/libc.so.6: undefined symbol: atexit) Any ideas? Is there anything equivalent at scheme side? (exit-handler doesn't seem to get get called when I C-d the process) -- vyzo From rafkind at cs.utah.edu Tue Dec 9 18:47:24 2008 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Thu Mar 26 02:35:38 2009 Subject: [plt-scheme] Complex Application With Database In-Reply-To: References: Message-ID: <493F038C.9080303@cs.utah.edu> Rohan Golwala wrote: > Hi, > > I am working on a project using Scheme language and PostGRESQL. Can > anyone suggest some higher or complex operations to be performed using > SQL database...? Can anyone help me with any topic or idea and provide > an understandingor a document on it to understand it...? Do you have a specific problem that needs to be addressed? Your question is a bit vague and I hate to give this kind of answer, but reading the manual is your best bet I suppose. http://www.postgresql.org/docs/manuals/archive.html From mflatt at cs.utah.edu Tue Dec 9 18:52:46 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:35:38 2009 Subject: [plt-scheme] reliable exit handlers for foreign functions In-Reply-To: References: Message-ID: <20081209235247.B9BF56500C8@mail-svr1.cs.utah.edu> At Tue, 9 Dec 2008 18:44:03 -0500 (EST), Dimitris Vyzovitis wrote: > Is there any reliable way to register atexit callbacks with ffi? > > I am trying to register a native thunk with atexit, but I am not getting > anywhere: > > (get-ffi-obj "atexit" #f _pointer) > ffi-obj: couldn't get "atexit" from #f (/usr/local/plt/bin/mzscheme: > undefined symbol: atexit) > > Trying libc doesn't go very far either: > > (get-ffi-obj "atexit" "libc" _pointer) > ffi-lib: couldn't open "libc.so" (/usr/lib64/libc.so: invalid ELF header) > ;; huh? > > (get-ffi-obj "atexit" "/lib/libc.so.6" _pointer) > ffi-obj: couldn't get "atexit" from "/lib/libc.so.6" (/lib/libc.so.6: > undefined symbol: atexit) I'm not sure why atexit() is unavailable, but try scheme_add_atexit_closer(). Matthew From mflatt at cs.utah.edu Tue Dec 9 18:54:54 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:35:38 2009 Subject: [plt-scheme] reliable exit handlers for foreign functions In-Reply-To: <20081209235247.B9BF56500C8@mail-svr1.cs.utah.edu> References: <20081209235247.B9BF56500C8@mail-svr1.cs.utah.edu> Message-ID: <20081209235455.3FC266500C8@mail-svr1.cs.utah.edu> At Tue, 9 Dec 2008 16:52:46 -0700, Matthew Flatt wrote: > At Tue, 9 Dec 2008 18:44:03 -0500 (EST), Dimitris Vyzovitis wrote: > > Is there any reliable way to register atexit callbacks with ffi? > > > > I am trying to register a native thunk with atexit, but I am not getting > > anywhere: > > > (get-ffi-obj "atexit" #f _pointer) > > ffi-obj: couldn't get "atexit" from #f (/usr/local/plt/bin/mzscheme: > > undefined symbol: atexit) > > > > Trying libc doesn't go very far either: > > > (get-ffi-obj "atexit" "libc" _pointer) > > ffi-lib: couldn't open "libc.so" (/usr/lib64/libc.so: invalid ELF header) > > ;; huh? > > > (get-ffi-obj "atexit" "/lib/libc.so.6" _pointer) > > ffi-obj: couldn't get "atexit" from "/lib/libc.so.6" (/lib/libc.so.6: > > undefined symbol: atexit) > > I'm not sure why atexit() is unavailable, but try > scheme_add_atexit_closer(). Sorry --- that's called once per object registered with the custodian. It may work, but it's not really what you were looking for. Matthew From eli at barzilay.org Tue Dec 9 19:01:48 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:35:39 2009 Subject: [plt-scheme] reliable exit handlers for foreign functions In-Reply-To: <20081209235247.B9BF56500C8@mail-svr1.cs.utah.edu> References: <20081209235247.B9BF56500C8@mail-svr1.cs.utah.edu> Message-ID: <18751.1772.369735.350057@arabic.ccs.neu.edu> On Dec 9, Matthew Flatt wrote: > At Tue, 9 Dec 2008 18:44:03 -0500 (EST), Dimitris Vyzovitis wrote: > > Is there any reliable way to register atexit callbacks with ffi? > > > > I am trying to register a native thunk with atexit, but I am not getting > > anywhere: > > > (get-ffi-obj "atexit" #f _pointer) > > ffi-obj: couldn't get "atexit" from #f (/usr/local/plt/bin/mzscheme: > > undefined symbol: atexit) > > > > Trying libc doesn't go very far either: > > > (get-ffi-obj "atexit" "libc" _pointer) > > ffi-lib: couldn't open "libc.so" (/usr/lib64/libc.so: invalid ELF header) > > ;; huh? > > > (get-ffi-obj "atexit" "/lib/libc.so.6" _pointer) > > ffi-obj: couldn't get "atexit" from "/lib/libc.so.6" (/lib/libc.so.6: > > undefined symbol: atexit) > > I'm not sure why atexit() is unavailable, I'm not sure either, but these "invalid ELF header" files are usually some text file that describes how to actually look for the real .so file. In any case, I couldn't find it either on my system -- the only place that had it is /usr/lib64/dietlibc/lib-x86_64/libc.so. But I did get on_exit() in the usual way, except that the man page says that atexit() should be used instead... -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From vyzo at media.mit.edu Tue Dec 9 19:08:52 2008 From: vyzo at media.mit.edu (Dimitris Vyzovitis) Date: Thu Mar 26 02:35:39 2009 Subject: [plt-scheme] reliable exit handlers for foreign functions In-Reply-To: <18751.1772.369735.350057@arabic.ccs.neu.edu> References: <20081209235247.B9BF56500C8@mail-svr1.cs.utah.edu> <18751.1772.369735.350057@arabic.ccs.neu.edu> Message-ID: On Tue, 9 Dec 2008, Eli Barzilay wrote: > On Dec 9, Matthew Flatt wrote: >> At Tue, 9 Dec 2008 18:44:03 -0500 (EST), Dimitris Vyzovitis wrote: >>> Is there any reliable way to register atexit callbacks with ffi? >>> >>> I am trying to register a native thunk with atexit, but I am not getting >>> anywhere: >>>> (get-ffi-obj "atexit" #f _pointer) >>> ffi-obj: couldn't get "atexit" from #f (/usr/local/plt/bin/mzscheme: >>> undefined symbol: atexit) >> ... >> I'm not sure why atexit() is unavailable, > > I'm not sure either, but these "invalid ELF header" files are usually > some text file that describes how to actually look for the real .so > file. In any case, I couldn't find it either on my system -- the only > place that had it is /usr/lib64/dietlibc/lib-x86_64/libc.so. But I > did get on_exit() in the usual way, except that the man page says that > atexit() should be used instead... Yes, on_exit is deprecated bsdism and it won't exist on non-unix platforms (hey, I want some portability here :) Let alone that it has the wrong prototype! I suspect that atexit is coming from gcc's crt, but I still expected it to be visible in the mzscheme system table. Also, for using scheme_at_exit_closer: that sounds quite inconvenient. What are the exact callback semantics? Do I have to manually call the closers I get in the callbacks? And does the closer get overwritten next time a closer is added? -- vyzo From vyzo at media.mit.edu Tue Dec 9 19:32:40 2008 From: vyzo at media.mit.edu (Dimitris Vyzovitis) Date: Thu Mar 26 02:35:39 2009 Subject: [plt-scheme] reliable exit handlers for foreign functions In-Reply-To: <18751.1772.369735.350057@arabic.ccs.neu.edu> References: <20081209235247.B9BF56500C8@mail-svr1.cs.utah.edu> <18751.1772.369735.350057@arabic.ccs.neu.edu> Message-ID: On Tue, 9 Dec 2008, Eli Barzilay wrote: > In any case, I couldn't find it either on my system -- the only > place that had it is /usr/lib64/dietlibc/lib-x86_64/libc.so. There is another insight here: atexits tend to be dangerous with dsos (ouch when the atexit handler has been unloaded because of a dlclose). ELF provides _init/_fini sections, but of course such functionality is infeasible for ffi. So, just trying find a proper solution: Eli, is it possible to add a facility for exit/unload handlers associated with ffi-libs? Something like (register-unload-handler ffi-lib thunk) to be called right before the dlclose (or when scheme exits, in the case there is no dlclose at all) -- vyzo From noelwelsh at gmail.com Wed Dec 10 03:03:19 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:35:39 2009 Subject: [plt-scheme] Complex Application With Database In-Reply-To: References: Message-ID: Your question is so general it is very difficult to answer. If you want something complicated involving SQL you could look at the Sudoku solvers that have been written in SQL. Search for them -- you will find many links. N. On Tue, Dec 9, 2008 at 11:43 PM, Rohan Golwala wrote: > Hi, > > I am working on a project using Scheme language and PostGRESQL. Can anyone > suggest some higher or complex operations to be performed using SQL > database...? Can anyone help me with any topic or idea and provide an > understandingor a document on it to understand it...? > > Thanks, > > -- > Rohan. From geb_a at yahoo.com Wed Dec 10 12:30:44 2008 From: geb_a at yahoo.com (geb a) Date: Thu Mar 26 02:35:39 2009 Subject: [plt-scheme] Displaying a picture while using instaweb In-Reply-To: <20081210170009.616B9402C2@qua.cs.brown.edu> Message-ID: <476213.46065.qm@web50901.mail.re2.yahoo.com> Does the servlet need to be stored in the web-server servlets directory in order to find an image and display it? I have the following but when viewed in a browser the images are not found. Thanks for your help! Dan (define buttons '(("contactus.htm" "sm-fitness-training-but.jpg") ("specials.htm" "fitness-training-shdlrsm.jpg" ) ("testimonials.htm" "sm-fitness-training-by-jon-.jpg") ("philosophy.htm" "fitness-training-situpsm.jpg") ("programs.htm" "sm-fitness-training-bal.jpg") ("questions.htm" "sm-fitness-training-arm.jpg") ("aboutus.htm" "fitness-training-curlsm.jpg"))) (define (create-button info) `(td () (div ((align "center")) (a((href ,(car info))) (img((border "0") (height "72") (width "105") (src ,(cadr info)))))))) (create-button '("contactus.htm" "sm-fitness-training-but.jpg") ) (define (start request) `(html (head (title "Welcome to the Official Fitness On The Run Fitness Training By: Jon Ham Website") ,meta-statement) (body (table ((width "760") (border "0") (align "center") (cellpadding "0") (cellspacing "0")) (tr ,@(map create-button buttons)))))) --- On Wed, 12/10/08, plt-scheme-request@list.cs.brown.edu wrote: > From: plt-scheme-request@list.cs.brown.edu > Subject: plt-scheme Digest, Vol 40, Issue 29 > To: plt-scheme@list.cs.brown.edu > Date: Wednesday, December 10, 2008, 9:00 AM > Send plt-scheme mailing list submissions to > plt-scheme@list.cs.brown.edu > > To subscribe or unsubscribe via the World Wide Web, visit > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > or, via email, send a message with subject or body > 'help' to > plt-scheme-request@list.cs.brown.edu > > You can reach the person managing the list at > plt-scheme-owner@list.cs.brown.edu > > When replying, please edit your Subject line so it is more > specific > than "Re: Contents of plt-scheme digest..." > > > [Please handle PLT Scheme list administrative tasks through > the Web: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme] > > > Today's Topics: > > 1. Re: reliable exit handlers for foreign functions > (Dimitris Vyzovitis) > 2. Re: Complex Application With Database (Noel Welsh) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 9 Dec 2008 19:32:40 -0500 (EST) > From: Dimitris Vyzovitis > Subject: Re: [plt-scheme] reliable exit handlers for > foreign functions > To: Eli Barzilay > Cc: Matthew Flatt , > plt-scheme@list.cs.brown.edu > Message-ID: > > Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed > > On Tue, 9 Dec 2008, Eli Barzilay wrote: > > > In any case, I couldn't find it either on my > system -- the only > > place that had it is > /usr/lib64/dietlibc/lib-x86_64/libc.so. > > There is another insight here: atexits tend to be dangerous > with dsos > (ouch when the atexit handler has been unloaded because of > a dlclose). > ELF provides _init/_fini sections, but of course such > functionality is > infeasible for ffi. > > So, just trying find a proper solution: > > Eli, is it possible to add a facility for exit/unload > handlers associated > with ffi-libs? > > Something like > (register-unload-handler ffi-lib thunk) > to be called right before the dlclose (or when scheme > exits, in the case > there is no dlclose at all) > > -- vyzo > > > ------------------------------ > > Message: 2 > Date: Wed, 10 Dec 2008 08:03:19 +0000 > From: "Noel Welsh" > Subject: Re: [plt-scheme] Complex Application With Database > To: "Rohan Golwala" > Cc: plt-scheme@list.cs.brown.edu > Message-ID: > > Content-Type: text/plain; charset=ISO-8859-1 > > Your question is so general it is very difficult to answer. > > If you want something complicated involving SQL you could > look at the > Sudoku solvers that have been written in SQL. Search for > them -- you > will find many links. > > N. > > On Tue, Dec 9, 2008 at 11:43 PM, Rohan Golwala > wrote: > > Hi, > > > > I am working on a project using Scheme language and > PostGRESQL. Can anyone > > suggest some higher or complex operations to be > performed using SQL > > database...? Can anyone help me with any topic or idea > and provide an > > understandingor a document on it to understand it...? > > > > Thanks, > > > > -- > > Rohan. > > > End of plt-scheme Digest, Vol 40, Issue 29 > ****************************************** From jay.mccarthy at gmail.com Wed Dec 10 12:23:13 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:35:39 2009 Subject: [plt-scheme] Re: PLT Scheme v4.1.3 In-Reply-To: <92e13fb30812081555x71bc8962k3b0b9efc400bcc40@mail.gmail.com> References: <200811211554.mALFsASw005702@winooski.ccs.neu.edu> <92e13fb30812081555x71bc8962k3b0b9efc400bcc40@mail.gmail.com> Message-ID: I've fixed it in SVN. Apologies for the inconvenience. Jay On Mon, Dec 8, 2008 at 4:55 PM, Shimon Cohen wrote: > Hi > > Thanks for your answer. > > Yes. It ignores the port option. (Why is that?) > > Shimon > > On Mon, Dec 8, 2008 at 5:00 PM, Jay McCarthy wrote: >> >> Hmm, I can't recreate the problem you mention. Perhaps what you are >> noticing is that it ignores the port option in the file and uses the >> one from the command-line or 80. >> >> Jay >> >> On Fri, Dec 5, 2008 at 10:16 PM, skc wrote: >> > Hi >> > >> > Now plt-web-server ignore the configuration table pointed by the -f >> > command line option. >> > >> > regards, >> > Shimon. >> > >> > On Nov 21, 5:54 pm, Eli Barzilay wrote: >> >> PLT Scheme version 4.1.3 is now available from >> >> >> >> http://plt-scheme.org/ >> >> >> >> This is mostly a bug-fix release. >> >> >> >> Notable changes: >> >> >> >> * Web Server: >> >> - Documentation rewritten to separate servlet APIs and server >> >> extension APIs >> >> - HTTPS supported on the "plt-web-server" command-line with "--ssl" >> >> option >> >> - Stateless servlets supported in default configuration through >> >> 'stateless interface-version >> >> - `web-server/servlet-env' supports top-level servlets through >> >> #:servlet-path >> >> - Servlets are served from anywhere in the htdocs directory by >> >> default >> >> - A template system based on the Scribble syntax has been added, see >> >> web-server/templates in the documentation >> >> And many other internal modifications to make extension easier! >> >> >> >> [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! >> >> _________________________________________________ >> >> For list-related administrative tasks: >> >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > _________________________________________________ >> > For list-related administrative tasks: >> > http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > >> >> >> >> -- >> Jay McCarthy >> Assistant Professor / Brigham Young University >> http://jay.teammccarthy.org >> >> "The glory of God is Intelligence" - D&C 93 > > -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From jerronman at gmail.com Wed Dec 10 13:45:43 2008 From: jerronman at gmail.com (Jerron St. Armand) Date: Thu Mar 26 02:35:40 2009 Subject: [plt-scheme] Binding display function with outputting to textfile. Message-ID: <43b8f9310812101045t1a3af054w7a21f93f115038e8@mail.gmail.com> This is in regards to using the display function and outputting to a text file. What I want to do is only write to this file when the user enters the function "hello". I notice a problem from my code below is that when I close the output port I am not able to write anything else to the file, but I believe closing the port is when the writing actually happens. (define o (open-output-file "helloworld.txt")) (define hello (display "hello world" o) ) (close-output-port o) Why does "hello world" get written to helloworld.txt when I run this, even though it is within a function, and I never called that function in my interaction window? Any help would greatly be appreciated Thanks Jerron St. Armand -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081210/25096d49/attachment.htm From rafkind at cs.utah.edu Wed Dec 10 13:52:12 2008 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Thu Mar 26 02:35:40 2009 Subject: [plt-scheme] Binding display function with outputting to textfile. In-Reply-To: <43b8f9310812101045t1a3af054w7a21f93f115038e8@mail.gmail.com> References: <43b8f9310812101045t1a3af054w7a21f93f115038e8@mail.gmail.com> Message-ID: <49400FDC.5000206@cs.utah.edu> > > (define o (open-output-file "helloworld.txt")) > > (define hello > (display "hello world" o) ) > > (close-output-port o) > > > Why does "hello world" get written to helloworld.txt when I run this, > even though it is within a function, and I never called that function > in my interaction window? Because those definitions aren't functions. There is some trickery that `define' uses to create a function for you. (define x 1) ;; x is now 1 when you click run (define (x) 1) ;; x is a function that returns 1 (define (x) 1) is shorthand for (define x (lambda () 1). So you have (define o (open-output-file "hello.txt")), and as soon as you click 'run' the (open-output-file ...) will be executed. Same for `hello'. All the code will be executed as soon as you click run. From Steven_Zukowski at student.uml.edu Wed Dec 10 14:04:48 2008 From: Steven_Zukowski at student.uml.edu (Zukowski, Steven D) Date: Thu Mar 26 02:35:41 2009 Subject: [plt-scheme] Using the Foreign Language Interface. Message-ID: I'm having issues with the Foreign Language Libraries and using them to get at some C++ functions. Essentially my scheme program wants to pass a string to a C++ function that has this signature: double Value_Of_Expr(const string &Expr). I compiled the C++ progame into a DLL using g++ using this: g++ -shared -o fn.dll fn.cpp, but Im not sure if this is correct, it's just what some help website said to do, but I don't know if it is doing it correctly or not. I then try to load the created dll using schemes foreign language library functions: (ffi-lib fn.dll), but this crashes scheme and I have to manually shut down the program. I have tried loading the Value_of_Expr() function using (get-ffi-obj) but the documentation on the docs is lost on me, I can't follow it. Can anyone help me solve this issue? To state it hopefully a bit more clearly: I am trying to interact with a dll I compiled using g++ -shared -o fn.dll fn.cpp. I need to get at the double Value_Of_Expr(const string &Expr) function inside that file and pass it a string from scheme. I then need to retrieve a returned number from the function. I am unsure how to do any of this really >< ~Steve Z -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081210/8cac21a9/attachment.html From eric_krupnik at student.uml.edu Wed Dec 10 14:03:18 2008 From: eric_krupnik at student.uml.edu (Eric Krupnik) Date: Thu Mar 26 02:35:42 2009 Subject: [plt-scheme] SISC Message-ID: <000601c95af9$f6df5dc0$e49e1940$@uml.edu> Hi Group, I am having issues with getting Java and Scheme to interact. I have a running Java application and want to have scheme do some of the basic math in it. How would I do that? Syntax, includes, compiling? I have sisc in the classpath. Thanks, Eric -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081210/98c13416/attachment.htm From geoff at knauth.org Wed Dec 10 14:25:17 2008 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Thu Mar 26 02:35:42 2009 Subject: [plt-scheme] SISC In-Reply-To: <000601c95af9$f6df5dc0$e49e1940$@uml.edu> References: <000601c95af9$f6df5dc0$e49e1940$@uml.edu> Message-ID: <2F96B977-646A-46AB-A2A4-1DCE9510AE7B@knauth.org> On Dec 10, 2008, at 14:03, Eric Krupnik wrote: > I am having issues with getting Java and Scheme to interact. I have > a running Java application and want to have scheme do some of the > basic math in it. > How would I do that? Syntax, includes, compiling? I have sisc in the > classpath. Are you talking about communication between your Java program and a SISC Scheme program? That would be a question for the SISC folks. But basically SISC can talk to most anything in the JVM, so I'd manage things from the SISC side. If you are talking about communication between your Java / SISC program and DrScheme, you could use sockets. Geoff From eddieSull at hotmail.com Wed Dec 10 14:47:48 2008 From: eddieSull at hotmail.com (Eddie Sullivan) Date: Thu Mar 26 02:35:43 2009 Subject: [plt-scheme] Faster CGI Message-ID: If anybody's interested, I've attached a simple wrapper for the FastCGI C library I hacked up when I was first learning Scheme. As a warning, it's probably not the best written code, and it's definitely incomplete, but it may be a starting point. I originally wanted to code up the FastCGI protocol from scratch, but the networking libraries provided with PLT are not low-level enough (I needed some way to determine what type of port stdin was, to differentiate between CGI and FCGI). Anyway, you should be able to run the same code under FastCGI and regular CGI. The function "fcgi-loop" takes a no-parameter-function as parameter, and calls it repeatedly (for FCGI) or once (for CGI). In the case of FCGI, current-input-port, current-output-port, and current-error-port are parameterized for the FCGI versions of those ports. It also tries to fake out the environment variables, but that part's a little hacky. The attached fcgi-cgi.scm shows an example use. It's a (F)CGI script that multiplies the two request parameters num1 and num2. Hope it helps. -Eddie Sullivan > From: "Jay McCarthy" > Subject: Re: [plt-scheme] Faster CGI > > Ah, I understand now. Yes, I would recommend writing something like a > FastCGI wrapper, I imagine that the protocol is fairly simple, if > you'd like me to look it over and give any tips on controlling > resources (i.e., with custodians), I'd be happy to. > > Jay > > On Mon, Dec 8, 2008 at 8:27 PM, Henk Boom wrote: > > 2008/12/8 Shriram Krishnamurthi : > >> Yes, that's correct. But the point is that they make it much more > >> friendly to use continuations if you so desire (ie, if you haven't > >> used the server w/ continuations in a year or two, you may want to > >> check whether these additions pass your necessary benchmarking). > > > > Ok, I see that point. If I am going to use the PLT Web Server then it > > makes sense to investigate those options to make using continuations > > affordable. The problem I was running into, though, was unaffordable > > memory usage even in the absence of continuations. > > > > Henk > > > > -------------- next part -------------- A non-text attachment was scrubbed... Name: fastcgi.scm Type: application/octet-stream Size: 6794 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081210/2f8049ec/fastcgi.obj -------------- next part -------------- A non-text attachment was scrubbed... Name: fcgi-cgi.scm Type: application/octet-stream Size: 1204 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081210/2f8049ec/fcgi-cgi.obj From jensaxel at soegaard.net Wed Dec 10 14:55:56 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:35:43 2009 Subject: [plt-scheme] SISC In-Reply-To: <000601c95af9$f6df5dc0$e49e1940$@uml.edu> References: <000601c95af9$f6df5dc0$e49e1940$@uml.edu> Message-ID: <49401ECC.8090108@soegaard.net> Hi Eric, > I am having issues with getting Java and Scheme to interact. I have a > running Java application and want to have scheme do some of the basic > math in it. > > How would I do that? Syntax, includes, compiling? I have sisc in the > classpath. I have a hunch, you are looking for the sisc-users mailing list: http://sourceforge.net/mail/?group_id=23735 -- Jens Axel S?gaard From ce.rohan at gmail.com Wed Dec 10 15:21:01 2008 From: ce.rohan at gmail.com (Rohan Golwala) Date: Thu Mar 26 02:35:44 2009 Subject: [plt-scheme] Creating views command using scheme and postgresql Message-ID: Hi, Can we create a view in postgresql using the scheme interface i.e executing command in scheme language...? If possible, can anyone provide with a hint or something helpful...? Thanks, -- Rohan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081210/edf8ce01/attachment.html From wand at ccs.neu.edu Wed Dec 10 16:57:06 2008 From: wand at ccs.neu.edu (Mitchell Wand) Date: Thu Mar 26 02:35:44 2009 Subject: [plt-scheme] [Scheme Steering Committee announcements] Scheme Steering Committee: Registration and Nominations start 5 Jan 2009 Message-ID: <1bd18ad50812101357u57d6b836q7cf91ab27b3ad56@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 Wed Dec 10 16:57:06 2008 From: wand at ccs.neu.edu (Mitchell Wand) Date: Thu Mar 26 02:35:45 2009 Subject: [plt-scheme] [Scheme Steering Committee announcements] Scheme Steering Committee: Registration and Nominations start 5 Jan 2009 Message-ID: <1bd18ad50812101357u57d6b836q7cf91ab27b3ad56@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 grettke at acm.org Wed Dec 10 17:26:17 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:35:45 2009 Subject: [plt-scheme] Is UNICODE in the code taboo? Message-ID: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> Hi folks, Though MzScheme supports UNICODE and DrScheme makes it easy to insert symbols, for example type: 1. \rightarrow 2. M:\ to get a right arrow, I am guessing that it is sort of a taboo to include UNICODE symbols in the code. Is it true? If so, why? I am guessing one reason against it is every non-UNICODE-friendly tool folks might use: Firefox for code listing (not sure beyond code listing) enscript Emacs Best wishes, Grant From jensaxel at soegaard.net Wed Dec 10 18:26:08 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:35:45 2009 Subject: [plt-scheme] Is UNICODE in the code taboo? In-Reply-To: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> Message-ID: <49405010.2080404@soegaard.net> Grant Rettke skrev: > Hi folks, > > Though MzScheme supports UNICODE and DrScheme makes it easy to insert > symbols, for example type: > > 1. \rightarrow > 2. M:\ > > to get a right arrow, I am guessing that it is sort of a taboo to > include UNICODE symbols in the code. > > Is it true? If so, why? It ought not to be. > I am guessing one reason against it is every non-UNICODE-friendly tool > folks might use: Well, everything works in DrScheme ;-) > Firefox for code listing (not sure beyond code listing) And the code at PLaneT correctly show e.g. lambdas. See for example the bottom of: http://planet.plt-scheme.org/package-source/robby/redex.plt/4/4/schemeunit.ss > enscript I prefer a2ps - but, er, that doesn't support unicode. > Emacs No problems there, at least if you remember to choose the correct encoding. -- Jens Axel S?gaard From vyzo at media.mit.edu Wed Dec 10 19:30:58 2008 From: vyzo at media.mit.edu (Dimitris Vyzovitis) Date: Thu Mar 26 02:35:45 2009 Subject: [plt-scheme] Is UNICODE in the code taboo? In-Reply-To: <49405010.2080404@soegaard.net> References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <49405010.2080404@soegaard.net> Message-ID: On Thu, 11 Dec 2008, Jens Axel Soegaard wrote: >> Emacs > > No problems there, at least if you remember to choose the correct > encoding. Or if people put the damn encoding at the modeline it would be much easier. Having said that, no it is not that simple: 1) the font must support the extra characters (many monospace fonts, the ones a programmer might use, get you nasty boxes instead) 2) when you are running in a terminal you get extra hoops to jump through, because you have to enable multibyte etc. And you must be in a sane terminal that works well with unicode. 3) Oh, and when you are running in a screen more hoops to jump. Recurse in hierarchies of screens running in different machines and you start to appreciate pain. 4) Oh, and pretty much all programs you expect to run in the command line for quick code processing tend to break with unicode. 5) ... \infty) Don't use unicode in the code :p -- vyzo From eli at barzilay.org Wed Dec 10 20:03:56 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:35:46 2009 Subject: [plt-scheme] Using the Foreign Language Interface. In-Reply-To: References: Message-ID: <18752.26364.375534.991429@arabic.ccs.neu.edu> On Dec 10, Zukowski, Steven D wrote: > > I'm having issues with the Foreign Language Libraries and using them > to get at some C++ functions. The short answer is that you can't. C++ libraries use mangled names and other tweaks that make interfacing them from Scheme very difficult, perhaps even impossible to do in a portable way. Your best shot is to write a small C library that iteracts with the C++ code, and interface that (the C library) from Scheme. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From robby at cs.uchicago.edu Wed Dec 10 20:53:39 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:35:46 2009 Subject: [plt-scheme] Is UNICODE in the code taboo? In-Reply-To: References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <49405010.2080404@soegaard.net> Message-ID: <932b2f1f0812101753s746dac8ak4cc70bad18f6f4a0@mail.gmail.com> It is sad to live with all those broken tools! At least in partial answer: if you are entering the unicode in drscheme you presumably have a programmer friendly font for the X11 version of Emacs. My experience with emacs in this regard is that it works well, once I find the magic incantation that says 'this file is in utf-8'. Robby On Wed, Dec 10, 2008 at 6:30 PM, Dimitris Vyzovitis wrote: > On Thu, 11 Dec 2008, Jens Axel Soegaard wrote: > >>> Emacs >> >> No problems there, at least if you remember to choose the correct >> encoding. > > Or if people put the damn encoding at the modeline it would be much easier. > Having said that, no it is not that simple: > 1) the font must support the extra characters (many monospace fonts, the > ones a programmer might use, get you nasty boxes instead) > 2) when you are running in a terminal you get extra hoops to jump > through, because you have to enable multibyte etc. And you must be in > a sane terminal that works well with unicode. > 3) Oh, and when you are running in a screen more hoops to jump. > Recurse in hierarchies of screens running in different machines and you > start to appreciate pain. > 4) Oh, and pretty much all programs you expect to run in the command line > for quick code processing tend to break with unicode. > 5) ... > \infty) Don't use unicode in the code :p > > -- vyzo > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From vyzo at media.mit.edu Wed Dec 10 21:01:23 2008 From: vyzo at media.mit.edu (Dimitris Vyzovitis) Date: Thu Mar 26 02:35:46 2009 Subject: [plt-scheme] Is UNICODE in the code taboo? In-Reply-To: <932b2f1f0812101753s746dac8ak4cc70bad18f6f4a0@mail.gmail.com> References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <49405010.2080404@soegaard.net> <932b2f1f0812101753s746dac8ak4cc70bad18f6f4a0@mail.gmail.com> Message-ID: On Wed, 10 Dec 2008, Robby Findler wrote: > It is sad to live with all those broken tools! Too bad that some of those "broken" tools are irreplacable. > At least in partial > answer: if you are entering the unicode in drscheme you presumably > have a programmer friendly font for the X11 version of Emacs. emacs is fine on x11, the problem is when you are in the terminal or going through tunnels. The font is quite restrictive tho, some of my favorite fonts give me boxes (iso10646 ho ho ho) and I end up switching fonts on the fly to read them. > My > experience with emacs in this regard is that it works well, once I > find the magic incantation that says 'this file is in utf-8'. C-x RET r utf-8 Better just set the modeline correctly tho. -- vyzo From grettke at acm.org Wed Dec 10 21:22:17 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:35:46 2009 Subject: [plt-scheme] Is UNICODE in the code taboo? In-Reply-To: References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <49405010.2080404@soegaard.net> <932b2f1f0812101753s746dac8ak4cc70bad18f6f4a0@mail.gmail.com> Message-ID: <756daca50812101822g5c274a51ub15c8aaeea034fa9@mail.gmail.com> > Better just set the modeline correctly tho. What is the right setting? From robby at cs.uchicago.edu Wed Dec 10 21:12:24 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:35:46 2009 Subject: [plt-scheme] Is UNICODE in the code taboo? In-Reply-To: References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <49405010.2080404@soegaard.net> <932b2f1f0812101753s746dac8ak4cc70bad18f6f4a0@mail.gmail.com> Message-ID: <932b2f1f0812101812s541edc88gc7a005be17c77519@mail.gmail.com> On Wed, Dec 10, 2008 at 8:01 PM, Dimitris Vyzovitis wrote: > On Wed, 10 Dec 2008, Robby Findler wrote: > >> It is sad to live with all those broken tools! > > Too bad that some of those "broken" tools are irreplacable. I just meant that (apparently) no one is maintaining them anymore. I don't mean to doubt their value. Thanks for the incantation. I actually found a different one for my init file so that all files open up in utf-8 (it seems that all files I edit in practice are in utf-8). Robby From vyzo at media.mit.edu Wed Dec 10 21:29:47 2008 From: vyzo at media.mit.edu (Dimitris Vyzovitis) Date: Thu Mar 26 02:35:47 2009 Subject: [plt-scheme] Is UNICODE in the code taboo? In-Reply-To: <932b2f1f0812101812s541edc88gc7a005be17c77519@mail.gmail.com> References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <49405010.2080404@soegaard.net> <932b2f1f0812101753s746dac8ak4cc70bad18f6f4a0@mail.gmail.com> <932b2f1f0812101812s541edc88gc7a005be17c77519@mail.gmail.com> Message-ID: On Wed, 10 Dec 2008, Robby Findler wrote: > On Wed, Dec 10, 2008 at 8:01 PM, Dimitris Vyzovitis wrote: > > I just meant that (apparently) no one is maintaining them anymore. I > don't mean to doubt their value. I know, I wasn't being sarcastic towards you. Even worse, even when the tools are actively maintained you can easily find yourself on a system that isn't up-to-date or configured for unicode. > > Thanks for the incantation. I actually found a different one for my > init file so that all files open up in utf-8 (it seems that all files > I edit in practice are in utf-8). The blanket? (setq default-buffer-file-coding-system 'utf-8) should do it. Also, if you do use a rodent with emacs, you can simply click on the modeline to switch on a buffer bases. -- vyzo From vyzo at media.mit.edu Wed Dec 10 21:37:42 2008 From: vyzo at media.mit.edu (Dimitris Vyzovitis) Date: Thu Mar 26 02:35:47 2009 Subject: [plt-scheme] Is UNICODE in the code taboo? In-Reply-To: <756daca50812101822g5c274a51ub15c8aaeea034fa9@mail.gmail.com> References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <49405010.2080404@soegaard.net> <932b2f1f0812101753s746dac8ak4cc70bad18f6f4a0@mail.gmail.com> <756daca50812101822g5c274a51ub15c8aaeea034fa9@mail.gmail.com> Message-ID: On Wed, 10 Dec 2008, Grant Rettke wrote: >> Better just set the modeline correctly tho. > > What is the right setting? coding: utf-8 should do it. Eg for scheme files: ;; -*- Mode: Scheme; coding: utf-8 -*- -- vyzo From andre.mayers at usherbrooke.ca Wed Dec 10 21:47:31 2008 From: andre.mayers at usherbrooke.ca (Andre Mayers) Date: Thu Mar 26 02:35:47 2009 Subject: [plt-scheme] how to quote identifier in macro In-Reply-To: References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <49405010.2080404@soegaard.net> <932b2f1f0812101753s746dac8ak4cc70bad18f6f4a0@mail.gmail.com> <932b2f1f0812101812s541edc88gc7a005be17c77519@mail.gmail.com> Message-ID: <006701c95b3a$d04d2fc0$70e78f40$@mayers@usherbrooke.ca> The following program=20 --- #lang scheme (define attr '(a1 a2 a3)) (define vals '(1 2 3)) (define slot-value (=A6=CB (slot-name objet) (cadr (assq (quote slot-name) objet)))) (define-syntax (tata stx) (syntax-case stx () [(_ a v (s ps ...) body ...) (syntax=20 (eval (list '=A6=CB '(self ps ...)=20 (list* 'let (map (=A6=CB (p_attr)=20 (list p_attr (list slot-value = p_attr 'self))) a)=20 '(body ...))) (make-base-namespace)))])) ((tata attr vals (self p1 p2) (display self) (newline) (+ p2 a1)) '((a1 10)(a2 20)(a3 30)) 4 5)=20 =3D=3D=3D give the following result --- . . reference to undefined identifier: a1 =3D=3D=3D It is the expected result because the expression given to eval is=20 (=A6=CB (self p1 p2) (let ((a1 (# a1 self)) (a2 (# a2 self)) (a3 (# a3 self))) (display self) (newline) (+ p2 a1))) and the ai in (# ai self) is not quoted.=20 My first problem is how to quote it.=20 I may have also a problem to get rid of the eval.=20 Any help will be 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/~amayers > From lunarc.lists at gmail.com Wed Dec 10 22:02:00 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:35:47 2009 Subject: [plt-scheme] Is UNICODE in the code taboo? In-Reply-To: <756daca50812101822g5c274a51ub15c8aaeea034fa9@mail.gmail.com> References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <49405010.2080404@soegaard.net> <932b2f1f0812101753s746dac8ak4cc70bad18f6f4a0@mail.gmail.com> <756daca50812101822g5c274a51ub15c8aaeea034fa9@mail.gmail.com> Message-ID: 2008/12/10 Grant Rettke : >> Better just set the modeline correctly tho. > > What is the right setting? This depends on whether the people who will edit the file are using vim or emacs (or something else), doesn't it? Henk From chust at web.de Wed Dec 10 22:39:50 2008 From: chust at web.de (Thomas Chust) Date: Thu Mar 26 02:35:47 2009 Subject: [plt-scheme] Using the Foreign Language Interface. In-Reply-To: <18752.26364.375534.991429@arabic.ccs.neu.edu> References: <18752.26364.375534.991429@arabic.ccs.neu.edu> Message-ID: <49408B86.1030408@web.de> Am 11.12.2008 2:03 Uhr, schrieb Eli Barzilay: > On Dec 10, Zukowski, Steven D wrote: >> I'm having issues with the Foreign Language Libraries and using them >> to get at some C++ functions. > > The short answer is that you can't. C++ libraries use mangled names > and other tweaks that make interfacing them from Scheme very > difficult, > [...] ... which is precisely the reason why every decent C++ compiler supports extern "C" declarations to switch off the name magling and export the symbols just like a plain C compiler would and usually issue warnings or errors if those functions try to use any fancy, C-incompatible features of C++. Just add the following to your header file for functions that have to be called from the outside world: #ifdef __cplusplus extern "C" { #endif /* Your declarations go here */ #ifdef __cplusplus } #endif Interfacing to object oriented C++ code is a different story, though, and is usually not possible at all without writing some wrapper code. If you also want cross language exception handling or even cross language inheritance hierarchies, the amount of auxiliary code needed will probably exceed the amount of actual program logic, but using some automatic binding tool like SWIG you can generate it automatically ;-) cu, Thomas From rafkind at cs.utah.edu Thu Dec 11 02:21:49 2008 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Thu Mar 26 02:35:47 2009 Subject: [plt-scheme] syntax identifier used out of context Message-ID: <4940BF8D.9040503@cs.utah.edu> I'm wondering why I get this error from the following code. I was helping someone on IRC so I don't have a real use case, just wondering what the error means. If I change bar2 to bar in the template then it works. Also it seems like I should be able to replace the lambda in syntax-parameterize by just bar2, but then I get an error about bar2 not being bound in the transformer environment. > compile: identifier used out of context in: bar2 #lang scheme (require scheme/stxparam) (define-syntax-parameter x (lambda (stx) (error "dont use x"))) (define-syntax bar (syntax-rules () ((_ q) (+ 1 q)))) (define-syntax (foo stx) (define (bar2 stx3) (syntax-case stx3 () ((_ q) #'(+ 1 q)))) (syntax-case stx () ((_ pat) #'(syntax-parameterize ([x (lambda (stx3) (syntax-case stx3 () ((_ . q) #'(bar2 . q)))) ]) (begin (printf "You won ~a!\n" pat)))))) (foo (x 4)) From noelwelsh at gmail.com Thu Dec 11 03:59:34 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:35:47 2009 Subject: [plt-scheme] syntax identifier used out of context In-Reply-To: <4940BF8D.9040503@cs.utah.edu> References: <4940BF8D.9040503@cs.utah.edu> Message-ID: bar2 is define'd, so it is bound in the evaluation environment, not the transformation environment. So that explains the second error. If you want to use it in the transformer env you should define-for-syntax it. As for the first, I'm not sure. But I think this code can't work as bar2 is defined as a fn stx -> stx but it is used in the eval env, so it won't receive stx of q but rather the actual value of q. Hope that is correct... N. On Thu, Dec 11, 2008 at 7:21 AM, Jon Rafkind wrote: > I'm wondering why I get this error from the following code. ... From olopierpa at gmail.com Thu Dec 11 04:53:39 2008 From: olopierpa at gmail.com (Pierpaolo Bernardi) Date: Thu Mar 26 02:35:48 2009 Subject: [plt-scheme] Is UNICODE in the code taboo? In-Reply-To: References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <49405010.2080404@soegaard.net> <932b2f1f0812101753s746dac8ak4cc70bad18f6f4a0@mail.gmail.com> <756daca50812101822g5c274a51ub15c8aaeea034fa9@mail.gmail.com> Message-ID: <7352e43a0812110153w6e4dce21h1735c8ae2aaa1760@mail.gmail.com> On Thu, Dec 11, 2008 at 3:29 AM, Dimitris Vyzovitis wrote: > On Wed, 10 Dec 2008, Robby Findler wrote: > >> On Wed, Dec 10, 2008 at 8:01 PM, Dimitris Vyzovitis >> wrote: >> Thanks for the incantation. I actually found a different one for my >> init file so that all files open up in utf-8 (it seems that all files >> I edit in practice are in utf-8). > > The blanket? (setq default-buffer-file-coding-system 'utf-8) should do it. Even better, put: (set-language-environment 'utf-8) in the init file. This will make emacs behave the best it can to accomodate utf-8 users P. From marek at xivilization.net Thu Dec 11 06:01:53 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:35:48 2009 Subject: [plt-scheme] Is UNICODE in the code taboo? In-Reply-To: <49405010.2080404@soegaard.net> References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <49405010.2080404@soegaard.net> Message-ID: <20081211120153.159f0ede@halmanfloyd.lan.local> On Thu, 11 Dec 2008 00:26:08 +0100 Jens Axel Soegaard wrote: > > enscript > > I prefer a2ps - but, er, that doesn't support unicode. I'd go for pygmentize (from the pygments package) as it supports numerous languages and about as many output formats. regards, Marek From robby at cs.uchicago.edu Thu Dec 11 11:10:48 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:35:48 2009 Subject: [plt-scheme] Is UNICODE in the code taboo? In-Reply-To: <7352e43a0812110153w6e4dce21h1735c8ae2aaa1760@mail.gmail.com> References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <49405010.2080404@soegaard.net> <932b2f1f0812101753s746dac8ak4cc70bad18f6f4a0@mail.gmail.com> <756daca50812101822g5c274a51ub15c8aaeea034fa9@mail.gmail.com> <7352e43a0812110153w6e4dce21h1735c8ae2aaa1760@mail.gmail.com> Message-ID: <932b2f1f0812110810v7dbcabc2ga23be3ff8acb7427@mail.gmail.com> On Thu, Dec 11, 2008 at 3:53 AM, Pierpaolo Bernardi wrote: > Even better, put: > > (set-language-environment 'utf-8) > My C-h f on set-language-environment says that the input must be a string. Does that vary from version to version of Emacs? Thanks, Robby From olopierpa at gmail.com Thu Dec 11 11:25:55 2008 From: olopierpa at gmail.com (Pierpaolo Bernardi) Date: Thu Mar 26 02:35:48 2009 Subject: [plt-scheme] Is UNICODE in the code taboo? In-Reply-To: <932b2f1f0812110810v7dbcabc2ga23be3ff8acb7427@mail.gmail.com> References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <49405010.2080404@soegaard.net> <932b2f1f0812101753s746dac8ak4cc70bad18f6f4a0@mail.gmail.com> <756daca50812101822g5c274a51ub15c8aaeea034fa9@mail.gmail.com> <7352e43a0812110153w6e4dce21h1735c8ae2aaa1760@mail.gmail.com> <932b2f1f0812110810v7dbcabc2ga23be3ff8acb7427@mail.gmail.com> Message-ID: <7352e43a0812110825x1ef04dfepec3db9dee336e98@mail.gmail.com> On Thu, Dec 11, 2008 at 5:10 PM, Robby Findler wrote: > On Thu, Dec 11, 2008 at 3:53 AM, Pierpaolo Bernardi wrote: >> Even better, put: >> >> (set-language-environment 'utf-8) >> > > My C-h f on set-language-environment says that the input must be a > string. Does that vary from version to version of Emacs? My version says the same. However, the implementation of set-language-environment contains the following snippet: ... (if language-name (if (symbolp language-name) (setq language-name (symbol-name language-name))) ... so, using a string is the right thing, but a symbol is currently working too. (I must have seen 'utf-8 used somewhere and copied it without checking the documentation :) Cheers P. From swarat at cse.psu.edu Mon Dec 8 13:57:28 2008 From: swarat at cse.psu.edu (Swarat Chaudhuri) Date: Thu Mar 26 02:35:48 2009 Subject: [plt-scheme] Call for papers: POPL 2010 Message-ID: ********************************************************************* * 37th ACM SIGPLAN-SIGACT Symposium * on * Principles of Programming Languages * * January, 2010 * Spain (details to be announced later). * * Call for Papers * * http://www.cse.psu.edu/popl/10 * ********************************************************************* Important dates: Abstract submission 8 July 2009 (Wednesday) Paper submission 15 July 2009 (Wednesday) Author response period 17-18 September 2009 (Thursday-Friday) Author notification 1 October 2009 (Thursday) Camera ready 2 November 2009 (Monday) Conference January 2010 (detailed dates to be announced) Scope The annual Symposium on Principles of Programming Languages is a forum for the discussion of all aspects of programming languages and systems, with emphasis on how principles underpin practice. Both theoretical and experimental papers are welcome, on topics ranging from formal frameworks to experience reports. Advice to Authors Submissions on a diversity of topics are sought, particularly ones that identify new research directions. POPL 2009 is not limited to topics discussed in previous symposia. Authors concerned about the appropriateness of a topic may communicate by electronic mail with the program chair prior to submission. Explaining a known idea in a new way may make as strong a contribution as inventing a new one. Continuing a tradition established in POPL 2008, we encourage the submission of pearls: elegant essays that illustrate an idea, for example by developing a short program. (Advice on writing pearls can be found in the ICFP 2008 Call for Papers.) However, there is no formal separation of categories and no need to explicitly label pearls as such: ALL papers, whether pearl or otherwise, will be judged on a combination of correctness, significance, novelty, clarity, and elegance. Each paper should explain its contributions in both general and technical terms, identifying what has been accomplished, explaining why it is significant, and comparing it with previous work. Authors should strive to make their papers understandable to a broad audience. More advice on writing technical papers can be found on the SIGPLAN Author Information page. Submission Guidelines Authors should submit an abstract of at most 300 words and a full paper of no more than 12 pages (including bibliography and appendices). The submission deadline and length limitations are firm. Submissions that do not meet these guidelines may not be considered. Submissions should be in standard ACM SIGPLAN conference format: two columns, nine-point font on a ten-point baseline, with columns 20pc (3.33in) wide and 54pc (9in) tall, with a column gutter of 2pc (0.33in). Detailed formatting guidelines are available on the SIGPLAN Author Information page (http://www.sigplan.org/authorInformation.htm), along with a LaTeX class file and template. Papers must be submitted in PDF format and printable on US Letter size paper. Individuals for whom this requirement is a hardship should contact the program chair at least one week before the deadline. Submitted papers must adhere to the SIGPLAN Republication Policy. Concurrent submissions to other conferences, workshops, journals, or similar forums of publication are not allowed. The ACM copyright notice is not required of submissions, only of accepted papers. Authors of accepted papers will be required to sign the ACM copyright form. Proceedings will be published by ACM Press. Categories and keywords need not be included in the submission. The URL for submission of abstracts and papers will be announced nearer to the deadline. Author Response Period Authors will have a 48-hour period to read and respond to the reviews of their papers before the PC meeting. Details of the response process will be announced by e-mail a few days beforehand. Student Attendees Students with accepted papers or posters are encouraged to apply for a SIGPLAN PAC grant that will help to cover travel expenses to POPL. Details on the PAC program and the application can be found at http://www.sigplan.org/PAC.htm. PAC also offers support for companion travel. Conference Chair: Manuel Hermenegildo Director, IMDEA-Software C.S. Department T.U. of Madrid (UPM) herme at fi.upm.es Program Chair: Jens Palsberg UCLA Computer Science Department 4531K Boelter Hall Los Angeles, CA 90095, USA palsberg at ucla.edu Program Committee: Alex Aiken (Stanford University) Rajeev Alur (University of Pennsylvania) Cristiano Calcagno (Imperial College, London) Juan Chen (Microsoft Research) Wei-Ngan Chin (National University of Singapore) Mads Dam (Royal Institute of Technology, Stockholm) Erik Ernst (Aarhus University) John Field (IBM T. J. Watson Research Center) Cormac Flanagan (UC Santa Cruz) Roberto Giacobazzi (Universita' degli Studi di Verona) Rachid Guerraoui (EPFL) Sorin Lerner (UC San Diego) Calvin Lin (University of Texas, Austin) Atsushi Ohori (Tohoku University) Jens Palsberg (UCLA) Andrey Rybalchenko (Max Planck Institute for Software Systems) Amr Sabry (Indiana University) Mooly Sagiv (Tel-Aviv University) Peter Sewell (University of Cambridge) Tayssir Touili (CNRS-LIAFA) *************************************************************************** From shruthi.rajegowda at gmail.com Mon Dec 8 15:06:34 2008 From: shruthi.rajegowda at gmail.com (sia007) Date: Thu Mar 26 02:35:49 2009 Subject: [plt-scheme] Webservelet in Scheme Message-ID: PLT Scheme is very interesting and simple. I was playing with the webservlet examples in the collection folder. Particularly, the quiz.ss doesnt run and gives error. can anyone please explain in detail how can I run this quiz.ss?? I tried in PLT 4.1.3 and Module Lang,Yet i am unable to run this file. Any help would be appreciated Thanks in advance Sia From Sophana_Son at student.uml.edu Wed Dec 10 15:48:38 2008 From: Sophana_Son at student.uml.edu (Sophana_Son@student.uml.edu) Date: Thu Mar 26 02:35:49 2009 Subject: [plt-scheme] XML Parsing & Writing Library Message-ID: <259379e8-7769-4a13-8af3-7b89fa0365bc@v13g2000vbb.googlegroups.com> I'm trying to create an XML file using the XML Parsing & Writing Library. I created a list of from the xexpr->xml procedure and unsure what the next steps are. Can anyone help me? From vyzo at media.mit.edu Thu Dec 11 12:11:21 2008 From: vyzo at media.mit.edu (Dimitris Vyzovitis) Date: Thu Mar 26 02:35:49 2009 Subject: [plt-scheme] Is UNICODE in the code taboo? In-Reply-To: <932b2f1f0812110810v7dbcabc2ga23be3ff8acb7427@mail.gmail.com> References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <49405010.2080404@soegaard.net> <932b2f1f0812101753s746dac8ak4cc70bad18f6f4a0@mail.gmail.com> <756daca50812101822g5c274a51ub15c8aaeea034fa9@mail.gmail.com> <7352e43a0812110153w6e4dce21h1735c8ae2aaa1760@mail.gmail.com> <932b2f1f0812110810v7dbcabc2ga23be3ff8acb7427@mail.gmail.com> Message-ID: On Thu, 11 Dec 2008, Robby Findler wrote: > On Thu, Dec 11, 2008 at 3:53 AM, Pierpaolo Bernardi wrote: >> Even better, put: >> >> (set-language-environment 'utf-8) >> > > My C-h f on set-language-environment says that the input must be a > string. Does that vary from version to version of Emacs? No. This sets the entire lang environment, input methods, encodings, etc. You want to use something that is recognized as a language env however, 'utf-8 is just an encoding. See the language-info-alist variable for valid language envs. -- vyzo From jay.mccarthy at gmail.com Thu Dec 11 12:08:54 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:35:49 2009 Subject: [plt-scheme] Webservelet in Scheme In-Reply-To: References: Message-ID: Step 1: $ plt-web-server -p 8080 Step 2: $ open http://localhost:8080/servlets/examples/quiz.ss Jay On Mon, Dec 8, 2008 at 1:06 PM, sia007 wrote: > PLT Scheme is very interesting and simple. I was playing with the > webservlet examples in the collection folder. Particularly, the > quiz.ss doesnt run and gives error. can anyone please explain in > detail how can I run this quiz.ss?? I tried in PLT 4.1.3 and Module > Lang,Yet i am unable to run this file. Any help would be appreciated > Thanks in advance > Sia > _________________________________________________ > 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 Thu Dec 11 12:11:20 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:35:49 2009 Subject: [plt-scheme] XML Parsing & Writing Library In-Reply-To: <259379e8-7769-4a13-8af3-7b89fa0365bc@v13g2000vbb.googlegroups.com> References: <259379e8-7769-4a13-8af3-7b89fa0365bc@v13g2000vbb.googlegroups.com> Message-ID: >From "Reading and Writing XML" [1] (write-xml/content content) takes xml content and writes it. (write-xml/content (xexpr->xml `(html (body (p "Hey!"))))) writes:

Hey!

Jay 1. http://docs.plt-scheme.org/xml/index.html#(part._.Reading_and_.Writing_.X.M.L) On Wed, Dec 10, 2008 at 1:48 PM, Sophana_Son@student.uml.edu wrote: > I'm trying to create an XML file using the XML Parsing & Writing > Library. I created a list of from the xexpr->xml procedure > and unsure what the next steps are. Can anyone help me? > _________________________________________________ > 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 rafkind at cs.utah.edu Thu Dec 11 12:40:20 2008 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Thu Mar 26 02:35:49 2009 Subject: [plt-scheme] syntax identifier used out of context In-Reply-To: References: <4940BF8D.9040503@cs.utah.edu> Message-ID: <49415084.9070306@cs.utah.edu> Noel Welsh wrote: > bar2 is define'd, so it is bound in the evaluation environment, not > the transformation environment. So that explains the second error. > If you want to use it in the transformer env you should > define-for-syntax it. > > Thats true, but define-for-syntax is disallowed inside another define-syntax. (define-syntax (foo stx) (define-for-syntax (bar) ...)) > illegal use (not at top-level) in: (define-values-for-syntax (bar2) > As for the first, I'm not sure. But I think this code can't work as > bar2 is defined as a fn stx -> stx but it is used in the eval env, so > it won't receive stx of q but rather the actual value of q. > > I'm not sure about that since bar is a fn stx -> stx as well, its just defined outside the foo function. > Hope that is correct... > N. > > On Thu, Dec 11, 2008 at 7:21 AM, Jon Rafkind wrote: > >> I'm wondering why I get this error from the following code. ... >> From noelwelsh at gmail.com Thu Dec 11 14:37:07 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:35:49 2009 Subject: [plt-scheme] how to quote identifier in macro In-Reply-To: <-6799851472409630867@unknownmsgid> References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <49405010.2080404@soegaard.net> <932b2f1f0812101753s746dac8ak4cc70bad18f6f4a0@mail.gmail.com> <932b2f1f0812101812s541edc88gc7a005be17c77519@mail.gmail.com> <-6799851472409630867@unknownmsgid> Message-ID: On Thu, Dec 11, 2008 at 2:47 AM, Andre Mayers wrote: > My first problem is how to quote it. Just write (quote some-expr) > I may have also a problem to get rid of the eval. Just write out the program code you want in that place: (lambda (self ps ...) ...) Also, underscores are not really Scheme style. Use hyphens instead. I.e. foo-bar not foo_bar HTH, Noel From mflatt at cs.utah.edu Thu Dec 11 14:59:37 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:35:49 2009 Subject: [plt-scheme] syntax identifier used out of context In-Reply-To: <4940BF8D.9040503@cs.utah.edu> References: <4940BF8D.9040503@cs.utah.edu> Message-ID: <20081211195937.8B534650085@mail-svr1.cs.utah.edu> You could move `bar2' out of `foo' using `define-for-syntax', (define-for-syntax (bar2 stx3) (syntax-case stx3 () ((_ q) #'(+ 1 q)))) and then it works to replace the lambda with `bar2', as you expected. You could also leave the lambda so that the expansion of `x' refers to `bar2', in which base `bar2' needs to be a macro, but still outside of `foo': (define-syntax (bar2 stx3) (syntax-case stx3 () ((_ q) #'(+ 1 q)))) (define-sytax (foo stx) (syntax-case stx ....)) If you keep the `bar2' definition inside of `foo' and if `foo' returns a syntax object that refers to `bar2', then you get an out-of-context error. That's because a syntax object captures binding information, but not values; the macro expander knows that `bar2' was lexically bound, but the dynamic invocation of the `foo' transformer has already returned at the point for expanding `bar2', so there's no value for the binding in the compile-time environment. At Thu, 11 Dec 2008 00:21:49 -0700, Jon Rafkind wrote: > I'm wondering why I get this error from the following code. I was > helping someone on IRC so I don't have a real use case, just wondering > what the error means. If I change bar2 to bar in the template then it > works. Also it seems like I should be able to replace the lambda in > syntax-parameterize by just bar2, but then I get an error about bar2 not > being bound in the transformer environment. > > > compile: identifier used out of context in: bar2 > > #lang scheme > > (require scheme/stxparam) > > (define-syntax-parameter x (lambda (stx) (error "dont use x"))) > > (define-syntax bar > (syntax-rules () > ((_ q) (+ 1 q)))) > > (define-syntax (foo stx) > (define (bar2 stx3) > (syntax-case stx3 () > ((_ q) #'(+ 1 q)))) > (syntax-case stx () > ((_ pat) #'(syntax-parameterize ([x (lambda (stx3) > (syntax-case stx3 () > ((_ . q) #'(bar2 . q)))) ]) > (begin > (printf "You won ~a!\n" pat)))))) > > (foo (x 4)) > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From andre.mayers at usherbrooke.ca Thu Dec 11 17:14:47 2008 From: andre.mayers at usherbrooke.ca (Andre Mayers) Date: Thu Mar 26 02:35:50 2009 Subject: [plt-scheme] how to quote identifier in macro In-Reply-To: References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <49405010.2080404@soegaard.net> <932b2f1f0812101753s746dac8ak4cc70bad18f6f4a0@mail.gmail.com> <932b2f1f0812101812s541edc88gc7a005be17c77519@mail.gmail.com> <-6799851472409630867@unknownmsgid> Message-ID: <003201c95bdd$e14c3de0$a3e4b9a0$@mayers@usherbrooke.ca> If I quote the identifier the expression given to eval becomes --- (? (self p1 p2) (let ((a1 (# p-attr self)) (a2 (# p-attr self)) (a3 (# p-attr self))) (display self) (newline) (+ p2 a1))) therefore the evaluation of ((tata attr vals (self p1 p2) (display self) (newline) (+ p2 a1)) '((a1 10)(a2 20)(a3 30)) 4 5) ---> reference to undefined identifier: p-attr === and what I want is --- (? (self p1 p2) (let ((a1 (slot-value 'a1 self)) (a2 (slot-value 'a2 self)) (a3 (slot-value 'a3 self))) (display self) (newline) (+ p2 a1))) === and, if I unquote it, I got --- (? (self p1 p2) (let ((a1 (# a1 self)) (a2 (# a2 self)) (a3 (# a3 self))) (display self) (newline) (+ p2 a1))) === The complete program is below (define slot-value (? (slot-name objet) (cadr (assq (quote slot-name) objet)))) (define-syntax (tata stx) (syntax-case stx () [(_ a v (s ps ...) body ...) (syntax ; (eval (list '? '(self ps ...) (list* 'let (map (? (p-attr) (list p-attr (list slot-value (quote p-attr) 'self))) a) '(body ...))) ; (make-base-namespace)) )])) (tata attr vals (self p1 p2) (display self) (newline) (+ p2 a1)) -----Message d'origine----- De?: Noel Welsh [mailto:noelwelsh@gmail.com] ... > My first problem is how to quote it. Just write (quote some-expr) > I may have also a problem to get rid of the eval. Just write out the program code you want in that place: (lambda (self ps ...) ...) Also, underscores are not really Scheme style. Use hyphens instead. I.e. foo-bar not foo_bar HTH, Noel From yinso.chen at gmail.com Thu Dec 11 17:36:40 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:35:50 2009 Subject: [plt-scheme] how to quote identifier in macro In-Reply-To: <-666531042596248776@unknownmsgid> References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <49405010.2080404@soegaard.net> <932b2f1f0812101753s746dac8ak4cc70bad18f6f4a0@mail.gmail.com> <932b2f1f0812101812s541edc88gc7a005be17c77519@mail.gmail.com> <-6799851472409630867@unknownmsgid> <-666531042596248776@unknownmsgid> Message-ID: <779bf2730812111436s7dff1da7r55e9e2b38431b268@mail.gmail.com> 2008/12/11 Andre Mayers > (define slot-value > (? (slot-name objet) > (cadr (assq (quote slot-name) objet)))) > The (quote slot-name) is most likely redundant. > > (define-syntax (tata stx) > (syntax-case stx () > [(_ a v (s ps ...) body ...) > (syntax > ; (eval > (list '? '(self ps ...) > (list* 'let (map (? (p-attr) > (list p-attr > (list slot-value (quote p-attr) > 'self))) > a) > '(body ...))) > Try `(quote ,p-attr) instead of (quote p-attr) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081211/efe38b56/attachment.htm From andre.mayers at usherbrooke.ca Thu Dec 11 18:32:23 2008 From: andre.mayers at usherbrooke.ca (Andre Mayers) Date: Thu Mar 26 02:35:51 2009 Subject: [plt-scheme] how to quote identifier in macro In-Reply-To: <779bf2730812111436s7dff1da7r55e9e2b38431b268@mail.gmail.com> References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <49405010.2080404@soegaard.net> <932b2f1f0812101753s746dac8ak4cc70bad18f6f4a0@mail.gmail.com> <932b2f1f0812101812s541edc88gc7a005be17c77519@mail.gmail.com> <-6799851472409630867@unknownmsgid> <-666531042596248776@unknownmsgid> <779bf2730812111436s7dff1da7r55e9e2b38431b268@mail.gmail.com> Message-ID: <003d01c95be8$b833c2b0$289b4810$@mayers@usherbrooke.ca> Eureka. It works. Now how to get rid of eval ? De : plt-scheme-bounces@list.cs.brown.edu [mailto:plt-scheme-bounces@list.cs.brown.edu] De la part de YC Envoy? : December-11-08 5:37 PM ? : andre.mayers@usherbrooke.ca Cc : pltscheme Objet : Re: [plt-scheme] how to quote identifier in macro 2008/12/11 Andre Mayers (define slot-value (? (slot-name objet) (cadr (assq (quote slot-name) objet)))) The (quote slot-name) is most likely redundant. (define-syntax (tata stx) (syntax-case stx () [(_ a v (s ps ...) body ...) (syntax ; (eval (list '? '(self ps ...) (list* 'let (map (? (p-attr) (list p-attr (list slot-value (quote p-attr) 'self))) a) '(body ...))) Try `(quote ,p-attr) instead of (quote p-attr) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081211/249c5194/attachment.html From robby at cs.uchicago.edu Thu Dec 11 19:24:35 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:35:51 2009 Subject: [plt-scheme] Re: plt version number issues? In-Reply-To: <779bf2730812042314r7ed46575webde637df7dad9d1@mail.gmail.com> References: <779bf2730812041738u3305bf12u94fe8af3a9b7afbd@mail.gmail.com> <779bf2730812042314r7ed46575webde637df7dad9d1@mail.gmail.com> Message-ID: <932b2f1f0812111624w23308e76vc934b181c7c7215c@mail.gmail.com> Thanks. The server now replies with something more sensible. Robby On Fri, Dec 5, 2008 at 1:14 AM, YC wrote: > Seems like I wrote this email in haste... upon deeper examination, the > particular package below is not marked as available for 4.xx tree, so that's > probably why the package is unavailable - the error message of "too old" > misdirected me ;) > > Thanks, > yc > > On Thu, Dec 4, 2008 at 5:38 PM, YC wrote: >> >> Hi - >> >> it seems that the version number change from 3xx into 4.xx are causing >> some logic issues. I came across this issue trying to require >> cce/parameter-utils, and below are the results (note the "too old"): >> >> Welcome to MzScheme v4.0 [3m], Copyright (c) 2004-2008 PLT Scheme Inc. >> > (require (planet cce/parameter-utils:1:0)) >> stdin::9: require: PLaneT could not find the requested package: Server had >> no matching package: Your version of PLT Scheme is too old to run the >> specified package in: (planet cce/parameter-utils:1:0) >> >> Obviously, 4.0 is pretty new. I then generated the planet url via `planet >> url` command, and paste into browser, and then change the 4.0 part into 372, >> and of course I was able to download the package. >> >> >> http://planet.plt-scheme.org/servlets/planet-servlet.ss?lang=%22372%22&name=%22parameter-utils.plt%22&maj=1&min-lo=0&min-hi=%23f&path=%28%22cce%22%29 >> >> So - the comparison of planet versioning is done on pure numbers (and >> hence 372 is greater than 4.0, even though the build is older). While this >> is a bug, perhaps switching the versioning convention causes unnecessary >> headaches? >> >> yc >> > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From yinso.chen at gmail.com Thu Dec 11 19:29:12 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:35:52 2009 Subject: [plt-scheme] how to quote identifier in macro In-Reply-To: <7970172560655284649@unknownmsgid> References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <932b2f1f0812101753s746dac8ak4cc70bad18f6f4a0@mail.gmail.com> <932b2f1f0812101812s541edc88gc7a005be17c77519@mail.gmail.com> <-6799851472409630867@unknownmsgid> <-666531042596248776@unknownmsgid> <779bf2730812111436s7dff1da7r55e9e2b38431b268@mail.gmail.com> <7970172560655284649@unknownmsgid> Message-ID: <779bf2730812111629je180be9n979f174442d0a39@mail.gmail.com> On Thu, Dec 11, 2008 at 3:32 PM, Andre Mayers wrote: > Eureka. It works. > > Now how to get rid of eval ? > As Noel said, try to write what you want as the final result, instead of using list & list* to create the expression and then eval it. As an example, the following creates a lambda without list, list*, and eval. (define-syntax (tada2 stx) (syntax-case stx () ((_ a1 a2 ...) #'(lambda (a1 a2 ...) (list a1 a2 ... 'a1 'a2 ...))))) ((tada2 a b c) 1 2 3) ;; => ?? HTH, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081211/23b3f651/attachment.htm From andre.mayers at usherbrooke.ca Thu Dec 11 20:56:41 2008 From: andre.mayers at usherbrooke.ca (Andre Mayers) Date: Thu Mar 26 02:35:53 2009 Subject: [plt-scheme] how to get rid of eval ; was : how to quote identifier in macro In-Reply-To: <779bf2730812111629je180be9n979f174442d0a39@mail.gmail.com> References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <932b2f1f0812101753s746dac8ak4cc70bad18f6f4a0@mail.gmail.com> <932b2f1f0812101812s541edc88gc7a005be17c77519@mail.gmail.com> <-6799851472409630867@unknownmsgid> <-666531042596248776@unknownmsgid> <779bf2730812111436s7dff1da7r55e9e2b38431b268@mail.gmail.com> <7970172560655284649@unknownmsgid> <779bf2730812111629je180be9n979f174442d0a39@mail.gmail.com> Message-ID: <000901c95bfc$e109c590$a31d50b0$@mayers@usherbrooke.ca> It almost works. I don?t know how to insert the binding inside de let --- (define attr '(a1 a2 a3)) (define slot-value (? (slot-name objet) (cadr (assq slot-name objet)))) (define-syntax (tata stx) (syntax-case stx () [(_ a v (s ps ...) body ...) #'(? (self ps ...) `(let ,(map (? (p-attr) (list p-attr (slot-value p-attr self))) a) body ...)) ])) ((tata attr vals (self p1 p2) (display self) (newline) (+ p2 a1)) '((a1 10)(a2 20)(a3 30)) 4 5) ? (let ((a1 10) (a2 20) (a3 30)) (display self) (newline) (+ p2 a1)) === If I remove the quote in front of the let, I got the following error let: bad syntax (not an identifier and expression for a binding) in: map De : YC [mailto:yinso.chen@gmail.com] Envoy? : December-11-08 7:29 PM ? : andre.mayers@usherbrooke.ca Cc : pltscheme Objet : Re: [plt-scheme] how to quote identifier in macro On Thu, Dec 11, 2008 at 3:32 PM, Andre Mayers wrote: Eureka. It works. Now how to get rid of eval ? As Noel said, try to write what you want as the final result, instead of using list & list* to create the expression and then eval it. As an example, the following creates a lambda without list, list*, and eval. (define-syntax (tada2 stx) (syntax-case stx () ((_ a1 a2 ...) #'(lambda (a1 a2 ...) (list a1 a2 ... 'a1 'a2 ...))))) ((tada2 a b c) 1 2 3) ;; => ?? HTH, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081211/ecf04e7f/attachment.html From fredm at cs.uml.edu Thu Dec 11 21:39:11 2008 From: fredm at cs.uml.edu (Fred G. Martin) Date: Thu Mar 26 02:35:53 2009 Subject: [plt-scheme] Scheme projects in my undergrad CS course Message-ID: <72ef860f0812111839o4f4f4b63w7721febe00479fd5@mail.gmail.com> Dear PLT-Schemers, You may have noticed a number of emails from my students at UMass Lowell. I had assigned a final project in our required "Organization of Programming Languages" course which is based on the SICP text. This is the first time that the course included a significant, independent project component, and I did encourage them to ask you for assistance. I am happy to report that the projects were wildly successful. Students presented today, and some the highlights were: * A stock visualization application in which users enter a stock symbol and date range at a web page. This is handed off to a Scheme servlet, which queries a Yahoo! financial service. Then Scheme generates an XML file containing the data, and this is transparently given back to the same web page and displayed as a live graph using Adobe Flex ( http://www.cs.uml.edu/ecg/index.php/OrganizationProgrammingLanguagesFall2008/SchemeStock ) * A Music Discovery web app with a similar architecture. The user enters artist or song search terms into a web form. This is handed off to a Scheme servlet, which searches music service RSS feeds and aggregates the resulting YouTube music videos into a web page presented to the user. The kicker is that the web page includes JavaScript code so that when one video finishes playing, the next one automatically starts, and you can have hours of continuous music from one query ( http://www.cs.uml.edu/ecg/index.php/OrganizationProgrammingLanguagesFall2008/MusicDiscovery ) * Scheme integrated into a C++ game engine, in which the front-end GUI is implemented in C++, but the game-character "AI" consists of Scheme procedures. In the student's live demo, changing a line of code in a resource file that the game auto-loads caused game characters to run different AI and behave differently ( http://www.cs.uml.edu/ecg/index.php/OrganizationProgrammingLanguagesFall2008/Scheme-in-C-Game-Engine ) * A Scheme-based serial line API to the iRobot "Create" robot platform. All of the Create's motor and sensor APIs were exposed as simple Scheme procedures. ( http://www.cs.uml.edu/ecg/index.php/OrganizationProgrammingLanguagesFall2008/IRobotCreateSchemeAPI ) * A set of Scheme procedures for converting image-bitmaps into control commands for a 3D desktop engraver. After engraving the PLT-Scheme lambda logo, the final demo was an etching of the Last Supper in relief. The student who developed this also used higher-order procedures to generate depth-maps on the fly, as you might pass a lambda function to the Henderson painters to color a pixel based on the X,Y coordinate where it is to be drawn. ( http://www.cs.uml.edu/ecg/index.php/OrganizationProgrammingLanguagesFall2008/DesktopReliefEngraving ) Overall, I was amazed not only with the creativity of the projects themselves, but the extend to which students integrated key ideas from functional programming into their project implementations. Many students used map and filter process data, and higher-order procedures across their code. In a conversation with one student afterward, he noted that he had heard people talk about elegant code, but now he understood what that meant. This student had written the Create robot API, and employed a clever way of dealing with two-dozen-odd sensor packets that might come back from the robot. He created a hash map that keyed sensor type to a lambda function for processing the sensor data packet. When he got the raw packet back from the robot, he grabbed the lambda function, applied it to the packet, and voila, the actual sensor reading was produced. It was elegant. The student also commented, "Now I want to go back over all the code I have written in other languages over the past year and improve it." This remarkable because this was far from the only student who had such an experience. Students really took the task seriously of using the functional approaches in their projects, and they succeeded, many of them brilliantly. Thanks for your help over the semester and in the last couple of days with my students. I'll definitely be doing this again in the spring! yours, Fred Martin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081211/63f08525/attachment.htm From grettke at acm.org Thu Dec 11 22:21:30 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:35:53 2009 Subject: [plt-scheme] Is UNICODE in the code taboo? In-Reply-To: References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <49405010.2080404@soegaard.net> <932b2f1f0812101753s746dac8ak4cc70bad18f6f4a0@mail.gmail.com> <756daca50812101822g5c274a51ub15c8aaeea034fa9@mail.gmail.com> <7352e43a0812110153w6e4dce21h1735c8ae2aaa1760@mail.gmail.com> <932b2f1f0812110810v7dbcabc2ga23be3ff8acb7427@mail.gmail.com> Message-ID: <756daca50812111921j1844ba94md860cae8cf5f2583@mail.gmail.com> > No. This sets the entire lang environment, input methods, encodings, etc. > You want to use something that is recognized as a language env however, > 'utf-8 is just an encoding. > > See the language-info-alist variable for valid language envs. (mapcar (lambda (linfo) (car linfo)) language-info-alist) => ("Georgian" "UTF-8" "IPA" "Vietnamese" "Tibetan" "Thai" "Lao" "Korean" "Japanese" "Windows-1255" "Hebrew" "Greek" "Romanian" "Slovak" "Czech" "Esperanto" "Brazilian Portuguese" "Croatian" "Swedish" "Latvian" "Lithuanian" "Latin-7" "Latin-6" "Welsh" "Polish" "Turkish" "Spanish" "Slovenian" "Italian" "French" "German" "Dutch" "Latin-9" "Latin-8" "Latin-5" "Latin-4" "Latin-3" "Latin-2" "Latin-1" "Ethiopic" "ASCII" "English" "Kannada" "Tamil" "Malayalam" "Devanagari" "Belarusian" "Bulgarian" "Tajik" "Cyrillic-ALT" "Ukrainian" "Russian" "Cyrillic-KOI8" "Cyrillic-ISO" "Chinese-EUC-TW" "Chinese-CNS" "Chinese-BIG5" "Chinese-GB") Thanks everyone. From noelwelsh at gmail.com Fri Dec 12 08:16:39 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:35:54 2009 Subject: [plt-scheme] Scheme projects in my undergrad CS course In-Reply-To: <72ef860f0812111839o4f4f4b63w7721febe00479fd5@mail.gmail.com> References: <72ef860f0812111839o4f4f4b63w7721febe00479fd5@mail.gmail.com> Message-ID: They look really good! I'm impressed. N. On Fri, Dec 12, 2008 at 2:39 AM, Fred G. Martin wrote: > Dear PLT-Schemers, > You may have noticed a number of emails from my students at UMass Lowell. I > had assigned a final project in our required "Organization of Programming > Languages" course which is based on the SICP text. This is the first time > that the course included a significant, independent project component, and I > did encourage them to ask you for assistance. ... From noelwelsh at gmail.com Fri Dec 12 08:32:14 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:35:54 2009 Subject: [plt-scheme] how to quote identifier in macro In-Reply-To: <-6799851472409630867@unknownmsgid> References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <49405010.2080404@soegaard.net> <932b2f1f0812101753s746dac8ak4cc70bad18f6f4a0@mail.gmail.com> <932b2f1f0812101812s541edc88gc7a005be17c77519@mail.gmail.com> <-6799851472409630867@unknownmsgid> Message-ID: I've finally had the time to look at this code in more detail. I'm a bit confused as to its intent. When you write: > ((tata attr vals (self p1 p2) (display self) (newline) (+ p2 a1)) '((a1 > 10)(a2 20)(a3 30)) 4 5) what are self p1 and p2 supposed to be bound to? Furthermore, I think you're trying to mix compile time and run time values (a1 etc.) N. From plragde at uwaterloo.ca Fri Dec 12 09:48:59 2008 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:35:54 2009 Subject: [plt-scheme] reading HTML as XML Message-ID: <494279DB.4000602@uwaterloo.ca> Am I misreading the documentation somehow? (require html) (require net/url) (require xml/xml) (xml->xexpr (read-html-as-xml (get-pure-port (string->url "http://www.nytimes.com")))) gets me something where the elements are not (list symbol ...), but element structures, all the way down. This doesn't seem to me to conform to the description of xexprs given in the XML Parsing and Writing library documentation. Sure, I can unwrap the element structures recursively, but it seems to me that xml->xexpr is supposed to do that. Thanks. --PR From etanter at dcc.uchile.cl Fri Dec 12 10:07:08 2008 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Thu Mar 26 02:35:54 2009 Subject: [plt-scheme] Scheme projects in my undergrad CS course In-Reply-To: References: <72ef860f0812111839o4f4f4b63w7721febe00479fd5@mail.gmail.com> Message-ID: <29D7816A-D0FC-4C86-89E0-3FD1CBD89ECC@dcc.uchile.cl> I'm also very impressed! Can you tell us more about how the projects were conceived? did they all pop up out of students' mind, if so, under which guidelines if any? or did you have a pool of project ideas? -- ?ric On Dec 12, 2008, at 10:16 , Noel Welsh wrote: > They look really good! I'm impressed. > > N. > > On Fri, Dec 12, 2008 at 2:39 AM, Fred G. Martin > wrote: >> Dear PLT-Schemers, >> You may have noticed a number of emails from my students at UMass >> Lowell. I >> had assigned a final project in our required "Organization of >> Programming >> Languages" course which is based on the SICP text. This is the >> first time >> that the course included a significant, independent project >> component, and I >> did encourage them to ask you for assistance. ... > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From mflatt at cs.utah.edu Fri Dec 12 10:39:46 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:35:54 2009 Subject: [plt-scheme] reading HTML as XML In-Reply-To: <494279DB.4000602@uwaterloo.ca> References: <494279DB.4000602@uwaterloo.ca> Message-ID: <20081212153947.79D516500AD@mail-svr1.cs.utah.edu> At Fri, 12 Dec 2008 09:48:59 -0500, Prabhakar Ragde wrote: > Am I misreading the documentation somehow? > > (require html) > (require net/url) > (require xml/xml) > > (xml->xexpr > (read-html-as-xml > (get-pure-port (string->url "http://www.nytimes.com")))) > > gets me something where the elements are not (list symbol ...), but > element structures, all the way down. This doesn't seem to me to conform > to the description of xexprs given in the XML Parsing and Writing > library documentation. Sure, I can unwrap the element structures > recursively, but it seems to me that xml->xexpr is supposed to do that. I've run into this before. The `read-html'as-xml' function produces a list of content values, and `xml->xexpr' wants a single content value. So, you probably want to `map xml->xexr'. (I'm not sure why `xml->xexpr' doesn't complain when it's given a list.) Matthew From noelwelsh at gmail.com Fri Dec 12 10:49:21 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:35:54 2009 Subject: [plt-scheme] Displaying a picture while using instaweb In-Reply-To: <476213.46065.qm@web50901.mail.re2.yahoo.com> References: <20081210170009.616B9402C2@qua.cs.brown.edu> <476213.46065.qm@web50901.mail.re2.yahoo.com> Message-ID: The images need to be in the htdocs directory (an optional parameter to instaweb) which defaults to (list (build-path (current-directory) "htdocs")) N. On Wed, Dec 10, 2008 at 5:30 PM, geb a wrote: > Does the servlet need to be stored in the web-server servlets directory in order to find an image and display it? I have the following but when viewed in a browser the images are not found. > > Thanks for your help! > > Dan From plragde at uwaterloo.ca Fri Dec 12 11:05:28 2008 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:35:54 2009 Subject: [plt-scheme] reading HTML as XML In-Reply-To: <20081212153947.79D516500AD@mail-svr1.cs.utah.edu> References: <494279DB.4000602@uwaterloo.ca> <20081212153947.79D516500AD@mail-svr1.cs.utah.edu> Message-ID: <49428BC8.8090009@uwaterloo.ca> Matthew Flatt wrote: > I've run into this before. The `read-html'as-xml' function produces a > list of content values, and `xml->xexpr' wants a single content value. > So, you probably want to `map xml->xexr'. (I'm not sure why > `xml->xexpr' doesn't complain when it's given a list.) That works, thanks. I would never have thought to try it. --PR From robby at cs.uchicago.edu Fri Dec 12 11:27:32 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:35:55 2009 Subject: [plt-scheme] reading HTML as XML In-Reply-To: <49428BC8.8090009@uwaterloo.ca> References: <494279DB.4000602@uwaterloo.ca> <20081212153947.79D516500AD@mail-svr1.cs.utah.edu> <49428BC8.8090009@uwaterloo.ca> Message-ID: <932b2f1f0812120827j3ebcc485v3c3c795b6e4e131a@mail.gmail.com> The docs do say that read-html-as-xml produces a list of content. Probably because there can be multiple html expressions in a single input stream. But I agree that it seems like xml->xexpr should signal an error. Its documented contract even suggests it should, but I'm reluctant to change it, not knowing how it is used ...? Robby On Fri, Dec 12, 2008 at 10:05 AM, Prabhakar Ragde wrote: > Matthew Flatt wrote: > >> I've run into this before. The `read-html'as-xml' function produces a >> list of content values, and `xml->xexpr' wants a single content value. >> So, you probably want to `map xml->xexr'. (I'm not sure why >> `xml->xexpr' doesn't complain when it's given a list.) > > That works, thanks. I would never have thought to try it. --PR > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From jay.mccarthy at gmail.com Fri Dec 12 11:59:28 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:35:55 2009 Subject: [plt-scheme] reading HTML as XML In-Reply-To: <932b2f1f0812120827j3ebcc485v3c3c795b6e4e131a@mail.gmail.com> References: <494279DB.4000602@uwaterloo.ca> <20081212153947.79D516500AD@mail-svr1.cs.utah.edu> <49428BC8.8090009@uwaterloo.ca> <932b2f1f0812120827j3ebcc485v3c3c795b6e4e131a@mail.gmail.com> Message-ID: I'm officially maintaining the XML collection. In the comments to xml->xexpr it says "The contract is loosely enforced." and looking at all the uses of it in the PLT tree, it doesn't seem to matter, because all the uses obey the contract. If I turn back on the contract enforcement, there aren't any errors in the test suite. So, I turned it on in SVN. Jay On Fri, Dec 12, 2008 at 9:27 AM, Robby Findler wrote: > The docs do say that read-html-as-xml produces a list of content. > Probably because there can be multiple html expressions in a single > input stream. > > But I agree that it seems like xml->xexpr should signal an error. Its > documented contract even suggests it should, but I'm reluctant to > change it, not knowing how it is used ...? > > Robby > > On Fri, Dec 12, 2008 at 10:05 AM, Prabhakar Ragde wrote: >> Matthew Flatt wrote: >> >>> I've run into this before. The `read-html'as-xml' function produces a >>> list of content values, and `xml->xexpr' wants a single content value. >>> So, you probably want to `map xml->xexr'. (I'm not sure why >>> `xml->xexpr' doesn't complain when it's given a list.) >> >> That works, thanks. I would never have thought to try it. --PR >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From grettke at acm.org Fri Dec 12 12:05:03 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:35:55 2009 Subject: [plt-scheme] Scheme projects in my undergrad CS course In-Reply-To: <72ef860f0812111839o4f4f4b63w7721febe00479fd5@mail.gmail.com> References: <72ef860f0812111839o4f4f4b63w7721febe00479fd5@mail.gmail.com> Message-ID: <756daca50812120905i5fc0650bu22601d849e502d59@mail.gmail.com> On Thu, Dec 11, 2008 at 8:39 PM, Fred G. Martin wrote: > This remarkable because this was far from the only student who had such an experience. Very nice! Happy to see such a great experience for you and your students! From dyoo at cs.wpi.edu Fri Dec 12 13:53:50 2008 From: dyoo at cs.wpi.edu (Danny Yoo) Date: Thu Mar 26 02:35:55 2009 Subject: [plt-scheme] webit for PLT Scheme 4 Message-ID: I've tried using the version of Webit 2.0 on PLaneT; it appears to be failing only because private/excess.ss is depending on the old version of the unit library. If I switch it to use the unit200 compatibility library, most of the test cases appears to run fine. Here's the diff: dyoo@kfisler-ra1:~/work/webit/webit$ diff private/excess.ss~ private/excess.ss 13c13 < (lib "unit.ss")) --- > (lib "unit200.ss")) The test cases that fail when running tests/tests.ss are: --- Running test "test list-structure sharing with xml-element-attributes (1)": (eq? (xml-element-attributes `(e (@ . ,yy-attrs) . ,yy-contents)) yy-attrs) "Unexpected result: #f\nexpected #t\n" Running test "test list-structure sharing with xml-element-attributes (2)": (eq? (xml-element-attributes `(e (@ (@ (*NAMESPACES* . ,yy-ns-list)) . ,yy-attrs) . ,yy-contents)) yy-attrs) "Unexpected result: #f\nexpected #t\n" Running test "test list-structure sharing with xml-element-ns-list": (eq? (xml-element-ns-list `(e (@ (@ (*NAMESPACES* . ,yy-ns-list)) . ,yy-attrs) . ,yy-contents)) yy-ns-list) gave the expected result: #t Running test "test list-structure sharing with xml-element-contents": (eq? (xml-element-contents `(e (@ (@ (*NAMESPACES* . ,yy-ns-list)) . ,yy-attrs) . ,yy-contents)) yy-contents) "Unexpected result: #f\nexpected #t\n" --- All of the tests in tests/xml-match-tests.ss appear to run ok. The code in the examples needs to be modularized, but other than that, there doesn't seem to be fundamental difficulty to make things work. Best of wishes! From andre.mayers at usherbrooke.ca Fri Dec 12 17:22:03 2008 From: andre.mayers at usherbrooke.ca (Andre Mayers) Date: Thu Mar 26 02:35:55 2009 Subject: [plt-scheme] how to quote identifier in macro In-Reply-To: References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <49405010.2080404@soegaard.net> <932b2f1f0812101753s746dac8ak4cc70bad18f6f4a0@mail.gmail.com> <932b2f1f0812101812s541edc88gc7a005be17c77519@mail.gmail.com> <-6799851472409630867@unknownmsgid> Message-ID: <009301c95ca8$0f777d40$2e6677c0$@mayers@usherbrooke.ca> Thank you Noel for the time spent to debug my program. Sorry for not reacting more quickly, I had some urgent matter to settle. --- The code that I shown was extracted and modified from a more complex program, a kind of object programming language. --- (define attr '(a1 a2 a3)) ; attr is a list of slot name. ; attr is the concatenation of the slot of the current class and the slots of its superclass. ; As define-class is a macro, it is possible to know them at expansion time ; but we don't have a syntaxical form (a1 ...) = attr (define slot-value (? (slot-name objet) (cadr (assq slot-name objet)))) (define-syntax (tata stx) (syntax-case stx () [(_ a (s ps ...) body ...) #'(? (self ps ...) `(let ,(map (? (p-attr) (list p-attr (slot-value p-attr self))) a) body ...)) ])) ; the syntaxical form (tata a (s ps ...) body ...) should return a procedure ; for example (tata attr (self p1 p2) (display self) (newline) (+ p2 a1)) ; should return (? (self p1 p2) (let ((a1 (slot-value 'a1 self)) (a2 (slot-value 'a2 self)) (a3 (slot-value 'a3 self))) (display self) (newline) (+ p2 a1))) ; therefore ; a = attr has been described in the beginning of this email ; (s ps ...) = (self p1 p2) is a list of identifiers known at expansion time ; body ... = (display self) (newline) (+ p2 a1) ; is the body of the let and is known at expansion time ; self is just an identifier at expansion time ; therefore it is not possible to know the value of (slot-value 'a1 self) ; at expansion time at execution time, we may have the following expression ( '((a1 10)(a2 20)(a3 30)) 4 5) ; ?s the compiled version of the procedure created by tata ; ((a1 10)(a2 20)(a3 30)) is a simplified example of the object self ; slot-value of a1 is 10 .... ; 4 5 are others parameters of From geoff at knauth.org Fri Dec 12 17:45:11 2008 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Thu Mar 26 02:35:55 2009 Subject: [plt-scheme] Scheme projects in my undergrad CS course In-Reply-To: <72ef860f0812111839o4f4f4b63w7721febe00479fd5@mail.gmail.com> References: <72ef860f0812111839o4f4f4b63w7721febe00479fd5@mail.gmail.com> Message-ID: <8787FBA2-8E0C-4712-98A7-361002008373@knauth.org> On Dec 11, 2008, at 21:39, Fred G. Martin wrote: > I am happy to report that the projects were wildly successful. That's awesome! Where I teach in north central PA, we used your Handyboard and book in Robotics two years ago, and we'll be using it again this spring. This time around we'll be working on driving Mindstorms NXT (and maybe Handyboard too) with DrScheme. The Design Recipe can be used to prevent many accidents. Geoffrey -- Geoffrey S. Knauth | http://knauth.org/gsk From eric.hanchrow at gmail.com Fri Dec 12 23:59:51 2008 From: eric.hanchrow at gmail.com (Eric Hanchrow) Date: Thu Mar 26 02:35:55 2009 Subject: [plt-scheme] A mystery: using immutable hashes slows my program down a lot Message-ID: <36366a980812122059j1a84e510gacb2f59d4066e225@mail.gmail.com> I have a fairly simple program that does lots of computation while traversing a big list. It constructs the list by first constructing a hash table, then calling hash-map on it ... I rewote it a little to replace the mutable hash with immutable ones -- and to my great surprise, the program as a whole slowed down by a factor of three. What's odder is that, as far as I can tell, the hash is unreferenced as soon as we return from hash-map -- and that happens very quickly in the life of the program; it's the subsequent computation, using the list, that is slow. Anyway, enough blather; you'll want to see what I'm talking about. Here's the slower version that uses immutable hashes: http://github.com/offby1/anagrams/tarball/99a7781001b4cebfcf8d91d0c254ffba70e8120e And here's the faster version that uses mutable hashes: http://github.com/offby1/anagrams/tarball/707635e63e8053705d898a364878b970eeb08602 (Unfortunately both those links require a Javascript-enabled browser; "wget" doesn't seem to work) Unpack 'em and, in each, cd to the unpacked directory and type "make" to see the program run and print a little timing report. (You'll need GNU Make, and of course mzscheme.) The difference between the two versions is at http://github.com/offby1/anagrams/commit/707635e63e8053705d898a364878b970eeb08602 If you could help explain why the immutable-hash version is three times slower than the other, I'd be grateful. Thanks! From sk at cs.brown.edu Sat Dec 13 00:48:25 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:35:56 2009 Subject: [plt-scheme] Scheme projects in my undergrad CS course In-Reply-To: <72ef860f0812111839o4f4f4b63w7721febe00479fd5@mail.gmail.com> References: <72ef860f0812111839o4f4f4b63w7721febe00479fd5@mail.gmail.com> Message-ID: Hi Fred, This is terrific. I hope your department appreciates it as much as all of us do! Can't wait to see what's coming in the future. Any chance you can get some of them to keep at it and eventually turn these into PLaneT contributions? > When he got the raw packet back from the robot, he grabbed the > lambda function, applied it to the packet, and voila, the actual > sensor reading was produced. I think of this as completely normal, but I've come to find that year after year, pretty sharp students find this a novel and profound structuring tool. So, it's great to hear your student(s) had the same epiphany. Three comments/questions: - This is an impressive list of projects, but how much evaluation was there of how well they did what they promised? - How good is their code? What's the measure of goodness? Did they get administered code-walks? - Some of these remarks look a bit odd and unchallenged. Eg, the Scheme-in-C-Game-Engine guy says, In my opinion, using Scheme (or at least MzScheme) as a game scripting language has some key disadvantages to more conventional choices (such as LUA). The first of which is the much-less-than-trivial embedding process. Of course, LUA was specifically constructed with integration with languages such as C in mind. Another disadvantage is the complex organization and parenthetical syntax. The first few remarks are perfectly reasonable, as is the last one, but what does "complex organization" mean? He should either write sufficiently clearly that a technically literate person can understand and evaluate the remark, or elide it. (That is, the reader need not agree with all his statements, nor should he be uncritical; but he should be decipherable!) Shriram From noelwelsh at gmail.com Sat Dec 13 07:45:33 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:35:56 2009 Subject: [plt-scheme] how to quote identifier in macro In-Reply-To: <4481829986472306362@unknownmsgid> References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <49405010.2080404@soegaard.net> <932b2f1f0812101753s746dac8ak4cc70bad18f6f4a0@mail.gmail.com> <932b2f1f0812101812s541edc88gc7a005be17c77519@mail.gmail.com> <-6799851472409630867@unknownmsgid> <4481829986472306362@unknownmsgid> Message-ID: I don't have time right now to work out the full solution, so here's a sketch of what you need to do: 1. Make attr available at expansion time. Do this using define-for-syntax instead of define 2. Map over attr generating the syntax you want to splice into the expansion. Introduce the result using with-syntax So something like: (define-for-syntax attr '(a1 a2 a3)) (define-syntax ... [(_ a (s ps ...) expr ...) (with-syntax ([(attr-id ...) (process-attr (syntax a))]) (syntax ...))]) HTH, Noel From entarter at gmail.com Sat Dec 13 08:02:00 2008 From: entarter at gmail.com (Killian McCutcheon) Date: Thu Mar 26 02:35:56 2009 Subject: [plt-scheme] Avoiding "duplicate definition for identifier" errors Message-ID: <310ea7f60812130502j7c4f89f1q7bf18f14de63e78d@mail.gmail.com> I'm having problems with duplicate definition for identifier errors when using modules. I have a small DSL for defining some data that looks a bit like this: (mission 20 rendezvous person "Jimmy" place "beach") (mission 21 deliver item "peanuts" person "Boris") The DSL code sits in one file and is loaded by the scheme file which implements the DSL. To implement this DSL, I have a macro for defining mission types which allows me to do this: (module mission-dsl scheme . . . (define-mission-type rendezvous (person ) (place )) (define-mission-type deliver (item ) (person )) . . .) This expands to something like this: (define rendezvous (lambda (num . args) ;; Code for constructing fields from arg list based on ;; type constructor in mission type definition ...)) ;; These are required so the person defining the missions in the DSL does not need to explicitly quote the field names (define person 'person) (define place 'place) (define deliver (lambda (num . args) ...)) (define item 'item) (define person 'person) ;; <== ERROR: duplicate definition for identifier at: person in: (define-values (person) (quote person)) So, Im wondering if there's a way to get around these duplicate definitions, maybe by checking if the identifier is bound in the define-mission-type macro before trying to define it, ie have this: (define-mission-type rendezvous (person ) (place )) expand to this: (define rendezvous (lambda (num . args) ...)) (if (unbound? 'person) (define person 'person)) ;; There is no unbound? function (if (unbound? 'place) (define place 'place)) Ive looked for a way to do this, but haven't found anything. I really want to keep the DSL as simple as possible to make it easier for the person writing in it (not a programmer). This means, if at all possible, not having to prefix the field names with the mission type, and not having to quote the field names. Any help would be appreciated Sincerely Killian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081213/749a0ace/attachment.html From andre.mayers at usherbrooke.ca Sat Dec 13 08:34:25 2008 From: andre.mayers at usherbrooke.ca (Andre Mayers) Date: Thu Mar 26 02:35:57 2009 Subject: [plt-scheme] Avoiding "duplicate definition for identifier" errors In-Reply-To: <310ea7f60812130502j7c4f89f1q7bf18f14de63e78d@mail.gmail.com> References: <310ea7f60812130502j7c4f89f1q7bf18f14de63e78d@mail.gmail.com> Message-ID: <002e01c95d27$83ee9ad0$8bcbd070$@mayers@usherbrooke.ca> Did you try to use a macro like the following (define-syntax define-if-not (? (stx) (syntax-case stx () [(_ var val) (with-syntax ([set!define (if (identifier-binding #'var 0) #'set! #'define)]) (syntax (set!define var val)))]))) De : plt-scheme-bounces@list.cs.brown.edu [mailto:plt-scheme-bounces@list.cs.brown.edu] De la part de Killian McCutcheon Envoy? : December-13-08 8:02 AM ? : plt-scheme@list.cs.brown.edu Objet : [plt-scheme] Avoiding "duplicate definition for identifier" errors I'm having problems with duplicate definition for identifier errors when using modules. I have a small DSL for defining some data that looks a bit like this: (mission 20 rendezvous person "Jimmy" place "beach") (mission 21 deliver item "peanuts" person "Boris") The DSL code sits in one file and is loaded by the scheme file which implements the DSL. To implement this DSL, I have a macro for defining mission types which allows me to do this: (module mission-dsl scheme . . . (define-mission-type rendezvous (person ) (place )) (define-mission-type deliver (item ) (person )) . . .) This expands to something like this: (define rendezvous (lambda (num . args) ;; Code for constructing fields from arg list based on ;; type constructor in mission type definition ...)) ;; These are required so the person defining the missions in the DSL does not need to explicitly quote the field names (define person 'person) (define place 'place) (define deliver (lambda (num . args) ...)) (define item 'item) (define person 'person) ;; <== ERROR: duplicate definition for identifier at: person in: (define-values (person) (quote person)) So, Im wondering if there's a way to get around these duplicate definitions, maybe by checking if the identifier is bound in the define-mission-type macro before trying to define it, ie have this: (define-mission-type rendezvous (person ) (place )) expand to this: (define rendezvous (lambda (num . args) ...)) (if (unbound? 'person) (define person 'person)) ;; There is no unbound? function (if (unbound? 'place) (define place 'place)) Ive looked for a way to do this, but haven't found anything. I really want to keep the DSL as simple as possible to make it easier for the person writing in it (not a programmer). This means, if at all possible, not having to prefix the field names with the mission type, and not having to quote the field names. Any help would be appreciated Sincerely Killian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081213/7d77905a/attachment.htm From noelwelsh at gmail.com Sat Dec 13 15:08:31 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:35:57 2009 Subject: [plt-scheme] Avoiding "duplicate definition for identifier" errors In-Reply-To: <310ea7f60812130502j7c4f89f1q7bf18f14de63e78d@mail.gmail.com> References: <310ea7f60812130502j7c4f89f1q7bf18f14de63e78d@mail.gmail.com> Message-ID: Andre's method is probably the simplest. Two alternatives: 1. Use keyword arg functions, which allows you to avoid writing your own dispatch functions Pro: you don't have to write any dispatch code Con: your user has to write keywords 2. Expand a define-mission-type into a macro that itself defines appropriate keywords. E.g. (define-syntax define-mission-type (syntax-rules () [(_ name (kwd type) ...) (define-syntax name (syntax-rules (kwd ...) [(name arg ...) dispatch code here]))])) Pro: user doesn't have to quote keywords Con: higher-order uses do not work. HTH, Noel From mflatt at cs.utah.edu Sat Dec 13 16:43:59 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:35:57 2009 Subject: [plt-scheme] A mystery: using immutable hashes slows my program down a lot In-Reply-To: <36366a980812122059j1a84e510gacb2f59d4066e225@mail.gmail.com> References: <36366a980812122059j1a84e510gacb2f59d4066e225@mail.gmail.com> Message-ID: <20081213214400.E73B36500BD@mail-svr1.cs.utah.edu> The lists that you get back from the different hash table implementations are in different orders. I changed both programs to return (sort result > #:key car) instead of just `result', and the run times ended up about the same. Sorting with `>' made both run fast, and sorting with `<' made both run slow. Matthew At Fri, 12 Dec 2008 20:59:51 -0800, "Eric Hanchrow" wrote: > I have a fairly simple program that does lots of computation while > traversing a big list. It constructs the list by first constructing a > hash table, then calling hash-map on it ... I rewote it a little to > replace the mutable hash with immutable ones -- and to my great > surprise, the program as a whole slowed down by a factor of three. > What's odder is that, as far as I can tell, the hash is unreferenced > as soon as we return from hash-map -- and that happens very quickly in > the life of the program; it's the subsequent computation, using the > list, that is slow. > > Anyway, enough blather; you'll want to see what I'm talking about. > Here's the slower version that uses immutable hashes: > http://github.com/offby1/anagrams/tarball/99a7781001b4cebfcf8d91d0c254ffba70e81 > 20e > > And here's the faster version that uses mutable hashes: > http://github.com/offby1/anagrams/tarball/707635e63e8053705d898a364878b970eeb08 > 602 > > (Unfortunately both those links require a Javascript-enabled browser; > "wget" doesn't seem to work) > > Unpack 'em and, in each, cd to the unpacked directory and type "make" > to see the program run and print a little timing report. (You'll need > GNU Make, and of course mzscheme.) > > The difference between the two versions is at > http://github.com/offby1/anagrams/commit/707635e63e8053705d898a364878b970eeb086 > 02 > > If you could help explain why the immutable-hash version is three > times slower than the other, I'd be grateful. Thanks! > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From grettke at acm.org Sat Dec 13 23:00:47 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:35:57 2009 Subject: [plt-scheme] Is sharing unit tests for problems in HtDP a good way to facilitate learning? Message-ID: <756daca50812132000y444c4a9ci76c751c6160bd6c8@mail.gmail.com> Hi folks, Sometimes people post HtDP problems here or to comp.lang.scheme or Study-HtDP, and from what I see talking through the problem with people is the best approach. Often times, the nudge of "have you followed the recipe" is made. Are unit tests and that nudge a good combination? I find them to be a good combination because they reinforce following the recipe and give the person something to work with. Best wishes, Grant -- http://www.wisdomandwonder.com/ From carl.eastlund at gmail.com Sat Dec 13 23:41:01 2008 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Thu Mar 26 02:35:58 2009 Subject: [plt-scheme] Is sharing unit tests for problems in HtDP a good way to facilitate learning? In-Reply-To: <756daca50812132000y444c4a9ci76c751c6160bd6c8@mail.gmail.com> References: <756daca50812132000y444c4a9ci76c751c6160bd6c8@mail.gmail.com> Message-ID: <990e0c030812132041u9675acbm8b4c125e00e52ef9@mail.gmail.com> Grant, That's a generous offer, but students need to learn to write their own tests. It's an important skill, and for that reason it's also often a graded part of the assignment. On a mailing list, you never know what's graded and what's not, so it's usually best to point the student in the right direction, but not contribute any new material to their work, no matter how innocuous it may seem. --Carl On Sat, Dec 13, 2008 at 11:00 PM, Grant Rettke wrote: > Hi folks, > > Sometimes people post HtDP problems here or to comp.lang.scheme or > Study-HtDP, and from what I see talking through the problem with > people is the best approach. Often times, the nudge of "have you > followed the recipe" is made. Are unit tests and that nudge a good > combination? > > I find them to be a good combination because they reinforce following > the recipe and give the person something to work with. > > Best wishes, > > Grant From andre.mayers at usherbrooke.ca Sun Dec 14 10:45:53 2008 From: andre.mayers at usherbrooke.ca (Andre Mayers) Date: Thu Mar 26 02:35:58 2009 Subject: [plt-scheme] how to quote identifier in macro In-Reply-To: References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <49405010.2080404@soegaard.net> <932b2f1f0812101753s746dac8ak4cc70bad18f6f4a0@mail.gmail.com> <932b2f1f0812101812s541edc88gc7a005be17c77519@mail.gmail.com> <-6799851472409630867@unknownmsgid> <4481829986472306362@unknownmsgid> Message-ID: <000501c95e03$0c6f66b0$254e3410$@mayers@usherbrooke.ca> I have some difficulty to apply your suggestion. The obvious way to implement it doesn't work. --- (define-for-syntax attr '(a1 a2 a3)) (define-for-syntax slot-value (? (slot-name objet) (cadr (assq slot-name objet)))) (define-syntax (tata stx) (syntax-case stx () [(_ a (s ps ...) body ...) (with-syntax ([(attr-id ...) (map (? (p-attr) (list p-attr (slot-value p-attr #'self))) (syntax->list #'a))]) (syntax (? (self ps ...) (let (attr-id ...) body ...))))])) --- because (tata attr (self p1 p2) (display self) (newline) (+ p2 a1)) ==> expand: unbound identifier in module in: attr --- I can make a copy of attr accessible for the expansion of the last expression (define attr '(a1 a2 a3) ) But both definition of attr are not related to each other and I don't know how to make the connexion between them in the tata macro. For example the simplified program --- (define attr '(a1 a2 a3)) (define-for-syntax attr '(a1 a2 a3)) (define-syntax (tata stx) (syntax-case stx () [(_ a (s ps ...) body ...) (with-syntax ([(attr-id ...) (syntax->list #'a)]) (syntax (attr-id ...)))])) (tata attr (self p1 p2) (display self) (newline) (+ p2 a1)) ==> give the following error message with-syntax: binding match failed in: (attr-id ...) --- -----Message d'origine----- De : Noel Welsh [mailto:noelwelsh@gmail.com] Envoy? : December-13-08 7:46 AM ? : andre.mayers@usherbrooke.ca Cc : pltscheme Objet : Re: [plt-scheme] how to quote identifier in macro I don't have time right now to work out the full solution, so here's a sketch of what you need to do: 1. Make attr available at expansion time. Do this using define-for-syntax instead of define 2. Map over attr generating the syntax you want to splice into the expansion. Introduce the result using with-syntax So something like: (define-for-syntax attr '(a1 a2 a3)) (define-syntax ... [(_ a (s ps ...) expr ...) (with-syntax ([(attr-id ...) (process-attr (syntax a))]) (syntax ...))]) HTH, Noel From keydana at gmx.de Sun Dec 14 12:47:12 2008 From: keydana at gmx.de (Sigrid Keydana) Date: Thu Mar 26 02:35:58 2009 Subject: [plt-scheme] problem with amb macros Message-ID: <494546A0.1010908@gmx.de> Hello, please excuse my question as it's not about PLT-scheme specific - I'm a complete autodidact studying on my own, trying to solve the SICP exercises, and I think this group is very helpful and instructive :-) I want to solve the amb exercises in SICP not always using the custom amb evaluator from the book, but one of the existing macros (as an exercise to employ these macros "in the real world"). However, with both the amb macro from the Dorai Sitaram book and one taken from http://community.schemewiki.org/?amb, I do not get the expected behavior when I call (amb) again to get the residual alternatives. E.g. in exercise 4.45, there should be 5 alternatives, but I get "amb tree exhausted" already when I call (amb) after the first try. In general it seems the failure continuations are stored correctly in the macros - simple cases like 1) (amb 1 2) -> 1 2) (amb) -> 2 work as expected, but for the more complicated cases as the language-parsing or the puzzles (e.g., exercise 4.43 in the "more-than-one-solution" version) it seems that the macros are not really equivalent of the SICP amb evaluator... Is this possible? Many thanks in advance for any help Sigrid From jensaxel at soegaard.net Sun Dec 14 13:11:01 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:35:58 2009 Subject: [plt-scheme] problem with amb macros In-Reply-To: <494546A0.1010908@gmx.de> References: <494546A0.1010908@gmx.de> Message-ID: <49454C35.7080206@soegaard.net> Hi Sigrid, > please excuse my question as it's not about PLT-scheme specific - I'm a > complete autodidact studying on my own, trying to solve the SICP > exercises, and I think this group is very helpful and instructive :-) > > I want to solve the amb exercises in SICP not always using the custom > amb evaluator from the book, but one of the existing macros (as an > exercise to employ these macros "in the real world"). > However, with both the amb macro from the Dorai Sitaram book and one > taken from http://community.schemewiki.org/?amb, I do not get the > expected behavior when I call (amb) again to get the residual alternatives. > E.g. in exercise 4.45, there should be 5 alternatives, but I get "amb > tree exhausted" already when I call (amb) after the first try. > > In general it seems the failure continuations are stored correctly in > the macros - simple cases like > > 1) (amb 1 2) -> 1 > 2) (amb) -> 2 > > work as expected, but for the more complicated cases as the > language-parsing or the puzzles (e.g., exercise 4.43 in the > "more-than-one-solution" version) it seems that the macros are not > really equivalent of the SICP amb evaluator... Is this possible? Without actually testing the macro, I'd say the intention of the implementation of http://community.schemewiki.org/?amb is that you can use with SICP. However, it might be that solutions are generated in a different order than shown in SICP. Do you have a concrete example, that shows where you get results that differ from your expectation? Can you perhaps show us what your code for 4.45 looks like? -- Jens Axel S?gaard From keydana at gmx.de Sun Dec 14 15:48:48 2008 From: keydana at gmx.de (stelvio) Date: Thu Mar 26 02:35:58 2009 Subject: [plt-scheme] Re: problem with amb macros In-Reply-To: <49454C35.7080206@soegaard.net> References: <494546A0.1010908@gmx.de> <49454C35.7080206@soegaard.net> Message-ID: <3a2482e1-10d6-4851-842f-15634e3d3ad0@v5g2000prm.googlegroups.com> Hi, thanks for your quick answer! The code is the following - the Dorai Sitaram book macro and the code form SICP: (require (lib "defmacro.ss")) (define amb-fail '*) (define initialize-amb-fail (lambda () (set! amb-fail (lambda () (error "amb tree exhausted"))))) (initialize-amb-fail) (define-macro amb (lambda alts... `(let ((+prev-amb-fail amb-fail)) (call/cc (lambda (+sk) ,@(map (lambda (alt) `(call/cc (lambda (+fk) (set! amb-fail (lambda () (set! amb-fail +prev-amb-fail) (+fk 'fail))) (+sk ,alt)))) alts...) (+prev-amb-fail)))))) (define (req condition) (if (not condition) (amb))) (define nouns '(noun student professor cat class drawer)) (define verbs '(verb studies lectures eats sleeps)) (define articles '(article the a)) (define prepositions '(prep for to in by with)) (define parse-sentence (lambda () (list 'sentence (parse-noun-phrase) (parse-verb-phrase)))) (define parse-simple-noun-phrase (lambda () (list 'simple-noun-phrase (parse-word articles) (parse-word nouns)))) (define parse-noun-phrase (lambda () (letrec ((maybe-extend (lambda (noun-phrase) (amb noun-phrase (maybe-extend (list 'noun-phrase noun-phrase (parse- prepositional-phrase))))))) (maybe-extend (parse-simple-noun-phrase))))) (define parse-word (lambda (word-list) (req (not (null? *unparsed*))) (req (memq (car *unparsed*) (cdr word-list))) (let ((found-word (car *unparsed*))) (set! *unparsed* (cdr *unparsed*)) (list (car word-list) found-word)))) (define *unparsed* '()) (define parse (lambda (input) (set! *unparsed* input) (let ((sent (parse-sentence))) (req (null? *unparsed*)) sent))) (define parse-prepositional-phrase (lambda () (list 'prep-phrase (parse-word prepositions) (parse-noun- phrase)))) (define parse-verb-phrase (lambda () (letrec ((maybe-extend (lambda (verb-phrase) (amb verb-phrase (maybe-extend (list 'verb-phrase verb-phrase (parse- prepositional-phrase))))))) (maybe-extend (parse-word verbs))))) The following two sentences should be possible to parse in 2 resp. 5 ways: (parse '(the professor lectures to the student with the cat)) (parse '(the professor lectures to the student in the class with the cat)) However, in both cases, when I do (amb) immediately afterwards I get "amb tree exhausted". Same thing with puzzle 4.43, where in the version with the commented line I should get alternatives from (amb): ; exercise 4.43 (interpret '(define (yachts) (let ((gabrielle (amb 'moore 'downing 'hall 'barnacle 'parker)) (lorna (amb 'moore 'downing 'hall 'barnacle 'parker)) (rosalind (amb 'moore 'downing 'hall 'barnacle 'parker)) (melissa 'barnacle) (maryann 'moore 'downing 'hall 'barnacle 'parker)) (require (not (eq? gabrielle 'barnacle))) (require (not (eq? lorna 'moore))) (require (not (eq? rosalind 'hall))) (require (eq? melissa 'barnacle)) ;(require (eq? maryann 'moore)) (require (cond ((eq? gabrielle 'moore) (eq? lorna 'parker)) ((eq? gabrielle 'downing) (eq? melissa 'parker)) ((eq? gabrielle 'hall) (eq? rosalind 'parker)) (else false))) (require (distinct? (list gabrielle lorna rosalind melissa maryann))) (list (list 'gabrielle gabrielle) (list 'lorna lorna) (list 'rosalind rosalind) (list 'melissa melissa) (list 'maryann maryann))))) (amb) Best greetings, Sigrid On Dec 14, 7:11 pm, Jens Axel Soegaard wrote: > Hi Sigrid, > > > > > please excuse my question as it's not about PLT-scheme specific - I'm a > > complete autodidact studying on my own, trying to solve the SICP > > exercises, and I think this group is very helpful and instructive :-) > > > I want to solve the amb exercises in SICP not always using the custom > > amb evaluator from the book, but one of the existing macros (as an > > exercise to employ these macros "in the real world"). > > However, with both the amb macro from the Dorai Sitaram book and one > > taken fromhttp://community.schemewiki.org/?amb, I do not get the > > expected behavior when I call (amb) again to get the residual alternatives. > > E.g. in exercise 4.45, there should be 5 alternatives, but I get "amb > > tree exhausted" already when I call (amb) after the first try. > > > In general it seems the failure continuations are stored correctly in > > the macros - simple cases like > > > 1) (amb 1 2) -> 1 > > 2) (amb) -> 2 > > > work as expected, but for the more complicated cases as the > > language-parsing or the puzzles (e.g., exercise 4.43 in the > > "more-than-one-solution" version) it seems that the macros are not > > really equivalent of the SICP amb evaluator... Is this possible? > > Without actually testing the macro, I'd say the intention > of the implementation ofhttp://community.schemewiki.org/?amb > is that you can use with SICP. However, it might be that > solutions are generated in a different order than shown in > SICP. > > Do you have a concrete example, that shows where you get > results that differ from your expectation? Can you > perhaps show us what your code for 4.45 looks like? > > -- > Jens Axel S?gaard > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From noelwelsh at gmail.com Sun Dec 14 16:57:50 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:35:58 2009 Subject: [plt-scheme] how to quote identifier in macro In-Reply-To: <7123918498576384275@unknownmsgid> References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <932b2f1f0812101753s746dac8ak4cc70bad18f6f4a0@mail.gmail.com> <932b2f1f0812101812s541edc88gc7a005be17c77519@mail.gmail.com> <-6799851472409630867@unknownmsgid> <4481829986472306362@unknownmsgid> <7123918498576384275@unknownmsgid> Message-ID: You must introduce bindings at expansion time, but you cannot compute their value till eval time. Your soln was trying to compute values at expansion time. See below. #lang scheme ;; Import cut which we use below (require (for-syntax srfi/26/cut)) ;; Give attr a transformer binding. This means we can lookup the value of attr given its name at expansion time, using syntax-local-value (define-syntax attr '(a1 a2 a3)) ;; : stx symbol -> stx ;; Given a symbol construct an identifier bound in the context of context (define-for-syntax (make-id context id) (datum->syntax context id context)) ;; : alist symbol -> any (define (slot-value self attr-id) (cadr (assq attr-id self))) (define-syntax (tata stx) (syntax-case stx () [(_ a (s ps ...) body ...) (with-syntax ([(attr-id ...) ;; Given the name of the attributes lookup their value (at expansion time) ;; Then convert the attribute names to identifiers in the context we're expanding (map (cut make-id stx <>) (syntax-local-value (syntax a)))]) (syntax (? (s ps ...) (let ([attr-id (slot-value s (quote attr-id))] ...) body ...))))])) ((tata attr (self p1 p2) (display self) (newline) (+ p2 a1)) '((a1 10)(a2 20)(a3 30)) 4 5) HTH, N. From noelwelsh at gmail.com Sun Dec 14 16:59:52 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:35:59 2009 Subject: [plt-scheme] how to quote identifier in macro In-Reply-To: References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <932b2f1f0812101812s541edc88gc7a005be17c77519@mail.gmail.com> <-6799851472409630867@unknownmsgid> <4481829986472306362@unknownmsgid> <7123918498576384275@unknownmsgid> Message-ID: Also my previous email was wrong. I should have suggested define-syntax not define-for-syntax for attr. N. From rafkind at cs.utah.edu Sun Dec 14 19:29:34 2008 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Thu Mar 26 02:35:59 2009 Subject: [plt-scheme] syntax identifier used out of context In-Reply-To: <20081211195937.8B534650085@mail-svr1.cs.utah.edu> References: <4940BF8D.9040503@cs.utah.edu> <20081211195937.8B534650085@mail-svr1.cs.utah.edu> Message-ID: <4945A4EE.6070607@cs.utah.edu> Matthew Flatt wrote: > You could move `bar2' out of `foo' using `define-for-syntax', > > (define-for-syntax (bar2 stx3) > (syntax-case stx3 () > ((_ q) #'(+ 1 q)))) > > and then it works to replace the lambda with `bar2', as you expected. > I was thinking about this a little more and wondered why it was necessary to move `bar2' out of `foo'. If I define `bar2' inside `foo' then aren't I defining it in a transformer environment? If not, then what does `define-for-syntax' do that it can only be used at the top-level (or I guess module-level really). From grettke at acm.org Sun Dec 14 20:36:58 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:35:59 2009 Subject: Untyped Scheme should be built on Typed Scheme? WAS: Re: [plt-scheme] macro question Message-ID: <756daca50812141736r6d658aby1c0946c175960464@mail.gmail.com> Hi Matthias, On Tue, Jun 10, 2008 at 10:22 AM, Matthias Felleisen wrote: > On Jun 10, 2008, at 11:40 AM, hendrik@topoi.pooq.com wrote: >> In my opinion, untyped Scheme needs to be built on top of typed Scheme, >> not the other way around. But until this revolution happens, I'm >> happy to use it they way it is. > > NSF wasn't willing to fund a time machine, even when I promised I'd add cold > fusion. You were joking around here, but is there any truth to it? Theoretically if you could start over, would you implement Untyped Scheme on top of a Typed Scheme? From grettke at acm.org Sun Dec 14 20:41:17 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:35:59 2009 Subject: [plt-scheme] Is sharing unit tests for problems in HtDP a good way to facilitate learning? In-Reply-To: <990e0c030812132041u9675acbm8b4c125e00e52ef9@mail.gmail.com> References: <756daca50812132000y444c4a9ci76c751c6160bd6c8@mail.gmail.com> <990e0c030812132041u9675acbm8b4c125e00e52ef9@mail.gmail.com> Message-ID: <756daca50812141741n19456caas4717f9a18651c7c6@mail.gmail.com> Hi Carl, On Sat, Dec 13, 2008 at 10:41 PM, Carl Eastlund wrote: > On a mailing list, you never know what's graded and what's not... Right, thanks for the reminder. I am used to talking to folks who are doing HtDP on "nights and weekends", in other words, school is not their "day job" :). Best wishes, Grant From vyzo at media.mit.edu Mon Dec 15 01:45:02 2008 From: vyzo at media.mit.edu (Dimitris Vyzovitis) Date: Thu Mar 26 02:35:59 2009 Subject: [plt-scheme] mred, bitmaps, and X memory usage/leak Message-ID: I have an animator widge that displays by first drawing in an off screen bitmap, and then reusing the bitmap until the next update. There is only one bitmap reachable at any given time (the current bitmap). After running a number of animation steps (about a 1000), X memory usage climbs to over 1GB, even when I explicitly collect-garbage. X memory is not released until I kill the process (at which point the memory is released). Any ideas? -- vyzo From vyzo at media.mit.edu Mon Dec 15 02:34:01 2008 From: vyzo at media.mit.edu (Dimitris Vyzovitis) Date: Thu Mar 26 02:35:59 2009 Subject: [plt-scheme] mred, bitmaps, and X memory usage/leak In-Reply-To: References: Message-ID: On Mon, 15 Dec 2008, Dimitris Vyzovitis wrote: > After running a number of animation steps (about a 1000), X memory usage > climbs to over 1GB, even when I explicitly collect-garbage. X memory is not > released until I kill the process (at which point the memory is released). Leak trigger attached. 1) fire top 2) mred -iqz > (require "xleak.ss") > (go) 3) sort top by memory (M) and watch X's memory go nooooooorth -- vyzo PS: terrible flicker! -------------- next part -------------- #lang scheme/gui (provide (all-defined-out)) (define-syntax-rule (color r g b) (make-object color% r g b)) (define-syntax-rule (palette a b e) (for/list ((a (in-range 0 255)) (b (in-range 255 0 -1))) e)) (define (leaking-canvas dt) (let ((colors (list->vector (append (palette g r (color r g 0)) (palette b g (color 0 g b)) (palette r b (color r 0 b)))))) (class canvas% (inherit get-width get-height refresh) (define next 0) (define current #f) (define timer #f) (define (on-superwindow-show shown?) (if shown? (set! timer (new timer% (notify-callback notify) (interval dt))) (begin (send timer stop) (set! timer #f)))) (override on-superwindow-show) (define (notify) (set! current #f) (set! next (modulo (add1 next) (vector-length colors))) (refresh)) (define (repaint _self dc) (unless (and current (= (get-width) (send current get-width)) (= (get-height) (send current get-height))) (let ((c (vector-ref colors next))) (printf "draw ~a ~a ~a~n" (send c red) (send c green) (send c blue))) (set! current (make-object bitmap% (get-width) (get-height))) (let ((bdc (new bitmap-dc% (bitmap current)))) (send bdc clear) (send bdc set-smoothing 'smoothed) (send bdc set-brush (send the-brush-list find-or-create-brush (vector-ref colors next) 'solid)) (send bdc draw-ellipse 0 0 (get-width) (get-height)))) (send dc draw-bitmap current 0 0)) (super-new (paint-callback repaint) (min-width 200) (min-height 200))))) (define xframe% (class frame% (define (can-close?) #t) (augment can-close?) (super-new))) (define (go (dt 100)) (let ((f (new xframe% (label "I am leaking!") (width 800) (height 800)))) (new (leaking-canvas dt) (parent f)) (send f show #t) (yield 'wait))) From mflatt at cs.utah.edu Mon Dec 15 07:55:10 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:35:59 2009 Subject: [plt-scheme] mred, bitmaps, and X memory usage/leak In-Reply-To: References: Message-ID: <20081215125512.71B3E6500AE@mail-svr1.cs.utah.edu> At Mon, 15 Dec 2008 02:34:01 -0500 (EST), Dimitris Vyzovitis wrote: > On Mon, 15 Dec 2008, Dimitris Vyzovitis wrote: > > > After running a number of animation steps (about a 1000), X memory usage > > climbs to over 1GB, even when I explicitly collect-garbage. X memory is not > > released until I kill the process (at which point the memory is released). > > Leak trigger attached. > 1) fire top > 2) mred -iqz > > (require "xleak.ss") > > (go) > 3) sort top by memory (M) and watch X's memory go nooooooorth I'm not able to reproduce the problem so far. I've tried running the program under x86_64 Linux and the X11 build for Mac OS X (as well as normal Mac OS X). Can you think of anything special about your configuration? Or can you reproduce the problem yourself on multiple machines (which would suggest that I'm just not running it right)? > PS: terrible flicker! Use the 'no-autoclear style for `canvas%'. Matthew From andre.mayers at usherbrooke.ca Mon Dec 15 08:36:06 2008 From: andre.mayers at usherbrooke.ca (Andre Mayers) Date: Thu Mar 26 02:36:00 2009 Subject: [plt-scheme] how to quote identifier in macro In-Reply-To: References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <932b2f1f0812101753s746dac8ak4cc70bad18f6f4a0@mail.gmail.com> <932b2f1f0812101812s541edc88gc7a005be17c77519@mail.gmail.com> <-6799851472409630867@unknownmsgid> <4481829986472306362@unknownmsgid> <7123918498576384275@unknownmsgid> Message-ID: <001201c95eba$153df600$3fb9e200$@mayers@usherbrooke.ca> You have introduced new scheme constructs that I didn't know before. I will be happy to know more about them, can you suggest any references. And your solution works well, thank you Noel, Andre -----Message d'origine----- De : Noel Welsh [mailto:noelwelsh@gmail.com] Envoy? : December-14-08 4:58 PM ? : andre.mayers@usherbrooke.ca Cc : pltscheme Objet : Re: [plt-scheme] how to quote identifier in macro You must introduce bindings at expansion time, but you cannot compute their value till eval time. Your soln was trying to compute values at expansion time. See below. #lang scheme ;; Import cut which we use below (require (for-syntax srfi/26/cut)) ;; Give attr a transformer binding. This means we can lookup the value of attr given its name at expansion time, using syntax-local-value (define-syntax attr '(a1 a2 a3)) ;; : stx symbol -> stx ;; Given a symbol construct an identifier bound in the context of context (define-for-syntax (make-id context id) (datum->syntax context id context)) ;; : alist symbol -> any (define (slot-value self attr-id) (cadr (assq attr-id self))) (define-syntax (tata stx) (syntax-case stx () [(_ a (s ps ...) body ...) (with-syntax ([(attr-id ...) ;; Given the name of the attributes lookup their value (at expansion time) ;; Then convert the attribute names to identifiers in the context we're expanding (map (cut make-id stx <>) (syntax-local-value (syntax a)))]) (syntax (? (s ps ...) (let ([attr-id (slot-value s (quote attr-id))] ...) body ...))))])) ((tata attr (self p1 p2) (display self) (newline) (+ p2 a1)) '((a1 10)(a2 20)(a3 30)) 4 5) HTH, N. From ebellani at gmail.com Mon Dec 15 08:52:42 2008 From: ebellani at gmail.com (Eduardo Bellani) Date: Thu Mar 26 02:36:00 2009 Subject: [plt-scheme] Is sharing unit tests for problems in HtDP a good way to facilitate learning? In-Reply-To: <756daca50812141741n19456caas4717f9a18651c7c6@mail.gmail.com> References: <756daca50812132000y444c4a9ci76c751c6160bd6c8@mail.gmail.com> <990e0c030812132041u9675acbm8b4c125e00e52ef9@mail.gmail.com> <756daca50812141741n19456caas4717f9a18651c7c6@mail.gmail.com> Message-ID: <184222e50812150552y5912c744r583da5641b606fdd@mail.gmail.com> In the case of people who are doing that on their own, where motivations is something that you can take for granted and there is no interest in cheating I think unit tests and stuff like that work great (I for instance always go for the tests whenever I want to learn a new piece of software, and most guys from the agile field do the same I guess). I think the "problem" with this approach is for college students looking only for grades (the grading system sucks IMHO) in their testing, hmm, test? :) On Sun, Dec 14, 2008 at 11:41 PM, Grant Rettke wrote: > Hi Carl, > > On Sat, Dec 13, 2008 at 10:41 PM, Carl Eastlund wrote: >> On a mailing list, you never know what's graded and what's not... > > Right, thanks for the reminder. > > I am used to talking to folks who are doing HtDP on "nights and > weekends", in other words, school is not their "day job" :). > > Best wishes, > > Grant > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Eduardo Bellani www.cnxs.com.br "What is hateful to you, do not to your fellow men. That is the entire Law; all the rest is commentary." The Talmud From toddobryan at gmail.com Mon Dec 15 08:59:17 2008 From: toddobryan at gmail.com (Todd O'Bryan) Date: Thu Mar 26 02:36:00 2009 Subject: [plt-scheme] answers in list archive Message-ID: <904774730812150559s7d09cc54r37d11a416b7102d8@mail.gmail.com> One of my students pointed out that plt-scheme has an archive that's publicly available: http://list.cs.brown.edu/pipermail/plt-scheme/2008-April/024020.html so any help or solutions we post are only a Google away. Didn't the archives used to require a password or something? Todd From noelwelsh at gmail.com Mon Dec 15 09:21:40 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:36:00 2009 Subject: [plt-scheme] how to quote identifier in macro In-Reply-To: <-6271452102888558791@unknownmsgid> References: <756daca50812101426r27484674ga41778558a4f7316@mail.gmail.com> <932b2f1f0812101812s541edc88gc7a005be17c77519@mail.gmail.com> <-6799851472409630867@unknownmsgid> <4481829986472306362@unknownmsgid> <7123918498576384275@unknownmsgid> <-6271452102888558791@unknownmsgid> Message-ID: Everything should be in the docs (docs.plt-scheme.org or your local copy). N. On Mon, Dec 15, 2008 at 1:36 PM, Andre Mayers wrote: > You have introduced new scheme constructs that I didn't know before. > I will be happy to know more about them, can you suggest any references. > And your solution works well, > thank you Noel, > > Andre From sk at cs.brown.edu Mon Dec 15 10:04:01 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:36:00 2009 Subject: [plt-scheme] answers in list archive In-Reply-To: <904774730812150559s7d09cc54r37d11a416b7102d8@mail.gmail.com> References: <904774730812150559s7d09cc54r37d11a416b7102d8@mail.gmail.com> Message-ID: No, plt-scheme list is fully public. Since list membership is not limited, it doesn't make sense to limit the archive. It's plt-edu that you should not be able to get to. On Mon, Dec 15, 2008 at 8:59 AM, Todd O'Bryan wrote: > One of my students pointed out that plt-scheme has an archive that's > publicly available: > > http://list.cs.brown.edu/pipermail/plt-scheme/2008-April/024020.html > > so any help or solutions we post are only a Google away. Didn't the > archives used to require a password or something? > > Todd > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From karthickarun21 at gmail.com Sat Dec 13 13:18:28 2008 From: karthickarun21 at gmail.com (kathir) Date: Thu Mar 26 02:36:00 2009 Subject: [plt-scheme] need dorai's book Message-ID: <63238203-5ae8-4bbb-8b97-f29288c8e2de@i18g2000prf.googlegroups.com> anyone pl tell the link for dorai's book for scheme From noelwelsh at gmail.com Mon Dec 15 10:11:49 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:36:01 2009 Subject: [plt-scheme] need dorai's book In-Reply-To: <63238203-5ae8-4bbb-8b97-f29288c8e2de@i18g2000prf.googlegroups.com> References: <63238203-5ae8-4bbb-8b97-f29288c8e2de@i18g2000prf.googlegroups.com> Message-ID: Google "dorai scheme" N. On Sat, Dec 13, 2008 at 6:18 PM, kathir wrote: > anyone pl tell the link for dorai's book for scheme From jay.mccarthy at gmail.com Mon Dec 15 10:12:13 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:36:01 2009 Subject: [plt-scheme] need dorai's book In-Reply-To: <63238203-5ae8-4bbb-8b97-f29288c8e2de@i18g2000prf.googlegroups.com> References: <63238203-5ae8-4bbb-8b97-f29288c8e2de@i18g2000prf.googlegroups.com> Message-ID: I type in "Dorai Scheme" into Google, and the top hit is: http://www.ccs.neu.edu/home/dorai/t-y-scheme/t-y-scheme.html Jay On Sat, Dec 13, 2008 at 11:18 AM, kathir wrote: > anyone pl tell the link for dorai's book for scheme > _________________________________________________ > 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 pivanyi at freemail.hu Mon Dec 15 10:21:58 2008 From: pivanyi at freemail.hu (Ivanyi Peter) Date: Thu Mar 26 02:36:01 2009 Subject: [plt-scheme] mred, bitmaps, and X memory usage/leak In-Reply-To: <20081215125512.71B3E6500AE@mail-svr1.cs.utah.edu> Message-ID: Matthew Flatt , ezt ?rta: > Can you think of anything special about your configuration? Or can you > reproduce the problem yourself on multiple machines (which would > suggest that I'm just not running it right)? One big difference can be the X window system. As I remember the "old" system use to have problems with bitmaps, that it could not free them up properly. Just an idea. Best regards, Peter Ivanyi From icfp.publicity at googlemail.com Mon Dec 15 12:51:07 2008 From: icfp.publicity at googlemail.com (Matthew Fluet (ICFP Publicity Chair)) Date: Thu Mar 26 02:36:01 2009 Subject: [plt-scheme] ICFP09 Call for Papers Message-ID: <53ff55480812150951n4394b666xf76b4cb4f2992b88@mail.gmail.com> Call for Papers ICFP 2009: International Conference on Functional Programming Edinburgh, Scotland, 31 August - 2 September 2009 http://www.cs.nott.ac.uk/~gmh/icfp09.html ** Submission deadline: 2 March 2009 ** (submission deadline is earlier than usual) ICFP 2009 seeks original papers on the art and science of functional programming. Submissions are invited on all topics from principles to practice, from foundations to features, from abstraction to application. The scope includes all languages that encourage functional programming, including both purely applicative and imperative languages, as well as languages with objects or concurrency. Particular topics of interest include * Language Design: type systems; concurrency and distribution; modules; components and composition; metaprogramming; relations to object-oriented or logic programming; interoperability * Implementation: abstract machines; compilation; compile-time and run-time optimization; memory management; multi-threading; exploiting parallel hardware; interfaces to foreign functions, services, components or low-level machine resources * Software-Development Techniques: algorithms and data structures; design patterns; specification; verification; validation; proof assistants; debugging; testing; tracing; profiling * Foundations: formal semantics; lambda calculus; rewriting; type theory; monads; continuations; control; state; effects * Transformation and Analysis: abstract interpretation; partial evaluation; program transformation; program calculation; program proof * Applications and Domain-Specific Languages: symbolic computing; formal-methods tools; artificial intelligence; systems programming; distributed-systems and web programming; hardware design; databases; XML processing; scientific and numerical computing; graphical user interfaces; multimedia programming; scripting; system administration; security; education * Functional Pearls: elegant, instructive, and fun essays on functional programming The conference also solicits Experience Reports, which are short papers that provide evidence that functional programming really works or describe obstacles that have kept it from working in a particular application. What's different this year? ~~~~~~~~~~~~~~~~~~~~~~~~~~~ * The conference dates and the submission deadline are about one month earlier than usual. * Special 'Call for Experience Reports' page, suitable as a target for posts on blogs and social networks to reach practitioners who wouldn't normally think about submitting to a conference. If you have a blog, etc., please help by pointing your readers to: http://web.cecs.pdx.edu/~apt/icfp09_cfer.html Instructions for authors ~~~~~~~~~~~~~~~~~~~~~~~~ By Monday, 2 March 2009, 20:00 UTC, submit an abstract of at most 300 words and a full paper of at most 12 pages (4 pages for an Experience Report), including bibliography and figures. The deadline will be strictly enforced and papers exceeding the page limits will be summarily rejected. Authors have the option to attach supplementary material to a submission, on the understanding that reviewers may choose not to look at it. A submission will be evaluated according to its relevance, correctness, significance, originality, and clarity. It should explain its contributions in both general and technical terms, clearly identifying what has been accomplished, explaining why it is significant, and comparing it with previous work. The technical content should be accessible to a broad audience. Functional Pearls and Experience Reports are separate categories of papers that need not report original research results and must be marked as such at the time of submission. Detailed guidelines on both categories are below. Each submission must adhere to SIGPLAN's republication policy, as explained on the web. Violation risks summary rejection of the offending submission. Proceedings will be published by ACM Press. Authors of accepted submissions are expected to transfer the copyright to ACM. Presentations will be videotaped and released online if the presenter consents by signing an additional permission form at the time of the presentation. Released videos will be included along with the conference proceedings in the ACM Digital Library and may also be placed on a host such as YouTube or Google Video. Formatting: ~~~~~~~~~~~ Submissions must be in PDF format printable in black and white on US Letter sized paper and interpretable by Ghostscript. If this requirement is a hardship, make contact with the program chair at least one week before the deadline. ICFP proceedings are printed in black and white. It is permissible to include color in a submission, but you risk annoying reviewers who will have to decide if your final paper will be understandable without it. Papers must adhere to the standard ACM conference format: two columns, nine-point font on a ten-point baseline, with columns 20pc (3.33in) wide and 54pc (9in) tall, with a column gutter of 2pc (0.33in). A suitable document template for LaTeX is available from SIGPLAN. Submission: ~~~~~~~~~~~ Submissions will be accepted electronically at a URL to be named later. The deadline is set in Coordinated Universal Time. The world clock (http://www.timeanddate.com/worldclock/fixedtime.html?month=3&day=2&year=2009&hour=20&min=0&sec=0&p1=0) can give you the equivalent in your local time, e.g., Noon Monday in Seattle, 3:00 PM Monday in New York, 8:00 PM Monday in London, 5:00 AM Tuesday in Tokyo. Citation: ~~~~~~~~~ We recommend (but do not require) that you put your citations into author-date form. This procedure makes your paper easier to review. For example, if you cite a result on testing as ``(Claessen and Hughes 2000)'', many reviewers will recognize the result instantly. On the other hand, if you cite it as ``[4]'', even the best-informed reviewer has to page through your paper to find the reference. By using author-date form, you enable a knowledgeable reviewer to focus on content, not arbitrary numbering of references. LaTeX users can simply use the natbib package along with the plainnat bibliography style. In practice, this means putting \usepackage{natbib} \bibpunct();A{}, \let\cite=\citep in your LaTeX preamble, and \bibliographystyle{plainnat} in your document. For most citations you will use the \cite command; if you want a citation like ``Claessen and Hughes (2000) showed that...'' you should use something like ``\citet{claessen:quickcheck} showed...'' Alternatively, the McBride bibliography style, which adheres to the Chicago manual of style ``Documentation Two'' specifications and which fixes some perceived deficiencies of natbib, may be used. The style file along with instructions for using it is available on the McBride web site. Author response: ~~~~~~~~~~~~~~~~ Authors will have a 48-hour period, starting at 20:00 UTC on 21 April 2009, to read and respond to reviews. Special categories of papers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In addition to research papers, ICFP solicits two kinds of papers that do not require original research contributions: Functional Pearls, which are full papers, and Experience Reports, which are limited to four pages. Authors submitting such papers may wish to consider the following advice. Functional Pearls ~~~~~~~~~~~~~~~~~ A Functional Pearl is an elegant essay about something related to functional programming. It might offer: * a new and thought-provoking way of looking at an old idea * an instructive example of program calculation or proof * a nifty presentation of an old or new data structure * an interesting application of functional programming techniques * a novel use or exposition of functional programming in the classroom Functional Pearls are not restricted to the above varieties, however. While pearls often demonstrate an idea through the development of a short program, there is no requirement or expectation that they do so. Thus, they encompass the notions of theoretical and educational pearls. Functional Pearls are valued as highly and judged as rigorously as ordinary papers, but using somewhat different criteria. In particular, a pearl is not required to report original research. However, it should be concise, instructive, and entertaining. Your pearl is likely to be rejected if your readers get bored, if the material gets too complicated, if too much specialized knowledge is needed, or if the writing is inelegant. The key to writing a good pearl is polishing. A submission you wish to have treated as a pearl must be marked as such on the submission web page, and should contain the words ``Functional Pearl'' somewhere in its title or subtitle. These steps will alert reviewers to use the appropriate evaluation criteria. However, pearls will be combined with ordinary papers for the purpose of computing the conference's acceptance rate. Experience Reports ~~~~~~~~~~~~~~~~~~ The purpose of an Experience Report is to help create a body of published, refereed, citable evidence that functional programming really works---or to describe what obstacles prevent it from working. Possible topics for an Experience Report include, but are not limited to: * insights gained from real-world projects using functional programming * comparison of functional programming with conventional programming in the context of an industrial project or a university curriculum * project-management, business, or legal issues encountered when using functional programming in a real-world project * curricular issues encountered when using functional programming in education * real-world constraints that created special challenges for an implementation of a functional language or for functional programming in general An Experience Report is distinguished from a normal ICFP paper by its title, by its length, and by the criteria used to evaluate it. * Both in the proceedings and in any citations, the title of each accepted Experience Report must begin with the words ``Experience Report'' followed by a colon. The acceptance rate for Experience Reports will be computed and reported separately from the rate for ordinary papers. * An Experience Report is at most 4 pages long. Each accepted Experience Report will be presented at the conference, but depending on the number of Experience Reports and regular papers accepted, authors of Experience reports may be asked to give shorter talks. * Because the purpose of Experience Reports is to enable our community to accumulate a body of evidence about the efficacy of functional programming, an acceptable Experience Report need not add to the body of knowledge of the functional-programming community by presenting novel results or conclusions. It is sufficient if the Report states a clear thesis and provides supporting evidence. The thesis must be relevant to ICFP, but it need not be novel. The program committee will accept or reject Experience Reports based on whether they judge the evidence to be convincing. Anecdotal evidence will be acceptable provided it is well argued and the author explains what efforts were made to gather as much evidence as possible. Typically, more convincing evidence is obtained from papers which show how functional programming was used than from papers which only say that functional programming was used. The most convincing evidence often includes comparisons of situations before and after the introduction or discontinuation of functional programming. Evidence drawn from a single person's experience may be sufficient, but more weight will be given to evidence drawn from the experience of groups of people. An Experience Report should be short and to the point: make a claim about how well functional programming worked on your project and why, and produce evidence to substantiate your claim. If functional programming worked for you in the same ways it has worked for others, you need only to summarize the results---the main part of your paper should discuss how well it worked and in what context. Most readers will not want to know all the details of your project and its implementation, but please characterize your project and its context well enough so that readers can judge to what degree your experience is relevant to their own projects. Be especially careful to highlight any unusual aspects of your project. Also keep in mind that specifics about your project are more valuable than generalities about functional programming; for example, it is more valuable to say that your team delivered its software a month ahead of schedule than it is to say that functional programming made your team more productive. If your paper not only describes experience but also presents new technical results, or if your experience refutes cherished beliefs of the functional-programming community, you may be better off submitting it as a full paper, which will be judged by the usual criteria of novelty, originality, and relevance. If you are unsure in which category to submit, the program chair will be happy to help you decide. Other information ~~~~~~~~~~~~~~~~~ Conference Chair ~~~~~~~~~~~~~~~~ Graham Hutton (University of Nottingham) Program Chair ~~~~~~~~~~~~~ Andrew Tolmach Department of Computer Science Portland State University P.O. Box 751, Portland, OR 97207 USA Email: apt@cs.pdx.edu Phone: +1 503 725 5492 Fax: +1 503 725 3211 Mail sent to the address above is filtered for spam. If you send mail and do not receive a prompt response, particularly if the deadline is looming, feel free to telephone. Program Committee ~~~~~~~~~~~~~~~~~ Amal Ahmed (Toyota Technological Institute, Chicago) Maria Alpuente (Technical University of Valencia (UPV)) Lennart Augustsson (Standard Chartered Bank) Lars Birkedal (IT University of Copenhagen) Manuel Chakravarty (University of New South Wales) Koen Claessen (Chalmers University of Technology) Marc Feeley (Universite de Montreal) Andrzej Filinski (University of Copenhagen) Daan Leijen (Microsoft Research) Xavier Leroy (INRIA Paris-Rocquencourt) Conor McBride (University of Strathclyde) Matthew Might (University of Utah) Shin-Cheng Mu (Academia Sinica) Atsushi Ohori (Tohoku University) Kristoffer Rose (IBM Thomas J. Watson Research Center) Important Dates (at 20:00 UTC) ~~~~~~~~~~~~~~~ Submission: 2 March 2009 Author response: 21-23 April 2009 Notification: 5 May 2009 Final papers due: 8 June 2009 ICFP 2009 Web Site ~~~~~~~~~~~~~~~~~~ http://www.cs.nott.ac.uk/~gmh/icfp09.html Special Journal Issue ~~~~~~~~~~~~~~~~~~~~~ There will be a special issue of the Journal of Functional Programming with papers from ICFP 2009. The program committee will invite the authors of select accepted papers to submit a journal version to this issue. From vyzo at media.mit.edu Mon Dec 15 14:12:32 2008 From: vyzo at media.mit.edu (Dimitris Vyzovitis) Date: Thu Mar 26 02:36:01 2009 Subject: [plt-scheme] mred, bitmaps, and X memory usage/leak In-Reply-To: <20081215125512.71B3E6500AE@mail-svr1.cs.utah.edu> References: <20081215125512.71B3E6500AE@mail-svr1.cs.utah.edu> Message-ID: On Mon, 15 Dec 2008, Matthew Flatt wrote: > I'm not able to reproduce the problem so far. I've tried running the > program under x86_64 Linux and the X11 build for Mac OS X (as well as > normal Mac OS X). > > Can you think of anything special about your configuration? Or can you > reproduce the problem yourself on multiple machines (which would > suggest that I'm just not running it right)? There wasn't anything special for running it, just let it run for a while. X memory starts going way off after about 500 steps in the example code (palette switches to green). I don't have another machine with display available right now. I am using xorg-server-1.3.0.0, with the nv driver (xf86-video-nv-2.1.12) [xorg.conf: Option "XaaNoOffscreenPixmaps"] Perhaps it is an X related bug? Can anyone else test on X11? -- vyzo From samth at ccs.neu.edu Mon Dec 15 14:24:49 2008 From: samth at ccs.neu.edu (Sam TH) Date: Thu Mar 26 02:36:01 2009 Subject: [plt-scheme] mred, bitmaps, and X memory usage/leak In-Reply-To: References: <20081215125512.71B3E6500AE@mail-svr1.cs.utah.edu> Message-ID: <63bb19ae0812151124o5e852110w62389da9a348c530@mail.gmail.com> I can definitely reproduce this on my machine. before: 17499 root 15 0 406m 62m 14m S 1.3 3.1 1279:21 Xorg after 1 min: 17499 root 15 0 1676m 1.2g 12m S 21.9 61.2 1279:55 Xorg after killing and `collect-garbage' 17499 root 15 0 1783m 1.3g 11m S 2.0 63.5 1279:58 Xorg after quitting mred: 17499 root 15 0 406m 38m 11m R 2.3 1.9 1280:01 Xorg Matthew, if you want to test on my machine, contact me off-list. sam th On Mon, Dec 15, 2008 at 2:12 PM, Dimitris Vyzovitis wrote: > On Mon, 15 Dec 2008, Matthew Flatt wrote: > >> I'm not able to reproduce the problem so far. I've tried running the >> program under x86_64 Linux and the X11 build for Mac OS X (as well as >> normal Mac OS X). >> >> Can you think of anything special about your configuration? Or can you >> reproduce the problem yourself on multiple machines (which would >> suggest that I'm just not running it right)? > > There wasn't anything special for running it, just let it run for a while. > X memory starts going way off after about 500 steps in the example code > (palette switches to green). > > I don't have another machine with display available right now. > I am using xorg-server-1.3.0.0, with the nv driver (xf86-video-nv-2.1.12) > [xorg.conf: Option "XaaNoOffscreenPixmaps"] > > Perhaps it is an X related bug? Can anyone else test on X11? > > -- vyzo > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- sam th samth@ccs.neu.edu From rafkind at cs.utah.edu Mon Dec 15 14:42:05 2008 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Thu Mar 26 02:36:02 2009 Subject: [plt-scheme] mred, bitmaps, and X memory usage/leak In-Reply-To: <63bb19ae0812151124o5e852110w62389da9a348c530@mail.gmail.com> References: <20081215125512.71B3E6500AE@mail-svr1.cs.utah.edu> <63bb19ae0812151124o5e852110w62389da9a348c530@mail.gmail.com> Message-ID: <4946B30D.6000407@cs.utah.edu> Sam TH wrote: > I can definitely reproduce this on my machine. > > before: > 17499 root 15 0 406m 62m 14m S 1.3 3.1 1279:21 Xorg > after 1 min: > 17499 root 15 0 1676m 1.2g 12m S 21.9 61.2 1279:55 Xorg > after killing and `collect-garbage' > 17499 root 15 0 1783m 1.3g 11m S 2.0 63.5 1279:58 Xorg > after quitting mred: > 17499 root 15 0 406m 38m 11m R 2.3 1.9 1280:01 Xorg > I have the same behavior as well. Ubuntu 8.04 X.Org X Server 1.4.0.90 Release Date: 5 September 2007 From mflatt at cs.utah.edu Mon Dec 15 18:18:07 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:36:02 2009 Subject: [plt-scheme] mred, bitmaps, and X memory usage/leak In-Reply-To: References: <20081215125512.71B3E6500AE@mail-svr1.cs.utah.edu> Message-ID: <20081215231808.8C1AB6500C2@mail-svr1.cs.utah.edu> At Mon, 15 Dec 2008 14:12:32 -0500 (EST), Dimitris Vyzovitis wrote: > On Mon, 15 Dec 2008, Matthew Flatt wrote: > > > I'm not able to reproduce the problem so far. I've tried running the > > program under x86_64 Linux and the X11 build for Mac OS X (as well as > > normal Mac OS X). > > > > Can you think of anything special about your configuration? Or can you > > reproduce the problem yourself on multiple machines (which would > > suggest that I'm just not running it right)? > > There wasn't anything special for running it, just let it run for a while. > X memory starts going way off after about 500 steps in the example code > (palette switches to green). I wasn't looking closely enough at my configuration, and it turns out that neither machine's build had Cairo enabled. The bug was related to releasing Cairo contexts for drawing in smoothed mode, and it's now fixed in SVN. Thanks, Matthew From vyzo at media.mit.edu Mon Dec 15 19:37:27 2008 From: vyzo at media.mit.edu (Dimitris Vyzovitis) Date: Thu Mar 26 02:36:02 2009 Subject: [plt-scheme] mred, bitmaps, and X memory usage/leak In-Reply-To: <20081215231808.8C1AB6500C2@mail-svr1.cs.utah.edu> References: <20081215125512.71B3E6500AE@mail-svr1.cs.utah.edu> <20081215231808.8C1AB6500C2@mail-svr1.cs.utah.edu> Message-ID: On Mon, 15 Dec 2008, Matthew Flatt wrote: > The bug was related to releasing Cairo contexts for drawing in smoothed > mode, and it's now fixed in SVN. Fix confirmed. Thanks! -- vyzo From matthias at ccs.neu.edu Tue Dec 16 11:23:59 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:36:02 2009 Subject: [plt-scheme] answers in list archive In-Reply-To: References: <904774730812150559s7d09cc54r37d11a416b7102d8@mail.gmail.com> Message-ID: <0B19BFB2-FD23-494D-9A0D-C9EE0DA8CBAF@ccs.neu.edu> It leaves us with the question of how to help teachers prevent cheating when they assign plain book problems. -- Matthias On Dec 15, 2008, at 10:04 AM, Shriram Krishnamurthi wrote: > No, plt-scheme list is fully public. Since list membership is not > limited, it doesn't make sense to limit the archive. It's plt-edu > that you should not be able to get to. > > On Mon, Dec 15, 2008 at 8:59 AM, Todd O'Bryan > wrote: >> One of my students pointed out that plt-scheme has an archive that's >> publicly available: >> >> http://list.cs.brown.edu/pipermail/plt-scheme/2008-April/024020.html >> >> so any help or solutions we post are only a Google away. Didn't the >> archives used to require a password or something? >> >> Todd >> _________________________________________________ >> 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 sk at cs.brown.edu Tue Dec 16 11:42:08 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:36:03 2009 Subject: [plt-scheme] answers in list archive In-Reply-To: References: <904774730812150559s7d09cc54r37d11a416b7102d8@mail.gmail.com> <0B19BFB2-FD23-494D-9A0D-C9EE0DA8CBAF@ccs.neu.edu> Message-ID: You might as well be Canute. On Dec 16, 2008 11:25 AM, "Matthias Felleisen" wrote: It leaves us with the question of how to help teachers prevent cheating when they assign plain book problems. -- Matthias On Dec 15, 2008, at 10:04 AM, Shriram Krishnamurthi wrote: > No, plt-scheme list is fully publi... -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081216/7df5ba1c/attachment.html From neil at neilvandyke.org Tue Dec 16 11:48:05 2008 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:36:03 2009 Subject: [plt-scheme] answers in list archive In-Reply-To: <0B19BFB2-FD23-494D-9A0D-C9EE0DA8CBAF@ccs.neu.edu> References: <904774730812150559s7d09cc54r37d11a416b7102d8@mail.gmail.com> <0B19BFB2-FD23-494D-9A0D-C9EE0DA8CBAF@ccs.neu.edu> Message-ID: <4947DBC5.7020306@neilvandyke.org> Matthias Felleisen wrote at 12/16/2008 11:23 AM: > It leaves us with the question of how to help teachers prevent > cheating when they assign plain book problems. -- Matthias New tool: PLT RevHonorcode -- http://www.neilvandyke.org/ From sk at cs.brown.edu Tue Dec 16 14:06:22 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:36:03 2009 Subject: [plt-scheme] answers in list archive In-Reply-To: <0B19BFB2-FD23-494D-9A0D-C9EE0DA8CBAF@ccs.neu.edu> References: <904774730812150559s7d09cc54r37d11a416b7102d8@mail.gmail.com> <0B19BFB2-FD23-494D-9A0D-C9EE0DA8CBAF@ccs.neu.edu> Message-ID: You could augment DrScheme to record every keystroke. Cheating cases presumably tend to be characterized by a large paste operation, usually at the beginning (and possibly followed by several alpha-renamings). Eliminating the latter avoids penalizing those who simply prefer writing their code in a different editor. I wonder how well Marmoset does on this, given that it does a CVS commit on every save. Shriram On Tue, Dec 16, 2008 at 11:23 AM, Matthias Felleisen wrote: > > It leaves us with the question of how to help teachers prevent cheating when > they assign plain book problems. -- Matthias > > > > On Dec 15, 2008, at 10:04 AM, Shriram Krishnamurthi wrote: > >> No, plt-scheme list is fully public. Since list membership is not >> limited, it doesn't make sense to limit the archive. It's plt-edu >> that you should not be able to get to. >> >> On Mon, Dec 15, 2008 at 8:59 AM, Todd O'Bryan >> wrote: >>> >>> One of my students pointed out that plt-scheme has an archive that's >>> publicly available: >>> >>> http://list.cs.brown.edu/pipermail/plt-scheme/2008-April/024020.html >>> >>> so any help or solutions we post are only a Google away. Didn't the >>> archives used to require a password or something? >>> >>> Todd >>> _________________________________________________ >>> For list-related administrative tasks: >>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From neil at neilvandyke.org Tue Dec 16 14:15:42 2008 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:36:03 2009 Subject: [plt-scheme] answers in list archive In-Reply-To: References: <904774730812150559s7d09cc54r37d11a416b7102d8@mail.gmail.com> <0B19BFB2-FD23-494D-9A0D-C9EE0DA8CBAF@ccs.neu.edu> Message-ID: <4947FE5E.8050308@neilvandyke.org> Shriram Krishnamurthi wrote at 12/16/2008 02:06 PM: > You could augment DrScheme to record every keystroke. Cheating cases > presumably tend to be characterized by a large paste operation Sounds somewhat analogous to math exams in which you have to turn in all your scratchpaper. I'd say that a respected honor code -- rather than technological surveillance -- is the way to go. PLT could teach not only better thinking, but better character. :) Neil -- http://www.neilvandyke.org/ From cwbowron at gmail.com Tue Dec 16 15:21:49 2008 From: cwbowron at gmail.com (Christopher Bowron) Date: Thu Mar 26 02:36:04 2009 Subject: [plt-scheme] Sequencing with a resource that needs to be released Message-ID: <114e756c0812161221x64ccd0d5wa673c0ded7e9316@mail.gmail.com> I recently figured out how the sequence generators can be helpful in my program and I was putting together a function to generate all the rows of the database in my app, but I realized I have a problem. I am using Jay McCarthy's SQLite module and using prepare, load-params, step and finalize to generate all the matching rows. I see that I could use the exec function, but I was interested in using sequences for stylistic reasons and to learn sequences better. My problem is how to call finalize correctly. In the ideal case, where the entire sequence is iterated on, I can clean up in the functions the determine whether or not to continue the sequence, but it seems that if the sequence is short circuited as in a for/and or for/or then my statement cannot be finalized and the database will stay locked. >From reading the docs I couldn't think of a way to ensure that I was releasing the resources correctly, but I was wondering if anyone had an idea. Here is the code that I wrote: (define (in-database-file-indexes (where #f) . rest) (let ([stmt (prepare (database) (if where (format "SELECT file_index FROM media WHERE ~A" where) "SELECT file_index FROM media"))]) (make-do-sequence (lambda () (values (lambda (p) (and-let* ([r (step p)]) (vector-ref r 0))) (lambda (p) p) (begin (when (and where (not (null? rest))) (apply load-params stmt rest)) stmt) (lambda (p) #t) (lambda (v) (if v #t (begin (finalize stmt) #f))) (lambda (p v) #t)))))) -- Christopher W. Bowron [ Nothing is exciting if you know what the outcome will be ] - Joseph Campbell -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081216/0c594a45/attachment.htm From ebellani at gmail.com Tue Dec 16 16:40:58 2008 From: ebellani at gmail.com (Eduardo Bellani) Date: Thu Mar 26 02:36:04 2009 Subject: [plt-scheme] answers in list archive In-Reply-To: <4947FE5E.8050308@neilvandyke.org> References: <904774730812150559s7d09cc54r37d11a416b7102d8@mail.gmail.com> <0B19BFB2-FD23-494D-9A0D-C9EE0DA8CBAF@ccs.neu.edu> <4947FE5E.8050308@neilvandyke.org> Message-ID: <184222e50812161340o4241a154j5569338a6d985468@mail.gmail.com> I'm always suspicious of technological solutions to social problems. Teaching the value of learning instead of forcing people to not cheat. A motivated enough person will always be able to bypass simple tech solutions, but someone with a goal of learning will never cheat :P Hugs On Tue, Dec 16, 2008 at 5:15 PM, Neil Van Dyke wrote: > Shriram Krishnamurthi wrote at 12/16/2008 02:06 PM: >> >> You could augment DrScheme to record every keystroke. Cheating cases >> presumably tend to be characterized by a large paste operation > > Sounds somewhat analogous to math exams in which you have to turn in all > your scratchpaper. > > I'd say that a respected honor code -- rather than technological > surveillance -- is the way to go. > > PLT could teach not only better thinking, but better character. :) > > Neil > > -- > http://www.neilvandyke.org/ > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Eduardo Bellani www.cnxs.com.br "What is hateful to you, do not to your fellow men. That is the entire Law; all the rest is commentary." The Talmud From jay.mccarthy at gmail.com Tue Dec 16 17:25:53 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:36:04 2009 Subject: [plt-scheme] Sequencing with a resource that needs to be released In-Reply-To: <114e756c0812161221x64ccd0d5wa673c0ded7e9316@mail.gmail.com> References: <114e756c0812161221x64ccd0d5wa673c0ded7e9316@mail.gmail.com> Message-ID: One thing that might make sense is to use a will executor, however, you'll want to have a more efficient case when it is possible to detect. http://docs.plt-scheme.org/reference/willexecutor.html Jay On Tue, Dec 16, 2008 at 1:21 PM, Christopher Bowron wrote: > I recently figured out how the sequence generators can be helpful in my > program and I was putting together a function to generate all the rows of > the database in my app, but I realized I have a problem. > > I am using Jay McCarthy's SQLite module and using prepare, load-params, step > and finalize to generate all the matching rows. I see that I could use the > exec function, but I was interested in using sequences for stylistic reasons > and to learn sequences better. > > My problem is how to call finalize correctly. In the ideal case, where the > entire sequence is iterated on, I can clean up in the functions the > determine whether or not to continue the sequence, but it seems that if the > sequence is short circuited as in a for/and or for/or then my statement > cannot be finalized and the database will stay locked. > > From reading the docs I couldn't think of a way to ensure that I was > releasing the resources correctly, but I was wondering if anyone had an > idea. > > Here is the code that I wrote: > > (define (in-database-file-indexes (where #f) . rest) > (let ([stmt (prepare > (database) > (if where > (format "SELECT file_index FROM media WHERE ~A" where) > "SELECT file_index FROM media"))]) > (make-do-sequence > (lambda () > (values > (lambda (p) > (and-let* ([r (step p)]) > (vector-ref r 0))) > (lambda (p) p) > (begin > (when (and where > (not (null? rest))) > (apply load-params stmt rest)) > stmt) > (lambda (p) #t) > (lambda (v) > (if v > #t > (begin > (finalize stmt) > #f))) > (lambda (p v) #t)))))) > > -- > Christopher W. Bowron > [ Nothing is exciting if you know what the outcome will be ] > - Joseph Campbell > > _________________________________________________ > 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 maxigas at anargeek.net Tue Dec 16 23:31:29 2008 From: maxigas at anargeek.net (maxigas) Date: Thu Mar 26 02:36:04 2009 Subject: [plt-scheme] string->html/response Message-ID: <20081217.053129.224788043.maxigas@anargeek.net> hi! i'm developing a little on the Continue.. tutorial: i am storing blog posts in HTML format and read them as snippets into the page. but for this i would need a string->html/response function, or something similar. e.g.: "hello!" -> '(b "hello!") i am sure there is such a function but i don't find it in the documentation.. :o thanks, maxigas From mvyskocil at suse.cz Mon Dec 15 10:41:29 2008 From: mvyskocil at suse.cz (Michal Vyskocil) Date: Thu Mar 26 02:36:05 2009 Subject: [plt-scheme] Implicit declaration problem Message-ID: <200812151641.29449.mvyskocil@suse.cz> Hi all, I work on rpm packages of drscheme for openSUSE's new Contrib repository. Our build system noticed me about some problems in source code with implicit declaration of functions from string.h. Attached patch includes string.h on systems compiled using gcc. I don't know if the big test of existence of SYSV, SVR4 and VMS symbols I have found in some files (like char.c) is necessary nowadays, but I didn't remove it and used it in all files. Best Regards Michal Vyskocil -------------- next part -------------- A non-text attachment was scrubbed... Name: plt-implicit-fortify-decl.patch Type: text/x-patch Size: 3308 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081215/41ec3b25/plt-implicit-fortify-decl.bin From jpc-ml at zenburn.net Wed Dec 17 07:05:18 2008 From: jpc-ml at zenburn.net (=?UTF-8?B?SmFrdWIgUGlvdHIgQ8WCYXBh?=) Date: Thu Mar 26 02:36:05 2009 Subject: [plt-scheme] Default string and byte string representation Message-ID: <4948EAFE.2070105@zenburn.net> Why does Scheme defaults to using octal notation in (byte)string escape codes? AFAICT more people are familiar with hexadecimal than octal so maybe defaulting to "\xFF" escapes (which are handled correctly on input) would be better? Or maybe a parameter to set that? -- regards, Jakub Piotr C?apa From mflatt at cs.utah.edu Wed Dec 17 08:06:06 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:36:06 2009 Subject: [plt-scheme] Implicit declaration problem In-Reply-To: <200812151641.29449.mvyskocil@suse.cz> References: <200812151641.29449.mvyskocil@suse.cz> Message-ID: <20081217130609.238676500BE@mail-svr1.cs.utah.edu> At Mon, 15 Dec 2008 16:41:29 +0100, Michal Vyskocil wrote: > Attached patch includes string.h on systems compiled using gcc. Applied in SVN --- thanks! Matthew From d.j.gurnell at gmail.com Wed Dec 17 08:43:12 2008 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Thu Mar 26 02:36:06 2009 Subject: [plt-scheme] string->html/response In-Reply-To: <20081217.053129.224788043.maxigas@anargeek.net> References: <20081217.053129.224788043.maxigas@anargeek.net> Message-ID: <65A9F282-07A7-42EB-8A7C-88842DDA165E@gmail.com> maxigas wrote: > i'm developing a little on the Continue.. tutorial: i am storing > blog posts in HTML format and > read them as snippets into the page. but for this i would need a > string->html/response function, > or something similar. > > e.g.: "hello!" -> '(b "hello!") > > i am sure there is such a function but i don't find it in the > documentation.. :o Hi, One option is to parse the post HTML into a more Schemely representation. There are libraries like HTMLPrag.plt and others in recent discussion on this list that do this. It might be a more complex solution than you require, though. A simpler option might be to use an output format that allows you to include raw unquoted strings in your X(H)TML output. This way so you never need to parse the HTML from the blog post. Mirrors.plt allows this via its "!raw" syntax. Here's an example: ---------- #lang scheme (require (planet untyped/mirrors:1/xml/xml)) ; Here's your list of posts: (define blog-posts (list "Post containing bold text." "Post containing italics.")) (pretty-print blog-posts) (newline) ; Here's some Mirrors XML markup to create a simple web page. ; The !raw form instructs Mirrors not to quote the "<" and ">" characters ; in the blog post: try omitting it to see the difference: (define html (xml (html (body (p "List of the blog posts:") (ul ,@(for/list ([post (in-list blog-posts)]) (xml (li (!raw ,post))))))))) ; Note that Mirrors uses its own prefab-struct-based XML representation ; rather than the usual list-based representations: (pretty-print html) (newline) ; You can convert the structs to a string like this: (define html-as-string (xml->string html)) (pretty-print html-as-string) (newline) ; Or a web-server response like this: (define web-server-response (make-html-response html)) (pretty-print html) (newline) ; There's currently no way of converting between Mirrors and list- based XML ; representations, but it's trivial code to write (feature requests welcome on ; PLaneT Trac; code contributions welcome by email). ---------- Everything above is described on this doc page if you're interested: http://planet.plt-scheme.org/package-source/untyped/mirrors.plt/1/3/planet-docs/mirrors/xml.html Hope this helps, -- Dave From jay.mccarthy at gmail.com Wed Dec 17 08:45:40 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:36:06 2009 Subject: [plt-scheme] string->html/response In-Reply-To: <65A9F282-07A7-42EB-8A7C-88842DDA165E@gmail.com> References: <20081217.053129.224788043.maxigas@anargeek.net> <65A9F282-07A7-42EB-8A7C-88842DDA165E@gmail.com> Message-ID: On Wed, Dec 17, 2008 at 6:43 AM, Dave Gurnell wrote: > A simpler option might be to use an output format that allows you to include > raw unquoted strings in your X(H)TML output. This way so you never need to > parse the HTML from the blog post. Mirrors.plt allows this via its "!raw" > syntax. Mirrors is great. But just to clarify, you can get raw unquoted strings in the X-expression syntax with cdata structs: Examples: (make-cdata #f #f "bold") > (display (xexpr->string `(html (body (h1 "Post Title") ,(make-cdata #f #f "

Bold!

")))))

Post Title

Bold!

> -- 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 Wed Dec 17 09:11:41 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:36:06 2009 Subject: [plt-scheme] Default string and byte string representation In-Reply-To: <4948EAFE.2070105@zenburn.net> References: <4948EAFE.2070105@zenburn.net> Message-ID: <20081217141147.EE4C16500BC@mail-svr1.cs.utah.edu> At Wed, 17 Dec 2008 13:05:18 +0100, Jakub Piotr C?apa wrote: > Why does Scheme defaults to using octal notation in (byte)string escape > codes? Only byte strings print with octal. Strings print with \u escapes, right? Octal is used for byte strings mostly because octal was always used for byte strings. It does have two minor redeeming qualities: a nul byte prints relatively compactly as \0 (unless followed by a digit), and UTF-8 encodings of non-ASCII characters show up as \3oo \2oo ... sequences (while encodings of ASCII characters never print as \2oo or \3oo). > AFAICT more people are familiar with hexadecimal than octal so maybe > defaulting to "\xFF" escapes (which are handled correctly on input) > would be better? Or maybe a parameter to set that? I'm reluctant to change the default, because the reward seems low given the risk of breaking something. But we could add a parameter. Matthew From eli at barzilay.org Wed Dec 17 09:33:05 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:36:06 2009 Subject: [plt-scheme] string->html/response In-Reply-To: References: <20081217.053129.224788043.maxigas@anargeek.net> <65A9F282-07A7-42EB-8A7C-88842DDA165E@gmail.com> Message-ID: <18761.3489.568447.594614@arabic.ccs.neu.edu> On Dec 17, Jay McCarthy wrote: > On Wed, Dec 17, 2008 at 6:43 AM, Dave Gurnell wrote: > > A simpler option might be to use an output format that allows you to include > > raw unquoted strings in your X(H)TML output. This way so you never need to > > parse the HTML from the blog post. Mirrors.plt allows this via its "!raw" > > syntax. > > Mirrors is great. But just to clarify, you can get raw unquoted > strings in the X-expression syntax with cdata structs: > > Examples: > > (make-cdata #f #f "bold") > > > (display > (xexpr->string > `(html > (body (h1 "Post Title") > ,(make-cdata #f #f > "

Bold!

"))))) >

Post Title

Bold!

And a scribble-syntax alternative: #reader scribble/reader #lang scheme (require (except-in xml cdata)) (define (cdata . xs) (make-cdata #f #f (string-append* xs))) (display (xexpr->string @`html{@body{@h1{Post Title} @,cdata{

Bold!

}}})) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From geoff at knauth.org Wed Dec 17 15:14:20 2008 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Thu Mar 26 02:36:06 2009 Subject: [plt-scheme] Default string and byte string representation In-Reply-To: <20081217141147.EE4C16500BC@mail-svr1.cs.utah.edu> References: <4948EAFE.2070105@zenburn.net> <20081217141147.EE4C16500BC@mail-svr1.cs.utah.edu> Message-ID: <6031F04B-2223-4792-B4B6-20824D27313F@knauth.org> For comparison, if I'm in Emacs and I edit a file that is binary, I get octal escapes for bytes. From maxigas at anargeek.net Wed Dec 17 18:25:47 2008 From: maxigas at anargeek.net (maxigas) Date: Thu Mar 26 02:36:06 2009 Subject: [plt-scheme] answers in list archive In-Reply-To: References: <0B19BFB2-FD23-494D-9A0D-C9EE0DA8CBAF@ccs.neu.edu> Message-ID: <20081218.002547.267818597.maxigas@anargeek.net> hi! as a person working against Internet surveillance and data retention practices i think this is a very bad idea. installing keyloggers on peoples' computers is like installing video cameras in their homes. it is an intrusion of their privacy and therefore a violation of their fundamental human rights. it changes their behaviour and force them to internalise the authority that you are. promoting hierarchy and authority is already one of the biggest problems of formal education institutions. i think such a step would not contribute to any humanistic aims. maxigas From: "Shriram Krishnamurthi" Subject: Re: [plt-scheme] answers in list archive Date: Tue, 16 Dec 2008 14:06:22 -0500 > You could augment DrScheme to record every keystroke. Cheating cases > presumably tend to be characterized by a large paste operation, > usually at the beginning (and possibly followed by several > alpha-renamings). Eliminating the latter avoids penalizing those who > simply prefer writing their code in a different editor. > > I wonder how well Marmoset does on this, given that it does a CVS > commit on every save. > > Shriram > > On Tue, Dec 16, 2008 at 11:23 AM, Matthias Felleisen > wrote: > > > > It leaves us with the question of how to help teachers prevent cheating when > > they assign plain book problems. -- Matthias > > > > > > > > On Dec 15, 2008, at 10:04 AM, Shriram Krishnamurthi wrote: > > > >> No, plt-scheme list is fully public. Since list membership is not > >> limited, it doesn't make sense to limit the archive. It's plt-edu > >> that you should not be able to get to. > >> > >> On Mon, Dec 15, 2008 at 8:59 AM, Todd O'Bryan > >> wrote: > >>> > >>> One of my students pointed out that plt-scheme has an archive that's > >>> publicly available: > >>> > >>> http://list.cs.brown.edu/pipermail/plt-scheme/2008-April/024020.html > >>> > >>> so any help or solutions we post are only a Google away. Didn't the > >>> archives used to require a password or something? > >>> > >>> Todd > >>> _________________________________________________ > >>> 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 maxigas at anargeek.net Wed Dec 17 18:28:29 2008 From: maxigas at anargeek.net (maxigas) Date: Thu Mar 26 02:36:06 2009 Subject: [plt-scheme] answers in list archive In-Reply-To: <4947FE5E.8050308@neilvandyke.org> References: <0B19BFB2-FD23-494D-9A0D-C9EE0DA8CBAF@ccs.neu.edu> <4947FE5E.8050308@neilvandyke.org> Message-ID: <20081218.002829.256290629.maxigas@anargeek.net> hi! i totally agree with you. hehe.. i remember those years in secondary school when i used some BASIC code to write my French homework. if a language teacher gives homeworks that can be so easily turned into algorhytms that's already bad. :P maxigas From: Neil Van Dyke Subject: Re: [plt-scheme] answers in list archive Date: Tue, 16 Dec 2008 14:15:42 -0500 > Shriram Krishnamurthi wrote at 12/16/2008 02:06 PM: > > You could augment DrScheme to record every keystroke. Cheating cases > > presumably tend to be characterized by a large paste operation > > Sounds somewhat analogous to math exams in which you have to turn in all your scratchpaper. > > I'd say that a respected honor code -- rather than technological surveillance -- is the way to go. > > PLT could teach not only better thinking, but better character. :) > > Neil > > -- http://www.neilvandyke.org/ > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From jpc-ml at zenburn.net Wed Dec 17 19:22:30 2008 From: jpc-ml at zenburn.net (=?UTF-8?B?SmFrdWIgUGlvdHIgQ8WCYXBh?=) Date: Thu Mar 26 02:36:07 2009 Subject: [plt-scheme] Default string and byte string representation In-Reply-To: <20081217141147.EE4C16500BC@mail-svr1.cs.utah.edu> References: <4948EAFE.2070105@zenburn.net> <20081217141147.EE4C16500BC@mail-svr1.cs.utah.edu> Message-ID: <494997C6.60906@zenburn.net> Matthew Flatt wrote: > At Wed, 17 Dec 2008 13:05:18 +0100, Jakub Piotr C?apa wrote: >> Why does Scheme defaults to using octal notation in (byte)string escape >> codes? > > Only byte strings print with octal. Strings print with \u escapes, > right? Yeah, sure. ;-) > Octal is used for byte strings mostly because octal was always used for > byte strings. It does have two minor redeeming qualities: a nul byte > prints relatively compactly as \0 (unless followed by a digit), and > UTF-8 encodings of non-ASCII characters show up as \3oo \2oo ... > sequences (while encodings of ASCII characters never print as \2oo or > \3oo). I see. So it's probably a tradeoff between visual-greping utf-8 text versus random binary encoded data. I prefer the hex notation since I am often doing the latter (since I use Scheme to interface some hardware; USB & Modbus stuff). >> AFAICT more people are familiar with hexadecimal than octal so maybe >> defaulting to "\xFF" escapes (which are handled correctly on input) >> would be better? Or maybe a parameter to set that? > > I'm reluctant to change the default, because the reward seems low given > the risk of breaking something. But we could add a parameter. A parameter would be excelent for my needs. -- regards, Jakub Piotr C?apa From asai at is.ocha.ac.jp Thu Dec 18 03:34:12 2008 From: asai at is.ocha.ac.jp (Kenichi Asai) Date: Thu Mar 26 02:36:07 2009 Subject: [plt-scheme] How to handle large data Message-ID: <20081218083412.GA11907@pllab.is.ocha.ac.jp> Hello everyone, I want to load a large file into DrScheme interactive environment. To be more specific, I want to use the following file containing all the postal data in Japan temporarily available at: http://pllab.is.ocha.ac.jp/~asai/postal.ss The file looks like: (define-struct postal (code address)) (define postal-list (list (make-postal 1706090 "address in Japanese") (make-postal 0708071 "address in Japanese") ... )) but the list is very long, about 120000 lines. I can open this file, but when I try to execute it, DrScheme says "out of memory" and when I switch off the memory limit, it runs forever. Is there any good way to load this file? I am going to teach the basic concepts in programming to high school students the day after tomorrow, and want to use PLT Scheme GUI for it. I plan to apply the linear search to the above postal data. I tried (load "postal.ss"), but DrScheme says: reference to undefined identifier: load Is this because I am using the language "beginning student"? (I want to stay at "beginning student" if possible.) Thank you in advance. Sincerely, -- Kenichi Asai From noelwelsh at gmail.com Thu Dec 18 04:17:40 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:36:07 2009 Subject: [plt-scheme] How to handle large data In-Reply-To: <20081218083412.GA11907@pllab.is.ocha.ac.jp> References: <20081218083412.GA11907@pllab.is.ocha.ac.jp> Message-ID: On Thu, Dec 18, 2008 at 8:34 AM, Kenichi Asai wrote: > I can open this file, but when I try to execute it, DrScheme says "out > of memory" and when I switch off the memory limit, it runs forever. > > Is there any good way to load this file? In MzScheme (NOT DrScheme) it loads without problem: Welcome to MzScheme v4.1.1.3 [3m], Copyright (c) 2004-2008 PLT Scheme Inc. > (load "postal.ss") > (length postal-list) 121793 DrScheme tracks locations and does other stuff that improves debugging but decreases performance. I believe you can turn some of this stuff off (and turn on the JIT). Perhaps that will help. > I tried (load "postal.ss"), but DrScheme says: > > reference to undefined identifier: load > > Is this because I am using the language "beginning student"? I think so. You could try turning it into a module and use require (though I don't know if the Beginning Student language includes require). HTH, N. From eli at barzilay.org Thu Dec 18 04:29:25 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:36:07 2009 Subject: [plt-scheme] How to handle large data In-Reply-To: References: <20081218083412.GA11907@pllab.is.ocha.ac.jp> Message-ID: <18762.6133.254259.932056@arabic.ccs.neu.edu> On Dec 18, Noel Welsh wrote: > On Thu, Dec 18, 2008 at 8:34 AM, Kenichi Asai wrote: > > I can open this file, but when I try to execute it, DrScheme says "out > > of memory" and when I switch off the memory limit, it runs forever. > > > > Is there any good way to load this file? > > In MzScheme (NOT DrScheme) it loads without problem: > > Welcome to MzScheme v4.1.1.3 [3m], Copyright (c) 2004-2008 PLT Scheme Inc. > > (load "postal.ss") > > (length postal-list) > 121793 > > DrScheme tracks locations and does other stuff that improves > debugging but decreases performance. I believe you can turn some of > this stuff off (and turn on the JIT). Perhaps that will help. It will likely make DrScheme's overhead much smaller if you make it all be just a big piece of quoted data: (define-struct postal (code address)) (define postal-list-data '((1706090 "address in Japanese") (0708071 "address in Japanese") ...) ) (define (postal-data->postal entry) (make-postal (first entry) (second entry))) (define postal-list (map postal-data->postal postal-list-data)) You can eliminate the overhead completely by putting the data in a file: ((1706090 "address in Japanese") (0708071 "address in Japanese") ...) and then load it with: (define postal-list (map postal-data->postal (call-with-input-file "postal-data" read))) But this requires things that are probably not available in the teaching languages. The obvious solution is to make it into a teachpack, which in this case will be a simple module: #lang scheme (provide read-file) (define (read-file file) (call-with-input-file file read)) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From jpc-ml at zenburn.net Thu Dec 18 07:54:05 2008 From: jpc-ml at zenburn.net (=?UTF-8?B?SmFrdWIgUGlvdHIgQ8WCYXBh?=) Date: Thu Mar 26 02:36:07 2009 Subject: [plt-scheme] How to handle large data In-Reply-To: <20081218083412.GA11907@pllab.is.ocha.ac.jp> References: <20081218083412.GA11907@pllab.is.ocha.ac.jp> Message-ID: <494A47ED.1090400@zenburn.net> You could try compiling it to bytecode with mzc. It should then load faster in normal DrScheme. -- regards, Jakub Piotr C?apa From matthias at ccs.neu.edu Thu Dec 18 12:11:56 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:36:07 2009 Subject: [plt-scheme] How to handle large data In-Reply-To: <20081218083412.GA11907@pllab.is.ocha.ac.jp> References: <20081218083412.GA11907@pllab.is.ocha.ac.jp> Message-ID: Kenichi, good to see your teaching your students stress-testing. Eli gave you the exact right answer, so let's spell it out. While I personally keep data in this form for scripts (checks, stocks, grades, ...) and edit it in Emacs when needed, I do not recommend teaching it to freshmen students as the primary mechanism. Just as I hate it when they come out of a freshmen course thinking "data is text" (think Perl/Python), I would want students to come out of a Scheme-using course thinking you create data with (define data ...) as convenient as this is for scripting. Instead, I recommend you show them an S-expression formatted data file, like Eli did, and use a two-line teachpack. Alternatively, you use a comma-separated style (sign up with plt-edu!) and use Shriram's teachpack (which just uses cvs.plt from PLANET) to read in 'spreadsheet style' data. A third alternative is to use XML and use read-xml, then explain that XML is new fandangled S-expressions syntax because people can't cope with "(" and ")". This way students learn something general that they can take away for other languages. -- Matthias On Dec 18, 2008, at 3:34 AM, Kenichi Asai wrote: > Hello everyone, > > I want to load a large file into DrScheme interactive environment. To > be more specific, I want to use the following file containing all the > postal data in Japan temporarily available at: > > http://pllab.is.ocha.ac.jp/~asai/postal.ss > > The file looks like: > > (define-struct postal (code address)) > > (define postal-list (list > (make-postal 1706090 "address in Japanese") > (make-postal 0708071 "address in Japanese") > ... > )) > > but the list is very long, about 120000 lines. > > I can open this file, but when I try to execute it, DrScheme says "out > of memory" and when I switch off the memory limit, it runs forever. > > Is there any good way to load this file? > > I am going to teach the basic concepts in programming to high school > students the day after tomorrow, and want to use PLT Scheme GUI for > it. > I plan to apply the linear search to the above postal data. > > I tried (load "postal.ss"), but DrScheme says: > > reference to undefined identifier: load > > Is this because I am using the language "beginning student"? > (I want to stay at "beginning student" if possible.) > > Thank you in advance. > > Sincerely, > > -- > Kenichi Asai > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From geoff at knauth.org Thu Dec 18 22:10:28 2008 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Thu Mar 26 02:36:07 2009 Subject: [plt-scheme] How to handle large data In-Reply-To: References: <20081218083412.GA11907@pllab.is.ocha.ac.jp> Message-ID: <31A33A07-97B4-4565-8162-8A36D5160B33@knauth.org> On Dec 18, 2008, at 12:11, Matthias Felleisen wrote: > A third alternative is to use XML and use read-xml, then explain > that XML is new fandangled S-expressions syntax because people can't > cope with "(" and ")". This way students learn something general > that they can take away for other languages. Speaking of XML, IBM is (I believe) behind the XML Challenge. A PLT- based entry in that contest would be different. Has anyone ever hooked up DrScheme with DB2? Alternatively, one can use XQuery or just be creative with XML. http://xmlchallenge.com/ Geoffrey From eli at barzilay.org Thu Dec 18 22:28:38 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:36:08 2009 Subject: [plt-scheme] Sandbox updates Message-ID: <18763.5350.21188.125838@arabic.ccs.neu.edu> The sandbox library has had some major work done, this is a not-too-short summary of the important changes. * Implemented a global sandbox memory limit and added a new `sandbox-memory-limit' parameter to control it. Previously, each expression evaluation had a memory limit, but there was no global limit for the whole sandbox. For example, if you construct a repl that evaluates each expression, then user code could allocate space that is smaller than the evaluation limit on each expression, therefore grabbing arbitrary amount of memory overall. * Memory accounting in MzScheme changed in a way that can potentially affect sandbox users: an object is counted against the highest custodian that can reach it. This means that if you're running a sandbox and pulling out a value from it (for example, to check that it satisfies some properties), then that object will be held against your own custodian's memory limit (if any). To get it back under the sandboxed custodian, you can simply release references to it. * When the sandbox commits suicide with (kill-thread (current-thread)) or (custodian-shutdown-all (current-custodian)), then it is properly terminated. This is possible through an improvement to call-with-limits': it now properly propagates such suicide actions to the caller. * Added `sandbox-exit-handler' to control the exit handler. The default will *not* throw an error -- instead, it kills the sandbox. (And the "terminated" error message indicates this as a reason.) * When the sandbox is terminated, a new exn:fail:sandbox-terminated exception is thrown. This exception has a `reason' field which is a symbol indicating the reason. Currently, this can be 'eof (when you evaluate the eof value), 'evaluator-killed (when `kill-evaluator' was used to kill it), 'thread-killed, 'custodian-shutdown, 'exited (when `exit' is used with the default exit handler above), 'out-of-memory (when `sandbox-memory-limit' is exceeded). * A new `evaluator-alive?' predicate can be used to determine if the sandboxed evaluator is still alive. * When using a 'string output, the output is created in the sandboxed environment, so it counts against its memory limit. * When a sandbox is created with a given initial code, the constrcuted module expression was previously evaluated under the expression limits, but the module was invoked outside of these limits. This is fixed now, for example, this code throws a proper error: (parameterize ([sandbox-eval-limits '(0.25 5)]) (make-evaluator 'scheme/base '(sleep 2))) * The sandbox uses now a new code-inspector to avoid using protected bindings (most notably, abusing `scheme/foreign' is impossible now, since `unsafe!' cannot be used in sandboxed code). A new `sandbox-make-code-inspector' parameter can be used to control this. * There is a new access mode for `sandbox-path-permissions': 'read-bytecode. This is generally like 'read access, but in addition it allows loading bytecode files from such paths. (This is necessary because a lower code-inspector generally means that you will not be able to load bytecode files.) This is used by default for the plt collects tree and additional #:allow-read arguments. * `sandbox-security-guard' can now be a thunk that creates a security guard. The default value uses this, so if you happen to create a sandbox in an already-restricted environment, the sandbox will be further restricted. * `call-with-trusted-sandbox-configuration' is a function that invokes a thunk in a context where the sandbox customization parameters are set for minimum restrictions. It is useful in cases where you want to choose restrictions to add to an unrestricted default rather than choose ones to remove from a restricted one. * `sandbox-eval-handlers' is a new configuration that holds a list of two functions that are used to impose arbitrary restrictions on sandbox interactions. The functions are called with a thunk, and they're expected to execute the thunk in some restricted way. The first function is used for the initial evaluation when the sandbox is setup, and the second is used for further interactions. The default value is (list #f call-with-custodian-shutdown), which means that no additional restrictions (beyond the usual ones) are put on the setup stage, and later evaluations occur in a custodian that is shutdown at the end of the interaction. This prevents interactions from leaving behind running threads, open ports, etc, but still allows doing so when setting up the sandbox. Also provided are `call-with-killing-threads' (similar, but only kills threads), and `set-eval-handler' (makes it possible to change the handler in an existing sandbox). * There is a new `call-in-sandbox-context' which invokes a thunk in the sandboxed context. `get-namespace' is gone, since it's easy to do with: (call-in-sandbox-context evaluator current-namespace). Note that such code is restricted like any other evaluation, but you can use more privileges because your own code is not inside the sandbox. For example: (let ([guard (current-security-guard)]) (call-in-sandbox-context (lambda () (parameterize ([current-security-guard guard]) ...can access anything you want here...)))) An optional second argument can be used to avoid the memory `sandbox-eval-handlers' restrictions. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From eli at barzilay.org Thu Dec 18 22:43:28 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:36:08 2009 Subject: [plt-scheme] Google APIs Message-ID: <18763.6240.853832.567666@arabic.ccs.neu.edu> Recently the subject of working on spreadsheet data through a CSV file came up -- which made me think of trying to play with the google API. The result is a cute piece of code that reads your google email & password (it only uses the password to authenticate you -- it's probably possible to do without it if you want to read public spreadsheets), retrieves the names of spreadsheets you have there and asks you to choose one, then it retrieves the spreadsheet, parses the xml into a nice list of lists, and finally prints a formatted table. It's not nearly as robust as a library should be, but the pieces are all there -- and it probably wouldn't be hard to improve it and even come up with some google api library (I got the impression that most of the google apis are very similar and uniform). So I'm posting it in case someone is interested in doing such work... ------------------------------------------------------------------------------- #lang scheme (require xml net/url-structs net/uri-codec) (require net/url-sig net/url-unit net/tcp-sig net/tcp-unit net/ssl-tcp-unit) ;; This will give us ssl:--- for an ssl version of url.ss, then abstract in a ;; convenient function. (define-values/invoke-unit (compound-unit/infer (import) (export url^) (link tcp@ url@)) (import) (export url^)) (define ssl-tcp@ (make-ssl-tcp@ #f #f #f #f #f #f #f)) (define-values/invoke-unit (compound-unit (import) (export URL) (link [((TCP : tcp^)) ssl-tcp@] [((URL : url^)) url@ TCP])) (import) (export (prefix ssl: url^))) (define (POST->port url alist) (let* ([url (if (string? url) (string->url url) url)] [scheme (url-scheme url)]) ((if (equal? "http" scheme) post-pure-port ssl:post-pure-port) url (string->bytes/utf-8 (alist->form-urlencoded alist)) '(#"Content-type: application/x-www-form-urlencoded")))) (define (GET->port url headers) (let* ([url (if (string? url) (string->url url) url)] [scheme (url-scheme url)]) ((if (equal? "http" scheme) get-pure-port ssl:get-pure-port) url headers))) ;; ---------------------------------------------------------------------------- ;; Google stuff (define google-auth (make-parameter #f (lambda (x) (bytes-append #"Authorization: GoogleLogin auth=" (if (string? x) (string->bytes/utf-8 x) x))))) (define (url->port url) (GET->port url `(,(google-auth) #"GData-Version: 2"))) (define (url->xexpr url) (xml->xexpr (document-element (read-xml (url->port url))))) (define (authenticate user passwd [service "xapi"]) (define (parse-lines lines) (map (lambda (line) (let ([m (regexp-match #rx"^([^=]+)=(.*)$" line)]) (if m (cons (string->symbol (cadr m)) (caddr m)) (error 'login "unexpected reply line: ~s" line)))) lines)) (define reply ((compose parse-lines port->lines POST->port) "https://www.google.com/accounts/ClientLogin" `([accountType . "HOSTED_OR_GOOGLE"] [Email . ,user] [Passwd . ,passwd] [service . ,service] [source . "PLTScheme-MzScheme-4"]))) (cond [(assq 'Auth reply) => cdr] [(assq 'Error reply) => (lambda (reason) (error 'authenticate "bad username/password: ~a" (cdr reason)))] [else (error 'authenticate "unexpected reply (no Auth or Error): ~s" reply)])) (define (get-spreadsheets) (sort (filter-map (match-lambda [(list-no-order (list 'title _ title) (list 'content (list-no-order (list 'src url) _ ...)) _ ...) (cons title url)] [_ #f]) (url->xexpr (string-append "https://spreadsheets.google.com/feeds/" "spreadsheets/private/full"))) stringlist-feed-url url) (match (url->xexpr url) [(list-no-order (cons 'entry (list-no-order (list 'content (list-no-order (list 'src x) _ ...)) _ ...)) _ ...) x] [_ #f])) (define (sheet-url->cell-feed-url url) (match (url->xexpr url) [(list-no-order (cons 'entry (list-no-order (list 'link (list-no-order (list 'href x) (list 'rel (regexp #rx"^http://.*#cellsfeed$")) _ ...)) _ ...)) _ ...) x] [_ #f])) (define (get-cells url) (define max-row 0) (define max-col 0) ;; get a flat list of ( ) (define cells (reverse (filter-map (match-lambda [(cons 'entry (list-no-order (list 'gs:cell (list-no-order (list 'row row) (list 'col col) _ ...) x) _ ...)) (let ([row (string->number row)] [col (string->number col)]) (when (> row max-row) (set! max-row row)) (when (> col max-col) (set! max-col col)) (list row col x))] [_ #f]) (url->xexpr url)))) (let loop ([row max-row] [col max-col] [line '()] [table '()] [cells cells]) (cond [(zero? row) table] [(zero? col) (loop (sub1 row) max-col '() (cons line table) cells)] [else (let ([x (and (pair? cells) (= row (caar cells)) (= col (cadar cells)) (caddar cells))]) (loop row (sub1 col) (cons x line) table (if x (cdr cells) cells)))]))) ;; ---------------------------------------------------------------------------- ;; Table formatting, for fun (provide print-table filler) (define-struct filler (str) #:omit-define-syntaxes) (define (filler x) (let ([str (if (string? x) x (format "~a" x))]) (if (equal? str "") (error 'filler "empty filler: ~e" x) (make-filler str)))) (define (format-filler str width) (let* ([n (ceiling (/ width (string-length str)))] [str (if (= n 1) str (string-append* (for/list ([i (in-range n)]) str)))]) (if (= width (string-length str)) str (substring str 0 width)))) (define (format-string str width alignment) (let ([len (string-length str)]) (if (>= len width) str (let ([pad (make-string (- width len) #\space)]) (if (eq? alignment 'l) (string-append str pad) (string-append pad str)))))) (define (print-table table alignments [convert #f]) (define table* (for/list ([row table]) (for/list ([x row]) (if (filler? x) x (let ([x (if convert (convert x) x)]) (if (string? x) x (format "~a" x))))))) (define (col-width . col) (foldl (lambda (x acc) (if (filler? x) acc (max acc (string-length x)))) 0 col)) (define widths (apply map col-width table*)) (for ([row table*]) (let* ([line (map (lambda (x width alignment) (if (filler? x) (format-filler (filler-str x) width) (format-string x width alignment))) row widths alignments)] [line (string-append* (add-between line " "))] [line (regexp-replace #rx" +$" line "")]) (display line) (newline)))) ;; ---------------------------------------------------------------------------- ;; "User Interface" (define (ask prompt) (printf "~a: " prompt) (flush-output) (read-line)) (define (choose prompt options) (printf "~a:\n" prompt) (for ([i (in-naturals 1)] [o options]) (printf " ~a. ~a\n" i o)) (sub1 (read))) ;; ---------------------------------------------------------------------------- (parameterize ([google-auth (authenticate (or (getenv "GOOGLE_USER") (ask "Google username (with domain)")) (or (getenv "GOOGLE_PASSWORD") (ask "Password")) "wise")]) (define sheets (get-spreadsheets)) (define sheet-url (cdr (list-ref sheets (choose "Choose a spreadsheet" (map car sheets))))) (define cells-url (sheet-url->cell-feed-url sheet-url)) (define table (get-cells cells-url)) (define (row-of x) (map (lambda (_) x) (car table))) (define hline (row-of (filler "-"))) (print-table `(,hline ,@table ,hline) (row-of 'l) (lambda (x) (or x "")))) ------------------------------------------------------------------------------- -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From geoff at knauth.org Thu Dec 18 22:55:18 2008 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Thu Mar 26 02:36:08 2009 Subject: [plt-scheme] Google APIs In-Reply-To: <18763.6240.853832.567666@arabic.ccs.neu.edu> References: <18763.6240.853832.567666@arabic.ccs.neu.edu> Message-ID: <7DF97448-3EA2-4887-B9A8-CD7A9F4086E0@knauth.org> On Dec 18, 2008, at 22:43, Eli Barzilay wrote: > the pieces are all there -- and it probably wouldn't be hard to > improve it and even > come up with some google api library (I got the impression that most > of the google apis are very similar and uniform). So I'm posting it > in case someone is interested in doing such work... This is great. I'll give it a whirl. At the moment, I have to go in the other direction: I have a MySQL database of local pilots, which originally started as a spreadsheet, and I was about to create a Google spreadsheet so the association's Board could look at the data. Maybe I can use your API to upload the data, but I can definitely use it to download any changes that others make. Geoffrey From sk at cs.brown.edu Thu Dec 18 23:04:21 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:36:08 2009 Subject: [plt-scheme] How to handle large data In-Reply-To: <31A33A07-97B4-4565-8162-8A36D5160B33@knauth.org> References: <20081218083412.GA11907@pllab.is.ocha.ac.jp> <31A33A07-97B4-4565-8162-8A36D5160B33@knauth.org> Message-ID: Every company now has a "call yourself cool by doing something with our boring application" contest. Very few of these seem to yield any interesting results. The one interesting thing I've seen done in SQL lately is Sudoku-solver-in-one-command. (Google for it.) Shriram From eli at barzilay.org Thu Dec 18 23:26:05 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:36:08 2009 Subject: [plt-scheme] Google APIs In-Reply-To: <7DF97448-3EA2-4887-B9A8-CD7A9F4086E0@knauth.org> References: <18763.6240.853832.567666@arabic.ccs.neu.edu> <7DF97448-3EA2-4887-B9A8-CD7A9F4086E0@knauth.org> Message-ID: <18763.8797.723724.2996@arabic.ccs.neu.edu> On Dec 18, Geoffrey S. Knauth wrote: > On Dec 18, 2008, at 22:43, Eli Barzilay wrote: > > the pieces are all there -- and it probably wouldn't be hard to > > improve it and even come up with some google api library (I got > > the impression that most of the google apis are very similar and > > uniform). So I'm posting it in case someone is interested in > > doing such work... > > This is great. I'll give it a whirl. At the moment, I have to go > in the other direction: I have a MySQL database of local pilots, > which originally started as a spreadsheet, and I was about to create > a Google spreadsheet so the association's Board could look at the > data. Maybe I can use your API to upload the data, Well, uploading data is possible in the api, but I didn't implement it. In any case, sounds like uploading data is a one time thing for what you need, and there are lots of easy ways to do so. (Like importing a .csv file.) > but I can definitely use it to download any changes that others > make. Yes -- that's the part that I did. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From geoff at knauth.org Thu Dec 18 23:26:24 2008 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Thu Mar 26 02:36:08 2009 Subject: [plt-scheme] How to handle large data In-Reply-To: References: <20081218083412.GA11907@pllab.is.ocha.ac.jp> <31A33A07-97B4-4565-8162-8A36D5160B33@knauth.org> Message-ID: <3C46FF35-BAB2-4711-A6AD-5235210781A0@knauth.org> On Dec 18, 2008, at 23:04, Shriram Krishnamurthi wrote: > The one interesting thing I've seen done in SQL lately is > Sudoku-solver-in-one-command. (Google for it.) A student in my database class this fall was really into Soduko. Noel Welsh told me about the SQL solvers and my student was thrilled. PLT- list came through again. From eli at barzilay.org Thu Dec 18 23:39:49 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:36:08 2009 Subject: [plt-scheme] How to handle large data In-Reply-To: References: <20081218083412.GA11907@pllab.is.ocha.ac.jp> <31A33A07-97B4-4565-8162-8A36D5160B33@knauth.org> Message-ID: <18763.9621.975288.419789@arabic.ccs.neu.edu> On Dec 18, Shriram Krishnamurthi wrote: > Every company now has a "call yourself cool by doing something with > our boring application" contest. Very few of these seem to yield > any interesting results. Well, in the case of our "application", it *is* boring unless you do something with it... But in any case, google really does manage to impress me with the kind of stuff that they do -- and being able to connect to that is therefore -- IMO -- a very nice thing. > The one interesting thing I've seen done in SQL lately is > Sudoku-solver-in-one-command. (Google for it.) Bah -- I've heard about it one too many times (actually, two now). SQL, in contrast to google, is so unexciting that I never bothered looking at that sudoku thing. It's as "exciting" as writing a sudoku solver in Scheme using regexp operations only... -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From d.j.gurnell at gmail.com Fri Dec 19 05:23:22 2008 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Thu Mar 26 02:36:09 2009 Subject: [plt-scheme] Google APIs In-Reply-To: <18763.8797.723724.2996@arabic.ccs.neu.edu> References: <18763.6240.853832.567666@arabic.ccs.neu.edu> <7DF97448-3EA2-4887-B9A8-CD7A9F4086E0@knauth.org> <18763.8797.723724.2996@arabic.ccs.neu.edu> Message-ID: <9903AC7A-F1CA-46C6-A6B6-E26D0BFC9FF5@gmail.com> Eli wrote: > the pieces are all there -- and it probably wouldn't be hard to > improve it and even come up with some google api library (I got the > impression that most of the google apis are very similar and > uniform). So I'm posting it in case someone is interested in doing > such work... Cool! Your timing couldn't have been better, Eli! Untyped are quoting for a project that will involve a lot of spreadsheet manipulation... Google Docs is one potential solution (Excel XML files are another). Assuming we get the gig and Google ends up being the "right" solution, we will have to develop some sort of client library... it looks like there's a nice little PLaneT package in this. I'll keep you posted if it goes ahead. -- Dave From jos.koot at telefonica.net Fri Dec 19 06:51:00 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:36:09 2009 Subject: [plt-scheme] dumb question Message-ID: Hi, (module x mzscheme (provide (all-from-except mzscheme add1)) (add1 1)) and (module x scheme (add1 1)) Work ok, but: (module x scheme (provide (except-out scheme add1)) (add1 1)) Gives: except-out: identifier to remove `add1' not included in nested provide spec in: scheme How come? Am I overlooking some parts of the docs? Thanks, Jos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081219/5a7292bd/attachment.htm From jos.koot at telefonica.net Fri Dec 19 14:04:49 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:36:10 2009 Subject: [plt-scheme] dumb question References: <18763.59468.378576.481982@arabic.ccs.neu.edu> Message-ID: <2774805C178F4B0082603276B87B2ED4@uw2b2dff239c4d> Thanks Eli, that works. Now that I have seen your answer it's clear that I misinterpreted the line: (except-out provide-spec provide-spec ...) in the docs. Thanks, Jos ----- Original Message ----- From: "Eli Barzilay" To: "Jos Koot" Cc: Sent: Friday, December 19, 2008 7:30 PM Subject: Re: [plt-scheme] dumb question > On Dec 19, Jos Koot wrote: >> Hi, >> >> (module x mzscheme >> (provide (all-from-except mzscheme add1)) >> (add1 1)) >> >> and >> >> (module x scheme >> (add1 1)) >> >> Work ok, but: >> >> (module x scheme >> (provide (except-out scheme add1)) >> (add1 1)) >> >> Gives: >> >> except-out: identifier to remove `add1' not included in nested provide spec in: scheme >> >> How come? Am I overlooking some parts of the docs? > > You need do do this: > > (module x scheme > (provide (except-out (all-from-out scheme) add1)) > (add1 1)) > > -- > ((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/20081219/8a631468/attachment.html From eli at barzilay.org Fri Dec 19 13:30:36 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:36:10 2009 Subject: [plt-scheme] dumb question In-Reply-To: References: Message-ID: <18763.59468.378576.481982@arabic.ccs.neu.edu> On Dec 19, Jos Koot wrote: > Hi, > > (module x mzscheme > (provide (all-from-except mzscheme add1)) > (add1 1)) > > and > > (module x scheme > (add1 1)) > > Work ok, but: > > (module x scheme > (provide (except-out scheme add1)) > (add1 1)) > > Gives: > > except-out: identifier to remove `add1' not included in nested provide spec in: scheme > > How come? Am I overlooking some parts of the docs? You need do do this: (module x scheme (provide (except-out (all-from-out scheme) add1)) (add1 1)) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From keydana at gmx.de Fri Dec 19 15:01:42 2008 From: keydana at gmx.de (Sigrid Keydana) Date: Thu Mar 26 02:36:10 2009 Subject: [plt-scheme] how to work with dates in scheme Message-ID: <494BFDA6.9030903@gmx.de> Hi, could anyone please give me a starting point how to work with dates in scheme (apart from the PLT scheme reference, where I did not find what I was looking for)? For example, I need to get a date as a program argument in some form (e.g., a string like 01.01.2009) and query the database for entries for that day and some following days. Thanks a lot for any help, Sigrid From clements at brinckerhoff.org Fri Dec 19 15:45:00 2008 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:36:11 2009 Subject: [plt-scheme] how to work with dates in scheme In-Reply-To: <494BFDA6.9030903@gmx.de> References: <494BFDA6.9030903@gmx.de> Message-ID: <6F48E810-308B-43AE-8076-A6A26861278C@brinckerhoff.org> On Dec 19, 2008, at 12:01 PM, Sigrid Keydana wrote: > Hi, > > could anyone please give me a starting point how to work with dates in > scheme (apart from the PLT scheme reference, where I did not find > what I > was looking for)? > > For example, I need to get a date as a program argument in some form > (e.g., a string like 01.01.2009) and query the database for entries > for > that day and some following days. > > Thanks a lot for any help, > Sigrid You probably want srfi-19. I'm surprised you didn't find it using Help Desk, though perhaps you were browsing rather than searching, or using a very old version of DrScheme. Try searching for "string->date" 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/20081219/fa6bb3d9/smime.bin From scott at adrenaline.com Fri Dec 19 15:47:03 2008 From: scott at adrenaline.com (Scott McLoughlin) Date: Thu Mar 26 02:36:11 2009 Subject: [plt-scheme] Using typed-scheme with optional and keyword arguments? Message-ID: <494C0847.2050803@adrenaline.com> I see docs on rest arguments, but nothing on positional optional and keyword optional arguments. Am I missing something, or has typed-scheme not implemented these yet? Scott From scott at adrenaline.com Fri Dec 19 16:33:32 2008 From: scott at adrenaline.com (Scott McLoughlin) Date: Thu Mar 26 02:36:11 2009 Subject: [plt-scheme] Typed scheme and curry Message-ID: <494C132C.1040000@adrenaline.com> I can require scheme/function and immediately get some trivial examples of curry to work. But when I try the same thing in Typed Scheme, I get various errors instead. Is there a straightforward set of practices to get curry to work within Typed Scheme? Many thanks, Scott From matthias at ccs.neu.edu Fri Dec 19 16:35:21 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:36:11 2009 Subject: [plt-scheme] Using typed-scheme with optional and keyword arguments? In-Reply-To: <494C0847.2050803@adrenaline.com> References: <494C0847.2050803@adrenaline.com> Message-ID: <36D8393B-6B39-4D37-AEA3-183AE6EA11CA@ccs.neu.edu> Sam may not be on-line right now, but I have seen keyword procs working on his branch of TS. So they will be coming to an svn site near you soon -- Matthias On Dec 19, 2008, at 3:47 PM, Scott McLoughlin wrote: > I see docs on rest arguments, but nothing on positional optional > and keyword optional arguments. Am I missing something, or has > typed-scheme not implemented these yet? > > Scott > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From carl.eastlund at gmail.com Fri Dec 19 16:37:23 2008 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Thu Mar 26 02:36:11 2009 Subject: [plt-scheme] Typed scheme and curry In-Reply-To: <494C132C.1040000@adrenaline.com> References: <494C132C.1040000@adrenaline.com> Message-ID: <990e0c030812191337m656278cw6cd393ac2c2e314c@mail.gmail.com> The "curry" function from scheme/function is not an easily typed function. Bear in mind that its behavior is based on tests of the procedure's dynamically reported arity, which may or may not bear any relation to its statically determined arity according to Typed Scheme. I don't think the "curry" function could be added to Typed Scheme without significant changes to one (curry) or the other (Typed Scheme). On Fri, Dec 19, 2008 at 4:33 PM, Scott McLoughlin wrote: > I can require scheme/function and immediately get some trivial examples of > curry to work. But when I try the same thing in Typed Scheme, I get various > errors instead. > > Is there a straightforward set of practices to get curry to work within > Typed Scheme? > > Many thanks, > > Scott -- Carl Eastlund From czhu at cs.utah.edu Fri Dec 19 17:12:27 2008 From: czhu at cs.utah.edu (Chongkai Zhu) Date: Thu Mar 26 02:36:11 2009 Subject: [plt-scheme] How to dynamic-require a syntax? Message-ID: <494C1C4B.6060601@cs.utah.edu> I tried something like (define-syntax (my-macro stx) (syntax-case stx () ((my-macro p) #`(... #,(dynamic-require '(file "t1.ss") (syntax->datum #'p)) ...)))) but it doesn't work (generates a seg fault). Could anyone help to make it work? Thanks. Chongkai From jpc-ml at zenburn.net Fri Dec 19 17:13:48 2008 From: jpc-ml at zenburn.net (=?UTF-8?B?SmFrdWIgUGlvdHIgQ8WCYXBh?=) Date: Thu Mar 26 02:36:11 2009 Subject: [plt-scheme] [PATCH 4.1.3] foreign.ss Message-ID: <494C1C9C.5010000@zenburn.net> A small correction for define-cstruct with inheritance (was broken somewhere between 4.1.2 and 4.1.3). -- regards, Jakub Piotr C?apa -------------- next part -------------- --- PLT Scheme v4.1.3/collects/mzlib/foreign.ss~ 2008-12-19 23:06:16.000000000 +0100 +++ PLT Scheme v4.1.3/collects/mzlib/foreign.ss 2008-12-19 23:06:16.000000000 +0100 @@ -1477,7 +1477,7 @@ (identifiers? #'(slot ...))) (make-syntax #'_TYPE #f #'(slot ...) #'(slot-type ...))] [(_ (_TYPE _SUPER) ([slot slot-type] ...)) - (and (_-identifier? #'_TYPE) (identifiers? #'(slot ...))) + (and (_-identifier? #'_TYPE stx) (identifiers? #'(slot ...))) (with-syntax ([super (datum->syntax #'_TYPE 'super #'_TYPE)]) (make-syntax #'_TYPE #t #'(super slot ...) #'(_SUPER slot-type ...)))])) From rafkind at cs.utah.edu Fri Dec 19 17:17:12 2008 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Thu Mar 26 02:36:12 2009 Subject: [plt-scheme] How to dynamic-require a syntax? In-Reply-To: <494C1C4B.6060601@cs.utah.edu> References: <494C1C4B.6060601@cs.utah.edu> Message-ID: <494C1D68.7090208@cs.utah.edu> Chongkai Zhu wrote: > I tried something like > > (define-syntax (my-macro stx) > (syntax-case stx () > ((my-macro p) > #`(... #,(dynamic-require '(file "t1.ss") (syntax->datum #'p)) > ...)))) > Works for me. Can you paste an entire example that segfaults? From scott at adrenaline.com Fri Dec 19 18:03:09 2008 From: scott at adrenaline.com (Scott McLoughlin) Date: Thu Mar 26 02:36:12 2009 Subject: [plt-scheme] Typed scheme and curry In-Reply-To: <63bb19ae0812191341s1f6c37b5ve3e9715ff40ee82@mail.gmail.com> References: <494C132C.1040000@adrenaline.com> <63bb19ae0812191341s1f6c37b5ve3e9715ff40ee82@mail.gmail.com> Message-ID: <494C282D.4000504@adrenaline.com> FWIW, strongly typed languages like Haskell and ML have curried functions. The typing isn't very complicated at all. fun fubar (a : Int) (b : Str) (c : Dbl) : Str = blah blah blah; fubar 1; => fn(Str, Dbl): Str k = fubar 1 "Hello"; => k : fn(Dbl) : Str k 3.4; => _ : "1 Hello 3.4" Or whatever depending upon the function definition. Point is that currying loses no type information. Scott Sam TH wrote: > On Fri, Dec 19, 2008 at 4:33 PM, Scott McLoughlin wrote: > >> I can require scheme/function and immediately get some trivial examples of >> curry to work. But when I try the same thing in Typed Scheme, I get various >> errors instead. >> > > What errors did you get? What type did you supply for `curry'? > > >> Is there a straightforward set of practices to get curry to work within >> Typed Scheme? >> > > No, as Carl said, `curry' is not feasible to describe with the Typed > Scheme type system (or any other that I know of). > > Thanks, > From robby at cs.uchicago.edu Fri Dec 19 18:05:46 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:36:12 2009 Subject: [plt-scheme] Typed scheme and curry In-Reply-To: <494C282D.4000504@adrenaline.com> References: <494C132C.1040000@adrenaline.com> <63bb19ae0812191341s1f6c37b5ve3e9715ff40ee82@mail.gmail.com> <494C282D.4000504@adrenaline.com> Message-ID: <932b2f1f0812191505q55a34608mcfe4c31b17ec35b@mail.gmail.com> The same is true for Typed Scheme, of course. Robby On Fri, Dec 19, 2008 at 5:03 PM, Scott McLoughlin wrote: > FWIW, strongly typed languages like Haskell and ML have curried functions. > The typing > isn't very complicated at all. > > fun fubar (a : Int) (b : Str) (c : Dbl) : Str = blah blah blah; > > fubar 1; > => fn(Str, Dbl): Str > > k = fubar 1 "Hello"; > => k : fn(Dbl) : Str > > k 3.4; > => _ : "1 Hello 3.4" > > Or whatever depending upon the function definition. Point is that currying > loses no type information. > > Scott > > > Sam TH wrote: >> >> On Fri, Dec 19, 2008 at 4:33 PM, Scott McLoughlin >> wrote: >> >>> >>> I can require scheme/function and immediately get some trivial examples >>> of >>> curry to work. But when I try the same thing in Typed Scheme, I get >>> various >>> errors instead. >>> >> >> What errors did you get? What type did you supply for `curry'? >> >> >>> >>> Is there a straightforward set of practices to get curry to work within >>> Typed Scheme? >>> >> >> No, as Carl said, `curry' is not feasible to describe with the Typed >> Scheme type system (or any other that I know of). >> >> Thanks, >> > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From matthias at ccs.neu.edu Fri Dec 19 18:16:43 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:36:12 2009 Subject: [plt-scheme] Typed scheme and curry In-Reply-To: <494C282D.4000504@adrenaline.com> References: <494C132C.1040000@adrenaline.com> <63bb19ae0812191341s1f6c37b5ve3e9715ff40ee82@mail.gmail.com> <494C282D.4000504@adrenaline.com> Message-ID: <9C4EC379-77EB-4E59-BBEB-C7F04443D817@ccs.neu.edu> Scott, you're right in that TS should provide better error messages. However, the claim below is entirely irrelevant. In Haskell and ML, curried functions are a part of the core language and thus are integrated into the core system. In Scheme, you are importing a function for currying from the untyped world into the typed one and THAT is an unsolved problem -- also for Haskell and ML. Indeed, they don't even try to create a type system for moving from a "bad" world to a "good" one. They just assume that you always program in a "good" world. -- Matthias On Dec 19, 2008, at 6:03 PM, Scott McLoughlin wrote: > FWIW, strongly typed languages like Haskell and ML have curried > functions. The typing > isn't very complicated at all. > > fun fubar (a : Int) (b : Str) (c : Dbl) : Str = blah blah blah; > > fubar 1; > => fn(Str, Dbl): Str > > k = fubar 1 "Hello"; > => k : fn(Dbl) : Str > > k 3.4; > => _ : "1 Hello 3.4" > > Or whatever depending upon the function definition. Point is that > currying loses no type information. > > Scott > > > Sam TH wrote: >> On Fri, Dec 19, 2008 at 4:33 PM, Scott McLoughlin >> wrote: >> >>> I can require scheme/function and immediately get some trivial >>> examples of >>> curry to work. But when I try the same thing in Typed Scheme, I >>> get various >>> errors instead. >>> >> >> What errors did you get? What type did you supply for `curry'? >> >> >>> Is there a straightforward set of practices to get curry to work >>> within >>> Typed Scheme? >>> >> >> No, as Carl said, `curry' is not feasible to describe with the Typed >> Scheme type system (or any other that I know of). >> >> Thanks, >> > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From carl.eastlund at gmail.com Fri Dec 19 18:56:39 2008 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Thu Mar 26 02:36:12 2009 Subject: [plt-scheme] Typed scheme and curry In-Reply-To: <494C282D.4000504@adrenaline.com> References: <494C132C.1040000@adrenaline.com> <63bb19ae0812191341s1f6c37b5ve3e9715ff40ee82@mail.gmail.com> <494C282D.4000504@adrenaline.com> Message-ID: <990e0c030812191556s68a42cc2od771f1515e7e64d5@mail.gmail.com> The "curry" function in Typed Scheme isn't just about writing curried functions, it's about converting uncurried functions to curried functions. If you want to write a function in a curried style from the get-go, you can do it like this: #lang typed-scheme (: curried (Integer -> (String -> (Char -> Boolean)))) (define (((curried n) s) c) (and (<= 0 n (- (string-length s) 1)) (equal? (string-ref s n) c))) And you can then use it like this: > curried - : (Integer -> (String -> (Char -> Boolean))) # > ((curried 5) "PLT Scheme") - : (Char -> Boolean) # If, however, you have an uncurried function and want to convert it to a curried function, you're just as out of luck in Haskell or ML as you are in Typed Scheme. Given a function of type (a,b,c,d) -> int, there's no builtin Haskell or ML function to produce a function of type a -> b -> c -> d -> int. You could write one, but it would not generalize to (a,b,c,d,e). The "curry" function in scheme/function does, in the case where dynamic arity checks produce meaningful results, generalize like that. Unfortunately, we have no way of writing down its most general type (nor do most other type systems), and its dynamic arity checks do not always tell the whole story. So, what you've run into is partially a quirk of the "curry" function and partially a problem that is hard in a statically typed world. --Carl On Fri, Dec 19, 2008 at 6:03 PM, Scott McLoughlin wrote: > FWIW, strongly typed languages like Haskell and ML have curried functions. > The typing > isn't very complicated at all. > > fun fubar (a : Int) (b : Str) (c : Dbl) : Str = blah blah blah; > > fubar 1; > => fn(Str, Dbl): Str > > k = fubar 1 "Hello"; > => k : fn(Dbl) : Str > > k 3.4; > => _ : "1 Hello 3.4" > > Or whatever depending upon the function definition. Point is that currying > loses no type information. > > Scott From scott at adrenaline.com Fri Dec 19 19:26:09 2008 From: scott at adrenaline.com (Scott McLoughlin) Date: Thu Mar 26 02:36:12 2009 Subject: [plt-scheme] Typed scheme and curry In-Reply-To: <9C4EC379-77EB-4E59-BBEB-C7F04443D817@ccs.neu.edu> References: <494C132C.1040000@adrenaline.com> <63bb19ae0812191341s1f6c37b5ve3e9715ff40ee82@mail.gmail.com> <494C282D.4000504@adrenaline.com> <9C4EC379-77EB-4E59-BBEB-C7F04443D817@ccs.neu.edu> Message-ID: <494C3BA1.7020006@adrenaline.com> Roger that. Scott Matthias Felleisen wrote: > > Scott, you're right in that TS should provide better error messages. > However, the claim below is entirely irrelevant. In Haskell and ML, > curried functions are a part of the core language and thus are > integrated into the core system. In Scheme, you are importing a > function for currying from the untyped world into the typed one and > THAT is an unsolved problem -- also for Haskell and ML. Indeed, they > don't even try to create a type system for moving from a "bad" world > to a "good" one. They just assume that you always program in a "good" > world. -- Matthias > > > > > > On Dec 19, 2008, at 6:03 PM, Scott McLoughlin wrote: > >> FWIW, strongly typed languages like Haskell and ML have curried >> functions. The typing >> isn't very complicated at all. >> >> fun fubar (a : Int) (b : Str) (c : Dbl) : Str = blah blah blah; >> >> fubar 1; >> => fn(Str, Dbl): Str >> >> k = fubar 1 "Hello"; >> => k : fn(Dbl) : Str >> >> k 3.4; >> => _ : "1 Hello 3.4" >> >> Or whatever depending upon the function definition. Point is that >> currying loses no type information. >> >> Scott >> >> >> Sam TH wrote: >>> On Fri, Dec 19, 2008 at 4:33 PM, Scott McLoughlin >>> wrote: >>> >>>> I can require scheme/function and immediately get some trivial >>>> examples of >>>> curry to work. But when I try the same thing in Typed Scheme, I >>>> get various >>>> errors instead. >>>> >>> >>> What errors did you get? What type did you supply for `curry'? >>> >>> >>>> Is there a straightforward set of practices to get curry to work >>>> within >>>> Typed Scheme? >>>> >>> >>> No, as Carl said, `curry' is not feasible to describe with the Typed >>> Scheme type system (or any other that I know of). >>> >>> Thanks, >>> >> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme From geoff at knauth.org Fri Dec 19 21:05:53 2008 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Thu Mar 26 02:36:13 2009 Subject: [plt-scheme] how to work with dates in scheme In-Reply-To: <494BFDA6.9030903@gmx.de> References: <494BFDA6.9030903@gmx.de> Message-ID: On Dec 19, 2008, at 15:01, Sigrid Keydana wrote: > could anyone please give me a starting point how to work with dates in > scheme (apart from the PLT scheme reference, where I did not find > what I > was looking for)? As John Clements wrote, srfi-19 will help. I found conflicts between PLT dates and srfi-19 dates, so in my code I've been using an s19: prefix, e.g.: #lang scheme (require (prefix-in s19: (lib "srfi/19.ss"))) (printf "~a: Alles Gute im neuen Jahr!\n" (s19:date->string (s19:make-date 0 0 0 0 1 1 2009 (* -5 3600)) "~d.~m.~Y")) ? 01.01.2009: Alles Gute im neuen Jahr! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081219/1c77ab5e/attachment.html From eli at barzilay.org Fri Dec 19 21:37:47 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:36:13 2009 Subject: [plt-scheme] Typed scheme and curry In-Reply-To: <990e0c030812191556s68a42cc2od771f1515e7e64d5@mail.gmail.com> References: <494C132C.1040000@adrenaline.com> <63bb19ae0812191341s1f6c37b5ve3e9715ff40ee82@mail.gmail.com> <494C282D.4000504@adrenaline.com> <990e0c030812191556s68a42cc2od771f1515e7e64d5@mail.gmail.com> Message-ID: <18764.23163.210339.405882@arabic.ccs.neu.edu> On Dec 19, Carl Eastlund wrote: > The "curry" function in Typed Scheme isn't just about writing curried > functions, it's about converting uncurried functions to curried > functions. If you want to write a function in a curried style from > the get-go, you can do it like this: [...] [Note: this is a reply for Scott.] Note that the basic problem that (the untyped) `curry' solves is unrelated to the typed vs the untyped worlds -- it's the fact that Scheme has variable arity functions, and therefore `curry' is "guessing" how many levels of function calls are needed. (I'll describe what it's "type" would be below.) (BTW, there is a plan to change how `curry' works -- the result is still going to be problematic for typed-scheme.) In any case, when you say FWIW, strongly typed languages like Haskell and ML have curried functions. The typing isn't very complicated at all. you're right -- except that this has very little to do with the fact that these langauges are strongly typed -- it's actually the fact that they lack such varied arity functions. (There is some relation though: making a static type system work with varied arity functions is more difficult, so staticaly typed languages will have one more reason to go with a fixed-arity world.) As for the type of `curry' -- the thing that it does, roughly speaking is take a function and return a function that "accumulates" argument until it satisfies the original function's arity. So, for example, given an input function with a type A B C -> D it will return something that looks like this: (U (A -> (B -> (C -> D))) (A -> (B C -> D)) (A B -> (C -> D)) (A B C -> D)) But the curried functions also work with zero arguments -- they simply return themselves, so the type should really be (Rec This1 (U (-> This1) (A -> (Rec This2 (U (-> This2) (B -> (Rec This3 (U (-> This3) (C -> D)))) (B C -> D)))) (A B -> (Rec This4 (U (-> This4) (C -> D)))) (A B C -> D))) There are some additional things that complicate this even more, for example, PLT can have a variable arity function with a few fixed arities, for example: > (procedure-arity (case-lambda [(a b) 2] [(a b c d) 4])) (2 4) Currying this function, assuming its type is (U (A B -> R) (A B C D -> R)) returns something that looks roughly like (Rec This1 (U (-> This1) (A -> (Rec This2 (U (-> This2) (B -> R) (B C -> (Rec This3 (U (-> This3) (D -> R))))))) (A B -> R) (A B C -> (Rec This4 (U (-> This4) (D -> R)))))) and to make things even more fun, each of the original cases can have its own type (which is why typed scheme has an arrow type for case-lambda functions instead of using unions). Anyway, take all of these things and try to put them into one type for `curry', and you can see why it's such a mess. Like I said above -- this is complicated in a way that can be reflected on uses of curried functions, which is part of the reason why it should (and planned to) be simplified. But even a much simplified version will have a complicated type -- for example, take simple curry function that always produces a two-step result function, and forbids applications without arguments. Its type would begin like this: (U ((A B -> C) -> (A -> (B -> C))) ((A B C -> D) -> (U (A -> (B C -> D)) (A B -> (C -> D)))) ((A B C D -> E) -> (U (A -> (B C D -> E)) (A B -> (C D -> E)) (A B C -> (D -> E)))) ...) and don't forget about variable-arity functions, even if we say that we deal with only a the single simplest case: (U ... ((A A A* -> B) -> (A A* -> (A A* -> B)))) So, if you read up to this point you can see why it's much easier for statically-typed languages to restrict functions to having fixed arity, then gain some of the flexibility back by using currying as the default mode for multiple arguments, which basically makes all functions be single-argument functions. (You can, of course, mimic functions with a different number of arguments by using tuples -- but if you want to curry these functions you get into a similar mess.) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From eli at barzilay.org Fri Dec 19 22:07:14 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:36:14 2009 Subject: [plt-scheme] [PATCH 4.1.3] foreign.ss In-Reply-To: <494C1C9C.5010000@zenburn.net> References: <494C1C9C.5010000@zenburn.net> Message-ID: <18764.24930.100683.743447@arabic.ccs.neu.edu> On Dec 19, Jakub Piotr C?apa wrote: > A small correction for define-cstruct with inheritance (was broken > somewhere between 4.1.2 and 4.1.3). Committed -- thanks! -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From keydana at gmx.de Sat Dec 20 02:58:25 2008 From: keydana at gmx.de (stelvio) Date: Thu Mar 26 02:36:14 2009 Subject: [plt-scheme] Re: how to work with dates in scheme In-Reply-To: References: <494BFDA6.9030903@gmx.de> Message-ID: <6798a02b-80ef-4f1b-a68b-0bd25a389219@s16g2000vbp.googlegroups.com> Hi, thanks both of you for your help, I did not know I had to look in the SRFI's so I just found scheme/date... I've read SICP and (the basic parts of) Dybvig's scheme book, but regarding "real world tasks" I'm just only starting to find out where to get what (and I'm even a bit overwhelmed by all the possibilities of PLT scheme :-)) Thanks again, and (printf "~a: Happy new year to you too!" (s19:date->string (s19:string- >date "01.01.2009" "~d.~m.~Y") "~D")) From samth0 at gmail.com Fri Dec 19 16:41:56 2008 From: samth0 at gmail.com (Sam TH) Date: Thu Mar 26 02:36:14 2009 Subject: [plt-scheme] Typed scheme and curry In-Reply-To: <494C132C.1040000@adrenaline.com> References: <494C132C.1040000@adrenaline.com> Message-ID: <63bb19ae0812191341s1f6c37b5ve3e9715ff40ee82@mail.gmail.com> On Fri, Dec 19, 2008 at 4:33 PM, Scott McLoughlin wrote: > I can require scheme/function and immediately get some trivial examples of > curry to work. But when I try the same thing in Typed Scheme, I get various > errors instead. What errors did you get? What type did you supply for `curry'? > Is there a straightforward set of practices to get curry to work within > Typed Scheme? No, as Carl said, `curry' is not feasible to describe with the Typed Scheme type system (or any other that I know of). Thanks, -- sam th samth@ccs.neu.edu From clements at brinckerhoff.org Sat Dec 20 18:14:27 2008 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:36:15 2009 Subject: [plt-scheme] Typed scheme and curry In-Reply-To: <18764.23163.210339.405882@arabic.ccs.neu.edu> References: <494C132C.1040000@adrenaline.com> <63bb19ae0812191341s1f6c37b5ve3e9715ff40ee82@mail.gmail.com> <494C282D.4000504@adrenaline.com> <990e0c030812191556s68a42cc2od771f1515e7e64d5@mail.gmail.com> <18764.23163.210339.405882@arabic.ccs.neu.edu> Message-ID: On Dec 19, 2008, at 6:37 PM, Eli Barzilay wrote: > On Dec 19, Carl Eastlund wrote: >> The "curry" function in Typed Scheme isn't just about writing curried >> functions, it's about converting uncurried functions to curried >> functions. If you want to write a function in a curried style from >> the get-go, you can do it like this: [...] > > [Note: this is a reply for Scott.] > > Note that the basic problem that (the untyped) `curry' solves is > unrelated to the typed vs the untyped worlds -- it's the fact that > Scheme has variable arity functions, and therefore `curry' is > "guessing" how many levels of function calls are needed. (I'll > describe what it's "type" would be below.) (BTW, there is a plan to > change how `curry' works -- the result is still going to be > problematic for typed-scheme.) In any case, when you say Lest we miss an obvious corollary of this discussion: you *can* make a plain-vanilla "curry3" function for a fixed number of arguments (in this case, 3): #lang typed-scheme (: curry3 (All (a b c d) ((a b c -> d) -> (a -> (b -> (c -> d)))))) (define (curry3 f) (lambda (a) (lambda (b) (lambda (c) (f a b c))))) ;; let's try it out: (: fun-of-four (Number Number Number -> Number)) (define (fun-of-four x y z) (* (+ x y) z)) ((((curry3 fun-of-four) 3) 5) 6) This isn't variable-arity, and it's not flexible the way that the 'curry' that Eli describes is. 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/20081220/c60433a0/smime.bin From czhu at cs.utah.edu Sun Dec 21 03:15:50 2008 From: czhu at cs.utah.edu (Chongkai Zhu) Date: Thu Mar 26 02:36:15 2009 Subject: [plt-scheme] How to dynamic-require a syntax? In-Reply-To: <494C1D68.7090208@cs.utah.edu> References: <494C1C4B.6060601@cs.utah.edu> <494C1D68.7090208@cs.utah.edu> Message-ID: <494DFB36.2010705@cs.utah.edu> File t1.ss: #lang scheme (require scheme/package) (define-package p #:all-defined (define x 1)) (provide p) File t2.ss: #lang scheme (require scheme/package) (define-syntax (load-package stx) (syntax-case stx () ((load-package p) #`(open-package #,(dynamic-require '(file "t1.ss") (syntax->datum #'p)))))) (load-package p) -Chongkai Jon Rafkind wrote: > Chongkai Zhu wrote: >> I tried something like >> >> (define-syntax (my-macro stx) >> (syntax-case stx () >> ((my-macro p) >> #`(... #,(dynamic-require '(file "t1.ss") (syntax->datum #'p)) >> ...)))) >> > Works for me. Can you paste an entire example that segfaults? From mflatt at cs.utah.edu Sun Dec 21 08:23:41 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:36:15 2009 Subject: [plt-scheme] How to dynamic-require a syntax? In-Reply-To: <494DFB36.2010705@cs.utah.edu> References: <494C1C4B.6060601@cs.utah.edu> <494C1D68.7090208@cs.utah.edu> <494DFB36.2010705@cs.utah.edu> Message-ID: <20081221132344.4218765009E@mail-svr1.cs.utah.edu> `dynamic-require' gets a value, not an identifier. In this case, you don't want to get a value for `p'; you want a `p' identifier that is syntactically bound to an export of "t1.ss". That is, the macro needs to expand to (open-package p) which is syntactically valid, and not (open-package ) which is not syntactically valid. Are you trying to do this in the SML expander, where you discover while compiling an expressions that it references another module, and so you need to import a structure-as-package from another module? If so, doesn't the old `#%module-begin' delimited-continuation trick work as before? At Sun, 21 Dec 2008 16:15:50 +0800, Chongkai Zhu wrote: > File t1.ss: > > #lang scheme > > (require scheme/package) > > (define-package p #:all-defined > (define x 1)) > > (provide p) > > > File t2.ss: > > #lang scheme > > (require scheme/package) > > (define-syntax (load-package stx) > (syntax-case stx () > ((load-package p) > #`(open-package #,(dynamic-require '(file "t1.ss") (syntax->datum > #'p)))))) > > (load-package p) > > -Chongkai > > > Jon Rafkind wrote: > > Chongkai Zhu wrote: > >> I tried something like > >> > >> (define-syntax (my-macro stx) > >> (syntax-case stx () > >> ((my-macro p) > >> #`(... #,(dynamic-require '(file "t1.ss") (syntax->datum #'p)) > >> ...)))) > >> > > Works for me. Can you paste an entire example that segfaults? > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From jos.koot at telefonica.net Sun Dec 21 08:56:15 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:36:16 2009 Subject: [plt-scheme] read-syntax/recursive in reader problem Message-ID: <349CDBEBCE2B40ABA2B965A70AB0724C@uw2b2dff239c4d> Please help me with the following problem extracted from a larger piece of code. I have in .../collects/problem/lang the following two files: ;file reader.ss (module reader syntax/module-reader scheme #:wrapper1 (lambda (t) (parameterize ((current-readtable readtable)) (t))) (define read-braces (case-lambda ((ch port src line col pos) #`(lambda #,@(read-syntax/recursive 'problem port #\{))) ((ch port) (cons 'lambda (read/recursive port #\{))))) (define readtable (make-readtable #f #\{ 'terminating-macro read-braces))) and ;file test.ss #lang problem ({x x} 1 2 3) ; to be read as ((lambda x x) 1 2 3) ; mark the two braces. When I try to run test.ss it keeps eating memory in the compilation phase until memory limits are exceeded (700Mb) DrScheme's run icon remains standing still. I guess the reader is getting into an infinite regression, but I fail to see how to avoid that problem. I use: Welcome to DrScheme, version 4.1.3.6-svn20dec2008 [3m]. Language: Module; memory limit: 700 megabytes. The readtable works correctly when used at top level. Help please, Jos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081221/b8c35540/attachment.html From mflatt at cs.utah.edu Sun Dec 21 09:07:20 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:36:16 2009 Subject: [plt-scheme] read-syntax/recursive in reader problem In-Reply-To: <349CDBEBCE2B40ABA2B965A70AB0724C@uw2b2dff239c4d> References: <349CDBEBCE2B40ABA2B965A70AB0724C@uw2b2dff239c4d> Message-ID: <20081221140721.64FC46500AA@mail-svr1.cs.utah.edu> At Sun, 21 Dec 2008 14:56:15 +0100, "Jos Koot" wrote: > Please help me with the following problem extracted from a larger piece of > code. > I have in .../collects/problem/lang the following two files: > > ;file reader.ss > (module reader syntax/module-reader scheme > #:wrapper1 > (lambda (t) > (parameterize ((current-readtable readtable)) > (t))) > > (define read-braces > (case-lambda > ((ch port src line col pos) > #`(lambda #,@(read-syntax/recursive 'problem port #\{))) > ((ch port) > (cons 'lambda (read/recursive port #\{))))) > > (define readtable > (make-readtable #f #\{ > 'terminating-macro read-braces))) > > and > > ;file test.ss > #lang problem > ({x x} 1 2 3) ; to be read as ((lambda x x) 1 2 3) > ; mark the two braces. > > When I try to run test.ss it keeps eating memory in the compilation phase > until memory limits are exceeded (700Mb) DrScheme's run icon remains standing > still. I guess the reader is getting into an infinite regression, but I fail > to see how to avoid that problem. You're right that parsing #\{ again just re-invokes your reader. To say that you mean to parse #\{ as with the default reader, just add an extra #f argument to your `read[-syntax]/recursive' calls: (define read-braces (case-lambda ((ch port src line col pos) #`(lambda #,@(read-syntax/recursive 'problem port #\{ #f))) ((ch port) (cons 'lambda (read/recursive port #\{ #f))))) Also, the syntax case is't quite right. When you use `quasisyntax', then the `lambda' ends up with lexical information, but a reader should produce syntax objects with no lexical information. I recommend using `datym->syntax', instead: (define read-braces (case-lambda ((ch port src line col pos) (datum->syntax #f `(lambda . ,(read-syntax/recursive 'problem port #\{ #f))) ((ch port) (cons 'lambda (read/recursive port #\{ #f))))) From a.rottmann at gmx.at Sun Dec 21 09:11:00 2008 From: a.rottmann at gmx.at (Andreas Rottmann) Date: Thu Mar 26 02:36:16 2009 Subject: [plt-scheme] mzscheme and R6RS error Message-ID: <87zlipr53f.fsf@delenn.lan> Hi! I'm playing with mzscheme's R6RS support, and found two issues with this simple test program: ---------mz-test.scm----------- #!r6rs (import (rnrs)) (define (foo x y) (when (> x y) (error 'foo "x must be <= y" x y)) (- y x)) (display (foo 1 2)) (newline) (display (foo 3 2)) (newline) --------mz-test.scm------------ Running "mzscheme mz-test.scm", I get the following: 1 foo: x must be <= y === context === /usr/local/stow/plt/lib/plt/collects/rnrs/base-6.ss:407:0: r6rs:error Note that the message is less useful than it could be, because the irritants (i.e. the values of x and y) are not included. However, trying to get an error trace using "mzscheme -l errortrace mz-test.scm", I get no output at all. This is all using a build from current SVN, running on Debian GNU/Linux sid, on amd64 (x86-64). Regards, Rotty -- Andreas Rottmann | Rotty@ICQ | 118634484@ICQ | a.rottmann@gmx.at http://rotty.uttx.net | GnuPG Key: http://rotty.uttx.net/gpg.asc Fingerprint | C38A 39C5 16D7 B69F 33A3 6993 22C8 27F7 35A9 92E7 v2sw7MYChw5pr5OFma7u7Lw2m5g/l7Di6e6t5BSb7en6g3/5HZa2Xs6MSr1/2p7 hackerkey.com To iterate is human; to recurse, divine. From jos.koot at telefonica.net Sun Dec 21 09:47:01 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:36:16 2009 Subject: [plt-scheme] read-syntax/recursive in reader problem References: <349CDBEBCE2B40ABA2B965A70AB0724C@uw2b2dff239c4d> <20081221140721.64FC46500AA@mail-svr1.cs.utah.edu> Message-ID: Hi Matthew, I'll try that out quickly. Thanks very much for the clear and quick response. By saying that I should "produce syntax objects with no lexical information" you probably solved another problem too, I was strubbling with (in casu identifiers becoming associated with other imports than intended) Thanks again, Jos. ----- Original Message ----- From: "Matthew Flatt" To: "Jos Koot" Cc: Sent: Sunday, December 21, 2008 3:07 PM Subject: Re: [plt-scheme] read-syntax/recursive in reader problem > At Sun, 21 Dec 2008 14:56:15 +0100, "Jos Koot" wrote: >> Please help me with the following problem extracted from a larger piece >> of >> code. >> I have in .../collects/problem/lang the following two files: >> >> ;file reader.ss >> (module reader syntax/module-reader scheme >> #:wrapper1 >> (lambda (t) >> (parameterize ((current-readtable readtable)) >> (t))) >> >> (define read-braces >> (case-lambda >> ((ch port src line col pos) >> #`(lambda #,@(read-syntax/recursive 'problem port #\{))) >> ((ch port) >> (cons 'lambda (read/recursive port #\{))))) >> >> (define readtable >> (make-readtable #f #\{ >> 'terminating-macro read-braces))) >> >> and >> >> ;file test.ss >> #lang problem >> ({x x} 1 2 3) ; to be read as ((lambda x x) 1 2 3) >> ; mark the two braces. >> >> When I try to run test.ss it keeps eating memory in the compilation phase >> until memory limits are exceeded (700Mb) DrScheme's run icon remains >> standing >> still. I guess the reader is getting into an infinite regression, but I >> fail >> to see how to avoid that problem. > > You're right that parsing #\{ again just re-invokes your reader. > > To say that you mean to parse #\{ as with the default reader, just add > an extra #f argument to your `read[-syntax]/recursive' calls: > > (define read-braces > (case-lambda > ((ch port src line col pos) > #`(lambda #,@(read-syntax/recursive 'problem port #\{ #f))) > ((ch port) > (cons 'lambda (read/recursive port #\{ #f))))) > > Also, the syntax case is't quite right. When you use `quasisyntax', > then the `lambda' ends up with lexical information, but a reader should > produce syntax objects with no lexical information. I recommend using > `datym->syntax', instead: > > (define read-braces > (case-lambda > ((ch port src line col pos) > (datum->syntax #f `(lambda > . ,(read-syntax/recursive 'problem port #\{ #f))) > ((ch port) > (cons 'lambda (read/recursive port #\{ #f))))) > > From grettke at acm.org Sun Dec 21 19:21:51 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:36:16 2009 Subject: [plt-scheme] mzscheme and R6RS error In-Reply-To: <87zlipr53f.fsf@delenn.lan> References: <87zlipr53f.fsf@delenn.lan> Message-ID: <756daca50812211621r6a27a5bfyd2c95743003d85c2@mail.gmail.com> On Sun, Dec 21, 2008 at 8:11 AM, Andreas Rottmann wrote: > Hi! > > I'm playing with mzscheme's R6RS support, and found two issues with this > simple test program: > > ---------mz-test.scm----------- > #!r6rs > > (import (rnrs)) > > (define (foo x y) > (when (> x y) > (error 'foo "x must be <= y" x y)) > (- y x)) > > (display (foo 1 2)) (newline) > (display (foo 3 2)) (newline) > --------mz-test.scm------------ > > Running "mzscheme mz-test.scm", I get the following: > > 1 > foo: x must be <= y > > === context === > /usr/local/stow/plt/lib/plt/collects/rnrs/base-6.ss:407:0: r6rs:error > > Note that the message is less useful than it could be, because the > irritants (i.e. the values of x and y) are not included. > > However, trying to get an error trace using "mzscheme -l errortrace > mz-test.scm", I get no output at all. Here is how Ypsilon handled it: 1 error in foo: x must be <= y irritants: 3 2 backtrace: 0 (error 'foo "x must be <= y" x y) ..."C:/temp/test.scm" line 5 1 (foo 3 2) ..."C:/temp/test.scm" line 9 From grettke at acm.org Sun Dec 21 19:30:21 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:36:16 2009 Subject: [plt-scheme] PLT at OSCON 2009? Message-ID: <756daca50812211630w50fdc755jcefe72a942c6cf48@mail.gmail.com> Hi folks, It might be interesting for the PLT team to present at O'Reilly's OSCON 2009 http://en.oreilly.com/oscon2009 as it would expose a bigger, different audience to the technology who would immediately have much more interest in it as a "practical tool" than for the pedagogical purpose it serves (it serves both of course). Best wishes, Grant From grettke at acm.org Sun Dec 21 19:31:07 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:36:16 2009 Subject: Untyped Scheme should be built on Typed Scheme? WAS: Re: [plt-scheme] macro question In-Reply-To: <756daca50812141736r6d658aby1c0946c175960464@mail.gmail.com> References: <756daca50812141736r6d658aby1c0946c175960464@mail.gmail.com> Message-ID: <756daca50812211631t51b276f8ra5dd844126bfae4e@mail.gmail.com> Hi folks, On Sun, Dec 14, 2008 at 7:36 PM, Grant Rettke wrote: > Hi Matthias, > > On Tue, Jun 10, 2008 at 10:22 AM, Matthias Felleisen > wrote: >> On Jun 10, 2008, at 11:40 AM, hendrik@topoi.pooq.com wrote: >>> In my opinion, untyped Scheme needs to be built on top of typed Scheme, >>> not the other way around. But until this revolution happens, I'm >>> happy to use it they way it is. >> >> NSF wasn't willing to fund a time machine, even when I promised I'd add cold >> fusion. > > You were joking around here, but is there any truth to it? > > Theoretically if you could start over, would you implement Untyped > Scheme on top of a Typed Scheme? Was this a dumb question or did no one reply because I only asked Matthias? It is open for everyone. From samth at ccs.neu.edu Sun Dec 21 19:38:18 2008 From: samth at ccs.neu.edu (Sam TH) Date: Thu Mar 26 02:36:17 2009 Subject: Untyped Scheme should be built on Typed Scheme? WAS: Re: [plt-scheme] macro question In-Reply-To: <756daca50812211631t51b276f8ra5dd844126bfae4e@mail.gmail.com> References: <756daca50812141736r6d658aby1c0946c175960464@mail.gmail.com> <756daca50812211631t51b276f8ra5dd844126bfae4e@mail.gmail.com> Message-ID: <63bb19ae0812211638ifa391e2h8238f73f1fa61cb5@mail.gmail.com> On Sun, Dec 21, 2008 at 7:31 PM, Grant Rettke wrote: > Hi folks, > > On Sun, Dec 14, 2008 at 7:36 PM, Grant Rettke wrote: >> Hi Matthias, >> >> On Tue, Jun 10, 2008 at 10:22 AM, Matthias Felleisen >> wrote: >>> On Jun 10, 2008, at 11:40 AM, hendrik@topoi.pooq.com wrote: >>>> In my opinion, untyped Scheme needs to be built on top of typed Scheme, >>>> not the other way around. But until this revolution happens, I'm >>>> happy to use it they way it is. >>> >>> NSF wasn't willing to fund a time machine, even when I promised I'd add cold >>> fusion. >> >> You were joking around here, but is there any truth to it? >> >> Theoretically if you could start over, would you implement Untyped >> Scheme on top of a Typed Scheme? > > Was this a dumb question or did no one reply because I only asked Matthias? I think the current layering is the right one. This is because in general, it's better to build more complex systems from simpler ones, and the untyped system is simpler. Thanks, -- sam th samth@ccs.neu.edu From sk at cs.brown.edu Sun Dec 21 20:39:10 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:36:17 2009 Subject: Untyped Scheme should be built on Typed Scheme? WAS: Re: [plt-scheme] macro question In-Reply-To: <756daca50812211631t51b276f8ra5dd844126bfae4e@mail.gmail.com> References: <756daca50812141736r6d658aby1c0946c175960464@mail.gmail.com> <756daca50812211631t51b276f8ra5dd844126bfae4e@mail.gmail.com> Message-ID: Every language grows and changes over time. What if you found out after a while that your type system inhibited the growth of your language? So better to build atop the "untyped" language. On Sun, Dec 21, 2008 at 7:31 PM, Grant Rettke wrote: > Hi folks, > > On Sun, Dec 14, 2008 at 7:36 PM, Grant Rettke wrote: >> Hi Matthias, >> >> On Tue, Jun 10, 2008 at 10:22 AM, Matthias Felleisen >> wrote: >>> On Jun 10, 2008, at 11:40 AM, hendrik@topoi.pooq.com wrote: >>>> In my opinion, untyped Scheme needs to be built on top of typed Scheme, >>>> not the other way around. But until this revolution happens, I'm >>>> happy to use it they way it is. >>> >>> NSF wasn't willing to fund a time machine, even when I promised I'd add cold >>> fusion. >> >> You were joking around here, but is there any truth to it? >> >> Theoretically if you could start over, would you implement Untyped >> Scheme on top of a Typed Scheme? > > Was this a dumb question or did no one reply because I only asked Matthias? > > It is open for everyone. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From hendrik at topoi.pooq.com Mon Dec 22 15:03:01 2008 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:36:17 2009 Subject: Untyped Scheme should be built on Typed Scheme? WAS: Re: [plt-scheme] macro question In-Reply-To: References: <756daca50812141736r6d658aby1c0946c175960464@mail.gmail.com> <756daca50812211631t51b276f8ra5dd844126bfae4e@mail.gmail.com> Message-ID: <20081222200301.GB28728@topoi.pooq.com> On Sun, Dec 21, 2008 at 08:39:10PM -0500, Shriram Krishnamurthi wrote: > Every language grows and changes over time. What if you found out > after a while that your type system inhibited the growth of your > language? Then you would have chosen the wrong type system, and you'd better fix it. > So better to build atop the "untyped" language. There is no such thing as untyped data. What there is is data whose nature is not made clear in the program text. Data are typed by the intention of the programmer, the programmer who defined a variable intends certain kind of data to reside in that variable -- those data that are compatiple with his intention while he writes the program, and no others. To the extent that an explicit type system can express those intentions, it supports the programmer in his efforts to write correct code; to the extent that it does not, it gets in his way. I really believe we know enough about type systems not that it is possible to edvise hslpful ones. In the few cases where a decent type system cannot express the programmers' intentions, there will have to be some kind of escape from it, such as a type 'reference to anything', or 'reference to anything with an encoding that can tell us what kind of thing it is at run time.' But the overwhelming majority of code will involve variables about which much more is statically known. Static type checking is the most powerful easily implemented formal verificatin tool we have in out eternal battle against bugs. It doesn't handle everything, but whe should use it for all it's worth. -- hendrik From sk at cs.brown.edu Sun Dec 21 21:40:26 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:36:17 2009 Subject: Untyped Scheme should be built on Typed Scheme? WAS: Re: [plt-scheme] macro question In-Reply-To: <20081222200301.GB28728@topoi.pooq.com> References: <756daca50812141736r6d658aby1c0946c175960464@mail.gmail.com> <756daca50812211631t51b276f8ra5dd844126bfae4e@mail.gmail.com> <20081222200301.GB28728@topoi.pooq.com> Message-ID: > To the extent that an explicit type system can express those intentions, > it supports the programmer in his efforts to write correct code; to the > extent that it does not, it gets in his way. I really believe we know > enough about type systems not that it is possible to edvise hslpful > ones. In the few cases where a decent type system cannot express the > programmers' intentions, there will have to be some kind of escape from > it, such as a type 'reference to anything', or 'reference to anything > with an encoding that can tell us what kind of thing it is at run time.' > But the overwhelming majority of code will involve variables about which > much more is statically known. > > Static type checking is the most powerful easily implemented formal > verificatin tool we have in out eternal battle against bugs. It doesn't > handle everything, but whe should use it for all it's worth. Out of curiosity, what is your mail client running on? A Burroughs B6700 or analog? (Surely not an x86 or PowerPC.) You should also consider revisiting the end-to-end paper, if it's been a while since you read it. Shriram From hendrik at topoi.pooq.com Mon Dec 22 16:12:56 2008 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:36:17 2009 Subject: Untyped Scheme should be built on Typed Scheme? WAS: Re: [plt-scheme] macro question In-Reply-To: References: <756daca50812141736r6d658aby1c0946c175960464@mail.gmail.com> <756daca50812211631t51b276f8ra5dd844126bfae4e@mail.gmail.com> <20081222200301.GB28728@topoi.pooq.com> Message-ID: <20081222211256.GB28957@topoi.pooq.com> On Sun, Dec 21, 2008 at 09:40:26PM -0500, Shriram Krishnamurthi wrote: > > To the extent that an explicit type system can express those intentions, > > it supports the programmer in his efforts to write correct code; to the > > extent that it does not, it gets in his way. I really believe we know > > enough about type systems not that it is possible to edvise hslpful > > ones. In the few cases where a decent type system cannot express the > > programmers' intentions, there will have to be some kind of escape from > > it, such as a type 'reference to anything', or 'reference to anything > > with an encoding that can tell us what kind of thing it is at run time.' > > But the overwhelming majority of code will involve variables about which > > much more is statically known. > > > > Static type checking is the most powerful easily implemented formal > > verificatin tool we have in out eternal battle against bugs. It doesn't > > handle everything, but whe should use it for all it's worth. > > Out of curiosity, what is your mail client running on? A Burroughs > B6700 or analog? (Surely not an x86 or PowerPC.) An x86. But it was probably *written* in C, which has a rudimentary type system. > You should also consider revisiting the end-to-end paper, if it's been > a while since you read it. The end-to-end paper? Could you provide a reference? -- hendrik From sk at cs.brown.edu Sun Dec 21 22:35:07 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:36:17 2009 Subject: Untyped Scheme should be built on Typed Scheme? WAS: Re: [plt-scheme] macro question In-Reply-To: <20081222211256.GB28957@topoi.pooq.com> References: <756daca50812141736r6d658aby1c0946c175960464@mail.gmail.com> <756daca50812211631t51b276f8ra5dd844126bfae4e@mail.gmail.com> <20081222200301.GB28728@topoi.pooq.com> <20081222211256.GB28957@topoi.pooq.com> Message-ID: > An x86. But it was probably *written* in C, which has a rudimentary > type system. 1. That's not consistent with the direction of your argument for Scheme, which is that you wanted the *lower* level to be typed, not the upper levels that translate to it. 2. Your argument about C suggests that we have a vast disagreement here. Most people would say a type *system* consists of - a definition of type attribution (eg, derivation rules) - one or more algorithms for attribution types (esp. if the rules happen to be non-deterministic) - a type soundness theorem that relates the static and dynamic semantics C has none of these. Though the first can be reconstructed (though in a very machine-dependent way), and the second is straightforward, the third is non-existent. Indeed, as I discuss in PLAI, the third can't even be meaningfully defined for regular C. So you don't actually mean a type *system*; you mean some syntactic means of rejecting programs, irrespective of the relationship to the semantics (it could be sound, unsound, complete, incomplete, random). But at least to me, an unsound type is even worse than not having one at all (because it doesn't create a false sense of security). >> You should also consider revisiting the end-to-end paper, if it's been >> a while since you read it. > > The end-to-end paper? Could you provide a reference? http://en.wikipedia.org/wiki/End-to-end_principle and the link to the original paper is at the bottom. Shriram From noelwelsh at gmail.com Mon Dec 22 06:40:02 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:36:17 2009 Subject: [plt-scheme] PLT at OSCON 2009? In-Reply-To: <756daca50812211630w50fdc755jcefe72a942c6cf48@mail.gmail.com> References: <756daca50812211630w50fdc755jcefe72a942c6cf48@mail.gmail.com> Message-ID: It is a pity there is no PLT official representation in the Bay Area. I nominate Rob Hunter to give a talk on LeftParen. N. On Mon, Dec 22, 2008 at 12:30 AM, Grant Rettke wrote: > Hi folks, > > It might be interesting for the PLT team to present at O'Reilly's OSCON 2009 > > http://en.oreilly.com/oscon2009 From mflatt at cs.utah.edu Mon Dec 22 08:36:42 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:36:17 2009 Subject: [plt-scheme] mzscheme and R6RS error In-Reply-To: <87zlipr53f.fsf@delenn.lan> References: <87zlipr53f.fsf@delenn.lan> Message-ID: <20081222133643.D9ABF650085@mail-svr1.cs.utah.edu> At Sun, 21 Dec 2008 15:11:00 +0100, Andreas Rottmann wrote: > I'm playing with mzscheme's R6RS support, and found two issues with this > simple test program: > > ---------mz-test.scm----------- > #!r6rs > > (import (rnrs)) > > (define (foo x y) > (when (> x y) > (error 'foo "x must be <= y" x y)) > (- y x)) > > (display (foo 1 2)) (newline) > (display (foo 3 2)) (newline) > --------mz-test.scm------------ > > Running "mzscheme mz-test.scm", I get the following: > > 1 > foo: x must be <= y > > === context === > /usr/local/stow/plt/lib/plt/collects/rnrs/base-6.ss:407:0: r6rs:error > > Note that the message is less useful than it could be, because the > irritants (i.e. the values of x and y) are not included. In SVN, I've added the irritants to the exception messages constructed by `error' and `assertion-violation'. > However, trying to get an error trace using "mzscheme -l errortrace > mz-test.scm", I get no output at all. You wanted mzscheme -l errrortrace -t mz-test.scm When you run `mzscheme mz-test.scm', then `-t' is inserted automatically, since there is no command-line flag before the first argument. But when you provide `-l errortrace', then you have to be more explicit about how to treat the "mz-test.scm" argument. Matthew From matthias at ccs.neu.edu Mon Dec 22 09:29:17 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:36:18 2009 Subject: Untyped Scheme should be built on Typed Scheme? WAS: Re: [plt-scheme] macro question In-Reply-To: <20081222211256.GB28957@topoi.pooq.com> References: <756daca50812141736r6d658aby1c0946c175960464@mail.gmail.com> <756daca50812211631t51b276f8ra5dd844126bfae4e@mail.gmail.com> <20081222200301.GB28728@topoi.pooq.com> <20081222211256.GB28957@topoi.pooq.com> Message-ID: <355D1E49-BF48-4A19-9D36-8E26659213B9@ccs.neu.edu> My original response was meant to express "historical development" in a concise manner: 1. Scheme was started in 1974 (someone correct me if I am off by a year) 2. Since then, dozens of implementations have revised, extended, changed the nature of the language. Thousands of programmers have written useful code, including in PLT Scheme. 3. So how in the world could Sam and I think of building Scheme on top of Typed Scheme? The idea of Typed Scheme is quite simple: * there is useful code out there * maintaining with 'types' is easier than without * we should provide a smooth path from where we are (Scheme as given) to where people may want to be (Scheme with a sound type system) without imposing any cost on those who don't wish to come along This is indeed how research should always work. Researchers discover paradise and keep making it more perfect than it always is (Haskell, ML). They don't care how ordinary people can get from hell to heaven. We (PLT) have decided to build an exemplary bridge on which others can follow or which others can mimic and build in different ways. In general, if you think about how computing evolved this is just a small universe that completely mirrors the large evolution. The world was untyped. Decades later, people discovered unsound compiler pragmas (C), naive type systems (Pascal, Algol) and then went on to fancy stuff, including inference (PAL, ML). Two decades later they finally realized how fancy types can be interpreted as compiler pragmas but to this day, we don't have a completely typed hierarchy. Sooner or later you descend from heaven to hell (Led Zeppelin has it backwards) and at that point hell breaks loose. You move from simple type theorems to full-fledged theorem proving, you yell abracadabra and nothing helps. Why would we want to do all this? We haven't even gotten the bridge complete or right yet? End of communication. -- Matthias From rob.hunter at gmail.com Mon Dec 22 11:26:12 2008 From: rob.hunter at gmail.com (Rob Hunter) Date: Thu Mar 26 02:36:18 2009 Subject: [plt-scheme] PLT at OSCON 2009? In-Reply-To: References: <756daca50812211630w50fdc755jcefe72a942c6cf48@mail.gmail.com> Message-ID: <5EA8D69C-2A23-4ED7-9C86-80FDD741C0EC@gmail.com> Thanks. Hmmm, not sure, but I'll definitely think about it. Deadline for proposals is Feb 3... --rob On Dec 22, 2008, at 3:40 AM, "Noel Welsh" wrote: > It is a pity there is no PLT official representation in the Bay Area. > I nominate Rob Hunter to give a talk on LeftParen. > > N. > > On Mon, Dec 22, 2008 at 12:30 AM, Grant Rettke > wrote: >> Hi folks, >> >> It might be interesting for the PLT team to present at O'Reilly's >> OSCON 2009 >> >> http://en.oreilly.com/oscon2009 > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From hendrik at topoi.pooq.com Tue Dec 23 05:34:53 2008 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:36:18 2009 Subject: Untyped Scheme should be built on Typed Scheme? WAS: Re: [plt-scheme] macro question In-Reply-To: <355D1E49-BF48-4A19-9D36-8E26659213B9@ccs.neu.edu> References: <756daca50812141736r6d658aby1c0946c175960464@mail.gmail.com> <756daca50812211631t51b276f8ra5dd844126bfae4e@mail.gmail.com> <20081222200301.GB28728@topoi.pooq.com> <20081222211256.GB28957@topoi.pooq.com> <355D1E49-BF48-4A19-9D36-8E26659213B9@ccs.neu.edu> Message-ID: <20081223103453.GB29880@topoi.pooq.com> On Mon, Dec 22, 2008 at 09:29:17AM -0500, Matthias Felleisen wrote: > > My original response was meant to express "historical development" in > a concise manner: > > 1. Scheme was started in 1974 (someone correct me if I am off by a year) > > 2. Since then, dozens of implementations have revised, extended, > changed the nature of the language. Thousands of programmers have > written useful code, including in PLT Scheme. > > 3. So how in the world could Sam and I think of building Scheme on > top of Typed Scheme? The idea of Typed Scheme is quite simple: > > * there is useful code out there > * maintaining with 'types' is easier than without > * we should provide a smooth path from where we are (Scheme as given) > to where people may want to be (Scheme with a sound type system) > without imposing any cost on those who don't wish to come along > > This is indeed how research should always work. Researchers discover > paradise and keep making it more perfect than it always is (Haskell, > ML). They don't care how ordinary people can get from hell to heaven. > We (PLT) have decided to build an exemplary bridge on which others > can follow or which others can mimic and build in different ways. > > In general, if you think about how computing evolved this is just a > small universe that completely mirrors the large evolution. The world > was untyped. Decades later, people discovered unsound compiler > pragmas (C), naive type systems (Pascal, Algol) and then went on to > fancy stuff, including inference (PAL, ML). Two decades later they > finally realized how fancy types can be interpreted as compiler > pragmas but to this day, we don't have a completely typed hierarchy. > Sooner or later you descend from heaven to hell (Led Zeppelin has it > backwards) and at that point hell breaks loose. You move from simple > type theorems to full-fledged theorem proving, you yell abracadabra > and nothing helps. Why would we want to do all this? We haven't even > gotten the bridge complete or right yet? That's right. And until we have a practical way to formalize everything, we won't. But there's no shame in having a language that can handle 99.9% of programming in a typed manner, and having a few unsafe loopholes for the rest. And an untyped language can perfectly well be built on top of that, should anyone desire it. The efficiency and reliability one can get from static typing will be there. The alleged convenience (and its cost) will be there if anyone needs it, too. But building a typed system on top of an untyped system means one pays the cost of the untyped system whether one needs it or not. -- hendrik From jos.koot at telefonica.net Mon Dec 22 12:29:30 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:36:18 2009 Subject: Untyped Scheme should be built on Typed Scheme? WAS: Re:[plt-scheme] macro question References: <756daca50812141736r6d658aby1c0946c175960464@mail.gmail.com><756daca50812211631t51b276f8ra5dd844126bfae4e@mail.gmail.com><20081222200301.GB28728@topoi.pooq.com><20081222211256.GB28957@topoi.pooq.com><355D1E49-BF48-4A19-9D36-8E26659213B9@ccs.neu.edu> <20081223103453.GB29880@topoi.pooq.com> Message-ID: <287F75A45C8B4527AEE3AF5FB414B537@uw2b2dff239c4d> In a truly functional language, there are procedures (or functions) that cannot even be proven to halt, let alone to halt with what kind of value. Although rather expensive in terms of processor cycles, PLT's contract system provides an acceptible compromise (at least in theory). I guess that a typed scheme (whether being the root or the target of an untyped scheme does not concern me) I think a typed scheme should be implemented such as to admit that it cannot in all cases infer the types of the values produced by functions/procedures. I am not an expert in this area, but I guess that building a fully safe typed functional language is like bypassing the halting problem. Jos From jay.mccarthy at gmail.com Mon Dec 22 12:47:44 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:36:19 2009 Subject: Untyped Scheme should be built on Typed Scheme? WAS: Re: [plt-scheme] macro question In-Reply-To: <63bb19ae0812211638ifa391e2h8238f73f1fa61cb5@mail.gmail.com> References: <756daca50812141736r6d658aby1c0946c175960464@mail.gmail.com> <756daca50812211631t51b276f8ra5dd844126bfae4e@mail.gmail.com> <63bb19ae0812211638ifa391e2h8238f73f1fa61cb5@mail.gmail.com> Message-ID: On Sun, Dec 21, 2008 at 5:38 PM, Sam TH wrote: > I think the current layering is the right one. This is because in > general, it's better to build more complex systems from simpler ones, > and the untyped system is simpler. It would, IMHO, be nice for the MzScheme core to expose unsafe operations that Typed Scheme (and other things) could use though. Jay -- 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 Mon Dec 22 13:29:02 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:36:19 2009 Subject: [plt-scheme] PLT at OSCON 2009? In-Reply-To: <5EA8D69C-2A23-4ED7-9C86-80FDD741C0EC@gmail.com> References: <756daca50812211630w50fdc755jcefe72a942c6cf48@mail.gmail.com> <5EA8D69C-2A23-4ED7-9C86-80FDD741C0EC@gmail.com> Message-ID: <756daca50812221029l6b5f11eeud200084415340307@mail.gmail.com> > Thanks. Hmmm, not sure, but I'll definitely think about it. Deadline for proposals is Feb 3... FWIW: OSCON attendees seem to love web apps. The session for Seaside (on Smalltalk) was bursting, standing room only. From hendrik at topoi.pooq.com Tue Dec 23 07:52:12 2008 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:36:19 2009 Subject: Untyped Scheme should be built on Typed Scheme? WAS: Re:[plt-scheme] macro question In-Reply-To: <287F75A45C8B4527AEE3AF5FB414B537@uw2b2dff239c4d> References: <20081223103453.GB29880@topoi.pooq.com> <287F75A45C8B4527AEE3AF5FB414B537@uw2b2dff239c4d> Message-ID: <20081223125212.GB30220@topoi.pooq.com> On Mon, Dec 22, 2008 at 06:29:30PM +0100, Jos Koot wrote: > In a truly functional language, there are procedures (or functions) that > cannot even be proven to halt, let alone to halt with what kind of value. > Although rather expensive in terms of processor cycles, PLT's contract > system provides an acceptible compromise (at least in theory). I guess > that a typed scheme (whether being the root or the target of an untyped > scheme does not concern me) I think a typed scheme should be implemented > such as to admit that it cannot in all cases infer the types of the values > produced by functions/procedures. I am not an expert in this area, but I > guess that building a fully safe typed functional language is like > bypassing the halting problem. > Jos Yes, you are part right about the unsolvability issues. It's easy to make a fully safe functional language. What's hard is to make one that allows you to write all the programs you want to write. You need to build in ways to escape the type system when necessary. The way to do this neatly is to include some unsafe operations and types. And some safe ways to generalize over safe types. An unchecked type assertion is one way to include an unsafe type. The implementation doesn't check it, and just hopes the prpgrammer is right. This kind of thing is typically used in foreign-language interfaces. A type for values whose details are not known at compile time, but will be sufficiently self-identifying at run time (like just about anything PLT Scheme currently provides) handles a lot of cases quite safely. You can use type test predicates to inquire as to the actual values at run time, and use the (static) presence of those type tests to statically infer the types of those values through particular areas of the code. THis is safe. There should be an easy way to administratively prohinbit the use of unsafe things when that is desired. Or, conversely, a clearly visible way to permit the use of unsafe things when needed (perhaps in a module header, or a #lang declaration or something). This is to make it easy to find the places unsafe code exists. Statically checking for termination cannot be done without restricting the class of functions that can be expressed in the language. You can't even express all total, computable functions in a langauge that statically check for termination. That is the import of the unsolvability results. It is worth trying as a research project. Certainly there are languages for restricted application domains where termination is easily achievable (trigger systems for warcraft, for example) but I don't think such restrictive systems are ready for day-to-day gerneral-purpose application coding yet. Complete formal verification is still a hard problem. But, as I said, the limited verification one can get with a static type system can deliver a lot at low cost. -- hendrik From mark.engelberg at gmail.com Mon Dec 22 14:36:33 2008 From: mark.engelberg at gmail.com (Mark Engelberg) Date: Thu Mar 26 02:36:19 2009 Subject: [plt-scheme] Continue tutorial Message-ID: I'm working through the webserver tutorial, and the sample in the section "decorating with style" doesn't work. Specifically, when I type in test-static.ss, and set up the style sheet file in the htdocs directory, I still get the following error: procedure application: procedure: #; does not expect an argument with keyword #:extra-files-path; arguments were: # #:extra-files-path # #:launch-browser? #t Has something changed since the tutorial was written? Is there a simple fix? Thanks, Mark From noelwelsh at gmail.com Mon Dec 22 15:37:51 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:36:19 2009 Subject: [plt-scheme] Continue tutorial In-Reply-To: References: Message-ID: If you haven't done so already, check your version of PLT is up to date. That's all the advice I can offer for now. HTH, Noel On Mon, Dec 22, 2008 at 7:36 PM, Mark Engelberg wrote: > I'm working through the webserver tutorial, and the sample in the > section "decorating with style" doesn't work. Specifically, when I > type in test-static.ss, and set up the style sheet file in the htdocs > directory, I still get the following error: > > procedure application: procedure: #; does not > expect an argument with keyword #:extra-files-path; arguments were: > # #:extra-files-path # #:launch-browser? > #t > > Has something changed since the tutorial was written? Is there a simple fix? > > Thanks, > > Mark > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From keydana at gmx.de Mon Dec 22 16:29:57 2008 From: keydana at gmx.de (Sigrid Keydana) Date: Thu Mar 26 02:36:19 2009 Subject: [plt-scheme] query mysql from scheme Message-ID: <495006D5.1060607@gmx.de> Hi all, can you please give me a hint what is the preferable way to access a mysql database with plt? Doing a search on the web, I found - the sqlid.plt package on Planet, by Hans Oesterholt , but it does not include a mysql driver, at least not in the current version, so I suppose I cannot use it? - the mysqlclient.ss from riverbot, which I don't know will work with PLT 4? My requirements regarding sql queries are very humble, just simple selects and updates, and I'd like to use PLT 4, not 3, to get used to the changes (which don't seem too trivial if you're still a scheme beginner...) I'd be grateful for a hint which might be the easiest/stablest/most "out-of-the-box" way to use mysql in scheme, as this is only a marginal (but inevitable) part of the application. Thanks a lot in advance Sigrid From jay.mccarthy at gmail.com Mon Dec 22 17:10:45 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:36:20 2009 Subject: [plt-scheme] Continue tutorial In-Reply-To: References: Message-ID: Hi Mark, You can fix the problem in the following way: 1. Change the top line of the program from "#lang web-server/insta" to "#lang scheme" 2. Add after this line the following: (require web-server/servlet-env web-server/servlet) [At this point, the top looks like: #lang scheme (require web-server/servlet-env web-server/servlet) ] 3. Add to the BOTTOM the following: (serve/servlet start #:extra-files-paths (list )) At this point, you've re-created the broken functionality that this bug is preventing you from using. If you'd like to see other examples that use serve/servlet directly: http://docs.plt-scheme.org/web-server/servlet-env_ss.html Apologies, Jay On Mon, Dec 22, 2008 at 12:36 PM, Mark Engelberg wrote: > I'm working through the webserver tutorial, and the sample in the > section "decorating with style" doesn't work. Specifically, when I > type in test-static.ss, and set up the style sheet file in the htdocs > directory, I still get the following error: > > procedure application: procedure: #; does not > expect an argument with keyword #:extra-files-path; arguments were: > # #:extra-files-path # #:launch-browser? > #t > > Has something changed since the tutorial was written? Is there a simple fix? > > Thanks, > > Mark > _________________________________________________ > 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 dvanhorn at ccs.neu.edu Mon Dec 22 18:49:41 2008 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Thu Mar 26 02:36:20 2009 Subject: [plt-scheme] query mysql from scheme In-Reply-To: <495006D5.1060607@gmx.de> References: <495006D5.1060607@gmx.de> Message-ID: <49502795.3020909@ccs.neu.edu> Sigrid Keydana wrote: > - the mysqlclient.ss from riverbot, which I don't know will work with > PLT 4? Geoffrey Knauth was using the library a year ago with 3.99.0.2, so it may be possible (Geoff may also have improvements to the code, which I haven't touched in 5 years). You'll likely need to tweak the mysqlclient code for v4 and whatever version of MySQL you're using. > My requirements regarding sql queries are very humble, just simple > selects and updates, and I'd like to use PLT 4, not 3, to get used to > the changes (which don't seem too trivial if you're still a scheme > beginner...) > > I'd be grateful for a hint which might be the easiest/stablest/most > "out-of-the-box" way to use mysql in scheme, as this is only a marginal > (but inevitable) part of the application. You could try using the Foreign interface to make calls to the mysql library. (It wasn't around when I wrote mysqlclient.ss). David From geoff at knauth.org Mon Dec 22 21:00:19 2008 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Thu Mar 26 02:36:20 2009 Subject: [plt-scheme] query mysql from scheme In-Reply-To: <49502795.3020909@ccs.neu.edu> References: <495006D5.1060607@gmx.de> <49502795.3020909@ccs.neu.edu> Message-ID: <21509E20-54A9-4E10-AFE5-0341292334D8@knauth.org> Sigrid, Indeed I am still using David Van Horn's mysqlclient. Every time I update DrScheme from SVN, I rebuild and mysqlclient. I had to make very minor adjustments a few years ago, and another minor adjustment during the v300 to v4.x transition. It works. I routinely alternate between Mac OS X and Ubuntu. I just put everything I use here: http://knauth.org/plt/mysql/ You'll see two directories, mysqlclient and teaching-db. mysqlclient is basically David's code with really minor modifications done to keep it working five years after he wrote it. teaching-db is a hack of mine: I keep grades and assignments in a MySQL database, because it helps me remember who submitted what, whose stuff needs to be graded, how people are doing, etc. I just put it there so you could see a little bit of code that uses DVH's code, then you can adapt it for your own use. At some point I'd love to repackage mysqlclient, put it into PLaneT, etc., but first I want to look at the other database packages on PLaneT and see if there's a way to unify the approaches. For example, in Ruby on Rails, it's easy to switch database engines with minimal changes to config files. It would be grand if database work using DrScheme were so easily retargeted. Geoffrey On Dec 22, 2008, at 18:49, David Van Horn wrote: > Sigrid Keydana wrote: >> - the mysqlclient.ss from riverbot, which I don't know will work with >> PLT 4? > > Geoffrey Knauth was using the library a year ago with 3.99.0.2, so > it may be possible (Geoff may also have improvements to the code, > which I haven't touched in 5 years). You'll likely need to tweak > the mysqlclient code for v4 and whatever version of MySQL you're > using. > >> My requirements regarding sql queries are very humble, just simple >> selects and updates, and I'd like to use PLT 4, not 3, to get used to >> the changes (which don't seem too trivial if you're still a scheme >> beginner...) >> I'd be grateful for a hint which might be the easiest/stablest/most >> "out-of-the-box" way to use mysql in scheme, as this is only a >> marginal >> (but inevitable) part of the application. > > You could try using the Foreign interface to make calls to the mysql > library. (It wasn't around when I wrote mysqlclient.ss). From geoff at knauth.org Mon Dec 22 21:09:09 2008 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Thu Mar 26 02:36:20 2009 Subject: [plt-scheme] query mysql from scheme In-Reply-To: <21509E20-54A9-4E10-AFE5-0341292334D8@knauth.org> References: <495006D5.1060607@gmx.de> <49502795.3020909@ccs.neu.edu> <21509E20-54A9-4E10-AFE5-0341292334D8@knauth.org> Message-ID: I left out a word in my last message. < Every time I update DrScheme from SVN, I rebuild and mysqlclient. -- > Every time I update DrScheme from SVN, I rebuild and test mysqlclient. From marek at xivilization.net Mon Dec 22 21:13:41 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:36:21 2009 Subject: [plt-scheme] query mysql from scheme In-Reply-To: <21509E20-54A9-4E10-AFE5-0341292334D8@knauth.org> References: <495006D5.1060607@gmx.de> <49502795.3020909@ccs.neu.edu> <21509E20-54A9-4E10-AFE5-0341292334D8@knauth.org> Message-ID: <20081223031341.3e4baae1@halmanfloyd.lan.local> On Mon, 22 Dec 2008 21:00:19 -0500 "Geoffrey S. Knauth" wrote: > At some point I'd love to repackage mysqlclient, put it into PLaneT, > etc., but first I want to look at the other database packages on > PLaneT and see if there's a way to unify the approaches. For > example, in Ruby on Rails, it's easy to switch database engines with > minimal changes to config files. It would be grand if database work > using DrScheme were so easily retargeted. That's a good idea. Although I suppose RoR uses a rather high-level interface. The Python DB API provides a rather low-level interface that every SQL library worth speaking of supports (you might want to skim through it for an API that works with many libraries and is low-level enough not to tie into specific functionality). Seeing something like this for DrScheme would be great. regards, Marek From geoff at knauth.org Mon Dec 22 21:29:54 2008 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Thu Mar 26 02:36:21 2009 Subject: [plt-scheme] query mysql from scheme In-Reply-To: <20081223031341.3e4baae1@halmanfloyd.lan.local> References: <495006D5.1060607@gmx.de> <49502795.3020909@ccs.neu.edu> <21509E20-54A9-4E10-AFE5-0341292334D8@knauth.org> <20081223031341.3e4baae1@halmanfloyd.lan.local> Message-ID: <8F09F7E3-68E3-4C31-A870-6B9008CAE7F1@knauth.org> On Dec 22, 2008, at 21:13, Marek Kubica wrote: > The Python DB API > provides a rather low-level interface that every SQL library worth > speaking of supports (you might want to skim through it for an API > that works with many libraries and is low-level enough not to tie > into specific functionality). I'll take a look. Thank for the suggestion. From jos.koot at telefonica.net Tue Dec 23 13:56:53 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:36:21 2009 Subject: Untyped Scheme should be built on Typed Scheme? WAS: Re:[plt-scheme] macro question Message-ID: <3AF8CB0395E64C458E4B2947B78B6C17@uw2b2dff239c4d> To hendrik at topoi dot pooq dot com Because my reply to your email bounced, I abuse the PLT list to thank you for the clear display of your opinion. Your views are most interesting. You did not cc your email to the PLT list, therefore I do not replicate it here. Jos From apatinoii at gmail.com Tue Dec 23 13:58:21 2008 From: apatinoii at gmail.com (apatinoii@gmail.com) Date: Thu Mar 26 02:36:21 2009 Subject: [plt-scheme] binding construct scoping issue Message-ID: I've become a bit befuddled over binding constructs. In particular, I was under the impression that a normal let expression was not able to define mutually recursive procedures. The r6rs and the plt-reference imply this through their explanation of letrec. Yet, (let ((even? (lambda (n) (if (= n 0) #t (odd? (- n 1))))) (odd? (lambda (n) (if (= n 0) #f (even? (- n 1)))))) (even 20)) => #t works just fine using both mzscheme and ypsilon. TSPL3 describes let as a syntactic extension, expanding into an application of a lambda expression. Therefore, I assumed that the previous expression would be expanded into the form: ((lambda (even? odd?) (even? 20)) (lambda (n) (if (= n 0) #t (odd? (- n 1)))) (lambda (n) (if (= n 0) #f (even? (- n 1))))) => #t which works as well. Why does this work? Both lambda arguments are defined outside of the body of the calling lambda. Therefore, the variables within them should be resolved outside. Isn't this dynamic scoping? For example, the following expressions work as expected: ((lambda (x f) (f)) 1 (lambda () x)) ((lambda (g) (define x 1) (g)) (lambda () x)) which both result in errors; x is unidentified. So, exactly what does let expand to? Another difficulty I'm having, concerning the same topic, but focused more on the algorithm, involves defining the same mutually recursive functions, only using named-let instead: (let even? ([n 20] [odd? (lambda (n) (and (not (= n 0)) (even? (- n 1))))]) (or (= n 0) (odd? (- n 1)))) which works as well, although by looking at its presumed expansion: ((lambda (n odd?) (define even? (lambda (x f) (or (= x 0) (f (- x 1))))) (even? n odd?)) 20 (lambda (n) (and (not (= n 0)) (even? (- n 1))))) appears it shouldn't, since again, the lambda is passed from outside. In this case, can anyone tell me why this works given that the even? procedure called inside of the lambda argument only takes one argument (even? (- n 1)), while inside it is defined to take two arguments? From carl.eastlund at gmail.com Tue Dec 23 14:09:43 2008 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Thu Mar 26 02:36:21 2009 Subject: [plt-scheme] binding construct scoping issue In-Reply-To: References: Message-ID: <990e0c030812231109ra5fd3b0i526a824fd6f17fc8@mail.gmail.com> The even? and odd? functions are defined in PLT Scheme -- some of your code is calling the builtins, rather than your own definitions. --Carl On Tue, Dec 23, 2008 at 1:58 PM, apatinoii@gmail.com wrote: > I've become a bit befuddled over binding constructs. > In particular, I was under the impression that a normal let expression > was not able to define mutually recursive procedures. The r6rs and the > plt-reference imply this through their explanation of letrec. Yet, > > (let ((even? (lambda (n) > (if (= n 0) > #t > (odd? (- n 1))))) > (odd? (lambda (n) > (if (= n 0) > #f > (even? (- n 1)))))) > (even 20)) > => #t > > works just fine using both mzscheme and ypsilon. > TSPL3 describes let as a syntactic extension, expanding into an > application of a lambda expression. Therefore, I assumed that the > previous expression would be expanded into the form: > > ((lambda (even? odd?) > (even? 20)) (lambda (n) > (if (= n 0) > #t > (odd? (- n 1)))) > (lambda (n) > (if (= n 0) > #f > (even? (- n 1))))) > => #t > > which works as well. Why does this work? Both lambda arguments are > defined outside of the body of the calling lambda. Therefore, the > variables within them should be resolved outside. Isn't this dynamic > scoping? For example, the following expressions work as expected: > > ((lambda (x f) (f)) 1 (lambda () x)) > ((lambda (g) (define x 1) (g)) (lambda () x)) > > which both result in errors; x is unidentified. > So, exactly what does let expand to? > > Another difficulty I'm having, concerning the same topic, but focused > more on the algorithm, involves defining the same mutually recursive > functions, only using named-let instead: > > (let even? ([n 20] [odd? (lambda (n) > (and (not (= n 0)) > (even? (- n 1))))]) > (or (= n 0) > (odd? (- n 1)))) > > which works as well, although by looking at its presumed expansion: > > ((lambda (n odd?) > (define even? > (lambda (x f) > (or (= x 0) > (f (- x 1))))) > (even? n odd?)) 20 (lambda (n) > (and (not (= n 0)) > (even? (- n 1))))) > > appears it shouldn't, since again, the lambda is passed from outside. > In this case, can anyone tell me why this works given that the even? > procedure called inside of the lambda argument only takes one > argument (even? (- n 1)), while inside it is defined to take two > arguments? From hendrik at topoi.pooq.com Tue Dec 23 07:52:12 2008 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:36:21 2009 Subject: Untyped Scheme should be built on Typed Scheme? WAS: Re:[plt-scheme] macro question In-Reply-To: <287F75A45C8B4527AEE3AF5FB414B537@uw2b2dff239c4d> References: <20081223103453.GB29880@topoi.pooq.com> <287F75A45C8B4527AEE3AF5FB414B537@uw2b2dff239c4d> Message-ID: <20081223125212.GB30220@topoi.pooq.com> On Mon, Dec 22, 2008 at 06:29:30PM +0100, Jos Koot wrote: > In a truly functional language, there are procedures (or functions) that > cannot even be proven to halt, let alone to halt with what kind of value. > Although rather expensive in terms of processor cycles, PLT's contract > system provides an acceptible compromise (at least in theory). I guess > that a typed scheme (whether being the root or the target of an untyped > scheme does not concern me) I think a typed scheme should be implemented > such as to admit that it cannot in all cases infer the types of the values > produced by functions/procedures. I am not an expert in this area, but I > guess that building a fully safe typed functional language is like > bypassing the halting problem. > Jos Yes, you are part right about the unsolvability issues. It's easy to make a fully safe functional language. What's hard is to make one that allows you to write all the programs you want to write. You need to build in ways to escape the type system when necessary. The way to do this neatly is to include some unsafe operations and types. And some safe ways to generalize over safe types. An unchecked type assertion is one way to include an unsafe type. The implementation doesn't check it, and just hopes the prpgrammer is right. This kind of thing is typically used in foreign-language interfaces. A type for values whose details are not known at compile time, but will be sufficiently self-identifying at run time (like just about anything PLT Scheme currently provides) handles a lot of cases quite safely. You can use type test predicates to inquire as to the actual values at run time, and use the (static) presence of those type tests to statically infer the types of those values through particular areas of the code. THis is safe. There should be an easy way to administratively prohinbit the use of unsafe things when that is desired. Or, conversely, a clearly visible way to permit the use of unsafe things when needed (perhaps in a module header, or a #lang declaration or something). This is to make it easy to find the places unsafe code exists. Statically checking for termination cannot be done without restricting the class of functions that can be expressed in the language. You can't even express all total, computable functions in a langauge that statically check for termination. That is the import of the unsolvability results. It is worth trying as a research project. Certainly there are languages for restricted application domains where termination is easily achievable (trigger systems for warcraft, for example) but I don't think such restrictive systems are ready for day-to-day gerneral-purpose application coding yet. Complete formal verification is still a hard problem. But, as I said, the limited verification one can get with a static type system can deliver a lot at low cost. -- hendrik From hendrik at topoi.pooq.com Wed Dec 24 08:09:51 2008 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:36:21 2009 Subject: Untyped Scheme should be built on Typed Scheme? WAS: Re:[plt-scheme] macro question In-Reply-To: <3AF8CB0395E64C458E4B2947B78B6C17@uw2b2dff239c4d> References: <3AF8CB0395E64C458E4B2947B78B6C17@uw2b2dff239c4d> Message-ID: <20081224130951.GC1001@topoi.pooq.com> On Tue, Dec 23, 2008 at 07:56:53PM +0100, Jos Koot wrote: > To hendrik at topoi dot pooq dot com > You > did not cc your email to the PLT list, My mistake -- with any luck, I just corrected this mistake. -- hendrik From matthias at ccs.neu.edu Tue Dec 23 14:14:20 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:36:22 2009 Subject: [plt-scheme] binding construct scoping issue In-Reply-To: <990e0c030812231109ra5fd3b0i526a824fd6f17fc8@mail.gmail.com> References: <990e0c030812231109ra5fd3b0i526a824fd6f17fc8@mail.gmail.com> Message-ID: <0CE1C00C-F5DB-44BF-8198-857B84146B2F@ccs.neu.edu> Use Chech Syntax and look at the arrows originating from the odd? and even? identifiers. Use this in the Module language: #lang scheme (let ((even? (lambda (n) (if (= n 0) #t (odd? (- n 1))))) (odd? (lambda (n) (if (= n 0) #f (even? (- n 1)))))) (even? 20)) ((lambda (even? odd?) (even? 20)) (lambda (n) (if (= n 0) #t (odd? (- n 1)))) (lambda (n) (if (= n 0) #f (even? (- n 1))))) On Dec 23, 2008, at 2:09 PM, Carl Eastlund wrote: > The even? and odd? functions are defined in PLT Scheme -- some of your > code is calling the builtins, rather than your own definitions. > > --Carl > > On Tue, Dec 23, 2008 at 1:58 PM, apatinoii@gmail.com > wrote: >> I've become a bit befuddled over binding constructs. >> In particular, I was under the impression that a normal let >> expression >> was not able to define mutually recursive procedures. The r6rs and >> the >> plt-reference imply this through their explanation of letrec. Yet, >> >> (let ((even? (lambda (n) >> (if (= n 0) >> #t >> (odd? (- n 1))))) >> (odd? (lambda (n) >> (if (= n 0) >> #f >> (even? (- n 1)))))) >> (even 20)) >> => #t >> >> works just fine using both mzscheme and ypsilon. >> TSPL3 describes let as a syntactic extension, expanding into an >> application of a lambda expression. Therefore, I assumed that the >> previous expression would be expanded into the form: >> >> ((lambda (even? odd?) >> (even? 20)) (lambda (n) >> (if (= n 0) >> #t >> (odd? (- n 1)))) >> (lambda (n) >> (if (= n 0) >> #f >> (even? (- n 1))))) >> => #t >> >> which works as well. Why does this work? Both lambda arguments are >> defined outside of the body of the calling lambda. Therefore, the >> variables within them should be resolved outside. Isn't this dynamic >> scoping? For example, the following expressions work as expected: >> >> ((lambda (x f) (f)) 1 (lambda () x)) >> ((lambda (g) (define x 1) (g)) (lambda () x)) >> >> which both result in errors; x is unidentified. >> So, exactly what does let expand to? >> >> Another difficulty I'm having, concerning the same topic, but focused >> more on the algorithm, involves defining the same mutually recursive >> functions, only using named-let instead: >> >> (let even? ([n 20] [odd? (lambda (n) >> (and (not (= n 0)) >> (even? (- n 1))))]) >> (or (= n 0) >> (odd? (- n 1)))) >> >> which works as well, although by looking at its presumed expansion: >> >> ((lambda (n odd?) >> (define even? >> (lambda (x f) >> (or (= x 0) >> (f (- x 1))))) >> (even? n odd?)) 20 (lambda (n) >> (and (not (= n 0)) >> (even? (- n 1))))) >> >> appears it shouldn't, since again, the lambda is passed from outside. >> In this case, can anyone tell me why this works given that the even? >> procedure called inside of the lambda argument only takes one >> argument (even? (- n 1)), while inside it is defined to take two >> arguments? > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From keydana at gmx.de Tue Dec 23 16:08:13 2008 From: keydana at gmx.de (stelvio) Date: Thu Mar 26 02:36:22 2009 Subject: [plt-scheme] Re: query mysql from scheme In-Reply-To: <8F09F7E3-68E3-4C31-A870-6B9008CAE7F1@knauth.org> References: <495006D5.1060607@gmx.de> <49502795.3020909@ccs.neu.edu> <21509E20-54A9-4E10-AFE5-0341292334D8@knauth.org> <20081223031341.3e4baae1@halmanfloyd.lan.local> <8F09F7E3-68E3-4C31-A870-6B9008CAE7F1@knauth.org> Message-ID: <3e1a1c11-4fd0-4030-9b90-b58594aca6cb@d36g2000prf.googlegroups.com> Thanks a lot for the information! Especially many thanks, Geoffrey, for the link to the files - this will be very useful to me, the adapted mysqlclient and also the usage examples! Thanks again! Sigrid From jensaxel at soegaard.net Tue Dec 23 17:03:55 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:36:22 2009 Subject: [plt-scheme] Re: query mysql from scheme In-Reply-To: <3e1a1c11-4fd0-4030-9b90-b58594aca6cb@d36g2000prf.googlegroups.com> References: <495006D5.1060607@gmx.de> <49502795.3020909@ccs.neu.edu> <21509E20-54A9-4E10-AFE5-0341292334D8@knauth.org> <20081223031341.3e4baae1@halmanfloyd.lan.local> <8F09F7E3-68E3-4C31-A870-6B9008CAE7F1@knauth.org> <3e1a1c11-4fd0-4030-9b90-b58594aca6cb@d36g2000prf.googlegroups.com> Message-ID: <4951604B.8030006@soegaard.net> stelvio wrote: > Thanks a lot for the information! > Especially many thanks, Geoffrey, for the link to the files - this > will be very useful to me, the adapted mysqlclient and also the usage > examples! FWIW - if it doesn't have to be MySQL, then try the bindings for SQLite. They are uptodate. http://planet.plt-scheme.org/display.ss?package=sqlite.plt&owner=jaymccarthy -- Jens Axel S?gaard From lunarc.lists at gmail.com Tue Dec 23 22:32:08 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:36:22 2009 Subject: [plt-scheme] Faster CGI In-Reply-To: References: Message-ID: 2008/12/10 Eddie Sullivan : > If anybody's interested, I've attached a simple wrapper for the FastCGI C > library I hacked up when I was first learning Scheme. Thanks for sharing this. =) I tried doing something like this myself before you sent that e-mail; I had just 3 of the fastcgi functions wrapped, enough that I could output simple requests. It seems to work nicely and quickly. I'm worried, though, that I'll have the same problem of many instances running. I'd probably use mod_action in apache to run a common fastcgi script to handle all .ss files, which would use one instance at low load. Except, that is, when I'm serving multiple sites. As far as I can tell there's no way to share a fastcgi instance across multiple sites served through Apache. This makes me worry that fastcgi won't be a viable solution for me. I'm still looking into it, though, so hopefully I can make it work somehow. Barring that, the only other solution I can think of is separately running a 'handler' instance of mzscheme which takes requests and serves responses (through, say, named pipes). Then native cgi applications would handle communicating with that handler. I'm a little worried about this approach, though, since it's getting pretty complex, and it almost feels like implementing an entire new web server. Any ideas? Henk From keydana at gmx.de Wed Dec 24 09:13:05 2008 From: keydana at gmx.de (stelvio) Date: Thu Mar 26 02:36:22 2009 Subject: [plt-scheme] Re: query mysql from scheme In-Reply-To: <4951604B.8030006@soegaard.net> References: <495006D5.1060607@gmx.de> <49502795.3020909@ccs.neu.edu> <21509E20-54A9-4E10-AFE5-0341292334D8@knauth.org> <20081223031341.3e4baae1@halmanfloyd.lan.local> <8F09F7E3-68E3-4C31-A870-6B9008CAE7F1@knauth.org> <3e1a1c11-4fd0-4030-9b90-b58594aca6cb@d36g2000prf.googlegroups.com> <4951604B.8030006@soegaard.net> Message-ID: <2f595381-1723-4ec4-8ddc-bd4248958195@f40g2000pri.googlegroups.com> Thanks for the hint - I had seen these, but unfortunately it has to be MySQL, and an old version too (3.2.3 if I remember correctly...) Ciao Sigrid On Dec 23, 11:03 pm, Jens Axel Soegaard wrote: > stelvio wrote: > > Thanks a lot for the information! > > Especially many thanks, Geoffrey, for the link to the files - this > > will be very useful to me, the adapted mysqlclient and also the usage > > examples! > > FWIW - if it doesn't have to be MySQL, then try the bindings > for SQLite. They are uptodate. > > http://planet.plt-scheme.org/display.ss?package=sqlite.plt&owner=jaym... > > -- > Jens Axel S?gaard > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From neil at neilvandyke.org Wed Dec 24 12:15:17 2008 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:36:22 2009 Subject: [plt-scheme] reencode-input-port and get-bindings/post Message-ID: <49526E25.4050103@neilvandyke.org> Any ideas on this confusing behavior with "reencode-input-port" and "get-bindings/post", before everyone heads off to Christmas? For this exercise, I want to make PLT 4.1.2's "get-bindings/post" interpret HTTP "POST" data in "iso-8859-1" unstead of "utf-8". (let ((port (reencode-input-port (current-input-port) ; in "iso-8859-1" ; encoding #f ; error-bytes #f ; close? "http-post-reencode" ; name #f ; convert-newlines? ; enc-error ))) (dynamic-wind (lambda () #f) (lambda () ;; TODO: !!! This re-encoding works outside of CGI, but when inside, ;; "get-bindings/post" seems to see the original bytes... (parameterize ((current-input-port port)) (get-bindings/post))) (lambda () (close-input-port port)))) This code works correctly when run on Debian GNU/Linux *outside* of Apache CGI. When the same code is dropped into Apache CGI,however, it generates an error as if the re-encoding weren't happening: bytes->string/utf-8: string is not a well-formed UTF-8 encoding: #"\251 Copyright" [[...]] [unknown source]: (call-with-continuation-prompt (lambda () (with-continuation-mark break-enabled-key bpz (with-continuation-mark ....))) handler-prompt-key (lambda (thunk) (thunk))) === context === /usr/local/plt-4.1.2/lib/plt/collects/net/uri-codec-unit.ss:168:0: decode /usr/local/plt-4.1.2/lib/plt/collects/net/cgi-unit.ss:116:0: read-name+value /usr/local/plt-4.1.2/lib/plt/collects/net/cgi-unit.ss:130:0: get-bindings/post I suspect I'm making a silly mistake or that there is some locale-related difference between the two situations. I cannot reproduce the error outside of CGI by adjusting the "LANG" environment variable. Thanks, Neil From eli at barzilay.org Wed Dec 24 13:47:41 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:36:23 2009 Subject: [plt-scheme] reencode-input-port and get-bindings/post In-Reply-To: <49526E25.4050103@neilvandyke.org> References: <49526E25.4050103@neilvandyke.org> Message-ID: <18770.33741.519390.625250@arabic.ccs.neu.edu> I don't know what the problem is, but to start tracking what causes it, did you dump the environment variables and the input and then run the code with these outside of the cgi environment? On Dec 24, Neil Van Dyke wrote: > Any ideas on this confusing behavior with "reencode-input-port" and > "get-bindings/post", before everyone heads off to Christmas? > > For this exercise, I want to make PLT 4.1.2's "get-bindings/post" > interpret HTTP "POST" data in "iso-8859-1" unstead of "utf-8". > > (let ((port (reencode-input-port (current-input-port) ; in > "iso-8859-1" ; encoding > #f ; error-bytes > #f ; close? > "http-post-reencode" ; name > #f ; convert-newlines? > ; enc-error > ))) > (dynamic-wind > (lambda () #f) > (lambda () > ;; TODO: !!! This re-encoding works outside of CGI, but when inside, > ;; "get-bindings/post" seems to see the original bytes... > (parameterize ((current-input-port port)) > (get-bindings/post))) > (lambda () > (close-input-port port)))) > > This code works correctly when run on Debian GNU/Linux *outside* of > Apache CGI. When the same code is dropped into Apache CGI,however, it > generates an error as if the re-encoding weren't happening: > > bytes->string/utf-8: string is not a well-formed UTF-8 encoding: #"\251 > Copyright" > [[...]] > [unknown source]: (call-with-continuation-prompt (lambda () > (with-continuation-mark break-enabled-key bpz (with-continuation-mark > ....))) handler-prompt-key (lambda (thunk) (thunk))) > === context === > /usr/local/plt-4.1.2/lib/plt/collects/net/uri-codec-unit.ss:168:0: decode > /usr/local/plt-4.1.2/lib/plt/collects/net/cgi-unit.ss:116:0: read-name+value > /usr/local/plt-4.1.2/lib/plt/collects/net/cgi-unit.ss:130:0: > get-bindings/post > > I suspect I'm making a silly mistake or that there is some > locale-related difference between the two situations. I cannot > reproduce the error outside of CGI by adjusting the "LANG" environment > variable. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From neil at neilvandyke.org Wed Dec 24 15:22:32 2008 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:36:23 2009 Subject: [plt-scheme] reencode-input-port and get-bindings/post In-Reply-To: <18770.33741.519390.625250@arabic.ccs.neu.edu> References: <49526E25.4050103@neilvandyke.org> <18770.33741.519390.625250@arabic.ccs.neu.edu> Message-ID: <49529A08.2080607@neilvandyke.org> Thanks, Eli. I have added some assertions that verify that re-encoding of bytes *is* working properly when run in CGI. At this point, I think it will be easiest to rewrite "get-bindings/post" to more directly do what I need. Eli Barzilay wrote at 12/24/2008 01:47 PM: > I don't know what the problem is, but to start tracking what causes > it, did you dump the environment variables and the input and then run > the code with these outside of the cgi environment? > From neil at neilvandyke.org Thu Dec 25 04:19:31 2008 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:36:23 2009 Subject: [plt-scheme] regexp-match on input port returning bytes Message-ID: <49535023.5000109@neilvandyke.org> Just out of curiosity, in PLT 4.1.2, why does "regexp-match" on an input port return bytes rather than strings, when using a string regexp (not a bytes regexp)? > (regexp-match #rx"^x" "x") ("x") > (regexp-match #rx"^x" (open-input-string "x")) (#"x") > (regexp-match #rx#"^x" (open-input-string "x")) (#"x") I would've expected the second example to yield a list of strings rather than a list of bytes. Thanks, Neil From robby at cs.uchicago.edu Thu Dec 25 09:54:49 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:36:23 2009 Subject: [plt-scheme] Merry Christmas everyone Message-ID: <932b2f1f0812250654l1585fd65t7aaab819aa1d92f5@mail.gmail.com> Ho ho ho! Robby From a.rottmann at gmx.at Thu Dec 25 10:01:49 2008 From: a.rottmann at gmx.at (Andreas Rottmann) Date: Thu Mar 26 02:36:23 2009 Subject: [plt-scheme] mzscheme and R6RS macrology Message-ID: <87zliki9ia.fsf@delenn.lan> Hi! I have trouble getting the following code to run under mzscheme (it works fine on Ikarus): ;;$ cat mz-test/bar.sls #!r6rs (library (mz-test bar) (export bar-definer) (import (rnrs)) (define (bar-definer alist) (lambda (stx) (syntax-case stx () ((k name sym) (let ((val (cond ((assq (syntax->datum #'sym) alist) => cdr) (else #f)))) (with-syntax ((v val)) #'(define name 'v)))))))) ;;$ cat mz-test/foo.sls #!r6rs (library (mz-test foo) (export foo) (import (rnrs)) (define (foo) '((a . 1) (b . 2)))) ;;$ cat test.scm #!r6rs (import (rnrs) (for (mz-test bar) expand) (for (mz-test foo) expand)) (define-syntax def (bar-definer (foo))) (def x b) (display x) (newline) ;;$ PLTCOLLECTS=":`pwd`" mzscheme -f test.scm ;;mz-test/bar.sls:16:16: compile: unbound identifier (and no #%top ;;syntax transformer is bound) in: define Under Ikarus, the program sucessfully runs and prints "2", as intended. Perhaps someone can shed some light on this? Thanks, Rotty -- Andreas Rottmann | Rotty@ICQ | 118634484@ICQ | a.rottmann@gmx.at http://rotty.uttx.net | GnuPG Key: http://rotty.uttx.net/gpg.asc Fingerprint | C38A 39C5 16D7 B69F 33A3 6993 22C8 27F7 35A9 92E7 v2sw7MYChw5pr5OFma7u7Lw2m5g/l7Di6e6t5BSb7en6g3/5HZa2Xs6MSr1/2p7 hackerkey.com Make free software, not war! From lunarc.lists at gmail.com Thu Dec 25 10:04:15 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:36:23 2009 Subject: [plt-scheme] Merry Christmas everyone In-Reply-To: <932b2f1f0812250654l1585fd65t7aaab819aa1d92f5@mail.gmail.com> References: <932b2f1f0812250654l1585fd65t7aaab819aa1d92f5@mail.gmail.com> Message-ID: Happy Christmas! Henk From aghuloum at cs.indiana.edu Thu Dec 25 11:47:03 2008 From: aghuloum at cs.indiana.edu (Abdulaziz Ghuloum) Date: Thu Mar 26 02:36:24 2009 Subject: [plt-scheme] mzscheme and R6RS macrology In-Reply-To: <87zliki9ia.fsf@delenn.lan> References: <87zliki9ia.fsf@delenn.lan> Message-ID: <11ED1A16-6022-4D60-BB1B-111A0C81DCEF@cs.indiana.edu> On Dec 25, 2008, at 10:01 AM, Andreas Rottmann wrote: > Under Ikarus, the program sucessfully runs and prints "2", as > intended. Yes. This is because in Ikarus, a "define" from (rnrs) means "define" from (rnrs). Ditto for "quote": it cannot mean something other than what you think it does and You don't need to say more. (you can refer to comp.lang.scheme for a long thread of discussion that I won't repeat here) > Perhaps someone can shed some light on this? You probably need to import the identifiers "define" and "quote" for (meta -1) in the (mz-test bar) library. That is, do (import (for (only (rnrs) define quote) (meta -1)) if you want to be precise or do (import (for (rnrs) run expand (meta -1))) just to be sure. Aziz,,, From carl.eastlund at gmail.com Thu Dec 25 13:15:10 2008 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Thu Mar 26 02:36:24 2009 Subject: [plt-scheme] regexp-match on input port returning bytes In-Reply-To: <49535023.5000109@neilvandyke.org> References: <49535023.5000109@neilvandyke.org> Message-ID: <990e0c030812251015k35788ee9gc91d38dfc93b3b4a@mail.gmail.com> >From the reference manual on regexp-match: > If the match fails, #f is returned. If the match succeeds, a list containing strings or byte string, > and possibly #f, is returned. The list contains strings only if input is a string and pattern is not a > byte regexp value. Otherwise, the list contains byte strings (substrings of the UTF-8 encoding of > input, if input is a string). The input in the second case is a port, rather than a string, so regexp-match uses byte strings rather than (character) strings. On Thu, Dec 25, 2008 at 4:19 AM, Neil Van Dyke wrote: > Just out of curiosity, in PLT 4.1.2, why does "regexp-match" on an input > port return bytes rather than strings, when using a string regexp (not a > bytes regexp)? > >> (regexp-match #rx"^x" "x") > ("x") >> (regexp-match #rx"^x" (open-input-string "x")) > (#"x") >> (regexp-match #rx#"^x" (open-input-string "x")) > (#"x") > > I would've expected the second example to yield a list of strings rather > than a list of bytes. > > Thanks, > Neil -- Carl Eastlund From benjisimon at gmail.com Thu Dec 25 14:41:36 2008 From: benjisimon at gmail.com (Ben Simon) Date: Thu Mar 26 02:36:25 2009 Subject: [plt-scheme] scheme/foreign issues - string conversion and DrScheme crashing Message-ID: Howdy, With the recent chatter about MySQL on this list and some dabbling I've been doing with FFI ( http://benjisimon.blogspot.com/2008/11/small-experiment-with-mzschemes-foriegn.html), I thought, what the heck, why not whip up a quick FFI interface to mysql. I started in on it, and I've run into two major issues: 1) the MySQL C api (http://dev.mysql.com/doc/refman/5.0/en/c.html) is easy to use. I'm able to get access to the C function call *mysql_real_connect*. If I hand it invalid connection information, it gracefully fails like I want it to. It calls the C function *mysql_error()* which is supposed to return back char*. However, I get the following message from DrScheme: bytes->string/utf8: string not well-formed UTF-8 encoding: #"0\344\22" Any thoughts as to why *mysql_error* is returning back a string scheme is choking on? 2) DrScheme has been crashing nearly constantly since I started working on this. I'm running on Vista, and after having DrScheme open for a minute or two, I'll inevitably get a pop-up: *PLT Scheme GUI Application has stopped working*. It doesn't seem to correspond to any one statement I'm executing. For example, I kicked off DrScheme, ran the test code mentioned above, got the error, started writing this e-mail, and flipped back to find DrScheme had crashed. I'm running 4.1.3.6-svn25dec2008. Could this be a pre release issue? Anyone have any ideas as to how I could get the specific cause of the crash? This is probably just the result of some poorly written FFI code (which, I realize, is unsafe). Perhaps there's a glaring bug in the code below? Here's the code I've worked up this far - For now, I'm testing it by running the (do-test) procedure. Thanks, Ben ------------------------------------------------------------------------------------------------------------------------------------------------ (require scheme/foreign) (unsafe!) (define current-mysql-handle (make-parameter #f)) (define libmysql (ffi-lib "libmysql")) (define _handle (make-ctype _pointer #f (lambda (handle) (when handle (register-finalizer handle c-mysql-close)) handle))) (define _data (make-ctype _pointer #f (lambda (data) (if data data (error 'mysql (c-mysql-error)))))) (define-fun-syntax _handle* (syntax-id-rules () [_ (type: _handle expr: (current-mysql-handle))])) (define c-mysql-init (get-ffi-obj "mysql_init" libmysql (_fun -> _handle))) (define c-mysql-close (get-ffi-obj "mysql_close" libmysql (_fun _handle -> _void))) (define c-mysql-error (get-ffi-obj "mysql_error" libmysql (_fun _handle* -> _string))) (current-mysql-handle (c-mysql-init)) (define c-mysql-real-connect (get-ffi-obj "mysql_real_connect" libmysql (_fun _handle* _string _string _string _string _int _string _long -> _data))) (define (do-test) ; Intentionally fail to connect, if all goes well, raise a scheme error (c-mysql-real-connect "localhos" "root" "invalid" "none" 0 "" 0)) -- Have an idea for software? I can make it happen - http://www.ideas2executables.com My Blog: http://benjisimon.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081225/f9053739/attachment.htm From fschwidom at BigBix.localdomain Thu Dec 25 16:40:20 2008 From: fschwidom at BigBix.localdomain (fschwidom@BigBix.localdomain) Date: Thu Mar 26 02:36:25 2009 Subject: [plt-scheme] mzscheme behaviour differs between debian and gentoo Message-ID: <20081225214020.GA4686@BigBox> Hi, the script: > (define a (list 1 2)) > (define b (list 3 4)) > (append! a b) (1 2 3 4) > a (1 2) > b (3 4) provides not the expected result (here running unter gentoo) unter debian the output of > a would be (1 2 3 4) what could the problem be? regards. From rafkind at cs.utah.edu Thu Dec 25 15:53:21 2008 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Thu Mar 26 02:36:25 2009 Subject: [plt-scheme] mzscheme behaviour differs between debian and gentoo In-Reply-To: <20081225214020.GA4686@BigBox> References: <20081225214020.GA4686@BigBox> Message-ID: <4953F2C1.1000701@cs.utah.edu> fschwidom@BigBix.localdomain wrote: > Hi, > > the script: > > >> (define a (list 1 2)) >> (define b (list 3 4)) >> (append! a b) >> > (1 2 3 4) > Are you sure you invoked append! and not append? append! has been moved out of the core so you can't use it normally. What version of mzscheme are you running? From eli at barzilay.org Thu Dec 25 15:56:07 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:36:25 2009 Subject: [plt-scheme] scheme/foreign issues - string conversion and DrScheme crashing In-Reply-To: References: Message-ID: <18771.62311.365007.284509@arabic.ccs.neu.edu> On Dec 25, Ben Simon wrote: > I started in on it, and I've run into two major issues: > > 1) the MySQL C api (http://dev.mysql.com/doc/refman/5.0/en/c.html) is easy > to use. I'm able to get access to the C function call *mysql_real_connect*. > If I hand it invalid connection information, it gracefully fails like I want > it to. It calls the C function *mysql_error()* which is supposed to return > back char*. However, I get the following message from DrScheme: > > bytes->string/utf8: string not well-formed UTF-8 encoding: #"0\344\22" > > Any thoughts as to why *mysql_error* is returning back a string scheme is > choking on? It's probably best to change the type to _bytes, then see what the actual char* contents is. > 2) DrScheme has been crashing nearly constantly since I started > working on this. I'm running on Vista, and after having DrScheme > open for a minute or two, I'll inevitably get a pop-up: *PLT Scheme > GUI Application has stopped working*. It doesn't seem to correspond > to any one statement I'm executing. For example, I kicked off > DrScheme, ran the test code mentioned above, got the error, started > writing this e-mail, and flipped back to find DrScheme had crashed. The most common cause of this is a bad memory reference, usually because mzscheme uses a moving GC (by default). Some things that you can do to verify this are adding `collect-garbage' in various places (maybe even a thread that keeps triggering GCs), and trying to run the code with the CGC executables. (You can get them as part of the "Full" distribution from the nightly builds.) Another thing to verify is that you don't call the close function twice on aa handler or something similar. Other than that -- yes, life in the (unsafe!) world can be hard... -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From eli at barzilay.org Thu Dec 25 16:00:59 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:36:25 2009 Subject: [plt-scheme] mzscheme behaviour differs between debian and gentoo In-Reply-To: <20081225214020.GA4686@BigBox> References: <20081225214020.GA4686@BigBox> Message-ID: <18771.62603.74791.828552@arabic.ccs.neu.edu> On Dec 25, fschwidom@BigBix.localdomain wrote: > > (define a (list 1 2)) > > (define b (list 3 4)) > > (append! a b) > (1 2 3 4) > > a > (1 2) > > b > (3 4) > > provides not the expected result (here running unter gentoo) > > unter debian the output of > > > a > > would be > > (1 2 3 4) > > what could the problem be? In the newer versions (4.x) MzScheme switched to immutable pairs. `append!' is usually defined as *possibly* changing the pairs to attache the two lists -- but it doesn't have to do so. (This is the case with srfi-1, which I assume is what you're using.) This means that in the new version, `append!' is defined as `append', and you're wrong to expect the mutation to happen. As for Debian, I suspect that the default PLT version is an old one, from before the immutable lists change. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From rafkind at cs.utah.edu Thu Dec 25 16:02:38 2008 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Thu Mar 26 02:36:25 2009 Subject: [plt-scheme] mzscheme behaviour differs between debian and gentoo In-Reply-To: <20081225215825.GA4800@BigBox> References: <20081225214020.GA4686@BigBox> <4953F2C1.1000701@cs.utah.edu> <20081225215825.GA4800@BigBox> Message-ID: <4953F4EE.7060801@cs.utah.edu> fschwidom@ wrote: > On Thu, Dec 25, 2008 at 01:53:21PM -0700, Jon Rafkind wrote: > >> fschwidom@BigBix.localdomain wrote: >> >>> Hi, >>> >>> the script: >>> >>> >>> >>>> (define a (list 1 2)) >>>> (define b (list 3 4)) >>>> (append! a b) >>>> >>>> >>> (1 2 3 4) >>> >>> >> Are you sure you invoked append! and not append? append! has been moved out >> of the core so you can't use it normally. What version of mzscheme are you >> running? >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > > $ mzscheme -v > Welcome to MzScheme v4.1 [3m], Copyright (c) 2004-2008 PLT Scheme Inc. > > before using "append!" i made "(require srfi/1)" because the > documentation suggested it. > Note that the srfi-1 documentation says "|append!| is the "linear-update" variant of |append| -- it is allowed, but not required, to alter cons cells in the argument lists to construct the result list. The last argument is never altered; the result list shares structure with this parameter. " In PLT's srfi-1 implementation append and append! are the same thing. If you really want to use append! (which I don't recommend) you can look at mappend! in the scheme/mpair library. From benjisimon at gmail.com Thu Dec 25 16:32:58 2008 From: benjisimon at gmail.com (Ben Simon) Date: Thu Mar 26 02:36:26 2009 Subject: [plt-scheme] scheme/foreign issues - string conversion and DrScheme crashing In-Reply-To: <18771.62311.365007.284509@arabic.ccs.neu.edu> References: <18771.62311.365007.284509@arabic.ccs.neu.edu> Message-ID: On Thu, Dec 25, 2008 at 3:56 PM, Eli Barzilay wrote: > On Dec 25, Ben Simon wrote: > > I started in on it, and I've run into two major issues: > ... > > bytes->string/utf8: string not well-formed UTF-8 encoding: #"0\344\22" > > > > Any thoughts as to why *mysql_error* is returning back a string scheme is > > choking on? > > It's probably best to change the type to _bytes, then see what the > actual char* contents is. Good to know. Perhaps the fact that mysql_error() is returning garbage is related to the system crashing. Hmmm, maybe something is just massively corrupt. > > 2) DrScheme has been crashing nearly constantly since I started > > working on this. > ... > > The most common cause of this is a bad memory reference, usually > because mzscheme uses a moving GC (by default). Some things that you > can do to verify this are adding `collect-garbage' in various places > (maybe even a thread that keeps triggering GCs), and trying to run the > code with the CGC executables. (You can get them as part of the > "Full" distribution from the nightly builds.) Thanks for the tips. > Another thing to verify is that you don't call the close function > twice on aa handler or something similar. I added a print statement right before close was called - and the system crashed before it even got that far. Still, good to know. > Other than that -- yes, life in the (unsafe!) world can be hard... Yeah, you can say that again :-). -Ben -- Have an idea for software? I can make it happen - http://www.ideas2executables.com My Blog: http://benjisimon.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081225/1fca8e8b/attachment.html From benjisimon at gmail.com Thu Dec 25 16:40:46 2008 From: benjisimon at gmail.com (Ben Simon) Date: Thu Mar 26 02:36:27 2009 Subject: [plt-scheme] scheme/foreign issues - string conversion and DrScheme crashing In-Reply-To: <18771.62311.365007.284509@arabic.ccs.neu.edu> References: <18771.62311.365007.284509@arabic.ccs.neu.edu> Message-ID: On Thu, Dec 25, 2008 at 3:56 PM, Eli Barzilay wrote: > On Dec 25, Ben Simon wrote: > > > 2) DrScheme has been crashing nearly constantly since I started > > working on this. > ... I wonder if I'm hosing things up because I'm calling mysql_init without an argument. The API says that if the argument is null, it returns back a fresh mysql handle. That's what I was intending. But, by not explicitly handing in NULL, i may be corrupting matters. How do I rewrite: (define c-mysql-init (get-ffi-obj "mysql_init" libmysql (_fun -> _handle))) so that the function takes in an explicit NULL? Thanks, -Ben -- Have an idea for software? I can make it happen - http://www.ideas2executables.com My Blog: http://benjisimon.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081225/6a899b1c/attachment.htm From eli at barzilay.org Thu Dec 25 16:49:19 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:36:27 2009 Subject: [plt-scheme] scheme/foreign issues - string conversion and DrScheme crashing In-Reply-To: References: <18771.62311.365007.284509@arabic.ccs.neu.edu> Message-ID: <18771.65503.573998.143801@arabic.ccs.neu.edu> On Dec 25, Ben Simon wrote: > On Thu, Dec 25, 2008 at 3:56 PM, Eli Barzilay wrote: > > > On Dec 25, Ben Simon wrote: > > > > > 2) DrScheme has been crashing nearly constantly since I started > > > working on this. > > > ... > > I wonder if I'm hosing things up because I'm calling mysql_init without an > argument. The API says that if the argument is null, it returns back a fresh > mysql handle. That's what I was intending. But, by not explicitly handing > in NULL, i may be corrupting matters. That sounds very likely: if you omit the type from the interface, then the foreign function will just use whatever junk happens to be on the stack. And it sounds like mysql will just assume that it's a pointer to a struct to fill -- so it stores that information in that random place. (And it shouldn't be surprising that this leads to a crash at some later point.) > How do I rewrite: > (define c-mysql-init (get-ffi-obj "mysql_init" libmysql (_fun -> > _handle))) > so that the function takes in an explicit NULL? Probably something like: (define c-mysql-init (get-ffi-obj "mysql_init" libmysql (_fun _pointer -> _handle))) and pass it #f (which translates to NULL). But you can also make it always pass in NULL with: (define c-mysql-init (get-ffi-obj "mysql_init" libmysql (_fun [_pointer = #f] -> _handle))) which makes the generated Scheme function expect no arguments, and always call the foreign one with #f. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From benjisimon at gmail.com Thu Dec 25 18:29:10 2008 From: benjisimon at gmail.com (Ben Simon) Date: Thu Mar 26 02:36:27 2009 Subject: [plt-scheme] scheme/foreign issues - string conversion and DrScheme crashing In-Reply-To: <18771.65503.573998.143801@arabic.ccs.neu.edu> References: <18771.62311.365007.284509@arabic.ccs.neu.edu> <18771.65503.573998.143801@arabic.ccs.neu.edu> Message-ID: On Thu, Dec 25, 2008 at 4:49 PM, Eli Barzilay wrote: > On Dec 25, Ben Simon wrote: > > I wonder if I'm hosing things up because I'm calling mysql_init without > an > > argument. The API says that if the argument is null, it returns back a > fresh > > mysql handle. That's what I was intending. But, by not explicitly > handing > > in NULL, i may be corrupting matters. > > That sounds very likely: if you omit the type from the interface, then > the foreign function will just use whatever junk happens to be on the > stack. And it sounds like mysql will just assume that it's a pointer > to a struct to fill -- so it stores that information in that random > place. (And it shouldn't be surprising that this leads to a crash at > some later point.) Yeah, that sounds totally logical. > > How do I rewrite: > > (define c-mysql-init (get-ffi-obj "mysql_init" libmysql (_fun -> > > _handle))) > > so that the function takes in an explicit NULL? > > Probably something like: > > (define c-mysql-init > (get-ffi-obj "mysql_init" libmysql (_fun _pointer -> _handle))) > > and pass it #f (which translates to NULL). But you can also make it > always pass in NULL with: > > (define c-mysql-init > (get-ffi-obj "mysql_init" libmysql (_fun [_pointer = #f] -> _handle))) > > which makes the generated Scheme function expect no arguments, and > always call the foreign one with #f. Cool - Thanks! I'll give that a try and see how it works. -Ben -- Have an idea for software? I can make it happen - http://www.ideas2executables.com My Blog: http://benjisimon.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081225/af906934/attachment.html From benjisimon at gmail.com Thu Dec 25 18:35:09 2008 From: benjisimon at gmail.com (Ben Simon) Date: Thu Mar 26 02:36:28 2009 Subject: [plt-scheme] scheme/foreign issues - string conversion and DrScheme crashing In-Reply-To: References: <18771.62311.365007.284509@arabic.ccs.neu.edu> <18771.65503.573998.143801@arabic.ccs.neu.edu> Message-ID: On Thu, Dec 25, 2008 at 6:29 PM, Ben Simon wrote: > On Thu, Dec 25, 2008 at 4:49 PM, Eli Barzilay wrote: > >> On Dec 25, Ben Simon wrote: >> > I wonder if I'm hosing things up because I'm calling mysql_init without >> an >> > argument. The API says that if the argument is null, it returns back a >> fresh >> > mysql handle. That's what I was intending. But, by not explicitly >> handing >> > in NULL, i may be corrupting matters. >> >> That sounds very likely: if you omit the type from the interface, then >> the foreign function will just use whatever junk happens to be on the >> stack. And it sounds like mysql will just assume that it's a pointer >> to a struct to fill -- so it stores that information in that random >> place. (And it shouldn't be surprising that this leads to a crash at >> some later point.) >> > Whoo! That appears to be it. Since I've made that change, I've been crash free. Thanks Eli! -Ben -- Have an idea for software? I can make it happen - http://www.ideas2executables.com My Blog: http://benjisimon.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081225/68fbae94/attachment.htm From benjisimon at gmail.com Thu Dec 25 18:44:53 2008 From: benjisimon at gmail.com (Ben Simon) Date: Thu Mar 26 02:36:29 2009 Subject: [plt-scheme] scheme/foreign and C arrays Message-ID: Howdy - Now that my MySQL FFI implementation doesn't crash every few moments, I've been able to make some headway into making the API useful. This has been going well, until I hit the row handling MySQL requires. Here's the C example they provide: MYSQL_ROW row; unsigned int num_fields; unsigned int i; num_fields = mysql_num_fields(result); while ((row = mysql_fetch_row(result))) { unsigned long *lengths; lengths = mysql_fetch_lengths(result); for(i = 0; i < num_fields; i++) { printf("[%.*s] ", (int) lengths[i], row[i] ? row[i] : "NULL"); } printf("\n"); } Apparently, when I call mysql_fetch_row(...) it will return back a big array of character data that is the series of columns. I can index into this array by calling mysql_num_fields and mysql_fetch_lengths. mysql_fetch_lengths returns back an array of numbers, while the row object is essentially an array. Given this, I think I need to focus on how Scheme handles C arrays. What's the cleanest way to handle this? I've found some discussion about cvectors, is that I'm looking for? Thanks, -Ben -- Have an idea for software? I can make it happen - http://www.ideas2executables.com My Blog: http://benjisimon.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081225/962773b8/attachment.html From DekuDekuplex at Yahoo.com Fri Dec 26 00:04:05 2008 From: DekuDekuplex at Yahoo.com (Benjamin L.Russell) Date: Thu Mar 26 02:36:29 2009 Subject: [plt-scheme] Re: Merry Christmas everyone References: <932b2f1f0812250654l1585fd65t7aaab819aa1d92f5@mail.gmail.com> <932b2f1f0812250654l1585fd65t7aaab819aa1d92f5-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> Message-ID: On Thu, 25 Dec 2008 10:04:15 -0500, "Henk Boom" wrote: >Happy Christmas! > > Henk Interesting DrScheme banner decoration.... -- Benjamin L. Russell -- Benjamin L. Russell / DekuDekuplex at Yahoo dot com http://dekudekuplex.wordpress.com/ Translator/Interpreter / Mobile: +011 81 80-3603-6725 "Furuike ya, kawazu tobikomu mizu no oto." -- Matsuo Basho^ From lunarc.lists at gmail.com Fri Dec 26 00:41:12 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:36:29 2009 Subject: [plt-scheme] PLT Web Server Memory Use Message-ID: Two things I'd like to note: For one, it looks like a significant part of the memory issues I was having before are due to non-trivial dispatching. If I use the virtual hosts dispatcher with this host->dispatcher function: (define (host->dispatcher host) (let ((host-str (symbol->string host))) (let-values (((clear-cache url->servlet) (servlets:make-cached-url->servlet (make-servlet-url->path host-str) (make-default-path->servlet)))) (sequencer:make (files:make #:url->path (make-file-url->path host-str) #:path->mime-type path->mime-type) (servlets:make url->servlet))))) mzscheme runs away gobbling up memory if I hold the refresh button in firefox for ~10 seconds (Its memory use rises continuously until I manually ^C it to death). Improving it with the following eliminates the problem. (define cached-host->dispatcher (let ((cache (make-hasheq))) (lambda (host) (unless (hash-ref cache host #f) (hash-set! cache host (host->dispatcher host))) (hash-ref cache host)))) I knew my host->dispatcher was not optimal (actually it is pretty wasteful) but I had no idea the consequences would be so drastic! The second thing, wouldn't it be useful to have something like the following included in the standard web server set of dispatchers? (define (make-limit-dispatcher num inner) (let ((sem (make-semaphore num))) (lambda (conn req) (call-with-semaphore sem (lambda () (inner conn req)))))) This is a simple way of limiting the number of concurrent servlet instances running at once, and also helps to keep the memory use down. Henk From troelskn at gmail.com Fri Dec 26 07:16:35 2008 From: troelskn at gmail.com (troels knak-nielsen) Date: Thu Mar 26 02:36:29 2009 Subject: [plt-scheme] scheme/foreign and C arrays In-Reply-To: References: Message-ID: <98b8086f0812260416j1130460cx9ae79bb70c9d1c5e@mail.gmail.com> I had a similar problem a few months back. Have a look over here: http://stackoverflow.com/questions/105816/how-do-i-access-a-char-through-ffi-in-plt-scheme -- troels On Fri, Dec 26, 2008 at 12:44 AM, Ben Simon wrote: > Howdy - > > Now that my MySQL FFI implementation doesn't crash every few moments, I've > been able to make some headway into making the API useful. This has been > going well, until I hit the row handling MySQL requires. Here's the C > example they provide: > > > MYSQL_ROW row; > unsigned int num_fields; > unsigned int i; > > num_fields = mysql_num_fields(result); > while ((row = mysql_fetch_row(result))) > { > unsigned long *lengths; > lengths = mysql_fetch_lengths(result); > for(i = 0; i < num_fields; i++) > { > printf("[%.*s] ", (int) lengths[i], > row[i] ? row[i] : "NULL"); > } > printf("\n"); > } > > Apparently, when I call mysql_fetch_row(...) it will return back a big array > of character data that is the series of columns. I can index into this > array by calling mysql_num_fields and mysql_fetch_lengths. > > mysql_fetch_lengths returns back an array of numbers, while the row object > is essentially an array. > > Given this, I think I need to focus on how Scheme handles C arrays. What's > the cleanest way to handle this? I've found some discussion about > cvectors, is that I'm looking for? > > Thanks, > -Ben > > -- > Have an idea for software? I can make it happen - > http://www.ideas2executables.com > My Blog: http://benjisimon.blogspot.com > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From benjisimon at gmail.com Fri Dec 26 09:54:13 2008 From: benjisimon at gmail.com (Ben Simon) Date: Thu Mar 26 02:36:30 2009 Subject: [plt-scheme] scheme/foreign and C arrays In-Reply-To: <98b8086f0812260416j1130460cx9ae79bb70c9d1c5e@mail.gmail.com> References: <98b8086f0812260416j1130460cx9ae79bb70c9d1c5e@mail.gmail.com> Message-ID: On Fri, Dec 26, 2008 at 7:16 AM, troels knak-nielsen wrote: > I had a similar problem a few months back. Have a look over here: > > http://stackoverflow.com/questions/105816/how-do-i-access-a-char-through-ffi-in-plt-scheme Figures, the exact question I was asking was already asked - typical. The answer doesn't really make sense to me. But, it gives me a place to start, and I'll mull it over from there. Oh - and I have the same goals you had when you were working on the code mentioned in the above post. It's all about learning FFI... Thanks, Ben > > > -- > troels > > On Fri, Dec 26, 2008 at 12:44 AM, Ben Simon wrote: > > Howdy - > > > > Now that my MySQL FFI implementation doesn't crash every few moments, > I've > > been able to make some headway into making the API useful. This has been > > going well, until I hit the row handling MySQL requires. Here's the C > > example they provide: > > > > > > MYSQL_ROW row; > > unsigned int num_fields; > > unsigned int i; > > > > num_fields = mysql_num_fields(result); > > while ((row = mysql_fetch_row(result))) > > { > > unsigned long *lengths; > > lengths = mysql_fetch_lengths(result); > > for(i = 0; i < num_fields; i++) > > { > > printf("[%.*s] ", (int) lengths[i], > > row[i] ? row[i] : "NULL"); > > } > > printf("\n"); > > } > > > > Apparently, when I call mysql_fetch_row(...) it will return back a big > array > > of character data that is the series of columns. I can index into this > > array by calling mysql_num_fields and mysql_fetch_lengths. > > > > mysql_fetch_lengths returns back an array of numbers, while the row > object > > is essentially an array. > > > > Given this, I think I need to focus on how Scheme handles C arrays. > What's > > the cleanest way to handle this? I've found some discussion about > > cvectors, is that I'm looking for? > > > > Thanks, > > -Ben > > > > -- > > Have an idea for software? I can make it happen - > > http://www.ideas2executables.com > > My Blog: http://benjisimon.blogspot.com > > > > _________________________________________________ > > For list-related administrative tasks: > > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > > > > -- Have an idea for software? I can make it happen - http://www.ideas2executables.com My Blog: http://benjisimon.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081226/3efcfec6/attachment.htm From jay.mccarthy at gmail.com Fri Dec 26 10:15:19 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:36:30 2009 Subject: [plt-scheme] PLT Web Server Memory Use In-Reply-To: References: Message-ID: On Thu, Dec 25, 2008 at 10:41 PM, Henk Boom wrote: > Two things I'd like to note: > > For one, it looks like a significant part of the memory issues I was > having before are due to non-trivial dispatching. If I use the virtual > hosts dispatcher with this host->dispatcher function: > > (define (host->dispatcher host) > (let ((host-str (symbol->string host))) > (let-values (((clear-cache url->servlet) > (servlets:make-cached-url->servlet > (make-servlet-url->path host-str) > (make-default-path->servlet)))) > (sequencer:make > (files:make > #:url->path (make-file-url->path host-str) > #:path->mime-type path->mime-type) > (servlets:make url->servlet))))) > > mzscheme runs away gobbling up memory if I hold the refresh button in > firefox for ~10 seconds (Its memory use rises continuously until I > manually ^C it to death). Improving it with the following eliminates > the problem. > > (define cached-host->dispatcher > (let ((cache (make-hasheq))) > (lambda (host) > (unless (hash-ref cache host #f) > (hash-set! cache host (host->dispatcher host))) > (hash-ref cache host)))) > > I knew my host->dispatcher was not optimal (actually it is pretty > wasteful) but I had no idea the consequences would be so drastic! Yes, every time you were getting a request, you were creating a whole bunch of closures and hash tables underneath those library calls. One curious thing is that the servlet cache created in the first example was never used, because a different servlet-dispatcher would be used each time. > The second thing, wouldn't it be useful to have something like the > following included in the standard web server set of dispatchers? > > (define (make-limit-dispatcher num inner) > (let ((sem (make-semaphore num))) > (lambda (conn req) > (call-with-semaphore sem > (lambda () (inner conn req)))))) > > This is a simple way of limiting the number of concurrent servlet > instances running at once, and also helps to keep the memory use down. I could add it. It _is_ 5 lines and really only one line matters. I think I will add it to the FAQ. Jay -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From lunarc.lists at gmail.com Fri Dec 26 11:11:10 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:36:30 2009 Subject: [plt-scheme] PLT Web Server Memory Use In-Reply-To: References: Message-ID: 2008/12/26 Jay McCarthy > Yes, every time you were getting a request, you were creating a whole > bunch of closures and hash tables underneath those library calls. One > curious thing is that the servlet cache created in the first example > was never used, because a different servlet-dispatcher would be used > each time. Right, thanks for the information. >> The second thing, wouldn't it be useful to have something like the >> following included in the standard web server set of dispatchers? >> >> (define (make-limit-dispatcher num inner) >> (let ((sem (make-semaphore num))) >> (lambda (conn req) >> (call-with-semaphore sem >> (lambda () (inner conn req)))))) >> >> This is a simple way of limiting the number of concurrent servlet >> instances running at once, and also helps to keep the memory use down. > > I could add it. It _is_ 5 lines and really only one line matters. I > think I will add it to the FAQ. It looks like it doesn't work. I added print statements before and after the call to inner using dynamic-wind, then used a servlet which takes a couple of seconds to run. If, in Firefox, I go to the servlet and hit refresh two times quickly, it looks like the servlet starts twice but only finishes once. Do this enough times and the semaphore runs out, stalling the server. What causes this behaviour? Does it have to do with how the web server handles abandoned connections? Henk From eddieSull at hotmail.com Fri Dec 26 12:20:27 2008 From: eddieSull at hotmail.com (Eddie Sullivan) Date: Thu Mar 26 02:36:31 2009 Subject: [plt-scheme] MySQL FFI in PLT Message-ID: Hi Ben. Here's some old code I wrote for MySQL. It's for version 3 of PLT scheme, but the FFI didn't change much. Much like the FastCGI stuff I sent out before, it's not the cleanest code in the world, but it does (did) work. See the comments at the end for how to use it. -Eddie -------------- next part -------------- A non-text attachment was scrubbed... Name: mysqldb.scm Type: application/octet-stream Size: 7745 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081226/e5deab02/mysqldb.obj From pltscheme at pnkfx.org Sat Dec 27 18:13:58 2008 From: pltscheme at pnkfx.org (Felix Klock's PLT scheme proxy) Date: Thu Mar 26 02:36:31 2009 Subject: [plt-scheme] prop:equal+hash for scheme/class ? Message-ID: <2E2B83F8-4C6A-4480-89A9-C9086F19C035@pnkfx.org> PLT Scheme Folk- Is there a prop:equal+hash for the scheme/class collection? That is, I have learned how to extend PLT Scheme's equal? procedure to handle instances of particular struct types specially, via the prop:equal+hash property. This has been incredibly useful for implementing abstract data types that integrate well with other code. I would like to know if there's an analogous property for classes. Or perhaps instead of a property, there are a set of methods I am supposed to override? (Much like how in Java one is supposed to make sure that the hashCode() and equals(..) methods must be kept in sync.) But if that is the case, the methods are not documented as far as I can tell. The documentation for object% says that it "has no methods fields" (sic) which leads me to think that PLT did not follow Java's lead (that's good!) and so something more like prop:equal+hash (which feels more like multi-method dispatch) is what belongs here. -Felix Klock p.s. I saw in the documentation for scheme/class that one can override the inspector for a class, but that does not handle implementing abstract data types; consider e.g. the example I provided in pr 9987: http://bugs.plt-scheme.org/query/gnatsweb.pl?cmd=view&pr=9987 From benjisimon at gmail.com Sat Dec 27 18:36:56 2008 From: benjisimon at gmail.com (Ben Simon) Date: Thu Mar 26 02:36:32 2009 Subject: [plt-scheme] Re: MySQL FFI in PLT In-Reply-To: References: Message-ID: Eddie - Thanks for sharing, this is really helpful. -Ben On Fri, Dec 26, 2008 at 12:20 PM, Eddie Sullivan wrote: > Hi Ben. > Here's some old code I wrote for MySQL. It's for version 3 of PLT scheme, > but the FFI didn't change much. > Much like the FastCGI stuff I sent out before, it's not the cleanest code > in the world, but it does (did) work. See the comments at the end for how to > use it. > -Eddie > -- Have an idea for software? I can make it happen - http://www.ideas2executables.com My Blog: http://benjisimon.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081227/d9a821d7/attachment.htm From grettke at acm.org Sat Dec 27 19:21:25 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:36:32 2009 Subject: [plt-scheme] Re: Merry Christmas everyone In-Reply-To: References: <932b2f1f0812250654l1585fd65t7aaab819aa1d92f5@mail.gmail.com> <932b2f1f0812250654l1585fd65t7aaab819aa1d92f5-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> Message-ID: <756daca50812271621t78d99c11t71271ba8101c76a5@mail.gmail.com> On Thu, Dec 25, 2008 at 11:04 PM, Benjamin L. Russell wrote: > Interesting DrScheme banner decoration.... Yes it was :). From maxigas at anargeek.net Sat Dec 27 19:28:31 2008 From: maxigas at anargeek.net (maxigas) Date: Thu Mar 26 02:36:32 2009 Subject: [plt-scheme] string->html/response In-Reply-To: References: <20081217.053129.224788043.maxigas@anargeek.net> <65A9F282-07A7-42EB-8A7C-88842DDA165E@gmail.com> Message-ID: <20081228.012831.178049802.maxigas@anargeek.net> From: "Jay McCarthy" Subject: Re: [plt-scheme] string->html/response Date: Wed, 17 Dec 2008 06:45:40 -0700 > Mirrors is great. But just to clarify, you can get raw unquoted > strings in the X-expression syntax with cdata structs: > > Examples: > > (make-cdata #f #f "bold") thank you. finally, i used this method with total success. :) this is how: ---8k---{snip..snip..}--- (define (load r b t) (let ((o (title->post b t))) `(html (head (title "Stratified Blog") ,css) (body (div ((id "level1")) "Stratified Blog") (div ((id "level2")) ,(post-title o)) (div ((id "level3")) ,@(map (lambda (x) (string-append " " (symbol->string x))) (post-tags o))) (div ((id "content")) ,(make-cdata #f #f (post-body o))))))) (define (file->string f) (let ((datum (read-line f))) (if (eof-object? datum) "" (string-append datum (file->string f))))) ---8k---{snip..snip..}--- maxigas From maxigas at anargeek.net Sat Dec 27 19:34:24 2008 From: maxigas at anargeek.net (maxigas) Date: Thu Mar 26 02:36:32 2009 Subject: [plt-scheme] pretty URLs Message-ID: <20081228.013424.235836955.maxigas@anargeek.net> hi! so now i have a blog engine (based on the Continue... tutorial) that can also handle tags of posts. i want to use it for different personal projects as a blogfarm engine. one requirement for that is that i need something that is i think called "pretty URLs": http://foo.bar/ --> URL of the blog (i can make this) with links to different tags. http://foo.bar/baz/ or even better http://baz.foo.bar/ --> URL that makes the same servlet list the posts tagged "baz". this is really simple thing but i cannot really imagine how to make it with plt-web-server. can somebody point me in the right direction? i have the vague understanding that there is some conceptual limitation here that has to do with continuations but i hope it is possible since it's pretty basic stuff. :) maxigas From benjisimon at gmail.com Sat Dec 27 20:38:21 2008 From: benjisimon at gmail.com (Ben Simon) Date: Thu Mar 26 02:36:33 2009 Subject: [plt-scheme] scheme/foreign and C arrays In-Reply-To: References: <98b8086f0812260416j1130460cx9ae79bb70c9d1c5e@mail.gmail.com> Message-ID: On Fri, Dec 26, 2008 at 9:54 AM, Ben Simon wrote: > On Fri, Dec 26, 2008 at 7:16 AM, troels knak-nielsen wrote: > >> I had a similar problem a few months back. Have a look over here: >> >> http://stackoverflow.com/questions/105816/how-do-i-access-a-char-through-ffi-in-plt-scheme > > > Figures, the exact question I was asking was already asked - typical. > > The answer doesn't really make sense to me. But, it gives me a place to > start, and I'll mull it over from there. > I've mulled it over, and gotten closer, but am not quite there yet. The return type of mysql-fetch-row is described as: This is a type-safe representation of one row of data. It is currently implemented as an array of counted byte strings. If I ignore for a second that they are byte counted strings, and not strings represented by a final null, I can write: (defmysql mysql-fetch-row : _result -> (_vector o _string (mysql-field-count))) (see below for all the source code. Though, everything after the : above is re-written into a (_fun ...)) This works remarkably well, but mysql-fetch-row returns NULL to signify the end of result set has been reached. With the above, I get the following error message when the end of a result set is hit: ptr-ref: expects type as 1st argument, given: #f; other arguments were: # 1 Any suggestions for how to handle this? I feel like I want to somehow use _cpointer/null - but just wrapping the above in a _cpointer/null doesn't appear to help. Also, to make this really robust, I'm going to need to think of this as a vector of _pointer's and then make byte strings out of them using the lenghts mysql tells me about. Part of this solution seems straightforward: ;; careful, psudo code below (define _row (make-ctype (_vector o _pointer (mysql-field-count)) #f (lambda (row) ;; row is a vector of _pointer's into strings (for/list ([ptr row] [length (mysql-fetch-lengths RESULT)]) ( make-sized-byte-string ptr length))))) The tricky part here is that I need access to RESULT - which is the value passed into mysql-fetch-row. Any suggestions for how I can arrange for this argument to be available for the ctype of resulting row? Thanks again for all help. Hopefully, this knowledge will be useful to others who come along and want to develop their own FFIs. -Ben (require scheme/foreign) (unsafe!) (define current-mysql-handle (make-parameter #f)) (define libmysql (ffi-lib "libmysql")) (define _handle (make-ctype _pointer #f (lambda (handle) (when handle (register-finalizer handle mysql-close)) handle))) (define _result (make-ctype _pointer #f (lambda (results) (when results (register-finalizer results mysql-free-result)) results))) (define _data (make-ctype _pointer #f (lambda (data) (if data data (error 'mysql (mysql-error)))))) (define _ok? (make-ctype _int #f (lambda (val) (if (= val 0) #t (error 'mysql (mysql-error)))))) (define-fun-syntax _handle* (syntax-id-rules () [_ (type: _handle expr: (current-mysql-handle))])) (define-fun-syntax _null_ptr* (syntax-id-rules () [_ (type: _pointer expr: #f)])) (define-syntax defmysql (syntax-rules (:) [(_ name : type ...) (define name (get-ffi-obj (regexp-replaces 'name '((#rx"-" "_") (#rx"[*?]$" ""))) libmysql (_fun type ...)))])) (defmysql mysql-init : _null_ptr* -> _handle) (defmysql mysql-close : _handle -> _void) (defmysql mysql-error : _handle* -> _string) (current-mysql-handle (mysql-init)) (defmysql mysql-real-connect : _handle* _string _string _string _string _int _string _long -> _data) (defmysql mysql-ping : _handle* -> _ok?) (defmysql mysql-query : _handle* _string -> _ok?) (defmysql mysql-free-result : _handle* _result -> _void) (defmysql mysql-store-result : _handle* -> _result) (defmysql mysql-num-fields : _result -> _int) (defmysql mysql-num-rows : _result -> _int) (defmysql mysql-field-count : _handle* -> _int) (defmysql mysql-fetch-row : _result -> (_vector o _string (mysql-field-count))) (defmysql mysql-fetch-lengths : _result -> (_vector o _long (mysql-field-count))) ;; TEST CODE (define (do-test) (mysql-real-connect "localhost" "root" "PASSWORD" "DATABASE" 0 "" 0) (mysql-query "select ID, user_login from wp_users") (printf "You've got: ~a columns.\n" (mysql-field-count)) (let ([r (mysql-store-result)]) (let loop ([i 0] [row (mysql-fetch-row r)]) (cond (row (printf "Row: ~a\n" i) (printf " ~a\n" row) (printf "\n") (loop (add1 i) (mysql-fetch-row r))) (else 'done))))) -- Have an idea for software? I can make it happen - http://www.ideas2executables.com My Blog: http://benjisimon.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081227/fb1c61b8/attachment.html From mflatt at cs.utah.edu Sat Dec 27 22:16:27 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:36:33 2009 Subject: [plt-scheme] prop:equal+hash for scheme/class ? In-Reply-To: <2E2B83F8-4C6A-4480-89A9-C9086F19C035@pnkfx.org> References: <2E2B83F8-4C6A-4480-89A9-C9086F19C035@pnkfx.org> Message-ID: <20081228031639.2B7E2650091@mail-svr1.cs.utah.edu> At Sat, 27 Dec 2008 18:13:58 -0500, Felix Klock's PLT scheme proxy wrote: > Is there a prop:equal+hash for the scheme/class collection? Not currently. > Or perhaps instead of a property, there are a set of methods I am > supposed to override? (Much like how in Java one is supposed to make > sure that the hashCode() and equals(..) methods must be kept in > sync.) But if that is the case, the methods are not documented as far > as I can tell. > > The documentation for object% says that it "has no methods > fields" (sic) which leads me to think that PLT did not follow Java's > lead (that's good!) and so something more like prop:equal+hash (which > feels more like multi-method dispatch) is what belongs here. It would be easy to add an interface for `prop:equal+hash' along the same lines as the `printable<%>' interface for `prop:custom-write'. I'm open to other suggestions. Matthew From keydana at gmx.de Sun Dec 28 02:01:54 2008 From: keydana at gmx.de (Sigrid Keydana) Date: Thu Mar 26 02:36:33 2009 Subject: [plt-scheme] how to call scheme program with arguments Message-ID: <49572462.4090309@gmx.de> Hi, this feels like a very stupid question, but I'm not clear about how to call a scheme program from the command line with arguments. I did not really find much in the PLT reference, and from the mzscheme man page I seem to understand I have to have a 'main' function that will automatically be called with the command-line arguments; on the other hand these might be packed into an 'argv' variable, still there seems to be a 'current-command-line-arguments' function... It would be great if someone could point out to me the "standard way" to do all this (perhaps with an example calling command line that also shows the necessary mzscheme options for this): - do I need the 'main' function as entry or are there other ways - how to get the arguments - whether to just have a one-liner on the command line or a whole shell-script-with-embedded-scheme like the one in the mzscheme man page (which btw does not print anything to stdout when I try it...?): #! /bin/sh #| exec mzscheme -qr "$0" ${1+"$@"} |# (display "Hello, world!") (newline) Thanks a lot for any hints, Sigrid From marek at xivilization.net Sun Dec 28 05:13:35 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:36:34 2009 Subject: [plt-scheme] how to call scheme program with arguments In-Reply-To: <49572462.4090309@gmx.de> References: <49572462.4090309@gmx.de> Message-ID: <20081228111335.2406c26e@halmanfloyd.lan.local> Hi, On Sun, 28 Dec 2008 08:01:54 +0100 Sigrid Keydana wrote: > - do I need the 'main' function as entry or are there other ways No, calling (current-command-line-arguments) is enough. > - how to get the arguments Personally I recommend the command-line form: For a program example that uses the command-line form, you can take a look at . > - whether to just have a one-liner on the command line or a whole > shell-script-with-embedded-scheme like the one in the mzscheme man > page (which btw does not print anything to stdout when I try it...?): I use normal 100% Scheme files without any shell-script stuff. regards, Marek From ryanc at ccs.neu.edu Sun Dec 28 05:29:34 2008 From: ryanc at ccs.neu.edu (Ryan Culpepper) Date: Thu Mar 26 02:36:34 2009 Subject: [plt-scheme] how to call scheme program with arguments In-Reply-To: <49572462.4090309@gmx.de> References: <49572462.4090309@gmx.de> Message-ID: <4957550E.80204@ccs.neu.edu> Sigrid Keydana wrote: > Hi, > > this feels like a very stupid question, but I'm not clear about how to > call a scheme program from the command line with arguments. I did not > really find much in the PLT reference, and from the mzscheme man page I > seem to understand I have to have a 'main' function that will > automatically be called with the command-line arguments; on the other > hand these might be packed into an 'argv' variable, still there seems to > be a 'current-command-line-arguments' function... The new PLT Scheme Guide contains a section on writing Unix-style scripts, accessing command-line arguments, etc, if you are using PLT Scheme 4. Here are links to the appropriate sections of the Guide: Creating Unix-style scripts: http://docs.plt-scheme.org/guide/scripts.html The whole section on running programs, including other ways of doing it: http://docs.plt-scheme.org/guide/running.html The Guide was written for PLT Scheme 4. If you are using an earlier version of PLT Scheme (like 371, say), much of what the Guide says does not apply, and the examples will not work. See more specific answers below. > It would be great if someone could point out to me the "standard way" to > do all this (perhaps with an example calling command line that also > shows the necessary mzscheme options for this): > > - do I need the 'main' function as entry or are there other ways No, you do not need a 'main' function. If you define a 'main' function, it is not called automatically when you run the script. You need to call it explicitly (example below). > - how to get the arguments Call the 'current-command-line-arguments' procedure. It returns a vector of strings (example below). > - whether to just have a one-liner on the command line or a whole > shell-script-with-embedded-scheme like the one in the mzscheme man page > (which btw does not print anything to stdout when I try it...?): > > #! /bin/sh > #| > exec mzscheme -qr "$0" ${1+"$@"} > |# > (display "Hello, world!") > (newline) I just tried the script above using both PLT Scheme 371 and PLT Scheme 4.1.3.6, and it worked in both of those systems. I put the code above in a file called "test1.sh", made it executable ("chmod 755 test1.sh"), and ran it ("./test1.sh" from the directory containing the script). It printed out "Hello, world!" as expected. The script above doesn't work for you? Does it print an error message instead, or does it terminate silently? (Beware if you've named the script "test" that there is a standard Unix command named "test" that might be getting called instead.) -- Here's a slightly larger example that demonstrates how to get the command-line arguments and how to define and call functions in the script: #! /bin/sh #| exec mzscheme -qr "$0" ${1+"$@"} |# (display "Hello, world!") (newline) ;; main : (vectorof string) -> void ;; Print out args one per line (or usage note if none given) (define (main argv) (when (zero? (vector-length argv)) (printf "please supply some arguments!\n") (exit 1)) (for-each (lambda (arg) (printf "arg: ~s\n" arg)) (vector->list argv))) (main (current-command-line-arguments)) (printf "done!\n") Note the explicit call to the 'main' function. BTW, the name of the function isn't important. There's no special significance to the name 'main'. Ryan > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From crasch at gmail.com Sun Dec 28 06:53:43 2008 From: crasch at gmail.com (Christopher Rasch) Date: Thu Mar 26 02:36:34 2009 Subject: [plt-scheme] Paypal tutorial? Message-ID: <495768C7.6070403@gmail.com> Hi, Has anyone written a tutorial for processing paypal payments via a scheme-powered website? The only thing related to paypal that I've found so far is this thread: http://list.cs.brown.edu/pipermail/plt-scheme/2007-September/020529.html Thanks! Chris From noelwelsh at gmail.com Sun Dec 28 07:10:37 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:36:34 2009 Subject: [plt-scheme] pretty URLs In-Reply-To: <20081228.013424.235836955.maxigas@anargeek.net> References: <20081228.013424.235836955.maxigas@anargeek.net> Message-ID: Take a look at the dispatch package on PLaneT. HTH, N. On Sun, Dec 28, 2008 at 12:34 AM, maxigas wrote: > hi! > > so now i have a blog engine (based on the Continue... tutorial) that can also handle tags of > posts. i want to use it for different personal projects as a blogfarm engine. one requirement > for that is that i need something that is i think called "pretty URLs": ... From mflatt at cs.utah.edu Sun Dec 28 10:07:10 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:36:34 2009 Subject: [plt-scheme] prop:equal+hash for scheme/class ? In-Reply-To: <20081228031639.2B7E2650091@mail-svr1.cs.utah.edu> References: <2E2B83F8-4C6A-4480-89A9-C9086F19C035@pnkfx.org> <20081228031639.2B7E2650091@mail-svr1.cs.utah.edu> Message-ID: <20081228150729.575F76500A9@mail-svr1.cs.utah.edu> At Sat, 27 Dec 2008 21:16:27 -0600, Matthew Flatt wrote: > At Sat, 27 Dec 2008 18:13:58 -0500, Felix Klock's PLT scheme proxy wrote: > > Is there a prop:equal+hash for the scheme/class collection? > > Not currently. > > > Or perhaps instead of a property, there are a set of methods I am > > supposed to override? (Much like how in Java one is supposed to make > > sure that the hashCode() and equals(..) methods must be kept in > > sync.) But if that is the case, the methods are not documented as far > > as I can tell. > > > > The documentation for object% says that it "has no methods > > fields" (sic) which leads me to think that PLT did not follow Java's > > lead (that's good!) and so something more like prop:equal+hash (which > > feels more like multi-method dispatch) is what belongs here. > > It would be easy to add an interface for `prop:equal+hash' along the > same lines as the `printable<%>' interface for `prop:custom-write'. I'm > open to other suggestions. I've added `equal<%>' --- and also `interface*', so that other properties can be mapped to interfaces without building them into `scheme/class'. The `equal<%>' interface is implemented with `interface*' and doesn't need to be built in, but it seems useful enough to include in `scheme/class'. Matthew From maxigas at anargeek.net Sun Dec 28 12:20:59 2008 From: maxigas at anargeek.net (maxigas) Date: Thu Mar 26 02:36:35 2009 Subject: [plt-scheme] pretty URLs In-Reply-To: References: <20081228.013424.235836955.maxigas@anargeek.net> Message-ID: <20081228.182059.101188012.maxigas@anargeek.net> hi! wouldn't it be easier to use this feature?: http://jay-mccarthy.blogspot.com/2008/11/top-level-servlets-in-plt-scheme-web.html but which version does it refer to? i have this: MzScheme v4.1.1.3 [3m] does it work if i download and compile 4.1.3 (current) from here: http://download.plt-scheme.org/drscheme/all-versions.html or i have to use the latest Subversion checkout? is it stable enough? maxigas From: "Noel Welsh" Subject: Re: [plt-scheme] pretty URLs Date: Sun, 28 Dec 2008 12:10:37 +0000 > Take a look at the dispatch package on PLaneT. > > HTH, > N. > > On Sun, Dec 28, 2008 at 12:34 AM, maxigas wrote: > > hi! > > > > so now i have a blog engine (based on the Continue... tutorial) that can also handle tags of > > posts. i want to use it for different personal projects as a blogfarm engine. one requirement > > for that is that i need something that is i think called "pretty URLs": > ... From maxigas at anargeek.net Sun Dec 28 12:26:37 2008 From: maxigas at anargeek.net (maxigas) Date: Thu Mar 26 02:36:35 2009 Subject: [plt-scheme] posting above and below Message-ID: <20081228.182637.10489587.maxigas@anargeek.net> hi! i am a little confused: is there a policy on this mailing list about answering emails above or below the quotation? it would be nice. :) maxigas From keydana at gmx.de Sun Dec 28 12:31:43 2008 From: keydana at gmx.de (stelvio) Date: Thu Mar 26 02:36:35 2009 Subject: [plt-scheme] Re: how to call scheme program with arguments In-Reply-To: <4957550E.80204@ccs.neu.edu> References: <49572462.4090309@gmx.de> <4957550E.80204@ccs.neu.edu> Message-ID: Hi Ryan, hi Marek, thanks a lot for your very useful answers and links. I ought to search the Guide more often; it's really more accessible than the reference if you're new to some topic and look for a "general approach"... Ryan, I think the reason why the script from the manpage didn't work for me was the -r option, the mzscheme help says that -r causes evaluation but no printing (indeed there was a time lapse). I replaced it by -u (like in the Guide example) just now and it printed out the results. I just wonder how it could print out something for you? Ciao, Sigrid From d.j.gurnell at gmail.com Sun Dec 28 12:35:29 2008 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Thu Mar 26 02:36:36 2009 Subject: [plt-scheme] pretty URLs In-Reply-To: References: <20081228.013424.235836955.maxigas@anargeek.net> Message-ID: A note on Dispatch: Dispatch's defaults are oriented towards someone using Instaweb or Instaservlet. These packages are being retired: they only work with PLT 4.1.2 and earlier. In PLT 4.1.3 and up youi'll want to use the web server's built-in serve/servlet procedure instead. It's pretty simple to get Dispatch to work with serve/servlet, but you have to add a couple of lines to the config. I've attached some sample code to get you up and running. You'll still have to look at the Dispatch docs to see what it offers, how it works, and whether it's right for you. -------------- next part -------------- A non-text attachment was scrubbed... Name: serve-servlet-dispatch-example.ss Type: application/octet-stream Size: 2411 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081228/0cf86ac0/serve-servlet-dispatch-example.obj -------------- next part -------------- I'll tweak Dispatch's defaults in the next release. Hope this helps, -- Dave > Take a look at the dispatch package on PLaneT. > > HTH, > N. > > On Sun, Dec 28, 2008 at 12:34 AM, maxigas > wrote: >> hi! >> >> so now i have a blog engine (based on the Continue... tutorial) >> that can also handle tags of >> posts. i want to use it for different personal projects as a >> blogfarm engine. one requirement >> for that is that i need something that is i think called "pretty >> URLs": > ... From d.j.gurnell at gmail.com Sun Dec 28 12:44:05 2008 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Thu Mar 26 02:36:36 2009 Subject: [plt-scheme] pretty URLs In-Reply-To: <20081228.182059.101188012.maxigas@anargeek.net> References: <20081228.013424.235836955.maxigas@anargeek.net> <20081228.182059.101188012.maxigas@anargeek.net> Message-ID: > wouldn't it be easier to use this feature?: > > http://jay-mccarthy.blogspot.com/2008/11/top-level-servlets-in-plt-scheme-web.html I don't know enough about serve/servlet to answer... it's probably a matter of preference. Dispatch does a little more than just give you pretty URLs, but you may or may not want these extra features. See the docs and the sample code I posted for more information. > but which version does it refer to? > > i have this: MzScheme v4.1.1.3 [3m] Dispatch works with any PLT from 4.1 to present. I think serve/servlet was introduced in 4.1.3 (althought I might be wrong). You should be able to do the direct download or the SVN checkout. I install PLT straight from SVN and find it to be quite stable. New features are added regularly... a few (not many) of them have broken backwards-compatibility and caused me to change things. I rarely have a problem with bugs (although the usual disclaimers undoubtedly apply). Cheers, -- Dave From robby at cs.uchicago.edu Sun Dec 28 12:50:35 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:36:36 2009 Subject: [plt-scheme] posting above and below In-Reply-To: <20081228.182637.10489587.maxigas@anargeek.net> References: <20081228.182637.10489587.maxigas@anargeek.net> Message-ID: <932b2f1f0812280950j3eaa562fy452e60d30f7d571d@mail.gmail.com> No policy. Robby On Sun, Dec 28, 2008 at 11:26 AM, maxigas wrote: > hi! > > i am a little confused: is there a policy on this mailing list about answering emails above or > below the quotation? it would be nice. :) > > maxigas > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From robby at cs.uchicago.edu Sun Dec 28 12:50:56 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:36:36 2009 Subject: [plt-scheme] posting above and below In-Reply-To: <20081228.182637.10489587.maxigas@anargeek.net> References: <20081228.182637.10489587.maxigas@anargeek.net> Message-ID: <932b2f1f0812280950o694c07ecie2c4696102873d97@mail.gmail.com> On Sun, Dec 28, 2008 at 11:26 AM, maxigas wrote: > i am a little confused: is there a policy on this mailing list about answering emails above or > below the quotation? it would be nice. :) Really: none. Robby From maxigas at anargeek.net Sun Dec 28 12:25:23 2008 From: maxigas at anargeek.net (maxigas) Date: Thu Mar 26 02:36:36 2009 Subject: [plt-scheme] pretty URLs In-Reply-To: References: <20081228.013424.235836955.maxigas@anargeek.net> Message-ID: <20081228.182523.184598115.maxigas@anargeek.net> hi! but it says "Ticket: 132 Doesn't seem to work with PLT 4.1.3". :o also, this link for the actual ticket page doesn't open at the moment.. maxigas From: "Noel Welsh" Subject: Re: [plt-scheme] pretty URLs Date: Sun, 28 Dec 2008 12:10:37 +0000 > Take a look at the dispatch package on PLaneT. > > HTH, > N. > > On Sun, Dec 28, 2008 at 12:34 AM, maxigas wrote: > > hi! > > > > so now i have a blog engine (based on the Continue... tutorial) that can also handle tags of > > posts. i want to use it for different personal projects as a blogfarm engine. one requirement > > for that is that i need something that is i think called "pretty URLs": > ... From robby at cs.uchicago.edu Sun Dec 28 12:55:35 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:36:37 2009 Subject: [plt-scheme] pretty URLs In-Reply-To: <20081228.182523.184598115.maxigas@anargeek.net> References: <20081228.013424.235836955.maxigas@anargeek.net> <20081228.182523.184598115.maxigas@anargeek.net> Message-ID: <932b2f1f0812280955q514ab3damdde6a80821166c86@mail.gmail.com> On Sun, Dec 28, 2008 at 11:25 AM, maxigas wrote: > hi! > > but it says "Ticket: 132 Doesn't seem to work with PLT 4.1.3". :o > > also, this link for the actual ticket page doesn't open at the moment.. Did you follow the link labeled "132" that goes here: http://planet.plt-scheme.org/trac/ticket/132 ? That one seems to work for me. Robby From jensaxel at soegaard.net Sun Dec 28 13:29:44 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:36:37 2009 Subject: [plt-scheme] posting above and below In-Reply-To: <20081228.182637.10489587.maxigas@anargeek.net> References: <20081228.182637.10489587.maxigas@anargeek.net> Message-ID: <4957C598.4060803@soegaard.net> maxigas wrote: > i am a little confused: is there a policy on this mailing list about answering emails above or > below the quotation? it would be nice. :) Consider yourself lucky this isn't Usenet... If it were, the answer would be "Always, *always* below". For good reasons too: http://pub.tsn.dk/how-to-quote.php -- Jens Axel S?gaard From d.j.gurnell at gmail.com Sun Dec 28 13:47:29 2008 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Thu Mar 26 02:36:37 2009 Subject: [plt-scheme] pretty URLs In-Reply-To: <932b2f1f0812280955q514ab3damdde6a80821166c86@mail.gmail.com> References: <20081228.013424.235836955.maxigas@anargeek.net> <20081228.182523.184598115.maxigas@anargeek.net> <932b2f1f0812280955q514ab3damdde6a80821166c86@mail.gmail.com> Message-ID: <2D656A7E-7DA2-4808-AF3D-63BF20A704BE@gmail.com> My bad - I forgot about that ticket. I've just uploaded version 1.6 addressing the problem. -- Dave > On Sun, Dec 28, 2008 at 11:25 AM, maxigas > wrote: >> hi! >> >> but it says "Ticket: 132 Doesn't seem to work with PLT 4.1.3". :o >> >> also, this link for the actual ticket page doesn't open at the >> moment.. > > Did you follow the link labeled "132" that goes here: > > http://planet.plt-scheme.org/trac/ticket/132 > > ? That one seems to work for me. > > Robby > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From maxigas at anargeek.net Sun Dec 28 14:38:54 2008 From: maxigas at anargeek.net (maxigas) Date: Thu Mar 26 02:36:37 2009 Subject: [plt-scheme] pretty URLs In-Reply-To: <932b2f1f0812280955q514ab3damdde6a80821166c86@mail.gmail.com> References: <20081228.182523.184598115.maxigas@anargeek.net> <932b2f1f0812280955q514ab3damdde6a80821166c86@mail.gmail.com> Message-ID: <20081228.203854.245284019.maxigas@anargeek.net> hi! see posting below. ;) From: "Robby Findler" Subject: Re: [plt-scheme] pretty URLs Date: Sun, 28 Dec 2008 11:55:35 -0600 > > but it says "Ticket: 132 Doesn't seem to work with PLT 4.1.3". :o > > > > also, this link for the actual ticket page doesn't open at the moment.. > > Did you follow the link labeled "132" that goes here: > > http://planet.plt-scheme.org/trac/ticket/132 > > ? That one seems to work for me. as i said it didn't open at the time despite i followed it. Dave Gurnell just wrote in his previous email that he fixed this, and indeed: thanks, Dave, i see the page and if i cannot get a similar line working with my servlet and the plt-scheme 1.4.3 i am compiling now (on Debian/PPC) then i will try the dispatch.ss way. :) ... (bla (bla (bla) bla) bla) (serve/servlet start #:launch-browser #f #:port 80 #:servlet-path (string->path "/code.ss")) ---> Servlet (@ /servlets/code.ss) didn't load: build-path: absolute path "/code.ss" cannot be added to a path maxigas From d.j.gurnell at gmail.com Sun Dec 28 17:37:42 2008 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Thu Mar 26 02:36:38 2009 Subject: [plt-scheme] pretty URLs In-Reply-To: <20081228.203854.245284019.maxigas@anargeek.net> References: <20081228.182523.184598115.maxigas@anargeek.net> <932b2f1f0812280955q514ab3damdde6a80821166c86@mail.gmail.com> <20081228.203854.245284019.maxigas@anargeek.net> Message-ID: > (serve/servlet start #:launch-browser #f #:port 80 #:servlet-path > (string->path "/code.ss")) > > ---> > > Servlet (@ /servlets/code.ss) didn't load: > build-path: absolute path "/code.ss" cannot be added to a path The #:servlet-path argument refers to the local URL of the servlet. It should be a string rather than a path object. This is different to the #:extra-files-paths and #:mime-types-path arguments, which refer to paths on your local filesystem. Say you have a servlet function that you want on the URL "http://localhost:8000/foo ". You also have a directory called "htdocs/stylesheets" containing a bunch of CSS files. You might write your call to serve/servlet as follows: (serve/servlet start #:port 8000 #:servlet-path "/foo" #:extra-files-paths (list (build-path "htdocs"))) The web server sends all requests to "/foo" to your servlet and serves all other URLs out of your static content directory: http://localhost:8000/foo ==> servlet http://localhost:8000/stylesheets/bar.css ==> htdocs/ stylesheets/bar.css etc... Hope this helps, -- Dave -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081228/0287fd60/attachment.html From grettke at acm.org Sun Dec 28 17:52:16 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:36:38 2009 Subject: [plt-scheme] posting above and below In-Reply-To: <20081228.182637.10489587.maxigas@anargeek.net> References: <20081228.182637.10489587.maxigas@anargeek.net> Message-ID: <756daca50812281452h639324fcg321c0946bde6460d@mail.gmail.com> On Sun, Dec 28, 2008 at 11:26 AM, maxigas wrote: > i am a little confused: is there a policy on this mailing list about answering emails above or > below the quotation? it would be nice. :) Per Robby's reply, no, and per Jen's, it is much easier to read a reply in chronological order :). From maxigas at anargeek.net Sun Dec 28 18:21:38 2008 From: maxigas at anargeek.net (maxigas) Date: Thu Mar 26 02:36:38 2009 Subject: [plt-scheme] pretty URLs In-Reply-To: References: <932b2f1f0812280955q514ab3damdde6a80821166c86@mail.gmail.com> <20081228.203854.245284019.maxigas@anargeek.net> Message-ID: <20081229.002138.84274771.maxigas@anargeek.net> hi! From: Dave Gurnell Subject: Re: [plt-scheme] pretty URLs Date: Sun, 28 Dec 2008 22:37:42 +0000 > (serve/servlet start #:launch-browser #f #:port 80 #:servlet-path (string->path "/code.ss")) > > ---> > > Servlet (@ /servlets/code.ss) didn't load: > build-path: absolute path "/code.ss" cannot be added to a path > > The #:servlet-path argument refers to the local URL of the servlet. It should be a string rather than a path object. This is > different to the #:extra-files-paths and #:mime-types-path arguments, which refer to paths on your local filesystem. I tried with a simple string before, but then i got a quite clear error message from mzscheme m3 1.1.4, which says at the end that it expected a path for the #:servlet-path keyword (see below)! I hope this is just a misleading error message or a buggy version, because this behavious doesn't work on the one hand and contradicts the documentation [1] on the other hand. 1.4.3. has been compiling on my G3 PPC/Debian for three hours now, so i hope it will finish sooner or later and i can confirm that it works with it. :) thank you for your example, i learned from it a lot, and now that i am reading the dispatcher docs i am pretty sure i will try it because it's a very useful and elegant thing and seems to be exactly what i was looking for! working with Scheme is like LSD: modify your consciousness for sure and sometimes it's a bad trip. %o [1] http://docs.plt-scheme.org/web-server/servlet-env_ss.html (file "/usr/local/plt/lib/plt/collects/web-server/default-web-root/././servlets/code.ss") broke the contract (->* ((-> request? response?)) (#:extra-files-path path? #:file-not-found-path path? #:launch-browser? boolean? #:listen-ip string? #:manager manager? #:mime-types-path path? #:port number? #:quit? boolean? #:server-root-path path? #:servlet-namespace (listof module-path?) #:servlet-path path? #:servlets-root path?) void) on serve/servlet; expected , given: "/code.ss" From maxigas at anargeek.net Sun Dec 28 19:49:22 2008 From: maxigas at anargeek.net (maxigas) Date: Thu Mar 26 02:36:38 2009 Subject: [plt-scheme] pretty URLs In-Reply-To: References: <932b2f1f0812280955q514ab3damdde6a80821166c86@mail.gmail.com> <20081228.203854.245284019.maxigas@anargeek.net> Message-ID: <20081229.014922.185302778.maxigas@anargeek.net> From: Dave Gurnell > (serve/servlet start #:launch-browser #f #:port 80 #:servlet-path (string->path "/code.ss")) > > ---> > > Servlet (@ /servlets/code.ss) didn't load: > build-path: absolute path "/code.ss" cannot be added to a path > > The #:servlet-path argument refers to the local URL of the servlet. It should be a string rather than a path object. This is > different to the #:extra-files-paths and #:mime-types-path arguments, which refer to paths on your local filesystem. OK, it works! But it's a path. I guess this is either a mistake in the documentation or a bug (probably the latter). I made 2 mistakes, however, when i was trying to make it work: - the keyword is "#:launch-browser?" not "#:launch-browser". - i launched code.ss from the browser, just trying to access the URL while an instance of plt-web-server was running. however, the correct was to lauch it is as a command line argument for mzscheme: "root@machine: mzscheme code.ss". note: this is also better for testing because you don't have to visit the refresh-servlets page all the time you alter code. ps: i think i had the same mzscheme before but the version output was also buggy: before: root@bubble: /usr/local/plt/bin/mzscheme -v Welcome to MzScheme v4.1.1.3 [3m], Copyright (c) 2004-2008 PLT Scheme Inc. after i compiled the latest stabel version from plt-scheme.org: Welcome to MzScheme v4.1.3 [3m], Copyright (c) 2004-2008 PLT Scheme Inc.a --> so maybe there was a mere typo, an extra "1." in the first case. maxigas From grettke at acm.org Sun Dec 28 21:11:24 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:36:38 2009 Subject: [plt-scheme] answers in list archive In-Reply-To: <0B19BFB2-FD23-494D-9A0D-C9EE0DA8CBAF@ccs.neu.edu> References: <904774730812150559s7d09cc54r37d11a416b7102d8@mail.gmail.com> <0B19BFB2-FD23-494D-9A0D-C9EE0DA8CBAF@ccs.neu.edu> Message-ID: <756daca50812281811j656e314an5f298734ba3b238f@mail.gmail.com> On Tue, Dec 16, 2008 at 10:23 AM, Matthias Felleisen wrote: > It leaves us with the question of how to help teachers prevent cheating when > they assign plain book problems. -- Matthias I got the impression that teachers are likely to come up with their own problems than use problems from the book. That isn't the case? From crasch at gmail.com Sun Dec 28 21:12:59 2008 From: crasch at gmail.com (Christopher Rasch) Date: Thu Mar 26 02:36:38 2009 Subject: [plt-scheme] Paypal integration? Message-ID: <4958322B.7080502@gmail.com> [Resent, as I haven't seen my initial message yet. Apologies if this is a dupe.] Hi, Are there any tutorials that detail how to integrate paypal with a scheme-powered website? Thanks! Chris From grettke at acm.org Sun Dec 28 21:13:17 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:36:39 2009 Subject: [plt-scheme] answers in list archive In-Reply-To: References: <904774730812150559s7d09cc54r37d11a416b7102d8@mail.gmail.com> <0B19BFB2-FD23-494D-9A0D-C9EE0DA8CBAF@ccs.neu.edu> Message-ID: <756daca50812281813p3f7a900ax16edad1c6a8f9ca6@mail.gmail.com> On Tue, Dec 16, 2008 at 1:06 PM, Shriram Krishnamurthi wrote: > You could augment DrScheme to record every keystroke. Cheating cases > presumably tend to be characterized by a large paste operation, > usually at the beginning (and possibly followed by several > alpha-renamings). Eliminating the latter avoids penalizing those who > simply prefer writing their code in a different editor. > > I wonder how well Marmoset does on this, given that it does a CVS > commit on every save. What is Marmoset? From grettke at acm.org Sun Dec 28 21:21:16 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:36:39 2009 Subject: [plt-scheme] Paypal integration? In-Reply-To: <4958322B.7080502@gmail.com> References: <4958322B.7080502@gmail.com> Message-ID: <756daca50812281821w3d62d727sa616c5d6bee8c4b1@mail.gmail.com> On Sun, Dec 28, 2008 at 8:12 PM, Christopher Rasch wrote: > [Resent, as I haven't seen my initial message yet. Apologies if this is a > dupe.] I haven't seen any. From sk at cs.brown.edu Sun Dec 28 21:21:45 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:36:39 2009 Subject: [plt-scheme] answers in list archive In-Reply-To: <756daca50812281813p3f7a900ax16edad1c6a8f9ca6@mail.gmail.com> References: <904774730812150559s7d09cc54r37d11a416b7102d8@mail.gmail.com> <0B19BFB2-FD23-494D-9A0D-C9EE0DA8CBAF@ccs.neu.edu> <756daca50812281813p3f7a900ax16edad1c6a8f9ca6@mail.gmail.com> Message-ID: Unfortunately, both Marmoset links from here http://www.cs.umd.edu/~pugh/ are broken. But Google for "Marmoset Pugh" and you'll learn a bit more. S. From lunarc.lists at gmail.com Mon Dec 29 00:48:02 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:36:39 2009 Subject: [plt-scheme] answers in list archive In-Reply-To: <756daca50812281811j656e314an5f298734ba3b238f@mail.gmail.com> References: <904774730812150559s7d09cc54r37d11a416b7102d8@mail.gmail.com> <0B19BFB2-FD23-494D-9A0D-C9EE0DA8CBAF@ccs.neu.edu> <756daca50812281811j656e314an5f298734ba3b238f@mail.gmail.com> Message-ID: 2008/12/28 Grant Rettke : > On Tue, Dec 16, 2008 at 10:23 AM, Matthias Felleisen > wrote: >> It leaves us with the question of how to help teachers prevent cheating when >> they assign plain book problems. -- Matthias > > I got the impression that teachers are likely to come up with their > own problems than use problems from the book. That isn't the case? As a third year undergraduate student, I can say that it's often not the case. In fact, this is often the only thing I end up using the textbook for. Very annoying when the textbook is expensive, since the expensive ones are usually the ones padded most with fluff, and therefore the least useful. Henk From noelwelsh at gmail.com Mon Dec 29 06:42:30 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:36:39 2009 Subject: [plt-scheme] pretty URLs In-Reply-To: <20081229.014922.185302778.maxigas@anargeek.net> References: <932b2f1f0812280955q514ab3damdde6a80821166c86@mail.gmail.com> <20081228.203854.245284019.maxigas@anargeek.net> <20081229.014922.185302778.maxigas@anargeek.net> Message-ID: On Mon, Dec 29, 2008 at 12:49 AM, maxigas wrote: > ps: i think i had the same mzscheme before but the version output was also buggy: > > before: > root@bubble: /usr/local/plt/bin/mzscheme -v > Welcome to MzScheme v4.1.1.3 [3m], Copyright (c) 2004-2008 PLT Scheme Inc. > > after i compiled the latest stabel version from plt-scheme.org: > Welcome to MzScheme v4.1.3 [3m], Copyright (c) 2004-2008 PLT Scheme Inc.a > > --> so maybe there was a mere typo, an extra "1." in the first case. I'm fairly sure this isn't a typo. There definitely was a version 4.1.1.3, and I believe current is 4.1.3. N. From geoff at knauth.org Mon Dec 29 09:20:34 2008 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Thu Mar 26 02:36:39 2009 Subject: [plt-scheme] Paypal integration? In-Reply-To: <4958322B.7080502@gmail.com> References: <4958322B.7080502@gmail.com> Message-ID: <176608A9-1267-4ABB-BAA8-509E6B499DBD@knauth.org> On Dec 28, 2008, at 21:12, Christopher Rasch wrote: > Are there any tutorials that detail how to integrate paypal with a > scheme-powered website? What do you mean by integration? Are there other systems that offer integration, and if so, how do they work? I recently had to put some PayPal Buy Now buttons on a website for a conference. These were the steps I had to do: - login to Paypal with conference's credentials - create a bunch of buttons for different registration options - - each button was basically an HTML form referencing a PayPal image and action - I put the buttons in the conference's website in the appropriate places When users pressed the buttons, they went to the PayPal site. Just before that happened, I saved user info so we knew that users had gone to PayPal to pay. Later we checked PayPal emails and web pages to see if they had paid. Integration to me means that PayPal communicates payment info directly to the conference database, or sends me some XML that can be validated and processed. That is not what we did, because I didn't see a good way to do that. Instead, we received email messages from PayPal, checked their payment pages, and updated our payment database ourselves. When PayPal sends an email to the conference administrator, the message can be parsed, but the email must be verified, and automatic recording of payments should have a human to check that the automation was correct. Geoff From benjisimon at gmail.com Mon Dec 29 09:39:27 2008 From: benjisimon at gmail.com (Ben Simon) Date: Thu Mar 26 02:36:40 2009 Subject: [plt-scheme] Paypal integration? In-Reply-To: <176608A9-1267-4ABB-BAA8-509E6B499DBD@knauth.org> References: <4958322B.7080502@gmail.com> <176608A9-1267-4ABB-BAA8-509E6B499DBD@knauth.org> Message-ID: On Mon, Dec 29, 2008 at 9:20 AM, Geoffrey S. Knauth wrote: > On Dec 28, 2008, at 21:12, Christopher Rasch wrote: > >> Are there any tutorials that detail how to integrate paypal with a >> scheme-powered website? >> > > What do you mean by integration? Are there other systems that offer > integration, and if so, how do they work? > > I recently had to put some PayPal Buy Now buttons on a website for a > conference. These were the steps I had to do: > > - login to Paypal with conference's credentials > - create a bunch of buttons for different registration options > - - each button was basically an HTML form referencing a PayPal image and > action > - I put the buttons in the conference's website in the appropriate places > > When users pressed the buttons, they went to the PayPal site. Just before > that happened, I saved user info so we knew that users had gone to PayPal to > pay. Later we checked PayPal emails and web pages to see if they had paid. Not to get too far off topic... You may want to look into PayPal IPN - Instant Payment Notification. This is a URL you plug into PayPal's back end, and it invokes every time an event happens (like someone purchases and item or cancels a subscription). You can learn more here: https://www.paypal.com/cgi-bin/webscr?cmd=p/xcl/rec/ipn-manual-outside Instant Payment Notification makes use of a standard HTTP POST (or maybe GET) so you can trivially plug in a scheme servlet to handle this request, if you wanted. You should be able to automate the transfer of PayPal information into your system, in a secure way, using this approach. -Ben -- Have an idea for software? I can make it happen - http://www.ideas2executables.com My Blog: http://benjisimon.blogspot.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20081229/06dbd2bb/attachment.htm From jay.mccarthy at gmail.com Mon Dec 29 09:41:04 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:36:40 2009 Subject: [plt-scheme] pretty URLs In-Reply-To: References: <20081228.013424.235836955.maxigas@anargeek.net> <20081228.182059.101188012.maxigas@anargeek.net> Message-ID: On Sun, Dec 28, 2008 at 10:44 AM, Dave Gurnell wrote: > I don't know enough about serve/servlet to answer... it's probably a matter > of preference. > > Dispatch does a little more than just give you pretty URLs, but you may or > may not want these extra features. See the docs and the sample code I posted > for more information. I think the Untyped folks answered this question well, just a few things to add: serve/servlet just gives you a way of capturing all requests to the top-level, so you need to parse those URLs intelligently to make it useful. I use Dispatch as my watermark of a good way to dispatch based on the URL structure. Jay -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From maxigas at anargeek.net Mon Dec 29 12:26:35 2008 From: maxigas at anargeek.net (maxigas) Date: Thu Mar 26 02:36:40 2009 Subject: [plt-scheme] pretty URLs In-Reply-To: References: <20081229.014922.185302778.maxigas@anargeek.net> Message-ID: <20081229.182635.229477151.maxigas@anargeek.net> hi! From: "Noel Welsh" Subject: Re: [plt-scheme] pretty URLs Date: Mon, 29 Dec 2008 11:42:30 +0000 > On Mon, Dec 29, 2008 at 12:49 AM, maxigas wrote: > > before: > > root@bubble: /usr/local/plt/bin/mzscheme -v > > Welcome to MzScheme v4.1.1.3 [3m], Copyright (c) 2004-2008 PLT Scheme Inc. > > > > after i compiled the latest stabel version from plt-scheme.org: > > Welcome to MzScheme v4.1.3 [3m], Copyright (c) 2004-2008 PLT Scheme Inc.a > > > > --> so maybe there was a mere typo, an extra "1." in the first case. > > I'm fairly sure this isn't a typo. There definitely was a version > 4.1.1.3, and I believe current is 4.1.3. you are right. for example in 4.1.1.3 serve/servlet accepts paths for the :servlet-path keyword and in 4.1.3 it accepts strings. :) thank you for all the answers, the issue is resolved now. maxigas From eli at barzilay.org Mon Dec 29 14:35:59 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:36:40 2009 Subject: [plt-scheme] posting above and below In-Reply-To: <756daca50812281452h639324fcg321c0946bde6460d@mail.gmail.com> References: <20081228.182637.10489587.maxigas@anargeek.net> <756daca50812281452h639324fcg321c0946bde6460d@mail.gmail.com> Message-ID: <92932db60812291135t6b3b5792h98a419194d36df32@mail.gmail.com> On Mon, Dec 29, 2008 at 12:52 AM, Grant Rettke wrote: > > Per Robby's reply, no, and per Jen's, it is much easier to read a > reply in chronological order :). Some people claim that it doesn't really matter, but only because they don't snip out the irrelevant stuff. IM(very subjective)O if you're too lazy to leave only the relevant stuff, then you can just as well top-post. Otherwise, bottom replies are much easier to read (and this is more important when you're "mass communicating", like usenet and mailing lists posts). -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From lunarc.lists at gmail.com Mon Dec 29 15:30:42 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:36:41 2009 Subject: [plt-scheme] posting above and below In-Reply-To: <20081228.182637.10489587.maxigas@anargeek.net> References: <20081228.182637.10489587.maxigas@anargeek.net> Message-ID: 2008/12/28 maxigas : > i am a little confused: is there a policy on this mailing list about answering emails above or > below the quotation? it would be nice. :) In my experience readers either don't care or prefer bottom-posts (like this one), so bottom-posting is safer. =) Henk From crasch at gmail.com Mon Dec 29 16:18:51 2008 From: crasch at gmail.com (Christopher Rasch) Date: Thu Mar 26 02:36:41 2009 Subject: [plt-scheme] Paypal integration? In-Reply-To: <176608A9-1267-4ABB-BAA8-509E6B499DBD@knauth.org> References: <4958322B.7080502@gmail.com> <176608A9-1267-4ABB-BAA8-509E6B499DBD@knauth.org> Message-ID: <49593EBB.6000206@gmail.com> Geoffrey S. Knauth wrote: > On Dec 28, 2008, at 21:12, Christopher Rasch wrote: >> Are there any tutorials that detail how to integrate paypal with a >> scheme-powered website? > > What do you mean by integration? Are there other systems that offer > integration, and if so, how do they work? > Hi Geoffrey, Thanks! By "integration" I mean, a system that can send and receive paypal payments to others without human intervention. What I have in mind is an auction site. When someone wins an auction, I'd like to be able to accept a paypal payment for the item, take my cut, and pay out the rest to the person selling the item. Paypal has an API, which is described here: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_nvp_NVPAPIOverview I was hoping that someone had already created a scheme-powered website that integrated the Paypal API, and had written about it, so that I could avoid gotchas, duplicating the wheel, etc. Chris From marek at xivilization.net Tue Dec 30 07:35:59 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:36:41 2009 Subject: [plt-scheme] posting above and below In-Reply-To: <92932db60812291135t6b3b5792h98a419194d36df32@mail.gmail.com> References: <20081228.182637.10489587.maxigas@anargeek.net> <756daca50812281452h639324fcg321c0946bde6460d@mail.gmail.com> <92932db60812291135t6b3b5792h98a419194d36df32@mail.gmail.com> Message-ID: <20081230133559.048091d8@halmanfloyd.lan.local> On Mon, 29 Dec 2008 21:35:59 +0200 "Eli Barzilay" wrote: > Otherwise, bottom replies are much easier to read (and this > is more important when you're "mass communicating", like usenet and > mailing lists posts). I always quote the mail and answer only relevant parts which has proven, over the years the most effective way of answering since people immediately see what I'm referring to and it has some resemblence to a dialog and not a letter exchange. Another observation that I made on this list is that people do a "Reply All" instead of a normal "Reply" so that an author that is subscribed to the list gets the mail twice. Is there some policy or is it "because everyone does so"? regards, Marek From sk at cs.brown.edu Tue Dec 30 08:27:26 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:36:41 2009 Subject: [plt-scheme] posting above and below In-Reply-To: <20081230133559.048091d8@halmanfloyd.lan.local> References: <20081228.182637.10489587.maxigas@anargeek.net> <756daca50812281452h639324fcg321c0946bde6460d@mail.gmail.com> <92932db60812291135t6b3b5792h98a419194d36df32@mail.gmail.com> <20081230133559.048091d8@halmanfloyd.lan.local> Message-ID: (a) Because there's no "reply to all but the original author" on most mailers. (b) Because mail systems like GMail automatically filter out duplicates. On Tue, Dec 30, 2008 at 7:35 AM, Marek Kubica wrote: > On Mon, 29 Dec 2008 21:35:59 +0200 > "Eli Barzilay" wrote: > >> Otherwise, bottom replies are much easier to read (and this >> is more important when you're "mass communicating", like usenet and >> mailing lists posts). > > I always quote the mail and answer only relevant parts which has > proven, over the years the most effective way of answering since people > immediately see what I'm referring to and it has some resemblence to a > dialog and not a letter exchange. > > Another observation that I made on this list is that people do a "Reply > All" instead of a normal "Reply" so that an author that is subscribed > to the list gets the mail twice. Is there some policy or is it "because > everyone does so"? > > regards, > Marek > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From noelwelsh at gmail.com Tue Dec 30 11:57:16 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:36:41 2009 Subject: [plt-scheme] Using one signature in place of two Message-ID: Hello all, I'm having some fun with the unit system. I have two signatures a^ and b^ which are used by mutually recursive units. The consumers of the resulting compound unit always want to use the union of a^ and b^, so I defined a signature thus: (define-signature c^ extends a^ ((open b^))) and consumers specify they import c^ and I invoke thus: (define-values/invoke-unit consumer@ (import c^) (export consumer^)) This, however, doesn't work. I get complaints about duplicate identifiers. E.g.: :unit: rename created duplicate identifier row-col->idx40 at: (rename row^ (struct:row22 struct:row) (make-row23 make-row) ... If I do instead: (define-values/invoke-unit consumer@ (import a^ b^) (export consumer^)) define-compound-unit: unit argument expects an untagged import with signature c^, which this usage context does not supply [I also got vector->values complaining about an out of range index, which I think came from a sig with a struct, but I can't reproduce right now] Is there any way to preserve the abstraction? I know if I define consumer^ to import a^ and b^ then things work. Example code below. Play around with quoting to see different errors. TIA, Noel ---------- #lang scheme/base (require scheme/unit) (define-signature a^ (a)) (define-signature b^ (b)) (define-signature c^ extends a^ ((open b^))) (define-signature consumer^ (foo)) (define-unit a@ (import b^) (export a^) (define a 1)) (define-unit b@ (import a^) (export b^) (define b 2)) (define-unit consumer1@ (import c^) (export consumer^) (define foo (+ a b))) (define-unit consumer2@ (import a^ b^) (export consumer^) (define foo (+ a b))) (define-values/invoke-unit (compound-unit/infer (import) (export a^ b^) (link a@ b@)) (import) (export a^ b^)) '(define-values/invoke-unit consumer1@ (import c^) (export consumer^)) '(define-values/invoke-unit consumer1@ (import a^ b^) (export consumer^)) (define-values/invoke-unit consumer2@ (import a^ b^) (export consumer^)) From lunarc.lists at gmail.com Tue Dec 30 12:52:07 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:36:41 2009 Subject: [plt-scheme] posting above and below In-Reply-To: <20081230133559.048091d8@halmanfloyd.lan.local> References: <20081228.182637.10489587.maxigas@anargeek.net> <756daca50812281452h639324fcg321c0946bde6460d@mail.gmail.com> <92932db60812291135t6b3b5792h98a419194d36df32@mail.gmail.com> <20081230133559.048091d8@halmanfloyd.lan.local> Message-ID: 2008/12/30 Marek Kubica : > Another observation that I made on this list is that people do a "Reply > All" instead of a normal "Reply" so that an author that is subscribed > to the list gets the mail twice. Is there some policy or is it "because > everyone does so"? In addition to what Eli mentioned, in general this means that people who sent to the list without being subscribed still get their answer (though I'm not sure whether or not the PLT Scheme mailing list accepts messages from people not subscribed). Henk From lunarc.lists at gmail.com Tue Dec 30 12:52:56 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:36:41 2009 Subject: [plt-scheme] posting above and below In-Reply-To: References: <20081228.182637.10489587.maxigas@anargeek.net> <756daca50812281452h639324fcg321c0946bde6460d@mail.gmail.com> <92932db60812291135t6b3b5792h98a419194d36df32@mail.gmail.com> <20081230133559.048091d8@halmanfloyd.lan.local> Message-ID: 2008/12/30 Henk Boom : > 2008/12/30 Marek Kubica : >> Another observation that I made on this list is that people do a "Reply >> All" instead of a normal "Reply" so that an author that is subscribed >> to the list gets the mail twice. Is there some policy or is it "because >> everyone does so"? > > In addition to what Eli mentioned Sorry, I meant Shriram here. Henk From wand at ccs.neu.edu Tue Dec 30 13:52:30 2008 From: wand at ccs.neu.edu (Mitchell Wand) Date: Thu Mar 26 02:36:42 2009 Subject: [plt-scheme] [Scheme Steering Committee announcements] Scheme Steering Committee: Reminder: Registration and Nominations start 5 Jan 2009 Message-ID: <1bd18ad50812301052n7171aa8i108f642d81da3f60@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 Tue Dec 30 13:52:30 2008 From: wand at ccs.neu.edu (Mitchell Wand) Date: Thu Mar 26 02:36:43 2009 Subject: [plt-scheme] [Scheme Steering Committee announcements] Scheme Steering Committee: Reminder: Registration and Nominations start 5 Jan 2009 Message-ID: <1bd18ad50812301052n7171aa8i108f642d81da3f60@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 maxigas at anargeek.net Tue Dec 30 14:35:33 2008 From: maxigas at anargeek.net (maxigas) Date: Thu Mar 26 02:36:43 2009 Subject: [plt-scheme] posting above and below In-Reply-To: <20081230133559.048091d8@halmanfloyd.lan.local> References: <756daca50812281452h639324fcg321c0946bde6460d@mail.gmail.com> <92932db60812291135t6b3b5792h98a419194d36df32@mail.gmail.com> <20081230133559.048091d8@halmanfloyd.lan.local> Message-ID: <20081230.203533.75745938.maxigas@anargeek.net> hi! From: Marek Kubica Subject: Re: [plt-scheme] posting above and below Date: Tue, 30 Dec 2008 13:35:59 +0100 > Another observation that I made on this list is that people do a "Reply > All" instead of a normal "Reply" so that an author that is subscribed > to the list gets the mail twice. Is there some policy or is it "because > everyone does so"? i like this practice because i don't read all the mails on the list so at least this one sticks out in which somebody is answering to me, and i think this is the case with many people. ps: my mail client (emacs/mew) automatically drops duplicates. :) maxigas From eric.hanchrow at gmail.com Tue Dec 30 16:06:02 2008 From: eric.hanchrow at gmail.com (Eric Hanchrow) Date: Thu Mar 26 02:36:43 2009 Subject: [plt-scheme] segv in mzscheme; culprit might be BTC_get_memory_use Message-ID: <36366a980812301306q76433ae0kff7695a6265d3bd3@mail.gmail.com> This struck my IRC bot while it was running; I don't know if I will be able to reproduce the problem. I've got the thing sitting in gdb; if someone wants to poke around, I'd happily give you the credentials needed to connect remotely. It's trunk revision 12896. Anyway, I've attached the stack trace. -------------- next part -------------- post-prompt No breakpoints or watchpoints. #0 0x401063ae in read () from /lib/tls/libc.so.6 #1 0x081bf5e6 in fault_handler (sn=11, si=0xbfb4dda4, ctx=0xbfb4de24) at ./sighand.c:28 #2 #3 0x081c35c3 in BTC_get_memory_use (gc=0x8226008, o=0x4384c1e8) at ./mem_account.c:229 #4 0x081c373f in GC_get_memory_use (o=0x0) at ./newgc.c:1613 #5 0x081c2f68 in garbage_collect (gc=0x8226008, force_full=) at ./mem_account.c:587 #6 0x081c5ab4 in GC_malloc_one_tagged (s=8) at ./newgc.c:617 #7 0x080aac86 in scheme_make_closure (p=0x0, code=0x437c9e68, close=0) at ./../src/fun.c:840 #8 0x080aae92 in read_compiled_closure (obj=0x441d3fc8) at ./../src/fun.c:8475 #9 0x08145041 in read_marshalled (type=, port=0x437c9ea0) at ./../src/read.c:5042 #10 0x08143505 in read_compact (port=0x441cc510, use_stack=) at ./../src/read.c:4855 #11 0x08144209 in read_compact (port=0x437c9ea0, use_stack=) at ./../src/read.c:4790 #12 0x0814370c in read_compact (port=0x437c9ea0, use_stack=) at ./../src/read.c:4559 #13 0x081447e3 in read_compact (port=0x441cc510, use_stack=) at ./../src/read.c:4889 #14 0x08145022 in read_marshalled (type=3, port=0x0) at ./../src/read.c:5030 #15 0x08143505 in read_compact (port=0x441cc510, use_stack=) at ./../src/read.c:4855 #16 0x0814370c in read_compact (port=0x437c9ea0, use_stack=) at ./../src/read.c:4559 #17 0x0814516a in read_compact_list (c=, proper=1, use_stack=, port=0x437c9ea0) at ./../src/read.c:4983 #18 0x0814363e in read_compact (port=0x441cc510, use_stack=) at ./../src/read.c:4894 #19 0x08145022 in read_marshalled (type=100, port=0x0) at ./../src/read.c:5030 #20 0x081441a6 in read_compact (port=0x441cc510, use_stack=) at ./../src/read.c:4643 #21 0x081447e3 in read_compact (port=0x441cc510, use_stack=) at ./../src/read.c:4889 #22 0x08145022 in read_marshalled (type=3, port=0x0) at ./../src/read.c:5030 #23 0x08143505 in read_compact (port=0x441cc510, use_stack=) at ./../src/read.c:4855 #24 0x0814519b in read_compact_list (c=, proper=0, use_stack=, port=0x437c9ea0) at ./../src/read.c:4992 #25 0x0814363e in read_compact (port=0x441cc510, use_stack=) at ./../src/read.c:4894 #26 0x08145022 in read_marshalled (type=87, port=0x0) at ./../src/read.c:5030 #27 0x08142143 in read_inner_inner (port=0x437ca020, stxsrc=0x437ca010, ht=0x437c2fa8, indentation=) at ./../src/read.c:5266 #28 0x08142af7 in _internal_read (port=0x437ca020, stxsrc=0x437ca010, crc=, cant_fail=0, honu_mode=0, recur=0, expose_comment=0, extra_char=-1, init_readtable=0x0, magic_sym=0x0, magic_val=0x0, delay_load_info=0x437ca148, get_info=0) at ./../src/read.c:2243 #29 0x08142f0b in scheme_internal_read_k () at ./../src/read.c:2317 #30 0x080a8e53 in scheme_top_level_do_worker (k=0x8142e40 , eb=0, new_thread=0, dyn_state=0x0) at ./../src/fun.c:2068 #31 0x080a96e4 in scheme_top_level_do (k=0x8142e40 , eb=0) at ./../src/fun.c:1976 #32 0x0813bb11 in scheme_internal_read (port=0x441cbf68, stxsrc=0x441caed0, crc=1, cantfail=0, honu_mode=0, recur=0, expose_comment=0, pre_char=-1, init_readtable=0x0, magic_sym=0x0, magic_val=0x0, delay_load_info=0x441ca038) at ./../src/read.c:2351 #33 0x08124329 in do_load_handler (data=0x3fac) at ./../src/portfun.c:4050 #34 0x080a229d in scheme_dynamic_wind (pre=0, act=0x8124220 , post=0x8124050 , jmp_handler=0, data=0x437ca158) at ./../src/fun.c:7590 #35 0x08123e19 in default_load (argc=2, argv=0x42314d58) at ./../src/portfun.c:4282 #36 0x4001a384 in ?? () #37 0x00000002 in ?? () #38 0x42314d58 in ?? () #39 0x08234738 in ?? () #40 0x404bc9c3 in ?? () #41 0x0000000c in ?? () #42 0x42314018 in ?? () #43 0x00000000 in ?? () No breakpoints or watchpoints. From mflatt at cs.utah.edu Tue Dec 30 16:33:52 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:36:43 2009 Subject: [plt-scheme] segv in mzscheme; culprit might be BTC_get_memory_use In-Reply-To: <36366a980812301306q76433ae0kff7695a6265d3bd3@mail.gmail.com> References: <36366a980812301306q76433ae0kff7695a6265d3bd3@mail.gmail.com> Message-ID: <20081230213412.78AC16500CF@mail-svr1.cs.utah.edu> At Tue, 30 Dec 2008 13:06:02 -0800, "Eric Hanchrow" wrote: > This struck my IRC bot while it was running; I don't know if I will be > able to reproduce the problem. > > I've got the thing sitting in gdb; if someone wants to poke around, > I'd happily give you the credentials needed to connect remotely. > > It's trunk revision 12896. > > Anyway, I've attached the stack trace. Thanks for the report, stack trace, and login! Happily, this one is already fixed in SVN (r12908). The bug was that `gc->owner_table' was extracted too early. Matthew From mflatt at cs.utah.edu Tue Dec 30 17:33:28 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:36:43 2009 Subject: [plt-scheme] Using one signature in place of two In-Reply-To: References: Message-ID: <20081230223344.CE08C6500CF@mail-svr1.cs.utah.edu> At Tue, 30 Dec 2008 16:57:16 +0000, "Noel Welsh" wrote: > I'm having some fun with the unit system. > > I have two signatures a^ and b^ which are used by mutually recursive > units. The consumers of the resulting compound unit always want to > use the union of a^ and b^, so I defined a signature thus: > > (define-signature c^ extends a^ > ((open b^))) > > and consumers specify they import c^ and I invoke thus: > > (define-values/invoke-unit consumer@ > (import c^) > (export consumer^)) > > This, however, doesn't work. I get complaints about duplicate > identifiers. E.g.: > > :unit: rename created duplicate identifier row-col->idx40 at: (rename > row^ (struct:row22 struct:row) (make-row23 make-row) ... I'm fairly certain that this is a bug in the unit system (related to the expansion of `open' within a signature), but I don't yet know how to fix it. I'm still thinking about it. Matthew From grettke at acm.org Tue Dec 30 23:02:36 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:36:43 2009 Subject: [plt-scheme] Sandbox updates In-Reply-To: <18763.5350.21188.125838@arabic.ccs.neu.edu> References: <18763.5350.21188.125838@arabic.ccs.neu.edu> Message-ID: <756daca50812302002q5fca10f3ob3c8f1e101a73c1@mail.gmail.com> On Thu, Dec 18, 2008 at 9:28 PM, Eli Barzilay wrote: > The sandbox library has had some major work done, this is a > not-too-short summary of the important changes. Very nice. From grettke at acm.org Tue Dec 30 23:12:31 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:36:44 2009 Subject: [plt-scheme] Why do layman programmers care about Currying? Message-ID: <756daca50812302012i492c77b2o484da69220d8d76a@mail.gmail.com> Why do layman (working programmers) care about Currying? Or how are they applied in daily use to help one out? http://en.wikipedia.org/wiki/Currying From lunarc.lists at gmail.com Tue Dec 30 23:31:32 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:36:44 2009 Subject: [plt-scheme] Why do layman programmers care about Currying? In-Reply-To: <756daca50812302012i492c77b2o484da69220d8d76a@mail.gmail.com> References: <756daca50812302012i492c77b2o484da69220d8d76a@mail.gmail.com> Message-ID: 2008/12/30 Grant Rettke : > Why do layman (working programmers) care about Currying? Or how are > they applied in daily use to help one out? > > http://en.wikipedia.org/wiki/Currying I find currying is useful as an alternative of (or at least alternative syntax for) small anonymous lambdas. This gets used more often in Haskel, but digging through some Scheme code I wrote for a compiler design class, here's a really simple example. ; process a class definition (define (process-class class) (for-each (curry process-function class) (defn:class-methods class))) This code in particular traverses a class definition from the parse tree, with the eventual aim of filling in things like labels to use for function addresses in the generated assembly. Here process-function needs the class definition as context for function processing, so I provide it as the first argument. Using curry just gives me a convenient way to fix the first argument. I could have used (lambda (f) (process-function class f)), but I find curry clearer. Also, lambda expressions like that one are less practical for functions which take more arguments, or even keyword arguments. But this is just my use, maybe someone else can come up with something more interesting. =) Henk From lordgeoffrey at optushome.com.au Tue Dec 30 23:51:14 2008 From: lordgeoffrey at optushome.com.au (LordGeoffrey) Date: Thu Mar 26 02:36:44 2009 Subject: [plt-scheme] Why do layman programmers care about Currying? In-Reply-To: <756daca50812302012i492c77b2o484da69220d8d76a@mail.gmail.com> References: <756daca50812302012i492c77b2o484da69220d8d76a@mail.gmail.com> Message-ID: <495AFA42.2020508@optushome.com.au> Definitely for brevity of anonymous functions. Which Haskell provides, scheme not so much. So i used them a lot in Haskell and never in Scheme. btw on a trivial note - the use of layman as a working programming seems contradictory to me. Grant Rettke wrote: > Why do layman (working programmers) care about Currying? Or how are > they applied in daily use to help one out? > > http://en.wikipedia.org/wiki/Currying > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From grettke at acm.org Wed Dec 31 00:08:37 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:36:44 2009 Subject: [plt-scheme] Why do layman programmers care about Currying? In-Reply-To: <495AFA42.2020508@optushome.com.au> References: <756daca50812302012i492c77b2o484da69220d8d76a@mail.gmail.com> <495AFA42.2020508@optushome.com.au> Message-ID: <756daca50812302108wc5d4950o6d3d029290a2220f@mail.gmail.com> On Tue, Dec 30, 2008 at 10:51 PM, LordGeoffrey wrote: > btw on a trivial note - the use of layman as a working programming seems > contradictory to me. Perhaps "a layman, for example a 'working programmer'" makes more sense here when you consider 'layman' in this context to mean "a person who does not belong to the profession of theoretical computer scientists". From acowley at seas.upenn.edu Wed Dec 31 01:26:41 2008 From: acowley at seas.upenn.edu (Anthony Cowley) Date: Thu Mar 26 02:36:44 2009 Subject: [plt-scheme] Why do layman programmers care about Currying? In-Reply-To: <756daca50812302012i492c77b2o484da69220d8d76a@mail.gmail.com> References: <756daca50812302012i492c77b2o484da69220d8d76a@mail.gmail.com> Message-ID: <81addec70812302226p7499c2cbge313f2dd0b97a38a@mail.gmail.com> On Tue, Dec 30, 2008 at 11:12 PM, Grant Rettke wrote: > Why do layman (working programmers) care about Currying? Or how are > they applied in daily use to help one out? > > http://en.wikipedia.org/wiki/Currying There are many cases where Curried functions can be convenient, but I'll just pick one class of examples. In FP, one is often passing around bundles of state in the form of parameters to a function. If that state is going to be updated on a regular basis, then one either wants to give up purity, or seriously consider monads. However, there are many cases where that state doesn't need to be updated, just referred to. Suppose then that we made whatever pieces of state we needed the first parameters to a pure function of multiple parameters. If that function is Curried and given its first few parameters, then the resulting partial application now has the necessary state tacked into its scope in way that is transparent to subsequent callers of that partial application. It is almost analogous to an implicit 'this' parameter if you close one eye and squint and want to think of it in an OO-way. So you start with general functions, you give them some state, and now they are instantiated in a sense. Callers of these new functions need not worry about those static state parameters, while the author of the function was able to consider, and test, his or her problem entirely functionally. Anthony From jmarshall at alum.mit.edu Wed Dec 31 01:43:15 2008 From: jmarshall at alum.mit.edu (Joe Marshall) Date: Thu Mar 26 02:36:44 2009 Subject: [plt-scheme] Why do layman programmers care about Currying? In-Reply-To: <756daca50812302012i492c77b2o484da69220d8d76a@mail.gmail.com> References: <756daca50812302012i492c77b2o484da69220d8d76a@mail.gmail.com> Message-ID: On Tue, Dec 30, 2008 at 8:12 PM, Grant Rettke wrote: > Why do layman (working programmers) care about Currying? Or how are > they applied in daily use to help one out? You might enjoy reading this article: @techreport{ leavens94fields, author = "Gary T. Leavens", title = "Fields in Physics are like Curried Functions or Physics for Functional Programmers", number = "94-06b", address = "Ames, Iowa, 50011", year = "1994", url = "citeseer.ist.psu.edu/leavens94fields.html" } The title says it all. -- ~jrm From noelwelsh at gmail.com Wed Dec 31 08:03:23 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:36:44 2009 Subject: [plt-scheme] Using one signature in place of two In-Reply-To: <20081230223344.CE08C6500CF@mail-svr1.cs.utah.edu> References: <20081230223344.CE08C6500CF@mail-svr1.cs.utah.edu> Message-ID: On Tue, Dec 30, 2008 at 10:33 PM, Matthew Flatt wrote: > I'm fairly certain that this is a bug in the unit system (related to > the expansion of `open' within a signature), but I don't yet know how > to fix it. I'm still thinking about it. Thanks. I can work around this easily enough so fixing it isn't important to me. N. From noelwelsh at gmail.com Wed Dec 31 10:42:19 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:36:45 2009 Subject: [plt-scheme] Paypal integration? In-Reply-To: <49593EBB.6000206@gmail.com> References: <4958322B.7080502@gmail.com> <176608A9-1267-4ABB-BAA8-509E6B499DBD@knauth.org> <49593EBB.6000206@gmail.com> Message-ID: On Mon, Dec 29, 2008 at 9:18 PM, Christopher Rasch wrote: > Thanks! By "integration" I mean, a system that can send and receive paypal payments to others without human intervention. I don't know of anything that does exactly what you want but the API you link to seems very easy to use, so it shouldn't be hard to build. N. From grettke at acm.org Wed Dec 31 11:46:54 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:36:45 2009 Subject: [plt-scheme] Why do layman programmers care about Currying? In-Reply-To: <81addec70812302226p7499c2cbge313f2dd0b97a38a@mail.gmail.com> References: <756daca50812302012i492c77b2o484da69220d8d76a@mail.gmail.com> <81addec70812302226p7499c2cbge313f2dd0b97a38a@mail.gmail.com> Message-ID: <756daca50812310846h2129567gb22bb9a65796c7bb@mail.gmail.com> On Wed, Dec 31, 2008 at 12:26 AM, Anthony Cowley wrote: > On Tue, Dec 30, 2008 at 11:12 PM, Grant Rettke wrote: >> Why do layman (working programmers) care about Currying? Or how are >> they applied in daily use to help one out? > There are many cases where Curried functions can be convenient, but > I'll just pick one class of examples. In FP, one is often passing > around bundles of state in the form of parameters to a function. I see. I was sort of wondering about that, because that is all I could come up with. Is this an idiomatic FP approach to managing such state? PLT's define seems to make it easy to do something so: (define (((collect-answers a1) a2) a3) ; do something with them (list a1 a2 a3)) What is the general approach for keeping track of when the function's work is "done" though? Having it callback a thunk perhaps? From rcleis at me.com Wed Dec 31 00:44:10 2008 From: rcleis at me.com (Richard Cleis) Date: Thu Mar 26 02:36:45 2009 Subject: [plt-scheme] Why do layman programmers care about Currying? In-Reply-To: <756daca50812302012i492c77b2o484da69220d8d76a@mail.gmail.com> References: <756daca50812302012i492c77b2o484da69220d8d76a@mail.gmail.com> Message-ID: On Dec 30, 2008, at 9:12 PM, Grant Rettke wrote: > Why do layman (working programmers) care about Currying? Or how are > they applied in daily use to help one out? > > http://en.wikipedia.org/wiki/Currying On Dec 30, 2008, at 9:12 PM, Grant Rettke wrote: > Why do layman (working programmers) care about Currying? Or how are > they applied in daily use to help one out? I'm not sure if you are referring to 'using a function that curries other functions,' or if you mean (as the wikisnip says) "if you fix some arguments, you get a function of the remaining arguments." I manually do the latter frequently, and it's one of the reasons I like Scheme so much. However, I am not certain that Currying refers to reducing the arguments in any order. I have the impression that Currying literally means reducing them in the order that they appear so that other functions may be written to take advantage of such strictness. Freeform reduction of arguments is simply making use of closures. No? rac From matthias at ccs.neu.edu Wed Dec 31 18:18:27 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:36:45 2009 Subject: [plt-scheme] Why do layman programmers care about Currying? In-Reply-To: References: <756daca50812302012i492c77b2o484da69220d8d76a@mail.gmail.com> Message-ID: <617742ED-C283-41A5-819B-1D3DB9CED172@ccs.neu.edu> You could imagine a world that looks like this: #lang scheme (define (fcore a b c) (+ a b c)) (define (f #:a (a #f) #:b (b #f) #:c (c #f)) (cond [(and a b c) (fcore a b c)] [(and a b) (lambda (c) (fcore a b c))] [(and a c) (lambda (b) (fcore a b c))] [(and b c) (lambda (a) (fcore a b c))] [a (lambda (b c) (fcore a b c))] [b (lambda (a c) (fcore a b c))] [c (lambda (a b) (fcore a b c))])) ((f #:a 0) 1 2) ((f #:a 0 #:c 2) 1) .. John Lamping explored this form of abstraction in his dissertation and I always thought there was something neat about it. -- Matthias On Dec 31, 2008, at 12:44 AM, Richard Cleis wrote: > > On Dec 30, 2008, at 9:12 PM, Grant Rettke wrote: > >> Why do layman (working programmers) care about Currying? Or how are >> they applied in daily use to help one out? >> >> http://en.wikipedia.org/wiki/Currying > > > On Dec 30, 2008, at 9:12 PM, Grant Rettke wrote: > >> Why do layman (working programmers) care about Currying? Or how are >> they applied in daily use to help one out? > > I'm not sure if you are referring to 'using a function that curries > other functions,' or if you mean (as the wikisnip says) "if you fix > some arguments, you get a function of the remaining arguments." I > manually do the latter frequently, and it's one of the reasons I > like Scheme so much. > > However, I am not certain that Currying refers to reducing the > arguments in any order. I have the impression that Currying > literally means reducing them in the order that they appear so that > other functions may be written to take advantage of such > strictness. Freeform reduction of arguments is simply making use > of closures. No? > > rac > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From jmarshall at alum.mit.edu Wed Dec 31 18:29:34 2008 From: jmarshall at alum.mit.edu (Joe Marshall) Date: Thu Mar 26 02:36:45 2009 Subject: [plt-scheme] Why do layman programmers care about Currying? In-Reply-To: References: <756daca50812302012i492c77b2o484da69220d8d76a@mail.gmail.com> Message-ID: On Tue, Dec 30, 2008 at 9:44 PM, Richard Cleis wrote: > > However, I am not certain that Currying refers to reducing the arguments in > any order. I have the impression that Currying literally means reducing > them in the order that they appear so that other functions may be written to > take advantage of such strictness. Freeform reduction of arguments is > simply making use of closures. No? I think that's an unnecessarily strict interpretation. You can always re-arrange the order of the arguments so they curry conveniently, and you can always de-curry any contiguous subset. Currying means to me taking an operation that operates on some base level and `lifting' it up to operate on functions of the base level. For example, the familiar binary operations of +, -, * and / operate on numbers, but if we curry them, we get functions that map from numbers to functions that map to numbers. We take the binary operator `+' and turn it into an `adder' function. (add 5) is a function that adds five to its argument. Now the `adder' function maps numbers to adders. An adder maps numbers to numbers. The space of adder functions is interesting in and of itself. (Like the gravitational field is interesting even if you never drop anything.) The operation of currying gets us out of the base space and into the higher order space. Yeah, it is a lambda expression, but not just *any* sort of lambda expression. For example, the LET form is implemeted as a lambda expression, but it usually isn't interesting to think of it as a higher-order function that has some ontological higher meaning. -- ~jrm From jmarshall at alum.mit.edu Wed Dec 31 18:42:19 2008 From: jmarshall at alum.mit.edu (Joe Marshall) Date: Thu Mar 26 02:36:45 2009 Subject: [plt-scheme] Why do layman programmers care about Currying? In-Reply-To: <617742ED-C283-41A5-819B-1D3DB9CED172@ccs.neu.edu> References: <756daca50812302012i492c77b2o484da69220d8d76a@mail.gmail.com> <617742ED-C283-41A5-819B-1D3DB9CED172@ccs.neu.edu> Message-ID: On Wed, Dec 31, 2008 at 3:18 PM, Matthias Felleisen wrote: > > You could imagine a world that looks like this: > > (define (f #:a (a #f) #:b (b #f) #:c (c #f)) > (cond > [(and a b c) (fcore a b c)] > [(and a b) (lambda (c) (fcore a b c))] > [(and a c) (lambda (b) (fcore a b c))] > [(and b c) (lambda (a) (fcore a b c))] > [a (lambda (b c) (fcore a b c))] > [b (lambda (a c) (fcore a b c))] > [c (lambda (a b) (fcore a b c))])) > > ((f #:a 0) 1 2) > ((f #:a 0 #:c 2) 1) > .. > > John Lamping explored this form of abstraction in his dissertation and I > always thought there was something neat about it. I played around with this sort of thing years ago, but the thing I didn't like was that it is really hard to figure out what (f #:a 0) means. It's a function of `the rest of the arguments', but you have to know the ultimate function fcore to figure out what arguments (and it what order) to call it. This isn't much of a problem until you start defining higher order functions and then you get a real mess of keyword soup. (And you would want some sort of `subtractive' mechanism to *omit* arguments previously provided.) On the other hand, you could just write (lambda (b c) (fcore 0 b c)) where you want to use such a function and be done with it. No ambiguity and it's already in the language. On a completely different thought: I expect the Haskell community would be *far* less excited about monads if their language didn't automatigically do the currying. -- ~jrm From eli at barzilay.org Wed Dec 31 18:54:02 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:36:46 2009 Subject: [plt-scheme] Why do layman programmers care about Currying? In-Reply-To: References: <756daca50812302012i492c77b2o484da69220d8d76a@mail.gmail.com> <617742ED-C283-41A5-819B-1D3DB9CED172@ccs.neu.edu> Message-ID: <92932db60812311554y22bc707fvae0eacab8ae03879@mail.gmail.com> On Thu, Jan 1, 2009 at 1:42 AM, Joe Marshall wrote: > On Wed, Dec 31, 2008 at 3:18 PM, Matthias Felleisen > wrote: >> >> You could imagine a world that looks like this: >> >> (define (f #:a (a #f) #:b (b #f) #:c (c #f)) >> (cond >> [(and a b c) (fcore a b c)] >> [(and a b) (lambda (c) (fcore a b c))] >> [(and a c) (lambda (b) (fcore a b c))] >> [(and b c) (lambda (a) (fcore a b c))] >> [a (lambda (b c) (fcore a b c))] >> [b (lambda (a c) (fcore a b c))] >> [c (lambda (a b) (fcore a b c))])) >> >> ((f #:a 0) 1 2) >> ((f #:a 0 #:c 2) 1) >> .. >> >> John Lamping explored this form of abstraction in his dissertation and I >> always thought there was something neat about it. > > I played around with this sort of thing years ago, but the thing I didn't > like was that it is really hard to figure out what (f #:a 0) means. > It's a function > of `the rest of the arguments', but you have to know the ultimate function > fcore to figure out what arguments (and it what order) to call it. This isn't > much of a problem until you start defining higher order functions and then > you get a real mess of keyword soup. (And you would want some sort of > `subtractive' mechanism to *omit* arguments previously provided.) You mean that (f #:a 0) is a function that will reject further uses of `#:a'? It sounds doable, though probably easier to write some generic facility to do so which will use the primitive keyword application functionality (ie, fixing Matthias's code is going to be very verbose). Also, IIRC, that's exactly what you get with keyworded arguments in Ocaml -- and things are even easier when you have a type system that can do that subtraction. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From eli at barzilay.org Wed Dec 31 19:07:13 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:36:46 2009 Subject: [plt-scheme] posting above and below In-Reply-To: References: <20081228.182637.10489587.maxigas@anargeek.net> <756daca50812281452h639324fcg321c0946bde6460d@mail.gmail.com> <92932db60812291135t6b3b5792h98a419194d36df32@mail.gmail.com> <20081230133559.048091d8@halmanfloyd.lan.local> Message-ID: <92932db60812311607n42e79c43u762dadc440645afa@mail.gmail.com> On Tue, Dec 30, 2008 at 7:52 PM, Henk Boom wrote: > (though I'm not sure whether or not the PLT Scheme mailing list > accepts messages from people not subscribed). It holds such posts for approval -- which means that the message is held until the list moderator (me) lets it through. [And I usually do so with a message asking people to subscribe and possibly turn on the "no-mail" option if they don't want/need emails -- it's just that there's a *lot* of spam that gets blocked in the same way, and I'm worried that I might silently drop such emails if I miss their (valid) content.] -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From acowley at seas.upenn.edu Wed Dec 31 19:11:24 2008 From: acowley at seas.upenn.edu (Anthony Cowley) Date: Thu Mar 26 02:36:46 2009 Subject: [plt-scheme] Why do layman programmers care about Currying? In-Reply-To: References: <756daca50812302012i492c77b2o484da69220d8d76a@mail.gmail.com> Message-ID: <81addec70812311611r26070cf5iacb1143ff4a64fd@mail.gmail.com> On Wed, Dec 31, 2008 at 12:44 AM, Richard Cleis wrote: > However, I am not certain that Currying refers to reducing the arguments in > any order. I have the impression that Currying literally means reducing > them in the order that they appear so that other functions may be written to > take advantage of such strictness. Freeform reduction of arguments is > simply making use of closures. No? > > rac I've always found the ordering aspect mildly troubling. Currying transforms (a x b) -> c into a -> b -> c, but is (a x b) the same as (b x a)? Not normally for programmers, but if you justify Currying with the logical argument that (a /\ b) -> c <=> a -> b -> c, and you believe that conjunctions are commutative, then I'm not sure where that leaves you since you have identified product types with conjunctions. I think the safe bet is to just call it partial application and not have to worry about offending anyone :) For practical purposes, functions of fewer arguments are more common, so the flip function in Haskell's Prelude is commonly used when exploiting one's automatically curried functions. For example, Prelude> let f x y = x / y Prelude> let g = flip f 3 Prelude> g 6 2.0 I don't think there is a flip automatically in scope in SML/NJ, but it's a very handy function when working in this style as it handles the case of functions of two arguments where the arguments are "equally important." If your function takes more arguments, one technique is to order them in terms of heavyness, or import, and put the heavy ones first. Anthony From gregory.woodhouse at gmail.com Wed Dec 31 20:55:48 2008 From: gregory.woodhouse at gmail.com (Gregory Woodhouse) Date: Thu Mar 26 02:36:46 2009 Subject: [plt-scheme] Why do layman programmers care about Currying? In-Reply-To: References: <756daca50812302012i492c77b2o484da69220d8d76a@mail.gmail.com> <617742ED-C283-41A5-819B-1D3DB9CED172@ccs.neu.edu> Message-ID: <8269CA49-3C48-42AE-B86A-218374E62250@gmail.com> On Dec 31, 2008, at 3:42 PM, Joe Marshall wrote: > On a completely different thought: > I expect the Haskell community would be *far* less excited about > monads > if their language didn't automatigically do the currying. > > -- > ~jrm I don't think I follow you here. Isn't the point of using monads to constrain recduction order so that side effects don't make the value of a function dependent on the choice of reduction order? I'm still trying to get my head around monads, but I admit that they seem rather artificial to me.