From jpc-ml at zenburn.net Sun Feb 1 09:06:55 2009 From: jpc-ml at zenburn.net (=?UTF-8?B?SmFrdWIgUGlvdHIgQ8WCYXBh?=) Date: Thu Mar 26 02:39:31 2009 Subject: [plt-scheme] Attaching modules to namespaces in compiled code In-Reply-To: <20090126003247.DF07265008C@mail-svr1.cs.utah.edu> References: <497CFB0D.6010409@zenburn.net> <20090126003247.DF07265008C@mail-svr1.cs.utah.edu> Message-ID: <4985AC7F.6010606@zenburn.net> On 1/26/09 1:32 AM, Matthew Flatt wrote: > At Mon, 26 Jan 2009 00:51:41 +0100, Jakub Piotr C?apa wrote: >> I already asked this question here once but AFAICT some things changed >> since then. >> >> I have the following code fragment: >> (let ([ns (make-base-namespace)] >> [sepack-mod (module-path-index-resolve (module-path-index-join >> "sepack.ss" (syntax-source-module #'here)))]) >> (namespace-attach-module (current-namespace) sepack-mod ns) >> (parameterize ([current-namespace ns] >> [current-prompt-read prompt]) >> (namespace-require sepack-mod) >> (read-eval-print-loop))) >> >> The last time I tried to do this I had to manually resolve the name >> recursively (I basically copied and pasted the code Matthew suggested). >> The module-path-index-resolve is certainly nicer but I am curious >> whether it can be improved upon: >> 1. Quite a few functions are needed to acquire one module path. >> 2. As far as I understand I still need to require the module statically >> somewhere (even if it is needed only in dynamically evaluated code) for >> mzc to compile it in. Can this be fused with define-runtime-path somehow? > > We have better pieces for making this work, now, and I've put them > together into a `define-runtime-module-path' form that is exported by > `scheme/runtime-path'. I found a -list version useful in my case: (define-syntax (define-runtime-module-path-list stx) (syntax-case stx () [(_ id (mod-path ...)) (begin (unless (memq (syntax-local-context) '(top-level module module-begin)) (raise-syntax-error #f "allowed only in a module top-level or top-level context" stx)) (unless (identifier? #'id) (raise-syntax-error #f "expected an identifier to bind" stx #'id)) (unless (andmap module-path? (syntax->datum #'(mod-path ...))) (raise-syntax-error #f "expected a list of literal module paths" stx #'(mod-path ...))) #`(begin (require (only-in (for-label mod-path))) ... (define id (let ([vr (#%variable-reference)]) (list (combine-module-path vr 'mod-path) ...)))))])) An example of usage is: (define-runtime-module-path-list repl-modules ("crc16.ss" "util.ss" "sepack.ss" "intel-hex.ss" scheme)) (let ([old-ns (current-namespace)]) (parameterize ([current-namespace (make-empty-namespace)]) (for ([path (in-list repl-modules)]) (namespace-attach-module old-ns path (current-namespace)) (namespace-require path)) (read-eval-print-loop))) -- regards, Jakub Piotr C?apa From filcab at gmail.com Sun Feb 1 17:40:28 2009 From: filcab at gmail.com (Filipe Cabecinhas) Date: Thu Mar 26 02:39:33 2009 Subject: [plt-scheme] Compiling Fluxus Message-ID: Hi all, I'm trying to experiment with fluxus, but I can't use it in mac or linux. In the Mac, I have every library installed through MacPorts and PLT Scheme from svn. The dynamic loader needs DYLD_LIBRARY_PATH set, which is not a problem, but then it just yields a bus error (valgrind is not a great help in debugging that, either), no other output. In Linux, I have a 32-bit Ubuntu, with every library installed through synaptic except PLT Scheme (source tarball + install). It compiles (after adding some #includes :s) but then, when I'm trying to run it: anog@ubuntu:~$ fluxus #f::0: compile: unbound identifier (and no #%app syntax transformer is bound) at: define in: (define fluxus-collects-location "/usr/local/lib/plt/collects/") anog@ubuntu:~$ any clues? Regards, F From jensaxel at soegaard.net Sun Feb 1 17:47:12 2009 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:39:34 2009 Subject: [plt-scheme] Compiling Fluxus In-Reply-To: References: Message-ID: <49862670.8050708@soegaard.net> Filipe Cabecinhas wrote: > I'm trying to experiment with fluxus, but I can't use it in mac or linux. > > In the Mac, I have every library installed through MacPorts and PLT > Scheme from svn. The dynamic loader needs DYLD_LIBRARY_PATH set, which > is not a problem, but then it just yields a bus error (valgrind is not > a great help in debugging that, either), no other output. I'll punt on the compiling problem, and just point out that you don't need to compile the svn version yourself. Grab a precompiled binary for the svn version from: http://pre.plt-scheme.org/installers/ If you want all everything, then choose the Full version. -- Jens Axel S?gaard From matthias at ccs.neu.edu Sun Feb 1 18:24:31 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:39:34 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> Message-ID: Everyone, this is a great chance to get infrastructure for PLT Scheme and get paid for it too. If you have a project in mind, let me encourage you to post here so that we can discuss it and the possibility of funding it through JSP. -- Matthias On Jan 31, 2009, at 2:55 PM, yminsky wrote: > I'm pleased to announce the Jane Street Summer Project for 2009. > The goal > of the JSSP is to make functional programming languages into better > practical tools for programming in the real world. To do that, we > will > fund students over the summer to work on open-source projects which > aim at > improving the practical utility of their favorite functional language. > > The JSSP is a follow-on to last year's OCaml Summer Project. A key > difference this year is that we are opening up the project to > proposals in > languages other than OCaml (although we expect to maintain a focus > on OCaml > projects.) There are also some changes to the funding structure > that are > particularly relevant for projects located in the US. > > If you want to find out more, you can look at the JSSP blog: > > http://janestreetsummer.com > > And at the project FAQ: > > http://ocaml.janestreet.com/?q=node/57 > > We're looking forward to a great and productive summer, and we hope > some of > you come along for the ride! > > Thanks, > Yaron Minsky > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From grettke at acm.org Sun Feb 1 19:31:02 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:39:34 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> Message-ID: <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> On Sun, Feb 1, 2009 at 5:24 PM, Matthias Felleisen wrote: > Everyone, this is a great chance to get infrastructure for > PLT Scheme and get paid for it too. If you have a project in > mind, let me encourage you to post here so that we can discuss > it and the possibility of funding it through JSP. -- Matthias Adding "Eclipse-like" IDE functionality to DrScheme. DrScheme already exposes the functionality that "most programmers" would expect; but it does so in a manner different than how most would expect it to: namely it provides the name dropdown and the module browser, debugger, and macro expander. A typical IDE set up might include the notion of a project, a file browser, a module browser, a class browser. This has been discussed before; but it seems relevant to JSSP's goals of "encourag[ing] growth in the functional programming community". I guess the question is of the means by which we encourage that growth. From jev at mac.com Sun Feb 1 20:01:44 2009 From: jev at mac.com (Jaime Vargas) Date: Thu Mar 26 02:39:34 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> Message-ID: <91521001-97D1-4B4F-B326-42A0FE5AC4CB@mac.com> Support for language specific syntax in the interactions pane. Right now, guest languages like Algol don't have first class support in the interactions area. Sent from my iPhone On Feb 1, 2009, at 6:24 PM, Matthias Felleisen wrote: > > Everyone, this is a great chance to get infrastructure for > PLT Scheme and get paid for it too. If you have a project in > mind, let me encourage you to post here so that we can discuss > it and the possibility of funding it through JSP. -- Matthias > > > On Jan 31, 2009, at 2:55 PM, yminsky wrote: > >> I'm pleased to announce the Jane Street Summer Project for 2009. >> The goal >> of the JSSP is to make functional programming languages into better >> practical tools for programming in the real world. To do that, we >> will >> fund students over the summer to work on open-source projects which >> aim at >> improving the practical utility of their favorite functional >> language. >> >> The JSSP is a follow-on to last year's OCaml Summer Project. A key >> difference this year is that we are opening up the project to >> proposals in >> languages other than OCaml (although we expect to maintain a focus >> on OCaml >> projects.) There are also some changes to the funding structure >> that are >> particularly relevant for projects located in the US. >> >> If you want to find out more, you can look at the JSSP blog: >> >> http://janestreetsummer.com >> >> And at the project FAQ: >> >> http://ocaml.janestreet.com/?q=node/57 >> >> We're looking forward to a great and productive summer, and we hope >> some of >> you come along for the ride! >> >> Thanks, >> Yaron Minsky >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From clements at brinckerhoff.org Mon Feb 2 00:18:13 2009 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:39:35 2009 Subject: [plt-scheme] Compiling Fluxus In-Reply-To: References: Message-ID: <03711134-5B54-41AE-99ED-E2AD41950A17@brinckerhoff.org> On Feb 1, 2009, at 2:40 PM, Filipe Cabecinhas wrote: > Hi all, > > I'm trying to experiment with fluxus, but I can't use it in mac or > linux. > > In the Mac, I have every library installed through MacPorts and PLT > Scheme from svn. The dynamic loader needs DYLD_LIBRARY_PATH set, which > is not a problem, but then it just yields a bus error (valgrind is not > a great help in debugging that, either), no other output. I observed the same thing a few months ago, and guessed that fluxus might be incompatible with the precise garbage collector. 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/20090201/30e3d5f1/smime.bin From filcab at gmail.com Mon Feb 2 10:18:05 2009 From: filcab at gmail.com (Filipe Cabecinhas) Date: Thu Mar 26 02:39:35 2009 Subject: [plt-scheme] Compiling Fluxus In-Reply-To: <03711134-5B54-41AE-99ED-E2AD41950A17@brinckerhoff.org> References: <03711134-5B54-41AE-99ED-E2AD41950A17@brinckerhoff.org> Message-ID: Hi, It doesn't seem like a compiling problem, MzScheme works in everything. As for 3m/CGC. I was testing with 3m on the Mac and CGC on linux... Regards, F On Mon, Feb 2, 2009 at 05:18, John Clements wrote: > > On Feb 1, 2009, at 2:40 PM, Filipe Cabecinhas wrote: > >> Hi all, >> >> I'm trying to experiment with fluxus, but I can't use it in mac or linux. >> >> In the Mac, I have every library installed through MacPorts and PLT >> Scheme from svn. The dynamic loader needs DYLD_LIBRARY_PATH set, which >> is not a problem, but then it just yields a bus error (valgrind is not >> a great help in debugging that, either), no other output. > > I observed the same thing a few months ago, and guessed that fluxus might be > incompatible with the precise garbage collector. > > John Clements > > From icfp.publicity at googlemail.com Mon Feb 2 10:30:38 2009 From: icfp.publicity at googlemail.com (Matthew Fluet (ICFP Publicity Chair)) Date: Thu Mar 26 02:39:35 2009 Subject: [plt-scheme] ICFP09 Final CFP Message-ID: <53ff55480902020730h3a1add37r3b5fb00aac22d3a3@mail.gmail.com> Final 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 URL: https://www.softconf.com/a/icfp09/ 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 * Implementation * Software-Development Techniques * Foundations * Applications and Domain-Specific Languages * Functional Pearls 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. Important Dates (at 20:00 UTC) ~~~~~~~~~~~~~~~ Submission: 2 March 2009 https://www.softconf.com/a/icfp09/ Author response: 21-23 April 2009 Notification: 5 May 2009 Final papers due: 8 June 2009 Call for Papers (full text) ~~~~~~~~~~~~~~~ http://web.cecs.pdx.edu/~apt/icfp09_cfp.html Call for Experience Reports (full text) ~~~~~~~~~~~~~~~~~~~~~~~~~~~ http://web.cecs.pdx.edu/~apt/icfp09_cfer.html 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. From noelwelsh at gmail.com Mon Feb 2 10:49:47 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:39:35 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> Message-ID: On Mon, Feb 2, 2009 at 12:31 AM, Grant Rettke wrote: > A typical IDE set up might include the notion of a project, a file > browser, a module browser, a class browser. Of these I think the notion of a project is the most important. It should include: - standard directory layout, prepopulated with standard stuff - one-click testing, building, build for planet, planet dev. link [We are building portions of this at Untyped. Notably not the DrScheme integration part.] Other things that would be useful: - Multimedia libraries - Continuous integration server - Bug tracker Other things that would be fun: - Compile to Dalvik, Objective-C, or Flash N. From mflatt at cs.utah.edu Mon Feb 2 11:29:07 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:39:36 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> Message-ID: <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> At Mon, 2 Feb 2009 15:49:47 +0000, Noel Welsh wrote: > On Mon, Feb 2, 2009 at 12:31 AM, Grant Rettke wrote: > > A typical IDE set up might include the notion of a project, a file > > browser, a module browser, a class browser. > > Of these I think the notion of a project is the most important. It > should include: > > - standard directory layout, prepopulated with standard stuff > - one-click testing, building, build for planet, planet dev. link For my part, I've tried to avoid introducing the notion of a "project" into PLT Scheme tools. It isn't because I'm unused to the project concept. My first real programming experiences were using CodeWarrior on the Mac. I still (have to) use projects with VisualStudio. And I'm forced to use XCode sometimes. Personal taste aside, the technical problem with projects --- as usually implemented --- is that they are outside the programming language. If your project tools are missing some functionality, then you're either stuck doing things manually or you learn the project system's ad hoc extension API. I've instead pushed the idea that everything should be code organized into modules. If you want a new programming language, you don't tell the project manager that it should run some command-line tool on files that end in ".xqz". Instead, you import the "xqx" language into your module (perhaps via "#lang xqz"). I'm convinced that this approach is more systematically extensible and composable. That approach is potentially compatible with a notion of projects. I can imagine a project description that starts "#lang project" and that does great things. But if there are some "project description" files sitting around that aren't code, or if doing something with a project (other than editing it) requires looking at the source of the description (in some fixed syntax) instead of "running" the project description, then it will seem to me like the wrong approach. Along similar lines, I'm uncomfortable with the idea that a programmer should click a button to create a tree of files and start editing. It should be enough to just start a file with "#lang ....". I don't think we're to that point, yet, because things like documentation or reader extension require files with the right name (e.g., "info.ss") in the right directory (e.g, in a directory registered with Planet). But I hope we can find ways to remove directory hierarchies and other boilerplate, instead of ways to generate boilerplate automatically. Matthew From sk at cs.brown.edu Mon Feb 2 11:59:10 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:39:36 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> Message-ID: > Along similar lines, I'm uncomfortable with the idea that a programmer > should click a button to create a tree of files and start editing. It > should be enough to just start a file with "#lang ....". I don't think > we're to that point, yet, because things like documentation or reader > extension require files with the right name (e.g., "info.ss") in the > right directory (e.g, in a directory registered with Planet). But I > hope we can find ways to remove directory hierarchies and other > boilerplate, instead of ways to generate boilerplate automatically. Hear, hear. Scheme macros are one of the very best ways of writing boilerplate. Given that, problems that require boilerplate should be turned into problems on macros+modules, not into boilerplate generators. Shriram From noelwelsh at gmail.com Mon Feb 2 12:27:38 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:39:36 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> Message-ID: On Mon, Feb 2, 2009 at 4:59 PM, Shriram Krishnamurthi wrote: >> Along similar lines, I'm uncomfortable with the idea that a programmer >> should click a button to create a tree of files and start editing. ... I >> hope we can find ways to remove directory hierarchies and other >> boilerplate, instead of ways to generate boilerplate automatically. > > Hear, hear. > > Scheme macros are one of the very best ways of writing boilerplate. > Given that, problems that require boilerplate should be turned into > problems on macros+modules, not into boilerplate generators. Consider info.ss. It needs to specify certain information. I've written a lot of PLT Scheme packages but I can never remember what that information is, so I always copy an old info.ss and edit that. It would be useful to have a tool that generates an info.ss for me. Perhaps you think that info.ss is the wrong thing ("things like documentation or reader extension require files with the right name (e.g., "info.ss")") but that information has be given somehow. Maybe the package installation tools search for a module written in the infotab language. The exact mechanism isn't particularly important. The point is there are a bunch of things I don't do often enough to remember how to do them, so it would be nice if I had a tool that did them for me. There are other things, like coding conventions, that could be replaced with code. For example, Untyped code always has a file called base.ss that defines the exception type used by that package when the built-in exceptions aren't appropriate. (See e.g. http://svn.untyped.com/snooze/trunk/src/base.ss or http://svn.untyped.com/dispatch/trunk/src/base.ss) Making a sufficiently configurable #project language (or whatever) to replace all this stuff (there are a number of conventions we use) would be a good project, I think. N. From hendrik at topoi.pooq.com Mon Feb 2 11:33:49 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:39:36 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> Message-ID: <20090202163349.GA30099@topoi.pooq.com> On Mon, Feb 02, 2009 at 09:29:07AM -0700, Matthew Flatt wrote: > At Mon, 2 Feb 2009 15:49:47 +0000, Noel Welsh wrote: > > On Mon, Feb 2, 2009 at 12:31 AM, Grant Rettke wrote: > > > A typical IDE set up might include the notion of a project, a file > > > browser, a module browser, a class browser. > > > > Of these I think the notion of a project is the most important. It > > should include: > > > > - standard directory layout, prepopulated with standard stuff > > - one-click testing, building, build for planet, planet dev. link > > For my part, I've tried to avoid introducing the notion of a "project" > into PLT Scheme tools. > > It isn't because I'm unused to the project concept. My first real > programming experiences were using CodeWarrior on the Mac. I still > (have to) use projects with VisualStudio. And I'm forced to use XCode > sometimes. > > Personal taste aside, the technical problem with projects --- as > usually implemented --- is that they are outside the programming > language. If your project tools are missing some functionality, then > you're either stuck doing things manually or you learn the project > system's ad hoc extension API. > > I've instead pushed the idea that everything should be code organized > into modules. If you want a new programming language, you don't tell > the project manager that it should run some command-line tool on files > that end in ".xqz". Instead, you import the "xqx" language into your > module (perhaps via "#lang xqz"). I'm convinced that this approach is > more systematically extensible and composable. > > That approach is potentially compatible with a notion of projects. I > can imagine a project description that starts "#lang project" and that > does great things. But if there are some "project description" files > sitting around that aren't code, or if doing something with a project > (other than editing it) requires looking at the source of the > description (in some fixed syntax) instead of "running" the project > description, then it will seem to me like the wrong approach. So if there are to be anything like project files, they should be executable PLT Scheme code, just like everything else? On the other hand, separating code into "projects" is useful for revision-management systems and organizing "releases" -- identifying particular subsets of the code as being a particular version of a particular subsystem. Monotone is a system of that sort that I appreciate. It conceptually separates "development", which yields a lot of nonworking code, from "certifying" the code that actually works. This to the extent that you're even encouraged to check in rough drafts of new code so it's available for discussion. But the concept of "project" is within the monotone distributed database, not in the code baing edited on your machine. - hendrik From hendrik at topoi.pooq.com Mon Feb 2 11:51:24 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:39:36 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: <20090202163349.GA30099@topoi.pooq.com> References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> <20090202163349.GA30099@topoi.pooq.com> Message-ID: <20090202165124.GB30099@topoi.pooq.com> On Mon, Feb 02, 2009 at 11:33:49AM -0500, hendrik@topoi.pooq.com wrote: > But the concept of > "project" is within the monotone distributed database, not in the code > baing edited on your machine. In fact, as far as I know, there's nothong stopping having versions of one file being shared betwen projects, even. - hendrik From mflatt at cs.utah.edu Mon Feb 2 12:59:32 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:39:37 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> Message-ID: <20090202175933.3DCEB65008C@mail-svr1.cs.utah.edu> At Mon, 2 Feb 2009 17:27:38 +0000, Noel Welsh wrote: > On Mon, Feb 2, 2009 at 4:59 PM, Shriram Krishnamurthi wrote: > >> Along similar lines, I'm uncomfortable with the idea that a programmer > >> should click a button to create a tree of files and start editing. ... I > >> hope we can find ways to remove directory hierarchies and other > >> boilerplate, instead of ways to generate boilerplate automatically. > > > > Hear, hear. > > > > Scheme macros are one of the very best ways of writing boilerplate. > > Given that, problems that require boilerplate should be turned into > > problems on macros+modules, not into boilerplate generators. > > Consider info.ss. It needs to specify certain information. I've > written a lot of PLT Scheme packages but I can never remember what > that information is, so I always copy an old info.ss and edit that. It > would be useful to have a tool that generates an info.ss for me. > Perhaps you think that info.ss is the wrong thing ("things like > documentation or reader extension require files with the right name > (e.g., "info.ss")") but that information has be given somehow. Maybe > the package installation tools search for a module written in the > infotab language. The exact mechanism isn't particularly important. > The point is there are a bunch of things I don't do often enough to > remember how to do them, so it would be nice if I had a tool that did > them for me. I agree that a GUI facade on "info.ss" would be useful. An extension to DrScheme might detect when an "info.ss" file is being opened (based on the "#lang" line, perhaps) and select the GUI info editing mode. I note that I have no objection to extensions of a programming environment, such as DrScheme, that provide nicer editors. My only objection is when the environment becomes the only reasonable way to act on the code because only the environment understands "projects". > There are other things, like coding conventions, that could be > replaced with code. For example, Untyped code always has a file called > base.ss that defines the exception type used by that package when the > built-in exceptions aren't appropriate. (See e.g. > http://svn.untyped.com/snooze/trunk/src/base.ss or > http://svn.untyped.com/dispatch/trunk/src/base.ss) Making a > sufficiently configurable #project language (or whatever) to replace > all this stuff (there are a number of conventions we use) would be a > good project, I think. In other words, a GUI editor for something like "#lang project" that's analogous to a GUI editor for "#lang setup/infotab" --- agreed! Matthew From samth at ccs.neu.edu Mon Feb 2 13:20:03 2009 From: samth at ccs.neu.edu (Sam TH) Date: Thu Mar 26 02:39:37 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> Message-ID: <63bb19ae0902021020xb21c827h126a87fc0904f3b8@mail.gmail.com> On Mon, Feb 2, 2009 at 11:29 AM, Matthew Flatt wrote: > At Mon, 2 Feb 2009 15:49:47 +0000, Noel Welsh wrote: >> On Mon, Feb 2, 2009 at 12:31 AM, Grant Rettke wrote: >> > A typical IDE set up might include the notion of a project, a file >> > browser, a module browser, a class browser. >> >> Of these I think the notion of a project is the most important. It >> should include: >> >> - standard directory layout, prepopulated with standard stuff >> - one-click testing, building, build for planet, planet dev. link > > For my part, I've tried to avoid introducing the notion of a "project" > into PLT Scheme tools. > > It isn't because I'm unused to the project concept. My first real > programming experiences were using CodeWarrior on the Mac. I still > (have to) use projects with VisualStudio. And I'm forced to use XCode > sometimes. > > Personal taste aside, the technical problem with projects --- as > usually implemented --- is that they are outside the programming > language. If your project tools are missing some functionality, then > you're either stuck doing things manually or you learn the project > system's ad hoc extension API. > > I've instead pushed the idea that everything should be code organized > into modules. If you want a new programming language, you don't tell > the project manager that it should run some command-line tool on files > that end in ".xqz". Instead, you import the "xqx" language into your > module (perhaps via "#lang xqz"). I'm convinced that this approach is > more systematically extensible and composable. > > That approach is potentially compatible with a notion of projects. I > can imagine a project description that starts "#lang project" and that > does great things. But if there are some "project description" files > sitting around that aren't code, or if doing something with a project > (other than editing it) requires looking at the source of the > description (in some fixed syntax) instead of "running" the project > description, then it will seem to me like the wrong approach. When thinking about this, I think it's important to consider the specific functionality that people might want from "projects". One big use-case is project-wide refactoring. For example, right now the ability to rename via check-syntax arrows is limited to a single file, because Check Syntax has no way of knowing about other potential references to the identifier. A "project" that knew the scope of the identifier would be able to find the rest of the references. A second use-case, mentioned by Noel, is project-wide testing. This requires the ability to find a different sort of references: the tests for a particular bit of code (or for the whole system). Similarly for building, where finding the "main module" is the important bit. So, I think the important thing to think about is how can we specify, in our code, the scope that we intend our program to be a part of, and where to find ancillary information like tests or build scripts or main modules or source control repositories. -- sam th samth@ccs.neu.edu From geoff at knauth.org Mon Feb 2 13:35:51 2009 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Thu Mar 26 02:39:37 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: <20090202175933.3DCEB65008C@mail-svr1.cs.utah.edu> References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> <20090202175933.3DCEB65008C@mail-svr1.cs.utah.edu> Message-ID: <1AC83EE4-AA98-40F4-9E6E-CBD2646AECED@knauth.org> On Feb 2, 2009, at 12:59, Matthew Flatt wrote: > My only objection is when the environment becomes the only > reasonable way to act on the code because only the environment > understands "projects". Also, sometimes even mighty Eclipse gets itself hopelessly messed up. I've lost count of the number of times I've had to move an existing workspace aside and start a new one because Eclipse suddenly made a workspace, and all the projects within it, unloadable. From geoff at knauth.org Mon Feb 2 13:40:01 2009 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Thu Mar 26 02:39:37 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: <63bb19ae0902021020xb21c827h126a87fc0904f3b8@mail.gmail.com> References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> <63bb19ae0902021020xb21c827h126a87fc0904f3b8@mail.gmail.com> Message-ID: How old is DrOCaml? I see on PLaneT that version 1.2 "does not seem to work fully with DrScheme 4.x." Would it be worth it to make it work better? From sk at cs.brown.edu Mon Feb 2 13:50:11 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:39:37 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> <63bb19ae0902021020xb21c827h126a87fc0904f3b8@mail.gmail.com> Message-ID: It's 2-3 years old. On Mon, Feb 2, 2009 at 1:40 PM, Geoffrey S. Knauth wrote: > How old is DrOCaml? I see on PLaneT that version 1.2 "does not seem to work > fully with DrScheme 4.x." Would it be worth it to make it work better? > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From dherman at ccs.neu.edu Mon Feb 2 17:34:21 2009 From: dherman at ccs.neu.edu (Dave Herman) Date: Thu Mar 26 02:39:37 2009 Subject: [plt-scheme] ANN: c.plt (C manipulation and FFI utilities) Message-ID: <498774ED.2020609@ccs.neu.edu> I've just posted a new PLaneT package called c.plt: http://planet.plt-scheme.org/package-source/dherman/c.plt/1/0/planet-docs/c/index.html This may be of interest to anyone working with the FFI. You can use it to parse header info and query a system C compiler to get exact data structure sizes and byte offsets for struct fields etc. Example: > (define time.h (make-header #reader (planet dherman/c/reader) { struct tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; }; })) > (define time-abi (compile-header time.h (system-compiler #:include<> '("time.h") gcc))) > (layout-size (time-abi 'tm)) 36 > (layout-offset (time-abi 'tm) 'tm_sec) 0 > (layout-offset (time-abi 'tm) 'tm_year) 20 The first version is available but pretty rough. There's lots of missing functionality. I'm happy to accept requests and bug reports. Dave From adityashukla1983 at gmail.com Mon Feb 2 19:44:30 2009 From: adityashukla1983 at gmail.com (aditya shukla) Date: Thu Mar 26 02:39:38 2009 Subject: [plt-scheme] Passing procedures are parameters. Message-ID: <73045cca0902021644q1407c652vd98aa36d8e885d00@mail.gmail.com> Hello guys , i am new to scheme and still learning to think in the procedural way.I have a question.Is there a way to pass a predicate as a parameter .for example ( every? predicate lst) returns #f if any element of lst fails to satisfy predicate, and returns #t otherwise. > (every? number? '(a b c 3 e)) #f > (every? number? '(1 2 3 5 4)) #t I can use map and check is the elements in the list are numbers .But what if i have to check for any other predicate.I mean can this be generalized. Aditya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090202/53713d00/attachment.htm From jmarshall at alum.mit.edu Mon Feb 2 20:05:48 2009 From: jmarshall at alum.mit.edu (Joe Marshall) Date: Thu Mar 26 02:39:39 2009 Subject: [plt-scheme] Passing procedures are parameters. In-Reply-To: <73045cca0902021644q1407c652vd98aa36d8e885d00@mail.gmail.com> References: <73045cca0902021644q1407c652vd98aa36d8e885d00@mail.gmail.com> Message-ID: On Mon, Feb 2, 2009 at 4:44 PM, aditya shukla wrote: > Hello guys , i am new to scheme and still learning to think in the > procedural way.I have a question.Is there a way to pass a predicate as a > parameter .for example > ( > every? predicate lst) returns #f if any element of lst fails to > satisfy predicate, and returns #t otherwise. > >> (every? number? '(a b c 3 e)) > #f >> (every? number? '(1 2 3 5 4)) > #t > > I can use map and check is the elements in the list are numbers .But what if > i have to check for any other predicate.I mean can this be generalized. You bet. Any predicate with a name, whether you define it yourself or whether it is built in will work. (define my-test (lambda (thing) (and (number? thing) (even? thing) (> thing 12)))) (every? my-test '(1 2 3 5 4)) => #f (every? my-test '(42 88)) => #t In fact, you can even use predicates that *don't* have names but are just a tiny snippet of code: ;; Check if every word is a 4-letter word. (every? (lambda (w) (and (string? w) (= (string-length w) 4))) list-of-words) Rule of thumb for Scheme: If it ought to be generalizable, it is. -- ~jrm From morazanm at gmail.com Mon Feb 2 20:13:28 2009 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:39:39 2009 Subject: [plt-scheme] Passing procedures are parameters. In-Reply-To: <73045cca0902021644q1407c652vd98aa36d8e885d00@mail.gmail.com> References: <73045cca0902021644q1407c652vd98aa36d8e885d00@mail.gmail.com> Message-ID: <9b1fff280902021713t58d61ae2i3b9f23acb9400590@mail.gmail.com> > Hello guys , i am new to scheme and still learning to think in the > procedural way.I have a question.Is there a way to pass a predicate as a > parameter .for example > ( > every? predicate lst) returns #f if any element of lst fails to > satisfy predicate, and returns #t otherwise. > >> (every? number? '(a b c 3 e)) > #f >> (every? number? '(1 2 3 5 4)) > #t > Yes, you can pass as an argument any predicate (whether built-in or user-defined) you wish. It is that simple. :-) > I can use map and check is the elements in the list are numbers .But what if > i have to check for any other predicate.I mean can this be generalized. Careful! map returns a list not a boolean. map is not what you would want to use to define every? . You can, however, use a function similar to map, say andmap, that traverses the list and returns a boolean. -- Cheers, Marco From dvanhorn at ccs.neu.edu Mon Feb 2 20:16:45 2009 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Thu Mar 26 02:39:39 2009 Subject: [plt-scheme] Passing procedures are parameters. In-Reply-To: <73045cca0902021644q1407c652vd98aa36d8e885d00@mail.gmail.com> References: <73045cca0902021644q1407c652vd98aa36d8e885d00@mail.gmail.com> Message-ID: <49879AFD.7060207@ccs.neu.edu> aditya shukla wrote: > Hello guys , i am new to scheme and still learning to think in the > procedural way.I have a question.Is there a way to pass a predicate as > a parameter .for example > ( > every? predicate lst) returns #f if any element of lst fails to > satisfy predicate, and returns #t otherwise. > > > (every? number? '(a b c 3 e)) > #f > > (every? number? '(1 2 3 5 4)) > #t > > I can use map and check is the elements in the list are numbers .But > what if i have to check for any other predicate.I mean can this be > generalized. Start with this program: #lang scheme (require htdp/testing) ;; [Listof Any] -> Boolean ;; Are all the elements in the list numbers? (define (all-number? ls) (cond [(empty? ls) true] [else (and (number? (first ls)) (all-number? (rest ls)))])) (check-expect (all-number? empty) true) (check-expect (all-number? (list 1 2 3)) true) (check-expect (all-number? (list 1 2 true)) false) ;; [Listof Any] -> Boolean ;; Are all the elements in the list booleans? (define (all-boolean? ls) (cond [(empty? ls) true] [else (and (boolean? (first ls)) (all-boolean? (rest ls)))])) (check-expect (all-boolean? empty) true) (check-expect (all-boolean? (list true false true)) true) (check-expect (all-boolean? (list 1 2 true)) false) (generate-report) Look at the definition of all-number? and all-boolean?. Circle what is different between them. Write a new function that has a definition with what is common between all-number? and all-boolean? and for each thing that is different, add a parameter and use that parameter in place of the piece you circled. Now redefine all-number? and all-boolean? in terms of this new function, giving as an argument the thing that was different. Now make sure all your (unchanged) tests pass. This process, which is called Function Abstraction, is spelled-out in more detail in Section 19 of HtDP (htdp.org). It leads naturally to higher-order programs, which is what you will get in this case if you follow the process correctly. David From grettke at acm.org Mon Feb 2 21:43:06 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:39:39 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: <1AC83EE4-AA98-40F4-9E6E-CBD2646AECED@knauth.org> References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> <20090202175933.3DCEB65008C@mail-svr1.cs.utah.edu> <1AC83EE4-AA98-40F4-9E6E-CBD2646AECED@knauth.org> Message-ID: <756daca50902021843p601c2f17hfcd9da60eeea3848@mail.gmail.com> On Mon, Feb 2, 2009 at 12:35 PM, Geoffrey S. Knauth wrote: > Also, sometimes even mighty Eclipse gets itself hopelessly messed up. I've > lost count of the number of times I've had to move an existing workspace > aside and start a new one because Eclipse suddenly made a workspace, and all > the projects within it, unloadable. For those who have not been subject to Eclipse and its ilk, the workspace is where Eclipse stores information about the ide and projects and everything else under the sun. Once it is hosed, you are out of luck! I know what you mean Geoff. Use IntelliJ Idea and find peace. I only mentioned Eclipse because its UI notion of a project is the norm. From grettke at acm.org Mon Feb 2 21:51:46 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:39:39 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> Message-ID: <756daca50902021851l3d931e6dob47cb96898e96dd4@mail.gmail.com> Hi Matthew, On Mon, Feb 2, 2009 at 10:29 AM, Matthew Flatt wrote: > For my part, I've tried to avoid introducing the notion of a "project" > into PLT Scheme tools. > > It isn't because I'm unused to the project concept. My first real > programming experiences were using CodeWarrior on the Mac. I still > (have to) use projects with VisualStudio. And I'm forced to use XCode > sometimes. > > Personal taste aside, the technical problem with projects --- as > usually implemented --- is that they are outside the programming > language. If your project tools are missing some functionality, then > you're either stuck doing things manually or you learn the project > system's ad hoc extension API. I've used an IDE with projects like you mention; Microsoft Visual Studio. In that IDE, there is no notion of building code unless it is associated with a project. I am not interested in that and I don't think it would be a good fit for DrScheme. Here is the use case I experience when I want to work on a project: 1. Start DrScheme. 2. Open the 3-5 files I care about while working the project: a couple modules, the tests, and maybe a scratch file (Stephen's plugin addresses this). 3. Work on some particular functions in files or modules. For me the project notion exists to help me, not the code. I can browse by file or module, and see all of the definitions in a module. ActiveState's Komodo IDE works like this. It works for Ruby and Python and Perl. It just works with files and if it can parse them it shows their functions. From aleks at cs.brown.edu Mon Feb 2 23:58:37 2009 From: aleks at cs.brown.edu (Aleks Bromfield) Date: Thu Mar 26 02:39:39 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> <63bb19ae0902021020xb21c827h126a87fc0904f3b8@mail.gmail.com> Message-ID: <985701c40902022058u5f710e41lcc0d5cde965ff326@mail.gmail.com> The current version of DrOCaml does work with DrScheme 4.x. I apologize for not posting it on PLaneT yet; I haven't gotten around to relearning how to build a PLaneT package. I'll try to get to this soon. In the meantime, I'd be glad to send you a .plt file if you want. There are quite a few things that could be done to improve DrOCaml, especially for someone who's willing to modify the OCaml toplevel source and/or work with EasyOCaml. That said, I don't see this as a particularly high-priority project. DrOCaml is primarily a collection of special cases. I think PLT would benefit much more from infrastructure which could work across multiple languages. On Mon, Feb 2, 2009 at 1:40 PM, Geoffrey S. Knauth wrote: > How old is DrOCaml? I see on PLaneT that version 1.2 "does not seem to work > fully with DrScheme 4.x." Would it be worth it to make it work better? > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From clements at brinckerhoff.org Tue Feb 3 03:05:24 2009 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:39:40 2009 Subject: [plt-scheme] representing environments in Java Message-ID: All right, I've asked what I consider to be the leading local Java expert, and he had no idea: what's the standard idiomatic way to represent environments in Java? More specifically: in order to implement a simple interpreter, you need maps with functional update. I spent about fifteen minutes poking around, and found absolutely no way to use the existing Java standard libraries to achieve this. To the best of my knowledge, the only correct way to do this is by "rolling your own"; in essence, following the first few chapters of HtDC to create a List interface with two concrete subclasses, Cons and MT. This seems like a ludicrous state of affairs: the standard libraries fail to contain any way to represent functional-update lists, despite the fact that such a thing would be about a hundred lines of extra code in a very large standard library. Surely I must be overlooking something obvious? Thanks, John Clements -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2484 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090203/4a2b0d87/smime.bin From lunarc.lists at gmail.com Tue Feb 3 03:12:20 2009 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:39:40 2009 Subject: [plt-scheme] representing environments in Java In-Reply-To: References: Message-ID: 2009/2/3 John Clements : > This seems like a ludicrous state of affairs: the standard libraries fail to > contain any way to represent functional-update lists, despite the fact that > such a thing would be about a hundred lines of extra code in a very large > standard library. Surely I must be overlooking something obvious? You might be able to borrow from Clojure's implementation, which IIRC contains functional-update maps. Henk From jpc-ml at zenburn.net Tue Feb 3 04:17:13 2009 From: jpc-ml at zenburn.net (=?UTF-8?B?SmFrdWIgUGlvdHIgQ8WCYXBh?=) Date: Thu Mar 26 02:39:40 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: <756daca50902021851l3d931e6dob47cb96898e96dd4@mail.gmail.com> References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> <756daca50902021851l3d931e6dob47cb96898e96dd4@mail.gmail.com> Message-ID: <49880B99.5030009@zenburn.net> On 2/3/09 3:51 AM, Grant Rettke wrote: > 1. Start DrScheme. > 2. Open the 3-5 files I care about while working the project: a couple > modules, the tests, and maybe a scratch file (Stephen's plugin > addresses this). > 3. Work on some particular functions in files or modules. > > For me the project notion exists to help me, not the code. I can > browse by file or module, and see all of the definitions in a module. IMHO the concept of a master file could be helpful in DrScheme [1] when running the code. I frequently find myself editing some modules and wanting to test the whole GUI (which means I must manualy switch to the master file). In plain mzscheme I prefer to run from the terminal so it's not a big concern. [1]: Maybe search the current window's tabs for an open #lang project file and check which file is the master. -- regards, Jakub Piotr C?apa From d.j.gurnell at gmail.com Tue Feb 3 04:20:07 2009 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Thu Mar 26 02:39:40 2009 Subject: [plt-scheme] UTF-8 URLs in Dispatch In-Reply-To: <20090131.140554.164884982.maxigas@anargeek.net> References: <20090131.140554.164884982.maxigas@anargeek.net> Message-ID: > hi! > > so thanks also to your help my blog engine is running on http://metatron.sh > and i will implement comments, etc. now. :) > > one problem now is the URLs for Hungarian titles are URLencoded in > the links: > > http://metatron.sh/v/G%C3%B6r%C3%B6gt%C5%B1z (this is the first > entry now on the front page) > > however, if i write http://metatron.sh/v/G?r?gt?z (the proper > UTF-8 way of putting it), it also > works. is it possible to make it that URLs appear in UTF-8 by > default? > > thanks, > > maxigas Hi, That's a great idea. There isn't an option for this in Dispatch yet but it should be relatively simple to implement. It'd have to be a configuration option that you set via a parameter. If you stick a feature request on the PLaneT Trac I'll take a look as soon as I can (Monday at the earliest). Alternatively, if you want to hack on it yourself, the code is available in SVN: svn co http://svn.untyped.com/dispatch/trunk/src dispatch-trunk If you mail me your changes, I'll roll them into the trunk and add you to the contributors list. Cheers, -- Dave From chust at web.de Tue Feb 3 04:25:53 2009 From: chust at web.de (Thomas Chust) Date: Thu Mar 26 02:39:41 2009 Subject: [plt-scheme] representing environments in Java In-Reply-To: References: Message-ID: <49880DA1.3060708@web.de> John Clements wrote: > [...] > This seems like a ludicrous state of affairs: the standard libraries > fail to contain any way to represent functional-update lists, despite > the fact that such a thing would be about a hundred lines of extra code > in a very large standard library. Surely I must be overlooking something > obvious? > [...] Hello, you're not overlooking anything, the Java standard library indeed contains no general purpose immutable, functional update collections of any kind. It is only possible to create unmodifiable views of the standard mutable collection classes through static methods of java.util.Collections. There are a few libraries, though, that provide immutable collections -- for example Functional Java (http://functionaljava.org/) or the runtime libraries of programming languages like Clojure (http://clojure.org/) or Scala (http://www.scala-lang.org/). cu, Thomas -- When C++ is your hammer, every problem looks like your thumb. From robby at eecs.northwestern.edu Tue Feb 3 07:32:25 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Mar 26 02:39:41 2009 Subject: [plt-scheme] representing environments in Java In-Reply-To: References: Message-ID: <932b2f1f0902030432x702095d7xfafa80ce8c354f50@mail.gmail.com> On Tue, Feb 3, 2009 at 2:05 AM, John Clements wrote: > More specifically: in order to implement a simple interpreter, you need maps > with functional update. I spent about fifteen minutes poking around, and > found absolutely no way to use the existing Java standard libraries to > achieve this. To the best of my knowledge, the only correct way to do this > is by "rolling your own"; in essence, following the first few chapters of > HtDC to create a List interface with two concrete subclasses, Cons and MT. You could use a hashmap and the clone method, ie isntead of just calling 'add' call 'clone' and then 'add'. Not sure about performance relative to an assoc, tho. Robby From jensaxel at soegaard.net Tue Feb 3 10:11:32 2009 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:39:41 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: <756daca50902021851l3d931e6dob47cb96898e96dd4@mail.gmail.com> References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> <756daca50902021851l3d931e6dob47cb96898e96dd4@mail.gmail.com> Message-ID: <49885EA4.6090605@soegaard.net> Grant Rettke wrote: > Here is the use case I > experience when I want to work on a project: > > 1. Start DrScheme. > 2. Open the 3-5 files I care about while working the project: a couple > modules, the tests, and maybe a scratch file (Stephen's plugin > addresses this). > 3. Work on some particular functions in files or modules. Most people put the files from the same project in a folder. So it seems to me, that all you need is the option to open more files than one in the "Open File" dialog? /Jens Axel From matthias at ccs.neu.edu Tue Feb 3 10:34:57 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:39:41 2009 Subject: [plt-scheme] representing environments in Java In-Reply-To: <932b2f1f0902030432x702095d7xfafa80ce8c354f50@mail.gmail.com> References: <932b2f1f0902030432x702095d7xfafa80ce8c354f50@mail.gmail.com> Message-ID: <289D683C-A62F-4C84-BC53-B06F382D6C4E@ccs.neu.edu> 0. Specify something for which you can also download a library from one of the recommended sites. 1. Introduce the standard data structures. It's a nice assignment. 2. Make students swap their library with one from a site. 3. Have them then implement an imperative environment, and have theme explain the changes to the API and what it implies and the difficulties. (They are likely to fail, which should create a nice teaching moment.) -- Matthias On Feb 3, 2009, at 7:32 AM, Robby Findler wrote: > On Tue, Feb 3, 2009 at 2:05 AM, John Clements > wrote: >> More specifically: in order to implement a simple interpreter, you >> need maps >> with functional update. I spent about fifteen minutes poking >> around, and >> found absolutely no way to use the existing Java standard >> libraries to >> achieve this. To the best of my knowledge, the only correct way >> to do this >> is by "rolling your own"; in essence, following the first few >> chapters of >> HtDC to create a List interface with two concrete subclasses, Cons >> and MT. > > You could use a hashmap and the clone method, ie isntead of just > calling 'add' call 'clone' and then 'add'. > > Not sure about performance relative to an assoc, tho. > > Robby > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From grettke at acm.org Tue Feb 3 11:01:48 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:39:41 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: <49885EA4.6090605@soegaard.net> References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> <756daca50902021851l3d931e6dob47cb96898e96dd4@mail.gmail.com> <49885EA4.6090605@soegaard.net> Message-ID: <756daca50902030801x9540e6egc8a36732ad7ddd37@mail.gmail.com> Hi Jens, On Tue, Feb 3, 2009 at 9:11 AM, Jens Axel Soegaard wrote: > Grant Rettke wrote: > >> Here is the use case I >> experience when I want to work on a project: >> >> 1. Start DrScheme. >> 2. Open the 3-5 files I care about while working the project: a couple >> modules, the tests, and maybe a scratch file (Stephen's plugin >> addresses this). >> 3. Work on some particular functions in files or modules. > > Most people put the files from the same project in a folder. > So it seems to me, that all you need is the option to open > more files than one in the "Open File" dialog? Yes that is the use case. Every time I want to work on a particular project I start DrScheme, and type C:o 5-7 times, and choose the file that I want to open. They are usually in the same directory. That is how I work on a project. Suppose that I want to work on a different project, I do the same thing; either I close the existing files or have 10-14 files open now, often with similar names "main, tests, scratch". Opening multiple files in the file dialog would address the opening of multiple files; but it wouldn't support the concept of "I am working on a project". Sometimes while working on a project, I want to reference code in some other project. I mean, reference it for my use; not for use in the system. In Komodo, I would add that file to the project. It doesn't affect the code at all. It is there to help me work with my project. Whether the files are in the same directory or not only matters when there are dependencies in the running code; and I am not suggesting that model of project. From matthias at ccs.neu.edu Tue Feb 3 11:38:22 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:39:41 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: <63bb19ae0902021020xb21c827h126a87fc0904f3b8@mail.gmail.com> References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> <63bb19ae0902021020xb21c827h126a87fc0904f3b8@mail.gmail.com> Message-ID: On Feb 2, 2009, at 1:20 PM, Sam TH wrote: > When thinking about this, I think it's important to consider the > specific functionality that people might want from "projects". > > One big use-case is project-wide refactoring. For example, right now > the ability to rename via check-syntax arrows is limited to a single > file, because Check Syntax has no way of knowing about other potential > references to the identifier. A "project" that knew the scope of the > identifier would be able to find the rest of the references. Let's conduct a Gedankenexperiment. You have a project that consists of files A, B, and C. A exports f, which B and C use. You rename f to g, via our fancy lightweight refactoring tool called CheckSyntax. Everything works. Then you return to project 2, which uses files A and D. D uses f from A. Argh, f is gone and the project is broken. (I have considered this before, but I just don't know how to do it properly.) > A second use-case, mentioned by Noel, is project-wide testing. This > requires the ability to find a different sort of references: the tests > for a particular bit of code (or for the whole system). Similarly for > building, where finding the "main module" is the important bit. > > So, I think the important thing to think about is how can we specify, > in our code, the scope that we intend our program to be a part of, and > where to find ancillary information like tests or build scripts or > main modules or source control repositories. This is a better task for project management. -- Matthias From mikeegg1 at me.com Tue Feb 3 12:00:00 2009 From: mikeegg1 at me.com (Mike Eggleston) Date: Thu Mar 26 02:39:42 2009 Subject: [plt-scheme] I'm learning and movie quotes/random thoughts Message-ID: <20090203170000.GF11546@mail.me.com> Morning, Well, I'm learning and making progress on my project. That I'm learning brings to mind the phrase 'tickled pink'. I'm really enjoying the paltry things I'm doing. The movie quote reference is this pleasure brings to mind the quote by the character Profile in the film _Heartbreak Ridge_, (roughly paraphrased) "Gunny Highway is the sickest individual it's been my pleasure to know." I'm having a blast learning again. Mike From geoff at knauth.org Tue Feb 3 12:55:28 2009 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Thu Mar 26 02:39:42 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: <756daca50902021843p601c2f17hfcd9da60eeea3848@mail.gmail.com> References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> <20090202175933.3DCEB65008C@mail-svr1.cs.utah.edu> <1AC83EE4-AA98-40F4-9E6E-CBD2646AECED@knauth.org> <756daca50902021843p601c2f17hfcd9da60eeea3848@mail.gmail.com> Message-ID: <869C86EB-0E68-4D58-99D1-9B0D89E613EF@knauth.org> On Feb 2, 2009, at 21:43, Grant Rettke wrote: > I know what you mean Geoff. Use IntelliJ Idea and find peace. I have and use and like IntelliJ, but at some places I've worked everyone used Eclipse except me and maybe one other person. From robby at eecs.northwestern.edu Tue Feb 3 14:28:13 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Mar 26 02:39:42 2009 Subject: [plt-scheme] Profiling real-time instead of CPU-time (in DrScheme) In-Reply-To: <497E0509.5090702@gmail.com> References: <497E0509.5090702@gmail.com> Message-ID: <932b2f1f0902031128h1e0e2f0ew4231426b0c9b9e6f@mail.gmail.com> It looks like this isn't being collected at the lower level (in the errortrace library). If you were really desperate, the easiest thing would probably to change the way that library works, either augmenting it to collect real time as well as cpu time and the possibly sending in a patch, or just hacking it to so report real times as if they were cpu times. hth, Robby On Mon, Jan 26, 2009 at 12:46 PM, Filipe Cabecinhas wrote: > Hi all, > > Is there a way to profile real-time instead of profiling CPU-time in > DrScheme? I'm using COM (MysterX) and want to figure out what's slowing > me down but if DrScheme only reports CPU-time in the profiling info, I > get algorithms with several seconds of real-time where almost every > function uses 0 msec :-) > > Regards, > > F > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From martindemello at gmail.com Tue Feb 3 14:37:26 2009 From: martindemello at gmail.com (Martin DeMello) Date: Thu Mar 26 02:39:42 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: <756daca50902021851l3d931e6dob47cb96898e96dd4@mail.gmail.com> References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> <756daca50902021851l3d931e6dob47cb96898e96dd4@mail.gmail.com> Message-ID: On Tue, Feb 3, 2009 at 8:21 AM, Grant Rettke wrote: > associated with a project. I am not interested in that and I don't > think it would be a good fit for DrScheme. Here is the use case I > experience when I want to work on a project: > > 1. Start DrScheme. > 2. Open the 3-5 files I care about while working the project: a couple > modules, the tests, and maybe a scratch file (Stephen's plugin > addresses this). > 3. Work on some particular functions in files or modules. That would be useful indeed! I've definitely missed the ability to say "these files are part of a single project, I want to open them all at once" martin From jay.mccarthy at gmail.com Tue Feb 3 17:42:59 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:39:42 2009 Subject: [plt-scheme] Cookies in the PLT Web Server Message-ID: >From http://jay-mccarthy.blogspot.com/2009/02/cookies-in-plt-web-server.html: It has always been possible to use cookies in PLT Web Server applications, but a lot of the work was not done for you. Now it is! The PLT Web Server now provides two modules as part of web-server/http for cookies: web-server/http/cookie [1] for installing cookies and web-server/http/cookie-parse [2] for extracting them. Here's a simple example: #lang web-server/insta (require net/url) (define (start req) (define cookies (request-cookies req)) (define id-cookie (findf (lambda (c) (string=? "id" (client-cookie-name c))) cookies)) (define who (if id-cookie (client-cookie-value id-cookie) #f)) (define new-req (send/suspend (lambda (k-url) `(html (head (title "Hello!")) (body (h1 "Hello " ,(if who who "")) (form ([action ,k-url]) (input ([name "who"])))))))) (define binds (request-bindings/raw new-req)) (match (bindings-assq #"who" binds) [(? binding:form? b) (define new-who (bytes->string/utf-8 (binding:form-value b))) (redirect-to (url->string (request-uri req)) see-other #:headers (list (cookie->header (make-cookie "id" new-who))))] [else (redirect-to (url->string (request-uri req)) see-other)])) This addition is based on code written for the PLaneT server by Jacob Matthews and the existing net/cookie client-side cookie library. 1. http://faculty.cs.byu.edu/~jay/plt-doc/web-server/cookie.html 2. http://faculty.cs.byu.edu/~jay/plt-doc/web-server/cookie-parse.html -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From lunarc.lists at gmail.com Tue Feb 3 18:03:00 2009 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:39:42 2009 Subject: [plt-scheme] Cookies in the PLT Web Server In-Reply-To: References: Message-ID: 2009/2/3 Jay McCarthy : > >From http://jay-mccarthy.blogspot.com/2009/02/cookies-in-plt-web-server.html: > > It has always been possible to use cookies in PLT Web Server > applications, but a lot of the work was not done for you. > > Now it is! That's great! This is a feature I've missed in the past. Henk From cobbe at ccs.neu.edu Tue Feb 3 18:39:51 2009 From: cobbe at ccs.neu.edu (Richard Cobbe) Date: Thu Mar 26 02:39:42 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> <63bb19ae0902021020xb21c827h126a87fc0904f3b8@mail.gmail.com> Message-ID: <20090203233951.GA2787@perdita.local> On Tue, Feb 03, 2009 at 11:38:22AM -0500, Matthias Felleisen wrote: > > Let's conduct a Gedankenexperiment. You have a project that > consists of files A, B, and C. A exports f, which B and C use. > You rename f to g, via our fancy lightweight refactoring tool > called CheckSyntax. Everything works. > > Then you return to project 2, which uses files A and D. D > uses f from A. Argh, f is gone and the project is broken. > > (I have considered this before, but I just don't know how > to do it properly.) I've seen this before, and I don't have a good answer either. But this particular set of dependencies suggests to me that A should not be "in" either project 1 or project 2, but should rather be a library external to both projects. This breaks down, of course, because I haven't yet found a good way to manage these sorts of "external libraries," especially when they're not suitable for Planet submissions, for whatever reason. (Oddly enough, this bites me more with LaTeX .sty files than with Scheme modules. Say what you like about LaTeX as a language---I certainly have---but it's enough of a PL to suffer from exactly this problem.) Another possibility, of course, is that project 1 is a library that project 2 uses. I'm not sure what the right behavior is here. I'd considered having CheckSyntax chase references into client libraries, but I suspect that (aside from the implementation difficulties) this would require a level of project management on the user's part that most would find prohibitive. Alternatively, CheckSyntax could simply refuse to rename identifiers that are part of the library project's public interface, but that gets unnecessarily annoying when the programmer knows quite well what he's doing, thanks, and wants to rename `f' anyway. So I don't really have any ideas here. Richard From plragde at uwaterloo.ca Tue Feb 3 19:01:32 2009 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:39:43 2009 Subject: [plt-scheme] behaviour of void? Message-ID: <4988DADC.6020403@uwaterloo.ca> Code: (define x 2) (void? (set! x 3)) In Advanced Student: produces `false'. In Module (with addition of #lang scheme): produces #t. Why? Thanks. (Not my question. I don't cover `void?', because I don't see much point to it, and I skip over Advanced Student to get to Module. Asked by people teaching the non-major course.) --PR From lunarc.lists at gmail.com Tue Feb 3 20:35:03 2009 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:39:43 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: <20090203233951.GA2787@perdita.local> References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> <63bb19ae0902021020xb21c827h126a87fc0904f3b8@mail.gmail.com> <20090203233951.GA2787@perdita.local> Message-ID: 2009/2/3 Richard Cobbe : > But this particular set of dependencies suggests to me that A should not be > "in" either project 1 or project 2, but should rather be a library external > to both projects. > > This breaks down, of course, because I haven't yet found a good way to > manage these sorts of "external libraries," especially when they're not > suitable for Planet submissions, for whatever reason. Would this be a good situation to use mzscheme's -S option? (I'm not sure if drscheme has an equivalent setting somewhere) Henk From matthias at ccs.neu.edu Tue Feb 3 20:38:45 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:39:43 2009 Subject: [plt-scheme] behaviour of void? In-Reply-To: <4988DADC.6020403@uwaterloo.ca> References: <4988DADC.6020403@uwaterloo.ca> Message-ID: <3C35B536-68FF-42E8-B80D-3DB88D13CEF6@ccs.neu.edu> On Feb 3, 2009, at 7:01 PM, Prabhakar Ragde wrote: > Code: > > (define x 2) > (void? (set! x 3)) > > In Advanced Student: produces `false'. > In Module (with addition of #lang scheme): produces #t. > > Why? Bug. > > Thanks. > > (Not my question. I don't cover `void?', because I don't see much > point to it, and I skip over Advanced Student to get to Module. > Asked by people teaching the non-major course.) --PR Tell them not to use void?. Tell them not to cover chapters VII and VIII. Instead have students work on large projects and spend lectures on iterative refinement and re-doing projects. -- Matthias From robby at eecs.northwestern.edu Tue Feb 3 21:11:08 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Mar 26 02:39:43 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> <63bb19ae0902021020xb21c827h126a87fc0904f3b8@mail.gmail.com> <20090203233951.GA2787@perdita.local> Message-ID: <932b2f1f0902031811l38c7f046pbc0ce28b1f7fc470@mail.gmail.com> On Tue, Feb 3, 2009 at 7:35 PM, Henk Boom wrote: > 2009/2/3 Richard Cobbe : >> But this particular set of dependencies suggests to me that A should not be >> "in" either project 1 or project 2, but should rather be a library external >> to both projects. >> >> This breaks down, of course, because I haven't yet found a good way to >> manage these sorts of "external libraries," especially when they're not >> suitable for Planet submissions, for whatever reason. > > Would this be a good situation to use mzscheme's -S option? (I'm not > sure if drscheme has an equivalent setting somewhere) The module language has a setting for that (using that setting your program gets different collects than drscheme itself, which can be tricky if you're not careful). Or you can set the PLTCOLLECTS environment variable, of course. I don't know that that will help with the problem at hand, tho. Robby From jpc-ml at zenburn.net Tue Feb 3 21:30:20 2009 From: jpc-ml at zenburn.net (=?UTF-8?B?SmFrdWIgUGlvdHIgQ8WCYXBh?=) Date: Thu Mar 26 02:39:43 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: <756daca50902030801x9540e6egc8a36732ad7ddd37@mail.gmail.com> References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> <756daca50902021851l3d931e6dob47cb96898e96dd4@mail.gmail.com> <49885EA4.6090605@soegaard.net> <756daca50902030801x9540e6egc8a36732ad7ddd37@mail.gmail.com> Message-ID: <4988FDBC.4090709@zenburn.net> On 2/3/09 5:01 PM, Grant Rettke wrote: > Yes that is the use case. Every time I want to work on a particular > project I start DrScheme, and type C:o 5-7 times, and choose the file > that I want to open. They are usually in the same directory. That is > how I work on a project. And is there anything fundamentally wrong with using Finder windows (and file associations) as simple project managment tools? AFAIK TextMate is praised for it's simple project system and the only thing it does (that Finder doesn't) is fuzzy file name search (a little like QuickSilver). -- regards, Jakub Piotr C?apa From plragde at uwaterloo.ca Tue Feb 3 21:34:45 2009 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:39:43 2009 Subject: [plt-scheme] behaviour of void? In-Reply-To: <3C35B536-68FF-42E8-B80D-3DB88D13CEF6@ccs.neu.edu> References: <4988DADC.6020403@uwaterloo.ca> <3C35B536-68FF-42E8-B80D-3DB88D13CEF6@ccs.neu.edu> Message-ID: <4988FEC5.6020909@uwaterloo.ca> Matthias Felleisen wrote: > Tell them not to use void?. Tell them not to cover chapters VII and > VIII. Instead have students work on large projects and spend lectures on > iterative refinement and re-doing projects. -- Matthias I'll tell them not to use `void?'. But they're covering some chapter VII and VIII material (not in a lot of detail) for the imminent transition to Python. We're doing the same in the majors course for the transition to C, using a memory model to explain effects. I wasn't going to talk about mutable structures in Scheme at all, but other instructors suggested that it was better to get a little practice in the friendly environment of DrScheme before the cold harsh reality of gcc on the command line... --PR From robby at eecs.northwestern.edu Tue Feb 3 21:41:50 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Mar 26 02:39:43 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: <756daca50902030801x9540e6egc8a36732ad7ddd37@mail.gmail.com> References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> <756daca50902021851l3d931e6dob47cb96898e96dd4@mail.gmail.com> <49885EA4.6090605@soegaard.net> <756daca50902030801x9540e6egc8a36732ad7ddd37@mail.gmail.com> Message-ID: <932b2f1f0902031841t51fca936j485469e39f3bf4c7@mail.gmail.com> On Tue, Feb 3, 2009 at 10:01 AM, Grant Rettke wrote: > Yes that is the use case. Every time I want to work on a particular > project I start DrScheme, and type C:o 5-7 times, and choose the file > that I want to open. They are usually in the same directory. That is > how I work on a project. Not that it addresses the remainder of your complaints, of course, but on the mac you can say "open *.ss" (or similar) in a terminal window and avoid all the clicking. Under windows, you can say "cmd /c foo.ss" for a similar effect. hth, Robby From cobbe at ccs.neu.edu Tue Feb 3 21:48:12 2009 From: cobbe at ccs.neu.edu (Richard Cobbe) Date: Thu Mar 26 02:39:44 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: <932b2f1f0902031811l38c7f046pbc0ce28b1f7fc470@mail.gmail.com> References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> <63bb19ae0902021020xb21c827h126a87fc0904f3b8@mail.gmail.com> <20090203233951.GA2787@perdita.local> <932b2f1f0902031811l38c7f046pbc0ce28b1f7fc470@mail.gmail.com> Message-ID: <20090204024812.GD2787@perdita.local> On Tue, Feb 03, 2009 at 08:11:08PM -0600, Robby Findler wrote: > On Tue, Feb 3, 2009 at 7:35 PM, Henk Boom wrote: > > 2009/2/3 Richard Cobbe : > >> But this particular set of dependencies suggests to me that A should not be > >> "in" either project 1 or project 2, but should rather be a library external > >> to both projects. > >> > >> This breaks down, of course, because I haven't yet found a good way to > >> manage these sorts of "external libraries," especially when they're not > >> suitable for Planet submissions, for whatever reason. > > > > Would this be a good situation to use mzscheme's -S option? (I'm not > > sure if drscheme has an equivalent setting somewhere) > > The module language has a setting for that (using that setting your > program gets different collects than drscheme itself, which can be > tricky if you're not careful). Or you can set the PLTCOLLECTS > environment variable, of course. > > I don't know that that will help with the problem at hand, tho. It doesn't, although one wouldn't know that from my original message. The problem is not so much file management as interface management, although it may be a consequence of my personal development style more than anything else. I'll often find myself hacking along on a project that uses one of these external libraries that I've written myself. If I'm in the zone, and I discover that the library needs a non-backward-compatible change, I don't want to put my original project on hold while I make the change to the library and issue a new "release" (whatever that means). I'm more likely to decide that producing a new major version isn't worth the effort, so I just make the change in-place and break other clients of the library. Alternatively (and this is usually what I do for LaTeX), I just copy the library directly into the project and make the change locally. So existing clients continue to work, but I get lots of copies of the library hanging around, so I have to make bug fixes and improvements in multiple places. (Using my version control's merging capability helps a bit here, but it too is not a perfect solution.) *That's* the problem I don't have a good solution for. I think the right strategy is to make issuing releases and managing multiple versions easier. I have *no* idea how to go about that, though. Planet dev links might help here, at least in the case of PLT Scheme, but I'd like a more general solution. There's no LaTeX equivalent to Planet dev links, for instance. Richard From grettke at acm.org Tue Feb 3 22:35:39 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:39:44 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> <63bb19ae0902021020xb21c827h126a87fc0904f3b8@mail.gmail.com> Message-ID: <756daca50902031935y6c323ea9n2c5eaffdb942f234@mail.gmail.com> On Tue, Feb 3, 2009 at 10:38 AM, Matthias Felleisen wrote: > Let's conduct a Gedankenexperiment. You have a project that > consists of files A, B, and C. A exports f, which B and C use. > You rename f to g, via our fancy lightweight refactoring tool > called CheckSyntax. Everything works. > > Then you return to project 2, which uses files A and D. D > uses f from A. Argh, f is gone and the project is broken. This is what happens when you refactor at the file and not the project level. V1 of the project exports one set of definitions, V2 exports another. From grettke at acm.org Tue Feb 3 23:01:05 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:39:44 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: <4988FDBC.4090709@zenburn.net> References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> <756daca50902021851l3d931e6dob47cb96898e96dd4@mail.gmail.com> <49885EA4.6090605@soegaard.net> <756daca50902030801x9540e6egc8a36732ad7ddd37@mail.gmail.com> <4988FDBC.4090709@zenburn.net> Message-ID: <756daca50902032001j1705bec0gdc76416792140434@mail.gmail.com> On Tue, Feb 3, 2009 at 8:30 PM, Jakub Piotr C?apa wrote: > And is there anything fundamentally wrong with using Finder windows (and > file associations) as simple project managment tools? No. That solves the problem of file management, not project management though. From grettke at acm.org Tue Feb 3 23:05:05 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:39:44 2009 Subject: [plt-scheme] Jane Street Summer Project 2009 In-Reply-To: <932b2f1f0902031841t51fca936j485469e39f3bf4c7@mail.gmail.com> References: <2a8f8da83cd3d40c099dc01a15722066@janestcapital.com> <756daca50902011631r5fd8785clfa030b163e0f0850@mail.gmail.com> <20090202162908.277A16500AD@mail-svr1.cs.utah.edu> <756daca50902021851l3d931e6dob47cb96898e96dd4@mail.gmail.com> <49885EA4.6090605@soegaard.net> <756daca50902030801x9540e6egc8a36732ad7ddd37@mail.gmail.com> <932b2f1f0902031841t51fca936j485469e39f3bf4c7@mail.gmail.com> Message-ID: <756daca50902032005j72882f0bs36cc7fd7e0a18804@mail.gmail.com> On Tue, Feb 3, 2009 at 8:41 PM, Robby Findler wrote: > On Tue, Feb 3, 2009 at 10:01 AM, Grant Rettke wrote: >> Yes that is the use case. Every time I want to work on a particular >> project I start DrScheme, and type C:o 5-7 times, and choose the file >> that I want to open. They are usually in the same directory. That is >> how I work on a project. > > Not that it addresses the remainder of your complaints, It is less complain and more how I like to work on projects. > on the mac you can say "open *.ss" (or similar) in a terminal window > and avoid all the clicking. Under windows, you can say "cmd /c foo.ss" > for a similar effect. Interesting. From grettke at acm.org Tue Feb 3 23:10:34 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:39:44 2009 Subject: [plt-scheme] behaviour of void? In-Reply-To: <3C35B536-68FF-42E8-B80D-3DB88D13CEF6@ccs.neu.edu> References: <4988DADC.6020403@uwaterloo.ca> <3C35B536-68FF-42E8-B80D-3DB88D13CEF6@ccs.neu.edu> Message-ID: <756daca50902032010o5d8d3ff8g8b43d1d881f20bac@mail.gmail.com> On Tue, Feb 3, 2009 at 7:38 PM, Matthias Felleisen wrote: > On Feb 3, 2009, at 7:01 PM, Prabhakar Ragde wrote: >> (Not my question. I don't cover `void?', because I don't see much point to >> it, and I skip over Advanced Student to get to Module. Asked by people >> teaching the non-major course.) --PR > > Tell them not to use void?. Tell them not to cover chapters VII and VIII. > Instead have students work on large projects and spend lectures on iterative > refinement and re-doing projects. -- Matthias Why skip 7 and 8? From grettke at acm.org Tue Feb 3 23:13:15 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:39:44 2009 Subject: [plt-scheme] Cookies in the PLT Web Server In-Reply-To: References: Message-ID: <756daca50902032013r49bb5225r465a2e0ac0bb7f78@mail.gmail.com> On Tue, Feb 3, 2009 at 4:42 PM, Jay McCarthy wrote: > >From http://jay-mccarthy.blogspot.com/2009/02/cookies-in-plt-web-server.html: > > It has always been possible to use cookies in PLT Web Server > applications, but a lot of the work was not done for you. That is great. The web server is probably a good candidate for spreading the use of functional languages in the JSSP. From vijay.the.schemer at gmail.com Wed Feb 4 08:04:51 2009 From: vijay.the.schemer at gmail.com (Vijay Mathew) Date: Thu Mar 26 02:39:45 2009 Subject: [plt-scheme] Exiting the current context Message-ID: <9c57dec20902040504v3942f490m9869a220e6e46afe@mail.gmail.com> Hi all, I am not sure if the term "current context" is what it should be. Anyway, here is what I like to accomplish: (define (suspend func) (call/cc (lambda (k) (save-k) (func) (exit-current-context)))) (define (run) (suspend my-func) ;; (run) should return here, as a result of (exit-current-context) ;; When continuation saved by (suspend) is invoked, (run) should resume at (do-something). (do-something)) How can I implement (exit-current-context)?? Thanks in advance, -- Vijay -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090204/d6d7df4b/attachment.htm From jay.mccarthy at gmail.com Wed Feb 4 08:11:23 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:39:45 2009 Subject: [plt-scheme] Exiting the current context In-Reply-To: <9c57dec20902040504v3942f490m9869a220e6e46afe@mail.gmail.com> References: <9c57dec20902040504v3942f490m9869a220e6e46afe@mail.gmail.com> Message-ID: Try abort-current-continuation http://docs.plt-scheme.org/reference/cont.html#(def._((quote._~23~25kernel)._abort-current-continuation)) Jay On Wed, Feb 4, 2009 at 6:04 AM, Vijay Mathew wrote: > Hi all, > > I am not sure if the term "current context" is what it should be. Anyway, > here is what I like to accomplish: > > (define (suspend func) > (call/cc > (lambda (k) > (save-k) > (func) > (exit-current-context)))) > > (define (run) > (suspend my-func) ;; (run) should return here, as a result of > (exit-current-context) > ;; When continuation saved by (suspend) is invoked, (run) should resume > at (do-something). > (do-something)) > > How can I implement (exit-current-context)?? > > Thanks in advance, > > -- Vijay > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From matthias at ccs.neu.edu Wed Feb 4 08:44:02 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:39:45 2009 Subject: [plt-scheme] behaviour of void? In-Reply-To: <756daca50902032010o5d8d3ff8g8b43d1d881f20bac@mail.gmail.com> References: <4988DADC.6020403@uwaterloo.ca> <3C35B536-68FF-42E8-B80D-3DB88D13CEF6@ccs.neu.edu> <756daca50902032010o5d8d3ff8g8b43d1d881f20bac@mail.gmail.com> Message-ID: <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> On Feb 3, 2009, at 11:10 PM, Grant Rettke wrote: > On Tue, Feb 3, 2009 at 7:38 PM, Matthias Felleisen > wrote: >> On Feb 3, 2009, at 7:01 PM, Prabhakar Ragde wrote: >>> (Not my question. I don't cover `void?', because I don't see much >>> point to >>> it, and I skip over Advanced Student to get to Module. Asked by >>> people >>> teaching the non-major course.) --PR >> >> Tell them not to use void?. Tell them not to cover chapters VII >> and VIII. >> Instead have students work on large projects and spend lectures on >> iterative >> refinement and re-doing projects. -- Matthias > > Why skip 7 and 8? It's a trade-off. Students are better off working through two or three "large" projects (say an interactive, distributed game): -- first with plain recursive programs -- second based on feedback for the first program -- third with higher-order functions -- fourth using modules to structure the program This kind of iteration is highly instructive in comparison to a rushed treatise on effects. -- Matthias From robby at eecs.northwestern.edu Wed Feb 4 08:55:46 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Mar 26 02:39:46 2009 Subject: [plt-scheme] behaviour of void? In-Reply-To: <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> References: <4988DADC.6020403@uwaterloo.ca> <3C35B536-68FF-42E8-B80D-3DB88D13CEF6@ccs.neu.edu> <756daca50902032010o5d8d3ff8g8b43d1d881f20bac@mail.gmail.com> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> Message-ID: <932b2f1f0902040555y743b255n54ed92a378487a15@mail.gmail.com> On 2/4/09, Matthias Felleisen wrote: > > On Feb 3, 2009, at 11:10 PM, Grant Rettke wrote: > >> On Tue, Feb 3, 2009 at 7:38 PM, Matthias Felleisen >> wrote: >>> On Feb 3, 2009, at 7:01 PM, Prabhakar Ragde wrote: >>>> (Not my question. I don't cover `void?', because I don't see much >>>> point to >>>> it, and I skip over Advanced Student to get to Module. Asked by >>>> people >>>> teaching the non-major course.) --PR >>> >>> Tell them not to use void?. Tell them not to cover chapters VII >>> and VIII. >>> Instead have students work on large projects and spend lectures on >>> iterative >>> refinement and re-doing projects. -- Matthias >> >> Why skip 7 and 8? > > > It's a trade-off. Students are better off working through two or three > "large" projects (say an interactive, distributed game): > -- first with plain recursive programs > -- second based on feedback for the first program > -- third with higher-order functions > -- fourth using modules to structure the program > This kind of iteration is highly instructive in comparison to a rushed > treatise on effects. Also, many of them don't realize what they are capable of at that stage. It can be a real eye-opener (for them). Robby From noelwelsh at gmail.com Wed Feb 4 11:58:51 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:39:46 2009 Subject: [plt-scheme] Hit People Over the Head with HtDP and martial arts!?? In-Reply-To: <200901202154.n0KLs0jN015492@mail02.syd.optusnet.com.au> References: <200901202154.n0KLs0jN015492@mail02.syd.optusnet.com.au> Message-ID: I don't practice any martial art but I do train a similar sport. I think all sports have an aspect of craft -- improving existing techniques or learning new ones -- which programming also has. Think of learning about, say, macros for the first time (learning new technique) or improving your current programming workflow (existing technique). Good programmers pay conscious attention to their craft, and to improving it. You might find "code katas" interesting. N. On Tue, Jan 20, 2009 at 9:54 PM, wrote: > Michael Forster wrote: >> Funny word that, "experience." My late Judo teacher used to talk > [snip] > > Interesting that this "hit them over the head" metaphor has brought out a Judo reference! > > Are there any other martial arts aficionados (past- or present-) Judo or otherwise out there? > > My confession / plug: http://maaml.blogspot.com > > -- Dan From jay.mccarthy at gmail.com Wed Feb 4 14:06:01 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:39:46 2009 Subject: [plt-scheme] Digest Authentication in the PLT Scheme Web Server Message-ID: >From http://jay-mccarthy.blogspot.com/2009/02/digest-authentication-in-plt-scheme-web.html: The PLT Scheme Web Server now has built-in support for Digest Authentication. It is provided by the web-server/http/digest-auth module (and through the web-server/http wrapper that is included in all servlets.) Here's an example: #lang web-server/insta (require scheme/pretty) (define private-key "private-key") (define opaque "opaque") (define (start req) (match (request->digest-credentials req) [#f (make-response/basic 401 #"Unauthorized" (current-seconds) TEXT/HTML-MIME-TYPE (list (make-digest-auth-header (format "Digest Auth Test: ~a" (gensym)) private-key opaque)))] [alist (define check (make-check-digest-credentials (password->digest-HA1 (lambda (username realm) "pass")))) (define pass? (check "GET" alist)) `(html (head (title "Digest Auth Test")) (body (h1 ,(if pass? "Pass!" "No Pass!")) (pre ,(pretty-format alist))))])) Documentation at: http://faculty.cs.byu.edu/~jay/plt-doc/web-server/digest-auth_ss.html And at http://docs.plt-scheme.org/web-server/digest-auth_ss.html after tonight. -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From cce at ccs.neu.edu Wed Feb 4 14:12:20 2009 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:39:47 2009 Subject: [plt-scheme] Dracula 8.0 release Message-ID: <990e0c030902041112k669c1ecayeff0cd308825bc0a@mail.gmail.com> I have just released Dracula 8.0. This is a bug-fix release. Only the Modular ACL2 language level is affected. If you are new to Dracula (the ACL2 interface for the DrScheme programming environment), you can find installation instructions and more information at: http://www.ccs.neu.edu/home/cce/acl2/ Regarding the bug fixed in version 8.0: The Modular ACL2 language level adds metadata to the top of saved files so DrScheme will recognize them as Modular ACL2 programs when loaded in the future. Previously, the metadata looked like this: ;; The first four lines of this file were added by Dracula. ;; They tell DrScheme that this is a Dracula Modular ACL2 program. ;; Leave these lines unchanged so that DrScheme can properly load this file. #reader(planet "reader.ss" ("cce" "dracula.plt" 7 1) "modular" "lang") Unfortunately, the fact that this encoded version 7.1 of Dracula meant it was neither forward- nor backward-compatible. Dracula 7.1 would not recognize Modular ACL2 files from 7.0, nor vice versa. Dracula 8.0 removes the version number from this metadata: ;; The first four lines of this file were added by Dracula. ;; They tell DrScheme that this is a Dracula Modular ACL2 program. ;; Leave these lines unchanged so that DrScheme can properly load this file. #reader(planet "reader.ss" ("cce" "dracula.plt") "modular" "lang") If you load an older Modular ACL2 file in Dracula 8.0, it may open in a different language level and it will show the metadata rather than hide it. You can delete the metadata, switch to the Modular ACL2 language level, and save the file. This will fix the metadata, and the file will then load in the Modular ACL2 language level with the metadata hidden in Dracula 8.0 and future releases. -- Carl Eastlund From morazanm at gmail.com Wed Feb 4 22:51:49 2009 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:39:47 2009 Subject: [plt-scheme] behaviour of void? In-Reply-To: <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> References: <4988DADC.6020403@uwaterloo.ca> <3C35B536-68FF-42E8-B80D-3DB88D13CEF6@ccs.neu.edu> <756daca50902032010o5d8d3ff8g8b43d1d881f20bac@mail.gmail.com> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> Message-ID: <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> > It's a trade-off. Students are better off working through two or three > "large" projects (say an interactive, distributed game): > -- first with plain recursive programs > -- second based on feedback for the first program > -- third with higher-order functions > -- fourth using modules to structure the program > This kind of iteration is highly instructive in comparison to a rushed > treatise on effects. It's a tough trade-off! :-) One, however, that I am delighted to indulge in.....finally ridding ourselves of making mention of assignment in a first course! It's about time. Hooray! :-) Why tough? Students that come with "experience" (from a HS CS course) want to cover mutation and "see" why writing programs using mutation is so much harder. Just telling them to go write binary-search or find-route-in-graph using assignment does not quite satisfy them (not that most of them really can). I am also currently seeing my "experienced" students yearning for assignment (e.g. "in Java I would just set this variable equal to that") as programs move away from the trivial domain. They just do not realize how much they would be complicating their lives (nor how terribly bug-ridden their assignment-based ideas have been up to now). In any case, can anyone share any specific ideas for a "large" project that worked well in your courses? -- Cheers, Marco From robby at eecs.northwestern.edu Wed Feb 4 23:06:20 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Mar 26 02:39:47 2009 Subject: [plt-scheme] behaviour of void? In-Reply-To: <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> References: <4988DADC.6020403@uwaterloo.ca> <3C35B536-68FF-42E8-B80D-3DB88D13CEF6@ccs.neu.edu> <756daca50902032010o5d8d3ff8g8b43d1d881f20bac@mail.gmail.com> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> Message-ID: <932b2f1f0902042006u6a801b09ub543d81781f4cd3b@mail.gmail.com> There are a number of projects here that I used below with varying degrees of success. Probably the snake game is the best of the lot (which I got from Matthias). If any one looks good, feel free to ask me how they went. projects: http://www.ece.northwestern.edu/~robby/uc-courses/15100-2008-fall/ projects: http://www.ece.northwestern.edu/~robby/uc-courses/15100-2007-fall/ lab 7 & 8 here: http://people.cs.uchicago.edu/~jacobm/15100-2006-fall/ and this: http://www.ece.northwestern.edu/~robby/uc-courses/15100-2006-fall/lab6/ Robby On Wed, Feb 4, 2009 at 9:51 PM, Marco Morazan wrote: >> It's a trade-off. Students are better off working through two or three >> "large" projects (say an interactive, distributed game): >> -- first with plain recursive programs >> -- second based on feedback for the first program >> -- third with higher-order functions >> -- fourth using modules to structure the program >> This kind of iteration is highly instructive in comparison to a rushed >> treatise on effects. > > It's a tough trade-off! :-) One, however, that I am delighted to > indulge in.....finally ridding ourselves of making mention of > assignment in a first course! It's about time. Hooray! :-) > > Why tough? Students that come with "experience" (from a HS CS course) > want to cover mutation and "see" why writing programs using mutation > is so much harder. Just telling them to go write binary-search or > find-route-in-graph using assignment does not quite satisfy them (not > that most of them really can). I am also currently seeing my > "experienced" students yearning for assignment (e.g. "in Java I would > just set this variable equal to that") as programs move away from the > trivial domain. They just do not realize how much they would be > complicating their lives (nor how terribly bug-ridden their > assignment-based ideas have been up to now). > > In any case, can anyone share any specific ideas for a "large" project > that worked well in your courses? > > -- > > Cheers, > > Marco > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From matthias at ccs.neu.edu Thu Feb 5 09:30:46 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:39:47 2009 Subject: [plt-scheme] behaviour of void? In-Reply-To: <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> References: <4988DADC.6020403@uwaterloo.ca> <3C35B536-68FF-42E8-B80D-3DB88D13CEF6@ccs.neu.edu> <756daca50902032010o5d8d3ff8g8b43d1d881f20bac@mail.gmail.com> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> Message-ID: <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> On Feb 4, 2009, at 10:51 PM, Marco Morazan wrote: >> In any case, can anyone share any specific ideas for a "large" >> project > that worked well in your courses? (Wrong mailing list probably, but here we go) Freshman games only: single machine games: -- 'space war' (neu) -- 'airplane fire fighting' (wpi) -- 'worm' (neu) -- 'little tetris' (neu) distributed games: -- 'hangman' (neu) -- 'chat noir' (chicago) All of them can be done as described: -- plain recursive functions (lists + structs) -- revise to criticism -- higher-order function revision (looks like applicative class- based programming, if done properly) -- state-based revisions (looks like imperative class-based programming, if done properly) You can, if you so wish, re-assign the same problem in Java in the second semester. It is an eye-popping experience for most of them to see the DR work out perfectly for a Java-based world. -- Matthias From mhcoen at gmail.com Wed Feb 4 18:00:50 2009 From: mhcoen at gmail.com (Michael H. Coen) Date: Thu Mar 26 02:39:47 2009 Subject: [plt-scheme] AI Algorithms in PLT-Scheme Message-ID: <80868ae3-5725-4565-9d1c-a378b908f32b@g3g2000pre.googlegroups.com> Howdy folks, I'm teaching the Introduction to AI course at UW-Madison this term. Given my nostalgia for SICP and the passing of 6.001, I decided to introduce Scheme and functional programming into the curriculum. Reaction has been very positive among the students. As GJS says, there is no need to teach Scheme; it teaches itself. Thus, I'm avoiding the libraries as much as is practical and taking a traditional SICP minimalist approach; namely, if you want it, write it yourself. Now, to be a hypocrite: I'm surprised there isn't more didactic software available for classroom use. For example, it's easy to find ID3 code for every language from Haskell to Lisp, but alas, no Scheme version? Of course, it's not hard to write, but I'm a bit surprised there isn't an AI code repository. Perhaps I'm not finding it? Yes, I can write whatever I need, but at some point, it becomes something of a timesink. It'd also be nifty if some of these algorithms had whizzbang graphical output, which adds to the implementation time. (Students like eye candy.) So, if I'm missing something obvious, please do let me know. And as I'm a recent convert from MIT Scheme -- I just couldn't fathom forcing the students to learn Edwin -- be gentle with the PLT-noob. In addition to replying here, please email me any responses to mhcoen &at& cs.wisc.edu, as this list gets a bit more traffic than I can keep up with. Best, Michael Coen From hkBst at gentoo.org Wed Feb 4 17:46:23 2009 From: hkBst at gentoo.org (Marijn Schouten (hkBst)) Date: Thu Mar 26 02:39:47 2009 Subject: [plt-scheme] Re: [Swig-devel] ANNOUNCE - swig-1.3.38 In-Reply-To: <4989FEE3.7020506@fultondesigns.co.uk> References: <4984EC4B.2030806@fultondesigns.co.uk> <498721D6.10509@gentoo.org> <4989FEE3.7020506@fultondesigns.co.uk> Message-ID: <498A1ABF.30401@gentoo.org> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 William S Fulton wrote: > Marijn Schouten (hkBst) wrote: >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> William S Fulton wrote: >>> *** ANNOUNCE: SWIG 1.3.38 (31 January 2009) *** >>> >>> http://www.swig.org >>> >>> >>> We're pleased to announce SWIG-1.3.38, the latest installment in the >>> SWIG development effort. SWIG-1.3.38 includes a number of bug fixes >>> and enhancements. >> >> I had a problem building swig-1.3.38: >> >> >> checking for gzdopen in -lz... yes >> >> configure: creating ./config.status >> >> config.status: creating Makefile >> >> config.status: creating config.h >> >> make -j2 >> >> test -z "1" || (cd CCache && make) >> >> make[1]: Entering directory >> `/var/tmp/portage/dev-lang/swig-1.3.38/work/swig-1.3.38/CCache' >> >> x86_64-pc-linux-gnu-gcc -march=core2 -O2 -pipe -Wall -W -I. -c -o >> ccache.o >> ccache.c >> make[1]: Entering directory >> `/var/tmp/portage/dev-lang/swig-1.3.38/work/swig-1.3.38/Source' >> >> Makefile:191: *** missing separator. Stop. >> >> make[1]: Leaving directory >> `/var/tmp/portage/dev-lang/swig-1.3.38/work/swig-1.3.38/Source' >> >> make: *** [source] Error 2 >> >> make: *** Waiting for unfinished jobs.... >> >> >> I figure the solution is: >> >> >> - --- Makefile.in.old 2009-02-02 17:29:13.000000000 +0100 >> >> +++ Makefile.in 2009-02-02 17:29:13.000000000 +0100 >> >> @@ -187,7 +187,7 @@ >> >> @echo $(ACTION)ing Examples/GIFPlot/Lib >> >> @cd Examples/GIFPlot/Lib && $(MAKE) -k -s $(ACTION) >> >> >> >> - -check-gifplot: \ >> >> +check-gifplot: >> >> check-tcl-gifplot \ >> >> check-perl5-gifplot \ >> >> check-python-gifplot \ >> >> >> >> but I cannot test that because when I tried to run autoconf I got: >> >> >> configure.in:31: error: possibly undefined macro: AC_COMPILE_WARNINGS >> If this token and others are legitimate, please use >> m4_pattern_allow. >> See the Autoconf documentation. >> configure.in:1461: error: possibly undefined macro: AC_COMPARE_VERSION >> configure.in:2138: error: possibly undefined macro: AC_DEFINE_DIR >> >> >> I'm using autoconf-2.63. > Are you using GNU make? Perhaps you've got GNU make, but something later > than 3.81? I use autoconf-2.61 which works great. Rather than running > autoreconf, please run ./autogen.sh. Alternatively, modify just the > Makefile, then you won't need to rerun configure. But essentially your > modification won't work and I can't see what your problem is if you are > using GNU make... try running without -j2 as there might be a parallel > problem, although I regularly do parallel builds. > > William Yes, I'm using GNU make 3.81 too. I succeeded running ./autogen.sh and indeed my patch fixes nothing. Turning off parallel building didn't help either. Actually looking better at the error I notice that I was looking at the wrong Makefile altogether. The offending one is the one in Source. A small snippet of that file: MKDIR_P = /bin/mkdir -p MZC = /usr/bin/mzc MZDYNOBJ = /usr/bin/mzscheme: bad switch: --mute-banner Use the --help or -h flag for help. MZSCHEME = /usr/bin/mzscheme MZSCHEME_SO = .so Line 191 starts with "Use the". It seems like it is an artefact of broken support for mzscheme which was reported for 1.3.36 already (http://sourceforge.net/tracker/?func=detail&atid=301645&aid=2081967&group_id=1645). I was able to compile by using --without-mzscheme. Quote from PLT Scheme developer Eli Barzilay: "[wo sep 3 2008] [12:53:14] The swig mz interface genarates a C file where it could generate a scheme file instead." Thanks, Marijn - -- Marijn Schouten (hkBst), Gentoo Lisp project, Gentoo ML , #gentoo-{lisp,ml} on FreeNode -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkmKGr4ACgkQp/VmCx0OL2yrJACeJ2V91rXaGc5y6AF1Nd2JVptw kNwAn3jmJuh7PjSg6yqcQeYJnXVpRG+w =otvY -----END PGP SIGNATURE----- From matthias at ccs.neu.edu Thu Feb 5 10:23:49 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:39:48 2009 Subject: [plt-scheme] AI Algorithms in PLT-Scheme In-Reply-To: <80868ae3-5725-4565-9d1c-a378b908f32b@g3g2000pre.googlegroups.com> References: <80868ae3-5725-4565-9d1c-a378b908f32b@g3g2000pre.googlegroups.com> Message-ID: <6B12138F-E8DC-4100-B455-2E96313F32F6@ccs.neu.edu> Michael, great idea to use the AI course to retain some of the Scheme spirit in the world that MIT created. I am not sure why audio files are of particular interest to AI so here is a general remark: Why don't you consider your AI course from the long-term perspective? Have your students design and develop libraries that you may wish to reuse in future editions of the class and upload them to the PLANET repository? That would (1) be a contribution to PLT and PLANET (2) turn your course into something your students might like even more (a contribution to an "open source" project, list on their CVs and get credit) (3) attract more students to your course in the future (4) help you teach it from a higher-level perspective. Just some thoughts. Sorry nothing concrete, because I too believe in building in if it doesn't exist -- Matthias On Feb 4, 2009, at 6:00 PM, Michael H. Coen wrote: > Howdy folks, > > I'm teaching the Introduction to AI course at UW-Madison this term. > Given my nostalgia for SICP and the passing of 6.001, I decided to > introduce Scheme and functional programming into the curriculum. > Reaction has been very positive among the students. As GJS says, > there is no need to teach Scheme; it teaches itself. Thus, I'm > avoiding the libraries as much as is practical and taking a > traditional SICP minimalist approach; namely, if you want it, write it > yourself. > > Now, to be a hypocrite: I'm surprised there isn't more didactic > software available for classroom use. For example, it's easy to find > ID3 code for every language from Haskell to Lisp, but alas, no Scheme > version? Of course, it's not hard to write, but I'm a bit surprised > there isn't an AI code repository. Perhaps I'm not finding it? Yes, > I can write whatever I need, but at some point, it becomes something > of a timesink. It'd also be nifty if some of these algorithms had > whizzbang graphical output, which adds to the implementation time. > (Students like eye candy.) > > So, if I'm missing something obvious, please do let me know. And as > I'm a recent convert from MIT Scheme -- I just couldn't fathom forcing > the students to learn Edwin -- be gentle with the PLT-noob. > > In addition to replying here, please email me any responses to mhcoen > &at& cs.wisc.edu, as this list gets a bit more traffic than I can keep > up with. > > Best, > Michael Coen > > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From dvanhorn at ccs.neu.edu Thu Feb 5 10:31:16 2009 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Thu Mar 26 02:39:48 2009 Subject: [plt-scheme] AI Algorithms in PLT-Scheme In-Reply-To: <6B12138F-E8DC-4100-B455-2E96313F32F6@ccs.neu.edu> References: <80868ae3-5725-4565-9d1c-a378b908f32b@g3g2000pre.googlegroups.com> <6B12138F-E8DC-4100-B455-2E96313F32F6@ccs.neu.edu> Message-ID: <498B0644.6090903@ccs.neu.edu> Matthias Felleisen wrote: > > Michael, great idea to use the AI course to retain some of > the Scheme spirit in the world that MIT created. > > I am not sure why audio files are of particular interest > to AI so here is a general remark: Michael is probably referring to the Iterative Dichotomiser 3 algorithm, not the MP3 metadata file format. http://en.wikipedia.org/wiki/ID3_algorithm David From matthias at ccs.neu.edu Thu Feb 5 10:55:20 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:39:48 2009 Subject: [plt-scheme] AI Algorithms in PLT-Scheme In-Reply-To: <498B0644.6090903@ccs.neu.edu> References: <80868ae3-5725-4565-9d1c-a378b908f32b@g3g2000pre.googlegroups.com> <6B12138F-E8DC-4100-B455-2E96313F32F6@ccs.neu.edu> <498B0644.6090903@ccs.neu.edu> Message-ID: <9244E612-BAAB-4DCE-B7B3-475DC92D8F98@ccs.neu.edu> Thanks! This restores my sanity (as someone who got into PL through AI). The rest of my comments stand, regardless -- Matthias On Feb 5, 2009, at 10:31 AM, David Van Horn wrote: > Matthias Felleisen wrote: >> Michael, great idea to use the AI course to retain some of >> the Scheme spirit in the world that MIT created. >> I am not sure why audio files are of particular interest >> to AI so here is a general remark: > > Michael is probably referring to the Iterative Dichotomiser 3 > algorithm, not the MP3 metadata file format. > > http://en.wikipedia.org/wiki/ID3_algorithm > > David > From noelwelsh at gmail.com Thu Feb 5 10:56:38 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:39:48 2009 Subject: [plt-scheme] AI Algorithms in PLT-Scheme In-Reply-To: <80868ae3-5725-4565-9d1c-a378b908f32b@g3g2000pre.googlegroups.com> References: <80868ae3-5725-4565-9d1c-a378b908f32b@g3g2000pre.googlegroups.com> Message-ID: I don't know of much released AI code. There is the Science collection on Planet (http://planet.plt-scheme.org) on which said code can be built (assuming you tend more towards statistical AI / machine learning than symbolic AI). There are several AI researchers on this list (including myself) who have code that might be useful to you, though I expect much of it is too advanced and too hastily written to be appropriate for the classroom. I have code for the following: - beta process - Dirichlet process - variational HMM - generic POMDP - basic HMM stuff (forward-backward alg. etc.) That's in rough order of when I last touched it, and hence how easy it would be to get running in recent PLT Scheme. N. On Wed, Feb 4, 2009 at 11:00 PM, Michael H. Coen wrote: > Howdy folks, > > I'm teaching the Introduction to AI course at UW-Madison this term. ... > I'm a bit surprised there isn't an AI code repository. Perhaps I'm not finding it? From anh at cs.rit.edu Thu Feb 5 14:01:02 2009 From: anh at cs.rit.edu (Arthur Nunes-Harwit) Date: Thu Mar 26 02:39:48 2009 Subject: [plt-scheme] behaviour of void? In-Reply-To: <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> References: <4988DADC.6020403@uwaterloo.ca> <3C35B536-68FF-42E8-B80D-3DB88D13CEF6@ccs.neu.edu> <756daca50902032010o5d8d3ff8g8b43d1d881f20bac@mail.gmail.com> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> Message-ID: Hi, I see a lot of projects that are video games. Such projects ultimately rely input and output, or side effects (perhaps disguised via monads). The coding style for much of HtDP is purely functional. What is the pedagogical impact? Do the students notice? (As a student, I didn't notice right away that read was different from square.) Is there any discussion of "special" functions or objects? What is the impact of other languages such as Java where the assumption [built into the language libraries] is that everything is done using side effects? To what extent is it still possible to take a mostly functional approach? Thanks. -Arthur >>> In any case, can anyone share any specific ideas for a "large" project >> that worked well in your courses? > > (Wrong mailing list probably, but here we go) > > Freshman games only: > single machine games: > -- 'space war' (neu) > -- 'airplane fire fighting' (wpi) > -- 'worm' (neu) > -- 'little tetris' (neu) > distributed games: > -- 'hangman' (neu) > -- 'chat noir' (chicago) > > All of them can be done as described: > -- plain recursive functions (lists + structs) > -- revise to criticism > -- higher-order function revision (looks like applicative class-based > programming, if done properly) > -- state-based revisions (looks like imperative class-based programming, if > done properly) > > You can, if you so wish, re-assign the same problem in Java in the second > semester. It is an eye-popping experience for most of them to see the DR work > out perfectly for a Java-based world. > > -- Matthias > > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From sk at cs.brown.edu Thu Feb 5 14:06:21 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:39:48 2009 Subject: [plt-scheme] behaviour of void? In-Reply-To: References: <4988DADC.6020403@uwaterloo.ca> <3C35B536-68FF-42E8-B80D-3DB88D13CEF6@ccs.neu.edu> <756daca50902032010o5d8d3ff8g8b43d1d881f20bac@mail.gmail.com> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> Message-ID: The "world" style is purely functional. See http://world.cs.brown.edu/ for some examples (including "videos" of the actual games). On Thu, Feb 5, 2009 at 2:01 PM, Arthur Nunes-Harwit wrote: > Hi, > > I see a lot of projects that are video games. Such projects ultimately rely > input and output, or side effects (perhaps disguised via monads). The coding > style for much of HtDP is purely functional. What is the pedagogical > impact? Do the students notice? (As a student, I didn't notice right away > that read was different from square.) Is there any discussion of "special" > functions or objects? > > What is the impact of other languages such as Java where the assumption > [built into the language libraries] is that everything is done using side > effects? To what extent is it still possible to take a mostly functional > approach? > > Thanks. > > -Arthur > >>>> In any case, can anyone share any specific ideas for a "large" project >>> >>> that worked well in your courses? >> >> (Wrong mailing list probably, but here we go) >> >> Freshman games only: >> single machine games: >> -- 'space war' (neu) >> -- 'airplane fire fighting' (wpi) >> -- 'worm' (neu) >> -- 'little tetris' (neu) >> distributed games: >> -- 'hangman' (neu) >> -- 'chat noir' (chicago) >> >> All of them can be done as described: >> -- plain recursive functions (lists + structs) >> -- revise to criticism >> -- higher-order function revision (looks like applicative class-based >> programming, if done properly) >> -- state-based revisions (looks like imperative class-based programming, >> if done properly) >> >> You can, if you so wish, re-assign the same problem in Java in the second >> semester. It is an eye-popping experience for most of them to see the DR >> work out perfectly for a Java-based world. >> >> -- Matthias >> >> >> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From matthias at ccs.neu.edu Thu Feb 5 14:09:57 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:39:49 2009 Subject: [plt-scheme] behaviour of void? In-Reply-To: References: <4988DADC.6020403@uwaterloo.ca> <3C35B536-68FF-42E8-B80D-3DB88D13CEF6@ccs.neu.edu> <756daca50902032010o5d8d3ff8g8b43d1d881f20bac@mail.gmail.com> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> Message-ID: It's not only possible, it is an order-of-magnitude easier in HtDP than in any Java text. Our "hello world" program is a rocket lifting off, and it all follows from the design recipe and images as values, plus 7th grade math. -- Matthias On Feb 5, 2009, at 2:01 PM, Arthur Nunes-Harwit wrote: > Hi, > > I see a lot of projects that are video games. Such projects > ultimately rely input and output, or side effects (perhaps > disguised via monads). The coding style for much of HtDP is purely > functional. What is the pedagogical impact? Do the students > notice? (As a student, I didn't notice right away that read was > different from square.) Is there any discussion of "special" > functions or objects? > > What is the impact of other languages such as Java where the > assumption [built into the language libraries] is that everything > is done using side effects? To what extent is it still possible to > take a mostly functional approach? > > Thanks. > > -Arthur > >>>> In any case, can anyone share any specific ideas for a "large" >>>> project >>> that worked well in your courses? >> >> (Wrong mailing list probably, but here we go) >> >> Freshman games only: >> single machine games: >> -- 'space war' (neu) >> -- 'airplane fire fighting' (wpi) >> -- 'worm' (neu) >> -- 'little tetris' (neu) >> distributed games: >> -- 'hangman' (neu) >> -- 'chat noir' (chicago) >> >> All of them can be done as described: >> -- plain recursive functions (lists + structs) >> -- revise to criticism >> -- higher-order function revision (looks like applicative class- >> based programming, if done properly) >> -- state-based revisions (looks like imperative class-based >> programming, if done properly) >> >> You can, if you so wish, re-assign the same problem in Java in the >> second semester. It is an eye-popping experience for most of them >> to see the DR work out perfectly for a Java-based world. >> >> -- Matthias >> >> >> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme From clements at brinckerhoff.org Thu Feb 5 14:11:02 2009 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:39:49 2009 Subject: [plt-scheme] CfP: Trends in Functional Programming (TFP) 2009 Message-ID: <03AF9785-50C0-4FA8-A4EB-52E5E90492C5@brinckerhoff.org> First call for papers 10th SYMPOSIUM ON TRENDS IN FUNCTIONAL PROGRAMMING TFP 2009 SELYE JANOS UNIVERSITY, KOMARNO, SLOVAKIA June 2-4, 2009 http://www.inf.elte.hu/tfp_cefp_2009 The symposium on Trends in Functional Programming (TFP) is an international forum for researchers with interests in all aspects of functional programming languages, focusing on providing a broad view of current and future trends in Functional Programming. It aspires to be a lively environment for presenting the latest research results. Acceptance for the conference is based on full papers or extended abstracts, and a formal post-symposium refereeing process selects the best articles presented at the symposium for publication in a high-profile volume. TFP 2009 is hosted by the Selye Janos University, Komarno, Slovakia, and it is co-located with the 3rd Central-European Functional Programming School (CEFP 2009), which is held immediately before TFP 2009 (May 25-30). IMPORTANT DATES (ALL 2009) * Paper Submission: March 15 * Notification of Acceptance: April 3 * Camera Ready Symposium Proceedings Paper: April 24 * TFP Symposium: June 2-4, 2009 * Post Symposium Paper Submission: June 30 * Notification of Acceptance: September 7 * Camera Ready Revised Paper: September 21 SCOPE OF THE SYMPOSIUM As part of the Symposium's focus on trends we therefore identify the following five article categories. High-quality articles are solicited in any of these categories: * Research: leading-edge, previously unpublished research. * Position: on what new trends should or should not be. * Project: descriptions of recently started new projects. * Evaluation: what lessons can be drawn from a finished project. * Overview: summarizing work with respect to a trendy subject. Articles must be original and not submitted for simultaneous publication to any other forum. They may consider any aspect of functional programming: theoretical, implementation-oriented, or more experience- oriented. Applications of functional programming techniques to other languages are also within the scope of the symposium. Contributions on the following subject areas are particularly welcomed: * Dependently Typed Functional Programming * Validation and Verification of Functional Programs * Debugging for Functional Languages * Functional Programming and Security * Functional Programming and Mobility * Functional Programming to Animate/Prototype/Implement Systems from Formal or Semi-Formal Specifications * Functional Languages for Telecommunications Applications * Functional Languages for Embedded Systems * Functional Programming Applied to Global Computing * Functional GRIDs * Functional Programming Ideas in Imperative or Object-Oriented Settings (and the converse) * Interoperability with Imperative Programming Languages * Novel Memory Management Techniques * Parallel/Concurrent Functional Languages * Program Transformation Techniques * Empirical Performance Studies * Abstract/Virtual Machines and Compilers for Functional Languages * New Implementation Strategies * Any new emerging trend in the functional programming area If you are in doubt on whether your article is within the scope of TFP, please contact the TFP 2009 program chairs, Zoltan Horvath and Viktoria Zsok at tfp2009@inf.elte.hu SUBMISSION AND DRAFT PROCEEDINGS Acceptance of articles for presentation at the symposium is based on the screening process of full papers (15 pages) and extended abstracts (at least 3 pages). TFP encourages PhD students to submit papers. PhD students may request the program committee to provide extensive feedback on their full papers at the time of submission. Full papers describing work accepted for presentation must be completed before the symposium for publication in the draft proceedings. Further details can be found at the TFP 2009 website. POST-SYMPOSIUM REFEREEING AND PUBLICATION In addition to the draft symposium proceedings, we continue the TFP tradition of publishing a high-quality subset of contributions in the Intellect series on Trends in Functional Programming. PROGRAM COMMITTEE * Peter Achten (symp-chair), Radboud University Nijmegen, NL * John Clements, California Polytechnic State University, USA * Cormac Flanagan, University of California at Santa Cruz, USA * Jurriaan Hage, Utrecht University, NL * Kevin Hammond, University of St. Andrews, UK * Michael Hanus, Christian-Albrechts University zu Kiel, DE * Ralf Hinze, University of Oxford, UK * Zoltan Horvath (PC co-chair), Eotvos Lorand University, HU * Graham Hutton, University of Nottingham, UK * Johan Jeuring, Utrecht University, NL * Pieter Koopman (symp-chair), Radboud University Nijmegen, NL * Hans-Wolfgang Loidl, Ludwig-Maximilians University Munchen, DE * Rita Loogen, Philipps-University Marburg, DE * Greg Michaelson, Heriot-Watt University, UK * Marco T. Morazan, Seton Hall University, USA * Rex L Page, University of Oklahoma, USA * Sven-Bodo Scholz, University of Hertfordshire, UK * Clara Segura, University Complutense de Madrid, ES * Mary Sheeran, Chalmers University of Technology, SE * Phil Trinder, Heriot-Watt University, UK * Marko van Eekelen, Radboud University Nijmegen, NL * Varmo Vene, University of Tartu, EE * Viktoria Zsok (PC co-chair), Eotvos Lorand University, HU LOCATION Conference Centre of Selye University, Komarno, Slovakia (http://www.selyeuni.sk/). It is a new and excellent conference centre with modern equipment, lecture rooms and computer labs. Komarno is on the north bank of river Danube, the northern part of the city Komarom / Komarno. It is a charming old city with about 30 000 inhabitants, 90 km away from Budapest (the capital of Hungary), with good highway and railway connections and 90 km away from Bratislava (the capital of Slovakia), about 100 km from Vienna International Airport. -------------- 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/20090205/d0685b3a/smime.bin From sk at cs.brown.edu Thu Feb 5 14:17:03 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:39:50 2009 Subject: [plt-edu] Re: [plt-scheme] behaviour of void? In-Reply-To: References: <4988DADC.6020403@uwaterloo.ca> <3C35B536-68FF-42E8-B80D-3DB88D13CEF6@ccs.neu.edu> <756daca50902032010o5d8d3ff8g8b43d1d881f20bac@mail.gmail.com> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> Message-ID: To back up Matthias, a rough measure: Danny Yoo rewrote the Google Android platform's lunar lander program in world. Though not identical (our Android support is obviously not yet as complete), the difference was roughly 150 lines (Scheme) vs 1058 lines (Java). Of course, that makes the Java program much more impressive to family and friends, so it is clearly superior. (-: Shriram On Thu, Feb 5, 2009 at 2:09 PM, Matthias Felleisen wrote: > > > It's not only possible, it is an order-of-magnitude easier in HtDP than in > any Java text. Our "hello world" program is a rocket lifting off, and it all > follows from the design recipe and images as values, plus 7th grade math. -- > Matthias > > > > > > > On Feb 5, 2009, at 2:01 PM, Arthur Nunes-Harwit wrote: > >> Hi, >> >> I see a lot of projects that are video games. Such projects ultimately >> rely input and output, or side effects (perhaps disguised via monads). The >> coding style for much of HtDP is purely functional. What is the pedagogical >> impact? Do the students notice? (As a student, I didn't notice right away >> that read was different from square.) Is there any discussion of "special" >> functions or objects? >> >> What is the impact of other languages such as Java where the assumption >> [built into the language libraries] is that everything is done using side >> effects? To what extent is it still possible to take a mostly functional >> approach? >> >> Thanks. >> >> -Arthur >> >>>>> In any case, can anyone share any specific ideas for a "large" project >>>> >>>> that worked well in your courses? >>> >>> (Wrong mailing list probably, but here we go) >>> >>> Freshman games only: >>> single machine games: >>> -- 'space war' (neu) >>> -- 'airplane fire fighting' (wpi) >>> -- 'worm' (neu) >>> -- 'little tetris' (neu) >>> distributed games: >>> -- 'hangman' (neu) >>> -- 'chat noir' (chicago) >>> >>> All of them can be done as described: >>> -- plain recursive functions (lists + structs) >>> -- revise to criticism >>> -- higher-order function revision (looks like applicative class-based >>> programming, if done properly) >>> -- state-based revisions (looks like imperative class-based programming, >>> if done properly) >>> >>> You can, if you so wish, re-assign the same problem in Java in the second >>> semester. It is an eye-popping experience for most of them to see the DR >>> work out perfectly for a Java-based world. >>> >>> -- Matthias >>> >>> >>> >>> _________________________________________________ >>> For list-related administrative tasks: >>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > PLT Educators mailing list > plt-edu@list.cs.brown.edu > http://list.cs.brown.edu/mailman/listinfo/plt-edu > From m.douglas.williams at gmail.com Thu Feb 5 14:59:56 2009 From: m.douglas.williams at gmail.com (Doug Williams) Date: Thu Mar 26 02:39:50 2009 Subject: [plt-scheme] AI Algorithms in PLT-Scheme In-Reply-To: References: <80868ae3-5725-4565-9d1c-a378b908f32b@g3g2000pre.googlegroups.com> Message-ID: There is the inference collection for backward and forward chaining inference that is on PLaneT (in fact, I just updated it for PLT Scheme 4.0 today). And, I have some graph search algorithms for state-space problem solvers (with examples) and a blocks world program, with how and why explanations based on walking the solution tree, that aren't on PLaneT, but that are written in PLT Scheme. I'd be happy to make those available to you. Doug On Thu, Feb 5, 2009 at 8:56 AM, Noel Welsh wrote: > I don't know of much released AI code. There is the Science > collection on Planet (http://planet.plt-scheme.org) on which said code > can be built (assuming you tend more towards statistical AI / machine > learning than symbolic AI). There are several AI researchers on this > list (including myself) who have code that might be useful to you, > though I expect much of it is too advanced and too hastily written to > be appropriate for the classroom. > > I have code for the following: > > - beta process > - Dirichlet process > - variational HMM > - generic POMDP > - basic HMM stuff (forward-backward alg. etc.) > > That's in rough order of when I last touched it, and hence how easy it > would be to get running in recent PLT Scheme. > > N. > > On Wed, Feb 4, 2009 at 11:00 PM, Michael H. Coen wrote: > > Howdy folks, > > > > I'm teaching the Introduction to AI course at UW-Madison this term. > > ... > > I'm a bit surprised there isn't an AI code repository. Perhaps I'm not > finding it? > _________________________________________________ > 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/20090205/79a47bbe/attachment.htm From robby at eecs.northwestern.edu Thu Feb 5 15:14:35 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Mar 26 02:39:50 2009 Subject: [plt-scheme] behaviour of void? In-Reply-To: References: <4988DADC.6020403@uwaterloo.ca> <3C35B536-68FF-42E8-B80D-3DB88D13CEF6@ccs.neu.edu> <756daca50902032010o5d8d3ff8g8b43d1d881f20bac@mail.gmail.com> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> Message-ID: <932b2f1f0902051214g1148d325hcb6c6042dbc737a1@mail.gmail.com> I'm sure Matthias will say more, but let me recommend you read How to Design Worlds and perhaps an introduction to the world teachpack elsewhere. http://world.cs.brown.edu/ Robby On Thu, Feb 5, 2009 at 1:01 PM, Arthur Nunes-Harwit wrote: > Hi, > > I see a lot of projects that are video games. Such projects ultimately rely > input and output, or side effects (perhaps disguised via monads). The coding > style for much of HtDP is purely functional. What is the pedagogical > impact? Do the students notice? (As a student, I didn't notice right away > that read was different from square.) Is there any discussion of "special" > functions or objects? > > What is the impact of other languages such as Java where the assumption > [built into the language libraries] is that everything is done using side > effects? To what extent is it still possible to take a mostly functional > approach? > > Thanks. > > -Arthur > >>>> In any case, can anyone share any specific ideas for a "large" project >>> >>> that worked well in your courses? >> >> (Wrong mailing list probably, but here we go) >> >> Freshman games only: >> single machine games: >> -- 'space war' (neu) >> -- 'airplane fire fighting' (wpi) >> -- 'worm' (neu) >> -- 'little tetris' (neu) >> distributed games: >> -- 'hangman' (neu) >> -- 'chat noir' (chicago) >> >> All of them can be done as described: >> -- plain recursive functions (lists + structs) >> -- revise to criticism >> -- higher-order function revision (looks like applicative class-based >> programming, if done properly) >> -- state-based revisions (looks like imperative class-based programming, >> if done properly) >> >> You can, if you so wish, re-assign the same problem in Java in the second >> semester. It is an eye-popping experience for most of them to see the DR >> work out perfectly for a Java-based world. >> >> -- Matthias >> >> >> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From plragde at uwaterloo.ca Thu Feb 5 15:12:56 2009 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:39:51 2009 Subject: [plt-scheme] behaviour of void? In-Reply-To: References: <4988DADC.6020403@uwaterloo.ca> <3C35B536-68FF-42E8-B80D-3DB88D13CEF6@ccs.neu.edu> <756daca50902032010o5d8d3ff8g8b43d1d881f20bac@mail.gmail.com> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> Message-ID: <498B4848.7080008@uwaterloo.ca> Arthur Nunes-Harwit wrote: > I see a lot of projects that are video games. Part of what I (and many others) would like to see are ways of attracting students to CS who might be turned off by the gaming stereotypes fostered in pre-secondary settings (many of them, in our setting, will have strong math skills). So suggestions for projects that are not games would also be appreciated. --PR From sk at cs.brown.edu Thu Feb 5 15:22:05 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:39:51 2009 Subject: [plt-edu] Re: [plt-scheme] behaviour of void? In-Reply-To: <498B4848.7080008@uwaterloo.ca> References: <4988DADC.6020403@uwaterloo.ca> <3C35B536-68FF-42E8-B80D-3DB88D13CEF6@ccs.neu.edu> <756daca50902032010o5d8d3ff8g8b43d1d881f20bac@mail.gmail.com> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> <498B4848.7080008@uwaterloo.ca> Message-ID: I think three things will greatly enhance this range: - our developed, but not yet deployed, support for GUIs - Matthias's recent deployed support for distributed programming - our ongoing work for mobile phones While each of these *could* be used for games, they open up many more avenues, including non-games. On Thu, Feb 5, 2009 at 3:12 PM, Prabhakar Ragde wrote: > Arthur Nunes-Harwit wrote: > >> I see a lot of projects that are video games. > > Part of what I (and many others) would like to see are ways of attracting > students to CS who might be turned off by the gaming stereotypes fostered in > pre-secondary settings (many of them, in our setting, will have strong math > skills). So suggestions for projects that are not games would also be > appreciated. --PR > _________________________________________________ > PLT Educators mailing list > plt-edu@list.cs.brown.edu > http://list.cs.brown.edu/mailman/listinfo/plt-edu > From robby at eecs.northwestern.edu Thu Feb 5 15:26:53 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Mar 26 02:39:51 2009 Subject: [plt-edu] Re: [plt-scheme] behaviour of void? In-Reply-To: <498B4848.7080008@uwaterloo.ca> References: <4988DADC.6020403@uwaterloo.ca> <3C35B536-68FF-42E8-B80D-3DB88D13CEF6@ccs.neu.edu> <756daca50902032010o5d8d3ff8g8b43d1d881f20bac@mail.gmail.com> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> <498B4848.7080008@uwaterloo.ca> Message-ID: <932b2f1f0902051226y71039479v6bee2f539ac0c09e@mail.gmail.com> There was at least one in the links I sent out: http://people.cs.uchicago.edu/~jacobm/15100-2006-fall/8/lab.html It was one of the somewhat successful ones, so I expect something like it can be made to work well (so you'd probably want to treat it as a starting point). Robby On Thu, Feb 5, 2009 at 2:12 PM, Prabhakar Ragde wrote: > Arthur Nunes-Harwit wrote: > >> I see a lot of projects that are video games. > > Part of what I (and many others) would like to see are ways of attracting > students to CS who might be turned off by the gaming stereotypes fostered in > pre-secondary settings (many of them, in our setting, will have strong math > skills). So suggestions for projects that are not games would also be > appreciated. --PR > _________________________________________________ > PLT Educators mailing list > plt-edu@list.cs.brown.edu > http://list.cs.brown.edu/mailman/listinfo/plt-edu > From anh at cs.rit.edu Thu Feb 5 15:32:55 2009 From: anh at cs.rit.edu (Arthur Nunes-Harwit) Date: Thu Mar 26 02:39:51 2009 Subject: [plt-scheme] behaviour of void? In-Reply-To: <498B4848.7080008@uwaterloo.ca> References: <4988DADC.6020403@uwaterloo.ca> <3C35B536-68FF-42E8-B80D-3DB88D13CEF6@ccs.neu.edu> <756daca50902032010o5d8d3ff8g8b43d1d881f20bac@mail.gmail.com> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> <498B4848.7080008@uwaterloo.ca> Message-ID: Hi, On Thu, 5 Feb 2009, Prabhakar Ragde wrote: > Part of what I (and many others) would like to see are ways of > attracting students to CS who might be turned off by the gaming > stereotypes fostered in pre-secondary settings (many of them, in our > setting, will have strong math skills). So suggestions for projects that > are not games would also be appreciated. --PR Personally, I found projects involving computer algebra, (crude) natural language parsing, and programming language implementation quite exciting. (This was way back when I took a course based on SICP.) I'd like to see more projects like those. Today I'm told either that that's too hard or that it's not exciting to students today. -Arthur From sk at cs.brown.edu Thu Feb 5 15:43:13 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:39:51 2009 Subject: [plt-scheme] behaviour of void? In-Reply-To: References: <4988DADC.6020403@uwaterloo.ca> <3C35B536-68FF-42E8-B80D-3DB88D13CEF6@ccs.neu.edu> <756daca50902032010o5d8d3ff8g8b43d1d881f20bac@mail.gmail.com> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> <498B4848.7080008@uwaterloo.ca> Message-ID: > Personally, I found projects involving computer algebra, (crude) natural > language parsing, and programming language implementation quite exciting. > (This was way back when I took a course based on SICP.) > > I'd like to see more projects like those. Today I'm told either that that's > too hard or that it's not exciting to students today. It's not too hard at all. Our courses routinely assign these kinds of assignments. But we also have to train our students to understand modern systems. SICP was not written for an interactive (in the sense of a computational model) era. The world effort is an strong attempt to make functional programming just as relevant to modern computation. What happens inside the system between interactions can still involve algebra, NLP, or language interpretation -- and often does. So please, let's not create unnecessary dichotomies or call into question what students can or will do. There's just more that they *need* to do, and our curricula need to scale to those needs. Shriram From eli at barzilay.org Thu Feb 5 15:59:19 2009 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:39:51 2009 Subject: [plt-scheme] New plt-dev mailing list Message-ID: <18827.21287.639812.751317@arabic.ccs.neu.edu> In the interests of making the PLT Scheme development process more open to contributors, we've created a new mailing list, called "plt-dev", for implementation and development discussion. This new list will be aimed at people who are interested in contributing to PLT Scheme, or who are interested in the implementation of PLT Scheme. In addition, the release process will happen on this list so you can follow that and perhaps try release candidates too. However, the new list is not for general discussion of Scheme, PLT Scheme, or programming -- such discussions should stay on the plt-scheme list. As examples, these thread are excellent candidates for plt-dev: http://list.cs.brown.edu/pipermail/plt-scheme/2009-January/029513.html http://list.cs.brown.edu/pipermail/plt-scheme/2009-January/029831.html but these threads should stay on plt-scheme: http://list.cs.brown.edu/pipermail/plt-scheme/2009-January/029933.html http://list.cs.brown.edu/pipermail/plt-scheme/2009-January/029974.html Anyone is welcome to lurk on the plt-dev list (and a gmane.org mirror should be available soon too), but we ask that you keep messages on it on-topic, since this is the list which we use for the PLT Scheme development work. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From yinso.chen at gmail.com Thu Feb 5 16:03:25 2009 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:39:52 2009 Subject: [plt-scheme] tools for determining memory leak? Message-ID: <779bf2730902051303w54989312pddf2e842ea1dce95@mail.gmail.com> Hi all - I am encountering curious behavior in my web code - basically for every request, ~7 or 8mb of memory is issued and never released. As I have quite a bit of code written, I don't have an easy way to isolate the behavior at this time. Are there tools (or tips) for help tracking down the leak point? Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090205/441481ba/attachment.html From pocmatos at gmail.com Thu Feb 5 16:33:10 2009 From: pocmatos at gmail.com (Paulo J. Matos) Date: Thu Mar 26 02:39:52 2009 Subject: [plt-scheme] New plt-dev mailing list In-Reply-To: <18827.21287.639812.751317@arabic.ccs.neu.edu> References: <18827.21287.639812.751317@arabic.ccs.neu.edu> Message-ID: <11b141710902051333p5f8aab58l9b30288e90946253@mail.gmail.com> On Thu, Feb 5, 2009 at 8:59 PM, Eli Barzilay wrote: > In the interests of making the PLT Scheme development process more > open to contributors, we've created a new mailing list, called > "plt-dev", for implementation and development discussion. This new > list will be aimed at people who are interested in contributing to PLT > Scheme, or who are interested in the implementation of PLT Scheme. In > addition, the release process will happen on this list so you can > follow that and perhaps try release candidates too. > I guess this is the link people should use to subscribe: http://list.cs.brown.edu/mailman/listinfo/plt-dev Thanks a lot for the creation of the list. Great idea! :) -- Paulo Jorge Matos - pocmatos at gmail.com Webpage: http://www.personal.soton.ac.uk/pocm From jay.mccarthy at gmail.com Thu Feb 5 16:58:26 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:39:52 2009 Subject: [plt-scheme] tools for determining memory leak? In-Reply-To: <779bf2730902051303w54989312pddf2e842ea1dce95@mail.gmail.com> References: <779bf2730902051303w54989312pddf2e842ea1dce95@mail.gmail.com> Message-ID: The memory backtracing that is built into mzscheme works well. Most likely, you have large continuations and they are not being freed in a timely way. What manager are you using? Jay On Thu, Feb 5, 2009 at 2:03 PM, YC wrote: > Hi all - > > I am encountering curious behavior in my web code - basically for every > request, ~7 or 8mb of memory is issued and never released. As I have quite > a bit of code written, I don't have an easy way to isolate the behavior at > this time. > > Are there tools (or tips) for help tracking down the leak point? > > Thanks, > yc > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From yinso.chen at gmail.com Thu Feb 5 17:21:19 2009 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:39:53 2009 Subject: [plt-scheme] tools for determining memory leak? In-Reply-To: References: <779bf2730902051303w54989312pddf2e842ea1dce95@mail.gmail.com> Message-ID: <779bf2730902051421v41f98abuc7c7bb9d38b3c2ce@mail.gmail.com> On Thu, Feb 5, 2009 at 1:58 PM, Jay McCarthy wrote: > The memory backtracing that is built into mzscheme works well. > Are you referring to `dump-memory-stats`? That's the only facility that I was able to find. Is there something else that I can use? > Most likely, you have large continuations and they are not being freed > in a timely way. What manager are you using? > I am fairly certain this is not caused solely by web-server - I am using LRU manager and quite happy with its behavior. My challenge is that I wrote a ton of code without noticing the behavior, so am at a loss to track down the problem quickly. My current approach is to reconstruct the code in chunks, hopefully to isolate the leak point, and this process is just slow. Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090205/34113875/attachment.htm From jay.mccarthy at gmail.com Thu Feb 5 17:32:21 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:39:53 2009 Subject: [plt-scheme] tools for determining memory leak? In-Reply-To: <779bf2730902051421v41f98abuc7c7bb9d38b3c2ce@mail.gmail.com> References: <779bf2730902051303w54989312pddf2e842ea1dce95@mail.gmail.com> <779bf2730902051421v41f98abuc7c7bb9d38b3c2ce@mail.gmail.com> Message-ID: Yes, dump-memory-stats is what I mean. When you compile with backtracing, you'll get additional options from dms. Jay On Thu, Feb 5, 2009 at 3:21 PM, YC wrote: > > > On Thu, Feb 5, 2009 at 1:58 PM, Jay McCarthy wrote: >> >> The memory backtracing that is built into mzscheme works well. > > Are you referring to `dump-memory-stats`? That's the only facility that I > was able to find. Is there something else that I can use? > >> >> Most likely, you have large continuations and they are not being freed >> in a timely way. What manager are you using? > > I am fairly certain this is not caused solely by web-server - I am using LRU > manager and quite happy with its behavior. > > My challenge is that I wrote a ton of code without noticing the behavior, so > am at a loss to track down the problem quickly. My current approach is to > reconstruct the code in chunks, hopefully to isolate the leak point, and > this process is just slow. > > Thanks, > yc > > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From pocmatos at gmail.com Thu Feb 5 17:45:44 2009 From: pocmatos at gmail.com (Paulo J. Matos) Date: Thu Mar 26 02:39:53 2009 Subject: [plt-scheme] Hit People Over the Head with HtDP and martial arts!?? In-Reply-To: <200901202154.n0KLs0jN015492@mail02.syd.optusnet.com.au> References: <200901202154.n0KLs0jN015492@mail02.syd.optusnet.com.au> Message-ID: <11b141710902051445m145ec0fcmc97b00945b60247c@mail.gmail.com> On Tue, Jan 20, 2009 at 9:54 PM, wrote: > Michael Forster wrote: >> Funny word that, "experience." My late Judo teacher used to talk > [snip] > > Interesting that this "hit them over the head" metaphor has brought out a Judo reference! > > Are there any other martial arts aficionados (past- or present-) Judo or otherwise out there? > I trained JuJutsu for 15 years before coming to the UK. My teacher had some interesting insights sometimes but I never really related it with programming. :) Now, thinking about it, I guess there are a lot of similarities between programming and learning a martial art. To begin with, you can learn martial arts without train as you can learn programming without writing code. In fact, my teacher used to say: "to improve you only need to do 3 things: train, train, train." Maybe we can apply it to programming and say: "to improve you only need 3 things: code, code, code"? Maybe here I would add "read good books". This divergence from the martial arts world is that most of the times you train with your teacher, so training includes the process of learning new techniques and perfecting the old ones, while in programming sitting alone in a room coding won't probably teach you anything new. Interesting to see, as an experiment, how would work the teaching of programming as if it were a martial art? Every so often you mean for a couple of hours with your teacher and you code with him, and maybe you get also to see your master code with someone else and then you practice by coding with a partner... This would be an awesome experience! :D > My confession / plug: http://maaml.blogspot.com > > -- Dan > > >> >> On Tue, Jan 20, 2009 at 12:30 PM, Michael Forster >> wrote: >> > On Mon, Jan 19, 2009 at 3:29 PM, Grant Rettke wrote: >> >> On Mon, Jan 19, 2009 at 2:03 PM, Neil Van Dyke >> wrote: >> >>> Random people with Web pages about Scheme, like myself, can also do >> our part >> >>> to point people in the right direction: >> >> >> >> Have you found some successful ways to communicate, or convince, >> >> experienced programmers that there is something for them to learn >> with >> >> HtDP? >> >> >> >> Most "experienced programmers" tend to be convinved that there is >> >> nothing left to learn but new APIs and frameworks. >> > >> > Funny word that, "experience." My late Judo teacher used to talk >> > about the difference between "20 years' worth of experience" and "one >> > year's worth, repeated 20 times over." >> > >> > Mike >> > >> >> I should clarify, as I just did to someone who replied off-list, that >> I didn't mean to imply that one measure was better. My teacher was >> simply asking us to consider the _difference_. And, perhaps, that any >> amount of experience can be a hindrance in some instances. >> >> Cheers, >> >> Mike >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Paulo Jorge Matos - pocmatos at gmail.com Webpage: http://www.personal.soton.ac.uk/pocm From plragde at uwaterloo.ca Thu Feb 5 17:51:44 2009 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:39:54 2009 Subject: [plt-scheme] behaviour of void? In-Reply-To: References: <4988DADC.6020403@uwaterloo.ca> <3C35B536-68FF-42E8-B80D-3DB88D13CEF6@ccs.neu.edu> <756daca50902032010o5d8d3ff8g8b43d1d881f20bac@mail.gmail.com> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> <498B4848.7080008@uwaterloo.ca> Message-ID: <498B6D80.2080100@uwaterloo.ca> Shriram Krishnamurthi wrote: > It's not too hard at all. Our courses routinely assign these kinds of > assignments. But we also have to train our students to understand > modern systems. > > SICP was not written for an interactive (in the sense of a > computational model) era. The world effort is an strong attempt to > make functional programming just as relevant to modern computation. Now who is setting up dichotomies with loaded use of the word "modern"? You and your co-authors, in "Structure and Interpretation of the Computer Science Curriculum", rightly criticize SICP for requiring too much domain knowledge. One obvious use of world.ss is in simulation of physical phenomena -- but this requires domain knowledge in physics at least (maybe even fluid dynamics), not to mention knowing how to deal with computation using inexact numbers, something I would rather avoid in first year. There must be non-gaming uses of world.ss that use discrete mathematics and have serious computer science content. I just have difficulty, personally, coming up with them. --PR From yinso.chen at gmail.com Thu Feb 5 18:01:05 2009 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:39:54 2009 Subject: [plt-scheme] tools for determining memory leak? In-Reply-To: References: <779bf2730902051303w54989312pddf2e842ea1dce95@mail.gmail.com> <779bf2730902051421v41f98abuc7c7bb9d38b3c2ce@mail.gmail.com> Message-ID: <779bf2730902051501v77950f58m38079f1f3078760e@mail.gmail.com> On Thu, Feb 5, 2009 at 2:32 PM, Jay McCarthy wrote: > Yes, dump-memory-stats is what I mean. When you compile with > backtracing, you'll get additional options from dms. > > Thanks Jay - is there a way for me to tell whether I have compiled with the backtracing or not? yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090205/6fec9032/attachment.html From carl.eastlund at gmail.com Thu Feb 5 18:04:54 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Thu Mar 26 02:39:54 2009 Subject: [plt-scheme] Hit People Over the Head with HtDP and martial arts!?? In-Reply-To: <11b141710902051445m145ec0fcmc97b00945b60247c@mail.gmail.com> References: <200901202154.n0KLs0jN015492@mail02.syd.optusnet.com.au> <11b141710902051445m145ec0fcmc97b00945b60247c@mail.gmail.com> Message-ID: <990e0c030902051504n1a37853eo35eaa301eb62191e@mail.gmail.com> On Thu, Feb 5, 2009 at 5:45 PM, Paulo J. Matos wrote: > I trained JuJutsu for 15 years before coming to the UK. My teacher had > some interesting insights sometimes but I never really related it with > programming. :) > > Now, thinking about it, I guess there are a lot of similarities > between programming and learning a martial art. To begin with, you can > learn martial arts without train as you can learn programming without > writing code. > > In fact, my teacher used to say: "to improve you only need to do 3 > things: train, train, train." > Maybe we can apply it to programming and say: "to improve you only > need 3 things: code, code, code"? Maybe here I would add "read good > books". This divergence from the martial arts world is that most of > the times you train with your teacher, so training includes the > process of learning new techniques and perfecting the old ones, while > in programming sitting alone in a room coding won't probably teach you > anything new. > > Interesting to see, as an experiment, how would work the teaching of > programming as if it were a martial art? Every so often you mean for a > couple of hours with your teacher and you code with him, and maybe you > get also to see your master code with someone else and then you > practice by coding with a partner... This would be an awesome > experience! :D I've practiced a number of martial arts sporadically over the years; mostly kung fu recently. I was first introduced to comparisons between martial arts and computer science when I took Stephen Rudich's discrete math course. He starts the course off by asking for three student volunteers to come up and try to punch him. The first, he pushes away as he jumps to the side. He explains this as the novice solution: brute force and inefficient, but simple and effective. The second, he simply blocks. He explains this as the expert solution: more efficient, using one maneuver for one attack, but still expending about as much effort as the opponent. The third attack, he twists his shoulders just a bit to get out of the way of. He explains this as the master solution, using the minimum amount of effort necessary to make the attack irrelevant, without wasting effort trying to prevent it. The rest of the class is spent tackling various problems in combinatorics, cryptography, and other tricky algorithms, always progressing through the analogy of the naive novice solution, the efficient expert solution, and the painstakingly researched, usually optimal master solution. Unfortunately for me, Professor Rudich was on sabbatical when I took the class, so I didn't get to see him demonstrate it. Professor Maggs, standing in for him, did explain what we would normally have seen, and used the analogy throughout the course. Since then, I often compare martial arts to computer science, and in the broad strokes it's usually pretty close. (I suppose it could just be easy to maintain a superficial analogy.) Martial arts is presented as "train, train, train", but you can't make someone go train until you've first showed them how to do something the right way. Training without instruction is a good way to get hurt. Programming classes may seem like "read, read, read", but if you don't apply your knowledge to writing programs you won't really understand it. In both cases, you need to learn the fundamentals, then apply them until you've mastered them. --Carl From yinso.chen at gmail.com Thu Feb 5 18:14:00 2009 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:39:55 2009 Subject: [plt-scheme] tools for determining memory leak? In-Reply-To: <779bf2730902051501v77950f58m38079f1f3078760e@mail.gmail.com> References: <779bf2730902051303w54989312pddf2e842ea1dce95@mail.gmail.com> <779bf2730902051421v41f98abuc7c7bb9d38b3c2ce@mail.gmail.com> <779bf2730902051501v77950f58m38079f1f3078760e@mail.gmail.com> Message-ID: <779bf2730902051514l21b5a4fcq1bfa76a526471d3d@mail.gmail.com> On Thu, Feb 5, 2009 at 3:01 PM, YC wrote: > > > On Thu, Feb 5, 2009 at 2:32 PM, Jay McCarthy wrote: > >> Yes, dump-memory-stats is what I mean. When you compile with >> backtracing, you'll get additional options from dms. >> >> > Thanks Jay - is there a way for me to tell whether I have compiled with the > backtracing or not? > Now it's clear my built does not have backtrace enabled as I got a compilation error - anyone seen this error before? I am on centos 5.1. ./newgc.c:1271: warning: dereferencing type-punned pointer will break strict-aliasing rules In file included from ./newgc.c:1789, from ./gc2.c:15: ./backtrace.c: In function 'print_out_pointer': ./backtrace.c:48: warning: implicit declaration of function 'find_page' ./backtrace.c:48: warning: assignment makes pointer from integer without a cast ./backtrace.c: In function 'print_traced_objects': ./backtrace.c:97: error: 'avoid_collection' undeclared (first use in this function) ./backtrace.c:97: error: (Each undeclared identifier is reported only once ./backtrace.c:97: error: for each function it appears in.) make[4]: *** [gc2.o] Error 1 make[4]: Leaving directory `/home/yc/tmp/plt-4.1.3/src/mzscheme/gc2' make[3]: *** [all] Error 2 make[3]: Leaving directory `/home/yc/tmp/plt-4.1.3/src/mzscheme/gc2' make[2]: *** [3m] Error 2 make[2]: Leaving directory `/home/yc/tmp/plt-4.1.3/src/mzscheme' make[1]: *** [3m] Error 2 make[1]: Leaving directory `/home/yc/tmp/plt-4.1.3/src' make: *** [all] Error 2 Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090205/d5cd1e4d/attachment.htm From rafkind at cs.utah.edu Thu Feb 5 18:19:17 2009 From: rafkind at cs.utah.edu (Jon Rafkind) Date: Thu Mar 26 02:39:55 2009 Subject: [plt-scheme] Hit People Over the Head with HtDP and martial arts!?? In-Reply-To: <990e0c030902051504n1a37853eo35eaa301eb62191e@mail.gmail.com> References: <200901202154.n0KLs0jN015492@mail02.syd.optusnet.com.au> <11b141710902051445m145ec0fcmc97b00945b60247c@mail.gmail.com> <990e0c030902051504n1a37853eo35eaa301eb62191e@mail.gmail.com> Message-ID: <498B73F5.1030503@cs.utah.edu> > Since then, I often compare martial arts to computer science, and in > the broad strokes it's usually pretty close. (I suppose it could just > be easy to maintain a superficial analogy.) Martial arts is presented > as "train, train, train", but you can't make someone go train until > you've first showed them how to do something the right way. Training > without instruction is a good way to get hurt. Programming classes > may seem like "read, read, read", but if you don't apply your > knowledge to writing programs you won't really understand it. In both > cases, you need to learn the fundamentals, then apply them until > you've mastered them. > > Ok I can't resist my little anecdote. I've been playing racquetball for 8 years and now play with people on campus, but I lost a lot in the beginning because apparently I sucked! The coach showed me what I was doing wrong in about 5 minutes and after a few weeks of practice I'm now at a reasonable skill level, orders of magnitude better than I was before. Its obvious in retrospect what I was doing wrong before but I didn't have the insights to improve myself on my own. From yinso.chen at gmail.com Thu Feb 5 19:20:59 2009 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:39:56 2009 Subject: [plt-scheme] tools for determining memory leak? In-Reply-To: <779bf2730902051514l21b5a4fcq1bfa76a526471d3d@mail.gmail.com> References: <779bf2730902051303w54989312pddf2e842ea1dce95@mail.gmail.com> <779bf2730902051421v41f98abuc7c7bb9d38b3c2ce@mail.gmail.com> <779bf2730902051501v77950f58m38079f1f3078760e@mail.gmail.com> <779bf2730902051514l21b5a4fcq1bfa76a526471d3d@mail.gmail.com> Message-ID: <779bf2730902051620u234a12b7hb936dbe08ce14027@mail.gmail.com> On Thu, Feb 5, 2009 at 3:14 PM, YC wrote: > > > On Thu, Feb 5, 2009 at 2:32 PM, Jay McCarthy wrote: >> >>> Yes, dump-memory-stats is what I mean. When you compile with >>> backtracing, you'll get additional options from dms. >>> >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090205/3ec5a014/attachment.html From yinso.chen at gmail.com Thu Feb 5 19:24:33 2009 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:39:56 2009 Subject: [plt-scheme] tools for determining memory leak? In-Reply-To: <779bf2730902051620u234a12b7hb936dbe08ce14027@mail.gmail.com> References: <779bf2730902051303w54989312pddf2e842ea1dce95@mail.gmail.com> <779bf2730902051421v41f98abuc7c7bb9d38b3c2ce@mail.gmail.com> <779bf2730902051501v77950f58m38079f1f3078760e@mail.gmail.com> <779bf2730902051514l21b5a4fcq1bfa76a526471d3d@mail.gmail.com> <779bf2730902051620u234a12b7hb936dbe08ce14027@mail.gmail.com> Message-ID: <779bf2730902051624q114af4f4je0aa56be0c5d43d9@mail.gmail.com> Oops - accidentally hit send on the last email. I was able to isolate the source of the leak, and it turned out to be a persistence module. It was leaking of all things - namespaces. I am unclear why it was leaking namespaces, but I was able to replace the module with another one, so for now the issue is resolved. Thanks for the help, yc On Thu, Feb 5, 2009 at 4:20 PM, YC wrote: > > > On Thu, Feb 5, 2009 at 3:14 PM, YC wrote: > >> >> >> On Thu, Feb 5, 2009 at 2:32 PM, Jay McCarthy wrote: >>> >>>> Yes, dump-memory-stats is what I mean. When you compile with >>>> backtracing, you'll get additional options from dms. >>>> >>>> >>> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090205/a90699e4/attachment.htm From matthias at ccs.neu.edu Thu Feb 5 20:12:26 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:39:57 2009 Subject: [plt-scheme] behaviour of void? In-Reply-To: <498B6D80.2080100@uwaterloo.ca> References: <4988DADC.6020403@uwaterloo.ca> <3C35B536-68FF-42E8-B80D-3DB88D13CEF6@ccs.neu.edu> <756daca50902032010o5d8d3ff8g8b43d1d881f20bac@mail.gmail.com> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> <498B4848.7080008@uwaterloo.ca> <498B6D80.2080100@uwaterloo.ca> Message-ID: On Feb 5, 2009, at 5:51 PM, Prabhakar Ragde wrote: > Shriram Krishnamurthi wrote: > >> It's not too hard at all. Our courses routinely assign these >> kinds of >> assignments. But we also have to train our students to understand >> modern systems. >> SICP was not written for an interactive (in the sense of a >> computational model) era. The world effort is an strong attempt to >> make functional programming just as relevant to modern computation. > > Now who is setting up dichotomies with loaded use of the word > "modern"? > > You and your co-authors, in "Structure and Interpretation of the > Computer Science Curriculum", rightly criticize SICP for requiring > too much domain knowledge. One obvious use of world.ss is in > simulation of physical phenomena -- but this requires domain > knowledge in physics at least (maybe even fluid dynamics), not to > mention knowing how to deal with computation using inexact numbers, > something I would rather avoid in first year. > > There must be non-gaming uses of world.ss that use discrete > mathematics and have serious computer science content. I just have > difficulty, personally, coming up with them. --PR 1. Recall that universe.ss is replacing world.ss. 2. How about a chat server? It's well within reach for universe.ss. Students can design their own features for the last few weeks of the course: type Hindi at one end, see German at the other :-) -- Matthias From sk at cs.brown.edu Thu Feb 5 20:21:58 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:39:57 2009 Subject: [plt-scheme] behaviour of void? In-Reply-To: References: <4988DADC.6020403@uwaterloo.ca> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> <498B4848.7080008@uwaterloo.ca> <498B6D80.2080100@uwaterloo.ca> Message-ID: Or Eliza-over-the-network. On Thu, Feb 5, 2009 at 8:12 PM, Matthias Felleisen wrote: > > > On Feb 5, 2009, at 5:51 PM, Prabhakar Ragde wrote: > >> Shriram Krishnamurthi wrote: >> >>> It's not too hard at all. Our courses routinely assign these kinds of >>> assignments. But we also have to train our students to understand >>> modern systems. >>> SICP was not written for an interactive (in the sense of a >>> computational model) era. The world effort is an strong attempt to >>> make functional programming just as relevant to modern computation. >> >> Now who is setting up dichotomies with loaded use of the word "modern"? >> >> You and your co-authors, in "Structure and Interpretation of the Computer >> Science Curriculum", rightly criticize SICP for requiring too much domain >> knowledge. One obvious use of world.ss is in simulation of physical >> phenomena -- but this requires domain knowledge in physics at least (maybe >> even fluid dynamics), not to mention knowing how to deal with computation >> using inexact numbers, something I would rather avoid in first year. >> >> There must be non-gaming uses of world.ss that use discrete mathematics >> and have serious computer science content. I just have difficulty, >> personally, coming up with them. --PR > > > 1. Recall that universe.ss is replacing world.ss. > > 2. How about a chat server? It's well within reach for universe.ss. Students > can design their own features for the last few weeks of the course: type > Hindi at one end, see German at the other :-) > > -- Matthias > > From plragde at uwaterloo.ca Thu Feb 5 20:47:42 2009 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:39:57 2009 Subject: [plt-scheme] behaviour of void? In-Reply-To: References: <4988DADC.6020403@uwaterloo.ca> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> <498B4848.7080008@uwaterloo.ca> <498B6D80.2080100@uwaterloo.ca> Message-ID: <498B96BE.7090105@uwaterloo.ca> Shriram Krishnamurthi wrote: >> How about a chat server? > Or Eliza-over-the-network. A few years ago, you folks provided a small teachpack to one of the TeachScheme! workshops that did TCP connect/send/receive. I used that to set my students a chat program exercise, where the chat was between two DrScheme interaction windows on different machines. Graphics in this case would be gilding the lily, as would running Eliza over the network instead of on one machine. Do we really have to tart things up in order to sell them to students? (I'm sorry if I'm being curmudgeonly. When I tell my students that Facebook Chat was written in Erlang, they perk up. But that doesn't mean I want them programming Facebook Chat in my course.) --PR From robby at eecs.northwestern.edu Thu Feb 5 20:59:24 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Mar 26 02:39:57 2009 Subject: [plt-scheme] behaviour of void? In-Reply-To: <498B96BE.7090105@uwaterloo.ca> References: <4988DADC.6020403@uwaterloo.ca> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> <498B4848.7080008@uwaterloo.ca> <498B6D80.2080100@uwaterloo.ca> <498B96BE.7090105@uwaterloo.ca> Message-ID: <932b2f1f0902051759v2fba4c4elbaac227705293363@mail.gmail.com> On Thu, Feb 5, 2009 at 7:47 PM, Prabhakar Ragde wrote: > Shriram Krishnamurthi wrote: >>> How about a chat server? >> >> Or Eliza-over-the-network. > > A few years ago, you folks provided a small teachpack to one of the > TeachScheme! workshops that did TCP connect/send/receive. I used that to set > my students a chat program exercise, where the chat was between two DrScheme > interaction windows on different machines. Graphics in this case would be > gilding the lily, as would running Eliza over the network instead of on one > machine. Do we really have to tart things up in order to sell them to > students? (I'm sorry if I'm being curmudgeonly. When I tell my students that > Facebook Chat was written in Erlang, they perk up. But that doesn't mean I > want them programming Facebook Chat in my course.) --PR But world doesn't require graphics. Robby From sk at cs.brown.edu Thu Feb 5 21:04:38 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:39:57 2009 Subject: [plt-scheme] behaviour of void? In-Reply-To: <498B96BE.7090105@uwaterloo.ca> References: <4988DADC.6020403@uwaterloo.ca> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> <498B4848.7080008@uwaterloo.ca> <498B6D80.2080100@uwaterloo.ca> <498B96BE.7090105@uwaterloo.ca> Message-ID: Yep, the Hamlet support code. What I was hoping you would get out of the "Eliza-over-the-network" suggestion was not gilding on a lily, but the idea that it could serve to simulate a (simple) Turing test. On Thu, Feb 5, 2009 at 8:47 PM, Prabhakar Ragde wrote: > Shriram Krishnamurthi wrote: >>> How about a chat server? >> >> Or Eliza-over-the-network. > > A few years ago, you folks provided a small teachpack to one of the > TeachScheme! workshops that did TCP connect/send/receive. I used that to set > my students a chat program exercise, where the chat was between two DrScheme > interaction windows on different machines. Graphics in this case would be > gilding the lily, as would running Eliza over the network instead of on one > machine. Do we really have to tart things up in order to sell them to > students? (I'm sorry if I'm being curmudgeonly. When I tell my students that > Facebook Chat was written in Erlang, they perk up. But that doesn't mean I > want them programming Facebook Chat in my course.) --PR > From matthias at ccs.neu.edu Thu Feb 5 21:04:34 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:39:58 2009 Subject: [plt-scheme] behaviour of void? In-Reply-To: <498B96BE.7090105@uwaterloo.ca> References: <4988DADC.6020403@uwaterloo.ca> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> <498B4848.7080008@uwaterloo.ca> <498B6D80.2080100@uwaterloo.ca> <498B96BE.7090105@uwaterloo.ca> Message-ID: <8C70F2CE-2F90-4273-BEB5-CC19566EF2F3@ccs.neu.edu> Dear Curmudgeon, On Feb 5, 2009, at 8:47 PM, Prabhakar Ragde wrote: > Shriram Krishnamurthi wrote: > >> How about a chat server? >> Or Eliza-over-the-network. > > A few years ago, you folks provided a small teachpack to one of the > TeachScheme! workshops that did TCP connect/send/receive. I used > that to set my students a chat program exercise, where the chat was > between two DrScheme interaction windows on different machines. > Graphics in this case would be gilding the lily, as would running > Eliza over the network instead of on one machine. Do we really have > to tart things up in order to sell them to students? (I'm sorry if > I'm being curmudgeonly. When I tell my students that Facebook Chat > was written in Erlang, they perk up. But that doesn't mean I want > them programming Facebook Chat in my course.) --PR I actually don't know what you want. A chat server is all about text and nothing about text, and in contrast to the Hamsup example that we used to run, the universe teachpack is entirely, completely, totally functional. If you really don't like your students to be chatty, why not write scientific simulations? And, believe it or not, we're open to suggestions: ask and thou shall receive. -- Matthias From sk at cs.brown.edu Thu Feb 5 21:08:29 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:39:58 2009 Subject: [plt-scheme] behaviour of void? In-Reply-To: <8C70F2CE-2F90-4273-BEB5-CC19566EF2F3@ccs.neu.edu> References: <4988DADC.6020403@uwaterloo.ca> <498B4848.7080008@uwaterloo.ca> <498B6D80.2080100@uwaterloo.ca> <498B96BE.7090105@uwaterloo.ca> <8C70F2CE-2F90-4273-BEB5-CC19566EF2F3@ccs.neu.edu> Message-ID: Though, the Hamsup example was carefully designed so that the network protocol was entirely functional! The primitives were imperative (my bad), but the protocol was truly stateless. On Thu, Feb 5, 2009 at 9:04 PM, Matthias Felleisen wrote: > > Dear Curmudgeon, > > > On Feb 5, 2009, at 8:47 PM, Prabhakar Ragde wrote: > >> Shriram Krishnamurthi wrote: >> >> How about a chat server? >>> >>> Or Eliza-over-the-network. >> >> A few years ago, you folks provided a small teachpack to one of the >> TeachScheme! workshops that did TCP connect/send/receive. I used that to set >> my students a chat program exercise, where the chat was between two DrScheme >> interaction windows on different machines. Graphics in this case would be >> gilding the lily, as would running Eliza over the network instead of on one >> machine. Do we really have to tart things up in order to sell them to >> students? (I'm sorry if I'm being curmudgeonly. When I tell my students that >> Facebook Chat was written in Erlang, they perk up. But that doesn't mean I >> want them programming Facebook Chat in my course.) --PR > > > I actually don't know what you want. A chat server is all about text and > nothing about text, and in contrast to the Hamsup example that we used to > run, the universe teachpack is entirely, completely, totally functional. > > If you really don't like your students to be chatty, why not write > scientific simulations? > > And, believe it or not, we're open to suggestions: ask and thou shall > receive. -- Matthias > > > > > From plragde at uwaterloo.ca Thu Feb 5 21:16:57 2009 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:39:58 2009 Subject: [plt-scheme] behaviour of void? In-Reply-To: <8C70F2CE-2F90-4273-BEB5-CC19566EF2F3@ccs.neu.edu> References: <4988DADC.6020403@uwaterloo.ca> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> <498B4848.7080008@uwaterloo.ca> <498B6D80.2080100@uwaterloo.ca> <498B96BE.7090105@uwaterloo.ca> <8C70F2CE-2F90-4273-BEB5-CC19566EF2F3@ccs.neu.edu> Message-ID: <498B9D99.7090805@uwaterloo.ca> Matthias Felleisen wrote: > I actually don't know what you want. Well, I don't know either. Something that is visual but not a game: art, maybe. iTunes visualization. Something that is network-oriented but not just putting two things on different machines. Web-scraping, or doing something with some Google API. > A chat server is all about text and > nothing about text, and in contrast to the Hamsup example that we used > to run, the universe teachpack is entirely, completely, totally functional. I don't remember anything "dys"-functional about that teachpack, but it's been a while. > If you really don't like your students to be chatty, why not write > scientific simulations? Because they don't know enough physics, and because I want to stay away from the serious issues involved in inexact computation, because I can't treat them carefully enough. > And, believe it or not, we're open to suggestions: ask and thou shall > receive. -- Matthias I know that. You folks are terrifically receptive. Just the fact that we're having this conversation instead of my being ignored or flamed by True Believers. What you've achieved is fantastic. So forgive me for using that as a point of departure for thinking about issues which probably transcend this particular pedagogical tool and what can be done with it. --PR From matthias at ccs.neu.edu Thu Feb 5 21:27:52 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:39:58 2009 Subject: [plt-scheme] behaviour of void? In-Reply-To: <498B9D99.7090805@uwaterloo.ca> References: <4988DADC.6020403@uwaterloo.ca> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> <498B4848.7080008@uwaterloo.ca> <498B6D80.2080100@uwaterloo.ca> <498B96BE.7090105@uwaterloo.ca> <8C70F2CE-2F90-4273-BEB5-CC19566EF2F3@ccs.neu.edu> <498B9D99.7090805@uwaterloo.ca> Message-ID: <2EB97994-DD64-4F9F-BFFF-7BC9139056A9@ccs.neu.edu> You could use universe to do a photo-gallery or a tune gallery, kind of like iPhoto. Simulate a cell phone (collaborative work) -- Matthias On Feb 5, 2009, at 9:16 PM, Prabhakar Ragde wrote: > Matthias Felleisen wrote: > >> I actually don't know what you want. > > Well, I don't know either. Something that is visual but not a game: > art, maybe. iTunes visualization. Something that is network- > oriented but not just putting two things on different machines. Web- > scraping, or doing something with some Google API. > >> A chat server is all about text and nothing about text, and in >> contrast to the Hamsup example that we used to run, the universe >> teachpack is entirely, completely, totally functional. > > I don't remember anything "dys"-functional about that teachpack, > but it's been a while. > >> If you really don't like your students to be chatty, why not write >> scientific simulations? > > Because they don't know enough physics, and because I want to stay > away from the serious issues involved in inexact computation, > because I can't treat them carefully enough. > >> And, believe it or not, we're open to suggestions: ask and thou >> shall receive. -- Matthias > > I know that. You folks are terrifically receptive. Just the fact > that we're having this conversation instead of my being ignored or > flamed by True Believers. What you've achieved is fantastic. So > forgive me for using that as a point of departure for thinking > about issues which probably transcend this particular pedagogical > tool and what can be done with it. --PR From geb_a at yahoo.com Thu Feb 5 21:23:53 2009 From: geb_a at yahoo.com (geb a) Date: Thu Mar 26 02:39:58 2009 Subject: [plt-edu] Re: [plt-scheme] behaviour of void? In-Reply-To: Message-ID: <281544.18684.qm@web50911.mail.re2.yahoo.com> So what kinds of exercises are you looking for? I guess I'm in the unique position of being able to use programming to teach Science, Technology, Engineering and Mathematics projects. As a high school teacher, I feel like computer science should be about integrating these disciplines. I think if computer science viewed itself as the means by which these other disciplines communicate, education would be more computer programming centered rather than what we currently have, where students take our courses if they have time or are hard core technogeeks. As a result, I've centered my courses around showing students how knowing HTDP and Dr. Scheme allows them to do more computationally than the other students taking science related courses. As a result, my courses are getting larger (my ninth grade doubled this year). My artificial intelligence course requires one yearlong collaborative project that must meet several requirements. 1) The project must be transformative (transforming information from one form to another) such as pictures to sound or stock market data to sound. 2) The project must involve such large amounts of data that it requires good programming principles or the program will crash and burn. 3) The project must use some core AI technology 4) The project must operate without human intervention (we use scheme servers set up by the students that are dedicated to specific tasks). The result of these projects demonstrates to students how computer programming can help them automate computational tasks that can make their lives easier in some work position. Just my 2 cents. Dan --- On Thu, 2/5/09, Matthias Felleisen wrote: > From: Matthias Felleisen > Subject: [plt-edu] Re: [plt-scheme] behaviour of void? > To: "Prabhakar Ragde" > Cc: "PLT List" , "plt edu" , "Shriram Krishnamurthi" , "Arthur Nunes-Harwit" > Date: Thursday, February 5, 2009, 5:12 PM > On Feb 5, 2009, at 5:51 PM, Prabhakar Ragde wrote: > > > Shriram Krishnamurthi wrote: > > > >> It's not too hard at all. Our courses > routinely assign these kinds of > >> assignments. But we also have to train our > students to understand > >> modern systems. > >> SICP was not written for an interactive (in the > sense of a > >> computational model) era. The world effort is an > strong attempt to > >> make functional programming just as relevant to > modern computation. > > > > Now who is setting up dichotomies with loaded use of > the word "modern"? > > > > You and your co-authors, in "Structure and > Interpretation of the Computer Science Curriculum", > rightly criticize SICP for requiring too much domain > knowledge. One obvious use of world.ss is in simulation of > physical phenomena -- but this requires domain knowledge in > physics at least (maybe even fluid dynamics), not to mention > knowing how to deal with computation using inexact numbers, > something I would rather avoid in first year. > > > > There must be non-gaming uses of world.ss that use > discrete mathematics and have serious computer science > content. I just have difficulty, personally, coming up with > them. --PR > > > 1. Recall that universe.ss is replacing world.ss. > > 2. How about a chat server? It's well within reach for > universe.ss. Students can design their own features for the > last few weeks of the course: type Hindi at one end, see > German at the other :-) > > -- Matthias > > _________________________________________________ > PLT Educators mailing list > plt-edu@list.cs.brown.edu > http://list.cs.brown.edu/mailman/listinfo/plt-edu From grettke at acm.org Thu Feb 5 22:10:32 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:39:58 2009 Subject: [plt-scheme] Hit People Over the Head with HtDP and martial arts!?? In-Reply-To: <498B73F5.1030503@cs.utah.edu> References: <200901202154.n0KLs0jN015492@mail02.syd.optusnet.com.au> <11b141710902051445m145ec0fcmc97b00945b60247c@mail.gmail.com> <990e0c030902051504n1a37853eo35eaa301eb62191e@mail.gmail.com> <498B73F5.1030503@cs.utah.edu> Message-ID: <756daca50902051910k35d6fce7x48c4efe41741902e@mail.gmail.com> It seems like a big difference between martial arts and programming is that you involve muscle memory in the former but not the latter. From robby at eecs.northwestern.edu Thu Feb 5 22:32:55 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Mar 26 02:39:59 2009 Subject: [plt-scheme] Hit People Over the Head with HtDP and martial arts!?? In-Reply-To: <756daca50902051910k35d6fce7x48c4efe41741902e@mail.gmail.com> References: <200901202154.n0KLs0jN015492@mail02.syd.optusnet.com.au> <11b141710902051445m145ec0fcmc97b00945b60247c@mail.gmail.com> <990e0c030902051504n1a37853eo35eaa301eb62191e@mail.gmail.com> <498B73F5.1030503@cs.utah.edu> <756daca50902051910k35d6fce7x48c4efe41741902e@mail.gmail.com> Message-ID: <932b2f1f0902051932l7290a68cr743fc85a9329d78a@mail.gmail.com> On Thu, Feb 5, 2009 at 9:10 PM, Grant Rettke wrote: > It seems like a big difference between martial arts and programming is > that you involve muscle memory in the former but not the latter. I don't know where all the names in the scheme/gui manual are stored in my body, but I wouldn't be surprised if they were in the muscles in my fingers ;) Robby From carl.eastlund at gmail.com Thu Feb 5 22:44:59 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Thu Mar 26 02:39:59 2009 Subject: [plt-scheme] Hit People Over the Head with HtDP and martial arts!?? In-Reply-To: <932b2f1f0902051932l7290a68cr743fc85a9329d78a@mail.gmail.com> References: <200901202154.n0KLs0jN015492@mail02.syd.optusnet.com.au> <11b141710902051445m145ec0fcmc97b00945b60247c@mail.gmail.com> <990e0c030902051504n1a37853eo35eaa301eb62191e@mail.gmail.com> <498B73F5.1030503@cs.utah.edu> <756daca50902051910k35d6fce7x48c4efe41741902e@mail.gmail.com> <932b2f1f0902051932l7290a68cr743fc85a9329d78a@mail.gmail.com> Message-ID: <990e0c030902051944l3f23a442he8852675b2ea091f@mail.gmail.com> On Thu, Feb 5, 2009 at 10:32 PM, Robby Findler wrote: > On Thu, Feb 5, 2009 at 9:10 PM, Grant Rettke wrote: >> It seems like a big difference between martial arts and programming is >> that you involve muscle memory in the former but not the latter. > > I don't know where all the names in the scheme/gui manual are stored > in my body, but I wouldn't be surprised if they were in the muscles in > my fingers ;) I think my brain sends a single impulse for my fingers to type drscheme:language:simple-module-based-language->module-based-language-mixin. Perhaps a second or a third to fix typos. -- Carl Eastlund From maxigas at anargeek.net Thu Feb 5 22:49:04 2009 From: maxigas at anargeek.net (maxigas) Date: Thu Mar 26 02:39:59 2009 Subject: [plt-scheme] daemontools vs. plt-web-server vs. UTF-8 file names Message-ID: <20090206.044904.05374982.maxigas@anargeek.net> hi! i think it's a daemontools issue, but i thought at least i mention it here as well: my Scheme script can read UTF-8 file names if started from terminal, but if started by daemontools, then it can't. it's on Debian etch. it's starting plt-web-server. /etc/stratobe is the service directory: ./run is: #!/bin/sh exec ./stratobe ./stratobe is: #!/bin/sh echo Stratobe firing up... cd /opt/bin/ ./mz /opt/bin/code.ss maxigas From henk at henk.ca Thu Feb 5 23:50:39 2009 From: henk at henk.ca (Henk Boom) Date: Thu Mar 26 02:39:59 2009 Subject: [plt-scheme] Hit People Over the Head with HtDP and martial arts!?? In-Reply-To: <756daca50902051910k35d6fce7x48c4efe41741902e@mail.gmail.com> References: <200901202154.n0KLs0jN015492@mail02.syd.optusnet.com.au> <11b141710902051445m145ec0fcmc97b00945b60247c@mail.gmail.com> <990e0c030902051504n1a37853eo35eaa301eb62191e@mail.gmail.com> <498B73F5.1030503@cs.utah.edu> <756daca50902051910k35d6fce7x48c4efe41741902e@mail.gmail.com> Message-ID: 2009/2/5 Grant Rettke : > It seems like a big difference between martial arts and programming is > that you involve muscle memory in the former but not the latter. You definitely form automatic mental habits, and different ways to think about things. Given that programming is an intellectual activity, I would consider this to be a valid analogy. Henk From danprager at optusnet.com.au Fri Feb 6 00:10:55 2009 From: danprager at optusnet.com.au (danprager@optusnet.com.au) Date: Thu Mar 26 02:39:59 2009 Subject: [plt-scheme] Hit People Over the Head with HtDP and martial arts!?? Message-ID: <200902060510.n165At07028955@mail02.syd.optusnet.com.au> Paul wrote: > Interesting to see, as an experiment, how would work the teaching of > programming as if it were a martial art? Every so often you mean for a > couple of hours with your teacher and you code with him, and maybe you > get also to see your master code with someone else and then you > practice by coding with a partner... This would be an awesome > experience! :D That's more or less how I teach my jiu-jitsu and classical judo class (I didn't invent this method), and quite similar to how we use pair-programming at work (didn't invent that either). -- Dan From erich at snafu.de Fri Feb 6 05:42:24 2009 From: erich at snafu.de (Erich Rast) Date: Thu Mar 26 02:39:59 2009 Subject: [plt-scheme] Transition from 3.x to 4.x (I'm late, I know...) Message-ID: <1233916944.6463.18.camel@darkstar> Hello all, After quite some time I've been looking at some old code from 3.x again and unfortunately it fails to work on 4.x particularly because some of the external collections I'm using don't seem to work. The crypto.plt package has been updated, but I've got troubles getting Oesterholt's excellent internat.plt to work and Jens Axel S?gaard's gzip.plt says it cannot find "zlib.dylib" on OS X 10.5. AFAIK, it worked previously, but when I search for "zlib.dylib" now it doesn't seem to be installed on my system any longer. (I have installed zlib using macports, but DrScheme can't find it, probably because the installation path is non-standard.) 1.) I replaced (module name mzscheme ...) with #lang scheme and it seems that reverse! is no longer available. Is there a way to require an external package with reverse! from srfi 1 in its namespace without modifying the source code? Or is it up to the package maintainer to require srfi/1? 2.) Is there a document that generally describes how to move code from 3.x to 4.x? There have been a few changes since and I can't find a central place describing them in the online docs. 3.) Does anyone know how to make the FFI find zlib on Leopard? Shouldn't it be installed on vanilla OS X 10.5.x anyway? 4.) Is there a "compatibility switch" allowing you to use older packages in 4.x? 5.) What's the difference between using #lang scheme followed by 'top-level' module source code and the old embedded (module name mzscheme ...)? I guess it's best to update the packages themselves and I will notify the package authors, but meanwhile I'd just like to get my old stuff working. Best regards, Erich From noelwelsh at gmail.com Fri Feb 6 06:06:06 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:40:00 2009 Subject: [plt-scheme] Transition from 3.x to 4.x (I'm late, I know...) In-Reply-To: <1233916944.6463.18.camel@darkstar> References: <1233916944.6463.18.camel@darkstar> Message-ID: On Fri, Feb 6, 2009 at 10:42 AM, Erich Rast wrote: > 1.) I replaced (module name mzscheme ...) with #lang scheme and it seems > that reverse! is no longer available. Is there a way to require an > external package with reverse! from srfi 1 in its namespace without > modifying the source code? Or is it up to the package maintainer to > require srfi/1? I think it is up to the package maintainer. > 2.) Is there a document that generally describes how to move code from > 3.x to 4.x? There have been a few changes since and I can't find a > central place describing them in the online docs. http://svn.plt-scheme.org/plt/trunk/doc/release-notes/mzscheme/MzScheme_4.txt > 3.) Does anyone know how to make the FFI find zlib on Leopard? Shouldn't > it be installed on vanilla OS X 10.5.x anyway? Give it the full path. Dunno about default installlation. > 4.) Is there a "compatibility switch" allowing you to use older packages > in 4.x? Not that I know of, but there is the mzscheme language. > 5.) What's the difference between using #lang scheme followed by > 'top-level' module source code and the old embedded (module name > mzscheme ...)? Read the manual and the above. Also, these questions have been asked a zillion times before. Searching the list archive will lead to more detailed answers. N. From chust at web.de Fri Feb 6 06:23:56 2009 From: chust at web.de (Thomas Chust) Date: Thu Mar 26 02:40:00 2009 Subject: [plt-scheme] Transition from 3.x to 4.x (I'm late, I know...) In-Reply-To: <1233916944.6463.18.camel@darkstar> References: <1233916944.6463.18.camel@darkstar> Message-ID: <498C1DCC.104@web.de> Erich Rast wrote: > [...] > 1.) I replaced (module name mzscheme ...) with #lang scheme and it seems > that reverse! is no longer available. Is there a way to require an > external package with reverse! from srfi 1 in its namespace without > modifying the source code? Or is it up to the package maintainer to > require srfi/1? Hello, if you want to use reverse! in your code, do a (require srfi/1), or maybe a more specific (require (only-in srfi/1 reverse!)). However, since PLT Scheme 4.x uses immutable pairs by default, reverse! really is an alias for reverse, which is probably the reason why it is no longer exported by the standard language module. As modules don't share a global namespace, whatever you require has no impact on the availability of reverse! in other code you access. If some external module uses reverse! but doesn't import it, that's not your fault, but that of the external module's author. > [...] > 3.) Does anyone know how to make the FFI find zlib on Leopard? Shouldn't > it be installed on vanilla OS X 10.5.x anyway? I think the zlib installed by default on MacOS X is called /usr/lib/libz.dylib (which is, of course, a symbolic link to a similarly named file, but with the full version number in its name). If the module you require insists on looking for a differently named library, placing another symbolic link with a matching name in /usr/local/lib or, if absolutely necessary, in /usr/lib can't hurt and should remedy the problem. > [...] > 5.) What's the difference between using #lang scheme followed by > 'top-level' module source code and the old embedded (module name > mzscheme ...)? Using #lang scheme is equivalent to using (module name scheme ...). Maybe you want #lang mzscheme instead to use the legacy MzScheme language? cu, Thomas -- When C++ is your hammer, every problem looks like your thumb. From erich at snafu.de Fri Feb 6 06:35:23 2009 From: erich at snafu.de (Erich Rast) Date: Thu Mar 26 02:40:00 2009 Subject: [plt-scheme] Transition from 3.x to 4.x (I'm late, I know...) In-Reply-To: References: <1233916944.6463.18.camel@darkstar> Message-ID: <1233920123.8355.4.camel@darkstar> > Also, these questions have been asked a zillion times before. > Searching the list archive will lead to more detailed answers. Sorry, I didn't have the time to follow the discussion on this mailing list during last year and really should have searched the list archives as you have said. Thanks for answering anyway! I'll contact the package maintainers off the list. Best regards, Erich From jensaxel at soegaard.net Fri Feb 6 07:05:58 2009 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:40:00 2009 Subject: [plt-scheme] Transition from 3.x to 4.x (I'm late, I know...) In-Reply-To: <1233916944.6463.18.camel@darkstar> References: <1233916944.6463.18.camel@darkstar> Message-ID: <498C27A6.8010707@soegaard.net> Erich Rast wrote: > The crypto.plt package has been updated, but I've got troubles getting > Oesterholt's excellent internat.plt to work and Jens Axel S?gaard's > gzip.plt says it cannot find "zlib.dylib" on OS X 10.5. AFAIK, it worked > previously, but when I search for "zlib.dylib" now it doesn't seem to be > installed on my system any longer. (I have installed zlib using > macports, but DrScheme can't find it, probably because the installation > path is non-standard.) As you probably have guessed, I haven't used it on the 4xx series. > 3.) Does anyone know how to make the FFI find zlib on Leopard? Shouldn't > it be installed on vanilla OS X 10.5.x anyway? A little experimenting reveals the name is libz on both both OS X 10.4 and 10.5. (The gzip package was written before I bought my first mac). Would you test whether changing "zlib" to "libz" works for you? http://coach.cs.uchicago.edu/package-source/soegaard/gzip.plt/1/0/gzip.ss Also, change reverse! to reverse. -- Jens Axel S?gard From filcab at gmail.com Fri Feb 6 07:41:13 2009 From: filcab at gmail.com (Filipe Cabecinhas) Date: Thu Mar 26 02:40:00 2009 Subject: [plt-scheme] New plt-dev mailing list In-Reply-To: <18827.21287.639812.751317@arabic.ccs.neu.edu> References: <18827.21287.639812.751317@arabic.ccs.neu.edu> Message-ID: <498C2FE9.6040408@gmail.com> Nice idea, thanks :D Regards, F Eli Barzilay wrote: > In the interests of making the PLT Scheme development process more > open to contributors, we've created a new mailing list, called > "plt-dev", for implementation and development discussion. This new > list will be aimed at people who are interested in contributing to PLT > Scheme, or who are interested in the implementation of PLT Scheme. In > addition, the release process will happen on this list so you can > follow that and perhaps try release candidates too. > > However, the new list is not for general discussion of Scheme, PLT > Scheme, or programming -- such discussions should stay on the > plt-scheme list. As examples, these thread are excellent candidates > for plt-dev: > > http://list.cs.brown.edu/pipermail/plt-scheme/2009-January/029513.html > http://list.cs.brown.edu/pipermail/plt-scheme/2009-January/029831.html > > but these threads should stay on plt-scheme: > > http://list.cs.brown.edu/pipermail/plt-scheme/2009-January/029933.html > http://list.cs.brown.edu/pipermail/plt-scheme/2009-January/029974.html > > Anyone is welcome to lurk on the plt-dev list (and a gmane.org mirror > should be available soon too), but we ask that you keep messages on it > on-topic, since this is the list which we use for the PLT Scheme > development work. > From noelwelsh at gmail.com Fri Feb 6 08:09:18 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:40:00 2009 Subject: [plt-scheme] Hit People Over the Head with HtDP and martial arts!?? In-Reply-To: <11b141710902051445m145ec0fcmc97b00945b60247c@mail.gmail.com> References: <200901202154.n0KLs0jN015492@mail02.syd.optusnet.com.au> <11b141710902051445m145ec0fcmc97b00945b60247c@mail.gmail.com> Message-ID: On Thu, Feb 5, 2009 at 10:45 PM, Paulo J. Matos wrote: > Interesting to see, as an experiment, how would work the teaching of > programming as if it were a martial art? Every so often you mean for a > couple of hours with your teacher and you code with him, and maybe you > get also to see your master code with someone else and then you > practice by coding with a partner... This would be an awesome > experience! :D This idea ties in with the "software craftsmanship" movement, of which the Pragmatic Programmers are perhaps the most visible adherents. Prog. lang. theory addresses the science side of programming, but is largely silent on the practical side. Software craftsmanship is, I think, an essential complement. As for art... well, I'll leave that to others to address. N. From jensaxel at soegaard.net Fri Feb 6 08:24:43 2009 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:40:01 2009 Subject: [plt-scheme] Transition from 3.x to 4.x (I'm late, I know...) In-Reply-To: <498C27A6.8010707@soegaard.net> References: <1233916944.6463.18.camel@darkstar> <498C27A6.8010707@soegaard.net> Message-ID: <498C3A1B.5040508@soegaard.net> Jens Axel Soegaard wrote: > Erich Rast wrote: > >> The crypto.plt package has been updated, but I've got troubles getting >> Oesterholt's excellent internat.plt to work and Jens Axel S?gaard's >> gzip.plt says it cannot find "zlib.dylib" on OS X 10.5. AFAIK, it worked >> previously, but when I search for "zlib.dylib" now it doesn't seem to be >> installed on my system any longer. (I have installed zlib using >> macports, but DrScheme can't find it, probably because the installation >> path is non-standard.) I have updated the PLaneT package to version 4xx now. It works for me on OS X 10.5. I'd like to hear whether everything works on Windows, Linux and OS X 10.4. http://coach.cs.uchicago.edu/package-source/soegaard/gzip.plt/2/0/doc.txt -- Jens Axel S?gaard From jay.mccarthy at gmail.com Fri Feb 6 08:35:18 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:40:01 2009 Subject: [plt-scheme] daemontools vs. plt-web-server vs. UTF-8 file names In-Reply-To: <20090206.044904.05374982.maxigas@anargeek.net> References: <20090206.044904.05374982.maxigas@anargeek.net> Message-ID: My guess is that your shell's initialization script (.profile or .bashrc) sets up the language encoding environment variables (LC_ALL, LC_CTYPE and LANG) "correctly", while daemontool's environment does not. Jay On Thu, Feb 5, 2009 at 8:49 PM, maxigas wrote: > hi! > > i think it's a daemontools issue, but i thought at least i mention it here as well: > > my Scheme script can read UTF-8 file names if started from terminal, but if started by > daemontools, then it can't. it's on Debian etch. it's starting plt-web-server. > > /etc/stratobe is the service directory: > > ./run is: > > #!/bin/sh > exec ./stratobe > > ./stratobe is: > > #!/bin/sh > echo Stratobe firing up... > cd /opt/bin/ > ./mz /opt/bin/code.ss > > maxigas > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From sbloch at adelphi.edu Fri Feb 6 09:48:03 2009 From: sbloch at adelphi.edu (Stephen Bloch) Date: Thu Mar 26 02:40:01 2009 Subject: [plt-scheme] Re: animation projects, video-game and not In-Reply-To: <932b2f1f0902051214g1148d325hcb6c6042dbc737a1@mail.gmail.com> References: <4988DADC.6020403@uwaterloo.ca> <3C35B536-68FF-42E8-B80D-3DB88D13CEF6@ccs.neu.edu> <756daca50902032010o5d8d3ff8g8b43d1d881f20bac@mail.gmail.com> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> <932b2f1f0902051214g1148d325hcb6c6042dbc737a1@mail.gmail.com> Message-ID: <3D5A6BB6-4A85-48F6-A74A-9B991291597C@adelphi.edu> > On Thu, Feb 5, 2009 at 1:01 PM, Arthur Nunes-Harwit > wrote: >> Hi, >> >> I see a lot of projects that are video games. Such projects >> ultimately rely >> input and output, or side effects (perhaps disguised via monads). >> The coding >> style for much of HtDP is purely functional. What is the pedagogical >> impact? Do the students notice? (As a student, I didn't notice >> right away >> that read was different from square.) Is there any discussion of >> "special" >> functions or objects? >> >> What is the impact of other languages such as Java where the >> assumption >> [built into the language libraries] is that everything is done >> using side >> effects? To what extent is it still possible to take a mostly >> functional >> approach? Matthias, Robby, etc. have suggested some readings. You might also take a look at (the January draft of) my textbook, which emphasizes world-based animation throughout. No explicit mention of input; instead, students write event handlers for mouse, keyboard, and timer events (just as in Java GUI-based programs). No explicit mention of output; instead, students write event handlers for redraw events (somewhat as in Java GUI-based programs; the main difference is that the event handler _returns_ an image rather than _modifying_ an image). No explicit mention of state or side effects; this differs from the usual practice in Java-based GUI's, but the designers of the Java class libraries _could_ have done it this way. In fact, I'm sure one could write a functional front end for much of the Java GUI libraries, giving it an API analogous to DrScheme's world or universe teachpacks. Let's see... what non-video-game animations do I have? The following are really easy examples, the sort that students in my "programming for non-majors" course would be doing before mid-semester. * Write an animation of a parametric equation, e.g. x= 100+50cos(t/ 10), y=100+30sin(t/10), which traces an ellipse; changing the constants allows you to do some fun and easy mathematical experiments. * Another easy, early example is simply following the mouse with a specified image; this is what's happening inside your computer all the time with a visible cursor. * Another easy, early example is a progress bar, as one sees all the time in real operating systems. * There's an exercise to allow a user to "type" into a text field. A later version adds support for delete, left and right arrow keys. * A digital clock. Later, an analogue clock. * Slide shows. * E-commerce: choose from a menu of items and see a picture of it. I haven't done as much work on coming up with substantial projects, like the video-game examples others have posted; I need more of those in the book :-) Stephen Bloch sbloch@adelphi.edu From raould at gmail.com Fri Feb 6 11:54:53 2009 From: raould at gmail.com (Raoul Duke) Date: Thu Mar 26 02:40:01 2009 Subject: [plt-scheme] Re: animation projects, video-game and not In-Reply-To: <3D5A6BB6-4A85-48F6-A74A-9B991291597C@adelphi.edu> References: <4988DADC.6020403@uwaterloo.ca> <3C35B536-68FF-42E8-B80D-3DB88D13CEF6@ccs.neu.edu> <756daca50902032010o5d8d3ff8g8b43d1d881f20bac@mail.gmail.com> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> <932b2f1f0902051214g1148d325hcb6c6042dbc737a1@mail.gmail.com> <3D5A6BB6-4A85-48F6-A74A-9B991291597C@adelphi.edu> Message-ID: <91a2ba3e0902060854r52f02d6ftd9c8a8539cc89824@mail.gmail.com> > I haven't done as much work on coming up with substantial projects, like the > video-game examples others have posted; I need more of those in the book :-) some other small random food for thought examples i've found interesting: + Asteroids in CAL (http://tinyurl.com/b7j7og) + Hieroglyph (http://tinyurl.com/da9xf5) + FRP style things -- anything by Conal Elliott, the Yampa stuff From matthias at ccs.neu.edu Fri Feb 6 12:34:54 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:40:01 2009 Subject: [plt-scheme] Re: animation projects, video-game and not In-Reply-To: <91a2ba3e0902060854r52f02d6ftd9c8a8539cc89824@mail.gmail.com> References: <4988DADC.6020403@uwaterloo.ca> <3C35B536-68FF-42E8-B80D-3DB88D13CEF6@ccs.neu.edu> <756daca50902032010o5d8d3ff8g8b43d1d881f20bac@mail.gmail.com> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> <932b2f1f0902051214g1148d325hcb6c6042dbc737a1@mail.gmail.com> <3D5A6BB6-4A85-48F6-A74A-9B991291597C@adelphi.edu> <91a2ba3e0902060854r52f02d6ftd9c8a8539cc89824@mail.gmail.com> Message-ID: On Feb 6, 2009, at 11:54 AM, Raoul Duke wrote: > + FRP style things -- anything by Conal Elliott, the Yampa stuff How do you think this would differ from universe/world programming? Also both are merely frameworks in the style of universe. What concrete examples do you have in mind? -- Matthias From jay.mccarthy at gmail.com Fri Feb 6 12:56:39 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:40:01 2009 Subject: [plt-scheme] Simple Server setup abstraction in the PLT Web Server Message-ID: >From http://jay-mccarthy.blogspot.com/2009/02/simple-server-setup-abstraction-in-plt.html: The PLT Web Server provides serve/servlet to start a server specifically for a single servlet and immediately launch a browser to it. This is how the Instant Servlet language works. One of the frustrating things about this interface is that you can't change what dispatchers the simple servers use, so if you want to build a dispatcher for a single servlet or start a server and launch a browser, you must copy the code. Both of these subtasks are now abstracted into helper functions: * dispatch/servlet: Builds a dispatcher to run a servlet . * serve/launch/wait: Starts a Web Server instance and launches a browser to one of its URLs. Documentation links: http://faculty.cs.byu.edu/~jay/plt-doc/web-server/servlet-env_ss.html (now) http://docs.plt-scheme.org/web-server/servlet-env_ss.html (later) -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From raould at gmail.com Fri Feb 6 13:06:57 2009 From: raould at gmail.com (Raoul Duke) Date: Thu Mar 26 02:40:02 2009 Subject: [plt-scheme] Re: animation projects, video-game and not In-Reply-To: References: <4988DADC.6020403@uwaterloo.ca> <756daca50902032010o5d8d3ff8g8b43d1d881f20bac@mail.gmail.com> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> <932b2f1f0902051214g1148d325hcb6c6042dbc737a1@mail.gmail.com> <3D5A6BB6-4A85-48F6-A74A-9B991291597C@adelphi.edu> <91a2ba3e0902060854r52f02d6ftd9c8a8539cc89824@mail.gmail.com> Message-ID: <91a2ba3e0902061006m36a94cbdh966122cfa02849b0@mail.gmail.com> hi, >> + FRP style things -- anything by Conal Elliott, the Yampa stuff > How do you think this would differ from universe/world programming? Also > both are merely frameworks in the style of universe. What concrete examples > do you have in mind? sorry if i came across misleadingly -- i meant only that there are more projects and people who have code / blogs / papers about the overarching topic. i have found some to be more able to give me an "ah hah!" moment than others, so personally it always helps to have a range of things to look at. (also, even when things are similar, it is interesting to think about what actually does make them subtly different.) and, some folks have particular programming language biases. but overall, i say the more the merrier, and hopefully the field can grow and improve and teach all those imperative whipper-snappers a thing or two some day. :-) sincerely. From clements at brinckerhoff.org Fri Feb 6 16:12:13 2009 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:40:02 2009 Subject: [plt-edu] Re: [plt-scheme] behaviour of void? In-Reply-To: <281544.18684.qm@web50911.mail.re2.yahoo.com> References: <281544.18684.qm@web50911.mail.re2.yahoo.com> Message-ID: On Feb 5, 2009, at 6:23 PM, geb a wrote: > So what kinds of exercises are you looking for? Meta-constructivism! That is, give the students the chance to design tools whose *use* will help them learn. These can be "tight-loop" projects like self- quizzers and grade predictors, or they can be "loose-loop" projects like time management tools and to-do-list organizers. Either way, the students are motivated to do a good job because they actually want to use the thing itself in order to improve their performance in this and other classes! 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/20090206/ffd0d3d7/smime.bin From matthias at ccs.neu.edu Fri Feb 6 16:28:58 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:40:02 2009 Subject: [plt-edu] Re: [plt-scheme] behaviour of void? In-Reply-To: References: <281544.18684.qm@web50911.mail.re2.yahoo.com> Message-ID: <7F3C11F5-B559-4C96-80FE-21A08A92CA4E@ccs.neu.edu> So have you tried this at CalPoly? It sounds too good to be true :-) On Feb 6, 2009, at 4:12 PM, John Clements wrote: > > On Feb 5, 2009, at 6:23 PM, geb a wrote: > >> So what kinds of exercises are you looking for? > > Meta-constructivism! > > > That is, give the students the chance to design tools whose *use* > will help them learn. These can be "tight-loop" projects like self- > quizzers and grade predictors, or they can be "loose-loop" projects > like time management tools and to-do-list organizers. Either way, > the students are motivated to do a good job because they actually > want to use the thing itself in order to improve their performance > in this and other classes! > > John > From clements at brinckerhoff.org Fri Feb 6 16:34:58 2009 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:40:03 2009 Subject: [plt-edu] Re: [plt-scheme] behaviour of void? In-Reply-To: <7F3C11F5-B559-4C96-80FE-21A08A92CA4E@ccs.neu.edu> References: <281544.18684.qm@web50911.mail.re2.yahoo.com> <7F3C11F5-B559-4C96-80FE-21A08A92CA4E@ccs.neu.edu> Message-ID: On Feb 6, 2009, at 1:28 PM, Matthias Felleisen wrote: > > So have you tried this at CalPoly? It sounds too good to be true :-) Ha! They won't let my ideas anywhere *near* the intro curriculum; I'm officially the 102 coordinator, but we have to teach in C and Java... because that's what the EE majors want. Don't get me started. To answer your question, then: no, this is all purely hypothetical. I'm waiting for the day I can give it a try. John > > On Feb 6, 2009, at 4:12 PM, John Clements wrote: > >> >> On Feb 5, 2009, at 6:23 PM, geb a wrote: >> >>> So what kinds of exercises are you looking for? >> >> Meta-constructivism! >> >> >> That is, give the students the chance to design tools whose *use* >> will help them learn. These can be "tight-loop" projects like self- >> quizzers and grade predictors, or they can be "loose-loop" projects >> like time management tools and to-do-list organizers. Either way, >> the students are motivated to do a good job because they actually >> want to use the thing itself in order to improve their performance >> in this and other classes! >> >> John >> > > _________________________________________________ > PLT Educators mailing list > plt-edu@list.cs.brown.edu > http://list.cs.brown.edu/mailman/listinfo/plt-edu -------------- 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/20090206/9c7659a1/smime.bin From morazanm at gmail.com Fri Feb 6 17:20:03 2009 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:40:03 2009 Subject: [plt-scheme] Re: animation projects, video-game and not In-Reply-To: <91a2ba3e0902061006m36a94cbdh966122cfa02849b0@mail.gmail.com> References: <4988DADC.6020403@uwaterloo.ca> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> <932b2f1f0902051214g1148d325hcb6c6042dbc737a1@mail.gmail.com> <3D5A6BB6-4A85-48F6-A74A-9B991291597C@adelphi.edu> <91a2ba3e0902060854r52f02d6ftd9c8a8539cc89824@mail.gmail.com> <91a2ba3e0902061006m36a94cbdh966122cfa02849b0@mail.gmail.com> Message-ID: <9b1fff280902061420h13d20df6s7e4a6420b1042958@mail.gmail.com> > > but overall, i say the more the merrier, and hopefully the field can > grow and improve and teach all those imperative whipper-snappers a > thing or two some day. :-) > Now, now, let us not go bad-mouthing the imperative world. After all, it does have its place and value in computing. Perhaps, it should not have the prominent placement it has now but we can not just dismiss it out of hand. Mutation is sometimes quite useful. Regarding the main topic of this discussion, let me come down in favor of simulations and video games using universe/world. My students are actually intrigued and giggle when they discover that they can write games and simulations. I have learned that my particular students in my particular neck of the woods feel overwhelmed if asked to write a non-trivial game/simulation from scratch. With some guidance and encouragment (and lots of patience sometimes), they get things going and upon finishing feel more empowered. I did not quite get the same reaction from, for example, having them write an evaluator. They are simply not turned on by such things yet (but they will be when I get them in my Programming Languages course :-). -- Cheers, Marco From raould at gmail.com Fri Feb 6 17:26:15 2009 From: raould at gmail.com (Raoul Duke) Date: Thu Mar 26 02:40:03 2009 Subject: [plt-scheme] Re: animation projects, video-game and not In-Reply-To: <9b1fff280902061420h13d20df6s7e4a6420b1042958@mail.gmail.com> References: <4988DADC.6020403@uwaterloo.ca> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> <932b2f1f0902051214g1148d325hcb6c6042dbc737a1@mail.gmail.com> <3D5A6BB6-4A85-48F6-A74A-9B991291597C@adelphi.edu> <91a2ba3e0902060854r52f02d6ftd9c8a8539cc89824@mail.gmail.com> <91a2ba3e0902061006m36a94cbdh966122cfa02849b0@mail.gmail.com> <9b1fff280902061420h13d20df6s7e4a6420b1042958@mail.gmail.com> Message-ID: <91a2ba3e0902061426p226c7fadq66f4afd5d6ae6ab8@mail.gmail.com> > Now, now, let us not go bad-mouthing the imperative world. After all, > it does have its place and value in computing. Perhaps, it should not > have the prominent placement it has now but we can not just dismiss it > out of hand. Mutation is sometimes quite useful. true! that's why we have monads. ;-) From jay.mccarthy at gmail.com Fri Feb 6 18:30:37 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:40:04 2009 Subject: [plt-scheme] Introducing... Stuffers Message-ID: >From http://jay-mccarthy.blogspot.com/2009/02/introducing-stuffers.html: The PLT Web Server stateless servlet language allows continuations to be serialized. This subtle features can produce entirely RESTful Web applications that use send/suspend, because continuations can be given to clients, rather than kept on the server. Before today, the serialization process was not customizable. There was a single default. But now, you can write your own stuffers using the Stuffer API and instruct the server to use them in your servlet code. Currently there are stuffers for: * GZip-ing * Base64 encoding * MD5 content-addressed filesystem storage In the future, I will be adding support for encrypting and signing, in addition to content-addressed database storage through SQLite, CouchDB, and BerkeleyDB. Documentation links: http://faculty.cs.byu.edu/~jay/plt-doc/web-server/stuffers_ss.html (now) http://docs.plt-scheme.org/web-server/stuffers_ss.html (later) The default as an example: http://faculty.cs.byu.edu/~jay/plt-doc/web-server/stuffers_ss.html#(def._((lib._web-server/lang/stuff-url..ss)._make-default-stuffer)) -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From redlmg98 at hotmail.com Fri Feb 6 18:46:14 2009 From: redlmg98 at hotmail.com (Lisa Gandy) Date: Thu Mar 26 02:40:04 2009 Subject: [plt-scheme] dot notation issue Message-ID: Hi, I have the following code.. (define (same-parity p . x) (define ind (remainder p 2)) (cond ((null? x) '()) ((= ind (remainder (car x) 2)) (cons (car x) (same-parity p (cdr x)))) (else (same-parity p (cdr x))))) I thought that x would be passed in as a list however when I run this function I get... (require (lib "trace.ss")) > (trace same-parity) > (same-parity 1 2 3 4 5) |(same-parity 1 2 3 4 5) |(same-parity 1 (3 4 5)) What is going on here? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090206/ec276657/attachment.html From yinso.chen at gmail.com Fri Feb 6 18:52:41 2009 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:40:05 2009 Subject: [plt-scheme] dot notation issue In-Reply-To: References: Message-ID: <779bf2730902061552j4dc1178oa7d806946152b2c8@mail.gmail.com> On Fri, Feb 6, 2009 at 3:46 PM, Lisa Gandy wrote: > Hi, > I have the following code.. > > (define (same-parity p . x) > (define ind (remainder p 2)) > (cond ((null? x) '()) > ((= ind (remainder (car x) 2)) > (cons (car x) (same-parity p (cdr x)))) > (else (same-parity p (cdr x))))) > Try (apply same-parity p (cdr x)). Cheers, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090206/5b6e9343/attachment.htm From henk at henk.ca Fri Feb 6 19:53:00 2009 From: henk at henk.ca (Henk Boom) Date: Thu Mar 26 02:40:05 2009 Subject: [plt-scheme] Introducing... Stuffers In-Reply-To: References: Message-ID: 2009/2/6 Jay McCarthy : > >From http://jay-mccarthy.blogspot.com/2009/02/introducing-stuffers.html: > > The PLT Web Server stateless servlet language allows continuations to > be serialized. This subtle features can produce entirely RESTful Web > applications that use send/suspend, because continuations can be given > to clients, rather than kept on the server. This sounds cool =). I've been meaning to ask this for a while, but what are the security consequences with storing the continuation on the (untrusted) client's computer? Henk From raould at gmail.com Fri Feb 6 20:00:08 2009 From: raould at gmail.com (Raoul Duke) Date: Thu Mar 26 02:40:05 2009 Subject: [plt-scheme] Introducing... Stuffers In-Reply-To: References: Message-ID: <91a2ba3e0902061700l23842b3j7b0a5b99257fb6e@mail.gmail.com> > I've been meaning to ask this for a while, but what are the security > consequences with storing the continuation on the (untrusted) client's > computer? hm, mr no security expert here, but i'd guess it would be very similar to whatever the deal is with cookies. i mean, you can encrypt the continuation so the client most likely can't read it, but they could still transfer it to a different machine or replay it a lot or whatever, so your server would have to deal with that. ? From henk at henk.ca Fri Feb 6 20:15:40 2009 From: henk at henk.ca (Henk Boom) Date: Thu Mar 26 02:40:05 2009 Subject: [plt-scheme] Introducing... Stuffers In-Reply-To: <91a2ba3e0902061700l23842b3j7b0a5b99257fb6e@mail.gmail.com> References: <91a2ba3e0902061700l23842b3j7b0a5b99257fb6e@mail.gmail.com> Message-ID: 2009/2/6 Raoul Duke : >> I've been meaning to ask this for a while, but what are the security >> consequences with storing the continuation on the (untrusted) client's >> computer? > > hm, mr no security expert here, but i'd guess it would be very similar > to whatever the deal is with cookies. > i mean, you can encrypt the continuation so the client most likely > can't read it, but they could still transfer it to a different machine > or replay it a lot or whatever, so your server would have to deal with > that. Cookies are usually used to uniquely identify the user, so that the right session can be loaded by the server, whereas in this case the continuation itself is on the client's machine. I was thinking more along the lines of people modifying their continuations to make the server execute different code. I'm asking because I don't know enough about how the continuations are serialized to know what the dangers are, and as far as I can see the documentation makes no mention of security considerations. Henk From rcleis at mac.com Fri Feb 6 20:17:36 2009 From: rcleis at mac.com (Richard Cleis) Date: Thu Mar 26 02:40:06 2009 Subject: [plt-scheme] dot notation issue In-Reply-To: References: Message-ID: <6E5F27A0-A575-4E93-A285-7F9A900457E9@mac.com> To find out what is going on, make a function like same-parity that simply returns the dotted x. Then, try it in the interactions window to see what the function gets for x. Use arguments that are like the ones you expect to be created in same-parity. rac On Feb 6, 2009, at 4:46 PM, Lisa Gandy wrote: > Hi, > I have the following code.. > > (define (same-parity p . x) > (define ind (remainder p 2)) > (cond ((null? x) '()) > ((= ind (remainder (car x) 2)) > (cons (car x) (same-parity p (cdr x)))) > (else (same-parity p (cdr x))))) > > I thought that x would be passed in as a list however > when I run this function I get... > (require (lib "trace.ss")) > > (trace same-parity) > > (same-parity 1 2 3 4 5) > |(same-parity 1 2 3 4 5) > |(same-parity 1 (3 4 5)) > > What is going on here? > > Thanks! > _________________________________________________ > 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/20090206/a5d95f5c/attachment.html From raould at gmail.com Fri Feb 6 20:23:06 2009 From: raould at gmail.com (Raoul Duke) Date: Thu Mar 26 02:40:06 2009 Subject: [plt-scheme] Introducing... Stuffers In-Reply-To: References: <91a2ba3e0902061700l23842b3j7b0a5b99257fb6e@mail.gmail.com> Message-ID: <91a2ba3e0902061723j76162074y9c0ac2e0d9b36c1c@mail.gmail.com> hi, > Cookies are usually used to uniquely identify the user, so that the > right session can be loaded by the server, whereas in this case the > continuation itself is on the client's machine. I was thinking more > along the lines of people modifying their continuations to make the > server execute different code. I'm asking because I don't know enough > about how the continuations are serialized to know what the dangers > are, and as far as I can see the documentation makes no mention of > security considerations. sorry, i might be clueless or not speaking well :-} because you can have the server encrypt the serialized continuations before sending them to the client, you can sorta just say that particular security issue isn't relevant. (well, it actually is, because encryption will tend to bloat things, of course, but ignoring that...) which means since they can't muck with them in any productive way, you get to issues that are the issues we have about storing anything on the client machine, just like with cookies. there are situations where somebody can manage to get a copy of your cookie (via xss attack or phishing or whatever) and use that to log into e.g. gmail w/out ever needing to enter a user name and password! bad news! so people could steal the continuation as well (assuming e.g. the continuation is stored as a cookie since that is the standard client-side storage mechanism) and then do whatever it is you were doing --- but only if the server side is written w/out such security concerns in mind. sorry if i'm still misunderstanding / not making any sense :-( sincerely. From jay.mccarthy at gmail.com Fri Feb 6 20:43:52 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:40:06 2009 Subject: [plt-scheme] Introducing... Stuffers In-Reply-To: References: <91a2ba3e0902061700l23842b3j7b0a5b99257fb6e@mail.gmail.com> Message-ID: On Fri, Feb 6, 2009 at 6:15 PM, Henk Boom wrote: > 2009/2/6 Raoul Duke : >>> I've been meaning to ask this for a while, but what are the security >>> consequences with storing the continuation on the (untrusted) client's >>> computer? >> >> hm, mr no security expert here, but i'd guess it would be very similar >> to whatever the deal is with cookies. >> i mean, you can encrypt the continuation so the client most likely >> can't read it, but they could still transfer it to a different machine >> or replay it a lot or whatever, so your server would have to deal with >> that. > > Cookies are usually used to uniquely identify the user, so that the > right session can be loaded by the server, whereas in this case the > continuation itself is on the client's machine. I was thinking more > along the lines of people modifying their continuations to make the > server execute different code. I'm asking because I don't know enough > about how the continuations are serialized to know what the dangers > are, and as far as I can see the documentation makes no mention of > security considerations. The point of stuffers is for you to control how the continuations get serialized. If you just use serialize-stuffer, then the user can change anything they want. They can only get you to run code that you've already written, but they can change values in the environment. If you use the md5-stuffer, then they never get the continuation, so it's no big deal. If you write a encryption or signing stuffer (which is a really trivial wrapper over openssl, I'll probably have one by noon when I work again on monday), then you can just encrypt/sign the cont. If you encrypt, they can't modify and observe. If you just sign, then they can't modify, but could observe (depending on the algorithm, obvs.) Basically, if you're worried use encrypt/sign or md5, but unless you have stuff like usernames, the environment won't be a very good attack vector. (For example, in Continue you'd be able to change the sort state, whooptity-doo.) Jay -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From sbloch at adelphi.edu Fri Feb 6 22:58:05 2009 From: sbloch at adelphi.edu (Stephen Bloch) Date: Thu Mar 26 02:40:06 2009 Subject: [plt-scheme] Introducing... Stuffers In-Reply-To: References: <91a2ba3e0902061700l23842b3j7b0a5b99257fb6e@mail.gmail.com> Message-ID: <954DCBAD-F9C3-4F92-B19C-BC74757A18EF@adelphi.edu> On Feb 6, 2009, at 8:43 PM, Jay McCarthy wrote: > If you just use serialize-stuffer, then the user can change anything > they want. They can only get you to run code that you've already > written, but they can change values in the environment. I suspect "the environment" could well be a target, but I'm more worried about "They can only get you to run code that you've already written." What exactly does this mean; what are its limits? Would it be possible to change the continuation so, say, it loads a user- specified file on the server and evaluates a user-specified expression using definitions from that file? Stephen Bloch sbloch@adelphi.edu From jay.mccarthy at gmail.com Fri Feb 6 23:10:03 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:40:07 2009 Subject: [plt-scheme] Introducing... Stuffers In-Reply-To: <954DCBAD-F9C3-4F92-B19C-BC74757A18EF@adelphi.edu> References: <91a2ba3e0902061700l23842b3j7b0a5b99257fb6e@mail.gmail.com> <954DCBAD-F9C3-4F92-B19C-BC74757A18EF@adelphi.edu> Message-ID: On Fri, Feb 6, 2009 at 8:58 PM, Stephen Bloch wrote: > > On Feb 6, 2009, at 8:43 PM, Jay McCarthy wrote: > >> If you just use serialize-stuffer, then the user can change anything >> they want. They can only get you to run code that you've already >> written, but they can change values in the environment. > > I suspect "the environment" could well be a target, Yes, it could be a target. > but I'm more worried > about "They can only get you to run code that you've already written." What > exactly does this mean; what are its limits? The transformation gives a distinct name to every continuation in the program. These names are allowed to occur in the serialized representation. So, suppose the serialization contains "k20", a hacker could change it to "k21" and see what happens, as so on. The only way I can think of executing arbitrary code is if one of your continuation is something like 'eval' that executes an s-expr in the environment. (Just including a closure in the environment is not problematic... these are labelled in the same way as continuations.) > Would it be possible to change > the continuation so, say, it loads a user-specified file on the server and > evaluates a user-specified expression using definitions from that file? If understand you, no. If the hacker could upload code through another channel, they could compile it using the transformation and therefore get the continuation to refer to it. These "problems" are definitely hypothetical though. They can be easily avoided with encryption, signing, or the hash-based storage. Jay -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From ray.racine at comcast.net Sat Feb 7 07:37:42 2009 From: ray.racine at comcast.net (Ray Racine) Date: Thu Mar 26 02:40:07 2009 Subject: [plt-scheme] Introducing... Stuffers In-Reply-To: References: <91a2ba3e0902061700l23842b3j7b0a5b99257fb6e@mail.gmail.com> Message-ID: <1234010262.3066.7.camel@bpel.ray.na.odcorp.net> ... > If you just use serialize-stuffer, then the user can change anything > they want. ... > If you use the md5-stuffer, then they never get the continuation, so > it's no big deal. There is a standard technique for a Server to send data (in this case the serialized continuation) freely out into the wild and woolly internet and ensure that the returned data has not been tainted or hijacked in anyway. The technique is based upon a signature such as MD-5 or SHA1 and a secret key. You could use it to send a continuation from one server to another in your cluster via user's cookie for example and the receiving Server can confidentially determine that the data was "minted" by a trusted peer Server for example. See HMAC on Wikipedia. From jay.mccarthy at gmail.com Sat Feb 7 08:14:16 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:40:07 2009 Subject: [plt-scheme] Introducing... Stuffers In-Reply-To: <1234010262.3066.7.camel@bpel.ray.na.odcorp.net> References: <91a2ba3e0902061700l23842b3j7b0a5b99257fb6e@mail.gmail.com> <1234010262.3066.7.camel@bpel.ray.na.odcorp.net> Message-ID: Thanks Ray, that is exactly what I planned on implementing. (Basically what my old HMAC [1] and secure url-param [2] PLaneT packages do.) The point of this post was that any PLT WS user can write whatever kind of serializer they need. I only initially wrote the ones that correspond to the prior default behavior. Jay 1. http://planet.plt-scheme.org/package-source/jaymccarthy/hmac-sha1.plt/1/1/hmac-sha1.ss 2. http://planet.plt-scheme.org/package-source/jaymccarthy/url-param.plt/2/0/secure.ss On Sat, Feb 7, 2009 at 5:37 AM, Ray Racine wrote: > ... >> If you just use serialize-stuffer, then the user can change anything >> they want. > ... > >> If you use the md5-stuffer, then they never get the continuation, so >> it's no big deal. > > There is a standard technique for a Server to send data (in this case > the serialized continuation) freely out into the wild and woolly > internet and ensure that the returned data has not been tainted or > hijacked in anyway. The technique is based upon a signature such as > MD-5 or SHA1 and a secret key. > > You could use it to send a continuation from one server to another in > your cluster via user's cookie for example and the receiving Server can > confidentially determine that the data was "minted" by a trusted peer > Server for example. > > See HMAC on Wikipedia. > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From jcoglan at googlemail.com Sat Feb 7 08:34:38 2009 From: jcoglan at googlemail.com (James Coglan) Date: Thu Mar 26 02:40:07 2009 Subject: [plt-scheme] Continuations and (begin) Message-ID: Hi all, Say I have the following: (define r #f) (define count-calls 0) (begin (call/cc (lambda (k) (set! r k) #t)) (set! count-calls (+ count-calls 1))) (r #t) (r #t) (r #t) I would expect count-calls to equal 4 after this, but it equals 1. The continuation, from what little I've read about this, should look like: ([#procedure] [#hole] (set! count-calls (+ count-calls 1))) where 'begin' has been evaluated, but the (set!) expression has not. Surely picking up again from #hole should call (set!) each time? I could understand this behaviour if I'd instead written: (begin (set! count-calls (+ count-calls 1)) (call/cc (lambda (k) (set! r k) #t))) (r #t) (r #t) (r #t) Then the continuation would be: ([#procedure] [#undefined] [#hole]) Could someone explain what's going on, and tell me whether there are other exceptions I'd be surprised by? I thought maybe it was saving the state of all variables with the continuation, but this would seem to refute that: (set! count-calls 0) (define (foo) (call/cc (lambda (k) (set! r k) #t)) (set! count-calls (+ count-calls 1))) (foo) (r #t) (r #t) (r #t) ; count-calls = 4 -- James Coglan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090207/93fbf44a/attachment.htm From mflatt at cs.utah.edu Sat Feb 7 08:43:00 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:40:08 2009 Subject: [plt-scheme] Continuations and (begin) In-Reply-To: References: Message-ID: <20090207134302.6D5506500A3@mail-svr1.cs.utah.edu> At Sat, 7 Feb 2009 13:34:38 +0000, James Coglan wrote: > (begin > (call/cc > (lambda (k) > (set! r k) > #t)) > (set! count-calls (+ count-calls 1))) > (r #t) (r #t) (r #t) > > I would expect count-calls to equal 4 after this, but it equals 1. The > continuation, from what little I've read about this, should look like: > > ([#procedure] [#hole] (set! count-calls (+ count-calls 1))) The body of a top-level `begin' is spliced into the top-level sequence, so the `begin' above doesn't usefully group the two expressions. (To put it another way, a top-level `begin' wraps a prompt around each of its sub-expressions.) Try (let () (call/cc (lambda (k) (set! r k) #t)) (set! count-calls (+ count-calls 1))) Matthew From syhpoon at syhpoon.name Sat Feb 7 09:47:33 2009 From: syhpoon at syhpoon.name (Max E. Kuznecov) Date: Thu Mar 26 02:40:08 2009 Subject: [plt-scheme] Conditions in web-templates Message-ID: <20090207144733.GA1384@syhpoon-hq.freenet.com.ua> Hi, I'm using plt web-server for my project. Content is rendered using web-server/templates module. I've got a questions about @-syntax: Is it possible to render a particular template branch using some condition as a criterion? I.e. I'd like to be able to write something of the kind: @if(expr){ branch1 } { else-branch } Thanks. -- ~syhpoon From vkp at ccs.neu.edu Sat Feb 7 10:00:23 2009 From: vkp at ccs.neu.edu (Viera Proulx) Date: Thu Mar 26 02:40:08 2009 Subject: [plt-scheme] Re: [plt-edu] Re: animation projects, video-game and not In-Reply-To: <3D5A6BB6-4A85-48F6-A74A-9B991291597C@adelphi.edu> References: <4988DADC.6020403@uwaterloo.ca> <3C35B536-68FF-42E8-B80D-3DB88D13CEF6@ccs.neu.edu> <756daca50902032010o5d8d3ff8g8b43d1d881f20bac@mail.gmail.com> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> <932b2f1f0902051214g1148d325hcb6c6042dbc737a1@mail.gmail.com> <3D5A6BB6-4A85-48F6-A74A-9B991291597C@adelphi.edu> Message-ID: On Feb 6, 2009, at 9:48 AM, Stephen Bloch wrote: > > In fact, I'm sure one could write a functional front end for much of > the Java GUI libraries, giving it an API analogous to DrScheme's > world or universe teachpacks. Steve, the functional world for Java already exists - see http://www.ccs.neu.edu/javalib -- Viera > > Stephen Bloch > sbloch@adelphi.edu > > _________________________________________________ > PLT Educators mailing list > plt-edu@list.cs.brown.edu > http://list.cs.brown.edu/mailman/listinfo/plt-edu From jay.mccarthy at gmail.com Sat Feb 7 10:07:07 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:40:08 2009 Subject: [plt-scheme] Conditions in web-templates In-Reply-To: <20090207144733.GA1384@syhpoon-hq.freenet.com.ua> References: <20090207144733.GA1384@syhpoon-hq.freenet.com.ua> Message-ID: Yes. Here is an example: if.html: @(if (@monkeys . > . @monkey-limit) @list{

There are too many monkeys!

} @(if (@monkeys . < . @monkey-minimum) @list{

There aren't enough monkeys!

} @list{

There are just enough monkeys!

})) http://svn.plt-scheme.org/plt/trunk/collects/tests/web-server/template/examples/if.html run.ss: (define (if-template #:monkeys monkeys #:monkey-limit monkey-limit #:monkey-minimum monkey-minimum) (include-template "if.html")) (if-template #:monkeys 5 #:monkey-limit 10 #:monkey-minimum 2) (if-template #:monkeys 11 #:monkey-limit 10 #:monkey-minimum 2) (if-template #:monkeys 1 #:monkey-limit 10 #:monkey-minimum 2) Jay On Sat, Feb 7, 2009 at 7:47 AM, Max E. Kuznecov wrote: > Hi, > I'm using plt web-server for my project. > Content is rendered using web-server/templates module. > I've got a questions about @-syntax: > Is it possible to render a particular template branch using > some condition as a criterion? > I.e. I'd like to be able to write something of the kind: > > @if(expr){ > branch1 > } > { > else-branch > } > > Thanks. > > -- > ~syhpoon > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From jcoglan at googlemail.com Sat Feb 7 10:13:36 2009 From: jcoglan at googlemail.com (James Coglan) Date: Thu Mar 26 02:40:09 2009 Subject: [plt-scheme] Continuations and (begin) In-Reply-To: <20090207134302.6D5506500A3@mail-svr1.cs.utah.edu> References: <20090207134302.6D5506500A3@mail-svr1.cs.utah.edu> Message-ID: 2009/2/7 Matthew Flatt > At Sat, 7 Feb 2009 13:34:38 +0000, James Coglan wrote: > > (begin > > (call/cc > > (lambda (k) > > (set! r k) > > #t)) > > (set! count-calls (+ count-calls 1))) > > (r #t) (r #t) (r #t) > > > > I would expect count-calls to equal 4 after this, but it equals 1. The > > continuation, from what little I've read about this, should look like: > > > > ([#procedure] [#hole] (set! count-calls (+ count-calls 1))) > > The body of a top-level `begin' is spliced into the top-level sequence, > so the `begin' above doesn't usefully group the two expressions. (To > put it another way, a top-level `begin' wraps a prompt around each of > its sub-expressions.) Thanks. Just out of curiosity, is there a function that simply returns the current continuation without jumping to another function using (call/cc)? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090207/646f88c8/attachment.html From sk at cs.brown.edu Sat Feb 7 11:37:22 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:40:09 2009 Subject: [plt-scheme] Continuations and (begin) In-Reply-To: References: <20090207134302.6D5506500A3@mail-svr1.cs.utah.edu> Message-ID: > Just out of curiosity, is there a function that simply returns the > current continuation without jumping to another function using > (call/cc)? Do you mean something like this? (define (gimme-cc) (let/cc k (call/cc k2 (k k2)))) Otherwise we'll have to start getting all zen on yo' ass: "the continuation you return is no longer the current continuation, grasshopper", etc. Shriram From matthias at ccs.neu.edu Sat Feb 7 11:46:15 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:40:09 2009 Subject: [plt-scheme] Re: [plt-edu] Re: animation projects, video-game and not In-Reply-To: References: <4988DADC.6020403@uwaterloo.ca> <3C35B536-68FF-42E8-B80D-3DB88D13CEF6@ccs.neu.edu> <756daca50902032010o5d8d3ff8g8b43d1d881f20bac@mail.gmail.com> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> <932b2f1f0902051214g1148d325hcb6c6042dbc737a1@mail.gmail.com> <3D5A6BB6-4A85-48F6-A74A-9B991291597C@adelphi.edu> Message-ID: <4D3FD08A-0585-4C84-8EE4-4A74760CA4F5@ccs.neu.edu> With due respect, but this isn't the same functional world that universe provides. It's a cross between HtDP's draw.ss and world. BUT, as I have privately shared with Arthur (former PRL member) already, it demonstrates how JAVA is even MORE suited for this kind of programming than plain functional Scheme when you get to large programs. (Of course, in Java like in Cobol, everything is large.) -- Matthias On Feb 7, 2009, at 10:00 AM, Viera Proulx wrote: > > On Feb 6, 2009, at 9:48 AM, Stephen Bloch wrote: >> >> In fact, I'm sure one could write a functional front end for much >> of the Java GUI libraries, giving it an API analogous to >> DrScheme's world or universe teachpacks. > > Steve, the functional world for Java already exists - see > http://www.ccs.neu.edu/javalib > > > -- Viera > > >> >> Stephen Bloch >> sbloch@adelphi.edu >> >> _________________________________________________ >> PLT Educators mailing list >> plt-edu@list.cs.brown.edu >> http://list.cs.brown.edu/mailman/listinfo/plt-edu > > _________________________________________________ > PLT Educators mailing list > plt-edu@list.cs.brown.edu > http://list.cs.brown.edu/mailman/listinfo/plt-edu From matthias at ccs.neu.edu Sat Feb 7 11:48:00 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:40:10 2009 Subject: [plt-scheme] Continuations and (begin) In-Reply-To: References: <20090207134302.6D5506500A3@mail-svr1.cs.utah.edu> Message-ID: <6CC0DA68-E3F9-472A-A19E-BF1CDF2AAD8D@ccs.neu.edu> Do you mean (define (state) (call/cc (lambda (x) x))) ;; that's the old name from some 1970's or early 1980's language that I can't recall Try programming with it to find out why call/cc is so much better. -- Matthias On Feb 7, 2009, at 10:13 AM, James Coglan wrote: > > > 2009/2/7 Matthew Flatt > At Sat, 7 Feb 2009 13:34:38 +0000, James Coglan wrote: > > (begin > > (call/cc > > (lambda (k) > > (set! r k) > > #t)) > > (set! count-calls (+ count-calls 1))) > > (r #t) (r #t) (r #t) > > > > I would expect count-calls to equal 4 after this, but it equals > 1. The > > continuation, from what little I've read about this, should look > like: > > > > ([#procedure] [#hole] (set! count-calls (+ count-calls 1))) > > The body of a top-level `begin' is spliced into the top-level > sequence, > so the `begin' above doesn't usefully group the two expressions. (To > put it another way, a top-level `begin' wraps a prompt around each of > its sub-expressions.) > > Thanks. Just out of curiosity, is there a function that simply > returns the current continuation without jumping to another > function using (call/cc)? > > _________________________________________________ > 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/20090207/b4dca27b/attachment.htm From morazanm at gmail.com Sat Feb 7 12:23:37 2009 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:40:10 2009 Subject: [plt-scheme] Are you using HtDP and/or HtDC? Message-ID: <9b1fff280902070923i69dc44d9occ7ab592a85c8f2d@mail.gmail.com> Dear All, I posed the question in the subject line to the plt-edu mailing list, but I have the impression that there may be some readers of this list using HtDP and/or HtDC that are not be subscribed to the plt-edu mailing list. I am compiling a list of universities and high schools using either. If you have not responded to me via the plt-edu mailing list, kindly respond to this e-mail letting me know. Include the name of your institution, city, and state/country. I will gladly make the list available to members of this list. Thank you in advance for your responses. :-) -- Cheers, Marco From mark.engelberg at gmail.com Sat Feb 7 12:48:35 2009 From: mark.engelberg at gmail.com (Mark Engelberg) Date: Thu Mar 26 02:40:10 2009 Subject: [plt-scheme] Re: [plt-edu] Re: animation projects, video-game and not In-Reply-To: <4D3FD08A-0585-4C84-8EE4-4A74760CA4F5@ccs.neu.edu> References: <4988DADC.6020403@uwaterloo.ca> <756daca50902032010o5d8d3ff8g8b43d1d881f20bac@mail.gmail.com> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> <932b2f1f0902051214g1148d325hcb6c6042dbc737a1@mail.gmail.com> <3D5A6BB6-4A85-48F6-A74A-9B991291597C@adelphi.edu> <4D3FD08A-0585-4C84-8EE4-4A74760CA4F5@ccs.neu.edu> Message-ID: On Sat, Feb 7, 2009 at 8:46 AM, Matthias Felleisen wrote: > > ... it demonstrates > how JAVA is even MORE suited for this kind of programming than plain > functional Scheme when you get to large programs. (Of course, in Java like > in Cobol, everything is large.) -- Matthias Can you elaborate for a few sentences, maybe giving an example from one of these libraries that turned out more elegant/cleaner/organized/etc. in Java vs. Scheme, and what aspects of Java made it so? I'm trying to help my son "Reach Java", but since he's spent a couple years getting quite adept at Scheme, he's having a hard time seeing the value of learning Java. I'm having a hard time motivating the study of Java, so any words of wisdom about this would be helpful. --Mark From matthias at ccs.neu.edu Sat Feb 7 13:06:19 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:40:10 2009 Subject: [plt-scheme] Re: [plt-edu] Re: animation projects, video-game and not In-Reply-To: References: <4988DADC.6020403@uwaterloo.ca> <756daca50902032010o5d8d3ff8g8b43d1d881f20bac@mail.gmail.com> <62709848-0DDA-4DDE-8AC3-2023C792C825@ccs.neu.edu> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> <932b2f1f0902051214g1148d325hcb6c6042dbc737a1@mail.gmail.com> <3D5A6BB6-4A85-48F6-A74A-9B991291597C@adelphi.edu> <4D3FD08A-0585-4C84-8EE4-4A74760CA4F5@ccs.neu.edu> Message-ID: On Feb 7, 2009, at 12:48 PM, Mark Engelberg wrote: > On Sat, Feb 7, 2009 at 8:46 AM, Matthias Felleisen > wrote: >> >> ... it demonstrates >> how JAVA is even MORE suited for this kind of programming than plain >> functional Scheme when you get to large programs. (Of course, in >> Java like >> in Cobol, everything is large.) -- Matthias > > Can you elaborate for a few sentences, maybe giving an example from > one of these libraries that turned out more > elegant/cleaner/organized/etc. in Java vs. Scheme, and what aspects of > Java made it so? Think of the World as an object for which you have three or four methods: ;; tick : World -> World ;; click : World KeyEvent -> World ;; clack : World MouseEvent - World ;; draw : World -> Scene ;; stop? : World -> Boolean As you can see (1) these methods belong together, (2) in a functional language you must pass in the world, and (3) you usually destructure it via field access to the struct. So there is clearly a certain intellectual elegance to (define World (class ... ;; -> World (define/public (tick) ...) ;; KeyEvent -> World (define/public (click ke) ...) ;; MouseEvent -> World ... )) Pardon my Java :-) You see it's really about having classes around to organize your code. It has nothing to do with Java. Better still, you can use inheritance to prepare default behaviors and then quickly instantiate this anticipated scenarios. When I teach Softw Dev (~12 Kloc to 18 Kloc of Java for the poor students who use Java), I actually use the PLT Scheme class system to write code like this. That's what I meant. > I'm trying to help my son "Reach Java", but since he's spent a couple > years getting quite adept at Scheme, he's having a hard time seeing > the value of learning Java. I'm having a hard time motivating the > study of Java, so any words of wisdom about this would be helpful. Unless you think your 12 year old son should prepare himself now for a career in software engineering of Java systems, I see NO NEED for him to listen to you. Tell him your former professor says so :-) Java sucks -- Matthias From yinso.chen at gmail.com Sat Feb 7 13:38:52 2009 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:40:11 2009 Subject: [plt-scheme] Re: [plt-edu] Re: animation projects, video-game and not In-Reply-To: References: <4988DADC.6020403@uwaterloo.ca> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> <932b2f1f0902051214g1148d325hcb6c6042dbc737a1@mail.gmail.com> <3D5A6BB6-4A85-48F6-A74A-9B991291597C@adelphi.edu> <4D3FD08A-0585-4C84-8EE4-4A74760CA4F5@ccs.neu.edu> Message-ID: <779bf2730902071038n5b504870yd5993ecd3d3afe1c@mail.gmail.com> On Sat, Feb 7, 2009 at 10:06 AM, Matthias Felleisen wrote: > > > Think of the World as an object for which you have three or four methods: > > ;; tick : World -> World > ;; click : World KeyEvent -> World > ;; clack : World MouseEvent - World > ;; draw : World -> Scene > ;; stop? : World -> Boolean > > As you can see (1) these methods belong together, (2) in a functional > language you must pass in the world, and (3) you usually destructure it via > field access to the struct. So there is clearly a certain intellectual > elegance to > > (define World > (class ... > ;; -> World > (define/public (tick) ...) > ;; KeyEvent -> World > (define/public (click ke) ...) > ;; MouseEvent -> World > ... )) > > Pardon my Java :-) You see it's really about having classes around to > organize your code. It has nothing to do with Java. > > Better still, you can use inheritance to prepare default behaviors and then > quickly instantiate this anticipated scenarios. When I teach Softw Dev (~12 > Kloc to 18 Kloc of Java for the poor students who use Java), I actually use > the PLT Scheme class system to write code like this. > > Coming from the OOP practitioner world, I greatly value classes as an organization, especially the constructor & destructor and the RAII idiom. It's ironic that one of the points against Java is too much boiler plate code, all of which helps the large program to organize themselves. I am learning to use just plain modules and structs to achieve the organization effect these days. Module provides encapsulation. And struct provides basic inheritance, so what's missing is polymorphism, but that's possible to achieve if the struct themselves carry the functions that they need to call. Also I miss the destructor and explicit finalize. Those comes in very handy for external resource management. I am probably reinventing the wheel, but that appears to be how I learn :) yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090207/4c6f56db/attachment.html From matthias at ccs.neu.edu Sat Feb 7 13:46:47 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:40:12 2009 Subject: [plt-scheme] Re: [plt-edu] Re: animation projects, video-game and not In-Reply-To: <779bf2730902071038n5b504870yd5993ecd3d3afe1c@mail.gmail.com> References: <4988DADC.6020403@uwaterloo.ca> <9b1fff280902041951p4f647559j61b3b48e1c13ceb@mail.gmail.com> <2C1FA24F-619D-40D3-A126-E946FFFBB4E5@ccs.neu.edu> <932b2f1f0902051214g1148d325hcb6c6042dbc737a1@mail.gmail.com> <3D5A6BB6-4A85-48F6-A74A-9B991291597C@adelphi.edu> <4D3FD08A-0585-4C84-8EE4-4A74760CA4F5@ccs.neu.edu> <779bf2730902071038n5b504870yd5993ecd3d3afe1c@mail.gmail.com> Message-ID: <4A00EB24-C151-408B-AC69-56F1ECDF6E6E@ccs.neu.edu> On Feb 7, 2009, at 1:38 PM, YC wrote: > I am learning to use just plain modules and structs to achieve the > organization effect these days. Module provides encapsulation. See my ECOOP talk. > And struct provides basic inheritance, so what's missing is > polymorphism, but that's possible to achieve if the struct > themselves carry the functions that they need to call. Also I miss > the destructor and explicit finalize. Those comes in very handy > for external resource management. GC. > I am probably reinventing the wheel, but that appears to be how I > learn :) It'll keep you back if you don't watch out. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090207/ed45ddd6/attachment.htm From wsf at fultondesigns.co.uk Fri Feb 6 21:08:59 2009 From: wsf at fultondesigns.co.uk (William S Fulton) Date: Thu Mar 26 02:40:12 2009 Subject: [plt-scheme] Re: [Swig-devel] ANNOUNCE - swig-1.3.38 In-Reply-To: <498A1ABF.30401@gentoo.org> References: <4984EC4B.2030806@fultondesigns.co.uk> <498721D6.10509@gentoo.org> <4989FEE3.7020506@fultondesigns.co.uk> <498A1ABF.30401@gentoo.org> Message-ID: <498CED3B.7010902@fultondesigns.co.uk> Marijn Schouten (hkBst) wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > William S Fulton wrote: > > Marijn Schouten (hkBst) wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- > >> Hash: SHA1 > >> > >> William S Fulton wrote: > >>> *** ANNOUNCE: SWIG 1.3.38 (31 January 2009) *** > >>> > >>> http://www.swig.org > >>> > >>> > >>> We're pleased to announce SWIG-1.3.38, the latest installment in the > >>> SWIG development effort. SWIG-1.3.38 includes a number of bug fixes > >>> and enhancements. > >> I had a problem building swig-1.3.38: > >> > >> > >> checking for gzdopen in -lz... yes > >> > >> configure: creating ./config.status > >> > >> config.status: creating Makefile > >> > >> config.status: creating config.h > >> > >> make -j2 > >> > >> test -z "1" || (cd CCache && make) > >> > >> make[1]: Entering directory > >> `/var/tmp/portage/dev-lang/swig-1.3.38/work/swig-1.3.38/CCache' > >> > >> x86_64-pc-linux-gnu-gcc -march=core2 -O2 -pipe -Wall -W -I. -c -o > >> ccache.o > >> ccache.c > >> make[1]: Entering directory > >> `/var/tmp/portage/dev-lang/swig-1.3.38/work/swig-1.3.38/Source' > >> > >> Makefile:191: *** missing separator. Stop. > >> > >> make[1]: Leaving directory > >> `/var/tmp/portage/dev-lang/swig-1.3.38/work/swig-1.3.38/Source' > >> > >> make: *** [source] Error 2 > >> > >> make: *** Waiting for unfinished jobs.... > >> > >> > >> I figure the solution is: > >> > >> > >> - --- Makefile.in.old 2009-02-02 17:29:13.000000000 +0100 > >> > >> +++ Makefile.in 2009-02-02 17:29:13.000000000 +0100 > >> > >> @@ -187,7 +187,7 @@ > >> > >> @echo $(ACTION)ing Examples/GIFPlot/Lib > >> > >> @cd Examples/GIFPlot/Lib && $(MAKE) -k -s $(ACTION) > >> > >> > >> > >> - -check-gifplot: \ > >> > >> +check-gifplot: > >> > >> check-tcl-gifplot \ > >> > >> check-perl5-gifplot \ > >> > >> check-python-gifplot \ > >> > >> > >> > >> but I cannot test that because when I tried to run autoconf I got: > >> > >> > >> configure.in:31: error: possibly undefined macro: AC_COMPILE_WARNINGS > >> If this token and others are legitimate, please use > >> m4_pattern_allow. > >> See the Autoconf documentation. > >> configure.in:1461: error: possibly undefined macro: AC_COMPARE_VERSION > >> configure.in:2138: error: possibly undefined macro: AC_DEFINE_DIR > >> > >> > >> I'm using autoconf-2.63. > > Are you using GNU make? Perhaps you've got GNU make, but something later > > than 3.81? I use autoconf-2.61 which works great. Rather than running > > autoreconf, please run ./autogen.sh. Alternatively, modify just the > > Makefile, then you won't need to rerun configure. But essentially your > > modification won't work and I can't see what your problem is if you are > > using GNU make... try running without -j2 as there might be a parallel > > problem, although I regularly do parallel builds. > > > > William > > Yes, I'm using GNU make 3.81 too. I succeeded running ./autogen.sh and > indeed my > patch fixes nothing. Turning off parallel building didn't help either. > > Actually looking better at the error I notice that I was looking at > the wrong > Makefile altogether. The offending one is the one in Source. A small > snippet of > that file: > > > MKDIR_P = /bin/mkdir -p > MZC = /usr/bin/mzc > MZDYNOBJ = /usr/bin/mzscheme: bad switch: --mute-banner > Use the --help or -h flag for help. > MZSCHEME = /usr/bin/mzscheme > MZSCHEME_SO = .so > > > Line 191 starts with "Use the". It seems like it is an artefact of broken > support for mzscheme which was reported for 1.3.36 already > (http://sourceforge.net/tracker/?func=detail&atid=301645&aid=2081967&group_id=1645). > I was able to compile by using --without-mzscheme. > > Quote from PLT Scheme developer Eli Barzilay: > "[wo sep 3 2008] [12:53:14] The swig mz interface > genarates a C > file where it could generate a scheme file instead." > I've used that patch as the basis for detecting new mzscheme and making sure future non-backward compatible mzscheme changes don't break the SWIG source makefile again. We do need a mzscheme person to update the SWIG support. Quite a bit of the test-suite looks fine, so probably not too much work to be done unless the radical changes mentioned by 'eli' above are implemented. William From mwand1 at gmail.com Sat Feb 7 09:34:25 2009 From: mwand1 at gmail.com (Mitch Wand) Date: Thu Mar 26 02:40:12 2009 Subject: [plt-scheme] Programming and Martial Arts Message-ID: I've been trying out a different metaphor as a way of making students stick to the Design Recipe: In martial arts, the first thing you learn is to do simple motions very precisely. Ditto for ballet, where the first thing you learn is the five positions. Once those are committed to muscle memory, you can go on to combinations and variations. Same deal for programming via HtDP: first practice using the templates until you can do it without thinking. Then you can go on to combinations and variations. And muscle memory is absolutely critical: that's knowledge that compiled in your head, not interpreted. --Mitch From rcleis at mac.com Sat Feb 7 14:15:56 2009 From: rcleis at mac.com (Richard Cleis) Date: Thu Mar 26 02:40:12 2009 Subject: [plt-scheme] Programming and Martial Arts In-Reply-To: References: Message-ID: On Feb 7, 2009, at 7:34 AM, Mitch Wand wrote: > I've been trying out a different metaphor as a way of making students > stick to the Design Recipe: > > In martial arts, the first thing you learn is to do simple motions > very precisely. Ditto for ballet, where the first thing you learn is > the five positions. > > Once those are committed to muscle memory, you can go on to > combinations and variations. > > Same deal for programming via HtDP: first practice using the templates > until you can do it without thinking. Then you can go on to > combinations and variations. > > And muscle memory is absolutely critical: that's knowledge that > compiled in your head, not interpreted. Isn't it more practical to compile when a young, inexperienced head hasn't yet been filled with ad hoc a.out files? What about entire corporations? They can occasionally be convinced of the value of Martial Arts, but don't touch their JAVA with alternatve programming approaches :) > > > --Mitch > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From carl.eastlund at gmail.com Sat Feb 7 14:23:19 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Thu Mar 26 02:40:13 2009 Subject: [plt-scheme] Programming and Martial Arts In-Reply-To: References: Message-ID: <990e0c030902071123r181eebbfv3952abca0b806682@mail.gmail.com> On Sat, Feb 7, 2009 at 2:15 PM, Richard Cleis wrote: > On Feb 7, 2009, at 7:34 AM, Mitch Wand wrote: > >> I've been trying out a different metaphor as a way of making students >> stick to the Design Recipe: >> >> In martial arts, the first thing you learn is to do simple motions >> very precisely. Ditto for ballet, where the first thing you learn is >> the five positions. >> >> Once those are committed to muscle memory, you can go on to >> combinations and variations. >> >> Same deal for programming via HtDP: first practice using the templates >> until you can do it without thinking. Then you can go on to >> combinations and variations. >> >> And muscle memory is absolutely critical: that's knowledge that >> compiled in your head, not interpreted. > > Isn't it more practical to compile when a young, inexperienced head hasn't > yet been filled with ad hoc a.out files? What about entire corporations? > They can occasionally be convinced of the value of Martial Arts, but don't > touch their JAVA with alternatve programming approaches :) I think that's exactly what Mitch is saying. Learn good practices early. And I don't think it has anything to do with choice of language, nor is it "alternative". Learning the fundamentals first applies just as well to imperative Java as it does to functional Scheme or obfuscated Perl. (Though perhaps the fundamentals of obfuscated Perl are "don't".) --Carl From yinso.chen at gmail.com Sat Feb 7 14:42:50 2009 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:40:13 2009 Subject: [plt-scheme] Re: [plt-edu] Re: animation projects, video-game and not In-Reply-To: <4A00EB24-C151-408B-AC69-56F1ECDF6E6E@ccs.neu.edu> References: <4988DADC.6020403@uwaterloo.ca> <932b2f1f0902051214g1148d325hcb6c6042dbc737a1@mail.gmail.com> <3D5A6BB6-4A85-48F6-A74A-9B991291597C@adelphi.edu> <4D3FD08A-0585-4C84-8EE4-4A74760CA4F5@ccs.neu.edu> <779bf2730902071038n5b504870yd5993ecd3d3afe1c@mail.gmail.com> <4A00EB24-C151-408B-AC69-56F1ECDF6E6E@ccs.neu.edu> Message-ID: <779bf2730902071142nc33e041ja6e6c18f64cb94ac@mail.gmail.com> On Sat, Feb 7, 2009 at 10:46 AM, Matthias Felleisen wrote: > > On Feb 7, 2009, at 1:38 PM, YC wrote: > > I am learning to use just plain modules and structs to achieve the > organization effect these days. Module provides encapsulation. > > > See my ECOOP talk. > A lot of gems in the talk - I need to digest it more fully - thanks! > > > And struct provides basic inheritance, so what's missing is polymorphism, > but that's possible to achieve if the struct themselves carry the functions > that they need to call. Also I miss the destructor and explicit finalize. > Those comes in very handy for external resource management. > > > GC. > I am probably missing the point here, but I think GC doesn't help with closing file handles or database connections (at least *safely*), no? Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090207/320f2598/attachment.html From carl.eastlund at gmail.com Sat Feb 7 14:50:11 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Thu Mar 26 02:40:14 2009 Subject: [plt-scheme] Re: [plt-edu] Re: animation projects, video-game and not In-Reply-To: <779bf2730902071142nc33e041ja6e6c18f64cb94ac@mail.gmail.com> References: <4988DADC.6020403@uwaterloo.ca> <932b2f1f0902051214g1148d325hcb6c6042dbc737a1@mail.gmail.com> <3D5A6BB6-4A85-48F6-A74A-9B991291597C@adelphi.edu> <4D3FD08A-0585-4C84-8EE4-4A74760CA4F5@ccs.neu.edu> <779bf2730902071038n5b504870yd5993ecd3d3afe1c@mail.gmail.com> <4A00EB24-C151-408B-AC69-56F1ECDF6E6E@ccs.neu.edu> <779bf2730902071142nc33e041ja6e6c18f64cb94ac@mail.gmail.com> Message-ID: <990e0c030902071150r79b0e83fmab18cc44776f1b49@mail.gmail.com> On Sat, Feb 7, 2009 at 2:42 PM, YC wrote: > On Sat, Feb 7, 2009 at 10:46 AM, Matthias Felleisen wrote: >> >> And struct provides basic inheritance, so what's missing is polymorphism, >> but that's possible to achieve if the struct themselves carry the functions >> that they need to call. Also I miss the destructor and explicit finalize. >> Those comes in very handy for external resource management. >> >> GC. > > I am probably missing the point here, but I think GC doesn't help with > closing file handles or database connections (at least *safely*), no? > > Thanks, > yc The PLT Scheme garbage collector does close file handles. A database library certainly could, and should, use the garbage collector to close connections. I don't know which ones do, but that's only my own inexperience with Scheme database libraries. In both cases, GC doesn't preclude the option to manually close a connection earlier -- but GC makes that into an optimization rather than a necessity, for most purposes. -- Carl Eastlund From yinso.chen at gmail.com Sat Feb 7 14:58:02 2009 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:40:14 2009 Subject: [plt-scheme] Re: [plt-edu] Re: animation projects, video-game and not In-Reply-To: <990e0c030902071150r79b0e83fmab18cc44776f1b49@mail.gmail.com> References: <4988DADC.6020403@uwaterloo.ca> <3D5A6BB6-4A85-48F6-A74A-9B991291597C@adelphi.edu> <4D3FD08A-0585-4C84-8EE4-4A74760CA4F5@ccs.neu.edu> <779bf2730902071038n5b504870yd5993ecd3d3afe1c@mail.gmail.com> <4A00EB24-C151-408B-AC69-56F1ECDF6E6E@ccs.neu.edu> <779bf2730902071142nc33e041ja6e6c18f64cb94ac@mail.gmail.com> <990e0c030902071150r79b0e83fmab18cc44776f1b49@mail.gmail.com> Message-ID: <779bf2730902071158l49d3fb90u4ece9a445ca08c88@mail.gmail.com> On Sat, Feb 7, 2009 at 11:50 AM, Carl Eastlund wrote: > > > I am probably missing the point here, but I think GC doesn't help with > > closing file handles or database connections (at least *safely*), no? > > > > Thanks, > > yc > > The PLT Scheme garbage collector does close file handles. A database > library certainly could, and should, use the garbage collector to > close connections. I don't know which ones do, but that's only my own > inexperience with Scheme database libraries. In both cases, GC > doesn't preclude the option to manually close a connection earlier -- > but GC makes that into an optimization rather than a necessity, for > most purposes. > What is the hook to provide GC with such knowledge to close the database handles if I need to implement my own database connection? My failure to find such a hook misled me to think GC can't be made handle external resources gracefully. Is it the will executor? It seems that will isn't called by GC, though. Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090207/779f20d3/attachment.htm From carl.eastlund at gmail.com Sat Feb 7 15:48:04 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Thu Mar 26 02:40:14 2009 Subject: [plt-scheme] Re: [plt-edu] Re: animation projects, video-game and not In-Reply-To: <779bf2730902071158l49d3fb90u4ece9a445ca08c88@mail.gmail.com> References: <4988DADC.6020403@uwaterloo.ca> <4D3FD08A-0585-4C84-8EE4-4A74760CA4F5@ccs.neu.edu> <779bf2730902071038n5b504870yd5993ecd3d3afe1c@mail.gmail.com> <4A00EB24-C151-408B-AC69-56F1ECDF6E6E@ccs.neu.edu> <779bf2730902071142nc33e041ja6e6c18f64cb94ac@mail.gmail.com> <990e0c030902071150r79b0e83fmab18cc44776f1b49@mail.gmail.com> <779bf2730902071158l49d3fb90u4ece9a445ca08c88@mail.gmail.com> Message-ID: <990e0c030902071248q42fa5212jb3dbcd775e65356b@mail.gmail.com> On Sat, Feb 7, 2009 at 2:58 PM, YC wrote: > On Sat, Feb 7, 2009 at 11:50 AM, Carl Eastlund > wrote: >> >> > I am probably missing the point here, but I think GC doesn't help with >> > closing file handles or database connections (at least *safely*), no? >> > >> > Thanks, >> > yc >> >> The PLT Scheme garbage collector does close file handles. A database >> library certainly could, and should, use the garbage collector to >> close connections. I don't know which ones do, but that's only my own >> inexperience with Scheme database libraries. In both cases, GC >> doesn't preclude the option to manually close a connection earlier -- >> but GC makes that into an optimization rather than a necessity, for >> most purposes. > > What is the hook to provide GC with such knowledge to close the database > handles if I need to implement my own database connection? My failure to > find such a hook misled me to think GC can't be made handle external > resources gracefully. > > Is it the will executor? It seems that will isn't called by GC, though. It is the will executor. It is not automatically called by GC because that leads to unpredictable execution order. It is, however, enabled by GC -- that is, the garbage collector determines when a will executor is ready to be run. If you schedule the will executor (put calls in your program to check when it is ready to run, or spawn a thread to run it whenever it's available), though, it will run when a value is ready to be garbage collected. -- Carl Eastlund From sk at cs.brown.edu Sat Feb 7 15:49:11 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:40:14 2009 Subject: [plt-scheme] Re: [plt-edu] Re: animation projects, video-game and not In-Reply-To: <4A00EB24-C151-408B-AC69-56F1ECDF6E6E@ccs.neu.edu> References: <4988DADC.6020403@uwaterloo.ca> <932b2f1f0902051214g1148d325hcb6c6042dbc737a1@mail.gmail.com> <3D5A6BB6-4A85-48F6-A74A-9B991291597C@adelphi.edu> <4D3FD08A-0585-4C84-8EE4-4A74760CA4F5@ccs.neu.edu> <779bf2730902071038n5b504870yd5993ecd3d3afe1c@mail.gmail.com> <4A00EB24-C151-408B-AC69-56F1ECDF6E6E@ccs.neu.edu> Message-ID: > > And struct provides basic inheritance, so what's missing is polymorphism, > > but that's possible to achieve if the struct themselves carry the functions > > that they need to call. Also I miss the destructor and explicit finalize. > > Those comes in very handy for external resource management. > > GC. He's referring to *external* resources, not memory. Look up "RAII", which he mentioned earlier: http://en.wikipedia.org/wiki/Resource_acquisition_is_initialization It's basically a poor man's custodian. Except it picks just the wrong example (C++ objects w/ destructors) to make its point. Shriram From carl.eastlund at gmail.com Sat Feb 7 15:50:42 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Thu Mar 26 02:40:15 2009 Subject: [plt-scheme] Re: [plt-edu] Re: animation projects, video-game and not In-Reply-To: <990e0c030902071248q42fa5212jb3dbcd775e65356b@mail.gmail.com> References: <4988DADC.6020403@uwaterloo.ca> <4D3FD08A-0585-4C84-8EE4-4A74760CA4F5@ccs.neu.edu> <779bf2730902071038n5b504870yd5993ecd3d3afe1c@mail.gmail.com> <4A00EB24-C151-408B-AC69-56F1ECDF6E6E@ccs.neu.edu> <779bf2730902071142nc33e041ja6e6c18f64cb94ac@mail.gmail.com> <990e0c030902071150r79b0e83fmab18cc44776f1b49@mail.gmail.com> <779bf2730902071158l49d3fb90u4ece9a445ca08c88@mail.gmail.com> <990e0c030902071248q42fa5212jb3dbcd775e65356b@mail.gmail.com> Message-ID: <990e0c030902071250o4958be50hcaff744589b185d6@mail.gmail.com> On Sat, Feb 7, 2009 at 3:48 PM, Carl Eastlund wrote: > On Sat, Feb 7, 2009 at 2:58 PM, YC wrote: >> On Sat, Feb 7, 2009 at 11:50 AM, Carl Eastlund >> wrote: >>> >>> > I am probably missing the point here, but I think GC doesn't help with >>> > closing file handles or database connections (at least *safely*), no? >>> > >>> > Thanks, >>> > yc >>> >>> The PLT Scheme garbage collector does close file handles. A database >>> library certainly could, and should, use the garbage collector to >>> close connections. I don't know which ones do, but that's only my own >>> inexperience with Scheme database libraries. In both cases, GC >>> doesn't preclude the option to manually close a connection earlier -- >>> but GC makes that into an optimization rather than a necessity, for >>> most purposes. >> >> What is the hook to provide GC with such knowledge to close the database >> handles if I need to implement my own database connection? My failure to >> find such a hook misled me to think GC can't be made handle external >> resources gracefully. >> >> Is it the will executor? It seems that will isn't called by GC, though. > > It is the will executor. It is not automatically called by GC because > that leads to unpredictable execution order. It is, however, enabled > by GC -- that is, the garbage collector determines when a will > executor is ready to be run. If you schedule the will executor (put > calls in your program to check when it is ready to run, or spawn a > thread to run it whenever it's available), though, it will run when a > value is ready to be garbage collected. As a technical aside about my second sentence above, I don't mean to imply that the current will executor mechanism has totally predictable execution order... just that the current scheme gives a little more control over how will executors interleave with the rest of the program. Section 15.3 of the PLT Scheme reference gives more detail. -- Carl Eastlund From mflatt at cs.utah.edu Sat Feb 7 16:28:00 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:40:15 2009 Subject: [plt-scheme] Re: [plt-edu] Re: animation projects, video-game and not In-Reply-To: <990e0c030902071150r79b0e83fmab18cc44776f1b49@mail.gmail.com> References: <4988DADC.6020403@uwaterloo.ca> <932b2f1f0902051214g1148d325hcb6c6042dbc737a1@mail.gmail.com> <3D5A6BB6-4A85-48F6-A74A-9B991291597C@adelphi.edu> <4D3FD08A-0585-4C84-8EE4-4A74760CA4F5@ccs.neu.edu> <779bf2730902071038n5b504870yd5993ecd3d3afe1c@mail.gmail.com> <4A00EB24-C151-408B-AC69-56F1ECDF6E6E@ccs.neu.edu> <779bf2730902071142nc33e041ja6e6c18f64cb94ac@mail.gmail.com> <990e0c030902071150r79b0e83fmab18cc44776f1b49@mail.gmail.com> Message-ID: <20090207212802.694A96500A9@mail-svr1.cs.utah.edu> At Sat, 7 Feb 2009 14:50:11 -0500, Carl Eastlund wrote: > On Sat, Feb 7, 2009 at 2:42 PM, YC wrote: > > On Sat, Feb 7, 2009 at 10:46 AM, Matthias Felleisen > wrote: > >> > >> And struct provides basic inheritance, so what's missing is polymorphism, > >> but that's possible to achieve if the struct themselves carry the functions > >> that they need to call. Also I miss the destructor and explicit finalize. > >> Those comes in very handy for external resource management. > >> > >> GC. > > > > I am probably missing the point here, but I think GC doesn't help with > > closing file handles or database connections (at least *safely*), no? > > > > Thanks, > > yc > > The PLT Scheme garbage collector does close file handles. No, file handles are not automatically closed when the associated port is unreachable. > A database > library certainly could, and should, use the garbage collector to > close connections. I don't know which ones do, but that's only my own > inexperience with Scheme database libraries. In both cases, GC > doesn't preclude the option to manually close a connection earlier -- > but GC makes that into an optimization rather than a necessity, for > most purposes. GC is a poor fit for scarce resources like file handles. It's partly a mismatch between scarce resources and the plentiful resource of memory, but OS and library limitations are the main factor. Imagine that PLT Scheme did close file handles when they become inaccessible. Programmers will then write programs that depend on it. To keep the program working reliably, The runtime system would have to trigger a GC when it fails in an attempt to open a new file handle. For the sake of argument, suppose we get that right. Now suppose that you want to use an external library that happens to open some configuration file internally. That library isn't going to know that it should force a GC if opening the configuration file fails, so making the library work nicely in a GCed-file-handle world is going to be a big pain, at best. (This is also why it would be difficult to get right within the run-time system.) File handles are registered with a custodian, as Shriram alluded. If a DB connection is implemented through an FFI binding to some library, then each DB connection also should be registered with the current custodian. If it's built on file descriptors, TCP connections, or other things that are already registered with the custodian, then probably nothing more is needed. Meanwhile, wouldn't the closest analogue to automatic C++ init/destruct for a block be `call-with-...' functions, such as `call-with-input-file'? Those use `dynamic-wind' to ensure that the file is explicitly closed when control leaves the `call-with-...' invocation. Matthew From sk at cs.brown.edu Sat Feb 7 16:38:08 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:40:15 2009 Subject: [plt-scheme] Re: [plt-edu] Re: animation projects, video-game and not In-Reply-To: <20090207212802.694A96500A9@mail-svr1.cs.utah.edu> References: <4988DADC.6020403@uwaterloo.ca> <4D3FD08A-0585-4C84-8EE4-4A74760CA4F5@ccs.neu.edu> <779bf2730902071038n5b504870yd5993ecd3d3afe1c@mail.gmail.com> <4A00EB24-C151-408B-AC69-56F1ECDF6E6E@ccs.neu.edu> <779bf2730902071142nc33e041ja6e6c18f64cb94ac@mail.gmail.com> <990e0c030902071150r79b0e83fmab18cc44776f1b49@mail.gmail.com> <20090207212802.694A96500A9@mail-svr1.cs.utah.edu> Message-ID: >> A database >> library certainly could, and should, use the garbage collector to >> close connections. I don't know which ones do, but that's only my own >> inexperience with Scheme database libraries. In both cases, GC >> doesn't preclude the option to manually close a connection earlier -- >> but GC makes that into an optimization rather than a necessity, for >> most purposes. > > GC is a poor fit for scarce resources like file handles. It's partly a > mismatch between scarce resources and the plentiful resource of memory, > but OS and library limitations are the main factor. A better example is an externally managed data structure. For instance, when we linked to decision diagrams -- which are managed internally in a library, through reference counts -- we used wills to inform the library that there were no more references from Scheme. That is, all of Scheme is a ++ ref, and dropping all references from Scheme is a -- ref. This is a good fit for wills, because the granularity is the same; the wills are just massaging over differences in storage and management strategy. > Now suppose that you want to use an external library that happens to > open some configuration file internally. That library isn't going to > know that it should force a GC if opening the configuration file fails, > so making the library work nicely in a GCed-file-handle world is going > to be a big pain, at best. (This is also why it would be difficult to > get right within the run-time system.) Isn't it worse? Usually, external libraries are not written with the assumption that files close without their say-so. That means a perverse bit of code might allocate a file, temporarily lose a direct reference to it, but re-acquire reference through some system mechanism (such as referring to the file pointer). [To put it differently, reachability might involve the OSes internal data structures, which are generally not considered for tracing.] Such a library would now behave faultily. > Meanwhile, wouldn't the closest analogue to automatic C++ init/destruct > for a block be `call-with-...' functions, such as > `call-with-input-file'? Those use `dynamic-wind' to ensure that the > file is explicitly closed when control leaves the `call-with-...' > invocation. Indeed, the Wikipedia article mentions UNWIND-PROTECT. Shriram From matthias at ccs.neu.edu Sat Feb 7 17:04:00 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:40:15 2009 Subject: [plt-scheme] Re: [plt-edu] Re: animation projects, video-game and not In-Reply-To: References: <4988DADC.6020403@uwaterloo.ca> <4D3FD08A-0585-4C84-8EE4-4A74760CA4F5@ccs.neu.edu> <779bf2730902071038n5b504870yd5993ecd3d3afe1c@mail.gmail.com> <4A00EB24-C151-408B-AC69-56F1ECDF6E6E@ccs.neu.edu> <779bf2730902071142nc33e041ja6e6c18f64cb94ac@mail.gmail.com> <990e0c030902071150r79b0e83fmab18cc44776f1b49@mail.gmail.com> <20090207212802.694A96500A9@mail-svr1.cs.utah.edu> Message-ID: <493257F7-15F8-4F3C-8F61-7F60FB30235A@ccs.neu.edu> 1. I am aware of the file and db example. I just explained all this to a visitor on friday (who requested gc'ed file handles). 2. YC's original message alluded to memory, which is usually not subject to special treatment but gc'ed. 3. And yes, I know about external resource management. I write my programs with call-with- and custodians. -- Matthias On Feb 7, 2009, at 4:38 PM, Shriram Krishnamurthi wrote: >>> A database >>> library certainly could, and should, use the garbage collector to >>> close connections. I don't know which ones do, but that's only >>> my own >>> inexperience with Scheme database libraries. In both cases, GC >>> doesn't preclude the option to manually close a connection >>> earlier -- >>> but GC makes that into an optimization rather than a necessity, for >>> most purposes. >> >> GC is a poor fit for scarce resources like file handles. It's >> partly a >> mismatch between scarce resources and the plentiful resource of >> memory, >> but OS and library limitations are the main factor. > > A better example is an externally managed data structure. For > instance, when we linked to decision diagrams -- which are managed > internally in a library, through reference counts -- we used wills to > inform the library that there were no more references from Scheme. > That is, all of Scheme is a ++ ref, and dropping all references from > Scheme is a -- ref. This is a good fit for wills, because the > granularity is the same; the wills are just massaging over differences > in storage and management strategy. > >> Now suppose that you want to use an external library that happens to >> open some configuration file internally. That library isn't going to >> know that it should force a GC if opening the configuration file >> fails, >> so making the library work nicely in a GCed-file-handle world is >> going >> to be a big pain, at best. (This is also why it would be difficult to >> get right within the run-time system.) > > Isn't it worse? Usually, external libraries are not written with the > assumption that files close without their say-so. That means a > perverse bit of code might allocate a file, temporarily lose a direct > reference to it, but re-acquire reference through some system > mechanism (such as referring to the file pointer). [To put it > differently, reachability might involve the OSes internal data > structures, which are generally not considered for tracing.] Such a > library would now behave faultily. > >> Meanwhile, wouldn't the closest analogue to automatic C++ init/ >> destruct >> for a block be `call-with-...' functions, such as >> `call-with-input-file'? Those use `dynamic-wind' to ensure that the >> file is explicitly closed when control leaves the `call-with-...' >> invocation. > > Indeed, the Wikipedia article mentions UNWIND-PROTECT. > > Shriram From yinso.chen at gmail.com Sat Feb 7 18:53:53 2009 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:40:16 2009 Subject: [plt-scheme] Re: [plt-edu] Re: animation projects, video-game and not In-Reply-To: <20090207212802.694A96500A9@mail-svr1.cs.utah.edu> References: <4988DADC.6020403@uwaterloo.ca> <4D3FD08A-0585-4C84-8EE4-4A74760CA4F5@ccs.neu.edu> <779bf2730902071038n5b504870yd5993ecd3d3afe1c@mail.gmail.com> <4A00EB24-C151-408B-AC69-56F1ECDF6E6E@ccs.neu.edu> <779bf2730902071142nc33e041ja6e6c18f64cb94ac@mail.gmail.com> <990e0c030902071150r79b0e83fmab18cc44776f1b49@mail.gmail.com> <20090207212802.694A96500A9@mail-svr1.cs.utah.edu> Message-ID: <779bf2730902071553g4c9ed98aw8a2b4299cec67cb3@mail.gmail.com> On Sat, Feb 7, 2009 at 1:28 PM, Matthew Flatt wrote: > > File handles are registered with a custodian, as Shriram alluded. If a > DB connection is implemented through an FFI binding to some library, > then each DB connection also should be registered with the current > custodian. If it's built on file descriptors, TCP connections, or other > things that are already registered with the custodian, then probably > nothing more is needed. > I think in most cases custodian might indeed be enough. But suppose that the code needs to do some additional clean up during the shutdown phrase. A contrived (or maybe not so much) example: when we start a database connection, we set the lock on the database file (which is its own separate file), and when we close the database connection, we also have to ensure that we delete the lock so the state of the database is clean. In such a situation, the additional clean up requires a separate procedure call that needs to be called during the shutdown phase. I am not sure how to do such a setup with using custodian. That's why I asked whether there is a hook that can clean up such objects. > Meanwhile, wouldn't the closest analogue to automatic C++ init/destruct > for a block be `call-with-...' functions, such as > `call-with-input-file'? Those use `dynamic-wind' to ensure that the > file is explicitly closed when control leaves the `call-with-...' > invocation. > call-with-* are for auto/local variable management, but I am thinking about longer lived objects, analogue would be C++ object managed through smart pointers such as the boost library. For example, there might be a module that provides a set of functions as its interface, but the module hides the fact that these functions uses a database connection (supposedly we can swap out the module so the client should not be aware that there is a database connection). In such situation it would be nice to have the module that hides the implementation detail to manage the destruction of the object once the module goes out of the scope. Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090207/852c7eff/attachment.html From grettke at acm.org Sat Feb 7 22:16:00 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:40:16 2009 Subject: [plt-scheme] dot notation issue In-Reply-To: References: Message-ID: <756daca50902071916l73eecd41l3e3ead930f912120@mail.gmail.com> On Fri, Feb 6, 2009 at 5:46 PM, Lisa Gandy wrote: > I have the following code.. > (define (same-parity p . x) > (define ind (remainder p 2)) > (cond ((null? x) '()) > ((= ind (remainder (car x) 2)) > (cons (car x) (same-parity p (cdr x)))) > (else (same-parity p (cdr x))))) > What is going on here? The first time you apply the function, p is bound to the first argument, and x is bound to a list of the rest of the arguments. When you take the iterative step, p is bound to the first argument which is a list of the rest of arguments from the previous steps. That is why YC's fix would work. You should play around with the dot define shape like Richard suggested to see what is happening. From eli at barzilay.org Sun Feb 8 13:40:58 2009 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:40:16 2009 Subject: [plt-scheme] Conditions in web-templates In-Reply-To: References: <20090207144733.GA1384@syhpoon-hq.freenet.com.ua> Message-ID: <18831.10042.856777.519360@arabic.ccs.neu.edu> On Feb 7, Jay McCarthy wrote: > Yes. Here is an example: > > if.html: > @(if (@monkeys . > . @monkey-limit) > @list{

There are too many monkeys!

} > @(if (@monkeys . < . @monkey-minimum) > @list{

There aren't enough monkeys!

} > @list{

There are just enough monkeys!

})) This is, BTW, the same as: @(if (monkeys . > . monkey-limit) @list{

There are too many monkeys!

} (if (monkeys . < . monkey-minimum) @list{

There aren't enough monkeys!

} @list{

There are just enough monkeys!

})) which is also the same as: @(cond [(monkeys . > . monkey-limit) @list{

There are too many monkeys!

}] [(monkeys . < . monkey-minimum) @list{

There aren't enough monkeys!

}] [else @list{

There are just enough monkeys!

}]) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From michel.sylvan at gmail.com Sun Feb 8 16:39:02 2009 From: michel.sylvan at gmail.com (Michel S.) Date: Thu Mar 26 02:40:16 2009 Subject: [plt-scheme] Trouble with IO ports Message-ID: <8b87ee11-fa71-4ffb-82d6-b43dc1aaeaf6@r37g2000prr.googlegroups.com> Using PLT 4.1.4 (the Fedora 9/i386 from plt-scheme.org), when creating a process, the input port appears to never contain anything. Example: (require scheme/system) > (require scheme/system) > (define p (process "bash")) > (define ip (car p)) > (define op (cadr p)) > (char-ready? ip) #f > (fprintf (cadr p) "ls /") > (flush-output) > (char-ready? ip) #f On Windows, the problem appears to be worse -- in Unix, this works: > (fprintf (cadr p) "echo foo > foo.txt") > (flush-output) whereas in Windows (using cmd instead of bash), nothing is written. On the other hand, on Windows, the input port initially contains some data, and the following code will retrieve the data without any problem: (define consume-when-ready (lambda (ip) (when input-port-ok? (let loop () (when (not (char-ready? ip)) (loop))) (let ([outs (open-output-string)]) (let loop () (when (or (char-ready? ip) (begin ;; allow for slow responses (sleep 0.1) (char-ready? ip))) (write-char (read-char ip) outs) (loop))) (get-output-string outs))))) I'm writing an interface from Scheme to Python, using process pipes to communicate between the two, so bidirectional communication is rather important. Any idea why this bizarre behavior occurs? (on Chez Scheme, in Unix -- Linux and OS X -- everything works; on Windows, the output works but the input is even more dangerous -- char- ready? will erroneously return #t but the interpreter enters an infinite loop when (read-char ip) is attempted. Thanks, -- Michel Salim From robby at eecs.northwestern.edu Sun Feb 8 16:47:01 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Mar 26 02:40:16 2009 Subject: [plt-scheme] Trouble with IO ports In-Reply-To: <8b87ee11-fa71-4ffb-82d6-b43dc1aaeaf6@r37g2000prr.googlegroups.com> References: <8b87ee11-fa71-4ffb-82d6-b43dc1aaeaf6@r37g2000prr.googlegroups.com> Message-ID: <932b2f1f0902081347leb058c5q3ee8d382a0c39895@mail.gmail.com> On Sun, Feb 8, 2009 at 3:39 PM, Michel S. wrote: > Using PLT 4.1.4 (the Fedora 9/i386 from plt-scheme.org), when creating > a process, the input port appears to never contain anything. > > Example: > > (require scheme/system) >> (require scheme/system) >> (define p (process "bash")) >> (define ip (car p)) >> (define op (cadr p)) >> (char-ready? ip) > #f >> (fprintf (cadr p) "ls /") >> (flush-output) >> (char-ready? ip) > #f I think you just miss the newline. At least that works on my mac, as below. Robby > (require scheme/system) > (define p (process "bash")) > (define ip (car p)) > (define op (cadr p))> #> > > (fprintf (cadr p) "ls /\n") > (thread (lambda () (copy-port ip (current-output-port)))) # > (flush-output (cadr p)) Applications ... the contents of my / directory follow ... From eli at barzilay.org Sun Feb 8 17:24:27 2009 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:40:17 2009 Subject: [plt-scheme] Trouble with IO ports In-Reply-To: <8b87ee11-fa71-4ffb-82d6-b43dc1aaeaf6@r37g2000prr.googlegroups.com> References: <8b87ee11-fa71-4ffb-82d6-b43dc1aaeaf6@r37g2000prr.googlegroups.com> Message-ID: <18831.23451.925445.669964@arabic.ccs.neu.edu> On Feb 8, Michel S. wrote: > Using PLT 4.1.4 (the Fedora 9/i386 from plt-scheme.org), when > creating a process, the input port appears to never contain > anything. > > Example: > > (require scheme/system) > > (require scheme/system) > > (define p (process "bash")) > > (define ip (car p)) > > (define op (cadr p)) > > (char-ready? ip) > #f Why did you expect something to be available at this point? (If you try to run bash manually from a redirected port instead of a terminal, it doesn't print any prompt.) > > (fprintf (cadr p) "ls /") > > (flush-output) > > (char-ready? ip) > #f You're missing a newline -- otherwise, bash is still just waiting for your input. > On Windows, the problem appears to be worse -- in Unix, this works: > > (fprintf (cadr p) "echo foo > foo.txt") > > (flush-output) > > whereas in Windows (using cmd instead of bash), nothing is written. I'd be surprised if Windows' cmd.exe behaves differently in this respect. > On the other hand, on Windows, the input port initially contains some > data, and the following code will retrieve the data without any > problem: [...] I can't see the whole picture (partly because you only included a random piece), but in general you have plenty of input functions that can deal very well with things like reading the available part of an input port. But if you plan to be interacting with an interactive command (like bash or python), then it is not a good idea to work in a simple mode where you throw some characters in and then wait for the output to come. It is much better to set up thread to do some of this work too. And BTW -- it is also not a good idea if you expect the response text to be a reply for the input text. This is true for any language that can spit out text asynchronously. > I'm writing an interface from Scheme to Python, using process pipes to > communicate between the two, so bidirectional communication is rather > important. Any idea why this bizarre behavior occurs? > > (on Chez Scheme, in Unix -- Linux and OS X -- everything works; I doubt it -- it's more likely that you have different code for Chez and you didn't forget the newline there. > on Windows, the output works but the input is even more dangerous -- > char- ready? will erroneously return #t but the interpreter enters > an infinite loop when (read-char ip) is attempted. In general, `char-ready?' and `read-char' are poor choices to build this functionality on. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From pltscheme at pnkfx.org Sun Feb 8 19:41:19 2009 From: pltscheme at pnkfx.org (Felix Klock's PLT scheme proxy) Date: Thu Mar 26 02:40:17 2009 Subject: [plt-scheme] Lazy evaluation and tail calls In-Reply-To: References: Message-ID: <1A310012-BC61-472C-9024-CC81B5C912D9@pnkfx.org> Joe (cc'ing James and plt-scheme)- On Jan 17, 2009, at 12:26 PM, Joe Marshall wrote: > On Sat, Jan 17, 2009 at 6:42 AM, James Coglan > wrote: >> >> I was wondering whether it's possible to have tail call >> optimisation when >> using normal order. I don't want to bang my head against the wall >> trying to >> make it happen if it can't be done. > > To answer your question directly: it isn't easy and it might not be > possible > at all. If anyone *really* knows the answer, it is Will Clinger. > > I might be a bit behind the times here, but I believe it is still an > open question > the way you have phrased it. I'll go out on a limb and suggest that > a good > explanation is worthy of a degree. > If you want to see related work on this topic, you may want to look at the work of Bakewell and Runciman on this topic. For example: http://portal.acm.org/citation.cfm?id=351287 (Caveat: I read their papers a few years ago, so maybe their stuff has become out-dated. But my memory is that they at least referenced Will's work on the topic; they had a chance of being on the right track.) -Felix From jcoglan at googlemail.com Sun Feb 8 19:53:13 2009 From: jcoglan at googlemail.com (James Coglan) Date: Thu Mar 26 02:40:17 2009 Subject: [plt-scheme] Lazy evaluation and tail calls In-Reply-To: <1A310012-BC61-472C-9024-CC81B5C912D9@pnkfx.org> References: <1A310012-BC61-472C-9024-CC81B5C912D9@pnkfx.org> Message-ID: 2009/2/9 Felix Klock's PLT scheme proxy > Joe (cc'ing James and plt-scheme)- > > On Jan 17, 2009, at 12:26 PM, Joe Marshall wrote: > > On Sat, Jan 17, 2009 at 6:42 AM, James Coglan >> wrote: >> >>> >>> I was wondering whether it's possible to have tail call optimisation when >>> using normal order. I don't want to bang my head against the wall trying >>> to >>> make it happen if it can't be done. >>> >> >> To answer your question directly: it isn't easy and it might not be >> possible >> at all. If anyone *really* knows the answer, it is Will Clinger. >> >> I might be a bit behind the times here, but I believe it is still an >> open question >> the way you have phrased it. I'll go out on a limb and suggest that a >> good >> explanation is worthy of a degree. >> >> > If you want to see related work on this topic, you may want to look at the > work of Bakewell and Runciman on this topic. > > For example: > > http://portal.acm.org/citation.cfm?id=351287 > > (Caveat: I read their papers a few years ago, so maybe their stuff has > become out-dated. But my memory is that they at least referenced Will's > work on the topic; they had a chance of being on the right track.) Thanks. I've since moved onto implementing continuations, and I had enough trouble getting my head around the applicative order version that I think trying to implement continuations for normal order would make my head explode... -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090209/a192809e/attachment.htm From matthias at ccs.neu.edu Sun Feb 8 20:44:33 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:40:18 2009 Subject: [plt-scheme] Lazy evaluation and tail calls In-Reply-To: References: <1A310012-BC61-472C-9024-CC81B5C912D9@pnkfx.org> Message-ID: <87D01BE0-E9D0-4A10-ACC4-31E1B31982B3@ccs.neu.edu> On Feb 8, 2009, at 7:53 PM, James Coglan wrote: > I've since moved onto implementing continuations, and I had enough > trouble getting my head around the applicative order version that I > think trying to implement continuations for normal order would make > my head explode... James, just for the record from a semanticist: the terms 'applicative order' and 'normal order' make NO SENSE whatsoever in the world of PLs. Period. -- Matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090208/7cfd4aae/attachment.html From mikeegg1 at me.com Sun Feb 8 16:58:32 2009 From: mikeegg1 at me.com (Mike Eggleston) Date: Thu Mar 26 02:40:18 2009 Subject: [plt-scheme] [OT] mac problem Message-ID: <20090208215832.GA257@mail.me.com> Morning, Well, my ISP is having severe issues so I can't surf for an answer. Here is a message I'll send to the apple boards when I get enough bandwidth for a browser. I hope this message makes it back through to the list. ----------------------- Morning, I'm on a fully patched (no patches applied today) Macbook Pro, 15", 10.5.6 and I'm trying to run TaxCut 2008. I have installed and removed TaxCut 2008 multiple times. When I start TaxCut it displays the first window (starting a return) with question marks instead of graphic buttons. When I click on the import previous tax return botton it says 'failure reading the compressed xml format'. This sounds like maybe a java error. Is there a way to downlevel my installed java? Is there something else that could be causing this issue? My daughter's computer, iMac 24", 10.5.6, fully patched, does run this program without error. What's going on with my laptop? Mike ----------------------- Does anyone have a thought about this issue? Mike From mikeegg1 at me.com Sun Feb 8 22:30:41 2009 From: mikeegg1 at me.com (Mike Eggleston) Date: Thu Mar 26 02:40:19 2009 Subject: [plt-scheme] [OT] mac problem In-Reply-To: <20090208215832.GA257@mail.me.com> References: <20090208215832.GA257@mail.me.com> Message-ID: <20090209033041.GD182@mail.me.com> On Sun, 08 Feb 2009, Mike Eggleston might have said: > Morning, > > Well, my ISP is having severe issues so I can't surf for an answer. > > Here is a message I'll send to the apple boards when I get enough > bandwidth for a browser. I hope this message makes it back through > to the list. > > ----------------------- > > Morning, > > I'm on a fully patched (no patches applied today) Macbook Pro, 15", > 10.5.6 and I'm trying to run TaxCut 2008. I have installed and > removed TaxCut 2008 multiple times. When I start TaxCut it displays > the first window (starting a return) with question marks instead > of graphic buttons. When I click on the import previous tax return > botton it says 'failure reading the compressed xml format'. This > sounds like maybe a java error. Is there a way to downlevel my > installed java? > > Is there something else that could be causing this issue? > > My daughter's computer, iMac 24", 10.5.6, fully patched, does run > this program without error. What's going on with my laptop? > > Mike > > ----------------------- > > > Does anyone have a thought about this issue? > > Mike Well, any ideas would be appreciated. Instead of continuing with the frustation of talking at tech support I got a refund and am doing my US taxes a different way. Thanks for reading the message. Mike From DekuDekuplex at Yahoo.com Sun Feb 8 23:43:23 2009 From: DekuDekuplex at Yahoo.com (Benjamin L.Russell) Date: Thu Mar 26 02:40:19 2009 Subject: [plt-scheme] Re: [plt-edu] Re: animation projects, video-game and not References: <4D3FD08A-0585-4C84-8EE4-4A74760CA4F5@ccs.neu.edu> <779bf2730902071038n5b504870yd5993ecd3d3afe1c@mail.gmail.com> <4A00EB24-C151-408B-AC69-56F1ECDF6E6E@ccs.neu.edu> <4A00EB24-C151-408B-AC69-56F1ECDF6E6E-1vnkWVZi4QaVc3sceRu5cw@public.gmane.org> <779bf2730902071142nc33e041ja6e6c18f64cb94ac@mail.gmail.com> Message-ID: On Sat, 7 Feb 2009 11:42:50 -0800, YC wrote: >On Sat, Feb 7, 2009 at 10:46 AM, Matthias Felleisen wrote: > >> >> On Feb 7, 2009, at 1:38 PM, YC wrote: >> >> I am learning to use just plain modules and structs to achieve the >> organization effect these days. Module provides encapsulation. >> >> >> See my ECOOP talk. >> > >A lot of gems in the talk - I need to digest it more fully - thanks! Assuming the "ECOOP talk" refers to the presentation "How many continuations can dance on the head of a pin" (see http://www.ccs.neu.edu/home/matthias/Presentations/ilc.html), I'm trying to carry out the examples in the presentation, but some of them refer to a "/Users/matthias/Unison/Web/HtDP/Extended/webpages.ss" teachpack, without which running the examples results in a "bad syntax (multiple expressions after identifier)" error. Is there a site from where I can install this teachpack in order to run the examples? -- 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 DekuDekuplex at Yahoo.com Sun Feb 8 23:49:00 2009 From: DekuDekuplex at Yahoo.com (Benjamin L.Russell) Date: Thu Mar 26 02:40:19 2009 Subject: [plt-scheme] Re: [plt-edu] Re: animation projects, video-game and not References: <4D3FD08A-0585-4C84-8EE4-4A74760CA4F5@ccs.neu.edu> <779bf2730902071038n5b504870yd5993ecd3d3afe1c@mail.gmail.com> <4A00EB24-C151-408B-AC69-56F1ECDF6E6E@ccs.neu.edu> <4A00EB24-C151-408B-AC69-56F1ECDF6E6E-1vnkWVZi4QaVc3sceRu5cw@public.gmane.org> <779bf2730902071142nc33e041ja6e6c18f64cb94ac@mail.gmail.com> Message-ID: On Mon, 09 Feb 2009 13:43:23 +0900, Benjamin L.Russell wrote: >On Sat, 7 Feb 2009 11:42:50 -0800, YC > wrote: > >>On Sat, Feb 7, 2009 at 10:46 AM, Matthias Felleisen wrote: >> >>> >>> On Feb 7, 2009, at 1:38 PM, YC wrote: >>> >>> I am learning to use just plain modules and structs to achieve the >>> organization effect these days. Module provides encapsulation. >>> >>> >>> See my ECOOP talk. >>> >> >>A lot of gems in the talk - I need to digest it more fully - thanks! > >Assuming the "ECOOP talk" refers to the presentation "How many >continuations can dance on the head of a pin" (see >http://www.ccs.neu.edu/home/matthias/Presentations/ilc.html), I'm >trying to carry out the examples in the presentation, but some of them >refer to a "/Users/matthias/Unison/Web/HtDP/Extended/webpages.ss" >teachpack, without which running the examples results in a "bad syntax >(multiple expressions after identifier)" error. > >Is there a site from where I can install this teachpack in order to >run the examples? Never mind; I just found it: http://www.ccs.neu.edu/home/matthias/HtDP/Extended/webpages.ss It is listed under the "Making Web Pages" section at the following site: Extended Exercises http://www.ccs.neu.edu/home/matthias/HtDP/Extended/ The documentation for that teachpack is also available at the following page: Documentation: webpages.ss http://www.ccs.neu.edu/home/matthias/HtDP/Extended/webpages-doc.html -- 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 michel.sylvan at gmail.com Mon Feb 9 00:02:30 2009 From: michel.sylvan at gmail.com (Michel S.) Date: Thu Mar 26 02:40:19 2009 Subject: [plt-scheme] Re: Trouble with IO ports In-Reply-To: <18831.23451.925445.669964@arabic.ccs.neu.edu> References: <8b87ee11-fa71-4ffb-82d6-b43dc1aaeaf6@r37g2000prr.googlegroups.com> <18831.23451.925445.669964@arabic.ccs.neu.edu> Message-ID: On Feb 8, 5:24?pm, Eli Barzilay wrote: > On Feb ?8, Michel S. wrote: > > > Using PLT 4.1.4 (the Fedora 9/i386 from plt-scheme.org), when > > creating a process, the input port appears to never contain > > anything. > > > Example: > > > (require scheme/system) > > > (require scheme/system) > > > (define p (process "bash")) > > > (define ip (car p)) > > > (define op (cadr p)) > > > (char-ready? ip) > > #f > > Why did you expect something to be available at this point? ?(If you > try to run bash manually from a redirected port instead of a terminal, > it doesn't print any prompt.) > > > > (fprintf (cadr p) "ls /") > > > (flush-output) > > > (char-ready? ip) > > #f > > You're missing a newline -- otherwise, bash is still just waiting for > your input. > > > On Windows, the problem appears to be worse -- in Unix, this works: > > > (fprintf (cadr p) "echo foo > foo.txt") > > > (flush-output) > > > whereas in Windows (using cmd instead of bash), nothing is written. > > I'd be surprised if Windows' cmd.exe behaves differently in this > respect. > > > On the other hand, on Windows, the input port initially contains some > > data, and the following code will retrieve the data without any > > problem: [...] > > I can't see the whole picture (partly because you only included a > random piece), but in general you have plenty of input functions that > can deal very well with things like reading the available part of an > input port. ?But if you plan to be interacting with an interactive > command (like bash or python), then it is not a good idea to work in a > simple mode where you throw some characters in and then wait for the > output to come. ?It is much better to set up thread to do some of this > work too. Turns out to be a trivial error -- I was printing the first expected input on stderr, and on Chez, stdout/stderr is redirected to a single input port. My real code has the newlines, yes, so Robby and yourself are correct on that point. Also, it looks like Chez more aggressively flushes output ports; so flushing after every write on the Scheme side (as well as on the sending side) helps. > And BTW -- it is also not a good idea if you expect the response text > to be a reply for the input text. ?This is true for any language that > can spit out text asynchronously. I'm aware of this; when working on the REPL, enough time normally has lapsed that I don't include the actual input-parsing code in my original question. After sending a command, I'd wait for the next available input, then keep reading until there has been no input for x seconds. > I doubt it -- it's more likely that you have different code for Chez > and you didn't forget the newline there. > The Chez bug still remains, alas (on Windows). Oh well, I'll bug the relevant people about that. > > on Windows, the output works but the input is even more dangerous -- > > char- ready? will erroneously return #t but the interpreter enters > > an infinite loop when (read-char ip) is attempted. > > In general, `char-ready?' and `read-char' are poor choices to build > this functionality on. Unfortunately that seems the lowest common denominator. copy-port appears to be PLT-specific. Any suggestion? Thanks, -- Michel From DekuDekuplex at Yahoo.com Mon Feb 9 00:03:50 2009 From: DekuDekuplex at Yahoo.com (Benjamin L.Russell) Date: Thu Mar 26 02:40:19 2009 Subject: [plt-scheme] Re: [plt-edu] Re: animation projects, video-game and not References: <779bf2730902071038n5b504870yd5993ecd3d3afe1c@mail.gmail.com> <4A00EB24-C151-408B-AC69-56F1ECDF6E6E@ccs.neu.edu> <4A00EB24-C151-408B-AC69-56F1ECDF6E6E-1vnkWVZi4QaVc3sceRu5cw@public.gmane.org> <779bf2730902071142nc33e041ja6e6c18f64cb94ac@mail.gmail.com> Message-ID: On Mon, 09 Feb 2009 13:49:00 +0900, Benjamin L.Russell wrote: >On Mon, 09 Feb 2009 13:43:23 +0900, Benjamin L.Russell > wrote: > >>On Sat, 7 Feb 2009 11:42:50 -0800, YC >> wrote: >> >>>On Sat, Feb 7, 2009 at 10:46 AM, Matthias Felleisen wrote: >>> >>>> >>>> On Feb 7, 2009, at 1:38 PM, YC wrote: >>>> >>>> I am learning to use just plain modules and structs to achieve the >>>> organization effect these days. Module provides encapsulation. >>>> >>>> >>>> See my ECOOP talk. >>>> >>> >>>A lot of gems in the talk - I need to digest it more fully - thanks! >> >>Assuming the "ECOOP talk" refers to the presentation "How many >>continuations can dance on the head of a pin" (see >>http://www.ccs.neu.edu/home/matthias/Presentations/ilc.html), I'm >>trying to carry out the examples in the presentation, but some of them >>refer to a "/Users/matthias/Unison/Web/HtDP/Extended/webpages.ss" >>teachpack, without which running the examples results in a "bad syntax >>(multiple expressions after identifier)" error. >> >>Is there a site from where I can install this teachpack in order to >>run the examples? > >Never mind; I just found it: > >http://www.ccs.neu.edu/home/matthias/HtDP/Extended/webpages.ss > >It is listed under the "Making Web Pages" section at the following >site: > >Extended Exercises >http://www.ccs.neu.edu/home/matthias/HtDP/Extended/ > >The documentation for that teachpack is also available at the >following page: > >Documentation: webpages.ss >http://www.ccs.neu.edu/home/matthias/HtDP/Extended/webpages-doc.html Perhaps it's just me, but I can't seem to run the following example on slide 24 of the above-mentioned presentation, in the slide entitled "Area of Circle (Console)": (define r (read "Enter radius:" ) (print "area is %d\n" (* 3.14 r r)) (exit) First, there seems to be at least one missing parenthesis, either at the end of the first line or at the end of the last line, depending on whether the above-mentioned code segment is regarded as a sequence of independent instructions, or as a single procedure. Second, even with the "webpages.ss" teachpack installed, the "read" function does not seem to be defined. Does anybody know how I can make this procedure work? -- 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 lordgeoffrey at optushome.com.au Mon Feb 9 00:06:52 2009 From: lordgeoffrey at optushome.com.au (LordGeoffrey) Date: Thu Mar 26 02:40:19 2009 Subject: [plt-scheme] Accessing SRFIs from R6RS In-Reply-To: <87ljt4bxdl.fsf@delenn.lan> References: <87ljt4bxdl.fsf@delenn.lan> Message-ID: <498FB9EC.8020002@optushome.com.au> I am playing with R6RS, and I am trying to access some of the SRFIs. I tried #!r6rs (import (srfi 27)) But that failed. What is the appropriate syntax? Yes, in this case i am after some random numbers. Thanks. From dvanhorn at ccs.neu.edu Mon Feb 9 00:10:50 2009 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Thu Mar 26 02:40:19 2009 Subject: [plt-scheme] Re: [plt-edu] Re: animation projects, video-game and not In-Reply-To: References: <4D3FD08A-0585-4C84-8EE4-4A74760CA4F5@ccs.neu.edu> <779bf2730902071038n5b504870yd5993ecd3d3afe1c@mail.gmail.com> <4A00EB24-C151-408B-AC69-56F1ECDF6E6E@ccs.neu.edu> <4A00EB24-C151-408B-AC69-56F1ECDF6E6E-1vnkWVZi4QaVc3sceRu5cw@public.gmane.org> <779bf2730902071142nc33e041ja6e6c18f64cb94ac@mail.gmail.com> Message-ID: <498FBADA.1060107@ccs.neu.edu> Benjamin L.Russell wrote: > Assuming the "ECOOP talk" refers to the presentation "How many > continuations can dance on the head of a pin" (see > http://www.ccs.neu.edu/home/matthias/Presentations/ilc.html), I'm > trying to carry out the examples in the presentation, but some of them > refer to a "/Users/matthias/Unison/Web/HtDP/Extended/webpages.ss" > teachpack, without which running the examples results in a "bad syntax > (multiple expressions after identifier)" error. > > Is there a site from where I can install this teachpack in order to > run the examples? The ECOOP talk is different. You can find it here: http://www.ccs.neu.edu/home/matthias/Presentations/ecoop2004.pdf As for the code from the ILC talk, someone else will have to help you with that. Or you might instead try the web server tutorial included in the documentation: http://docs.plt-scheme.org/continue/index.html David From dvanhorn at ccs.neu.edu Mon Feb 9 00:24:23 2009 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Thu Mar 26 02:40:20 2009 Subject: [plt-scheme] Accessing SRFIs from R6RS In-Reply-To: <498FB9EC.8020002@optushome.com.au> References: <87ljt4bxdl.fsf@delenn.lan> <498FB9EC.8020002@optushome.com.au> Message-ID: <498FBE07.5010302@ccs.neu.edu> LordGeoffrey wrote: > I am playing with R6RS, and I am trying to access some of the SRFIs. I > tried > #!r6rs > (import (srfi 27)) Change 27 to :27 and it should work. (This is an artifact of R6RS requiring all library names to be identifiers, so a number is disallowed). David From lordgeoffrey at optushome.com.au Mon Feb 9 00:30:41 2009 From: lordgeoffrey at optushome.com.au (LordGeoffrey) Date: Thu Mar 26 02:40:20 2009 Subject: [plt-scheme] Accessing SRFIs from R6RS In-Reply-To: <498FBE07.5010302@ccs.neu.edu> References: <87ljt4bxdl.fsf@delenn.lan> <498FB9EC.8020002@optushome.com.au> <498FBE07.5010302@ccs.neu.edu> Message-ID: <498FBF81.5010809@optushome.com.au> David, I tried this>> #!r6rs (import (srfi :27)) And got this>> . import: cannot find suitable installed library in: (srfi :27) I am using version 4.1.4 David Van Horn wrote: > LordGeoffrey wrote: >> I am playing with R6RS, and I am trying to access some of the SRFIs. >> I tried >> #!r6rs >> (import (srfi 27)) > > Change 27 to :27 and it should work. (This is an artifact of R6RS > requiring all library names to be identifiers, so a number is > disallowed). > > David > > From eli at barzilay.org Mon Feb 9 01:05:08 2009 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:40:20 2009 Subject: [plt-scheme] Re: Trouble with IO ports In-Reply-To: References: <8b87ee11-fa71-4ffb-82d6-b43dc1aaeaf6@r37g2000prr.googlegroups.com> <18831.23451.925445.669964@arabic.ccs.neu.edu> Message-ID: <18831.51092.245617.84646@arabic.ccs.neu.edu> On Feb 8, Michel S. wrote: > > On Feb 8, 5:24?pm, Eli Barzilay wrote: > > > > In general, `char-ready?' and `read-char' are poor choices to build > > this functionality on. > > Unfortunately that seems the lowest common denominator. copy-port > appears to be PLT-specific. Any suggestion? Well, IMO `read-char' and `char-ready?' are poor enough that I'd write some PLT- and some Chez-specific code. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From lordgeoffrey at optushome.com.au Mon Feb 9 01:22:41 2009 From: lordgeoffrey at optushome.com.au (LordGeoffrey) Date: Thu Mar 26 02:40:20 2009 Subject: [plt-scheme] R6RS and PLoT Message-ID: <498FCBB1.9070102@optushome.com.au> In R5RS, the example from the docs works fine: #lang scheme (require plot) (define data1 (list (vector 1 1 2) (vector 2 2 2))) (plot (error-bars data1)) In R6RS, not so much success: #!r6rs (import (rnrs base (6)) (plot)) (define data1 (list (vector 1 1 2) (vector 2 2 2))) (plot (error-bars data1)) Results in map: expects type as 2nd argument, given: {#(1 1 2) #(2 2 2)}; other arguments were: # From dvanhorn at ccs.neu.edu Mon Feb 9 01:30:04 2009 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Thu Mar 26 02:40:21 2009 Subject: [plt-scheme] Accessing SRFIs from R6RS In-Reply-To: <498FBF81.5010809@optushome.com.au> References: <87ljt4bxdl.fsf@delenn.lan> <498FB9EC.8020002@optushome.com.au> <498FBE07.5010302@ccs.neu.edu> <498FBF81.5010809@optushome.com.au> Message-ID: <498FCD6C.9040105@ccs.neu.edu> LordGeoffrey wrote: > David, > I tried this>> > #!r6rs > (import (srfi :27)) > > And got this>> > . import: cannot find suitable installed library in: (srfi :27) > > I am using version 4.1.4 Support for SRFI 97 must have been added since 4.1.4. This works for me: #lang r6rs (import (rnrs) (srfi :27)) (display (random-integer 10)) But I'm using 4.1.4.2-svn25jan2009. David From dvanhorn at ccs.neu.edu Mon Feb 9 01:41:08 2009 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Thu Mar 26 02:40:21 2009 Subject: [plt-scheme] R6RS and PLoT In-Reply-To: <498FCBB1.9070102@optushome.com.au> References: <498FCBB1.9070102@optushome.com.au> Message-ID: <498FD004.3080509@ccs.neu.edu> LordGeoffrey wrote: > In R5RS, the example from the docs works fine: > #lang scheme > (require plot) > (define data1 (list (vector 1 1 2) > (vector 2 2 2))) > (plot (error-bars data1)) > > > In R6RS, not so much success: > #!r6rs > (import (rnrs base (6)) > (plot)) > (define data1 (list (vector 1 1 2) > (vector 2 2 2))) > (plot (error-bars data1)) > > Results in > map: expects type as 2nd argument, given: {#(1 1 2) #(2 2 > 2)}; other arguments were: # PLT Scheme and R6RS have different notions of the list datatype. You have to convert between them when you pass an R6RS (mutable) list to a function expecting an immutable list: #lang r6rs (import (rnrs) (plot) (scheme mpair)) (define data1 (mlist->list (list (vector 1 1 2) (vector 2 2 2)))) (plot (error-bars data1)) This still doesn't show anything in the interactions window, but that is a separate issue. You can use (display (plot ...)) to see the result. David From lordgeoffrey at optushome.com.au Mon Feb 9 01:41:09 2009 From: lordgeoffrey at optushome.com.au (LordGeoffrey) Date: Thu Mar 26 02:40:21 2009 Subject: [plt-scheme] Accessing SRFIs from R6RS In-Reply-To: <498FCD6C.9040105@ccs.neu.edu> References: <87ljt4bxdl.fsf@delenn.lan> <498FB9EC.8020002@optushome.com.au> <498FBE07.5010302@ccs.neu.edu> <498FBF81.5010809@optushome.com.au> <498FCD6C.9040105@ccs.neu.edu> Message-ID: <498FD005.9080403@optushome.com.au> Yep. Must be. Thanks. David Van Horn wrote: > LordGeoffrey wrote: >> David, >> I tried this>> >> #!r6rs >> (import (srfi :27)) >> >> And got this>> >> . import: cannot find suitable installed library in: (srfi :27) >> >> I am using version 4.1.4 > > Support for SRFI 97 must have been added since 4.1.4. This works for me: > > #lang r6rs > (import (rnrs) > (srfi :27)) > (display (random-integer 10)) > > But I'm using 4.1.4.2-svn25jan2009. > > David > From diggerrrrr at gmail.com Mon Feb 9 02:33:42 2009 From: diggerrrrr at gmail.com (Veer) Date: Thu Mar 26 02:40:21 2009 Subject: [plt-scheme] evaluation order for fold Message-ID: Hello , Consider following functions : (define (search-each los ) (cond [(empty? los) empty] [(member (first los) visited) (search-each (rest los))] [else (cons (search-tree (first los)) (search-each (rest los)))])) and the same above function using foldr : (define (search-each-fold los) (foldr (lambda (s r) (if (member s visited) r (cons (search-tree s) r))) empty los)) Also variable 'visited' is global and updated by search-tree function . When given the same input both function produces the result which though correct but are in different order. My question is are these two function equivalent? I see that in the line [else (cons (search-tree (first los)) (search-each (rest los)))])) (search-tree (first los)) is evaluated first But the fold example does not seem to follow this. Thanks Veer From lordgeoffrey at optushome.com.au Mon Feb 9 02:29:30 2009 From: lordgeoffrey at optushome.com.au (LordGeoffrey) Date: Thu Mar 26 02:40:21 2009 Subject: [plt-scheme] R6RS and PLoT In-Reply-To: <498FD004.3080509@ccs.neu.edu> References: <498FCBB1.9070102@optushome.com.au> <498FD004.3080509@ccs.neu.edu> Message-ID: <498FDB5A.1020208@optushome.com.au> Thanks David (again) David Van Horn wrote: > LordGeoffrey wrote: >> In R5RS, the example from the docs works fine: >> #lang scheme >> (require plot) >> (define data1 (list (vector 1 1 2) >> (vector 2 2 2))) >> (plot (error-bars data1)) >> >> >> In R6RS, not so much success: >> #!r6rs >> (import (rnrs base (6)) >> (plot)) >> (define data1 (list (vector 1 1 2) >> (vector 2 2 2))) >> (plot (error-bars data1)) >> >> Results in >> map: expects type as 2nd argument, given: {#(1 1 2) #(2 >> 2 2)}; other arguments were: # > > PLT Scheme and R6RS have different notions of the list datatype. You > have to convert between them when you pass an R6RS (mutable) list to a > function expecting an immutable list: > > #lang r6rs > (import (rnrs) > (plot) > (scheme mpair)) > > (define data1 (mlist->list (list (vector 1 1 2) > (vector 2 2 2)))) > (plot (error-bars data1)) > > This still doesn't show anything in the interactions window, but that > is a separate issue. You can use (display (plot ...)) to see the result. > > David > > From jcoglan at googlemail.com Mon Feb 9 04:38:33 2009 From: jcoglan at googlemail.com (James Coglan) Date: Thu Mar 26 02:40:22 2009 Subject: [plt-scheme] Lazy evaluation and tail calls In-Reply-To: <87D01BE0-E9D0-4A10-ACC4-31E1B31982B3@ccs.neu.edu> References: <1A310012-BC61-472C-9024-CC81B5C912D9@pnkfx.org> <87D01BE0-E9D0-4A10-ACC4-31E1B31982B3@ccs.neu.edu> Message-ID: 2009/2/9 Matthias Felleisen > > On Feb 8, 2009, at 7:53 PM, James Coglan wrote: > > I've since moved onto implementing continuations, and I had enough > trouble getting my head around the applicative order version that I think > trying to implement continuations for normal order would make my head > explode... > > > James, just for the record from a semanticist: the terms 'applicative > order' and 'normal order' make NO SENSE whatsoever in the world of PLs. > Period. -- Matthias > Could you elaborate? These are terms I picked up learning Scheme from SICP but have also seen any number of confusing descriptions of various calling semantics. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090209/b1ddc17f/attachment.htm From noelwelsh at gmail.com Mon Feb 9 08:26:53 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:40:22 2009 Subject: [plt-scheme] evaluation order for fold In-Reply-To: References: Message-ID: On Mon, Feb 9, 2009 at 7:33 AM, Veer wrote: > My question is are these two function equivalent? Take a look at foldl and foldr. It's an interesting little puzzle working out when the two are equivalent, and when they differ. N. From noelwelsh at gmail.com Mon Feb 9 08:40:15 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:40:22 2009 Subject: [plt-scheme] Player/Stage (robot simulator) bindings Message-ID: Hello, Has anyone worked on binding Player/Stage (a robot simulator) to PLT Scheme? If not, I'll do it myself, but I'd like to build on existing work if possible. (There is nothing in Planet, but that doesn't mean no-one has done it...) Thanks, Noel From matthias at ccs.neu.edu Mon Feb 9 08:42:48 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:40:23 2009 Subject: [plt-scheme] Lazy evaluation and tail calls In-Reply-To: References: <1A310012-BC61-472C-9024-CC81B5C912D9@pnkfx.org> <87D01BE0-E9D0-4A10-ACC4-31E1B31982B3@ccs.neu.edu> Message-ID: On Feb 9, 2009, at 4:38 AM, James Coglan wrote: > > > 2009/2/9 Matthias Felleisen > > On Feb 8, 2009, at 7:53 PM, James Coglan wrote: > >> I've since moved onto implementing continuations, and I had >> enough trouble getting my head around the applicative order >> version that I think trying to implement continuations for normal >> order would make my head explode... > > James, just for the record from a semanticist: the terms > 'applicative order' and 'normal order' make NO SENSE whatsoever in > the world of PLs. Period. -- Matthias > > > Could you elaborate? These are terms I picked up learning Scheme > from SICP but have also seen any number of confusing descriptions > of various calling semantics. Normal order and applicative order are failed attempts to explain the nature of call-by-name programming languages and call-by-value programming languages as models of the lambda calculus. Each describes a so-called _reduction strategy_, which is an algorithm that picks the position of next redex BETA that should be reduced. By 1972, it was clear that instead you want different kind of calculi for different calling conventions and evaluation strategies (to the first outermost lambda, not inside). That is, you always reduce at the leftmost-outermost point in a program but you use either BETA- NAME or BETA-VALUE. Non-PL people were confused (and still are) because BETA-NAME looks like BETA but nearly 40 years later, everyone should figure this out. SICP was written when the majority of people were still confused. -- Matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090209/e0735b0c/attachment.html From sk at cs.brown.edu Mon Feb 9 08:44:08 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:40:24 2009 Subject: [plt-scheme] Player/Stage (robot simulator) bindings In-Reply-To: References: Message-ID: We've actually just been talking to a student here. But I don't know of anyone else who has. On Feb 9, 2009 8:40 AM, "Noel Welsh" wrote: Hello, Has anyone worked on binding Player/Stage (a robot simulator) to PLT Scheme? If not, I'll do it myself, but I'd like to build on existing work if possible. (There is nothing in Planet, but that doesn't mean no-one has done it...) Thanks, Noel _________________________________________________ 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/20090209/5f78cbd1/attachment.htm From matthias at ccs.neu.edu Mon Feb 9 08:53:17 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:40:24 2009 Subject: [plt-scheme] evaluation order for fold In-Reply-To: References: Message-ID: <870F3496-BF75-4FB7-849E-05B42796ED09@ccs.neu.edu> Veer, make sure you reset the visited variable for each search. Then play with foldl and foldr. But also contrast with map and why you may not like it. -- Matthias ;; list of visited trees (define visited '()) ;; Tree -> Boolean (define (search-tree t) (begin (set! visited (cons t visited)) (printf "~s\n" (first t)) true)) ;; [Listof Tree] -> [Listof Boolean] (define (search-each los ) (cond [(empty? los) empty] [(member (first los) visited) (search-each (rest los))] [else (cons (search-tree (first los)) (search-each (rest los)))])) ;; [Listof Tree] -> [Listof Boolean] (define (search-each-fold los) (foldl (lambda (s r) (if (member s visited) r (cons (search-tree s) r))) empty los)) ;; [Listof Tree] -> [Listof Boolean] (define (search-each-map los) (map search-tree los)) ;; --- run program run (define t1 (cons 0 empty)) (define t2 (cons 1 empty)) (define t3 (cons 2 empty)) (define l (list t1 t2 t1 t3 t1)) (set! visited '()) '--plain-- (search-each l) (set! visited '()) '--fold-- (search-each-fold l) (set! visited '()) '--map-- (search-each-map l) On Feb 9, 2009, at 2:33 AM, Veer wrote: > Hello , > > Consider following functions : > > (define (search-each los ) > (cond > [(empty? los) empty] > [(member (first los) visited) (search-each (rest los))] > [else (cons (search-tree (first los)) (search-each (rest > los)))])) > > > and the same above function using foldr : > > (define (search-each-fold los) > (foldr (lambda (s r) > (if (member s visited) > r > (cons (search-tree s) r))) empty los)) > > > Also variable 'visited' is global and updated by search-tree > function . > > When given the same input both function produces the result which > though > correct but are in different order. > > My question is are these two function equivalent? > > I see that in the line [else (cons (search-tree (first los)) > (search-each (rest los)))])) > (search-tree (first los)) is evaluated first > > But the fold example does not seem to follow this. > > Thanks > Veer > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From matthias at ccs.neu.edu Mon Feb 9 08:56:03 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:40:24 2009 Subject: [plt-scheme] Re: [plt-edu] Re: animation projects, video-game and not In-Reply-To: <498FBADA.1060107@ccs.neu.edu> References: <4D3FD08A-0585-4C84-8EE4-4A74760CA4F5@ccs.neu.edu> <779bf2730902071038n5b504870yd5993ecd3d3afe1c@mail.gmail.com> <4A00EB24-C151-408B-AC69-56F1ECDF6E6E@ccs.neu.edu> <4A00EB24-C151-408B-AC69-56F1ECDF6E6E-1vnkWVZi4QaVc3sceRu5cw@public.gmane.org> <779bf2730902071142nc33e041ja6e6c18f64cb94ac@mail.gmail.com> <498FBADA.1060107@ccs.neu.edu> Message-ID: <9D790BBD-D15F-4127-AF99-14214FA3E015@ccs.neu.edu> Yes: the ECOOP talk is about objects. The continuation talk was a satire on Lisp and is very dated. Read the Continue manual instead. On Feb 9, 2009, at 12:10 AM, David Van Horn wrote: > Benjamin L.Russell wrote: >> Assuming the "ECOOP talk" refers to the presentation "How many >> continuations can dance on the head of a pin" (see >> http://www.ccs.neu.edu/home/matthias/Presentations/ilc.html), I'm >> trying to carry out the examples in the presentation, but some of >> them >> refer to a "/Users/matthias/Unison/Web/HtDP/Extended/webpages.ss" >> teachpack, without which running the examples results in a "bad >> syntax >> (multiple expressions after identifier)" error. >> Is there a site from where I can install this teachpack in order to >> run the examples? > > The ECOOP talk is different. You can find it here: > > http://www.ccs.neu.edu/home/matthias/Presentations/ecoop2004.pdf > > As for the code from the ILC talk, someone else will have to help > you with that. Or you might instead try the web server tutorial > included in the documentation: > > http://docs.plt-scheme.org/continue/index.html > > David > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From gabor.lists at mndl.hu Mon Feb 9 08:53:20 2009 From: gabor.lists at mndl.hu (gabor papp) Date: Thu Mar 26 02:40:24 2009 Subject: [plt-scheme] delaunay/voronoi Message-ID: <49903550.2010206@mndl.hu> hello, has anyone implemented delaunay triangulations/voronoi diagrams or worked on bindings for existing computational geometry libraries like qhull or cgal? any help would be appreciated. best, gabor From jadudm at gmail.com Mon Feb 9 09:57:24 2009 From: jadudm at gmail.com (Matt Jadud) Date: Thu Mar 26 02:40:24 2009 Subject: [plt-scheme] Player/Stage (robot simulator) bindings In-Reply-To: References: Message-ID: Hi Noel, > Has anyone worked on binding Player/Stage (a robot simulator) to PLT > Scheme? If not, I'll do it myself, but I'd like to build on existing > work if possible. On Mon, Feb 9, 2009 at 8:44 AM, Shriram Krishnamurthi wrote: > We've actually just been talking to a student here. But I don't know of > anyone else who has. I've worked with Player/Stage from another language, but not Scheme. It should be straight-forward. At least, the polling-based interface should be straight-forward enough. (Granted, polling in robotics strikes me as the single worst thing you can do...) Also, consider ROS from Willow Garage---I don't know how far along it is, but they split everything about robotic control out over XML-RPC. It is being developed by the same individual who drove the development of Player/Stage. I think XML-RPC is probably a bad idea in robotics, but it might make interacting with an equivalent system easier depending on your performance needs. Or not. Cheers, Matt From diggerrrrr at gmail.com Mon Feb 9 10:52:04 2009 From: diggerrrrr at gmail.com (Veer) Date: Thu Mar 26 02:40:24 2009 Subject: [plt-scheme] evaluation order for fold In-Reply-To: <870F3496-BF75-4FB7-849E-05B42796ED09@ccs.neu.edu> References: <870F3496-BF75-4FB7-849E-05B42796ED09@ccs.neu.edu> Message-ID: Thanks! , i guess i have been doing too much of casual programming. In (lambda (s r) ....) i was thinking that r will be evaluated inside the function which of course is false. Just to confirm if am still sane , here is the implementation of foldl and foldr . (define (foldll f base lst) (define (fold res lst) (cond [(empty? lst) res] [else (fold (f (first lst) res) (rest lst))])) (fold base lst)) (define (foldrr f base lst) (cond [(empty? lst) base] [else (f (first lst) (foldrr f base (rest lst)))])) I was thinking that in foldr , (first lst) to be equivalent to (search-tree (first lst)) and was expecting it to be evaluated first before the right hand :) . Sorry for the trouble. On Mon, Feb 9, 2009 at 7:23 PM, Matthias Felleisen wrote: > > Veer, make sure you reset the visited variable for each search. Then play > with foldl and foldr. But also contrast with map and why you may not like > it. -- Matthias > > > ;; list of visited trees > (define visited '()) > > ;; Tree -> Boolean > (define (search-tree t) > (begin (set! visited (cons t visited)) > (printf "~s\n" (first t)) > true)) > > ;; [Listof Tree] -> [Listof Boolean] > (define (search-each los ) > (cond > [(empty? los) empty] > [(member (first los) visited) (search-each (rest los))] > [else (cons (search-tree (first los)) (search-each (rest los)))])) > > ;; [Listof Tree] -> [Listof Boolean] > (define (search-each-fold los) > (foldl (lambda (s r) (if (member s visited) r (cons (search-tree s) r))) > empty > los)) > > ;; [Listof Tree] -> [Listof Boolean] > (define (search-each-map los) (map search-tree los)) > > ;; --- run program run > (define t1 (cons 0 empty)) > (define t2 (cons 1 empty)) > (define t3 (cons 2 empty)) > > (define l (list t1 t2 t1 t3 t1)) > > (set! visited '()) > '--plain-- > (search-each l) > > (set! visited '()) > '--fold-- > (search-each-fold l) > > (set! visited '()) > '--map-- > (search-each-map l) > > > > > On Feb 9, 2009, at 2:33 AM, Veer wrote: > >> Hello , >> >> Consider following functions : >> >> (define (search-each los ) >> (cond >> [(empty? los) empty] >> [(member (first los) visited) (search-each (rest los))] >> [else (cons (search-tree (first los)) (search-each (rest los)))])) >> >> >> and the same above function using foldr : >> >> (define (search-each-fold los) >> (foldr (lambda (s r) >> (if (member s visited) >> r >> (cons (search-tree s) r))) empty los)) >> >> >> Also variable 'visited' is global and updated by search-tree function . >> >> When given the same input both function produces the result which though >> correct but are in different order. >> >> My question is are these two function equivalent? >> >> I see that in the line [else (cons (search-tree (first los)) >> (search-each (rest los)))])) >> (search-tree (first los)) is evaluated first >> >> But the fold example does not seem to follow this. >> >> Thanks >> Veer >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From morazanm at gmail.com Mon Feb 9 12:55:22 2009 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:40:25 2009 Subject: [plt-scheme] Lazy evaluation and tail calls In-Reply-To: References: <1A310012-BC61-472C-9024-CC81B5C912D9@pnkfx.org> <87D01BE0-E9D0-4A10-ACC4-31E1B31982B3@ccs.neu.edu> Message-ID: <9b1fff280902090955r549923d7h6050030b7ca0a1e1@mail.gmail.com> On Mon, Feb 9, 2009 at 4:38 AM, James Coglan wrote: >> >> James, just for the record from a semanticist: the terms 'applicative >> order' and 'normal order' make NO SENSE whatsoever in the world of PLs. >> Period. -- Matthias > > Could you elaborate? These are terms I picked up learning Scheme from SICP > but have also seen any number of confusing descriptions of various calling > semantics. SICP is not the best source to learn about the implementation of programming languages. If you take a look at modern PLs textbooks like, for example, EOPL you will discover that the terms applicative order and normal order are not used. SICP is guiding you in the wrong direction in this case. It really is all about parameter passing variations as Matthias has pointed out to you. -- Cheers, Marco From jay.mccarthy at gmail.com Mon Feb 9 13:22:30 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:40:25 2009 Subject: [plt-scheme] Introducing... Stuffers In-Reply-To: References: <91a2ba3e0902061700l23842b3j7b0a5b99257fb6e@mail.gmail.com> <1234010262.3066.7.camel@bpel.ray.na.odcorp.net> Message-ID: As promised, an HMAC-SHA1 signing stuffer is now implemented. http://faculty.cs.byu.edu/~jay/plt-doc/web-server/stuffers_ss.html#(part._.H.M.A.C-.S.H.A1_.Signing) Jay On Sat, Feb 7, 2009 at 6:14 AM, Jay McCarthy wrote: > Thanks Ray, that is exactly what I planned on implementing. (Basically > what my old HMAC [1] and secure url-param [2] PLaneT packages do.) > > The point of this post was that any PLT WS user can write whatever > kind of serializer they need. I only initially wrote the ones that > correspond to the prior default behavior. > > Jay > > 1. http://planet.plt-scheme.org/package-source/jaymccarthy/hmac-sha1.plt/1/1/hmac-sha1.ss > > 2. http://planet.plt-scheme.org/package-source/jaymccarthy/url-param.plt/2/0/secure.ss > > On Sat, Feb 7, 2009 at 5:37 AM, Ray Racine wrote: >> ... >>> If you just use serialize-stuffer, then the user can change anything >>> they want. >> ... >> >>> If you use the md5-stuffer, then they never get the continuation, so >>> it's no big deal. >> >> There is a standard technique for a Server to send data (in this case >> the serialized continuation) freely out into the wild and woolly >> internet and ensure that the returned data has not been tainted or >> hijacked in anyway. The technique is based upon a signature such as >> MD-5 or SHA1 and a secret key. >> >> You could use it to send a continuation from one server to another in >> your cluster via user's cookie for example and the receiving Server can >> confidentially determine that the data was "minted" by a trusted peer >> Server for example. >> >> See HMAC on Wikipedia. >> >> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > > > > -- > Jay McCarthy > Assistant Professor / Brigham Young University > http://teammccarthy.org/jay > > "The glory of God is Intelligence" - D&C 93 > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From grettke at acm.org Mon Feb 9 16:21:22 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:40:25 2009 Subject: [plt-scheme] HtDP on the Amazon Kindle? Message-ID: <756daca50902091321w3b5041b1h7360de2c0730f857@mail.gmail.com> Will HtDP be published to the Amazon Kindle? How about "The Little" series? From dyrueta at gmail.com Mon Feb 9 18:03:36 2009 From: dyrueta at gmail.com (dave yrueta) Date: Thu Mar 26 02:40:25 2009 Subject: [plt-scheme] HtDP Exercise 23.4.1 Message-ID: <9ff37941-7c84-4b80-85ff-99c3a3393942@t26g2000prh.googlegroups.com> Hi All -- Am sending out a message in a virtual bottle for help with HtDP exercise 23.4.1, reproduced below: A general integration function must consume three inputs: a, b, and the function f. The fourth part, the x axis, is implied. This suggests the following contract: ;; integrate : (number -> number) number number -> number ;; to compute the area under the graph of f between a and b (define (integrate f a b) ...) Kepler suggested one simple integration method. It consists of three steps: divide the interval into two parts: [a,(a + b/2)] and [(a + b/2),b]; compute the area of each trapezoid; and add the two areas to get an estimate at the integral. Exercise 23.4.1. Develop the function integrate-kepler. It computes the area under some the graph of some function f between left and right using Kepler's rule. Specifically, I'm stuck at the "create examples" part of the design recipe, because I don't understand the "integration method" outlined by the exercise. First, what does it mean to "divide the interval into two parts?" Suppose I substitute values for variables a and b (a=3 and b=6). I end up with a pair of values: [3, 6] and [6, 6]. Are these x,y coordinates for points on a graph? If so, how do they relate to the second step of the integration method, which is to determine the area for "each trapezoid?" I know the area for a trapezoid = a (b1 + b2 /2) where a is the altitude, and b1 and b2 are the length of the two bases. My problem is deriving values for a, b1 and b2 from the integrate-kepler function arguments. Finally, I have no idea how argument f, the line function, fits into all this. I don't even know what a function for a line looks like (y = x + 10?) HtDP supplies an illustration to help visualize the problem (http:// www.htdp.org/2003-09-26/Book/curriculum-Z-H-29.html#node_sec_23.4). I haven't the faintest idea how to interpret it: I'm sure someone even casually acquainted with basic calculus could solve this problem easily. Unfortunately, I'm relatively math- illiterate, so figuring out how all the parts fit together has eluded me. I did manage to solve the other mathematical examples which appeared earlier in the chapter because the mechanics of determining the solution appeared clear to me. Not so here. I'm hoping that if someone can help me formulate some examples, I'd be on my way. Thanks! Dave Yrueta From danprager at optusnet.com.au Mon Feb 9 18:32:44 2009 From: danprager at optusnet.com.au (danprager@optusnet.com.au) Date: Thu Mar 26 02:40:25 2009 Subject: [plt-scheme] HtDP Exercise 23.4.1 Message-ID: <200902092332.n19NWiF2030668@mail07.syd.optusnet.com.au> > divide the interval into two parts: [a,(a + b/2)] and [(a + b/2),b]; Try: [a,(a+b)/2 and [(a+b)/2, b] (a+b)/2 is the mid-point between a and b: (a + b/2) ain't. -- Dan > dave yrueta wrote: > > Hi All -- > > Am sending out a message in a virtual bottle for help with HtDP > exercise 23.4.1, reproduced below: > > A general integration function must consume three inputs: a, b, and > the function f. The fourth part, the x axis, is implied. This suggests > the following contract: > > ;; integrate : (number -> number) number number -> number > ;; to compute the area under the graph of f between a and b > (define (integrate f a b) ...) > Kepler suggested one simple integration method. It consists of three > steps: > > divide the interval into two parts: [a,(a + b/2)] and [(a + b/2),b]; > > compute the area of each trapezoid; and > > add the two areas to get an estimate at the integral. > > Exercise 23.4.1. Develop the function integrate-kepler. It computes > the area under some the graph of some function f between left and > right using Kepler's rule. > > Specifically, I'm stuck at the "create examples" part of the design > recipe, because I don't understand the "integration method" outlined > by the exercise. > > First, what does it mean to "divide the interval into two parts?" > Suppose I substitute values for variables a and b (a=3 and b=6). I > end up with a pair of values: [3, 6] and [6, 6]. Are these x,y > coordinates for points on a graph? If so, how do they relate to the > second step of the integration method, which is to determine the area > for "each trapezoid?" > > I know the area for a trapezoid = a (b1 + b2 /2) where a is the > altitude, and b1 and b2 are the length of the two bases. My problem > is deriving values for a, b1 and b2 from the integrate-kepler function > arguments. > > Finally, I have no idea how argument f, the line function, fits into > all this. I don't even know what a function for a line looks like (y > = x + 10?) > > HtDP supplies an illustration to help visualize the problem (http:// > www.htdp.org/2003-09-26/Book/curriculum-Z-H-29.html#node_sec_23.4). I > haven't the faintest idea how to interpret it: > > I'm sure someone even casually acquainted with basic calculus could > solve this problem easily. Unfortunately, I'm relatively math- > illiterate, so figuring out how all the parts fit together has eluded > me. I did manage to solve the other mathematical examples which > appeared earlier in the chapter because the mechanics of determining > the solution appeared clear to me. Not so here. I'm hoping that if > someone can help me formulate some examples, I'd be on my way. > > Thanks! > > Dave Yrueta > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From dyrueta at gmail.com Mon Feb 9 18:53:17 2009 From: dyrueta at gmail.com (David Yrueta) Date: Thu Mar 26 02:40:26 2009 Subject: [plt-scheme] HtDP Exercise 23.4.1 In-Reply-To: <200902092332.n19NWiF2030668@mail07.syd.optusnet.com.au> References: <200902092332.n19NWiF2030668@mail07.syd.optusnet.com.au> Message-ID: <186df66b0902091553r4eb4e4a8qacef9335f90399e3@mail.gmail.com> Thanks Dan. Looks like the original formatting from HtDP didn't carry over from my cut-and-paste. Still don't really understand how this relates to the question of computing the "area of each trapezoid," though. Cheers, Dave On Mon, Feb 9, 2009 at 3:32 PM, wrote: > > > divide the interval into two parts: [a,(a + b/2)] and [(a + b/2),b]; > > Try: [a,(a+b)/2 and [(a+b)/2, b] > > (a+b)/2 is the mid-point between a and b: (a + b/2) ain't. > > -- Dan > > > > > dave yrueta wrote: > > > > Hi All -- > > > > Am sending out a message in a virtual bottle for help with HtDP > > exercise 23.4.1, reproduced below: > > > > A general integration function must consume three inputs: a, b, and > > the function f. The fourth part, the x axis, is implied. This suggests > > the following contract: > > > > ;; integrate : (number -> number) number number -> number > > ;; to compute the area under the graph of f between a and b > > (define (integrate f a b) ...) > > Kepler suggested one simple integration method. It consists of three > > steps: > > > > divide the interval into two parts: [a,(a + b/2)] and [(a + b/2),b]; > > > > compute the area of each trapezoid; and > > > > add the two areas to get an estimate at the integral. > > > > Exercise 23.4.1. Develop the function integrate-kepler. It computes > > the area under some the graph of some function f between left and > > right using Kepler's rule. > > > > Specifically, I'm stuck at the "create examples" part of the design > > recipe, because I don't understand the "integration method" outlined > > by the exercise. > > > > First, what does it mean to "divide the interval into two parts?" > > Suppose I substitute values for variables a and b (a=3 and b=6). I > > end up with a pair of values: [3, 6] and [6, 6]. Are these x,y > > coordinates for points on a graph? If so, how do they relate to the > > second step of the integration method, which is to determine the area > > for "each trapezoid?" > > > > I know the area for a trapezoid = a (b1 + b2 /2) where a is the > > altitude, and b1 and b2 are the length of the two bases. My problem > > is deriving values for a, b1 and b2 from the integrate-kepler function > > arguments. > > > > Finally, I have no idea how argument f, the line function, fits into > > all this. I don't even know what a function for a line looks like (y > > = x + 10?) > > > > HtDP supplies an illustration to help visualize the problem (http:// > > www.htdp.org/2003-09-26/Book/curriculum-Z-H-29.html#node_sec_23.4). I > > haven't the faintest idea how to interpret it: > > > > I'm sure someone even casually acquainted with basic calculus could > > solve this problem easily. Unfortunately, I'm relatively math- > > illiterate, so figuring out how all the parts fit together has eluded > > me. I did manage to solve the other mathematical examples which > > appeared earlier in the chapter because the mechanics of determining > > the solution appeared clear to me. Not so here. I'm hoping that if > > someone can help me formulate some examples, I'd be on my way. > > > > Thanks! > > > > Dave Yrueta > > _________________________________________________ > > 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/20090209/48567b02/attachment.html From chust at web.de Mon Feb 9 20:33:59 2009 From: chust at web.de (Thomas Chust) Date: Thu Mar 26 02:40:26 2009 Subject: [plt-scheme] HtDP Exercise 23.4.1 In-Reply-To: <186df66b0902091553r4eb4e4a8qacef9335f90399e3@mail.gmail.com> References: <200902092332.n19NWiF2030668@mail07.syd.optusnet.com.au> <186df66b0902091553r4eb4e4a8qacef9335f90399e3@mail.gmail.com> Message-ID: <1c1a33bc0902091733t32910a27rabd8fbc9ee1b3b83@mail.gmail.com> 2009/2/10 David Yrueta : > [...] Still don't really understand how this relates to the question of computing the > "area of each trapezoid," though. [...] Hello, http://en.wikipedia.org/wiki/Trapezoidal_rule has some figures that may make the idea behind this integration method more clear: The graph of the function is approximated by a polyline -- in the special case of Kepler's rule a very coarse one with only two edges; the approximation of the integral is the area of the polygon bounded by this polyline, the two integration interval boundaries and the coordinate axis of the integration variable. cu, Thomas -- When C++ is your hammer, every problem looks like your thumb. From dyrueta at gmail.com Mon Feb 9 21:47:33 2009 From: dyrueta at gmail.com (David Yrueta) Date: Thu Mar 26 02:40:27 2009 Subject: [plt-scheme] HtDP Exercise 23.4.1 In-Reply-To: <1c1a33bc0902091733t32910a27rabd8fbc9ee1b3b83@mail.gmail.com> References: <200902092332.n19NWiF2030668@mail07.syd.optusnet.com.au> <186df66b0902091553r4eb4e4a8qacef9335f90399e3@mail.gmail.com> <1c1a33bc0902091733t32910a27rabd8fbc9ee1b3b83@mail.gmail.com> Message-ID: <186df66b0902091847r38e46f41ge057a1fe11187851@mail.gmail.com> Hi Thomas -- Thank you for the link. I'm not familiar with the mathematical notation used to represent the trapezoid rule function, but it resembles Scheme enough to give me some clue on how to go forward. Here's my best effort at translation: For this problem, argument "a" signifies the x-axis coordinate for the "left interval" and argument "b" signifies the x-axis coordinate for "right interval." The length of each interval is equal to it's y-coordinate value, which can be derived by applying function f to it's x-coordinate. The length of each interval also equals the two base lengths of a trapezoid. The altitude of the trapezoid is equal to the difference between the x-coordinate values of a and b. So, if the area of a trapezoid = altitude * ((base1+ base2) / 2), then the formula for the area under the curve equals [(b - a) * ((f a) + (f b) / 2)]. To calculate the areas for two trapezoids, one needs only to divide the interval between a and b by 2, apply f to that value, and then use the result as base2 for the trapezoid with (f a) as base1, and base1 for the trapezoid with (f b) as base2. Does that sound about right? If so, I'll translate it to Scheme. Perhaps that would make my thoughts easier to evaluate. Thanks for the time! Thanks, Dave On Mon, Feb 9, 2009 at 5:33 PM, Thomas Chust wrote: > 2009/2/10 David Yrueta : > > [...] Still don't really understand how this relates to the question of > computing the > > "area of each trapezoid," though. [...] > > Hello, > > http://en.wikipedia.org/wiki/Trapezoidal_rule has some figures that > may make the idea behind this integration method more clear: The graph > of the function is approximated by a polyline -- in the special case > of Kepler's rule a very coarse one with only two edges; the > approximation of the integral is the area of the polygon bounded by > this polyline, the two integration interval boundaries and the > coordinate axis of the integration variable. > > cu, > Thomas > > > -- > When C++ is your hammer, every problem looks like your thumb. > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090209/6fe72f0a/attachment.htm From rcleis at mac.com Mon Feb 9 21:49:05 2009 From: rcleis at mac.com (Richard Cleis) Date: Thu Mar 26 02:40:27 2009 Subject: [plt-scheme] Multicast Message-ID: I need to connect to a machine that is serving information through a multicast port. Can DrScheme do it? rac From adityashukla1983 at gmail.com Mon Feb 9 22:34:38 2009 From: adityashukla1983 at gmail.com (aditya shukla) Date: Thu Mar 26 02:40:28 2009 Subject: [plt-scheme] Writing interfaces Message-ID: <73045cca0902091934o1b3381b4q5969fb4f9af90c83@mail.gmail.com> How should i approach to write interfaces for abstract data types in scheme eg . if the data type is stack of values and the operations are push , pop , top and empty-stack? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090209/3a5cf8c9/attachment.html From matthias at ccs.neu.edu Mon Feb 9 23:08:52 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:40:28 2009 Subject: [plt-scheme] Writing interfaces In-Reply-To: <73045cca0902091934o1b3381b4q5969fb4f9af90c83@mail.gmail.com> References: <73045cca0902091934o1b3381b4q5969fb4f9af90c83@mail.gmail.com> Message-ID: Here is the stack module and its interface: > #lang scheme > > (define empty-stack '()) > > (define (push-stack stack item) (cons item stack)) > > (define (pop-stack stack) (cdr stack)) > > (define (empty-stack? stack) (null? stack)) > > ;; --- interface --- > > (require scheme/contract) > > (define stack/c (listof any/c)) > > (provide/contract > ;; the empty stack > [empty-stack stack/c] > ;; add an item to the top of this stack > [push-stack (-> stack/c any/c stack/c)] > ;; remove an item from the top of this stack > [pop-stack (-> stack/c stack/c)] > ;; is this stack empty? > [empty-stack? (-> stack/c boolean?)]) Here is the client: > #lang scheme > > (require "stack.ss") > > (define s1 empty-stack) > (define s2 (push-stack s1 1)) > (define s3 (pop-stack s2)) > (empty-stack? s3) On Feb 9, 2009, at 10:34 PM, aditya shukla wrote: > How should i approach to write interfaces for abstract data types > in scheme eg . if the data type is stack of values and the > operations are push , pop , top and empty-stack? > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From rcleis at mac.com Mon Feb 9 23:12:17 2009 From: rcleis at mac.com (Richard Cleis) Date: Thu Mar 26 02:40:28 2009 Subject: [plt-scheme] Multicast In-Reply-To: References: Message-ID: <3485F3C7-A802-4EED-A68D-968B8AED5F4F@mac.com> Thanks! rac On Feb 9, 2009, at 9:09 PM, Dimitris Vyzovitis wrote: > On Mon, 9 Feb 2009, Richard Cleis wrote: > >> I need to connect to a machine that is serving information through >> a multicast port. Can DrScheme do it? > > You can try my socket library, there is multicast support. > http://planet.plt-scheme.org/display.ss?package=socket.plt&owner=vyzo > > -- vyzo From vyzo at media.mit.edu Mon Feb 9 23:09:00 2009 From: vyzo at media.mit.edu (Dimitris Vyzovitis) Date: Thu Mar 26 02:40:28 2009 Subject: [plt-scheme] Multicast In-Reply-To: References: Message-ID: On Mon, 9 Feb 2009, Richard Cleis wrote: > I need to connect to a machine that is serving information through a > multicast port. Can DrScheme do it? You can try my socket library, there is multicast support. http://planet.plt-scheme.org/display.ss?package=socket.plt&owner=vyzo -- vyzo From danprager at optusnet.com.au Tue Feb 10 02:22:50 2009 From: danprager at optusnet.com.au (Daniel Prager) Date: Thu Mar 26 02:40:29 2009 Subject: [plt-scheme] HtDP Exercise 23.4.1 In-Reply-To: <186df66b0902091734u7457a0e2n3d6410909f117231@mail.gmail.com> References: <200902100102.n1A12cr7017503@mail12.syd.optusnet.com.au> <186df66b0902091734u7457a0e2n3d6410909f117231@mail.gmail.com> Message-ID: Hi Dave It seems to me that part of the art of programming is learning enough about the domain that you are modeling to get by. Otherwise how can you tell if your program is correct? Unfortunately math(s) is a bugbear for many (most?) people at some level, and especially calculus. But I believe that one of the side- aims of htdp is to help people better understand some fundamental (I won't say "basic") mathematical concepts, brought to life and clarified in programs. I am not sure if that is the kind of answer that you want to hear, but good luck regardless! -- Dan "give math a chance" Prager On 10/02/2009, at 12:34 PM, David Yrueta wrote: > Hi Dan -- > > Thanks for the reply. Unfortunately for me, I'm not mathematically > literate enough to understand how to derive the bases and altitudes > of the trapezoids from the proposed function arguments. Or in other > words, I don't understand how the function arguments relate to one > another, and what the terms [a,(a+b)/2 and [(a+b)/2, b] mean once > the argument values are plugged in. Never made it past high school > trig, and the metaphysics of Being studied in my university > philosophy courses didn't have much to say about areas under a > curve :) > > I'm hoping that the principal author of the problem (MF) might come > to my rescue here. > > Thanks again for the time! > > Cheers, > Dave > > On Mon, Feb 9, 2009 at 5:02 PM, wrote: > Hi Dave > > Without having the time (or patience) to read the example, it's > almost certainly a divide-and-conquer approach. > > You use a trapezoid to approximate the area under the curve. > There's some error involved, but by using 2 (or 4 or ..) smaller > trapezoids the net error using the smaller trapezoids gets smaller > as they get more numerous, because the multiple line segments hug > the curve more closely. > > Drawing pictures with an example non-linear function should help a > lot here. > > -- Dan > > > > > David Yrueta wrote: > > > > Thanks Dan. Looks like the original formatting from HtDP didn't > carry > > over > > from my cut-and-paste. Still don't really understand how this > relates > > to > > the question of computing the "area of each trapezoid," though. > > > > Cheers, > > Dave > > > > On Mon, Feb 9, 2009 at 3:32 PM, wrote: > > > > > > > > > divide the interval into two parts: [a,(a + b/2)] and [(a + b/ > 2),b]; > > > > > > Try: [a,(a+b)/2 and [(a+b)/2, b] > > > > > > (a+b)/2 is the mid-point between a and b: (a + b/2) ain't. > > > > > > -- Dan > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090210/43238139/attachment.htm From robert.winslow at gmail.com Tue Feb 10 06:46:11 2009 From: robert.winslow at gmail.com (Robert Winslow) Date: Thu Mar 26 02:40:29 2009 Subject: [plt-scheme] Fast Byte Vector Traversal (200MB+ file) Message-ID: <80c068220902100346r21627086sd3d4f7b8674d475c@mail.gmail.com> I am loving PLT Scheme - its consistent and elegant specification is relief, after trudging through the behemoth that is Common Lisp. But, speed is a problem, especially memory traversal. I am writing software that loops many times over a file's contents in memory. The file will not change over the lifetime of the program. I have considered a few solutions to get C-like speed in this project, while using as much PLT Scheme as possible: 1) Write a simple TCP/IP server to do the iterating over the array of unsigned chars. MzScheme will send and receive requests from this daemon program. 2) Do something with C inside of MzScheme, possibly using c-lambda. How fast can this be? 3) Write a small C library, and use FFI. Will contracts slow it down? 4) Use u8vectors/cvectors/malloc/sequence generators in a way that I haven't anticipated to get speedy results using only Scheme code. I'd really rather just use a for/fold loop in Scheme to iterate over the array, collecting different types of information with each pass. In my tests, though, the speedup of using C over scheme is at least 10x, if not 100x. How might I best approach this problem? From noelwelsh at gmail.com Tue Feb 10 06:57:09 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:40:29 2009 Subject: [plt-scheme] Fast Byte Vector Traversal (200MB+ file) In-Reply-To: <80c068220902100346r21627086sd3d4f7b8674d475c@mail.gmail.com> References: <80c068220902100346r21627086sd3d4f7b8674d475c@mail.gmail.com> Message-ID: Some time ago I tested matrix multiplication using Scheme vectors, f64vectors, and C code. The C code was something like 100x faster. Using vectors was about 5x faster than f64vectors IIRC. Things have changed since then, but I expect the general result is the same. For more complex code the difference is less, as things like jumps, fetches, etc. take up more of the time. For this simple kind of code C is just so much closer to the machine model that Scheme can't compete. I have had good results with the following: > 3) Write a small C library, and use FFI. Will contracts slow it down? Contracts shouldn't slow things down too much, as long as your C library does enough work that the FFI / contract overhead is a small part of its runtime cost. I.e. don't call a C function that only does a few instructions worth of work. HTH, Noel From mflatt at cs.utah.edu Tue Feb 10 07:11:24 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:40:30 2009 Subject: [plt-scheme] Fast Byte Vector Traversal (200MB+ file) In-Reply-To: <80c068220902100346r21627086sd3d4f7b8674d475c@mail.gmail.com> References: <80c068220902100346r21627086sd3d4f7b8674d475c@mail.gmail.com> Message-ID: <20090210121126.755666500A3@mail-svr1.cs.utah.edu> At Tue, 10 Feb 2009 06:46:11 -0500, Robert Winslow wrote: > [...] I am writing software > that loops many times over a file's contents in memory. The file will > not change over the lifetime of the program. > > I have considered a few solutions to get C-like speed in this project, > while using as much PLT Scheme as possible: > 1) Write a simple TCP/IP server to do the iterating over the array of > unsigned chars. MzScheme will send and receive requests from this > daemon program. > 2) Do something with C inside of MzScheme, possibly using c-lambda. > How fast can this be? > 3) Write a small C library, and use FFI. Will contracts slow it down? > 4) Use u8vectors/cvectors/malloc/sequence generators in a way that I > haven't anticipated to get speedy results using only Scheme code. Option 2 will be fastest if the operation to be written in C is fairly small. If it's large enough that the overhead of the FFI call is small, then I recommend option 3. To get a sense of the costs, I tried the extreme example of a function that takes a byte string and index and extracts an integer from the byte string: #lang scheme/base (require scheme/foreign) (unsafe!) ;; Scheme: (define (f0 s i) (bytes-ref s i)) ;; option 2, a C-implemented extension, "f_ext.c" below: (define f2 (load-extension "f_ext.dylib")) ;; option 3, FFI, "f.c" below: (define l (ffi-lib "f.dylib")) (define f3 (get-ffi-obj 'f l (_fun _pointer _int -> _int))) (define (go f) (time (for ([i (in-range 1000000)]) (f #"apple" 2)))) (go f0) (go f2) (go f3) The output on my machine: cpu time: 50 real time: 49 gc time: 0 cpu time: 31 real time: 30 gc time: 0 cpu time: 426 real time: 427 gc time: 0 If I remove the type checks in "f_ext.c", the second one goes to cpu time: 24 real time: 24 gc time: 0 I bet that option 3 is going to bet the best for you. Despite its overhead relative to an extension, if you're putting enough work into the C function to get much better performance relative to Scheme, then the overhead of a foreign call is likely small. For pure speed, it's difficult to beat option 2, though. ---------------------------------------- f_ext.c: #include "escheme.h" static Scheme_Object *f(int argc, Scheme_Object **argv) { if (SCHEME_BYTE_STRINGP(argv[0]) && SCHEME_INTP(argv[1])) { int v= SCHEME_BYTE_STR_VAL(argv[0])[SCHEME_INT_VAL(argv[1])]; return scheme_make_integer(v); } else return scheme_false; } Scheme_Object *scheme_initialize(Scheme_Env *env) { return scheme_make_prim_w_arity(f, "f", 2, 2); } Scheme_Object *scheme_reload(Scheme_Env *env) { return scheme_initialize(env); /* Nothing special for reload */ } Scheme_Object *scheme_module_name() { return scheme_false; } ---------------------------------------- f.c: int f(char *s, int v) { return s[v]; } From pivanyi at freemail.hu Tue Feb 10 08:10:06 2009 From: pivanyi at freemail.hu (Ivanyi Peter) Date: Thu Mar 26 02:40:30 2009 Subject: [plt-scheme] delaunay/voronoi In-Reply-To: <49903550.2010206@mndl.hu> Message-ID: gabor papp ?rta: > hello, > > has anyone implemented delaunay triangulations/voronoi diagrams or > worked on bindings for existing computational geometry libraries like > qhull or cgal? any help would be appreciated. > /> I have only an AutoLISP version of the Delaunay triangulation. Not mine, I have downloaded it from the Web. I suspect :-) You are Hungarian, so you can check out this page http://e-oktat.pmmf.hu/graftervrendszprog For more serious Delaunay triangulation in 2D see this link: http://www.cs.cmu.edu/~quake/triangle.html The program is in C. I think it would be very easy to interface with it through FFI. Best regards Peter Ivanyi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090210/47e1454d/attachment.html From adityashukla1983 at gmail.com Tue Feb 10 09:10:17 2009 From: adityashukla1983 at gmail.com (aditya shukla) Date: Thu Mar 26 02:40:31 2009 Subject: [plt-scheme] Implementing constructors for environment interface Message-ID: <73045cca0902100610o399fdd4dm649b5bf3b90c0efe@mail.gmail.com> I have an interface , how can i implement a constructor extend-env* using a list representation such that (extend-env* (var1 ... vark) (val1 ... valk)  f ) = g, where g(var) =vali if var = vari for some i such that 1 ? i ? k f (var) otherwise -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090210/1bab31a2/attachment.htm From matthias at ccs.neu.edu Tue Feb 10 09:26:34 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:40:31 2009 Subject: [plt-scheme] Implementing constructors for environment interface In-Reply-To: <73045cca0902100610o399fdd4dm649b5bf3b90c0efe@mail.gmail.com> References: <73045cca0902100610o399fdd4dm649b5bf3b90c0efe@mail.gmail.com> Message-ID: > #lang scheme > > (require htdp/testing) > > (define (extend-env* vars vals f) > (lambda (var) > (if (member var vars) > (foldl (lambda (var* val* r) (if (eq? var* var) val* r)) =20 > (gensym) vars vals) > (f var)))) > > (define new-stack (extend-env* '(var1 vark) '(val1 valk) (lambda =20 > (x) 10))) > > (check-expect (new-stack 'var1) 'val1) > (check-expect (new-stack 'vark) 'valk) > (check-expect (new-stack 'x) 10) > > (test) On Feb 10, 2009, at 9:10 AM, aditya shukla wrote: > I have an interface , how can i implement a constructor extend-env* =20= > using a list representation such that > > (extend-env* (var1 ... vark) (val1 ... valk) =02 f =03) =3D =02g=03, > > where g(var) =3Dvali if var =3D vari for some i such that 1 =B2 i =B2 = k > f (var) otherwise > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From matthias at ccs.neu.edu Tue Feb 10 09:40:49 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:40:31 2009 Subject: [plt-scheme] HtDP Exercise 23.4.1 In-Reply-To: <186df66b0902091847r38e46f41ge057a1fe11187851@mail.gmail.com> References: <200902092332.n19NWiF2030668@mail07.syd.optusnet.com.au> <186df66b0902091553r4eb4e4a8qacef9335f90399e3@mail.gmail.com> <1c1a33bc0902091733t32910a27rabd8fbc9ee1b3b83@mail.gmail.com> <186df66b0902091847r38e46f41ge057a1fe11187851@mail.gmail.com> Message-ID: <0D884D21-AC33-427B-B9D6-E0D31D5C4890@ccs.neu.edu> David, it is entirely safe to navigate around the mathematics sections in the book. As someone pointed out, they exist because it's so easy to use Scheme to bring across rather complex mathematical concepts. Indeed, you won't believe it but by reaching part VI, you have mastered a significant chunk of mathematics that you would have never considered within reach had I told you at the outset of your studies that you'd understand rudimentary concepts from "higher" algebra (advanced college material). If you want to figure out some basics, try this. Can you draw the curve for (define (f x) x), (define (g x) 10), and (define (h x) (- 10 x)) between 0 and 10? Can you determine the area that is enclosed by f, g, and h, the X and Y axis between 0 and 10? If so, how did you compute those? These are special cases for the exercise that you are tackling. If your solution comes close to your answers, you know it works for special cases. That's good. For somewhat more advanced uses, you would consider more sophisticated cases, such as sin, cos, expt, etc. In all those cases, mathematics tells you how to come up with a close- enough answer through a few calculations. And that's the whole point of testing. You hope that it works for the rest of it. Give it a try. -- Matthias On Feb 9, 2009, at 9:47 PM, David Yrueta wrote: > Hi Thomas -- > > Thank you for the link. I'm not familiar with the mathematical > notation used to represent the trapezoid rule function, but it > resembles Scheme enough to give me some clue on how to go forward. > > Here's my best effort at translation: > > For this problem, argument "a" signifies the x-axis coordinate for > the "left interval" and argument "b" signifies the x-axis > coordinate for "right interval." > > The length of each interval is equal to it's y-coordinate value, > which can be derived by applying function f to it's x-coordinate. > The length of each interval also equals the two base lengths of a > trapezoid. The altitude of the trapezoid is equal to the > difference between the x-coordinate values of a and b. So, if the > area of a trapezoid = altitude * ((base1+ base2) / 2), then the > formula for the area under the curve equals [(b - a) * ((f a) + (f > b) / 2)]. > > To calculate the areas for two trapezoids, one needs only to divide > the interval between a and b by 2, apply f to that value, and then > use the result as base2 for the trapezoid with (f a) as base1, and > base1 for the trapezoid with (f b) as base2. > > Does that sound about right? If so, I'll translate it to Scheme. > Perhaps that would make my thoughts easier to evaluate. > > Thanks for the time! > > Thanks, > Dave > > On Mon, Feb 9, 2009 at 5:33 PM, Thomas Chust wrote: > 2009/2/10 David Yrueta : > > [...] Still don't really understand how this relates to the > question of computing the > > "area of each trapezoid," though. [...] > > Hello, > > http://en.wikipedia.org/wiki/Trapezoidal_rule has some figures that > may make the idea behind this integration method more clear: The graph > of the function is approximated by a polyline -- in the special case > of Kepler's rule a very coarse one with only two edges; the > approximation of the integral is the area of the polygon bounded by > this polyline, the two integration interval boundaries and the > coordinate axis of the integration variable. > > cu, > Thomas > > > -- > When C++ is your hammer, every problem looks like your thumb. > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From dyrueta at gmail.com Tue Feb 10 09:53:52 2009 From: dyrueta at gmail.com (David Yrueta) Date: Thu Mar 26 02:40:32 2009 Subject: [plt-scheme] HtDP Exercise 23.4.1 In-Reply-To: <0D884D21-AC33-427B-B9D6-E0D31D5C4890@ccs.neu.edu> References: <200902092332.n19NWiF2030668@mail07.syd.optusnet.com.au> <186df66b0902091553r4eb4e4a8qacef9335f90399e3@mail.gmail.com> <1c1a33bc0902091733t32910a27rabd8fbc9ee1b3b83@mail.gmail.com> <186df66b0902091847r38e46f41ge057a1fe11187851@mail.gmail.com> <0D884D21-AC33-427B-B9D6-E0D31D5C4890@ccs.neu.edu> Message-ID: <186df66b0902100653s2c8cc9d8w5a2347f6374f4f9c@mail.gmail.com> Hi Matthias -- David, it is entirely safe to navigate around the mathematics sections in the book Yes, but I can't resist the challenge of tackling and hopefully solving an explicitly "mathematical" problem which I always considered beyond my reach :) (which is why I'm up at 5:30 am taking a whack at this thing!). I looked at the link sent to me by Thomas Chust and came up with this version of integrate-kepler (before reading your comments below, which I will): (define (integrate-kepler f left right) (local ((define (area-of-trap a b1 b2) (* a ( / ( + (f b1) (f b2)) 2))) (define midpoint ( / (+ right left) 2)) (define alt-left (- midpoint left)) (define alt-right (- right midpoint))) (+ (area-of-trap alt-left left midpoint) (area-of-trap alt-right midpoint right)))) Am I in the ballpark? Thanks! Dave On Tue, Feb 10, 2009 at 6:40 AM, Matthias Felleisen wrote: > > > David, it is entirely safe to navigate around the mathematics sections in > the book. As someone pointed out, they exist because it's so easy to use > Scheme to bring across rather complex mathematical concepts. Indeed, you > won't believe it but by reaching part VI, you have mastered a significant > chunk of mathematics that you would have never considered within reach had I > told you at the outset of your studies that you'd understand rudimentary > concepts from "higher" algebra (advanced college material). > > If you want to figure out some basics, try this. > > Can you draw the curve for (define (f x) x), (define (g x) 10), and > (define (h x) (- 10 x)) between 0 and 10? > > Can you determine the area that is enclosed by f, g, and h, the X and Y > axis between 0 and 10? > > If so, how did you compute those? > > These are special cases for the exercise that you are tackling. If your > solution comes close to your answers, you know it works for special cases. > That's good. For somewhat more advanced uses, you would consider more > sophisticated cases, such as sin, cos, expt, etc. In all those cases, > mathematics tells you how to come up with a close-enough answer through a > few calculations. > > And that's the whole point of testing. You hope that it works for the rest > of it. > > Give it a try. -- Matthias > > > > > > > > > On Feb 9, 2009, at 9:47 PM, David Yrueta wrote: > > Hi Thomas -- >> >> Thank you for the link. I'm not familiar with the mathematical notation >> used to represent the trapezoid rule function, but it resembles Scheme >> enough to give me some clue on how to go forward. >> >> Here's my best effort at translation: >> >> For this problem, argument "a" signifies the x-axis coordinate for the >> "left interval" and argument "b" signifies the x-axis coordinate for "right >> interval." >> >> The length of each interval is equal to it's y-coordinate value, which can >> be derived by applying function f to it's x-coordinate. The length of each >> interval also equals the two base lengths of a trapezoid. The altitude of >> the trapezoid is equal to the difference between the x-coordinate values of >> a and b. So, if the area of a trapezoid = altitude * ((base1+ base2) / 2), >> then the formula for the area under the curve equals [(b - a) * ((f a) + (f >> b) / 2)]. >> >> To calculate the areas for two trapezoids, one needs only to divide the >> interval between a and b by 2, apply f to that value, and then use the >> result as base2 for the trapezoid with (f a) as base1, and base1 for the >> trapezoid with (f b) as base2. >> >> Does that sound about right? If so, I'll translate it to Scheme. Perhaps >> that would make my thoughts easier to evaluate. >> >> Thanks for the time! >> >> Thanks, >> Dave >> >> On Mon, Feb 9, 2009 at 5:33 PM, Thomas Chust wrote: >> 2009/2/10 David Yrueta : >> > [...] Still don't really understand how this relates to the question of >> computing the >> > "area of each trapezoid," though. [...] >> >> Hello, >> >> http://en.wikipedia.org/wiki/Trapezoidal_rule has some figures that >> may make the idea behind this integration method more clear: The graph >> of the function is approximated by a polyline -- in the special case >> of Kepler's rule a very coarse one with only two edges; the >> approximation of the integral is the area of the polygon bounded by >> this polyline, the two integration interval boundaries and the >> coordinate axis of the integration variable. >> >> cu, >> Thomas >> >> >> -- >> When C++ is your hammer, every problem looks like your thumb. >> >> _________________________________________________ >> 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/20090210/d9fd6447/attachment.html From matthias at ccs.neu.edu Tue Feb 10 10:04:05 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:40:32 2009 Subject: [plt-scheme] HtDP Exercise 23.4.1 In-Reply-To: <186df66b0902100653s2c8cc9d8w5a2347f6374f4f9c@mail.gmail.com> References: <200902092332.n19NWiF2030668@mail07.syd.optusnet.com.au> <186df66b0902091553r4eb4e4a8qacef9335f90399e3@mail.gmail.com> <1c1a33bc0902091733t32910a27rabd8fbc9ee1b3b83@mail.gmail.com> <186df66b0902091847r38e46f41ge057a1fe11187851@mail.gmail.com> <0D884D21-AC33-427B-B9D6-E0D31D5C4890@ccs.neu.edu> <186df66b0902100653s2c8cc9d8w5a2347f6374f4f9c@mail.gmail.com> Message-ID: <694A4BE7-34C2-4DD6-9729-E4DCB2496014@ccs.neu.edu> On Feb 10, 2009, at 9:53 AM, David Yrueta wrote: > Hi Matthias -- > > David, it is entirely safe to navigate around the mathematics > sections in the book > > Yes, but I can't resist the challenge of tackling and hopefully > solving an explicitly "mathematical" problem which I always > considered beyond my reach :) (which is why I'm up at 5:30 am > taking a whack at this thing!). > > I looked at the link sent to me by Thomas Chust and came up with > this version of integrate-kepler (before reading your comments > below, which I will): > > (define (integrate-kepler f left right) > (local ((define (area-of-trap a b1 b2) > (* a ( / ( + (f b1) (f b2)) 2))) > (define midpoint ( / (+ right left) 2)) > (define alt-left (- midpoint left)) > (define alt-right (- right midpoint))) > (+ (area-of-trap alt-left left midpoint) > (area-of-trap alt-right midpoint right)))) > > Am I in the ballpark? Where are your examples? Tests? :-) From morazanm at gmail.com Tue Feb 10 10:24:46 2009 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:40:32 2009 Subject: [plt-scheme] Implementing constructors for environment interface In-Reply-To: <73045cca0902100610o399fdd4dm649b5bf3b90c0efe@mail.gmail.com> References: <73045cca0902100610o399fdd4dm649b5bf3b90c0efe@mail.gmail.com> Message-ID: <9b1fff280902100724j2d2cbb76ha742020fed655e6e@mail.gmail.com> It seems to me that you are asking for solutions to problems in EOPL. I would suggest posting questions on a solution *you* propose. Matthias, to my shock :-), has provided you with some actual code. I may be wrong, but I suspect that the code he has provided is not really comprehensible to you. It is all pinned on the notion that data are functions and functions are data. You may want to ask questions about his code. Understanding the sections of EOPL you are working through is important. -- Cheers, Marco From fkoksal at cs.bilgi.edu.tr Tue Feb 10 12:42:35 2009 From: fkoksal at cs.bilgi.edu.tr (=?UTF-8?B?Ik0uIEZhdGloIEvDtmtzYWwi?=) Date: Thu Mar 26 02:40:33 2009 Subject: [plt-scheme] Deserialization error Message-ID: <4991BC8B.1040806@cs.bilgi.edu.tr> Hi again, After the discussion on "Log every change in Definitions and Interactions"[1] mails, we started to implement the screen-replay tool. We are facing some problems while deserializing our structure; We have this serializable structure exported by record.ss (module record mzscheme (require scheme/serialize) (provide record make-record record-timestamp record-operation record-start record-len record-content) (define-serializable-struct record (timestamp operation start len content))) Then we serialize the keystrokes and write it to a file ... (define (serialize-record rec) (with-output-to-file "/tmp/fatih.record" (lambda () (begin (display (serialize rec)) (display "\n"))) 'binary 'append)) ... Here are some example lines from the file fatih.record; ((1) 1 (((lib screen-replay/record.ss) . deserialize-info:record-v0)) 0 () () (0 1234286023 insert 0 1 (u . a))) ((1) 1 (((lib screen-replay/record.ss) . deserialize-info:record-v0)) 0 () () (0 1234286023 insert 1 1 (u . s))) ((1) 1 (((lib screen-replay/record.ss) . deserialize-info:record-v0)) 0 () () (0 1234286024 insert 2 1 (u . d))) We are able to read the lines from the file, but deserializing gives this error; > (deserialize (with-input-from-file "/tmp/fatih.record" read 'binary)) standard-module-name-resolver: expected argument of type ; given "/home/fkoksal/.plt-scheme/4.0.1/collects/screen-replay/record.ss" Any comments? [1] http://list.cs.brown.edu/pipermail/plt-scheme/2009-January/029941.html M. Fatih K?ksal ?stanbul Bilgi University Computer Science Department -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 260 bytes Desc: OpenPGP digital signature Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090210/09de311c/signature.pgp From ryanc at ccs.neu.edu Tue Feb 10 16:36:48 2009 From: ryanc at ccs.neu.edu (Ryan Culpepper) Date: Thu Mar 26 02:40:33 2009 Subject: [plt-scheme] Deserialization error In-Reply-To: <4991BC8B.1040806@cs.bilgi.edu.tr> References: <4991BC8B.1040806@cs.bilgi.edu.tr> Message-ID: <1CA417EE-ADFF-4A56-B7D4-DD341615126D@ccs.neu.edu> On Feb 10, 2009, at 12:42 PM, M. Fatih K?ksal wrote: > Hi again, > > After the discussion on "Log every change in Definitions and > Interactions"[1] mails, we started to implement the screen-replay > tool. > We are facing some problems while deserializing our structure; > > We have this serializable structure exported by record.ss > > (module record mzscheme > (require scheme/serialize) > (provide record make-record record-timestamp record-operation > record-start record-len record-content) > (define-serializable-struct record (timestamp operation start len > content))) > > Then we serialize the keystrokes and write it to a file > > ... > > (define (serialize-record rec) > (with-output-to-file > "/tmp/fatih.record" > (lambda () > (begin (display (serialize rec)) > (display "\n"))) > 'binary > 'append)) > ... > > Here are some example lines from the file fatih.record; > > ((1) 1 (((lib screen-replay/record.ss) . deserialize-info:record- > v0)) 0 > () () (0 1234286023 insert 0 1 (u . a))) > ((1) 1 (((lib screen-replay/record.ss) . deserialize-info:record- > v0)) 0 > () () (0 1234286023 insert 1 1 (u . s))) > ((1) 1 (((lib screen-replay/record.ss) . deserialize-info:record- > v0)) 0 > () () (0 1234286024 insert 2 1 (u . d))) > > We are able to read the lines from the file, but deserializing gives > this error; > >> (deserialize (with-input-from-file "/tmp/fatih.record" read 'binary)) > > standard-module-name-resolver: expected argument of type path or > path>; given > "/home/fkoksal/.plt-scheme/4.0.1/collects/screen-replay/record.ss" > > > Any comments? This looks to me like a bug in the serialize library. Prefab structs might solve your problem more simply, since they're automatically readable and writable, so they avoid the complicated serialization mechanism. Search the help desk for "prefab". Here's roughly what the code would look like: (module record mzscheme ;; replace mzscheme's define-struct with scheme/base's (require (only scheme/base define-struct)) (define-struct record (timestamp operation start len content) #:prefab) ___) Ryan From clements at brinckerhoff.org Tue Feb 10 22:30:27 2009 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:40:34 2009 Subject: [plt-scheme] incredibly useful PLT planet source search broken? Message-ID: I went looking for a planet package that would take inexact numbers and return their IEEE hexadecimal representation (yes, it's probably a three-liner in MZ internals). A search on the planet main page didn't help, but I figured that your full-source-search engine would be just the ticket. Unfortunately 1) it's down, and 2) it's incredibly hard to find. Can you rectify the first of these? Is there an alternate way of doing this that I'm just not aware of? 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/20090210/d595ee0c/smime.bin From mflatt at cs.utah.edu Wed Feb 11 07:48:54 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:40:34 2009 Subject: [plt-scheme] Deserialization error In-Reply-To: <1CA417EE-ADFF-4A56-B7D4-DD341615126D@ccs.neu.edu> References: <4991BC8B.1040806@cs.bilgi.edu.tr> <1CA417EE-ADFF-4A56-B7D4-DD341615126D@ccs.neu.edu> Message-ID: <20090211124855.870886500AE@mail-svr1.cs.utah.edu> At Tue, 10 Feb 2009 16:36:48 -0500, Ryan Culpepper wrote: > On Feb 10, 2009, at 12:42 PM, M. Fatih K?ksal wrote: > > We have this serializable structure exported by record.ss > > > > (module record mzscheme > > (require scheme/serialize) > > (provide record make-record record-timestamp record-operation > > record-start record-len record-content) > > (define-serializable-struct record (timestamp operation start len > > content))) > > > > Then we serialize the keystrokes and write it to a file > > > > ... > > > > (define (serialize-record rec) > > (with-output-to-file > > "/tmp/fatih.record" > > (lambda () > > (begin (display (serialize rec)) > > (display "\n"))) > > 'binary > > 'append)) > > ... > > > > Here are some example lines from the file fatih.record; > > > > ((1) 1 (((lib screen-replay/record.ss) . deserialize-info:record- > > v0)) 0 > > () () (0 1234286023 insert 0 1 (u . a))) > > ((1) 1 (((lib screen-replay/record.ss) . deserialize-info:record- > > v0)) 0 > > () () (0 1234286023 insert 1 1 (u . s))) > > ((1) 1 (((lib screen-replay/record.ss) . deserialize-info:record- > > v0)) 0 > > () () (0 1234286024 insert 2 1 (u . d))) > > > > We are able to read the lines from the file, but deserializing gives > > this error; > > > >> (deserialize (with-input-from-file "/tmp/fatih.record" read 'binary)) > > > > standard-module-name-resolver: expected argument of type > path or > > path>; given > > "/home/fkoksal/.plt-scheme/4.0.1/collects/screen-replay/record.ss" > > > > > > Any comments? > > This looks to me like a bug in the serialize library. I agree, but I haven't been able to recreate the problem... Can you provide step-by-step instructions for arraiving at the error? I expect that you're organizing the code among module in a different way that I was trying, or you're using a different REPL or using it in a different way than I was trying. Thanks, Matthew From jensaxel at soegaard.net Wed Feb 11 08:13:52 2009 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:40:34 2009 Subject: [plt-scheme] incredibly useful PLT planet source search broken? In-Reply-To: References: Message-ID: <4992CF10.1080504@soegaard.net> Hi, > I went looking for a planet package that would take inexact numbers and > return their IEEE hexadecimal representation (yes, it's probably a > three-liner in MZ internals). A search on the planet main page didn't > help, but I figured that your full-source-search engine would be just > the ticket. Unfortunately > > 1) it's down, and > 2) it's incredibly hard to find. > > Can you rectify the first of these? Sorry, not easily. At the moment I am swamped at work, so I haven't got time nor energy to revive it. But maybe someone on this list would be interested in reviving it? The source search consisted of several parts: 1. A full text indexer - which for each keyword in each file stores its position in a large (compressed) index 2. Search routines - which queries the index, and is thusly very fast 3. A web interface for the search 4. A way to browse the source of PLaneT packages The source code browsing functions became (after rewrites) part of the current PLaneT site, so 4. is taken care of. Parts 1. and 2. i.e. the indexer and query functions are more or less uptodate, that is: if they don't already work on the current release, they could easily be updated. Some code from part 3 could be reused, but probably needs a rewrite due the new context. If anyone is interested, I'd be happy to send the code along. If you are interested in reading about the inner workings of a search engine, then follow the list of blog postings at the bottom of: http://www.scheme.dk/blog/archive/2006_09_01_archive.html > Is there an alternate way of doing > this that I'm just not aware of? Download all PLaneT packages (scripted), and then grep? -- Jens Axel S?gaard From jensaxel at soegaard.net Wed Feb 11 08:22:04 2009 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:40:35 2009 Subject: [plt-scheme] incredibly useful PLT planet source search broken? In-Reply-To: <4992CF10.1080504@soegaard.net> References: <4992CF10.1080504@soegaard.net> Message-ID: <4992D0FC.40401@soegaard.net> >> I went looking for a planet package that would take inexact numbers >> and return their IEEE hexadecimal representation (yes, it's probably a >> three-liner in MZ internals). A search on the planet main page didn't >> help, but I figured that your full-source-search engine would be just >> the ticket. Unfortunately >> >> 1) it's down, and >> 2) it's incredibly hard to find. >> >> Can you rectify the first of these? > > Sorry, not easily. I forgot the servlet still runs (on very old data): http://www.scheme.dk/search-plt/search.ss The generated links is to a now retired server (I didn't have space enough on the web-server for all the PLaneT source code), but you can get an idea of how it works. -- Jens Axel S?gaard From fkoksal at cs.bilgi.edu.tr Wed Feb 11 08:48:21 2009 From: fkoksal at cs.bilgi.edu.tr (=?UTF-8?B?Ik0uIEZhdGloIEvDtmtzYWwi?=) Date: Thu Mar 26 02:40:35 2009 Subject: [plt-scheme] Deserialization error In-Reply-To: <20090211124855.870886500AE@mail-svr1.cs.utah.edu> References: <4991BC8B.1040806@cs.bilgi.edu.tr> <1CA417EE-ADFF-4A56-B7D4-DD341615126D@ccs.neu.edu> <20090211124855.870886500AE@mail-svr1.cs.utah.edu> Message-ID: <4992D725.7010604@cs.bilgi.edu.tr> Matthew Flatt wrote: > I agree, but I haven't been able to recreate the problem... > > Can you provide step-by-step instructions for arraiving at the error? Here it is. http://cs.bilgi.edu.tr/~fkoksal/scheme-serialize.tar After setting up screen-replay, open DrScheme and type something. This will record the keystrokes and write it to a file. Then try to deserialize it by running deserialize-example.scm . You will get the error. By the way, it works fine with prefab. fkoksal > > I expect that you're organizing the code among module in a different > way that I was trying, or you're using a different REPL or using it in > a different way than I was trying. > > Thanks, > Matthew > -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 260 bytes Desc: OpenPGP digital signature Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090211/4d37443b/signature.pgp From neil at neilvandyke.org Wed Feb 11 09:09:05 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:40:35 2009 Subject: [plt-scheme] overhead of lots of dynamic closure creation in high-performance environment? Message-ID: <4992DC01.7050500@neilvandyke.org> Is there any rule-of-thumb I could use when reasoning about the performance implications of using lots of dynamic creation of closures and one-shot application of them? I need high-performance processing of a protocol that is chunked at arbitrary points across packets in a lower protocol layer. I want to integrate the parsing of the higher-level protocol into that of the lower-level protocol, rather than assembling the lower-level chunks and doing a second pass for the higher-level. Doing this efficiently in a C-like style requires some headache-inducing record-keeping and code. Doing this by dynamically creating a closure (for immediate application, or to be stuck in a hash table keyed on the stream ID), which in turn dynamically creates another closure, and so on until the protocol is consumed, looks like it will be pretty elegant. And efficient, if closure creation is inexpensive. For example: (letrec (;; ... (make-complete-name-paramsproc (lambda (params name val-size) (lambda (content content-i) ;; !!! do some processing and return a closure created by ;; make-partial-val-paramsproc ))) (make-partial-val-paramsproc (lambda (params name buf used) (lambda (content content-i) ;; !!! ))) ;;... So, for each Web page served, this part of the processing would typically involve, say, 30 closures created dynamically, applied once, and immediately left for GC. The entire purpose of this mechanism that would use dynamic closures is to greatly *speed up* Web serving, so I'm looking for a better intuition for how efficient dynamic closures are this is before I code it all. Thanks, Neil -- http://www.neilvandyke.org/ From chust at web.de Wed Feb 11 09:15:36 2009 From: chust at web.de (Thomas Chust) Date: Thu Mar 26 02:40:36 2009 Subject: [plt-scheme] HtDP Exercise 23.4.1 In-Reply-To: <186df66b0902100653s2c8cc9d8w5a2347f6374f4f9c@mail.gmail.com> References: <200902092332.n19NWiF2030668@mail07.syd.optusnet.com.au> <186df66b0902091553r4eb4e4a8qacef9335f90399e3@mail.gmail.com> <1c1a33bc0902091733t32910a27rabd8fbc9ee1b3b83@mail.gmail.com> <186df66b0902091847r38e46f41ge057a1fe11187851@mail.gmail.com> <0D884D21-AC33-427B-B9D6-E0D31D5C4890@ccs.neu.edu> <186df66b0902100653s2c8cc9d8w5a2347f6374f4f9c@mail.gmail.com> Message-ID: <1c1a33bc0902110615w54720ad8hf7906189eabb1301@mail.gmail.com> 2009-02-10 David Yrueta : > [...] > (define (integrate-kepler f left right) > (local ((define (area-of-trap a b1 b2) > (* a ( / ( + (f b1) (f b2)) 2))) > (define midpoint ( / (+ right left) 2)) > (define alt-left (- midpoint left)) > (define alt-right (- right midpoint))) > (+ (area-of-trap alt-left left midpoint) > (area-of-trap alt-right midpoint right)))) > Am I in the ballpark? > [...] Hello David, this implementation of the integration function looks good. As Matthias said, thinking about some tests could help you convince yourself that it is correct ;-) For example, the procedure should yield exact results for any linear function (ie. any function of the form (lambda (x) (+ a (* b x))) with arbitrary real a and b)... cu, Thomas -- When C++ is your hammer, every problem looks like your thumb. From mflatt at cs.utah.edu Wed Feb 11 09:18:03 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:40:36 2009 Subject: [plt-scheme] overhead of lots of dynamic closure creation in high-performance environment? In-Reply-To: <4992DC01.7050500@neilvandyke.org> References: <4992DC01.7050500@neilvandyke.org> Message-ID: <20090211141804.7693E6500A8@mail-svr1.cs.utah.edu> At Wed, 11 Feb 2009 09:09:05 -0500, Neil Van Dyke wrote: > Is there any rule-of-thumb I could use when reasoning about the > performance implications of using lots of dynamic creation of closures > and one-shot application of them? As allocations go, closure creation is fast. It's inlined by the JIT, for example. The cost of a closure allocation is proportional to the number of locally bound variables that are captured by the closure. (References to top-level or module-level bindings are chunked into a single slot within the closure.) > So, for each Web page served, this part of the processing would > typically involve, say, 30 closures created dynamically, applied once, > and immediately left for GC. I expect that serving a web page involves so much allocation that 30 closure creations is negligible. Matthew From neil at neilvandyke.org Wed Feb 11 09:31:56 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:40:36 2009 Subject: [plt-scheme] overhead of lots of dynamic closure creation in high-performance environment? In-Reply-To: <20090211141804.7693E6500A8@mail-svr1.cs.utah.edu> References: <4992DC01.7050500@neilvandyke.org> <20090211141804.7693E6500A8@mail-svr1.cs.utah.edu> Message-ID: <4992E15C.3010803@neilvandyke.org> Matthew Flatt wrote at 02/11/2009 09:18 AM: > As allocations go, closure creation is fast. It's inlined by the JIT, > for example. > Excellent! Thanks, Matthew! -- http://www.neilvandyke.org/ From ambjornelder at gmail.com Wed Feb 11 11:09:51 2009 From: ambjornelder at gmail.com (=?ISO-8859-1?Q?Ambj=F6rn_Elder?=) Date: Thu Mar 26 02:40:36 2009 Subject: [plt-scheme] Installing the Simply Scheme package? Message-ID: <4992F84F.2050603@gmail.com> Hello, I'm a beginner with Scheme trying to install the Simply Scheme package written by Danny Yoo to use with the Simply Scheme book. I'm running into some problems and I'm hoping someone here can help me out. (require (planet "simply-scheme.ss" ("dyoo" "simply-scheme.plt"))) Running the previous bit of code from the PLaneT docs page on simply-scheme.ss results in the following errors on restart of DrScheme: Error invoking tool #;("tool.ss") Users/me/Library/PLT Scheme/planet/300/4.1.4/cache/dyoo/simply-scheme.plt/1/2/tool.ss:15:51: syntax: no pattern variables before ellipses in template at: ... in: (begin (require (lib "unitsig.ss")) (define-syntax (define-unit-tool stx) (syntax-case stx () ((_ name tool-export import-body rest-body ...) (syntax/loc stx (define name (unit/sig tool-export import-body rest-body ...))))))) === context === /Applications/PLT Scheme v4.1.4/collects/scheme/private/sc.ss:510:11: expander /Applications/PLT Scheme v4.1.4/collects/scheme/private/sc.ss:510:11: expander /Applications/PLT Scheme v4.1.4/collects/scheme/private/sc.ss:510:11: expander /Applications/PLT Scheme v4.1.4/collects/scheme/private/sc.ss:510:11: expander /Applications/PLT Scheme v4.1.4/collects/scheme/private/sc.ss:510:11: expander /Applications/PLT Scheme v4.1.4/collects/scheme/private/sc.ss:510:11: expander /Applications/PLT Scheme v4.1.4/collects/scheme/private/sc.ss:510:11: expander /Applications/PLT Scheme v4.1.4/collects/scheme/private/sc.ss:510:11: expander /Applications/PLT Scheme v4.1.4/collects/scheme/private/sc.ss:510:11: expander /Applications/PLT Scheme v4.1.4/collects/scheme/private/sc.ss:510:11: expander /Applications/PLT Scheme v4.1.4/collects/scheme/private/sc.ss:510:11: expander /Applications/PLT Scheme v4.1.4/collects/scheme/private/sc.ss:510:11: expander /Applications/PLT Scheme v4.1.4/collects/scheme/private/sc.ss:510:11: expander /Applications/PLT Scheme v4.1.4/collects/scheme/private/sc.ss:510:11: expander /Applications/PLT Scheme v4.1.4/collects/scheme/private/sc.ss:510:11: expander /Applications/PLT Scheme v4.1.4/collects/scheme/private/sc.ss:510:11: expander ... I'm using DrScheme v4.1.4 on MacOSX 10.4.11. Is there a problem with the package, or can I install the Language definition a different way? I'd appreciate help anyone can give me. Ambj?rn Elder From mikeegg1 at me.com Wed Feb 11 11:40:41 2009 From: mikeegg1 at me.com (Mike Eggleston) Date: Thu Mar 26 02:40:36 2009 Subject: [plt-scheme] Interesting idea for web developers Message-ID: <20090211164041.GD17870@mail.me.com> Searching for scheme stuff this morning: Mike From grettke at acm.org Wed Feb 11 11:51:09 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:40:36 2009 Subject: [plt-scheme] Interesting idea for web developers In-Reply-To: <20090211164041.GD17870@mail.me.com> References: <20090211164041.GD17870@mail.me.com> Message-ID: <756daca50902110851i5d61d316h60943d7e576c3c90@mail.gmail.com> On Wed, Feb 11, 2009 at 10:40 AM, Mike Eggleston wrote: > Searching for scheme stuff this morning: > > Just yesterday I was searching for Scheme and JavaScript. There are a lot of projects out there! From fare at tunes.org Wed Feb 11 12:24:29 2009 From: fare at tunes.org (Francois-Rene Rideau) Date: Thu Mar 26 02:40:36 2009 Subject: [plt-scheme] 2009-02-23 Boston Lisp Meeting: Dimitris Vyzovitis on gerbils Message-ID: <20090211172429.30B3A3F72@bespin.org> Next Boston Lisp Meeting Monday February 23th 2009 at 1800 at MIT 34-401B Dimitris Vyzovitis Programming gerbils: Distributed programming with PLT-Scheme http://fare.livejournal.com/139926.html Dimitris Vyzovitis will give a talk about Programming gerbils: Distributed programming with PLT-Scheme. vyzo will talk about gerbil, a little language for distributed programming using PLT-Scheme. Gerbil is a macro language that provides facilities for actor-based distributed programs and transparent network simulation. vyzo is a PhD student at the MIT Media Lab who suffers from a severe scheme addiction. His website is at http://web.media.mit.edu/~vyzo/ * The Lisp Meeting will take place on Monday February 23th 2009 at 1800 (6pm) at MIT, Room 34-401B. As the numbers indicate, this is in Building 34, on the 4th floor. This is the usual location, on 50 Vassar Street, Cambridge. MIT map: http://whereis.mit.edu/bin/map?selection=34 Google map: http://maps.google.com/maps?q=50+Vassar+St,+Cambridge,+MA+02139,+USA Many thanks go to Alexey Radul for arranging for the room, and to MIT for welcoming us. * * Dinner: ITA Software, a fine employer of Lisp hackers (disclaimer: I work there), is kindly purchasing a buffet to accompany our monthly Boston Lisp meeting. Anyone who attends is welcome to partake. We appreciate it if you let us know you're coming, and what food taboos you have, so that we can order the correct amount of food. Tell us by sending email to boston-lisp-meeting-register at common-lisp.net. We won't send any acknowledgement unless requested; importantly, we'll keep your identity and address confidential and won't communicate any such information to anyone, not even to our sponsors. * * * The previous Boston Lisp Meeting on January 26th had over 30 participants. David O'Toole gave a wide-ranging overview of the hacks he uses to write the meanings of English words as programs, and how computers could learn such programs through various interactions. We're always looking for more speakers. The call for speakers and all the other details are at http://fare.livejournal.com/120393.html For more information, see our new web site boston-lisp.org. For posts related to the Boston Lisp meetings in general, follow this link: http:// fare.livejournal.com/tag/boston-lisp-meeting or subscribe to our RSS feed: http://fare.livejournal.com/data/rss?tag=boston-lisp-meeting Please forward this information to people you think would be interested. Please accept my apologies for your receiving this message multiple times. My apologies if this announce gets posted to a list where it shouldn't, or fails to get posted to a list where it should. Feedback welcome by private email reply to fare at tunes.org. From dyoo at cs.wpi.edu Wed Feb 11 13:12:18 2009 From: dyoo at cs.wpi.edu (Danny Yoo) Date: Thu Mar 26 02:40:37 2009 Subject: [plt-scheme] Installing the Simply Scheme package? In-Reply-To: <4992F84F.2050603@gmail.com> References: <4992F84F.2050603@gmail.com> Message-ID: On Wed, Feb 11, 2009 at 11:09 AM, Ambj?rn Elder wrote: > I'm a beginner with Scheme trying to install the Simply Scheme package > written by Danny Yoo to use with the Simply Scheme book. I'm running into > some problems and I'm hoping someone here can help me out. Hi Ambjorn, Ok, I've identified and fixed the problem. It wasn't actually an issue with simply-scheme. Rather, one of its dependencies (version-case) had a regression that I introduced. I've now corrected the bug. [aside: and now I finally see why quote-syntax is important!] You may need to clear out your PLaneT cache so that your system uses the newest version-case library. After you do this, try repeating the line: (require (planet "tool.ss" ("dyoo" "simply-scheme.plt"))) and this time, simply-scheme should install fine. Thanks for letting me know about the problem! From grettke at acm.org Wed Feb 11 13:25:03 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:40:37 2009 Subject: [plt-scheme] Installing the Simply Scheme package? In-Reply-To: References: <4992F84F.2050603@gmail.com> Message-ID: <756daca50902111025o3c24a8cby1bdaff0995eae6e6@mail.gmail.com> On Wed, Feb 11, 2009 at 12:12 PM, Danny Yoo wrote: > [aside: and now I finally see why quote-syntax is important!] Why is it important?! From vyzo at media.mit.edu Wed Feb 11 13:35:50 2009 From: vyzo at media.mit.edu (Dimitris Vyzovitis) Date: Thu Mar 26 02:40:37 2009 Subject: [plt-scheme] Installing the Simply Scheme package? In-Reply-To: <756daca50902111025o3c24a8cby1bdaff0995eae6e6@mail.gmail.com> References: <4992F84F.2050603@gmail.com> <756daca50902111025o3c24a8cby1bdaff0995eae6e6@mail.gmail.com> Message-ID: On Wed, 11 Feb 2009, Grant Rettke wrote: > On Wed, Feb 11, 2009 at 12:12 PM, Danny Yoo wrote: >> [aside: and now I finally see why quote-syntax is important!] > > Why is it important?! It is impossible to implement syntax-case in userland without it for starters... -- vyzo From mikeegg1 at me.com Wed Feb 11 22:11:17 2009 From: mikeegg1 at me.com (Mike Eggleston) Date: Thu Mar 26 02:40:37 2009 Subject: [plt-scheme] what is fold-left? Message-ID: <20090212031117.GA163@mail.me.com> Morning, I'm looking at some code at . This code by default will not run in DrScheme. The code is using (fold-left ...). Looking at the function it looks like a (map ...), but I don't (yet) know why I can't just use a 'map' instead of the 'fold-left'. Any ideas? What does this function do that 'map' doesn't and why should it be used? Mike From eli at barzilay.org Wed Feb 11 22:23:58 2009 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:40:37 2009 Subject: [plt-scheme] what is fold-left? In-Reply-To: <20090212031117.GA163@mail.me.com> References: <20090212031117.GA163@mail.me.com> Message-ID: <18835.38478.817063.417346@arabic.ccs.neu.edu> On Feb 11, Mike Eggleston wrote: > Morning, > > I'm looking at some code at > . This > code by default will not run in DrScheme. The code is using (fold-left > ...). Looking at the function it looks like a (map ...), but I don't > (yet) know why I can't just use a 'map' instead of the 'fold-left'. > > Any ideas? What does this function do that 'map' doesn't and why > should it be used? It's similar to `map' except that you give it a function to accumulate the results. Think of it as a generic swiss-army-knife of list functions. In PLT, you have it available as `foldl'. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From mikeegg1 at me.com Wed Feb 11 22:24:43 2009 From: mikeegg1 at me.com (Mike Eggleston) Date: Thu Mar 26 02:40:37 2009 Subject: [plt-scheme] what is fold-left? In-Reply-To: <20090212031117.GA163@mail.me.com> References: <20090212031117.GA163@mail.me.com> Message-ID: <20090212032443.GB163@mail.me.com> On Wed, 11 Feb 2009, Mike Eggleston might have said: > Morning, > > I'm looking at some code at > . This > code by default will not run in DrScheme. The code is using (fold-left > ...). Looking at the function it looks like a (map ...), but I don't > (yet) know why I can't just use a 'map' instead of the 'fold-left'. > > Any ideas? What does this function do that 'map' doesn't and why > should it be used? > > Mike I found a reference here: How to I call this library? I'm using '#lang scheme' as the first line of my file. Mike From mikeegg1 at me.com Wed Feb 11 22:27:17 2009 From: mikeegg1 at me.com (Mike Eggleston) Date: Thu Mar 26 02:40:37 2009 Subject: [plt-scheme] what is fold-left? In-Reply-To: <18835.38478.817063.417346@arabic.ccs.neu.edu> References: <20090212031117.GA163@mail.me.com> <18835.38478.817063.417346@arabic.ccs.neu.edu> Message-ID: <20090212032717.GC163@mail.me.com> On Wed, 11 Feb 2009, Eli Barzilay might have said: > On Feb 11, Mike Eggleston wrote: > > Morning, > > > > I'm looking at some code at > > . This > > code by default will not run in DrScheme. The code is using (fold-left > > ...). Looking at the function it looks like a (map ...), but I don't > > (yet) know why I can't just use a 'map' instead of the 'fold-left'. > > > > Any ideas? What does this function do that 'map' doesn't and why > > should it be used? > > It's similar to `map' except that you give it a function to accumulate > the results. Think of it as a generic swiss-army-knife of list > functions. In PLT, you have it available as `foldl'. Wonderful. Thank you Eli. In scheme how do I alias a function so that when 'fold-left' is called it ultimatly calls 'foldl'? (define (fold-left &rest args) (apply 'foldl args)) Mike From eli at barzilay.org Wed Feb 11 22:29:50 2009 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:40:38 2009 Subject: [plt-scheme] what is fold-left? In-Reply-To: <20090212032717.GC163@mail.me.com> References: <20090212031117.GA163@mail.me.com> <18835.38478.817063.417346@arabic.ccs.neu.edu> <20090212032717.GC163@mail.me.com> Message-ID: <18835.38830.255117.459387@arabic.ccs.neu.edu> On Feb 11, Mike Eggleston wrote: > On Wed, 11 Feb 2009, Eli Barzilay might have said: > > > On Feb 11, Mike Eggleston wrote: > > > Morning, > > > > > > I'm looking at some code at > > > . This > > > code by default will not run in DrScheme. The code is using (fold-left > > > ...). Looking at the function it looks like a (map ...), but I don't > > > (yet) know why I can't just use a 'map' instead of the 'fold-left'. > > > > > > Any ideas? What does this function do that 'map' doesn't and why > > > should it be used? > > > > It's similar to `map' except that you give it a function to accumulate > > the results. Think of it as a generic swiss-army-knife of list > > functions. In PLT, you have it available as `foldl'. > > Wonderful. Thank you Eli. In scheme how do I alias a function so > that when 'fold-left' is called it ultimatly calls 'foldl'? > > (define (fold-left &rest args) > (apply 'foldl args)) In increasing order of alias-ness: (define (fold-left kons init list) (foldl kons init list)) or (define (fold-left . args) (apply foldl args)) or (define fold-left foldl) or (require (rename-in scheme/base [foldl fold-left])) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From eli at barzilay.org Wed Feb 11 22:41:46 2009 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:40:38 2009 Subject: [plt-scheme] what is fold-left? In-Reply-To: <18835.38830.255117.459387@arabic.ccs.neu.edu> References: <20090212031117.GA163@mail.me.com> <18835.38478.817063.417346@arabic.ccs.neu.edu> <20090212032717.GC163@mail.me.com> <18835.38830.255117.459387@arabic.ccs.neu.edu> Message-ID: <18835.39546.400362.228726@arabic.ccs.neu.edu> On Feb 11, Eli Barzilay wrote: > > In increasing order of alias-ness: > > (define (fold-left kons init list) (foldl kons init list)) > > or > > (define (fold-left . args) (apply foldl args)) > > or > > (define fold-left foldl) > > or > > (require (rename-in scheme/base [foldl fold-left])) ... and all of these are wrong... Sorry, I forgot that there was an incompatibility with the srfi/1 fold: to use PLT's `foldl' you need a slightly different function in `foldl': (define (sum f list) (foldl (lambda (element sum) ; <- arguments are swapped (+ sum (f element))) 0 list)) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From mikeegg1 at me.com Wed Feb 11 22:48:46 2009 From: mikeegg1 at me.com (Mike Eggleston) Date: Thu Mar 26 02:40:38 2009 Subject: [plt-scheme] what is fold-left? In-Reply-To: <18835.39546.400362.228726@arabic.ccs.neu.edu> References: <20090212031117.GA163@mail.me.com> <18835.38478.817063.417346@arabic.ccs.neu.edu> <20090212032717.GC163@mail.me.com> <18835.38830.255117.459387@arabic.ccs.neu.edu> <18835.39546.400362.228726@arabic.ccs.neu.edu> Message-ID: <20090212034846.GD163@mail.me.com> On Wed, 11 Feb 2009, Eli Barzilay might have said: > On Feb 11, Eli Barzilay wrote: > > > > In increasing order of alias-ness: > > > > (define (fold-left kons init list) (foldl kons init list)) > > > > or > > > > (define (fold-left . args) (apply foldl args)) > > > > or > > > > (define fold-left foldl) > > > > or > > > > (require (rename-in scheme/base [foldl fold-left])) > > ... and all of these are wrong... Sorry, I forgot that there was an > incompatibility with the srfi/1 fold: to use PLT's `foldl' you need a > slightly different function in `foldl': > > (define (sum f list) > (foldl (lambda (element sum) ; <- arguments are swapped > (+ sum (f element))) > 0 > list)) Great, thank you. Now I get the fun of figuring out just what the code does! Mike From dvanhorn at ccs.neu.edu Wed Feb 11 23:08:09 2009 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Thu Mar 26 02:40:38 2009 Subject: [plt-scheme] what is fold-left? In-Reply-To: <20090212034846.GD163@mail.me.com> References: <20090212031117.GA163@mail.me.com> <18835.38478.817063.417346@arabic.ccs.neu.edu> <20090212032717.GC163@mail.me.com> <18835.38830.255117.459387@arabic.ccs.neu.edu> <18835.39546.400362.228726@arabic.ccs.neu.edu> <20090212034846.GD163@mail.me.com> Message-ID: <4993A0A9.5030009@ccs.neu.edu> You might have a look at HtDP, Section 21: http://htdp.org/2003-09-26/Book/curriculum-Z-H-27.html#node_chap_21 David From a.rottmann at gmx.at Wed Feb 11 23:46:05 2009 From: a.rottmann at gmx.at (Andreas Rottmann) Date: Thu Mar 26 02:40:38 2009 Subject: [plt-scheme] what is fold-left? In-Reply-To: <20090212032443.GB163@mail.me.com> (Mike Eggleston's message of "Wed, 11 Feb 2009 21:24:43 -0600") References: <20090212031117.GA163@mail.me.com> <20090212032443.GB163@mail.me.com> Message-ID: <878woci74z.fsf@vir.lan> Mike Eggleston writes: > On Wed, 11 Feb 2009, Mike Eggleston might have said: > >> Morning, >> >> I'm looking at some code at >> . This >> code by default will not run in DrScheme. The code is using (fold-left >> ...). Looking at the function it looks like a (map ...), but I don't >> (yet) know why I can't just use a 'map' instead of the 'fold-left'. >> >> Any ideas? What does this function do that 'map' doesn't and why >> should it be used? >> >> Mike > > I found a reference here: > > > > How to I call this library? I'm using '#lang scheme' as the first > line of my file. > Using '#lang scheme': #lang scheme (require scheme/mpair rnrs/lists-6) (display (fold-left cons '() (list->mlist '(2 3 6 1)))) (newline) ; EOF Note the a bit awkward use of `list->mlist' from scheme/mpair necessitated by the fact that PLT's default language and R[56]RS are incompatible when it comes to pairs: R6RS gives you mutable pairs (although you need to import `(rnrs mutable-pairs)' to get `set-car!' and `set-cdr!'), whereas PLT gives you immutable pairs, which you have to convert from/to mutable pairs when taking or giving values from/to R6RS libraries. Another option would be to switch to R6RS completely (which would probably make sense for the example program, as it seems to be aimed at R6RS in the first place), like this: #!r6rs (import (rnrs base) (rnrs io simple) (rnrs lists)) (display (fold-left cons '() '(2 3 6 1))) (newline) ; EOF Note that the (in both programs) is not a list, but `((((() . 2) . 3) . 6) . 1)', as R6RS `fold-left' has the accumulator on the left side, as opposed to SRFI-1 and PLT. With the second program, the output is `{{{{() . 2} . 3} . 6} . 1}', as mutable pairs are displayed with curly brackets by default, and R6RS `cons' returns mutable pairs. Regards, Rotty From chadestioco at gmail.com Thu Feb 12 05:52:38 2009 From: chadestioco at gmail.com (Andrei Estioco) Date: Thu Mar 26 02:40:39 2009 Subject: [plt-scheme] Math prerequisites for SICP Message-ID: How much math do I need to know to understand SICP? We used HtDP last semester (June-October '08) although we skipped the parts that required some actual math, especially calculus. We focused more on the "algorithm" aspect of the book. I've leafed through the first few pages of SICP and found out that it tackled the big O way earlier that HtDP. We touched big O lightly last semester. How much math do I need to understand this? We only started on calculus this semester (November '08 - March '09). As of this writing our current topic is the definite integral. Is that enough (for the big O and everything else SICP) ? Thanks, -- Chad Estioco BS Computer Science University of the Philippines-Diliman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090212/d23db25a/attachment.html From pocmatos at gmail.com Thu Feb 12 07:07:30 2009 From: pocmatos at gmail.com (Paulo J. Matos) Date: Thu Mar 26 02:40:39 2009 Subject: [plt-scheme] Hygienic Macros Message-ID: <11b141710902120407p65b49b40lc6f73a2a9bb550f4@mail.gmail.com> Hi all, What would be a good simple example of an hygienic macro that would not work as expected if the macro were not hygienic? I would like an example that would be simple to understand to programming language students that are non-schemers. All the ones I have found from papers don't seem 'simple' enough. Any suggestions? -- Paulo Jorge Matos - pocmatos at gmail.com Webpage: http://www.personal.soton.ac.uk/pocm From eli at barzilay.org Thu Feb 12 07:21:21 2009 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:40:39 2009 Subject: [plt-scheme] Hygienic Macros In-Reply-To: <11b141710902120407p65b49b40lc6f73a2a9bb550f4@mail.gmail.com> References: <11b141710902120407p65b49b40lc6f73a2a9bb550f4@mail.gmail.com> Message-ID: <18836.5185.3617.315645@arabic.ccs.neu.edu> On Feb 12, Paulo J. Matos wrote: > Hi all, > > What would be a good simple example of an hygienic macro that would > not work as expected if the macro were not hygienic? I would like > an example that would be simple to understand to programming > language students that are non-schemers. All the ones I have found > from papers don't seem 'simple' enough. I do `orelse', which is actually just `or'. I begin with: (define-macro (orelse E1 E2) `(let ([tmp ,E1]) (if tmp tmp ,E2))) (let ([x 1]) (orelse #f x)) --> 1 (let ([tmp 1]) (orelse #f tmp)) --> #f I then switch to (define-macro (orelse E1 E2) `(let ([%%secret-name%% ,E1]) (if %%secret-name%% %%secret-name%% ,E1))) and say that this doesn't work in some cases of nested macros which will use the same name (but I don't have a good example for this, so if anyone has one I'll be happy). The next step is: (define-macro (orelse E1 E2) (let ([tmp (gensym)]) ; (and I explain what this does) `(let ([,tmp ,E1]) (if ,tmp ,tmp ,E2)))) (let ([x 1]) (orelse #f x)) --> 1 (let ([tmp 1]) (orelse #f tmp)) --> 1 (let ([if list]) (orelse 1 2)) --> (1 1 2) (If you want I can mail you my class notes.) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From matthias at ccs.neu.edu Thu Feb 12 07:58:45 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:40:39 2009 Subject: [plt-scheme] Math prerequisites for SICP In-Reply-To: References: Message-ID: SICP assumes a substantial level of math maturity for mathematical freshmen in the US. It also introduces you to domain knowledge from mathematical application domains at a high pace. Learning this kind of material is imperative, if you want to be really good especially at constructing large, real systems in an engineering world. Learning it is also good if you want to construct less interesting system in the future. Recommendation: do the math-y sections in HTDP. This will give you a flavor of the kind of mathematics you get in SICP, even though there are non-overlapping examples in each. I would especially focus on the examples from calculus (numeric differentiation, integration, taylor series etc) but the graph traversal (network flow) things are good for you too. Once you are at east with those, you can tackle SICP and get through fast -- Matthias On Feb 12, 2009, at 5:52 AM, Andrei Estioco wrote: > How much math do I need to know to understand SICP? We used HtDP > last semester (June-October '08) although we skipped the parts that > required some actual math, especially calculus. We focused more on > the "algorithm" aspect of the book. > > I've leafed through the first few pages of SICP and found out that > it tackled the big O way earlier that HtDP. We touched big O > lightly last semester. How much math do I need to understand this? > > We only started on calculus this semester (November '08 - March > '09). As of this writing our current topic is the definite > integral. Is that enough (for the big O and everything else SICP) ? > > Thanks, > > -- > Chad Estioco > BS Computer Science > University of the Philippines-Diliman > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From chust at web.de Thu Feb 12 08:05:56 2009 From: chust at web.de (Thomas Chust) Date: Thu Mar 26 02:40:40 2009 Subject: [plt-scheme] Math prerequisites for SICP In-Reply-To: References: Message-ID: <1c1a33bc0902120505y55f68328l963f6002e2b390c0@mail.gmail.com> Hello Andrei, to understand the big O notation you only need to know what a limit is in the mathematical sense and you need some measure for the cost of a computation, for example the number of operations of a certain kind that have to be performed. cu, Thomas -- When C++ is your hammer, every problem looks like your thumb. From farr at mit.edu Thu Feb 12 08:46:54 2009 From: farr at mit.edu (Will Farr) Date: Thu Mar 26 02:40:40 2009 Subject: [plt-scheme] Hygienic Macros In-Reply-To: <11b141710902120407p65b49b40lc6f73a2a9bb550f4@mail.gmail.com> References: <11b141710902120407p65b49b40lc6f73a2a9bb550f4@mail.gmail.com> Message-ID: Paulo, Here's another one (probably Eli's examples are better, but I've been bitten by this one in practice): Suppose you define a macro do-range: (define-syntax do-range (syntax-rules () ((do-range (i llow hhigh) body ...) (let ((low llow) (high hhigh)) (let loop ((i low)) (if (< i high) (begin body ... (loop (add1 i))) 'done)))))) And then try to use it in (define (vector-n-smallest vector n <) (let* ((store (vector-copy vector 0 (+ n 1)))) (insert-sort! store <) (do-range (i (+ n 1) (vector-length vector)) (vector-set! store n (vector-ref vector i)) (insert-sort! store <)) (vector-copy store 0 n))) Without hygiene, the '< in the do-range macro will refer to the '< that is passed into vector-n-smallest. There's no way to avoid this without introducing hygiene (i.e. it's not a bug that can be fixed by simply using (gensym)). And, it bit me in real life :). Will On Thu, Feb 12, 2009 at 7:07 AM, Paulo J. Matos wrote: > Hi all, > > What would be a good simple example of an hygienic macro that would > not work as expected if the macro were not hygienic? > I would like an example that would be simple to understand to > programming language students that are non-schemers. All the ones I > have found from papers don't seem 'simple' enough. > > Any suggestions? > > -- > Paulo Jorge Matos - pocmatos at gmail.com > Webpage: http://www.personal.soton.ac.uk/pocm > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From matthias at ccs.neu.edu Thu Feb 12 08:57:22 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:40:40 2009 Subject: [plt-scheme] Hygienic Macros In-Reply-To: References: <11b141710902120407p65b49b40lc6f73a2a9bb550f4@mail.gmail.com> Message-ID: <0DD0A8BB-0A0F-4A69-A924-033C270E3F08@ccs.neu.edu> The Hitchhiker's Guide to the Metauniverse used to advertise hygiene with a range of examples, starting from if/orelse and going to loop macros, especially for, which are notoriously to get right. Story: After I had written the Hygiene paper Dan and I went to the MIT lab late one night and encountered an old Lisper (name withheld) hacking on a Lisp machine. My first. We asked him to write one of those macros. He wrote the worst possible version. So we wrote a client that messed up. He was actually stumped for a moment and didn't know why the thing didn't behave as expected. Then we went through the defensive spiel of all people who make mistakes in programming. Lesson is: if you want to reason about the surface syntax of macro uses and if you want to have lots of programmers leverage the power of syntactic abstraction, you want hygiene, i.e., enforced lexical scoping. (Only superstars on their highest alert level get things right all the time.) -- Matthias On Feb 12, 2009, at 8:46 AM, Will Farr wrote: > Paulo, > > Here's another one (probably Eli's examples are better, but I've been > bitten by this one in practice): > > Suppose you define a macro do-range: > > (define-syntax do-range > (syntax-rules () > ((do-range (i llow hhigh) body ...) > (let ((low llow) > (high hhigh)) > (let loop ((i low)) > (if (< i high) > (begin body ... > (loop (add1 i))) > 'done)))))) > > And then try to use it in > > (define (vector-n-smallest vector n <) > (let* ((store (vector-copy vector 0 (+ n 1)))) > (insert-sort! store <) > (do-range (i (+ n 1) (vector-length vector)) > (vector-set! store n (vector-ref vector i)) > (insert-sort! store <)) > (vector-copy store 0 n))) > > Without hygiene, the '< in the do-range macro will refer to the '< > that is passed into vector-n-smallest. There's no way to avoid this > without introducing hygiene (i.e. it's not a bug that can be fixed by > simply using (gensym)). And, it bit me in real life :). > > Will > > On Thu, Feb 12, 2009 at 7:07 AM, Paulo J. Matos > wrote: >> Hi all, >> >> What would be a good simple example of an hygienic macro that would >> not work as expected if the macro were not hygienic? >> I would like an example that would be simple to understand to >> programming language students that are non-schemers. All the ones I >> have found from papers don't seem 'simple' enough. >> >> Any suggestions? >> >> -- >> Paulo Jorge Matos - pocmatos at gmail.com >> Webpage: http://www.personal.soton.ac.uk/pocm >> _________________________________________________ >> 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 florin.craciun at durham.ac.uk Thu Feb 12 09:26:10 2009 From: florin.craciun at durham.ac.uk (CRACIUN F.) Date: Thu Mar 26 02:40:40 2009 Subject: [plt-scheme] TASE 2009 - CALL FOR PAPERS Message-ID: <1C7F51B7A4A4F54389A69794AD79A24D0199C653@EXDUR3.mds.ad.dur.ac.uk> TASE 2009 - Final CALL FOR PAPERS ****************************************** * 3rd IEEE International Symposium on * Theoretical Aspects of Software Engineering * (TASE 2009) * 29-31 July 2009, Tianjin, China * http://www.dur.ac.uk/ieee.tase2009 * * For more information email: IEEE.TASE2009@durham.ac.uk ********************************************************** Large scale software systems and the Internet are of growing concern to academia and industry. This poses new challenges to the various aspects of software engineering, for instance, the reliability of software development, web-oriented software architecture and aspect and object-orientation techniques. As a result, new concepts and methodologies are required to enhance the development of software engineering from theoretical aspects. TASE 2009 is a forum for researchers from academia, industry and government to present ideas, results, and ongoing research on theoretical advances in software engineering. TASE 2009 is the third in a series of conference, sponsored by IEEE CS and IFIP. The first TASE conference was held in Shanghai, China, in June 2007. The second TASE conference was held in Nanjing, China, in June 2008. Topics of Interest: Authors are invited to submit high quality technical papers describing original and unpublished work in all theoretical aspects of software engineering. Topics of interest include, but are not limited to: * Requirements Engineering * Specification and Verification * Program Analysis * Software Testing * Model-Driven Engineering * Software Architectures and Design * Aspect and Object Orientation * Embedded and Real-Time Systems * Software Processes and Workflows * Component-Based Software Engineering * Software Safety, Security and Reliability * Reverse Engineering and Software Maintenance * Service-Oriented Computing * Semantic Web and Web Services * Type System and Theory * Program Logics and Calculus * Dependable Concurrency * Software Model Checking Program Co-Chairs ----------------- Wei-Ngan Chin (National Univ. of Singapore, Singapore) Shengchao Qin (Durham University, UK) Program Committee ----------------- Bernhard Aichernig (Graz University of Technology, Austria) Stefan Andrei (Lamar University, USA) Keijiro Araki (Kyushu University, Japan) Farhad Arbab (CWI and Leiden University, Netherlands) Jonathan Bowen (King's College London, UK) Michael Butler (University of Southampton, UK) Juan Chen (Microsoft Research, USA) Tyng-Ruey Chuang (Academica Sinica, Taiwan) Jim Davies (University of Oxford, UK) Zhenhua Duan (Xidian University, China) Xinyu Feng (Toyota Technological Inst. at Chicago, USA) Dieter Gollmann (Hamburg University of Technology, Germany) Tetsuo Ida (University of Tsukuba, Japan) Radu Iosif (Verimag, CNRS, France) Xuandong Li (Nanjing University, China) Kung-Kiu Lau (University of Manchester, UK) Shaoying Liu (Hosei University, Japan) Dorel Lucanu (University of Iasi, Romania) Tom Maibaum (McMaster University, Canada) Darko Marinov (Univ. of Illinois at Urbana-Champaign, USA) Hong Mei (Peking University, China) Huaikou Miao (Shanghai University, China) Peter Mueller (ETH Zurich, Switzerland) Viet Ha Nguyen (Vietnam National University, Vietnam) Sungwoo Park (Pohang Univ. of Science and Technology, Korea) Corneliu Popeea (MPI-SWS, Germany) Geguang Pu (East China Normal University, China) Zongyan Qiu (Peking University, China) Volker Stolz (UNU/IIST, Macau) Jing Sun (University of Auckland, New Zealand) Jun Sun (National Univ. of Singapore, Singapore) Kenji Taguchi (National Institute of Informatics, Japan) Yih-Kuen Tsay (National Taiwan University, Taiwan) Elizabeth Vidal (San Agustin National University, Peru) Ji Wang (National University of Defense Technology, China) Linzhang Wang (Nanjing University, China) Xianbing Wang (Wuhan University, China) Wang Yi (Uppsala University, Sweden) Jim Woodcock (University of York, UK) Hongyu Zhang (Tsinghua University, China) Jian Zhang (Chinese Academy of Sciences, China) Jianjun Zhao (Shanghai Jiao Tong University, China) Hong Zhu (Oxford Brookes University, UK) Huibiao Zhu (East China Normal University, China) Important Dates: February 20, 2009: Title and abstract submission deadline February 27, 2009: Paper submission deadline April 20, 2009: Acceptance/rejection notification May 11, 2009: Camera-ready version due July 29 - 31, 2009: TASE 2009 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090212/4b474ef5/attachment.htm From diggerrrrr at gmail.com Thu Feb 12 10:04:58 2009 From: diggerrrrr at gmail.com (Veer) Date: Thu Mar 26 02:40:41 2009 Subject: [plt-scheme] Pattern matching help Message-ID: Hello, Code : (match-let ([(list item rest-of-lst ...) (list (list 'eat 'cake))]) (match (list (list 'some 'dah) (list 'hmm 'ta) (list 'life 'sucks)) ((list item next-item rest-items ...) (printf "~a: ~a\n" item (cons next-item rest-items))) (_ 'false))) I want the item identifier bound by the match-let to be a value in a second match's first clause.How do i do that? It should became like this: (match-let ([(list item rest-of-lst ...) (list (list 'eat 'cake))]) (match (list (list 'some 'dah) (list 'hmm 'ta) (list 'life 'sucks)) ((list (list 'eat 'cake) next-item rest-items ...) ; item-> (list 'eat 'cake) (printf "~a: ~a\n" item (cons next-item rest-items))) (_ 'false))) Thanks From ckasso at sprynet.com Thu Feb 12 08:38:22 2009 From: ckasso at sprynet.com (Chris Kassopulo) Date: Thu Mar 26 02:40:41 2009 Subject: [plt-scheme] Re: Installing the Simply Scheme package? References: <4992F84F.2050603@gmail.com> Message-ID: On Wed, 11 Feb 2009 13:12:18 -0500, Danny Yoo wrote: > On Wed, Feb 11, 2009 at 11:09 AM, Ambj?rn Elder > wrote: > > >> I'm a beginner with Scheme trying to install the Simply Scheme package >> written by Danny Yoo to use with the Simply Scheme book. I'm running >> into some problems and I'm hoping someone here can help me out. > > > Hi Ambjorn, > > Ok, I've identified and fixed the problem. It wasn't actually an issue > with simply-scheme. Rather, one of its dependencies (version-case) had > a regression that I introduced. I've now corrected the bug. [aside: > and now I finally see why quote-syntax is important!] > > You may need to clear out your PLaneT cache so that your system uses the > newest version-case library. After you do this, try repeating the line: > > (require (planet "tool.ss" ("dyoo" "simply-scheme.plt"))) > > and this time, simply-scheme should install fine. > Hi Danny, I'm also having problems trying to install Simply-Scheme. They appear to be different than Ambjorn's problems. I'm using DrScheme, version 372. Using the instructions found here: http://hkn.eecs.berkeley.edu/~dyoo/cs3/simply-scheme/ I changed language to Pretty Big. I ran: (require (planet "simply-scheme.ss" ("dyoo" "simply-scheme.plt" 1 1))) and got: syntax: no pattern variables before ellipses in template setup-plt: Error during Compiling .zos for Simply Scheme (/home/ckasso/.plt-scheme/planet/300/372/cache/dyoo/simply-scheme.plt/1/1) setup-plt: syntax: no pattern variables before ellipses in template I deleted the cache and tried: (require (planet "tool.ss" ("dyoo" "simply-scheme.plt"))) I got the same error as before plus: .plt-scheme/planet/300/372/cache/dyoo/simply-scheme.plt/1/1/tool.ss:15:51: syntax: no pattern variables before ellipses in template in: ... Chris From samth at ccs.neu.edu Thu Feb 12 10:22:25 2009 From: samth at ccs.neu.edu (Sam TH) Date: Thu Mar 26 02:40:41 2009 Subject: [plt-scheme] Pattern matching help In-Reply-To: References: Message-ID: <63bb19ae0902120722h1b4e84eco5ed2395367c87a98@mail.gmail.com> On Thu, Feb 12, 2009 at 10:04 AM, Veer wrote: > Hello, > > Code : > > (match-let ([(list item rest-of-lst ...) (list (list 'eat 'cake))]) > (match (list (list 'some 'dah) (list 'hmm 'ta) (list 'life 'sucks)) > ((list item next-item rest-items ...) > (printf "~a: ~a\n" item (cons next-item rest-items))) > > (_ 'false))) > The easiest way to do this is: (match-let ([(list item rest-of-lst ...) (list (list 'eat 'cake))]) (match (list (list 'some 'dah) (list 'hmm 'ta) (list 'life 'sucks)) [(list (? (lambda (e) (equal? e item))) next-item rest-items ...) (printf "~a: ~a\n" item (cons next-item rest-items)) [_ 'false])) Hope that helps, -- sam th samth@ccs.neu.edu From plragde at uwaterloo.ca Thu Feb 12 10:34:49 2009 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:40:41 2009 Subject: [plt-scheme] Math prerequisites for SICP Message-ID: <49944199.1080309@uwaterloo.ca> Thomas Chust wrote: > to understand the big O notation you only need to know what a limit is > in the mathematical sense and you need some measure for the cost of a > computation, for example the number of operations of a certain kind > that have to be performed. Limits are not necessary to understand big-O notation. In fact, I would argue that limits are the wrong way to deal with big-O notation, because worst-case running times are discrete functions (since the "size" of the input is typically an integer) and contain an extra quantifier ("for all inputs of size n"). Limits can help in some of the manipulations needed to justify certain claims made with O-notation, for example that an + b log n is O(n). But the larger stumbling block is, as Thomas writes, "some measure for the cost of a computation". HtDP presents a clear enough semantic model that one can count steps. I can't remember if SICP does. --PR From diggerrrrr at gmail.com Thu Feb 12 10:37:36 2009 From: diggerrrrr at gmail.com (Veer) Date: Thu Mar 26 02:40:41 2009 Subject: [plt-scheme] Pattern matching help In-Reply-To: <63bb19ae0902120722h1b4e84eco5ed2395367c87a98@mail.gmail.com> References: <63bb19ae0902120722h1b4e84eco5ed2395367c87a98@mail.gmail.com> Message-ID: It works now , thanks for the help Sam TH and Noel Welsh . On Thu, Feb 12, 2009 at 8:52 PM, Sam TH wrote: > On Thu, Feb 12, 2009 at 10:04 AM, Veer wrote: >> Hello, >> >> Code : >> >> (match-let ([(list item rest-of-lst ...) (list (list 'eat 'cake))]) >> (match (list (list 'some 'dah) (list 'hmm 'ta) (list 'life 'sucks)) >> ((list item next-item rest-items ...) >> (printf "~a: ~a\n" item (cons next-item rest-items))) >> >> (_ 'false))) >> > > The easiest way to do this is: > > (match-let ([(list item rest-of-lst ...) (list (list 'eat 'cake))]) > (match (list (list 'some 'dah) (list 'hmm 'ta) (list 'life 'sucks)) > [(list (? (lambda (e) (equal? e item))) next-item rest-items ...) > (printf "~a: ~a\n" item (cons next-item rest-items)) > [_ 'false])) > > Hope that helps, > -- > sam th > samth@ccs.neu.edu > From dyoo at cs.wpi.edu Thu Feb 12 10:38:42 2009 From: dyoo at cs.wpi.edu (Danny Yoo) Date: Thu Mar 26 02:40:41 2009 Subject: [plt-scheme] Re: Installing the Simply Scheme package? In-Reply-To: References: <4992F84F.2050603@gmail.com> Message-ID: > I'm also having problems trying to install Simply-Scheme. They appear to > be different than Ambjorn's problems. Ack; my apologies. It is the same bug, but I had forgotten to make sure the updated version is visible in the 3xx repository. Ok, this should be fixed now. You'll probably need to clear out your PLaneT cache. Can you try again? From ckasso at sprynet.com Thu Feb 12 10:53:07 2009 From: ckasso at sprynet.com (Chris Kassopulo) Date: Thu Mar 26 02:40:42 2009 Subject: [plt-scheme] Re: Installing the Simply Scheme package? References: <4992F84F.2050603@gmail.com> Message-ID: On Thu, 12 Feb 2009 10:38:42 -0500, Danny Yoo wrote: >> I'm also having problems trying to install Simply-Scheme. They appear >> to be different than Ambjorn's problems. > > Ack; my apologies. It is the same bug, but I had forgotten to make sure > the updated version is visible in the 3xx repository. Ok, this should > be fixed now. You'll probably need to clear out your PLaneT cache. Can > you try again? No apologies necessary. Cleared the cache. Ran: (require (planet "tool.ss" ("dyoo" "simply-scheme.plt"))) Exited Changed language to Simply Scheme Works Thanks Now back to reading Chris From jay.mccarthy at gmail.com Thu Feb 12 11:13:51 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:40:42 2009 Subject: [plt-scheme] #%top-interaction and reader Message-ID: Is it possible for a module language to override the reader in the DrScheme REPL through some #%top-interaction magic? Jay -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From samth at ccs.neu.edu Thu Feb 12 11:28:40 2009 From: samth at ccs.neu.edu (Sam TH) Date: Thu Mar 26 02:40:42 2009 Subject: [plt-scheme] #%top-interaction and reader In-Reply-To: References: Message-ID: <63bb19ae0902120828s1ed27e62l2a7ce402296b0a3f@mail.gmail.com> On Thu, Feb 12, 2009 at 11:13 AM, Jay McCarthy wrote: > Is it possible for a module language to override the reader in the > DrScheme REPL through some #%top-interaction magic? This is currently not possible. Some of the mechanism is in place, in the form of the `module-compiled-language-info' procedure and its relatives. However, to my knowledge, it hasn't been determined how languages should use these tools to communicate with DrScheme et al. -- sam th samth@ccs.neu.edu From eviertel at gmail.com Thu Feb 12 13:04:49 2009 From: eviertel at gmail.com (e) Date: Thu Mar 26 02:40:42 2009 Subject: [plt-scheme] Re: silly question about getting email In-Reply-To: <21119183-ed20-4962-be6b-4b5a037aba23@v13g2000yqm.googlegroups.com> References: <21119183-ed20-4962-be6b-4b5a037aba23@v13g2000yqm.googlegroups.com> Message-ID: please disregard. I don't get the digest-only anymore :) On Wed, Feb 11, 2009 at 8:22 PM, e wrote: > Hi, this is my first post to the group. Anyone know why I can't > choose the 4th membership type that allows one to receive each > individual email? It just says, "There's a problem with your > subscription type." so I have to pick "Digest". > > Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090212/07b0cce3/attachment.html From eviertel at gmail.com Thu Feb 12 13:13:05 2009 From: eviertel at gmail.com (e) Date: Thu Mar 26 02:40:43 2009 Subject: [plt-scheme] newbie: web server tutorial questions Message-ID: just before the https section in the tutorial: http://docs.plt-scheme.org/continue/index.html I tried> mzscheme -t blog.ss and got back> blog.ss:150:33: compile: unbound identifier in module in: path sooooooo, is supposed to be the same value as "APPLICATION.ss", and are both of these supposed to be the place the application code was getting cut and past (in my case "blog.ss")? Are all the ss files supposed to reside in a servlets folder? and is #:servlet-path "/servlets/APPLICATION.ss" a relative path to htdocs? and in the following, (list (build-path path "htdocs")) is htdocs relative to where you run the mzscheme command? Thanks. From jay.mccarthy at gmail.com Thu Feb 12 14:08:47 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:40:43 2009 Subject: [plt-scheme] newbie: web server tutorial questions In-Reply-To: References: Message-ID: On Thu, Feb 12, 2009 at 11:13 AM, e wrote: > just before the https section in the tutorial: http://docs.plt-scheme.org/continue/index.html > > I tried> mzscheme -t blog.ss > > and got back> blog.ss:150:33: compile: unbound identifier in module > in: path Your problem is that you've left 'path' in the code, where it says: "You should change /path/ to be the path to the parent of your htdocs directory." > sooooooo, is supposed to be the same value as > "APPLICATION.ss", and are both of these supposed to be the place the > application code was getting cut and past (in my case "blog.ss")? Are > all the ss files supposed to reside in a servlets folder? and is > > #:servlet-path "/servlets/APPLICATION.ss" > > a relative path to htdocs? file.ss is where the actual code is servlet-path (and APPLICATION.ss) is the URL you would like to use to get to it. > and in the following, > (list (build-path path "htdocs")) > > is htdocs relative to where you run the mzscheme command? htdocs is relative to 'path', which you must supply. If you use (current-directory), then you will use the current directory. Jay > > Thanks. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From hendrik at topoi.pooq.com Thu Feb 12 14:54:00 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:40:43 2009 Subject: [plt-scheme] what is fold-left? In-Reply-To: <20090212031117.GA163@mail.me.com> References: <20090212031117.GA163@mail.me.com> Message-ID: <20090212195400.GA19526@topoi.pooq.com> On Wed, Feb 11, 2009 at 09:11:17PM -0600, Mike Eggleston wrote: > Morning, > > I'm looking at some code at > . This > code by default will not run in DrScheme. The code is using (fold-left > ...). Looking at the function it looks like a (map ...), but I don't > (yet) know why I can't just use a 'map' instead of the 'fold-left'. > > Any ideas? What does this function do that 'map' doesn't and why > should it be used? The name comes from Richard Bird's paper "A Theory of Lists", and he may have gotten it from ongoing discussins in IFIP WOrking Group 2.1 on Algorithmic Language. There's also a fold-right, by the way. -- hendrik From william.wood3 at comcast.net Thu Feb 12 15:56:37 2009 From: william.wood3 at comcast.net (Bill) Date: Thu Mar 26 02:40:43 2009 Subject: [plt-scheme] what is fold-left? In-Reply-To: <20090212195400.GA19526@topoi.pooq.com> References: <20090212031117.GA163@mail.me.com> <20090212195400.GA19526@topoi.pooq.com> Message-ID: <1234472197.7749.3.camel@localhost> On Thu, 2009-02-12 at 14:54 -0500, hendrik@topoi.pooq.com wrote: > On Wed, Feb 11, 2009 at 09:11:17PM -0600, Mike Eggleston wrote: > > Morning, > > > > I'm looking at some code at > > . This > > code by default will not run in DrScheme. The code is using (fold-left > > ...). Looking at the function it looks like a (map ...), but I don't > > (yet) know why I can't just use a 'map' instead of the 'fold-left'. > > > > Any ideas? What does this function do that 'map' doesn't and why > > should it be used? > > The name comes from Richard Bird's paper "A Theory of Lists", and he may > have gotten it from ongoing discussins in IFIP WOrking Group 2.1 on > Algorithmic Language. > > There's also a fold-right, by the way. Another source is Richard Bird and Oege de Moor, _Algebra of Programming_, pp. 4 -- 16, where fold functions for the natural numbers, lists and trees are discussed. -- Bill Wood From pocmatos at gmail.com Thu Feb 12 17:15:22 2009 From: pocmatos at gmail.com (Paulo J. Matos) Date: Thu Mar 26 02:40:44 2009 Subject: [plt-scheme] Hygienic Macros In-Reply-To: <0DD0A8BB-0A0F-4A69-A924-033C270E3F08@ccs.neu.edu> References: <11b141710902120407p65b49b40lc6f73a2a9bb550f4@mail.gmail.com> <0DD0A8BB-0A0F-4A69-A924-033C270E3F08@ccs.neu.edu> Message-ID: <11b141710902121415m6342302chdd08d942346b6883@mail.gmail.com> On Thu, Feb 12, 2009 at 1:57 PM, Matthias Felleisen wrote: > > The Hitchhiker's Guide to the Metauniverse used to advertise hygiene with a > range of examples, starting from if/orelse and going to loop macros, > especially for, which are notoriously to get right. > > Story: After I had written the Hygiene paper Dan and I went to the MIT lab > late one night and encountered an old Lisper (name withheld) hacking on a > Lisp machine. My first. We asked him to write one of those macros. He wrote > the worst possible version. So we wrote a client that messed up. He was > actually stumped for a moment and didn't know why the thing didn't behave as > expected. Then we went through the defensive spiel of all people who make > mistakes in programming. > > Lesson is: if you want to reason about the surface syntax of macro uses and > if you want to have lots of programmers leverage the power of syntactic > abstraction, you want hygiene, i.e., enforced lexical scoping. (Only > superstars on their highest alert level get things right all the time.) > > -- Matthias > > Thanks Matthias for the comment and Will and Eli for the examples. It will be very useful! :) > > > > On Feb 12, 2009, at 8:46 AM, Will Farr wrote: > >> Paulo, >> >> Here's another one (probably Eli's examples are better, but I've been >> bitten by this one in practice): >> >> Suppose you define a macro do-range: >> >> (define-syntax do-range >> (syntax-rules () >> ((do-range (i llow hhigh) body ...) >> (let ((low llow) >> (high hhigh)) >> (let loop ((i low)) >> (if (< i high) >> (begin body ... >> (loop (add1 i))) >> 'done)))))) >> >> And then try to use it in >> >> (define (vector-n-smallest vector n <) >> (let* ((store (vector-copy vector 0 (+ n 1)))) >> (insert-sort! store <) >> (do-range (i (+ n 1) (vector-length vector)) >> (vector-set! store n (vector-ref vector i)) >> (insert-sort! store <)) >> (vector-copy store 0 n))) >> >> Without hygiene, the '< in the do-range macro will refer to the '< >> that is passed into vector-n-smallest. There's no way to avoid this >> without introducing hygiene (i.e. it's not a bug that can be fixed by >> simply using (gensym)). And, it bit me in real life :). >> >> Will >> >> On Thu, Feb 12, 2009 at 7:07 AM, Paulo J. Matos >> wrote: >>> >>> Hi all, >>> >>> What would be a good simple example of an hygienic macro that would >>> not work as expected if the macro were not hygienic? >>> I would like an example that would be simple to understand to >>> programming language students that are non-schemers. All the ones I >>> have found from papers don't seem 'simple' enough. >>> >>> Any suggestions? >>> >>> -- >>> Paulo Jorge Matos - pocmatos at gmail.com >>> Webpage: http://www.personal.soton.ac.uk/pocm >>> _________________________________________________ >>> 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 > -- Paulo Jorge Matos - pocmatos at gmail.com Webpage: http://www.personal.soton.ac.uk/pocm From jmarshall at alum.mit.edu Thu Feb 12 19:05:52 2009 From: jmarshall at alum.mit.edu (Joe Marshall) Date: Thu Mar 26 02:40:44 2009 Subject: [plt-scheme] what is fold-left? In-Reply-To: <20090212031117.GA163@mail.me.com> References: <20090212031117.GA163@mail.me.com> Message-ID: (define (fold-left procedure init list) (define (fold-left-error irritant) (error:not-list irritant 'FOLD-LEFT)) (define (fold-left-loop state element tail) (if (pair? tail) (fold-left-loop (procedure state element) (car tail) (cdr tail)) (begin (if (not (null? tail)) (fold-left-error tail)) (procedure state element)))) (if (pair? list) (fold-left-loop init (car list) (cdr list)) (begin (if (not (null? list)) (fold-left-error tail)) init))) On Wed, Feb 11, 2009 at 7:11 PM, Mike Eggleston wrote: > Morning, > > I'm looking at some code at > . This > code by default will not run in DrScheme. The code is using (fold-left > ...). Looking at the function it looks like a (map ...), but I don't > (yet) know why I can't just use a 'map' instead of the 'fold-left'. > > Any ideas? What does this function do that 'map' doesn't and why > should it be used? Because `map' doesn't do what you want. MAP takes a function and a list and returns a new list. FOLD-LEFT takes a function, a (initial) value, and a list and then walks down the list applying the function to the current value and the head of the list to generate the next value. Here is an example: (define (sum f list) (fold-left (lambda (sum element) (+ sum (f element))) 0 list)) on each iteration, we apply f to the head of the list and add it to the accumulated sum. For example: (sum string-length '("Foo" "bar" "hello")) => 11 (map string-length '("Foo" "bar" "hello")) => (3 3 5) Feel free to ask other questions. -- ~jrm From jmarshall at alum.mit.edu Thu Feb 12 19:09:18 2009 From: jmarshall at alum.mit.edu (Joe Marshall) Date: Thu Mar 26 02:40:44 2009 Subject: [plt-scheme] what is fold-left? In-Reply-To: <18835.39546.400362.228726@arabic.ccs.neu.edu> References: <20090212031117.GA163@mail.me.com> <18835.38478.817063.417346@arabic.ccs.neu.edu> <20090212032717.GC163@mail.me.com> <18835.38830.255117.459387@arabic.ccs.neu.edu> <18835.39546.400362.228726@arabic.ccs.neu.edu> Message-ID: On Wed, Feb 11, 2009 at 7:41 PM, Eli Barzilay wrote: > On Feb 11, Eli Barzilay wrote: >> >> In increasing order of alias-ness: >> >> (define (fold-left kons init list) (foldl kons init list)) >> >> or >> >> (define (fold-left . args) (apply foldl args)) >> >> or >> >> (define fold-left foldl) >> >> or >> >> (require (rename-in scheme/base [foldl fold-left])) > > ... and all of these are wrong... Sorry, I forgot that there was an > incompatibility with the srfi/1 fold: to use PLT's `foldl' you need a > slightly different function in `foldl': > > (define (sum f list) > (foldl (lambda (element sum) ; <- arguments are swapped > (+ sum (f element))) > 0 > list)) That's why I said in the text right after the post ``Also note that your version of Scheme might take the arguments to fold-left in a different order.'' -- ~jrm From eviertel at gmail.com Thu Feb 12 21:15:07 2009 From: eviertel at gmail.com (e) Date: Thu Mar 26 02:40:45 2009 Subject: [plt-scheme] newbie: web server tutorial questions In-Reply-To: References: Message-ID: awesome. I missed that "path" was in italics. path was what was unbound, duh. I thought it was saying that something in my path was unbound. Totally amazing software, I'm sure I don't have to say. Totally amazing. On Thu, Feb 12, 2009 at 2:08 PM, Jay McCarthy wrote: > On Thu, Feb 12, 2009 at 11:13 AM, e wrote: > > just before the https section in the tutorial: > http://docs.plt-scheme.org/continue/index.html > > > > I tried> mzscheme -t blog.ss > > > > and got back> blog.ss:150:33: compile: unbound identifier in module > > in: path > > Your problem is that you've left 'path' in the code, where it says: > > "You should change /path/ to be the path to the parent of your htdocs > directory." > > > sooooooo, is supposed to be the same value as > > "APPLICATION.ss", and are both of these supposed to be the place the > > application code was getting cut and past (in my case "blog.ss")? Are > > all the ss files supposed to reside in a servlets folder? and is > > > > #:servlet-path "/servlets/APPLICATION.ss" > > > > a relative path to htdocs? > > file.ss is where the actual code is > > servlet-path (and APPLICATION.ss) is the URL you would like to use to get > to it. > > > and in the following, > > (list (build-path path "htdocs")) > > > > is htdocs relative to where you run the mzscheme command? > > htdocs is relative to 'path', which you must supply. If you use > (current-directory), then you will use the current directory. > > Jay > > > > > Thanks. > > _________________________________________________ > > For list-related administrative tasks: > > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > > > > > -- > Jay McCarthy > Assistant Professor / Brigham Young University > http://teammccarthy.org/jay > > "The glory of God is Intelligence" - D&C 93 > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090212/292d9917/attachment.htm From adityashukla1983 at gmail.com Thu Feb 12 21:24:33 2009 From: adityashukla1983 at gmail.com (aditya shukla) Date: Thu Mar 26 02:40:45 2009 Subject: [plt-scheme] Learning functional programming Message-ID: <73045cca0902121824i5b90d909ma0dcaea74c53202c@mail.gmail.com> Hello people , i am new to the concept of functional programming and using EOPL as text.But the thing is i end up getting confused more often than learning from it. Can someone please suggest me any other other resource to study from ? Aditya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090212/153adbe9/attachment.html From eli at barzilay.org Thu Feb 12 21:31:42 2009 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:40:45 2009 Subject: [plt-scheme] Learning functional programming In-Reply-To: <73045cca0902121824i5b90d909ma0dcaea74c53202c@mail.gmail.com> References: <73045cca0902121824i5b90d909ma0dcaea74c53202c@mail.gmail.com> Message-ID: <18836.56206.900405.827971@arabic.ccs.neu.edu> On Feb 12, aditya shukla wrote: > Hello people , > > i am new to the concept of functional programming and using EOPL as > text.But the thing is i end up getting confused more often than > learning from it. Can someone please suggest me any other other > resource to study from ? Try PLAI -- http://www.plai.org/ . -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From mvanier42 at gmail.com Thu Feb 12 21:40:14 2009 From: mvanier42 at gmail.com (Michael Vanier) Date: Thu Mar 26 02:40:47 2009 Subject: [plt-scheme] Learning functional programming In-Reply-To: <18836.56206.900405.827971@arabic.ccs.neu.edu> References: <73045cca0902121824i5b90d909ma0dcaea74c53202c@mail.gmail.com> <18836.56206.900405.827971@arabic.ccs.neu.edu> Message-ID: <4994DD8E.8050606@cs.caltech.edu> Eli Barzilay wrote: > On Feb 12, aditya shukla wrote: > >> Hello people , >> >> i am new to the concept of functional programming and using EOPL as >> text.But the thing is i end up getting confused more often than >> learning from it. Can someone please suggest me any other other >> resource to study from ? >> > > Try PLAI -- http://www.plai.org/ . > > Or more naively, try HtDP (http://www.htdp.org) and SICP (http://mitpress.mit.edu/sicp). EOPL/PLAI strikes me as jumping into the deep end of the pool. Also, those books focus on program interpretation/semantics rather than general functional programming. Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090212/cb8de9dd/attachment.htm From sk at cs.brown.edu Thu Feb 12 21:42:22 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:40:47 2009 Subject: [plt-scheme] newbie: web server tutorial questions In-Reply-To: References: Message-ID: Jay, given the tendency to copy-and-paste code, why not change "path" to "your-path-goes-here" or something like that? And doing the same in general in other parts of the docs? From eli at barzilay.org Thu Feb 12 21:43:05 2009 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:40:47 2009 Subject: [plt-scheme] Learning functional programming In-Reply-To: <4994DD8E.8050606@cs.caltech.edu> References: <73045cca0902121824i5b90d909ma0dcaea74c53202c@mail.gmail.com> <18836.56206.900405.827971@arabic.ccs.neu.edu> <4994DD8E.8050606@cs.caltech.edu> Message-ID: <18836.56889.176713.792974@arabic.ccs.neu.edu> On Feb 12, Michael Vanier wrote: > Eli Barzilay wrote: > > On Feb 12, aditya shukla wrote: > > > >> Hello people , > >> > >> i am new to the concept of functional programming and using EOPL > >> as text.But the thing is i end up getting confused more often > >> than learning from it. Can someone please suggest me any other > >> other resource to study from ? > > > > Try PLAI -- http://www.plai.org/ . > > > Or more naively, try HtDP (http://www.htdp.org) and SICP > (http://mitpress.mit.edu/sicp). EOPL/PLAI strikes me as jumping into > the deep end of the pool. Also, those books focus on program > interpretation/semantics rather than general functional programming. (Yes, of course -- I just assumed that the request was for a book on a similar subject...) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From eviertel at gmail.com Thu Feb 12 22:00:31 2009 From: eviertel at gmail.com (e) Date: Thu Mar 26 02:40:48 2009 Subject: [plt-scheme] newbie: web server tutorial questions In-Reply-To: References: Message-ID: There was another tutorial http://docs.plt-scheme.org/more/index.html that put the code on the side, but perhaps the inline method is better because it forces the newbie to read. By the way, the whole plt-scheme effort is great advertising for Brown. This stuff is so cool, it's got me browsing through Brown pages looking at degree programs! On Thu, Feb 12, 2009 at 9:42 PM, Shriram Krishnamurthi wrote: > Jay, given the tendency to copy-and-paste code, why not change "path" > to "your-path-goes-here" or something like that? And doing the same > in general in other parts of the docs? > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090212/eb850936/attachment.html From sk at cs.brown.edu Thu Feb 12 22:21:53 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:40:48 2009 Subject: [plt-scheme] newbie: web server tutorial questions In-Reply-To: References: Message-ID: > By the way, the whole plt-scheme effort is great advertising for > Brown. This stuff is so cool, it's got me browsing through Brown > pages looking at degree programs! Please look at the other major schools, too! Matthias Felleisen at Northeastern http://www.ccs.neu.edu/scheme/ Robby Findler at Northwestern http://plt.eecs.northwestern.edu/ Matthew Flatt at Utah http://www.cs.utah.edu/plt/ Growing PLT campuses include: John Clements at Cal Poly Kathi Fisler at WPI Jay McCarthy at BYU In particular, the PLT Web server is now housed under Jay at BYU (but indeed he began working on it under my supervision while a PhD student at Brown). PLT is a great multi-university effort with active collaborations between many of these campuses. These are all great places to study, and offer access to a very successful group of research advisors. Shriram From grettke at acm.org Thu Feb 12 22:45:23 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:40:48 2009 Subject: [plt-scheme] How is letrec different from letrec* in its use? Message-ID: <756daca50902121945r58b907agb3da62f0d3c7f24@mail.gmail.com> Hi folks, I just read the spec for both letrec and letrec* and I see that the former is not evaluted in any other but the latter is evaluted from left to right. I am not getting the difference in their use. May someone please provide an illuminating example? Best wishes, Grant From samth at ccs.neu.edu Thu Feb 12 22:58:55 2009 From: samth at ccs.neu.edu (Sam TH) Date: Thu Mar 26 02:40:48 2009 Subject: [plt-scheme] How is letrec different from letrec* in its use? In-Reply-To: <756daca50902121945r58b907agb3da62f0d3c7f24@mail.gmail.com> References: <756daca50902121945r58b907agb3da62f0d3c7f24@mail.gmail.com> Message-ID: <63bb19ae0902121958y1abdfc6cy5dc00fbfa04f8fb4@mail.gmail.com> The following program does not have a consistent meaning under all orders of evaluation of the `letrec' right-hand-sides. (letrec ([x 1] [y (set! x 2)] [z (set! x (+ x 1))]) x) For example, if we evaluate the bindings top down, we get 3, but if we evaluate z before y, we get 2. The semantics for `letrec' do not specify which of these you might get (indeed, you might get an error from +). The semantics of `letrec*' will always give you 3. sam th On Thu, Feb 12, 2009 at 10:45 PM, Grant Rettke wrote: > Hi folks, > > I just read the spec for both letrec and letrec* and I see that the > former is not evaluted in any other but the latter is evaluted from > left to right. I am not getting the difference in their use. May > someone please provide an illuminating example? > > Best wishes, > > Grant > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- sam th samth@ccs.neu.edu From sk at cs.brown.edu Thu Feb 12 23:04:55 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:40:48 2009 Subject: [plt-scheme] How is letrec different from letrec* in its use? In-Reply-To: <63bb19ae0902121958y1abdfc6cy5dc00fbfa04f8fb4@mail.gmail.com> References: <756daca50902121945r58b907agb3da62f0d3c7f24@mail.gmail.com> <63bb19ae0902121958y1abdfc6cy5dc00fbfa04f8fb4@mail.gmail.com> Message-ID: These threads (we had a recent flare-up about LOCAL, as some might recall) point to the worst thing about Old Scheme: not only did they leave the semantics undefined, they ALSO didn't have the courtesy to provide a reference compiler that actually produced unexpected output, thereby compounding confusion (resulting in unknown unknowns). From grettke at acm.org Thu Feb 12 23:24:24 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:40:49 2009 Subject: [plt-scheme] How is letrec different from letrec* in its use? In-Reply-To: <63bb19ae0902121958y1abdfc6cy5dc00fbfa04f8fb4@mail.gmail.com> References: <756daca50902121945r58b907agb3da62f0d3c7f24@mail.gmail.com> <63bb19ae0902121958y1abdfc6cy5dc00fbfa04f8fb4@mail.gmail.com> Message-ID: <756daca50902122024r289ba43cy1193ca2c46c1c6c6@mail.gmail.com> On Thu, Feb 12, 2009 at 9:58 PM, Sam TH wrote: > The following program does not have a consistent meaning under all > orders of evaluation of the `letrec' right-hand-sides. > > (letrec ([x 1] > [y (set! x 2)] > [z (set! x (+ x 1))]) > x) > > For example, if we evaluate the bindings top down, we get 3, but if we > evaluate z before y, we get 2. The semantics for `letrec' do not > specify which of these you might get (indeed, you might get an error > from +). The semantics of `letrec*' will always give you 3. I see. Reading the R6RS specification of letrec it says: "It should be possible to evaluate each without assigning or referring to the value of any . In the most common uses of letrec, all the s are lambda expressions and the restriction is satisfied automatically." Why letrec is included when it would only work in a predictable manner when the s are lambda expressions? From eviertel at gmail.com Thu Feb 12 08:38:24 2009 From: eviertel at gmail.com (e) Date: Thu Mar 26 02:40:49 2009 Subject: [plt-scheme] newbie: web server tutorial questions Message-ID: http://docs.plt-scheme.org/continue/index.html On that note. I'm having trouble: regarding the end of: http://docs.plt-scheme.org/continue/index.html, just before the https section, I did: > mzscheme -t blog.ss blog.ss:150:33: compile: unbound identifier in module in: path sooooooo, is supposed to be the same value as "APPLICATION.ss", and are both of these supposed to be the place the application code was getting cut and past? Are all the ss files supposed to reside in a servlets folder? and is #:servlet-path "/servlets/APPLICATION.ss" a relative path to htdocs? and in (list (build-path path "htdocs")) is htdocs relative to where you run the mzscheme command? Thanks. From cat at catdancer.ws Thu Feb 12 14:42:22 2009 From: cat at catdancer.ws (Cat Dancer) Date: Thu Mar 26 02:40:49 2009 Subject: [plt-scheme] Is documentation for old versions of MzScheme still available on the web site? Message-ID: <1356b65a-647f-4390-8517-e2f6b8290820@u13g2000yqg.googlegroups.com> I remember at one point documentation for old versions of MzScheme was available on plt-scheme.org: there was a link in the doc page, if I remember, to go to older versions, and then you could click on a older version, and see the documentation for that version's MzScheme manual, mzlib, etc. I wasn't finding it any more, so I was wondering if documentation for older versions is still available up on the web site? I know I can download older versions which includes the documentation, so it isn't a big deal. Thanks! From eli at barzilay.org Fri Feb 13 00:42:22 2009 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:40:49 2009 Subject: [plt-scheme] Is documentation for old versions of MzScheme still available on the web site? In-Reply-To: <1356b65a-647f-4390-8517-e2f6b8290820@u13g2000yqg.googlegroups.com> References: <1356b65a-647f-4390-8517-e2f6b8290820@u13g2000yqg.googlegroups.com> Message-ID: <18837.2110.469067.300831@arabic.ccs.neu.edu> On Feb 12, Cat Dancer wrote: > I remember at one point documentation for old versions of MzScheme was > available on plt-scheme.org: there was a link in the doc page, if I > remember, to go to older versions, and then you could click on a older > version, and see the documentation for that version's MzScheme manual, > mzlib, etc. > > I wasn't finding it any more, so I was wondering if documentation for > older versions is still available up on the web site? Yes: http://download.plt-scheme.org/doc/ -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From hendrik at topoi.pooq.com Thu Feb 12 23:43:49 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:40:49 2009 Subject: [plt-scheme] what is fold-left? In-Reply-To: <1234472197.7749.3.camel@localhost> References: <20090212031117.GA163@mail.me.com> <20090212195400.GA19526@topoi.pooq.com> <1234472197.7749.3.camel@localhost> Message-ID: <20090213044349.GA21163@topoi.pooq.com> On Thu, Feb 12, 2009 at 02:56:37PM -0600, Bill wrote: > On Thu, 2009-02-12 at 14:54 -0500, hendrik@topoi.pooq.com wrote: > > On Wed, Feb 11, 2009 at 09:11:17PM -0600, Mike Eggleston wrote: > > > Morning, > > > > > > I'm looking at some code at > > > . This > > > code by default will not run in DrScheme. The code is using (fold-left > > > ...). Looking at the function it looks like a (map ...), but I don't > > > (yet) know why I can't just use a 'map' instead of the 'fold-left'. > > > > > > Any ideas? What does this function do that 'map' doesn't and why > > > should it be used? > > > > The name comes from Richard Bird's paper "A Theory of Lists", and he may > > have gotten it from ongoing discussins in IFIP WOrking Group 2.1 on > > Algorithmic Language. > > > > There's also a fold-right, by the way. > > Another source is Richard Bird and Oege de Moor, _Algebra of > Programming_, pp. 4 -- 16, where fold functions for the natural numbers, > lists and trees are discussed. Trees have natural constructors. Lists can be viewed as trees, constructed by a concatenation function. As a tree, a list has a lot of ways it can be so constructed. fold-left and fold-right just deconstruct it in two particularly regular ways. -- hendrik From hendrik at topoi.pooq.com Thu Feb 12 23:54:40 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:40:49 2009 Subject: [plt-scheme] How is letrec different from letrec* in its use? In-Reply-To: <756daca50902122024r289ba43cy1193ca2c46c1c6c6@mail.gmail.com> References: <756daca50902121945r58b907agb3da62f0d3c7f24@mail.gmail.com> <63bb19ae0902121958y1abdfc6cy5dc00fbfa04f8fb4@mail.gmail.com> <756daca50902122024r289ba43cy1193ca2c46c1c6c6@mail.gmail.com> Message-ID: <20090213045440.GB21163@topoi.pooq.com> On Thu, Feb 12, 2009 at 10:24:24PM -0600, Grant Rettke wrote: > On Thu, Feb 12, 2009 at 9:58 PM, Sam TH wrote: > > The following program does not have a consistent meaning under all > > orders of evaluation of the `letrec' right-hand-sides. > > > > (letrec ([x 1] > > [y (set! x 2)] > > [z (set! x (+ x 1))]) > > x) > > > > For example, if we evaluate the bindings top down, we get 3, but if we > > evaluate z before y, we get 2. The semantics for `letrec' do not > > specify which of these you might get (indeed, you might get an error > > from +). The semantics of `letrec*' will always give you 3. > > I see. > > Reading the R6RS specification of letrec it says: > > "It should be possible to evaluate each without assigning or > referring to the value of any . In the most common uses of > letrec, all the s are lambda expressions and the restriction is > satisfied automatically." > > Why letrec is included when it would only work in a predictable manner > when the s are lambda expressions? So you could use it in a predicatable manner for lambda expressions, of course. I think, in fact, it was invented first, before letrec*. I think is was in Landin's original ISWIM paper, entitled, "The Next 700 Progeanning Languages". -- hendrik From grettke at acm.org Fri Feb 13 00:57:57 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:40:49 2009 Subject: [plt-scheme] How is letrec different from letrec* in its use? In-Reply-To: <20090213045440.GB21163@topoi.pooq.com> References: <756daca50902121945r58b907agb3da62f0d3c7f24@mail.gmail.com> <63bb19ae0902121958y1abdfc6cy5dc00fbfa04f8fb4@mail.gmail.com> <756daca50902122024r289ba43cy1193ca2c46c1c6c6@mail.gmail.com> <20090213045440.GB21163@topoi.pooq.com> Message-ID: <756daca50902122157u64a97140k93e94c4bf1333275@mail.gmail.com> On Thu, Feb 12, 2009 at 10:54 PM, wrote: > On Thu, Feb 12, 2009 at 10:24:24PM -0600, Grant Rettke wrote: >> Why letrec is included when it would only work in a predictable manner >> when the s are lambda expressions? > > So you could use it in a predicatable manner for lambda expressions, of course. The thing I wonder is why, if it was only intended for lambda expressions, does it allow an example like the above? I am aware that I am not aware of some key bits here... From alexshinn at gmail.com Fri Feb 13 01:59:12 2009 From: alexshinn at gmail.com (Alex Shinn) Date: Thu Mar 26 02:40:50 2009 Subject: [plt-scheme] How is letrec different from letrec* in its use? In-Reply-To: (Shriram Krishnamurthi's message of "Thu\, 12 Feb 2009 23\:04\:55 -0500") References: <756daca50902121945r58b907agb3da62f0d3c7f24@mail.gmail.com> <63bb19ae0902121958y1abdfc6cy5dc00fbfa04f8fb4@mail.gmail.com> Message-ID: Shriram Krishnamurthi writes: > These threads (we had a recent flare-up about LOCAL, as > some might recall) point to the worst thing about Old > Scheme: not only did they leave the semantics undefined, > they ALSO didn't have the courtesy to provide a reference > compiler that actually produced unexpected output, thereby > compounding confusion (resulting in unknown unknowns). Where's the reference implementation that gets this right for R6RS? Neither plt-r6rs nor larceny signal an error. Ikarus signals the wrong error, but doesn't signal an error if you replace `+' with `cons'. -- Alex From robby at eecs.northwestern.edu Fri Feb 13 07:15:33 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Mar 26 02:40:50 2009 Subject: [plt-scheme] How is letrec different from letrec* in its use? In-Reply-To: References: <756daca50902121945r58b907agb3da62f0d3c7f24@mail.gmail.com> <63bb19ae0902121958y1abdfc6cy5dc00fbfa04f8fb4@mail.gmail.com> Message-ID: <932b2f1f0902130415i3121accdl90fb6030407ea0f4@mail.gmail.com> On Fri, Feb 13, 2009 at 12:59 AM, Alex Shinn wrote: > Shriram Krishnamurthi writes: > >> These threads (we had a recent flare-up about LOCAL, as >> some might recall) point to the worst thing about Old >> Scheme: not only did they leave the semantics undefined, >> they ALSO didn't have the courtesy to provide a reference >> compiler that actually produced unexpected output, thereby >> compounding confusion (resulting in unknown unknowns). > > Where's the reference implementation that gets this right > for R6RS? Neither plt-r6rs nor larceny signal an error. > Ikarus signals the wrong error, but doesn't signal an error > if you replace `+' with `cons'. The semantics is executable and covers this case. It produces an uncaught exception indicating that a letrec variable was touched Sam's expression. Robby From jcoglan at googlemail.com Fri Feb 13 07:35:37 2009 From: jcoglan at googlemail.com (James Coglan) Date: Thu Mar 26 02:40:50 2009 Subject: [plt-scheme] How is letrec different from letrec* in its use? In-Reply-To: <756daca50902121945r58b907agb3da62f0d3c7f24@mail.gmail.com> References: <756daca50902121945r58b907agb3da62f0d3c7f24@mail.gmail.com> Message-ID: > I just read the spec for both letrec and letrec* and I see that the > former is not evaluted in any other but the latter is evaluted from > left to right. I am not getting the difference in their use. May > someone please provide an illuminating example? I find it's helpful to expand (let) expressions as lambdas to see what's going on. It shows up how each variable is scoped and also shows where execution order is important. (let) simply makes a lambda in the current scope and calls it with the given arguments: (let ([x 1] [y 2]) (+ x y)) is equivalent to: ((lambda (x y) (+ x y)) 1 2) So the values of x,y are evaluated *outside* the scope of the lambda. (let*) is a shorthand for nesting (let)s, so each value is evaluated in the scope of the previous enclosing (let). Here execution order is important because each evaluation must have access to the value of the preceeding evaluations. (let* ([x 1] [y 2]) (+ x y)) is equivalent to: (let ([x 1]) (let ([y 2]) (+ x y))) (letrec) is like (let), but the evaluations take place *inside* the lambda, changing their scope. The evaluations are not supposed to depend on each other so evaluation order is not important (like for (let)). (letrec ([x 1] [y 2]) (+ x y)) is equivalent to: ((lambda () (define x 1) (define y 2) (+ x y))) Finally, (letrec*) is like (let*) but it uses (letrec). (letrec* ([x 1] [y 2]) (+ x y)) is equivalent to: (letrec ([x 1]) (letrec ([y 2]) (+ x y))) Hopefully you can see how if we replaced 1,2 in these examples with expressions, lambdas, etc, the differences in scoping affect the outcomes. (let*) and (letrec*) impose an evaluation order because they imply a fixed nesting order for scopes and thus affect the visibilty of variables within lambdas assigned to other variables. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090213/81f475a0/attachment.htm From robby at eecs.northwestern.edu Fri Feb 13 07:45:35 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Mar 26 02:40:51 2009 Subject: [plt-scheme] How is letrec different from letrec* in its use? In-Reply-To: References: <756daca50902121945r58b907agb3da62f0d3c7f24@mail.gmail.com> Message-ID: <932b2f1f0902130445y6205b05bw2a7d81595a9c5008@mail.gmail.com> While I don't see any mistakes in the specific equivalences below, there are not generalizable as suggested. For example, (letrec* ([x e1][y e2]) e3) is not the same as (letrec* ([x e1]) (letrec* ([x e2]) e3)) Let me encourage interested parties to try out the semantics to better understand letrec and letrec* It runs in PLT Redex, so you can see how examples behave. Robby On Fri, Feb 13, 2009 at 6:35 AM, James Coglan wrote: > >> I just read the spec for both letrec and letrec* and I see that the >> former is not evaluted in any other but the latter is evaluted from >> left to right. I am not getting the difference in their use. May >> someone please provide an illuminating example? > > I find it's helpful to expand (let) expressions as lambdas to see what's > going on. It shows up how each variable is scoped and also shows where > execution order is important. > > (let) simply makes a lambda in the current scope and calls it with the given > arguments: > > (let ([x 1] > [y 2]) > (+ x y)) > > is equivalent to: > > ((lambda (x y) > (+ x y)) > 1 2) > > So the values of x,y are evaluated *outside* the scope of the lambda. (let*) > is a shorthand for nesting (let)s, so each value is evaluated in the scope > of the previous enclosing (let). Here execution order is important because > each evaluation must have access to the value of the preceeding evaluations. > > (let* ([x 1] > [y 2]) > (+ x y)) > > is equivalent to: > > (let ([x 1]) > (let ([y 2]) > (+ x y))) > > (letrec) is like (let), but the evaluations take place *inside* the lambda, > changing their scope. The evaluations are not supposed to depend on each > other so evaluation order is not important (like for (let)). > > (letrec ([x 1] > [y 2]) > (+ x y)) > > is equivalent to: > > ((lambda () > (define x 1) > (define y 2) > (+ x y))) > > Finally, (letrec*) is like (let*) but it uses (letrec). > > (letrec* ([x 1] > [y 2]) > (+ x y)) > > is equivalent to: > > (letrec ([x 1]) > (letrec ([y 2]) > (+ x y))) > > > Hopefully you can see how if we replaced 1,2 in these examples with > expressions, lambdas, etc, the differences in scoping affect the outcomes. > (let*) and (letrec*) impose an evaluation order because they imply a fixed > nesting order for scopes and thus affect the visibilty of variables within > lambdas assigned to other variables. > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From eviertel at gmail.com Fri Feb 13 07:51:00 2009 From: eviertel at gmail.com (e) Date: Thu Mar 26 02:40:51 2009 Subject: [plt-scheme] newbie: web server tutorial questions In-Reply-To: References: Message-ID: disregard. was having trouble posting before. On Thu, Feb 12, 2009 at 8:38 AM, e wrote: > http://docs.plt-scheme.org/continue/index.html > > On that note. I'm having trouble: > regarding the end of: http://docs.plt-scheme.org/continue/index.html, > just before the https section, > > I did: > > mzscheme -t blog.ss > blog.ss:150:33: compile: unbound identifier in module in: path > > sooooooo, is supposed to be the same value as > "APPLICATION.ss", and are both of these supposed to be the place the > application code was getting cut and past? Are all the ss files > supposed to reside in a servlets folder? and is > > #:servlet-path "/servlets/APPLICATION.ss" > > a relative path to htdocs? > > and in > > (list (build-path path "htdocs")) > > is htdocs relative to where you run the mzscheme command? > > Thanks. > _________________________________________________ > 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/20090213/c3dd3528/attachment.html From jboadas at gmail.com Fri Feb 13 08:46:48 2009 From: jboadas at gmail.com (Jesus Boadas) Date: Thu Mar 26 02:40:51 2009 Subject: [plt-scheme] Newbie Lambda( ) (???????????) Message-ID: <8C311BF9-6308-4357-96F6-6D1F983130D9@gmail.com> Hello everybody I am a very very newbie in functional and scheme programming, Im an imperative programmer since 1989, following the tutorials in the Plt- Scheme I cant get a clue in this: (define (serve port-no) (define listener (tcp-listen port-no 5 #t)) (define (loop) (accept-and-handle listener) (loop)) (define t (thread loop)) (lambda () (kill-thread t) (tcp-close listener))) and > (define stop (serve 8081)) I simply cant see the relation between stop and lambda(), lambda() is inside the function serve and stop is outside serve, where is the logic of this ? Im very sorry for this dumb question but I will apreciate your help to understand this lambda stuff, if anyone can point me into a reference, a book, a tutorial, anything. Also I apologise for errors in this email because english is not my mother language. Best Regards. From noelwelsh at gmail.com Fri Feb 13 09:22:53 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:40:52 2009 Subject: [plt-scheme] Newbie Lambda( ) (???????????) In-Reply-To: <8C311BF9-6308-4357-96F6-6D1F983130D9@gmail.com> References: <8C311BF9-6308-4357-96F6-6D1F983130D9@gmail.com> Message-ID: On Fri, Feb 13, 2009 at 1:46 PM, Jesus Boadas wrote: The value returned by the function serve is the value of the expression (lambda () (kill-thread t) (tcp-close listener)) This is a function (with no name). This function is bound to the name stop by the expression >> (define stop (serve 8081)) HTH, Noel From jboadas at gmail.com Fri Feb 13 13:35:06 2009 From: jboadas at gmail.com (Jesus Boadas) Date: Thu Mar 26 02:40:52 2009 Subject: [plt-scheme] Newbie Lambda( ) (???????????) In-Reply-To: <52D7DE59-B39C-48F4-935D-DB00210E4DA7@adelphi.edu> References: <8C311BF9-6308-4357-96F6-6D1F983130D9@gmail.com> <52D7DE59-B39C-48F4-935D-DB00210E4DA7@adelphi.edu> Message-ID: <949DBC39-5EB3-4311-9738-E87CCAE7E6F6@gmail.com> Thanks I understand now, this is new to me. My usual functions only return values, never could imagine that a function could return a function, I was doing some research and this is called higher order functions or I am in a mistake?. El 13/02/2009, a las 12:58 p.m., Stephen Bloch escribi?: > > On Feb 13, 2009, at 8:46 AM, Jesus Boadas wrote: > >> I am a very very newbie in functional and scheme programming, Im an >> imperative programmer since 1989, following the tutorials in the >> Plt-Scheme I cant get a clue in this: >> >> (define (serve port-no) >> (define listener (tcp-listen port-no 5 #t)) >> (define (loop) >> (accept-and-handle listener) >> (loop)) >> (define t (thread loop)) >> (lambda () >> (kill-thread t) >> (tcp-close listener))) >> >> and >> >> > (define stop (serve 8081)) >> >> >> I simply cant see the relation between stop and lambda(), lambda() >> is inside the function serve and stop is outside serve, where is >> the logic of this ? > > The neat idea of this example, one which you may not have > encountered outside functional programming, is that a function can > take in and return not only ordinary data types, but functions. > This one in particular returns a function as its value. > > A simpler example: > (define (make-adder n) > (lambda (m) (+ m n))) > (define add3 (make-adder 3)) > (add3 12) "should be 15" > (map add3 (list 1 2 3 4 5)) "should be (list 4 5 6 7 8)" > > (define (add-to-each num nums) > (map (make-adder num) nums)) > (add-to-each 5 (list 10 20 30 40 50)) "should be (list 15 25 35 45 > 55)" > > Make sure you understand why this all works, and then the client/ > server example will make more sense. > > > Stephen Bloch > sbloch@adelphi.edu > From carl.eastlund at gmail.com Fri Feb 13 14:13:31 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Thu Mar 26 02:40:52 2009 Subject: [plt-scheme] Newbie Lambda( ) (???????????) In-Reply-To: <949DBC39-5EB3-4311-9738-E87CCAE7E6F6@gmail.com> References: <8C311BF9-6308-4357-96F6-6D1F983130D9@gmail.com> <52D7DE59-B39C-48F4-935D-DB00210E4DA7@adelphi.edu> <949DBC39-5EB3-4311-9738-E87CCAE7E6F6@gmail.com> Message-ID: <990e0c030902131113w281057f0s9eeb6cd9c0e37ab2@mail.gmail.com> On Fri, Feb 13, 2009 at 1:35 PM, Jesus Boadas wrote: > Thanks I understand now, this is new to me. My usual functions only return > values, never could imagine that a function could return a function Functions can, indeed, return functions. In fact, functions themselves are values, so your function that returns a function is still returning a value. It just happens to be a more interesting value than a number or a string. > I was doing some research and this is called higher order functions or I am in a > mistake?. That is correct. Higher order functions are functions whose inputs and/or outputs are also functions. They are commonplace in Scheme and many similar programming languages. --Carl From matthias at ccs.neu.edu Fri Feb 13 14:23:12 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:40:52 2009 Subject: [plt-scheme] Newbie Lambda( ) (???????????) In-Reply-To: <990e0c030902131113w281057f0s9eeb6cd9c0e37ab2@mail.gmail.com> References: <8C311BF9-6308-4357-96F6-6D1F983130D9@gmail.com> <52D7DE59-B39C-48F4-935D-DB00210E4DA7@adelphi.edu> <949DBC39-5EB3-4311-9738-E87CCAE7E6F6@gmail.com> <990e0c030902131113w281057f0s9eeb6cd9c0e37ab2@mail.gmail.com> Message-ID: Jesus, just to make sure. In case you have studied calculus, functions returning functions is very old. For example, d/dx : (Real -> Real) -> (Real -> Real) Conventional mathematicians, though, tend to be afraid of the concept and therefore call these things 'operators' and 'functionals' and other hideous names. Now you are ahead of these people. You have taken the first step to a land where all this is easy to understand, normal, and .. HIGHLY PRODUCTIVE. (Think callbacks for GUIs and such stuff.) -- Matthias On Feb 13, 2009, at 2:13 PM, Carl Eastlund wrote: > On Fri, Feb 13, 2009 at 1:35 PM, Jesus Boadas > wrote: >> Thanks I understand now, this is new to me. My usual functions >> only return >> values, never could imagine that a function could return a function > > Functions can, indeed, return functions. In fact, functions > themselves are values, so your function that returns a function is > still returning a value. It just happens to be a more interesting > value than a number or a string. > >> I was doing some research and this is called higher order >> functions or I am in a >> mistake?. > > That is correct. Higher order functions are functions whose inputs > and/or outputs are also functions. They are commonplace in Scheme and > many similar programming languages. > > --Carl > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From jos.koot at telefonica.net Fri Feb 13 14:38:19 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:40:52 2009 Subject: [plt-scheme] Newbie Lambda( ) (???????????) References: <8C311BF9-6308-4357-96F6-6D1F983130D9@gmail.com><52D7DE59-B39C-48F4-935D-DB00210E4DA7@adelphi.edu><949DBC39-5EB3-4311-9738-E87CCAE7E6F6@gmail.com><990e0c030902131113w281057f0s9eeb6cd9c0e37ab2@mail.gmail.com> Message-ID: ----- Original Message ----- From: "Matthias Felleisen" To: "Carl Eastlund" Cc: Sent: Friday, February 13, 2009 8:23 PM Subject: Re: [plt-scheme] Newbie Lambda( ) (???????????) > > Jesus, just to make sure. In case you have studied calculus, functions > returning functions is very old. For example, > > d/dx : (Real -> Real) -> (Real -> Real) > > Conventional mathematicians, though, tend to be afraid of the concept and > therefore call these things 'operators' and 'functionals' and other > hideous names. If, as you say, mathematiciens use other names for the concept, that does not imply they are afraid of the concept. Ever heard of tensor operators in quantum mechanics? Did you ever see the beautiful graphical algebra of Yutsis and El Baz? I am inclined to disagree on this point. Mho, Jos > > Now you are ahead of these people. You have taken the first step to a > land where all this is easy to understand, normal, and > > .. HIGHLY PRODUCTIVE. > > (Think callbacks for GUIs and such stuff.) > > -- Matthias > > > > > > > > On Feb 13, 2009, at 2:13 PM, Carl Eastlund wrote: > >> On Fri, Feb 13, 2009 at 1:35 PM, Jesus Boadas wrote: >>> Thanks I understand now, this is new to me. My usual functions only >>> return >>> values, never could imagine that a function could return a function >> >> Functions can, indeed, return functions. In fact, functions >> themselves are values, so your function that returns a function is >> still returning a value. It just happens to be a more interesting >> value than a number or a string. >> >>> I was doing some research and this is called higher order functions or >>> I am in a >>> mistake?. >> >> That is correct. Higher order functions are functions whose inputs >> and/or outputs are also functions. They are commonplace in Scheme and >> many similar programming languages. >> >> --Carl >> _________________________________________________ >> 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 adityashukla1983 at gmail.com Fri Feb 13 15:05:39 2009 From: adityashukla1983 at gmail.com (aditya shukla) Date: Thu Mar 26 02:40:53 2009 Subject: [plt-scheme] Understanding lambda Message-ID: <73045cca0902131205w6181f394r43018d0d3599060d@mail.gmail.com> I am trying to understand lambda and i have a question. Suppose (define f (lambda(x) (+(* 3 x) 5))) Now i have read and heard that lambda is used to define unnamed functions now , i am confused about the value of f ie will it be equal to the function returned by (lambda(x) (+(* 3 x) 5)) or will be equal to the value which is computed for any value of x ie if x =1 then f =8.Any help is appreciated. Thanks in advance Aditya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090213/7e7eefda/attachment.htm From czhu at cs.utah.edu Fri Feb 13 15:14:03 2009 From: czhu at cs.utah.edu (Chongkai Zhu) Date: Thu Mar 26 02:40:53 2009 Subject: [plt-scheme] Understanding lambda In-Reply-To: <73045cca0902131205w6181f394r43018d0d3599060d@mail.gmail.com> References: <73045cca0902131205w6181f394r43018d0d3599060d@mail.gmail.com> Message-ID: <4995D48B.3090308@cs.utah.edu> aditya shukla wrote: > I am trying to understand lambda and i have a question. > > Suppose (define f (lambda(x) (+(* 3 x) 5))) > > Now i have read and heard that lambda is used to define unnamed > functions now , i am confused about the value of f > ie will it be equal to the function returned by (lambda(x) (+(* 3 x) > 5)) or will be equal to the value which is computed for any value of x > ie if x =1 then f =8.Any help is appreciated. > The first case, the function returned by (lambda(x) (+(* 3 x) 5)). Chongkai > Thanks in advance > > Aditya > > ------------------------------------------------------------------------ > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From cce at ccs.neu.edu Fri Feb 13 15:12:53 2009 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:40:54 2009 Subject: [plt-scheme] Understanding lambda In-Reply-To: <73045cca0902131205w6181f394r43018d0d3599060d@mail.gmail.com> References: <73045cca0902131205w6181f394r43018d0d3599060d@mail.gmail.com> Message-ID: <990e0c030902131212u4a625c4bvfe0482311596e167@mail.gmail.com> On Fri, Feb 13, 2009 at 3:05 PM, aditya shukla wrote: > I am trying to understand lambda and i have a question. > > Suppose (define f (lambda(x) (+(* 3 x) 5))) > > Now i have read and heard that lambda is used to define unnamed functions > now , i am confused about the value of f > ie will it be equal to the function returned by (lambda(x) (+(* 3 x) 5)) or > will be equal to the value which is computed for any value of x ie if x =1 > then f =8.Any help is appreciated. As you say, lambda is used to define functions without giving them a name. The define form, on the other hand, gives things names. So (define f (lambda ...)) is just a function with a name. Hence, your first hypothesis was correct. If you inspect your second hypothesis closely, you will see that it cannot work that way. You conjecture that the value of f may depend on the value of x. However, you have not provided a value for x yet... so what value does f have? You've defined it, so it must have some value. You have not defined x yet; as x has no value, but f does have a value, f's value cannot depend on x. In your definition, f is a function, and that function never changes. The result of applying that function does change, however, depending on what value you apply it to. (f 1) = 8 (f 2) = 11 (f 1000) = 3005 and so on. I hope this clarifies the matter for you. -- Carl Eastlund From adityashukla1983 at gmail.com Fri Feb 13 15:21:50 2009 From: adityashukla1983 at gmail.com (aditya shukla) Date: Thu Mar 26 02:40:54 2009 Subject: [plt-scheme] Understanding lambda In-Reply-To: <990e0c030902131212u4a625c4bvfe0482311596e167@mail.gmail.com> References: <73045cca0902131205w6181f394r43018d0d3599060d@mail.gmail.com> <990e0c030902131212u4a625c4bvfe0482311596e167@mail.gmail.com> Message-ID: <73045cca0902131221tbcc0dd4xffda5e628250490@mail.gmail.com> I think i got it now , just one more simple thing comes to my mind.In this case can i say that f is a function with parameter x and body 3x+5? Aditya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090213/58ac4f33/attachment.html From neil at neilvandyke.org Fri Feb 13 15:21:46 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:40:54 2009 Subject: [plt-scheme] Understanding lambda In-Reply-To: <73045cca0902131205w6181f394r43018d0d3599060d@mail.gmail.com> References: <73045cca0902131205w6181f394r43018d0d3599060d@mail.gmail.com> Message-ID: <4995D65A.8060804@neilvandyke.org> aditya shukla wrote at 02/13/2009 03:05 PM: > I am trying to understand lambda and i have a question. Remember you have DrScheme, and can experiment: Welcome to DrScheme, version 4.1.4 [3m]. Language: Module; memory limit: 128 megabytes. > (define f (lambda(x) (+(* 3 x) 5))) > f # > (f 2) 11 > From jos.koot at telefonica.net Fri Feb 13 15:23:56 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:40:55 2009 Subject: [plt-scheme] Understanding lambda References: <73045cca0902131205w6181f394r43018d0d3599060d@mail.gmail.com> Message-ID: Equality is a very tedious thing to define. But replacing f by (lambda(x) (+(* 3 x) 5))) does produce the same results (normally (i.e. if. for example `'lamda' is not redefined)) In mathematics two functions are connsidered to be the same if they produce the same results for the same arguments (which already presuposes an equality relation). In Scheme, this concept is somewhat more complicated because it cannot always be proven whether or not two functions always produce the same results when given the same arguments. Because of the difficulty of deciding when two functuions are the same, we have for example: (equal? (lambda (x) x) (lambda (x) x)) --> #f, whereas a mathematicean probably would ansewer `yes'. Jos ----- Original Message ----- From: aditya shukla To: plt-scheme@list.cs.brown.edu Sent: Friday, February 13, 2009 9:05 PM Subject: [plt-scheme] Understanding lambda I am trying to understand lambda and i have a question. Suppose (define f (lambda(x) (+(* 3 x) 5))) Now i have read and heard that lambda is used to define unnamed functions now , i am confused about the value of f ie will it be equal to the function returned by (lambda(x) (+(* 3 x) 5)) or will be equal to the value which is computed for any value of x ie if x =1 then f =8.Any help is appreciated. Thanks in advance Aditya ------------------------------------------------------------------------------ _________________________________________________ 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/20090213/ac834872/attachment.htm From adityashukla1983 at gmail.com Fri Feb 13 15:32:39 2009 From: adityashukla1983 at gmail.com (aditya shukla) Date: Thu Mar 26 02:40:56 2009 Subject: [plt-scheme] Understanding lambda In-Reply-To: References: <73045cca0902131205w6181f394r43018d0d3599060d@mail.gmail.com> Message-ID: <73045cca0902131232r21fafbewb2e4d54598d4774d@mail.gmail.com> Thanks for the help guys , so now i know that in (define f (lambda(x) (+(* 3 x) 5))) value of f is a function returned by the lambda expressions.so when i do ( f 1) or anything as in (f 55) then what are 1 or 55 in this expression , constants or functions? Aditya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090213/fc87eac9/attachment.html From grettke at acm.org Fri Feb 13 15:34:02 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:40:56 2009 Subject: [plt-scheme] Understanding lambda In-Reply-To: <73045cca0902131205w6181f394r43018d0d3599060d@mail.gmail.com> References: <73045cca0902131205w6181f394r43018d0d3599060d@mail.gmail.com> Message-ID: <756daca50902131234o5c006e2bm2cdbbb2ffcd27e95@mail.gmail.com> On Fri, Feb 13, 2009 at 2:05 PM, aditya shukla wrote: > I am trying to understand lambda and i have a question. > > Suppose (define f (lambda(x) (+(* 3 x) 5))) > > Now i have read and heard that lambda is used to define unnamed functions > now , i am confused about the value of f > ie will it be equal to the function returned by (lambda(x) (+(* 3 x) 5)) or > will be equal to the value which is computed for any value of x ie if x =1 > then f =8.Any help is appreciated. 1. When you evaluate lambda it creates an object which is a procedure that binds the operand to x and then triples it and adds 5: (lambda (x) (+ (* 3 x) 5)). If you evaluate that in the repl you will see that a function object got created. 2. When you say (define f (lambda (x) (+ (* 3 x) 5))) you are saying that "f" is name which is bound to a location, and that location has a value, and the value is the function object that you just created. When you ask if f is equal to the function object you just created, no it can't be; because f is just a name bound to a location that stores a value. To your second point, the value stored in the location to which f is bound will only change if you do so intentionally, because whey you say (f 1) you are really just applying 1 to the function object stored in the value of the location referred to by f. From grettke at acm.org Fri Feb 13 15:42:19 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:40:56 2009 Subject: [plt-scheme] Understanding lambda In-Reply-To: <73045cca0902131232r21fafbewb2e4d54598d4774d@mail.gmail.com> References: <73045cca0902131205w6181f394r43018d0d3599060d@mail.gmail.com> <73045cca0902131232r21fafbewb2e4d54598d4774d@mail.gmail.com> Message-ID: <756daca50902131242q2d81b5d6n1d629640eb6c8ae3@mail.gmail.com> > Thanks for the help guys , so now i know that in (define f (lambda(x) (+(* > 3 x) 5))) value of f is a function returned by the lambda expressions.so > when i do ( f 1) or anything as in (f 55) then what are 1 or 55 in this > expression , constants or functions? You can play around with some stuff in the REPL: > (procedure? 1) #f > (procedure? f) #t > (number? 1) #t > (number? f) #f From dvanhorn at ccs.neu.edu Fri Feb 13 15:48:05 2009 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Thu Mar 26 02:40:56 2009 Subject: [plt-scheme] Understanding lambda In-Reply-To: <4995D65A.8060804@neilvandyke.org> References: <73045cca0902131205w6181f394r43018d0d3599060d@mail.gmail.com> <4995D65A.8060804@neilvandyke.org> Message-ID: <4995DC85.40408@ccs.neu.edu> Neil Van Dyke wrote: > aditya shukla wrote at 02/13/2009 03:05 PM: >> I am trying to understand lambda and i have a question. > > Remember you have DrScheme, and can experiment: > > Welcome to DrScheme, version 4.1.4 [3m]. > Language: Module; memory limit: 128 megabytes. > > (define f (lambda(x) (+(* 3 x) 5))) > > f > # > > (f 2) > 11 > > Let me second Neil's recommendation to experiment. Make some examples and try to predict how they are computed. For more fine grained experiments, I suggest using the Intermediate Student with lambda language; you can use the Stepper to see each step of the computation. Try to predict which piece of the program will step, and how it will step. If you can do this consistently and fluently, you understand. David From jos.koot at telefonica.net Fri Feb 13 15:48:54 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:40:57 2009 Subject: [plt-scheme] Understanding lambda References: <73045cca0902131205w6181f394r43018d0d3599060d@mail.gmail.com> <73045cca0902131232r21fafbewb2e4d54598d4774d@mail.gmail.com> Message-ID: <0740B0226A07472487D6CC977C1D9809@uw2b2dff239c4d> As far as I know the concept of `consant' is not defined in scheme. But 1 and 55 definitiley are (representations of) values (in fact self evaluating values, that is to say, the value of 55 is 55, whereas the value of say 'a-variable-name' can be anything from undefined to a very well defined value) Jos ----- Original Message ----- From: aditya shukla To: Jos Koot Cc: plt-scheme@list.cs.brown.edu Sent: Friday, February 13, 2009 9:32 PM Subject: Re: [plt-scheme] Understanding lambda Thanks for the help guys , so now i know that in (define f (lambda(x) (+(* 3 x) 5))) value of f is a function returned by the lambda expressions.so when i do ( f 1) or anything as in (f 55) then what are 1 or 55 in this expression , constants or functions? Aditya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090213/e0ef468e/attachment.htm From grettke at acm.org Fri Feb 13 15:57:17 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:40:57 2009 Subject: [plt-scheme] Understanding lambda In-Reply-To: <0740B0226A07472487D6CC977C1D9809@uw2b2dff239c4d> References: <73045cca0902131205w6181f394r43018d0d3599060d@mail.gmail.com> <73045cca0902131232r21fafbewb2e4d54598d4774d@mail.gmail.com> <0740B0226A07472487D6CC977C1D9809@uw2b2dff239c4d> Message-ID: <756daca50902131257h5fb39addh70f39ea5b24e79fa@mail.gmail.com> > As far as I know the concept of `consant' is not defined in scheme. But 1 > and 55 definitiley are (representations of) values (in fact self evaluating > values, that is to say, the value of 55 is 55, whereas the value of say > 'a-variable-name' can be anything from undefined to a very well defined > value) It is easier to say that "55 is 55", but in reality you have to take into acount the evaluation model, and in consequence say that 55 is self-evaluating because it is a core object type that is not a procedure, and that when you type in 55 you really aren't typing 55 as far as the interpreter is concerned you are just typing in the external representation of 55. Did I get that right? I didn't follow the HtDP or TSPL approach to learning Scheme initially and I suspect it made the process more painful as a result. From carl.eastlund at gmail.com Fri Feb 13 16:07:48 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Thu Mar 26 02:40:57 2009 Subject: [plt-scheme] Understanding lambda In-Reply-To: <73045cca0902131232r21fafbewb2e4d54598d4774d@mail.gmail.com> References: <73045cca0902131205w6181f394r43018d0d3599060d@mail.gmail.com> <73045cca0902131232r21fafbewb2e4d54598d4774d@mail.gmail.com> Message-ID: <990e0c030902131307m49c44ab3gd11b8ae652507a28@mail.gmail.com> On Fri, Feb 13, 2009 at 3:32 PM, aditya shukla wrote: > Thanks for the help guys , so now i know that in (define f (lambda(x) (+(* > 3 x) 5))) value of f is a function returned by the lambda expressions.so > when i do ( f 1) or anything as in (f 55) then what are 1 or 55 in this > expression , constants or functions? I think whether or not 1 and 55 are constants is kind of beside the point... one could consider (lambda (x) (+ (* 3 x) 5)) a constant, too. (I won't go into why, I think at this point it would just be confusing.) The important thing is that they are all expressions, they all produce values, but 1 and 55 produce numbers and the lambda expression produces a function. The important distinction between them is the kind of data they produce. -- Carl Eastlund From adityashukla1983 at gmail.com Fri Feb 13 16:21:01 2009 From: adityashukla1983 at gmail.com (aditya shukla) Date: Thu Mar 26 02:40:58 2009 Subject: [plt-scheme] Using stepper Message-ID: <73045cca0902131321l1c841b51xaa794a8c1b04e609@mail.gmail.com> I am trying to use stepper to see how the code works , i am in interactive student with lambda language and i have made a file eg1.ss define g (lambda(x)(+ x 1))) .When i open it in stepper and click on step nothing except i just get All of the definitions have been successfully evaluated.This is maybe a very silly question but any help is appreciated. Aditya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090213/b572d571/attachment.html From dvanhorn at ccs.neu.edu Fri Feb 13 16:42:14 2009 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Thu Mar 26 02:40:58 2009 Subject: [plt-scheme] Using stepper In-Reply-To: <73045cca0902131321l1c841b51xaa794a8c1b04e609@mail.gmail.com> References: <73045cca0902131321l1c841b51xaa794a8c1b04e609@mail.gmail.com> Message-ID: <4995E936.7010103@ccs.neu.edu> aditya shukla wrote: > I am trying to use stepper to see how the code works , i am in > interactive student with lambda language and i have made a file eg1.ss > define g (lambda(x)(+ x 1))) .When i open it in stepper and click on > step nothing except i just get All of the definitions have been > successfully evaluated.This is maybe a very silly question but any help > is appreciated. This program doesn't do any computation, it only names a value, so there are no steps to be made. Try using g to see some computation: (define g (lambda (x) (+ x 1)) g (g 6) (+ (g 2) (g 3)) David From sbloch at adelphi.edu Fri Feb 13 16:42:43 2009 From: sbloch at adelphi.edu (Stephen Bloch) Date: Thu Mar 26 02:40:58 2009 Subject: [BULK] [plt-scheme] Using stepper In-Reply-To: <73045cca0902131321l1c841b51xaa794a8c1b04e609@mail.gmail.com> References: <73045cca0902131321l1c841b51xaa794a8c1b04e609@mail.gmail.com> Message-ID: <92AEF2E9-EE72-4E53-A853-454CCCA13415@adelphi.edu> On Feb 13, 2009, at 4:21 PM, aditya shukla wrote: > I am trying to use stepper to see how the code works , i am in > interactive student with lambda language and i have made a file eg1.ss > define g (lambda(x)(+ x 1))) .When i open it in stepper and click > on step nothing except i just get All of the definitions have been > successfully evaluated.This is maybe a very silly question but any > help is appreciated. Perhaps the confusion is that the word "lambda" appears just after a left parenthesis as though it were a function like "+" or "sqrt", so one might be tempted to think of "lambda" as the name of a function. But it is NOT a function; it's a notation for a particular kind of literal. 5 is a literal number. It doesn't "stand for" anything else. You could store it in a variable, e.g. (define age 5), or you can just use it by itself, e.g. (+ 3 5). "hello" is a literal string. It doesn't "stand for" anything else. You could store it in a variable, e.g. (define greeting "hello"), or you can just use it by itself, e.g. (string-length "hello"). 'bluebird is a literal symbol. It doesn't "stand for" anything else. You could store it in a variable, e.g. (define bird 'bluebird), or you can just use it by itself, e.g. (symbol=? pet 'bluebird). (lambda (x) (+ x 1)) is a literal function. It doesn't "stand for" anything else. You could store it in a variable, e.g. (define g (lambda (x) (+ x 1)), or you can just use it by itself, e.g. ((lambda (x) (+ x 1)) 4). If you wrote (define g (lambda (x) (+ x 1))) (g 4) and hit "Step" in the Stepper, the first step would be replacing the variable name "g" in the last line with its value "(lambda (x) (+ x 1))", the second step would be replacing "((lambda (x) (+ x 1)) 4)" with "(+ 4 1)", and the third step would be replacing "(+ 4 1)" with "5". Stephen Bloch sbloch@adelphi.edu From morazanm at gmail.com Fri Feb 13 17:03:56 2009 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:40:58 2009 Subject: [plt-scheme] Newbie Lambda( ) (???????????) In-Reply-To: <949DBC39-5EB3-4311-9738-E87CCAE7E6F6@gmail.com> References: <8C311BF9-6308-4357-96F6-6D1F983130D9@gmail.com> <52D7DE59-B39C-48F4-935D-DB00210E4DA7@adelphi.edu> <949DBC39-5EB3-4311-9738-E87CCAE7E6F6@gmail.com> Message-ID: <9b1fff280902131403o66300a6fse3a199e985ded436@mail.gmail.com> On Fri, Feb 13, 2009 at 1:35 PM, Jesus Boadas wrote: > Thanks I understand now, this is new to me. My usual functions only return > values, never could imagine that a function could return a function, I was > doing some research and this is called higher order functions or I am in a > mistake?. > No, you are not. You are quite right. It is quite elegant, no? :-) Consider, now, a function, f, that returns a function as its value after being applied to a set of arguments. A nice way to think of such a function is as specialized-function generator. For example, consider the problem of creating functions (i.e. what you do when you write functions) that return a list with the results of adding a constant to every element of a list of numbers. You would like to write a function that takes as input a number (i.e. the constant to add) and that returns a function that takes as input a list of numbers and that returns a list by adding the given constant to every element of the list. The code for this could look something like this: ; make-list-adder: number --> (list-of-numbers --> list-of-numbers) (define (make-list-adder n) ; add: number --> number (define (add m) (+ n m)) ; add-n-to-list: list-of-numbers --> list-of-numbers (define (add-n-to-list lon) (map add lon)) add-n-to-list) Every time make-list-adder is applied to an argument it returns a function for which n is fixed. We can now, for example, define functions to add 1 and to add 5 to every element of a list of numbers without having to explicitly write code (in the conventional sense): (define add-1-to-list (make-list-adder 1)) (define add-5-to-list (make-list-adder 5)) The above definitions should illustrate that we have not written the code for neither add-1-to-list nor add-5-to-list in the conventional sense, but yet we have functions we can use! (add-1-to-list (list 1 2 3)) = (list 2 3 4) (add-5-to-list (list 1 2 3)) = (list 6 7 8) By writing one abstract function, we have the power to define a whole class of functions. I hope this gives you an appetite to learn more about HOFs. -- Cheers, Marco From morazanm at gmail.com Fri Feb 13 17:28:49 2009 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:40:59 2009 Subject: [plt-scheme] Understanding lambda In-Reply-To: <73045cca0902131232r21fafbewb2e4d54598d4774d@mail.gmail.com> References: <73045cca0902131205w6181f394r43018d0d3599060d@mail.gmail.com> <73045cca0902131232r21fafbewb2e4d54598d4774d@mail.gmail.com> Message-ID: <9b1fff280902131428w7f25cb2du547133feec12f49e@mail.gmail.com> On Fri, Feb 13, 2009 at 3:32 PM, aditya shukla wrote: > Thanks for the help guys , so now i know that in (define f (lambda(x) (+(* > 3 x) 5))) value of f is a function returned by the lambda expressions. What is f? f is a function with one parameter called x. > so > when i do ( f 1) or anything as in (f 55) then what are 1 or 55 in this > expression , constants or functions? > 1 and 55 are the values of x for the two different applications of f to an argument (i.e. (f 1) and (f 55)). When you apply f to 1 (i.e. (f 1) ), x takes the value of 1. When you apply f to 5 (i.e. (f 55) ), x takes the value of 55. Forget Scheme syntax for a second. f(x) = 3x + 5 Consider f(1) and f(55). I hope that clears it up. -- Cheers, Marco From dougorleans at gmail.com Fri Feb 13 17:56:08 2009 From: dougorleans at gmail.com (Doug Orleans) Date: Thu Mar 26 02:40:59 2009 Subject: [plt-scheme] Where is tex2page.sty? Message-ID: <2c17707e0902131456w51c8e1f7n75112c906977219d@mail.gmail.com> Where can I find tex2page.sty? It's not in collects/tex2page. I had a feeling I had asked this before, and a web search for tex2page.sty does turn up my name: http://www.cs.brown.edu/pipermail/plt-scheme/2003-August/003375.html I think it never got answered then; I probably just downloaded it from somewhere, because I know I've used it successfully since then. But shouldn't it be included with PLT Scheme? --dougorleans@gmail.com From jay.mccarthy at gmail.com Fri Feb 13 18:08:08 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:40:59 2009 Subject: [plt-scheme] Datalog in PLT Scheme Message-ID: I've just released a PLaneT package that adds Datalog as a language in DrScheme. It is called datalog.plt. http://planet.plt-scheme.org/display.ss?package=datalog.plt&owner=jaymccarthy Documentation is available online. http://planet.plt-scheme.org/package-source/jaymccarthy/datalog.plt/1/0/planet-docs/datalog/index.html In particular, check out the tutorial! http://planet.plt-scheme.org/package-source/jaymccarthy/datalog.plt/1/0/planet-docs/datalog/Tutorial.html Jay -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From jay.mccarthy at gmail.com Fri Feb 13 18:22:21 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:40:59 2009 Subject: [plt-scheme] newbie: web server tutorial questions In-Reply-To: References: Message-ID: Done! e, Glad to hear you think it is amazing. Let us know if you find anything that could be easier or more amazing. On Thu, Feb 12, 2009 at 7:42 PM, Shriram Krishnamurthi wrote: > Jay, given the tendency to copy-and-paste code, why not change "path" > to "your-path-goes-here" or something like that? And doing the same > in general in other parts of the docs? > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From grettke at acm.org Sat Feb 14 00:01:14 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:40:59 2009 Subject: [plt-scheme] How is letrec different from letrec* in its use? In-Reply-To: References: <756daca50902121945r58b907agb3da62f0d3c7f24@mail.gmail.com> Message-ID: <756daca50902132101p655ac2bdt48a0be445cd25741@mail.gmail.com> On Fri, Feb 13, 2009 at 6:35 AM, James Coglan wrote: >> I just read the spec for both letrec and letrec* and I see that the >> former is not evaluted in any other but the latter is evaluted from >> left to right. I am not getting the difference in their use. May >> someone please provide an illuminating example? > (letrec) is like (let), but the evaluations take place *inside* the lambda, > changing their scope. The evaluations are not supposed to depend on each > other so evaluation order is not important (like for (let)). > > (letrec ([x 1] > [y 2]) > (+ x y)) > > is equivalent to: > > ((lambda () > (define x 1) > (define y 2) > (+ x y))) This is how I interpreted its behavior from the spec: (define-syntax my-letrec (syntax-rules () ((_ ((var init) ...) body) (let ((var #f) ...) (set! var init) ... body)))) (my-letrec ((a (lambda (n) (when (< n 5) (b (add1 n))))) (b (lambda (n) (when (< n 5) (a (add1 n)))))) (a 0)) #;(let ((a #f) (b #f)) (set! a (lambda (n) (when (< n 5) (b (add1 n))))) (set! b (lambda (n) (when (< n 5) (a (add1 n))))) (a 0)) Are we saying the same thing? Is this right? > Finally, (letrec*) is like (let*) but it uses (letrec). > > (letrec* ([x 1] > [y 2]) > (+ x y)) > > is equivalent to: > > (letrec ([x 1]) > (letrec ([y 2]) > (+ x y))) I see. This allow for mutually recursive definitions; but as Sam said you can predict about behavior in situations when you are not *only* binding lambda expressions. I am wondering why would people use letrec for anything other than binding lambda expressions if it is impossible to reason about its behavior? Or rather, why would it allow anything other than lambda expressions to be bound if you can't predict the behavior? From chadestioco at gmail.com Sat Feb 14 00:24:31 2009 From: chadestioco at gmail.com (Andrei Estioco) Date: Thu Mar 26 02:41:00 2009 Subject: [plt-scheme] Math prerequisites for SICP In-Reply-To: <49944199.1080309@uwaterloo.ca> References: <49944199.1080309@uwaterloo.ca> Message-ID: Thanks. I'll work on my math and the math-HtDP first as Mr. Felleisen suggested. However, I would like to ask your opinon on another Scheme book. You see, along with HtDP and SICP, my computer science instructor used a book called *Concrete Abstractions*. He said that it can be used as an intermediary between HtDP and SICP. What's your opinion regarding *Concrete Abstractions*? Do you think it is possible for me to tackle that as well given my current mathematical background? Thanks in advance, -- Chad Estioco BS Computer Science University of the Philippines-Diliman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090214/ed58a299/attachment.htm From jos.koot at telefonica.net Sat Feb 14 06:48:52 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:41:00 2009 Subject: [plt-scheme] How is letrec different from letrec* in its use? References: <756daca50902121945r58b907agb3da62f0d3c7f24@mail.gmail.com> <756daca50902132101p655ac2bdt48a0be445cd25741@mail.gmail.com> Message-ID: According to the R6RS docs, (letrec* ([x 1] [y 2]) (+ x y)) is NOT equivalent to (letrec ([x 1]) (letrec ([y 2]) (+ x y))) It is equivalent with: (let ((x #f) (y #f)) (set! x 1) (set! y 2) (+ x y)) The difference between letrec and letrec* is that the letrec does not specify the order in which the values to be bound are evaluated and assigned, whereas letrec* does guarantee that the values are computed and assigned from left to right. Letrec* is not a nested letrec, whereas let* may be regarded as a nested let. Hence the correspondence between letrec and letrec* is quite different from that between let and let*. Notice that in PLT-scheme's letrec is like letrec*, but according to R6RS it might have been different as follows: (letrec ((x 1) (y 2)) (+ x y)) --> (let ((x undefined) (y undefined)) (let ((tempx 1) (tempy 2)) ; in arbitrary order (set! x tempx) (set! y tempy) ; in arbitrary order (+ x y))) and (letrec* ((x 1) (y 2)) (+ x y)) --> (let ((x undefined) (y undefined)) (set! x 1) (set! y 2) ; from left to right (+ x y)) Jos ----- Original Message ----- From: "Grant Rettke" To: "James Coglan" Cc: "PLT-Scheme List" Sent: Saturday, February 14, 2009 6:01 AM Subject: Re: [plt-scheme] How is letrec different from letrec* in its use? > On Fri, Feb 13, 2009 at 6:35 AM, James Coglan > wrote: >>> I just read the spec for both letrec and letrec* and I see that the >>> former is not evaluted in any other but the latter is evaluted from >>> left to right. I am not getting the difference in their use. May >>> someone please provide an illuminating example? > >> (letrec) is like (let), but the evaluations take place *inside* the >> lambda, >> changing their scope. The evaluations are not supposed to depend on each >> other so evaluation order is not important (like for (let)). >> >> (letrec ([x 1] >> [y 2]) >> (+ x y)) >> >> is equivalent to: >> >> ((lambda () >> (define x 1) >> (define y 2) >> (+ x y))) > > This is how I interpreted its behavior from the spec: > > (define-syntax my-letrec > (syntax-rules () > ((_ ((var init) ...) body) > (let ((var #f) ...) > (set! var init) ... > body)))) > > (my-letrec > ((a (lambda (n) (when (< n 5) (b (add1 n))))) > (b (lambda (n) (when (< n 5) (a (add1 n)))))) > (a 0)) > > #;(let ((a #f) > (b #f)) > (set! a (lambda (n) (when (< n 5) (b (add1 n))))) > (set! b (lambda (n) (when (< n 5) (a (add1 n))))) > (a 0)) > > Are we saying the same thing? Is this right? > >> Finally, (letrec*) is like (let*) but it uses (letrec). >> >> (letrec* ([x 1] >> [y 2]) >> (+ x y)) >> >> is equivalent to: >> >> (letrec ([x 1]) >> (letrec ([y 2]) >> (+ x y))) > > I see. This allow for mutually recursive definitions; but as Sam said > you can predict about behavior in situations when you are not *only* > binding lambda expressions. > > I am wondering why would people use letrec for anything other than > binding lambda expressions if it is impossible to reason about its > behavior? Or rather, why would it allow anything other than lambda > expressions to be bound if you can't predict the behavior? > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From matthias at ccs.neu.edu Sat Feb 14 08:13:44 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:41:00 2009 Subject: [plt-scheme] Math prerequisites for SICP In-Reply-To: References: <49944199.1080309@uwaterloo.ca> Message-ID: <408329E1-06C8-469D-AAD7-00FFCADBA92B@ccs.neu.edu> I don't know what intermediary would mean. HtDP is focused on function __design__ as a discipline, a notion that Hal and Gerry (the authors of SICP) explicitly reject. So would Concrete Abstractions reject it halfway? -- Matthias On Feb 14, 2009, at 12:24 AM, Andrei Estioco wrote: > > > Thanks. I'll work on my math and the math-HtDP first as Mr. > Felleisen suggested. However, I would like to ask your opinon on > another Scheme book. You see, along with HtDP and SICP, my computer > science instructor used a book called Concrete Abstractions. He > said that it can be used as an intermediary between HtDP and SICP. > > What's your opinion regarding Concrete Abstractions? Do you think > it is possible for me to tackle that as well given my current > mathematical background? > > Thanks in advance, > > -- > Chad Estioco > BS Computer Science > University of the Philippines-Diliman > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From mflatt at cs.utah.edu Sat Feb 14 08:41:13 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:41:00 2009 Subject: [plt-scheme] Where is tex2page.sty? In-Reply-To: <2c17707e0902131456w51c8e1f7n75112c906977219d@mail.gmail.com> References: <2c17707e0902131456w51c8e1f7n75112c906977219d@mail.gmail.com> Message-ID: <20090214134116.6535D6500B1@mail-svr1.cs.utah.edu> At Fri, 13 Feb 2009 17:56:08 -0500, Doug Orleans wrote: > Where can I find tex2page.sty? It's not in collects/tex2page. > > I had a feeling I had asked this before, and a web search for > tex2page.sty does turn up my name: > > http://www.cs.brown.edu/pipermail/plt-scheme/2003-August/003375.html > > I think it never got answered then; I probably just downloaded it from > somewhere, because I know I've used it successfully since then. But > shouldn't it be included with PLT Scheme? Yes --- I've added it to the collection. From hendrik at topoi.pooq.com Sat Feb 14 07:47:11 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:41:00 2009 Subject: [plt-scheme] How is letrec different from letrec* in its use? In-Reply-To: <756daca50902132101p655ac2bdt48a0be445cd25741@mail.gmail.com> References: <756daca50902121945r58b907agb3da62f0d3c7f24@mail.gmail.com> <756daca50902132101p655ac2bdt48a0be445cd25741@mail.gmail.com> Message-ID: <20090214124711.GA23634@topoi.pooq.com> On Fri, Feb 13, 2009 at 11:01:14PM -0600, Grant Rettke wrote: > On Fri, Feb 13, 2009 at 6:35 AM, James Coglan wrote: > >> I just read the spec for both letrec and letrec* and I see that the > >> former is not evaluted in any other but the latter is evaluted from > >> left to right. I am not getting the difference in their use. May > >> someone please provide an illuminating example? > > > (letrec) is like (let), but the evaluations take place *inside* the lambda, > > changing their scope. The evaluations are not supposed to depend on each > > other so evaluation order is not important (like for (let)). > > > > (letrec ([x 1] > > [y 2]) > > (+ x y)) > > > > is equivalent to: > > > > ((lambda () > > (define x 1) > > (define y 2) > > (+ x y))) > > This is how I interpreted its behavior from the spec: > > (define-syntax my-letrec > (syntax-rules () > ((_ ((var init) ...) body) > (let ((var #f) ...) > (set! var init) ... > body)))) > > (my-letrec > ((a (lambda (n) (when (< n 5) (b (add1 n))))) > (b (lambda (n) (when (< n 5) (a (add1 n)))))) > (a 0)) > > #;(let ((a #f) > (b #f)) > (set! a (lambda (n) (when (< n 5) (b (add1 n))))) > (set! b (lambda (n) (when (< n 5) (a (add1 n))))) > (a 0)) > > Are we saying the same thing? Is this right? > > > Finally, (letrec*) is like (let*) but it uses (letrec). > > > > (letrec* ([x 1] > > [y 2]) > > (+ x y)) > > > > is equivalent to: > > > > (letrec ([x 1]) > > (letrec ([y 2]) > > (+ x y))) > > I see. This allow for mutually recursive definitions; but as Sam said > you can predict about behavior in situations when you are not *only* > binding lambda expressions. > > I am wondering why would people use letrec for anything other than > binding lambda expressions if it is impossible to reason about its > behavior? Or rather, why would it allow anything other than lambda > expressions to be bound if you can't predict the behavior? Might there be constructions like (letrec ([f (cons (lambda() foo) (lambda() bar))] [foo (lambda() ...f...)] [bar ...] ) ) -- hendrik From jos.koot at telefonica.net Sat Feb 14 09:33:07 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:41:01 2009 Subject: [plt-scheme] How is letrec different from letrec* in its use? References: <756daca50902121945r58b907agb3da62f0d3c7f24@mail.gmail.com><756daca50902132101p655ac2bdt48a0be445cd25741@mail.gmail.com> <20090214124711.GA23634@topoi.pooq.com> Message-ID: <42A602EFE17C49A49398ACF90FFFAC8D@uw2b2dff239c4d> ----- Original Message ----- From: snip> > Might there be constructions like > > (letrec ([f (cons (lambda() foo) (lambda() bar))] > [foo (lambda() ...f...)] > [bar ...] > ) > ) > > -- hendrik Yes. Letrec (in R6RS) assumes that each value to be bound to a variable can be computed without reference to the value of any of the variables. However, the bindings are already available (although possibly without values being stored yet) Now consider: (letrec ((odd? (lambda (n) (and (not (zero? n)) (even? (- n 1)))) (even? (lambda (n) (or (zero? n) (odd? (- n 1)))))) (even? 5)) The two values to be bound are the values of the two lambda forms. The first one requires the binding (but not the value) of the second one and reversely. Compare this with: (letrec ((x 1) (y (add1 x))) (list x y)) R6RS does not specify the behaviour of this letrec form. It may be the case that (add1 x) is computed and hence the value of x is needed before x has received its value. That's why there is also letrec* (letrec* ((x 1) (y (+ x 1))) ; values computed and stored from left to right. (list x y)) ; correct --> (1 2) With this letrec* the value to be assigned to y may refer to the value of x (but not reversely!) We can rewrite let, let*, letrec and letrec* as follows: (let ((var value-expr) ...) definition ... body-expr ...) ==> ((lambda (var ...) definition ... body-expr ...) value-expr ...) (let* ((var1 value-expr1) (var1 value-expr1)) definition ... body-expr ...) ==> ((lambda (var1) ((lambda (var2) definition ... body-expr ...) value-expr2)) value-expr-1) (letrec ((var value-expr) ...) definition ... body-expr ...) ==> (let ((var undefined) ...) (let ((temp value-expr) ...) in arbitrary order (set! var temp) ... in arbitrary order (let ( ) definition ... body-expr ...))) (letrec* ((var value-expr) ...) definition ... body-expr ...) ==> (let ((var undefined) ...) (set! var value-expr) ... from left tio right (let ( ) definition ... body-expr ...)) Jos > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From anesward at mac.com Sat Feb 14 11:22:48 2009 From: anesward at mac.com (mike) Date: Thu Mar 26 02:41:01 2009 Subject: [plt-scheme] Re: Math prerequisites for SICP In-Reply-To: References: Message-ID: I am presently studying both htdp and sicp, they both complement each other and a course on cs offered at ucberk. has video lectures located at acedemicearth.org. which focuses on sicp. The concrete abstractions can be downloaded for free and i did browse through parts of the book but I believe that the 3 sources will lead to info overload and will dramatically slow the pace of learning. So my advice is to stick with at most 2 references. mike On Feb 12, 2:52?am, Andrei Estioco wrote: > How much math do I need to know to understand SICP? We used HtDP last > semester (June-October '08) although we skipped the parts that required some > actual math, especially calculus. We focused more on the "algorithm" aspect > of the book. > > I've leafed through the first few pages of SICP and found out that it > tackled the big O way earlier that HtDP. We touched big O lightly last > semester. How much math do I need to understand this? > > ?We only started on calculus this semester (November '08 - March '09). As of > this writing our current topic is the definite integral. Is that enough (for > the big O and everything else SICP) ? > > Thanks, > > -- > Chad Estioco > BS Computer Science > University of the Philippines-Diliman > > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme From wookiz at hotmail.com Sat Feb 14 16:28:15 2009 From: wookiz at hotmail.com (wooks) Date: Thu Mar 26 02:41:01 2009 Subject: [plt-scheme] nested vectors Message-ID: <1ac64f9a-f0f5-4201-a7f3-35690e0c7703@b38g2000prf.googlegroups.com> working in Pretty Big (define deposits (make-vector 17 (make-vector 17))) Now I want to set the value of the index entry [0,11] in deposits to 39. (vector-set! (vector-ref deposits 0) 11 39) gives a weird result. Please explain the result and correct me. #(#(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0)) From mlsmith at cs.vassar.edu Sat Feb 14 16:20:30 2009 From: mlsmith at cs.vassar.edu (Marc L. Smith) Date: Thu Mar 26 02:41:01 2009 Subject: [plt-scheme] DrScheme print preferences Message-ID: DrScheme is installed on the (Debian) Linux workstations in our computer labs. Each student logs into his/her own account. The "Destination" preference defaults to "Preview", the "Print Command:" text field defaults to "lpr" and the "Preview Command:" text field defaults to "gv". DrScheme apparently doesn't inherit the environment of the login shell that it launches from, because printouts don't go to the default printer set by the student login accounts. We tried adding the "-Pprinter" option to the print command, and that works, but DrScheme only remembers this for the current session. The next time DrScheme is launched, the print command reverts to "lpr" without the printer flag. Same story for specifying a different preview command. We wanted to change from "gv" to evince, but the change is only remembered until quitting DrScheme. Likewise, the Destination radio button to select "Printer" or "Preview" appears to reset to "Preview" between DrScheme sessions. I'm sorry if this question has been answered before, but we couldn't find a way to save a set of print preferences that is preserved between DrScheme sessions. Ideally, we'd like to set up default preferences for all users, but it would also be fine if we could have each student save their own print preferences. Any help would be appreciated. Thanks, Marc From eli at barzilay.org Sat Feb 14 16:38:26 2009 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:41:01 2009 Subject: [plt-scheme] nested vectors In-Reply-To: <1ac64f9a-f0f5-4201-a7f3-35690e0c7703@b38g2000prf.googlegroups.com> References: <1ac64f9a-f0f5-4201-a7f3-35690e0c7703@b38g2000prf.googlegroups.com> Message-ID: <18839.14802.62453.953359@arabic.ccs.neu.edu> On Feb 14, wooks wrote: > working in Pretty Big > > (define deposits (make-vector 17 (make-vector 17))) > > Now I want to set the value of the index entry [0,11] in deposits to > 39. > > (vector-set! (vector-ref deposits 0) 11 39) gives a weird result. > Please explain the result and correct me. What you did is similar to (define deposits (let ([row (vector 1 2 3)]) (vector row row row))) but what you reaaly need is to have separate vectors for each row: (define deposits (vector (vector 1 2 3) (vector 1 2 3) (vector 1 2 3))) You probably want something like (build-vector 17 (lambda (_) (make-vector 17))) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From robby at eecs.northwestern.edu Sat Feb 14 16:40:24 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Mar 26 02:41:02 2009 Subject: [plt-scheme] nested vectors In-Reply-To: <1ac64f9a-f0f5-4201-a7f3-35690e0c7703@b38g2000prf.googlegroups.com> References: <1ac64f9a-f0f5-4201-a7f3-35690e0c7703@b38g2000prf.googlegroups.com> Message-ID: <932b2f1f0902141340l2b9c7fbfnac07a25347fb9f06@mail.gmail.com> (make-vector 17 V) creates a vector with 17 entries that each have the same value inside. So you got the same vector 17 times in the outer vector. I think you wanted to use build-vector. Robby On Sat, Feb 14, 2009 at 3:28 PM, wooks wrote: > working in Pretty Big > > (define deposits (make-vector 17 (make-vector 17))) > > Now I want to set the value of the index entry [0,11] in deposits to > 39. > > (vector-set! (vector-ref deposits 0) 11 39) gives a weird result. > Please explain the result and correct me. > > #(#(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0)) > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From czhu at cs.utah.edu Sat Feb 14 16:40:12 2009 From: czhu at cs.utah.edu (Chongkai Zhu) Date: Thu Mar 26 02:41:02 2009 Subject: [plt-scheme] nested vectors In-Reply-To: <1ac64f9a-f0f5-4201-a7f3-35690e0c7703@b38g2000prf.googlegroups.com> References: <1ac64f9a-f0f5-4201-a7f3-35690e0c7703@b38g2000prf.googlegroups.com> Message-ID: <49973A3C.6040001@cs.utah.edu> This is what (make-vector n fill) does: it create a vector of length n, and every slot of the vector is filled with `fill'. In your case, the outside `make-vector' created a vector of length 17. It will not copy the inner (make-vector 17) 17 times. Instead, all 17 slots of the outer vector refers to the same area (in memory). To be more clear: (define a (make-vector 16)) (define b (make-vector 17 a)) (vector-set! a 2 1) Now a is #(0 1), while b is #(a a) thus #(#(0 1) #(0 1) #(0 1)), the same as you saw in your example. I guess your want to create a two dimension array. To do that in Scheme, you need: (define (make-array n) (let ((a (make-vector n))) (let loop ((i 0)) (when (< i n) (vector-set! a i (make-vector n)) (loop (add1 i)))) a)) In which the loop actually allocate space for all sub-vector. Chongkai wooks wrote: > working in Pretty Big > > (define deposits (make-vector 17 (make-vector 17))) > > Now I want to set the value of the index entry [0,11] in deposits to > 39. > > (vector-set! (vector-ref deposits 0) 11 39) gives a weird result. > Please explain the result and correct me. > > #(#(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0) > #(0 0 0 0 0 0 0 0 0 0 0 39 0 0 0 0 0)) > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From eli at barzilay.org Sat Feb 14 16:47:56 2009 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:41:02 2009 Subject: [plt-scheme] DrScheme print preferences In-Reply-To: References: Message-ID: <18839.15372.635951.872158@arabic.ccs.neu.edu> On Feb 14, Marc L. Smith wrote: > DrScheme is installed on the (Debian) Linux workstations in our > computer labs. Each student logs into his/her own account. > > The "Destination" preference defaults to "Preview", > the "Print Command:" text field defaults to "lpr" and > the "Preview Command:" text field defaults to "gv". > > DrScheme apparently doesn't inherit the environment of the login > shell that it launches from, because printouts don't go to the > default printer set by the student login accounts. It sounds like the students have these settings in some environment like Gnome -- whereas DrScheme just uses `lpr' by default. You can try getting the student environment to have a `PRINTER' environment variable set to the name of the printer, which makes `lpr' use that printer by default. (I don't know of a value that will make it use a file by default -- that might depend on whatever variant of `lpr' you have.) > We tried adding the "-Pprinter" option to the print command, and > that works, but DrScheme only remembers this for the current > session. The next time DrScheme is launched, the print command > reverts to "lpr" without the printer flag. IIRC, setting `PRINTER' is the same as using the `-P' flag. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From will at wjduquette.com Fri Feb 13 16:24:07 2009 From: will at wjduquette.com (Will Duquette) Date: Thu Mar 26 02:41:02 2009 Subject: [plt-scheme] Naming style Message-ID: <09c2bbeb-edb3-4154-a999-3a18bf441e0d@t39g2000prh.googlegroups.com> Warning: I am a clueless newbie when it comes to PLT-Scheme (though I have some slight background with Lisp-like languages). I've just started glancing at "An Introduction to Scheme with Pictures", which uses something called "#lang slideshow". Almost immediately I see the function "hc-append". When I go look at the docs, as suggested, I see that it's one of a family of functions, all of which follow this naming convention: - Thus, this command appends pictures together horizontally ("h"), centering them vertically. ("c"). This strikes me as a very add way to name functions; I'd have thought that having one function, "append", with arguments indicating the alignment, would make more sense. On the other hand, someone implemented it this way on purpose, and given that it's used in a document for newbies like me I presume it's good style. Would someone care to explain to me *why* it's good style? Thanks very much. From emilio.moretti at gmail.com Sat Feb 14 15:04:39 2009 From: emilio.moretti at gmail.com (Emilio) Date: Thu Mar 26 02:41:02 2009 Subject: [plt-scheme] cannot use drscheme (collection paths are empty) (Satux Linux) Message-ID: <24f6c2a5-8095-4b8a-8870-d59d28973301@g39g2000pri.googlegroups.com> I installed DrScheme 4.1.4 on Satux Linux ./configure --prefix=/usr/local --enable-shared make sudo make install No problems at all, mzscheme works without problems but drscheme is giving me a hard time. Seems not to be finding the collections. But they are installed. I verified /usr/local/lib/plt and the files are present. This is the error message: Warning: your collection paths are empty! ACK! didn't find drscheme's stackframe when filtering . Module Language: There must be a valid module in the definitions window. Try starting your program with #lang scheme and clicking ?Run?. Interactions disabled. What should I do? did I miss a step? don't really know why it's not working. I tried with #lang scheme but the error message is: Welcome to DrScheme, version 4.1.4 [3m]. Language: Module custom; memory limit: 128 megabytes. Warning: your collection paths are empty! Module Language: invalid module text standard-module-name-resolver: collection not found: # in any of: () Interactions disabled. thanks for your time. From eli at barzilay.org Sat Feb 14 17:04:46 2009 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:41:02 2009 Subject: [plt-scheme] Naming style In-Reply-To: <09c2bbeb-edb3-4154-a999-3a18bf441e0d@t39g2000prh.googlegroups.com> References: <09c2bbeb-edb3-4154-a999-3a18bf441e0d@t39g2000prh.googlegroups.com> Message-ID: <18839.16382.175453.585724@arabic.ccs.neu.edu> On Feb 13, Will Duquette wrote: > Warning: I am a clueless newbie when it comes to PLT-Scheme (though I > have some slight background with Lisp-like languages). > > I've just started glancing at "An Introduction to Scheme with > Pictures", which uses something called "#lang slideshow". Almost > immediately I see the function "hc-append". When I go look at the > docs, as suggested, I see that it's one of a family of functions, all > of which follow this naming convention: > > - > > Thus, this command appends pictures together horizontally ("h"), > centering them vertically. ("c"). > > This strikes me as a very add way to name functions; I'd have > thought that having one function, "append", with arguments > indicating the alignment, would make more sense. On the other hand, > someone implemented it this way on purpose, and given that it's used > in a document for newbies like me I presume it's good style. Would > someone care to explain to me *why* it's good style? There are two arguments for this that I can think of (disclaimer: I'm not the one who wrote that interface...): 1. It was designed before PLT had an organized way for using keyword arguments, which are one of the obvious ways to make a more convenient interface. 2. Having separate bindings for `hc-append' and `vc-append' (for example) mean that you'll get feedback of whether you wrote the right thing immediately: if there is no `vc-append' (or if you made some typo) then the code wouldn't even compile, and you'll know that you need to fix it. OTOH, you could have a mode argument, and have `append' check it and either use the mode or throw an error -- that means that you only get an error when you try to run the code. BTW, there is also an option of: (define (append mode blah ...) (let ([horiz (eq? mode 'horizontal)]) ...)) which means that a user typo like (append 'horiz) will silently use vertical mode, which can be very confusing. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From robby at eecs.northwestern.edu Sat Feb 14 17:06:57 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Mar 26 02:41:02 2009 Subject: [plt-scheme] cannot use drscheme (collection paths are empty) (Satux Linux) In-Reply-To: <24f6c2a5-8095-4b8a-8870-d59d28973301@g39g2000pri.googlegroups.com> References: <24f6c2a5-8095-4b8a-8870-d59d28973301@g39g2000pri.googlegroups.com> Message-ID: <932b2f1f0902141406t2dd37b28mf63c8ec851ede62d@mail.gmail.com> This is a long standing bug that I think I've just fixed (but post 4.1.4). The bug results in a corrupted preferences file. The easiest way to fix this is to open the language dialog with the language set to 'module' (as I think it will already be). Click "Show Details" (if they aren't already shown; I would guess they will be shown). Click the "Add Default" button on the right-hand side, about 2/3 of the way down in the dialog. Click "ok" and click run. The "Warning your collection paths are empty!" should go away and things should start working. hth, Robby On Sat, Feb 14, 2009 at 2:04 PM, Emilio wrote: > I installed DrScheme 4.1.4 on Satux Linux > > ./configure --prefix=/usr/local --enable-shared > make > sudo make install > > No problems at all, mzscheme works without problems but drscheme is > giving me a hard time. > Seems not to be finding the collections. But they are installed. I > verified /usr/local/lib/plt and the files are present. > > > This is the error message: > > Warning: your collection paths are empty! > ACK! didn't find drscheme's stackframe when filtering > . Module Language: There must be a valid module in the > definitions window. Try starting your program with > > #lang scheme > > and clicking 'Run'. > > Interactions disabled. > > > What should I do? did I miss a step? don't really know why it's not > working. I tried with #lang scheme but the error message is: > > Welcome to DrScheme, version 4.1.4 [3m]. > Language: Module custom; memory limit: 128 megabytes. > Warning: your collection paths are empty! > Module Language: invalid module text > standard-module-name-resolver: collection not found: # lang> in any of: () > > Interactions disabled. > > > > thanks for your time. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From eli at barzilay.org Sat Feb 14 17:07:41 2009 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:41:03 2009 Subject: [plt-scheme] cannot use drscheme (collection paths are empty) (Satux Linux) In-Reply-To: <24f6c2a5-8095-4b8a-8870-d59d28973301@g39g2000pri.googlegroups.com> References: <24f6c2a5-8095-4b8a-8870-d59d28973301@g39g2000pri.googlegroups.com> Message-ID: <18839.16557.163013.153959@arabic.ccs.neu.edu> On Feb 14, Emilio wrote: > I installed DrScheme 4.1.4 on Satux Linux > > ./configure --prefix=/usr/local --enable-shared > make > sudo make install > > No problems at all, mzscheme works without problems but drscheme is > giving me a hard time. If MzScheme works fine, then it was able to find the collections. The problem is probably in the plt preferences being corrupt somehow. (I think that there was a bug report recently about this problem.) You can try to remove the preferences (in ~/.plt-scheme/plt-prefs.ss) before you start DrScheme. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From robby at eecs.northwestern.edu Sat Feb 14 17:08:32 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Mar 26 02:41:03 2009 Subject: [plt-scheme] Naming style In-Reply-To: <18839.16382.175453.585724@arabic.ccs.neu.edu> References: <09c2bbeb-edb3-4154-a999-3a18bf441e0d@t39g2000prh.googlegroups.com> <18839.16382.175453.585724@arabic.ccs.neu.edu> Message-ID: <932b2f1f0902141408v6dd844e3jaddb0c4a0146eea@mail.gmail.com> 1. is the historically accurate reason. Robby On Sat, Feb 14, 2009 at 4:04 PM, Eli Barzilay wrote: > On Feb 13, Will Duquette wrote: >> Warning: I am a clueless newbie when it comes to PLT-Scheme (though I >> have some slight background with Lisp-like languages). >> >> I've just started glancing at "An Introduction to Scheme with >> Pictures", which uses something called "#lang slideshow". Almost >> immediately I see the function "hc-append". When I go look at the >> docs, as suggested, I see that it's one of a family of functions, all >> of which follow this naming convention: >> >> - >> >> Thus, this command appends pictures together horizontally ("h"), >> centering them vertically. ("c"). >> >> This strikes me as a very add way to name functions; I'd have >> thought that having one function, "append", with arguments >> indicating the alignment, would make more sense. On the other hand, >> someone implemented it this way on purpose, and given that it's used >> in a document for newbies like me I presume it's good style. Would >> someone care to explain to me *why* it's good style? > > There are two arguments for this that I can think of (disclaimer: I'm > not the one who wrote that interface...): > > 1. It was designed before PLT had an organized way for using keyword > arguments, which are one of the obvious ways to make a more > convenient interface. > > 2. Having separate bindings for `hc-append' and `vc-append' (for > example) mean that you'll get feedback of whether you wrote the > right thing immediately: if there is no `vc-append' (or if you made > some typo) then the code wouldn't even compile, and you'll know > that you need to fix it. > > OTOH, you could have a mode argument, and have `append' check it > and either use the mode or throw an error -- that means that you > only get an error when you try to run the code. BTW, there is also > an option of: > > (define (append mode blah ...) > (let ([horiz (eq? mode 'horizontal)]) > ...)) > > which means that a user typo like > > (append 'horiz) > > will silently use vertical mode, which can be very confusing. > > -- > ((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 eecs.northwestern.edu Sat Feb 14 17:13:46 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Mar 26 02:41:03 2009 Subject: [plt-scheme] cannot use drscheme (collection paths are empty) (Satux Linux) In-Reply-To: <18839.16557.163013.153959@arabic.ccs.neu.edu> References: <24f6c2a5-8095-4b8a-8870-d59d28973301@g39g2000pri.googlegroups.com> <18839.16557.163013.153959@arabic.ccs.neu.edu> Message-ID: <932b2f1f0902141413u68e9fcdtf7ac7213a8c908d6@mail.gmail.com> FWIW, you don't need to remove the preferences file, unless my instructions fail you. Robby On Sat, Feb 14, 2009 at 4:07 PM, Eli Barzilay wrote: > On Feb 14, Emilio wrote: >> I installed DrScheme 4.1.4 on Satux Linux >> >> ./configure --prefix=/usr/local --enable-shared >> make >> sudo make install >> >> No problems at all, mzscheme works without problems but drscheme is >> giving me a hard time. > > If MzScheme works fine, then it was able to find the collections. The > problem is probably in the plt preferences being corrupt somehow. (I > think that there was a bug report recently about this problem.) You > can try to remove the preferences (in ~/.plt-scheme/plt-prefs.ss) > before you start DrScheme. > > -- > ((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 will at wjduquette.com Sat Feb 14 18:20:14 2009 From: will at wjduquette.com (Will Duquette) Date: Thu Mar 26 02:41:03 2009 Subject: [plt-scheme] Re: Naming style In-Reply-To: <932b2f1f0902141408v6dd844e3jaddb0c4a0146eea@mail.gmail.com> References: <09c2bbeb-edb3-4154-a999-3a18bf441e0d@t39g2000prh.googlegroups.com> <18839.16382.175453.585724@arabic.ccs.neu.edu> <932b2f1f0902141408v6dd844e3jaddb0c4a0146eea@mail.gmail.com> Message-ID: Thanks both, for the answers. Keyword style is what I had in mind. (I do most of my programming in Tcl/Tk these days, and Scheme keywords seem the obvious analogy to Tcl-style option arguments.) A follow-on question. I gather Scheme has keyword arguments with the syntax #:mykeyword. In the example (append 'horizontal) you use an ordinary quoted symbol instead of a keyword symbol, e.g., #:horizontal. Which would normally be considered good style for keywords? (And while we're on that, why is the keyword prefix "#:" instead of the shorter ":", as in Common Lisp? (I don't mean to be critical; I'm just curious.) Thanks again! Will Duquette On Feb 14, 2:08?pm, Robby Findler wrote: > 1. is the historically accurate reason. > > Robby > > > > On Sat, Feb 14, 2009 at 4:04 PM, Eli Barzilay wrote: > > On Feb 13, Will Duquette wrote: > >> Warning: I am a clueless newbie when it comes to PLT-Scheme (though I > >> have some slight background with Lisp-like languages). > > >> I've just started glancing at "An Introduction to Scheme with > >> Pictures", which uses something called "#lang slideshow". ?Almost > >> immediately I see the function "hc-append". ?When I go look at the > >> docs, as suggested, I see that it's one of a family of functions, all > >> of which follow this naming convention: > > >> ? ? - > > >> Thus, this command appends pictures together horizontally ("h"), > >> centering them vertically. ("c"). > > >> This strikes me as a very add way to name functions; I'd have > >> thought that having one function, "append", with arguments > >> indicating the alignment, would make more sense. ?On the other hand, > >> someone implemented it this way on purpose, and given that it's used > >> in a document for newbies like me I presume it's good style. ?Would > >> someone care to explain to me *why* it's good style? > > > There are two arguments for this that I can think of (disclaimer: I'm > > not the one who wrote that interface...): > > > 1. It was designed before PLT had an organized way for using keyword > > ? arguments, which are one of the obvious ways to make a more > > ? convenient interface. > > > 2. Having separate bindings for `hc-append' and `vc-append' (for > > ? example) mean that you'll get feedback of whether you wrote the > > ? right thing immediately: if there is no `vc-append' (or if you made > > ? some typo) then the code wouldn't even compile, and you'll know > > ? that you need to fix it. > > > ? OTOH, you could have a mode argument, and have `append' check it > > ? and either use the mode or throw an error -- that means that you > > ? only get an error when you try to run the code. ?BTW, there is also > > ? an option of: > > > ? ? (define (append mode blah ...) > > ? ? ? (let ([horiz (eq? mode 'horizontal)]) > > ? ? ? ? ...)) > > > ? which means that a user typo like > > > ? ? (append 'horiz) > > > ? will silently use vertical mode, which can be very confusing. > > > -- > > ? ? ? ? ?((lambda (x) (x x)) (lambda (x) (x x))) ? ? ? ? ?Eli Barzilay: > > ? ? ? ? ? ? ? ? ?http://www.barzilay.org/? ? ? ? ? ? ? ? Maze is Life! > > _________________________________________________ > > ?For list-related administrative tasks: > > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme From eli at barzilay.org Sat Feb 14 18:31:42 2009 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:41:03 2009 Subject: [plt-scheme] Re: Naming style In-Reply-To: References: <09c2bbeb-edb3-4154-a999-3a18bf441e0d@t39g2000prh.googlegroups.com> <18839.16382.175453.585724@arabic.ccs.neu.edu> <932b2f1f0902141408v6dd844e3jaddb0c4a0146eea@mail.gmail.com> Message-ID: <18839.21598.723096.571703@arabic.ccs.neu.edu> On Feb 14, Will Duquette wrote: > Thanks both, for the answers. Keyword style is what I had in mind. > (I do most of my programming in Tcl/Tk these days, and Scheme > keywords seem the obvious analogy to Tcl-style option arguments.) > > A follow-on question. I gather Scheme has keyword arguments with the > syntax #:mykeyword. In the example > > (append 'horizontal) > > you use an ordinary quoted symbol instead of a keyword symbol, e.g., I should have clarified what Robby wrote later -- that #1 is the historical reason -- so using keywords was not an easy option at the time. So I wrote the above as an example of how it would look like without keyword arguments -- but the same notes apply to using them. > (And while we're on that, why is the keyword prefix "#:" instead of > the shorter ":", as in Common Lisp? (I don't mean to be critical; > I'm just curious.) IIRC, there was no consensus between `:foo' or `foo:', and Mattew preferred to go with something that clearly doesn't break any existing code. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From will at wjduquette.com Sat Feb 14 18:59:27 2009 From: will at wjduquette.com (Will Duquette) Date: Thu Mar 26 02:41:03 2009 Subject: [plt-scheme] Re: Naming style In-Reply-To: <18839.21598.723096.571703@arabic.ccs.neu.edu> References: <09c2bbeb-edb3-4154-a999-3a18bf441e0d@t39g2000prh.googlegroups.com> <18839.16382.175453.585724@arabic.ccs.neu.edu> <932b2f1f0902141408v6dd844e3jaddb0c4a0146eea@mail.gmail.com> <18839.21598.723096.571703@arabic.ccs.neu.edu> Message-ID: <7fb6c43a-d14b-4ed5-b6f8-0387333221f4@w1g2000prm.googlegroups.com> On Feb 14, 3:31?pm, Eli Barzilay wrote: > On Feb 14, Will Duquette wrote: > > A follow-on question. ?I gather Scheme has keyword arguments with the > > syntax #:mykeyword. ?In the example > > > ? ?(append 'horizontal) > > > you use an ordinary quoted symbol instead of a keyword symbol, e.g., > > I should have clarified what Robby wrote later -- that #1 is the > historical reason -- so using keywords was not an easy option at the > time. ?So I wrote the above as an example of how it would look like > without keyword arguments -- but the same notes apply to using them. Aha! Got it. Thanks very much! From grettke at acm.org Sat Feb 14 19:13:34 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:03 2009 Subject: [plt-scheme] Naming style In-Reply-To: <09c2bbeb-edb3-4154-a999-3a18bf441e0d@t39g2000prh.googlegroups.com> References: <09c2bbeb-edb3-4154-a999-3a18bf441e0d@t39g2000prh.googlegroups.com> Message-ID: <756daca50902141613l34f0474dp73743a9c69634ee5@mail.gmail.com> > This strikes me as a very add way to name functions; I'd have thought > that having one function, "append", with arguments indicating the > alignment, would make more sense. On the other hand, someone > implemented it this way on purpose, and given that it's used in a > document for newbies like me I presume it's good style. Would someone > care to explain to me *why* it's good style? I have heard people explain that when they use dynamically typed languages they prefer more verbose procedure names because it makes it easier to "refactor" their code. From will at wjduquette.com Sat Feb 14 19:24:17 2009 From: will at wjduquette.com (Will Duquette) Date: Thu Mar 26 02:41:04 2009 Subject: [plt-scheme] Re: Naming style In-Reply-To: <756daca50902141613l34f0474dp73743a9c69634ee5@mail.gmail.com> References: <09c2bbeb-edb3-4154-a999-3a18bf441e0d@t39g2000prh.googlegroups.com> <756daca50902141613l34f0474dp73743a9c69634ee5@mail.gmail.com> Message-ID: On Feb 14, 4:13?pm, Grant Rettke wrote: > > This strikes me as a very add way to name functions; I'd have thought > > that having one function, "append", with arguments indicating the > > alignment, would make more sense. ?On the other hand, someone > > implemented it this way on purpose, and given that it's used in a > > document for newbies like me I presume it's good style. ?Would someone > > care to explain to me *why* it's good style? > > I have heard people explain that when they use dynamically typed > languages they prefer more verbose procedure names because it makes it > easier to "refactor" their code. I'm not questioning the verbosity; I'm questioning defining umpteen functions when one function with two or three keyword arguments would do the same work. The umpteen functions are no doubt simpler and easier to understand in isolation--but when you've got a swarm of them, it seems to me that you end up with more to understand. I agree that using just "append" instead of, say, "hc-append", is probably a bad idea; "append" is too generic. > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme From adityashukla1983 at gmail.com Sat Feb 14 19:24:44 2009 From: adityashukla1983 at gmail.com (aditya shukla) Date: Thu Mar 26 02:41:04 2009 Subject: [plt-scheme] Functions as first class data types. Message-ID: <73045cca0902141624j33031e0ara6c86603b33c60ac@mail.gmail.com> Can someone please explain what's the use of having functions as first class data type in scheme .I am a little confused about functions having functions as their arguments . Aditya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090214/43684d37/attachment.html From dougorleans at gmail.com Sat Feb 14 19:30:14 2009 From: dougorleans at gmail.com (Doug Orleans) Date: Thu Mar 26 02:41:04 2009 Subject: [plt-scheme] Where is tex2page.sty? In-Reply-To: <20090214134116.6535D6500B1@mail-svr1.cs.utah.edu> References: <2c17707e0902131456w51c8e1f7n75112c906977219d@mail.gmail.com> <20090214134116.6535D6500B1@mail-svr1.cs.utah.edu> Message-ID: <2c17707e0902141630i42f485e3tbaea141e196ed8@mail.gmail.com> On Sat, Feb 14, 2009 at 8:41 AM, Matthew Flatt wrote: > At Fri, 13 Feb 2009 17:56:08 -0500, Doug Orleans wrote: >> Where can I find tex2page.sty? It's not in collects/tex2page. >> >> I had a feeling I had asked this before, and a web search for >> tex2page.sty does turn up my name: >> >> http://www.cs.brown.edu/pipermail/plt-scheme/2003-August/003375.html >> >> I think it never got answered then; I probably just downloaded it from >> somewhere, because I know I've used it successfully since then. But >> shouldn't it be included with PLT Scheme? > > Yes --- I've added it to the collection. Thanks... but tex2page.tex needs to be there too. (In fact all tex2page.sty is is \input{tex2page}.) Sorry for not mentioning that. --dougorleans@gmail.com From carl.eastlund at gmail.com Sat Feb 14 19:33:44 2009 From: carl.eastlund at gmail.com (Carl Eastlund) Date: Thu Mar 26 02:41:04 2009 Subject: [plt-scheme] Functions as first class data types. In-Reply-To: <73045cca0902141624j33031e0ara6c86603b33c60ac@mail.gmail.com> References: <73045cca0902141624j33031e0ara6c86603b33c60ac@mail.gmail.com> Message-ID: <990e0c030902141633k4070be7fr963463049e52dffb@mail.gmail.com> On Sat, Feb 14, 2009 at 7:24 PM, aditya shukla wrote: > Can someone please explain what's the use of having functions as first > class data type in scheme .I am a little confused about functions having > functions as their arguments . For a thorough introduction to first-class functions, I suggest going through section IV of How To Design Programs; specifically chapters 19 through 22. http://www.htdp.org/2003-09-26/Book/curriculum-Z-H-25.html If you are new to Scheme and functional programming, you may want to start at the beginning of the book and work up to there at your own pace. For a quick answer, higher order functions can save you a lot of repeated effort. If there's a frequent programming pattern you use, like walking down the elements of a list, you can encode that as a higher order function that walks the list. The part that's different each time, the choice of what to do with each list element, you can then pass in as an argument to the higher order function. It then becomes very easy to process lists without writing a new function: (map sqr xs) ;; square every number in xs (map - xs) ;; negate every number in xs (map / xs) ;; take the reciprocal of every number in xs (foldr + 0 xs) ;; compute the sum of every number in xs (foldr * 1 xs) ;; compute the product of every number in xs (foldr string-append "" strs) ;; append all the strings in strs It may not be immediately clear how each of those examples work, but once you get used to them it's much easier than writing a new function each time. -- Carl Eastlund From grettke at acm.org Sat Feb 14 20:10:57 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:05 2009 Subject: [plt-scheme] Re: Naming style In-Reply-To: References: <09c2bbeb-edb3-4154-a999-3a18bf441e0d@t39g2000prh.googlegroups.com> <756daca50902141613l34f0474dp73743a9c69634ee5@mail.gmail.com> Message-ID: <756daca50902141710x28505941gae8ffa6b64e449cf@mail.gmail.com> Hi Will, On Sat, Feb 14, 2009 at 6:24 PM, Will Duquette wrote: > On Feb 14, 4:13 pm, Grant Rettke wrote: >> I have heard people explain that when they use dynamically typed >> languages they prefer more verbose procedure names because it makes it >> easier to "refactor" their code. > > I'm not questioning the verbosity; I'm questioning defining umpteen > functions when one function with two or three keyword arguments would > do the same work. The umpteen functions are no doubt simpler and > easier to understand in isolation--but when you've got a swarm of > them, it seems to me that you end up with more to understand. I agree > that using just "append" instead of, say, "hc-append", is probably a > bad idea; "append" is too generic. My reply was an answer to yours. One reason to have N append functions rather than 1 is that it makes it easier to search for uses of it in your code. I wouldn't say that N functions are easier to understand or not; just that they are easier to search for ;). From will at wjduquette.com Sat Feb 14 20:47:44 2009 From: will at wjduquette.com (Will Duquette) Date: Thu Mar 26 02:41:05 2009 Subject: [plt-scheme] Re: Naming style In-Reply-To: <756daca50902141710x28505941gae8ffa6b64e449cf@mail.gmail.com> References: <09c2bbeb-edb3-4154-a999-3a18bf441e0d@t39g2000prh.googlegroups.com> <756daca50902141613l34f0474dp73743a9c69634ee5@mail.gmail.com> <756daca50902141710x28505941gae8ffa6b64e449cf@mail.gmail.com> Message-ID: On Feb 14, 5:10?pm, Grant Rettke wrote: > Hi Will, > > On Sat, Feb 14, 2009 at 6:24 PM, Will Duquette wrote: > > On Feb 14, 4:13 pm, Grant Rettke wrote: > >> I have heard people explain that when they use dynamically typed > >> languages they prefer more verbose procedure names because it makes it > >> easier to "refactor" their code. > > > I'm not questioning the verbosity; I'm questioning defining umpteen > > functions when one function with two or three keyword arguments would > > do the same work. ?The umpteen functions are no doubt simpler and > > easier to understand in isolation--but when you've got a swarm of > > them, it seems to me that you end up with more to understand. ?I agree > > that using just "append" instead of, say, "hc-append", is probably a > > bad idea; "append" is too generic. > > My reply was an answer to yours. One reason to have N append functions > rather than 1 is that it makes it easier to search for uses of it in > your code. I wouldn't say that N functions are easier to understand or > not; just that they are easier to search for ;). Oh, OK. Sorry about that. :-) > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme From mflatt at cs.utah.edu Sat Feb 14 21:09:17 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:41:05 2009 Subject: [plt-scheme] Where is tex2page.sty? In-Reply-To: <2c17707e0902141630i42f485e3tbaea141e196ed8@mail.gmail.com> References: <2c17707e0902131456w51c8e1f7n75112c906977219d@mail.gmail.com> <20090214134116.6535D6500B1@mail-svr1.cs.utah.edu> <2c17707e0902141630i42f485e3tbaea141e196ed8@mail.gmail.com> Message-ID: <20090215020921.DF7376500AD@mail-svr1.cs.utah.edu> At Sat, 14 Feb 2009 19:30:14 -0500, Doug Orleans wrote: > On Sat, Feb 14, 2009 at 8:41 AM, Matthew Flatt wrote: > > At Fri, 13 Feb 2009 17:56:08 -0500, Doug Orleans wrote: > >> Where can I find tex2page.sty? It's not in collects/tex2page. > >> > >> I had a feeling I had asked this before, and a web search for > >> tex2page.sty does turn up my name: > >> > >> http://www.cs.brown.edu/pipermail/plt-scheme/2003-August/003375.html > >> > >> I think it never got answered then; I probably just downloaded it from > >> somewhere, because I know I've used it successfully since then. But > >> shouldn't it be included with PLT Scheme? > > > > Yes --- I've added it to the collection. > > Thanks... but tex2page.tex needs to be there too. (In fact all > tex2page.sty is is \input{tex2page}.) Sorry for not mentioning that. Oh, of course. I've added "tex2page.tex". From grettke at acm.org Sat Feb 14 22:17:25 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:05 2009 Subject: [plt-scheme] Functions as first class data types. In-Reply-To: <73045cca0902141624j33031e0ara6c86603b33c60ac@mail.gmail.com> References: <73045cca0902141624j33031e0ara6c86603b33c60ac@mail.gmail.com> Message-ID: <756daca50902141917i445bdf1amd4051a6b05899ab6@mail.gmail.com> On Sat, Feb 14, 2009 at 6:24 PM, aditya shukla wrote: > Can someone please explain what's the use of having functions as first > class data type in scheme .I am a little confused about functions having > functions as their arguments . There are problems that you want to solve while programming where you will find that first class functions are one good solution. In their absence there are other good solutions, too. From henk at henk.ca Sat Feb 14 22:29:01 2009 From: henk at henk.ca (Henk Boom) Date: Thu Mar 26 02:41:05 2009 Subject: [plt-scheme] Functions as first class data types. In-Reply-To: <756daca50902141917i445bdf1amd4051a6b05899ab6@mail.gmail.com> References: <73045cca0902141624j33031e0ara6c86603b33c60ac@mail.gmail.com> <756daca50902141917i445bdf1amd4051a6b05899ab6@mail.gmail.com> Message-ID: 2009/2/14 Grant Rettke : > On Sat, Feb 14, 2009 at 6:24 PM, aditya shukla > wrote: >> Can someone please explain what's the use of having functions as first >> class data type in scheme .I am a little confused about functions having >> functions as their arguments . > > There are problems that you want to solve while programming where you > will find that first class functions are one good solution. In their > absence there are other good solutions, too. Other good solutions such as objects: http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/msg03277.html Henk From eviertel at gmail.com Sat Feb 14 23:10:42 2009 From: eviertel at gmail.com (e) Date: Thu Mar 26 02:41:06 2009 Subject: Fwd: [plt-scheme] Newbie Lambda( ) (???????????) In-Reply-To: References: <8C311BF9-6308-4357-96F6-6D1F983130D9@gmail.com> <52D7DE59-B39C-48F4-935D-DB00210E4DA7@adelphi.edu> <949DBC39-5EB3-4311-9738-E87CCAE7E6F6@gmail.com> <9b1fff280902131403o66300a6fse3a199e985ded436@mail.gmail.com> Message-ID: I don't think I sent this to the group last time. Something odd still about how I interact with this group vs. the other ones I'm in: ------------------------------------------------------- ok, I am new, too, to fp, so, perhaps partially to help me learn ... I was somewhat confused by the stop example, at first, also. I initially thought that once you defined "stop" one time, you were set forever. I was sort of assuming symmetry between "server" and "stop". . . . like, after the definition, you could just call (stop) after every call to (server 8081). But the example was adamant that we had somehow "fixed" the problem of not shutting down the listener. So I started thinking it through, like, "what I really need is a handle to something, like the thread . .. yeah the ACTUAL one that the listener is using . . . .so I can kill it". And that was it. I understood enough to know that what's needed is to *redefine stop every time you start the server*. That's the part I didn't grok right away. You're not making a reusable function called "(stop)" the way you are making a reusable function "(server)". Not only CAN you return a function, the REASON you are in this case is so that its execution will be tied (bound) to the thread that was started. I am thinking this is an example of a "closure". I guess in OO, you'd make a server "instance", and it would have a "stop" command . . .. or you could "delete" it (in C++), which would call the "destructor" . . . or in Java, there's some what of an opportunity in "finalize()", but not a reliable one. In Python, I'm thinking you'd have a "stop", and it'd be obvious that construction and "stopping" aren't symmetric operations. Now that I've made this comparison, it seems like the argument you have for fp reduces from "you can't do this in OO" to, "you need more boilerplate and fanfare to do it in OO" (possibly a whole file, possibly two -- one for the header and one for the implementation, RAII semantics on the constructor, etc). -------------------- Then Macro said: Yes, you are on the right track. It would be a lot more verbose in OO. There are some things that are done better by an OO language (e.g. encapsulation and polymorphic dispatch). Others, however, are incredibly hard to do (and should not as demonstrated by FP). -- Cheers, Marco On Fri, Feb 13, 2009 at 5:03 PM, Marco Morazan wrote: > On Fri, Feb 13, 2009 at 1:35 PM, Jesus Boadas wrote: > > Thanks I understand now, this is new to me. My usual functions only > return > > values, never could imagine that a function could return a function, I > was > > doing some research and this is called higher order functions or I am in > a > > mistake?. > > > > No, you are not. You are quite right. It is quite elegant, no? :-) > > Consider, now, a function, f, that returns a function as its value > after being applied to a set of arguments. A nice way to think of such > a function is as specialized-function generator. For example, consider > the problem of creating functions (i.e. what you do when you write > functions) that return a list with the results of adding a constant to > every element of a list of numbers. You would like to write a function > that takes as input a number (i.e. the constant to add) and that > returns a function that takes as input a list of numbers and that > returns a list by adding the given constant to every element of the > list. The code for this could look something like this: > > ; make-list-adder: number --> (list-of-numbers --> list-of-numbers) > (define (make-list-adder n) > ; add: number --> number > (define (add m) (+ n m)) > > ; add-n-to-list: list-of-numbers --> list-of-numbers > (define (add-n-to-list lon) (map add lon)) > > add-n-to-list) > > Every time make-list-adder is applied to an argument it returns a > function for which n is fixed. We can now, for example, define > functions to add 1 and to add 5 to every element of a list of numbers > without having to explicitly write code (in the conventional sense): > > (define add-1-to-list (make-list-adder 1)) > > (define add-5-to-list (make-list-adder 5)) > > The above definitions should illustrate that we have not written the > code for neither add-1-to-list nor add-5-to-list in the conventional > sense, but yet we have functions we can use! > > (add-1-to-list (list 1 2 3)) = (list 2 3 4) > > (add-5-to-list (list 1 2 3)) = (list 6 7 8) > > By writing one abstract function, we have the power to define a whole > class of functions. I hope this gives you an appetite to learn more > about HOFs. > > -- > > Cheers, > > Marco > _________________________________________________ > 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/20090214/8db5bd12/attachment.htm From eviertel at gmail.com Sat Feb 14 23:16:32 2009 From: eviertel at gmail.com (e) Date: Thu Mar 26 02:41:07 2009 Subject: [plt-scheme] Newbie Lambda( ) (???????????) In-Reply-To: References: <8C311BF9-6308-4357-96F6-6D1F983130D9@gmail.com> <52D7DE59-B39C-48F4-935D-DB00210E4DA7@adelphi.edu> <949DBC39-5EB3-4311-9738-E87CCAE7E6F6@gmail.com> <9b1fff280902131403o66300a6fse3a199e985ded436@mail.gmail.com> Message-ID: oops. I thought he was being clever . . . turns out I was . . sort of :) On Sat, Feb 14, 2009 at 11:12 PM, Shriram Krishnamurthi wrote: > > Then Macro said: > > I wonder how he feels about this particular name change. (-: > > Shriram > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090214/04e60f2d/attachment.html From sk at cs.brown.edu Sat Feb 14 23:12:30 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:41:07 2009 Subject: [plt-scheme] Newbie Lambda( ) (???????????) In-Reply-To: References: <8C311BF9-6308-4357-96F6-6D1F983130D9@gmail.com> <52D7DE59-B39C-48F4-935D-DB00210E4DA7@adelphi.edu> <949DBC39-5EB3-4311-9738-E87CCAE7E6F6@gmail.com> <9b1fff280902131403o66300a6fse3a199e985ded436@mail.gmail.com> Message-ID: > Then Macro said: I wonder how he feels about this particular name change. (-: Shriram From eviertel at gmail.com Sat Feb 14 23:21:39 2009 From: eviertel at gmail.com (e) Date: Thu Mar 26 02:41:08 2009 Subject: [plt-scheme] Functions as first class data types. In-Reply-To: References: <73045cca0902141624j33031e0ara6c86603b33c60ac@mail.gmail.com> <756daca50902141917i445bdf1amd4051a6b05899ab6@mail.gmail.com> Message-ID: wow, based on that link, I guess my answer to the "newbie lambda()(??????)" post wasn't that unique. Here's an excerpt that had to do with *why* (not how) the stop function was tied to the function returned from "server": "Not only CAN you return a function, the REASON you are in this case is so that its execution will be tied (bound) to the thread that was started. I am thinking this is an example of a "closure". I guess in OO, you'd make a server "instance", and it would have a "stop" command . . .. or you could "delete" it (in C++), which would call the "destructor" . . . or in Java, there's some what of an opportunity in "finalize()", but not a reliable one. In Python, I'm thinking you'd have a "stop", and it'd be obvious that construction and "stopping" aren't symmetric operations. Now that I've made this comparison, it seems like the argument you have for fp reduces from "you can't do this in OO" to, "you need more boilerplate and fanfare to do it in OO" (possibly a whole file, possibly two -- one for the header and one for the implementation, RAII semantics on the constructor, etc)." On Sat, Feb 14, 2009 at 10:29 PM, Henk Boom wrote: > 2009/2/14 Grant Rettke : > > On Sat, Feb 14, 2009 at 6:24 PM, aditya shukla > > wrote: > >> Can someone please explain what's the use of having functions as first > >> class data type in scheme .I am a little confused about functions having > >> functions as their arguments . > > > > There are problems that you want to solve while programming where you > > will find that first class functions are one good solution. In their > > absence there are other good solutions, too. > > Other good solutions such as objects: > > http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/msg03277.html > > Henk > _________________________________________________ > 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/20090214/18886b80/attachment.htm From sstrickl at ccs.neu.edu Sat Feb 14 23:24:26 2009 From: sstrickl at ccs.neu.edu (Stevie Strickland) Date: Thu Mar 26 02:41:08 2009 Subject: [plt-scheme] New contract-related features Message-ID: <06EEF9E3-FE3D-4CBE-93F4-5A4FDCC33F20@ccs.neu.edu> In SVN I've added three new major features that involve contracts. One allows for more fine-grained control of contracts, and the other two allow for the use of contracts with signatures and units. Contract Regions ---------------- Contract regions allow the programmer to protect a region of code with a contract boundary. In addition to the wrapped code, the programmer also provides a name for the region which is used in blame situations and a list of exported variables which can either be protected with contracts or unprotected. The region provides a true contract boundary, in that uses of contracted exports within the region are unprotected. Contract regions are specified with the with-contract form. The following contract region defines two mutually recursive functions: (with-contract region1 ([f (-> number? boolean?)] [g (-> number? boolean?)]) (define (f n) (if (zero? n) #f (g (sub1 n)))) (define (g n) (if (zero? n) #t (f (sub1 n))))) The internal calls to f and g are uncontracted, but calls to f and g outside this region would be appropriately contracted. First-order checks are performed at the region, so the following region: (with-contract region2 ([n number?]) (define n #t)) results in the following error: (region region2) broke the contract number? on n; expected , given: #t Notice that the blame not only gives the name of the region, but describes what type of contract boundary was involved. For contracting a single definition, there is the define/contract form which has a similar syntax to define, except that it takes a contract before the body of the definition. To compare the two forms, the following two definitions are equivalent: (with-contract fact ([fact (-> number? number?)]) (define (fact n) (if (zero? n) 1 (* n (fact (sub1 n)))))) (define/contract (fact n) (-> number? number?) (if (zero? n) 1 (* n (fact (sub1 n))))) First order checks are similarly performed at the definition for define/contract, so (define/contract (fact n) (-> number?) (if (zero? n) 1 (* n (fact (sub1 n))))) results in (function fact) broke the contract (-> number?) on fact; expected a procedure that accepts no arguments without any keywords, given: # Signature Contracts ------------------- In addition to contract regions, units are also now contract boundaries. One way to use contracts with units is to add contracts to unit signatures via the contracted signature form. (define-signature toy-factory^ ((contracted [build-toys (-> integer? (listof toy?))] [repaint (-> toy? symbol? toy?)] [toy? (-> any/c boolean?)] [toy-color (-> toy? symbol?)]))) Notice that contracts in a signature can use variables listed in the signature. Now if we take the following implementation of that signature: (define-unit simple-factory@ (import) (export toy-factory^) (define-struct toy (color) #:transparent) (define (build-toys n) (for/list ([i (in-range n)]) (make-toy 'blue))) (define (repaint t col) (make-toy col))) We get the appropriate contract checks on those exports: > (define-values/invoke-unit/infer simple-factory@) > (build-toys 3) (#(struct:toy blue) #(struct:toy blue) #(struct:toy blue)) > (build-toys #f) top-level broke the contract (-> integer? (listof toy?)) on build-toys; expected , given: #f As before, uses of contracted exports inside the unit are not checked. Since units are contract boundaries, they can be blamed appropriately. Take the following definitions: (define-unit factory-user@ (import toy-factory^) (export) (let ([toys (build-toys 3)]) (repaint 3 'blue))) (define-compound-unit/infer factory+user@ (import) (export) (link simple-factory@ factory-user@)) When we invoke the combined unit: > (define-values/invoke-unit/infer factory+user@) (unit factory-user@) broke the contract (-> toy? symbol? toy?) on repaint; expected , given: 3 Unit Contracts -------------- However, we may not always be able to add contracts to signatures. For example, there are many already-existing signatures in PLT Scheme that one may want to implement, or a programmer may want to take a unit value and add contracts to it after the fact. To do this, there is the unit/c contract combinator. It takes a list of imports and exports, where each signature is paired with a list of variables and their contracts for each signature. So if we had the uncontracted version of the toy-factory^ signature: (define-signature toy-factory^ (build-toys repaint toy? toy-color)) the following contracts would be appropriate for a unit that imports nothing and exports that signature: (unit/c (import) (export)) (unit/c (import) (export toy-factory^)) (unit/c (import) (export (toy-factory^ [toy-color (-> toy? symbol?)]))) (unit/c (import) (export (toy-factory^ [build-toys (-> integer? (listof toy?))] [repaint (-> toy? symbol? toy?)] [toy? (-> any/c boolean?)] [toy-color (-> toy? symbol?)]))) Unit contracts can contain a superset of the import signatures and a subset of the export signatures for a given unit value. Also, variables that are not listed for a given signature are left alone when the contracts are being added. Since the results of applying unit/c is a new unit, then adding a contract can cause link inference to fail. For example, if we change the definition of simple-factory@ above to (define/contract simple-factory@ (unit/c (import) (export (toy-factory^ [build-toys (-> integer? (listof toy?))] [repaint (-> toy? symbol? toy?)] [toy? (-> any/c boolean?)] [toy-color (-> toy? symbol?)]))) (unit (import) (export toy-factory^) (define-struct toy (color) #:transparent) (define (build-toys n) (for/list ([i (in-range n)]) (make-toy 'blue))) (define (repaint t col) (make-toy col)))) Then when we try to combine it with the factory-user@ unit, we get: define-compound-unit/infer: not a unit definition in: simple-factory@ One way to solve this is to use define-unit-binding to set up the static information for the new contracted value. Another possibility for unit definitions is to use define-unit/contract: (define-unit/contract simple-factory@ (import) (export (toy-factory^ [build-toys (-> integer? (listof toy?))] [repaint (-> toy? symbol? toy?)] [toy? (-> any/c boolean?)] [toy-color (-> toy? symbol?)])) (define-struct toy (color) #:transparent) (define (build-toys n) (for/list ([i (in-range n)]) (make-toy 'blue))) (define (repaint t col) (make-toy col))) More about these features can be found in the Reference, and a short section about signature and unit contracts has been added to the Guide. Stevie From eviertel at gmail.com Sat Feb 14 23:30:40 2009 From: eviertel at gmail.com (e) Date: Thu Mar 26 02:41:08 2009 Subject: [plt-scheme] Datalog in PLT Scheme In-Reply-To: References: Message-ID: the use of "database" in the docs references an "in memory only" database, right? The whole set of facts and rules must be parsed or otherwise "entered/programmed" into memory. There's no automatic disk backing, like a BTree or relational database persisting stuff behind the scenes? Thanks. On Fri, Feb 13, 2009 at 6:08 PM, Jay McCarthy wrote: > I've just released a PLaneT package that adds Datalog as a language in > DrScheme. It is called datalog.plt. > > > http://planet.plt-scheme.org/display.ss?package=datalog.plt&owner=jaymccarthy > > Documentation is available online. > > > http://planet.plt-scheme.org/package-source/jaymccarthy/datalog.plt/1/0/planet-docs/datalog/index.html > > In particular, check out the tutorial! > > > http://planet.plt-scheme.org/package-source/jaymccarthy/datalog.plt/1/0/planet-docs/datalog/Tutorial.html > > Jay > > -- > Jay McCarthy > Assistant Professor / Brigham Young University > http://teammccarthy.org/jay > > "The glory of God is Intelligence" - D&C 93 > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090214/3cf59afe/attachment.html From grettke at acm.org Sat Feb 14 23:35:37 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:09 2009 Subject: [plt-edu] Re: [plt-scheme] behaviour of void? In-Reply-To: <281544.18684.qm@web50911.mail.re2.yahoo.com> References: <281544.18684.qm@web50911.mail.re2.yahoo.com> Message-ID: <756daca50902142035m6a072d9dtfa57c8089d5b0fce@mail.gmail.com> On Thu, Feb 5, 2009 at 8:23 PM, geb a wrote: > So what kinds of exercises are you looking for? I guess I'm in the unique position of being able to use programming to teach Science, Technology, Engineering and Mathematics projects. As a high school teacher, I feel like computer science should be about integrating these disciplines. I wish I had gone to school where you teach. Is it common practice for highschools these days to include CS? What is your title? CS teacher? From eli at barzilay.org Sat Feb 14 23:36:15 2009 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:41:09 2009 Subject: Fwd: [plt-scheme] Newbie Lambda( ) (???????????) In-Reply-To: References: <8C311BF9-6308-4357-96F6-6D1F983130D9@gmail.com> <52D7DE59-B39C-48F4-935D-DB00210E4DA7@adelphi.edu> <949DBC39-5EB3-4311-9738-E87CCAE7E6F6@gmail.com> <9b1fff280902131403o66300a6fse3a199e985ded436@mail.gmail.com> Message-ID: <18839.39871.84040.779338@arabic.ccs.neu.edu> On Feb 14, e wrote: > I don't think I sent this to the group last time. Something odd > still about how I interact with this group vs. the other ones I'm > in: [...] If you're referring to the delay between sending an email and seeing it on the list -- this is a result of the Brown mail server (where the mailing list is hosted) doing "greylisting". This basically means that sometimes emails get delayed for a while. [Greylisting is a method that is used against spam: if the server doesn't "know you", it will reject your email in a way that makes proper mail servers retry sending the message. The idea is that spammers use servers in a way that makes it impractical for their servers to resend email, so the email will be dropped. Once the graylisting server sees a few emails from you, it remembers you and will stop doing that delay.] -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From emilio.moretti at gmail.com Sat Feb 14 17:20:32 2009 From: emilio.moretti at gmail.com (Emilio) Date: Thu Mar 26 02:41:09 2009 Subject: [plt-scheme] Re: cannot use drscheme (collection paths are empty) (Satux Linux) In-Reply-To: <18839.16557.163013.153959@arabic.ccs.neu.edu> References: <24f6c2a5-8095-4b8a-8870-d59d28973301@g39g2000pri.googlegroups.com> <18839.16557.163013.153959@arabic.ccs.neu.edu> Message-ID: <58c7e060-f05e-44bf-9c7b-90448e40f5c5@z27g2000prd.googlegroups.com> Robby Findler's solution worked. Now the problem is gone. Thanks both of you for the quick answers. Thanks A LOT. Emilio Moretti On Feb 14, 8:07?pm, Eli Barzilay wrote: > On Feb 14, Emilio wrote: > > > I installed DrScheme 4.1.4 on Satux Linux > > > ./configure --prefix=/usr/local --enable-shared > > make > > sudo make install > > > No problems at all, mzscheme works without problems but drscheme is > > giving me a hard time. > > If MzScheme works fine, then it was able to find the collections. ?The > problem is probably in the plt preferences being corrupt somehow. ?(I > think that there was a bug report recently about this problem.) ?You > can try to remove the preferences (in ~/.plt-scheme/plt-prefs.ss) > before you start DrScheme. > > -- > ? ? ? ? ? ((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 spamme at innerpaths.net Sun Feb 15 02:29:55 2009 From: spamme at innerpaths.net (Gregg Williams) Date: Thu Mar 26 02:41:09 2009 Subject: [plt-scheme] Newbie question: Why "orange text, black background" after Run? Message-ID: <9F230C05-E66A-4206-8DCC-B5B7D3C3FC0E@innerpaths.net> Thanks for your forbearance; I've searched the PLT Scheme mailing list and the Help Desk and haven't found anything useful. Here's my problem. When I define some functions in the upper pane and press the Run button, the body of each function changes to orange text on a black background. Not only is this distracting per se, but it also makes it hard for me to see the green markers when I begin debugging the code. I'm running PLT Scheme on MacOS X Leopard (10.5), and I've clicked Reset in the Preferences. The language used, noted at the bottom of the screen, is Advanced Student. I'm sure this must be something I'm not understanding; thanks for your help. --Gregg From keydana at gmx.de Sun Feb 15 01:37:25 2009 From: keydana at gmx.de (Sigrid Keydana) Date: Thu Mar 26 02:41:09 2009 Subject: [plt-scheme] continue web application: correspondence between blog/post objects and db tables Message-ID: <4997B825.5020203@gmx.de> Hi, arriving at the sqlite section of the Continue guide, I was a bit confused at first by the non-correspondence between the blog and db structures in the scheme code and the blog and db objects as represented in the database. (In the database, the objects are "like they are in the real world", i.e. a post is something that has a title and a body, whereas in the code it is, if one can say so, an object that allows us to work with the database, i.e. it has an indirect database handle via the blog object and an id corresponding to the table's primary key). It seems I'm much more aquainted with a model that just mirrors the table (like I suppose it's mostly done in Java applications, or even the ActiveRecord pattern of Rails). Now I'd be curious to know whether the fact that it's done differently here has anything to do with the kind of language you use (functional or non-functional one)? (Or else, was it done like this to keep the guide short and, if you had a real productive application, you would do it the other way in scheme too?) Thanks a lot for any hints, Sigrid From chadestioco at gmail.com Sun Feb 15 06:13:31 2009 From: chadestioco at gmail.com (Andrei Estioco) Date: Thu Mar 26 02:41:10 2009 Subject: [plt-scheme] Newbie question: Why "orange text, black background" after Run? In-Reply-To: <9F230C05-E66A-4206-8DCC-B5B7D3C3FC0E@innerpaths.net> References: <9F230C05-E66A-4206-8DCC-B5B7D3C3FC0E@innerpaths.net> Message-ID: It will come in useful once you start debugging large bits of code. This is what I so far figured out about this feature. Consider: (define (f x) (+ 1 (g (* x 2)))) (define (g x) (+ 3 (h x))) (define (h x) (append (cons 7 x) (cons (i x) empty))) (define (i x) 'seeTheError) say you call (f 3). You do not have to hand-evaluate to see that at (h x), DrScheme will generate an error as it expects a list for the argument x. Now what will happen is that the highlights will vanish up to the line (cons (i x) empty). It shows you what function calls did and didn't happen because of the error. Yes I found it annoying at first, me having used one of the previous versions of DrScheme not bearing this feature. However, as you'll come to see, it will come in useful after sometime. And...I don't know how to turn the feature off :P. Hoping I helped, -- Chad Estioco BS Computer Science University of the Philippines-Diliman ============================== http://www.geocities.com/lokisky_walker -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090215/ace5ec0e/attachment.htm From chust at web.de Sun Feb 15 06:23:17 2009 From: chust at web.de (Thomas Chust) Date: Thu Mar 26 02:41:10 2009 Subject: [plt-scheme] New contract-related features In-Reply-To: <06EEF9E3-FE3D-4CBE-93F4-5A4FDCC33F20@ccs.neu.edu> References: <06EEF9E3-FE3D-4CBE-93F4-5A4FDCC33F20@ccs.neu.edu> Message-ID: <1c1a33bc0902150323w7e94a730h53a66f0647cccb35@mail.gmail.com> 2009-02-15 Stevie Strickland : > In SVN I've added three new major features that involve contracts. > One allows for more fine-grained control of contracts, and the other > two allow for the use of contracts with signatures and units. > [...] Wow, quite impressive enhancements and very useful ones :-) Are there any plans to add something along the same lines to classes and interfaces in PLT Scheme, too, or is it even already possible to use the new contract regions inside classes? cu, Thomas -- When C++ is your hammer, every problem looks like your thumb. From jadudm at gmail.com Sun Feb 15 09:12:50 2009 From: jadudm at gmail.com (Matt Jadud) Date: Thu Mar 26 02:41:10 2009 Subject: [plt-scheme] continue web application: correspondence between blog/post objects and db tables In-Reply-To: <4997B825.5020203@gmx.de> References: <4997B825.5020203@gmx.de> Message-ID: On Sun, Feb 15, 2009 at 1:37 AM, Sigrid Keydana wrote: > It seems I'm much more aquainted with a model that just mirrors the > table (like I suppose it's mostly done in Java applications, or even the > ActiveRecord pattern of Rails). Now I'd be curious to know whether the > fact that it's done differently here has anything to do with the kind of Hi Sigrid, If you are interested in a DB backing solution that is more ORM-like, take a look at Snooze: http://planet.plt-scheme.org/display.ss?package=snooze.plt&owner=untyped Through a combination of the documentation and unit tests using Snooze should be relatively straight-forward. If the query language is problematic or confusing in any way, ask here. (Instead of building SQL strings a la the Continue tutorial, Snooze has a little macro language that is compiled down to SQL, allowing Snooze to work with either Postgres or SQLite.) And as a note for Jay: it might be nice to point to some of the Untyped libraries from your documentation. Code written with Dispatch and Snooze tends to be more concise when one is writing simple programs. (It might even be more concise for more complex programs---certainly, I prefer writing against Snooze than mangling strings to build SQL.) Also, the Untyped libraries have unit tests, which means that users can also see how the code is used in a context other than the tutorial. Just a suggestion. Cheers, Matt From jay.mccarthy at gmail.com Sun Feb 15 09:26:19 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:41:10 2009 Subject: [plt-scheme] Datalog in PLT Scheme In-Reply-To: References: Message-ID: Correct. The database is implemented in a serializable way, so theories can be saved with 'write' and 'read', but the library doesn't do any of that automatically. Jay On Sat, Feb 14, 2009 at 9:30 PM, e wrote: > the use of "database" in the docs references an "in memory only" database, > right? The whole set of facts and rules must be parsed or otherwise > "entered/programmed" into memory. There's no automatic disk backing, like a > BTree or relational database persisting stuff behind the scenes? > > Thanks. > > On Fri, Feb 13, 2009 at 6:08 PM, Jay McCarthy > wrote: >> >> I've just released a PLaneT package that adds Datalog as a language in >> DrScheme. It is called datalog.plt. >> >> >> http://planet.plt-scheme.org/display.ss?package=datalog.plt&owner=jaymccarthy >> >> Documentation is available online. >> >> >> http://planet.plt-scheme.org/package-source/jaymccarthy/datalog.plt/1/0/planet-docs/datalog/index.html >> >> In particular, check out the tutorial! >> >> >> http://planet.plt-scheme.org/package-source/jaymccarthy/datalog.plt/1/0/planet-docs/datalog/Tutorial.html >> >> Jay >> >> -- >> Jay McCarthy >> Assistant Professor / Brigham Young University >> http://teammccarthy.org/jay >> >> "The glory of God is Intelligence" - D&C 93 >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From jay.mccarthy at gmail.com Sun Feb 15 09:27:18 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:41:11 2009 Subject: [plt-scheme] Datalog in PLT Scheme In-Reply-To: References: Message-ID: If you want a 'normal' database, use my sqlite package or Untyped's Snooze library. The Datalog package gives you a 'deductive' database, which can be nice in some cases. Jay On Sun, Feb 15, 2009 at 7:26 AM, Jay McCarthy wrote: > Correct. The database is implemented in a serializable way, so > theories can be saved with 'write' and 'read', but the library doesn't > do any of that automatically. > > Jay > > On Sat, Feb 14, 2009 at 9:30 PM, e wrote: >> the use of "database" in the docs references an "in memory only" database, >> right? The whole set of facts and rules must be parsed or otherwise >> "entered/programmed" into memory. There's no automatic disk backing, like a >> BTree or relational database persisting stuff behind the scenes? >> >> Thanks. >> >> On Fri, Feb 13, 2009 at 6:08 PM, Jay McCarthy >> wrote: >>> >>> I've just released a PLaneT package that adds Datalog as a language in >>> DrScheme. It is called datalog.plt. >>> >>> >>> http://planet.plt-scheme.org/display.ss?package=datalog.plt&owner=jaymccarthy >>> >>> Documentation is available online. >>> >>> >>> http://planet.plt-scheme.org/package-source/jaymccarthy/datalog.plt/1/0/planet-docs/datalog/index.html >>> >>> In particular, check out the tutorial! >>> >>> >>> http://planet.plt-scheme.org/package-source/jaymccarthy/datalog.plt/1/0/planet-docs/datalog/Tutorial.html >>> >>> Jay >>> >>> -- >>> Jay McCarthy >>> Assistant Professor / Brigham Young University >>> http://teammccarthy.org/jay >>> >>> "The glory of God is Intelligence" - D&C 93 >>> _________________________________________________ >>> For list-related administrative tasks: >>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> > > > > -- > Jay McCarthy > Assistant Professor / Brigham Young University > http://teammccarthy.org/jay > > "The glory of God is Intelligence" - D&C 93 > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From matthias at ccs.neu.edu Sun Feb 15 10:45:45 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:41:11 2009 Subject: [plt-scheme] Newbie question: Why "orange text, black background" after Run? In-Reply-To: <9F230C05-E66A-4206-8DCC-B5B7D3C3FC0E@innerpaths.net> References: <9F230C05-E66A-4206-8DCC-B5B7D3C3FC0E@innerpaths.net> Message-ID: <49A67A6F-DF27-4DC8-9CA8-880C51565612@ccs.neu.edu> DrScheme tells you that you haven't tested certain parts of your program. If you really don't want to know that you haven't finished designing your program, you can open the language dialog, look at the details, and turn off coverage. -- Matthias On Feb 15, 2009, at 2:29 AM, Gregg Williams wrote: > Thanks for your forbearance; I've searched the PLT Scheme mailing > list and the Help Desk and haven't found anything useful. > > Here's my problem. When I define some functions in the upper pane > and press the Run button, the body of each function changes to > orange text on a black background. Not only is this distracting per > se, but it also makes it hard for me to see the green markers when > I begin debugging the code. > > I'm running PLT Scheme on MacOS X Leopard (10.5), and I've clicked > Reset in the Preferences. The language used, noted at the bottom of > the screen, is Advanced Student. I'm sure this must be something > I'm not understanding; thanks for your help. > > --Gregg > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From eviertel at gmail.com Sun Feb 15 10:47:18 2009 From: eviertel at gmail.com (e) Date: Thu Mar 26 02:41:11 2009 Subject: Fwd: [plt-scheme] Newbie Lambda( ) (???????????) In-Reply-To: <18839.39871.84040.779338@arabic.ccs.neu.edu> References: <8C311BF9-6308-4357-96F6-6D1F983130D9@gmail.com> <52D7DE59-B39C-48F4-935D-DB00210E4DA7@adelphi.edu> <949DBC39-5EB3-4311-9738-E87CCAE7E6F6@gmail.com> <9b1fff280902131403o66300a6fse3a199e985ded436@mail.gmail.com> <18839.39871.84040.779338@arabic.ccs.neu.edu> Message-ID: thanks. that's helpful to know. A few things I can say definitively (rather than my former vagueness): 1) I still can't select the individual mail option for the google group. yet, I am getting individual mail as if it is working correctly. I ALSO get the digest (which I don't actually want and end up deleting). I've never had any problems before. 2) In other groups, the mail just comes from the message group email address. Here the message comes from the sender, and the cc is the message group email address. Because I was forgetting to do "reply all", I wasn't picking up the message group, and wound up only sending back to the previous sender. perhaps both issues have to do with the Brown server, I dunno. On Sat, Feb 14, 2009 at 11:36 PM, Eli Barzilay wrote: > On Feb 14, e wrote: > > I don't think I sent this to the group last time. Something odd > > still about how I interact with this group vs. the other ones I'm > > in: [...] > > If you're referring to the delay between sending an email and seeing > it on the list -- this is a result of the Brown mail server (where the > mailing list is hosted) doing "greylisting". This basically means > that sometimes emails get delayed for a while. > > [Greylisting is a method that is used against spam: if the server > doesn't "know you", it will reject your email in a way that makes > proper mail servers retry sending the message. The idea is that > spammers use servers in a way that makes it impractical for their > servers to resend email, so the email will be dropped. Once the > graylisting server sees a few emails from you, it remembers you and > will stop doing that delay.] > > -- > ((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/20090215/778e22a8/attachment.html From grettke at acm.org Sun Feb 15 11:38:33 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:11 2009 Subject: [plt-scheme] Help with symbols Message-ID: <756daca50902150838m6acf2d2bnad65560d93e1d781@mail.gmail.com> Hi, I have a question about symbols in Scheme. (symbol? '5) => #f Is this the case because 5 is self-evaluating and for lack of a better term, "5 is 5"? (symbol? '(+ 1 2)) =? #f Is this the case because it is a quoted list, and not a "name"? I see that I don't know much more about symbols other than they are a quoted sequence of characters about which I am not sure of the restrictions. Is there more to know about them? Where? Best wishes, Grant From jos.koot at telefonica.net Sun Feb 15 14:19:38 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:41:12 2009 Subject: [plt-scheme] Help with symbols References: <756daca50902150838m6acf2d2bnad65560d93e1d781@mail.gmail.com> Message-ID: <54B538657E0740869690460415F37967@uw2b2dff239c4d> The use of symbols is like that of immutable strings with the big difference that two symbols written in the same way always are equal in the sense of *eq?* (as long as no uninterned symbols are around) Symbols can be used for enumerated types, for example: (define day-name->day-number day-name) (case day-name ((Monday) 1) ((Tuesday) 2) ((Wednesday) 3) ((Thurstday) 4) ((Friday) 5) ((Saturday) 6) ((Sunday) 7))) Notice that the day-names in the case statement are not evaluated, they are taken as immediate data. For the inverse we can write: (define (day-number->day-name day-number) (string-ref '(Monday Tuesday Wednesday Thurstday Friday Saturday Sunday) (- day-number 1))) (day-name->day-number (quote Friday)) --> 5 (day-number->day-name 5) --> Friday (a symbol) Here the day-names can be regarded as an enumerated type. An arrow signifies that evaluation of the lefthand side results in the righthand side. Notice that in `(day-name->day-number (quote Friday))' symbol `Friday' is quoted. This expression is quite different from: (day-name->day-number Friday) --> error because variable `Friday' is not bound. When evaluating the latter, Scheme interprets the symbol `Friday' as the name of a variable (which in the above code has not been bound and therefore causes an error) The names of variables are usually called `identifiers' because they identify storage locations containing values. Now, if we first define: (define Friday (quote Friday)) then we have: (day-name->day-number Friday) --> 5 When evaluating the line `(define Friday (quote Friday))', symbol `Friday' is used both as an identifier that refers to a storage location and as a value to be stored at that location. When evaluating the line `(day-name->day-number Friday)' the token `Friday' is used as an identifier and its value is the symbol `Friday'. Because symbols (and more generally symbolic expressions) are data and programs are written as symbolic expressions, it is relatively easy to write procedures that can manipulate programs, for example an interpreter for a simple subset of Scheme (making a *good* interpreter/compiler for all of Scheme is quite another thing) If we would like to write a C-compiler in C, then we would have to read the C-program as a sequence of characters and do all of the token parsing. In Scheme the tokens are already parsed by a simple read (or by read-syntax) Because symbols in a program text can denote both the identifiers of variables and symbols used as data, symbols must be quoted when used as data (usually, for example in the above case statement, syntax case does the quoting implicitly) A number needs no quotation because it cannot refer to any other thing than itself. But when inserting a list in a program to be used as data, then this list must be quoted, for otherwise it would be interpreted as code to be evaluated. (write 5) --> writes 5 (write (quote 5)) --> writes 5 (write (+ 2 3)) --> writes 5 (write (quote (+ 2 3))) --> writes (+ 2 3) Proper use of quotation is not self evident, particularly (as in Scheme) when the quoted fragments have the same appearence as the language used to talk about the quotations. It was until the start of the twentiest century that even some famous mathematiciens sometimes confused the use and the mention of a word. mention: `letter' is a word, not a letter. use: I send you this letter and hope it is usefull. Jos ----- Original Message ----- From: "Grant Rettke" To: "PLT List" Sent: Sunday, February 15, 2009 5:38 PM Subject: [plt-scheme] Help with symbols > Hi, > > I have a question about symbols in Scheme. > > (symbol? '5) => #f > > Is this the case because 5 is self-evaluating and for lack of a better > term, "5 is 5"? > > (symbol? '(+ 1 2)) =? #f > > Is this the case because it is a quoted list, and not a "name"? > > I see that I don't know much more about symbols other than they are a > quoted sequence of characters about which I am not sure of the > restrictions. Is there more to know about them? Where? > > Best wishes, > > Grant > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From eli at barzilay.org Sun Feb 15 15:42:34 2009 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:41:12 2009 Subject: Fwd: [plt-scheme] Newbie Lambda( ) (???????????) In-Reply-To: References: <8C311BF9-6308-4357-96F6-6D1F983130D9@gmail.com> <52D7DE59-B39C-48F4-935D-DB00210E4DA7@adelphi.edu> <949DBC39-5EB3-4311-9738-E87CCAE7E6F6@gmail.com> <9b1fff280902131403o66300a6fse3a199e985ded436@mail.gmail.com> <18839.39871.84040.779338@arabic.ccs.neu.edu> Message-ID: <18840.32314.173903.724692@arabic.ccs.neu.edu> On Feb 15, e wrote: > thanks. that's helpful to know. A few things I can say > definitively (rather than my former vagueness): > > 1) I still can't select the individual mail option for the google > group. yet, I am getting individual mail as if it is working > correctly. I ALSO get the digest (which I don't actually want and > end up deleting). I've never had any problems before. I don't know how you got to that situation -- the google groups interface is the same as it always is. I did see that you had the digest option in google (which gave you the digest emails) and since I subscribed you to the plt mailing list too you got the emails directly from it. So to fix it, I changed your google groups subscription to plain emails, and set the "no mail" option in the PLT Scheme mailing list. This is the usual setup for reading the list elsewhere but still be able to post as usual. (I wish the google groups thing would do what gmane does -- it allows people to post through it.) > 2) In other groups, the mail just comes from the message group > email address. Here the message comes from the sender, and the cc > is the message group email address. Because I was forgetting to do > "reply all", I wasn't picking up the message group, and wound up > only sending back to the previous sender. Well, my guess is that you're used to the way google groups distributes emails. The PLT list is leaving the sender intact -- which is usually considered as a much better option. See http://www.unicom.com/pw/reply-to-harmful.html for a very detailed description of why it is better. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From plragde at uwaterloo.ca Sun Feb 15 16:13:33 2009 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:41:12 2009 Subject: [plt-scheme] Newbie question: Why "orange text, black background" after Run? In-Reply-To: <49A67A6F-DF27-4DC8-9CA8-880C51565612@ccs.neu.edu> Message-ID: <4998857D.5080509@uwaterloo.ca> Matthias wrote: > DrScheme tells you that you haven't tested certain parts of your > program. If you really don't want to know that you haven't finished > designing your program, you can open the language dialog, look at the > details, and turn off coverage. -- Matthias I haven't succeeded in finding a place to turn this off. Can someone elaborate? Thanks. --PR From grettke at acm.org Sun Feb 15 17:41:32 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:12 2009 Subject: [plt-scheme] Does the R6RS mode support case-insensitive mode? Message-ID: <756daca50902151441w1f1e397cl162d80ea4f2c684e@mail.gmail.com> Does the R6RS language support case-insensitive mode? http://www.r6rs.org/final/html/r6rs-app/r6rs-app-Z-H-4.html#node_chap_B I don't see any mention of it in the PLT docs. If it does, how is it enabled? From sstrickl at ccs.neu.edu Sun Feb 15 17:47:52 2009 From: sstrickl at ccs.neu.edu (Stevie Strickland) Date: Thu Mar 26 02:41:12 2009 Subject: [plt-scheme] New contract-related features In-Reply-To: <1c1a33bc0902150323w7e94a730h53a66f0647cccb35@mail.gmail.com> References: <06EEF9E3-FE3D-4CBE-93F4-5A4FDCC33F20@ccs.neu.edu> <1c1a33bc0902150323w7e94a730h53a66f0647cccb35@mail.gmail.com> Message-ID: <0FF0E688-7D2F-4F13-8E59-2A17B41D2513@ccs.neu.edu> On Feb 15, 2009, at 6:23 AM, Thomas Chust wrote: > 2009-02-15 Stevie Strickland : >> In SVN I've added three new major features that involve contracts. >> One allows for more fine-grained control of contracts, and the other >> two allow for the use of contracts with signatures and units. >> [...] > > Wow, quite impressive enhancements and very useful ones :-) > > Are there any plans to add something along the same lines to classes > and interfaces in PLT Scheme, too, or is it even already possible to > use the new contract regions inside classes? To some extent you can, but not in a way to get what you'd really want from contracted classes and interfaces. Adding contracts to the class system is indeed planned, and I hope to turn my focus to that and get it going in the near future. Stevie From grettke at acm.org Sun Feb 15 18:28:20 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:12 2009 Subject: [plt-scheme] Help remembering an article about different ways to implement macros in Scheme Message-ID: <756daca50902151528m4528e685pbf3f4e4379e5c9c7@mail.gmail.com> Once on this list someone referenced an article on the Bigloo mailing list that explain all of the different ways that have been covered for implementing macros in Scheme.It also explained how to implemement hygiene in those different ways. Does anyone recall that article? It may have been linked on Lambda the Ultimate also; but I can't seem to find it anywhere. From geb_a at yahoo.com Sun Feb 15 20:37:05 2009 From: geb_a at yahoo.com (geb a) Date: Thu Mar 26 02:41:12 2009 Subject: [plt-edu] Re: [plt-scheme] behaviour of void? In-Reply-To: <756daca50902142035m6a072d9dtfa57c8089d5b0fce@mail.gmail.com> Message-ID: <969170.53738.qm@web50910.mail.re2.yahoo.com> Yes, the focus is on htdp with advanced students working on projects that use programming in other disciplines. I really believe that computer science should be central to a strong technical background. In fact, a computer science student should be able to compute circles around any other student. Dan Anderson --- On Sat, 2/14/09, Grant Rettke wrote: > From: Grant Rettke > Subject: Re: [plt-edu] Re: [plt-scheme] behaviour of void? > To: geb_a@yahoo.com > Cc: "Prabhakar Ragde" , "Matthias Felleisen" , "plt edu" , "Shriram Krishnamurthi" , "PLT List" > Date: Saturday, February 14, 2009, 8:35 PM > On Thu, Feb 5, 2009 at 8:23 PM, geb a > wrote: > > So what kinds of exercises are you looking for? I > guess I'm in the unique position of being able to use > programming to teach Science, Technology, Engineering and > Mathematics projects. As a high school teacher, I feel > like computer science should be about integrating these > disciplines. > > I wish I had gone to school where you teach. Is it common > practice for > highschools these days to include CS? What is your title? > CS teacher? From rcleis at mac.com Sun Feb 15 21:59:26 2009 From: rcleis at mac.com (Richard Cleis) Date: Thu Mar 26 02:41:13 2009 Subject: [plt-edu] Re: [plt-scheme] behaviour of void? In-Reply-To: <969170.53738.qm@web50910.mail.re2.yahoo.com> References: <969170.53738.qm@web50910.mail.re2.yahoo.com> Message-ID: <57632263-ACC0-481B-B2F5-5F6E440A7877@mac.com> On Feb 15, 2009, at 6:37 PM, geb a wrote: > > > Yes, the focus is on htdp with advanced students working on projects > that use programming in other disciplines. I really believe that > computer science should be central to a strong technical > background. In fact, a computer science student should be able to > compute circles around any other student. Are you saying that graduates of other disciplines should know more of what CS graduates know? Or are you saying that CS graduates should be able to implement better software for the other disciplines than the disciplines can muster themselves? In my world, it seems that overall effectiveness doesn't match up to our considerable individual abilities because it is nearly impossible to mix & match the resources of all of the disciplines. It would be wonderful if the tech disciplines knew more about CS, but I don't see that ever happening. I do hope for the day when more effective overlapping of expertise comes to pass. rac > > > Dan Anderson > > > --- On Sat, 2/14/09, Grant Rettke wrote: > >> From: Grant Rettke >> Subject: Re: [plt-edu] Re: [plt-scheme] behaviour of void? >> To: geb_a@yahoo.com >> Cc: "Prabhakar Ragde" , "Matthias Felleisen" > >, "plt edu" , "Shriram Krishnamurthi" > >, "PLT List" >> Date: Saturday, February 14, 2009, 8:35 PM >> On Thu, Feb 5, 2009 at 8:23 PM, geb a >> wrote: >>> So what kinds of exercises are you looking for? I >> guess I'm in the unique position of being able to use >> programming to teach Science, Technology, Engineering and >> Mathematics projects. As a high school teacher, I feel >> like computer science should be about integrating these >> disciplines. >> >> I wish I had gone to school where you teach. Is it common >> practice for >> highschools these days to include CS? What is your title? >> CS teacher? > > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From andre.mayers at usherbrooke.ca Sun Feb 15 21:21:29 2009 From: andre.mayers at usherbrooke.ca (Andre Mayers) Date: Thu Mar 26 02:41:13 2009 Subject: [plt-scheme] How to find the value associated to a symbol via an identifier ? In-Reply-To: <18840.32314.173903.724692@arabic.ccs.neu.edu> Message-ID: <0KF400KZ7ZTFF560@VL-MO-MR003.ip.videotron.ca> I would like to define "find-symbol-value", a function or a macro that will do the following (define id45 45) (define idid 'id45) (define (find-symbol-value symb) ...) (find-symbol-value idid) ; ==> 45 From eli at barzilay.org Sun Feb 15 22:35:11 2009 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:41:13 2009 Subject: [plt-scheme] How to find the value associated to a symbol via an identifier ? In-Reply-To: <0KF400KZ7ZTFF560@VL-MO-MR003.ip.videotron.ca> References: <18840.32314.173903.724692@arabic.ccs.neu.edu> <0KF400KZ7ZTFF560@VL-MO-MR003.ip.videotron.ca> Message-ID: <18840.57071.514658.440387@arabic.ccs.neu.edu> On Feb 15, Andre Mayers wrote: > I would like to define "find-symbol-value", a function or a macro > that will do the following > > (define id45 45) > (define idid 'id45) > > (define (find-symbol-value symb) > ...) > > (find-symbol-value idid) > ; ==> 45 It is possible to do this, but not in a way that will make you happy. Perhaps you really need something like this: (define id45 (box 45)) (define idid id45) (unbox idid) ; ==> 45 ? -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From grettke at acm.org Sun Feb 15 23:01:41 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:13 2009 Subject: [plt-scheme] How to find the value associated to a symbol via an identifier ? In-Reply-To: <18840.57071.514658.440387@arabic.ccs.neu.edu> References: <18840.32314.173903.724692@arabic.ccs.neu.edu> <0KF400KZ7ZTFF560@VL-MO-MR003.ip.videotron.ca> <18840.57071.514658.440387@arabic.ccs.neu.edu> Message-ID: <756daca50902152001s3696e27ev5a6551110b21feff@mail.gmail.com> On Sun, Feb 15, 2009 at 9:35 PM, Eli Barzilay wrote: > It is possible to do this, but not in a way that will make you happy. Is there a not-ugly non-macro-generating way to do this? From eli at barzilay.org Sun Feb 15 23:12:36 2009 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:41:13 2009 Subject: [plt-scheme] How to find the value associated to a symbol via an identifier ? In-Reply-To: <756daca50902152001s3696e27ev5a6551110b21feff@mail.gmail.com> References: <18840.32314.173903.724692@arabic.ccs.neu.edu> <0KF400KZ7ZTFF560@VL-MO-MR003.ip.videotron.ca> <18840.57071.514658.440387@arabic.ccs.neu.edu> <756daca50902152001s3696e27ev5a6551110b21feff@mail.gmail.com> Message-ID: <18840.59316.279993.466602@arabic.ccs.neu.edu> On Feb 15, Grant Rettke wrote: > On Sun, Feb 15, 2009 at 9:35 PM, Eli Barzilay wrote: > > It is possible to do this, but not in a way that will make you > > happy. > > Is there a not-ugly non-macro-generating way to do this? No, at least not for my definition of "not-ugly". And there's a reason for that: questions like this are always about something that could be done in a better way. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From eviertel at gmail.com Mon Feb 16 00:04:16 2009 From: eviertel at gmail.com (e) Date: Thu Mar 26 02:41:14 2009 Subject: [plt-scheme] nested vectors In-Reply-To: <49973A3C.6040001@cs.utah.edu> References: <1ac64f9a-f0f5-4201-a7f3-35690e0c7703@b38g2000prf.googlegroups.com> <49973A3C.6040001@cs.utah.edu> Message-ID: is something like this an acceptable approach? (just teat a linear array like a 2d array). seems like a better version of this stuff is probably part of the included stuff, I would imagine. Like there's probably a way to get the size of a vector. I was going to make a (array-2d-print) function, too that displays it like a grid ..... maybe tomorrow. Any suggested improvements or directions are of course welcome. (define (make-array-2d size initial) (make-vector (* size size) initial)) (define (array-2d-ref array size row col) (vector-ref array (+ (* row size) col))) (define (array-2d-set! array size row col value) (vector-set! array (+ (* row size) col))) > (define deposits (make-array-2d 17 0)) > (array-2d-ref deposits 17 0 11) 0 > (array-2d-set! deposits 17 0 11 39) > (array-2d-ref deposits 17 0 11) 39 On Sat, Feb 14, 2009 at 4:40 PM, Chongkai Zhu wrote: > and every slot of the vector is filled with `fill'. In your -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090216/552ed95a/attachment.htm From wookiz at hotmail.com Mon Feb 16 01:15:15 2009 From: wookiz at hotmail.com (wooks) Date: Thu Mar 26 02:41:14 2009 Subject: [plt-scheme] for-each - analagous to map Message-ID: <822e6970-021d-40fb-a4f9-7deb900bd289@m40g2000yqh.googlegroups.com> Travelling salesman. So I have a tour that is list of numbers each representing cities (0 11 3 7) I need to get each journey 0 - 11, 11 - 3, 3 - 7 etc I do this (map (lambda (cities shifted-copy) ....) cities (append (cdr cities) (list (car cities))) getting (0 11 3 7) and (11 3 7 0) as my inputs to map. So now the car of each list (recursively) constitutes my trip Ok that was just motivation. I want to do this for side effects. Does for-each share maps ability to traverse multiple lists in this way. From eli at barzilay.org Mon Feb 16 01:20:52 2009 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:41:14 2009 Subject: [plt-scheme] for-each - analagous to map In-Reply-To: <822e6970-021d-40fb-a4f9-7deb900bd289@m40g2000yqh.googlegroups.com> References: <822e6970-021d-40fb-a4f9-7deb900bd289@m40g2000yqh.googlegroups.com> Message-ID: <18841.1476.567749.132799@arabic.ccs.neu.edu> On Feb 15, wooks wrote: > [...] > Does for-each share maps ability to traverse multiple lists in this > way. Yes -- it's easy to try it: (for-each (lambda (x y) (printf "~s: ~s\n" x y)) '(1 2 3) '(a b c)) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From spamme at innerpaths.net Mon Feb 16 01:36:04 2009 From: spamme at innerpaths.net (Gregg Williams) Date: Thu Mar 26 02:41:15 2009 Subject: [plt-scheme] Re: Newbie question: Why "orange text, black background" after Run? In-Reply-To: <49A67A6F-DF27-4DC8-9CA8-880C51565612@ccs.neu.edu> References: <9F230C05-E66A-4206-8DCC-B5B7D3C3FC0E@innerpaths.net> <49A67A6F-DF27-4DC8-9CA8-880C51565612@ccs.neu.edu> Message-ID: <99b7d541-cb90-467f-bd0d-4bfba4e073fb@x29g2000prf.googlegroups.com> Thanks for the explanatory message you sent recently. Attempting to follow your instructions, I executed the menu item Language > Choose Language..., which gave me a list of languages and the parameters that can be changed. For the "Advanced Student" language (which is what I was using), here are the parameters that I can change: case-sensitive; output style = constructor/quasiquote/write; fraction style = mixed fractions/repeating decimals; checkbox: insert new lines in printed values; checkbox: show sharing in values. However, I don't see anything that allows me to turn this highlighting feature off. Searching for "coverage" in the Help Desk documentation leads me to the "Errortrace: Debugging and Profiling" document, but I don't find anything that looks useful here, either. Finally, I read Andrei Estioco's comment and see now that the orange/ black highlighting goes away for whatever lines of code that get "exercised" when you execute code from the bottom panel, thus showing you the parts of your code that (so far, at least) have not gotten "coverage." This is a useful feature, but I've not found any documentation for how to control it. If you (or anyone else) could point us newcomers to some relevant documentation, we would certainly appreciate it. Thanks. On Feb 15, 7:45?am, Matthias Felleisen wrote: > DrScheme tells you that you haven't tested certain parts of your ? > program. If you really don't want to know that you haven't finished ? > designing your program, you can open the language dialog, look at the ? > details, and turn off coverage. -- Matthias From spamme at innerpaths.net Mon Feb 16 01:36:56 2009 From: spamme at innerpaths.net (Gregg Williams) Date: Thu Mar 26 02:41:15 2009 Subject: [plt-scheme] Re: Newbie question: Why "orange text, black background" after Run? In-Reply-To: <49A67A6F-DF27-4DC8-9CA8-880C51565612@ccs.neu.edu> References: <9F230C05-E66A-4206-8DCC-B5B7D3C3FC0E@innerpaths.net> <49A67A6F-DF27-4DC8-9CA8-880C51565612@ccs.neu.edu> Message-ID: Thanks for the explanatory message you sent recently. Attempting to follow your instructions, I executed the menu item Language > Choose Language..., which gave me a list of languages and the parameters that can be changed. For the "Advanced Student" language (which is what I was using), here are the parameters that I can change: case-sensitive; output style = constructor/quasiquote/write; fraction style = mixed fractions/repeating decimals; checkbox: insert new lines in printed values; checkbox: show sharing in values. However, I don't see anything that allows me to turn this highlighting feature off. Searching for "coverage" in the Help Desk documentation leads me to the "Errortrace: Debugging and Profiling" document, but I don't find anything that looks useful here, either. Finally, I read Andrei Estioco's comment and see now that the orange/ black highlighting goes away for whatever lines of code that get "exercised" when you execute code from the bottom panel, thus showing you the parts of your code that (so far, at least) have not gotten "coverage." This is a useful feature, but I've not found any documentation for how to control it. If you (or anyone else) could point us newcomers to some relevant documentation, we would certainly appreciate it. Thanks. --Gregg From jos.koot at telefonica.net Mon Feb 16 04:46:11 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:41:15 2009 Subject: [plt-scheme] for-each - analagous to map References: <822e6970-021d-40fb-a4f9-7deb900bd289@m40g2000yqh.googlegroups.com> Message-ID: <1E5B58BBA118435699CBFE688678EC98@uw2b2dff239c4d> yes jos ----- Original Message ----- From: "wooks" To: Sent: Monday, February 16, 2009 7:15 AM Subject: [plt-scheme] for-each - analagous to map > Travelling salesman. So I have a tour that is list of numbers each > representing cities (0 11 3 7) > > I need to get each journey 0 - 11, 11 - 3, 3 - 7 etc > > I do this > > (map (lambda (cities shifted-copy) ....) cities (append (cdr cities) > (list (car cities))) > > getting (0 11 3 7) and (11 3 7 0) as my inputs to map. > > So now the car of each list (recursively) constitutes my trip > > Ok that was just motivation. I want to do this for side effects. > > Does for-each share maps ability to traverse multiple lists in this > way. > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From robby at eecs.northwestern.edu Mon Feb 16 07:31:27 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Mar 26 02:41:15 2009 Subject: [plt-scheme] for-each - analagous to map In-Reply-To: <1E5B58BBA118435699CBFE688678EC98@uw2b2dff239c4d> References: <822e6970-021d-40fb-a4f9-7deb900bd289@m40g2000yqh.googlegroups.com> <1E5B58BBA118435699CBFE688678EC98@uw2b2dff239c4d> Message-ID: <932b2f1f0902160431x1c68ffdm217059511d7469d@mail.gmail.com> > (for-each (lambda (x y) (printf "got ~s ~s\n" x y)) '(1 2 3) '(a b c)) got 1 a got 2 b got 3 c On Mon, Feb 16, 2009 at 3:46 AM, Jos Koot wrote: > yes > jos > > ----- Original Message ----- From: "wooks" > To: > Sent: Monday, February 16, 2009 7:15 AM > Subject: [plt-scheme] for-each - analagous to map > > >> Travelling salesman. So I have a tour that is list of numbers each >> representing cities (0 11 3 7) >> >> I need to get each journey 0 - 11, 11 - 3, 3 - 7 etc >> >> I do this >> >> (map (lambda (cities shifted-copy) ....) cities (append (cdr cities) >> (list (car cities))) >> >> getting (0 11 3 7) and (11 3 7 0) as my inputs to map. >> >> So now the car of each list (recursively) constitutes my trip >> >> Ok that was just motivation. I want to do this for side effects. >> >> Does for-each share maps ability to traverse multiple lists in this >> way. >> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From noelwelsh at gmail.com Mon Feb 16 07:50:23 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:41:15 2009 Subject: [plt-scheme] nested vectors In-Reply-To: References: <1ac64f9a-f0f5-4201-a7f3-35690e0c7703@b38g2000prf.googlegroups.com> <49973A3C.6040001@cs.utah.edu> Message-ID: On Mon, Feb 16, 2009 at 5:04 AM, e wrote: > is something like this an acceptable approach? ... > > (define (make-array-2d size initial) > (make-vector (* size size) initial)) > > (define (array-2d-ref array size row col) > (vector-ref array (+ (* row size) col))) > > (define (array-2d-set! array size row col value) > (vector-set! array (+ (* row size) col))) Yeah, that is a pretty standard solution. If you aren't doing this just as a learning exercise look at the matrix package on planet by Will Farr. N. From robby at eecs.northwestern.edu Mon Feb 16 07:54:04 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Mar 26 02:41:15 2009 Subject: [plt-scheme] Re: Newbie question: Why "orange text, black background" after Run? In-Reply-To: References: <9F230C05-E66A-4206-8DCC-B5B7D3C3FC0E@innerpaths.net> <49A67A6F-DF27-4DC8-9CA8-880C51565612@ccs.neu.edu> Message-ID: <932b2f1f0902160454t7441b6f8qb3a768239a5bd7cd@mail.gmail.com> I believe it cannot be disabled for the teaching languages. I've added a little bit of explanation to the teaching languages manuals. Below is the raw source text for that. Comments welcome. Robby The languages documented in this manual are provided by DrScheme to be used with the @italic{@link["http://www.htdp.org/"]{How to Design Programs}} book. When programs in these languages are run in DrScheme, any part of the program that was not run is highlighted in orange and black. These colors are intended to give the programmer feedback about the parts of the program that have not been tested. To avoid seeing these colors, use @scheme[check-expect] to test your program. Of course, just because you see no colors, does not mean that your program has been fully tested; it simply means that each part of the program been run (at least once). On Mon, Feb 16, 2009 at 12:36 AM, Gregg Williams wrote: > Thanks for the explanatory message you sent recently. Attempting to > follow your instructions, I executed the menu item Language > Choose > Language..., which gave me a list of languages and the parameters that > can be changed. For the "Advanced Student" language (which is what I > was using), here are the parameters that I can change: case-sensitive; > output style = constructor/quasiquote/write; fraction style = mixed > fractions/repeating decimals; checkbox: insert new lines in printed > values; checkbox: show sharing in values. However, I don't see > anything that allows me to turn this highlighting feature off. > > Searching for "coverage" in the Help Desk documentation leads me to > the "Errortrace: Debugging and Profiling" document, but I don't find > anything that looks useful here, either. > > Finally, I read Andrei Estioco's comment and see now that the orange/ > black highlighting goes away for whatever lines of code that get > "exercised" when you execute code from the bottom panel, thus showing > you the parts of your code that (so far, at least) have not gotten > "coverage." This is a useful feature, but I've not found any > documentation for how to control it. > > If you (or anyone else) could point us newcomers to some relevant > documentation, we would certainly appreciate it. Thanks. > > --Gregg > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From grettke at acm.org Mon Feb 16 11:20:50 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:16 2009 Subject: [plt-scheme] How to find the value associated to a symbol via an identifier ? In-Reply-To: <18840.59316.279993.466602@arabic.ccs.neu.edu> References: <18840.32314.173903.724692@arabic.ccs.neu.edu> <0KF400KZ7ZTFF560@VL-MO-MR003.ip.videotron.ca> <18840.57071.514658.440387@arabic.ccs.neu.edu> <756daca50902152001s3696e27ev5a6551110b21feff@mail.gmail.com> <18840.59316.279993.466602@arabic.ccs.neu.edu> Message-ID: <756daca50902160820x1e6a246ar62f1e3e0f8a5fa32@mail.gmail.com> On Sun, Feb 15, 2009 at 10:12 PM, Eli Barzilay wrote: > On Feb 15, Grant Rettke wrote: >> Is there a not-ugly non-macro-generating way to do this? > > No, at least not for my definition of "not-ugly". And there's a > reason for that: questions like this are always about something that > could be done in a better way. While I can speak for the original poster; I found that there was a period where I simply wanted to find out whether *anything* could be done using macros. Often times the answer was yes, but it was ugly, and there was almost always a better solution. That certainly didn't dissuade me at the time, though. From czhu at cs.utah.edu Mon Feb 16 11:21:05 2009 From: czhu at cs.utah.edu (Chongkai Zhu) Date: Thu Mar 26 02:41:16 2009 Subject: [plt-scheme] nested vectors In-Reply-To: References: <1ac64f9a-f0f5-4201-a7f3-35690e0c7703@b38g2000prf.googlegroups.com> <49973A3C.6040001@cs.utah.edu> Message-ID: <49999271.4020200@cs.utah.edu> Yes, this is good (more than acceptable). Chongkai e wrote: > is something like this an acceptable approach? (just teat a linear > array like a 2d array). seems like a better version of this stuff is > probably part of the included stuff, I would imagine. Like there's > probably a way to get the size of a vector. I was going to make a > (array-2d-print) function, too that displays it like a grid ..... > maybe tomorrow. Any suggested improvements or directions are of > course welcome. > > (define (make-array-2d size initial) > (make-vector (* size size) initial)) > > (define (array-2d-ref array size row col) > (vector-ref array (+ (* row size) col))) > > (define (array-2d-set! array size row col value) > (vector-set! array (+ (* row size) col))) > > > (define deposits (make-array-2d 17 0)) > > > (array-2d-ref deposits 17 0 11) > 0 > > > (array-2d-set! deposits 17 0 11 39) > > > (array-2d-ref deposits 17 0 11) > 39 > > > > On Sat, Feb 14, 2009 at 4:40 PM, Chongkai Zhu > wrote: > > and every slot of the vector is filled with `fill'. In your > > From anh at cs.rit.edu Mon Feb 16 13:31:19 2009 From: anh at cs.rit.edu (Arthur Nunes-Harwit) Date: Thu Mar 26 02:41:16 2009 Subject: [plt-scheme] HtDP in Python! Message-ID: Hi, I'm interested in getting reactions to doing programming HtDP style but in Python. Here is an example. Thanks. -Arthur # Data Definitions: # a linkedList is either # + an emptyList # + an elementList with parts # * o, where o is an object and # * ll, where ll is a linkedList class emptyList(tuple): pass # Constructor: nullList: () -> linkedList def nullList(): return emptyList(()) class elementList (tuple): def head(self): return self[0] def tail(self): return self[1] # Constructor: cons: object linkedList -> linkedList def cons(o, ll): return elementList((o, ll)); # Contract: length: linkedList -> nat # Purpose: to count the number of objects in a linkedList # Example: length(cons('a', cons('b', nullList()))) == 2 # Template: # def length(ll): # if isinstance(ll, emptyList): # return ... # elif isinstance(ll, elementList): # return ... ll.head() ... length(ll.tail()) ... # else: # raise RuntimeError("length's input not a linkedList") # Definition: def length(ll): if isinstance(ll, emptyList): return 0 elif isinstance(ll, elementList): return 1 + length(ll.tail()) else: raise RuntimeError("length's input not a linkedList") # Tests: length(nullList()) == 0 length(cons('a', cons('b', nullList()))) == 2 From sk at cs.brown.edu Mon Feb 16 13:38:07 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:41:16 2009 Subject: [plt-scheme] HtDP in Python! In-Reply-To: References: Message-ID: 1. The whole point of the HtDP methodology is that it has nothing to do with Scheme. It's a universal recipe across programming languages, which is why we refrain from syntactic tricks (which are numerous and easy to build in Scheme). HtDC makes this point explicit in Java; a whole family of HtD* can make this point explicit for other languages. 2. Try the same with a tail-recursive program and see how far it goes. 3. You still have about 679 pages to go to meet the challenge of your subject line. (-: 4. Then you can port DrScheme, too. <-; Shriram From neil at neilvandyke.org Mon Feb 16 13:41:27 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:41:16 2009 Subject: [plt-scheme] HtDP in Python! In-Reply-To: References: Message-ID: <4999B357.9040209@neilvandyke.org> Arthur Nunes-Harwit wrote at 02/16/2009 01:31 PM: > > I'm interested in getting reactions to doing programming HtDP style > but in Python. Here is an example. Speaking as a non-PLT person... I suspect that trying to do HtDP with anything other than DrScheme would compromise the experience for the students. HtDP in Python might be interesting to play around with as a hack or learning exercise, in addition to proper HtDP, however. -- http://www.neilvandyke.org/ From eviertel at gmail.com Mon Feb 16 13:57:18 2009 From: eviertel at gmail.com (e) Date: Thu Mar 26 02:41:17 2009 Subject: [plt-scheme] nested vectors In-Reply-To: <49999271.4020200@cs.utah.edu> References: <1ac64f9a-f0f5-4201-a7f3-35690e0c7703@b38g2000prf.googlegroups.com> <49973A3C.6040001@cs.utah.edu> <49999271.4020200@cs.utah.edu> Message-ID: any way to ask a vector it's length? I tried (length), but it seemed to complain that I wasn't dealing with a list. seems like a long road to turn it into a list first. I guess I should look up how to mess with vectors in scheme. I'm thinking you don't need to pass around the length in the interface. On Mon, Feb 16, 2009 at 11:21 AM, Chongkai Zhu wrote: > Yes, this is good (more than acceptable). > > Chongkai > > e wrote: > >> is something like this an acceptable approach? (just teat a linear array >> like a 2d array). seems like a better version of this stuff is probably >> part of the included stuff, I would imagine. Like there's probably a way to >> get the size of a vector. I was going to make a (array-2d-print) function, >> too that displays it like a grid ..... maybe tomorrow. Any suggested >> improvements or directions are of course welcome. >> >> (define (make-array-2d size initial) >> (make-vector (* size size) initial)) >> >> (define (array-2d-ref array size row col) >> (vector-ref array (+ (* row size) col))) >> >> (define (array-2d-set! array size row col value) >> (vector-set! array (+ (* row size) col))) >> >> > (define deposits (make-array-2d 17 0)) >> >> > (array-2d-ref deposits 17 0 11) >> 0 >> >> > (array-2d-set! deposits 17 0 11 39) >> >> > (array-2d-ref deposits 17 0 11) >> 39 >> >> >> >> On Sat, Feb 14, 2009 at 4:40 PM, Chongkai Zhu > czhu@cs.utah.edu>> wrote: >> >> and every slot of the vector is filled with `fill'. In your >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090216/c0f5d3ce/attachment.html From jensaxel at soegaard.net Mon Feb 16 14:02:15 2009 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:41:17 2009 Subject: [plt-scheme] nested vectors In-Reply-To: References: <1ac64f9a-f0f5-4201-a7f3-35690e0c7703@b38g2000prf.googlegroups.com> <49973A3C.6040001@cs.utah.edu> <49999271.4020200@cs.utah.edu> Message-ID: <4999B837.9070603@soegaard.net> e skrev: > any way to ask a vector it's length? I tried (length), but it seemed to > complain that I wasn't dealing with a list. seems like a long road to > turn it into a list first. I guess I should look up how to mess with > vectors in scheme. I'm thinking you don't need to pass around the > length in the interface. Search the documentation. Open http://docs.plt-scheme.org/ Search for: vector length -- Jens Axel S?gaard From geb_a at yahoo.com Mon Feb 16 14:02:33 2009 From: geb_a at yahoo.com (geb a) Date: Thu Mar 26 02:41:17 2009 Subject: [plt-edu] Re: [plt-scheme] behaviour of void? In-Reply-To: <57632263-ACC0-481B-B2F5-5F6E440A7877@mac.com> Message-ID: <373276.75308.qm@web50904.mail.re2.yahoo.com> If you examine any of the technical disciplines, students in those disciplines would be much more effective with a knowledge of the programming principles laid out in htdp. In physics, I could have save much time with a knowledge of computing. Bioinformatics is almost completely a computer discipline. I'm convinced that one or two software courses in an engineering discipline is not sufficient. If drscheme could be turned into a general purpose environment that could handle large amounts of computation, it would make a perfect integrating language. My son, who characterized himself as a "non math person" in 7th grade and who was earning low B's and C's now earns perfect scores on his honors math exams. His success is a combination of tutoring and programming as well as a decision on his part to excel. But I believe that to a large degree, the skills he learned using htdp made the difference. I believe that when he goes to study engineering, he will benefit from what he learned. --- On Sun, 2/15/09, Richard Cleis wrote: > From: Richard Cleis > Subject: Re: [plt-edu] Re: [plt-scheme] behaviour of void? > To: geb_a@yahoo.com > Cc: "Grant Rettke" , plt-scheme@list.cs.brown.edu > Date: Sunday, February 15, 2009, 6:59 PM > On Feb 15, 2009, at 6:37 PM, geb a wrote: > > > > > > > Yes, the focus is on htdp with advanced students > working on projects that use programming in other > disciplines. I really believe that computer science should > be central to a strong technical background. In fact, a > computer science student should be able to compute circles > around any other student. > > Are you saying that graduates of other disciplines should > know more of what CS graduates know? Or are you saying that > CS graduates should be able to implement better software for > the other disciplines than the disciplines can muster > themselves? In my world, it seems that overall > effectiveness doesn't match up to our considerable > individual abilities because it is nearly impossible to mix > & match the resources of all of the disciplines. It > would be wonderful if the tech disciplines knew more about > CS, but I don't see that ever happening. I do hope for > the day when more effective overlapping of expertise comes > to pass. > > rac > > > > > > > Dan Anderson > > > > > > --- On Sat, 2/14/09, Grant Rettke > wrote: > > > >> From: Grant Rettke > >> Subject: Re: [plt-edu] Re: [plt-scheme] behaviour > of void? > >> To: geb_a@yahoo.com > >> Cc: "Prabhakar Ragde" > , "Matthias Felleisen" > , "plt edu" > , "Shriram > Krishnamurthi" , "PLT > List" > >> Date: Saturday, February 14, 2009, 8:35 PM > >> On Thu, Feb 5, 2009 at 8:23 PM, geb a > >> wrote: > >>> So what kinds of exercises are you looking > for? I > >> guess I'm in the unique position of being able > to use > >> programming to teach Science, Technology, > Engineering and > >> Mathematics projects. As a high school teacher, > I feel > >> like computer science should be about integrating > these > >> disciplines. > >> > >> I wish I had gone to school where you teach. Is it > common > >> practice for > >> highschools these days to include CS? What is your > title? > >> CS teacher? > > > > > > > > _________________________________________________ > > For list-related administrative tasks: > > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From eli at barzilay.org Mon Feb 16 14:07:18 2009 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:41:17 2009 Subject: [plt-scheme] nested vectors In-Reply-To: References: <1ac64f9a-f0f5-4201-a7f3-35690e0c7703@b38g2000prf.googlegroups.com> <49973A3C.6040001@cs.utah.edu> <49999271.4020200@cs.utah.edu> Message-ID: <18841.47462.829216.112813@arabic.ccs.neu.edu> On Feb 16, e wrote: > any way to ask a vector it's length? I tried (length), but it > seemed to complain that I wasn't dealing with a list. seems like a > long road to turn it into a list first. You want `vector-length'. > I guess I should look up how to mess with vectors in scheme. I'm > thinking you don't need to pass around the length in the interface. As a starting point, you can go to the documentation search page, and enter "L:scheme vector" -- it will show you all the bindings that exist in the `scheme' language that have `vector' in their name. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From sbloch at adelphi.edu Mon Feb 16 14:19:29 2009 From: sbloch at adelphi.edu (Stephen Bloch) Date: Thu Mar 26 02:41:17 2009 Subject: [plt-scheme] HtDP in Python! In-Reply-To: <4999B357.9040209@neilvandyke.org> References: <4999B357.9040209@neilvandyke.org> Message-ID: <828920EA-9582-43DF-8486-9EC13EB591DB@adelphi.edu> On Feb 16, 2009, at 1:41 PM, Neil Van Dyke wrote: > Arthur Nunes-Harwit wrote at 02/16/2009 01:31 PM: >> >> I'm interested in getting reactions to doing programming HtDP >> style but in Python. Here is an example. > > Speaking as a non-PLT person... I suspect that trying to do HtDP > with anything other than DrScheme would compromise the experience > for the students. Well, yes, but sometimes you have to. My department, for example, has made clear that CS1 for majors WILL be in Java from beginning to end. So I spent the first two weeks writing static methods involving int, double, and String, then introduced a Posn class and showed how to write methods on Posns, both statically and non-statically. Today I'm introducing booleans, again starting with static methods on int, double, and String, then writing some non-static methods that return booleans or require conditionals. It's not ideal, but I think it's a lot better than starting with assignment statements and System.out.println on Day 1. Stephen Bloch sbloch@adelphi.edu From grettke at acm.org Mon Feb 16 14:56:25 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:18 2009 Subject: [plt-scheme] HtDP in Python! In-Reply-To: References: Message-ID: <756daca50902161156g2952f2f6rc93b41070dc37cf0@mail.gmail.com> On Mon, Feb 16, 2009 at 12:31 PM, Arthur Nunes-Harwit wrote: > I'm interested in getting reactions to doing programming HtDP style but in Python. That is delightful: 1. The theory is that HtDP can be used with any language. Have you found that to be the case? 2. Any downsides compared to doing it with the teaching languages and DrScheme? 3. Have you developed any new opinions of Python as to its pros and cons? From adityashukla1983 at gmail.com Mon Feb 16 14:59:03 2009 From: adityashukla1983 at gmail.com (aditya shukla) Date: Thu Mar 26 02:41:18 2009 Subject: [plt-scheme] Combining digits to form numbers Message-ID: <73045cca0902161159u1ddeea39h8f818c288c8bccf9@mail.gmail.com> I am trying to solve this exercise from htdp http://www.htdp.org/2003-09-26/Book/curriculum-Z-H-8.html *Exercise 5.1.3.* Develop the function check-guess3. It implements a larger portion of the number guessing game of exercise 5.1.2than the function check-guess. Now the teachpack hands over the digits that the user guesses, not the number that they form. To simplify the problem a little bit, the game works with only three numbers. Thus, check-guess3 consumes three digits and a number. The first digit is the least significant, the third one is the most significant. The number is called target and represents the randomly chosen number. Depending on how guess, the number determined by the three digits, relates to target, check-guess3 produces one of the following three answers: 'TooSmall, ' Perfect, or 'TooLarge. The rest of the game is still implemented by *guess.ss*. To play the game with check-guess3, evaluate (guess-with-gui-3 check-guess3) after the function has been thoroughly tested. My solution is like this contract for check-guess3 ;; check-guess3 :: number * number * number * number > symbol header (define check-3 (lambda(lsb csb msb number)....) body (define check-guess3 (lambda(lsb csb msb number) (cond [(< guess(lsb csb msb) number) 'Toosmall] [(= guess(lsb csb msb) number) 'Perfect] [else 'Toolarge]))) contract for guess ;;guess :: number * number *number -> number header (define guess (lambda(lsb csb msb)...) body (define guess (lambda(lsb csb msb) This is the part which i was not able to do , how can i combine lsb , csb and msb so the number is of the form (msbcsblsb) .Is there any function in scheme which can do this )) Any help is appreciated. Aditya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090216/aeb691c5/attachment.htm From anh at cs.rit.edu Mon Feb 16 15:19:05 2009 From: anh at cs.rit.edu (Arthur Nunes-Harwit) Date: Thu Mar 26 02:41:18 2009 Subject: [plt-scheme] HtDP in Python! In-Reply-To: <756daca50902161156g2952f2f6rc93b41070dc37cf0@mail.gmail.com> References: <756daca50902161156g2952f2f6rc93b41070dc37cf0@mail.gmail.com> Message-ID: On Mon, 16 Feb 2009, Grant Rettke wrote: > On Mon, Feb 16, 2009 at 12:31 PM, Arthur Nunes-Harwit wrote: >> I'm interested in getting reactions to doing programming HtDP style but in Python. > > That is delightful: > > 1. The theory is that HtDP can be used with any language. Have you > found that to be the case? I believe that HtDP can be used with any language that supports functional programming. (Of course, there may not be support for the groovy web and graphics examples.) > 2. Any downsides compared to doing it with the teaching languages and DrScheme? I can't yet say. I am planning a course using Python. That wasn't my first choice. The curriculum committee was suggesting Scheme or Haskell. Most of the sub-committee members voted against both of those. We'll see what happens. I expect that we'll have students use unadulterated Python. That strikes me as an immediate disadvantage. The teaching languages are simpler and simpler to learn. > 3. Have you developed any new opinions of Python as to its pros and cons? I'll let you know. My choice for representing structures in Python is unconventional. I chose it for reasons of immutability and succinctness. I was bracing myself for negative reactions from both folks with Python experience and PLT Scheme folks. Pleasantly, that's not at all been the case so far. -Arthur From maxigas at anargeek.net Mon Feb 16 15:18:45 2009 From: maxigas at anargeek.net (maxigas) Date: Thu Mar 26 02:41:19 2009 Subject: [plt-scheme] HtDP in Python! In-Reply-To: References: Message-ID: <20090216.211845.140435454.maxigas@anargeek.net> From: Shriram Krishnamurthi Subject: Re: [plt-scheme] HtDP in Python! Date: Mon, 16 Feb 2009 13:38:07 -0500 > 2. Try the same with a tail-recursive program and see how far it goes. It actually depends on how far you stretch the stack. I usually do sth like this when i program Python with recursions: import sys sys.setrecursionlimit(1000) From reb at cs.bilgi.edu.tr Mon Feb 16 15:00:28 2009 From: reb at cs.bilgi.edu.tr (=?utf-8?Q?R=2E_Emre_Ba=C5=9Far?=) Date: Thu Mar 26 02:41:19 2009 Subject: [plt-scheme] Unbound variable at unit signature Message-ID: <20090216200028.GB3747@terra.galaxy> Hi all, We are trying to develop an extension to DrScheme. We are stuck at defining some new signatures for our unit. The main problem is our application consists of multiple units, which need to be invoked by a controller unit. Currently, we are trying to define signatures for those units, but we are unable to accomplish it. When we try to invoke a function in another unit we get this error which comes from the signature file: "expand: unbound variable in module" There is an example code at http://cs.bilgi.edu.tr/~reb/unit-example On another topic, are there any tutorials on creating and using units. We are having trouble in some points, and although we read the documentation, we are not able to find any examples in it. -- R. Emre Ba?ar ?stanbul Bilgi University Department of Computer Science -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090216/401c0201/attachment.pgp From matthias at ccs.neu.edu Mon Feb 16 15:42:07 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:41:19 2009 Subject: [plt-scheme] HtDP in Python! In-Reply-To: References: <756daca50902161156g2952f2f6rc93b41070dc37cf0@mail.gmail.com> Message-ID: On Feb 16, 2009, at 3:19 PM, Arthur Nunes-Harwit wrote: > > I believe that HtDP can be used with any language that supports > functional programming. (Of course, there may not be support for > the groovy web and graphics examples.) As Shriram said, we have a successful transition to Java -- using the design recipe. Of course, because you have different means of abstractions in OOPLs than FPLs, HtDC needs additional chapters on creating and using abstractions. Furthermore, if you drive this thought to the end, you quickly realize how OOP design ends up looking functional. See abstraction of traversals in OOP, last chapter in HtDC. > I can't yet say. I am planning a course using Python. That > wasn't my first choice. The curriculum committee was suggesting > Scheme or Haskell. Most of the sub-committee members voted against > both of those. It is nonsense to evaluate a first course in terms of the language that is used. HtDP is as much about Scheme as Python is about basketweaving. The question is whether you teach notational mechanics in the first course or whether you teach design. From a purely egotistical pov, I welcome your decision of course. It means that you're putting your students at a great disadvantage in the first semester/year, and they may never catch up. Being at neighboring schools and competing for the same scarce slots in the Boston area, my students will have a unique advantage in four years from now. Please forward my thank-you to your colleagues. -- Matthias P.S. I gave a talk comparing the situation at NEU when I arrived here (and you know it) with the one that we have now wrt to our curriculum. Back then it was all-Java-all-first-year-and-no- programming jobs after five. Now it's the opposite. "Wir sind froh, dass die Absolventen schon Java k?nnen. Programmieren m?ssen wir denen halt noch beibringen." overheard in a German firm, via Mike Sperber From anh at cs.rit.edu Mon Feb 16 16:28:17 2009 From: anh at cs.rit.edu (Arthur Nunes-Harwit) Date: Thu Mar 26 02:41:19 2009 Subject: [plt-scheme] HtDP in Python! In-Reply-To: References: <756daca50902161156g2952f2f6rc93b41070dc37cf0@mail.gmail.com> Message-ID: Dear Matthias, > It is nonsense to evaluate a first course in terms of the language that is > used. HtDP is as much about Scheme as Python is about basketweaving. The > question is whether you teach notational mechanics in the first course or > whether you teach design. Your students already have an advantage: we currently teach notational mechanics. Any move closer to design is a win. -Arthur From sk at cs.brown.edu Mon Feb 16 16:30:12 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:41:20 2009 Subject: [plt-scheme] HtDP in Python! In-Reply-To: References: <756daca50902161156g2952f2f6rc93b41070dc37cf0@mail.gmail.com> Message-ID: > My choice for representing structures in Python is unconventional. I chose > it for reasons of immutability and succinctness. Proceed with caution. This seems like a clever idea. The committee won't look at the details, and will go along with it. At the end of your first semester, you'll get lambasted in course reviews. It'll be by students who already "know Python", and find your representation choices not intriguing and mind-expanding but quirky, misguided, ridiculous, ignorant, and wrong. Your chair will call you in for a firm chat. You'll try it again. The evals will repeat. And in two years, you'll end up with a "intro programming in conventional Python" course. This is the folk wisdom from places that have tried to teach Java functionally. In short, make sure you have (a) the intestinal constitution (which I fully believe you do) and (b) the departmental support (the big if) before proceeding. Otherwise the result would be even worse than the alternatives. Shriram From neil at neilvandyke.org Mon Feb 16 16:32:33 2009 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:41:20 2009 Subject: [plt-scheme] HtDP in Python! In-Reply-To: References: <756daca50902161156g2952f2f6rc93b41070dc37cf0@mail.gmail.com> Message-ID: <4999DB71.3030201@neilvandyke.org> FWIW, a few years ago, when I was a new Architect at a company in Cambridge, one of the engineering managers asked me if I knew any good candidates for hiring at MIT. (MIT spinoffs tend to have a strong hiring bias towards MIT people, for various reasons.) I said I'd give it some thought, and then something like, "Actually, this might sound weird, but a great place to look is Northeastern." I went on to mention to the curriculum, which I thought was in some respects even better than MIT's, and to mention Matthias' group for poaching grad students. I don't have a good feel for the local job market right now, much less what it will be like in a few years, so I couldn't say much about which strictly-vocational skills an undergrad will want to have. But I *can* say that starting by learning HtDP and then some real Scheme will make you smarter than any Java-based anything that I've ever heard of. Being smarter has to be a good thing in a competitive and possibly chaotic job market. (Oh, do take as much Bio and Bio/Med-CS crossover courses as you can!) -- http://www.neilvandyke.org/ From anh at cs.rit.edu Mon Feb 16 16:43:28 2009 From: anh at cs.rit.edu (Arthur Nunes-Harwit) Date: Thu Mar 26 02:41:20 2009 Subject: [plt-scheme] HtDP in Python! In-Reply-To: References: <756daca50902161156g2952f2f6rc93b41070dc37cf0@mail.gmail.com> Message-ID: On Mon, 16 Feb 2009, Shriram Krishnamurthi wrote: >> My choice for representing structures in Python is unconventional. I chose >> it for reasons of immutability and succinctness. > > Proceed with caution. Thanks. I'll keep that in mind. -Arthur From grettke at acm.org Mon Feb 16 17:49:11 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:20 2009 Subject: [plt-scheme] How to find the value associated to a symbol via an identifier ? In-Reply-To: <18840.59316.279993.466602@arabic.ccs.neu.edu> References: <18840.32314.173903.724692@arabic.ccs.neu.edu> <0KF400KZ7ZTFF560@VL-MO-MR003.ip.videotron.ca> <18840.57071.514658.440387@arabic.ccs.neu.edu> <756daca50902152001s3696e27ev5a6551110b21feff@mail.gmail.com> <18840.59316.279993.466602@arabic.ccs.neu.edu> Message-ID: <756daca50902161449h5afb6a6fya5f1be1c24607416@mail.gmail.com> On Sun, Feb 15, 2009 at 10:12 PM, Eli Barzilay wrote: > On Feb 15, Grant Rettke wrote: >> Is there a not-ugly non-macro-generating way to do this? > > No, at least not for my definition of "not-ugly". And there's a > reason for that: questions like this are always about something that > could be done in a better way. I think this is a "macros for macros sake question". I see that this is a literal approach: #lang scheme (define id45 45) (define idid 'id45) (define-syntax find-symbol-value (lambda (stx) (syntax-case stx () ((find-symbol-value) (with-syntax ((var (datum->syntax #`find-symbol-value 'id45 #f))) #`var))))) (find-symbol-value) But none of what I have studied or learned (yet?) helps me understand how to easily generalize the solution. How would you do that? From sk at cs.brown.edu Mon Feb 16 17:54:00 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:41:20 2009 Subject: [plt-scheme] HtDP in Python! In-Reply-To: References: <756daca50902161156g2952f2f6rc93b41070dc37cf0@mail.gmail.com> Message-ID: Arthur, Since you seem to be seriously considering a course on this, here's something else to consider. Python, more than just about any language, is based on the opinion of one person. People who buy into Python think like Guido; those who don't, often don't. Guido does not appear to be a particularly big fan of functional programming. Sure, you can say import sys sys.setrecursionlimit(1000) But you might very well find that doing so is not considered good Python *style*, and in Python (in particular), style is a very serious consideration. You'll run into a wall of "Guido thinks that program should be written this other way: ...". This is not a problem that attends teaching with Scheme, partly because there is no Guido of Scheme, and partly because the style you want to use is already considered very much "the Scheme style". In other words, tread with great care around programming functionally in Python. Shriram From sstrickl at ccs.neu.edu Mon Feb 16 17:54:25 2009 From: sstrickl at ccs.neu.edu (Stevie Strickland) Date: Thu Mar 26 02:41:20 2009 Subject: [plt-scheme] Unbound variable at unit signature In-Reply-To: <20090216200028.GB3747@terra.galaxy> References: <20090216200028.GB3747@terra.galaxy> Message-ID: <9A19BE3E-1B69-4021-B161-A9EAF9008128@ccs.neu.edu> On Feb 16, 2009, at 3:00 PM, R. Emre Ba?ar wrote: > We are trying to develop an extension to DrScheme. We are stuck at > defining some new signatures for our unit. > > The main problem is our application consists of multiple units, which > need to be invoked by a controller unit. Currently, we are trying to > define signatures for those units, but we are unable to accomplish it. > > When we try to invoke a function in another unit we get this error > which > comes from the signature file: > > "expand: unbound variable in module" > > There is an example code at http://cs.bilgi.edu.tr/~reb/unit-example Looking at your code, everything looks good except that you are attempting to invoke the client unit without linking it to the server unit. When you do this, it can't find an appropriate version of echo, and so it fails. One example of what you might do after defining the client@ unit is the following: ;; This links together the client and server units into one unit (define-compound-unit/infer server+client@ (import) (export) (link server@ client@)) ;; This invokes the combined unit. (invoke-unit/infer server+client@) > On another topic, are there any tutorials on creating and using units. > We are having trouble in some points, and although we read the > documentation, we are not able to find any examples in it. Yes -- I would suggest the Unit chapter from the Guide: http://docs.plt-scheme.org/guide/units.html If you're running a 4.x version of PLT Scheme, you should have this installed locally as well. HTH, Stevie From eli at barzilay.org Mon Feb 16 17:55:33 2009 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:41:21 2009 Subject: [plt-scheme] How to find the value associated to a symbol via an identifier ? In-Reply-To: <756daca50902161449h5afb6a6fya5f1be1c24607416@mail.gmail.com> References: <18840.32314.173903.724692@arabic.ccs.neu.edu> <0KF400KZ7ZTFF560@VL-MO-MR003.ip.videotron.ca> <18840.57071.514658.440387@arabic.ccs.neu.edu> <756daca50902152001s3696e27ev5a6551110b21feff@mail.gmail.com> <18840.59316.279993.466602@arabic.ccs.neu.edu> <756daca50902161449h5afb6a6fya5f1be1c24607416@mail.gmail.com> Message-ID: <18841.61157.637967.99967@arabic.ccs.neu.edu> On Feb 16, Grant Rettke wrote: > > I see that this is a literal approach: > > #lang scheme > > (define id45 45) > (define idid 'id45) > > (define-syntax find-symbol-value > (lambda (stx) > (syntax-case stx () > ((find-symbol-value) > (with-syntax > ((var (datum->syntax #`find-symbol-value 'id45 #f))) > #`var))))) > > (find-symbol-value) You won't be able to do it this way -- note that your code doesn't use the value of `idid'. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From maxigas at anargeek.net Mon Feb 16 18:19:39 2009 From: maxigas at anargeek.net (maxigas) Date: Thu Mar 26 02:41:21 2009 Subject: [plt-scheme] HtDP in Python! In-Reply-To: References: Message-ID: <20090217.001939.11674725.maxigas@anargeek.net> From: Shriram Krishnamurthi Subject: Re: [plt-scheme] HtDP in Python! Date: Mon, 16 Feb 2009 17:54:00 -0500 > Python, more than just about any language, is based on the opinion of > one person. People who buy into Python think like Guido; those who > don't, often don't. Guido does not appear to be a particularly big > fan of functional programming. i don't want to bash Python, since it's my 2nd favourite, but that's very true. if you look at the changes between versions and the corresponding usegroup activity, you find that Python actually had pretty good support for functional programming, which was gradually dropped, feature after feature, and often at the Benevolent Dictator's personal dictum. of course this is a logical development of the "only one way of doing it" slogan, which at least i find really useful in Python. maxigas From grettke at acm.org Mon Feb 16 18:46:24 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:21 2009 Subject: [plt-scheme] How to find the value associated to a symbol via an identifier ? In-Reply-To: <18841.61157.637967.99967@arabic.ccs.neu.edu> References: <18840.32314.173903.724692@arabic.ccs.neu.edu> <0KF400KZ7ZTFF560@VL-MO-MR003.ip.videotron.ca> <18840.57071.514658.440387@arabic.ccs.neu.edu> <756daca50902152001s3696e27ev5a6551110b21feff@mail.gmail.com> <18840.59316.279993.466602@arabic.ccs.neu.edu> <756daca50902161449h5afb6a6fya5f1be1c24607416@mail.gmail.com> <18841.61157.637967.99967@arabic.ccs.neu.edu> Message-ID: <756daca50902161546y7673fbe8o4cf38db31475197a@mail.gmail.com> On Mon, Feb 16, 2009 at 4:55 PM, Eli Barzilay wrote: > You won't be able to do it this way -- note that your code doesn't use > the value of `idid'. Exactly. From plragde at uwaterloo.ca Mon Feb 16 19:08:45 2009 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:41:21 2009 Subject: [plt-scheme] HtDP in Python! In-Reply-To: Message-ID: <499A000D.8080808@uwaterloo.ca> Shriram wrote: > Python, more than just about any language, is based on the opinion of > one person. People who buy into Python think like Guido; those who > don't, often don't. Guido does not appear to be a particularly big > fan of functional programming. I guess the guy didn't choose his name, but still... doesn't it make you think of concrete boots? In all fairness, Python does have a community process of sorts, and Ruby is open to a similar criticism. Plus, going further back, Steele and Sussman got an amazing number of things right with the original design of Scheme, as did Milner with ML. (On the committee side of the balance, we have Algol 60 and Haskell.) The difference, I guess, is that these people were working from solid design principles and a deep understanding of the underlying theory. Maybe Guido has these, but somehow they're not evident in the actual design of the language. Another major problem with Python is the lack of anything remotely close to an educational IDE, unless you count stripped-down versions of Eclipse or other industrially-oriented tools. There was at least one attempt at DrPython independent of PLT Scheme, but it does not seem to have taken. While the design principles of HtDP do not depend on Scheme (or Scheme-like teaching languages), it is important to have a language with sufficiently minimal syntactic overhead that simply learning to express oneself and to understand the operation of programs written in the language do not swamp the design aspects. It's not easy to find alternatives. --PR From chadestioco at gmail.com Mon Feb 16 19:30:11 2009 From: chadestioco at gmail.com (Andrei Estioco) Date: Thu Mar 26 02:41:22 2009 Subject: [plt-scheme] It gets shared! Message-ID: Hello, I created a program which will display (in a list) a farey sequenceof level n. My code is as follows: (define-struct farey (num denom)) (define (farey-level n) (farey-acc (- n 1) (list (make-farey 0 1) (make-farey 1 1)))) (define (farey-acc n flist) (cond [(= n 0) flist] [else (farey-acc (- n 1) (insert-new-farey flist))])) (define (insert-new-farey flist) (append (get-first-two flist) (get-middle flist) (get-last-two flist))) (define (get-first-two flist) (list (first flist) (get-between flist) (second flist))) (define (get-middle flist) (local ((define (get-mid flist acc) (cond [(empty? flist) empty] [(= (length flist) 2) (reverse acc)] [else (get-mid (rest flist) (cons (first flist) acc))]))) (get-mid (rest (rest flist)) empty))) (define (get-last-two flist) (cond [(empty? (rest (rest flist))) (list (first flist) (get-between flist) (second flist))] [else (get-last-two (rest flist))])) (define (get-between flist) (make-farey (+ (farey-num (first flist)) (farey-num (second flist))) (+ (farey-denom (first flist)) (farey-denom (second flist))))) I test the code in Advanced Student. I call the function (farey-level 4) and get this result: > (shared ((-1- (make-farey 0 1)) (-9- (make-farey 1 1))) (list -1- (make-farey 1 4) (make-farey 1 3) (make-farey 1 2) -9- -1- (make-farey 1 2) (make-farey 2 3) (make-farey 3 4) -9-)) This is not the result I was expecting so I run the code again, this time in Intermediate Student, with the same function call, (farey-level 4). This is the result I get: >(list (make-farey 0 1) (make-farey 1 4) (make-farey 1 3) (make-farey 1 2) (make-farey 1 1) (make-farey 0 1) (make-farey 1 2) (make-farey 2 3) (make-farey 3 4) (make-farey 1 1)) Now that is the result I was expecting. My question is, why did it get (shared) in Advanced Student? I didn't even use (set!). The only instance I ever encountered (shared) was when I defined a doubly-linked list and, of course, I was expecting it then. Did I make a mistake in my code? -- Chad Estioco BS Computer Science University of the Philippines-Diliman ============================== http://www.geocities.com/lokisky_walker -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090217/3116eb63/attachment.htm From michael at schuerig.de Mon Feb 16 20:05:14 2009 From: michael at schuerig.de (Michael Schuerig) Date: Thu Mar 26 02:41:22 2009 Subject: [plt-scheme] Re: HtDP in Python! In-Reply-To: <499A000D.8080808@uwaterloo.ca> References: <499A000D.8080808@uwaterloo.ca> Message-ID: <200902170205.14583.michael@schuerig.de> On Tuesday 17 February 2009, Prabhakar Ragde wrote: > Shriram wrote: > > Python, more than just about any language, is based on the opinion > > of one person. People who buy into Python think like Guido; those > > who don't, often don't. Guido does not appear to be a particularly > > big fan of functional programming. > > I guess the guy didn't choose his name, but still... doesn't it make > you think of concrete boots? Me at least his name makes think of this http://en.wikipedia.org/wiki/R.U.R._(Rossum's_Universal_Robots) Michael -- Michael Schuerig mailto:michael@schuerig.de http://www.schuerig.de/michael/ From chust at web.de Mon Feb 16 20:08:49 2009 From: chust at web.de (Thomas Chust) Date: Thu Mar 26 02:41:22 2009 Subject: [plt-scheme] Combining digits to form numbers In-Reply-To: <73045cca0902161159u1ddeea39h8f818c288c8bccf9@mail.gmail.com> References: <73045cca0902161159u1ddeea39h8f818c288c8bccf9@mail.gmail.com> Message-ID: <1c1a33bc0902161708q75cb425cu1f6f8639a0cb8b38@mail.gmail.com> 2009-02-16 aditya shukla : > [...] > (define guess (lambda(lsb csb msb) > This is the part which i was not able to do , how can i combine lsb > , csb and msb so the number is of the form (msbcsblsb) .Is there any > function in scheme which can do this > > )) > [...] Hello, there are indeed functions in Scheme that can be used do this -- they are called + and * ;-) All you need to do is multiply each digit of the number with the value of its position and add up the results. If you want to create a more general solution for an arbitrary number of digits, a function like foldr comes in handy, too. cu, Thomas -- When C++ is your hammer, every problem looks like your thumb. From inforichland at gmail.com Mon Feb 16 20:21:56 2009 From: inforichland at gmail.com (Tim Wawrzynczak) Date: Thu Mar 26 02:41:23 2009 Subject: [plt-scheme] Combining digits to form numbers In-Reply-To: <1c1a33bc0902161708q75cb425cu1f6f8639a0cb8b38@mail.gmail.com> References: <73045cca0902161159u1ddeea39h8f818c288c8bccf9@mail.gmail.com> <1c1a33bc0902161708q75cb425cu1f6f8639a0cb8b38@mail.gmail.com> Message-ID: <4335a3260902161721x5686ba24od760a0ac0e484b13@mail.gmail.com> I think you're looking for something like this? (foldr (lambda (x y) ( + x (* y 10) )) 0 (reverse '(1 2 3))) = 123 - inforichland On Mon, Feb 16, 2009 at 7:08 PM, Thomas Chust wrote: > 2009-02-16 aditya shukla : > > [...] > > (define guess (lambda(lsb csb msb) > > This is the part which i was not able to do , how can i combine > lsb > > , csb and msb so the number is of the form (msbcsblsb) .Is there any > > function in scheme which can do this > > > > )) > > [...] > > Hello, > > there are indeed functions in Scheme that can be used do this -- they > are called + and * ;-) > > All you need to do is multiply each digit of the number with the value > of its position and add up the results. If you want to create a more > general solution for an arbitrary number of digits, a function like > foldr comes in handy, too. > > cu, > Thomas > > > -- > When C++ is your hammer, every problem looks like your thumb. > _________________________________________________ > 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/20090216/ae255863/attachment.html From matthias at ccs.neu.edu Mon Feb 16 20:55:05 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:41:23 2009 Subject: [plt-scheme] Combining digits to form numbers In-Reply-To: <4335a3260902161721x5686ba24od760a0ac0e484b13@mail.gmail.com> References: <73045cca0902161159u1ddeea39h8f818c288c8bccf9@mail.gmail.com> <1c1a33bc0902161708q75cb425cu1f6f8639a0cb8b38@mail.gmail.com> <4335a3260902161721x5686ba24od760a0ac0e484b13@mail.gmail.com> Message-ID: <0DAFB77D-C2E0-4A56-A466-D87B1A396C73@ccs.neu.edu> > > (foldl (lambda (x y) ( + x (* y 10) )) 0 '(1 2 3)) > 123 -- Matthias On Feb 16, 2009, at 8:21 PM, Tim Wawrzynczak wrote: > I think you're looking for something like this? > > (foldr (lambda (x y) ( + x (* y 10) )) 0 (reverse '(1 2 3))) > = 123 > > - inforichland > > On Mon, Feb 16, 2009 at 7:08 PM, Thomas Chust wrote: > 2009-02-16 aditya shukla : > > [...] > > (define guess (lambda(lsb csb msb) > > This is the part which i was not able to do , how can i > combine lsb > > , csb and msb so the number is of the form (msbcsblsb) .Is there any > > function in scheme which can do this > > > > )) > > [...] > > Hello, > > there are indeed functions in Scheme that can be used do this -- they > are called + and * ;-) > > All you need to do is multiply each digit of the number with the value > of its position and add up the results. If you want to create a more > general solution for an arbitrary number of digits, a function like > foldr comes in handy, too. > > cu, > Thomas > > > -- > When C++ is your hammer, every problem looks like your thumb. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090216/2c33cd31/attachment.htm From robby at eecs.northwestern.edu Mon Feb 16 21:00:27 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Mar 26 02:41:24 2009 Subject: [plt-scheme] Combining digits to form numbers In-Reply-To: <0DAFB77D-C2E0-4A56-A466-D87B1A396C73@ccs.neu.edu> References: <73045cca0902161159u1ddeea39h8f818c288c8bccf9@mail.gmail.com> <1c1a33bc0902161708q75cb425cu1f6f8639a0cb8b38@mail.gmail.com> <4335a3260902161721x5686ba24od760a0ac0e484b13@mail.gmail.com> <0DAFB77D-C2E0-4A56-A466-D87B1A396C73@ccs.neu.edu> Message-ID: <932b2f1f0902161800u6b7cb617r6f985f16c4ebb8ea@mail.gmail.com> ((lambda (l) (string->number (apply string-append (map number->string l)))) '(1 2 3)) = 123 ;P Robby On Mon, Feb 16, 2009 at 7:55 PM, Matthias Felleisen wrote: > >> (foldl (lambda (x y) ( + x (* y 10) )) 0 '(1 2 3)) > 123 > > -- Matthias > > > On Feb 16, 2009, at 8:21 PM, Tim Wawrzynczak wrote: > > I think you're looking for something like this? > > (foldr (lambda (x y) ( + x (* y 10) )) 0 (reverse '(1 2 3))) > = 123 > > - inforichland > > On Mon, Feb 16, 2009 at 7:08 PM, Thomas Chust wrote: >> >> 2009-02-16 aditya shukla : >> > [...] >> > (define guess (lambda(lsb csb msb) >> > This is the part which i was not able to do , how can i combine >> > lsb >> > , csb and msb so the number is of the form (msbcsblsb) .Is there any >> > function in scheme which can do this >> > >> > )) >> > [...] >> >> Hello, >> >> there are indeed functions in Scheme that can be used do this -- they >> are called + and * ;-) >> >> All you need to do is multiply each digit of the number with the value >> of its position and add up the results. If you want to create a more >> general solution for an arbitrary number of digits, a function like >> foldr comes in handy, too. >> >> cu, >> Thomas >> >> >> -- >> When C++ is your hammer, every problem looks like your thumb. >> _________________________________________________ >> 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 rcleis at mac.com Mon Feb 16 21:27:59 2009 From: rcleis at mac.com (Richard Cleis) Date: Thu Mar 26 02:41:24 2009 Subject: [plt-edu] Re: [plt-scheme] behaviour of void? In-Reply-To: <373276.75308.qm@web50904.mail.re2.yahoo.com> References: <373276.75308.qm@web50904.mail.re2.yahoo.com> Message-ID: On Feb 16, 2009, at 12:02 PM, geb a wrote: > > If you examine any of the technical disciplines, students in those > disciplines would be much more effective with a knowledge of the > programming principles laid out in htdp. In physics, I could have > save much time with a knowledge of computing. Bioinformatics is > almost completely a computer discipline. I'm convinced that one or > two software courses in an engineering discipline is not > sufficient. If drscheme could be turned into a general purpose > environment that could handle large amounts of computation, it would > make a perfect integrating language. One or two courses is not sufficient, and neither is three or four. I don't think that most engineers, for example, can afford the time to develop the wisdom of computer scientists (or vice versa.) Computer science needs to be trusted to glue the other technologies together, perhaps with 'a perfect integrating language' as you suggest. I am trying to make this happen in our lab, but guess what? I am not a computer scientist, so I am not making much progress. Furthermore, the other disciplines seem satisfied with blaming software development for their scheduling woes. :) > > > My son, who characterized himself as a "non math person" in 7th > grade and who was earning low B's and C's now earns perfect scores > on his honors math exams. His success is a combination of tutoring > and programming as well as a decision on his part to excel. But I > believe that to a large degree, the skills he learned using htdp > made the difference. I believe that when he goes to study > engineering, he will benefit from what he learned. I wish I could hire people like your son :) rac > > > > > --- On Sun, 2/15/09, Richard Cleis wrote: > >> From: Richard Cleis >> Subject: Re: [plt-edu] Re: [plt-scheme] behaviour of void? >> To: geb_a@yahoo.com >> Cc: "Grant Rettke" , plt-scheme@list.cs.brown.edu >> Date: Sunday, February 15, 2009, 6:59 PM >> On Feb 15, 2009, at 6:37 PM, geb a wrote: >> >>> >>> >>> Yes, the focus is on htdp with advanced students >> working on projects that use programming in other >> disciplines. I really believe that computer science should >> be central to a strong technical background. In fact, a >> computer science student should be able to compute circles >> around any other student. >> >> Are you saying that graduates of other disciplines should >> know more of what CS graduates know? Or are you saying that >> CS graduates should be able to implement better software for >> the other disciplines than the disciplines can muster >> themselves? In my world, it seems that overall >> effectiveness doesn't match up to our considerable >> individual abilities because it is nearly impossible to mix >> & match the resources of all of the disciplines. It >> would be wonderful if the tech disciplines knew more about >> CS, but I don't see that ever happening. I do hope for >> the day when more effective overlapping of expertise comes >> to pass. >> >> rac >> >>> >>> >>> Dan Anderson >>> >>> >>> --- On Sat, 2/14/09, Grant Rettke >> wrote: >>> >>>> From: Grant Rettke >>>> Subject: Re: [plt-edu] Re: [plt-scheme] behaviour >> of void? >>>> To: geb_a@yahoo.com >>>> Cc: "Prabhakar Ragde" >> , "Matthias Felleisen" >> , "plt edu" >> , "Shriram >> Krishnamurthi" , "PLT >> List" >>>> Date: Saturday, February 14, 2009, 8:35 PM >>>> On Thu, Feb 5, 2009 at 8:23 PM, geb a >>>> wrote: >>>>> So what kinds of exercises are you looking >> for? I >>>> guess I'm in the unique position of being able >> to use >>>> programming to teach Science, Technology, >> Engineering and >>>> Mathematics projects. As a high school teacher, >> I feel >>>> like computer science should be about integrating >> these >>>> disciplines. >>>> >>>> I wish I had gone to school where you teach. Is it >> common >>>> practice for >>>> highschools these days to include CS? What is your >> title? >>>> CS teacher? >>> >>> >>> >>> _________________________________________________ >>> 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 morazanm at gmail.com Mon Feb 16 22:02:44 2009 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:41:24 2009 Subject: [plt-scheme] Prereqs for robotic programming Message-ID: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> Dear All, I am faced with a colleague, call him Prof. BW, that believes that he can recruit students with no background in program design and implementation into a robotics course that requires students to write programs. Here's a small part of our exchange: Prof BW: You mention that "[...] it is inappropriate to recruit students that have no background in programming into a robotics course [...]" - I am not sure what you base this on. I would suggest that it really depends on the particular course, its design, and its goals. Robotics courses are used even in high schools to get students interested in and exposed to programming and problem-solving techniques, as I am sure you know. Marco: If a robotics course requires students to write programs then background on how to design programs is required. It is inappropriate to recruit students that do not have such background. These are skills that can not be picked up or develop on the fly in the context of a robotics course. Prof. BW: It is tricky, but with the right tools it can work fine. Marco: The right tools can, indeed, make writing programs easier by eliminating the need for cumbersome syntax (this is what visual programming thought it could deliver and has failed to date), but these tools do not eliminate the need to design the programs that are to be written. It will be a nightmare for students with no programming background to implement any motion or sensor-exploiting algorithms. Prof. BW: I am sure students will enjoy such a course. It will not be a nightmare. Marco: I am sorry you missed my point. I was not commenting on whether or not you will get the students to enjoy the course. I was commenting on having students design and implement programs for a particular task without knowing how to design a program in the first place. I think this gives you an accurate picture. Any suggestions? -- Cheers, Marco From henk at henk.ca Mon Feb 16 22:24:13 2009 From: henk at henk.ca (Henk Boom) Date: Thu Mar 26 02:41:24 2009 Subject: [plt-scheme] Prereqs for robotic programming In-Reply-To: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> Message-ID: 2009/2/16 Marco Morazan : > ... > > I think this gives you an accurate picture. Any suggestions? It's hard to answer something like this without more context. Hypothetically, if the environment is well done, why should controlling (very simple) robots to teach basic programming be any different from, say, using simplified GUI libraries? Both have inputs, outputs, and can respond to events. Whether or not this is a valid analogy would of course depend on what the aims of the course are. There is a big difference between a robotics course which happens to require non-trivial programming tasks, and a programming course using robots to grab the students' interest. Henk From morazanm at gmail.com Mon Feb 16 23:01:25 2009 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:41:24 2009 Subject: [plt-scheme] Prereqs for robotic programming In-Reply-To: References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> Message-ID: <9b1fff280902162001g78c0d1edyeeff8f7357e76ac8@mail.gmail.com> > It's hard to answer something like this without more context. > > Hypothetically, if the environment is well done, why should > controlling (very simple) robots to teach basic programming be any > different from, say, using simplified GUI libraries? Both have inputs, > outputs, and can respond to events. > My apologies for the confusion. The goal is not to teach basic programming. The goal is to teach robotics. I think that using robots to teach basic programming can eventually be a great motivator, but I have not seen a programming environment that comes remotely close to being up to the task. Even LEGO's NXT graphical enviroment falls well short of the mark for teaching basic programming. -- Cheers, Marco From acowley at gmail.com Tue Feb 17 00:54:06 2009 From: acowley at gmail.com (Anthony Cowley) Date: Thu Mar 26 02:41:25 2009 Subject: [plt-scheme] Prereqs for robotic programming In-Reply-To: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> Message-ID: <81addec70902162154m2472e700k67f0291037511417@mail.gmail.com> On Feb 16, 2009, at 10:02 PM, Marco Morazan wrote: > Dear All, > > ... > Marco: The right tools can, indeed, make writing programs easier by > eliminating the need for cumbersome syntax (this is what visual > programming thought it could deliver and has failed to date), but > these tools do not eliminate the need to design the programs that are > to be written. It will be a nightmare for students with no programming > background to implement any motion or sensor-exploiting algorithms. Marco, I think you are overstating things when you predict a "nightmare." I have seen many successful robotics-centric classes that have brought in students from outside of CS, and none have had anything like HtDP as a prerequisite. While I would love to see such a thing, and indeed I do, if often indirectly, work towards such a goal myself as a roboticist, I think it is far too narrow a view to have such particular requirements. These days, one can find many examples of robotics used as a gateway for programming education at the intro level, and as an application domain for Mechanical and Electrical Engineers at more advanced stages. Setting aside the former, a typical, realistic, situation is that the professor will provide a crash course in Matlab programming for the first few weeks, if necessary, before diving into a selection of relevant topics in control theory, computer vision, robust estimation, and perhaps mechatronics, depending on the professor. (A discourse on the finer points of theoretical computer science this is not.) All of these topics can be covered with non-CS students who have come in with a weak programming background, if any. It can indeed be difficult, and one may balk at the quality of programming on display, but I think it is an excellent opportunity to demonstrate the importance of solid software engineering to an audience that would quite possibly never otherwise see it. You should view a robotics class as an opportunity to reach out to engineers who see programming as just another tool, and give them a taste of its depth and relevance while still covering the material a robotics course must focus on. In fact, quite often a Mechanical Engineering department, for example, will offer a robotics class for ME students (my wife is an ME who does just this). These classes will seldom consider software design at all, so if you can inject some of that into the proceedings, then you should declare (some measure of) victory. Anthony From marek at xivilization.net Tue Feb 17 01:34:37 2009 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:41:25 2009 Subject: [plt-scheme] HtDP in Python! In-Reply-To: References: <756daca50902161156g2952f2f6rc93b41070dc37cf0@mail.gmail.com> Message-ID: <20090217073437.3cf6bda5@halmanfloyd.lan.local> On Mon, 16 Feb 2009 17:54:00 -0500 Shriram Krishnamurthi wrote: > Python, more than just about any language, is based on the opinion of > one person. People who buy into Python think like Guido; those who > don't, often don't. Guido does not appear to be a particularly big > fan of functional programming. Well, he's not but that does not stop Python from having a number of functional constructs and concepts. Since I know Scheme I use more and more of these. It is, in my opinion a language where you can integrate OOP and functional programming nicely (although the majority of program will use mostly OOP features). For me, the mix has been quite useful and I love ``itertools`` and ``functools``. On Mon, 16 Feb 2009 16:30:12 -0500 Shriram Krishnamurthi wrote: > This is the folk wisdom from places that have tried to teach Java > functionally. I've been exposed to such attempts. The fun thing is that our prefessor used both Java and his own invented theoretical programming language for teaching programming. And his syntax is kind of a Scheme disguised in a mix of Java and Bash syntax. Functional programming without first-class functions.. *sigh* regards, Marek From marek at xivilization.net Tue Feb 17 01:41:39 2009 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:41:25 2009 Subject: [plt-scheme] HtDP in Python! In-Reply-To: <20090216.211845.140435454.maxigas@anargeek.net> References: <20090216.211845.140435454.maxigas@anargeek.net> Message-ID: <20090217074139.23ac1a30@halmanfloyd.lan.local> On Mon, 16 Feb 2009 21:18:45 +0100 (CET) maxigas wrote: > It actually depends on how far you stretch the stack. I usually do > sth like this when i program Python with recursions: > > import sys > sys.setrecursionlimit(1000) I wouldn't recommend such code as a long-time user of Python. For funnier hacks, how about a tail recursion optimization decorator? :) regards, Marek From yinso.chen at gmail.com Tue Feb 17 01:54:41 2009 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:41:25 2009 Subject: [plt-scheme] convert time zone to offsets? Message-ID: <779bf2730902162254t450cfa51i51154b53d008e854@mail.gmail.com> Hi all - is there a function that convert a time zone like 'America/Los_Angeles' to an offset? I suspect not (and didn't find any), but want to check to see if others have tried to solve this issue before. Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090216/c6404169/attachment.html From mvanier42 at gmail.com Tue Feb 17 03:17:34 2009 From: mvanier42 at gmail.com (Michael Vanier) Date: Thu Mar 26 02:41:26 2009 Subject: [plt-scheme] Prereqs for robotic programming In-Reply-To: <81addec70902162154m2472e700k67f0291037511417@mail.gmail.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <81addec70902162154m2472e700k67f0291037511417@mail.gmail.com> Message-ID: <499A729E.4080206@cs.caltech.edu> Anthony Cowley wrote: > On Feb 16, 2009, at 10:02 PM, Marco Morazan wrote: > >> Dear All, >> >> ... >> Marco: The right tools can, indeed, make writing programs easier by >> eliminating the need for cumbersome syntax (this is what visual >> programming thought it could deliver and has failed to date), but >> these tools do not eliminate the need to design the programs that are >> to be written. It will be a nightmare for students with no programming >> background to implement any motion or sensor-exploiting algorithms. >> > > > Marco, > > I think you are overstating things when you predict a "nightmare." > > I have seen many successful robotics-centric classes that have brought > in students from > outside of CS, and none have had anything like HtDP as a prerequisite. > While I would love to > see such a thing, and indeed I do, if often indirectly, work towards > such a goal myself as a > roboticist, I think it is far too narrow a view to have such > particular requirements. > > These days, one can find many examples of robotics used as a gateway > for programming > education at the intro level, and as an application domain for > Mechanical and Electrical > Engineers at more advanced stages. Setting aside the former, a > typical, realistic, situation > is that the professor will provide a crash course in Matlab > programming for the first few > weeks, if necessary, before diving into a selection of relevant topics > in control theory, > computer vision, robust estimation, and perhaps mechatronics, > depending on the professor. (A > discourse on the finer points of theoretical computer science this is not.) > > All of these topics can be covered with non-CS students who have come > in with a weak > programming background, if any. It can indeed be difficult, and one > may balk at the quality > of programming on display, but I think it is an excellent opportunity > to demonstrate the > importance of solid software engineering to an audience that would > quite possibly never > otherwise see it. You should view a robotics class as an opportunity > to reach out to > engineers who see programming as just another tool, and give them a > taste of its depth and > relevance while still covering the material a robotics course must focus on. > > In fact, quite often a Mechanical Engineering department, for example, > will offer a robotics > class for ME students (my wife is an ME who does just this). These > classes will seldom > consider software design at all, so if you can inject some of that > into the proceedings, then > you should declare (some measure of) victory. > > Anthony > This is very reminiscent of a situation I've found myself in where students would ask if I would teach Matlab in one of my programming classes, because that's the only programming language/environment they "need" and can ever imagine themselves needing to know. I have always replied that I refuse to teach Matlab because it's a terrible language and just encourages bad programming habits. However, the demand persisted, and eventually another department stepped up to the plate and now teaches an "intro to matlab and Mathematica"-style course, with no prerequisites AFAIK. And that's fine with me. One of the things I've had to get used to is that a large number of students who supposedly want to learn how to program also want to remain blissfully ignorant of all the important ideas in programming. So be it -- they're never going to become good programmers, and maybe if all they ever write is one-page matlab scripts, they don't need to be. Mike From chadestioco at gmail.com Tue Feb 17 05:53:32 2009 From: chadestioco at gmail.com (Andrei Estioco) Date: Thu Mar 26 02:41:26 2009 Subject: [plt-scheme] Re: It gets shared! In-Reply-To: <699736a3-c4e2-48de-bd12-b3a32c1b337c@r41g2000prr.googlegroups.com> References: <699736a3-c4e2-48de-bd12-b3a32c1b337c@r41g2000prr.googlegroups.com> Message-ID: Oh...well yes that solved my problem for Advanced Student. Thanks. But my question remains. What part of my code made it shared? I mean...I didn't even use set! . Well, as far as I know, set! is the only way in Scheme to have values shared. -- Chad Estioco BS Computer Science University of the Philippines-Diliman ============================== http://www.geocities.com/lokisky_walker -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090217/71a3dfe4/attachment.htm From jos.koot at telefonica.net Tue Feb 17 06:18:16 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:41:27 2009 Subject: [plt-scheme] It gets shared! References: Message-ID: <1F0B75DA060C433C9C5A85FE7EB9FAC7@uw2b2dff239c4d> unmark `Show sharing in values' in the `language/choose language' menu. You may have to open the `show details' first. Jos ----- Original Message ----- From: Andrei Estioco To: plt-scheme@list.cs.brown.edu Sent: Tuesday, February 17, 2009 1:30 AM Subject: [plt-scheme] It gets shared! Hello, I created a program which will display (in a list) a farey sequence of level n. My code is as follows: (define-struct farey (num denom)) (define (farey-level n) (farey-acc (- n 1) (list (make-farey 0 1) (make-farey 1 1)))) (define (farey-acc n flist) (cond [(= n 0) flist] [else (farey-acc (- n 1) (insert-new-farey flist))])) (define (insert-new-farey flist) (append (get-first-two flist) (get-middle flist) (get-last-two flist))) (define (get-first-two flist) (list (first flist) (get-between flist) (second flist))) (define (get-middle flist) (local ((define (get-mid flist acc) (cond [(empty? flist) empty] [(= (length flist) 2) (reverse acc)] [else (get-mid (rest flist) (cons (first flist) acc))]))) (get-mid (rest (rest flist)) empty))) (define (get-last-two flist) (cond [(empty? (rest (rest flist))) (list (first flist) (get-between flist) (second flist))] [else (get-last-two (rest flist))])) (define (get-between flist) (make-farey (+ (farey-num (first flist)) (farey-num (second flist))) (+ (farey-denom (first flist)) (farey-denom (second flist))))) I test the code in Advanced Student. I call the function (farey-level 4) and get this result: > (shared ((-1- (make-farey 0 1)) (-9- (make-farey 1 1))) (list -1- (make-farey 1 4) (make-farey 1 3) (make-farey 1 2) -9- -1- (make-farey 1 2) (make-farey 2 3) (make-farey 3 4) -9-)) This is not the result I was expecting so I run the code again, this time in Intermediate Student, with the same function call, (farey-level 4). This is the result I get: >(list (make-farey 0 1) (make-farey 1 4) (make-farey 1 3) (make-farey 1 2) (make-farey 1 1) (make-farey 0 1) (make-farey 1 2) (make-farey 2 3) (make-farey 3 4) (make-farey 1 1)) Now that is the result I was expecting. My question is, why did it get (shared) in Advanced Student? I didn't even use (set!). The only instance I ever encountered (shared) was when I defined a doubly-linked list and, of course, I was expecting it then. Did I make a mistake in my code? -- Chad Estioco BS Computer Science University of the Philippines-Diliman ============================== http://www.geocities.com/lokisky_walker ------------------------------------------------------------------------------ _________________________________________________ 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/20090217/617d78b0/attachment.html From jcoglan at googlemail.com Tue Feb 17 06:20:05 2009 From: jcoglan at googlemail.com (James Coglan) Date: Thu Mar 26 02:41:27 2009 Subject: [plt-scheme] Continuations and expression evaluation Message-ID: Hi list, Got a quick question about continuations. Take the following program: (define r #f) (define value #f) (define y 2) (set! value (+ 1 y (call/cc (lambda (k) (set! r k) 1)))) (display value) (set! y 7) (r 1) (display value) (set! y 2) (set! value (+ 1 (call/cc (lambda (k) (set! r k) 1)) y)) (display value) (set! y 7) (r 1) (display value) This prints "4449" -- in the first expression, y has already been evaluated when we create the continuation, but in the second it has not so it is re-evaluated each time we call the continuation. However, in the Scheme spec it says that operands are to be evaluated in an unspecified order. Is this at odds with the above continuation behaviour? Is this an accident or does PLT guarantee evaluation order of operands? I couldn't tell from the spec whether any concrete behaviour is mandated for (call/cc) embedded in a larger expression. -- James Coglan http://github.com/jcoglan/heist -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090217/7c0cee24/attachment.htm From chust at web.de Tue Feb 17 06:14:17 2009 From: chust at web.de (Thomas Chust) Date: Thu Mar 26 02:41:28 2009 Subject: [plt-scheme] HtDP in Python! In-Reply-To: <20090217074139.23ac1a30@halmanfloyd.lan.local> References: <20090216.211845.140435454.maxigas@anargeek.net> <20090217074139.23ac1a30@halmanfloyd.lan.local> Message-ID: <1c1a33bc0902170314k1a870f71tc608793e0d5e6877@mail.gmail.com> 2009-02-17 Marek Kubica : > On Mon, 16 Feb 2009 21:18:45 +0100 (CET) > maxigas wrote: > >> It actually depends on how far you stretch the stack. I usually do >> sth like this when i program Python with recursions: >> >> import sys >> sys.setrecursionlimit(1000) > > I wouldn't recommend such code as a long-time user of Python. > [...] Maybe stackless Python (http://www.stackless.com/) does tail calls. At least it has full continuations, which implies good chances that tail call optimization is also present... cu, Thomas -- When C++ is your hammer, every problem looks like your thumb. From jos.koot at telefonica.net Tue Feb 17 06:40:52 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:41:29 2009 Subject: [plt-scheme] Re: It gets shared! References: <699736a3-c4e2-48de-bd12-b3a32c1b337c@r41g2000prr.googlegroups.com> Message-ID: <540518F99A874C1B9609AE8BADCC3EDA@uw2b2dff239c4d> Consider: (define a (list 1 2)) (define b (list a a)) Now the two elements of list b are shared. No set! required to do that. You may or you may not want to show the sharing in the output. Because lists are immutable, the fact that two elements are shared makes no difference as long as the elements are immutable too. Compare this to: (define a (list (box 1) (box 2))) ; mutable elements! (define b (list a a)) (set-box! (car a) 3) b --> (list (list (box 3) (box 2)) (list (box 3) (box 2))) or b --> (shared ((-1- (list (box 3) (box 2)))) (list -1- -1-)) depending on the output mode. Jos ----- Original Message ----- From: Andrei Estioco To: plt-scheme@list.cs.brown.edu Sent: Tuesday, February 17, 2009 11:53 AM Subject: [plt-scheme] Re: It gets shared! Oh...well yes that solved my problem for Advanced Student. Thanks. But my question remains. What part of my code made it shared? I mean...I didn't even use set! . Well, as far as I know, set! is the only way in Scheme to have values shared. -- Chad Estioco BS Computer Science University of the Philippines-Diliman ============================== http://www.geocities.com/lokisky_walker ------------------------------------------------------------------------------ _________________________________________________ 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/20090217/881390b7/attachment.html From matthias at ccs.neu.edu Tue Feb 17 07:38:19 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:41:29 2009 Subject: [plt-scheme] Continuations and expression evaluation In-Reply-To: References: Message-ID: On Feb 17, 2009, at 6:20 AM, James Coglan wrote: > ... in the Scheme spec it says that operands are to be evaluated in > an unspecified order. ... Here is the meaning of this statement. Say you have an application with several subexpressions (M n K) and at least two of them are NOT values yet, say, M and K. Then the compiler can arrange two different sequences evaluate M, store away value m evaluate K, store away value k test that m is a function and then call m{n,k} OR evaluate K, store away value k evaluate M, store away value m test that m is a function and then call m{n,k} Now take a look at your program and check whether it contains such an application. NB, application includes such things as (+ 1 2). -- Matthias -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090217/8c871930/attachment.htm From sk at cs.brown.edu Tue Feb 17 07:21:13 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:41:29 2009 Subject: [plt-scheme] HtDP in Python! In-Reply-To: <20090217073437.3cf6bda5@halmanfloyd.lan.local> References: <756daca50902161156g2952f2f6rc93b41070dc37cf0@mail.gmail.com> <20090217073437.3cf6bda5@halmanfloyd.lan.local> Message-ID: > It is, in my opinion a language where you can integrate > OOP and functional programming nicely (although the majority of program > will use mostly OOP features). You cannot have true OOP without tail calls. This is not a matter of nitpicking. See Matthias Felleisen's ECOOP invited talk slides. (You can't have true FP without tail calls, either, but I assume everyone here knows that. A few seconds' inspection clarifies that both of these "can't have"s are for the same reason.) Shriram From noelwelsh at gmail.com Tue Feb 17 07:40:34 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:41:30 2009 Subject: [plt-scheme] Continuations and expression evaluation In-Reply-To: References: Message-ID: On Tue, Feb 17, 2009 at 11:20 AM, James Coglan wrote: >... However, in the Scheme spec > it says that operands are to be evaluated in an unspecified order. Is this > at odds with the above continuation behaviour? Is this an accident or does > PLT guarantee evaluation order of operands? I'm fairly sure PLT guarantees left-to-right evaluation. (Couldn't find it in the new Reference, but it is in the old (pre-400) docs IIRC) N. From matthias at ccs.neu.edu Tue Feb 17 08:50:33 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:41:30 2009 Subject: [plt-scheme] Prereqs for robotic programming In-Reply-To: <9b1fff280902162001g78c0d1edyeeff8f7357e76ac8@mail.gmail.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902162001g78c0d1edyeeff8f7357e76ac8@mail.gmail.com> Message-ID: <1B07412B-005E-480F-9A72-CCC0F62E5172@ccs.neu.edu> Marco, morally you are correct. It is as irresponsible to call the 'robot programming' that currently pervades universities and colleges 'programming'. Worse, these departments (especially ECEs) tend to then add two or three courses on top of such a course and call the graduates 'software engineers' simply because states and universities grant Engineering schools the right to hand out Engineer titles and deny it to other departments. Such students are software engineers just as much as a person with two or three courses on pharmaceuticals is a pharmacist or a student who has taken physics and two or three civ eng courses is a nuclear engineer. It is simply an embarrassment that we must allow such people to call this activity 'programming.' Pragmatically you are fighting the wrong fight. We have lost the fight over 'programming' pure and simple, and we need to conquer the upper end of the spectrum. So first and most importantly, don't call anything 'programming'. Use 'program design' instead, and on occasion, make it very clear that whatever they are doing, program design it is not. Second, instead of fighting this effort, embrace and attack from the back. Let him teach this course. Then advertise with "In Course Robot -1, you have learned just enough to control the robot. If you want to understand how software is really designed, join my course now and take the next step." Save your energy and spend it on important fights. Get the best kids launched on the path of 'program design.' -- Matthias From chadestioco at gmail.com Tue Feb 17 08:59:36 2009 From: chadestioco at gmail.com (Andrei Estioco) Date: Thu Mar 26 02:41:30 2009 Subject: [plt-scheme] Re: It gets shared! In-Reply-To: <540518F99A874C1B9609AE8BADCC3EDA@uw2b2dff239c4d> References: <699736a3-c4e2-48de-bd12-b3a32c1b337c@r41g2000prr.googlegroups.com> <540518F99A874C1B9609AE8BADCC3EDA@uw2b2dff239c4d> Message-ID: Oh...Thanks for the insight Jos. I might be able to find the loophole in my code now. Thanks a lot -- Chad Estioco BS Computer Science University of the Philippines-Diliman ============================== http://www.geocities.com/lokisky_walker -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090217/282e8617/attachment.html From grettke at acm.org Tue Feb 17 09:42:05 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:31 2009 Subject: [plt-scheme] HtDP in Python! In-Reply-To: References: <756daca50902161156g2952f2f6rc93b41070dc37cf0@mail.gmail.com> <20090217073437.3cf6bda5@halmanfloyd.lan.local> Message-ID: <756daca50902170642y7d36a166p8d37d1d186c44fa0@mail.gmail.com> On Tue, Feb 17, 2009 at 6:21 AM, Shriram Krishnamurthi wrote: >> It is, in my opinion a language where you can integrate >> OOP and functional programming nicely (although the majority of program >> will use mostly OOP features). > > You cannot have true OOP without tail calls. This is not a matter of > nitpicking. See Matthias Felleisen's ECOOP invited talk slides. > > (You can't have true FP without tail calls, either, but I assume > everyone here knows that. A few seconds' inspection clarifies that > both of these "can't have"s are for the same reason.) Inspection of that ECOOP paper? From robby at eecs.northwestern.edu Tue Feb 17 09:45:04 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Mar 26 02:41:31 2009 Subject: [plt-scheme] HtDP in Python! In-Reply-To: <756daca50902170642y7d36a166p8d37d1d186c44fa0@mail.gmail.com> References: <756daca50902161156g2952f2f6rc93b41070dc37cf0@mail.gmail.com> <20090217073437.3cf6bda5@halmanfloyd.lan.local> <756daca50902170642y7d36a166p8d37d1d186c44fa0@mail.gmail.com> Message-ID: <932b2f1f0902170645v3dfde0b3ic7e2de7a56ddd8fe@mail.gmail.com> Perhaps he meant "introspection"? On Tue, Feb 17, 2009 at 8:42 AM, Grant Rettke wrote: > On Tue, Feb 17, 2009 at 6:21 AM, Shriram Krishnamurthi wrote: >>> It is, in my opinion a language where you can integrate >>> OOP and functional programming nicely (although the majority of program >>> will use mostly OOP features). >> >> You cannot have true OOP without tail calls. This is not a matter of >> nitpicking. See Matthias Felleisen's ECOOP invited talk slides. >> >> (You can't have true FP without tail calls, either, but I assume >> everyone here knows that. A few seconds' inspection clarifies that >> both of these "can't have"s are for the same reason.) > > Inspection of that ECOOP paper? > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From sbloch at adelphi.edu Tue Feb 17 09:56:29 2009 From: sbloch at adelphi.edu (Stephen Bloch) Date: Thu Mar 26 02:41:31 2009 Subject: [plt-scheme] Prereqs for robotic programming In-Reply-To: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> Message-ID: On Feb 16, 2009, at 10:02 PM, Marco Morazan wrote: > I am faced with a colleague, call him Prof. BW, that believes that he > can recruit students with no background in program design and > implementation into a robotics course that requires students to write > programs. Here's a small part of our exchange:... It's fairly common to use robotics as an introduction to programming. I haven't taught such a course, but (like Logo turtle- graphics, Alice, or Lyn Turbak's BuggleWorlds in Java) it's quite a natural fit if you think of programming in a purely imperative/ sequential way. Your colleague will probably succeed in getting students interested in programming, getting them to do experimental/ exploratory programming, and teaching them the sequential, conditional, looping, and perhaps (void) procedure-calling constructs of a programming language. BW will probably not succeed in teaching them general principles of program design, because that's not what (s) he set out to do (and it may not have even occurred to him/her). By the end of the course, most of the students will probably not be prepared to write programs of more than a few dozen lines, but they'll be able to get the robots doing some simple tasks. A few particularly sharp ones may be able to write, by the seats of their pants, programs of several hundred lines which, though ugly and inadequately-tested, work correctly most of the time. The gravest concern is that they will come OUT of your colleague's course thinking they know how to program. Stephen Bloch sbloch@adelphi.edu From morazanm at gmail.com Tue Feb 17 10:23:50 2009 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:41:31 2009 Subject: [plt-scheme] Prereqs for robotic programming In-Reply-To: <1B07412B-005E-480F-9A72-CCC0F62E5172@ccs.neu.edu> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902162001g78c0d1edyeeff8f7357e76ac8@mail.gmail.com> <1B07412B-005E-480F-9A72-CCC0F62E5172@ccs.neu.edu> Message-ID: <9b1fff280902170723x17aec018u4c16c8423df14791@mail.gmail.com> Matthias, That is a bitter pill to swallow. Have you ever seen students sit and randomly tweak code to try to get a robot to move in a circle? I have and it was disturbing. It was clear to me that they had no real clue about: 1) what needed to be done and 2) how to design code for what needed to be done. Respectfully, I doubt they will ever learn enough to control the robot in such a course. Nonetheless, I hear you and I need to think deeply about it despite wholeheartedly agreeing that it is an embarrassment to call such an activity programming. Marco On Tue, Feb 17, 2009 at 8:50 AM, Matthias Felleisen wrote: > > Marco, > > morally you are correct. It is as irresponsible to call the 'robot > programming' that currently pervades universities and colleges > 'programming'. Worse, these departments (especially ECEs) tend to then add > two or three courses on top of such a course and call the graduates > 'software engineers' simply because states and universities grant > Engineering schools the right to hand out Engineer titles and deny it to > other departments. Such students are software engineers just as much as a > person with two or three courses on pharmaceuticals is a pharmacist or a > student who has taken physics and two or three civ eng courses is a nuclear > engineer. > > It is simply an embarrassment that we must allow such people to call this > activity 'programming.' > > Pragmatically you are fighting the wrong fight. We have lost the fight over > 'programming' pure and simple, and we need to conquer the upper end of the > spectrum. So first and most importantly, don't call anything 'programming'. > Use 'program design' instead, and on occasion, make it very clear that > whatever they are doing, program design it is not. Second, instead of > fighting this effort, embrace and attack from the back. Let him teach this > course. Then advertise with "In Course Robot -1, you have learned just > enough to control the robot. If you want to understand how software is > really designed, join my course now and take the next step." > > Save your energy and spend it on important fights. Get the best kids > launched on the path of 'program design.' > > -- Matthias > > -- Cheers, Marco From morazanm at gmail.com Tue Feb 17 10:29:37 2009 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:41:31 2009 Subject: [plt-scheme] Prereqs for robotic programming In-Reply-To: References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> Message-ID: <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> > > The gravest concern is that they will come OUT of your colleague's course > thinking they know how to program. > That is, indeed, the gravest concern and why I would like Prof. BW to embrace program design in his intro to robotics course. The resistance to this suggestion is overwhelming. It is like an article of faith that program design does not apply to programming robots...... I must admit that distinguishing program design from programming feels most unnatural to me..... -- Cheers, Marco From acowley at seas.upenn.edu Tue Feb 17 10:43:37 2009 From: acowley at seas.upenn.edu (Anthony Cowley) Date: Thu Mar 26 02:41:31 2009 Subject: [plt-scheme] Prereqs for robotic programming In-Reply-To: <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> Message-ID: <81addec70902170743i19403724y3b1d5e443702f960@mail.gmail.com> On Tue, Feb 17, 2009 at 10:29 AM, Marco Morazan wrote: >> >> The gravest concern is that they will come OUT of your colleague's course >> thinking they know how to program. >> > > That is, indeed, the gravest concern and why I would like Prof. BW to > embrace program design in his intro to robotics course. The resistance > to this suggestion is overwhelming. It is like an article of faith > that program design does not apply to programming robots...... > > I must admit that distinguishing program design from programming feels > most unnatural to me..... Many robotics courses also feature CS students trying to solder. Most don't come out of the course thinking themselves experts in electronics, much less electrical system design, but the experience is still valuable if it engenders in the students a greater respect for that which they do not know. As others have suggested, some students will come out of the course with a newfound desire to understand why programming was so hard in the robotics course, and these students can ride this new motivation into becoming proper programmers. Also, just to set the record straight, students can be remarkably resourceful. You will often have some students who came in with little programming knowledge produce final projects of several hundreds lines of code evincing fairly complex behaviors. Again, it's not pretty code, but a significant positive outcome is how the experience demonstrated to them the limits of bunging all your ideas into one big Matlab script. Anthony From matthias at ccs.neu.edu Tue Feb 17 10:44:54 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:41:32 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming In-Reply-To: <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> Message-ID: <984FB2DB-7272-4B3B-8C76-A81C81C47BBE@ccs.neu.edu> On Feb 17, 2009, at 10:29 AM, Marco Morazan wrote: > It is like an article of faith that program design does not apply > to programming robots The problem that we are facing is that most of these so-called professor-programmers don't know how to design a program, and even if they have seen your design activity in action they can't imagine how this struct-union-list-tree stuff could possibly apply to their domain. Whose failure is this? Ours as much as theirs. While we should expect more from academics than what many of our colleagues display, FP has failed to reach out and demonstrate concretely to such people "how _it_ works and is superior to what they have." We have failed as discipline, we have failed as individuals, we have failed at all levels. Instead of building a road from 'hell' to 'paradise' we continue to dust and polish paradise with ever-fancier type systems and logics and what- have-yous. What we really need, however, are ways to take existing 'stuff' and integrate it into a 'good' framework and gradually improve it. (That's what Typed Scheme is about, Dracula, contracts, what have you.) [I have been meaning to write an essay on this topic but I don't ever seem to find time.] Let's build: -- a software simulation test bed for robots -- with an interface that's like the stupid robots BW will program -- and let's demo in your course how 'program design' can do much much better than his programming Such a framework shouldn't be too far from Universe.ss and it will help you demo to your students why 'program design' is so superior to 'programming.' At Rice, my freshmen were my best ambassadors. After two or three instances of '210' and a parallel effort by 'highly respected teachers from the engineering school' to compete with me, I walked into the first session over bodies everywhere (1995, before .com). When I asked why they were here, one student got up and said "Many of us took 2xx last year from Prof. yy. In that class, we learned Fortran, but we've been told that in your class, we learn to program." (I hadn't yet learned to say 'program design'. And I will admit that I didn't build roads to paradise back then.) -- Matthias From grettke at acm.org Tue Feb 17 10:52:14 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:32 2009 Subject: [plt-scheme] Prereqs for robotic programming In-Reply-To: <81addec70902170743i19403724y3b1d5e443702f960@mail.gmail.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <81addec70902170743i19403724y3b1d5e443702f960@mail.gmail.com> Message-ID: <756daca50902170752y727e3e94u60fa4ce28169cbd2@mail.gmail.com> > Also, just to set the record straight, students can be remarkably resourceful. It is not a question of students' resourcefulness; it is a question of how much they are likely to hate programming coming away from the experience if as you put it "It is not pretty but it works". A bad experience is worse than none. From acowley at seas.upenn.edu Tue Feb 17 11:01:29 2009 From: acowley at seas.upenn.edu (Anthony Cowley) Date: Thu Mar 26 02:41:32 2009 Subject: [plt-scheme] Prereqs for robotic programming In-Reply-To: <756daca50902170752y727e3e94u60fa4ce28169cbd2@mail.gmail.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <81addec70902170743i19403724y3b1d5e443702f960@mail.gmail.com> <756daca50902170752y727e3e94u60fa4ce28169cbd2@mail.gmail.com> Message-ID: <81addec70902170801v36d11259idc2d9d124025aaa5@mail.gmail.com> > A bad experience is worse than none. That's very true, and I've only seen, up-close, robotics courses at 3 schools, so I don't claim to speak with any kind of universal authority on the matter. But I will say that retention between Robotics 1 and Robotics 2 (when offered) has been extremely high in each case that I've seen. That really doesn't say anything about the explicit or implicit presence of programming design in the curriculum, but your warning applies equally well to CS classes that turn off potential CS students. And do bear in mind, some of the robotics students will branch out more into control theory, others into mechanical design. Some do follow on deeper into CS, but I think it's actually quite a good thing to get an opportunity to require that these other engineers construct fairly complex programs. Anthony From grettke at acm.org Tue Feb 17 11:19:08 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:32 2009 Subject: [plt-scheme] Prereqs for robotic programming In-Reply-To: <81addec70902170801v36d11259idc2d9d124025aaa5@mail.gmail.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <81addec70902170743i19403724y3b1d5e443702f960@mail.gmail.com> <756daca50902170752y727e3e94u60fa4ce28169cbd2@mail.gmail.com> <81addec70902170801v36d11259idc2d9d124025aaa5@mail.gmail.com> Message-ID: <756daca50902170819o4745038fl198183179d0568d3@mail.gmail.com> On Tue, Feb 17, 2009 at 10:01 AM, Anthony Cowley wrote: >> A bad experience is worse than none. > but your warning applies equally well to CS classes that turn off > potential CS students. I am banking on CS students "toughing it out". From hendrik at topoi.pooq.com Tue Feb 17 10:22:35 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:41:32 2009 Subject: [plt-scheme] Prereqs for robotic programming In-Reply-To: <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> Message-ID: <20090217152235.GA29566@topoi.pooq.com> On Tue, Feb 17, 2009 at 10:29:37AM -0500, Marco Morazan wrote: > > > > The gravest concern is that they will come OUT of your colleague's course > > thinking they know how to program. > > > > That is, indeed, the gravest concern and why I would like Prof. BW to > embrace program design in his intro to robotics course. The resistance > to this suggestion is overwhelming. It is like an article of faith > that program design does not apply to programming robots...... > > I must admit that distinguishing program design from programming feels > most unnatural to me..... It is indeed hard to distinguish. Especially because saying I "design programs" makes it sound as if I'm don't actual write them -- that I just "design" them for others to implement. It's like the difference between writing (what you learn in Grade two) and writing (what regularly published authors do). They say it takes about a million words of writing to climb the slope from one to the other. But all of it is legitimately called "writing". Authors aren't called "novel designers". -- hendrik From grettke at acm.org Tue Feb 17 11:23:38 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:32 2009 Subject: [plt-scheme] Prereqs for robotic programming In-Reply-To: <20090217152235.GA29566@topoi.pooq.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <20090217152235.GA29566@topoi.pooq.com> Message-ID: <756daca50902170823l4d369dcbk3fc0b404df26d5ce@mail.gmail.com> On Tue, Feb 17, 2009 at 9:22 AM, wrote: > Authors aren't called "novel designers". You can't be a successful author without first being a successful novel designer, though; at least if you are writing novels. From matthias at ccs.neu.edu Tue Feb 17 11:32:09 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:41:33 2009 Subject: [plt-scheme] Prereqs for robotic programming In-Reply-To: <20090217152235.GA29566@topoi.pooq.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <20090217152235.GA29566@topoi.pooq.com> Message-ID: On Feb 17, 2009, at 10:22 AM, hendrik@topoi.pooq.com wrote: > Authors aren't called "novel designers". The analogy is perfect, you just failed to use the wrong words. We often say that "an author __writes novels__" in order to distinguish it from "my son wrote an essay for his high school class." Indeed, you can also hear/read "X authored another novel." Subtle distinctions, for the trained ear, trying not to emphasize the differences -- Matthias From sbloch at adelphi.edu Tue Feb 17 11:38:17 2009 From: sbloch at adelphi.edu (Stephen Bloch) Date: Thu Mar 26 02:41:33 2009 Subject: [plt-scheme] Combining digits to form numbers In-Reply-To: <73045cca0902161159u1ddeea39h8f818c288c8bccf9@mail.gmail.com> References: <73045cca0902161159u1ddeea39h8f818c288c8bccf9@mail.gmail.com> Message-ID: <6F30A62B-5415-4110-B3A9-8DB5E0FFAC03@adelphi.edu> On Feb 16, 2009, at 2:59 PM, aditya shukla wrote: > I am trying to solve this exercise from htdp ... Yes, I like that exercise, and I've given it to my students on a number of occasions. Which is one reason for not giving you a solution to it on an e-mail list :-) However, I can suggest a general technique that helps here as well as in many other problems. Assuming you've already seen "templates" or "inventories", a step of program design in which you write down what you have available (mostly parameters to the current function) and their types, I call this technique "Inventories with Values". Suppose you've already got ; convert-3-digits : number (lsb) number (csb) number (msb) -> number (check-expect (convert-3-digits 0 0 0) 0) (check-expect (convert-3-digits 1 2 3) 321) (check-expect (convert-3-digits 5 1 0) 15) (check-expect (convert-3-digits 2 9 7) 792) (define (convert-3-digits lsb csb msb) ; lsb a number, 0-9 ; csb a number, 0-9 ; msb a number, 0-9 ... ) Pick a moderately-complicated one of your examples; let's try the last one, 792. For each item in your inventory, write down not only its type but its VALUE FOR THIS EXAMPLE. Also add a line to the inventory labelled "Right Answer", with ITS value for this example. ; convert-3-digits : number (lsb) number (csb) number (msb) -> number (check-expect (convert-3-digits 0 0 0) 0) (check-expect (convert-3-digits 1 2 3) 321) (check-expect (convert-3-digits 5 1 0) 15) (check-expect (convert-3-digits 2 9 7) 792) (define (convert-3-digits lsb csb msb) ; lsb a number, 0-9 2 ; csb a number, 0-9 9 ; msb a number, 0-9 7 ; right answer a number 792 ... ) Now the challenge is to use your human pattern-recognition abilities to figure out how to get to the "right answer" from the available expressions. Since everything in sight is a number, the most likely operations are arithmetic: +, -, *, /. What arithmetic expression involving 2, 9, and 7 would give you 792? (You might want to try an example with msb=0 first.) Stephen Bloch sbloch@adelphi.edu From morazanm at gmail.com Tue Feb 17 11:58:32 2009 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:41:33 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming In-Reply-To: <984FB2DB-7272-4B3B-8C76-A81C81C47BBE@ccs.neu.edu> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <984FB2DB-7272-4B3B-8C76-A81C81C47BBE@ccs.neu.edu> Message-ID: <9b1fff280902170858wa357d23va08cc53f4823e698@mail.gmail.com> > > Ours as much as theirs. While we should expect more from academics than what > many of our colleagues display, FP has failed to reach out and demonstrate > concretely to such people "how _it_ works and is superior to what they > have." We have failed as discipline, we have failed as individuals, we have > failed at all levels. Instead of building a road from 'hell' to 'paradise' > we continue to dust and polish paradise with ever-fancier type systems and > logics and what-have-yous. What we really need, however, are ways to take > existing 'stuff' and integrate it into a 'good' framework and gradually > improve it. (That's what Typed Scheme is about, Dracula, contracts, what > have you.) > Eloquently stated although it will make few friends among, say, those that develop fancier type systems. Nonetheless, highways, streets, and dirt roads from hell to heaven are, indeed, needed. > Let's build: > > -- a software simulation test bed for robots > -- with an interface that's like the stupid robots BW will program > -- and let's demo in your course how 'program design' can do much much > better than his programming > Interesting proposal. Certainly easier than building a compiler for whatever bytecode robot X interprets. I bet I can even get some undergrads to contribute to such an effort over a summer. > Such a framework shouldn't be too far from Universe.ss and it will help you I believe you are correct. Simulation with graphics + control is doable. If I can simulate the movement of a spaceship, I can simulate the movement of a robot. > demo to your students why 'program design' is so superior to 'programming.' It is definitely worth a try. :-) > At Rice, my freshmen were my best ambassadors. After two or three instances > of '210' and a parallel effort by 'highly respected teachers from the > engineering school' to compete with me, I walked into the first session over > bodies everywhere (1995, before .com). When I asked why they were here, one > student got up and said > > "Many of us took 2xx last year from Prof. yy. In that class, we learned > Fortran, but we've been told that in your class, we learn to program." > My intro students are finally beginning to talk in a similar way. It took more than a semester to get them to give up the bad habits they brought from HS (or learned elsewhere in case of upper classmen), but they now agree that they are really learning to program. Just last week after class, an upper classmen walks up to me and we had this dialogue: Student: Well done. This is the only course that has ever made me feel stupid. Marco: Stupid? I don't want you to feel stupid. Student: No, really well done. This course makes me feel stupid, because it's showing me that I really do not know how to think. Marco: But, are you learning how to think about and analyze problems? Student: Are you kidding? This is the course I have learned the most in. I should have had such a course as a freshman like these guys (i.e. the other students in the class). Marco: There is nothing stupid about learning. Well done! :-) -- Cheers, Marco From noelwelsh at gmail.com Tue Feb 17 12:13:08 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:41:33 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming In-Reply-To: <984FB2DB-7272-4B3B-8C76-A81C81C47BBE@ccs.neu.edu> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <984FB2DB-7272-4B3B-8C76-A81C81C47BBE@ccs.neu.edu> Message-ID: On Tue, Feb 17, 2009 at 3:44 PM, Matthias Felleisen wrote: > Let's build: > > -- a software simulation test bed for robots If, but probably when, I build an interface to player/stage, it will be suitable for this task. It will depend on an external library (player/stage) which is unfortunate. One of the key aspects of robotics (in my experience) is dealing with uncertainty, and for this I'd rather use well tested sensor emulations than write my own. N. From acowley at seas.upenn.edu Tue Feb 17 12:25:58 2009 From: acowley at seas.upenn.edu (Anthony Cowley) Date: Thu Mar 26 02:41:33 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming In-Reply-To: References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <984FB2DB-7272-4B3B-8C76-A81C81C47BBE@ccs.neu.edu> Message-ID: <81addec70902170925v9a1f437qa48e582784146791@mail.gmail.com> On Tue, Feb 17, 2009 at 12:13 PM, Noel Welsh wrote: > On Tue, Feb 17, 2009 at 3:44 PM, Matthias Felleisen > wrote: >> Let's build: >> >> -- a software simulation test bed for robots > > If, but probably when, I build an interface to player/stage, it will > be suitable for this task. It will depend on an external library > (player/stage) which is unfortunate. One of the key aspects of > robotics (in my experience) is dealing with uncertainty, and for this > I'd rather use well tested sensor emulations than write my own. > > N. A Player/Stage interface would be very useful for some, but bear in mind that many serious Player/Stage users end up rewriting their own sensor models in many cases. It provides a useful level of abstraction so that hardware can be swapped for software, and it provides a level of plumbing necessary to deal with networking issues. However, if you have inclinations away from interfacing Player/Stage, I don't think you should hesitate too much. There really isn't a very strong consensus on any particular software platform at this point. If all you want is a fixed network topology and a Pioneer-style skid-steer vehicle with a Sick laser, then you'd be wise to leverage the extant materials, but if you are aiming to interface with more education-focused robots, then your software will primarily be asked to simulate non-holonomic kinematics, and perhaps a simpler range sensor such as an IR. In that case, you're picking up a lot of baggage to go along with the benefit of not having to reinvent certain wheels by building on top of Player/Stage. You could also consider interfacing with a more limited visualization package such as http://www.peekabot.org/ which seems to be more cross-platform friendly, but doesn't provide all the bits and pieces of applied robotics programming that the Player/Stage platform does. I think there are different concerns for who the audience for this software is. The easiest thing to do is to produce a robotics software platform that has too high an entry cost for newcomers and offers too dated or inflexible of an architecture for the advanced user. Do try to avoid that trap :) Anthony From matthias at ccs.neu.edu Tue Feb 17 12:47:26 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:41:33 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming In-Reply-To: <9b1fff280902170858wa357d23va08cc53f4823e698@mail.gmail.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <984FB2DB-7272-4B3B-8C76-A81C81C47BBE@ccs.neu.edu> <9b1fff280902170858wa357d23va08cc53f4823e698@mail.gmail.com> Message-ID: <607C9A98-8417-451C-9D40-D4C95874365E@ccs.neu.edu> On Feb 17, 2009, at 11:58 AM, Marco Morazan wrote: > >> Let's build: >> >> -- a software simulation test bed for robots >> -- with an interface that's like the stupid robots BW will program >> -- and let's demo in your course how 'program design' can do much >> much >> better than his programming >> > > Interesting proposal. Certainly easier than building a compiler for > whatever bytecode robot X interprets. I bet I can even get some > undergrads to contribute to such an effort over a summer. And get funding for it, eventually. Just make it look -- inclusive -- embracing the robots guys, too -- and outreachy. :-) -- Matthias From grettke at acm.org Tue Feb 17 13:17:22 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:33 2009 Subject: [plt-scheme] Combining digits to form numbers In-Reply-To: <6F30A62B-5415-4110-B3A9-8DB5E0FFAC03@adelphi.edu> References: <73045cca0902161159u1ddeea39h8f818c288c8bccf9@mail.gmail.com> <6F30A62B-5415-4110-B3A9-8DB5E0FFAC03@adelphi.edu> Message-ID: <756daca50902171017v708c6711rd32ba1ca51a9e4db@mail.gmail.com> I was surprised to see all of the answers posted here. This is one of the best problems in HtDP because it draws out whether or not you are really following the recipe; because if you are you will produce the correct solution. One of the reasons for this is that the "intuitive" approach would be to write the procedure so that the first digit is least significant; when you don't write it this way the solution becomes less obvious. It was really helpful talking through this with folks. From hendrik at topoi.pooq.com Tue Feb 17 12:21:52 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:41:34 2009 Subject: Novels and programs (was: Re: [plt-scheme] Prereqs for robotic programming In-Reply-To: <756daca50902170823l4d369dcbk3fc0b404df26d5ce@mail.gmail.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <20090217152235.GA29566@topoi.pooq.com> <756daca50902170823l4d369dcbk3fc0b404df26d5ce@mail.gmail.com> Message-ID: <20090217172152.GB29566@topoi.pooq.com> On Tue, Feb 17, 2009 at 10:23:38AM -0600, Grant Rettke wrote: > On Tue, Feb 17, 2009 at 9:22 AM, wrote: > > Authors aren't called "novel designers". > > You can't be a successful author without first being a successful > novel designer, though; at least if you are writing novels. There are authors who cannot write from an outline. FOr them, the novel is what they discover along the way while they are writing, and then they have a *huge* revision job when they finish the first draft. Others cannot write without an outline. It has been said that when writing a mystery novel, it's a huge advantage for the author to know whodunit. But other writers confess that they only thing they can use to motivate themselves is that they want to find out whodunit. Once they know that, it becomes excricuatingly hard to commit words to paper. The thing is, there are good writers in both camps. Are there similar phenomena in computer programming? -- hendrik From clements at brinckerhoff.org Tue Feb 17 13:23:38 2009 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:41:34 2009 Subject: [plt-scheme] Functions as first class data types. In-Reply-To: References: <73045cca0902141624j33031e0ara6c86603b33c60ac@mail.gmail.com> <756daca50902141917i445bdf1amd4051a6b05899ab6@mail.gmail.com> Message-ID: <202B7866-CCAA-4790-BDF0-B51C8AE8ED1B@brinckerhoff.org> On Feb 14, 2009, at 8:21 PM, e wrote: > wow, based on that link, I guess my answer to the "newbie lambda() > (??????)" post wasn't that unique. Here's an excerpt that had to do > with *why* (not how) the stop function was tied to the function > returned from "server": > > "Not only CAN you return a function, the REASON you are in this case > is so that its execution will be tied (bound) to the thread that was > started. I am thinking this is an example of a "closure". > > I guess in OO, you'd make a server "instance", and it would have a > "stop" command . . .. or you could "delete" it (in C++), which would > call the "destructor" . . . or in Java, there's some what of an > opportunity in "finalize()", but not a reliable one. In Python, I'm > thinking you'd have a "stop", and it'd be obvious that construction > and "stopping" aren't symmetric operations. > > Now that I've made this comparison, it seems like the argument you > have for fp reduces from "you can't do this in OO" to, "you need > more boilerplate and fanfare to do it in OO" (possibly a whole file, > possibly two -- one for the header and one for the implementation, > RAII semantics on the constructor, etc)." From Alan Perlis: Beware of the Turing tar-pit in which everything is possible but nothing of interest is easy." --Alan Perlis, "Epigrams on Programming" [1]. That is: in any Turing-complete language, you can "do anything you want" (that is, you can do all the things you can do in the other Turing-complete languages) . The question is not whether a particular language can encode a particular style, but whether it does so in a "nice" way. You can also distinguish languages on the basis of their expressiveness--see papers by Felleisen. John Clements > On Sat, Feb 14, 2009 at 10:29 PM, Henk Boom wrote: > 2009/2/14 Grant Rettke : > > On Sat, Feb 14, 2009 at 6:24 PM, aditya shukla > > wrote: > >> Can someone please explain what's the use of having functions as > first > >> class data type in scheme .I am a little confused about functions > having > >> functions as their arguments . > > > > There are problems that you want to solve while programming where > you > > will find that first class functions are one good solution. In their > > absence there are other good solutions, too. > > Other good solutions such as objects: > > http://people.csail.mit.edu/gregs/ll1-discuss-archive-html/msg03277.html > > Henk > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme -------------- 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/20090217/a8608391/smime.bin From grettke at acm.org Tue Feb 17 13:30:54 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:34 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming In-Reply-To: <984FB2DB-7272-4B3B-8C76-A81C81C47BBE@ccs.neu.edu> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <984FB2DB-7272-4B3B-8C76-A81C81C47BBE@ccs.neu.edu> Message-ID: <756daca50902171030v4dc27da8x831a461599b89f5f@mail.gmail.com> On Tue, Feb 17, 2009 at 9:44 AM, Matthias Felleisen wrote: > FP has failed to reach out and demonstrate concretely to such people "how _it_ works and is superior to what they have." Is that one of the duties of your academic career? Personal philosophy? The most popular programming trends today encourage acceptance without question and utilization without understanding fueled mostly by highly charismatic individuals and/or big corporations. The motto "Thinking is not required" sums it up. Compared to the mainstream; there is little material that shows why "FP is so great"; but the material, and more importantly the people, are out there; it just requires a highly motivated individual to take the effort to find out why. That individual is likely to be a fractional percentage of the overall community. *That* is the problem. From yinso.chen at gmail.com Tue Feb 17 13:36:46 2009 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:41:35 2009 Subject: Novels and programs (was: Re: [plt-scheme] Prereqs for robotic programming In-Reply-To: <20090217172152.GB29566@topoi.pooq.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <20090217152235.GA29566@topoi.pooq.com> <756daca50902170823l4d369dcbk3fc0b404df26d5ce@mail.gmail.com> <20090217172152.GB29566@topoi.pooq.com> Message-ID: <779bf2730902171036h8519b11kc3bdfefdbf3b35dc@mail.gmail.com> On Tue, Feb 17, 2009 at 9:21 AM, wrote: > > The thing is, there are good writers in both camps. > > Are there similar phenomena in computer programming? > I can find similar phenomena within myself (not saying I am a good developer though as that's for others to judge) :) When I am building an application, often times it makes sense to do some upfront requirements, specs, and designs so I have an understanding of what to do. But there are also situations, most often when tackling an unfamiliar problem domain, writing APIs, I have to first hack a probable solution, than I can eventually evole the solution into something that I like (unfortunately, sometimes that means never). It could be just a habit, but even if I tried to write the API on paper, I found it's not as satisfying as seeing the code actually evolve, as the API written on paper is most likely also wrong since it's my first try (and it's harder to correct the API on paper than on keyboard). This might not be a 100% parallel, but that's what I immediately thought of when reading your msg. Cheers, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090217/38c08e5f/attachment.html From grettke at acm.org Tue Feb 17 13:41:06 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:35 2009 Subject: Novels and programs (was: Re: [plt-scheme] Prereqs for robotic programming In-Reply-To: <20090217172152.GB29566@topoi.pooq.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <20090217152235.GA29566@topoi.pooq.com> <756daca50902170823l4d369dcbk3fc0b404df26d5ce@mail.gmail.com> <20090217172152.GB29566@topoi.pooq.com> Message-ID: <756daca50902171041s5440492fj19aa1e04e8af2fd3@mail.gmail.com> On Tue, Feb 17, 2009 at 11:21 AM, wrote: > On Tue, Feb 17, 2009 at 10:23:38AM -0600, Grant Rettke wrote: >> >> You can't be a successful author without first being a successful >> novel designer, though; at least if you are writing novels. > > There are authors who cannot write from an outline. FOr them, the novel > is what they discover along the way while they are writing, and then > they have a *huge* revision job when they finish the first draft. Yes, the same thing happens in software. It is painful and very expensive. > Others cannot write without an outline. I talked to an author about this and skimmed some books about "how to write books". Books, all books, have structure and a plan. They have a design. It is just like programming. Call it iterations or increments of deployments or whatever you want they have a plan. > But other writers confess that they only thing they can use to motivate > themselves is that they want to find out whodunit. Once they know that, > it becomes excricuatingly hard to commit words to paper. Why?! :) > The thing is, there are good writers in both camps. The "non planners" have internalized an approach but don't know how to verbalize it. They know what they think, but not why they think it. > Are there similar phenomena in computer programming? The the non-planners sometimes get away with it and are called superstarts until they fail miserably and they call in the designers to clean up the mess! :) From hendrik at topoi.pooq.com Tue Feb 17 12:50:47 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:41:35 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming In-Reply-To: <756daca50902171030v4dc27da8x831a461599b89f5f@mail.gmail.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <984FB2DB-7272-4B3B-8C76-A81C81C47BBE@ccs.neu.edu> <756daca50902171030v4dc27da8x831a461599b89f5f@mail.gmail.com> Message-ID: <20090217175046.GA29828@topoi.pooq.com> On Tue, Feb 17, 2009 at 12:30:54PM -0600, Grant Rettke wrote: > On Tue, Feb 17, 2009 at 9:44 AM, Matthias Felleisen > wrote: > > FP has failed to reach out and demonstrate concretely to such people "how _it_ works and is superior to what they have." > > Is that one of the duties of your academic career? Personal philosophy? > > The most popular programming trends today encourage acceptance without > question and utilization without understanding fueled mostly by highly > charismatic individuals and/or big corporations. The motto "Thinking > is not required" sums it up. > > Compared to the mainstream; there is little material that shows why > "FP is so great"; but the material, and more importantly the people, > are out there; it just requires a highly motivated individual to take > the effort to find out why. > > That individual is likely to be a fractional percentage of the overall > community. *That* is the problem. The wider problem is that the practice of computer programming (taken in a wide sense) is spreading far faster than the understanding of computer programming. The result is that, as a beginner, you're likely to be learning from other beginners. And you're not even likely to know there are other ways. -- hendrik From grettke at acm.org Tue Feb 17 13:54:13 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:36 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming In-Reply-To: <20090217175046.GA29828@topoi.pooq.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <984FB2DB-7272-4B3B-8C76-A81C81C47BBE@ccs.neu.edu> <756daca50902171030v4dc27da8x831a461599b89f5f@mail.gmail.com> <20090217175046.GA29828@topoi.pooq.com> Message-ID: <756daca50902171054q6088f36bp1fc1cabf58b5f412@mail.gmail.com> On Tue, Feb 17, 2009 at 11:50 AM, wrote: > as a beginner, you're likely to be learning from other beginners. And you're not even likely to know there are other ways. That is my experience. From adityashukla1983 at gmail.com Tue Feb 17 14:19:32 2009 From: adityashukla1983 at gmail.com (aditya shukla) Date: Thu Mar 26 02:41:36 2009 Subject: [plt-scheme] Combining digits to form numbers In-Reply-To: <756daca50902171017v708c6711rd32ba1ca51a9e4db@mail.gmail.com> References: <73045cca0902161159u1ddeea39h8f818c288c8bccf9@mail.gmail.com> <6F30A62B-5415-4110-B3A9-8DB5E0FFAC03@adelphi.edu> <756daca50902171017v708c6711rd32ba1ca51a9e4db@mail.gmail.com> Message-ID: <73045cca0902171119j733c5be1g6477cdf499a50561@mail.gmail.com> This how i solved this problem .I have made another procedure for guess thinking that the number returned by it depends on lsb , csb and msb.Therefore it should be another procedure. (define check-guess3 (lambda(lsb csb msb target) (cond [(< guess(lsb csb msb) target) 'Toosmall] [(= guess(lsb csb msb) target) 'Perfect] [else 'Toolarge]))) (define guess (lambda (lsb csb msb) (+(* msb 100)(* csb 10) (* lsb 1)))) Aditya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090217/f231af27/attachment.htm From yinso.chen at gmail.com Tue Feb 17 14:21:59 2009 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:41:37 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming In-Reply-To: <756daca50902171030v4dc27da8x831a461599b89f5f@mail.gmail.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <984FB2DB-7272-4B3B-8C76-A81C81C47BBE@ccs.neu.edu> <756daca50902171030v4dc27da8x831a461599b89f5f@mail.gmail.com> Message-ID: <779bf2730902171121i51c6b99fxb1b1c803accaf523@mail.gmail.com> On Tue, Feb 17, 2009 at 10:30 AM, Grant Rettke wrote: > On Tue, Feb 17, 2009 at 9:44 AM, Matthias Felleisen > wrote: > > FP has failed to reach out and demonstrate concretely to such people "how > _it_ works and is superior to what they have." > > Is that one of the duties of your academic career? Personal philosophy? > > The most popular programming trends today encourage acceptance without > question and utilization without understanding fueled mostly by highly > charismatic individuals and/or big corporations. The motto "Thinking > is not required" sums it up. > IMHO two non-marketing factors for the success of language platforms in the past decade are 1) vast amount of libraries written in the language to reduce mundane work, and/or 2) the language fills a niche that hasn't yet been addressed. Many FPs suffer #1. Erlang appears to have momentum behind them as they tackle multi processing quite well. > Compared to the mainstream; there is little material that shows why > "FP is so great"; but the material, and more importantly the people, > are out there; it just requires a highly motivated individual to take > the effort to find out why. > Learning FP today is similar to "exercise and floss are good for you", yet for many it's too much to bother. Their day jobs and lives are hard enough as is. That individual is likely to be a fractional percentage of the overall > community. *That* is the problem. > But people are motivated toward pleasure and away from pain, so if learning FP is going to cause too much pain, it's going to be a non starter. Paraphrasing Joel Spolsky, you can't find customers if you can't explain what their pains are . So if we want greater adoptions (and a shelf life after school) then FP must attempt to solve some problems for people in work settings, better than what they are already familiar with. Erlang is a good case studyon how a company adopts and develop FP when other alternatives failed. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090217/9edb571c/attachment.html From grettke at acm.org Tue Feb 17 14:26:07 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:37 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming In-Reply-To: <779bf2730902171121i51c6b99fxb1b1c803accaf523@mail.gmail.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <984FB2DB-7272-4B3B-8C76-A81C81C47BBE@ccs.neu.edu> <756daca50902171030v4dc27da8x831a461599b89f5f@mail.gmail.com> <779bf2730902171121i51c6b99fxb1b1c803accaf523@mail.gmail.com> Message-ID: <756daca50902171126xd5748c7n9922900f8573741@mail.gmail.com> On Tue, Feb 17, 2009 at 1:21 PM, YC wrote: > But people are motivated toward pleasure and away from pain, so if learning > FP is going to cause too much pain, it's going to be a non starter. Yes it is painful. > So if we want greater adoptions (and a shelf life > after school) then FP must attempt to solve some problems for people in work > settings, better than what they are already familiar with. Siebel's _Practical Common Lisp_ book is loved by thousands. _Practical Scheme_ is sure to be a hit. From sbloch at adelphi.edu Tue Feb 17 14:30:22 2009 From: sbloch at adelphi.edu (Stephen Bloch) Date: Thu Mar 26 02:41:37 2009 Subject: Novels and programs (was: Re: [plt-scheme] Prereqs for robotic programming In-Reply-To: <20090217172152.GB29566@topoi.pooq.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <20090217152235.GA29566@topoi.pooq.com> <756daca50902170823l4d369dcbk3fc0b404df26d5ce@mail.gmail.com> <20090217172152.GB29566@topoi.pooq.com> Message-ID: <7A211AFD-42A7-4069-AB04-582FB57B6CAE@adelphi.edu> On Feb 17, 2009, at 12:21 PM, hendrik@topoi.pooq.com wrote: > There are authors who cannot write from an outline. FOr them, the > novel > is what they discover along the way while they are writing, and then > they have a *huge* revision job when they finish the first draft. > > Others cannot write without an outline. > ... > The thing is, there are good writers in both camps. > > Are there similar phenomena in computer programming? I'm sure you're all familiar with the concept of "exploratory programming", in which you don't start out with a well-defined problem, but you go ahead and start coding anyway. It can be used to learn about the domain, to familiarize yourself with a library you'll need to use, to rapid-prototype a user interface, etc. In a sense, even DrScheme's Interactions Pane is an example in that it encourages trying things as they occur to you, not necessarily according to a prewritten plan. That said, "exploratory programming" can easily be taken as an excuse for "I don't want to bother thinking about the problem; I just want to see some code compile and run." Stephen Bloch sbloch@adelphi.edu From jos.koot at telefonica.net Tue Feb 17 15:51:45 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:41:37 2009 Subject: [plt-scheme] Combining digits to form numbers References: <73045cca0902161159u1ddeea39h8f818c288c8bccf9@mail.gmail.com><6F30A62B-5415-4110-B3A9-8DB5E0FFAC03@adelphi.edu><756daca50902171017v708c6711rd32ba1ca51a9e4db@mail.gmail.com> <73045cca0902171119j733c5be1g6477cdf499a50561@mail.gmail.com> Message-ID: Almost right, but you did not yet test it. You are close, though! Introduction of function quess is a good idea. The first two cond lines have bugs. The procedure wont run correctly. After you have made it working (which requires a few keystrokes only), you may want to avoid calling procedure guess twice with the same arguments. But first make it working after your present idea, then simplify. Jos ----- Original Message ----- From: aditya shukla To: Grant Rettke Cc: PLT Scheme ML ; plt-edu-discuss@list.cs.brown.edu Sent: Tuesday, February 17, 2009 8:19 PM Subject: Re: [plt-scheme] Combining digits to form numbers This how i solved this problem .I have made another procedure for guess thinking that the number returned by it depends on lsb , csb and msb.Therefore it should be another procedure. (define check-guess3 (lambda(lsb csb msb target) (cond [(< guess(lsb csb msb) target) 'Toosmall] [(= guess(lsb csb msb) target) 'Perfect] [else 'Toolarge]))) (define guess (lambda (lsb csb msb) (+(* msb 100)(* csb 10) (* lsb 1)))) Aditya ------------------------------------------------------------------------------ _________________________________________________ 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/20090217/7d03ac28/attachment.htm From jos.koot at telefonica.net Tue Feb 17 15:57:02 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:41:38 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com><9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com><984FB2DB-7272-4B3B-8C76-A81C81C47BBE@ccs.neu.edu><756daca50902171030v4dc27da8x831a461599b89f5f@mail.gmail.com> <779bf2730902171121i51c6b99fxb1b1c803accaf523@mail.gmail.com> Message-ID: ----- Original Message ----- From: YC To: Grant Rettke Cc: PLT List ; Marco Morazan ; Matthias Felleisen Sent: Tuesday, February 17, 2009 8:21 PM Subject: Re: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming On Tue, Feb 17, 2009 at 10:30 AM, Grant Rettke wrote: On Tue, Feb 17, 2009 at 9:44 AM, Matthias Felleisen wrote: > FP has failed to reach out and demonstrate concretely to such people "how _it_ works and is superior to what they have." Is that one of the duties of your academic career? Personal philosophy? The most popular programming trends today encourage acceptance without question and utilization without understanding fueled mostly by highly charismatic individuals and/or big corporations. The motto "Thinking is not required" sums it up. IMHO two non-marketing factors for the success of language platforms in the past decade are 1) vast amount of libraries written in the language to reduce mundane work, and/or 2) the language fills a niche that hasn't yet been addressed. Many FPs suffer #1. Erlang appears to have momentum behind them as they tackle multi processing quite well. It appears to me that, at least in the past, some programmers prefer languages with incomprehensible syntax and many pittfals, because it looks so clever in the eyes of layman. Jos Compared to the mainstream; there is little material that shows why "FP is so great"; but the material, and more importantly the people, are out there; it just requires a highly motivated individual to take the effort to find out why. Learning FP today is similar to "exercise and floss are good for you", yet for many it's too much to bother. Their day jobs and lives are hard enough as is. That individual is likely to be a fractional percentage of the overall community. *That* is the problem. But people are motivated toward pleasure and away from pain, so if learning FP is going to cause too much pain, it's going to be a non starter. Paraphrasing Joel Spolsky, you can't find customers if you can't explain what their pains are. So if we want greater adoptions (and a shelf life after school) then FP must attempt to solve some problems for people in work settings, better than what they are already familiar with. Erlang is a good case study on how a company adopts and develop FP when other alternatives failed. ------------------------------------------------------------------------------ _________________________________________________ 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/20090217/bf0b029b/attachment.html From maxigas at anargeek.net Tue Feb 17 16:01:31 2009 From: maxigas at anargeek.net (maxigas) Date: Thu Mar 26 02:41:38 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming In-Reply-To: References: <756daca50902171030v4dc27da8x831a461599b89f5f@mail.gmail.com> <779bf2730902171121i51c6b99fxb1b1c803accaf523@mail.gmail.com> Message-ID: <20090217.220131.118252702.maxigas@anargeek.net> From: "Jos Koot" Subject: Re: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming Date: Tue, 17 Feb 2009 21:57:02 +0100 > It appears to me that, at least in the past, some programmers prefer languages with incomprehensible syntax and many pittfals, > because it looks so clever in the eyes of layman. > Jos That was one of my motivations for learning a Lisp dialect, connecting with the old-school hacker tradition and looking for a language that can provide some "formal" education in programming, since i am a Humanities student working as a web developer on the side. :) maxigas From maxigas at anargeek.net Tue Feb 17 16:04:17 2009 From: maxigas at anargeek.net (maxigas) Date: Thu Mar 26 02:41:39 2009 Subject: Novels and programs (was: Re: [plt-scheme] Prereqs for robotic programming In-Reply-To: <7A211AFD-42A7-4069-AB04-582FB57B6CAE@adelphi.edu> References: <756daca50902170823l4d369dcbk3fc0b404df26d5ce@mail.gmail.com> <20090217172152.GB29566@topoi.pooq.com> <7A211AFD-42A7-4069-AB04-582FB57B6CAE@adelphi.edu> Message-ID: <20090217.220417.201177531.maxigas@anargeek.net> From: Stephen Bloch Subject: Re: Novels and programs (was: Re: [plt-scheme] Prereqs for robotic programming Date: Tue, 17 Feb 2009 14:30:22 -0500 > On Feb 17, 2009, at 12:21 PM, hendrik@topoi.pooq.com wrote: > >> There are authors who cannot write from an outline. FOr them, the >> novel >> is what they discover along the way while they are writing, and then >> they have a *huge* revision job when they finish the first draft. >> >> Others cannot write without an outline. >> ... >> The thing is, there are good writers in both camps. >> >> Are there similar phenomena in computer programming? > > I'm sure you're all familiar with the concept of "exploratory > programming", in which you don't start out with a well-defined > problem, but you go ahead and start coding anyway. It can be used to > learn about the domain, to familiarize yourself with a library you'll > need to use, to rapid-prototype a user interface, etc. In a sense, > even DrScheme's Interactions Pane is an example in that it encourages > trying things as they occur to you, not necessarily according to a > prewritten plan. > > That said, "exploratory programming" can easily be taken as an excuse > for "I don't want to bother thinking about the problem; I just want to > see some code compile and run." there was a memorable quote from last year's Chaos Computer Congress: "Hours of planning can save days of coding." which was turned into the more head-on "Days of coding can save hours of planning." maxime. :P maxigas From plragde at uwaterloo.ca Tue Feb 17 16:46:05 2009 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:41:39 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming Message-ID: <499B301D.40905@uwaterloo.ca> >> But people are motivated toward pleasure and away from pain, so if learning >> > FP is going to cause too much pain, it's going to be a non starter. > > Yes it is painful. Says who? I wrote my first functional program in my fifth decade of life. And as my sixth approaches, I continue to learn about FP with an underlying fury -- fury that from age 14 to 40+, my teachers, my peers, and my field conspired to hide this natural and elegant way of doing things from me. --PR From adityashukla1983 at gmail.com Tue Feb 17 16:47:16 2009 From: adityashukla1983 at gmail.com (aditya shukla) Date: Thu Mar 26 02:41:40 2009 Subject: [plt-scheme] Combining digits to form numbers In-Reply-To: References: <73045cca0902161159u1ddeea39h8f818c288c8bccf9@mail.gmail.com> <6F30A62B-5415-4110-B3A9-8DB5E0FFAC03@adelphi.edu> <756daca50902171017v708c6711rd32ba1ca51a9e4db@mail.gmail.com> <73045cca0902171119j733c5be1g6477cdf499a50561@mail.gmail.com> Message-ID: <73045cca0902171347w7990bd70t8c010b451853e268@mail.gmail.com> I removed the bugs from the cond condition . (define check-guess3 (lambda(lsb csb msb target) (cond [(< (guess lsb csb msb) target) 'Toosmall] [(= (guess lsb csb msb) target) 'Perfect] [else 'Toolarge]))) (define guess (lambda (lsb csb msb) (+(* msb 100)(* csb 10) (* lsb 1)))) For removing the function call twice with the same argument i can i call it before cond and store the return value in a variable .can it be done like this (define check-guess3 (lambda(lsb csb msb target) define guess-n (guess lsb csb msb) (cond [(< guess-n target) 'Toosmall] [(= guess-n target) 'Perfect] [else 'Toolarge]))) (define guess (lambda (lsb csb msb) (+(* msb 100)(* csb 10) (* lsb 1)))) After doing this i get the error lambda: expected only one expression for the function body, but found at least one extra part How can i fix this error? Aditya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090217/f825f93c/attachment.htm From robby at eecs.northwestern.edu Tue Feb 17 16:51:08 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Mar 26 02:41:40 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming In-Reply-To: <499B301D.40905@uwaterloo.ca> References: <499B301D.40905@uwaterloo.ca> Message-ID: <932b2f1f0902171351y2e9c3328vbfedcdd4132ebad0@mail.gmail.com> On Tue, Feb 17, 2009 at 3:46 PM, Prabhakar Ragde wrote: > fury that from age 14 to 40+, my teachers, my peers, and my field conspired > to hide this natural and elegant way of doing things from me. --PR Those bastards! Robby From grettke at acm.org Tue Feb 17 16:53:37 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:40 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming In-Reply-To: <499B301D.40905@uwaterloo.ca> References: <499B301D.40905@uwaterloo.ca> Message-ID: <756daca50902171353r4edb5782n43d231236481caa0@mail.gmail.com> On Tue, Feb 17, 2009 at 3:46 PM, Prabhakar Ragde wrote: >>> But people are motivated toward pleasure and away from pain, so if >>> learning FP is going to cause too much pain, it's going to be a non starter. >> >> Yes it is painful. > > Says who? So say the masses. Books on OO and imperative (non-OO) are numerous; and a lot of them are even good. Books on FP are few and far between. You are also dealing with an expert community who sort of forgets how hard it is. Now this group is very much the exception in that regard; but you get the point. > I wrote my first functional program in my fifth decade of life. And as my > sixth approaches, I continue to learn about FP with an underlying fury -- > fury that from age 14 to 40+, my teachers, my peers, and my field conspired > to hide this natural and elegant way of doing things from me. --PR Yes I am a victim of the conspiracy you descibe; but no longer. From plragde at uwaterloo.ca Tue Feb 17 16:54:24 2009 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:41:40 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming In-Reply-To: <932b2f1f0902171351y2e9c3328vbfedcdd4132ebad0@mail.gmail.com> References: <499B301D.40905@uwaterloo.ca> <932b2f1f0902171351y2e9c3328vbfedcdd4132ebad0@mail.gmail.com> Message-ID: <499B3210.8010001@uwaterloo.ca> Robby Findler wrote: > On Tue, Feb 17, 2009 at 3:46 PM, Prabhakar Ragde wrote: >> fury that from age 14 to 40+, my teachers, my peers, and my field conspired >> to hide this natural and elegant way of doing things from me. --PR > > Those bastards! Damn straight. This week it's "Why the hell did I have to learn the theory of LR parsing with explicit stacks and state transitions instead of mutually-recursive functions?" --PR From plragde at uwaterloo.ca Tue Feb 17 17:01:43 2009 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:41:40 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming In-Reply-To: <756daca50902171353r4edb5782n43d231236481caa0@mail.gmail.com> References: <499B301D.40905@uwaterloo.ca> <756daca50902171353r4edb5782n43d231236481caa0@mail.gmail.com> Message-ID: <499B33C7.2020203@uwaterloo.ca> Grant Rettke wrote: > So say the masses. Yeah, I teach those masses (and work beside some of them). They're hidebound. Their idea of "make it simple" is "make it what I already know", never mind that what I'm showing them is a tenth the size and crystal-clear. > Books on OO and imperative (non-OO) are numerous; > and a lot of them are even good. Books on FP are few and far between. I disagree. Books on OO and imperative programming are numerous, yes. Nearly all of them are wretched. In such a volume you will find the occasional gem, perhaps. But the hit rate is much higher with FP books. Nearly all the good ones I've read lately have been at least tangentially related and often deeply related to FP. --PR From jos.koot at telefonica.net Tue Feb 17 17:15:48 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:41:41 2009 Subject: [plt-scheme] Combining digits to form numbers References: <73045cca0902161159u1ddeea39h8f818c288c8bccf9@mail.gmail.com> <6F30A62B-5415-4110-B3A9-8DB5E0FFAC03@adelphi.edu> <756daca50902171017v708c6711rd32ba1ca51a9e4db@mail.gmail.com> <73045cca0902171119j733c5be1g6477cdf499a50561@mail.gmail.com> <73045cca0902171347w7990bd70t8c010b451853e268@mail.gmail.com> Message-ID: <19939944328648378DC6E5609F938E8C@uw2b2dff239c4d> ----- Original Message ----- From: aditya shukla To: Jos Koot Cc: PLT Scheme ML ; plt-edu-discuss@list.cs.brown.edu Sent: Tuesday, February 17, 2009 10:47 PM Subject: Re: [plt-scheme] Combining digits to form numbers I removed the bugs from the cond condition . (define check-guess3 (lambda(lsb csb msb target) (cond [(< (guess lsb csb msb) target) 'Toosmall] [(= (guess lsb csb msb) target) 'Perfect] [else 'Toolarge]))) (define guess (lambda (lsb csb msb) (+(* msb 100)(* csb 10) (* lsb 1)))) For removing the function call twice with the same argument i can i call it before cond and store the return value in a variable .can it be done like this (define check-guess3 (lambda(lsb csb msb target) define guess-n (guess lsb csb msb) (cond [(< guess-n target) 'Toosmall] [(= guess-n target) 'Perfect] [else 'Toolarge]))) (define guess (lambda (lsb csb msb) (+(* msb 100)(* csb 10) (* lsb 1)))) After doing this i get the error lambda: expected only one expression for the function body, but found at least one extra part How can i fix this error? Aditya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090217/a00456d9/attachment.html From jos.koot at telefonica.net Tue Feb 17 17:20:40 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:41:41 2009 Subject: [plt-scheme] Combining digits to form numbers References: <73045cca0902161159u1ddeea39h8f818c288c8bccf9@mail.gmail.com> <6F30A62B-5415-4110-B3A9-8DB5E0FFAC03@adelphi.edu> <756daca50902171017v708c6711rd32ba1ca51a9e4db@mail.gmail.com> <73045cca0902171119j733c5be1g6477cdf499a50561@mail.gmail.com> <73045cca0902171347w7990bd70t8c010b451853e268@mail.gmail.com> Message-ID: You still have some parentheses wrong. See my anseer in private mail. Jos ----- Original Message ----- From: aditya shukla To: Jos Koot Cc: PLT Scheme ML ; plt-edu-discuss@list.cs.brown.edu Sent: Tuesday, February 17, 2009 10:47 PM Subject: Re: [plt-scheme] Combining digits to form numbers I removed the bugs from the cond condition . (define check-guess3 (lambda(lsb csb msb target) (cond [(< (guess lsb csb msb) target) 'Toosmall] [(= (guess lsb csb msb) target) 'Perfect] [else 'Toolarge]))) (define guess (lambda (lsb csb msb) (+(* msb 100)(* csb 10) (* lsb 1)))) For removing the function call twice with the same argument i can i call it before cond and store the return value in a variable .can it be done like this (define check-guess3 (lambda(lsb csb msb target) define guess-n (guess lsb csb msb) (cond [(< guess-n target) 'Toosmall] [(= guess-n target) 'Perfect] [else 'Toolarge]))) (define guess (lambda (lsb csb msb) (+(* msb 100)(* csb 10) (* lsb 1)))) After doing this i get the error lambda: expected only one expression for the function body, but found at least one extra part How can i fix this error? Aditya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090217/199879b0/attachment.htm From jos.koot at telefonica.net Tue Feb 17 17:29:30 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:41:42 2009 Subject: [plt-scheme] Combining digits to form numbers Message-ID: <4BBE1C7D05CA449A84D6E7DB29F0101E@uw2b2dff239c4d> I should have added the following: Are you using DrScheme? In that case you can check the correct placement of parentheses by placing the cursor right before or after a subform and inspect whether the highlighted part is as expected. You can also set the preferences such that when typing a closing parenthesesis, the corresponding opening parenthesis is shown for a short moment. I use these two tools very frequently. And of course I frequently use Check Syntax. Jos ----- Original Message ----- From: Jos Koot To: aditya shukla Cc: PLT Scheme ML ; plt-edu-discuss@list.cs.brown.edu Sent: Tuesday, February 17, 2009 11:20 PM Subject: Re: [plt-scheme] Combining digits to form numbers You still have some parentheses wrong. See my anseer in private mail. Jos ----- Original Message ----- From: aditya shukla To: Jos Koot Cc: PLT Scheme ML ; plt-edu-discuss@list.cs.brown.edu Sent: Tuesday, February 17, 2009 10:47 PM Subject: Re: [plt-scheme] Combining digits to form numbers I removed the bugs from the cond condition . (define check-guess3 (lambda(lsb csb msb target) (cond [(< (guess lsb csb msb) target) 'Toosmall] [(= (guess lsb csb msb) target) 'Perfect] [else 'Toolarge]))) (define guess (lambda (lsb csb msb) (+(* msb 100)(* csb 10) (* lsb 1)))) For removing the function call twice with the same argument i can i call it before cond and store the return value in a variable .can it be done like this (define check-guess3 (lambda(lsb csb msb target) define guess-n (guess lsb csb msb) (cond [(< guess-n target) 'Toosmall] [(= guess-n target) 'Perfect] [else 'Toolarge]))) (define guess (lambda (lsb csb msb) (+(* msb 100)(* csb 10) (* lsb 1)))) After doing this i get the error lambda: expected only one expression for the function body, but found at least one extra part How can i fix this error? Aditya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090217/77d13526/attachment.html From yinso.chen at gmail.com Tue Feb 17 18:19:41 2009 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:41:43 2009 Subject: Novels and programs (was: Re: [plt-scheme] Prereqs for robotic programming In-Reply-To: <20090217.220417.201177531.maxigas@anargeek.net> References: <756daca50902170823l4d369dcbk3fc0b404df26d5ce@mail.gmail.com> <20090217172152.GB29566@topoi.pooq.com> <7A211AFD-42A7-4069-AB04-582FB57B6CAE@adelphi.edu> <20090217.220417.201177531.maxigas@anargeek.net> Message-ID: <779bf2730902171519x19214295uecc40074c5a1275d@mail.gmail.com> On Tue, Feb 17, 2009 at 1:04 PM, maxigas wrote: > > > That said, "exploratory programming" can easily be taken as an excuse > > for "I don't want to bother thinking about the problem; I just want to > > see some code compile and run." > > there was a memorable quote from last year's Chaos Computer Congress: > "Hours of planning can save > days of coding." which was turned into the more head-on "Days of coding can > save hours of > planning." maxime. :P > I've seen months of planning can saves days of programming as well. There is a reason why people rebel against waterfall approaches. These maxims cut both ways. It all depends on who's working on the problem. Cheers, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090217/f9868b34/attachment.htm From morazanm at gmail.com Tue Feb 17 18:25:39 2009 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:41:43 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming In-Reply-To: <756daca50902171126xd5748c7n9922900f8573741@mail.gmail.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <984FB2DB-7272-4B3B-8C76-A81C81C47BBE@ccs.neu.edu> <756daca50902171030v4dc27da8x831a461599b89f5f@mail.gmail.com> <779bf2730902171121i51c6b99fxb1b1c803accaf523@mail.gmail.com> <756daca50902171126xd5748c7n9922900f8573741@mail.gmail.com> Message-ID: <9b1fff280902171525w509f9828x454280889df78972@mail.gmail.com> >> But people are motivated toward pleasure and away from pain, so if learning >> FP is going to cause too much pain, it's going to be a non starter. > > Yes it is painful. > I am always shocked to hear stuff like this. Functional programming exacts a small intellectual price for a great deal of power that *most* when they discover it feel relieved and a sense of satisfaction. Yet the myth -- and let's be frank it is a myth -- that functional programming is hard persists. Seriously, what is painful about it? Is it painful not to have a mangled syntax? Is it painful to encourage the use of recursion? Really, c'mon! Is it painful for functions to be first-class? Is it painful not to encourage the use of sequencing and mutation/assignment? Is it painful not to have "for" and "while" as keywords? Is it painful not to think of state all the time? Is it painful not to have to manipulate pointers? Is it painful for the language to properly implement tail calls? Is referential transparency painful -- most of my students are shocked when I point out to them that in, say, Java (pick any language that encurages assignment) that f(x) == f(x) is not always true, which suggest huge gaps in their education when they learned Java --? Is having macros or continuations painful? I am not being cynical here. I know that many pick up bad habits that become part of muscle memory and then may feel lost at sea using a different programming language. Is that a short coming of functional programming? Would any of those lost at sea feel more comfortable coding in Prolog? Would a Cobol programmer feel more comfortable programming in Java? Perhaps, it is a shortcoming of our education and not of functional programming. -- Cheers, Marco From grettke at acm.org Tue Feb 17 18:51:30 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:43 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming In-Reply-To: <9b1fff280902171525w509f9828x454280889df78972@mail.gmail.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <984FB2DB-7272-4B3B-8C76-A81C81C47BBE@ccs.neu.edu> <756daca50902171030v4dc27da8x831a461599b89f5f@mail.gmail.com> <779bf2730902171121i51c6b99fxb1b1c803accaf523@mail.gmail.com> <756daca50902171126xd5748c7n9922900f8573741@mail.gmail.com> <9b1fff280902171525w509f9828x454280889df78972@mail.gmail.com> Message-ID: <756daca50902171551u369af6b6hc4c1f87144339485@mail.gmail.com> On Tue, Feb 17, 2009 at 5:25 PM, Marco Morazan wrote: >>> But people are motivated toward pleasure and away from pain, so if learning >>> FP is going to cause too much pain, it's going to be a non starter. >> >> Yes it is painful. > > I am always shocked to hear stuff like this. When I feel shocked at what someone says; it is often an opportunity for me to get to the root of a perspective very different from my own. It is just a feeling; you know that they can't be trusted. I don't think what is going on here is very shocking, though. Anything different from the mainstream will be more difficult to learn just because it is different. Now throw on top of that what is considered to me normal, or rather what is considered not to be normal in the mainstream: Normal: Object orientation, Design Patterns, C like languages, no depth or attention to detail, over complexity Abnormal: HtDP, SICP, attention to detail, thoughtful action, simplicity The very traits that are lauded in the mainstream offer little help in seeing the value of FP; or really anything for that matter. That said, there are a lot of mainstream books that are tailored to "draw in the masses" to OO. Kathy Sierra's "Head First" books for example are very appealing to the large. Also Peter Siebel's "Practical Common Lisp" or the "Real World Haskell" book are what people want to see so they feel like they are "doing something valuable" with what they learn. I don't see that in the FP world. Another example is showing the value of "pure functional programming". Other than HtDP, I have yet to be able to find a book that teaches how to, and the value of, designing purely functional programs. I have asked just about everyone I could find and there is still only one that I can point too. It is all about marketing. It isn't about real value; it is about perceived value. It would take a FP person writing a hot book and speaking at conferences and doing all sorts of things to generate hype. That is how languages "win". > Functional programming > exacts a small intellectual price for a great deal of power that > *most* when they discover it feel relieved and a sense of > satisfaction. Agreed. I feel the same way. > Yet the myth -- and let's be frank it is a myth -- that > functional programming is hard persists. Compared with the mainstream tracks; it has a higher barrier to entry. > Seriously, what is painful about it? Is it painful not to have a > mangled syntax? Is it painful to encourage the use of recursion? > Really, c'mon! Is it painful for functions to be first-class? Is it > painful not to encourage the use of sequencing and > mutation/assignment? Is it painful not to have "for" and "while" as > keywords? Is it painful not to think of state all the time? Is it > painful not to have to manipulate pointers? Is it painful for the > language to properly implement tail calls? Is referential transparency > painful -- most of my students are shocked when I point out to them > that in, say, Java (pick any language that encurages assignment) that > f(x) == f(x) is not always true, which suggest huge gaps in their > education when they learned Java --? Is having macros or continuations > painful? Strawmen: that is not the point. > I am not being cynical here. I know that many pick up bad habits that > become part of muscle memory and then may feel lost at sea using a > different programming language. Is that a short coming of functional > programming? It doesn't matter whose fault it is; but what matters is how easy you make it for these lost souls to be saved. > Would any of those lost at sea feel more comfortable > coding in Prolog? Would a Cobol programmer feel more comfortable > programming in Java? Perhaps, it is a shortcoming of our education and > not of functional programming. No. No. It doesn't matter. What matters is how you sell it. From morazanm at gmail.com Tue Feb 17 19:25:47 2009 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:41:43 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming In-Reply-To: <756daca50902171551u369af6b6hc4c1f87144339485@mail.gmail.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <984FB2DB-7272-4B3B-8C76-A81C81C47BBE@ccs.neu.edu> <756daca50902171030v4dc27da8x831a461599b89f5f@mail.gmail.com> <779bf2730902171121i51c6b99fxb1b1c803accaf523@mail.gmail.com> <756daca50902171126xd5748c7n9922900f8573741@mail.gmail.com> <9b1fff280902171525w509f9828x454280889df78972@mail.gmail.com> <756daca50902171551u369af6b6hc4c1f87144339485@mail.gmail.com> Message-ID: <9b1fff280902171625h1759173ct326524d642cc8ef9@mail.gmail.com> > example are very appealing to the large. Also Peter Siebel's > "Practical Common Lisp" or the "Real World Haskell" book are what > people want to see so they feel like they are "doing something > valuable" with what they learn. I don't see that in the FP world. > Fair criticism to some extent. It comes back to the point Matthias made about building roads from hell to paradise. We will agree to disagree about whether FP is hard. I am not going to accept that just because something is different from the mainstream, like FP is, then it means it is hard or hard to learn. Learning is general is hard and full of challenges especially when it is worthwhile to learn. I guess I just have a profound cultural difference with anyone that equates that with pain. -- Cheers, Marco From marek at xivilization.net Tue Feb 17 19:35:53 2009 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:41:43 2009 Subject: [plt-scheme] HtDP in Python! In-Reply-To: References: <756daca50902161156g2952f2f6rc93b41070dc37cf0@mail.gmail.com> <20090217073437.3cf6bda5@halmanfloyd.lan.local> Message-ID: <20090218013553.06da95d9@halmanfloyd.lan.local> On Tue, 17 Feb 2009 07:21:13 -0500 Shriram Krishnamurthi wrote: > You cannot have true OOP without tail calls. This is not a matter of > nitpicking. Python does not claim to have true OOP, even if it had tail calls. Oh, I don't think we really need a debate about Python's OOP here anyway. regards, Marek From yinso.chen at gmail.com Tue Feb 17 19:58:42 2009 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:41:44 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming In-Reply-To: <9b1fff280902171525w509f9828x454280889df78972@mail.gmail.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <984FB2DB-7272-4B3B-8C76-A81C81C47BBE@ccs.neu.edu> <756daca50902171030v4dc27da8x831a461599b89f5f@mail.gmail.com> <779bf2730902171121i51c6b99fxb1b1c803accaf523@mail.gmail.com> <756daca50902171126xd5748c7n9922900f8573741@mail.gmail.com> <9b1fff280902171525w509f9828x454280889df78972@mail.gmail.com> Message-ID: <779bf2730902171658m6de4e35gd1a5b43432fa261@mail.gmail.com> On Tue, Feb 17, 2009 at 3:25 PM, Marco Morazan wrote: I am always shocked to hear stuff like this. Functional programming > exacts a small intellectual price for a great deal of power that > *most* when they discover it feel relieved and a sense of > satisfaction. Yet the myth -- and let's be frank it is a myth -- that > functional programming is hard persists. > Well - at the risk of appearing to be down on FP, I'll share my thoughts. Let me first say that I've had a great ride so far learning FP and developing in PLT, but it's certainly not without bumps and bruises. Note - I am talking about the implementations of FP, not the concept of FP. My view is completely from a practitioner perspective - my exposure to FP in school is absolutely minimal - I had challenges matching parentheses back then. > Seriously, what is painful about it? Is it painful not to have a > mangled syntax? Is it painful to encourage the use of recursion? > Really, c'mon! Is it painful for functions to be first-class? Is it > painful not to encourage the use of sequencing and > mutation/assignment? Is it painful not to have "for" and "while" as > keywords? Is it painful not to think of state all the time? Is it > painful not to have to manipulate pointers? Is it painful for the > language to properly implement tail calls? Is referential transparency > painful -- most of my students are shocked when I point out to them > that in, say, Java (pick any language that encurages assignment) that > f(x) == f(x) is not always true, which suggest huge gaps in their > education when they learned Java --? Is having macros or continuations > painful? > The merits of FP are certainly there, but I don't believe they are well articulated or positioned. In general the message appears to be - you can write better, simpler, and shorter program in FP, without having to pull your hairs out trying to find the weird bugs. These are good value propositions, but for mass practitioners they are dubious at best. The reason is because there are serious competitors. FPs are no longer competing against C/C++ or even Java. They are competing against the newer wave of languages all vying for developers' attentions. Perl, Python, PHP, Ruby also offer ways to write better, simpler and shorter programs. And they demand far lower learning curves. Erann Gat previously shared his thoughtand alluded to Python being a serious competitor to his favorite, lisp. These languages further lower the barrier to entry by providing massive plumbings. The amount of tutorials, books, references on them are staggering. Whether you consider them rubbish or not, their existences simplified the adoption problem. Besides being "battery included", the amount of 3rd party modules written in these languages makes most developer's job fairly simple. Most developers simply have to find modules to plug and play. The fastest way to develop is not having to develop. No matter how fast you can code in FP, you can't beat reusable code. And no matter how well the FP code are written, they also go through product lifecycle of maintenance. Hence maintenance (and having a vibrant community to do maintenance) is critical. The most important thing for a practitioner is to be *productive*. Contrast the above with the state of FP language/platforms today. Introduction materials are hard(er) to find, and even when you find them, it might or might not work with a given implementation. And when you go through the hurdle to be proficient, you still have to develop most code yourself, as there simply isn't a big enough community to spread the burden and the maintenance. That *is* pain. The truth is, professional developers will put up with a lot of pain. Just look at their day jobs. They are stuck using C, Java, Cobol or whatever at work at most places in a dusty cubicle with little lights, working 60-80 hours a week, just so they can put some food on the table. Why wouldn't they want to simplify their lives? But change is scary. Peopleware talks about people hate change, period. People more readily adapt change when there are prior examples of success. Or when they really have to solve a problem that existing solutions just don't cut it. What they generally don't do is to jump through hoops for qualitative and possibly dubious value propositions such as better or simpler. That's why I believe plumbings are the most important task for a FP to catch on. It's even better if there are such a well defined niche for the language to solve a problem, so it can take the time to build up the plumbings. Even Perl's formiddable CPAN is built over time while Perl prospers from solving text processing and web CGI niches. Erlang now also appears to catch on as it solves massive concurrency problems that's appearing to become important. I am a lurker on erlang's list and can attest to the increase of interest there. If Erlang does "get over the hump" it will cause more adoption for FP in general than other FP languages. I am not being cynical here. I know that many pick up bad habits that > become part of muscle memory and then may feel lost at sea using a > different programming language. Is that a short coming of functional > programming? Would any of those lost at sea feel more comfortable > coding in Prolog? Would a Cobol programmer feel more comfortable > programming in Java? Perhaps, it is a shortcoming of our education and > not of functional programming. > Education is certainly key, but education alone isn't going to influence the industry, until the above issues are addressed. And given most will stay in industry longer than in school I would say it's more important to build up the plumbings. Wouldn't you want to hear your student say "why don't you teach me scheme, I want to work at Google (or another hip company) and they standardize on it"? Surely that'll make your life as a professor easier too. My 2 cents and ramblings. Cheers, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090217/d7f02872/attachment.html From plragde at uwaterloo.ca Tue Feb 17 20:00:35 2009 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:41:44 2009 Subject: [plt-scheme] Re: from hell to paradise In-Reply-To: <756daca50902171551u369af6b6hc4c1f87144339485@mail.gmail.com> Message-ID: <499B5DB3.60304@uwaterloo.ca> Grant Rettke wrote: > Also Peter Siebel's > "Practical Common Lisp" or the "Real World Haskell" book are what > people want to see so they feel like they are "doing something > valuable" with what they learn. I don't see that in the FP world. I'm confused -- those books are in the FP world. Do you want something like them for Scheme? I would point to the v4 documentation, already an order of magnitude better than that for any comparable tool. I expect it to get better. (If HtDP were a wiki, it would be transformed by now.) > Another example is showing the value of "pure functional programming". > Other than HtDP, I have yet to be able to find a book that teaches how > to, and the value of, designing purely functional programs. I have > asked just about everyone I could find and there is still only one > that I can point too. In Scheme, no, though I would say that TSPL doesn't make a big deal of mutation, and neither does Paulson's "ML For The Working Programmer". But what about Hutton's "Programming in Haskell", or Hudak's "The Haskell School of Expression", or Okasaki's "Purely Functional Data Structures", or Rabhi and Lapalme's "Algorithms: A Functional Programming Approach"? Perhaps I can draw an analogy with environmentalism. After some alarming discoveries in the '60's and '70's, governments gradually regulated (at least in North America) the more extreme violations. But individual responsibility took much longer to sink in. There was a school of thought that suggested making it easier for people by making it familiar, which brought us trash separated at the dump instead of at collection point, hybrid SUVs, etc. But these were just stopgaps. What was really required was a change in thinking, and that happened among the young. We're not there yet, but it looks a lot better than it did a decade or two ago. As a student, I went out into summer workplaces and argued for structured programming against senior programmers who insisted on their right to GOTO any label they put in their code, for the use of Pascal and C instead of FORTRAN and COBOL, for the use of Unix instead of whatever IBM was offering. I didn't make much headway, but there were thousands like me, and collectively we had an effect. We were shown a new way to think, and we made that the norm. It can happen again, though -- I believe -- not if we make do with only the students who are not repulsed by their high-school CS labs (or by their image, never getting anywhere near the labs themselves) or who are primarily driven by the video games they have enjoyed. We need also to reach the best math and science students -- and the best philosophy and political science and English students, because they can look objectively at a piece of C++ code and a piece of Scheme code and come to the obvious conclusion, the one resisted by those who believe, in defiance of most of human history, that the way things are done now is the way they will always be done. --PR From grettke at acm.org Tue Feb 17 20:01:40 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:44 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming In-Reply-To: <9b1fff280902171625h1759173ct326524d642cc8ef9@mail.gmail.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <984FB2DB-7272-4B3B-8C76-A81C81C47BBE@ccs.neu.edu> <756daca50902171030v4dc27da8x831a461599b89f5f@mail.gmail.com> <779bf2730902171121i51c6b99fxb1b1c803accaf523@mail.gmail.com> <756daca50902171126xd5748c7n9922900f8573741@mail.gmail.com> <9b1fff280902171525w509f9828x454280889df78972@mail.gmail.com> <756daca50902171551u369af6b6hc4c1f87144339485@mail.gmail.com> <9b1fff280902171625h1759173ct326524d642cc8ef9@mail.gmail.com> Message-ID: <756daca50902171701x7cdf4608o64a71dc7205d2625@mail.gmail.com> On Tue, Feb 17, 2009 at 6:25 PM, Marco Morazan wrote: > We will agree to disagree about whether FP is hard. Can we agree that it is perceived to be hard? That the only point that I am trying to make. There is a lot of great material once you dig it up. From jos.koot at telefonica.net Tue Feb 17 20:02:59 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:41:44 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com><9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com><984FB2DB-7272-4B3B-8C76-A81C81C47BBE@ccs.neu.edu><756daca50902171030v4dc27da8x831a461599b89f5f@mail.gmail.com><779bf2730902171121i51c6b99fxb1b1c803accaf523@mail.gmail.com><756daca50902171126xd5748c7n9922900f8573741@mail.gmail.com><9b1fff280902171525w509f9828x454280889df78972@mail.gmail.com> <756daca50902171551u369af6b6hc4c1f87144339485@mail.gmail.com> Message-ID: <4466CC5DFEF641B489BA10CCBA5E4F5E@uw2b2dff239c4d> May be the issue is that FP requires additional layers of abstraction. That frightens lots of people. I remember well how much time I had to spend in order to give my students a grasp of first order abstraction. My personal view is, as Matthias Felleisen (thanks) once pointed out to me, of another universe, namely that CS students, or even students only to be tought programming (the borderline is not sharp I think) should first master a substantial part of mathematics in order to grasp levels of abstractions. I think the two can be combined, though. A good correlation and synchronization between mathematics classes and parallel computer science classes can be helpfull. They may even be integrated one into the other. My point of view is that programming requires the development of the ability to discern levels of abstraction and the discipline not to confuse these layers. Please don't interpret this wrongly. I do admire the succesful approach of HtDP such as to present students with *interesting* problems while nevertheless presenting a disciplined approach to programming. Nowadays students require courses to be attractive. In a number of countries making courses attractive, even to the dispence of quality, is enhanced by a financial system that grants universities money based on the ratio between the number of incoming students and the number of those that do graduate. I have seen a number of examples where this strategy fails. It may easily lead to relaxation of the demands imposed on students. But allas, this seems to be the universe we are living in. I want another universe. A university should be awarded for not letting pass students that do not qualify. It should be awarded for the quality of the graduates rather than the number of graduates. An unreal universe, I know, but it is worth to strive for an ideal even if beforehand we know that not all of this ideal can be substantiated. Jos ----- Original Message ----- From: "Grant Rettke" To: "Marco Morazan" Cc: "PLT List" ; "Matthias Felleisen" Sent: Wednesday, February 18, 2009 12:51 AM Subject: Re: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming > On Tue, Feb 17, 2009 at 5:25 PM, Marco Morazan wrote: >>>> But people are motivated toward pleasure and away from pain, so if >>>> learning >>>> FP is going to cause too much pain, it's going to be a non starter. >>> >>> Yes it is painful. >> >> I am always shocked to hear stuff like this. > > When I feel shocked at what someone says; it is often an opportunity > for me to get to the root of a perspective very different from my own. > It is just a feeling; you know that they can't be trusted. > > I don't think what is going on here is very shocking, though. Anything > different from the mainstream will be more difficult to learn just > because it is different. > > Now throw on top of that what is considered to me normal, or rather > what is considered not to be normal in the mainstream: > > Normal: Object orientation, Design Patterns, C like languages, no > depth or attention to detail, over complexity > Abnormal: HtDP, SICP, attention to detail, thoughtful action, simplicity > > The very traits that are lauded in the mainstream offer little help in > seeing the value of FP; or really anything for that matter. > > That said, there are a lot of mainstream books that are tailored to > "draw in the masses" to OO. Kathy Sierra's "Head First" books for > example are very appealing to the large. Also Peter Siebel's > "Practical Common Lisp" or the "Real World Haskell" book are what > people want to see so they feel like they are "doing something > valuable" with what they learn. I don't see that in the FP world. > > Another example is showing the value of "pure functional programming". > Other than HtDP, I have yet to be able to find a book that teaches how > to, and the value of, designing purely functional programs. I have > asked just about everyone I could find and there is still only one > that I can point too. > > It is all about marketing. It isn't about real value; it is about > perceived value. > > It would take a FP person writing a hot book and speaking at > conferences and doing all sorts of things to generate hype. That is > how languages "win". > >> Functional programming >> exacts a small intellectual price for a great deal of power that >> *most* when they discover it feel relieved and a sense of >> satisfaction. > > Agreed. I feel the same way. > >> Yet the myth -- and let's be frank it is a myth -- that >> functional programming is hard persists. > > Compared with the mainstream tracks; it has a higher barrier to entry. > >> Seriously, what is painful about it? Is it painful not to have a >> mangled syntax? Is it painful to encourage the use of recursion? >> Really, c'mon! Is it painful for functions to be first-class? Is it >> painful not to encourage the use of sequencing and >> mutation/assignment? Is it painful not to have "for" and "while" as >> keywords? Is it painful not to think of state all the time? Is it >> painful not to have to manipulate pointers? Is it painful for the >> language to properly implement tail calls? Is referential transparency >> painful -- most of my students are shocked when I point out to them >> that in, say, Java (pick any language that encurages assignment) that >> f(x) == f(x) is not always true, which suggest huge gaps in their >> education when they learned Java --? Is having macros or continuations >> painful? > > Strawmen: that is not the point. > >> I am not being cynical here. I know that many pick up bad habits that >> become part of muscle memory and then may feel lost at sea using a >> different programming language. Is that a short coming of functional >> programming? > > It doesn't matter whose fault it is; but what matters is how easy you > make it for these lost souls to be saved. > >> Would any of those lost at sea feel more comfortable >> coding in Prolog? Would a Cobol programmer feel more comfortable >> programming in Java? Perhaps, it is a shortcoming of our education and >> not of functional programming. > > No. No. It doesn't matter. What matters is how you sell it. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From grettke at acm.org Tue Feb 17 20:12:44 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:45 2009 Subject: [plt-scheme] Re: from hell to paradise In-Reply-To: <499B5DB3.60304@uwaterloo.ca> References: <756daca50902171551u369af6b6hc4c1f87144339485@mail.gmail.com> <499B5DB3.60304@uwaterloo.ca> Message-ID: <756daca50902171712t7d22e02ctdc223121f06fe44@mail.gmail.com> On Tue, Feb 17, 2009 at 7:00 PM, Prabhakar Ragde wrote: > Grant Rettke wrote: >> Also Peter Siebel's >> "Practical Common Lisp" or the "Real World Haskell" book are what >> people want to see so they feel like they are "doing something >> valuable" with what they learn. I don't see that in the FP world. > > I'm confused -- those books are in the FP world. Do you want something like > them for Scheme? I am arguing that if "we" want to see FP adopted; it needs to be presented in a manner that is deemed acceptable to the mainstream. Siebel and RWH are two books that do this. If we want to see Scheme adopted; then this is what needs to happen. That is my understanding of the market. > I would point to the v4 documentation, already an order of > magnitude better than that for any comparable tool. I expect it to get > better. (If HtDP were a wiki, it would be transformed by now.) The V4 documentation is brilliant; but it is not aimed at the masses. >> Another example is showing the value of "pure functional programming". >> Other than HtDP, I have yet to be able to find a book that teaches how >> to, and the value of, designing purely functional programs. I have >> asked just about everyone I could find and there is still only one >> that I can point too. > > In Scheme, no, though I would say that TSPL doesn't make a big deal of > mutation, and neither does Paulson's "ML For The Working Programmer". But > what about Hutton's "Programming in Haskell", or Hudak's "The Haskell School > of Expression", or Okasaki's "Purely Functional Data Structures", or Rabhi > and Lapalme's "Algorithms: A Functional Programming Approach"? Which one of these shows the programmer how to write web apps, or a streaming MP3 server? I don't even care about that and don't find it very compelling; but a *lot* of people do. HtDP, Paulson, and Okasaki are on my list; but they are not written to "win people over". > Perhaps I can draw an analogy with environmentalism. I think your point is that at some point you need to stand up for what you value and show other people that they can do the same thing. I agree. I think we are just discussing the means by which this occurs. If you want to "play the game"; you could move it along a lot faster than a wholesome, organic approach. I prefer the latter. Perhaps that makes me lazy and inflexible, or vigilent and steadfast? From morazanm at gmail.com Tue Feb 17 20:15:31 2009 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:41:45 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming In-Reply-To: <756daca50902171701x7cdf4608o64a71dc7205d2625@mail.gmail.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <984FB2DB-7272-4B3B-8C76-A81C81C47BBE@ccs.neu.edu> <756daca50902171030v4dc27da8x831a461599b89f5f@mail.gmail.com> <779bf2730902171121i51c6b99fxb1b1c803accaf523@mail.gmail.com> <756daca50902171126xd5748c7n9922900f8573741@mail.gmail.com> <9b1fff280902171525w509f9828x454280889df78972@mail.gmail.com> <756daca50902171551u369af6b6hc4c1f87144339485@mail.gmail.com> <9b1fff280902171625h1759173ct326524d642cc8ef9@mail.gmail.com> <756daca50902171701x7cdf4608o64a71dc7205d2625@mail.gmail.com> Message-ID: <9b1fff280902171715v3a72b758i4e218366367289d1@mail.gmail.com> On Tue, Feb 17, 2009 at 8:01 PM, Grant Rettke wrote: > On Tue, Feb 17, 2009 at 6:25 PM, Marco Morazan wrote: >> We will agree to disagree about whether FP is hard. > > Can we agree that it is perceived to be hard? > Yes, we can agree on that. :-) > That the only point that I am trying to make. > > There is a lot of great material once you dig it up. > Digging, admittedly, is hard. It is my experience, however, that digging for gold nuggets in the non-FP world is a lot harder. ;-) -- Cheers, Marco From morazanm at gmail.com Tue Feb 17 20:22:27 2009 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:41:45 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming In-Reply-To: <779bf2730902171658m6de4e35gd1a5b43432fa261@mail.gmail.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <984FB2DB-7272-4B3B-8C76-A81C81C47BBE@ccs.neu.edu> <756daca50902171030v4dc27da8x831a461599b89f5f@mail.gmail.com> <779bf2730902171121i51c6b99fxb1b1c803accaf523@mail.gmail.com> <756daca50902171126xd5748c7n9922900f8573741@mail.gmail.com> <9b1fff280902171525w509f9828x454280889df78972@mail.gmail.com> <779bf2730902171658m6de4e35gd1a5b43432fa261@mail.gmail.com> Message-ID: <9b1fff280902171722v3a48d345p43df90744c20e666@mail.gmail.com> > the plumbings. Wouldn't you want to hear your student say "why don't you > teach me scheme, I want to work at Google (or another hip company) and they > standardize on it"? No, I do not. I want to hear my students say teach me how to program reliable and easy to maintain software. Period. I am not interested in teaching them Scheme, C++, Java, or Perl. I want them to know how to reason about problems and how to design programs to solve problems. The syntax used is irrelevant. Whatever syntax I teach them today is likely to be outdated by the time they graduate. The problem solving skills and the design principles will not. -- Cheers, Marco From plragde at uwaterloo.ca Tue Feb 17 20:27:26 2009 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:41:45 2009 Subject: [plt-scheme] Re: from hell to paradise In-Reply-To: <756daca50902171712t7d22e02ctdc223121f06fe44@mail.gmail.com> References: <756daca50902171551u369af6b6hc4c1f87144339485@mail.gmail.com> <499B5DB3.60304@uwaterloo.ca> <756daca50902171712t7d22e02ctdc223121f06fe44@mail.gmail.com> Message-ID: <499B63FE.5030703@uwaterloo.ca> Grant Rettke wrote: > I am arguing that if "we" want to see FP adopted; it needs to be > presented in a manner that is deemed acceptable to the mainstream. > Siebel and RWH are two books that do this. If we want to see Scheme > adopted; then this is what needs to happen. That is my understanding > of the market. Fair enough. I note that it was not Guy Steele who wrote "Practical Common Lisp" and it was not Simon Peyton-Jones who wrote "Real-World Haskell". If someone wants to tackle "Real Practical Scheme" based on v4, the hostility from the factionalized community alone is likely to doom it, but on purely technical grounds, there is plenty of material. But it is not clear to me that today's enthusiasm for Haskell and Erlang (or, for that matter, Ruby) because one can do "real things" in them is sustainable. Maybe to an educator everything looks like education, but I suspect that the main benefit of Haskell is that it is highly attractive to some highly intelligent people, and the main benefit of Erlang is in learning how to do concurrency right before going off and fixing up something written in a mixture of other languages by a mixture of other people. In other words, I would caution against superficial effects that are as easily reversed as they were provoked. --PR From grettke at acm.org Tue Feb 17 20:41:30 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:45 2009 Subject: [plt-scheme] you have a tough road ahead of you ; ; ; was Re: from hell to paradise Message-ID: <756daca50902171741m2975f25bx92a4c4dbe81e530e@mail.gmail.com> Last year at work I proposed that we conduct an experiment where some senior developers and a bunch of junior-mid-level developers work through HtDP in order to find out what we could learn from it and how the company could benefit. My argument was that if we are going to flag people as "not up to snuff" then we need a way to get them "up to snuff". Typically, every single company develops their own plan; and they all fail. Since I had seen so many of these efforts crash and burn (including those of my own design); I didn't want to try again. HtPD was one a pre-built curriculum that looked like a good fit. Our plan was to follow a curriculum of reading, homework, code reviews, discussions, and by building relationships with everyone since we don't work on the same projects together. It was an all volunteer effort and the only reward would be person enrichment and perhaps stronger relationships with your peers. In theory, our culture is one of "programmer's programmers'; so this really should not have been a stretch. There were 5 senior folks and 10 junior-mid-level folks. Within one month; all of the junior-mid-level folks and 2 of the senior folks quit. One senior person quit due to health reasons and that just left my friend and I. I asked what we did wrong, how we could do it differently, and what should be changed to make it work and what we found was that it would be impossible to make it work for the following reasons: 1. It required effort on nights and weekends and it is not normal to take effort on nights and weekends. 2. It added no visible value to their daily work. 3. It was not difficult enough (they were too smart). Talking more to folks about this, I found that the going in position was: 1. If I don't learn it on the job; I won't learn it at all. 2. I want to learn about tasks like how to drop a control onto a form or deploy an ear; but not how to think. 3. I don't have much more to learn; I am already awesome. In my experience, at every place that I've worked, in every conversation with my friends in the US; this seems to be the status quo. This is for whom you are marketing "designing programs" and FP: people who don't want to put forth any effort, who don't want to learn how to think, and don't see the possibility that there is anything left for them to learn. Is it hopeless? Should you give up? No way. But what you should do is have a fair view of the playing field; and this is what it is. From adityashukla1983 at gmail.com Tue Feb 17 20:43:09 2009 From: adityashukla1983 at gmail.com (aditya shukla) Date: Thu Mar 26 02:41:46 2009 Subject: [plt-scheme] Defining structures Message-ID: <73045cca0902171743s75716fddv62e2f51f2d44c956@mail.gmail.com> I have a doubt the concept of defining structures.In htdp chapter 6 its given as A STRUCTURE DEFINITION is, as the term says, a new form of definition. Here is DrScheme's definition of posn: i have modified the example here (define-struct entry (name zip phone)) Now a few lines later it says If we give the structure a name, (define phonebook (make-entry 'PeterLee 15270 '606-7771)) Now my question here is phonebook the name of the structure or it is a structure of type entry? Aditya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090217/0553d277/attachment.htm From yinso.chen at gmail.com Tue Feb 17 20:46:13 2009 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:41:46 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming In-Reply-To: <9b1fff280902171722v3a48d345p43df90744c20e666@mail.gmail.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <984FB2DB-7272-4B3B-8C76-A81C81C47BBE@ccs.neu.edu> <756daca50902171030v4dc27da8x831a461599b89f5f@mail.gmail.com> <779bf2730902171121i51c6b99fxb1b1c803accaf523@mail.gmail.com> <756daca50902171126xd5748c7n9922900f8573741@mail.gmail.com> <9b1fff280902171525w509f9828x454280889df78972@mail.gmail.com> <779bf2730902171658m6de4e35gd1a5b43432fa261@mail.gmail.com> <9b1fff280902171722v3a48d345p43df90744c20e666@mail.gmail.com> Message-ID: <779bf2730902171746v24191e64x2a60a2dde6c4a226@mail.gmail.com> On Tue, Feb 17, 2009 at 5:22 PM, Marco Morazan wrote: > > the plumbings. Wouldn't you want to hear your student say "why don't you > > teach me scheme, I want to work at Google (or another hip company) and > they > > standardize on it"? > > No, I do not. I want to hear my students say teach me how to program > reliable and easy to maintain software. Period. I am not interested in > teaching them Scheme, C++, Java, or Perl. I want them to know how to > reason about problems and how to design programs to solve problems. > The syntax used is irrelevant. Whatever syntax I teach them today is > likely to be outdated by the time they graduate. The problem solving > skills and the design principles will not. Fair enough. I might be reaching there guessing what you'd like to hear, but hopefully it's clear that my point wasn't about a particular syntax (but isn't scheme syntax-less? :P). Meanwhile, FP adoption remains a real problem. Cheers, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090217/d2faf9cf/attachment.html From plragde at uwaterloo.ca Tue Feb 17 21:01:21 2009 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:41:47 2009 Subject: [plt-scheme] Re: you have a tough road ahead of you ; ; ; was Re: from hell to paradise In-Reply-To: <756daca50902171741m2975f25bx92a4c4dbe81e530e@mail.gmail.com> References: <756daca50902171741m2975f25bx92a4c4dbe81e530e@mail.gmail.com> Message-ID: <499B6BF1.1080405@uwaterloo.ca> Grant Rettke wrote: > This is for whom you are marketing "designing programs" and FP: people > who don't want to put forth any effort, who don't want to learn how to > think, and don't see the possibility that there is anything left for > them to learn. What you say doesn't surprise me, Grant, because of my experience in 1978 failing to get career programmers in their thirties to use a while loop. (A *while* loop!) They were calcified. Which is why I spend time with seventeen-year-olds. Though half of them are calcified already. And I will show them five-line PLT Scheme programs to suck down the New York Times RSS feed and present it as an S-expression. But not too often. Because seeing stuff like that will not help them nearly as much as working through the "generate all permutations of this list" exercise, or doing abstract list function one-liners. Sure, you need to do a certain amount of selling. But at some point there needs to be steak underneath the sizzle. --PR From matthias at ccs.neu.edu Tue Feb 17 21:04:23 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:41:47 2009 Subject: [plt-scheme] Defining structures In-Reply-To: <73045cca0902171743s75716fddv62e2f51f2d44c956@mail.gmail.com> References: <73045cca0902171743s75716fddv62e2f51f2d44c956@mail.gmail.com> Message-ID: <132C8BBC-4274-41D3-A371-36640970BD3C@ccs.neu.edu> On Feb 17, 2009, at 8:43 PM, aditya shukla wrote: > I have a doubt the concept of defining structures.In htdp chapter > 6 its given as > > A STRUCTURE DEFINITION is, as the term says, a new form of > definition. Here is DrScheme's definition of posn: i have modified > the example here > > (define-struct entry (name zip phone)) A __structure definition__ adds a class of values (lots and lots of them) to the ever-expanding universe of values. > Now a few lines later it says > > > If we give the structure a name, > > (define phonebook (make-entry 'PeterLee 15270 '606-7771)) A __structure instance__ is a specific value from the class of values that some structure definition added to the universe. Here you gave it a name: phonebook (a horrible name, because you're dealing with just one person). -- Matthias > Now my question here is phonebook the name of the structure or it > is a structure of type entry? The name _phonebook_ stands for the value (make-entry ...). To which class of values does it belong? > > > Aditya > _________________________________________________ > 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/20090217/6001f4eb/attachment.htm From jos.koot at telefonica.net Tue Feb 17 21:15:21 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:41:48 2009 Subject: [plt-scheme] Defining structures References: <73045cca0902171743s75716fddv62e2f51f2d44c956@mail.gmail.com> Message-ID: <5F313FFCFF8A41B2B3824F8168989B2B@uw2b2dff239c4d> define-struct does not define a struct, it defines a struct-type and a number of related procedures, such as a constructor (make-...), a predicate ...? and accessors and mutators. make-struct-... is a procedure that returns an instantiation of the struct-type. I think `define-struct-type' would be a better name, but reality is different. Personally I prefer make-struct-type, but that is not in the teaching languages, I think. Jos ----- Original Message ----- From: aditya shukla To: PLT Scheme ML Sent: Wednesday, February 18, 2009 2:43 AM Subject: [plt-scheme] Defining structures I have a doubt the concept of defining structures.In htdp chapter 6 its given as A STRUCTURE DEFINITION is, as the term says, a new form of definition. Here is DrScheme's definition of posn: i have modified the example here (define-struct entry (name zip phone)) Now a few lines later it says If we give the structure a name,(define phonebook (make-entry 'PeterLee 15270 '606-7771)) Now my question here is phonebook the name of the structure or it is a structure of type entry? Aditya ------------------------------------------------------------------------------ _________________________________________________ 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/20090218/765d13fc/attachment.html From adityashukla1983 at gmail.com Tue Feb 17 21:21:20 2009 From: adityashukla1983 at gmail.com (aditya shukla) Date: Thu Mar 26 02:41:49 2009 Subject: [plt-scheme] Defining structures In-Reply-To: <132C8BBC-4274-41D3-A371-36640970BD3C@ccs.neu.edu> References: <73045cca0902171743s75716fddv62e2f51f2d44c956@mail.gmail.com> <132C8BBC-4274-41D3-A371-36640970BD3C@ccs.neu.edu> Message-ID: <73045cca0902171821j3843d62ah442416dd8c005018@mail.gmail.com> So in other words can i say that define-struct will define the data type and (define phonebook (make-entry 'PeterLee 15270 '606-7771)) would create a variable named phonebook of the data type entry? Aditya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090217/b0f5ddeb/attachment.htm From matthias at ccs.neu.edu Tue Feb 17 21:34:41 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:41:49 2009 Subject: [plt-scheme] Defining structures In-Reply-To: <73045cca0902171821j3843d62ah442416dd8c005018@mail.gmail.com> References: <73045cca0902171743s75716fddv62e2f51f2d44c956@mail.gmail.com> <132C8BBC-4274-41D3-A371-36640970BD3C@ccs.neu.edu> <73045cca0902171821j3843d62ah442416dd8c005018@mail.gmail.com> Message-ID: On Feb 17, 2009, at 9:21 PM, aditya shukla wrote: > So in other words can i say that define-struct will define the data > type and (define phonebook (make-entry 'PeterLee 15270 '606-7771)) > would create a variable named phonebook of the data type entry? 1. Variables don't have types in Scheme. Values have "dynamic types" aka type tags. So this particular variable is a placeholder for a value whose tag is "entry". 2. A structure and a type don't necessarily coincide (in any language that is halfway decent). Take a look: (define-struct dress (layer neath)) ;; An RD is one of: ;; -- 'naked ;; -- (make-dress Symbol RD) If you want to call anything a "type" here, it is RD. -- Matthias From toddobryan at gmail.com Tue Feb 17 21:37:28 2009 From: toddobryan at gmail.com (Todd O'Bryan) Date: Thu Mar 26 02:41:49 2009 Subject: [plt-scheme] Re: Newbie question: Why "orange text, black background" after Run? In-Reply-To: <932b2f1f0902160454t7441b6f8qb3a768239a5bd7cd@mail.gmail.com> References: <9F230C05-E66A-4206-8DCC-B5B7D3C3FC0E@innerpaths.net> <49A67A6F-DF27-4DC8-9CA8-880C51565612@ccs.neu.edu> <932b2f1f0902160454t7441b6f8qb3a768239a5bd7cd@mail.gmail.com> Message-ID: <904774730902171837g63861af3h99670079cb0525c0@mail.gmail.com> On Mon, Feb 16, 2009 at 7:54 AM, Robby Findler wrote: > I believe it cannot be disabled for the teaching languages. > > I've added a little bit of explanation to the teaching languages > manuals. Below is the raw source text for that. Comments welcome. > > Robby > > The languages documented in this manual are provided by DrScheme to be > used with the @italic{@link["http://www.htdp.org/"]{How to Design > Programs}} book. > > When programs in these languages are run in DrScheme, any part of the > program that was not run is highlighted in orange and black. These > colors are intended to give the programmer feedback about the parts of > the program that have not been tested. To avoid seeing these colors, > use @scheme[check-expect] to test your program. Of course, just > because you see no colors, does not mean that your program has been > fully tested; it simply means that each part of the program been run > (at least once). Would you people quit changing things willy-nilly? I've now had to revise my jokes... When the untested code was red, I told students "That red text is your grade bleeding." Now I've decided on "When the text is black and orange, it should remind you of Halloween. Untested code is scary!" :-) Todd From morazanm at gmail.com Tue Feb 17 21:44:38 2009 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:41:49 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming In-Reply-To: <779bf2730902171746v24191e64x2a60a2dde6c4a226@mail.gmail.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <984FB2DB-7272-4B3B-8C76-A81C81C47BBE@ccs.neu.edu> <756daca50902171030v4dc27da8x831a461599b89f5f@mail.gmail.com> <779bf2730902171121i51c6b99fxb1b1c803accaf523@mail.gmail.com> <756daca50902171126xd5748c7n9922900f8573741@mail.gmail.com> <9b1fff280902171525w509f9828x454280889df78972@mail.gmail.com> <779bf2730902171658m6de4e35gd1a5b43432fa261@mail.gmail.com> <9b1fff280902171722v3a48d345p43df90744c20e666@mail.gmail.com> <779bf2730902171746v24191e64x2a60a2dde6c4a226@mail.gmail.com> Message-ID: <9b1fff280902171844w42eab6abpbe2b2a1fccc2f58c@mail.gmail.com> > > Meanwhile, FP adoption remains a real problem. > Yes, it does. There is a difference, however, between FP being hard and FP adoption being hard. -- Cheers, Marco From robby at eecs.northwestern.edu Tue Feb 17 21:46:51 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Mar 26 02:41:49 2009 Subject: [plt-scheme] Re: Newbie question: Why "orange text, black background" after Run? In-Reply-To: <904774730902171837g63861af3h99670079cb0525c0@mail.gmail.com> References: <9F230C05-E66A-4206-8DCC-B5B7D3C3FC0E@innerpaths.net> <49A67A6F-DF27-4DC8-9CA8-880C51565612@ccs.neu.edu> <932b2f1f0902160454t7441b6f8qb3a768239a5bd7cd@mail.gmail.com> <904774730902171837g63861af3h99670079cb0525c0@mail.gmail.com> Message-ID: <932b2f1f0902171846k5f5948cdn4822e33e2d200821@mail.gmail.com> This one I changed after the 3rd (or maybe more) person told me they couldn't see it because of colorblindness. You still have the blood for the errors, tho....? Robby On Tue, Feb 17, 2009 at 8:37 PM, Todd O'Bryan wrote: > On Mon, Feb 16, 2009 at 7:54 AM, Robby Findler > wrote: >> I believe it cannot be disabled for the teaching languages. >> >> I've added a little bit of explanation to the teaching languages >> manuals. Below is the raw source text for that. Comments welcome. >> >> Robby >> >> The languages documented in this manual are provided by DrScheme to be >> used with the @italic{@link["http://www.htdp.org/"]{How to Design >> Programs}} book. >> >> When programs in these languages are run in DrScheme, any part of the >> program that was not run is highlighted in orange and black. These >> colors are intended to give the programmer feedback about the parts of >> the program that have not been tested. To avoid seeing these colors, >> use @scheme[check-expect] to test your program. Of course, just >> because you see no colors, does not mean that your program has been >> fully tested; it simply means that each part of the program been run >> (at least once). > > Would you people quit changing things willy-nilly? I've now had to > revise my jokes... > > When the untested code was red, I told students "That red text is your > grade bleeding." > > Now I've decided on "When the text is black and orange, it should > remind you of Halloween. Untested code is scary!" :-) > > Todd > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From grettke at acm.org Tue Feb 17 21:48:02 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:50 2009 Subject: [plt-scheme] Re: Newbie question: Why "orange text, black background" after Run? In-Reply-To: <904774730902171837g63861af3h99670079cb0525c0@mail.gmail.com> References: <9F230C05-E66A-4206-8DCC-B5B7D3C3FC0E@innerpaths.net> <49A67A6F-DF27-4DC8-9CA8-880C51565612@ccs.neu.edu> <932b2f1f0902160454t7441b6f8qb3a768239a5bd7cd@mail.gmail.com> <904774730902171837g63861af3h99670079cb0525c0@mail.gmail.com> Message-ID: <756daca50902171848h3483ced1u9360c81c6eb1acb8@mail.gmail.com> On Tue, Feb 17, 2009 at 8:37 PM, Todd O'Bryan wrote: > Would you people quit changing things willy-nilly? I've now had to > revise my jokes... > > When the untested code was red, I told students "That red text is your > grade bleeding." > > Now I've decided on "When the text is black and orange, it should > remind you of Halloween. Untested code is scary!" :-) I would love to see a "horror level" drop down to specify how this works :). From toddobryan at gmail.com Tue Feb 17 21:58:43 2009 From: toddobryan at gmail.com (Todd O'Bryan) Date: Thu Mar 26 02:41:50 2009 Subject: [plt-scheme] HtDP in Python! In-Reply-To: <20090218013553.06da95d9@halmanfloyd.lan.local> References: <756daca50902161156g2952f2f6rc93b41070dc37cf0@mail.gmail.com> <20090217073437.3cf6bda5@halmanfloyd.lan.local> <20090218013553.06da95d9@halmanfloyd.lan.local> Message-ID: <904774730902171858p5648a256m5b20589c7b8ab970@mail.gmail.com> The other thing Python is missing from an HtDP-replacement standpoint is a hierarchy of languages that limits students' ability to shoot themselves in the foot. If you could create a set of language grammars that limits what students can do at any particular point, you can create programs that are reasonably idiomatic but still don't use confusing/dangerous constructs. HtDC does this with Java, to some extent. In the early languages, you can only use the assignment statement in constructors and only to assign values to the fields. What that means is that you've excluded mutation syntactically. From danprager at optusnet.com.au Tue Feb 17 22:15:57 2009 From: danprager at optusnet.com.au (danprager@optusnet.com.au) Date: Thu Mar 26 02:41:50 2009 Subject: [plt-scheme] you have a tough road ahead of you ; ; ; was Re: from hell to paradise Message-ID: <200902180315.n1I3FvTm025419@mail06.syd.optusnet.com.au> > Grant Rettke wrote: > Talking more to folks about this, I found that the going in position > was: > > 1. If I don't learn it on the job; I won't learn it at all. > 2. I want to learn about tasks like how to drop a control onto a form > or deploy an ear; but not how to think. > 3. I don't have much more to learn; I am already awesome. > [snip] > This is for whom you are marketing "designing programs" and FP: people > who don't want to put forth any effort, who don't want to learn how to > think, and don't see the possibility that there is anything left for > them to learn. There's a lot in this. If you want to sell something effectively, you need to see things from your prospect's point of view. What's their "pain"? If they don't think clearly, don't realise this, and don't perceive it as a problem, and you tell them that they have a problem are they going to: a) Accept your advice, or b) Tell you to "take a hike"? In other words, they need to realise they're in hell, before being open to stepping on any road to heaven. And how do they know that your road is going to be any better than the one recommended by some other person? We want people to make discerning choices, but if you are a beginner -- perhaps with many years of experience -- you are unlikely to be all that discerning. * * * Good salespeople try to engage their mark^H^H^Hprospect with a "reference story", engaging tales of how someone similar to you had a "pain" that you can probably relate to, and try to find out more about you and then hopefully relate it back to a compelling offering. Relevant examples: * Kumon: http://www.kumon.co.uk/aboutkumon/subsection.asp?id=48 * Testimonials from Stephen Bloch's page: http://home.adelphi.edu/sbloch/class/hs/testimonials/ I remember somewhere a story about someone who had done an after-school (htdp-based?) program in high school, gone onto Harvard Law, been told that studying law at Harvard would "teach him to think", getting through with flying colors, but claiming to have learned the crux already in the after-school program. The best of these kinds of stories could be featured more prominently, in my view. But that's only part of it. At least these threads provide a little guidance and some moral support for evangelists. Cheers Dan From eli at barzilay.org Tue Feb 17 22:19:50 2009 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:41:50 2009 Subject: [plt-scheme] Re: from hell to paradise In-Reply-To: <984FB2DB-7272-4B3B-8C76-A81C81C47BBE@ccs.neu.edu> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <984FB2DB-7272-4B3B-8C76-A81C81C47BBE@ccs.neu.edu> Message-ID: <18843.32342.684410.355442@arabic.ccs.neu.edu> On Feb 17, Matthias Felleisen wrote: > > Let's build: > > -- a software simulation test bed for robots > -- with an interface that's like the stupid robots BW will program > -- and let's demo in your course how 'program design' can do much > much better than his programming A possibly stupid question: did anyone look into using thunks to turn imperative style programs into functional ones? I mean, not doing so with the intention of designing a course on something like robotics better, but instead done with the direct intention of doing a second course about software design (FP-style) but not throwing away completely stuff that students were exposed to in the first course. Basically something like: * They learned how to write programs that "do" things, like move a robot N mm forward and turn left N degrees, in the first course. * The second course begins with explaining thunks and how they can be composed. * At this point it should be possible to tanslate knowledge from the old course: (define (circle left?) (let ([n 0]) (while (< n 360) (move-forward 1) (turn-left (if left? 1 -1)) (set! n (add1 n))))) (define (8-shape) (circle #t) (circle #f)) into its functional form (using some simple sugars): (define (circle left?) (local [(define fwd (thunk (move-forward 1))) (define turn (thunk (turn-left (if left? 1 -1)))) (define step (combine fwd turn))] (build-combination 360 (lambda (i) step)))) (define 8-shape (combine (circle #t) (circle #f))) I can help but think that this must be a good idea because (a) it builds on what they learned in the for-the-popular-masses course instead of throwing it all out, and (b) it shows how to use first class functions in a way that will be useful for students in the future too -- given that most of them will go on living in an imperative world, but also given that in practically all modern languages you have first class functions. They'll have the basic tools for translating such an imperative world to a functional one. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From hendrik at topoi.pooq.com Tue Feb 17 21:25:15 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:41:50 2009 Subject: Novels and programs (was: Re: [plt-scheme] Prereqs for robotic programming In-Reply-To: <779bf2730902171519x19214295uecc40074c5a1275d@mail.gmail.com> References: <756daca50902170823l4d369dcbk3fc0b404df26d5ce@mail.gmail.com> <20090217172152.GB29566@topoi.pooq.com> <7A211AFD-42A7-4069-AB04-582FB57B6CAE@adelphi.edu> <20090217.220417.201177531.maxigas@anargeek.net> <779bf2730902171519x19214295uecc40074c5a1275d@mail.gmail.com> Message-ID: <20090218022514.GB29828@topoi.pooq.com> On Tue, Feb 17, 2009 at 03:19:41PM -0800, YC wrote: > On Tue, Feb 17, 2009 at 1:04 PM, maxigas wrote: > > > > > > That said, "exploratory programming" can easily be taken as an excuse > > > for "I don't want to bother thinking about the problem; I just want to > > > see some code compile and run." > > > > there was a memorable quote from last year's Chaos Computer Congress: > > "Hours of planning can save > > days of coding." which was turned into the more head-on "Days of coding can > > save hours of > > planning." maxime. :P > > > > I've seen months of planning can saves days of programming as well. There > is a reason why people rebel against waterfall approaches. > > These maxims cut both ways. It all depends on who's working on the problem. > > Cheers, > yc If I'm looking at models, I'd choose the spiral model. Keep going around and around the problem, in more detail every time. If you've done problems like it in the past, you'll go around fewer times. If not, you're in for some rewriting and redesign anyway. You might as well learn as much as you can each iteration. -- hendrik From hendrik at topoi.pooq.com Tue Feb 17 21:33:25 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:41:51 2009 Subject: [plt-scheme] Re: from hell to paradise In-Reply-To: <499B5DB3.60304@uwaterloo.ca> References: <756daca50902171551u369af6b6hc4c1f87144339485@mail.gmail.com> <499B5DB3.60304@uwaterloo.ca> Message-ID: <20090218023325.GC29828@topoi.pooq.com> On Tue, Feb 17, 2009 at 08:00:35PM -0500, Prabhakar Ragde wrote: > Grant Rettke wrote: > > >Also Peter Siebel's > >"Practical Common Lisp" or the "Real World Haskell" book are what > >people want to see so they feel like they are "doing something > >valuable" with what they learn. I don't see that in the FP world. > > I'm confused -- those books are in the FP world. Do you want something > like them for Scheme? I would point to the v4 documentation, already an > order of magnitude better than that for any comparable tool. I expect it > to get better. (If HtDP were a wiki, it would be transformed by now.) Maybe someone should start wuch a wiki. Perhaps wikibooks might be a suitable site. -- hendrik From hendrik at topoi.pooq.com Tue Feb 17 21:38:59 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:41:51 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming In-Reply-To: <9b1fff280902171525w509f9828x454280889df78972@mail.gmail.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <984FB2DB-7272-4B3B-8C76-A81C81C47BBE@ccs.neu.edu> <756daca50902171030v4dc27da8x831a461599b89f5f@mail.gmail.com> <779bf2730902171121i51c6b99fxb1b1c803accaf523@mail.gmail.com> <756daca50902171126xd5748c7n9922900f8573741@mail.gmail.com> <9b1fff280902171525w509f9828x454280889df78972@mail.gmail.com> Message-ID: <20090218023859.GD29828@topoi.pooq.com> On Tue, Feb 17, 2009 at 06:25:39PM -0500, Marco Morazan wrote: > > Seriously, what is painful about it? Is it painful not to have a > mangled syntax? Is it painful to encourage the use of recursion? > Really, c'mon! Is it painful for functions to be first-class? Is it > painful not to encourage the use of sequencing and > mutation/assignment? This is not painful. What's painful is to be prohibited from using mutation/assignment. Schame doesn't prohibit this. Some of the others do. It's ideological extremism, and leads to elaborately complicated programs for simple stuff, like a queue. > Is it painful not to have "for" and "while" as > keywords? Is it painful not to think of state all the time? Is it > painful not to have to manipulate pointers? Is it painful for the > language to properly implement tail calls? Is referential transparency > painful -- most of my students are shocked when I point out to them > that in, say, Java (pick any language that encurages assignment) that > f(x) == f(x) is not always true, which suggest huge gaps in their > education when they learned Java --? Is having macros or continuations > painful? No, none of this is painful -- except for some kind of macros. It's too easy to make unholy syntax mashups with them. I admit that Scheme's macros are much better than C's. -- hendrik From hendrik at topoi.pooq.com Tue Feb 17 21:43:44 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:41:51 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming In-Reply-To: <499B3210.8010001@uwaterloo.ca> References: <499B301D.40905@uwaterloo.ca> <932b2f1f0902171351y2e9c3328vbfedcdd4132ebad0@mail.gmail.com> <499B3210.8010001@uwaterloo.ca> Message-ID: <20090218024344.GE29828@topoi.pooq.com> On Tue, Feb 17, 2009 at 04:54:24PM -0500, Prabhakar Ragde wrote: > Robby Findler wrote: > >On Tue, Feb 17, 2009 at 3:46 PM, Prabhakar Ragde > >wrote: > >>fury that from age 14 to 40+, my teachers, my peers, and my field > >>conspired > >>to hide this natural and elegant way of doing things from me. --PR > > > >Those bastards! > > Damn straight. > > This week it's "Why the hell did I have to learn the theory of LR > parsing with explicit stacks and state transitions instead of > mutually-recursive functions?" --PR It's a completely different algorithm, with quite different capabilities. I think, if you're going to write compilers, you should know both, so you'll be able to use the one that suits the language. -- hendrik From ntoronto at cs.byu.edu Tue Feb 17 22:38:32 2009 From: ntoronto at cs.byu.edu (Neil Toronto) Date: Thu Mar 26 02:41:51 2009 Subject: [plt-scheme] Re: Novels and programs In-Reply-To: <779bf2730902171036h8519b11kc3bdfefdbf3b35dc@mail.gmail.com> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <20090217152235.GA29566@topoi.pooq.com> <756daca50902170823l4d369dcbk3fc0b404df26d5ce@mail.gmail.com> <20090217172152.GB29566@topoi.pooq.com> <779bf2730902171036h8519b11kc3bdfefdbf3b35dc@mail.gmail.com> Message-ID: <499B82B8.6010101@cs.byu.edu> YC wrote: > > On Tue, Feb 17, 2009 at 9:21 AM, > wrote: > > > The thing is, there are good writers in both camps. > > Are there similar phenomena in computer programming? > > > I can find similar phenomena within myself (not saying I am a good > developer though as that's for others to judge) :) I've written both ways for research papers, fiction, and programs, and I've noticed the same effects in all three. For me, outlining is great when I have a firm grasp of the high-level ideas and flow before I start. Outlining often helps me figure that out as well. But there are cases where I just don't know enough before I start. See below. In all three domains, I think rigid outlining/planning bends whatever elements you *didn't* outline to the whims of the elements you *did* outline. You end up with characters that are puppets rather than people, research papers that are about the wrong subject, and programs you didn't really want. Conversely, not outlining or planning leads to rambling and inconsistency. > But there are also situations, most often when tackling an > unfamiliar problem domain... Hear hear! I'm making a DSL for a very rich problem domain that I'm quite familiar with. I chose to make a language because it opens up exciting possibilities, but I don't know what all of them are yet! Since I've just begun to explore what can be expressed in this new and exciting family of languages, I can't really write enough test cases for test cases to drive development. (If I used only current practice, I'd end up with a broken interpreter comprised of special cases. Boo.) I don't know the available, desirable and/or necessary properties, so I can't develop by aiming for ideal properties. Outlining? Don't make me laugh. I need to discover what problems need to be solved first. That's why I'm writing an interpreter! Chances are I'll rewrite everything at least ten more times. Then I'll scrap it all and write a new one, starting from an outline. :) Neil From hendrik at topoi.pooq.com Tue Feb 17 21:46:39 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:41:51 2009 Subject: from hell to paradise ; ; ; was: [plt-scheme] Prereqs for robotic programming In-Reply-To: <499B301D.40905@uwaterloo.ca> References: <499B301D.40905@uwaterloo.ca> Message-ID: <20090218024639.GF29828@topoi.pooq.com> On Tue, Feb 17, 2009 at 04:46:05PM -0500, Prabhakar Ragde wrote: > >>But people are motivated toward pleasure and away from pain, so if > >>learning > >>> FP is going to cause too much pain, it's going to be a non starter. > > > >Yes it is painful. > > Says who? > > I wrote my first functional program in my fifth decade of life. And as > my sixth approaches, I continue to learn about FP with an underlying > fury -- fury that from age 14 to 40+, my teachers, my peers, and my > field conspired to hide this natural and elegant way of doing things > from me. --PR I was lucky in that I read McCarthy's paper on Lisp early in the 60's, while prowling through the periodicals section of my university library. I was so impressed that I wrote away for the Lisp 1.5 programmer's manual, and even got a listing of the implementation on the IBM 7090 -- lots and lots of assembler. I then started my own implementation. -- hendrik From hendrik at topoi.pooq.com Tue Feb 17 21:58:38 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:41:51 2009 Subject: [plt-scheme] Re: Novels and programs In-Reply-To: <499B82B8.6010101@cs.byu.edu> References: <9b1fff280902161902x44de048udf631956cc199948@mail.gmail.com> <9b1fff280902170729s5ce62b1j782939847974fd56@mail.gmail.com> <20090217152235.GA29566@topoi.pooq.com> <756daca50902170823l4d369dcbk3fc0b404df26d5ce@mail.gmail.com> <20090217172152.GB29566@topoi.pooq.com> <779bf2730902171036h8519b11kc3bdfefdbf3b35dc@mail.gmail.com> <499B82B8.6010101@cs.byu.edu> Message-ID: <20090218025838.GG29828@topoi.pooq.com> On Tue, Feb 17, 2009 at 08:38:32PM -0700, Neil Toronto wrote: > YC wrote: > > > >On Tue, Feb 17, 2009 at 9:21 AM, >> wrote: > > > > > > The thing is, there are good writers in both camps. > > > > Are there similar phenomena in computer programming? > > > > > >I can find similar phenomena within myself (not saying I am a good > >developer though as that's for others to judge) :) > > I've written both ways for research papers, fiction, and programs, and > I've noticed the same effects in all three. For me, outlining is great > when I have a firm grasp of the high-level ideas and flow before I > start. Outlining often helps me figure that out as well. > > But there are cases where I just don't know enough before I start. See > below. > > In all three domains, I think rigid outlining/planning bends whatever > elements you *didn't* outline to the whims of the elements you *did* > outline. You end up with characters that are puppets rather than people, > research papers that are about the wrong subject, and programs you > didn't really want. > > Conversely, not outlining or planning leads to rambling and inconsistency. > > >But there are also situations, most often when tackling an > >unfamiliar problem domain... > > Hear hear! > > I'm making a DSL for a very rich problem domain that I'm quite familiar > with. I chose to make a language because it opens up exciting > possibilities, but I don't know what all of them are yet! > > Since I've just begun to explore what can be expressed in this new and > exciting family of languages, I can't really write enough test cases for > test cases to drive development. (If I used only current practice, I'd > end up with a broken interpreter comprised of special cases. Boo.) I > don't know the available, desirable and/or necessary properties, so I > can't develop by aiming for ideal properties. > > Outlining? Don't make me laugh. I need to discover what problems need to > be solved first. That's why I'm writing an interpreter! May I suggest you read the paper "The next 700 programming languages" by Landin. It was published in CACM sometime in the late 60's or early 70's and is a classic in the field. It was also one of the inspiratins for the entire field of functional programming languages, althoug the language style he proposes does have imperative features. It attempts to explain what's specific and what's general about domain-specific languages -- this decades before the DSL acronym was coined. > > Chances are I'll rewrite everything at least ten more times. Then I'll > scrap it all and write a new one, starting from an outline. :) Maybe the paper will reduce the number of iterations ever so slightly. Or maybe you already know it all. -- hendrik From grettke at acm.org Tue Feb 17 23:11:38 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:51 2009 Subject: [plt-scheme] you have a tough road ahead of you ; ; ; was Re: from hell to paradise In-Reply-To: <200902180315.n1I3FvTm025419@mail06.syd.optusnet.com.au> References: <200902180315.n1I3FvTm025419@mail06.syd.optusnet.com.au> Message-ID: <756daca50902172011l60154dbfu7d9fbb18a4d1afb5@mail.gmail.com> Hi Dan, On Tue, Feb 17, 2009 at 9:15 PM, wrote: > There's a lot in this. If you want to sell something effectively, you need to see things > from your prospect's point of view. > > What's their "pain"? > > If they don't think clearly, don't realise this, and don't perceive it as a problem, and you > tell them that they have a problem are they going to: I forgot to include the "pain" part of the story! The pain is client-visible broken features, no unit tests, terrible incomprehensible code, no answer for "why did you type this?", no ability to visualize the problem or the solution, and no way for senior and junior developers to interact since there is no common ground. It has been very, very painful. Not painful enough I guess?! Best wishes, Grant From grettke at acm.org Tue Feb 17 23:13:17 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:51 2009 Subject: Novels and programs (was: Re: [plt-scheme] Prereqs for robotic programming In-Reply-To: <20090218022514.GB29828@topoi.pooq.com> References: <756daca50902170823l4d369dcbk3fc0b404df26d5ce@mail.gmail.com> <20090217172152.GB29566@topoi.pooq.com> <7A211AFD-42A7-4069-AB04-582FB57B6CAE@adelphi.edu> <20090217.220417.201177531.maxigas@anargeek.net> <779bf2730902171519x19214295uecc40074c5a1275d@mail.gmail.com> <20090218022514.GB29828@topoi.pooq.com> Message-ID: <756daca50902172013r3402904ej8b8cec5c5a45e4a0@mail.gmail.com> On Tue, Feb 17, 2009 at 8:25 PM, wrote: > If I'm looking at models, I'd choose the spiral model. The spiral model reads well but it doesn't have the six sigma nuts or caffeine fueled zealots like Lean and Agile have. How will it survive?! :) From danprager at optusnet.com.au Wed Feb 18 00:45:50 2009 From: danprager at optusnet.com.au (danprager@optusnet.com.au) Date: Thu Mar 26 02:41:52 2009 Subject: [plt-scheme] you have a tough road ahead of you ; ; ; was Re: from hell to paradise Message-ID: <200902180545.n1I5joAI025683@mail11.syd.optusnet.com.au> Hi Grant > I forgot to include the "pain" part of the story! > > The pain is client-visible broken features, no unit tests, terrible > incomprehensible code, no answer for "why did you type this?", no > ability to visualize the problem or the solution, and no way for > senior and junior developers to interact since there is no common > ground. It has been very, very painful. I hear your pain! It sounds like you might need some shorter-term approaches to address the worst parts of the pain, in part to further build your own credibility, prior to refashioning the entire org. into a team of high-performing htdp-wielding cyborgs. Did you have a plan B? How's that going? Personally, I am yet to get the reading-group thing happening in an organizational setting. -- Dan P.S. I've bitten the bullet and have made a start on htdp last night; I am trying hard not to skip ahead. From pocmatos at gmail.com Wed Feb 18 06:23:56 2009 From: pocmatos at gmail.com (Paulo J. Matos) Date: Thu Mar 26 02:41:52 2009 Subject: [plt-scheme] Re: from hell to paradise In-Reply-To: <20090218023325.GC29828@topoi.pooq.com> References: <756daca50902171551u369af6b6hc4c1f87144339485@mail.gmail.com> <499B5DB3.60304@uwaterloo.ca> <20090218023325.GC29828@topoi.pooq.com> Message-ID: <11b141710902180323i6b1f122uff7f0b6c6a0398d4@mail.gmail.com> On Wed, Feb 18, 2009 at 2:33 AM, wrote: > On Tue, Feb 17, 2009 at 08:00:35PM -0500, Prabhakar Ragde wrote: >> Grant Rettke wrote: >> >> >Also Peter Siebel's >> >"Practical Common Lisp" or the "Real World Haskell" book are what >> >people want to see so they feel like they are "doing something >> >valuable" with what they learn. I don't see that in the FP world. >> >> I'm confused -- those books are in the FP world. Do you want something >> like them for Scheme? I would point to the v4 documentation, already an >> order of magnitude better than that for any comparable tool. I expect it >> to get better. (If HtDP were a wiki, it would be transformed by now.) > > Maybe someone should start wuch a wiki. > > Perhaps wikibooks might be a suitable site. > I was just thinking "gosh with so many people if each wrote a real-world application of scheme to 'real life' we would have a 'book'". > -- hendrik > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Paulo Jorge Matos - pocmatos at gmail.com Webpage: http://www.personal.soton.ac.uk/pocm From morazanm at gmail.com Wed Feb 18 07:10:49 2009 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:41:52 2009 Subject: [plt-scheme] you have a tough road ahead of you ; ; ; was Re: from hell to paradise In-Reply-To: <756daca50902171741m2975f25bx92a4c4dbe81e530e@mail.gmail.com> References: <756daca50902171741m2975f25bx92a4c4dbe81e530e@mail.gmail.com> Message-ID: <9b1fff280902180410vc45e8d5s16d0bcc6b5c4296f@mail.gmail.com> > > I asked what we did wrong, how we could do it differently, and what > should be changed to make it work and what we found was that it would > be impossible to make it work for the following reasons: > > 1. It required effort on nights and weekends and it is not normal to > take effort on nights and weekends. > 2. It added no visible value to their daily work. > 3. It was not difficult enough (they were too smart). > > Talking more to folks about this, I found that the going in position was: > > 1. If I don't learn it on the job; I won't learn it at all. > 2. I want to learn about tasks like how to drop a control onto a form > or deploy an ear; but not how to think. > 3. I don't have much more to learn; I am already awesome. > What you did wrong? I smile fondly, because I will give you an answer inspired on a conversation (actually more of tongue lashing given to my student partner) with Dijkstra back in 1996. Your target audience was a bunch of brain damaged people whom can not be helped by anything in FP or in HtDP (they are not the same). It is too late for them! The late Dijkstra tended to use a very confrontational style (which I learned to appreciate), but I am not trying to be confrontatioanl here (nor insulting). Nonetheless, the point that Dijkstra was trying to make in 1996 is the same I am trying to make. I do believe that you were trying to do something good, but your audience was clearly not going to listen no matter how the material was presented. Dijkstra considered those that do not want to learn and who refuse to think (or learn to think) brain damaged. This was especially true for him when it came to designing programs. Perhaps, this is one reason the authors of HtDP targetted students. Some students may not be already calcified -- if I may borrow a phrase from Prabhakar. -- Cheers, Marco From matthias at ccs.neu.edu Wed Feb 18 07:38:14 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:41:52 2009 Subject: [plt-scheme] Re: from hell to paradise In-Reply-To: <11b141710902180323i6b1f122uff7f0b6c6a0398d4@mail.gmail.com> References: <756daca50902171551u369af6b6hc4c1f87144339485@mail.gmail.com> <499B5DB3.60304@uwaterloo.ca> <20090218023325.GC29828@topoi.pooq.com> <11b141710902180323i6b1f122uff7f0b6c6a0398d4@mail.gmail.com> Message-ID: On Feb 18, 2009, at 6:23 AM, Paulo J. Matos wrote: > I was just thinking "gosh with so many people if each wrote a > real-world application of scheme to 'real life' we would have a > 'book'". That has been my thinking for a while now. What if we set up an svn repository and provided a mechanism for "literate" programming so that you can describe your stuff and then make it available for others to edit? -- Matthias From matthias at ccs.neu.edu Wed Feb 18 07:43:10 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:41:52 2009 Subject: [plt-scheme] you have a tough road ahead of you ; ; ; was Re: from hell to paradise In-Reply-To: <200902180545.n1I5joAI025683@mail11.syd.optusnet.com.au> References: <200902180545.n1I5joAI025683@mail11.syd.optusnet.com.au> Message-ID: <846270D2-8947-47BA-8F49-B6829BE4B221@ccs.neu.edu> On Feb 18, 2009, at 12:45 AM, danprager@optusnet.com.au wrote: > I've bitten the bullet and have made a start on htdp last night; I > am trying hard not to skip ahead. If you are an experienced programmer, you should read HtDP like this: -- read the sections whose title starts with "Designing ...." -- also read the "iterative refinement" sections -- pick five exercises in the preceding and/or follow-up sections and solve them according to the recipe -- unless you're stuck move forward -- try to understand the "symmetry" between data definitions and templates I expect that somewhere around late part II, you will slow down. You may pick up real reading as of part III, though some may make it thru III and only "stutter" in IV. Also: -- use check-expect to express your examples/tests -- avoid draw.ss exercises, replace them with world.ss but that's a non-trivial switch And holler if you are having trouble -- Matthias From pocmatos at gmail.com Wed Feb 18 07:45:44 2009 From: pocmatos at gmail.com (Paulo J. Matos) Date: Thu Mar 26 02:41:52 2009 Subject: [plt-scheme] Re: from hell to paradise In-Reply-To: References: <756daca50902171551u369af6b6hc4c1f87144339485@mail.gmail.com> <499B5DB3.60304@uwaterloo.ca> <20090218023325.GC29828@topoi.pooq.com> <11b141710902180323i6b1f122uff7f0b6c6a0398d4@mail.gmail.com> Message-ID: <11b141710902180445v677a45e0t2f726083422d4f72@mail.gmail.com> On Wed, Feb 18, 2009 at 12:38 PM, Matthias Felleisen wrote: > > On Feb 18, 2009, at 6:23 AM, Paulo J. Matos wrote: > >> I was just thinking "gosh with so many people if each wrote a >> real-world application of scheme to 'real life' we would have a >> 'book'". > > > That has been my thinking for a while now. What if we > set up an svn repository and provided a mechanism for > "literate" programming so that you can describe your > stuff and then make it available for others to edit? > Still not sure how it would work out, given that if nobody imposes restrictions on 'what is' commited, surely lots of non 'real life' stuff will get in. Is that what it is intented? Or what is indented is to commit only specific real-life examples that explain how to do something in Scheme? Examples of real life would be (i think... since we are trying to attract others): - Graphics programming; - C Interface; - GUI; - Databases; - Parsing; etc... Something along the lines on 'How to Design for Real Life'. hehehe :D Again, it would be interesting to specify on what is intended by this. As an example, I am developing for my PhD a SAT-based model checker in PLT Scheme. That would be the first thing that occurs to me that I can commit but that is hardly real life (how often a programmer thinks "ah, I have to develop a model checker"). If anything, that would detract people from reading the thing I guess. > -- Matthias > > -- Paulo Jorge Matos - pocmatos at gmail.com Webpage: http://www.personal.soton.ac.uk/pocm From filcab at gmail.com Wed Feb 18 07:57:48 2009 From: filcab at gmail.com (Filipe Cabecinhas) Date: Thu Mar 26 02:41:53 2009 Subject: [plt-scheme] How to add a new language to DrScheme? Message-ID: <499C05CC.7020106@gmail.com> Hi I'm trying to add a new language to DrScheme. I've already implemented main.ss, lang/reader.ss and info.ss. (so require, #lang and DrScheme all work). But I don't have my module directory inside collects, so DrScheme won't see it (module... see it because I added it to that language's collects). How can I add this directory to DrScheme? Must I change an environment variable or can I do it by changing one or two files or configuring DrScheme for that? Also, I want to distribute DrScheme with this language to some students for testing. Is there a way to create a minimized installer with only scheme, DrScheme, debug tools and my language? Mind that my language needs to use MysterX, so I need to run the scripts to register the dlls. And they're architecture students, so I can't just tell them to run regsrv32 mysterx.dll :-) Thanks for your help, F From robby at eecs.northwestern.edu Wed Feb 18 08:15:10 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Mar 26 02:41:53 2009 Subject: [plt-scheme] How to add a new language to DrScheme? In-Reply-To: <499C05CC.7020106@gmail.com> References: <499C05CC.7020106@gmail.com> Message-ID: <932b2f1f0902180515w7a502ac6h34c18bcd1c92b90a@mail.gmail.com> On Wed, Feb 18, 2009 at 6:57 AM, Filipe Cabecinhas wrote: > Hi > > I'm trying to add a new language to DrScheme. I've already implemented > main.ss, lang/reader.ss and info.ss. (so require, #lang and DrScheme all > work). But I don't have my module directory inside collects, so DrScheme > won't see it (module... see it because I added it to that language's > collects). How can I add this directory to DrScheme? Must I change an > environment variable or can I do it by changing one or two files or > configuring DrScheme for that? The way we used to do that was to distribute a .plt file. Nowadays, we recommend using planet for that, but you'd have to issue a command to download it after drscheme is installed. > Also, I want to distribute DrScheme with this language to some students > for testing. Is there a way to create a minimized installer with only > scheme, DrScheme, debug tools and my language? Mind that my language > needs to use MysterX, so I need to run the scripts to register the dlls. > And they're architecture students, so I can't just tell them to run > regsrv32 mysterx.dll :-) If you go the planet route, then telling them to (require (planet ...)) would also trigger running whatever code you'd want, and I expect that code can go register the dlls? Unless DrScheme can't be running at the time you do that, in which case you'd have to tell them to run the command 'planet install ...', but is that beyond them? If you go the .plt route, the same thing applies; you can create a .plt that runs some code when it is installed to set up the environment. Robby From sk at cs.brown.edu Wed Feb 18 08:28:10 2009 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:41:53 2009 Subject: [plt-scheme] Re: from hell to paradise In-Reply-To: <11b141710902180445v677a45e0t2f726083422d4f72@mail.gmail.com> References: <756daca50902171551u369af6b6hc4c1f87144339485@mail.gmail.com> <499B5DB3.60304@uwaterloo.ca> <20090218023325.GC29828@topoi.pooq.com> <11b141710902180323i6b1f122uff7f0b6c6a0398d4@mail.gmail.com> <11b141710902180445v677a45e0t2f726083422d4f72@mail.gmail.com> Message-ID: A SAT-based model checker has several real-world elements to it. I'm sure you can refactor it into appropriate lessons. From grettke at acm.org Wed Feb 18 08:29:00 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:53 2009 Subject: [plt-scheme] you have a tough road ahead of you ; ; ; was Re: from hell to paradise In-Reply-To: <200902180545.n1I5joAI025683@mail11.syd.optusnet.com.au> References: <200902180545.n1I5joAI025683@mail11.syd.optusnet.com.au> Message-ID: <756daca50902180529m636201dfi606c8fb7d5b74381@mail.gmail.com> On Tue, Feb 17, 2009 at 11:45 PM, wrote: > It sounds like you might need some shorter-term approaches Our plan b is to require unit tests and code reviews and use that as an "ice breaker" for talking about how programs work and how languages work and anything else that makes sense. > Did you have a plan B? How's that going? As for a plan C curriculum, there is none. HtDP was our plan B. I am going to pay attention as to the results of our short-term approach and try to see what I am missing. > P.S. I've bitten the bullet and have made a start on htdp last night; I am trying hard not to skip > ahead. It is more fun that way! From henk at henk.ca Wed Feb 18 08:29:58 2009 From: henk at henk.ca (Henk Boom) Date: Thu Mar 26 02:41:53 2009 Subject: [plt-scheme] Re: from hell to paradise In-Reply-To: References: <756daca50902171551u369af6b6hc4c1f87144339485@mail.gmail.com> <499B5DB3.60304@uwaterloo.ca> <20090218023325.GC29828@topoi.pooq.com> <11b141710902180323i6b1f122uff7f0b6c6a0398d4@mail.gmail.com> Message-ID: 2009/2/18 Matthias Felleisen : > > On Feb 18, 2009, at 6:23 AM, Paulo J. Matos wrote: > >> I was just thinking "gosh with so many people if each wrote a >> real-world application of scheme to 'real life' we would have a >> 'book'". > > > That has been my thinking for a while now. What if we > set up an svn repository and provided a mechanism for > "literate" programming so that you can describe your > stuff and then make it available for others to edit? I think the biggest help are accessible blog posts demonstrating why and how to use PLT-Scheme for specific things. Even after learning scheme, I only started using PLT Scheme for web development after reading this series: http://www.scheme.dk/blog/2007/01/introduction-to-web-development-with.html Blog posts are friendly, and eminently google-able. I find they also illustrate the presence of a community more effectively than a central site. For some reason, "This guy is using it!" seems stronger than "There is apparently some group of people using it". Henk From grettke at acm.org Wed Feb 18 08:51:13 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:54 2009 Subject: [plt-scheme] you have a tough road ahead of you ; ; ; was Re: from hell to paradise In-Reply-To: <846270D2-8947-47BA-8F49-B6829BE4B221@ccs.neu.edu> References: <200902180545.n1I5joAI025683@mail11.syd.optusnet.com.au> <846270D2-8947-47BA-8F49-B6829BE4B221@ccs.neu.edu> Message-ID: <756daca50902180551k39c51734i8d5876cdaad83755@mail.gmail.com> On Wed, Feb 18, 2009 at 6:43 AM, Matthias Felleisen wrote: > If you are an experienced programmer, you should read HtDP like this: > > -- pick five exercises in the preceding and/or follow-up sections and solve > them according to the recipe I wanted to do all of the exercise so I would know what I was asking other people to complete. From dyoo at cs.wpi.edu Wed Feb 18 09:00:46 2009 From: dyoo at cs.wpi.edu (Danny Yoo) Date: Thu Mar 26 02:41:54 2009 Subject: [plt-scheme] Searching on docs.plt-scheme disabled? Message-ID: I've tried to search on docs.plt-scheme.org, but the javascript doesn't seem to be doing anything. From robby at eecs.northwestern.edu Wed Feb 18 09:09:10 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Mar 26 02:41:54 2009 Subject: [plt-scheme] Fwd: Google Alert - drscheme In-Reply-To: <0016368e268f36eaea046331deea@google.com> References: <0016368e268f36eaea046331deea@google.com> Message-ID: <932b2f1f0902180609w5493a7cfyb8352c4d9e75759a@mail.gmail.com> Clearly, the think to do about that bad kitchen sink smell is to add a gutter to DrScheme! :) Robby ---------- Forwarded message ---------- From: Google Alerts Date: Wed, Feb 18, 2009 at 8:02 AM Subject: Google Alert - drscheme To: robby.findler@gmail.com Google Blogs Alert for: drscheme why does my kitchen sink smell bad and what can i do about it? By admin Related Blogs on Gutter; Gutter journalism | anilnetto.com ? Adding a gutter to DrScheme | Wisdom and Wonder ? Time for Portland residents to Consider Gutter Protection ? Insight Magazine ? CD REVIEW: D?lek: Gutter Tactics ? MP3 Search ... Double Kitchen Sink - http://www.doublekitchensink.net/blog/ ________________________________ This as-it-happens Google Alert is brought to you by Google. Remove this alert. Create another alert. Manage your alerts. From henk at henk.ca Wed Feb 18 09:16:01 2009 From: henk at henk.ca (Henk Boom) Date: Thu Mar 26 02:41:54 2009 Subject: [plt-scheme] Searching on docs.plt-scheme disabled? In-Reply-To: References: Message-ID: 2009/2/18 Danny Yoo : > I've tried to search on docs.plt-scheme.org, but the javascript > doesn't seem to be doing anything. This often happens to me. Hitting refresh in the browser seems to help, even when doing more searches doesn't. Henk From jecarnell at saintfrancis.com Wed Feb 18 09:13:39 2009 From: jecarnell at saintfrancis.com (Carnell, James E) Date: Thu Mar 26 02:41:54 2009 Subject: [plt-scheme] Functional vs Imperative Parallel Programming In-Reply-To: <20090217235154.0250B402B2@qua.cs.brown.edu> Message-ID: I am asking a question way beyond where I am at as a programmer. I didn't know what imperative and functional programming was until I started reading about it last night (I have a degree in MIS too?). I am starting to get interested in parallel programming and after reading about functional programming it seems that functional programming would be easier on the patience and programming skills of a parallel programmer. I know there probably isn't a quick answer, but that was my guess. From hendrik at topoi.pooq.com Wed Feb 18 10:05:03 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:41:54 2009 Subject: Novels and programs (was: Re: [plt-scheme] Prereqs for robotic programming In-Reply-To: <756daca50902172013r3402904ej8b8cec5c5a45e4a0@mail.gmail.com> References: <756daca50902170823l4d369dcbk3fc0b404df26d5ce@mail.gmail.com> <20090217172152.GB29566@topoi.pooq.com> <7A211AFD-42A7-4069-AB04-582FB57B6CAE@adelphi.edu> <20090217.220417.201177531.maxigas@anargeek.net> <779bf2730902171519x19214295uecc40074c5a1275d@mail.gmail.com> <20090218022514.GB29828@topoi.pooq.com> <756daca50902172013r3402904ej8b8cec5c5a45e4a0@mail.gmail.com> Message-ID: <20090218150503.GA31571@topoi.pooq.com> On Tue, Feb 17, 2009 at 10:13:17PM -0600, Grant Rettke wrote: > On Tue, Feb 17, 2009 at 8:25 PM, wrote: > > If I'm looking at models, I'd choose the spiral model. > > The spiral model reads well but it doesn't have the six sigma nuts or > caffeine fueled zealots like Lean and Agile have. How will it > survive?! :) It's the one that de facto gets used every time someone says, "This code is a mess. Let's fork it and rewrite it". Usually the old understanding -- what there is of it -- gets embedded in the new, cleaner system. -- hendrik From plragde at uwaterloo.ca Wed Feb 18 11:12:00 2009 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:41:54 2009 Subject: [plt-scheme] Re: from hell to paradise In-Reply-To: <20090218024344.GE29828@topoi.pooq.com> Message-ID: <499C3350.5000006@uwaterloo.ca> Hendrik Boom wrote: >> This week it's "Why the hell did I have to learn the theory of LR >> > parsing with explicit stacks and state transitions instead of >> > mutually-recursive functions?" --PR > > It's a completely different algorithm, with quite different > capabilities. I think, if you're going to write compilers, you should > know both, so you'll be able to use the one that suits the language. See, you're a victim of the conspiracy, too. They are not completely different algorithms. There is a thread of continuity between them explored in a series of papers, the central one being Leermakers, Augusteijn, and Kruseman Aretz (TCS 1992). Here it is in a nutshell. If we take a context-free grammar G and create a function A() for each nonterminal A whose job it is to consume (from an input list provided as a parameter to the function A) an initial sequence of terminals derivable from A, it is easy to write what we call a naive recursive-descent parser. It can even handle ambiguous grammars if we have it produce a list of input suffixes (that is, make it nondeterministic). But it takes exponential time on some grammars, and gets into infinite loops with left-recursive productions (e.g. A -> Ab). So we transform G to ensure there are at most two nonterminals on the right-hand side of every rule. There are many related ways to do this (cf Chomsky normal form) but we choose one that introduces items as nonterminals. An item is a grammar rule with a dot in the right-hand side to indicate partial progress. The rules in the transformed grammar have an item on the left side and on the right side, the nonterminal after the dot followed by the item with the dot moved over one position. If we apply recursive descent to the transformed grammar (with a function for each item), it still has the same problems. But if we memoize the computation, it's not hard to show that it takes O(n^3) time. [Aside: up to this point should be core material for any reputable CS curriculum, but it is not.] We can cut this down by introducing lookahead (first and follow sets), giving LL(k). But we still have the problem with left recursion, which tends to be natural in grammars for programming languages (and, I am told, for natural language grammars as well). There are techniques for avoiding the infinite loops, but the resulting parse trees "slant the wrong way". We can handle that by transforming the parse tree, but that involves operations on trees, not to mention building the parse tree in the first place. (Such things are hard for students instructed using Java.) So we transform the grammar again to eliminate left recursion. There are many related ways to do this (cf Greibach normal form), but we choose one that involves left corners of the symbol after the dot (a left corner being any initial symbol generated by rewriting the leftmost symbol zero or more times). Then we apply recursive descent to the newly transformed grammar. Expressed in terms of the original grammar, this involves not only a function for each item, but a function for each (left corner, item) pair. This is nondeterministic recursive ascent parsing, so named because the recursive functions "ascend" from a terminal which is a left corner through successive undone leftmost rewrites. To make this more general, we use the idea from NFA->DFA conversion, and replace functions on items by functions on sets of items (called states). Where before the natural successor of an item I with respect to a nonterminal A just after a dot was the item with the dot moved over the A, now the successor of a state is the collection of such plus the introduction of new items with A on the left and some right-hand side with a dot all the way to the left. This is the LR(0) automaton, and what I've described is its transition or "goto" function. If we apply recursive ascent to this, and work out the details, we get an LR(0) parser. (Pepper at TU-Berlin explains it entirely in terms of grammar transformations.) Shift-reduce and reduce-reduce conflicts are explained by being exactly the points in the function definitions where nondeterminism is possible. Adding lookahead as we did for LL(k) gives LR(k). Cutting down on the number of states and the complexity of the transition function by including various restrictions gives SLR or LALR. These sets of mutually-recursive functions don't look much like the traditional LR(0) or LR(k) parser. To get there, we make the recursion stack explicit, and treat the input list as a stack. Then the core of the algorithm becomes an iterative loop, popping and pushing. Finally, we notice that we can combine the two stacks into one, processing the input sequentially, and we have the conventional presentation (which, unlike everything I have described up to this point, cannot handle nondeterminism caused by grammars that don't conform to the restrictions). But all the intuition has been drained out of it, as the blood has been drained out of a slaughtered animal that ends up as shrink-wrapped pieces of meat in a supermarket. Yes, they're convenient, and we adults make the connection with living animals if we think about it enough, though usually we don't. The traditional LR(k) algorithm is efficient in time and space (to an extent not really needed in many applications any more, and certainly not needed in a pedagogical presentation), but students don't make the connection with more natural or simpler techniques. Instead, they either use tools (e.g. Lex/YACC) that they only dimly understand, flailing away at shift-reduce or reduce-reduce conflicts by randomly rewriting their grammars, or they learn the algorithm by rote but glean what intuition they can from one or two worked examples. I went further, learning the theories of LL and LR parsing from researchers in formal languages at two universities, but until recently I also thought these were "completely different" algorithms that could only be expressed iteratively using mutation. To be fair, I learned said theories before the above connections were worked out; the first papers in this series (Roberts and Kruseman Aretz) appeared in 1988. Twenty years later, we no longer have an excuse. --PR From hendrik at topoi.pooq.com Wed Feb 18 10:15:24 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:41:55 2009 Subject: [plt-scheme] Re: from hell to paradise In-Reply-To: References: <756daca50902171551u369af6b6hc4c1f87144339485@mail.gmail.com> <499B5DB3.60304@uwaterloo.ca> <20090218023325.GC29828@topoi.pooq.com> <11b141710902180323i6b1f122uff7f0b6c6a0398d4@mail.gmail.com> Message-ID: <20090218151524.GB31571@topoi.pooq.com> On Wed, Feb 18, 2009 at 08:29:58AM -0500, Henk Boom wrote: > 2009/2/18 Matthias Felleisen : > > > > On Feb 18, 2009, at 6:23 AM, Paulo J. Matos wrote: > > > >> I was just thinking "gosh with so many people if each wrote a > >> real-world application of scheme to 'real life' we would have a > >> 'book'". > > > > > > That has been my thinking for a while now. What if we > > set up an svn repository and provided a mechanism for > > "literate" programming so that you can describe your > > stuff and then make it available for others to edit? > > I think the biggest help are accessible blog posts demonstrating why > and how to use PLT-Scheme for specific things. Even after learning > scheme, I only started using PLT Scheme for web development after > reading this series: > > http://www.scheme.dk/blog/2007/01/introduction-to-web-development-with.html And as a result you discovered a number of serious problems in using PLT Scheme for we design. One of the real contributions you made by doing this is your series of posts on this mailing list about these difficulties. They got people to take the problems seriously and to do something about them. I suspect PLT Scheme is friendlier to web site implementation now than it was before you started. Are you still using it for your site? Ny the way, another mostly functional language that's been used for a serious web site is OCaml. -- hendrik > > Blog posts are friendly, and eminently google-able. I find they also > illustrate the presence of a community more effectively than a central > site. For some reason, "This guy is using it!" seems stronger than > "There is apparently some group of people using it". And if they're well-thought out, revised occasionally, and include references to later developments, they can be quite useful. -- hendrik From morazanm at gmail.com Wed Feb 18 11:19:10 2009 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:41:55 2009 Subject: [plt-scheme] you have a tough road ahead of you ; ; ; was Re: from hell to paradise In-Reply-To: <846270D2-8947-47BA-8F49-B6829BE4B221@ccs.neu.edu> References: <200902180545.n1I5joAI025683@mail11.syd.optusnet.com.au> <846270D2-8947-47BA-8F49-B6829BE4B221@ccs.neu.edu> Message-ID: <9b1fff280902180819r5264ff01h6329c49e9a9d2ab1@mail.gmail.com> On Wed, Feb 18, 2009 at 7:43 AM, Matthias Felleisen wrote: > > I expect that somewhere around late part II, you will slow down. You may > pick up real reading as of part III, though some may make it thru III and > only "stutter" in IV. > Is this really what you have observed or just an expectation? Part IV (i.e. abstraction) is where my students finally bought into the methodology. Part IV is what they considered easier, because it clicked with them and really made sense. In addition, they felt like they had grasped a real time-saving concept. The dialog after my first lecture was telling and inspiring in many ways: We had developed (this differs a little from the presentation in HtDP): ; make-filter: X --> boolean --> ((listof X) --> (listof X)) (define (make-filter pred) (local [; concrete-filter: ((listof X) X --> (listof X)) (define (concrete-filter L n) (cond [(empty? L) empty] [else (cond [(pred (first L) n) (cons (first L) (concrete-filter (rest L)))] [else (concrete-filter (rest L))])]))] concrete-filter)) After that we used it defined new functions as follows: less-than-filter: ((listof number) number --> (listof number)) (define less-than-filter (make-filter <)) ; less-than-2: (listof number) --> (listof number) (define (less-than-2 L) (less-than-filter L 2)) ; less-than-5: (listof number) --> (listof number) (define (less-than-5 L) (less-than-filter L 5)) with appropriate checks here for both less-than-2 and less-than-5. I pointed out that now we are using functions for which we did not explicitly write. Upon concluding the example: Students: [looked in awe] Marco: [smile] Student A: [spontaneously] Wow....you make it look like magic! Student B: That's incredible. Marco: Is it really magic? Student C: No, it only looks like magic. My students found developing functions that take more than one compound value as input much harder than all of Part IV. -- Cheers, Marco From sbloch at adelphi.edu Wed Feb 18 11:22:59 2009 From: sbloch at adelphi.edu (Stephen Bloch) Date: Thu Mar 26 02:41:55 2009 Subject: [plt-scheme] Defining structures In-Reply-To: <73045cca0902171821j3843d62ah442416dd8c005018@mail.gmail.com> References: <73045cca0902171743s75716fddv62e2f51f2d44c956@mail.gmail.com> <132C8BBC-4274-41D3-A371-36640970BD3C@ccs.neu.edu> <73045cca0902171821j3843d62ah442416dd8c005018@mail.gmail.com> Message-ID: <12B17F3D-B9BF-4F51-B1D9-3B67DDD93AB0@adelphi.edu> On Feb 17, 2009, at 9:21 PM, aditya shukla wrote: > So in other words can i say that define-struct will define the data > type and (define phonebook (make-entry 'PeterLee 15270 '606-7771)) > would create a variable named phonebook of the data type entry? Yes, pretty much, aside from the issue, already mentioned, that variables don't have data types; change your last few words to "would create a variable named phonebook containing a value of the data type entry." In class, I use the analogy of an inventor and a factory. If you invent a new kind of cell phone, or video game, or whatever, what you actually produce is not a cell phone but the BLUEPRINTS or PLANS for a cell phone. Only once the plans have been written down can somebody build a factory that churns out thousands of cell phones to your plan. "define-struct" is an INVENTOR. It doesn't produce phonebook entries, but one of the things it produces is a FACTORY (named "make- entry") which can then be used to churn out as many phonebook entries as you wish. Stephen Bloch sbloch@adelphi.edu From hendrik at topoi.pooq.com Wed Feb 18 10:45:53 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:41:55 2009 Subject: [plt-scheme] Re: from hell to paradise In-Reply-To: <499C3350.5000006@uwaterloo.ca> References: <20090218024344.GE29828@topoi.pooq.com> <499C3350.5000006@uwaterloo.ca> Message-ID: <20090218154552.GC31571@topoi.pooq.com> On Wed, Feb 18, 2009 at 11:12:00AM -0500, Prabhakar Ragde wrote: > Hendrik Boom wrote: > > >>This week it's "Why the hell did I have to learn the theory of LR > >>> parsing with explicit stacks and state transitions instead of > >>> mutually-recursive functions?" --PR > > > >It's a completely different algorithm, with quite different > >capabilities. I think, if you're going to write compilers, you should > >know both, so you'll be able to use the one that suits the language. > > See, you're a victim of the conspiracy, too. They are not completely > different algorithms. There is a thread of continuity between them > explored in a series of papers, the central one being Leermakers, > Augusteijn, and Kruseman Aretz (TCS 1992). > > Here it is in a nutshell. If we take a context-free grammar G and create > a function A() for each nonterminal A whose job it is to consume (from > an input list provided as a parameter to the function A) an initial > sequence of terminals derivable from A, it is easy to write what we call > a naive recursive-descent parser. It can even handle ambiguous grammars > if we have it produce a list of input suffixes (that is, make it > nondeterministic). But it takes exponential time on some grammars, and > gets into infinite loops with left-recursive productions (e.g. A -> Ab). > > So we transform G to ensure there are at most two nonterminals on the > right-hand side of every rule. There are many related ways to do this > (cf Chomsky normal form) but we choose one that introduces items as > nonterminals. An item is a grammar rule with a dot in the right-hand > side to indicate partial progress. The rules in the transformed grammar > have an item on the left side and on the right side, the nonterminal > after the dot followed by the item with the dot moved over one position. > > If we apply recursive descent to the transformed grammar (with a > function for each item), it still has the same problems. But if we > memoize the computation, it's not hard to show that it takes O(n^3) > time. [Aside: up to this point should be core material for any reputable > CS curriculum, but it is not.] We can cut this down by introducing > lookahead (first and follow sets), giving LL(k). > > But we still have the problem with left recursion, which tends to be > natural in grammars for programming languages (and, I am told, for > natural language grammars as well). There are techniques for avoiding > the infinite loops, but the resulting parse trees "slant the wrong way". > We can handle that by transforming the parse tree, but that involves > operations on trees, not to mention building the parse tree in the first > place. (Such things are hard for students instructed using Java.) > > So we transform the grammar again to eliminate left recursion. There are > many related ways to do this (cf Greibach normal form), but we choose > one that involves left corners of the symbol after the dot (a left > corner being any initial symbol generated by rewriting the leftmost > symbol zero or more times). Then we apply recursive descent to the newly > transformed grammar. > > Expressed in terms of the original grammar, this involves not only a > function for each item, but a function for each (left corner, item) > pair. This is nondeterministic recursive ascent parsing, so named > because the recursive functions "ascend" from a terminal which is a left > corner through successive undone leftmost rewrites. > > To make this more general, we use the idea from NFA->DFA conversion, and > replace functions on items by functions on sets of items (called > states). Where before the natural successor of an item I with respect to > a nonterminal A just after a dot was the item with the dot moved over > the A, now the successor of a state is the collection of such plus the > introduction of new items with A on the left and some right-hand side > with a dot all the way to the left. This is the LR(0) automaton, and > what I've described is its transition or "goto" function. > > If we apply recursive ascent to this, and work out the details, we get > an LR(0) parser. (Pepper at TU-Berlin explains it entirely in terms of > grammar transformations.) Shift-reduce and reduce-reduce conflicts are > explained by being exactly the points in the function definitions where > nondeterminism is possible. Adding lookahead as we did for LL(k) gives > LR(k). Cutting down on the number of states and the complexity of the > transition function by including various restrictions gives SLR or LALR. > > These sets of mutually-recursive functions don't look much like the > traditional LR(0) or LR(k) parser. To get there, we make the recursion > stack explicit, and treat the input list as a stack. Then the core of > the algorithm becomes an iterative loop, popping and pushing. Finally, > we notice that we can combine the two stacks into one, processing the > input sequentially, and we have the conventional presentation (which, > unlike everything I have described up to this point, cannot handle > nondeterminism caused by grammars that don't conform to the restrictions). > > But all the intuition has been drained out of it, as the blood has been > drained out of a slaughtered animal that ends up as shrink-wrapped > pieces of meat in a supermarket. Yes, they're convenient, and we adults > make the connection with living animals if we think about it enough, > though usually we don't. The traditional LR(k) algorithm is efficient in > time and space (to an extent not really needed in many applications any > more, and certainly not needed in a pedagogical presentation), but > students don't make the connection with more natural or simpler > techniques. Instead, they either use tools (e.g. Lex/YACC) that they > only dimly understand, flailing away at shift-reduce or reduce-reduce > conflicts by randomly rewriting their grammars, or they learn the > algorithm by rote but glean what intuition they can from one or two > worked examples. > > I went further, learning the theories of LL and LR parsing from > researchers in formal languages at two universities, but until recently > I also thought these were "completely different" algorithms that could > only be expressed iteratively using mutation. To be fair, I learned said > theories before the above connections were worked out; the first papers > in this series (Roberts and Kruseman Aretz) appeared in 1988. Twenty > years later, we no longer have an excuse. --PR > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme I know about sone of this stuff. I made a presentation at IFIP Working Group 2.1 in which I transformed a nonworking recursive-descent parser into working one -- what Charles Lindsey remarked was a "recursive descent bottom-up parser." Later, others went on from there, formalizing the method, developing it further, and writing it up in papers, including some of the papers you mentioned. The key thing I introduced was having a production (i.e., a recurive-descent paring function) deliver one of *several* nonterminals. Instead of having to commit between parsing a Statement or a Declaration, you call a function that parsers either, and reports what it found. You then decide which it was after you've seen it. The resulting parser still has the feel and flavour of a recursive-descent parser, you can use all the coding methods you've learned to use as a regular user of a powerful programming language, interface with so-called "static semantics" in a natural way, and retain intellectual control of the parser. I suspect the technique would be easy to teach. I've used this technique on all my recent parsers. When I write a recursive-descent parser generator, I allow a production to specify what constructor is to be used to build its piece of parse tree. Then where the nonterminal is called, I use a notation that pattern-matches on the bit of parse tree built to determine what to do next. Perhaps I shouldn't have said you need to know both the LR and the recursive descent methods. It is not true any more. You certainly did need to know both in the 70's and 80's, when I did most of my compiler writing (Algol 68 and C++ in case you're interested). But I maintain that they are different algorithms. Performing program transformations on an algorithm, especially ones as nontrivial as you describe, really does transform it into a different algorithm. -- hendrik From grettke at acm.org Wed Feb 18 11:45:38 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:55 2009 Subject: [plt-scheme] Defining structures In-Reply-To: <12B17F3D-B9BF-4F51-B1D9-3B67DDD93AB0@adelphi.edu> References: <73045cca0902171743s75716fddv62e2f51f2d44c956@mail.gmail.com> <132C8BBC-4274-41D3-A371-36640970BD3C@ccs.neu.edu> <73045cca0902171821j3843d62ah442416dd8c005018@mail.gmail.com> <12B17F3D-B9BF-4F51-B1D9-3B67DDD93AB0@adelphi.edu> Message-ID: <756daca50902180845x114ce6f9t23412da45d14363f@mail.gmail.com> On Wed, Feb 18, 2009 at 10:22 AM, Stephen Bloch wrote: > "define-struct" is an INVENTOR. It doesn't produce phonebook entries, but > one of the things it produces is a FACTORY (named "make-entry") which can > then be used to churn out as many phonebook entries as you wish. By analogue, a variable is a MAP with one item on it; it shows you the location of that thing that the factory just churned out. From grettke at acm.org Wed Feb 18 11:48:13 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:55 2009 Subject: [plt-scheme] Fwd: Google Alert - drscheme In-Reply-To: <932b2f1f0902180609w5493a7cfyb8352c4d9e75759a@mail.gmail.com> References: <0016368e268f36eaea046331deea@google.com> <932b2f1f0902180609w5493a7cfyb8352c4d9e75759a@mail.gmail.com> Message-ID: <756daca50902180848i375c4eefq8dd92defd73f5d60@mail.gmail.com> On Wed, Feb 18, 2009 at 8:09 AM, Robby Findler wrote: > Clearly, the think to do about that bad kitchen sink smell is to add a > gutter to DrScheme! :) :) Now please tell me that more than two people find that absurd alert to be funny! From grettke at acm.org Wed Feb 18 12:01:13 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:56 2009 Subject: Novels and programs (was: Re: [plt-scheme] Prereqs for robotic programming In-Reply-To: <20090218150503.GA31571@topoi.pooq.com> References: <756daca50902170823l4d369dcbk3fc0b404df26d5ce@mail.gmail.com> <20090217172152.GB29566@topoi.pooq.com> <7A211AFD-42A7-4069-AB04-582FB57B6CAE@adelphi.edu> <20090217.220417.201177531.maxigas@anargeek.net> <779bf2730902171519x19214295uecc40074c5a1275d@mail.gmail.com> <20090218022514.GB29828@topoi.pooq.com> <756daca50902172013r3402904ej8b8cec5c5a45e4a0@mail.gmail.com> <20090218150503.GA31571@topoi.pooq.com> Message-ID: <756daca50902180901o58f48ba9h952d918b188e1e8f@mail.gmail.com> On Wed, Feb 18, 2009 at 9:05 AM, wrote: > On Tue, Feb 17, 2009 at 10:13:17PM -0600, Grant Rettke wrote: >> On Tue, Feb 17, 2009 at 8:25 PM, wrote: >> > If I'm looking at models, I'd choose the spiral model. >> >> The spiral model reads well but it doesn't have the six sigma nuts or >> caffeine fueled zealots like Lean and Agile have. How will it >> survive?! :) > > It's the one that de facto gets used every time someone says, "This code > is a mess. Let's fork it and rewrite it". Usually the old > understanding -- what there is of it -- gets embedded in the new, > cleaner system. I like spiral too. From hendrik at topoi.pooq.com Wed Feb 18 11:03:33 2009 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:41:56 2009 Subject: [plt-scheme] you have a tough road ahead of you ; ; ; was Re: from hell to paradise In-Reply-To: <756daca50902172011l60154dbfu7d9fbb18a4d1afb5@mail.gmail.com> References: <200902180315.n1I3FvTm025419@mail06.syd.optusnet.com.au> <756daca50902172011l60154dbfu7d9fbb18a4d1afb5@mail.gmail.com> Message-ID: <20090218160333.GD31571@topoi.pooq.com> On Tue, Feb 17, 2009 at 10:11:38PM -0600, Grant Rettke wrote: > Hi Dan, > > On Tue, Feb 17, 2009 at 9:15 PM, wrote: > > There's a lot in this. If you want to sell something effectively, you need to see things > > from your prospect's point of view. > > > > What's their "pain"? > > > > If they don't think clearly, don't realise this, and don't perceive it as a problem, and you > > tell them that they have a problem are they going to: > > I forgot to include the "pain" part of the story! > > The pain is client-visible broken features, no unit tests, terrible > incomprehensible code, no answer for "why did you type this?", no > ability to visualize the problem or the solution, and no way for > senior and junior developers to interact since there is no common > ground. It has been very, very painful. > > Not painful enough I guess?! Too painful for them to consider alternatives. In my long life I've been at two universities where the computer centre was saddled with CDC Cyber computers. For those not in the know, the only thing they did well was fast floating point arithmetic -- everything else was an afterthought. This was fine for the influential physics department, nut a disaster for everyone else. The software had been adapted by CDC to do terminal access, do some manner of time sharing, etc., etc., but it basically could not work reliably. The computer centre closed in around the machine, protecting it from the hordes of potential users who would only crash the machine if they were given free rein to program and compute as the wished (and no, I'm not talking about the ones trying to crash the machinery. That was no challenge at all.) When the powers that be decreed that the university would acquire a new machine, a VAX, the computer centre rebelled. Another Cyber, sure, they had the experteise to deal with that. But learning all the troubles and foibles for yet another kind of machine, no, they couldn't possibly face that. Fortunately, the powers that be had tbe final say, and VAXen were foisted upon the hapless computer centre. Once the installation work was done, and the machine was turned on and made available to the army of users (gridgingly, at first), it took only a few weeks for the computer centre to discover that the new machine *actually* *worked*, and that when users started to do innovative things with it, it *went* *on* *working*. And letting too many users on it didn't crash it. It just made it slow for a while. The computer entre personell' attitude toward the rest of the university changed rapidly. No longer did they avoid meeting people. No longer were they offputting in every interaction. They became the kind of people you'd go to the pub with. What you're facing is people who are so battle-scarred that they have no emotional or intellectual energy left to even imagine there's a better way. They know their pain. They simply don't believe there's a cure. -- hendrik From synx13+plt at gmail.com Wed Feb 18 12:15:06 2009 From: synx13+plt at gmail.com (synx13+plt@gmail.com) Date: Thu Mar 26 02:41:56 2009 Subject: [plt-scheme] xhtml generation Message-ID: <499C421A.6060505@synx.us.to> I've been trying to understand xhtml and xml in general a bit better, and was just poking around the xml module for ways to generate valid documents. Figure I might include what I've done so far. Thanks to some help from eli on Freenode it's working now. My goal's not so much to have a system that cannot produce an invalid document, but to at least have a system where it's possible to produce a valid document. One thing I'm still puzzling over is in the plt documentation, the prolog and document's "misc" structures claim they can be both pcdata and comments (though AFAIK only comments are allowed there), but pcdata seems to error out when I use it in those fields. That's why the pre-comments et al are checked to make sure they're all only comments. -------------- next part -------------- #lang scheme (require xml) (define (create-document head body (pre-comments null) (post-comments null) (tail-comments null)) (make-document (apply make-prolog (cons (make-p-i #f #f "xml" "version=\"1.0\" encoding=\"UTF-8\"") pre-comments) (make-document-type 'html (make-external-dtd/public "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" "-//W3C//DTD XHTML 1.0 Strict//EN") #f) post-comments) (xexpr->xml `(html ((lang "en") (xml:lang "en") (xmlns "http://www.w3.org/1999/xhtml")) (head () ,head) (body () ,body))) tail-comments)) (define (only-comments? l) (andmap comment? l)) (provide/contract [create-document (->* (xexpr? xexpr?) (only-comments? only-comments? only-comments?) document?)]) -------------- next part -------------- #lang scheme (require "xhtml.ss") (require xml) (display-xml (create-document '(title "beep") '(p () "content"))) (display "\n---\n") (display-xml (create-document '(title "beep") '(p () "shmontent") (list (make-comment "Beep") (make-comment "Beep2")) (list (make-comment "Before the HTML")) (list (make-comment "tail1") (make-comment "tail2")))) From grettke at acm.org Wed Feb 18 12:15:41 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:56 2009 Subject: [plt-scheme] you have a tough road ahead of you ; ; ; was Re: from hell to paradise In-Reply-To: <20090218160333.GD31571@topoi.pooq.com> References: <200902180315.n1I3FvTm025419@mail06.syd.optusnet.com.au> <756daca50902172011l60154dbfu7d9fbb18a4d1afb5@mail.gmail.com> <20090218160333.GD31571@topoi.pooq.com> Message-ID: <756daca50902180915p4f3a42f6hc318949f175deb4b@mail.gmail.com> On Wed, Feb 18, 2009 at 10:03 AM, wrote: > What you're facing is people who are so battle-scarred that they have no > emotional or intellectual energy left to even imagine there's a better > way. They know their pain. They simply don't believe there's a cure. That sounds like hopelessness. How do you teach hope? From plragde at uwaterloo.ca Wed Feb 18 12:49:47 2009 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:41:56 2009 Subject: [plt-scheme] Re: from hell to paradise In-Reply-To: <20090218154552.GC31571@topoi.pooq.com> References: <20090218024344.GE29828@topoi.pooq.com> <499C3350.5000006@uwaterloo.ca> <20090218154552.GC31571@topoi.pooq.com> Message-ID: <499C4A3B.7000706@uwaterloo.ca> hendrik@topoi.pooq.com wrote: > Perhaps I shouldn't have said you need to know both the LR and the > recursive descent methods. It is not true any more. You certainly did > need to know both in the 70's and 80's, when I did most of my compiler > writing (Algol 68 and C++ in case you're interested). I think that we still have a lot of cases where Lex/YACC-style tools are used, and we should probably explain them somewhere in the curriculum. But there are alternatives -- ANTLR, packrat parsers, and parser generators, for example -- that also deserve attention. > But I maintain that they are different algorithms. Performing > program transformations on an algorithm, especially ones as > nontrivial as you describe, really does transform it into a different > algorithm. They are different algorithms. But presenting them in a unifying framework means they are not separate mysteries any more. We do this with other "umbrellas" -- depth-first search, or dynamic programming. It's clear to me that umbrella should be functional for parsing. I don't think anyone presents quicksort as an iterative algorithm with an explicit stack any more, do they? Not without discussing the recursive version first. Why are we still doing this for parsing? In the second-year course at my institution that covers such matters, I don't think the phrase "recursive descent" is used. They see LL(1) and LL(k) algorithms with while loops and tables. That is because the course was designed for Java programmers whose understanding of recursion was limited to nonexistent. We are no longer using Java, and I hope a more functional approach will be possible -- though I have colleagues who begrudgingly let us use Scheme in first year, but believe that it should not be allowed to taint anything after that. --PR From maxigas at anargeek.net Wed Feb 18 13:10:28 2009 From: maxigas at anargeek.net (maxigas) Date: Thu Mar 26 02:41:56 2009 Subject: [plt-scheme] HtDP in Python! In-Reply-To: <904774730902171858p5648a256m5b20589c7b8ab970@mail.gmail.com> References: <20090218013553.06da95d9@halmanfloyd.lan.local> <904774730902171858p5648a256m5b20589c7b8ab970@mail.gmail.com> Message-ID: <20090218.191028.120223607.maxigas@anargeek.net> From: "Todd O'Bryan" Subject: Re: [plt-scheme] HtDP in Python! Date: Tue, 17 Feb 2009 21:58:43 -0500 > The other thing Python is missing from an HtDP-replacement standpoint > is a hierarchy of languages that limits students' ability to shoot > themselves in the foot. If you could create a set of language grammars > that limits what students can do at any particular point, you can > create programs that are reasonably idiomatic but still don't use > confusing/dangerous constructs. sorry, but for sure the single most annoying thing about this whole Scheme adventure is precisely this: having to put up with 1000 different dialects, interpreters, etc. i worked through HtDP without using any of these because it was really irritating that my programs in one language wouldn't work in other languages. and after all it was not difficult at all to do the same things in Scheme proper even as a novice. of course, figuring out the differences was indeed very annoying. for example, to realise that after a certain point i cannot use (first) but has to use (car) would have been a stupid feeling if i wouldn't have figured out (car) first. :) maxigas From raould at gmail.com Wed Feb 18 13:41:54 2009 From: raould at gmail.com (Raoul Duke) Date: Thu Mar 26 02:41:57 2009 Subject: [plt-scheme] Functional vs Imperative Parallel Programming In-Reply-To: References: <20090217235154.0250B402B2@qua.cs.brown.edu> Message-ID: <91a2ba3e0902181041s12ffacc5pd425029ff4c9ce78@mail.gmail.com> On Wed, Feb 18, 2009 at 6:13 AM, Carnell, James E wrote: > programmer. I know there probably isn't a quick answer, but that was my > guess. e.g. http://www.google.com/search?q=purely+functional+concurrency+immutable :-) From adityashukla1983 at gmail.com Wed Feb 18 13:52:27 2009 From: adityashukla1983 at gmail.com (aditya shukla) Date: Thu Mar 26 02:41:57 2009 Subject: [plt-scheme] Defining structures In-Reply-To: <756daca50902180845x114ce6f9t23412da45d14363f@mail.gmail.com> References: <73045cca0902171743s75716fddv62e2f51f2d44c956@mail.gmail.com> <132C8BBC-4274-41D3-A371-36640970BD3C@ccs.neu.edu> <73045cca0902171821j3843d62ah442416dd8c005018@mail.gmail.com> <12B17F3D-B9BF-4F51-B1D9-3B67DDD93AB0@adelphi.edu> <756daca50902180845x114ce6f9t23412da45d14363f@mail.gmail.com> Message-ID: <73045cca0902181052j53ee890ci33545ba9da980db@mail.gmail.com> A question that comes to mind if variables in scheme do not have type in scheme thus can be say that (define a 9) -here a is a placeholder for a value whose tag is a number > (define a 'aditya) define: cannot redefine name: a why can't we redefine a here? Aditya -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090218/a3960fb2/attachment.html From jos.koot at telefonica.net Wed Feb 18 14:17:16 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:41:58 2009 Subject: [plt-scheme] Defining structures References: <73045cca0902171743s75716fddv62e2f51f2d44c956@mail.gmail.com><132C8BBC-4274-41D3-A371-36640970BD3C@ccs.neu.edu><73045cca0902171821j3843d62ah442416dd8c005018@mail.gmail.com><12B17F3D-B9BF-4F51-B1D9-3B67DDD93AB0@adelphi.edu><756daca50902180845x114ce6f9t23412da45d14363f@mail.gmail.com> <73045cca0902181052j53ee890ci33545ba9da980db@mail.gmail.com> Message-ID: <0AA7BE3B33A4443BA6E8B7D038E348F4@uw2b2dff239c4d> Try: (define a 'a-symbol) (set! a 300) Jos ----- Original Message ----- From: aditya shukla To: Grant Rettke Cc: plt edu ; PLT Scheme ML Sent: Wednesday, February 18, 2009 7:52 PM Subject: Re: [plt-scheme] Defining structures A question that comes to mind if variables in scheme do not have type in scheme thus can be say that (define a 9) -here a is a placeholder for a value whose tag is a number > (define a 'aditya) define: cannot redefine name: a why can't we redefine a here? Aditya ------------------------------------------------------------------------------ _________________________________________________ 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/20090218/17bd540f/attachment.htm From lordgeoffrey at optushome.com.au Wed Feb 18 14:24:03 2009 From: lordgeoffrey at optushome.com.au (LordGeoffrey) Date: Thu Mar 26 02:41:58 2009 Subject: [plt-scheme] you have a tough road ahead of you ; ; ; was Re: from hell to paradise In-Reply-To: <756daca50902180915p4f3a42f6hc318949f175deb4b@mail.gmail.com> References: <200902180315.n1I3FvTm025419@mail06.syd.optusnet.com.au> <756daca50902172011l60154dbfu7d9fbb18a4d1afb5@mail.gmail.com> <20090218160333.GD31571@topoi.pooq.com> <756daca50902180915p4f3a42f6hc318949f175deb4b@mail.gmail.com> Message-ID: <499C6053.3040909@optushome.com.au> Grant Rettke wrote: > On Wed, Feb 18, 2009 at 10:03 AM, wrote: > >> What you're facing is people who are so battle-scarred that they have no >> emotional or intellectual energy left to even imagine there's a better >> way. They know their pain. They simply don't believe there's a cure. >> > > That sounds like hopelessness. > > How do you teach hope? > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > You don't. You inspire and foster it. From grettke at acm.org Wed Feb 18 14:30:56 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:41:58 2009 Subject: [plt-scheme] you have a tough road ahead of you ; ; ; was Re: from hell to paradise In-Reply-To: <499C6053.3040909@optushome.com.au> References: <200902180315.n1I3FvTm025419@mail06.syd.optusnet.com.au> <756daca50902172011l60154dbfu7d9fbb18a4d1afb5@mail.gmail.com> <20090218160333.GD31571@topoi.pooq.com> <756daca50902180915p4f3a42f6hc318949f175deb4b@mail.gmail.com> <499C6053.3040909@optushome.com.au> Message-ID: <756daca50902181130y5dfd957ex13261ad49934e0bc@mail.gmail.com> On Wed, Feb 18, 2009 at 1:24 PM, LordGeoffrey wrote: > Grant Rettke wrote: >> On Wed, Feb 18, 2009 at 10:03 AM, wrote: >>> What you're facing is people who are so battle-scarred that they have no >>> emotional or intellectual energy left to even imagine there's a better >>> way. They know their pain. They simply don't believe there's a cure. >>> >> >> That sounds like hopelessness. >> >> How do you teach hope? > You don't. You inspire and foster it. Ok. How do you do that? From stone at cs.grinnell.edu Wed Feb 18 14:58:17 2009 From: stone at cs.grinnell.edu (John David Stone) Date: Thu Mar 26 02:41:58 2009 Subject: [plt-scheme] you have a tough road ahead of you ; ; ; was Re: from hell to paradise In-Reply-To: <756daca50902181130y5dfd957ex13261ad49934e0bc@mail.gmail.com> References: <200902180315.n1I3FvTm025419@mail06.syd.optusnet.com.au> <756daca50902172011l60154dbfu7d9fbb18a4d1afb5@mail.gmail.com> <20090218160333.GD31571@topoi.pooq.com> <756daca50902180915p4f3a42f6hc318949f175deb4b@mail.gmail.com> <499C6053.3040909@optushome.com.au> <756daca50902181130y5dfd957ex13261ad49934e0bc@mail.gmail.com> Message-ID: <18844.26713.794163.331480@babbage.cs.grinnell.edu> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Grant Rettke writes: > How do you teach hope? In the same way you teach any other moral disposition: example and precept. Be hopeful, let others see that you are hopeful, look for opportunities to explain what the grounds for hope are, and demonstrate how hope facilitates your achievements and promotes cooperation. As in other kinds of teaching, the struggle against prejudice, ignorance, apathy, and superstition takes a long time and doesn't always end in victory. But I'll be damned if I give up. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Processed by Mailcrypt 3.5.8+ iD8DBQFJnGhLbBGsCPR0ElQRAiLxAJwMa6FG7bqCNFij9ImvmnoLw4N7MwCg6TtM TaeL0BYvCe2VUNm3OEF5BsI= =pmbz -----END PGP SIGNATURE----- From yinso.chen at gmail.com Wed Feb 18 16:22:33 2009 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:41:59 2009 Subject: [plt-scheme] no prehistoric dates? Message-ID: <779bf2730902181322o5a3ab1bdg4dab96c51238cdd4@mail.gmail.com> make-date cannot handle negative years, i.e. no BC time. > (make-date 0 0 0 1 1 -1 0 0 #f 0) make-date: expected argument of type ; given -1 Is there a reason for such restriction? Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090218/6d63589b/attachment.html From mflatt at cs.utah.edu Wed Feb 18 16:24:49 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:41:59 2009 Subject: [plt-scheme] no prehistoric dates? In-Reply-To: <779bf2730902181322o5a3ab1bdg4dab96c51238cdd4@mail.gmail.com> References: <779bf2730902181322o5a3ab1bdg4dab96c51238cdd4@mail.gmail.com> Message-ID: <20090218212450.8ACFC6500B1@mail-svr1.cs.utah.edu> At Wed, 18 Feb 2009 13:22:33 -0800, YC wrote: > make-date cannot handle negative years, i.e. no BC time. > > > (make-date 0 0 0 1 1 -1 0 0 #f 0) > make-date: expected argument of type ; given > -1 > > Is there a reason for such restriction? None that I can see, so I'll change the `date' structure type to allow it. From yinso.chen at gmail.com Wed Feb 18 16:26:27 2009 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:42:00 2009 Subject: [plt-scheme] no prehistoric dates? In-Reply-To: <20090218212450.8ACFC6500B1@mail-svr1.cs.utah.edu> References: <779bf2730902181322o5a3ab1bdg4dab96c51238cdd4@mail.gmail.com> <20090218212450.8ACFC6500B1@mail-svr1.cs.utah.edu> Message-ID: <779bf2730902181326u7cf7020ardb2b8a02a25af0ef@mail.gmail.com> On Wed, Feb 18, 2009 at 1:24 PM, Matthew Flatt wrote: > At Wed, 18 Feb 2009 13:22:33 -0800, YC wrote: > > make-date cannot handle negative years, i.e. no BC time. > > > > > (make-date 0 0 0 1 1 -1 0 0 #f 0) > > make-date: expected argument of type ; given > > -1 > > > > Is there a reason for such restriction? > > None that I can see, so I'll change the `date' structure type to allow > it. > Thanks. yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090218/815c0b35/attachment.htm From toddobryan at gmail.com Wed Feb 18 16:26:43 2009 From: toddobryan at gmail.com (Todd O'Bryan) Date: Thu Mar 26 02:42:00 2009 Subject: [plt-scheme] Defining structures In-Reply-To: <73045cca0902181052j53ee890ci33545ba9da980db@mail.gmail.com> References: <73045cca0902171743s75716fddv62e2f51f2d44c956@mail.gmail.com> <132C8BBC-4274-41D3-A371-36640970BD3C@ccs.neu.edu> <73045cca0902171821j3843d62ah442416dd8c005018@mail.gmail.com> <12B17F3D-B9BF-4F51-B1D9-3B67DDD93AB0@adelphi.edu> <756daca50902180845x114ce6f9t23412da45d14363f@mail.gmail.com> <73045cca0902181052j53ee890ci33545ba9da980db@mail.gmail.com> Message-ID: <904774730902181326i18a1c3d8k195ba3b3c8bcc6b1@mail.gmail.com> On Wed, Feb 18, 2009 at 1:52 PM, aditya shukla wrote: > A question that comes to mind if variables in scheme do not have type in > scheme thus can be say that > > (define a 9) -here a is a placeholder for a value whose tag is a number > >> (define a 'aditya) > define: cannot redefine name: a > > > > why can't we redefine a here? > > > Aditya Because you can only define something once. It doesn't have to do with the type--even if you tried to redefine a as another number, you'd still get the same error: (define a 1) (define a 2) <---- Scheme doesn't like this either Todd From noelwelsh at gmail.com Wed Feb 18 17:25:19 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:42:00 2009 Subject: [plt-scheme] Functional vs Imperative Parallel Programming In-Reply-To: References: <20090217235154.0250B402B2@qua.cs.brown.edu> Message-ID: The main architectures for parallel programming in functional languages are: - message passing - transactional memory - dataflow The first one come built into PLT Scheme. Check the documentation for channels. There isn't a transactional memory library that I'm aware of, though it is quite easy to build one. You'll probably want to check out the STM work in Haskell. Dataflow languages are represented by functional reactive programming. For this, check out FrTime, which comes with PLT. Others will probably disagree with my taxonomy, so you'll probably find other stuff as well. I have ignored implicit parallelism, for example. N. On Wed, Feb 18, 2009 at 2:13 PM, Carnell, James E wrote: > > I am asking a question way beyond where I am at as a programmer. I > didn't know what imperative and functional programming was until I > started reading about it last night (I have a degree in MIS too?). I am > starting to get interested in parallel programming and after reading > about functional programming it seems that functional programming would > be easier on the patience and programming skills of a parallel > programmer. I know there probably isn't a quick answer, but that was my > guess. From grettke at acm.org Wed Feb 18 17:28:38 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:42:01 2009 Subject: [plt-scheme] Functional vs Imperative Parallel Programming In-Reply-To: References: <20090217235154.0250B402B2@qua.cs.brown.edu> Message-ID: <756daca50902181428q14a76e4cr43169a22413fe146@mail.gmail.com> http://www.wisdomandwonder.com/link/588/mpscm-a-distributed-extension-to-mzscheme http://www.wisdomandwonder.com/link/227/updated-distributed-programming-in-scheme From danprager at optusnet.com.au Wed Feb 18 17:46:58 2009 From: danprager at optusnet.com.au (danprager@optusnet.com.au) Date: Thu Mar 26 02:42:01 2009 Subject: [plt-scheme] you have a tough road ahead of you ; ; ; was Re: from hell to paradise Message-ID: <200902182246.n1IMkw5h013575@mail01.syd.optusnet.com.au> > Grant Rettke wrote: > > On Wed, Feb 18, 2009 at 10:03 AM, wrote: > > What you're facing is people who are so battle-scarred that they have > no > > emotional or intellectual energy left to even imagine there's a better > > way. They know their pain. They simply don't believe there's a cure. > > That sounds like hopelessness. > > How do you teach hope? > How to awaken hope: 1. Show that you understand their pains. 2. Tell a story about how one of their pains (or something similar) was overcome, ideally by you personally. 3. Work with them to make a small constructive step, with a tangible and fairly immediate pay-off. 4. As hope emerges, their trust in your guidance will hopefully grow, step by step. It sounds like with unit tests and code reviews you are doing this. You may need to give a _lot_ of support to get good tests happening though. Be open to learning from this pass through (if perception of arrogance is a problem). -- Dan From maxigas at anargeek.net Wed Feb 18 20:19:22 2009 From: maxigas at anargeek.net (maxigas) Date: Thu Mar 26 02:42:01 2009 Subject: [plt-scheme] Searching on docs.plt-scheme disabled? In-Reply-To: References: Message-ID: <20090219.021922.125999895.maxigas@anargeek.net> From: Henk Boom Subject: Re: [plt-scheme] Searching on docs.plt-scheme disabled? Date: Wed, 18 Feb 2009 09:16:01 -0500 > 2009/2/18 Danny Yoo : >> I've tried to search on docs.plt-scheme.org, but the javascript >> doesn't seem to be doing anything. you can restrict your search to a certain domain when you search on google.com like this: yoursearchterm site:docs.plt-scheme.org maxigas From yinso.chen at gmail.com Wed Feb 18 20:50:06 2009 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:42:02 2009 Subject: [plt-scheme] seconds->date 32bit limitation Message-ID: <779bf2730902181750u2f4774as46cd1ab14439f1e3@mail.gmail.com> Hi all - is the seconds->date limitation bound to the underlying OS arcitecture? I noticed that date->seconds can return numbers outside of the range for seconds->date, and wonder whether seconds->date can be expanded to handle the greater range easily. Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090218/ab294a7f/attachment.html From mflatt at cs.utah.edu Wed Feb 18 21:16:10 2009 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:42:02 2009 Subject: [plt-scheme] seconds->date 32bit limitation In-Reply-To: <779bf2730902181750u2f4774as46cd1ab14439f1e3@mail.gmail.com> References: <779bf2730902181750u2f4774as46cd1ab14439f1e3@mail.gmail.com> Message-ID: <20090219021611.F09656500B1@mail-svr1.cs.utah.edu> At Wed, 18 Feb 2009 17:50:06 -0800, YC wrote: > is the seconds->date limitation bound to the underlying OS arcitecture? Yes. > I noticed that date->seconds can return numbers outside of the range for > seconds->date, and wonder whether seconds->date can be expanded to handle > the greater range easily. Do you mean `date->seconds' or `find-seconds'? I don't think `find-seconds' can return an out-of-range result, because it uses `seconds->date' to find a match. But maybe you mean a `date->seconds' function that I don't know. Matthew From dyrueta at gmail.com Wed Feb 18 21:11:27 2009 From: dyrueta at gmail.com (dave yrueta) Date: Thu Mar 26 02:42:02 2009 Subject: [plt-scheme] HtDP Exercise 25.5.3 - Very Quick Question Message-ID: <19db08ab-784e-45e2-89f3-a326802aae25@w1g2000prk.googlegroups.com> The exercise describes a problem solving process, and then instructs the student to "repeat the process with epsilon/2 and then with epsilon/4." Here's a link: http://www.htdp.org/2003-09-26/Book/curriculum-Z-H-29.html#node_sec_23.5 Does that translate to "epsilon divided by 2 and 4" or "epsilon as 2 and 4?" Thanks! Dave Yrueta From yinso.chen at gmail.com Wed Feb 18 21:25:03 2009 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:42:03 2009 Subject: [plt-scheme] seconds->date 32bit limitation In-Reply-To: <20090219021611.F09656500B1@mail-svr1.cs.utah.edu> References: <779bf2730902181750u2f4774as46cd1ab14439f1e3@mail.gmail.com> <20090219021611.F09656500B1@mail-svr1.cs.utah.edu> Message-ID: <779bf2730902181825x73cbbfabxd46e8c4b781435d5@mail.gmail.com> On Wed, Feb 18, 2009 at 6:16 PM, Matthew Flatt wrote: > > > I noticed that date->seconds can return numbers outside of the range for > > seconds->date, and wonder whether seconds->date can be expanded to handle > > the greater range easily. > > Do you mean `date->seconds' or `find-seconds'? I don't think > `find-seconds' can return an out-of-range result, because it uses > `seconds->date' to find a match. But maybe you mean a `date->seconds' > function that I don't know. > My bad. I forgot date->seconds is a wrapper I created on srfi/19's date->time-utc. So is this only fixable when the 2038 bug is addressed? Thoughts on integrating srfi/19 into core? Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090218/7efd65f0/attachment.htm From matthias at ccs.neu.edu Wed Feb 18 21:29:07 2009 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:42:03 2009 Subject: [plt-scheme] HtDP Exercise 25.5.3 - Very Quick Question In-Reply-To: <19db08ab-784e-45e2-89f3-a326802aae25@w1g2000prk.googlegroups.com> References: <19db08ab-784e-45e2-89f3-a326802aae25@w1g2000prk.googlegroups.com> Message-ID: <600E1873-8180-4772-A812-EF6137ACD06D@ccs.neu.edu> divide, then conquer -) On Feb 18, 2009, at 9:11 PM, dave yrueta wrote: > The exercise describes a problem solving process, and then instructs > the student to "repeat the process with epsilon/2 and then with > epsilon/4." > > Here's a link: http://www.htdp.org/2003-09-26/Book/curriculum-Z- > H-29.html#node_sec_23.5 > > Does that translate to "epsilon divided by 2 and 4" or "epsilon as 2 > and 4?" > > Thanks! > Dave Yrueta > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From morazanm at gmail.com Thu Feb 19 07:03:46 2009 From: morazanm at gmail.com (Marco Morazan) Date: Thu Mar 26 02:42:03 2009 Subject: [plt-scheme] Defining structures In-Reply-To: <904774730902181326i18a1c3d8k195ba3b3c8bcc6b1@mail.gmail.com> References: <73045cca0902171743s75716fddv62e2f51f2d44c956@mail.gmail.com> <132C8BBC-4274-41D3-A371-36640970BD3C@ccs.neu.edu> <73045cca0902171821j3843d62ah442416dd8c005018@mail.gmail.com> <12B17F3D-B9BF-4F51-B1D9-3B67DDD93AB0@adelphi.edu> <756daca50902180845x114ce6f9t23412da45d14363f@mail.gmail.com> <73045cca0902181052j53ee890ci33545ba9da980db@mail.gmail.com> <904774730902181326i18a1c3d8k195ba3b3c8bcc6b1@mail.gmail.com> Message-ID: <9b1fff280902190403j5e933428h792ae8a414e7c6b8@mail.gmail.com> On Wed, Feb 18, 2009 at 4:26 PM, Todd O'Bryan wrote: > On Wed, Feb 18, 2009 at 1:52 PM, aditya shukla > wrote: >> A question that comes to mind if variables in scheme do not have type in >> scheme thus can be say that >> >> (define a 9) -here a is a placeholder for a value whose tag is a number >> >>> (define a 'aditya) >> define: cannot redefine name: a >> >> >> >> why can't we redefine a here? >> >> >> Aditya > > Because you can only define something once. It doesn't have to do with > the type--even if you tried to redefine a as another number, you'd > still get the same error: > > (define a 1) > (define a 2) <---- Scheme doesn't like this either > It really has to do with the restrictions imposed by the (student) language you are using. One of the restrictions is that you can only define a variable once. Full Scheme will allow you to redefine anything (i.e. a variable, a function, etc.). The question, Aditya, is why would you want to redefine a variable? What sense does it make to define a variable more than once? -- Cheers, Marco From jboadas at gmail.com Thu Feb 19 08:36:36 2009 From: jboadas at gmail.com (Jesus Boadas) Date: Thu Mar 26 02:42:04 2009 Subject: [plt-scheme] Drscheme boost programs performance Message-ID: Hello great scheme comunity. Im playing with DrScheme and thinking on it for migrate an application based on XML-RPC web services and Desktops clients for a large distributed network, I also get some UI demos and play with It, reading documentation and looking for some answers, but (IMHO) I get a slow feeling response using the UI aplications (like a feeling using a .NET application, no as bad as java-vm but slow than C/C++), I always prefer robustness before performance and DrScheme looks solid rock but I know how are the common-user and need to ask if exist any way to compile native aplications with DrScheme or other way to gain performance to change the feel of the UI, I know that DrScheme can compile shared libraries to native code but also need a fast startup. Best regards -- Jesus Boadas jboadas@gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090219/ee763275/attachment.html From noelwelsh at gmail.com Thu Feb 19 08:53:13 2009 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:42:04 2009 Subject: [plt-scheme] Drscheme boost programs performance In-Reply-To: References: Message-ID: Just a note: code running under DrScheme is slower than the same code running under MzScheme or MrEd. DrScheme disables the JIT, IIRC, so that it can report better error messages. Try your code in MrEd. N. On Thu, Feb 19, 2009 at 1:36 PM, Jesus Boadas wrote: > ... > network, I also get some UI demos and play with It, reading documentation > and looking for some answers, but (IMHO) I get a slow feeling response using > the UI aplications (like a feeling using a .NET application, no as bad as > java-vm but slow than C/C++), ... From robby at eecs.northwestern.edu Thu Feb 19 09:07:17 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Mar 26 02:42:04 2009 Subject: [plt-scheme] Drscheme boost programs performance In-Reply-To: References: Message-ID: <932b2f1f0902190607r76ff0481m9c681f13bcbd5f29@mail.gmail.com> The currently released version of DrScheme does not disable the JIT, but it does add debugging annotations which have a significant performance impact. (For non-teaching languages, this can be changed in the language dialog.) Robby On Thu, Feb 19, 2009 at 7:53 AM, Noel Welsh wrote: > Just a note: code running under DrScheme is slower than the same code > running under MzScheme or MrEd. DrScheme disables the JIT, IIRC, so > that it can report better error messages. Try your code in MrEd. > > N. > > On Thu, Feb 19, 2009 at 1:36 PM, Jesus Boadas wrote: >> ... >> network, I also get some UI demos and play with It, reading documentation >> and looking for some answers, but (IMHO) I get a slow feeling response using >> the UI aplications (like a feeling using a .NET application, no as bad as >> java-vm but slow than C/C++), ... > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From geoff at knauth.org Thu Feb 19 09:52:15 2009 From: geoff at knauth.org (Geoffrey S. Knauth) Date: Thu Mar 26 02:42:04 2009 Subject: [plt-scheme] you have a tough road ahead of you ; ; ; was Re: from hell to paradise In-Reply-To: <756daca50902171741m2975f25bx92a4c4dbe81e530e@mail.gmail.com> References: <756daca50902171741m2975f25bx92a4c4dbe81e530e@mail.gmail.com> Message-ID: First of all, Grant, I really admire you for trying to get your colleagues to work through HtDP. OK, so your first attempt didn't work out as you hoped. But what first attempt ever does? I wonder what check-expect would do for the steps of your experiment, and what subsequent refinements of your educational enterprise would look like. I believe if you keep trying this, eventually you'll hit on a formula for success. As I thought about your experience, I wondered what had worked for me in the past. Usually, getting a small group of people together who really care about something yields the best results. DrScheme itself is a classic example of just such a small group of passionate developers coming up with something amazing and extensible that draws a devoted following. If you're trying to motivate a group of people who don't have that passion, but you hope they will, you kind of have to blow them away with something they could never do in their world. I liked Prabhakar Ragde's example of the 5 line program to read the NYTimes RSS feed and deliver an S-expression ready to manipulate. Do that a few times a few different ways, and you might win a few converts. Reading Marco Morazan's recollection that Dijkstra considered people who do not want to learn and who refuse to think "brain damaged," I partly agree, but I think maybe they are only brain damaged as far as computer science is concerned if the amount of time we have is limited. I'm not sure if our culture has poisoned people to avoid mathematics, or if there really are different kinds of brains. It seems to me some people are attracted to mathematical concepts, and some people lack mathematical curiosity. I'm not talking about the American tendency in recent decades to believe mathematical thinking requires talent, discouraging everyone else from even trying. Mathematics is work, sometimes very hard work. Answers don't magically pop into the heads of geniuses very often. But even though I believe most people can do math and learn to enjoy it if they only give it a fair shot, I have run into a few people who either fight against mathematics or try really hard but show no sign of getting it. In those cases, I say to myself, "Well maybe God has another plan for them in life," while I still look for the right insight to tip the balance in the hardest cases. Sometimes people fight us because they don't want "receive" knowledge, they want to come up with it on their own. When I was a consultant 15 years ago, a wise person told me the secret was to get executives with more ego than knowledge to see what we hoped they'd see while thinking it was their idea. There was the case of a doctor making a phone call who was struck by lightning, survived, and then developed amazing musical talent. Before that happened, perhaps music teachers would have looked at him in despair, but afterward they were surely amazed. We are only beginning to understand how the brain works. Geoff From jos.koot at telefonica.net Thu Feb 19 09:53:13 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:42:04 2009 Subject: [plt-scheme] Drscheme boost programs performance References: <932b2f1f0902190607r76ff0481m9c681f13bcbd5f29@mail.gmail.com> Message-ID: Nice to hear this. For a moment this thread worried me, for I always run from DrScheme (usually debugging switched off and modules first compiled with managed-compile-zo and debugging switched off) I hate typing shell commands and I love the simple way PLT Scheme can be downloaded/installed and the way DrScheme can be used without having to worry about shell scripts/commands (untill a decade ago I was an expert in producing reliable scripts, though) >From time to time, I experience severe slow downs too, but they can always be tracked down to Fsecure and HP-digital-monitor (under Windows XP that is) Even in a completely clean system, without any application running, they sometimes consume 25% of CPU time. When I really want all of my CPU, I first restart my system without connection to any network and without printer, virus protection and firewall. Thanks, Jos ----- Original Message ----- From: "Robby Findler" To: "Noel Welsh" Cc: Sent: Thursday, February 19, 2009 3:07 PM Subject: Re: [plt-scheme] Drscheme boost programs performance > The currently released version of DrScheme does not disable the JIT, > but it does add debugging annotations which have a significant > performance impact. (For non-teaching languages, this can be changed > in the language dialog.) > > Robby > > On Thu, Feb 19, 2009 at 7:53 AM, Noel Welsh wrote: >> Just a note: code running under DrScheme is slower than the same code >> running under MzScheme or MrEd. DrScheme disables the JIT, IIRC, so >> that it can report better error messages. Try your code in MrEd. >> >> N. >> >> On Thu, Feb 19, 2009 at 1:36 PM, Jesus Boadas wrote: >>> ... >>> network, I also get some UI demos and play with It, reading >>> documentation >>> and looking for some answers, but (IMHO) I get a slow feeling response >>> using >>> the UI aplications (like a feeling using a .NET application, no as bad >>> as >>> java-vm but slow than C/C++), ... >> _________________________________________________ >> 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 grettke at acm.org Thu Feb 19 12:01:50 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:42:05 2009 Subject: [plt-scheme] Drscheme boost programs performance In-Reply-To: References: <932b2f1f0902190607r76ff0481m9c681f13bcbd5f29@mail.gmail.com> Message-ID: <756daca50902190901q3b879b23s78ec017c98c07f29@mail.gmail.com> On Thu, Feb 19, 2009 at 8:53 AM, Jos Koot wrote: > I always run from DrScheme (usually debugging switched off and modules first compiled > with managed-compile-zo and debugging switched off) You do that for performance? From jay.mccarthy at gmail.com Thu Feb 19 12:58:10 2009 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:42:05 2009 Subject: [plt-scheme] xhtml generation In-Reply-To: <499C421A.6060505@synx.us.to> References: <499C421A.6060505@synx.us.to> Message-ID: I've just committed a documentation fix to SVN. Those 'pcdata's are supposed to be 'p-i's. Here's an example: #lang scheme (require xml) (define a-pi (make-p-i #f #f "foo" "bar")) (define a-p (make-prolog empty #f)) (define a-p/pi (make-prolog (list a-pi) #f)) (define a-d0 (make-document a-p (make-element #f #f 'html empty empty) empty)) (define a-d1 (make-document a-p (make-element #f #f 'html empty empty) (list a-pi))) (define a-d2 (make-document a-p/pi (make-element #f #f 'html empty empty) (list a-pi))) (display-xml a-d0) (display-xml a-d1) (display-xml a-d2) On Wed, Feb 18, 2009 at 12:15 PM, wrote: > I've been trying to understand xhtml and xml in general a bit better, > and was just poking around the xml module for ways to generate valid > documents. Figure I might include what I've done so far. Thanks to some > help from eli on Freenode it's working now. My goal's not so much to > have a system that cannot produce an invalid document, but to at least > have a system where it's possible to produce a valid document. > > One thing I'm still puzzling over is in the plt documentation, the > prolog and document's "misc" structures claim they can be both pcdata > and comments (though AFAIK only comments are allowed there), but pcdata > seems to error out when I use it in those fields. That's why the > pre-comments et al are checked to make sure they're all only comments. > > > #lang scheme > > (require xml) > > (define (create-document head body (pre-comments null) (post-comments null) (tail-comments null)) > (make-document > (apply > make-prolog > (cons (make-p-i #f #f "xml" "version=\"1.0\" encoding=\"UTF-8\"") pre-comments) > (make-document-type 'html (make-external-dtd/public > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" > "-//W3C//DTD XHTML 1.0 Strict//EN") #f) > post-comments) > (xexpr->xml > `(html ((lang "en") (xml:lang "en") (xmlns "http://www.w3.org/1999/xhtml")) > (head () ,head) > (body () ,body))) > tail-comments)) > > (define (only-comments? l) > (andmap comment? l)) > > (provide/contract > [create-document > (->* > (xexpr? xexpr?) (only-comments? only-comments? only-comments?) document?)]) > #lang scheme > (require "xhtml.ss") > (require xml) > > (display-xml (create-document '(title "beep") '(p () "content"))) > (display "\n---\n") > (display-xml (create-document > '(title "beep") '(p () "shmontent") > (list (make-comment "Beep") (make-comment "Beep2")) > (list (make-comment "Before the HTML")) > (list (make-comment "tail1") (make-comment "tail2")))) > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > -- Jay McCarthy Assistant Professor / Brigham Young University http://teammccarthy.org/jay "The glory of God is Intelligence" - D&C 93 From jos.koot at telefonica.net Thu Feb 19 13:21:15 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:42:05 2009 Subject: [plt-scheme] Drscheme boost programs performance References: <932b2f1f0902190607r76ff0481m9c681f13bcbd5f29@mail.gmail.com> <756daca50902190901q3b879b23s78ec017c98c07f29@mail.gmail.com> Message-ID: <6BEE69BDC4444CD6A524FA8C4FF046B6@uw2b2dff239c4d> Yes, the difference may be a factor of 2. Of course there are other languages to achieve greater performance, but as languages most perform less. Counting my own time too, (PLT) Scheme is in many cases faster than C or Fortran or Algol or Pascal. Jos ----- Original Message ----- From: "Grant Rettke" To: "Jos Koot" Cc: "Robby Findler" ; "Noel Welsh" ; Sent: Thursday, February 19, 2009 6:01 PM Subject: Re: [plt-scheme] Drscheme boost programs performance > On Thu, Feb 19, 2009 at 8:53 AM, Jos Koot wrote: >> I always run from DrScheme (usually debugging switched off and modules >> first compiled >> with managed-compile-zo and debugging switched off) > > You do that for performance? From jos.koot at telefonica.net Thu Feb 19 13:27:14 2009 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:42:06 2009 Subject: [plt-scheme] redex is great Message-ID: Lately I have played with redex. It is very nice. Although redex can be used for a bigger set of languages, I played with lambda calculus only, making procedures such as to find normal forms (if possible within a reasonable amount of steps), checking equality of terms modulo alpha congruence, currying of uncurried shorthand, and a predicate for equality of lambda terms (reflexive and transitive and symmetrized closure of beta and eta reduction) The last predicate is incomplete of course and I have made it to halt if no answer can be found within a reasonable number of steps. I have the pleasure to share my code with you. You can download it from: http://www.telefonica.net/web2/koot/rdx.scm Thanks to Robby Findler and the PLT team. Would it be possible to add a in-left-most-hole to the reduction rules of redex? (same as in-hole, but applying to the leftmost one only) May be I should try to add iyt myself? Jos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20090219/4413c7c1/attachment.htm From grettke at acm.org Thu Feb 19 14:37:33 2009 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:42:06 2009 Subject: [plt-scheme] 2004 Functional Objects presentation video? Message-ID: <756daca50902191137n6e8bb93mc1522c04f1b6ac86@mail.gmail.com> Is there a video for Matthias' 2004 Functional Objects presentation video? From robby at eecs.northwestern.edu Thu Feb 19 14:44:53 2009 From: robby at eecs.northwestern.edu (Robby Findler) Date: Thu Mar 26 02:42:06 2009 Subject: [plt-scheme] redex is great In-Reply-To: References: Message-ID: <932b2f1f0902191144o5d1de41n1e79d3c5df7f5ff9@mail.gmail.com> Thanks for the kind words, Jos. On Thu, Feb 19, 2009 at 12:27 PM, Jos Koot wrote: > Would it be possible to add a in-left-most-hole to the reduction rules of > redex? (same as in-hole, but applying to the leftmost one only) May be I > should try to add iyt myself? If I'm understanding correctly, I think the easiest thing would be to define a context like that and then just use it instead of adding something more general to Redex. Robby From grettke at acm.org Thu Feb 19 14:5