From noelwelsh at gmail.com Mon Sep 1 04:24:14 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:27:12 2009 Subject: [plt-scheme] Intended semantics of make-collection Message-ID: Hello, What is the intended semantics of make-collection? The docs read: "Builds bytecode files for each file in collection-files, writing each to a "compiled" subdirectory and automatically managing dependencies. Supply '#("zo") as argv to compile all files." I read this as meaning it does what mzc -k does, which is compile a file and all its dependencies (hence "automatically managing dependencies"). It doesn't, however, do this. Instead it compiles just the specified files and not their dependencies. My suspicion is that nobody used make-collection, as I just fixed a bug in it. The code still looks a bit hokey. For example, it creates a "compiled" directory, when this could be delegated to the compile-zos in compiler/compiler. Thanks, Noel From neil at neilvandyke.org Mon Sep 1 05:54:07 2008 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:27:15 2009 Subject: [plt-scheme] convenience for removing planet development links Message-ID: <48BBBBBF.7030902@neilvandyke.org> Does anyone already have a convenience for removing PLaneT development links to versions that are available in the PLaneT repository? The usage scenario I have in mind is: 1. Work on new versions of interconnected packages. In the process, create development links for the ultimate new version numbers of some, so that new versions of the other packages can |require| them. 2. Upload the new versions of some or all of the packages to PLaneT. 3. Type a command (say, |remove-obsolete-planet-development-links|, only catchier), which causes the development links for versions now in PLaneT to be removed. The motivations for automating the removal are both to avoid likely operator error and to avoid some hassle. Anyone already have a tool like this, or have a better way of doing it? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080901/7812e48d/attachment.html From neil at neilvandyke.org Mon Sep 1 06:13:59 2008 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:27:15 2009 Subject: [plt-scheme] reporting on planet packages and versions used by a set of collections & other tools Message-ID: <48BBC067.4000100@neilvandyke.org> If I have dozens of PLT collections that "require" various PLaneT packages, and would to know at any time which packages and versions are being used, does anyone have a tool to do that? One reason I might want to know this is so that I can see when some files are requiring older versions of packages than I am actually using for development. I might want to either make them require the versions I'm actually developing and testing with, or test with the old versions to be sure that they still work. (Which leads to my next tool wishlist item, which is automated help either for bumping the versions in "require" forms in lots of files, or for running test suites using all combinations of applicable PLaneT package versions.) -- http://www.neilvandyke.org/ From noelwelsh at gmail.com Mon Sep 1 07:14:34 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:27:15 2009 Subject: [plt-scheme] convenience for removing planet development links In-Reply-To: <48BBBBBF.7030902@neilvandyke.org> References: <48BBBBBF.7030902@neilvandyke.org> Message-ID: On Mon, Sep 1, 2008 at 10:54 AM, Neil Van Dyke wrote: > Does anyone already have a convenience for removing PLaneT development links > to versions that are available in the PLaneT repository? Attached might help. We shou.ld probably release it. N. From noelwelsh at gmail.com Mon Sep 1 07:47:04 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:27:15 2009 Subject: [plt-scheme] convenience for removing planet development links In-Reply-To: References: <48BBBBBF.7030902@neilvandyke.org> Message-ID: *ahem* --- README.txt --- ====== AUTOPLANET ====== by Dave Gurnell (dave at untyped dot com) This command line utility helps manage development links for PLaneT packages. Here's how you use it: 1. copy autoplanet.ss to ~/bin; 2. edit the first line to point to your MzScheme installation; 3. create a directory somewhere called something like "planetdev"; 4. populate this directory with suubdirectories for each development link you want to maintain, for example: planetdev/untyped/snooze.plt/1/5 planetdev/schematics/schemeunit.plt/4/5 (each directory has to be of the format owner/package.plt/major/minor) 5. run "autoplanet.ss planetdev" on the command line. Autoplanet will synchronize your PLaneT development links to the packages found in the planetdev directory. It will ask you to confirm the changes before it does anything. If you don't want to type in the name of "planetdev" all the time, you can set the $AUTOPLANET environment variable instead. ------- --- autoplanet.ss --- #!/usr/local/plt/bin/mzscheme #lang scheme/base (require scheme/match scheme/pretty planet/util srfi/1/list srfi/13/string srfi/26/cut) ; Regular expressions -------------------------- (define owner-regexp #rx"^[a-z]+$") (define package-regexp #rx"^[a-z-]+[.]plt$") (define major-regexp #rx"^[0-9]+$") (define minor-regexp #rx"^[0-9]+$") ; Utility procedures --------------------------- ;; system/output : string string ... -> string ;; ;; Executes a shell command and returns the content of standard out. ;; ;; Raises exn:fail if the command had a non-zero exit status. ;(define (system/output cmd . args) ; (define output (open-output-string)) ; (parameterize ([current-output-port output]) ; (if (apply system* cmd args) ; (begin0 (get-output-string output) ; (close-output-port output)) ; (begin (close-output-port output) ; (error "Command failed" cmd args))))) ;; accumulate-directories : complete-path (listof string) integer -> (list-of (listof string)) (define (accumulate-directories root relative depth) (define current (apply build-path root relative)) (cond [(not (directory-exists? current)) (error "Path is not a directory" current)] [(zero? depth) (list relative)] [else (fold (match-lambda* [(list (app path->string path) accum) `(,@accum ,@(accumulate-directories root `(,@relative ,path) (sub1 depth)))]) null (directory-list current))])) ;; directory->add-arguments : path (list string string string string) -> (list path string string null integer integer) (define directory->add-arguments (match-lambda* [(list root (list owner package major minor)) (cond [(not (regexp-match owner-regexp owner)) (error "Bad owner name in directory" owner package major minor)] [(not (regexp-match package-regexp package)) (error "Bad package name in directory" owner package major minor)] [(not (regexp-match major-regexp major)) (error "Bad major version number in directory" owner package major minor)] [(not (regexp-match minor-regexp minor)) (error "Bad minor version number in directory" owner package major minor)] [else (list owner package (string->number major) (string->number minor) (build-path root owner package major minor))])])) ;; hard-link-spec->remove-arguments : (list path string string null integer integer) -> (list string string integer integer) (define hard-link-spec->remove-arguments (match-lambda [(list _ owner package _ major minor) (list owner package major minor)])) ;; string string integer integer -> void (define (remove-hard-link* . args) (with-handlers ([exn? void]) (apply remove-hard-link args))) ; Main ----------------------------------------- ; argv : (vectorof string) (define argv (current-command-line-arguments)) ; root : complete-path (define root (cond [(not (zero? (vector-length argv))) (path->complete-path (build-path (vector-ref argv 0)))] [(getenv "AUTOPLANET") (path->complete-path (build-path (getenv "AUTOPLANET")))] [else (error "Please specify the root directory you wish to scan.")])) (unless (directory-exists? root) (error "The root you specified is not a directory:" (path->string root))) ;; remove-arguments : (listof (list string string integer integer)) (define remove-arguments (map hard-link-spec->remove-arguments (get-hard-linked-packages))) ;; add-arguments : (listof (list string string integer integer path)) (define add-arguments (map (cut directory->add-arguments root <>) (accumulate-directories root null 4))) (printf "===== AUTOPLANET =====~n") (printf "~nThe following development links will be removed:~n") (for-each (cut printf " ~s~n" <>) remove-arguments) (printf "~nThe following development links will be added:~n") (for-each (cut printf " ~s~n" <>) add-arguments) (printf "~nProceed [y/n]? ") (if (member (read-line) '("y" "yes" "Y" "YES" "Yes")) (begin (for-each (cut apply remove-hard-link* <>) remove-arguments) (for-each (cut apply add-hard-link <>) add-arguments) (printf "Done~n")) (begin (printf "Cancelled~n"))) ------ On Mon, Sep 1, 2008 at 12:14 PM, Noel Welsh wrote: > On Mon, Sep 1, 2008 at 10:54 AM, Neil Van Dyke wrote: >> Does anyone already have a convenience for removing PLaneT development links >> to versions that are available in the PLaneT repository? > > Attached might help. We shou.ld probably release it. > > N. > From robby at cs.uchicago.edu Mon Sep 1 08:02:16 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:15 2009 Subject: [plt-scheme] reporting on planet packages and versions used by a set of collections & other tools In-Reply-To: <48BBC067.4000100@neilvandyke.org> References: <48BBC067.4000100@neilvandyke.org> Message-ID: <932b2f1f0809010502s5a78759epca59ae98e533c1e8@mail.gmail.com> Does the module browser help with that at all? Robby On Mon, Sep 1, 2008 at 5:13 AM, Neil Van Dyke wrote: > If I have dozens of PLT collections that "require" various PLaneT packages, > and would to know at any time which packages and versions are being used, > does anyone have a tool to do that? > > One reason I might want to know this is so that I can see when some files > are requiring older versions of packages than I am actually using for > development. I might want to either make them require the versions I'm > actually developing and testing with, or test with the old versions to be > sure that they still work. > > (Which leads to my next tool wishlist item, which is automated help either > for bumping the versions in "require" forms in lots of files, or for running > test suites using all combinations of applicable PLaneT package versions.) > > -- > http://www.neilvandyke.org/ > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From noelwelsh at gmail.com Mon Sep 1 08:32:43 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:27:15 2009 Subject: [plt-scheme] reporting on planet packages and versions used by a set of collections & other tools In-Reply-To: <48BBC067.4000100@neilvandyke.org> References: <48BBC067.4000100@neilvandyke.org> Message-ID: On Mon, Sep 1, 2008 at 11:13 AM, Neil Van Dyke wrote: > If I have dozens of PLT collections that "require" various PLaneT packages, > and would to know at any time which packages and versions are being used, > does anyone have a tool to do that? Nope, but you can read the Planet cache to find out (tedious, but it works). > One reason I might want to know this is so that I can see when some files > are requiring older versions of packages than I am actually using for > development. I might want to either make them require the versions I'm > actually developing and testing with, or test with the old versions to be > sure that they still work. > > (Which leads to my next tool wishlist item, which is automated help either > for bumping the versions in "require" forms in lots of files, or for running > test suites using all combinations of applicable PLaneT package versions.) For a given Planet major version all minor versions should be the same, modulo bug fixes. So it is reasonable to test using only the latest minor version, as it should not differ in functionality, only correctness. N. From neil at neilvandyke.org Mon Sep 1 09:07:16 2008 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:27:16 2009 Subject: [plt-scheme] reporting on planet packages and versions used by a set of collections & other tools In-Reply-To: References: <48BBC067.4000100@neilvandyke.org> Message-ID: <48BBE904.3030507@neilvandyke.org> Noel Welsh wrote at 09/01/2008 08:32 AM: > For a given Planet major version all minor versions should be the > same, modulo bug fixes. So it is reasonable to test using only the > latest minor version, as it should not differ in functionality, only > correctness. > Agreed, *should*. You know I'm going to play devil's advocate here. :) Rarely do we actually prove that given changes are backward-compatible wrt a specification, and even more rarely do we prove that all the interactions among units rely only on specified behavior. By "rarely," I mean "never," for virtually everyone, including myself. Just within my own systems, I'd like to know whether my assertions of version compatibility are correct. Testing unit version combinations within my systems can inform me of reliance on unspecified behavior or of a non-backward-compatible change that was not caught in unit testing with the versions I happened to be using. Ideally, I would be informed before I submitted code to PLaneT that falsely claimed to be backward-compatible or that had overly liberal "require"'d versions. A fun project for an undergrad once there's a dense web of "require" relationships among PLaneT packages might be to brute-force test all the version combinations and see whether any new test failures fall out. Maybe not fun, but if it found a new defect, that might suggest they've found a useful new tool and/or a tangential benefit of PLaneT-like repositories. -- http://www.neilvandyke.org/ From neil at neilvandyke.org Mon Sep 1 09:10:28 2008 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:27:16 2009 Subject: [plt-scheme] convenience for removing planet development links In-Reply-To: References: <48BBBBBF.7030902@neilvandyke.org> Message-ID: <48BBE9C4.2020409@neilvandyke.org> Thanks, Noel and Dave. It's good to see that people like Untyped are making real-world use of PLaneT and rounding out the tools ahead of me. Noel Welsh wrote at 09/01/2008 07:47 AM: > ====== AUTOPLANET ====== > > From noelwelsh at gmail.com Mon Sep 1 10:12:23 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:27:16 2009 Subject: [plt-scheme] convenience for removing planet development links In-Reply-To: <48BBE9C4.2020409@neilvandyke.org> References: <48BBBBBF.7030902@neilvandyke.org> <48BBE9C4.2020409@neilvandyke.org> Message-ID: Speaking of tools, I'm working on a build system (i.e. another descendent of make) at the moment. It will ideally have functions to perform Planet packaging etc. Code is in Schematics under the sake directory, online at http://schematics.svn.sourceforge.net/ (website is really slow right now I haven't included the full URL). N. On Mon, Sep 1, 2008 at 2:10 PM, Neil Van Dyke wrote: > Thanks, Noel and Dave. It's good to see that people like Untyped are making > real-world use of PLaneT and rounding out the tools ahead of me. > > > Noel Welsh wrote at 09/01/2008 07:47 AM: >> >> ====== AUTOPLANET ====== >> >> > > From goetter at mazama.net Mon Sep 1 13:03:55 2008 From: goetter at mazama.net (Ben Goetter) Date: Thu Mar 26 02:27:16 2009 Subject: [plt-scheme] Building mred 3m with VS2008 Message-ID: <48BC207B.3090601@mazama.net> I'm building PLT Scheme with Microsoft Visual Studio 2008 ("VS2008" hereafter), or rather working toward same, but have hit a snag during the 3m build process. The transformation that decorates C++ source with 3m GC information is choking on function calls in the global namespace, e.g. ::ReleaseDC(), emitting the diagnostic Error [DECL] in : Variable declaration (:: () not at the beginning of a block. This message originates from collects/compiler/private/xform.ss, line 2680 or so, and it's calling double-colon a type, left-paren a var. The token sequence that provokes this looks like tok :: tok ReleaseDC parens ( tok ; tok DELETE parens ( tok ; Removing the global namespace qualifier from function calls in files such as wxwindow/src/base/wb_print.cxx lets xform proceed with its business as usual. However, I'm a little baffled as to how VS2008 could be provoking this behavior. Presumably something from the preprocessor pass in the preceding token stream has sent xform to a place where ordinarily it would not go. Any ideas? Also, once I get this build working, may I submit it as a patch against the official sources? How would you like it packaged? From zhe at cs.brown.edu Mon Sep 1 15:47:32 2008 From: zhe at cs.brown.edu (Zhe Zhang) Date: Thu Mar 26 02:27:17 2009 Subject: [plt-scheme] Using MzTake in PLT Scheme 4.1 Message-ID: <4413ee4f0809011247m2a6bdec4n3e69aa04a94128dc@mail.gmail.com> Hi Do you know where i can find the MzTake that can be installed on PLT Scheme 4.1? It seems mztake-208.plt couldn't be installed on PLT Scheme 4.1. Thanks zhe -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080901/4c3acacc/attachment.htm From ghcooper at gmail.com Mon Sep 1 16:15:17 2008 From: ghcooper at gmail.com (Gregory Cooper) Date: Thu Mar 26 02:27:17 2009 Subject: [plt-scheme] Using MzTake in PLT Scheme 4.1 In-Reply-To: <4413ee4f0809011247m2a6bdec4n3e69aa04a94128dc@mail.gmail.com> References: <4413ee4f0809011247m2a6bdec4n3e69aa04a94128dc@mail.gmail.com> Message-ID: <65e1d50c0809011315u11bb9a48t22b005bd1d755739@mail.gmail.com> Hi Zhe, As far as I know, no one has been developing or using MzTake for at least two years, so it was removed from the distribution about six months ago. I would recommend checking out from subversion at around r8500; if that works, it should be easier to update it to run under v4.1. Regards, Greg On Mon, Sep 1, 2008 at 3:47 PM, Zhe Zhang wrote: > Hi > > Do you know where i can find the MzTake that can be installed on PLT Scheme > 4.1? It seems mztake-208.plt couldn't be installed on PLT Scheme 4.1. > > Thanks > > zhe > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From mflatt at cs.utah.edu Mon Sep 1 18:39:10 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:27:17 2009 Subject: [plt-scheme] Building mred 3m with VS2008 In-Reply-To: <48BC207B.3090601@mazama.net> References: <48BC207B.3090601@mazama.net> Message-ID: <20080901223912.22BBD65009C@mail-svr1.cs.utah.edu> At Mon, 01 Sep 2008 10:03:55 -0700, Ben Goetter wrote: > I'm building PLT Scheme with Microsoft Visual Studio 2008 ("VS2008" > hereafter), or rather working toward same, but have hit a snag during > the 3m build process. The transformation that decorates C++ source > with 3m GC information is choking on function calls in the global > namespace, e.g. ::ReleaseDC(), emitting the diagnostic > > Error [DECL] in : Variable declaration (:: () not at the > beginning of a block. > > This message originates from collects/compiler/private/xform.ss, line > 2680 or so, and it's calling double-colon a type, left-paren a var. The > token sequence that provokes this looks like > > tok :: > tok ReleaseDC > parens ( > tok ; > tok DELETE > parens ( > tok ; > > Removing the global namespace qualifier from function calls in files > such as wxwindow/src/base/wb_print.cxx lets xform proceed with its > business as usual. However, I'm a little baffled as to how VS2008 could > be provoking this behavior. Presumably something from the preprocessor > pass in the preceding token stream has sent xform to a place where > ordinarily it would not go. Any ideas? > > Also, once I get this build working, may I submit it as a patch against > the official sources? How would you like it packaged? I'm puzzled too. I guess mzschemecgc (as compiled by VS2008) is working correctly otherwise? Is it possible to drop in a "mzschemecgc.exe" from the nightly build to check that the 3m-creating "make.ss" program still fails in the same way (i.e., it's not just that mzschemecgc is somehow broken)? A diff that I can apply with `patch' is the best way to submit patches. Matthew From robby at cs.uchicago.edu Tue Sep 2 08:53:26 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:17 2009 Subject: [plt-scheme] planet: help submitting bugs & a question Message-ID: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> New feature: In the latest (SVN) version of DrScheme (not yet in the nightly builds), you will see a little blue icon next to a contract violation error message that blames a planet package. Click it and you will be taken to the ticket submission web page with a number of the fields filled in, extracted from the bug report. ---Question: Drscheme could also log these contract violations, anonymize them[*] and periodically submit them as tickets to trac by itself. Is that something that people would appreciate? Or would such an automatic submission be a privacy problem (or some other kind of problem)? Thanks, Robby [*] it could remove any values that triggered the error from them error message so that functions that, say, accept credit card numbers as their arguments wouldn't trigger credit card information being sent in the bug report. From noelwelsh at gmail.com Tue Sep 2 09:04:24 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:27:17 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> Message-ID: On Tue, Sep 2, 2008 at 1:53 PM, Robby Findler wrote: > Drscheme could also log these contract violations, anonymize them[*] > and periodically submit them as tickets to trac by itself. Is that > something that people would appreciate? Or would such an automatic > submission be a privacy problem (or some other kind of problem)? I think it would be very useful for developing statistics of software quality. I'm not sure if Trac tickets are the best way to log these, however. I can see a huge number of tickets being submitted. N. From cce at ccs.neu.edu Tue Sep 2 09:12:07 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:27:17 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> Message-ID: <990e0c030809020612i330d0825k51e46c45c5fc12fd@mail.gmail.com> On Tue, Sep 2, 2008 at 8:53 AM, Robby Findler wrote: > > Drscheme could also log these contract violations, anonymize them[*] > and periodically submit them as tickets to trac by itself. Is that > something that people would appreciate? Or would such an automatic > submission be a privacy problem (or some other kind of problem)? > > Thanks, > Robby > > [*] it could remove any values that triggered the error from them > error message so that functions that, say, accept credit card numbers > as their arguments wouldn't trigger credit card information being sent > in the bug report. It would be hard to remove the values that triggered the error without cutting off most of the useful error message information... for instance, if your password checking function had the contract: (-> (matching-password/c your-code) your-sensitive-data/c), just the name of the input contract might be formatted with your-code in it. The contract itself would have to be taken out, leaving not much information. Also, would development links and fileinjected local packages, never intended for distribution, be properly left out of this mechanism? -- Carl Eastlund From neil at neilvandyke.org Tue Sep 2 09:13:30 2008 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:27:18 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> Message-ID: <48BD3BFA.3000608@neilvandyke.org> That sounds like a neat usability/quality feature. Will it also drive home another dynamic of contracts? I might be misunderstanding, but, if code in package B accepts invalid input from package A and passes it through to package C, will the developer of package B then be getting annoying bug reports until s/he adds contracts to put the blame on package A (or input checks to error-out before a contract violation happens)? Regarding whether DrScheme anonymously submitting bug reports on contract violations reports raises privacy or sensitive-information issues, I think in some cases it would. I think there should definitely be user confirmation in the loop on each such submission. This is mostly a matter of principle regarding PLT, since I doubt anyone's dotcom will be scooped or marriage ruined because someone else noticed suspicious patterns in contract violations. However, pervasively handling info privacy/security well is a good practice, and might even occasionally pose an important question relevant to PLT research. -- http://www.neilvandyke.org/ From robby at cs.uchicago.edu Tue Sep 2 09:14:27 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:18 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <990e0c030809020612i330d0825k51e46c45c5fc12fd@mail.gmail.com> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> <990e0c030809020612i330d0825k51e46c45c5fc12fd@mail.gmail.com> Message-ID: <932b2f1f0809020614v1d195e93xab66214ca5c47b48@mail.gmail.com> On Tue, Sep 2, 2008 at 8:12 AM, Carl Eastlund wrote: > On Tue, Sep 2, 2008 at 8:53 AM, Robby Findler wrote: >> >> Drscheme could also log these contract violations, anonymize them[*] >> and periodically submit them as tickets to trac by itself. Is that >> something that people would appreciate? Or would such an automatic >> submission be a privacy problem (or some other kind of problem)? >> >> Thanks, >> Robby >> >> [*] it could remove any values that triggered the error from them >> error message so that functions that, say, accept credit card numbers >> as their arguments wouldn't trigger credit card information being sent >> in the bug report. > > It would be hard to remove the values that triggered the error without > cutting off most of the useful error message information... for > instance, if your password checking function had the contract: > (-> (matching-password/c your-code) your-sensitive-data/c), > just the name of the input contract might be formatted with your-code > in it. The contract itself would have to be taken out, leaving not > much information. I wouldn't anonymize that part, no. I also wouldn't anonymize the stacktrace, so if you named a function with your credit card information, you'd also be in trouble. > Also, would development links and fileinjected local packages, never > intended for distribution, be properly left out of this mechanism? Yes (altho the new bug link currently sends you to the tract ticket submission page, even for development links, I believe). Robby From robby at cs.uchicago.edu Tue Sep 2 09:16:43 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:18 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <48BD3BFA.3000608@neilvandyke.org> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> <48BD3BFA.3000608@neilvandyke.org> Message-ID: <932b2f1f0809020616y46d2b486w4577c2581716cb0e@mail.gmail.com> On Tue, Sep 2, 2008 at 8:13 AM, Neil Van Dyke wrote: > That sounds like a neat usability/quality feature. > > Will it also drive home another dynamic of contracts? I might be > misunderstanding, but, if code in package B accepts invalid input from > package A and passes it through to package C, will the developer of package > B then be getting annoying bug reports until s/he adds contracts to put the > blame on package A (or input checks to error-out before a contract violation > happens)? No, contracts will continue to work properly. :) But if you have a confusing example, please do let me know (the example doesn't have to involve planet, of course -- the contract is mostly planet agnostic; it just puts a link in at the very end if the blame ends up on a planet source file). > Regarding whether DrScheme anonymously submitting bug reports on contract > violations reports raises privacy or sensitive-information issues, I think > in some cases it would. I think there should definitely be user > confirmation in the loop on each such submission. This is mostly a matter > of principle regarding PLT, since I doubt anyone's dotcom will be scooped or > marriage ruined because someone else noticed suspicious patterns in contract > violations. However, pervasively handling info privacy/security well is a > good practice, and might even occasionally pose an important question > relevant to PLT research. Right. One could imagine a command "planet send-collected-info" or somesuch, but I suspect that that would not get used much. Robby From neil at neilvandyke.org Tue Sep 2 09:28:12 2008 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:27:18 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <932b2f1f0809020616y46d2b486w4577c2581716cb0e@mail.gmail.com> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> <48BD3BFA.3000608@neilvandyke.org> <932b2f1f0809020616y46d2b486w4577c2581716cb0e@mail.gmail.com> Message-ID: <48BD3F6C.30709@neilvandyke.org> An animated paperclip in DrScheme asking if you want to submit that info would probably not go over well either. :) If there were a way to periodically have the documentation browser add an unobtrusive banner or sidebar box to the page, suggesting click here to inspect&submit the info", that might work. I think people would be more tolerant of this than of popup or fringe bar appearing in the DrScheme interface while they're trying to work. Or, if email sending from tools works, DrScheme could periodically send email to its user, providing a button to click to inspect&submit the info to submit. This emailling by tools used to be used to some good effect on Unix workstations, but email no longer works as well as it used to, so I like the idea of adding to the documentation browser better. Robby Findler wrote at 09/02/2008 09:16 AM: > One could imagine a command "planet send-collected-info" or somesuch, > but I suspect that that would not get used much. > From grettke at acm.org Tue Sep 2 09:37:51 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:18 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> Message-ID: <756daca50809020637t7a8d7cd1h8cfbebd7c781b690@mail.gmail.com> On Tue, Sep 2, 2008 at 7:53 AM, Robby Findler wrote: > Drscheme could also log these contract violations, anonymize them[*] > and periodically submit them as tickets to trac by itself. Is that > something that people would appreciate? Or would such an automatic > submission be a privacy problem (or some other kind of problem)? That sounds pretty neat. Rather than worrying about anonymizing data, you could allow PLaneT packages to include a public key provided by the author. Encrypt the whole enchilada that gets sent to trac. If the package maintainer wants to make the details public, he can decrypt it and append it to trac message. That way there are two options: insecure and secure, make it the maintainers choice and default to insecure. From robby at cs.uchicago.edu Tue Sep 2 09:44:15 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:19 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <756daca50809020637t7a8d7cd1h8cfbebd7c781b690@mail.gmail.com> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> <756daca50809020637t7a8d7cd1h8cfbebd7c781b690@mail.gmail.com> Message-ID: <932b2f1f0809020644o7d3b7484oe9b4b891d612b59e@mail.gmail.com> On Tue, Sep 2, 2008 at 8:37 AM, Grant Rettke wrote: > On Tue, Sep 2, 2008 at 7:53 AM, Robby Findler wrote: >> Drscheme could also log these contract violations, anonymize them[*] >> and periodically submit them as tickets to trac by itself. Is that >> something that people would appreciate? Or would such an automatic >> submission be a privacy problem (or some other kind of problem)? > > That sounds pretty neat. > > Rather than worrying about anonymizing data, you could allow PLaneT > packages to include a public key provided by the author. Encrypt the > whole enchilada that gets sent to trac. If the package maintainer > wants to make the details public, he can decrypt it and append it to > trac message. That way there are two options: insecure and secure, > make it the maintainers choice and default to insecure. Well, the user of the package is the one who could be divulging information, not the package author. Robby From cce at ccs.neu.edu Tue Sep 2 09:45:45 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:27:19 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <932b2f1f0809020614v1d195e93xab66214ca5c47b48@mail.gmail.com> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> <990e0c030809020612i330d0825k51e46c45c5fc12fd@mail.gmail.com> <932b2f1f0809020614v1d195e93xab66214ca5c47b48@mail.gmail.com> Message-ID: <990e0c030809020645qf00612ax2b7b61ed1e2ebf16@mail.gmail.com> On Tue, Sep 2, 2008 at 9:14 AM, Robby Findler wrote: > On Tue, Sep 2, 2008 at 8:12 AM, Carl Eastlund wrote: >> >> It would be hard to remove the values that triggered the error without >> cutting off most of the useful error message information... for >> instance, if your password checking function had the contract: >> (-> (matching-password/c your-code) your-sensitive-data/c), >> just the name of the input contract might be formatted with your-code >> in it. The contract itself would have to be taken out, leaving not >> much information. > > I wouldn't anonymize that part, no. I also wouldn't anonymize the > stacktrace, so if you named a function with your credit card > information, you'd also be in trouble. I'd also be in trouble if someone else named a contract or function with my credit card information. But the contract is more likely -- function names tend to be static, but contracts can be named dynamically; for instance, a >=/c inside an ->d will include its argument in its name. Not that a lot of Planet code is dealing with credit card information these days, but personally I prefer an application to ask me before sending data back, and let me see the data to decide. Saving it up and sending it off without asking is just looking for trouble. Planet code -- some of it anyway -- is licensed such that it can be used in proprietary applications. If we really mean for people to use it this way, I'm not sure we have the right to start arbitrarily downloading users' data. --Carl From robby at cs.uchicago.edu Tue Sep 2 09:48:07 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:19 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <990e0c030809020645qf00612ax2b7b61ed1e2ebf16@mail.gmail.com> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> <990e0c030809020612i330d0825k51e46c45c5fc12fd@mail.gmail.com> <932b2f1f0809020614v1d195e93xab66214ca5c47b48@mail.gmail.com> <990e0c030809020645qf00612ax2b7b61ed1e2ebf16@mail.gmail.com> Message-ID: <932b2f1f0809020648o57d9832cx93dc5dc2c193a51c@mail.gmail.com> Yes, some form of confirmation from the submitter is probably going to be required. That seems to be the consensus. Robby On Tue, Sep 2, 2008 at 8:45 AM, Carl Eastlund wrote: > On Tue, Sep 2, 2008 at 9:14 AM, Robby Findler wrote: >> On Tue, Sep 2, 2008 at 8:12 AM, Carl Eastlund wrote: >>> >>> It would be hard to remove the values that triggered the error without >>> cutting off most of the useful error message information... for >>> instance, if your password checking function had the contract: >>> (-> (matching-password/c your-code) your-sensitive-data/c), >>> just the name of the input contract might be formatted with your-code >>> in it. The contract itself would have to be taken out, leaving not >>> much information. >> >> I wouldn't anonymize that part, no. I also wouldn't anonymize the >> stacktrace, so if you named a function with your credit card >> information, you'd also be in trouble. > > I'd also be in trouble if someone else named a contract or function > with my credit card information. But the contract is more likely -- > function names tend to be static, but contracts can be named > dynamically; for instance, a >=/c inside an ->d will include its > argument in its name. Not that a lot of Planet code is dealing with > credit card information these days, but personally I prefer an > application to ask me before sending data back, and let me see the > data to decide. Saving it up and sending it off without asking is > just looking for trouble. > > Planet code -- some of it anyway -- is licensed such that it can be > used in proprietary applications. If we really mean for people to use > it this way, I'm not sure we have the right to start arbitrarily > downloading users' data. > > --Carl > > From matthias at ccs.neu.edu Tue Sep 2 09:56:57 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:27:19 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <932b2f1f0809020616y46d2b486w4577c2581716cb0e@mail.gmail.com> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> <48BD3BFA.3000608@neilvandyke.org> <932b2f1f0809020616y46d2b486w4577c2581716cb0e@mail.gmail.com> Message-ID: <5CF8DF6B-11AC-4761-85BD-3E5459D937EB@ccs.neu.edu> On Sep 2, 2008, at 9:16 AM, Robby Findler wrote: >> >> Will it also drive home another dynamic of contracts? I might be >> misunderstanding, but, if code in package B accepts invalid input >> from >> package A and passes it through to package C, will the developer >> of package >> B then be getting annoying bug reports until s/he adds contracts >> to put the >> blame on package A (or input checks to error-out before a contract >> violation >> happens)? > > No, contracts will continue to work properly. :) Neil, let me try to clarify this answer. Short: Yes, package B will be blamed for calling C's functions with bad inputs. If the author of B doesn't want to be blamed for such things, his package needs contracts that defend B against A. Long: This is in a sense the goal of the effort. Our hypothesis is that contract-blame is viral. It used properly, it leads to defensive efforts at the right level. As Meyer pointed out, defensive programming per se is bad. It obscures the interface of methods and functions. Defensive contracting, however, is a good idea. It explicates what functions and methods are able to consume and what they can't cope with it at the level that 3rd party developers must understand to use a package. -- Matthias From grettke at acm.org Tue Sep 2 09:58:48 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:19 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <932b2f1f0809020644o7d3b7484oe9b4b891d612b59e@mail.gmail.com> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> <756daca50809020637t7a8d7cd1h8cfbebd7c781b690@mail.gmail.com> <932b2f1f0809020644o7d3b7484oe9b4b891d612b59e@mail.gmail.com> Message-ID: <756daca50809020658m2bfe9acepffa55222b40f4743@mail.gmail.com> On Tue, Sep 2, 2008 at 8:44 AM, Robby Findler wrote: > On Tue, Sep 2, 2008 at 8:37 AM, Grant Rettke wrote: >> Rather than worrying about anonymizing data, you could allow PLaneT >> packages to include a public key provided by the author. Encrypt the >> whole enchilada that gets sent to trac. > Well, the user of the package is the one who could be divulging > information, not the package author. How else then would you submit accurate bug reports to the package maintainer? As I type this, I suppose the goal is not to do that, it is only to report contract violations. The notion of asking the user (non-programmer) whether they want to submit details regarding contract violations is unrealistic. How would a user know what they should and they should not send when a contract is violated? It would be confusing. From icfp.publicity at googlemail.com Tue Sep 2 10:06:08 2008 From: icfp.publicity at googlemail.com (Matthew Fluet (ICFP Publicity Chair)) Date: Thu Mar 26 02:27:19 2009 Subject: [plt-scheme] ICFP09 Announcement Message-ID: <53ff55480809020706h5064c2f8wbe3a69a2c571b0bb@mail.gmail.com> +--------------------------------------------------------------------+ ANNOUNCEMENT The 14th ACM SIGPLAN International Conference on Functional Programming ICFP 2009 31st August - 2nd September 2009 Edinburgh, United Kingdom ICFP provides a forum for researchers and developers to hear about the latest work on the design, implementations, principles, and uses of functional programming. ICFP 2009 will be held in Scotland's historic capital city of Edinburgh, during the final week of the Edinburgh International Festival. Further information is available from: http://www.cs.nott.ac.uk/~gmh/icfp09.html Graham Hutton General Chair, ICFP 2009 +--------------------------------------------------------------------+ | Dr Graham Hutton Email : gmh@cs.nott.ac.uk | | Functional Programming Lab | | School of Computer Science Web : www.cs.nott.ac.uk/~gmh | | University of Nottingham | | Jubilee Campus, Wollaton Road Phone : +44 (0)115 951 4220 | | Nottingham NG8 1BB, UK | +--------------------------------------------------------------------+ From robby at cs.uchicago.edu Tue Sep 2 10:08:15 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:20 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <756daca50809020658m2bfe9acepffa55222b40f4743@mail.gmail.com> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> <756daca50809020637t7a8d7cd1h8cfbebd7c781b690@mail.gmail.com> <932b2f1f0809020644o7d3b7484oe9b4b891d612b59e@mail.gmail.com> <756daca50809020658m2bfe9acepffa55222b40f4743@mail.gmail.com> Message-ID: <932b2f1f0809020708y39bfbfc1we1416d6c1bd70156@mail.gmail.com> On Tue, Sep 2, 2008 at 8:58 AM, Grant Rettke wrote: > On Tue, Sep 2, 2008 at 8:44 AM, Robby Findler wrote: >> On Tue, Sep 2, 2008 at 8:37 AM, Grant Rettke wrote: >>> Rather than worrying about anonymizing data, you could allow PLaneT >>> packages to include a public key provided by the author. Encrypt the >>> whole enchilada that gets sent to trac. > >> Well, the user of the package is the one who could be divulging >> information, not the package author. > > How else then would you submit accurate bug reports to the package > maintainer? As I type this, I suppose the goal is not to do that, it > is only to report contract violations. > > The notion of asking the user (non-programmer) whether they want to > submit details regarding contract violations is unrealistic. > > How would a user know what they should and they should not send when a > contract is violated? It would be confusing. I'm sorry -- we seem to be miscommunicating. When I wrote "user" I meant the user of the planet package (a programmer), not an end user of the software. I think that encrypting things in the manner you suggest would help protect the author of the planet package, but it is not (always) this person that needs protection. Instead, it is the programmer who is using the plant package. Altho proper blame assignment (like we have!) suggests that in many cases the values that end up in the bug report will be values that originate with the planet package being blamed, that is not always the case. For example, imagine I wrote a function like this: parse-cc-number : (-> string (between/c 0 (expt 2 32))) ;; accepts the contents of a form and returns a creditcard number string ;; removes intermediate spaces and checks well-formedness and packaged it up via planet. The contract on the range is broken, so when you first use it, this will produce a contract violation that includes the properly parsed credit card number but will be sent to my package and thus encrypted with my key, not with the credit card author's key. Does that make more sense? Robby From cce at ccs.neu.edu Tue Sep 2 10:15:48 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:27:20 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <932b2f1f0809020708y39bfbfc1we1416d6c1bd70156@mail.gmail.com> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> <756daca50809020637t7a8d7cd1h8cfbebd7c781b690@mail.gmail.com> <932b2f1f0809020644o7d3b7484oe9b4b891d612b59e@mail.gmail.com> <756daca50809020658m2bfe9acepffa55222b40f4743@mail.gmail.com> <932b2f1f0809020708y39bfbfc1we1416d6c1bd70156@mail.gmail.com> Message-ID: <990e0c030809020715u29bc8da5pbf31140cd8ffa645@mail.gmail.com> On Tue, Sep 2, 2008 at 10:08 AM, Robby Findler wrote: > On Tue, Sep 2, 2008 at 8:58 AM, Grant Rettke wrote: >> >> How would a user know what they should and they should not send when a >> contract is violated? It would be confusing. > > I'm sorry -- we seem to be miscommunicating. > > When I wrote "user" I meant the user of the planet package (a > programmer), not an end user of the software. Wait... I think it is the end user who matters. If Albert writes an encryption routine, and Bob uses it to write an online store, and Curt tries to buy something and it hits a bug, we should ask Curt if he wants to send the error report so he can say "no, don't send any data, I just typed my credit card number in". We don't want to send Curt's credit information to Bob and ask him if Al can have it; Bob shouldn't have it to begin with. Curt doesn't have to know any technical details, he just needs to know whether or not the application involved had any private data. Any time a program crashes in Windows or Mac OS, I get asked if I want to send the bug report to Microsoft or Apple respectively, and it's not like the OS knows I'm a programmer. The same principle applies to Planet and PLT. --Carl From robby at cs.uchicago.edu Tue Sep 2 10:17:30 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:20 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <990e0c030809020715u29bc8da5pbf31140cd8ffa645@mail.gmail.com> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> <756daca50809020637t7a8d7cd1h8cfbebd7c781b690@mail.gmail.com> <932b2f1f0809020644o7d3b7484oe9b4b891d612b59e@mail.gmail.com> <756daca50809020658m2bfe9acepffa55222b40f4743@mail.gmail.com> <932b2f1f0809020708y39bfbfc1we1416d6c1bd70156@mail.gmail.com> <990e0c030809020715u29bc8da5pbf31140cd8ffa645@mail.gmail.com> Message-ID: <932b2f1f0809020717q6d30594ep265851def89d6f8c@mail.gmail.com> Yes, yes. All along: the person who gets the error message gets to decide to submit it. Are we not all saying the same thing? Robby On Tue, Sep 2, 2008 at 9:15 AM, Carl Eastlund wrote: > On Tue, Sep 2, 2008 at 10:08 AM, Robby Findler wrote: >> On Tue, Sep 2, 2008 at 8:58 AM, Grant Rettke wrote: >>> >>> How would a user know what they should and they should not send when a >>> contract is violated? It would be confusing. >> >> I'm sorry -- we seem to be miscommunicating. >> >> When I wrote "user" I meant the user of the planet package (a >> programmer), not an end user of the software. > > Wait... I think it is the end user who matters. If Albert writes an > encryption routine, and Bob uses it to write an online store, and Curt > tries to buy something and it hits a bug, we should ask Curt if he > wants to send the error report so he can say "no, don't send any data, > I just typed my credit card number in". We don't want to send Curt's > credit information to Bob and ask him if Al can have it; Bob shouldn't > have it to begin with. > > Curt doesn't have to know any technical details, he just needs to know > whether or not the application involved had any private data. Any > time a program crashes in Windows or Mac OS, I get asked if I want to > send the bug report to Microsoft or Apple respectively, and it's not > like the OS knows I'm a programmer. The same principle applies to > Planet and PLT. > > --Carl > > From pltscheme at pnkfx.org Tue Sep 2 10:23:27 2008 From: pltscheme at pnkfx.org (Felix Klock's PLT scheme proxy) Date: Thu Mar 26 02:27:20 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <932b2f1f0809020717q6d30594ep265851def89d6f8c@mail.gmail.com> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> <756daca50809020637t7a8d7cd1h8cfbebd7c781b690@mail.gmail.com> <932b2f1f0809020644o7d3b7484oe9b4b891d612b59e@mail.gmail.com> <756daca50809020658m2bfe9acepffa55222b40f4743@mail.gmail.com> <932b2f1f0809020708y39bfbfc1we1416d6c1bd70156@mail.gmail.com> <990e0c030809020715u29bc8da5pbf31140cd8ffa645@mail.gmail.com> <932b2f1f0809020717q6d30594ep265851def89d6f8c@mail.gmail.com> Message-ID: <09DADED3-B2A5-427F-A9C6-4125E6255626@pnkfx.org> Robby: "I meant the user of the planet package (a programmer), not an end user of the software." Carl: "it is the end user who matters ... Any time a program crashes in Windows or Mac OS, I get asked if I want to send the bug report to Microsoft or Apple respectively, and it's not like the OS knows I'm a programmer" Robby: "Are we not all saying the same thing?" I think you two definitely are *not* saying the same thing. (All of the above quotes appear in context below.) -Felix, (who agrees with Carl, for the record) On Sep 2, 2008, at 10:17 AM, Robby Findler wrote: > Yes, yes. All along: the person who gets the error message gets to > decide to submit it. Are we not all saying the same thing? > > Robby > > On Tue, Sep 2, 2008 at 9:15 AM, Carl Eastlund wrote: >> On Tue, Sep 2, 2008 at 10:08 AM, Robby Findler >> wrote: >>> On Tue, Sep 2, 2008 at 8:58 AM, Grant Rettke >>> wrote: >>>> >>>> How would a user know what they should and they should not send >>>> when a >>>> contract is violated? It would be confusing. >>> >>> I'm sorry -- we seem to be miscommunicating. >>> >>> When I wrote "user" I meant the user of the planet package (a >>> programmer), not an end user of the software. >> >> Wait... I think it is the end user who matters. If Albert writes an >> encryption routine, and Bob uses it to write an online store, and >> Curt >> tries to buy something and it hits a bug, we should ask Curt if he >> wants to send the error report so he can say "no, don't send any >> data, >> I just typed my credit card number in". We don't want to send Curt's >> credit information to Bob and ask him if Al can have it; Bob >> shouldn't >> have it to begin with. >> >> Curt doesn't have to know any technical details, he just needs to >> know >> whether or not the application involved had any private data. Any >> time a program crashes in Windows or Mac OS, I get asked if I want to >> send the bug report to Microsoft or Apple respectively, and it's not >> like the OS knows I'm a programmer. The same principle applies to >> Planet and PLT. >> >> --Carl >> >> > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From robby at cs.uchicago.edu Tue Sep 2 10:30:16 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:20 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <09DADED3-B2A5-427F-A9C6-4125E6255626@pnkfx.org> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> <756daca50809020637t7a8d7cd1h8cfbebd7c781b690@mail.gmail.com> <932b2f1f0809020644o7d3b7484oe9b4b891d612b59e@mail.gmail.com> <756daca50809020658m2bfe9acepffa55222b40f4743@mail.gmail.com> <932b2f1f0809020708y39bfbfc1we1416d6c1bd70156@mail.gmail.com> <990e0c030809020715u29bc8da5pbf31140cd8ffa645@mail.gmail.com> <932b2f1f0809020717q6d30594ep265851def89d6f8c@mail.gmail.com> <09DADED3-B2A5-427F-A9C6-4125E6255626@pnkfx.org> Message-ID: <932b2f1f0809020730n4bc7a3bfmabd7536ba730b19c@mail.gmail.com> I can see how what I wrote was perhaps unclear. I meant the person whose machine actually has the contract violation. Carl also seems to mean that. Clear now? Robby On Tue, Sep 2, 2008 at 9:23 AM, Felix Klock's PLT scheme proxy wrote: > Robby: "I meant the user of the planet package (a programmer), not an end > user of the software." > > Carl: "it is the end user who matters ... Any time a program crashes in > Windows or Mac OS, I get asked if I want to send the bug report to Microsoft > or Apple respectively, and it's not like the OS knows I'm a programmer" > > Robby: "Are we not all saying the same thing?" > > I think you two definitely are *not* saying the same thing. (All of the > above quotes appear in context below.) > > -Felix, (who agrees with Carl, for the record) > > On Sep 2, 2008, at 10:17 AM, Robby Findler wrote: > >> Yes, yes. All along: the person who gets the error message gets to >> decide to submit it. Are we not all saying the same thing? >> >> Robby >> >> On Tue, Sep 2, 2008 at 9:15 AM, Carl Eastlund wrote: >>> >>> On Tue, Sep 2, 2008 at 10:08 AM, Robby Findler >>> wrote: >>>> >>>> On Tue, Sep 2, 2008 at 8:58 AM, Grant Rettke wrote: >>>>> >>>>> How would a user know what they should and they should not send when a >>>>> contract is violated? It would be confusing. >>>> >>>> I'm sorry -- we seem to be miscommunicating. >>>> >>>> When I wrote "user" I meant the user of the planet package (a >>>> programmer), not an end user of the software. >>> >>> Wait... I think it is the end user who matters. If Albert writes an >>> encryption routine, and Bob uses it to write an online store, and Curt >>> tries to buy something and it hits a bug, we should ask Curt if he >>> wants to send the error report so he can say "no, don't send any data, >>> I just typed my credit card number in". We don't want to send Curt's >>> credit information to Bob and ask him if Al can have it; Bob shouldn't >>> have it to begin with. >>> >>> Curt doesn't have to know any technical details, he just needs to know >>> whether or not the application involved had any private data. Any >>> time a program crashes in Windows or Mac OS, I get asked if I want to >>> send the bug report to Microsoft or Apple respectively, and it's not >>> like the OS knows I'm a programmer. The same principle applies to >>> Planet and PLT. >>> >>> --Carl >>> >>> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > > From cce at ccs.neu.edu Tue Sep 2 12:13:12 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:27:20 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <932b2f1f0809020730n4bc7a3bfmabd7536ba730b19c@mail.gmail.com> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> <756daca50809020637t7a8d7cd1h8cfbebd7c781b690@mail.gmail.com> <932b2f1f0809020644o7d3b7484oe9b4b891d612b59e@mail.gmail.com> <756daca50809020658m2bfe9acepffa55222b40f4743@mail.gmail.com> <932b2f1f0809020708y39bfbfc1we1416d6c1bd70156@mail.gmail.com> <990e0c030809020715u29bc8da5pbf31140cd8ffa645@mail.gmail.com> <932b2f1f0809020717q6d30594ep265851def89d6f8c@mail.gmail.com> <09DADED3-B2A5-427F-A9C6-4125E6255626@pnkfx.org> <932b2f1f0809020730n4bc7a3bfmabd7536ba730b19c@mail.gmail.com> Message-ID: <990e0c030809020913o7656502bobacd956b4ec20a86@mail.gmail.com> In that case, your answer to me is clear, but now I don't understand your answer to Grant. In what way did not mean "not an end user"? --Carl On Tue, Sep 2, 2008 at 10:30 AM, Robby Findler wrote: > I can see how what I wrote was perhaps unclear. I meant the person > whose machine actually has the contract violation. Carl also seems to > mean that. Clear now? > > Robby > > On Tue, Sep 2, 2008 at 9:23 AM, Felix Klock's PLT scheme proxy > wrote: >> Robby: "I meant the user of the planet package (a programmer), not an end >> user of the software." >> >> Carl: "it is the end user who matters ... Any time a program crashes in >> Windows or Mac OS, I get asked if I want to send the bug report to Microsoft >> or Apple respectively, and it's not like the OS knows I'm a programmer" >> >> Robby: "Are we not all saying the same thing?" >> >> I think you two definitely are *not* saying the same thing. (All of the >> above quotes appear in context below.) >> >> -Felix, (who agrees with Carl, for the record) >> >> On Sep 2, 2008, at 10:17 AM, Robby Findler wrote: >> >>> Yes, yes. All along: the person who gets the error message gets to >>> decide to submit it. Are we not all saying the same thing? >>> >>> Robby >>> >>> On Tue, Sep 2, 2008 at 9:15 AM, Carl Eastlund wrote: >>>> >>>> On Tue, Sep 2, 2008 at 10:08 AM, Robby Findler >>>> wrote: >>>>> >>>>> On Tue, Sep 2, 2008 at 8:58 AM, Grant Rettke wrote: >>>>>> >>>>>> How would a user know what they should and they should not send when a >>>>>> contract is violated? It would be confusing. >>>>> >>>>> I'm sorry -- we seem to be miscommunicating. >>>>> >>>>> When I wrote "user" I meant the user of the planet package (a >>>>> programmer), not an end user of the software. >>>> >>>> Wait... I think it is the end user who matters. If Albert writes an >>>> encryption routine, and Bob uses it to write an online store, and Curt >>>> tries to buy something and it hits a bug, we should ask Curt if he >>>> wants to send the error report so he can say "no, don't send any data, >>>> I just typed my credit card number in". We don't want to send Curt's >>>> credit information to Bob and ask him if Al can have it; Bob shouldn't >>>> have it to begin with. >>>> >>>> Curt doesn't have to know any technical details, he just needs to know >>>> whether or not the application involved had any private data. Any >>>> time a program crashes in Windows or Mac OS, I get asked if I want to >>>> send the bug report to Microsoft or Apple respectively, and it's not >>>> like the OS knows I'm a programmer. The same principle applies to >>>> Planet and PLT. >>>> >>>> --Carl From robby at cs.uchicago.edu Tue Sep 2 12:18:59 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:21 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <990e0c030809020913o7656502bobacd956b4ec20a86@mail.gmail.com> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> <756daca50809020637t7a8d7cd1h8cfbebd7c781b690@mail.gmail.com> <932b2f1f0809020644o7d3b7484oe9b4b891d612b59e@mail.gmail.com> <756daca50809020658m2bfe9acepffa55222b40f4743@mail.gmail.com> <932b2f1f0809020708y39bfbfc1we1416d6c1bd70156@mail.gmail.com> <990e0c030809020715u29bc8da5pbf31140cd8ffa645@mail.gmail.com> <932b2f1f0809020717q6d30594ep265851def89d6f8c@mail.gmail.com> <09DADED3-B2A5-427F-A9C6-4125E6255626@pnkfx.org> <932b2f1f0809020730n4bc7a3bfmabd7536ba730b19c@mail.gmail.com> <990e0c030809020913o7656502bobacd956b4ec20a86@mail.gmail.com> Message-ID: <932b2f1f0809020918k291d0046g3860a40a5d7863e1@mail.gmail.com> I was thinking of an "end user" as someone who uses some complete software application (that possibly involves planet packages). Such a person is not typically running inside drscheme and they won't see the blue icon. Robby On Tue, Sep 2, 2008 at 11:13 AM, Carl Eastlund wrote: > In that case, your answer to me is clear, but now I don't understand > your answer to Grant. In what way did not mean "not an end user"? > > --Carl > > On Tue, Sep 2, 2008 at 10:30 AM, Robby Findler wrote: >> I can see how what I wrote was perhaps unclear. I meant the person >> whose machine actually has the contract violation. Carl also seems to >> mean that. Clear now? >> >> Robby >> >> On Tue, Sep 2, 2008 at 9:23 AM, Felix Klock's PLT scheme proxy >> wrote: >>> Robby: "I meant the user of the planet package (a programmer), not an end >>> user of the software." >>> >>> Carl: "it is the end user who matters ... Any time a program crashes in >>> Windows or Mac OS, I get asked if I want to send the bug report to Microsoft >>> or Apple respectively, and it's not like the OS knows I'm a programmer" >>> >>> Robby: "Are we not all saying the same thing?" >>> >>> I think you two definitely are *not* saying the same thing. (All of the >>> above quotes appear in context below.) >>> >>> -Felix, (who agrees with Carl, for the record) >>> >>> On Sep 2, 2008, at 10:17 AM, Robby Findler wrote: >>> >>>> Yes, yes. All along: the person who gets the error message gets to >>>> decide to submit it. Are we not all saying the same thing? >>>> >>>> Robby >>>> >>>> On Tue, Sep 2, 2008 at 9:15 AM, Carl Eastlund wrote: >>>>> >>>>> On Tue, Sep 2, 2008 at 10:08 AM, Robby Findler >>>>> wrote: >>>>>> >>>>>> On Tue, Sep 2, 2008 at 8:58 AM, Grant Rettke wrote: >>>>>>> >>>>>>> How would a user know what they should and they should not send when a >>>>>>> contract is violated? It would be confusing. >>>>>> >>>>>> I'm sorry -- we seem to be miscommunicating. >>>>>> >>>>>> When I wrote "user" I meant the user of the planet package (a >>>>>> programmer), not an end user of the software. >>>>> >>>>> Wait... I think it is the end user who matters. If Albert writes an >>>>> encryption routine, and Bob uses it to write an online store, and Curt >>>>> tries to buy something and it hits a bug, we should ask Curt if he >>>>> wants to send the error report so he can say "no, don't send any data, >>>>> I just typed my credit card number in". We don't want to send Curt's >>>>> credit information to Bob and ask him if Al can have it; Bob shouldn't >>>>> have it to begin with. >>>>> >>>>> Curt doesn't have to know any technical details, he just needs to know >>>>> whether or not the application involved had any private data. Any >>>>> time a program crashes in Windows or Mac OS, I get asked if I want to >>>>> send the bug report to Microsoft or Apple respectively, and it's not >>>>> like the OS knows I'm a programmer. The same principle applies to >>>>> Planet and PLT. >>>>> >>>>> --Carl > > From robby at cs.uchicago.edu Tue Sep 2 12:20:49 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:21 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <932b2f1f0809020918k291d0046g3860a40a5d7863e1@mail.gmail.com> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> <932b2f1f0809020644o7d3b7484oe9b4b891d612b59e@mail.gmail.com> <756daca50809020658m2bfe9acepffa55222b40f4743@mail.gmail.com> <932b2f1f0809020708y39bfbfc1we1416d6c1bd70156@mail.gmail.com> <990e0c030809020715u29bc8da5pbf31140cd8ffa645@mail.gmail.com> <932b2f1f0809020717q6d30594ep265851def89d6f8c@mail.gmail.com> <09DADED3-B2A5-427F-A9C6-4125E6255626@pnkfx.org> <932b2f1f0809020730n4bc7a3bfmabd7536ba730b19c@mail.gmail.com> <990e0c030809020913o7656502bobacd956b4ec20a86@mail.gmail.com> <932b2f1f0809020918k291d0046g3860a40a5d7863e1@mail.gmail.com> Message-ID: <932b2f1f0809020920g340a36f5s56fa80aa480fda68@mail.gmail.com> Oh -- let me clarify a little more -- the way this information would be collected is via the default exception handler (called when no exception handler is in place) and the one that records information would probably only be installed when running inside drscheme. That's how the 'end user' would not see this. Of course, we don't have to do it that way -- that's just what I had in mind when I wrote that. Robby On Tue, Sep 2, 2008 at 11:18 AM, Robby Findler wrote: > I was thinking of an "end user" as someone who uses some complete > software application (that possibly involves planet packages). Such a > person is not typically running inside drscheme and they won't see the > blue icon. > > Robby > > On Tue, Sep 2, 2008 at 11:13 AM, Carl Eastlund wrote: >> In that case, your answer to me is clear, but now I don't understand >> your answer to Grant. In what way did not mean "not an end user"? >> >> --Carl >> >> On Tue, Sep 2, 2008 at 10:30 AM, Robby Findler wrote: >>> I can see how what I wrote was perhaps unclear. I meant the person >>> whose machine actually has the contract violation. Carl also seems to >>> mean that. Clear now? >>> >>> Robby >>> >>> On Tue, Sep 2, 2008 at 9:23 AM, Felix Klock's PLT scheme proxy >>> wrote: >>>> Robby: "I meant the user of the planet package (a programmer), not an end >>>> user of the software." >>>> >>>> Carl: "it is the end user who matters ... Any time a program crashes in >>>> Windows or Mac OS, I get asked if I want to send the bug report to Microsoft >>>> or Apple respectively, and it's not like the OS knows I'm a programmer" >>>> >>>> Robby: "Are we not all saying the same thing?" >>>> >>>> I think you two definitely are *not* saying the same thing. (All of the >>>> above quotes appear in context below.) >>>> >>>> -Felix, (who agrees with Carl, for the record) >>>> >>>> On Sep 2, 2008, at 10:17 AM, Robby Findler wrote: >>>> >>>>> Yes, yes. All along: the person who gets the error message gets to >>>>> decide to submit it. Are we not all saying the same thing? >>>>> >>>>> Robby >>>>> >>>>> On Tue, Sep 2, 2008 at 9:15 AM, Carl Eastlund wrote: >>>>>> >>>>>> On Tue, Sep 2, 2008 at 10:08 AM, Robby Findler >>>>>> wrote: >>>>>>> >>>>>>> On Tue, Sep 2, 2008 at 8:58 AM, Grant Rettke wrote: >>>>>>>> >>>>>>>> How would a user know what they should and they should not send when a >>>>>>>> contract is violated? It would be confusing. >>>>>>> >>>>>>> I'm sorry -- we seem to be miscommunicating. >>>>>>> >>>>>>> When I wrote "user" I meant the user of the planet package (a >>>>>>> programmer), not an end user of the software. >>>>>> >>>>>> Wait... I think it is the end user who matters. If Albert writes an >>>>>> encryption routine, and Bob uses it to write an online store, and Curt >>>>>> tries to buy something and it hits a bug, we should ask Curt if he >>>>>> wants to send the error report so he can say "no, don't send any data, >>>>>> I just typed my credit card number in". We don't want to send Curt's >>>>>> credit information to Bob and ask him if Al can have it; Bob shouldn't >>>>>> have it to begin with. >>>>>> >>>>>> Curt doesn't have to know any technical details, he just needs to know >>>>>> whether or not the application involved had any private data. Any >>>>>> time a program crashes in Windows or Mac OS, I get asked if I want to >>>>>> send the bug report to Microsoft or Apple respectively, and it's not >>>>>> like the OS knows I'm a programmer. The same principle applies to >>>>>> Planet and PLT. >>>>>> >>>>>> --Carl >> >> > From simon at joyful.com Tue Sep 2 14:12:04 2008 From: simon at joyful.com (Simon Michael) Date: Thu Mar 26 02:27:21 2009 Subject: [plt-scheme] Re: [study-htdp] hello, reader expressions In-Reply-To: <0A157FB1-0719-489E-A2A1-32F600F41931@joyful.com> References: <0A157FB1-0719-489E-A2A1-32F600F41931@joyful.com> Message-ID: <1C2C03A3-F903-4E29-B107-CC31E1583949@joyful.com> Cc'ing plt list.. On Sep 2, 2008, at 11:06 AM, Simon Michael wrote: > 2. when I call convert-file from convert.ss, I get a "read: #reader > expressions not currently enabled" error. Googling found me just one > workaround for this, which seems out of date. Didn't anybody else > hit it ? > > Good learning all! From matthias at ccs.neu.edu Tue Sep 2 14:35:39 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:27:21 2009 Subject: [plt-scheme] Re: [study-htdp] hello, reader expressions In-Reply-To: <1C2C03A3-F903-4E29-B107-CC31E1583949@joyful.com> References: <0A157FB1-0719-489E-A2A1-32F600F41931@joyful.com> <1C2C03A3-F903-4E29-B107-CC31E1583949@joyful.com> Message-ID: You may have created and saved the file with the input numbers via DrScheme. Since the latter is a program editor, it saves meta-data in the file, in addition to the numbers. I recommend using some other editor to create the input file. -- Matthias On Sep 2, 2008, at 2:12 PM, Simon Michael wrote: > Cc'ing plt list.. > > On Sep 2, 2008, at 11:06 AM, Simon Michael wrote: >> 2. when I call convert-file from convert.ss, I get a "read: >> #reader expressions not currently enabled" error. Googling found >> me just one workaround for this, which seems out of date. Didn't >> anybody else hit it ? >> >> Good learning all! > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From jensaxel at soegaard.net Tue Sep 2 14:51:48 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:27:21 2009 Subject: [plt-scheme] Re: [study-htdp] hello, reader expressions In-Reply-To: References: <0A157FB1-0719-489E-A2A1-32F600F41931@joyful.com> <1C2C03A3-F903-4E29-B107-CC31E1583949@joyful.com> Message-ID: <48BD8B44.1090203@soegaard.net> Matthias Felleisen wrote: > You may have created and saved the file with the input numbers via > DrScheme. Since the latter is a program editor, it saves meta-data in > the file, in addition to the numbers. I recommend using some other > editor to create the input file. -- Matthias I suspect putting DrScheme into text mode before saving will do the trick. /Jens Axel From robby at cs.uchicago.edu Tue Sep 2 15:05:14 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:21 2009 Subject: [plt-scheme] Re: [study-htdp] hello, reader expressions In-Reply-To: <48BD8B44.1090203@soegaard.net> References: <0A157FB1-0719-489E-A2A1-32F600F41931@joyful.com> <1C2C03A3-F903-4E29-B107-CC31E1583949@joyful.com> <48BD8B44.1090203@soegaard.net> Message-ID: <932b2f1f0809021205h5d35b061tf9c589098637652@mail.gmail.com> The error message suggests that the author of the file edited the file in DrScheme and had the language set to a teaching language when they did so. DrScheme doesn't save teaching language files as plain text, but instead includes a header indicating what the language is and what teachpacks are installed. Robby On Tue, Sep 2, 2008 at 1:51 PM, Jens Axel Soegaard wrote: > Matthias Felleisen wrote: >> >> You may have created and saved the file with the input numbers via >> DrScheme. Since the latter is a program editor, it saves meta-data in the >> file, in addition to the numbers. I recommend using some other editor to >> create the input file. -- Matthias > > I suspect putting DrScheme into text mode before saving will do the trick. > > /Jens Axel > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From jensaxel at soegaard.net Tue Sep 2 15:08:16 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:27:22 2009 Subject: [plt-scheme] Re: [study-htdp] hello, reader expressions In-Reply-To: <932b2f1f0809021205h5d35b061tf9c589098637652@mail.gmail.com> References: <0A157FB1-0719-489E-A2A1-32F600F41931@joyful.com> <1C2C03A3-F903-4E29-B107-CC31E1583949@joyful.com> <48BD8B44.1090203@soegaard.net> <932b2f1f0809021205h5d35b061tf9c589098637652@mail.gmail.com> Message-ID: <48BD8F20.6000207@soegaard.net> Robby Findler wrote: > The error message suggests that the author of the file edited the file > in DrScheme and had the language set to a teaching language when they > did so. DrScheme doesn't save teaching language files as plain text, > but instead includes a header indicating what the language is and wha > > teachpacks are installed. > Even in text mode? /Jens Axel From robby at cs.uchicago.edu Tue Sep 2 15:10:10 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:22 2009 Subject: [plt-scheme] Re: [study-htdp] hello, reader expressions In-Reply-To: <48BD8F20.6000207@soegaard.net> References: <0A157FB1-0719-489E-A2A1-32F600F41931@joyful.com> <1C2C03A3-F903-4E29-B107-CC31E1583949@joyful.com> <48BD8B44.1090203@soegaard.net> <932b2f1f0809021205h5d35b061tf9c589098637652@mail.gmail.com> <48BD8F20.6000207@soegaard.net> Message-ID: <932b2f1f0809021210m18ecd819if7e33623ec52793c@mail.gmail.com> Yes. Text mode is independent of this. (In graphical mode, the same header is there, but encoded). Robby On Tue, Sep 2, 2008 at 2:08 PM, Jens Axel Soegaard wrote: > Robby Findler wrote: >> >> The error message suggests that the author of the file edited the file >> in DrScheme and had the language set to a teaching language when they >> did so. DrScheme doesn't save teaching language files as plain text, >> but instead includes a header indicating what the language is and wha >> teachpacks are installed. >> > > Even in text mode? > > /Jens Axel > > > > From noelwelsh at gmail.com Tue Sep 2 17:26:12 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:27:22 2009 Subject: [plt-scheme] reporting on planet packages and versions used by a set of collections & other tools In-Reply-To: <48BBE904.3030507@neilvandyke.org> References: <48BBC067.4000100@neilvandyke.org> <48BBE904.3030507@neilvandyke.org> Message-ID: On Mon, Sep 1, 2008 at 2:07 PM, Neil Van Dyke wrote: > Agreed, *should*. You know I'm going to play devil's advocate here. :) > Rarely do we actually prove that given changes are backward-compatible wrt > a specification, and even more rarely do we prove that all the interactions > among units rely only on specified behavior. By "rarely," I mean "never," > for virtually everyone, including myself. Agreed. > Just within my own systems, I'd like to know whether my assertions of > version compatibility are correct. Testing unit version combinations within > my systems can inform me of reliance on unspecified behavior or of a > non-backward-compatible change that was not caught in unit testing with the > versions I happened to be using. Ideally, I would be informed before I > submitted code to PLaneT that falsely claimed to be backward-compatible or > that had overly liberal "require"'d versions. I've done some reading of the Planet API and it looks like all the information is available, but the functions are not conveniently presented. Note that util.ss in the planet collection exports more bindings than are documented. N. From robby at cs.uchicago.edu Tue Sep 2 17:42:30 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:22 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <932b2f1f0809020920g340a36f5s56fa80aa480fda68@mail.gmail.com> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> <756daca50809020658m2bfe9acepffa55222b40f4743@mail.gmail.com> <932b2f1f0809020708y39bfbfc1we1416d6c1bd70156@mail.gmail.com> <990e0c030809020715u29bc8da5pbf31140cd8ffa645@mail.gmail.com> <932b2f1f0809020717q6d30594ep265851def89d6f8c@mail.gmail.com> <09DADED3-B2A5-427F-A9C6-4125E6255626@pnkfx.org> <932b2f1f0809020730n4bc7a3bfmabd7536ba730b19c@mail.gmail.com> <990e0c030809020913o7656502bobacd956b4ec20a86@mail.gmail.com> <932b2f1f0809020918k291d0046g3860a40a5d7863e1@mail.gmail.com> <932b2f1f0809020920g340a36f5s56fa80aa480fda68@mail.gmail.com> Message-ID: <932b2f1f0809021442h6e3c7f83k2154190ec610078f@mail.gmail.com> Okay, based on the feedback in this thread (thanks, btw!), I've put together a fairly low key mechanism and checked it in to SVN. Each time a contract violation that would blame a planet component to the REPL, DrScheme records that in a table (these are only recorded when DrScheme runs the program, and they aren't recorded for the teaching languages). As long as the table is not empty, a small blue icon appears in the bottom bar of the drscheme window. Click it to see a list of the recorded violations. If you click a particular button in that list, you get sent to a url for submitting the bug report and the item falls off the list. This means that nothing is submitted without the person-who-discovered-the-bug-report's explicit okay (so I didn't redact anything), and hopefully the little blue icon isn't too ostentatious. This is checked in to SVN, but the latest nightly builds won't have it until they next complete. Possibly today sometime, hopefully by tomorrow US time. If you can build via SVN and you want to try it out, I've uploaded a planet package that violates its contract to make it easier to play with: #lang scheme (require (planet robby/bug/bug)) (bug) For those that are curious to see how it looks, but aren't in a position to build from SVN, here is a screenshot: http://people.cs.uchicago.edu/~robby/tmp/bug-tracking.png Note that this only records new bug reports, where "new" means that it has either a different stack trace or a different planet package or different version of the planet package, as compared to the other currently recorded bug reports. (It is doing an equal? check on the data that gets automatically filled in the bug report form.) Robby From simon at joyful.com Tue Sep 2 18:16:52 2008 From: simon at joyful.com (Simon Michael) Date: Thu Mar 26 02:27:22 2009 Subject: [plt-scheme] Re: [study-htdp] hello, reader expressions In-Reply-To: <932b2f1f0809021205h5d35b061tf9c589098637652@mail.gmail.com> References: <0A157FB1-0719-489E-A2A1-32F600F41931@joyful.com> <1C2C03A3-F903-4E29-B107-CC31E1583949@joyful.com> <48BD8B44.1090203@soegaard.net> <932b2f1f0809021205h5d35b061tf9c589098637652@mail.gmail.com> Message-ID: <4EBD6E19-F484-4FB8-8767-4558D8D2488B@joyful.com> On Sep 2, 2008, at 12:05 PM, Robby Findler wrote: > The error message suggests that the author of the file edited the file > in DrScheme and had the language set to a teaching language when they > did so. DrScheme doesn't save teaching language files as plain text, > but instead includes a header indicating what the language is and what > teachpacks are installed. Thanks for the replies. I tried converting the file to plain text, but that didn't work because Dr Scheme adds the header when you open plain text files too (I can see the error right after loading the plain text file, and I see the header in the file after saving it). So I'm currently unable to complete exercise 2.2.1 in Dr Scheme 4.1.. From robby at cs.uchicago.edu Tue Sep 2 18:21:30 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:22 2009 Subject: [plt-scheme] Re: [study-htdp] hello, reader expressions In-Reply-To: <4EBD6E19-F484-4FB8-8767-4558D8D2488B@joyful.com> References: <0A157FB1-0719-489E-A2A1-32F600F41931@joyful.com> <1C2C03A3-F903-4E29-B107-CC31E1583949@joyful.com> <48BD8B44.1090203@soegaard.net> <932b2f1f0809021205h5d35b061tf9c589098637652@mail.gmail.com> <4EBD6E19-F484-4FB8-8767-4558D8D2488B@joyful.com> Message-ID: <932b2f1f0809021521i7b36827x2bbdc15b6dc5e4b7@mail.gmail.com> Please set the language level to something other than a teaching language. Pretty Big should work fine. Robby On Tue, Sep 2, 2008 at 5:16 PM, Simon Michael wrote: > On Sep 2, 2008, at 12:05 PM, Robby Findler wrote: >> >> The error message suggests that the author of the file edited the file >> in DrScheme and had the language set to a teaching language when they >> did so. DrScheme doesn't save teaching language files as plain text, >> but instead includes a header indicating what the language is and what >> teachpacks are installed. > > Thanks for the replies. I tried converting the file to plain text, but that > didn't work because Dr Scheme adds the header when you open plain text files > too (I can see the error right after loading the plain text file, and I see > the header in the file after saving it). So I'm currently unable to > complete exercise 2.2.1 in Dr Scheme 4.1.. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From simon at joyful.com Tue Sep 2 18:37:10 2008 From: simon at joyful.com (Simon Michael) Date: Thu Mar 26 02:27:22 2009 Subject: [plt-scheme] Re: [study-htdp] hello, reader expressions In-Reply-To: <932b2f1f0809021521i7b36827x2bbdc15b6dc5e4b7@mail.gmail.com> References: <0A157FB1-0719-489E-A2A1-32F600F41931@joyful.com> <1C2C03A3-F903-4E29-B107-CC31E1583949@joyful.com> <48BD8B44.1090203@soegaard.net> <932b2f1f0809021205h5d35b061tf9c589098637652@mail.gmail.com> <4EBD6E19-F484-4FB8-8767-4558D8D2488B@joyful.com> <932b2f1f0809021521i7b36827x2bbdc15b6dc5e4b7@mail.gmail.com> Message-ID: On Sep 2, 2008, at 3:21 PM, Robby Findler wrote: > Please set the language level to something other than a teaching > language. Pretty Big should work fine. I picked the idea from somewhere that we are intended to begin HTDP and study-htdp in the Beginning Student language. I don't know where I read that; HTDP itself doesn't seem to specify the language it requires (it probably should ?) Pretty Big language breaks the check-expect function study-htdp recommended we use (ok, commented out); disables teachpacks (ok, used (require teachpack/htdp/convert)); and it didn't fix the read error. :/ From robby at cs.uchicago.edu Tue Sep 2 18:40:39 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:23 2009 Subject: [plt-scheme] Re: [study-htdp] hello, reader expressions In-Reply-To: References: <0A157FB1-0719-489E-A2A1-32F600F41931@joyful.com> <1C2C03A3-F903-4E29-B107-CC31E1583949@joyful.com> <48BD8B44.1090203@soegaard.net> <932b2f1f0809021205h5d35b061tf9c589098637652@mail.gmail.com> <4EBD6E19-F484-4FB8-8767-4558D8D2488B@joyful.com> <932b2f1f0809021521i7b36827x2bbdc15b6dc5e4b7@mail.gmail.com> Message-ID: <932b2f1f0809021540h313a6e0bt692bc5bbed906bb7@mail.gmail.com> Please use the pretty big language ONLY for editing the file you are using with convert-file. Robby On Tue, Sep 2, 2008 at 5:37 PM, Simon Michael wrote: > On Sep 2, 2008, at 3:21 PM, Robby Findler wrote: >> >> Please set the language level to something other than a teaching >> language. Pretty Big should work fine. > > I picked the idea from somewhere that we are intended to begin HTDP and > study-htdp in the Beginning Student language. I don't know where I read > that; HTDP itself doesn't seem to specify the language it requires (it > probably should ?) > > Pretty Big language breaks the check-expect function study-htdp recommended > we use (ok, commented out); disables teachpacks (ok, used (require > teachpack/htdp/convert)); and it didn't fix the read error. :/ > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From simon at joyful.com Tue Sep 2 18:47:44 2008 From: simon at joyful.com (Simon Michael) Date: Thu Mar 26 02:27:23 2009 Subject: [plt-scheme] Re: [study-htdp] hello, reader expressions In-Reply-To: <932b2f1f0809021540h313a6e0bt692bc5bbed906bb7@mail.gmail.com> References: <0A157FB1-0719-489E-A2A1-32F600F41931@joyful.com> <1C2C03A3-F903-4E29-B107-CC31E1583949@joyful.com> <48BD8B44.1090203@soegaard.net> <932b2f1f0809021205h5d35b061tf9c589098637652@mail.gmail.com> <4EBD6E19-F484-4FB8-8767-4558D8D2488B@joyful.com> <932b2f1f0809021521i7b36827x2bbdc15b6dc5e4b7@mail.gmail.com> <932b2f1f0809021540h313a6e0bt692bc5bbed906bb7@mail.gmail.com> Message-ID: <1527BF71-DDEF-49AA-8C5D-C3DFEB97C40C@joyful.com> On Sep 2, 2008, at 3:40 PM, Robby Findler wrote: > Please use the pretty big language ONLY for editing the file you are > using with convert-file. Ah, I now understand you all were talking about the data file (in.dat). Indeed I had created that with Dr Scheme, still in Beginner Student mode. Fellow study-htdp participants: don't do that. Thanks! From noelwelsh at gmail.com Tue Sep 2 22:15:19 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:27:23 2009 Subject: [plt-scheme] ANN: Sake, a build tool Message-ID: Hi all, I've just released a Make-like build tool called Sake to Planet. I'm hoping it will be useful for anyone developing projects in Scheme. It has already proven very useful for automating its own build process. It is quite sparse on features right now, but contributions and suggestions for improvements are very welcome. Cheers, Noel From grettke at acm.org Tue Sep 2 22:24:01 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:23 2009 Subject: [plt-scheme] ANN: Sake, a build tool In-Reply-To: References: Message-ID: <756daca50809021924i4561bf7cu9fd6926778f927c8@mail.gmail.com> Nice Noel. How is it pronounced? I suspect folks could start porting all appropriate Ant tasks with wild abandon! From grettke at acm.org Tue Sep 2 22:29:14 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:23 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <932b2f1f0809020708y39bfbfc1we1416d6c1bd70156@mail.gmail.com> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> <756daca50809020637t7a8d7cd1h8cfbebd7c781b690@mail.gmail.com> <932b2f1f0809020644o7d3b7484oe9b4b891d612b59e@mail.gmail.com> <756daca50809020658m2bfe9acepffa55222b40f4743@mail.gmail.com> <932b2f1f0809020708y39bfbfc1we1416d6c1bd70156@mail.gmail.com> Message-ID: <756daca50809021929k4461836ag8f63e186834ab862@mail.gmail.com> On Tue, Sep 2, 2008 at 9:08 AM, Robby Findler wrote: > and packaged it up via planet. The contract on the range is broken, so > when you first use it, this will produce a contract violation that > includes the properly parsed credit card number but will be sent to my > package and thus encrypted with my key, not with the credit card > author's key. > > Does that make more sense? Yes, thanks for the clarification. From grettke at acm.org Tue Sep 2 22:31:25 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:24 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <990e0c030809020715u29bc8da5pbf31140cd8ffa645@mail.gmail.com> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> <756daca50809020637t7a8d7cd1h8cfbebd7c781b690@mail.gmail.com> <932b2f1f0809020644o7d3b7484oe9b4b891d612b59e@mail.gmail.com> <756daca50809020658m2bfe9acepffa55222b40f4743@mail.gmail.com> <932b2f1f0809020708y39bfbfc1we1416d6c1bd70156@mail.gmail.com> <990e0c030809020715u29bc8da5pbf31140cd8ffa645@mail.gmail.com> Message-ID: <756daca50809021931n2fe9e158t953dd3660038bc60@mail.gmail.com> On Tue, Sep 2, 2008 at 9:15 AM, Carl Eastlund wrote: > Curt doesn't have to know any technical details, he just needs to know > whether or not the application involved had any private data. Any > time a program crashes in Windows or Mac OS, I get asked if I want to > send the bug report to Microsoft or Apple respectively, and it's not > like the OS knows I'm a programmer. The same principle applies to > Planet and PLT. I would bet that %90 of the people who are prompted as such on Windows click 'yes', because they are average users. If you are talking about programmers working on code in DrScheme, that is a very different group, programmers are typically expert users. From grettke at acm.org Tue Sep 2 22:35:20 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:24 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <932b2f1f0809020918k291d0046g3860a40a5d7863e1@mail.gmail.com> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> <932b2f1f0809020644o7d3b7484oe9b4b891d612b59e@mail.gmail.com> <756daca50809020658m2bfe9acepffa55222b40f4743@mail.gmail.com> <932b2f1f0809020708y39bfbfc1we1416d6c1bd70156@mail.gmail.com> <990e0c030809020715u29bc8da5pbf31140cd8ffa645@mail.gmail.com> <932b2f1f0809020717q6d30594ep265851def89d6f8c@mail.gmail.com> <09DADED3-B2A5-427F-A9C6-4125E6255626@pnkfx.org> <932b2f1f0809020730n4bc7a3bfmabd7536ba730b19c@mail.gmail.com> <990e0c030809020913o7656502bobacd956b4ec20a86@mail.gmail.com> <932b2f1f0809020918k291d0046g3860a40a5d7863e1@mail.gmail.com> Message-ID: <756daca50809021935r7d89e7b2hda9988de7124e39@mail.gmail.com> I see! Makes sense. I wonder if moving forward a "best practice" would be to write a unit test that triggers the violation and add that to the ticket. On Tue, Sep 2, 2008 at 11:18 AM, Robby Findler wrote: > I was thinking of an "end user" as someone who uses some complete > software application (that possibly involves planet packages). Such a > person is not typically running inside drscheme and they won't see the > blue icon. From grettke at acm.org Tue Sep 2 22:46:50 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:24 2009 Subject: [plt-scheme] Off topic: Why does Common Lisp have two namespaces (lisp2)? Message-ID: <756daca50809021946p741923ccx78f0a0ae64789b1b@mail.gmail.com> Hi folks, Because I don't know any CL people, and I know there is expertise here, could you please explain why Common Lisp has two namespaces (lisp2)? The ability to have two bindings to the name 'list' (one for a variable and one for a function) surely can not be the only reason for two namespaces?! Best wishes, Grant From robby at cs.uchicago.edu Tue Sep 2 22:50:02 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:24 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <756daca50809021935r7d89e7b2hda9988de7124e39@mail.gmail.com> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> <756daca50809020658m2bfe9acepffa55222b40f4743@mail.gmail.com> <932b2f1f0809020708y39bfbfc1we1416d6c1bd70156@mail.gmail.com> <990e0c030809020715u29bc8da5pbf31140cd8ffa645@mail.gmail.com> <932b2f1f0809020717q6d30594ep265851def89d6f8c@mail.gmail.com> <09DADED3-B2A5-427F-A9C6-4125E6255626@pnkfx.org> <932b2f1f0809020730n4bc7a3bfmabd7536ba730b19c@mail.gmail.com> <990e0c030809020913o7656502bobacd956b4ec20a86@mail.gmail.com> <932b2f1f0809020918k291d0046g3860a40a5d7863e1@mail.gmail.com> <756daca50809021935r7d89e7b2hda9988de7124e39@mail.gmail.com> Message-ID: <932b2f1f0809021950p77e74c5ma6fe8e6bb2a49995@mail.gmail.com> Indeed, that would be great. This is one of the research projects I'd like to embark on... there's some interesting technical challenges in making that happen. Robby On Tue, Sep 2, 2008 at 9:35 PM, Grant Rettke wrote: > I see! Makes sense. > > I wonder if moving forward a "best practice" would be to write a unit > test that triggers the violation and add that to the ticket. > > On Tue, Sep 2, 2008 at 11:18 AM, Robby Findler wrote: >> I was thinking of an "end user" as someone who uses some complete >> software application (that possibly involves planet packages). Such a >> person is not typically running inside drscheme and they won't see the >> blue icon. > > From robby at cs.uchicago.edu Tue Sep 2 22:51:09 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:24 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <932b2f1f0809021950p77e74c5ma6fe8e6bb2a49995@mail.gmail.com> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> <932b2f1f0809020708y39bfbfc1we1416d6c1bd70156@mail.gmail.com> <990e0c030809020715u29bc8da5pbf31140cd8ffa645@mail.gmail.com> <932b2f1f0809020717q6d30594ep265851def89d6f8c@mail.gmail.com> <09DADED3-B2A5-427F-A9C6-4125E6255626@pnkfx.org> <932b2f1f0809020730n4bc7a3bfmabd7536ba730b19c@mail.gmail.com> <990e0c030809020913o7656502bobacd956b4ec20a86@mail.gmail.com> <932b2f1f0809020918k291d0046g3860a40a5d7863e1@mail.gmail.com> <756daca50809021935r7d89e7b2hda9988de7124e39@mail.gmail.com> <932b2f1f0809021950p77e74c5ma6fe8e6bb2a49995@mail.gmail.com> Message-ID: <932b2f1f0809021951o60d0c5e2u12e74f14e33444d0@mail.gmail.com> (Oh wait -- I was thinking of automatically extracting the unit test from the failed run. If you're talking about the programmer who discovered the bug doing so, then by all means, yes! My experience is such unit tests are often most of the work in fixing the bug.) On Tue, Sep 2, 2008 at 9:50 PM, Robby Findler wrote: > Indeed, that would be great. This is one of the research projects I'd > like to embark on... there's some interesting technical challenges in > making that happen. > > Robby > > On Tue, Sep 2, 2008 at 9:35 PM, Grant Rettke wrote: >> I see! Makes sense. >> >> I wonder if moving forward a "best practice" would be to write a unit >> test that triggers the violation and add that to the ticket. >> >> On Tue, Sep 2, 2008 at 11:18 AM, Robby Findler wrote: >>> I was thinking of an "end user" as someone who uses some complete >>> software application (that possibly involves planet packages). Such a >>> person is not typically running inside drscheme and they won't see the >>> blue icon. >> >> > From grettke at acm.org Tue Sep 2 23:00:41 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:24 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <932b2f1f0809021951o60d0c5e2u12e74f14e33444d0@mail.gmail.com> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> <990e0c030809020715u29bc8da5pbf31140cd8ffa645@mail.gmail.com> <932b2f1f0809020717q6d30594ep265851def89d6f8c@mail.gmail.com> <09DADED3-B2A5-427F-A9C6-4125E6255626@pnkfx.org> <932b2f1f0809020730n4bc7a3bfmabd7536ba730b19c@mail.gmail.com> <990e0c030809020913o7656502bobacd956b4ec20a86@mail.gmail.com> <932b2f1f0809020918k291d0046g3860a40a5d7863e1@mail.gmail.com> <756daca50809021935r7d89e7b2hda9988de7124e39@mail.gmail.com> <932b2f1f0809021950p77e74c5ma6fe8e6bb2a49995@mail.gmail.com> <932b2f1f0809021951o60d0c5e2u12e74f14e33444d0@mail.gmail.com> Message-ID: <756daca50809022000k77739ab0r42df7b5c99282d22@mail.gmail.com> Yes I was thinking of the programmer supplied test. The automatically generated test sounds like a fun project, too :). On Tue, Sep 2, 2008 at 9:51 PM, Robby Findler wrote: > (Oh wait -- I was thinking of automatically extracting the unit test > from the failed run. If you're talking about the programmer who > discovered the bug doing so, then by all means, yes! My experience is > such unit tests are often most of the work in fixing the bug.) > > On Tue, Sep 2, 2008 at 9:50 PM, Robby Findler wrote: >> Indeed, that would be great. This is one of the research projects I'd >> like to embark on... there's some interesting technical challenges in >> making that happen. >> >> Robby >> >> On Tue, Sep 2, 2008 at 9:35 PM, Grant Rettke wrote: >>> I see! Makes sense. >>> >>> I wonder if moving forward a "best practice" would be to write a unit >>> test that triggers the violation and add that to the ticket. >>> >>> On Tue, Sep 2, 2008 at 11:18 AM, Robby Findler wrote: >>>> I was thinking of an "end user" as someone who uses some complete >>>> software application (that possibly involves planet packages). Such a >>>> person is not typically running inside drscheme and they won't see the >>>> blue icon. >>> >>> >> > -- http://www.wisdomandwonder.com/ From ghcooper at gmail.com Tue Sep 2 23:14:32 2008 From: ghcooper at gmail.com (Gregory Cooper) Date: Thu Mar 26 02:27:25 2009 Subject: [plt-scheme] Off topic: Why does Common Lisp have two namespaces (lisp2)? In-Reply-To: <756daca50809021946p741923ccx78f0a0ae64789b1b@mail.gmail.com> References: <756daca50809021946p741923ccx78f0a0ae64789b1b@mail.gmail.com> Message-ID: <65e1d50c0809022014n7a7b9697m646591392e50bb9b@mail.gmail.com> Hi Grant, Others may know better than me, but I believe one reason is so the compiler can identify function calls that it can resolve statically, in which case it can generate more efficient code (e.g., by inlining, or at least by avoiding a level of indirection). (CL's equivalent of SET! can't see the function namespace, just as mzscheme's module system doesn't allow mutation of require'd variables.) Greg On Tue, Sep 2, 2008 at 7:46 PM, Grant Rettke wrote: > Hi folks, > > Because I don't know any CL people, and I know there is expertise > here, could you please explain why Common Lisp has two namespaces > (lisp2)? > > The ability to have two bindings to the name 'list' (one for a > variable and one for a function) surely can not be the only reason for > two namespaces?! > > Best wishes, > > Grant > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From noelwelsh at gmail.com Wed Sep 3 03:26:25 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:27:25 2009 Subject: [plt-scheme] ANN: Sake, a build tool In-Reply-To: <756daca50809021924i4561bf7cu9fd6926778f927c8@mail.gmail.com> References: <756daca50809021924i4561bf7cu9fd6926778f927c8@mail.gmail.com> Message-ID: On Wed, Sep 3, 2008 at 3:24 AM, Grant Rettke wrote: > Nice Noel. How is it pronounced? Whatever works for you. I was thinking "sa-ke" like the Japanese rice wine, but "sayke" rhyming with make and rake is also an option. > I suspect folks could start porting all appropriate Ant tasks with wild abandon! Yup. Another thing to add is file-based dependencies like Make. I didn't have the need for this release but can see they would be useful. N. From neil at neilvandyke.org Wed Sep 3 05:49:37 2008 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:27:25 2009 Subject: [plt-scheme] planet: help submitting bugs & a question In-Reply-To: <932b2f1f0809021442h6e3c7f83k2154190ec610078f@mail.gmail.com> References: <932b2f1f0809020553t12dc62b9iadc85c8753e9ff3d@mail.gmail.com> <756daca50809020658m2bfe9acepffa55222b40f4743@mail.gmail.com> <932b2f1f0809020708y39bfbfc1we1416d6c1bd70156@mail.gmail.com> <990e0c030809020715u29bc8da5pbf31140cd8ffa645@mail.gmail.com> <932b2f1f0809020717q6d30594ep265851def89d6f8c@mail.gmail.com> <09DADED3-B2A5-427F-A9C6-4125E6255626@pnkfx.org> <932b2f1f0809020730n4bc7a3bfmabd7536ba730b19c@mail.gmail.com> <990e0c030809020913o7656502bobacd956b4ec20a86@mail.gmail.com> <932b2f1f0809020918k291d0046g3860a40a5d7863e1@mail.gmail.com> <932b2f1f0809020920g340a36f5s56fa80aa480fda68@mail.gmail.com> <932b2f1f0809021442h6e3c7f83k2154190ec610078f@mail.gmail.com> Message-ID: <48BE5DB1.5010907@neilvandyke.org> Robby Findler wrote at 09/02/2008 05:42 PM: > As long as the table is not empty, a small blue icon appears in the > bottom bar of the drscheme window. Click it to see a list of the > recorded violations. Nice. I think this is the best of the ideas. I'd forgotten the status bar could be used. From marek at xivilization.net Wed Sep 3 06:36:52 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:27:25 2009 Subject: [plt-scheme] Off topic: Why does Common Lisp have two namespaces (lisp2)? In-Reply-To: <756daca50809021946p741923ccx78f0a0ae64789b1b@mail.gmail.com> References: <756daca50809021946p741923ccx78f0a0ae64789b1b@mail.gmail.com> Message-ID: <20080903123652.74301487@halmanfloyd.lan.local> Hi, On Tue, 2 Sep 2008 21:46:50 -0500 "Grant Rettke" wrote: > Because I don't know any CL people, and I know there is expertise > here, could you please explain why Common Lisp has two namespaces > (lisp2)? To be exact, Lisp-2 does not mean that there are two namespaces as Common Lisp has more than two but still is a Lisp-2: - packages - functions - variables - operator (macros) - loop keywords - block names - go tags - etc. regards, Marek From neil at neilvandyke.org Wed Sep 3 07:10:46 2008 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:27:25 2009 Subject: [plt-scheme] ANN: Sake, a build tool In-Reply-To: References: Message-ID: <48BE70B6.6050307@neilvandyke.org> Noel Welsh wrote at 09/02/2008 10:15 PM: > I've just released a Make-like build tool called Sake to Planet. I' The ability to write Make actions in Scheme code is a win. Make-like tools fill some gaps that the "setup-plt", "planet", and DrScheme tools can't fully cover. I'm going to make (ha) an advertorial sales pitch here, for anyone unfamiliar with Make... A client of mine recently moved to GNU Make for development of a large system that's implemented predominantly in PLT Scheme. The Make setup has been a big win over the previous setup of poorly-documented, effort-intensive, error-prone process and collection of shell scripts that had redundant information and weren't always in sync. Make rules now automate everything from initializing a development database, to incrementally compiling the system (using "setup-plt" as much as possible), to generating config files and the template home page, to (re)configuring and (re)starting an Apache server specifically for that particular source code workspace on TCP ports private to it (generating SSL certificate as necessary), to starting the right DrScheme version with the right environment variables, to sending Firefox to the appropriate URL for this server. Options specific to a source code workspace -- to override the defaults specifying feature sets, network, and database -- are controlled via a "Makefile-options" file in which Make variables are set, and those settings in one place percolate throughout the system. "Makefile-options" settings also permit a production server to be run from a source code workspace if necessary, which has been handy for demos. We capture additional conveniences in the Makefile as needed, like a target to report which PLaneT versions we're using, and for the simplest case of checking out a new source workspace from branches in several SCM repositories. We invoke Make from both Emacs and from Bash. Bash does command-line argument completion for Make targets, which is especially nice for descriptive targets like "create-foo-demo-database". All this is a yawn to some C programmers. "Make: It's Not Just For C Programmers Anymore." The only shortcoming I've noticed with this use of GNU Make is that we can't easily embed Scheme code to implement actions. The Scheme code is in external files, and we have to pass various information from Make to the Scheme process, which can be a hassle. Therefore, the Makefile uses embedded Bourne shell tricks, "sed", and "grep" when sometimes embedded Scheme would be better. This seems like one good contribution for Sake to make to Make. -- http://www.neilvandyke.org/ From alan at alan-watson.org Wed Sep 3 09:22:17 2008 From: alan at alan-watson.org (Alan Watson) Date: Thu Mar 26 02:27:25 2009 Subject: [plt-scheme] Off topic: Why does Common Lisp have two namespaces (lisp2)? In-Reply-To: <756daca50809021946p741923ccx78f0a0ae64789b1b@mail.gmail.com> References: <756daca50809021946p741923ccx78f0a0ae64789b1b@mail.gmail.com> Message-ID: <4D89CF89-CFD9-45A4-9AE1-7E8ADBEC2E13@alan-watson.org> See: http://www.nhplace.com/kent/Papers/Technical-Issues.html Regards, Alan -- Alan Watson http://www.alan-watson.org/ From grettke at acm.org Wed Sep 3 09:30:24 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:25 2009 Subject: [plt-scheme] HTDP: Ought folks use contracts while working through HTDP? Message-ID: <756daca50809030630l1c4c8e17p3b8c686ca9962477@mail.gmail.com> Hi folks, Should people working on HTDP be welcome to include contracts http://pre.plt-scheme.org/plt/doc/guide/contracts.html to specify the behavior of functions that they implement? Best wishes, Grant From noelwelsh at gmail.com Wed Sep 3 09:36:16 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:27:26 2009 Subject: [plt-scheme] HTDP: Ought folks use contracts while working through HTDP? In-Reply-To: <756daca50809030630l1c4c8e17p3b8c686ca9962477@mail.gmail.com> References: <756daca50809030630l1c4c8e17p3b8c686ca9962477@mail.gmail.com> Message-ID: I don't think the teaching language support contracts, so no, I don't think they're expected. OTOH, for people who are experienced programmers they are worthwhile learning. N. On Wed, Sep 3, 2008 at 2:30 PM, Grant Rettke wrote: > Hi folks, > > Should people working on HTDP be welcome to include contracts > > http://pre.plt-scheme.org/plt/doc/guide/contracts.html > > to specify the behavior of functions that they implement? > > Best wishes, > > Grant From robby at cs.uchicago.edu Wed Sep 3 10:01:56 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:26 2009 Subject: [plt-scheme] HTDP: Ought folks use contracts while working through HTDP? In-Reply-To: References: <756daca50809030630l1c4c8e17p3b8c686ca9962477@mail.gmail.com> Message-ID: <932b2f1f0809030701r115e8130p15e30d2c4f820e18@mail.gmail.com> People working on HtDP should add contracts in the form of comments with their functions, but as Noel points out, contracts aren't supported in the teaching languages. Robby On Wed, Sep 3, 2008 at 8:36 AM, Noel Welsh wrote: > I don't think the teaching language support contracts, so no, I don't > think they're expected. OTOH, for people who are experienced > programmers they are worthwhile learning. > > N. > > On Wed, Sep 3, 2008 at 2:30 PM, Grant Rettke wrote: >> Hi folks, >> >> Should people working on HTDP be welcome to include contracts >> >> http://pre.plt-scheme.org/plt/doc/guide/contracts.html >> >> to specify the behavior of functions that they implement? >> >> Best wishes, >> >> Grant > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From grettke at acm.org Wed Sep 3 10:25:23 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:26 2009 Subject: [plt-scheme] HTDP: Ought folks use contracts while working through HTDP? In-Reply-To: <932b2f1f0809030701r115e8130p15e30d2c4f820e18@mail.gmail.com> References: <756daca50809030630l1c4c8e17p3b8c686ca9962477@mail.gmail.com> <932b2f1f0809030701r115e8130p15e30d2c4f820e18@mail.gmail.com> Message-ID: <756daca50809030725x4bf4adbo4823e0108a7c6db1@mail.gmail.com> I figured that based on the approach, it would make sense to use only features defined in the teaching language itself. I was sort of intrigued about if/where the software contracts could fit, though. From matthias at ccs.neu.edu Wed Sep 3 10:33:36 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:27:26 2009 Subject: [plt-scheme] HTDP: Ought folks use contracts while working through HTDP? In-Reply-To: <756daca50809030630l1c4c8e17p3b8c686ca9962477@mail.gmail.com> References: <756daca50809030630l1c4c8e17p3b8c686ca9962477@mail.gmail.com> Message-ID: History: I introduced the word contract in 1995 or 6 to distinguish the comments in HtDP from types and yet to allude to something like types. To use the word "type" is only meaningful in a context where a language of types is clearly defined and a mechanism for checking whether an expresssion E is classifiable as something that satisfies type T exists. (That's theorem checking.) Scheme had no type system at the time, and I didn't want a type system. Typical novices say for the first few weeks "the computer did this to me". No need to introduce yet another level of syntactic detail, no need to introduce yet another level of failure at this point. At the same time, I strongly believe that the organization of functions is best based on something like types. A naive and intuitive notion of set-based reasoning comes in handy here. They are easy to express with a mix of English and constructors from whatever language you choose (Scheme, Perl, Python). They are intuitive to reason with and about. And I hoped they'd be easy to check, dynamically first and statically second. Robby explored the dynamic, formal counter-parts to this notion of "contracts" in his dissertation. Sam is exploring the static, formal counter-part and complement to Robby's type with Typed Scheme. One day we're hoping to have a smooth path from untyped Scheme to Scheme with contracts and types. -- Matthias On Sep 3, 2008, at 9:30 AM, Grant Rettke wrote: > Hi folks, > > Should people working on HTDP be welcome to include contracts > > http://pre.plt-scheme.org/plt/doc/guide/contracts.html > > to specify the behavior of functions that they implement? > > Best wishes, > > Grant > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From simon at joyful.com Wed Sep 3 12:08:38 2008 From: simon at joyful.com (Simon Michael) Date: Thu Mar 26 02:27:26 2009 Subject: [plt-scheme] Re: ANN: Sake, a build tool In-Reply-To: References: Message-ID: Cool, thanks for the release. There's another Sake, fyi: http://wiki.squeak.org/squeak/5953 . From jay.mccarthy at gmail.com Wed Sep 3 12:13:54 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:27:26 2009 Subject: [plt-scheme] ANN: Sake, a build tool In-Reply-To: References: Message-ID: How does this compare to the Make that comes with PLT Scheme? http://docs.plt-scheme.org/make/index.html Jay On Tue, Sep 2, 2008 at 8:15 PM, Noel Welsh wrote: > Hi all, > > I've just released a Make-like build tool called Sake to Planet. I'm > hoping it will be useful for anyone developing projects in Scheme. It > has already proven very useful for automating its own build process. > It is quite sparse on features right now, but contributions and > suggestions for improvements are very welcome. > > Cheers, > Noel > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From noelwelsh at gmail.com Wed Sep 3 12:27:27 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:27:27 2009 Subject: [plt-scheme] Re: ANN: Sake, a build tool In-Reply-To: References: Message-ID: I'll arm-wrestle for the right to the name. N. On Wed, Sep 3, 2008 at 5:08 PM, Simon Michael wrote: > Cool, thanks for the release. There's another Sake, fyi: > http://wiki.squeak.org/squeak/5953 . From noelwelsh at gmail.com Wed Sep 3 12:37:52 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:27:27 2009 Subject: [plt-scheme] ANN: Sake, a build tool In-Reply-To: References: Message-ID: On Wed, Sep 3, 2008 at 5:13 PM, Jay McCarthy wrote: > How does this compare to the Make that comes with PLT Scheme? > > http://docs.plt-scheme.org/make/index.html The focus of that library is managing dependencies between files, presumably for the purposes of recompilation. I have found this isn't very important with most Scheme projects, as mzc does dependency tracking automatically. The features Sake provides that the PLT make doesn't are: 1. Tasks that don't produce or depend on files (e.g. installation) 2. Convenient syntax 3. Provided library of actions (currently: test, compile, package) 4. Convenient invocation of any task via command line tool Sake doesn't yet track dependencies between file based on time-stamps. I have yet to find this important (in the ENTIRE DAY I've been using Sake; this feature is next on my list). N. From dvanhorn at ccs.neu.edu Wed Sep 3 14:35:53 2008 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Thu Mar 26 02:27:27 2009 Subject: [plt-scheme] check-expect and Typed Scheme Message-ID: <48BED909.3040206@ccs.neu.edu> Is it possible to use check-expect in a Typed Scheme module? David #lang typed-scheme (require htdp/testing) (check-expect #t #t) Welcome to DrScheme, version 4.1.0.2-svn29aug2008 [3m]. Language: Module; memory limit: 128 megabytes. typecheck: Untyped definition : (test3820) in: (check-expect #t #t) From matthias at ccs.neu.edu Wed Sep 3 15:33:51 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:27:27 2009 Subject: [plt-scheme] check-expect and Typed Scheme In-Reply-To: <48BED909.3040206@ccs.neu.edu> References: <48BED909.3040206@ccs.neu.edu> Message-ID: <83132930-778F-4977-A6AE-865FBC7AEE47@ccs.neu.edu> No, not yet. On Sep 3, 2008, at 2:35 PM, David Van Horn wrote: > Is it possible to use check-expect in a Typed Scheme module? > > David > > #lang typed-scheme > (require htdp/testing) > > (check-expect #t #t) > > Welcome to DrScheme, version 4.1.0.2-svn29aug2008 [3m]. > Language: Module; memory limit: 128 megabytes. > typecheck: Untyped definition : (test3820) in: (check-expect #t #t) > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From dherman at ccs.neu.edu Wed Sep 3 15:55:59 2008 From: dherman at ccs.neu.edu (Dave Herman) Date: Thu Mar 26 02:27:27 2009 Subject: [plt-scheme] Re: ANN: Sake, a build tool In-Reply-To: References: Message-ID: <48BEEBCF.3050900@ccs.neu.edu> There's always schake... Dave Noel Welsh wrote: > I'll arm-wrestle for the right to the name. > > N. > > On Wed, Sep 3, 2008 at 5:08 PM, Simon Michael wrote: >> Cool, thanks for the release. There's another Sake, fyi: >> http://wiki.squeak.org/squeak/5953 . > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From dvanhorn at ccs.neu.edu Wed Sep 3 16:12:13 2008 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Thu Mar 26 02:27:27 2009 Subject: [plt-scheme] check-expect and Typed Scheme In-Reply-To: <83132930-778F-4977-A6AE-865FBC7AEE47@ccs.neu.edu> References: <48BED909.3040206@ccs.neu.edu> <83132930-778F-4977-A6AE-865FBC7AEE47@ccs.neu.edu> Message-ID: <48BEEF9D.3060402@ccs.neu.edu> Matthias Felleisen wrote: > No, not yet. OK. On a related note... this doesn't behave as I expected. #lang typed-scheme (require/opaque-type KeyEvent key-event? htdp/world) Welcome to DrScheme, version 4.1.0.2-svn29aug2008 [3m]. Language: Module; memory limit: 128 megabytes. > key-event? - : (Any -> Boolean : ((restrict KeyEvent)) ((remove KeyEvent))) # > (key-event? 'left) - : Boolean #t > (: k KeyEvent) > (define k 'left) typecheck: Expected KeyEvent, but got 'left in: (quote left) Is this a bug in Typed Scheme, or am I doing something wrong? Thanks, David From pdkhai89 at yahoo.com Wed Sep 3 08:34:29 2008 From: pdkhai89 at yahoo.com (Pham Dinh Khai) Date: Thu Mar 26 02:27:28 2009 Subject: [plt-scheme] Fw: anonymus storage and named storage Message-ID: <226930.54521.qm@web34407.mail.mud.yahoo.com> --- On Wed, 8/27/08, Pham Dinh Khai wrote: > From: Pham Dinh Khai > Subject: anonymus storage and named storage > Date: Wednesday, August 27, 2008, 8:55 PM > Hi there, > I'm now studying DrScheme language programming. > Could you tell me clearly about the meaning of anonymus > storage and named storage in Drscheme language? > I'm looking forward to hearing from you soon > Thanks, > khai From dvanhorn at ccs.neu.edu Wed Sep 3 18:28:51 2008 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Thu Mar 26 02:27:28 2009 Subject: [plt-scheme] Typed tetris Message-ID: <48BF0FA3.7040305@ccs.neu.edu> I've ported my Tetris game (planet dvanhorn/tetris) to the Typed Scheme language. I thought it might be compelling for those interested in using Typed Scheme and the Student language with the World teachpack. To compare the untyped and typed variants see: http://planet.plt-scheme.org/package-source/dvanhorn/tetris.plt/2/3/tetris.ss http://planet.plt-scheme.org/package-source/dvanhorn/tetris.plt/2/3/typed-tetris.ss The transition from HtDP-style contracts (in comments) to Typed Scheme types was effortless. However I had to give up all of my test cases since I couldn't make check-expect work in Typed Scheme. [There is a workaround: have an untyped module for test cases that requires the TS code and htdp/testing.] I had to require the needed bindings from the Student Language and the World teachpack with appropriate types. It would be nicer if there were typed variants of the teaching languages and teachpacks. I also had to rewrite the one occurrence of local into a letrec: since there is no Typed Scheme local. David From samth at ccs.neu.edu Thu Sep 4 01:08:03 2008 From: samth at ccs.neu.edu (Sam TH) Date: Thu Mar 26 02:27:28 2009 Subject: [plt-scheme] check-expect and Typed Scheme In-Reply-To: <48BEEF9D.3060402@ccs.neu.edu> References: <48BED909.3040206@ccs.neu.edu> <83132930-778F-4977-A6AE-865FBC7AEE47@ccs.neu.edu> <48BEEF9D.3060402@ccs.neu.edu> Message-ID: <63bb19ae0809032208n5d7fd9b0se07d7031d93a5c91@mail.gmail.com> On Wed, Sep 3, 2008 at 4:12 PM, David Van Horn wrote: > Matthias Felleisen wrote: >> >> No, not yet. > > OK. On a related note... this doesn't behave as I expected. > > #lang typed-scheme > (require/opaque-type KeyEvent key-event? htdp/world) > > Welcome to DrScheme, version 4.1.0.2-svn29aug2008 [3m]. > Language: Module; memory limit: 128 megabytes. >> key-event? > - : (Any -> Boolean : ((restrict KeyEvent)) ((remove KeyEvent))) > # >> (key-event? 'left) > - : Boolean > #t >> (: k KeyEvent) >> (define k 'left) > typecheck: Expected KeyEvent, but got 'left in: (quote left) > > > Is this a bug in Typed Scheme, or am I doing something wrong? So I think the answer is that you're expecting more from Opaque types than they provide. All they give you is a type that you can check for. In particular, if you haven't checked for it, it won't ever be a KeyEvent. The only ways to construct a KeyEvent are to `require' one, or test for one with `key-event?'. So even though (key-event? 'left) is #t, the typechecker doesn't know that. Does that explain what's going on here? -- sam th samth@ccs.neu.edu From DekuDekuplex at Yahoo.com Thu Sep 4 01:13:41 2008 From: DekuDekuplex at Yahoo.com (Benjamin L.Russell) Date: Thu Mar 26 02:27:28 2009 Subject: [plt-scheme] Re: Off topic: Why does Common Lisp have two namespaces (lisp2)? References: <756daca50809021946p741923ccx78f0a0ae64789b1b@mail.gmail.com> <756daca50809021946p741923ccx78f0a0ae64789b1b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> <4D89CF89-CFD9-45A4-9AE1-7E8ADBEC2E13@alan-watson.org> Message-ID: <16qub4ll0ncesk8bsbqfdi1bn5sj9v1f69@4ax.com> On Wed, 3 Sep 2008 08:22:17 -0500, Alan Watson wrote: >See: > >http://www.nhplace.com/kent/Papers/Technical-Issues.html Very illuminating! Ever since my first exposure to both Scheme and Common Lisp in college, I had never quite understood why I had always had so much more difficulty in programming in Common Lisp than in Scheme in solving exercises similar to those that appear in SICP. At first, I had thought that it was because of namespace collisions in Common Lisp. But after seeing the above-referenced document, I realize that the issue was deeper: It actually had to do with the differentiation between function namespaces and value namespaces, and the resulting cumbersomeness of writing certain higher-order functions in Common Lisp. Specifically, to cite the above-referenced document: >Lisp2 is slightly more complicated than Lisp1 in situations where we would want to do either of the following: > > * Fetch the value of an identifier in the value namespace and call it as a function > * Fetch the value of an identifier in the function namespace and pass it around as a value. > >To use the value of an identifier in the value namespace as a function, Lisp2 provides this notation: > > (FUNCALL . ) > >For example, in Lisp2 one would write > > (DEFUN MAPC-1 (F L) (DOLIST (X L) (FUNCALL F X))) > >In Lisp1, one would write > > (DEFUN MAPC-1 (F L) (DOLIST (X L) (F X))) I vaguely remember this 'FUNCALL notation and how lack of a good understanding of how to use this notation at the time caused difficulties in writing some higher-order functions. The above-referenced document continues: >To use the value of an identifier in the function namespace as a normal value, Lisp2 provides this notation: > > (FUNCTION ) > >which is often abbreviated as simply > > #' > >For example, in Lisp2 one would write > > (MAPC #'PRINT '(A B C D)) > >In Lisp1, one would write > > (MAPC PRINT '(A B C D)) Again, I vaguely remember having had difficulties in differentiating between the 'FUNCTION, 'FUNCALL, '#'', and ''' notations (especially when sleep-deprived, as I always was). To continue: >The differences are more striking in a larger, more complex example. In Lisp2, one can write the Y operator as > > (DEFUN Y (F) > ( (LAMBDA (G) #'(LAMBDA (H) (FUNCALL (FUNCALL F (FUNCALL G G)) H))) > #'(LAMBDA (G) #'(LAMBDA (H) (FUNCALL (FUNCALL F (FUNCALL G G)) H))))) > >while in Lisp1, one can write > > (DEFUN Y (F) > ((LAMBDA (G) (LAMBDA (H) ((F (G G)) H))) > (LAMBDA (G) (LAMBDA (H) ((F (G G)) H))))) Perhaps this is just a matter of taste, but personally, I find the second (Lisp1) example much easier to write and understand when sleep-deprived (as I perpetually was in college) than the first (Lisp2). Again, to continue: >The call to this operator in order to compute 6! in Lisp2 would look like > > (FUNCALL (Y #'(LAMBDA (FN) > #'(LAMBDA (X) > (IF (ZEROP X) 1 (* X (FUNCALL FN (- X 1))))))) > 6) > >In Lisp1, the same call would look like > > ((Y (LAMBDA (FN) > (LAMBDA (X) > (IF (ZEROP X) 1 (* X (FN (- X 1))))))) > 6) Perhaps some would actually prefer the differentiation between function namespaces and value namespaces, but if I were a sleep-deprived student in an introductory course in computer science covering problems similar to those in SICP, I would find the former (Lisp2) notation much harder to understand at a glance than the latter (Lisp1) notation. The latter notation allows me to divide the code into lexical closures just by glancing at the function-names in the functional positions and the lambda-calls; the former notation forces me to parse the code manually and to treat instances of 'FUNCALL '#'' as special cases.. -- Benjamin L. Russell From noelwelsh at gmail.com Thu Sep 4 07:08:28 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:27:28 2009 Subject: [plt-scheme] Typed tetris In-Reply-To: <48BF0FA3.7040305@ccs.neu.edu> References: <48BF0FA3.7040305@ccs.neu.edu> Message-ID: Nice. The difference between the two version seems quite minor. Typed Scheme has certainly been polished since I last used it. N. On Wed, Sep 3, 2008 at 11:28 PM, David Van Horn wrote: > I've ported my Tetris game (planet dvanhorn/tetris) to the Typed Scheme > language. I thought it might be compelling for those interested in using > Typed Scheme and the Student language with the World teachpack. > > To compare the untyped and typed variants see: > > http://planet.plt-scheme.org/package-source/dvanhorn/tetris.plt/2/3/tetris.ss > http://planet.plt-scheme.org/package-source/dvanhorn/tetris.plt/2/3/typed-tetris.ss > ... From cobbe at ccs.neu.edu Thu Sep 4 08:21:43 2008 From: cobbe at ccs.neu.edu (Richard Cobbe) Date: Thu Mar 26 02:27:28 2009 Subject: [plt-scheme] check-expect and Typed Scheme In-Reply-To: <63bb19ae0809032208n5d7fd9b0se07d7031d93a5c91@mail.gmail.com> References: <48BED909.3040206@ccs.neu.edu> <83132930-778F-4977-A6AE-865FBC7AEE47@ccs.neu.edu> <48BEEF9D.3060402@ccs.neu.edu> <63bb19ae0809032208n5d7fd9b0se07d7031d93a5c91@mail.gmail.com> Message-ID: <20080904122143.GA520@perdita.local> On Thu, Sep 04, 2008 at 01:08:03AM -0400, Sam TH wrote: > So I think the answer is that you're expecting more from Opaque types > than they provide. All they give you is a type that you can check > for. In particular, if you haven't checked for it, it won't ever be a > KeyEvent. The only ways to construct a KeyEvent are to `require' one, > or test for one with `key-event?'. So even though (key-event? 'left) > is #t, the typechecker doesn't know that. > > Does that explain what's going on here? Yes, and this fits with my previous experience with opaque types. But I'm curious about the pragmatics of the situation. The following looks like the right idiom to me, but I'm interested in feedback. (module source scheme (define (key-event? x) ...) (define (inject-key-event x) (if (key-event? x) x (error ...))) (provide/contract [key-event? (any? . -> . boolean?)] [inject-key-event (any? . -> . key-event?)])) (module client typed-scheme (require-opaque-type Key-Event key-event? source) (require/typed inject-key-event (Any -> Key-Event) source) ...) Notes: - if you wanted to treat the Key-Event as a Symbol, say, in the client module, you'd probably need a projection function or functions as well. These would probably just be special-purpose versions of the identity function, at least in this case. - depending on the representation of key-events as defined in the source module, you could give `inject-key-event' a more restrictive domain, both in the type and the contract. Sound reasonable? Are the contracts and the types redundant? Consistent? (I didn't have time to actually try this out, so I have no idea if it compiles.) * * * * * One of the most interesting things to me about the growth of typed scheme is the changes to normal Scheme idioms that it requires. It's a fascinating and occasionally frustrating process to watch as people (including myself) try to develop new pragmatic tools for working with the new language. Richard From dvanhorn at ccs.neu.edu Thu Sep 4 09:27:13 2008 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Thu Mar 26 02:27:29 2009 Subject: [plt-scheme] check-expect and Typed Scheme In-Reply-To: <63bb19ae0809032208n5d7fd9b0se07d7031d93a5c91@mail.gmail.com> References: <48BED909.3040206@ccs.neu.edu> <83132930-778F-4977-A6AE-865FBC7AEE47@ccs.neu.edu> <48BEEF9D.3060402@ccs.neu.edu> <63bb19ae0809032208n5d7fd9b0se07d7031d93a5c91@mail.gmail.com> Message-ID: <48BFE231.2050203@ccs.neu.edu> Sam TH wrote: > So I think the answer is that you're expecting more from Opaque types > than they provide. All they give you is a type that you can check > for. In particular, if you haven't checked for it, it won't ever be a > KeyEvent. The only ways to construct a KeyEvent are to `require' one, > or test for one with `key-event?'. So even though (key-event? 'left) > is #t, the typechecker doesn't know that. > > Does that explain what's going on here? Yes, thanks for the explanation Sam. But can you see where I'm coming from based on the current documentation? The type is defined as precisely those values to which pred produces #t. Since (key-event? 'left) is true, 'left has type KeyEvent. Or so I thought. Maybe you could update the docs to include some of the explanation you gave me? Also, Richard captured much of what I was going to ask about, so I'm interested in hearing the response. In this particular case, I could've also just defined a type alias KeyEvent for (U Symbol Char), without need for inj/proj functions. Is there a benefit to one over the other? David From matthias at ccs.neu.edu Thu Sep 4 09:31:22 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:27:29 2009 Subject: [plt-scheme] check-expect and Typed Scheme In-Reply-To: <20080904122143.GA520@perdita.local> References: <48BED909.3040206@ccs.neu.edu> <83132930-778F-4977-A6AE-865FBC7AEE47@ccs.neu.edu> <48BEEF9D.3060402@ccs.neu.edu> <63bb19ae0809032208n5d7fd9b0se07d7031d93a5c91@mail.gmail.com> <20080904122143.GA520@perdita.local> Message-ID: <98CBE582-6D51-4F4E-97F2-210A08476145@ccs.neu.edu> I tend to move the inject function into the Typed Scheme module: (: to-keyevent (Any -> KeyEvent)) (define (to-keyevent x) (if (keyevent? x) x (error 'to-keyevent "shouldn't happen: ~s" x))) ; later (: ke KeyEvent) (define ke (to-keyevent 'left)) Sad thing is, though, I had encountered the same situation as Dave two days before and when I saw it in an email I didn't recognize it. So perhaps there is room for improvement. -- Matthias On Sep 4, 2008, at 8:21 AM, Richard Cobbe wrote: > On Thu, Sep 04, 2008 at 01:08:03AM -0400, Sam TH wrote: > >> So I think the answer is that you're expecting more from Opaque types >> than they provide. All they give you is a type that you can check >> for. In particular, if you haven't checked for it, it won't ever >> be a >> KeyEvent. The only ways to construct a KeyEvent are to `require' >> one, >> or test for one with `key-event?'. So even though (key-event? 'left) >> is #t, the typechecker doesn't know that. >> >> Does that explain what's going on here? > > Yes, and this fits with my previous experience with opaque types. > But I'm > curious about the pragmatics of the situation. The following looks > like > the right idiom to me, but I'm interested in feedback. > > (module source scheme > > (define (key-event? x) ...) > (define (inject-key-event x) > (if (key-event? x) > x > (error ...))) > > (provide/contract > [key-event? (any? . -> . boolean?)] > [inject-key-event (any? . -> . key-event?)])) > > (module client typed-scheme > > (require-opaque-type Key-Event key-event? source) > (require/typed inject-key-event (Any -> Key-Event) source) > > ...) > > Notes: > > - if you wanted to treat the Key-Event as a Symbol, say, in the > client module, you'd probably need a projection function or > functions > as well. These would probably just be special-purpose versions > of the > identity function, at least in this case. > > - depending on the representation of key-events as defined in the > source > module, you could give `inject-key-event' a more restrictive > domain, > both in the type and the contract. > > Sound reasonable? > > Are the contracts and the types redundant? Consistent? (I didn't > have > time to actually try this out, so I have no idea if it compiles.) > > * * * * * > > One of the most interesting things to me about the growth of typed > scheme > is the changes to normal Scheme idioms that it requires. It's a > fascinating and occasionally frustrating process to watch as people > (including myself) try to develop new pragmatic tools for working > with the > new language. > > Richard > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From robby at cs.uchicago.edu Thu Sep 4 09:37:29 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:29 2009 Subject: [plt-scheme] check-expect and Typed Scheme In-Reply-To: <98CBE582-6D51-4F4E-97F2-210A08476145@ccs.neu.edu> References: <48BED909.3040206@ccs.neu.edu> <83132930-778F-4977-A6AE-865FBC7AEE47@ccs.neu.edu> <48BEEF9D.3060402@ccs.neu.edu> <63bb19ae0809032208n5d7fd9b0se07d7031d93a5c91@mail.gmail.com> <20080904122143.GA520@perdita.local> <98CBE582-6D51-4F4E-97F2-210A08476145@ccs.neu.edu> Message-ID: <932b2f1f0809040637h97e79fci1348a53236ff693d@mail.gmail.com> Should those inject functions be written as assertions? That way typed scheme can track them better and presumably give better, more uniform error messages (including source location of the assertion, etc). I'm thinking of something like: (define to-keyevent (assert (-> any/c key-event) (lambda (x) x))) where "assert" comes from typed scheme (and would be morally equivalent to defining to-keyevent in a separate module and exporting it with a contract). Robby On Thu, Sep 4, 2008 at 8:31 AM, Matthias Felleisen wrote: > > I tend to move the inject function into the Typed Scheme > module: > > > (: to-keyevent (Any -> KeyEvent)) > (define (to-keyevent x) > (if (keyevent? x) x (error 'to-keyevent "shouldn't happen: ~s" x))) > > ; later > > (: ke KeyEvent) > (define ke (to-keyevent 'left)) > > Sad thing is, though, I had encountered the same situation as > Dave two days before and when I saw it in an email I didn't > recognize it. So perhaps there is room for improvement. > > -- Matthias > > > > > > > > > > On Sep 4, 2008, at 8:21 AM, Richard Cobbe wrote: > >> On Thu, Sep 04, 2008 at 01:08:03AM -0400, Sam TH wrote: >> >>> So I think the answer is that you're expecting more from Opaque types >>> than they provide. All they give you is a type that you can check >>> for. In particular, if you haven't checked for it, it won't ever be a >>> KeyEvent. The only ways to construct a KeyEvent are to `require' one, >>> or test for one with `key-event?'. So even though (key-event? 'left) >>> is #t, the typechecker doesn't know that. >>> >>> Does that explain what's going on here? >> >> Yes, and this fits with my previous experience with opaque types. But I'm >> curious about the pragmatics of the situation. The following looks like >> the right idiom to me, but I'm interested in feedback. >> >> (module source scheme >> >> (define (key-event? x) ...) >> (define (inject-key-event x) >> (if (key-event? x) >> x >> (error ...))) >> >> (provide/contract >> [key-event? (any? . -> . boolean?)] >> [inject-key-event (any? . -> . key-event?)])) >> >> (module client typed-scheme >> >> (require-opaque-type Key-Event key-event? source) >> (require/typed inject-key-event (Any -> Key-Event) source) >> >> ...) >> >> Notes: >> >> - if you wanted to treat the Key-Event as a Symbol, say, in the >> client module, you'd probably need a projection function or functions >> as well. These would probably just be special-purpose versions of the >> identity function, at least in this case. >> >> - depending on the representation of key-events as defined in the source >> module, you could give `inject-key-event' a more restrictive domain, >> both in the type and the contract. >> >> Sound reasonable? >> >> Are the contracts and the types redundant? Consistent? (I didn't have >> time to actually try this out, so I have no idea if it compiles.) >> >> * * * * * >> >> One of the most interesting things to me about the growth of typed scheme >> is the changes to normal Scheme idioms that it requires. It's a >> fascinating and occasionally frustrating process to watch as people >> (including myself) try to develop new pragmatic tools for working with the >> new language. >> >> Richard >> _________________________________________________ >> 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 Sep 4 09:39:24 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:27:29 2009 Subject: [plt-scheme] check-expect and Typed Scheme In-Reply-To: <932b2f1f0809040637h97e79fci1348a53236ff693d@mail.gmail.com> References: <48BED909.3040206@ccs.neu.edu> <83132930-778F-4977-A6AE-865FBC7AEE47@ccs.neu.edu> <48BEEF9D.3060402@ccs.neu.edu> <63bb19ae0809032208n5d7fd9b0se07d7031d93a5c91@mail.gmail.com> <20080904122143.GA520@perdita.local> <98CBE582-6D51-4F4E-97F2-210A08476145@ccs.neu.edu> <932b2f1f0809040637h97e79fci1348a53236ff693d@mail.gmail.com> Message-ID: <87329F72-85EE-4B14-8E7B-5C1DEBBAEB5B@ccs.neu.edu> Yes. In my "synthesize" view of the world (DLS 2006) this is exactly where they come from. -- Matthias On Sep 4, 2008, at 9:37 AM, Robby Findler wrote: > Should those inject functions be written as assertions? That way typed > scheme can track them better and presumably give better, more uniform > error messages (including source location of the assertion, etc). I'm > thinking of something like: > > (define to-keyevent (assert (-> any/c key-event) (lambda (x) x))) > > where "assert" comes from typed scheme (and would be morally > equivalent to defining to-keyevent in a separate module and exporting > it with a contract). > > Robby > > On Thu, Sep 4, 2008 at 8:31 AM, Matthias Felleisen > wrote: >> >> I tend to move the inject function into the Typed Scheme >> module: >> >> >> (: to-keyevent (Any -> KeyEvent)) >> (define (to-keyevent x) >> (if (keyevent? x) x (error 'to-keyevent "shouldn't happen: ~s" x))) >> >> ; later >> >> (: ke KeyEvent) >> (define ke (to-keyevent 'left)) >> >> Sad thing is, though, I had encountered the same situation as >> Dave two days before and when I saw it in an email I didn't >> recognize it. So perhaps there is room for improvement. >> >> -- Matthias >> >> >> >> >> >> >> >> >> >> On Sep 4, 2008, at 8:21 AM, Richard Cobbe wrote: >> >>> On Thu, Sep 04, 2008 at 01:08:03AM -0400, Sam TH wrote: >>> >>>> So I think the answer is that you're expecting more from Opaque >>>> types >>>> than they provide. All they give you is a type that you can check >>>> for. In particular, if you haven't checked for it, it won't >>>> ever be a >>>> KeyEvent. The only ways to construct a KeyEvent are to >>>> `require' one, >>>> or test for one with `key-event?'. So even though (key-event? >>>> 'left) >>>> is #t, the typechecker doesn't know that. >>>> >>>> Does that explain what's going on here? >>> >>> Yes, and this fits with my previous experience with opaque >>> types. But I'm >>> curious about the pragmatics of the situation. The following >>> looks like >>> the right idiom to me, but I'm interested in feedback. >>> >>> (module source scheme >>> >>> (define (key-event? x) ...) >>> (define (inject-key-event x) >>> (if (key-event? x) >>> x >>> (error ...))) >>> >>> (provide/contract >>> [key-event? (any? . -> . boolean?)] >>> [inject-key-event (any? . -> . key-event?)])) >>> >>> (module client typed-scheme >>> >>> (require-opaque-type Key-Event key-event? source) >>> (require/typed inject-key-event (Any -> Key-Event) source) >>> >>> ...) >>> >>> Notes: >>> >>> - if you wanted to treat the Key-Event as a Symbol, say, in the >>> client module, you'd probably need a projection function or >>> functions >>> as well. These would probably just be special-purpose >>> versions of the >>> identity function, at least in this case. >>> >>> - depending on the representation of key-events as defined in >>> the source >>> module, you could give `inject-key-event' a more restrictive >>> domain, >>> both in the type and the contract. >>> >>> Sound reasonable? >>> >>> Are the contracts and the types redundant? Consistent? (I >>> didn't have >>> time to actually try this out, so I have no idea if it compiles.) >>> >>> * * * * * >>> >>> One of the most interesting things to me about the growth of >>> typed scheme >>> is the changes to normal Scheme idioms that it requires. It's a >>> fascinating and occasionally frustrating process to watch as people >>> (including myself) try to develop new pragmatic tools for working >>> with the >>> new language. >>> >>> Richard >>> _________________________________________________ >>> 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 cobbe at ccs.neu.edu Thu Sep 4 10:40:35 2008 From: cobbe at ccs.neu.edu (Richard Cobbe) Date: Thu Mar 26 02:27:29 2009 Subject: [plt-scheme] check-expect and Typed Scheme In-Reply-To: <98CBE582-6D51-4F4E-97F2-210A08476145@ccs.neu.edu> References: <48BED909.3040206@ccs.neu.edu> <83132930-778F-4977-A6AE-865FBC7AEE47@ccs.neu.edu> <48BEEF9D.3060402@ccs.neu.edu> <63bb19ae0809032208n5d7fd9b0se07d7031d93a5c91@mail.gmail.com> <20080904122143.GA520@perdita.local> <98CBE582-6D51-4F4E-97F2-210A08476145@ccs.neu.edu> Message-ID: <20080904144035.GA570@perdita.local> On Thu, Sep 04, 2008 at 09:31:22AM -0400, Matthias Felleisen wrote: > > I tend to move the inject function into the Typed Scheme > module: > > > (: to-keyevent (Any -> KeyEvent)) > (define (to-keyevent x) > (if (keyevent? x) x (error 'to-keyevent "shouldn't happen: ~s" x))) Oh, of course. I'd forgotten that Typed Scheme uses the predicate in the conditional to restrict the type of x in the first branch of the if. Given that, putting the injection functions into the typed module makes sense, because untyped clients are unlikely to use them (especially if the untyped modules use contracts). Can you write the projections in Typed Scheme, though? Or do those still have to be in the untyped world? Richard From samth at ccs.neu.edu Thu Sep 4 12:30:43 2008 From: samth at ccs.neu.edu (Sam TH) Date: Thu Mar 26 02:27:29 2009 Subject: [plt-scheme] check-expect and Typed Scheme In-Reply-To: <20080904144035.GA570@perdita.local> References: <48BED909.3040206@ccs.neu.edu> <83132930-778F-4977-A6AE-865FBC7AEE47@ccs.neu.edu> <48BEEF9D.3060402@ccs.neu.edu> <63bb19ae0809032208n5d7fd9b0se07d7031d93a5c91@mail.gmail.com> <20080904122143.GA520@perdita.local> <98CBE582-6D51-4F4E-97F2-210A08476145@ccs.neu.edu> <20080904144035.GA570@perdita.local> Message-ID: <63bb19ae0809040930pbde5c11uca1768fe4a4033dd@mail.gmail.com> On Thu, Sep 4, 2008 at 10:40 AM, Richard Cobbe wrote: > On Thu, Sep 04, 2008 at 09:31:22AM -0400, Matthias Felleisen wrote: >> >> I tend to move the inject function into the Typed Scheme >> module: >> >> >> (: to-keyevent (Any -> KeyEvent)) >> (define (to-keyevent x) >> (if (keyevent? x) x (error 'to-keyevent "shouldn't happen: ~s" x))) > > Oh, of course. I'd forgotten that Typed Scheme uses the predicate in the > conditional to restrict the type of x in the first branch of the if. Given > that, putting the injection functions into the typed module makes sense, > because untyped clients are unlikely to use them (especially if the untyped > modules use contracts). > > Can you write the projections in Typed Scheme, though? Or do those still > have to be in the untyped world? Most likely not. The only operations you have on an opaque type are ones you require from other modules, so any project would have to be imported. -- sam th samth@ccs.neu.edu From billclem at gmail.com Thu Sep 4 12:45:01 2008 From: billclem at gmail.com (Bill Clementson) Date: Thu Mar 26 02:27:30 2009 Subject: [plt-scheme] Vancouver Lisp Users Group meeting for September 2008 - The BKNR Common Lisp web application development environment Message-ID: <8757cb490809040945gcb0c97fsabfd40c9d09b921d@mail.gmail.com> Hi all, We've had a few presentations on web application development environments/frameworks at lispvan. For our September lispvan meeting, Hans H?bner will be flying over from Berlin (actually, he's coming for the ICFP conference in Victoria, but has graciously agreed to come over to Vancouver for the evening while he's in the area) to give us a presentation on BKNR. BKNR is neat in that it provides it's own object persistence layer as part of the web application development environment. It's nice to be able to hear about different web application development frameworks from the authors/users of those frameworks and it will be interesting to be able to compare/contrast BKNR with the others we've seen at lispvan meetings. We are planning to have the meeting at our new location (with a projector and a special meeting room!) as the owner of the new cafe (which is located right next door to the Mac Market) expects the construction work to be completed by our meeting date. I'll update this post closer to the meeting date with any changes (in the event that the new meeting venue isn't ready in time). Here's the "official" meeting notice: Topic: The BKNR Common Lisp web application development environment Presenter: Hans H?bner Date: Thursday, September 25th, 2008 Time: 7pm - 10pm (or whenever) Venue: no-name cafe next door to the Mac Market, 2774 West 4th Avenue (at MacDonald Street), Vancouver Summary: BKNR is a collection of Common Lisp packages used to develop and deploy web applications. It consists of a number of open source Lisp modules and adds several framework level modules. The goal is to have a one-stop repository for all base software to aid in easy deployment and configuration reproducability. The major component in the BKNR framework is the pure Lisp transaction-based persistence layer. It provides for in-memory object persistence and delivers high performance with small development overhead. The web components of BKNR make it easy to serve persistent objects using HTTP in XML, HTML or other formats. The presentation shows the guiding principles for BKNR, architectures and features of the data store and web components, current applications and future plans. The presenter: Hans H?bner has been a hacker for over 20 years. Coming from an object oriented and system programming background with extensive commercial development experience in C++ and Perl, he discovered Common Lisp as his favourite programming language in 2001. He is currently a freelance consultant with Clozure Associates and ITA Software. His research interests include persistence systems and hardware to support dynamic programming. Some links: http://bknr.net/ http://vaxbusters.org/workshop/secd.xml http://headcraft.de/ Join us for a beer/coffee and a chance to see/discuss the BKNR Common Lisp web application development environment. Any updates (and a copy of this notice with additional links) will be posted on my blog: http://bc.tech.coop/blog/080904.html -- Bill Clementson From cce at ccs.neu.edu Thu Sep 4 13:03:15 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:27:30 2009 Subject: [plt-scheme] check-expect and Typed Scheme In-Reply-To: <63bb19ae0809040930pbde5c11uca1768fe4a4033dd@mail.gmail.com> References: <48BED909.3040206@ccs.neu.edu> <83132930-778F-4977-A6AE-865FBC7AEE47@ccs.neu.edu> <48BEEF9D.3060402@ccs.neu.edu> <63bb19ae0809032208n5d7fd9b0se07d7031d93a5c91@mail.gmail.com> <20080904122143.GA520@perdita.local> <98CBE582-6D51-4F4E-97F2-210A08476145@ccs.neu.edu> <20080904144035.GA570@perdita.local> <63bb19ae0809040930pbde5c11uca1768fe4a4033dd@mail.gmail.com> Message-ID: <990e0c030809041003k61d086ebjba358cd26423617f@mail.gmail.com> On Thu, Sep 4, 2008 at 12:30 PM, Sam TH wrote: > On Thu, Sep 4, 2008 at 10:40 AM, Richard Cobbe wrote: >> >> Oh, of course. I'd forgotten that Typed Scheme uses the predicate in the >> conditional to restrict the type of x in the first branch of the if. Given >> that, putting the injection functions into the typed module makes sense, >> because untyped clients are unlikely to use them (especially if the untyped >> modules use contracts). >> >> Can you write the projections in Typed Scheme, though? Or do those still >> have to be in the untyped world? > > Most likely not. The only operations you have on an opaque type are > ones you require from other modules, so any project would have to be > imported. No, you also have operations defined on all types, such as predicates. The following typechecks just fine, and runs without error: #lang typed-scheme (require/opaque-type KeyEvent key-event? htdp/world) (: to-keyevent (Any -> KeyEvent)) (define (to-keyevent x) (if (key-event? x) x (error 'to-keyevent "shouldn't happen: ~s" x))) (: to-symbol (KeyEvent -> Symbol)) (define (to-symbol ke) (if (symbol? ke) ke (error 'to-symbol "not a symbol: ~s" ke))) (: ke KeyEvent) (define ke (to-keyevent 'left)) (: sym Symbol) (define sym (to-symbol ke)) -- Carl Eastlund From samth at ccs.neu.edu Thu Sep 4 13:13:26 2008 From: samth at ccs.neu.edu (Sam TH) Date: Thu Mar 26 02:27:30 2009 Subject: [plt-scheme] check-expect and Typed Scheme In-Reply-To: <990e0c030809041003k61d086ebjba358cd26423617f@mail.gmail.com> References: <48BED909.3040206@ccs.neu.edu> <83132930-778F-4977-A6AE-865FBC7AEE47@ccs.neu.edu> <48BEEF9D.3060402@ccs.neu.edu> <63bb19ae0809032208n5d7fd9b0se07d7031d93a5c91@mail.gmail.com> <20080904122143.GA520@perdita.local> <98CBE582-6D51-4F4E-97F2-210A08476145@ccs.neu.edu> <20080904144035.GA570@perdita.local> <63bb19ae0809040930pbde5c11uca1768fe4a4033dd@mail.gmail.com> <990e0c030809041003k61d086ebjba358cd26423617f@mail.gmail.com> Message-ID: <63bb19ae0809041013u37f489fbga01d00377b0981ba@mail.gmail.com> On Thu, Sep 4, 2008 at 1:03 PM, Carl Eastlund wrote: > On Thu, Sep 4, 2008 at 12:30 PM, Sam TH wrote: >> On Thu, Sep 4, 2008 at 10:40 AM, Richard Cobbe wrote: >>> >>> Oh, of course. I'd forgotten that Typed Scheme uses the predicate in the >>> conditional to restrict the type of x in the first branch of the if. Given >>> that, putting the injection functions into the typed module makes sense, >>> because untyped clients are unlikely to use them (especially if the untyped >>> modules use contracts). >>> >>> Can you write the projections in Typed Scheme, though? Or do those still >>> have to be in the untyped world? >> >> Most likely not. The only operations you have on an opaque type are >> ones you require from other modules, so any project would have to be >> imported. > > No, you also have operations defined on all types, such as predicates. > The following typechecks just fine, and runs without error: Yes, of course. I wasn't thinking of those as projections, since nothing is actually being done to the key-events. But I guess it all comes down to what you mean by injections and projections. -- sam th samth@ccs.neu.edu From dave at pawfal.org Fri Sep 5 17:45:36 2008 From: dave at pawfal.org (Dave Griffiths) Date: Thu Mar 26 02:27:30 2009 Subject: [plt-scheme] optimizer crash in embedded mzscheme Message-ID: <1220651136.19066.36.camel@daves-laptop> Hi all, I've upgraded from 3.99 to 4.1 and I've started getting crashes in my mzscheme embedded app. They're coming from errors in my scheme module code, which are being correctly reported by the optimiser, but crashes in scheme_log_message. This only seems to be happening after I've reset my interpreter by calling scheme_basic_env() a second time - which may or may not be related. Just thought I'd ask before delving deeper in case it's a simple API change I've missed. I'll try and cobble together some smallish amount of code that exhibits this if it's required. cheers, dave From alan at alan-watson.org Fri Sep 5 20:13:35 2008 From: alan at alan-watson.org (Alan Watson) Date: Thu Mar 26 02:27:30 2009 Subject: [plt-scheme] Opening file in text mode Message-ID: <31D87412-B6B0-410E-9EE6-045CE1FA463B@alan-watson.org> Is there any way to tell DrScheme to open a file in text mode rather than Scheme mode? In Emacs I would just add -*-text-*- to the top of the file. Thanks. Alan -- Alan Watson http://www.alan-watson.org/ From grettke at acm.org Fri Sep 5 23:10:30 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:30 2009 Subject: [plt-scheme] End of week 1: How are you doing? Message-ID: <756daca50809052010m265f0fbcg48b4ed82ab9332bd@mail.gmail.com> Hi folks, It is the end of our first week. How are you all doing? Best wishes, Grant From grettke at acm.org Sat Sep 6 00:47:45 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:31 2009 Subject: [plt-scheme] HTDP: What does exercise 3.3.6 suggest about composition? Message-ID: <756daca50809052147p2a7251eclaf4a993b1cdb9933@mail.gmail.com> I completed exercise 3.3.6 and I'm not sure what it suggest about function composition. What am I doing wrong? From dvanhorn at ccs.neu.edu Sat Sep 6 01:25:52 2008 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Thu Mar 26 02:27:31 2009 Subject: [plt-scheme] HTDP: What does exercise 3.3.6 suggest about composition? In-Reply-To: <756daca50809052147p2a7251eclaf4a993b1cdb9933@mail.gmail.com> References: <756daca50809052147p2a7251eclaf4a993b1cdb9933@mail.gmail.com> Message-ID: <48C21460.2040001@ccs.neu.edu> Grant Rettke wrote: > I completed exercise 3.3.6 and I'm not sure what it suggest about > function composition. > > What am I doing wrong? You've misread the question. What does [evaluating (I 32)] suggest about the composition of the two functions [C->F and F->C, specifically]? David From dvanhorn at ccs.neu.edu Sat Sep 6 01:30:29 2008 From: dvanhorn at ccs.neu.edu (David Van Horn) Date: Thu Mar 26 02:27:31 2009 Subject: [plt-scheme] End of week 1: How are you doing? In-Reply-To: <756daca50809052010m265f0fbcg48b4ed82ab9332bd@mail.gmail.com> References: <756daca50809052010m265f0fbcg48b4ed82ab9332bd@mail.gmail.com> Message-ID: <48C21575.8060408@ccs.neu.edu> Grant Rettke wrote: > Hi folks, > > It is the end of our first week. How are you all doing? I think you meant for this message to go to the HtDP study group, but it went to plt-scheme instead ("you all" instead of "y'all" was the tell). David From matthias at ccs.neu.edu Sat Sep 6 07:45:47 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:27:31 2009 Subject: [plt-scheme] End of week 1: How are you doing? In-Reply-To: <48C21575.8060408@ccs.neu.edu> References: <756daca50809052010m265f0fbcg48b4ed82ab9332bd@mail.gmail.com> <48C21575.8060408@ccs.neu.edu> Message-ID: John Gateley (my most Southern student) used to say ya'll is the plural, y'all the singular. On Sep 6, 2008, at 1:30 AM, David Van Horn wrote: > Grant Rettke wrote: >> Hi folks, >> It is the end of our first week. How are you all doing? > > I think you meant for this message to go to the HtDP study group, > but it went to plt-scheme instead ("you all" instead of "y'all" was > the tell). > > David > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From grettke at acm.org Sat Sep 6 09:26:47 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:31 2009 Subject: [plt-scheme] End of week 1: How are you doing? In-Reply-To: <48C21575.8060408@ccs.neu.edu> References: <756daca50809052010m265f0fbcg48b4ed82ab9332bd@mail.gmail.com> <48C21575.8060408@ccs.neu.edu> Message-ID: <756daca50809060626pa55c1e9g39c84400e1556c00@mail.gmail.com> >> It is the end of our first week. How are you all doing? > > I think you meant for this message to go to the HtDP study group, but it > went to plt-scheme instead ("you all" instead of "y'all" was the tell). Yes, sorry. From grettke at acm.org Sat Sep 6 09:27:16 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:31 2009 Subject: [plt-scheme] End of week 1: How are you doing? In-Reply-To: References: <756daca50809052010m265f0fbcg48b4ed82ab9332bd@mail.gmail.com> <48C21575.8060408@ccs.neu.edu> Message-ID: <756daca50809060627k665375dcyc6f6650068885159@mail.gmail.com> > John Gateley (my most Southern student) used to say ya'll is the plural, > y'all the singular. In Texas, y'all is singular and all y'all is plural. From grettke at acm.org Sat Sep 6 09:27:34 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:32 2009 Subject: [plt-scheme] HTDP: What does exercise 3.3.6 suggest about composition? In-Reply-To: <48C21460.2040001@ccs.neu.edu> References: <756daca50809052147p2a7251eclaf4a993b1cdb9933@mail.gmail.com> <48C21460.2040001@ccs.neu.edu> Message-ID: <756daca50809060627v784e1ed9q56c0a42da5250796@mail.gmail.com> > You've misread the question. What does [evaluating (I 32)] suggest about > the composition of the two functions [C->F and F->C, specifically]? Understood, thanks. From mflatt at cs.utah.edu Sat Sep 6 13:46:43 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:27:32 2009 Subject: [plt-scheme] optimizer crash in embedded mzscheme In-Reply-To: <1220651136.19066.36.camel@daves-laptop> References: <1220651136.19066.36.camel@daves-laptop> Message-ID: <20080906174645.3C0506500A9@mail-svr1.cs.utah.edu> At Fri, 05 Sep 2008 22:45:36 +0100, Dave Griffiths wrote: > I've upgraded from 3.99 to 4.1 and I've started getting crashes in my > mzscheme embedded app. They're coming from errors in my scheme module > code, which are being correctly reported by the optimiser, but crashes > in scheme_log_message. > > This only seems to be happening after I've reset my interpreter by > calling scheme_basic_env() a second time - which may or may not be > related. I think the reset behavior of scheme_basic_env() is likely broken. It's fragile and not properly tested, so I'll look into that. Matthew From andre.mayers at usherbrooke.ca Sat Sep 6 14:28:43 2008 From: andre.mayers at usherbrooke.ca (Andre Mayers) Date: Thu Mar 26 02:27:32 2009 Subject: [plt-scheme] problem to create string with unicode In-Reply-To: <756daca50809052010m265f0fbcg48b4ed82ab9332bd@mail.gmail.com> References: <756daca50809052010m265f0fbcg48b4ed82ab9332bd@mail.gmail.com> Message-ID: <001601c9104e$64a331c0$2de99540$@mayers@usherbrooke.ca> I want to print a big sigma with (display (integer->char 9138))(newline) (display (integer->char 9139)) or with (display (string (integer->char 9138) #\return (integer->char 9139))) but I got extra character Andr? From noelwelsh at gmail.com Sat Sep 6 14:39:47 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:27:32 2009 Subject: [plt-scheme] problem to create string with unicode In-Reply-To: <3436699664071607979@unknownmsgid> References: <756daca50809052010m265f0fbcg48b4ed82ab9332bd@mail.gmail.com> <3436699664071607979@unknownmsgid> Message-ID: This works for me: #lang scheme/base (display "\u03A3") Does that help? N. On Sat, Sep 6, 2008 at 7:28 PM, Andre Mayers wrote: > I want to print a big sigma with > > (display (integer->char 9138))(newline) > (display (integer->char 9139)) > > or with > > (display (string (integer->char 9138) #\return (integer->char 9139))) > > but I got extra character > > Andr? > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From cobbe at ccs.neu.edu Sat Sep 6 15:21:32 2008 From: cobbe at ccs.neu.edu (Richard Cobbe) Date: Thu Mar 26 02:27:32 2009 Subject: [plt-scheme] problem to create string with unicode Message-ID: <20080906192132.GA2008@perdita.local> On Sat, Sep 06, 2008 at 02:28:43PM -0400, Andre Mayers wrote: > I want to print a big sigma with > > (display (integer->char 9138))(newline) > (display (integer->char 9139)) > > or with > > (display (string (integer->char 9138) #\return (integer->char 9139))) > > but I got extra character We'll need more information to help you here. Are you running in DrScheme or MzScheme? Which version? What OS? Which version? And what precisely are you seeing? Rendering Unicode text depends on a lot of things beyond DrScheme, not least of which is the specific font you're using. I tried this on MacOS 10.5.4 running DrScheme 4.1, and I'm seeing a gap between the two halves of the big sigma. As far as I can tell, this is a font thing rather than a DrScheme thing. On my system, it looks like only one font, Apple Symbol Regular, provides either of these two glyphs, and the large gap appears to be part of the glyphs themselves. I certainly get the gap in Apple's TextEdit.app as well as in DrScheme. So you can only get rid of that gap if you have control over the precise placement of the individual glyphs on the page or screen, and that's just not something that `display' gives you. Richard From andre.mayers at usherbrooke.ca Sat Sep 6 15:41:16 2008 From: andre.mayers at usherbrooke.ca (Andre Mayers) Date: Thu Mar 26 02:27:32 2009 Subject: [plt-scheme] problem to create string with unicode In-Reply-To: References: <756daca50809052010m265f0fbcg48b4ed82ab9332bd@mail.gmail.com> <3436699664071607979@unknownmsgid> Message-ID: <001701c91058$877380b0$965a8210$@mayers@usherbrooke.ca> No, I want a sigma that expand on two or three lines. -----Message d'origine----- De?: Noel Welsh [mailto:noelwelsh@gmail.com] Envoy??: September-06-08 2:40 PM ??: andre.mayers@usherbrooke.ca Cc?: PLTScheme List Objet?: Re: [plt-scheme] problem to create string with unicode This works for me: #lang scheme/base (display "\u03A3") Does that help? N. On Sat, Sep 6, 2008 at 7:28 PM, Andre Mayers wrote: > I want to print a big sigma with > > (display (integer->char 9138))(newline) > (display (integer->char 9139)) > > or with > > (display (string (integer->char 9138) #\return (integer->char 9139))) > > but I got extra character > > Andr? > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From andre.mayers at usherbrooke.ca Sat Sep 6 15:47:08 2008 From: andre.mayers at usherbrooke.ca (Andre Mayers) Date: Thu Mar 26 02:27:33 2009 Subject: [plt-scheme] problem to create string with unicode In-Reply-To: <20080906192132.GA2008@perdita.local> References: <20080906192132.GA2008@perdita.local> Message-ID: <001801c91059$5956bc00$0c043400$@mayers@usherbrooke.ca> OK. I understand that it is not a bug and that I cannot easily overcome the problem from within drscheme. I wanted something simple to show to my students. Thanks, Andre -----Message d'origine----- De?: plt-scheme-bounces@list.cs.brown.edu [mailto:plt-scheme-bounces@list.cs.brown.edu] De la part de Richard Cobbe Envoy??: September-06-08 3:22 PM ??: plt-scheme@list.cs.brown.edu Objet?: Re: [plt-scheme] problem to create string with unicode On Sat, Sep 06, 2008 at 02:28:43PM -0400, Andre Mayers wrote: > I want to print a big sigma with > > (display (integer->char 9138))(newline) > (display (integer->char 9139)) > > or with > > (display (string (integer->char 9138) #\return (integer->char 9139))) > > but I got extra character We'll need more information to help you here. Are you running in DrScheme or MzScheme? Which version? What OS? Which version? And what precisely are you seeing? Rendering Unicode text depends on a lot of things beyond DrScheme, not least of which is the specific font you're using. I tried this on MacOS 10.5.4 running DrScheme 4.1, and I'm seeing a gap between the two halves of the big sigma. As far as I can tell, this is a font thing rather than a DrScheme thing. On my system, it looks like only one font, Apple Symbol Regular, provides either of these two glyphs, and the large gap appears to be part of the glyphs themselves. I certainly get the gap in Apple's TextEdit.app as well as in DrScheme. So you can only get rid of that gap if you have control over the precise placement of the individual glyphs on the page or screen, and that's just not something that `display' gives you. Richard _________________________________________________ For list-related administrative tasks: http://list.cs.brown.edu/mailman/listinfo/plt-scheme From cobbe at ccs.neu.edu Sat Sep 6 15:58:46 2008 From: cobbe at ccs.neu.edu (Richard Cobbe) Date: Thu Mar 26 02:27:33 2009 Subject: [plt-scheme] problem to create string with unicode Message-ID: <20080906195846.GA2290@perdita.local> On Sat, Sep 06, 2008 at 03:47:08PM -0400, Andre Mayers wrote: > OK. I understand that it is not a bug and that I cannot easily overcome the > problem from within drscheme. > I wanted something simple to show to my students. I should have included: Depending on how much effort you want to put into this, it *should* be possible to use the MrEd text-rendering and placement primitives or the slideshow/pict module to generate what you want. Since that's more complex, it may not be something you want to show your students as a demo, though. Richard From mflatt at cs.utah.edu Sun Sep 7 09:12:39 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:27:33 2009 Subject: [plt-scheme] optimizer crash in embedded mzscheme In-Reply-To: <20080906174645.3C0506500A9@mail-svr1.cs.utah.edu> References: <1220651136.19066.36.camel@daves-laptop> <20080906174645.3C0506500A9@mail-svr1.cs.utah.edu> Message-ID: <20080907131240.C8793650091@mail-svr1.cs.utah.edu> At Sat, 6 Sep 2008 11:46:43 -0600, Matthew Flatt wrote: > At Fri, 05 Sep 2008 22:45:36 +0100, Dave Griffiths wrote: > > I've upgraded from 3.99 to 4.1 and I've started getting crashes in my > > mzscheme embedded app. They're coming from errors in my scheme module > > code, which are being correctly reported by the optimiser, but crashes > > in scheme_log_message. > > > > This only seems to be happening after I've reset my interpreter by > > calling scheme_basic_env() a second time - which may or may not be > > related. > > I think the reset behavior of scheme_basic_env() is likely broken. It's > fragile and not properly tested, so I'll look into that. As expected, when I added logging support, I didn't make sure that the `current-logger' parameter was reset correctly. This is fixed in SVN. Matthew From s.degabrielle at cs.ucl.ac.uk Sun Sep 7 10:01:45 2008 From: s.degabrielle at cs.ucl.ac.uk (s.degabrielle@cs.ucl.ac.uk) Date: Thu Mar 26 02:27:33 2009 Subject: [plt-scheme] Opening file in text mode In-Reply-To: <31D87412-B6B0-410E-9EE6-045CE1FA463B@alan-watson.org> References: <31D87412-B6B0-410E-9EE6-045CE1FA463B@alan-watson.org> Message-ID: <595b9ab20809070701m6bb7e156n2dfcc0db9333c4be@mail.gmail.com> I'm not familiar with that method of determining the file type, only the rather similar unix pound-bang-path convention. The drscheme extensions/tools/plugins manual has some info about making new modes, but i suspect you can extend tabs to take a look at the first line and set the mode. (or .txt filename extension) s. On 9/6/08, Alan Watson wrote: > Is there any way to tell DrScheme to open a file in text mode rather > than Scheme mode? In Emacs I would just add -*-text-*- to the top of > the file. > > Thanks. > > Alan > -- > Alan Watson > http://www.alan-watson.org/ > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Cheers, Stephen -- Stephen De Gabrielle s.degabrielle@cs.ucl.ac.uk Telephone +44 (0)20 7679 0693 (x30693) Mobile 079 851 890 45 Project: Making Sense of Information (MaSI) Work:http://www.uclic.ucl.ac.uk/annb/MaSI.html Home:http://www.degabrielle.name/stephen UCL Interaction Centre MPEB 8th floor University College London Gower Street London WC1E 6BT From kbohdan at mail.ru Sun Sep 7 10:48:27 2008 From: kbohdan at mail.ru (kbohdan@mail.ru) Date: Thu Mar 26 02:27:33 2009 Subject: [plt-scheme] Scheme sources readability Message-ID: Hello, Probably not PLT specific, but hope not too OT: After many years of programming i found new-old scheme world very fascinating. One thing i still do not like here is source code readability. What about docstrings, design patterns (like GoF), coding conventions. Are those non-applicable to scheme ? Or scheme evolution is still on its early stages ? -- Bohdan From matthias at ccs.neu.edu Sun Sep 7 11:12:19 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:27:34 2009 Subject: [plt-scheme] Scheme sources readability In-Reply-To: References: Message-ID: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> On Sep 7, 2008, at 10:48 AM, kbohdan@mail.ru wrote: > Hello, > > Probably not PLT specific, but hope not too OT: > > After many years of programming i found new-old > scheme world very fascinating. One thing i still > do not like here is source code readability. Code in Scheme tends to be 1/4 or 1/3 of the size of Java. The indentation structure is far more revealing than there. So I find it as readable as Java or better. You could argue CL is better, I wouldn't respond then. > What about docstrings, We consider Help Desk a priority because its linked way of doing docs is superior. As my PhD advisor used to say, a program (he meant module) is only worth writing if you also write a paper about it (he meant documentation). > design patterns (like GoF), The design patterns of GOF were invented to address weaknesses in Java and C++'s expressiveness when compared to Scheme and LISP. Plus, when we discover a "pattern", we just turn it into a construct via syntactic extensions. > coding conventions. Are those non-applicable to scheme ? Much higher-level coding conventions are applicable. But yes I admit this takes training. > Or scheme evolution is still on its early stages ? Yes it is in its early stages. Fortunately, because it means we have research left to do. Also fortunately, Scheme has far outpaced Java and friends. -- Matthias > > -- > Bohdan > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From jensaxel at soegaard.net Sun Sep 7 11:17:54 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:27:34 2009 Subject: [plt-scheme] Scheme sources readability In-Reply-To: References: Message-ID: <48C3F0A2.70802@soegaard.net> kbohdan@mail.ru wrote: > Hello, > > Probably not PLT specific, but hope not too OT: > > After many years of programming i found new-old > scheme world very fascinating. One thing i still > do not like here is source code readability. > What about docstrings, Used in Common Lisp. > design patterns (like GoF), One man's design pattern is another man's macro. See Norvig's survey: http://norvig.com/design-patterns/ > > coding conventions. Are those non-applicable to scheme ? Mu. > Or scheme evolution is still on its early stages ? Scheme is a new programming language from the seventies, so it is really to early to say (whether the evolution is in it early stages or not). If I were forced to answer, I'd say yes. But then again, I'd say that about legacy(*) languages too. (*) legacy language: Language without closures, proper tail recursion and call/cc. -- Jens Axel S?gaard From neil at neilvandyke.org Sun Sep 7 11:37:40 2008 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:27:34 2009 Subject: [plt-scheme] Scheme sources readability In-Reply-To: References: Message-ID: <48C3F544.8000502@neilvandyke.org> One of the PLT people can answer better than I can, but a few quick comments from someone who did a lot of work in other languages before moving to Scheme... Docstrings: There is no standard way to do this. PLT has an interesting new documentation system, Scribble, that has you writing documentation outside of the source code files, and I believe I heard a rumor that they might do more with embedding the documentation in the files. There are various homebrew ways to embed documentation in various Scheme implementations. For PLT, you could also look at contracts and Typed Scheme as ways to embed some documentation. Design patterns: You might find that many of the design patterns that were originally developed with C++ and then Java in mind are irrelevant to Scheme and Common Lisp. As for learning Scheme features, idioms, and ways of thinking, a good starting point is HTDP.org. If you don't work through HTDP, one tip I have (which might be controversial) is to learn how to write Scheme code without mutations (try not to use things like "set!"). Once you've got the hang of that, learn syntactic extension, which leads to a higher echelon of programming. Coding conventions: That could fall under idioms and ways of thinking. For how to format code, use the automatic indentation in DrScheme or Emacs, and snuggle up ")" to immediately following the last non-whitespace character. For how to name things, there are many conventions. You'll notice that most people put all their identifiers in lowercase, with "-" to separate words. When you see "/" in an identifier, it can usually be read as the English word "with". Lots of people name identifiers for parameters beginning with the word "current". ":" in an identifier is often used for things like accessing a field of a record, such as "person:firstname" and "person:lastname". PLT also has some naming conventions for use with their classes, units, and signatures. Evolution: Scheme is used as a testbed by many programming language researchers, so there are constant innovations, some of which become adopted as mainstream or in some circles. For this reason, who can say whether it is "early stages". What I can say is that some Scheme implementations are generally more powerful and stable than languages that are considered . I suspect what you will find with Scheme is not that the language is immature, but that there are not as many people using it as, say, Java. This can be a curse, but it is also a blessing. (For example of why it is a blessing: I was recently bitten when using a popular non-Scheme framework. It took a while to realize that not all the developers had rigorous solutions like Scheme developers like PLT usually would, and that the user community chatter on average was not very knowledgeable.) -- http://www.neilvandyke.org/ From grettke at acm.org Sun Sep 7 13:01:46 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:34 2009 Subject: [plt-scheme] HTDP: How much do your students study? Message-ID: <756daca50809071001k8d5b040mbccf249fa57d85a6@mail.gmail.com> Hi, How much do your students study? I suspect that when you do *ALL* of the work expected in the exercises it takes you much longer than you would have imagined to complete them; at least this is the case for me coming to HTDP having programmed prior to the book. Based on this week, I could easily imagine spending 9 hours a week, nights and weekends I mean, studying. Best wishes, Grant From kbohdan at mail.ru Sun Sep 7 12:59:00 2008 From: kbohdan at mail.ru (kbohdan@mail.ru) Date: Thu Mar 26 02:27:34 2009 Subject: [plt-scheme] Re: Scheme sources readability In-Reply-To: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> References: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> Message-ID: Matthias Felleisen wrote: >> After many years of programming i found new-old >> scheme world very fascinating. One thing i still >> do not like here is source code readability. > > Code in Scheme tends to be 1/4 or 1/3 of the size of Java. > The indentation structure is far more revealing than there. > So I find it as readable as Java or better. You could argue > CL is better, I wouldn't respond then. Yes, agree code size is much smaller, but i'm still not sure if it helps me to read it. Lets compare with Java: If i see class names like XxxAdapter, XxxVisitor, XxxFSM, XxxModel/XxxView/XxxController it only takes a seconds to understand what is going on. Can you take any non-trivial snippet from DrScheme collects to demonstrate your algorithm of code reading? >> What about docstrings, > > We consider Help Desk a priority because its linked way > of doing docs is superior. As my PhD advisor used to say, > a program (he meant module) is only worth writing if you > also write a paper about it (he meant documentation). "Help Desk" helps me to understand public interface, but it doesn't help me too much to understand implementation. From your point of view nobody guarantee that it should be easy for third person to understand even interface of private module not even saying about its implementation. IMHO, this is not the case for commercial software development. >> design patterns (like GoF), > > The design patterns of GOF were invented to address > weaknesses in Java and C++'s expressiveness when compared > to Scheme and LISP. Plus, when we discover a "pattern", we > just turn it into a construct via syntactic extensions. Design patterns (DP) were invented by architect not by programmers. In programming DP are addressing history proven successful code patterns used both in coding and understanding source code. Despite the fact that i can implement most of patterns as macros doesn't mean that scheme community should not pay attention on architecture and force all starting scheme programmers to invent the bike. >> coding conventions. Are those non-applicable to scheme ? > > Much higher-level coding conventions are applicable. But > yes I admit this takes training. > >> Or scheme evolution is still on its early stages ? > > Yes it is in its early stages. Fortunately, because it means > we have research left to do. Also fortunately, Scheme has far > outpaced Java and friends. > > -- Matthias -- Bohdan From matthias at ccs.neu.edu Sun Sep 7 13:05:31 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:27:34 2009 Subject: [plt-scheme] HTDP: How much do your students study? In-Reply-To: <756daca50809071001k8d5b040mbccf249fa57d85a6@mail.gmail.com> References: <756daca50809071001k8d5b040mbccf249fa57d85a6@mail.gmail.com> Message-ID: On Sep 7, 2008, at 1:01 PM, Grant Rettke wrote: > Hi, > > How much do your students study? > > I suspect that when you do *ALL* of the work expected in the exercises > it takes you much longer than you would have imagined to complete > them; at least this is the case for me coming to HTDP having > programmed prior to the book. > > Based on this week, I could easily imagine spending 9 hours a week, > nights and weekends I mean, studying. For the homework assignments I hand out, this is pretty much the average. However, I pick and choose drill exercises and make up new graded exercises every week to complement the drill. I suspect that overall I assign about half the exercises (in this counting). The fast students do it in 5 hours. I also have slow ones (quite a few) who spend 20-30 hours/week. > > Best wishes, > > Grant > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From matthias at ccs.neu.edu Sun Sep 7 13:11:35 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:27:35 2009 Subject: [plt-scheme] Re: Scheme sources readability In-Reply-To: References: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> Message-ID: <7EF7CE25-369A-4D55-8283-E3CD426B4597@ccs.neu.edu> As for GOF patterns, which is what you asked about, please read up on the extensive literature. 20 out of 23 GOF patterns aren't macros; they have been features in Scheme and LISP for the past 30 years. As for reading code, I am sorry my brain isn't an algorithm. And I dont really have time to explain these things but here is a snippet of a function I wrote last week why Scheme code is readable and how it's written. Copy it into drscheme, remove the obviously unnecessary line breaks introduced by your mail client, and read it. (BTW, can you imagine ANYONE using the phrase "obviously unnecessary" for Java code?) -- Matthias ;; ------------------------------------------------------------------------ ----- ;; Ball Paddle -> Ball ;; compute the point to where the ball travels in one tick, bouncing off walls ;; and the stationary horizontal paddle in the middle. (define P0 (make-posn 0 0)) (define speed0 (+ CNTR 10)) ;; hit left only (check-expect (ball-move (make-ball 10 10 -15 0) P0) (make-ball 5 10 +15 0)) ;; hit right only (check-expect (ball-move (make-ball (- SIZE 10) 10 +15 0) P0) (make-ball (- SIZE 5) 10 -15 0)) ;; hit bottom left corner (check-within (ball-move (make-ball CNTR CNTR (- speed0) speed0) P0) (make-ball 10 (- SIZE 10) speed0 (- speed0)) .1) ;; hit bottom right corner (check-within (ball-move (make-ball CNTR CNTR speed0 speed0) P0) (make-ball (- SIZE 10) (- SIZE 10) (- speed0) (- speed0)) .1) ;; hit paddle in right corner (check-within (ball-move (make-ball (- SIZE 1) (- SIZE 1) 1 1) (make-posn SIZE SIZE)) (make-ball SIZE SIZE 1 -1) .1) ;; double bounce: reach bottom first: ;; -- (make-ball (- SIZE 25) SIZE 100 -100) for delta = .25 ;; -- (make-ball 0 (- SIZE 25) -100 -100) delta = .25 ;; -- (make-ball (- SIZE 50) (- SIZE 75) -100 -100) for delta = .50 (check-within (ball-move (make-ball (- SIZE 50) (- SIZE 25) 100 100) P0) (make-ball (- SIZE 50.) (- SIZE 75.) -100 -100) .1) ;; running out of time after bounce (check-within (ball-move (make-ball (- SIZE 50) 10 50.01 0) P0) (make-ball SIZE 10 -50.01 0) .1) ;; escape through top (check-expect (ball? (ball-move (make-ball 10 10 0 -20) P0)) true) (define P1 (make-posn 10 15)) ;; hit paddle from top (check-within (ball-move (make-ball 10 10 10 10) P1) (ball-straight (make-ball 15 15 10 -10) .5) .1) ;; hit paddle from bottom (check-within (ball-move (make-ball 10 20 10 -10) P1) (ball-straight (make-ball 15 15 10 10) .5) .1) ;; hit goal (check-within (ball-move (make-ball LGOAL (- SIZE 5) 0 5) P1) (ball-straight (make-ball LGOAL (- SIZE 5) 0 5) 2.) .1) (define (ball-move b0 p) (local ((define speed (ball->speed b0)) ;; Time Ball -> Ball ;; ball : accumulates the movement for 1.0 - delta (define (ball-move delta b) (local ((define (move-and-recur hit-location) (ball-move (- delta (/ (distance-traveled b hit-location) speed)) hit-location))) (cond [(<= delta 0.01) b] [(thru-top? b delta) (ball-drop 'go)] [(hits-pad-top? b p delta) (move-and-recur (bounce-pad-top b p delta))] [(hits-pad-bot? b p delta) (move-and-recur (bounce-pad-bot b p delta))] [(hits-lft? b delta) (if (hits-bot? b delta) (move-and-recur (bounce-diagonal b delta)) (move-and-recur (bounce-lft b delta)))] [(hits-rgt? b delta) (if (hits-bot? b delta) (move-and-recur (bounce-diagonal b delta)) (move-and-recur (bounce-rgt b delta)))] [(hits-bot? b delta) (if (hits-goal? b delta) (ball-straight b (* 2 delta)) (move-and-recur (bounce-bot b delta)))] [else (ball-straight b delta)])))) (ball-move 1.0 b0))) On Sep 7, 2008, at 12:59 PM, kbohdan@mail.ru wrote: > Matthias Felleisen wrote: > >>> After many years of programming i found new-old >>> scheme world very fascinating. One thing i still >>> do not like here is source code readability. >> Code in Scheme tends to be 1/4 or 1/3 of the size of Java. >> The indentation structure is far more revealing than there. >> So I find it as readable as Java or better. You could argue >> CL is better, I wouldn't respond then. > > Yes, agree code size is much smaller, but i'm still not sure > if it helps me to read it. > Lets compare with Java: If i see class names like XxxAdapter, > XxxVisitor, XxxFSM, XxxModel/XxxView/XxxController it only takes > a seconds to understand what is going on. Can you take any > non-trivial snippet from DrScheme collects to demonstrate your > algorithm of code reading? > >>> What about docstrings, >> We consider Help Desk a priority because its linked way >> of doing docs is superior. As my PhD advisor used to say, >> a program (he meant module) is only worth writing if you >> also write a paper about it (he meant documentation). > > "Help Desk" helps me to understand public interface, but > it doesn't help me too much to understand implementation. > From your point of view nobody guarantee that it should be > easy for third person to understand even interface of private > module not even saying about its implementation. IMHO, this > is not the case for commercial software development. > >>> design patterns (like GoF), >> The design patterns of GOF were invented to address >> weaknesses in Java and C++'s expressiveness when compared >> to Scheme and LISP. Plus, when we discover a "pattern", we >> just turn it into a construct via syntactic extensions. > > Design patterns (DP) were invented by architect not by programmers. > In programming DP are addressing history proven successful code > patterns used both in coding and understanding source code. > Despite the fact that i can implement most of patterns as macros > doesn't mean that scheme community should not pay attention on > architecture and force all starting scheme programmers to > invent the bike. > > >>> coding conventions. Are those non-applicable to scheme ? >> Much higher-level coding conventions are applicable. But >> yes I admit this takes training. >>> Or scheme evolution is still on its early stages ? >> Yes it is in its early stages. Fortunately, because it means >> we have research left to do. Also fortunately, Scheme has far >> outpaced Java and friends. >> -- Matthias > > -- > Bohdan > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From diggerrrrr at gmail.com Sun Sep 7 13:49:16 2008 From: diggerrrrr at gmail.com (Veer) Date: Thu Mar 26 02:27:35 2009 Subject: [plt-scheme] Re: Scheme sources readability In-Reply-To: References: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> Message-ID: In my opinion you only need to know public interface to use it in your application. If public interface is documented well , then there is no need to look into the implementation. Don't we use OS api's without knowing how they are implemented. On 9/7/08, kbohdan@mail.ru wrote: > Matthias Felleisen wrote: > >>> After many years of programming i found new-old >>> scheme world very fascinating. One thing i still >>> do not like here is source code readability. >> >> Code in Scheme tends to be 1/4 or 1/3 of the size of Java. >> The indentation structure is far more revealing than there. >> So I find it as readable as Java or better. You could argue >> CL is better, I wouldn't respond then. > > Yes, agree code size is much smaller, but i'm still not sure > if it helps me to read it. > Lets compare with Java: If i see class names like XxxAdapter, > XxxVisitor, XxxFSM, XxxModel/XxxView/XxxController it only takes > a seconds to understand what is going on. Can you take any > non-trivial snippet from DrScheme collects to demonstrate your > algorithm of code reading? > >>> What about docstrings, >> >> We consider Help Desk a priority because its linked way >> of doing docs is superior. As my PhD advisor used to say, >> a program (he meant module) is only worth writing if you >> also write a paper about it (he meant documentation). > > "Help Desk" helps me to understand public interface, but > it doesn't help me too much to understand implementation. > From your point of view nobody guarantee that it should be > easy for third person to understand even interface of private > module not even saying about its implementation. IMHO, this > is not the case for commercial software development. > >>> design patterns (like GoF), >> >> The design patterns of GOF were invented to address >> weaknesses in Java and C++'s expressiveness when compared >> to Scheme and LISP. Plus, when we discover a "pattern", we >> just turn it into a construct via syntactic extensions. > > Design patterns (DP) were invented by architect not by programmers. > In programming DP are addressing history proven successful code > patterns used both in coding and understanding source code. > Despite the fact that i can implement most of patterns as macros > doesn't mean that scheme community should not pay attention on > architecture and force all starting scheme programmers to > invent the bike. > > >>> coding conventions. Are those non-applicable to scheme ? >> >> Much higher-level coding conventions are applicable. But >> yes I admit this takes training. >> >>> Or scheme evolution is still on its early stages ? >> >> Yes it is in its early stages. Fortunately, because it means >> we have research left to do. Also fortunately, Scheme has far >> outpaced Java and friends. >> >> -- Matthias > > -- > Bohdan > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From noelwelsh at gmail.com Sun Sep 7 13:55:06 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:27:35 2009 Subject: [plt-scheme] Scheme sources readability In-Reply-To: References: Message-ID: On Sun, Sep 7, 2008 at 3:48 PM, wrote: > What about docstrings, Replaced by Scribble in PLT Scheme > design patterns (like GoF), Regarding GoF: http://people.csail.mit.edu/gregs/ref-dyn-patterns.html "This paper explores how the patterns from the "Gang of Four", or "GOF" book, as it is often called, appear when similar problems are addressed using a dynamic, higher-order, object-oriented programming language. Some of the patterns disappear -- that is, they are supported directly by language features, some patterns are simpler or have a different focus, and some are essentially unchanged." There are still patterns in Scheme and other functional languages. E.g. fold, zipper, monad etc. Often they are published as "Functional Pearls". Generally we try to replace patterns with code. > coding conventions. Are those non-applicable to scheme ? There are many conventions. Here are some low-level ones: A function that operates on a type foo is called foo-something. E.g. foo-load might load a foo from a file. A function ending in a ? returns #t or #f A function that converts foos to bars is called foo->bar Here are some conventions on a higher level (many Untyped specific): The main file in the collection is called main.ss There is a file called base.ss that defines the exceptions raised by this collection There is a file called test-base.ss that re-exports the version of SchemeUnit in use and defines any testing utilities There is a file called all-tests.ss that collects all the tests for the collection Module foo.ss has tests in foo-test.ss, which exports all-foo-tests and so on... HTH, N. From kbohdan at mail.ru Sun Sep 7 14:08:18 2008 From: kbohdan at mail.ru (kbohdan@mail.ru) Date: Thu Mar 26 02:27:35 2009 Subject: [plt-scheme] Re: Scheme sources readability In-Reply-To: <48C3F0A2.70802@soegaard.net> References: <48C3F0A2.70802@soegaard.net> Message-ID: Jens Axel Soegaard wrote: > kbohdan@mail.ru wrote: >> Hello, >> >> Probably not PLT specific, but hope not too OT: >> >> After many years of programming i found new-old >> scheme world very fascinating. One thing i still >> do not like here is source code readability. >> What about docstrings, > Used in Common Lisp. Why not in scheme ? >> design patterns (like GoF), > One man's design pattern is another man's macro. Then what about "scheme specific design patterns" book gathering successful higher-order macro programming practice or at least ideas like: - DSLs (ex: define-type, type-case from PLAI) - monads - coroutines - pattern matching - parser combinators ... Or ... should is grok whole http://readscheme.org to become good in scheme theory ? :) > See Norvig's survey: > > http://norvig.com/design-patterns/ Great link! Thanks. >> coding conventions. Are those non-applicable to scheme ? > Mu. > >> Or scheme evolution is still on its early stages ? > Scheme is a new programming language from the seventies, > so it is really to early to say (whether the evolution is in > it early stages or not). > > If I were forced to answer, I'd say yes. But then again, I'd say > that about legacy(*) languages too. > > > (*) legacy language: Language without closures, proper tail recursion > and call/cc. -- Bohdan From plragde at uwaterloo.ca Sun Sep 7 14:14:28 2008 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:27:35 2009 Subject: [plt-scheme] HTDP: How much do your students study? In-Reply-To: <756daca50809071001k8d5b040mbccf249fa57d85a6@mail.gmail.com> Message-ID: <48C41A04.3000209@uwaterloo.ca> Grant wrote: > How much do your students study? > > I suspect that when you do *ALL* of the work expected in the exercises > it takes you much longer than you would have imagined to complete > them; at least this is the case for me coming to HTDP having > programmed prior to the book. > > Based on this week, I could easily imagine spending 9 hours a week, > nights and weekends I mean, studying. We tell students they should spend at least two hours on a course for every hour spent in lecture. Since we have 3 lecture hours a week (plus a tutorial hour in some classes), 10-12 hours per course is not unreasonable. Our students take five courses. As Matthias said, the distribution of the time actually taken is broad, because some students do not follow the design recipe, or don't stop and seek help when they should, or dismiss the hints that we provide when they do, because we haven't given them the answer. Psychologically, it is too easy to think that the next change will result in "all tests passed!", even if the last fifty changes have not. We don't ask our students to do every exercise in HtDP. We suggest some warmup exercises from the book, and then set them 5-10 questions per week which are a mix of harder HtDP exercises and ones we design ourselves. --PR From grettke at acm.org Sun Sep 7 14:44:00 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:35 2009 Subject: [plt-scheme] Re: Scheme sources readability In-Reply-To: References: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> Message-ID: <756daca50809071144t10f875d7r8a5c0ef559fc02ad@mail.gmail.com> On Sun, Sep 7, 2008 at 11:59 AM, wrote: > Matthias Felleisen wrote: >> Code in Scheme tends to be 1/4 or 1/3 of the size of Java. >> The indentation structure is far more revealing than there. >> So I find it as readable as Java or better. You could argue >> CL is better, I wouldn't respond then. > > Yes, agree code size is much smaller, but i'm still not sure > if it helps me to read it. > Lets compare with Java: If i see class names like XxxAdapter, > XxxVisitor, XxxFSM, XxxModel/XxxView/XxxController it only takes > a seconds to understand what is going on. kbohdan, my bread and butter is enterprise Java; so thanks for the comic relief with your statement that "it only takes a [few] seconds to understand what is going on." If it only takes *you* a few seconds, then you should probably be bililng $USD in multiples of one thousand per hour :) I would instead argue that the class name captures its intent, but you don't need classes to realize the goal of the design pattern itself, especially if the pattern only exists to work limitations of the class system to achieve the goal of the pattern. >> We consider Help Desk a priority because its linked way >> of doing docs is superior. As my PhD advisor used to say, >> a program (he meant module) is only worth writing if you >> also write a paper about it (he meant documentation). > > "Help Desk" helps me to understand public interface, but > it doesn't help me too much to understand implementation. Object-oriented (OO) decomposition of systems doesn't work unless you are a product comapny. Virtually everyone doing enterprise development does component oriented development (CO) (whether they want to admit that or not is another story). Don't confuse using an OO language to implement a CO architecture. The *only* thing that anyone should code against or care about these days is the class' interface. Implementation doesn't matter, especially if you're interested in testing. I think, though, perhaps you are looking at this from a maintainers perspective? If that is the case, there is Helpdesk documentation for private methods, isn't there? > From your point of view nobody guarantee that it should be > easy for third person to understand even interface of private > module not even saying about its implementation. IMHO, this > is not the case for commercial software development. The only thing that matters is its interface, but that doesn't prevent you from documenting private methods. PLT doesn't document private methods? >> The design patterns of GOF were invented to address >> weaknesses in Java and C++'s expressiveness when compared >> to Scheme and LISP. Plus, when we discover a "pattern", we >> just turn it into a construct via syntactic extensions. > > Design patterns (DP) were invented by architect not by programmers. Architect == Senior Programmer > In programming DP are addressing history proven successful code > patterns used both in coding and understanding source code. Patterns are really more about recognizing a particular approach to some problem and giving it a common name. > Despite the fact that i can implement most of patterns as macros > doesn't mean that scheme community should not pay attention on > architecture and force all starting scheme programmers to > invent the bike. Of course. From grettke at acm.org Sun Sep 7 14:45:09 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:36 2009 Subject: [plt-scheme] Re: Scheme sources readability In-Reply-To: References: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> Message-ID: <756daca50809071145q29f2334bia52033f8c62bb9f0@mail.gmail.com> On Sun, Sep 7, 2008 at 12:49 PM, Veer wrote: > In my opinion you only need to know public interface to use it in your > application. > If public interface is documented well , then there is no need to look > into the implementation. Don't we use OS api's without knowing how > they are implemented. That is true. The contrived notion of private methods to communicate something is archaic, it virtually never adds value. Keep all of your class methods public, implement an interface; document and test to your hearts content. From kbohdan at mail.ru Sun Sep 7 14:44:42 2008 From: kbohdan at mail.ru (kbohdan@mail.ru) Date: Thu Mar 26 02:27:36 2009 Subject: [plt-scheme] Re: Scheme sources readability In-Reply-To: <7EF7CE25-369A-4D55-8283-E3CD426B4597@ccs.neu.edu> References: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> <7EF7CE25-369A-4D55-8283-E3CD426B4597@ccs.neu.edu> Message-ID: Matthias Felleisen wrote: > > As for GOF patterns, which is what you asked about, please read up on > the extensive literature. 20 out of 23 GOF patterns aren't macros; they > have been features in Scheme and LISP for the past 30 years. Sorry, i definitely wasn't clear enough. I'm not interested in GoF rewrite for scheme and i obviously understand "obviously unnecessary" of such design patterns. What i'm very interested in is one book describing advanced higher order programming topics: - DSLs (ex: via define-type, type-case macros from PLAI) - monads (usable for scheme?) - coroutines (how to use ? how to implement ?) - pattern matching - parser combinators ... Definitely each of them is worse separate book, but the aim is to have catalogue of "common programming ideas" with sample-implementaion and sample usage. IMHO, whole community can benefit from such catalogue-book. > As for reading code, I am sorry my brain isn't an algorithm. > And I dont really have time to explain these things but here is a snippet of a > function I wrote last week why Scheme code is readable and how it's > written. Thanks. Does your snippet mean that ANY scheme code can be written in such readable manner ? > Copy it into drscheme, remove the obviously unnecessary line > breaks introduced by your mail client, and read it. > > (BTW, can you imagine ANYONE using the phrase "obviously unnecessary" > for Java code?) > > -- Matthias PS: My English level is not as well as i'd like to, so please excuse me if i wasn't clear/polite enough. -- Bohdan From goetter at mazama.net Sun Sep 7 14:53:20 2008 From: goetter at mazama.net (Ben Goetter) Date: Thu Mar 26 02:27:36 2009 Subject: [plt-scheme] Re: Scheme sources readability In-Reply-To: References: <48C3F0A2.70802@soegaard.net> Message-ID: <48C42320.6060905@mazama.net> kbohdan@mail.ru wrote: >>> What about docstrings, >> Used in Common Lisp. > Why not in scheme ? In Scheme, the code describes the process of computation, and only the process of computation. This leaves Scheme implementations free to experiment with different, richer solutions for documenting code than embedding text in the code as a literal string datum. Since you're posting to plt-scheme, you'll hear here about PLT Scheme's work to that end. Some Scheme implementations do support traditional docstrings -- Guile comes to mind. From kbohdan at mail.ru Sun Sep 7 14:48:13 2008 From: kbohdan at mail.ru (kbohdan@mail.ru) Date: Thu Mar 26 02:27:36 2009 Subject: [plt-scheme] Re: Scheme sources readability In-Reply-To: References: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> Message-ID: Veer wrote: > In my opinion you only need to know public interface to use it in your > application. > If public interface is documented well , then there is no need to look > into the implementation. Don't we use OS api's without knowing how > they are implemented. Yep, but i'm looking on problem from the side of implementer or someone who wants to study implementation. -- Bohdan From dave at pawfal.org Sun Sep 7 15:27:39 2008 From: dave at pawfal.org (Dave Griffiths) Date: Thu Mar 26 02:27:36 2009 Subject: [plt-scheme] optimizer crash in embedded mzscheme In-Reply-To: <20080907131240.C8793650091@mail-svr1.cs.utah.edu> References: <1220651136.19066.36.camel@daves-laptop> <20080906174645.3C0506500A9@mail-svr1.cs.utah.edu> <20080907131240.C8793650091@mail-svr1.cs.utah.edu> Message-ID: <32812.81.154.250.104.1220815659.squirrel@webmail.pawfal.org> > At Sat, 6 Sep 2008 11:46:43 -0600, Matthew Flatt wrote: >> At Fri, 05 Sep 2008 22:45:36 +0100, Dave Griffiths wrote: >> > I've upgraded from 3.99 to 4.1 and I've started getting crashes in my >> > mzscheme embedded app. They're coming from errors in my scheme module >> > code, which are being correctly reported by the optimiser, but crashes >> > in scheme_log_message. >> > >> > This only seems to be happening after I've reset my interpreter by >> > calling scheme_basic_env() a second time - which may or may not be >> > related. >> >> I think the reset behavior of scheme_basic_env() is likely broken. It's >> fragile and not properly tested, so I'll look into that. > > As expected, when I added logging support, I didn't make sure that the > `current-logger' parameter was reset correctly. This is fixed in SVN. Ah, nice one - thanks! dave From matthias at ccs.neu.edu Sun Sep 7 15:52:46 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:27:36 2009 Subject: [plt-scheme] Re: Scheme sources readability In-Reply-To: References: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> <7EF7CE25-369A-4D55-8283-E3CD426B4597@ccs.neu.edu> Message-ID: <931F6FFF-13E4-49DC-94AE-6C9547759DDB@ccs.neu.edu> On Sep 7, 2008, at 2:44 PM, kbohdan@mail.ru wrote: > > Thanks. > Does your snippet mean that ANY scheme code can be written > in such readable manner ? Absolutely. -- Matthias From kbohdan at mail.ru Sun Sep 7 16:03:53 2008 From: kbohdan at mail.ru (kbohdan@mail.ru) Date: Thu Mar 26 02:27:37 2009 Subject: [plt-scheme] Re: Scheme sources readability In-Reply-To: <756daca50809071144t10f875d7r8a5c0ef559fc02ad@mail.gmail.com> References: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> <756daca50809071144t10f875d7r8a5c0ef559fc02ad@mail.gmail.com> Message-ID: Grant Rettke wrote: > On Sun, Sep 7, 2008 at 11:59 AM, wrote: >> Matthias Felleisen wrote: >>> Code in Scheme tends to be 1/4 or 1/3 of the size of Java. >>> The indentation structure is far more revealing than there. >>> So I find it as readable as Java or better. You could argue >>> CL is better, I wouldn't respond then. >> Yes, agree code size is much smaller, but i'm still not sure >> if it helps me to lread it. >> Lets compare with Java: If i see class names like XxxAdapter, >> XxxVisitor, XxxFSM, XxxModel/XxxView/XxxController it only takes >> a seconds to understand what is going on. > > kbohdan, my bread and butter is enterprise Java; so thanks for the > comic relief with your statement that "it only takes a [few] seconds > to understand what is going on." I mean surface understanding and reviewed code expected to be ideal. Also expected the same-level sample in scheme. If it only takes *you* a few seconds, > then you should probably be bililng $USD in multiples of one thousand > per hour :) :) Still trying. Hope you too. > I would instead argue that the class name captures its intent, but you > don't need classes to realize the goal of the design pattern itself, > especially if the pattern only exists to work limitations of the class > system to achieve the goal of the pattern. Did i say that i want classes or OOP in scheme ? BTW, pattern name can be captured in macro. Please do not consider cases with "legacy GoF patterns" lets imagine native scheme higher order patterns. Ex: - coroutines - DSLs - monads ... Without pattern catalogue i can see the only way to become good scheme programmer : traverse tons of web links and articles without any idea what is good in practice and what is just mathematic experiment. And that is what i'm currenly doing :) >>> We consider Help Desk a priority because its linked way >>> of doing docs is superior. As my PhD advisor used to say, >>> a program (he meant module) is only worth writing if you >>> also write a paper about it (he meant documentation). >> "Help Desk" helps me to understand public interface, but >> it doesn't help me too much to understand implementation. > > Object-oriented (OO) decomposition of systems doesn't work unless you > are a product comapny. Virtually everyone doing enterprise development > does component oriented development (CO) (whether they want to admit > that or not is another story). Don't confuse using an OO language to > implement a CO architecture. The *only* thing that anyone should code > against or care about these days is the class' interface. > Implementation doesn't matter, especially if you're interested in > testing. Looking at code of big companies like MS, should agree here. From this perspective documenting private code probably is not very important. Simple comment will be enough. >>> The design patterns of GOF were invented to address >>> weaknesses in Java and C++'s expressiveness when compared >>> to Scheme and LISP. Plus, when we discover a "pattern", we >>> just turn it into a construct via syntactic extensions. >> Design patterns (DP) were invented by architect not by programmers. > > Architect == Senior Programmer "Christopher Alexander" == Senior Programmer ? :) -- Bohdan From noelwelsh at gmail.com Sun Sep 7 16:12:34 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:27:37 2009 Subject: [plt-scheme] Re: Scheme sources readability In-Reply-To: References: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> <756daca50809071144t10f875d7r8a5c0ef559fc02ad@mail.gmail.com> Message-ID: On Sun, Sep 7, 2008 at 9:03 PM, wrote: > Without pattern catalogue i can see the only way to become good scheme > programmer : traverse tons of web links and articles without any idea what > is good in practice and what is just mathematic experiment. > And that is what i'm currenly doing :) There is no book that I know of which collates all the Scheme patterns. It would be a great book to have, if it did exist. N. From s.degabrielle at cs.ucl.ac.uk Sun Sep 7 17:44:54 2008 From: s.degabrielle at cs.ucl.ac.uk (s.degabrielle@cs.ucl.ac.uk) Date: Thu Mar 26 02:27:37 2009 Subject: [plt-scheme] Re: Scheme sources readability In-Reply-To: References: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> <756daca50809071144t10f875d7r8a5c0ef559fc02ad@mail.gmail.com> Message-ID: <595b9ab20809071444x22ebe390lb24818d6547d988c@mail.gmail.com> Sounds like something for the scheme cookbook wiki. On 9/7/08, Noel Welsh wrote: > On Sun, Sep 7, 2008 at 9:03 PM, wrote: > >> Without pattern catalogue i can see the only way to become good scheme >> programmer : traverse tons of web links and articles without any idea what >> is good in practice and what is just mathematic experiment. >> And that is what i'm currenly doing :) > > There is no book that I know of which collates all the Scheme > patterns. It would be a great book to have, if it did exist. > > N. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Cheers, Stephen -- Stephen De Gabrielle s.degabrielle@cs.ucl.ac.uk Telephone +44 (0)20 7679 0693 (x30693) Mobile 079 851 890 45 Project: Making Sense of Information (MaSI) Work:http://www.uclic.ucl.ac.uk/annb/MaSI.html Home:http://www.degabrielle.name/stephen UCL Interaction Centre MPEB 8th floor University College London Gower Street London WC1E 6BT From rcleis at mac.com Sun Sep 7 18:03:14 2008 From: rcleis at mac.com (Richard Cleis) Date: Thu Mar 26 02:27:37 2009 Subject: [plt-scheme] Re: Scheme sources readability In-Reply-To: References: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> <756daca50809071144t10f875d7r8a5c0ef559fc02ad@mail.gmail.com> Message-ID: On Sep 7, 2008, at 2:03 PM, kbohdan@mail.ru wrote: > Grant Rettke wrote: >> On Sun, Sep 7, 2008 at 11:59 AM, wrote: >>> Matthias Felleisen wrote: >>>> Code in Scheme tends to be 1/4 or 1/3 of the size of Java. >>>> The indentation structure is far more revealing than there. >>>> So I find it as readable as Java or better. You could argue >>>> CL is better, I wouldn't respond then. >>> Yes, agree code size is much smaller, but i'm still not sure >>> if it helps me to lread it. >>> Lets compare with Java: If i see class names like XxxAdapter, >>> XxxVisitor, XxxFSM, XxxModel/XxxView/XxxController it only takes >>> a seconds to understand what is going on. >> kbohdan, my bread and butter is enterprise Java; so thanks for the >> comic relief with your statement that "it only takes a [few] seconds >> to understand what is going on." > > I mean surface understanding and reviewed code expected to be ideal. > Also expected the same-level sample in scheme. > > If it only takes *you* a few seconds, >> then you should probably be bililng $USD in multiples of one thousand >> per hour :) > > :) Still trying. Hope you too. > >> I would instead argue that the class name captures its intent, but >> you >> don't need classes to realize the goal of the design pattern itself, >> especially if the pattern only exists to work limitations of the >> class >> system to achieve the goal of the pattern. > > Did i say that i want classes or OOP in scheme ? > BTW, pattern name can be captured in macro. > Please do not consider cases with "legacy GoF patterns" lets > imagine native scheme higher order patterns. Ex: > - coroutines > - DSLs > - monads > ... > > Without pattern catalogue i can see the only way to become good > scheme programmer : traverse tons of web links and articles without > any idea what is good in practice and what is just mathematic > experiment. > And that is what i'm currenly doing :) What have you found that is not good in practice? How was it merely a mathematical experiment? RAC > > >>>> We consider Help Desk a priority because its linked way >>>> of doing docs is superior. As my PhD advisor used to say, >>>> a program (he meant module) is only worth writing if you >>>> also write a paper about it (he meant documentation). >>> "Help Desk" helps me to understand public interface, but >>> it doesn't help me too much to understand implementation. >> Object-oriented (OO) decomposition of systems doesn't work unless you >> are a product comapny. Virtually everyone doing enterprise >> development >> does component oriented development (CO) (whether they want to admit >> that or not is another story). Don't confuse using an OO language to >> implement a CO architecture. The *only* thing that anyone should code >> against or care about these days is the class' interface. >> Implementation doesn't matter, especially if you're interested in >> testing. > > Looking at code of big companies like MS, should agree here. > From this perspective documenting private code probably is not > very important. Simple comment will be enough. > > > >>>> The design patterns of GOF were invented to address >>>> weaknesses in Java and C++'s expressiveness when compared >>>> to Scheme and LISP. Plus, when we discover a "pattern", we >>>> just turn it into a construct via syntactic extensions. >>> Design patterns (DP) were invented by architect not by programmers. >> Architect == Senior Programmer > > "Christopher Alexander" == Senior Programmer ? :) > > > > -- > Bohdan > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From grettke at acm.org Sun Sep 7 19:44:17 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:37 2009 Subject: [plt-scheme] Re: Scheme sources readability In-Reply-To: References: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> <756daca50809071144t10f875d7r8a5c0ef559fc02ad@mail.gmail.com> Message-ID: <756daca50809071644x799507bfmfece68bfe2150ad4@mail.gmail.com> > Without pattern catalogue i can see the only way to become good scheme > programmer : traverse tons of web links and articles without any idea what > is good in practice and what is just mathematic experiment. > And that is what i'm currenly doing :) There is a lot of great material to read. However, it is a lot of separate material. Right now I suspect that HTDP is the best place to start. From grettke at acm.org Sun Sep 7 20:14:36 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:37 2009 Subject: [plt-scheme] Scheme sources readability In-Reply-To: <48C3F544.8000502@neilvandyke.org> References: <48C3F544.8000502@neilvandyke.org> Message-ID: <756daca50809071714n2e4fc938hb5476dcea6341947@mail.gmail.com> > As for learning Scheme features, idioms, and ways of > thinking, a good starting point is HTDP.org. If you don't work through > HTDP, one tip I have (which might be controversial) is to learn how to write > Scheme code without mutations (try not to use things like "set!"). Once > you've got the hang of that, learn syntactic extension, which leads to a > higher echelon of programming. While I learned the Scheme programming language; I knew that I didn't "get Functional Programming". I mean I know what it means factually, but I didn't internalize in the same way that I did OO. As such, I'm studying HTDP. From grettke at acm.org Sun Sep 7 20:16:14 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:38 2009 Subject: [plt-scheme] HTDP: Design recipe exercises write themselves? Message-ID: <756daca50809071716s737697dcy80ef369238bf8098@mail.gmail.com> Hi, When you follow the recipes, the exercises sort of "write themselves", don't they? Best wishes, Grant From grettke at acm.org Sun Sep 7 20:18:25 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:38 2009 Subject: [plt-scheme] HTDP: How much do your students study? In-Reply-To: <48C41A04.3000209@uwaterloo.ca> References: <756daca50809071001k8d5b040mbccf249fa57d85a6@mail.gmail.com> <48C41A04.3000209@uwaterloo.ca> Message-ID: <756daca50809071718n5650ebear48ef7e1ca846862e@mail.gmail.com> Is it safe to say that in lieu of participating in a class with curriculum and a teacher, doing all of the exercises is a good bet? From matthias at ccs.neu.edu Sun Sep 7 20:19:07 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:27:38 2009 Subject: [plt-scheme] HTDP: Design recipe exercises write themselves? In-Reply-To: <756daca50809071716s737697dcy80ef369238bf8098@mail.gmail.com> References: <756daca50809071716s737697dcy80ef369238bf8098@mail.gmail.com> Message-ID: On Sep 7, 2008, at 8:16 PM, Grant Rettke wrote: > Hi, > > When you follow the recipes, the exercises sort of "write themselves", > don't they? :-) (We show this to teachers and often count the number of keystrokes needed to transform a template into a definition. From gregory.woodhouse at gmail.com Sun Sep 7 20:43:22 2008 From: gregory.woodhouse at gmail.com (Woodhouse Gregory) Date: Thu Mar 26 02:27:38 2009 Subject: [plt-scheme] What about "The Little Schemer"? Message-ID: This, together with its companion volume "The Seasoned Schemer", are books I've returned to many times. By no means should you expect to fully appreciate them on a first read! Unlike HtDP programs, this isn't really a general introduction to programming in Scheme. It's not a cookbook or an an "advanced" text in the usual sense, either. It's a book about ideas. I think these are books that will make you a better programmer, not by teaching "coding techniques" but by helping you to understand some fundamental concepts in a deeper way. Sent from my iPhone From plragde at uwaterloo.ca Sun Sep 7 20:44:57 2008 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:27:38 2009 Subject: [plt-scheme] HTDP: How much do your students study? In-Reply-To: <756daca50809071718n5650ebear48ef7e1ca846862e@mail.gmail.com> References: <756daca50809071001k8d5b040mbccf249fa57d85a6@mail.gmail.com> <48C41A04.3000209@uwaterloo.ca> <756daca50809071718n5650ebear48ef7e1ca846862e@mail.gmail.com> Message-ID: <48C47589.9050602@uwaterloo.ca> Grant Rettke wrote: > Is it safe to say that in lieu of participating in a class with > curriculum and a teacher, doing all of the exercises is a good bet? I don't think it will hurt to do all of the exercises. As a "mature student", though, there may be exercises that you can glance at and see the point of or the idea of, without writing out all the details. What may be fruitful for a high-school sophomore may be less rewarding for you. It's a matter of judgement. --PR From jos.koot at telefonica.net Sun Sep 7 20:49:29 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:27:39 2009 Subject: [plt-scheme] What about "The Little Schemer"? References: Message-ID: <9FDDD9476DE249B19F374EB69DD8881A@uw2b2dff239c4d> +1 jos ----- Original Message ----- From: "Woodhouse Gregory" To: "PLT Scheme" Sent: Monday, September 08, 2008 2:43 AM Subject: [plt-scheme] What about "The Little Schemer"? > This, together with its companion volume "The Seasoned Schemer", are > books I've returned to many times. By no means should you expect to > fully appreciate them on a first read! Unlike HtDP programs, this > isn't really a general introduction to programming in Scheme. It's not > a cookbook or an an "advanced" text in the usual sense, either. It's a > book about ideas. I think these are books that will make you a better > programmer, not by teaching "coding techniques" but by helping you to > understand some fundamental concepts in a deeper way. > > Sent from my iPhone > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From grettke at acm.org Sun Sep 7 20:52:54 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:39 2009 Subject: [plt-scheme] HTDP: How much do your students study? In-Reply-To: <48C47589.9050602@uwaterloo.ca> References: <756daca50809071001k8d5b040mbccf249fa57d85a6@mail.gmail.com> <48C41A04.3000209@uwaterloo.ca> <756daca50809071718n5650ebear48ef7e1ca846862e@mail.gmail.com> <48C47589.9050602@uwaterloo.ca> Message-ID: <756daca50809071752w3bb81fffo5288fc6cc29a5773@mail.gmail.com> On Sun, Sep 7, 2008 at 7:44 PM, Prabhakar Ragde wrote: > Grant Rettke wrote: >> >> Is it safe to say that in lieu of participating in a class with >> curriculum and a teacher, doing all of the exercises is a good bet? > > I don't think it will hurt to do all of the exercises. As a "mature > student", though, there may be exercises that you can glance at and see the > point of or the idea of, without writing out all the details. What may be > fruitful for a high-school sophomore may be less rewarding for you. It's a > matter of judgement. --PR Understood. My going in position is that I want to know what kind of problems entry-level students are answering, because we might have some in the group. From grettke at acm.org Sun Sep 7 20:54:54 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:39 2009 Subject: [plt-scheme] What about "The Little Schemer"? In-Reply-To: References: Message-ID: <756daca50809071754t7d0a89bfhab362a169a20905e@mail.gmail.com> HTDP is the "extended version" of TLS :) From jos.koot at telefonica.net Sun Sep 7 21:00:13 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:27:39 2009 Subject: [plt-scheme] HTDP: How much do your students study? References: <756daca50809071001k8d5b040mbccf249fa57d85a6@mail.gmail.com><48C41A04.3000209@uwaterloo.ca> <756daca50809071718n5650ebear48ef7e1ca846862e@mail.gmail.com> Message-ID: <07E81E5612B6431DA33759C03636135B@uw2b2dff239c4d> Some students may do without a teacher (and may be a hint from this list now and then) Other students may not be self disciplined enough to honestly/correctly judge their own acheivements. Yet other students may need the stimulation of an inspiring teacher. But a book can be inspiring too, of course. Jos ----- Original Message ----- From: "Grant Rettke" To: "Prabhakar Ragde" Cc: Sent: Monday, September 08, 2008 2:18 AM Subject: Re: [plt-scheme] HTDP: How much do your students study? > Is it safe to say that in lieu of participating in a class with > curriculum and a teacher, doing all of the exercises is a good bet? > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From grettke at acm.org Sun Sep 7 21:10:55 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:39 2009 Subject: [plt-scheme] HTDP: How much do your students study? In-Reply-To: <07E81E5612B6431DA33759C03636135B@uw2b2dff239c4d> References: <756daca50809071001k8d5b040mbccf249fa57d85a6@mail.gmail.com> <48C41A04.3000209@uwaterloo.ca> <756daca50809071718n5650ebear48ef7e1ca846862e@mail.gmail.com> <07E81E5612B6431DA33759C03636135B@uw2b2dff239c4d> Message-ID: <756daca50809071810t244ff722y613c445f05ea1e4c@mail.gmail.com> On Sun, Sep 7, 2008 at 8:00 PM, Jos Koot wrote: > Some students may do without a teacher (and may be a hint from this list now > and then) My other goal is to re-develop good programming habits, so the more problems the better. From jos.koot at telefonica.net Sun Sep 7 21:10:54 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:27:39 2009 Subject: [plt-scheme] What about "The Little Schemer"? References: <756daca50809071754t7d0a89bfhab362a169a20905e@mail.gmail.com> Message-ID: <33B0C94375304F64BEDD8CC9250C7961@uw2b2dff239c4d> Sorry, but a disagree on that. TLS is far from easy. TLL or TLS teaches an important idea of a mathematical nature: RECURSION (and a little bit of FP). Its primary goal is not to teach programming. See the foreword of TLS. Yet for some students (like I was long ago and still am) TLS can be a very stimulating book opening far horizons and thus helping improve already acquired programming skills. This is not to say that HtDP is easy, but as it is more focussed on discipline and practical, attractive real life like problems, it may be more adequate for with more interest in practical problems than in mathematical concepts. mho, jos ----- Original Message ----- From: "Grant Rettke" To: "Woodhouse Gregory" Cc: "PLT Scheme" Sent: Monday, September 08, 2008 2:54 AM Subject: Re: [plt-scheme] What about "The Little Schemer"? > HTDP is the "extended version" of TLS :) > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From grettke at acm.org Sun Sep 7 21:23:35 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:40 2009 Subject: [plt-scheme] What about "The Little Schemer"? In-Reply-To: <33B0C94375304F64BEDD8CC9250C7961@uw2b2dff239c4d> References: <756daca50809071754t7d0a89bfhab362a169a20905e@mail.gmail.com> <33B0C94375304F64BEDD8CC9250C7961@uw2b2dff239c4d> Message-ID: <756daca50809071823j7cbadc7el7f5620e79ca6cc41@mail.gmail.com> On Sun, Sep 7, 2008 at 8:10 PM, Jos Koot wrote: > Sorry, but a disagree on that. > TLS is far from easy. TLL or TLS teaches an important idea of a mathematical > nature: RECURSION (and a little bit of FP). Its primary goal is not to teach > programming. See the foreword of TLS. Yet for some students (like I was long > ago and still am) TLS can be a very stimulating book opening far horizons > and thus helping improve already acquired programming skills. > This is not to say that HtDP is easy, but as it is more focussed on > discipline and practical, attractive real life like problems, it may be more > adequate for with more interest in practical problems than in mathematical Thanks Jos. I had incorrectly paraphrased, having taken out-of-context something I had a read a while back, and missed the point: "HtDP [is] TLL spelled out slowly and carefully." http://groups.google.com/group/plt-scheme/msg/23b48714b69f86c7?hl=en From jos.koot at telefonica.net Sun Sep 7 21:29:35 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:27:40 2009 Subject: [plt-scheme] HTDP: How much do your students study? References: <756daca50809071001k8d5b040mbccf249fa57d85a6@mail.gmail.com> <48C41A04.3000209@uwaterloo.ca> <756daca50809071718n5650ebear48ef7e1ca846862e@mail.gmail.com> <07E81E5612B6431DA33759C03636135B@uw2b2dff239c4d> <756daca50809071810t244ff722y613c445f05ea1e4c@mail.gmail.com> Message-ID: Agreed, making a certain attitude a habit requires repetition. But slavishly doing homework is not enough. One should acquire the skill to apply the discipline on exercises invented by oneself and in the very end on problems encountered as a professional programmer. When I read a book of study (in any field) I often do exercises after my own ideas (often to later find out that somewhat further the same exercise is exhibited in the book itself) One also should acquire the skill to convince collegues and managers that the approach is the most adequate one. How often is it heard that precious principles of good programming are not more than theory when it comes to fix a problem in an existing system requiring a fast fix? In the very end, they are not mere theory, of course, even when it comes to making money out of the programming. Jos ----- Original Message ----- From: "Grant Rettke" To: "Jos Koot" Cc: "Prabhakar Ragde" ; Sent: Monday, September 08, 2008 3:10 AM Subject: Re: [plt-scheme] HTDP: How much do your students study? > On Sun, Sep 7, 2008 at 8:00 PM, Jos Koot wrote: >> Some students may do without a teacher (and may be a hint from this list >> now >> and then) > > My other goal is to re-develop good programming habits, so the more > problems the better. From jos.koot at telefonica.net Sun Sep 7 21:41:50 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:27:40 2009 Subject: [plt-scheme] What about "The Little Schemer"? References: <756daca50809071754t7d0a89bfhab362a169a20905e@mail.gmail.com> <33B0C94375304F64BEDD8CC9250C7961@uw2b2dff239c4d> <756daca50809071823j7cbadc7el7f5620e79ca6cc41@mail.gmail.com> Message-ID: I think HtDP is about programming and that TLS is a mathematical textbook using Scheme as the mathematical language. For me TLL (now TLS) did add to my programming skills (I admit and I hope), but more importantly it was, for me that is, a primer before studying Lambda Calculus. Jos ----- Original Message ----- From: "Grant Rettke" To: "Jos Koot" Cc: "Woodhouse Gregory" ; "PLT Scheme" Sent: Monday, September 08, 2008 3:23 AM Subject: Re: [plt-scheme] What about "The Little Schemer"? > On Sun, Sep 7, 2008 at 8:10 PM, Jos Koot wrote: >> Sorry, but a disagree on that. >> TLS is far from easy. TLL or TLS teaches an important idea of a >> mathematical >> nature: RECURSION (and a little bit of FP). Its primary goal is not to >> teach >> programming. See the foreword of TLS. Yet for some students (like I was >> long >> ago and still am) TLS can be a very stimulating book opening far horizons >> and thus helping improve already acquired programming skills. >> This is not to say that HtDP is easy, but as it is more focussed on >> discipline and practical, attractive real life like problems, it may be >> more >> adequate for with more interest in practical problems than in >> mathematical > > Thanks Jos. I had incorrectly paraphrased, having taken out-of-context > something I had a read a while back, and missed the point: > > "HtDP [is] TLL spelled out slowly and carefully." > > http://groups.google.com/group/plt-scheme/msg/23b48714b69f86c7?hl=en From jos.koot at telefonica.net Sun Sep 7 22:02:01 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:27:40 2009 Subject: [plt-scheme] What about "The Little Schemer"? References: <756daca50809071754t7d0a89bfhab362a169a20905e@mail.gmail.com><33B0C94375304F64BEDD8CC9250C7961@uw2b2dff239c4d><756daca50809071823j7cbadc7el7f5620e79ca6cc41@mail.gmail.com> Message-ID: <77136BE866084F2DB5DE8D8F104B2BB8@uw2b2dff239c4d> It's 4 am at my place. Sorry, I can't continue participating in this discussion before 24 hours after now. Jos From grettke at acm.org Sun Sep 7 22:04:10 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:40 2009 Subject: [plt-scheme] What about "The Little Schemer"? In-Reply-To: References: <756daca50809071754t7d0a89bfhab362a169a20905e@mail.gmail.com> <33B0C94375304F64BEDD8CC9250C7961@uw2b2dff239c4d> <756daca50809071823j7cbadc7el7f5620e79ca6cc41@mail.gmail.com> Message-ID: <756daca50809071904se8b763au2c5750dc1bcf88f6@mail.gmail.com> On Sun, Sep 7, 2008 at 8:41 PM, Jos Koot wrote: > I think HtDP is about programming and that TLS is a mathematical textbook > using Scheme as the mathematical language. > For me TLL (now TLS) did add to my programming skills (I admit and I hope), > but more importantly it was, for me that is, a primer before studying Lambda > Calculus. I see. Interesting, thanks! From grettke at acm.org Sun Sep 7 22:07:29 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:40 2009 Subject: [plt-scheme] HTDP: How much do your students study? In-Reply-To: References: <756daca50809071001k8d5b040mbccf249fa57d85a6@mail.gmail.com> <48C41A04.3000209@uwaterloo.ca> <756daca50809071718n5650ebear48ef7e1ca846862e@mail.gmail.com> <07E81E5612B6431DA33759C03636135B@uw2b2dff239c4d> <756daca50809071810t244ff722y613c445f05ea1e4c@mail.gmail.com> Message-ID: <756daca50809071907w72c61224s2fe738f5d8afcbea@mail.gmail.com> On Sun, Sep 7, 2008 at 8:29 PM, Jos Koot wrote: > Agreed, making a certain attitude a habit requires repetition. Sometimes I feel like every word in the book is there for reason; every problem is there to illustrate some point, and I don't want to miss out on a real gem of an exercise. If there is rote repetitive stuff in there, I would want to avoid that. > But slavishly doing homework is not enough. Agreed. > One should acquire the skill to apply the discipline on exercises invented > by oneself and in the very end on problems encountered as a professional > programmer. Discipline, Perseverance, and Self-Control are critical. > In the very end, they are not mere theory, of course, even when it comes to > making money out of the programming. Good practices are even more important when things are going wrong. From jao at gnu.org Sun Sep 7 21:33:51 2008 From: jao at gnu.org (Jose A. Ortega Ruiz) Date: Thu Mar 26 02:27:41 2009 Subject: [plt-scheme] Re: What about "The Little Schemer"? References: Message-ID: <871vzvpgjk.fsf@mithrandir.homeunix.net> Woodhouse Gregory writes: > This, together with its companion volume "The Seasoned Schemer", are > books I've returned to many times. By no means should you expect to > fully appreciate them on a first read! Unlike HtDP programs, this > isn't really a general introduction to programming in Scheme. It's not > a cookbook or an an "advanced" text in the usual sense, either. It's a > book about ideas. I think these are books that will make you a better > programmer, not by teaching "coding techniques" but by helping you to > understand some fundamental concepts in a deeper way. > Total agreement. I remember that it was reading these books that concepts like (tail) recursion, the Y combinator or continuations really 'clicked' on me. The same goes for 'The Reasoned Schemer' and declarative programming. And yes, the clicking only really happened on second or third readings, which only adds to the fun (i still laugh when i remember my stupid feelings after my first reading of TLS). From hendrik at topoi.pooq.com Sun Sep 7 22:55:17 2008 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:27:41 2009 Subject: :-) Re: [plt-scheme] Re: Scheme sources readability In-Reply-To: References: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> Message-ID: <20080908025517.GA17922@topoi.pooq.com> On Sun, Sep 07, 2008 at 07:59:00PM +0300, kbohdan@mail.ru wrote: > > Lets compare with Java: If i see class names like XxxAdapter, > XxxVisitor, XxxFSM, XxxModel/XxxView/XxxController it only takes > a seconds to understand what is going on. Let's see. The xxx obviously indicates this is about pronography. That explains the COntroller, View, Model, and perbape even Visitor. But what are FSM and Adapter? My imagination is inadequate to the task. :-) -- hendrik From hendrik at topoi.pooq.com Sun Sep 7 22:59:49 2008 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:27:41 2009 Subject: [plt-scheme] Re: Scheme sources readability In-Reply-To: <756daca50809071144t10f875d7r8a5c0ef559fc02ad@mail.gmail.com> References: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> <756daca50809071144t10f875d7r8a5c0ef559fc02ad@mail.gmail.com> Message-ID: <20080908025949.GB17922@topoi.pooq.com> On Sun, Sep 07, 2008 at 01:44:00PM -0500, Grant Rettke wrote: > On Sun, Sep 7, 2008 at 11:59 AM, wrote: > > > > Design patterns (DP) were invented by architect not by programmers. > > Architect == Senior Programmer Actually, the original design patterns were developed by an architect -- the kind of guy that tells you how buildings and college campuses should be organised. They were described in his book A Pattern Language. -- hendrik From robby at cs.uchicago.edu Sun Sep 7 23:01:54 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:41 2009 Subject: [plt-scheme] Re: Scheme sources readability In-Reply-To: <20080908025949.GB17922@topoi.pooq.com> References: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> <756daca50809071144t10f875d7r8a5c0ef559fc02ad@mail.gmail.com> <20080908025949.GB17922@topoi.pooq.com> Message-ID: <932b2f1f0809072001y7c750169g37356bd7b3b55ab3@mail.gmail.com> His name is Christopher Alexander. Robby On Sun, Sep 7, 2008 at 9:59 PM, wrote: > On Sun, Sep 07, 2008 at 01:44:00PM -0500, Grant Rettke wrote: >> On Sun, Sep 7, 2008 at 11:59 AM, wrote: >> > >> > Design patterns (DP) were invented by architect not by programmers. >> >> Architect == Senior Programmer > > Actually, the original design patterns were developed by an architect -- > the kind of guy that tells you how buildings and college campuses should > be organised. They were described in his book A Pattern Language. > > -- hendrik > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From matthias at ccs.neu.edu Sun Sep 7 23:09:16 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:27:41 2009 Subject: [plt-scheme] Re: Scheme sources readability In-Reply-To: <932b2f1f0809072001y7c750169g37356bd7b3b55ab3@mail.gmail.com> References: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> <756daca50809071144t10f875d7r8a5c0ef559fc02ad@mail.gmail.com> <20080908025949.GB17922@topoi.pooq.com> <932b2f1f0809072001y7c750169g37356bd7b3b55ab3@mail.gmail.com> Message-ID: <0863B87E-EF1E-419A-A329-5D3059AC2CF0@ccs.neu.edu> .. but if you read his "Notes on Design", 2nd ed, preface, you'll see that he thinks GOF misunderstood the relevance and import of his work. I concur. HtDP is much closer -- Matthias On Sep 7, 2008, at 11:01 PM, Robby Findler wrote: > His name is Christopher Alexander. > > Robby > > On Sun, Sep 7, 2008 at 9:59 PM, wrote: >> On Sun, Sep 07, 2008 at 01:44:00PM -0500, Grant Rettke wrote: >>> On Sun, Sep 7, 2008 at 11:59 AM, wrote: >>>> >>>> Design patterns (DP) were invented by architect not by >>>> programmers. >>> >>> Architect == Senior Programmer >> >> Actually, the original design patterns were developed by an >> architect -- >> the kind of guy that tells you how buildings and college campuses >> should >> be organised. They were described in his book A Pattern Language. >> >> -- hendrik >> _________________________________________________ >> 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 Sun Sep 7 23:12:07 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:41 2009 Subject: :-) Re: [plt-scheme] Re: Scheme sources readability In-Reply-To: <20080908025517.GA17922@topoi.pooq.com> References: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> <20080908025517.GA17922@topoi.pooq.com> Message-ID: <756daca50809072012r75674c99n8990b104cc38dfa2@mail.gmail.com> On Sun, Sep 7, 2008 at 9:55 PM, wrote: > On Sun, Sep 07, 2008 at 07:59:00PM +0300, kbohdan@mail.ru wrote: >> >> Lets compare with Java: If i see class names like XxxAdapter, >> XxxVisitor, XxxFSM, XxxModel/XxxView/XxxController it only takes >> a seconds to understand what is going on. > > Let's see. The xxx obviously indicates this is about pronography. That > explains the COntroller, View, Model, and perbape even Visitor. But > what are FSM and Adapter? Oh programming humor... :) From eli at barzilay.org Sun Sep 7 23:35:36 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:27:42 2009 Subject: [plt-scheme] Re: Scheme sources readability In-Reply-To: References: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> <756daca50809071144t10f875d7r8a5c0ef559fc02ad@mail.gmail.com> <7EF7CE25-369A-4D55-8283-E3CD426B4597@ccs.neu.edu> <48C3F0A2.70802@soegaard.net> Message-ID: <18628.40328.165254.85507@arabic.ccs.neu.edu> On Sep 7, kbohdan@mail.ru wrote: > Matthias Felleisen wrote: > > >> After many years of programming i found new-old > >> scheme world very fascinating. One thing i still > >> do not like here is source code readability. > > > > Code in Scheme tends to be 1/4 or 1/3 of the size of Java. > > The indentation structure is far more revealing than there. > > So I find it as readable as Java or better. You could argue > > CL is better, I wouldn't respond then. > > Yes, agree code size is much smaller, but i'm still not sure if it > helps me to read it. Lets compare with Java: If i see class names > like XxxAdapter, XxxVisitor, XxxFSM, XxxModel/XxxView/XxxController > it only takes a seconds to understand what is going on. * You'll need to know what "Adapter", "Visitor", "FSM", etc mean to get a clue about the purpose of the code. At least "Visitor" is something that originates with a Java problem, so you'll need to know Java (culture) to really know what it means. * Still, these are only names that hint at the intended behavior. As such, you can do the same in any programming language (that doen't cripple its identifiers). * For example in Scheme, you'll see things like `print-foo', `set-foo-length!', and `foo?' that take seconds to understand what is going on. And like in Java you'll see names like `current-foo', `with-foo' and others that rely on (PLT) Scheme cultural idioms. Note also that there is nothing that prevents you from calling your modules/classes/functions names like `foo-model', `foo-view', etc, if you like to organize code in that particular way. > Can you take any non-trivial snippet from DrScheme collects to > demonstrate your algorithm of code reading? Whatever "algorithm" people use to read code, there's no way to escape learning the language. In the case of PLT it includes a *lot* of stuff that you need to know about, because there's plenty of functionality that it has. So choose any (small) piece of code that looks interesting, or maybe looks similar to something that you want to do, and start going over the source while reading about the functionality that you find. DrScheme will make it easier, by providing you will tools like check-syntax. > >> What about docstrings, > > > > We consider Help Desk a priority because its linked way > > of doing docs is superior. As my PhD advisor used to say, > > a program (he meant module) is only worth writing if you > > also write a paper about it (he meant documentation). > > "Help Desk" helps me to understand public interface, but it > doesn't help me too much to understand implementation. From your > point of view nobody guarantee that it should be easy for third > person to understand even interface of private module not even > saying about its implementation. IMHO, this is not the case for > commercial software development. Looks to me like you're confusing the role of doc strings: they're a particular form of documentation that happens to be attached to the function objects in a way that makes them interactively available. If anything, this means that they tend to be *shorter* than a manual entry, and in any case, both forms of documentation should talk about nothing more than the public interface. The actual implementation can change at any point, and comments are the tool for making such maintenance jobs easier. > >> design patterns (like GoF), > > > > The design patterns of GOF were invented to address weaknesses in > > Java and C++'s expressiveness when compared to Scheme and > > LISP. Plus, when we discover a "pattern", we just turn it into a > > construct via syntactic extensions. > > Design patterns (DP) were invented by architect not by programmers. [This is an odd statement.] > In programming DP are addressing history proven successful code > patterns used both in coding and understanding source code. Despite > the fact that i can implement most of patterns as macros doesn't > mean that scheme community should not pay attention on architecture > and force all starting scheme programmers to invent the bike. The fact that some design patterns can be implemented as macros mean that they would frequently be implemented -- so why not focus on things that you need and look into them instead of a vague "where are The Scheme Patterns listed?" question? On Sep 7, kbohdan@mail.ru wrote: > Jens Axel Soegaard wrote: > > One man's design pattern is another man's macro. > > Then what about "scheme specific design patterns" book gathering > successful higher-order macro programming practice or at least ideas > like: > - DSLs (ex: define-type, type-case from PLAI) There's no real "pattern" here, besides the fact that you have macros as a feature than can extend your language. (And BTW, it is questionable whether slapping one extra feature like `define-type'/`type-case' gives you a DSL -- if you're familiar with PLAI, then read about DSLs there.) > - monads > - coroutines > - pattern matching > - parser combinators These are useful facilities in general. In the context of PLT there is no explicit support that I know of for coroutines -- because we have threads and we have continuations (so make them be the relevant "DP", for some definition of "DP"). Pattern matching is available through `match' (see the manual for details). Monads, IIRC, were implemented in several different ways by several people. Parser combinators are not something that I'd consider a DP. On Sep 7, kbohdan@mail.ru wrote: > > Definitely each of them is worse separate book, but the aim is to > have catalogue of "common programming ideas" with > sample-implementaion and sample usage. IMHO, whole community can > benefit from such catalogue-book. Take `match' for example -- how will a sample implementation help? What's missing in the current documentation for PLT's match? On Sep 7, kbohdan@mail.ru wrote: > Grant Rettke wrote: > >> Design patterns (DP) were invented by architect not by > >> programmers. > > > > Architect == Senior Programmer > > "Christopher Alexander" == Senior Programmer ? :) (I hope that this was a joke...) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From kbohdan at mail.ru Mon Sep 8 00:56:39 2008 From: kbohdan at mail.ru (kbohdan@mail.ru) Date: Thu Mar 26 02:27:42 2009 Subject: [plt-scheme] Re: Scheme sources readability In-Reply-To: References: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> <756daca50809071144t10f875d7r8a5c0ef559fc02ad@mail.gmail.com> Message-ID: Richard Cleis wrote: >> Without pattern catalogue i can see the only way to become good scheme >> programmer : traverse tons of web links and articles without any idea >> what is good in practice and what is just mathematic experiment. >> And that is what i'm currenly doing :) > > What have you found that is not good in practice? How was it merely a > mathematical experiment? > > RAC Many things. For example famous "amb" from SICP. It looks great, but i haven't seen something like this is used in practice. Other example are monads which look great and promising, but people say that in scheme they are "not big fun". -- Bohdan From gregory.woodhouse at gmail.com Mon Sep 8 01:28:43 2008 From: gregory.woodhouse at gmail.com (Woodhouse Gregory) Date: Thu Mar 26 02:27:42 2009 Subject: [plt-scheme] Re: Scheme sources readability In-Reply-To: References: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> <756daca50809071144t10f875d7r8a5c0ef559fc02ad@mail.gmail.com> Message-ID: Interestingly, search in state space is an idea with practical signifamce (particularly for NP-hard problems). But be that as it may, I think the point of the treatment in SICP is to introduce non-determinism in a concrete and intuitive way. Sent from my iPhone On Sep 7, 2008, at 9:56 PM, kbohdan@mail.ru wrote: > Richard Cleis wrote: > >>> Without pattern catalogue i can see the only way to become good >>> scheme programmer : traverse tons of web links and articles >>> without any idea what is good in practice and what is just >>> mathematic experiment. >>> And that is what i'm currenly doing :) >> What have you found that is not good in practice? How was it >> merely a mathematical experiment? >> RAC > > Many things. > For example famous "amb" from SICP. It looks great, but i haven't seen > something like this is used in practice. > Other example are monads which look great and promising, but people > say that in scheme they are "not big fun". > > > -- > Bohdan > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From lordgeoffrey at optushome.com.au Mon Sep 8 04:29:13 2008 From: lordgeoffrey at optushome.com.au (LordGeoffrey) Date: Thu Mar 26 02:27:42 2009 Subject: [plt-scheme] Re: What about "The Little Schemer"? In-Reply-To: <871vzvpgjk.fsf@mithrandir.homeunix.net> References: <871vzvpgjk.fsf@mithrandir.homeunix.net> Message-ID: <48C4E259.6000902@optushome.com.au> Jose A. Ortega Ruiz wrote: > Woodhouse Gregory > writes: > > >> This, together with its companion volume "The Seasoned Schemer", are >> books I've returned to many times. By no means should you expect to >> fully appreciate them on a first read! Unlike HtDP programs, this >> isn't really a general introduction to programming in Scheme. It's not >> a cookbook or an an "advanced" text in the usual sense, either. It's a >> book about ideas. I think these are books that will make you a better >> programmer, not by teaching "coding techniques" but by helping you to >> understand some fundamental concepts in a deeper way. >> >> > > Total agreement. I remember that it was reading these books that > concepts like (tail) recursion, the Y combinator or continuations really > 'clicked' on me. The same goes for 'The Reasoned Schemer' and > declarative programming. And yes, the clicking only really happened on > second or third readings, which only adds to the fun (i still laugh when > i remember my stupid feelings after my first reading of TLS). > > Excellent books, but y combinator has always seemed, for want of a better word, pointless to me. Yep i am Neanderthal. From tom at zwizwa.be Mon Sep 8 05:27:45 2008 From: tom at zwizwa.be (Tom Schouten) Date: Thu Mar 26 02:27:42 2009 Subject: [plt-scheme] Re: Scheme sources readability In-Reply-To: References: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> <756daca50809071144t10f875d7r8a5c0ef559fc02ad@mail.gmail.com> Message-ID: <20080908092745.GD3401@zzz.i> > Other example are monads which look great and promising, but people say > that in scheme they are "not big fun". If I understand, this is mostly because polymorphic dispatch on return type is not possible in a dynamic language.. Would this work in Typed Scheme? From d.j.gurnell at gmail.com Mon Sep 8 07:59:49 2008 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Thu Mar 26 02:27:42 2009 Subject: [plt-scheme] Fund with override and augment Message-ID: Hi all, I got tripped up by something recently and I was wondering what your opinions on it were. Here's some sample code that illustrates the problem I had: #lang scheme (define class-a% (class object% (define/pubment (xyz) (list* 1 (inner null xyz))) (super-new))) (define class-b% (class class-a% (define/augride (xyz) (list 2)) (super-new))) (define class-c% (class class-b% (define/augment (xyz) (list 3)) (super-new))) Three classes in a hierarchy: the super class defines a method and allows it to be augmented. The middle class augments it and allows it to be overridden. Due to a programmer error, the third class augments the method rather than overriding it. Calling (send (new class-c%) xyz) yields '(1 3). This seems counter- intuitive to me: I was expecting a compiler error for class-c%. I got tripped up by this because I rewrote some code a couple of times, switching from overriding to augmenting and vice versa, and my changes to different classes got out of sync. To make matters more complicated I was using mixins and one of them was switching from augmenting to overriding when it shouldn't have been. Now, I'm not familiar with the origins or history of augmentable methods. I'm not sure if this is an oddity or what. Does anyone have any thoughts on this? In particular, is the behaviour shown above "correct" (for any given definition of the term)? Cheers, -- Dave From toddobryan at gmail.com Mon Sep 8 08:23:25 2008 From: toddobryan at gmail.com (Todd O'Bryan) Date: Thu Mar 26 02:27:43 2009 Subject: [plt-scheme] pixmap caching? Message-ID: <904774730809080523o735c0761n1f6c8350d00b9cba@mail.gmail.com> Silly question... Does DrScheme on Linux cache pixmap images to X11? Firefox and OpenOffice do the same thing and it's a wonderful way to crash thin clients or other diskless workstations very handily. See this bug report: https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/137764 I'm asking because all the thin clients in my lab are just hard freezing while we're playing with Kathi's fabric teachpack. If it's not the pixmap cache issue, I'll need to do some more investigating. Todd -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080908/b46f9c06/attachment.html From mflatt at cs.utah.edu Mon Sep 8 09:16:13 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:27:43 2009 Subject: [plt-scheme] Fund with override and augment In-Reply-To: References: Message-ID: <20080908131615.0FF02650094@mail-svr1.cs.utah.edu> At Mon, 8 Sep 2008 12:59:49 +0100, Dave Gurnell wrote: > I got tripped up by something recently and I was wondering what your > opinions on it were. Here's some sample code that illustrates the > problem I had: > > #lang scheme > > (define class-a% > (class object% > (define/pubment (xyz) > (list* 1 (inner null xyz))) > (super-new))) > > (define class-b% > (class class-a% > (define/augride (xyz) > (list 2)) > (super-new))) > > (define class-c% > (class class-b% > (define/augment (xyz) > (list 3)) > (super-new))) > > Three classes in a hierarchy: the super class defines a method and > allows it to be augmented. The middle class augments it and allows it > to be overridden. Due to a programmer error, the third class augments > the method rather than overriding it. > > Calling (send (new class-c%) xyz) yields '(1 3). This seems counter- > intuitive to me: I was expecting a compiler error for class-c%. Yes, that should have been an error (but a run-time error in creating the class bound to `class-c%'). I'll fix the bug soon. Matthew From mflatt at cs.utah.edu Mon Sep 8 10:42:14 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:27:43 2009 Subject: [plt-scheme] Fund with override and augment In-Reply-To: <20080908131615.0FF02650094@mail-svr1.cs.utah.edu> References: <20080908131615.0FF02650094@mail-svr1.cs.utah.edu> Message-ID: <20080908144214.970F3650058@mail-svr1.cs.utah.edu> At Mon, 8 Sep 2008 07:16:13 -0600, Matthew Flatt wrote: > Yes, that should have been an error [...] I'll fix the bug soon. Fixed in SVN. From d.j.gurnell at gmail.com Mon Sep 8 10:48:33 2008 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Thu Mar 26 02:27:43 2009 Subject: [plt-scheme] Fund with override and augment In-Reply-To: <20080908144214.970F3650058@mail-svr1.cs.utah.edu> References: <20080908131615.0FF02650094@mail-svr1.cs.utah.edu> <20080908144214.970F3650058@mail-svr1.cs.utah.edu> Message-ID: On 8 Sep 2008, at 15:42, Matthew Flatt wrote: > At Mon, 8 Sep 2008 07:16:13 -0600, Matthew Flatt wrote: >> Yes, that should have been an error [...] I'll fix the bug soon. > > Fixed in SVN. Thanks! I have a feeling this will catch a few bugs in my code :) -- Dave From hendrik at topoi.pooq.com Mon Sep 8 10:59:26 2008 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:27:43 2009 Subject: [plt-scheme] Re: Scheme sources readability In-Reply-To: References: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> <756daca50809071144t10f875d7r8a5c0ef559fc02ad@mail.gmail.com> Message-ID: <20080908145926.GA18625@topoi.pooq.com> On Mon, Sep 08, 2008 at 07:56:39AM +0300, kbohdan@mail.ru wrote: > Richard Cleis wrote: > > >>Without pattern catalogue i can see the only way to become good scheme > >>programmer : traverse tons of web links and articles without any idea > >>what is good in practice and what is just mathematic experiment. > >>And that is what i'm currenly doing :) > > > >What have you found that is not good in practice? How was it merely a > >mathematical experiment? > > > >RAC > > Many things. > For example famous "amb" from SICP. It looks great, but i haven't seen > something like this is used in practice. > Other example are monads which look great and promising, but people > say that in scheme they are "not big fun". Monads were invented so that you could do imperative stuff (at least top-level) within a purely functional language, and the theoretical combinator-calculus coding was to justify that it was, in some theoretical sense at least, still functional. Scheme is not purely functional, it has side-affecting operatins, and has no need for the monads. -- hendrik From lunarc.lists at gmail.com Mon Sep 8 11:06:47 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:27:44 2009 Subject: [plt-scheme] Re: Scheme sources readability In-Reply-To: <20080908145926.GA18625@topoi.pooq.com> References: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> <756daca50809071144t10f875d7r8a5c0ef559fc02ad@mail.gmail.com> <20080908145926.GA18625@topoi.pooq.com> Message-ID: 2008/9/8 : > On Mon, Sep 08, 2008 at 07:56:39AM +0300, kbohdan@mail.ru wrote: >> Richard Cleis wrote: >> >> >>Without pattern catalogue i can see the only way to become good scheme >> >>programmer : traverse tons of web links and articles without any idea >> >>what is good in practice and what is just mathematic experiment. >> >>And that is what i'm currenly doing :) >> > >> >What have you found that is not good in practice? How was it merely a >> >mathematical experiment? >> > >> >RAC >> >> Many things. >> For example famous "amb" from SICP. It looks great, but i haven't seen >> something like this is used in practice. >> Other example are monads which look great and promising, but people >> say that in scheme they are "not big fun". > > Monads were invented so that you could do imperative stuff (at least > top-level) within a purely functional language, and the theoretical > combinator-calculus coding was to justify that it was, in some > theoretical sense at least, still functional. > > Scheme is not purely functional, it has side-affecting > operatins, and has no need for the monads. There are other types of monads in Haskell for doing different things. See the 'Maybe' monad for an example. Henk From hendrik at topoi.pooq.com Mon Sep 8 11:08:40 2008 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:27:44 2009 Subject: [plt-scheme] Scheme sources readability In-Reply-To: References: Message-ID: <20080908150840.GB18625@topoi.pooq.com> On Sun, Sep 07, 2008 at 06:55:06PM +0100, Noel Welsh wrote: > > There are still patterns in Scheme and other functional languages. > E.g. fold, zipper, monad etc. Often they are published as "Functional > Pearls". Generally we try to replace patterns with code. The strength of Scheme is that this usually can be done in the abstract, said patterns being invoked with parameters to use them. The further strength is that you can use patterns without doing this, if it is easier or clearer. -- hendrik From kbohdan at mail.ru Mon Sep 8 13:19:50 2008 From: kbohdan at mail.ru (kbohdan@mail.ru) Date: Thu Mar 26 02:27:44 2009 Subject: [plt-scheme] Re: Scheme sources readability In-Reply-To: References: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> <756daca50809071144t10f875d7r8a5c0ef559fc02ad@mail.gmail.com> Message-ID: Woodhouse Gregory wrote: > Interestingly, search in state space is an idea with practical > signifamce (particularly for NP-hard problems). Thanks for info. Still trying to collect my in-brain catalogue of ideas/DPs from smart people like you. Its a pity that i can not find roadmap in a single book :) > But be that as it may, I think the point of the treatment in SICP is to > introduce non-determinism in a concrete and intuitive way. Already read SICP, but again - it doesn't provide implementation of amb (done by myself) - it doesn't mention about any NP-hard problems (AFAIR) - it says nothing about practical usage. - it doesn't compare with other solutions to similar problems The only thing it provides is intuitive puzzle sample. It is really great, but ... my must-read books/articles queue is still too long to fit in my lifetime. -- Bohdan From etanter at dcc.uchile.cl Mon Sep 8 13:06:42 2008 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Thu Mar 26 02:27:44 2009 Subject: [plt-scheme] Simple IDE questions: multi-file projects Message-ID: Hi all, I've seen the documentation about debugging multiple files in the DrScheme documentation, however it does not work in my case, and I have no clue what I'm missing. The documentation says: "To debug a program that spans several files, make sure that all of the files are open in DrScheme. Click the Debug button in the window containing the main program. As this program loads additional files that are present in other windows or tabs, message boxes will pop up asking whether or not to include the file in the debugging session. Including the file means that it will be possible to set breakpoints, inspect variables, and single-step in that file." I have a multi-file project, all files open, I debug one of the test file (examples.scm) that starts by loading other files: (load "ds-fp.scm") (load "test.scm") (load "macros.scm") (test ...) (test ...) etc. But no message boxes pop up asking for anything -- so the debug session only works within the main file (which in my case is useless). Any idea on what I might be doing wrong here? --- On another note, I find multiple file project development a bit below expectations (from someone coming from full-fledged IDEs of strange languages like Java). Isn't there a way to have a tree like pan on the right-hand side of the window with files as nodes with functions as subnodes? something like: ds-fp.scm |- do-this |- do-that test.scm |- t1 |- t2 If it's not available, any plans of making it? In the current state of affairs, the list of functions in the top right is fine, but for multiple files, that's not really useful. Also, how do I do a search/ replace between different files? Thanks in advance, -- ?ric From robby at cs.uchicago.edu Mon Sep 8 13:45:51 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:45 2009 Subject: [plt-scheme] Simple IDE questions: multi-file projects In-Reply-To: References: Message-ID: <932b2f1f0809081045w6940d6acn24ef6bf1898c6c5@mail.gmail.com> There is search across files (but it is not very high tech) and did you try the module browser (under the 'view' menu)? Robby On Mon, Sep 8, 2008 at 12:06 PM, Eric Tanter wrote: > Hi all, > > I've seen the documentation about debugging multiple files in the DrScheme > documentation, however it does not work in my case, and I have no clue what > I'm missing. > > The documentation says: > "To debug a program that spans several files, make sure that all of the > files are open in DrScheme. Click the Debug button in the window containing > the main program. As this program loads additional files that are present in > other windows or tabs, message boxes will pop up asking whether or not to > include the file in the debugging session. Including the file means that it > will be possible to set breakpoints, inspect variables, and single-step in > that file." > > I have a multi-file project, all files open, I debug one of the test file > (examples.scm) that starts by loading other files: > > (load "ds-fp.scm") > (load "test.scm") > (load "macros.scm") > > (test ...) > (test ...) > etc. > > But no message boxes pop up asking for anything -- so the debug session only > works within the main file (which in my case is useless). > > Any idea on what I might be doing wrong here? > > --- > > On another note, I find multiple file project development a bit below > expectations (from someone coming from full-fledged IDEs of strange > languages like Java). Isn't there a way to have a tree like pan on the > right-hand side of the window with files as nodes with functions as > subnodes? something like: > > ds-fp.scm > |- do-this > |- do-that > test.scm > |- t1 > |- t2 > > If it's not available, any plans of making it? In the current state of > affairs, the list of functions in the top right is fine, but for multiple > files, that's not really useful. Also, how do I do a search/replace between > different files? > > Thanks in advance, > > -- ?ric > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From ghcooper at gmail.com Mon Sep 8 13:53:41 2008 From: ghcooper at gmail.com (Gregory Cooper) Date: Thu Mar 26 02:27:45 2009 Subject: [plt-scheme] Simple IDE questions: multi-file projects In-Reply-To: References: Message-ID: <65e1d50c0809081053p695c9bafq57cedefdb4a9bd91@mail.gmail.com> In order to debug a multi-file project, any ancillary files need to be `module's loaded by `require'. Greg On Mon, Sep 8, 2008 at 10:06 AM, Eric Tanter wrote: > Hi all, > > I've seen the documentation about debugging multiple files in the DrScheme > documentation, however it does not work in my case, and I have no clue what > I'm missing. > > The documentation says: > "To debug a program that spans several files, make sure that all of the > files are open in DrScheme. Click the Debug button in the window containing > the main program. As this program loads additional files that are present in > other windows or tabs, message boxes will pop up asking whether or not to > include the file in the debugging session. Including the file means that it > will be possible to set breakpoints, inspect variables, and single-step in > that file." > > I have a multi-file project, all files open, I debug one of the test file > (examples.scm) that starts by loading other files: > > (load "ds-fp.scm") > (load "test.scm") > (load "macros.scm") > > (test ...) > (test ...) > etc. > > But no message boxes pop up asking for anything -- so the debug session only > works within the main file (which in my case is useless). > > Any idea on what I might be doing wrong here? > > --- > > On another note, I find multiple file project development a bit below > expectations (from someone coming from full-fledged IDEs of strange > languages like Java). Isn't there a way to have a tree like pan on the > right-hand side of the window with files as nodes with functions as > subnodes? something like: > > ds-fp.scm > |- do-this > |- do-that > test.scm > |- t1 > |- t2 > > If it's not available, any plans of making it? In the current state of > affairs, the list of functions in the top right is fine, but for multiple > files, that's not really useful. Also, how do I do a search/replace between > different files? > > Thanks in advance, > > -- ?ric > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From clements at brinckerhoff.org Mon Sep 8 14:41:25 2008 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:27:45 2009 Subject: [plt-scheme] redex question: use ordering to force determinism? Message-ID: <89047ED0-746C-4EAF-B91D-CFD426FDD69B@brinckerhoff.org> Redex is designed to handle one-to-many reduction relations gracefully. Is there some way to squelch this and specify that only the first applicable rule is to be used? That is, I would like to implicitly quantify each reduction rule with a side-condition that specifies that none of the textually earlier rules match. My conjecture is that no such mechanism exists, because the beginner.ss example includes things like this: ((symbol=? 'x_1 'x_2) . ==> . ,(if (eq? (term x_1) (term x_2)) (term true) (term false))) ((side-condition (symbol=? v_1 v_2) (or (not (and (pair? (term v_1)) (eq? (car (term v_1)) 'quote))) (not (and (pair? (term v_2)) (eq? (car (term v_2)) 'quote))))) . e==> . "symbol=?: expects argument of type ") ... yikes! Is there some reason not to allow relations to be ordered in this way? Am I missing some newer feature? Many thanks, John -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2484 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080908/296a78ae/smime.bin From robby at cs.uchicago.edu Mon Sep 8 14:42:58 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:46 2009 Subject: [plt-scheme] redex question: use ordering to force determinism? In-Reply-To: <89047ED0-746C-4EAF-B91D-CFD426FDD69B@brinckerhoff.org> References: <89047ED0-746C-4EAF-B91D-CFD426FDD69B@brinckerhoff.org> Message-ID: <932b2f1f0809081142h239734c2p4075b24fbf5e893c@mail.gmail.com> There is no way to do that, sorry. (metafunctions do have that property, tho) Robby On Mon, Sep 8, 2008 at 1:41 PM, John Clements wrote: > Redex is designed to handle one-to-many reduction relations gracefully. Is > there some way to squelch this and specify that only the first applicable > rule is to be used? That is, I would like to implicitly quantify each > reduction rule with a side-condition that specifies that none of the > textually earlier rules match. > > My conjecture is that no such mechanism exists, because the beginner.ss > example includes things like this: > > ((symbol=? 'x_1 'x_2) . ==> . ,(if (eq? (term x_1) (term x_2)) (term true) > (term false))) > ((side-condition (symbol=? v_1 v_2) > (or (not (and (pair? (term v_1)) > (eq? (car (term v_1)) 'quote))) > (not (and (pair? (term v_2)) > (eq? (car (term v_2)) 'quote))))) > . e==> . > "symbol=?: expects argument of type ") > > > ... yikes! > > Is there some reason not to allow relations to be ordered in this way? Am I > missing some newer feature? > > Many thanks, > > John > > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From matthias at ccs.neu.edu Mon Sep 8 14:39:32 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:27:46 2009 Subject: [plt-scheme] redex question: use ordering to force determinism? In-Reply-To: <932b2f1f0809081142h239734c2p4075b24fbf5e893c@mail.gmail.com> References: <89047ED0-746C-4EAF-B91D-CFD426FDD69B@brinckerhoff.org> <932b2f1f0809081142h239734c2p4075b24fbf5e893c@mail.gmail.com> Message-ID: No reason to be sorry. Relations are, well, relations. And meta- functions denote, oh, eh, functions. On Sep 8, 2008, at 2:42 PM, Robby Findler wrote: > There is no way to do that, sorry. (metafunctions do have that > property, tho) > > Robby > > On Mon, Sep 8, 2008 at 1:41 PM, John Clements > wrote: >> Redex is designed to handle one-to-many reduction relations >> gracefully. Is >> there some way to squelch this and specify that only the first >> applicable >> rule is to be used? That is, I would like to implicitly quantify >> each >> reduction rule with a side-condition that specifies that none of the >> textually earlier rules match. >> >> My conjecture is that no such mechanism exists, because the >> beginner.ss >> example includes things like this: >> >> ((symbol=? 'x_1 'x_2) . ==> . ,(if (eq? (term x_1) (term x_2)) >> (term true) >> (term false))) >> ((side-condition (symbol=? v_1 v_2) >> (or (not (and (pair? (term v_1)) >> (eq? (car (term v_1)) 'quote))) >> (not (and (pair? (term v_2)) >> (eq? (car (term v_2)) 'quote))))) >> . e==> . >> "symbol=?: expects argument of type ") >> >> >> ... yikes! >> >> Is there some reason not to allow relations to be ordered in this >> way? Am I >> missing some newer feature? >> >> Many thanks, >> >> John >> >> >> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From sk at cs.brown.edu Mon Sep 8 14:48:24 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:27:46 2009 Subject: [plt-scheme] redex question: use ordering to force determinism? In-Reply-To: <89047ED0-746C-4EAF-B91D-CFD426FDD69B@brinckerhoff.org> References: <89047ED0-746C-4EAF-B91D-CFD426FDD69B@brinckerhoff.org> Message-ID: Then they wouldn't be relations, no? On Mon, Sep 8, 2008 at 2:41 PM, John Clements wrote: > Redex is designed to handle one-to-many reduction relations gracefully. Is > there some way to squelch this and specify that only the first applicable > rule is to be used? That is, I would like to implicitly quantify each > reduction rule with a side-condition that specifies that none of the > textually earlier rules match. > > My conjecture is that no such mechanism exists, because the beginner.ss > example includes things like this: > > ((symbol=? 'x_1 'x_2) . ==> . ,(if (eq? (term x_1) (term x_2)) (term true) > (term false))) > ((side-condition (symbol=? v_1 v_2) > (or (not (and (pair? (term v_1)) > (eq? (car (term v_1)) 'quote))) > (not (and (pair? (term v_2)) > (eq? (car (term v_2)) 'quote))))) > . e==> . > "symbol=?: expects argument of type ") > > > ... yikes! > > Is there some reason not to allow relations to be ordered in this way? Am I > missing some newer feature? > > Many thanks, > > John > > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From clements at brinckerhoff.org Mon Sep 8 15:08:06 2008 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:27:47 2009 Subject: Utility of monads in Scheme (was: Re: [plt-scheme] Re: Scheme sources readability) In-Reply-To: <20080908145926.GA18625@topoi.pooq.com> References: <4F20ACAE-90B1-4769-BBF1-898D8C3649ED@ccs.neu.edu> <756daca50809071144t10f875d7r8a5c0ef559fc02ad@mail.gmail.com> <20080908145926.GA18625@topoi.pooq.com> Message-ID: <785848F7-C007-462F-B4FC-9689BABA95C0@brinckerhoff.org> On Sep 8, 2008, at 7:59 AM, hendrik@topoi.pooq.com wrote: > > Monads were invented so that you could do imperative stuff (at least > top-level) within a purely functional language, and the theoretical > combinator-calculus coding was to justify that it was, in some > theoretical sense at least, still functional. > > Scheme is not purely functional, it has side-affecting > operatins, and has no need for the monads. Wellll..... When regarded as a programming pattern, monads can certainly lead to some useful Scheme macros. To take the canonical example, a state- passing interpreter is a whole heck of a lot easier to read when you introduce a do-like state-passing macro. -------------- 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/20080908/e8901d7d/smime.bin From clements at brinckerhoff.org Mon Sep 8 15:11:00 2008 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:27:47 2009 Subject: [plt-scheme] redex question: use ordering to force determinism? In-Reply-To: References: <89047ED0-746C-4EAF-B91D-CFD426FDD69B@brinckerhoff.org> Message-ID: <8414D26E-6CE2-4AAC-A472-406C58EB82DA@brinckerhoff.org> On Sep 8, 2008, at 11:48 AM, Shriram Krishnamurthi wrote: > Then they wouldn't be relations, no? Sure they would. Functions aren't a subset of relations in your world? I just want a more convenient way of specifying a relation with a particular set of constraints. Anyhow, perhaps metafunctions do what I want. Thanks! John > On Mon, Sep 8, 2008 at 2:41 PM, John Clements > wrote: >> Redex is designed to handle one-to-many reduction relations >> gracefully. Is >> there some way to squelch this and specify that only the first >> applicable >> rule is to be used? That is, I would like to implicitly quantify >> each >> reduction rule with a side-condition that specifies that none of the >> textually earlier rules match. >> >> My conjecture is that no such mechanism exists, because the >> beginner.ss >> example includes things like this: >> >> ((symbol=? 'x_1 'x_2) . ==> . ,(if (eq? (term x_1) (term x_2)) >> (term true) >> (term false))) >> ((side-condition (symbol=? v_1 v_2) >> (or (not (and (pair? (term v_1)) >> (eq? (car (term v_1)) 'quote))) >> (not (and (pair? (term v_2)) >> (eq? (car (term v_2)) 'quote))))) >> . e==> . >> "symbol=?: expects argument of type ") >> >> >> ... yikes! >> >> Is there some reason not to allow relations to be ordered in this >> way? Am I >> missing some newer feature? >> >> Many thanks, >> >> John >> >> >> >> _________________________________________________ >> 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/20080908/ef814336/smime.bin From dherman at ccs.neu.edu Mon Sep 8 17:07:17 2008 From: dherman at ccs.neu.edu (Dave Herman) Date: Thu Mar 26 02:27:47 2009 Subject: [plt-scheme] mystifying scribble warning Message-ID: <48C59405.8090300@ccs.neu.edu> I added some @declare-exporting[...] declarations to my Scribble docs and I'm getting a bunch of identical warnings that I can't decipher: WARNING: collected information for key multiple times: (exporting-libraries #f) If it helps, this is from a multi-file scribbling. Thanks, Dave From etanter at dcc.uchile.cl Mon Sep 8 18:30:50 2008 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Thu Mar 26 02:27:48 2009 Subject: [plt-scheme] Simple IDE questions: multi-file projects In-Reply-To: References: Message-ID: <45B7ED20-B66E-48E0-B416-D62B03181AAD@dcc.uchile.cl> Thanks all for the extremely fast answers! I understood that I need to start using modules instead of files with load. So I'm trying (still)... Problem I'm running into: mutually-recursive modules (A requires B, B requires A). I get a cycle error. I have found a thread on the mailing list (from 2004 (*)), that suggests that it's not feasible "out of the box". So I am trying to refactor the code to avoid this, but does not seem possible. While I'm still trying, I can't help wondering: what is wrong with mutually-recursive modules? Note that I understand the technical reason of why a cycle is bad, because a module can have expressions that have to be evaluated, so all definitions must be there, etc. -- but all my modules are just define's, the actual code is in the examples/tests -- so there is indeed no real problem with the dependencies (I guess that's why the solution with files/load was working nicely. Any simple way out of this tunnel? -- ?ric (*) http://article.gmane.org/gmane.lisp.scheme.plt/6081 PS: BTW this might be a bug: a circular dependency of the type: A requires B B requires (only-in A foo) does not result in a cyclic error, but in an out of memory error. (I guess one would expect the same circularity error) On Sep 8, 2008, at 13:55 , Danny Yoo wrote: >> I have a multi-file project, all files open, I debug one of the >> test file >> (examples.scm) that starts by loading other files: >> >> (load "ds-fp.scm") >> (load "test.scm") >> (load "macros.scm") > > Are you using PLT Scheme modules? It looks like you're using "load", > which isn't involving the module system. See: > > http://docs.plt-scheme.org/guide/intro.html#(part._use-module) > > http://docs.plt-scheme.org/guide/module-basics.html > > > Good luck to you! From robby at cs.uchicago.edu Mon Sep 8 18:33:42 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:48 2009 Subject: [plt-scheme] Simple IDE questions: multi-file projects In-Reply-To: <45B7ED20-B66E-48E0-B416-D62B03181AAD@dcc.uchile.cl> References: <45B7ED20-B66E-48E0-B416-D62B03181AAD@dcc.uchile.cl> Message-ID: <932b2f1f0809081533n5c8c153fpab4e72189d496276@mail.gmail.com> The short answer is that modules may have macros and other things that affect the compilation of those that require them, so cycles are just disallowed. You might try using units inside your files (or just refactoring ...) Robby On Mon, Sep 8, 2008 at 5:30 PM, Eric Tanter wrote: > Thanks all for the extremely fast answers! > I understood that I need to start using modules instead of files with load. > > So I'm trying (still)... > Problem I'm running into: mutually-recursive modules (A requires B, B > requires A). I get a cycle error. > I have found a thread on the mailing list (from 2004 (*)), that suggests > that it's not feasible "out of the box". > > So I am trying to refactor the code to avoid this, but does not seem > possible. > While I'm still trying, I can't help wondering: what is wrong with > mutually-recursive modules? > > Note that I understand the technical reason of why a cycle is bad, because a > module can have expressions that have to be evaluated, so all definitions > must be there, etc. -- but all my modules are just define's, the actual code > is in the examples/tests -- so there is indeed no real problem with the > dependencies (I guess that's why the solution with files/load was working > nicely. > > Any simple way out of this tunnel? > > -- ?ric > > (*) http://article.gmane.org/gmane.lisp.scheme.plt/6081 > > PS: BTW this might be a bug: > a circular dependency of the type: > A requires B > B requires (only-in A foo) > does not result in a cyclic error, but in an out of memory error. (I guess > one would expect the same circularity error) > > > On Sep 8, 2008, at 13:55 , Danny Yoo wrote: > >>> I have a multi-file project, all files open, I debug one of the test file >>> (examples.scm) that starts by loading other files: >>> >>> (load "ds-fp.scm") >>> (load "test.scm") >>> (load "macros.scm") >> >> Are you using PLT Scheme modules? It looks like you're using "load", >> which isn't involving the module system. See: >> >> http://docs.plt-scheme.org/guide/intro.html#(part._use-module) >> >> http://docs.plt-scheme.org/guide/module-basics.html >> >> >> Good luck to you! > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From etanter at dcc.uchile.cl Mon Sep 8 18:41:28 2008 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Thu Mar 26 02:27:48 2009 Subject: [plt-scheme] Simple IDE questions: multi-file projects In-Reply-To: <932b2f1f0809081533n5c8c153fpab4e72189d496276@mail.gmail.com> References: <45B7ED20-B66E-48E0-B416-D62B03181AAD@dcc.uchile.cl> <932b2f1f0809081533n5c8c153fpab4e72189d496276@mail.gmail.com> Message-ID: <488692E5-1ED3-49AC-BC19-344275C76C25@dcc.uchile.cl> > The short answer is that modules may have macros and other things that > affect the compilation of those that require them, so cycles are just > disallowed. Ok I understand that. Would be nice if I could say (or even better, if the system could figure out --fairly straightforward I guess) that a module is a "plain standard definitions module" so that these issues don't show up. > You might try using units inside your files ok, will look at what this other kind of beast is... > (or just refactoring ...) I understand this idea, but does not always work. I have an interpreter and a transport layer, I want them to be separate modules, but one needs to call the other, and vice-versa. Can't help it. And I can imagine tons of similar cases... -- ?ric From lunarc.lists at gmail.com Mon Sep 8 19:19:39 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:27:48 2009 Subject: [plt-scheme] Simple IDE questions: multi-file projects In-Reply-To: <488692E5-1ED3-49AC-BC19-344275C76C25@dcc.uchile.cl> References: <45B7ED20-B66E-48E0-B416-D62B03181AAD@dcc.uchile.cl> <932b2f1f0809081533n5c8c153fpab4e72189d496276@mail.gmail.com> <488692E5-1ED3-49AC-BC19-344275C76C25@dcc.uchile.cl> Message-ID: 2008/9/8 Eric Tanter : >> The short answer is that modules may have macros and other things that >> affect the compilation of those that require them, so cycles are just >> disallowed. > > Ok I understand that. Would be nice if I could say (or even better, if the > system could figure out --fairly straightforward I guess) that a module is a > "plain standard definitions module" so that these issues don't show up. > >> You might try using units inside your files > > ok, will look at what this other kind of beast is... > >> (or just refactoring ...) > > I understand this idea, but does not always work. I have an interpreter and > a transport layer, I want them to be separate modules, but one needs to call > the other, and vice-versa. Can't help it. And I can imagine tons of similar > cases... You could try dynamic-require, which seems to work in my experience. Henk From grettke at acm.org Mon Sep 8 23:10:00 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:49 2009 Subject: [plt-scheme] HTDP: Exercise 6.2.1 Message-ID: <756daca50809082010u556c96e4p5c86bc49b0dc1d2f@mail.gmail.com> Hi, When I follow the directions for Exercise 6.2.1 where you "Evaluate the following expressions in order: " the drawing that comes out is a big mess. Is it supposed to be, or should it look like something intelligible? Grant From etanter at dcc.uchile.cl Mon Sep 8 23:22:18 2008 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Thu Mar 26 02:27:49 2009 Subject: [plt-scheme] Simple IDE questions: multi-file projects In-Reply-To: References: <45B7ED20-B66E-48E0-B416-D62B03181AAD@dcc.uchile.cl> <932b2f1f0809081533n5c8c153fpab4e72189d496276@mail.gmail.com> <488692E5-1ED3-49AC-BC19-344275C76C25@dcc.uchile.cl> Message-ID: <5DC9CA35-C805-4718-BB7B-2919D75F5BA1@dcc.uchile.cl> Indeed, with dynamic-require I was able to have things work. Thanks a lot! -- ?ric On Sep 8, 2008, at 19:19 , Henk Boom wrote: > 2008/9/8 Eric Tanter : >>> The short answer is that modules may have macros and other things >>> that >>> affect the compilation of those that require them, so cycles are >>> just >>> disallowed. >> >> Ok I understand that. Would be nice if I could say (or even better, >> if the >> system could figure out --fairly straightforward I guess) that a >> module is a >> "plain standard definitions module" so that these issues don't show >> up. >> >>> You might try using units inside your files >> >> ok, will look at what this other kind of beast is... >> >>> (or just refactoring ...) >> >> I understand this idea, but does not always work. I have an >> interpreter and >> a transport layer, I want them to be separate modules, but one >> needs to call >> the other, and vice-versa. Can't help it. And I can imagine tons of >> similar >> cases... > > You could try dynamic-require, which seems to work in my experience. > > Henk From etanter at dcc.uchile.cl Mon Sep 8 23:39:50 2008 From: etanter at dcc.uchile.cl (Eric Tanter) Date: Thu Mar 26 02:27:49 2009 Subject: [plt-scheme] Simple IDE questions: multi-file projects In-Reply-To: <5DC9CA35-C805-4718-BB7B-2919D75F5BA1@dcc.uchile.cl> References: <45B7ED20-B66E-48E0-B416-D62B03181AAD@dcc.uchile.cl> <932b2f1f0809081533n5c8c153fpab4e72189d496276@mail.gmail.com> <488692E5-1ED3-49AC-BC19-344275C76C25@dcc.uchile.cl> <5DC9CA35-C805-4718-BB7B-2919D75F5BA1@dcc.uchile.cl> Message-ID: <70E337C7-F826-4858-85DF-480A11D9BA9D@dcc.uchile.cl> But now things work, I can come back to the original intent: having multi-file debugging and using the module browser. a) multi-file debugging seems to interact badly with dynamic-require: I keep getting the dialog box asking me if I want to debug file a, then b, then c, then a, then b, etc... never stops -- bottom line is, I can't use it b) the module browser does not open: I get the message "The module browser is only available for programs in the PLT languages and in the module language (and only for programs that have modules in them)." ... and my program is in the module language, my program is made up of 6-7 modules + a couple of test files that just require the modules and play with them. any advice is greatly appreciated, -- ?ric On Sep 8, 2008, at 23:22 , Eric Tanter wrote: > Indeed, with dynamic-require I was able to have things work. Thanks > a lot! > > -- ?ric > > > On Sep 8, 2008, at 19:19 , Henk Boom wrote: > >> 2008/9/8 Eric Tanter : >>>> The short answer is that modules may have macros and other things >>>> that >>>> affect the compilation of those that require them, so cycles are >>>> just >>>> disallowed. >>> >>> Ok I understand that. Would be nice if I could say (or even >>> better, if the >>> system could figure out --fairly straightforward I guess) that a >>> module is a >>> "plain standard definitions module" so that these issues don't >>> show up. >>> >>>> You might try using units inside your files >>> >>> ok, will look at what this other kind of beast is... >>> >>>> (or just refactoring ...) >>> >>> I understand this idea, but does not always work. I have an >>> interpreter and >>> a transport layer, I want them to be separate modules, but one >>> needs to call >>> the other, and vice-versa. Can't help it. And I can imagine tons >>> of similar >>> cases... >> >> You could try dynamic-require, which seems to work in my experience. >> >> Henk > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From robby at cs.uchicago.edu Mon Sep 8 23:42:31 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:49 2009 Subject: [plt-scheme] Simple IDE questions: multi-file projects In-Reply-To: <70E337C7-F826-4858-85DF-480A11D9BA9D@dcc.uchile.cl> References: <45B7ED20-B66E-48E0-B416-D62B03181AAD@dcc.uchile.cl> <932b2f1f0809081533n5c8c153fpab4e72189d496276@mail.gmail.com> <488692E5-1ED3-49AC-BC19-344275C76C25@dcc.uchile.cl> <5DC9CA35-C805-4718-BB7B-2919D75F5BA1@dcc.uchile.cl> <70E337C7-F826-4858-85DF-480A11D9BA9D@dcc.uchile.cl> Message-ID: <932b2f1f0809082042n554d52cauc39191bb0178880a@mail.gmail.com> On Mon, Sep 8, 2008 at 10:39 PM, Eric Tanter wrote: > b) the module browser does not open: I get the message "The module browser > is only available for programs in the PLT languages and in the module > language (and only for programs that have modules in them)." ... and my > program is in the module language, my program is made up of 6-7 modules + a > couple of test files that just require the modules and play with them. I guess you're trying to use the module browser in one of the test files? That doesn't work. Everything has to be in a module. FWIW, we have tried to make things work well when everything is in a module. Really everything. Robby > On Sep 8, 2008, at 23:22 , Eric Tanter wrote: > >> Indeed, with dynamic-require I was able to have things work. Thanks a lot! >> >> -- ?ric >> >> >> On Sep 8, 2008, at 19:19 , Henk Boom wrote: >> >>> 2008/9/8 Eric Tanter : >>>>> >>>>> The short answer is that modules may have macros and other things that >>>>> affect the compilation of those that require them, so cycles are just >>>>> disallowed. >>>> >>>> Ok I understand that. Would be nice if I could say (or even better, if >>>> the >>>> system could figure out --fairly straightforward I guess) that a module >>>> is a >>>> "plain standard definitions module" so that these issues don't show up. >>>> >>>>> You might try using units inside your files >>>> >>>> ok, will look at what this other kind of beast is... >>>> >>>>> (or just refactoring ...) >>>> >>>> I understand this idea, but does not always work. I have an interpreter >>>> and >>>> a transport layer, I want them to be separate modules, but one needs to >>>> call >>>> the other, and vice-versa. Can't help it. And I can imagine tons of >>>> similar >>>> cases... >>> >>> You could try dynamic-require, which seems to work in my experience. >>> >>> Henk >> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From ghcooper at gmail.com Tue Sep 9 00:13:03 2008 From: ghcooper at gmail.com (Gregory Cooper) Date: Thu Mar 26 02:27:49 2009 Subject: [plt-scheme] Simple IDE questions: multi-file projects In-Reply-To: <70E337C7-F826-4858-85DF-480A11D9BA9D@dcc.uchile.cl> References: <45B7ED20-B66E-48E0-B416-D62B03181AAD@dcc.uchile.cl> <932b2f1f0809081533n5c8c153fpab4e72189d496276@mail.gmail.com> <488692E5-1ED3-49AC-BC19-344275C76C25@dcc.uchile.cl> <5DC9CA35-C805-4718-BB7B-2919D75F5BA1@dcc.uchile.cl> <70E337C7-F826-4858-85DF-480A11D9BA9D@dcc.uchile.cl> Message-ID: <65e1d50c0809082113t119958e1md6d7dbca0e3cce81@mail.gmail.com> > a) multi-file debugging seems to interact badly with dynamic-require: I keep > getting the dialog box asking me if I want to debug file a, then b, then c, > then a, then b, etc... never stops -- bottom line is, I can't use it I'm not sure what to do about this. If you say "no", does it stop asking? If so, could you just say "yes" until you've touched each module once? If that doesn't work, then my next question is: how tightly coupled are the modules? If you don't want to convert to units, and you can reduce the cycle-inducing imports to a just a few, then one trick is to fake B's import of A's `foo' by having B export a `set-foo' for A. I think this is roughly what units would do internally. Greg > b) the module browser does not open: I get the message "The module browser > is only available for programs in the PLT languages and in the module > language (and only for programs that have modules in them)." ... and my > program is in the module language, my program is made up of 6-7 modules + a > couple of test files that just require the modules and play with them. > > any advice is greatly appreciated, > > -- ?ric > > > On Sep 8, 2008, at 23:22 , Eric Tanter wrote: > >> Indeed, with dynamic-require I was able to have things work. Thanks a lot! >> >> -- ?ric >> >> >> On Sep 8, 2008, at 19:19 , Henk Boom wrote: >> >>> 2008/9/8 Eric Tanter : >>>>> >>>>> The short answer is that modules may have macros and other things that >>>>> affect the compilation of those that require them, so cycles are just >>>>> disallowed. >>>> >>>> Ok I understand that. Would be nice if I could say (or even better, if >>>> the >>>> system could figure out --fairly straightforward I guess) that a module >>>> is a >>>> "plain standard definitions module" so that these issues don't show up. >>>> >>>>> You might try using units inside your files >>>> >>>> ok, will look at what this other kind of beast is... >>>> >>>>> (or just refactoring ...) >>>> >>>> I understand this idea, but does not always work. I have an interpreter >>>> and >>>> a transport layer, I want them to be separate modules, but one needs to >>>> call >>>> the other, and vice-versa. Can't help it. And I can imagine tons of >>>> similar >>>> cases... >>> >>> You could try dynamic-require, which seems to work in my experience. >>> >>> Henk >> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From david.hansen at gmx.net Tue Sep 9 04:57:01 2008 From: david.hansen at gmx.net (David Hansen) Date: Thu Mar 26 02:27:50 2009 Subject: [plt-scheme] scheme_weak_reference and MZ_PRECISE_GC Message-ID: <87ljy1wvc2.fsf@localhorst.mine.nu> Hello, what's the alternative to scheme_weak_reference() if MZ_PRECISE_GC is defined? Shall I use a finalizer and the fixup callback? And how would I use the fixup callback? I'm currently playing around with Welcome to MzScheme v4.1 [3m], Copyright (c) 2004-2008 PLT Scheme Inc. BTW, the docs don't mention that the weak reference function aren't available with 3m. David From matthias at ccs.neu.edu Tue Sep 9 06:58:32 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:27:50 2009 Subject: [plt-scheme] HTDP: Exercise 6.2.1 In-Reply-To: <756daca50809082010u556c96e4p5c86bc49b0dc1d2f@mail.gmail.com> References: <756daca50809082010u556c96e4p5c86bc49b0dc1d2f@mail.gmail.com> Message-ID: Yes. On Sep 8, 2008, at 11:10 PM, Grant Rettke wrote: > Hi, > > When I follow the directions for Exercise 6.2.1 where you "Evaluate > the following expressions in order: " the drawing that comes out is a > big mess. Is it supposed to be, or should it look like something > intelligible? > > Grant > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From matthias at ccs.neu.edu Tue Sep 9 06:59:35 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:27:50 2009 Subject: [plt-scheme] HTDP: Exercise 6.2.1 In-Reply-To: <756daca50809082010u556c96e4p5c86bc49b0dc1d2f@mail.gmail.com> References: <756daca50809082010u556c96e4p5c86bc49b0dc1d2f@mail.gmail.com> Message-ID: Try to use the world and image teachpacks instead of draw. That will help you a lot. -- Matthias P.S. Get started at http://www.ccs.neu.edu/home/matthias/HtDP/ Prologue/book.html On Sep 8, 2008, at 11:10 PM, Grant Rettke wrote: > Hi, > > When I follow the directions for Exercise 6.2.1 where you "Evaluate > the following expressions in order: " the drawing that comes out is a > big mess. Is it supposed to be, or should it look like something > intelligible? > > Grant > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From mflatt at cs.utah.edu Tue Sep 9 07:23:59 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:27:50 2009 Subject: [plt-scheme] scheme_weak_reference and MZ_PRECISE_GC In-Reply-To: <87ljy1wvc2.fsf@localhorst.mine.nu> References: <87ljy1wvc2.fsf@localhorst.mine.nu> Message-ID: <20080909112403.221A065009D@mail-svr1.cs.utah.edu> At Tue, 09 Sep 2008 10:57:01 +0200, David Hansen wrote: > what's the alternative to scheme_weak_reference() if MZ_PRECISE_GC is > defined? Shall I use a finalizer and the fixup callback? And how would > I use the fixup callback? You can use scheme_make_weak_box() with both 3m and CGC. > BTW, the docs don't mention that the weak reference function aren't > available with 3m. Thanks --- I'll fix that. Matthew From jensaxel at soegaard.net Tue Sep 9 08:22:52 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:27:50 2009 Subject: [plt-scheme] Simple IDE questions: multi-file projects In-Reply-To: <5DC9CA35-C805-4718-BB7B-2919D75F5BA1@dcc.uchile.cl> References: <45B7ED20-B66E-48E0-B416-D62B03181AAD@dcc.uchile.cl> <932b2f1f0809081533n5c8c153fpab4e72189d496276@mail.gmail.com> <488692E5-1ED3-49AC-BC19-344275C76C25@dcc.uchile.cl> <5DC9CA35-C805-4718-BB7B-2919D75F5BA1@dcc.uchile.cl> Message-ID: <48C66A9C.3090107@soegaard.net> > On Sep 8, 2008, at 19:19 , Henk Boom wrote: > >> 2008/9/8 Eric Tanter : >>>> The short answer is that modules may have macros and other things that >>>> affect the compilation of those that require them, so cycles are just >>>> disallowed. >>> >>> Ok I understand that. Would be nice if I could say (or even better, >>> if the >>> system could figure out --fairly straightforward I guess) that a >>> module is a >>> "plain standard definitions module" so that these issues don't show up. >>> >>>> You might try using units inside your files >>> >>> ok, will look at what this other kind of beast is... >>> >>>> (or just refactoring ...) >>> >>> I understand this idea, but does not always work. I have an >>> interpreter and >>> a transport layer, I want them to be separate modules, but one needs >>> to call >>> the other, and vice-versa. Can't help it. And I can imagine tons of >>> similar >>> cases... >> >> You could try dynamic-require, which seems to work in my experience. Eric Tanter wrote: > Indeed, with dynamic-require I was able to have things work. Thanks a > lot! > I am not sure dynamic-require is the solution. I suspect the error messages might not be as precise as they could be. Here is one strategy that will break the cycle. Introduce a module called config.ss: #lang scheme (provide current-interpreter current-transporter) (define current-interpreter (make-parameter (lambda x (error "no current interpreter yet")))) (define current-transporter (make-parameter (lambda x (error "no current transporter yet")))) This module is to be required in both the interpreter and the transporter module. Now in the interpreter module, you need to set the current-interpreter like this: (current-interpreter my-interpreter) at the bottom of the source file. In the transporter, you can now call the interpreter like this: ((current-interpreter) the-source-of-program an-environment other-args ...) Another strategy is to add a parameter to the interpreter, so that it besides the program and environment also takes a transporter as input. -- Jens Axel S?gaard From grettke at acm.org Tue Sep 9 08:38:21 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:50 2009 Subject: [plt-scheme] Simple IDE questions: multi-file projects In-Reply-To: <48C66A9C.3090107@soegaard.net> References: <45B7ED20-B66E-48E0-B416-D62B03181AAD@dcc.uchile.cl> <932b2f1f0809081533n5c8c153fpab4e72189d496276@mail.gmail.com> <488692E5-1ED3-49AC-BC19-344275C76C25@dcc.uchile.cl> <5DC9CA35-C805-4718-BB7B-2919D75F5BA1@dcc.uchile.cl> <48C66A9C.3090107@soegaard.net> Message-ID: <756daca50809090538m46a31b9pc7c95d10547ac031@mail.gmail.com> > Another strategy is to add a parameter to the interpreter, so that it > besides the program and environment also takes a transporter as input. That sounds like how you would structure it with classes, and by analogue, units, too? From noelwelsh at gmail.com Tue Sep 9 08:44:39 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:27:50 2009 Subject: [plt-scheme] Simple IDE questions: multi-file projects In-Reply-To: <756daca50809090538m46a31b9pc7c95d10547ac031@mail.gmail.com> References: <45B7ED20-B66E-48E0-B416-D62B03181AAD@dcc.uchile.cl> <932b2f1f0809081533n5c8c153fpab4e72189d496276@mail.gmail.com> <488692E5-1ED3-49AC-BC19-344275C76C25@dcc.uchile.cl> <5DC9CA35-C805-4718-BB7B-2919D75F5BA1@dcc.uchile.cl> <48C66A9C.3090107@soegaard.net> <756daca50809090538m46a31b9pc7c95d10547ac031@mail.gmail.com> Message-ID: Yes, it is all more or less the same idea, just with different trade-offs in the implementation. N. On Tue, Sep 9, 2008 at 1:38 PM, Grant Rettke wrote: >> Another strategy is to add a parameter to the interpreter, so that it >> besides the program and environment also takes a transporter as input. > > That sounds like how you would structure it with classes, and by > analogue, units, too? From dherman at ccs.neu.edu Tue Sep 9 09:23:00 2008 From: dherman at ccs.neu.edu (Dave Herman) Date: Thu Mar 26 02:27:51 2009 Subject: [plt-scheme] low-level contract constructors Message-ID: <48C678B4.5090305@ccs.neu.edu> In parameter.plt I have a struct-as-procedure called a pseudo-parameter with a high-order contract constructor pseudo-parameter/c. I discovered a couple little issues with the scheme/contract library in the process. - The undocumented `proj-get' procedure seems necessary for a higher-order contract constructor, since you need to use the projection of the underlying contract in building the new one. - The `flat-proj' procedure isn't exported from scheme/contract, but it's also needed for a higher-order contract, in case the underlying contract is flat. So I copied its definition from contract-guts.ss and pasted it into my module. Robby, if by chance you have a moment, could you take a look at http://planet.plt-scheme.org/package-source/dherman/parameter.plt/1/3/main.ss and tell me if pseudo-parameter/c looks plausible? It seems to work for the test cases I've tried, but it's a little confusing so I'm not sure I've got it right. Particularly the call to ((proj-get c) c) looks weird. Also, I seem to be getting the object-name wrong when wrapping a function contract, e.g.: (module a scheme (require (planet dherman/parameter:1:3)) (define p (let ([f add1]) (make-pseudo-parameter (lambda () f) (lambda (g) (set! f g))))) (provide/contract [p (pseudo-parameter/c (-> number? number?))])) > (require 'a) > (p) # Thanks so much, Dave From robby at cs.uchicago.edu Tue Sep 9 09:30:55 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:51 2009 Subject: [plt-scheme] low-level contract constructors In-Reply-To: <48C678B4.5090305@ccs.neu.edu> References: <48C678B4.5090305@ccs.neu.edu> Message-ID: <932b2f1f0809090630h19748690o1d1a0977f353b443@mail.gmail.com> On Tue, Sep 9, 2008 at 8:23 AM, Dave Herman wrote: > In parameter.plt I have a struct-as-procedure called a pseudo-parameter with > a high-order contract constructor pseudo-parameter/c. I discovered a couple > little issues with the scheme/contract library in the process. > > - The undocumented `proj-get' procedure seems necessary for a higher-order > contract constructor, since you need to use the projection of the underlying > contract in building the new one. > > - The `flat-proj' procedure isn't exported from scheme/contract, but it's > also needed for a higher-order contract, in case the underlying contract is > flat. So I copied its definition from contract-guts.ss and pasted it into my > module. I have not spent the time to properly document and export the tools to build new contract combinators (partly because they have changed a bunch and partly because I just haven't gotten to it). > Robby, if by chance you have a moment, could you take a look at > > http://planet.plt-scheme.org/package-source/dherman/parameter.plt/1/3/main.ss > > and tell me if pseudo-parameter/c looks plausible? It seems fine on a quick look. > It seems to work for the > test cases I've tried, but it's a little confusing so I'm not sure I've got > it right. Particularly the call to ((proj-get c) c) looks weird. That's fine. > Also, I > seem to be getting the object-name wrong when wrapping a function contract, > e.g.: > > (module a scheme > (require (planet dherman/parameter:1:3)) > (define p > (let ([f add1]) > (make-pseudo-parameter > (lambda () f) > (lambda (g) > (set! f g))))) > (provide/contract [p (pseudo-parameter/c (-> number? number?))])) > > > (require 'a) > > (p) > # I don't think you can do much better. You're making a wrapper function, so you're going to have that wrapper function's name, not the name `add1'. The same thing happens like this: #lang scheme/load (module m scheme (provide/contract [f (-> (-> number? number?))]) (define (f) add1)) (module n scheme (require 'm) (printf "~s\n" (f))) (require 'n) Robby From dherman at ccs.neu.edu Tue Sep 9 09:32:32 2008 From: dherman at ccs.neu.edu (Dave Herman) Date: Thu Mar 26 02:27:51 2009 Subject: [plt-scheme] low-level contract constructors In-Reply-To: <932b2f1f0809090630h19748690o1d1a0977f353b443@mail.gmail.com> References: <48C678B4.5090305@ccs.neu.edu> <932b2f1f0809090630h19748690o1d1a0977f353b443@mail.gmail.com> Message-ID: <48C67AF0.4050808@ccs.neu.edu> Great, thanks for the (incredibly) quick response! Thanks, Dave Robby Findler wrote: > On Tue, Sep 9, 2008 at 8:23 AM, Dave Herman wrote: >> In parameter.plt I have a struct-as-procedure called a pseudo-parameter with >> a high-order contract constructor pseudo-parameter/c. I discovered a couple >> little issues with the scheme/contract library in the process. >> >> - The undocumented `proj-get' procedure seems necessary for a higher-order >> contract constructor, since you need to use the projection of the underlying >> contract in building the new one. >> >> - The `flat-proj' procedure isn't exported from scheme/contract, but it's >> also needed for a higher-order contract, in case the underlying contract is >> flat. So I copied its definition from contract-guts.ss and pasted it into my >> module. > > I have not spent the time to properly document and export the tools to > build new contract combinators (partly because they have changed a > bunch and partly because I just haven't gotten to it). > >> Robby, if by chance you have a moment, could you take a look at >> >> http://planet.plt-scheme.org/package-source/dherman/parameter.plt/1/3/main.ss >> >> and tell me if pseudo-parameter/c looks plausible? > > It seems fine on a quick look. > >> It seems to work for the >> test cases I've tried, but it's a little confusing so I'm not sure I've got >> it right. Particularly the call to ((proj-get c) c) looks weird. > > That's fine. > >> Also, I >> seem to be getting the object-name wrong when wrapping a function contract, >> e.g.: >> >> (module a scheme >> (require (planet dherman/parameter:1:3)) >> (define p >> (let ([f add1]) >> (make-pseudo-parameter >> (lambda () f) >> (lambda (g) >> (set! f g))))) >> (provide/contract [p (pseudo-parameter/c (-> number? number?))])) >> >> > (require 'a) >> > (p) >> # > > I don't think you can do much better. You're making a wrapper > function, so you're going to have that wrapper function's name, not > the name `add1'. The same thing happens like this: > > #lang scheme/load > > (module m scheme > (provide/contract [f (-> (-> number? number?))]) > (define (f) add1)) > > (module n scheme > (require 'm) > (printf "~s\n" (f))) > > (require 'n) > > Robby From david.hansen at gmx.net Tue Sep 9 10:40:53 2008 From: david.hansen at gmx.net (David Hansen) Date: Thu Mar 26 02:27:51 2009 Subject: [plt-scheme] Re: scheme_weak_reference and MZ_PRECISE_GC References: <87ljy1wvc2.fsf@localhorst.mine.nu> <20080909112403.221A065009D@mail-svr1.cs.utah.edu> Message-ID: <87hc8pwfey.fsf@localhorst.mine.nu> On Tue, 9 Sep 2008 05:23:59 -0600 Matthew Flatt wrote: > At Tue, 09 Sep 2008 10:57:01 +0200, David Hansen wrote: >> what's the alternative to scheme_weak_reference() if MZ_PRECISE_GC is >> defined? Shall I use a finalizer and the fixup callback? And how would >> I use the fixup callback? > > You can use scheme_make_weak_box() with both 3m and CGC. Hmm, but that gives me another Scheme_Object*. Now I need something to weak ref that ;-) OK, I could scheme_dont_gc_ptr() the weak box and scheme_gc_ptr_ok() the box in a finalizer of the value the box holds. But this sounds a bit complicated. I want to keep track of Scheme_Object*s of a custom tagged type. Can I do that from the fixup callback I pass to GC_register_traversers()? If so, how? The documentation is a bit dense there. In case the object moved, how do I get the old and new Scheme_Object*? David From mflatt at cs.utah.edu Tue Sep 9 11:17:55 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:27:51 2009 Subject: [plt-scheme] Re: scheme_weak_reference and MZ_PRECISE_GC In-Reply-To: <87hc8pwfey.fsf@localhorst.mine.nu> References: <87ljy1wvc2.fsf@localhorst.mine.nu> <20080909112403.221A065009D@mail-svr1.cs.utah.edu> <87hc8pwfey.fsf@localhorst.mine.nu> Message-ID: <20080909151755.7D08F6500BF@mail-svr1.cs.utah.edu> At Tue, 09 Sep 2008 16:40:53 +0200, David Hansen wrote: > On Tue, 9 Sep 2008 05:23:59 -0600 Matthew Flatt wrote: > > > At Tue, 09 Sep 2008 10:57:01 +0200, David Hansen wrote: > >> what's the alternative to scheme_weak_reference() if MZ_PRECISE_GC is > >> defined? Shall I use a finalizer and the fixup callback? And how would > >> I use the fixup callback? > > > > You can use scheme_make_weak_box() with both 3m and CGC. > > Hmm, but that gives me another Scheme_Object*. Now I need something to > weak ref that ;-) I guess the problem is that the GC can't see the reference to the object? I can see how that would work with CGC, where objects don't move and so the only reason the pointer needs to change is when it's collected. But 3m needs to see all references to Scheme objects. > OK, I could scheme_dont_gc_ptr() the weak box and scheme_gc_ptr_ok() the > box in a finalizer of the value the box holds. If I guess correctly about the situation, that wouldn't work, because the weak box might move even if it isn't collected. But you could put the weak box in an immobile box (allocated with scheme_malloc_immobile_box), and so on. > I want to keep track of Scheme_Object*s of a custom tagged type. Do you just need a a weak hash table, where the sets of keys in the table can act as a list of all the non-GCed objects? > Can I > do that from the fixup callback I pass to GC_register_traversers()? If you know when a GC starts and when it ends, then you could record all the pointers that are passed to the fixup function. That seems relatively complicated, though, and I don't think there's currently a way to know when a GC starts and ends. > If so, how? The documentation is a bit dense there. In case the object > moved, how do I get the old and new Scheme_Object*? GC_fixup_self() can do that. It's mentioned in section 3.1.1, but I should add an entry in the list of procedures. Matthew From grettke at acm.org Tue Sep 9 11:47:23 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:51 2009 Subject: [plt-scheme] Can you study HTDP to satisfy the goal to learn Functional Programming? Message-ID: <756daca50809090847l7d3a963p291cd183798b65c6@mail.gmail.com> Hi, While talking with one of my friends who is studying Haskell as his first FP, I told him that while I had learned Scheme the language, and feel like I factually understand what FP is about, I haven't internalized the "FP way of thinking". What I mean by this is that at my day job, I use object oriented (OO) languages, and I factually understand the approach, but I've also internalized (and mixed it with my experience) to form my personal philosophy and vision of "how to do it". I haven't go that with FP, and I want to get it. Since HTDP is %75 pure FP, is that a good place to start? Having read 50 pages or so into it, I feel like the data-driven approach makes sense. Not trying to make something out of nothing here, but I think there is more to programming approaches and philosophies regarding FP than just reading a bit about it and writing some functions. All thoughts welcome. Best wishes, Grant From david.hansen at gmx.net Tue Sep 9 11:59:42 2008 From: david.hansen at gmx.net (David Hansen) Date: Thu Mar 26 02:27:52 2009 Subject: [plt-scheme] Re: scheme_weak_reference and MZ_PRECISE_GC References: <87ljy1wvc2.fsf@localhorst.mine.nu> <20080909112403.221A065009D@mail-svr1.cs.utah.edu> <87hc8pwfey.fsf@localhorst.mine.nu> <20080909151755.7D08F6500BF@mail-svr1.cs.utah.edu> Message-ID: <87abehwbrl.fsf@localhorst.mine.nu> On Tue, 9 Sep 2008 09:17:55 -0600 Matthew Flatt wrote: > At Tue, 09 Sep 2008 16:40:53 +0200, David Hansen wrote: > >> OK, I could scheme_dont_gc_ptr() the weak box and scheme_gc_ptr_ok() the >> box in a finalizer of the value the box holds. > > If I guess correctly about the situation, that wouldn't work, because > the weak box might move even if it isn't collected. But you could put > the weak box in an immobile box (allocated with > scheme_malloc_immobile_box), and so on. OK, thanks. But still pretty complicated. >> I want to keep track of Scheme_Object*s of a custom tagged type. > > Do you just need a a weak hash table, where the sets of keys in the > table can act as a list of all the non-GCed objects? I want a mapping -> . So when an in C written proc returns a Scheme object it will use the possibly already existing one instead of creating a new wrapper. The reason I don't use the existing c pointer type is to have some flexibility in what "some possible data" can be. An now it's of course about understanding the issue as well ;-) I think I just start understanding how this stuff work: When I scheme_register_extension_global() the values of this mapping, will 3m update the pointers? What would be the difference to a weak reference? I suspect they will never get collected (not what I want). >> Can I >> do that from the fixup callback I pass to GC_register_traversers()? > > If you know when a GC starts and when it ends, then you could record > all the pointers that are passed to the fixup function. That seems > relatively complicated, though, and I don't think there's currently a > way to know when a GC starts and ends. > >> If so, how? The documentation is a bit dense there. In case the object >> moved, how do I get the old and new Scheme_Object*? > > GC_fixup_self() can do that. It's mentioned in section 3.1.1, but I > should add an entry in the list of procedures. Will this give me the new Scheme_Object*? That will most probably be enough, the C pointer from the other lib is accessible from the Scheme_Object so I can update the mapping. David From mflatt at cs.utah.edu Tue Sep 9 12:22:18 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:27:52 2009 Subject: [plt-scheme] Re: scheme_weak_reference and MZ_PRECISE_GC In-Reply-To: <87abehwbrl.fsf@localhorst.mine.nu> References: <87ljy1wvc2.fsf@localhorst.mine.nu> <20080909112403.221A065009D@mail-svr1.cs.utah.edu> <87hc8pwfey.fsf@localhorst.mine.nu> <20080909151755.7D08F6500BF@mail-svr1.cs.utah.edu> <87abehwbrl.fsf@localhorst.mine.nu> Message-ID: <20080909162218.610F46500BA@mail-svr1.cs.utah.edu> At Tue, 09 Sep 2008 17:59:42 +0200, David Hansen wrote: > I want a mapping > > -> the C pointer + some possible other data>. That's simply a hash table from integers (representing C pointers) to Scheme objects. If that's it, there's no need for anything like weak references. Is there more to the problem? Matthew From goetter at mazama.net Tue Sep 9 12:46:58 2008 From: goetter at mazama.net (Ben Goetter) Date: Thu Mar 26 02:27:52 2009 Subject: [plt-scheme] Extensibility of MrEd In-Reply-To: <20080804121107.8C4B16500AD@mail-svr1.cs.utah.edu> References: <48960316.8060809@mazama.net> <4896184E.5070903@mazama.net> <20080804121107.8C4B16500AD@mail-svr1.cs.utah.edu> Message-ID: <48C6A882.3060102@mazama.net> (One month later....) Matthew Flatt wrote: > I don't think there's currently a way to extend the messages recognized > by a frame, but it's something we could add. > > Beware that there's a bad interaction between PLT Scheme threads and > Windows: a Scheme-level thread swap cannot be allowed while handling a > Windows message. The solution is usually to handle a message by just > queuing a callback in the eventspace, and then return to Windows > immediately; that works when you don't need to compute any particular > return value for the message. Would that strategy work for the messages > that you need to handle (if you had a way to install a handler)? > That strategy would work. And I think (handwaving) that for my Windows-specific needs it could work entirely without hacking on MrEd. The app at startup would subclass each wx-created frame window, installing therein its own wndproc that sniffs for the private messages and queues an appropriate callback. (class frame% () (define/public (on-init) (register-hocuspocus (get-handle))) (define/augment (on-close) (unregister-hocuspocus (get-handle))) (define/public (on-hocuspocus x y dx dy) whatever) etc) ;; create previous, then send it on-init /* mzscheme extension - hocuspocus.c */ Scheme_Object* register_hocuspocus(whatever-thunks-to-a-HWND h) { /* save away existing wndproc of h, install sniffer proc in its stead */ } LRESULT CALLBACK SnifferWndProc(HWND h, UINT msg, WPARAM, LPARAM) { /* if msg is one of ours, crack the params and queue a hocuspocus callback on h's frame%, else invoke previous proc */ } The callback needs to end up in the context of the frame% corresponding to that particular window, as if it had been dispatched via send in Scheme, and should arrive with the same priority as other interactive events. At present it's not obvious to me how to do either of these. Ben From mflatt at cs.utah.edu Tue Sep 9 13:03:01 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:27:52 2009 Subject: [plt-scheme] Extensibility of MrEd In-Reply-To: <48C6A882.3060102@mazama.net> References: <48960316.8060809@mazama.net> <4896184E.5070903@mazama.net> <20080804121107.8C4B16500AD@mail-svr1.cs.utah.edu> <48C6A882.3060102@mazama.net> Message-ID: <20080909170301.8AB6E65009D@mail-svr1.cs.utah.edu> At Tue, 09 Sep 2008 09:46:58 -0700, Ben Goetter wrote: > /* mzscheme extension - hocuspocus.c */ > Scheme_Object* register_hocuspocus(whatever-thunks-to-a-HWND h) > { /* save away existing wndproc of h, install sniffer proc in its stead */ } > LRESULT CALLBACK SnifferWndProc(HWND h, UINT msg, WPARAM, LPARAM) > { /* if msg is one of ours, crack the params and queue a hocuspocus > callback on h's frame%, else invoke previous proc */ } > > The callback needs to end up in the context of the frame% corresponding > to that particular window, as if it had been dispatched via send in > Scheme, and should arrive with the same priority as other interactive > events. At present it's not obvious to me how to do either of these. At the Scheme level, there's a `get-eventspace' method on `top-level-window<%>', so you should have access to the relevant eventspace whenever you have access to a frame's HWND. Meanwhile, `mred/private/kernel' exports `middle-queue-key'. Its value is recognized specially by `queue-callback' when supplied as the "boolean" second argument, and it causes a callback to be added with the same priority as a GUI event. (Of course, the module `mred/private/kernel' is meant to be private to MrEd, but if you have enough privileges to load an extension, then it's probably fine also to access that module.) Matthew From david.hansen at gmx.net Tue Sep 9 13:09:54 2008 From: david.hansen at gmx.net (David Hansen) Date: Thu Mar 26 02:27:52 2009 Subject: [plt-scheme] Re: scheme_weak_reference and MZ_PRECISE_GC References: <87ljy1wvc2.fsf@localhorst.mine.nu> <20080909112403.221A065009D@mail-svr1.cs.utah.edu> <87hc8pwfey.fsf@localhorst.mine.nu> <20080909151755.7D08F6500BF@mail-svr1.cs.utah.edu> <87abehwbrl.fsf@localhorst.mine.nu> <20080909162218.610F46500BA@mail-svr1.cs.utah.edu> Message-ID: <87tzcputy5.fsf@localhorst.mine.nu> On Tue, 9 Sep 2008 10:22:18 -0600 Matthew Flatt wrote: > At Tue, 09 Sep 2008 17:59:42 +0200, David Hansen wrote: >> I want a mapping >> >> -> > the C pointer + some possible other data>. > > That's simply a hash table from integers (representing C pointers) to > Scheme objects. > > If that's it, there's no need for anything like weak references. Is > there more to the problem? Well, sometimes it's that easy :) Thank you very much. Last question for now: How do I store weak values? Using a weak box? David From clements at brinckerhoff.org Tue Sep 9 13:28:55 2008 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:27:53 2009 Subject: [plt-scheme] problems with #%datum (was: Re: [plt-bug] all/9476: Debugger broken on mzscheme + kw) In-Reply-To: <20080611120729.5B38A6500E2@mail-svr1.cs.utah.edu> References: <200806110500.m5B501tn020113@champlain.ccs.neu.edu> <5F67AB69-699E-4731-82A1-2F743E4A5BD6@brinckerhoff.org> <20080611120729.5B38A6500E2@mail-svr1.cs.utah.edu> Message-ID: <9EFCEFED-FF03-4A24-B7C7-4A6E384F225F@brinckerhoff.org> On Jun 11, 2008, at 5:07 AM, Matthew Flatt wrote: > At Tue, 10 Jun 2008 22:20:15 -0700, John Clements wrote: >> >> On Jun 10, 2008, at 10:00 PM, eli@barzilay.org wrote: >> >>> A new problem report is waiting at >>> http://bugs.plt-scheme.org/query/?cmd=view&pr=9476 >>> >>> Reported by Eli Barzilay for release: 3.99.0.9 >>> >>> *** Description: >>> Trying to debug the program below throws an error: >>> >>> require: namespace mismatch; reference (phase 0) to a >>> module "/home/scheme/plt/collects/scheme/private/kw.ss" that is >>> not available (phase level 0) in: #%app >> >> FWIW, this is also the error encountered by the stepper tests in all >> of the test cases that involve running the stepper on non-teaching >> languages. > > The problem happens when a tool adds code to the a program, and when > the added code uses `#%app' from `scheme/base'. > > The solution is to explicitly use `#%plain-app' for the added code. > > I'll fix the debugger... I fussed with the language fields of the modules used by the stepper's test code, & now I have a related problem that happens on expansion of annotater-decorated code. require: namespace mismatch; reference (phase 0) to a module "/Users/ clements/plt/collects/scheme/private/old-ds.ss" that is not available (phase level 0) in: #%datum I took a look at old-ds.ss and ... I'm still confused. It's quite short, and appears to be a compatability definition of an old define- struct. It appears to me that the next step is to isolate the piece of the annotator that inserts the offending #%datum, and hope that something comes to mind; perhaps I'm inadvertently capturing and inserting a binding for #%datum that depends on old-ds.ss. Any suggestions appreciated. Many thanks, John -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2484 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080909/06ffb788/smime.bin From mflatt at cs.utah.edu Tue Sep 9 14:19:14 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:27:53 2009 Subject: [plt-scheme] Re: problems with #%datum (was: Re: [plt-bug] all/9476: Debugger broken on mzscheme + kw) In-Reply-To: <9EFCEFED-FF03-4A24-B7C7-4A6E384F225F@brinckerhoff.org> References: <200806110500.m5B501tn020113@champlain.ccs.neu.edu> <5F67AB69-699E-4731-82A1-2F743E4A5BD6@brinckerhoff.org> <20080611120729.5B38A6500E2@mail-svr1.cs.utah.edu> <9EFCEFED-FF03-4A24-B7C7-4A6E384F225F@brinckerhoff.org> Message-ID: <20080909181915.256616500AF@mail-svr1.cs.utah.edu> At Tue, 9 Sep 2008 10:28:55 -0700, John Clements wrote: > > On Jun 11, 2008, at 5:07 AM, Matthew Flatt wrote: > > > At Tue, 10 Jun 2008 22:20:15 -0700, John Clements wrote: > >> > >> On Jun 10, 2008, at 10:00 PM, eli@barzilay.org wrote: > >> > >>> A new problem report is waiting at > >>> http://bugs.plt-scheme.org/query/?cmd=view&pr=9476 > >>> > >>> Reported by Eli Barzilay for release: 3.99.0.9 > >>> > >>> *** Description: > >>> Trying to debug the program below throws an error: > >>> > >>> require: namespace mismatch; reference (phase 0) to a > >>> module "/home/scheme/plt/collects/scheme/private/kw.ss" that is > >>> not available (phase level 0) in: #%app > >> > >> FWIW, this is also the error encountered by the stepper tests in all > >> of the test cases that involve running the stepper on non-teaching > >> languages. > > > > The problem happens when a tool adds code to the a program, and when > > the added code uses `#%app' from `scheme/base'. > > > > The solution is to explicitly use `#%plain-app' for the added code. > > > > I'll fix the debugger... > > I fussed with the language fields of the modules used by the stepper's > test code, & now I have a related problem that happens on expansion of > annotater-decorated code. > > require: namespace mismatch; reference (phase 0) to a module "/Users/ > clements/plt/collects/scheme/private/old-ds.ss" that is not available > (phase level 0) in: #%datum > > I took a look at old-ds.ss and ... I'm still confused. It's quite > short, and appears to be a compatability definition of an old define- > struct. Yes: "old-ds.ss" supplies `#%datum' for `mzscheme'. > It appears to me that the next step is to isolate the piece of the > annotator that inserts the offending #%datum, and hope that something > comes to mind; perhaps I'm inadvertently capturing and inserting a > binding for #%datum that depends on old-ds.ss. Keep in mind that you don't have to use `#%datum' explicitly to arrive at this error. If a bit of syntax is intended as a (self-quoting) literal, and if its bindings are from `mzscheme' instead of `scheme/base', then it effectively carries the `mzscheme' binding of `#%datum' with it. Matthew From noelwelsh at gmail.com Tue Sep 9 16:29:13 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:27:53 2009 Subject: [plt-scheme] Can you study HTDP to satisfy the goal to learn Functional Programming? In-Reply-To: <756daca50809090847l7d3a963p291cd183798b65c6@mail.gmail.com> References: <756daca50809090847l7d3a963p291cd183798b65c6@mail.gmail.com> Message-ID: On Tue, Sep 9, 2008 at 4:47 PM, Grant Rettke wrote: > Since HTDP is %75 pure FP, is that a good place to start? Having read > 50 pages or so into it, I feel like the data-driven approach makes > sense. I think the data-driven / HtDP approach is the core of FP style. There is a lot more to FPt, but that is the essential part. You could write the same code in Scheme. ML, Haskell etc. with only minor differences due to syntax. N. From matthias at ccs.neu.edu Tue Sep 9 16:38:07 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:27:53 2009 Subject: [plt-scheme] Can you study HTDP to satisfy the goal to learn Functional Programming? In-Reply-To: References: <756daca50809090847l7d3a963p291cd183798b65c6@mail.gmail.com> Message-ID: <3F00D19C-A8FF-465B-9404-68F8B91582F4@ccs.neu.edu> On Sep 9, 2008, at 4:29 PM, Noel Welsh wrote: > On Tue, Sep 9, 2008 at 4:47 PM, Grant Rettke wrote: >> Since HTDP is %75 pure FP, is that a good place to start? Having read >> 50 pages or so into it, I feel like the data-driven approach makes >> sense. > > I think the data-driven / HtDP approach is the core of FP style. > There is a lot more to FPt, but that is the essential part. You could > write the same code in Scheme. ML, Haskell etc. with only minor > differences due to syntax. 1. HtDP is not just about functional programming. The design ideas work in many contexts (Ruby, Java). 2. HtDP is FP as you can find it in Erlang, Haskell, ML, Lisp, AND Scheme, etc. In each of these languages you will find additional FP ideas that are specific to a family: Haskell: a type system in which you can write a mail client ML: a functor system Erlang: parallelism out of your ears Lisp/Scheme: macro systems that make programmers an order of magnitude more productive Depending on your interests, you can use HtDP to explore any and all of these. -- Matthias From grettke at acm.org Tue Sep 9 17:43:57 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:53 2009 Subject: [plt-scheme] Can you study HTDP to satisfy the goal to learn Functional Programming? In-Reply-To: <3F00D19C-A8FF-465B-9404-68F8B91582F4@ccs.neu.edu> References: <756daca50809090847l7d3a963p291cd183798b65c6@mail.gmail.com> <3F00D19C-A8FF-465B-9404-68F8B91582F4@ccs.neu.edu> Message-ID: <756daca50809091443h1b5462bdh576dc31c850aa01d@mail.gmail.com> On Tue, Sep 9, 2008 at 3:38 PM, Matthias Felleisen wrote: > 1. HtDP is not just about functional programming. The design ideas > work in many contexts (Ruby, Java). I'm not trying to paint HTDP into a corner here. There seems to be a lot of books on FP languages, but, there just don't seem to be very many books that teach you the "FP" style of programming. HTDP does that, and more! From mflatt at cs.utah.edu Tue Sep 9 18:45:12 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:27:54 2009 Subject: [plt-scheme] Re: scheme_weak_reference and MZ_PRECISE_GC In-Reply-To: <87tzcputy5.fsf@localhorst.mine.nu> References: <87ljy1wvc2.fsf@localhorst.mine.nu> <20080909112403.221A065009D@mail-svr1.cs.utah.edu> <87hc8pwfey.fsf@localhorst.mine.nu> <20080909151755.7D08F6500BF@mail-svr1.cs.utah.edu> <87abehwbrl.fsf@localhorst.mine.nu> <20080909162218.610F46500BA@mail-svr1.cs.utah.edu> <87tzcputy5.fsf@localhorst.mine.nu> Message-ID: <20080909224514.478406500C8@mail-svr1.cs.utah.edu> At Tue, 09 Sep 2008 19:09:54 +0200, David Hansen wrote: > On Tue, 9 Sep 2008 10:22:18 -0600 Matthew Flatt wrote: > > > At Tue, 09 Sep 2008 17:59:42 +0200, David Hansen wrote: > >> I want a mapping > >> > >> -> >> the C pointer + some possible other data>. > > > > That's simply a hash table from integers (representing C pointers) to > > Scheme objects. > > > > If that's it, there's no need for anything like weak references. Is > > there more to the problem? > > Well, sometimes it's that easy :) Thank you very much. Last question > for now: How do I store weak values? Using a weak box? Just to make sure I understand: what do you mean by "weak values"? Do you mean, for example, that the Scheme objects in the above table should be collectable even while the C object is still allocated (perhaps because the table of wrappers is really just a cache)? In that case, yes, a weak box can be used for the value of the hash table, and when you look up a box from the table, you'll have to treat an empty box the same as not being in the table. Matthew From andre.mayers at usherbrooke.ca Tue Sep 9 21:15:14 2008 From: andre.mayers at usherbrooke.ca (Andre Mayers) Date: Thu Mar 26 02:27:54 2009 Subject: [plt-scheme] How to reinitialize the complete search path directory ? In-Reply-To: <1220651136.19066.36.camel@daves-laptop> References: <1220651136.19066.36.camel@daves-laptop> Message-ID: <000501c912e2$ae394ef0$0aabecd0$@mayers@usherbrooke.ca> I try to define my own directory for collection without success. First, I have defined a collects directory in C:\Users\amayers\Cours\IFT359\Exercice I tried to define PLTCOLLECTS environment variable without success, and I deleted this environment variable. I deleted also the collects directory in C:\Users\amayers\Cours\IFT359\Exercice I logout and login and I still have # (get-collects-search-dirs) (# # #) I am using version 4.1 on window vista Thank you Andre Mayers From robby at cs.uchicago.edu Tue Sep 9 22:36:22 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:54 2009 Subject: [plt-scheme] How to reinitialize the complete search path directory ? In-Reply-To: <5521673769486209001@unknownmsgid> References: <1220651136.19066.36.camel@daves-laptop> <5521673769486209001@unknownmsgid> Message-ID: <932b2f1f0809091936m31d78f5ap837267a708716368@mail.gmail.com> Depending on what you want to do, often it is better to use "planet link" than setting that environment variable. That said, perhaps the problem is that setting PLTCOLLECTS (or current-library-collection-paths) adds sets of directories, no just individual directories? That is, look inside \Program Files (x86)\PLT\collects and you'll see that there are directories there, with files inside them. The same needs to hold for your Exercise directory. hth, Robby On Tue, Sep 9, 2008 at 8:15 PM, Andre Mayers wrote: > I try to define my own directory for collection without success. > > First, I have defined a collects directory in > C:\Users\amayers\Cours\IFT359\Exercice > > I tried to define PLTCOLLECTS environment variable without success, and I > deleted this environment variable. > > I deleted also the collects directory in > C:\Users\amayers\Cours\IFT359\Exercice > > I logout and login and I still have > # >> (get-collects-search-dirs) > (# > # > #) > > I am using version 4.1 on window vista > > Thank you > > Andre Mayers > > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From mark.engelberg at gmail.com Tue Sep 9 23:38:56 2008 From: mark.engelberg at gmail.com (Mark Engelberg) Date: Thu Mar 26 02:27:54 2009 Subject: [plt-scheme] Can you study HTDP to satisfy the goal to learn Functional Programming? In-Reply-To: <756daca50809091443h1b5462bdh576dc31c850aa01d@mail.gmail.com> References: <756daca50809090847l7d3a963p291cd183798b65c6@mail.gmail.com> <3F00D19C-A8FF-465B-9404-68F8B91582F4@ccs.neu.edu> <756daca50809091443h1b5462bdh576dc31c850aa01d@mail.gmail.com> Message-ID: I find that for me to really get a different style of programming, I need to study large, nontrivial programs written in that style. For me, HtDP doesn't really provide that. All the examples in the book are too small. Unfortunately, I can't recommend just one book for this purpose. Over the years, I've read a large number of books written in a variety of languages, and most books have one or two large programs to study, so for me it's been more of a cumulative process. Of the books I've read most recently, the new Erlang book comes to mind as having a couple good extended examples of FP in action. --Mark From grettke at acm.org Wed Sep 10 00:13:27 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:27:54 2009 Subject: [plt-scheme] Can you study HTDP to satisfy the goal to learn Functional Programming? In-Reply-To: References: <756daca50809090847l7d3a963p291cd183798b65c6@mail.gmail.com> <3F00D19C-A8FF-465B-9404-68F8B91582F4@ccs.neu.edu> <756daca50809091443h1b5462bdh576dc31c850aa01d@mail.gmail.com> Message-ID: <756daca50809092113y6e0b2c52ja57517c8a390e0f1@mail.gmail.com> > Unfortunately, I can't recommend just one book for this purpose. Over > the years, I've read a large number of books written in a variety of > languages, and most books have one or two large programs to study, so > for me it's been more of a cumulative process. What are some of your favorites? > Of the books I've read > most recently, the new Erlang book comes to mind as having a couple > good extended examples of FP in action. What were some of your take-aways from this book? From mark.engelberg at gmail.com Wed Sep 10 01:03:28 2008 From: mark.engelberg at gmail.com (Mark Engelberg) Date: Thu Mar 26 02:27:55 2009 Subject: [plt-scheme] Can you study HTDP to satisfy the goal to learn Functional Programming? In-Reply-To: <756daca50809092113y6e0b2c52ja57517c8a390e0f1@mail.gmail.com> References: <756daca50809090847l7d3a963p291cd183798b65c6@mail.gmail.com> <3F00D19C-A8FF-465B-9404-68F8B91582F4@ccs.neu.edu> <756daca50809091443h1b5462bdh576dc31c850aa01d@mail.gmail.com> <756daca50809092113y6e0b2c52ja57517c8a390e0f1@mail.gmail.com> Message-ID: On Tue, Sep 9, 2008 at 9:13 PM, Grant Rettke wrote: >> Unfortunately, I can't recommend just one book for this purpose. Over >> the years, I've read a large number of books written in a variety of >> languages, and most books have one or two large programs to study, so >> for me it's been more of a cumulative process. > > What are some of your favorites? My memory is pretty hazy, which is why I avoided being specific the first time around :). In part, that's because I get most of these books through my library system, and I don't really remember any more which programs I saw where. Since you already know Scheme, you'll probably really enjoy the extended examples in Siebel's Practical Common Lisp (free version available on-line). As for other Scheme examples, I think SICP had some good extended examples (wasn't there an interesting FP circuit-simulator example in that book?), but I'm not certain. Have you read Okasaki's book? Understanding how to write purely functional data structures such as queues, and lists with reasonably efficient random access is an eye-opening experience. It helped me to understand both the benefits and the challenges of writing in a pure FP style. Have you seen Graham Hutton's "Countdown Problem" example in "Programming in Haskell"? I think "The Haskell School of Expression" had a nice example of how to write a DSL to represent and manipulate music algorithmically in a purely functional style. The old Clean manual had some good case studies, but I think they were removed from the website because the code was incompatible with the latest version of Clean. Ditto with the Dylan book. Maybe it would be possible to dig up old copies of those somewhere? How about the implementation of a two-player game complete with AI in the O'Caml book? http://caml.inria.fr/pub/docs/oreilly-book/html/index.html > >> Of the books I've read >> most recently, the new Erlang book comes to mind as having a couple >> good extended examples of FP in action. > > What were some of your take-aways from this book? > For me, it was really enjoyable to read extended code by the designer of the Erlang language, and see how he would design and organize a slightly long-ish program (I think one of the longer examples involved a chat program). I like reading code like that and thinking about how I would do it. Some of the things seem really elegant, and sometimes I just find myself thinking, "You know, that seems weak; other languages do that better." Erlang definitely showcases some instances where FP shines, because the guarantee of immutability makes it much easier to understand some of the parallel code. On the other hand, I think that certain useful data structures would be a total pain to code in Erlang. So, it also makes me appreciate certain features from "impure" languages. Anyway, maybe others can chime in here. What's the most instructive, readable, clearly-documented, non-trivial FP program you've seen? --Mark From noelwelsh at gmail.com Wed Sep 10 03:31:20 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:27:55 2009 Subject: [plt-scheme] Can you study HTDP to satisfy the goal to learn Functional Programming? In-Reply-To: References: <756daca50809090847l7d3a963p291cd183798b65c6@mail.gmail.com> <3F00D19C-A8FF-465B-9404-68F8B91582F4@ccs.neu.edu> <756daca50809091443h1b5462bdh576dc31c850aa01d@mail.gmail.com> <756daca50809092113y6e0b2c52ja57517c8a390e0f1@mail.gmail.com> Message-ID: On Wed, Sep 10, 2008 at 6:03 AM, Mark Engelberg wrote: > Anyway, maybe others can chime in here. What's the most instructive, > readable, clearly-documented, non-trivial FP program you've seen? Not necessarily complete programs, but a few that stick in my mind are: - The picture language and circuit simulator in SICP - Reading some of the libraries in PLT Scheme is interesting. There are a variety of different styles. I remember finding SK's code in the net collection quite clear. N. From gregory.woodhouse at gmail.com Wed Sep 10 08:06:23 2008 From: gregory.woodhouse at gmail.com (Greg Woodhouse) Date: Thu Mar 26 02:27:55 2009 Subject: [plt-scheme] Threads and evaluation model Message-ID: <5f07325f0809100506k303338ak9ef35ce5b1c69e1e@mail.gmail.com> I have a question about section 1.1.13 of the Reference: 1.1.13 Threads Scheme supports multiple, pre-emptive threads of evaluation. In terms of the evaluation model, this means that each step in evaluation actually consists of multiple concurrent expressions, rather than a single expression. The expressions all share the same objects and top-level variables, so that they can communicate through shared state. Most evaluation steps involve a single step in a single expression, but certain synchronization primitives require multiple threads to progress together in one step. I take this to mean that multiple redexes can, at least potentially be evaluated concurrently, possibly synchronizing to get the order of evaluation right. But taken to an extreme, this sounds like overkill. Are threads routinely created to evaluate sub-expressions, or does this mean that expressions are potentially evaluated in a separate thread? Or is it maybe something completely different - that there are "threads" in the usual sense, and this passage should be taken as definitional (that threads are continuations?) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080910/5f212214/attachment.htm From mflatt at cs.utah.edu Wed Sep 10 08:13:11 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:27:56 2009 Subject: [plt-scheme] Threads and evaluation model In-Reply-To: <5f07325f0809100506k303338ak9ef35ce5b1c69e1e@mail.gmail.com> References: <5f07325f0809100506k303338ak9ef35ce5b1c69e1e@mail.gmail.com> Message-ID: <20080910121313.23C666500B1@mail-svr1.cs.utah.edu> At Wed, 10 Sep 2008 05:06:23 -0700, "Greg Woodhouse" wrote: > I have a question about section 1.1.13 of the Reference: > > 1.1.13 Threads > Scheme supports multiple, pre-emptive threads of evaluation. In terms of the > evaluation model, this means that each step in evaluation actually consists > of multiple concurrent expressions, rather than a single expression. The > expressions all share the same objects and top-level variables, so that they > can communicate through shared state. Most evaluation steps involve a single > step in a single expression, but certain synchronization primitives require > multiple threads to progress together in one step. > > > I take this to mean that multiple redexes can, at least potentially be > evaluated concurrently, possibly synchronizing to get the order of > evaluation right. But taken to an extreme, this sounds like overkill. Are > threads routinely created to evaluate sub-expressions, or does this mean > that expressions are potentially evaluated in a separate thread? Or is it > maybe something completely different - that there are "threads" in the usual > sense, and this passage should be taken as definitional (that threads are > continuations?) Yes - it's supposed to be about "threads" in the usual sense, which you have to create explicitly. I'll clarify that in the docs, along with the point that "actually consists of multiple concurrent expressions" means up to one expression per thread. Matthew From Oege.de.Moor at comlab.ox.ac.uk Wed Sep 10 06:31:19 2008 From: Oege.de.Moor at comlab.ox.ac.uk (Oege.de.Moor@comlab.ox.ac.uk) Date: Thu Mar 26 02:27:56 2009 Subject: [plt-scheme] CC 2009: abstracts due Oct 2 Message-ID: <200809101031.m8AAVJ6o005210@merc4.comlab.ox.ac.uk> >>> abstracts - Oct 2, full papers - Oct 9 <<< CC 2009 International Conference on Compiler Construction March 22-29, York, United Kingdom Invited Speaker: Vivek Sarkar (Rice University, US) Part of ETAPS 2009 http://www.brics.dk/~mis/CC2009/ CC is a premier forum for presenting research on compilers in the broadest possible sense, including run-time techniques, programming tools, domain-specific languages, novel language constructs and so on. In recent years CC has seen a healthy increase in the number of submissions, in line with its broad outlook; its typical acceptance rate is 20-25%. CC is part of ETAPS, and this year it is held in York (UK), March 22-29 2009. The program committee would particularly welcome submissions from scheme programmers on any topic relating to analysis or compilation of Scheme programs Abstracts are due on October 2, and the deadline for full paper submission is October 9. Prospective authors are welcome to contact the program chairs, Michael Schwartzbach (mis@brics.dk) and Oege de Moor (oege@comlab.ox.ac.uk) with any queries they might have. From david.hansen at gmx.net Wed Sep 10 12:41:32 2008 From: david.hansen at gmx.net (David Hansen) Date: Thu Mar 26 02:27:56 2009 Subject: [plt-scheme] Re: scheme_weak_reference and MZ_PRECISE_GC References: <87ljy1wvc2.fsf@localhorst.mine.nu> <20080909112403.221A065009D@mail-svr1.cs.utah.edu> <87hc8pwfey.fsf@localhorst.mine.nu> <20080909151755.7D08F6500BF@mail-svr1.cs.utah.edu> <87abehwbrl.fsf@localhorst.mine.nu> <20080909162218.610F46500BA@mail-svr1.cs.utah.edu> <87tzcputy5.fsf@localhorst.mine.nu> <20080909224514.478406500C8@mail-svr1.cs.utah.edu> Message-ID: <87abegc5s3.fsf@localhorst.mine.nu> On Tue, 9 Sep 2008 16:45:12 -0600 Matthew Flatt wrote: > At Tue, 09 Sep 2008 19:09:54 +0200, David Hansen wrote: >> On Tue, 9 Sep 2008 10:22:18 -0600 Matthew Flatt wrote: >> >> > At Tue, 09 Sep 2008 17:59:42 +0200, David Hansen wrote: >> >> I want a mapping >> >> >> >> -> > >> the C pointer + some possible other data>. >> > >> > That's simply a hash table from integers (representing C pointers) to >> > Scheme objects. >> > >> > If that's it, there's no need for anything like weak references. Is >> > there more to the problem? >> >> Well, sometimes it's that easy :) Thank you very much. Last question >> for now: How do I store weak values? Using a weak box? > > Just to make sure I understand: what do you mean by "weak values"? > > Do you mean, for example, that the Scheme objects in the above table > should be collectable even while the C object is still allocated > (perhaps because the table of wrappers is really just a cache)? > > In that case, yes, a weak box can be used for the value of the hash > table, and when you look up a box from the table, you'll have to treat > an empty box the same as not being in the table. Yup, that's it. Thank you very much for your help. David From pivanyi at freemail.hu Wed Sep 10 14:47:42 2008 From: pivanyi at freemail.hu (Ivanyi Peter) Date: Thu Mar 26 02:27:56 2009 Subject: [plt-scheme] [ANN] MrEd Designer 2.1.2 Message-ID: Dear All, I am happy to announce that I have released a new version of the MrEd Designer. The main improvement in this release is the handling of tab-panels! The current version also generates Scheme code for the tab-panels (using Framework). You can download the program from the usual place: http://www.hexahedron.hu/personal/peteri/mreddesigner/index.html Best regards, Peter Ivanyi _______________________________________ A Generteln?l elfelejtheti, amit eddig a casco d?jakr?l gondolt. Hogy mi?rt? J?rjon ut?na, k?rjen aj?nlatot most! http://ad.adverticum.net/b/cl,1,6022,249296,296182/click.prm From s.degabrielle at cs.ucl.ac.uk Wed Sep 10 16:05:46 2008 From: s.degabrielle at cs.ucl.ac.uk (Stephen De Gabrielle) Date: Thu Mar 26 02:27:56 2009 Subject: [plt-scheme] [ANN] MrEd Designer 2.1.2 In-Reply-To: References: Message-ID: <595b9ab20809101305x35dd207sabd26fd3f954441c@mail.gmail.com> Great work - thanks! s. 2008/9/10 Ivanyi Peter : > Dear All, > > I am happy to announce that I have released a new version of the > MrEd Designer. The main improvement in this release is the > handling of tab-panels! The current version also generates > Scheme > code for the tab-panels (using Framework). > > You can download the program from the usual place: > > http://www.hexahedron.hu/personal/peteri/mreddesigner/index.html > > Best regards, > > Peter Ivanyi > > _______________________________________ > A Generteln?l elfelejtheti, amit eddig a casco d?jakr?l gondolt. Hogy mi?rt? J?rjon ut?na, k?rjen aj?nlatot most! > http://ad.adverticum.net/b/cl,1,6022,249296,296182/click.prm > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Cheers, Stephen -- Stephen De Gabrielle s.degabrielle@cs.ucl.ac.uk Telephone +44 (0)20 7679 0693 (x30693) Mobile 079 851 890 45 Project: Making Sense of Information (MaSI) Work:http://www.uclic.ucl.ac.uk/annb/MaSI.html Home:http://www.degabrielle.name/stephen UCL Interaction Centre MPEB 8th floor University College London Gower Street London WC1E 6BT From s.degabrielle at cs.ucl.ac.uk Wed Sep 10 16:05:46 2008 From: s.degabrielle at cs.ucl.ac.uk (Stephen De Gabrielle) Date: Thu Mar 26 02:27:56 2009 Subject: [plt-scheme] [ANN] MrEd Designer 2.1.2 In-Reply-To: References: Message-ID: <595b9ab20809101305x35dd207sabd26fd3f954441c@mail.gmail.com> Great work - thanks! s. 2008/9/10 Ivanyi Peter : > Dear All, > > I am happy to announce that I have released a new version of the > MrEd Designer. The main improvement in this release is the > handling of tab-panels! The current version also generates > Scheme > code for the tab-panels (using Framework). > > You can download the program from the usual place: > > http://www.hexahedron.hu/personal/peteri/mreddesigner/index.html > > Best regards, > > Peter Ivanyi > > _______________________________________ > A Generteln?l elfelejtheti, amit eddig a casco d?jakr?l gondolt. Hogy mi?rt? J?rjon ut?na, k?rjen aj?nlatot most! > http://ad.adverticum.net/b/cl,1,6022,249296,296182/click.prm > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Cheers, Stephen -- Stephen De Gabrielle s.degabrielle@cs.ucl.ac.uk Telephone +44 (0)20 7679 0693 (x30693) Mobile 079 851 890 45 Project: Making Sense of Information (MaSI) Work:http://www.uclic.ucl.ac.uk/annb/MaSI.html Home:http://www.degabrielle.name/stephen UCL Interaction Centre MPEB 8th floor University College London Gower Street London WC1E 6BT From geb_a at yahoo.com Wed Sep 10 19:05:17 2008 From: geb_a at yahoo.com (geb a) Date: Thu Mar 26 02:27:56 2009 Subject: [plt-scheme] Error msg on the new scheme... In-Reply-To: <20080909124506.317D7402AE@qua.cs.brown.edu> Message-ID: <433117.8632.qm@web50910.mail.re2.yahoo.com> I have a module (that was being used as a bash script) with the following statement in it... #! /usr/local/bin/mzscheme #lang mzscheme ;(provide (all-defined-out)) (define macs (with-input-from-file "macs.scm" read)) I am getting the error message: read: #reader expressions not currently enabled I've looked through the documentation and have had trouble figuring out why it worked before but it isn't working now. The provide statement is commented out because it was also giving me some grief. Thanks for your time, Dan From robby at cs.uchicago.edu Wed Sep 10 19:16:35 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:57 2009 Subject: [plt-scheme] Error msg on the new scheme... In-Reply-To: <433117.8632.qm@web50910.mail.re2.yahoo.com> References: <20080909124506.317D7402AE@qua.cs.brown.edu> <433117.8632.qm@web50910.mail.re2.yahoo.com> Message-ID: <932b2f1f0809101616u75056914t7105a8bf9f620299@mail.gmail.com> Is it possible you were in a teaching language when you saved the file? The teaching languages add metadata in the saved files that does not show up when you see the file in drscheme. Robby On Wed, Sep 10, 2008 at 6:05 PM, geb a wrote: > I have a module (that was being used as a bash script) with the following statement in it... > > #! /usr/local/bin/mzscheme > #lang mzscheme > ;(provide (all-defined-out)) > (define macs (with-input-from-file "macs.scm" read)) > > I am getting the error message: > > read: #reader expressions not currently enabled > > I've looked through the documentation and have had trouble figuring out why it worked before but it isn't working now. The provide statement is commented out because it was also giving me some grief. > > Thanks for your time, > > Dan > > > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From aleks at cs.brown.edu Thu Sep 11 00:14:57 2008 From: aleks at cs.brown.edu (Aleks Bromfield) Date: Thu Mar 26 02:27:57 2009 Subject: [plt-scheme] test-coverage and colorblindness Message-ID: <20080911041457.GA12539@cs.brown.edu> The syntactic test suite coverage feature prints tested code in green and untested code in red. As far as I can tell, these colors are not configurable. This color choice is very unfortunate for colorblind users. Would it be possible to make these colors configurable, and/or to change the defaults to something better? I seem to recall that the tested-code color used to be black. Thanks! ~ Aleks From toddobryan at gmail.com Thu Sep 11 05:32:35 2008 From: toddobryan at gmail.com (Todd O'Bryan) Date: Thu Mar 26 02:27:57 2009 Subject: [plt-scheme] test-coverage and colorblindness In-Reply-To: <20080911041457.GA12539@cs.brown.edu> References: <20080911041457.GA12539@cs.brown.edu> Message-ID: <904774730809110232o2cf6f503o9b7eba1d5f710f42@mail.gmail.com> Another option is to add another feature to the text, in addition to color. For example, untested code could be red *and* bold. This is something that I've been pushing with my upper-level programming class. Never indicate an important UI distinction with *only* color. In my case, this really hit home when the CRT monitor I was using had its red gun go out. :-) On Thu, Sep 11, 2008 at 12:14 AM, Aleks Bromfield wrote: > The syntactic test suite coverage feature prints tested code in green > and untested code in red. As far as I can tell, these colors are not > configurable. This color choice is very unfortunate for colorblind > users. > > Would it be possible to make these colors configurable, and/or to change > the defaults to something better? I seem to recall that the tested-code > color used to be black. > > Thanks! > ~ Aleks > > _________________________________________________ > 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/20080911/96b07156/attachment.html From esmith at acanac.net Thu Sep 11 09:36:30 2008 From: esmith at acanac.net (Ernie Smith) Date: Thu Mar 26 02:27:58 2009 Subject: [plt-scheme] Noticeable absence of (with-output-to-port ...) and (with-input-from-port ...) Message-ID: <48C91EDE.706@acanac.net> I was looking to redirect intput and output of existing scheme functions to pipes. In the spirit of "The art of taking out the weakness that causes the need to add features" (forgive the paraphrase, I couldn't find the original quote), I am surprised to find that though (with-output-to-file ...) is defined, the more general (with-output-to-port ...) appears to be lacking. It would seem to me that (with-output-to-port ...) would make other (with-output-to-xxx ...) unnecessary, but the the converse is not true, so I surmise there is an underlying implementation problem or a conflict with a more substantial issue. Perhaps someone could edify me on this. Why is it missing? Back to my initial problem: (with-input-from-port ...) and (with-output-to-port ...) exemplify exactly what I am looking for, where I could make a pipe and invoke them as follows (with-output-to-port port1 (with-input-from-port port2 ...)) in one context, and use file streamss in another context etc.. Given I dont have that, can someone suggest how I should proceed instead? From robby at cs.uchicago.edu Thu Sep 11 10:18:48 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:58 2009 Subject: [plt-scheme] Noticeable absence of (with-output-to-port ...) and (with-input-from-port ...) In-Reply-To: <48C91EDE.706@acanac.net> References: <48C91EDE.706@acanac.net> Message-ID: <932b2f1f0809110718o2a05f398ucac0fd75de8c015b@mail.gmail.com> On Thu, Sep 11, 2008 at 8:36 AM, Ernie Smith wrote: > I was looking to redirect intput and output of existing > scheme functions to pipes. > > In the spirit of "The art of taking out the weakness that causes the need > to add features" (forgive the paraphrase, I couldn't find the original > quote), Its the introduction of the RnRS reports. eg: http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-3.html > I am > surprised to find that though (with-output-to-file ...) is defined, > the more general (with-output-to-port ...) appears to be lacking. It would > seem to me that (with-output-to-port ...) would make other > (with-output-to-xxx ...) unnecessary, but the the converse is not true, > so I surmise there is an underlying implementation problem or a conflict > with a more substantial issue. Perhaps someone could edify me on this. > Why is it missing? With-output-to-port wouldn't do anything. Output already goes to a port. The one returned by current-output-port. Input also comes from a port; you guessed it: current-input-port. You might try reading about those in help desk. Be sure to also read about the scheme/port library which has some useful helper functions. I suggest starting with the Guide: http://docs.plt-scheme.org/guide/i_o.html Robby From aleks at cs.brown.edu Thu Sep 11 10:54:58 2008 From: aleks at cs.brown.edu (Aleks Bromfield) Date: Thu Mar 26 02:27:58 2009 Subject: [plt-scheme] Re: test-coverage and colorblindness In-Reply-To: <20080911041457.GA12539@cs.brown.edu> References: <20080911041457.GA12539@cs.brown.edu> Message-ID: <20080911145458.GA28580@cs.brown.edu> Note that my email was prompted by an email from a student: > I have red-green color blindness and I can't see the color differences > between the tested and untested lines. Until I read this email carefully, I > thought that "syntactic test suite coverage" was just broken on my machine. > > Can these colors be changed? I didn't see relevant options in a cursory look > through Preferences. ~ Aleks From hendrik at topoi.pooq.com Thu Sep 11 11:19:23 2008 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:27:58 2009 Subject: [plt-scheme] Noticeable absence of (with-output-to-port ...) and (with-input-from-port ...) In-Reply-To: <48C91EDE.706@acanac.net> References: <48C91EDE.706@acanac.net> Message-ID: <20080911151923.GB27472@topoi.pooq.com> On Thu, Sep 11, 2008 at 09:36:30AM -0400, Ernie Smith wrote: > I was looking to redirect intput and output of existing > scheme functions to pipes. This isn't portable, but in http://www.informit.com/articles/article.aspx?p=99706&seqNum=15 it says: * 3.15 /dev/fd * * Newer systems provide a directory named /dev/fd whose entries are * files named 0,1, 2, and so on. Opening the file /dev/fd/n is * equivalent to duplicating descriptor n (assuming that descriptor n is * open). * * The /dev/fd feature was developed by Tom Duff and appeared in the 8th * Edition of the Research Unix System. It is supported by SVR4 and * 4.3+BSD. It is not part of POSIX.1. /dev/fd/0, /dev/fd/1, etc. seem to be part of my Debian Lenny system. -- hendrik From robby at cs.uchicago.edu Thu Sep 11 11:22:32 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:27:58 2009 Subject: [plt-scheme] Noticeable absence of (with-output-to-port ...) and (with-input-from-port ...) In-Reply-To: <20080911151923.GB27472@topoi.pooq.com> References: <48C91EDE.706@acanac.net> <20080911151923.GB27472@topoi.pooq.com> Message-ID: <932b2f1f0809110822k28904807m1b099c948f6a2bba@mail.gmail.com> Sorry I didn't say this explicitly in my earlier message, but some uses of OS-level pipes can be done wholely within Scheme using various port functions (like make-pipe). Robby On Thu, Sep 11, 2008 at 10:19 AM, wrote: > On Thu, Sep 11, 2008 at 09:36:30AM -0400, Ernie Smith wrote: >> I was looking to redirect intput and output of existing >> scheme functions to pipes. > > This isn't portable, but in > http://www.informit.com/articles/article.aspx?p=99706&seqNum=15 > it says: > > * 3.15 /dev/fd > * > * Newer systems provide a directory named /dev/fd whose entries are > * files named 0,1, 2, and so on. Opening the file /dev/fd/n is > * equivalent to duplicating descriptor n (assuming that descriptor n is > * open). > * > * The /dev/fd feature was developed by Tom Duff and appeared in the 8th > * Edition of the Research Unix System. It is supported by SVR4 and > * 4.3+BSD. It is not part of POSIX.1. > > /dev/fd/0, /dev/fd/1, etc. seem to be part of my Debian Lenny system. > > -- hendrik > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From gregory.woodhouse at gmail.com Thu Sep 11 11:23:45 2008 From: gregory.woodhouse at gmail.com (Greg Woodhouse) Date: Thu Mar 26 02:27:59 2009 Subject: [plt-scheme] Noticeable absence of (with-output-to-port ...) and (with-input-from-port ...) In-Reply-To: <20080911151923.GB27472@topoi.pooq.com> References: <48C91EDE.706@acanac.net> <20080911151923.GB27472@topoi.pooq.com> Message-ID: <5f07325f0809110823t4d25e6f6l7a273a69186e67d6@mail.gmail.com> My mistake. On Thu, Sep 11, 2008 at 8:19 AM, wrote: > On Thu, Sep 11, 2008 at 09:36:30AM -0400, Ernie Smith wrote: > > I was looking to redirect intput and output of existing > > scheme functions to pipes. > > This isn't portable, but in > http://www.informit.com/articles/article.aspx?p=99706&seqNum=15 > it says: > > * 3.15 /dev/fd > * > * Newer systems provide a directory named /dev/fd whose entries are > * files named 0,1, 2, and so on. Opening the file /dev/fd/n is > * equivalent to duplicating descriptor n (assuming that descriptor n is > * open). > * > * The /dev/fd feature was developed by Tom Duff and appeared in the 8th > * Edition of the Research Unix System. It is supported by SVR4 and > * 4.3+BSD. It is not part of POSIX.1. > > /dev/fd/0, /dev/fd/1, etc. seem to be part of my Debian Lenny system. > > -- hendrik > _________________________________________________ > 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/20080911/54f86a42/attachment.htm From jos.koot at telefonica.net Thu Sep 11 13:55:17 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:27:59 2009 Subject: [plt-scheme] Noticeable absence of (with-output-to-port ...) and(with-input-from-port ...) References: <48C91EDE.706@acanac.net> <932b2f1f0809110718o2a05f398ucac0fd75de8c015b@mail.gmail.com> Message-ID: The absence of with-output-to-port has no deep foundation. It can easily be made by yourself: (define-syntax with-output-to-port (syntax-rules () ((_ port thunk) (parameterize ((current-output-port port)) (thunk))))) Actually the same holds for with-output-to-file, but this one is required by RnRS (at least for n>4) Jos ----- Original Message ----- From: "Robby Findler" To: "Ernie Smith" Cc: "PLT Scheme List" Sent: Thursday, September 11, 2008 4:18 PM Subject: Re: [plt-scheme] Noticeable absence of (with-output-to-port ...) and(with-input-from-port ...) > On Thu, Sep 11, 2008 at 8:36 AM, Ernie Smith wrote: >> I was looking to redirect intput and output of existing >> scheme functions to pipes. >> >> In the spirit of "The art of taking out the weakness that causes the >> need >> to add features" (forgive the paraphrase, I couldn't find the original >> quote), > > Its the introduction of the RnRS reports. eg: > http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-3.html > >> I am >> surprised to find that though (with-output-to-file ...) is defined, >> the more general (with-output-to-port ...) appears to be lacking. It >> would >> seem to me that (with-output-to-port ...) would make other >> (with-output-to-xxx ...) unnecessary, but the the converse is not true, >> so I surmise there is an underlying implementation problem or a conflict >> with a more substantial issue. Perhaps someone could edify me on this. >> Why is it missing? > > With-output-to-port wouldn't do anything. Output already goes to a > port. The one returned by current-output-port. Input also comes from a > port; you guessed it: current-input-port. > > You might try reading about those in help desk. Be sure to also read > about the scheme/port library which has some useful helper functions. > I suggest starting with the Guide: > > http://docs.plt-scheme.org/guide/i_o.html > > Robby > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From jos.koot at telefonica.net Thu Sep 11 14:00:57 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:27:59 2009 Subject: [plt-scheme] Noticeable absence of (with-output-to-port ...)and(with-input-from-port ...) References: <48C91EDE.706@acanac.net><932b2f1f0809110718o2a05f398ucac0fd75de8c015b@mail.gmail.com> Message-ID: <60ADC22B92994951AFC0599D29C36F07@uw2b2dff239c4d> Well a procedure is to be preferred, I think: (define (with-output-to-port port thunk) (parameterize etc) Jos ----- Original Message ----- From: "Jos Koot" To: "Robby Findler" ; "Ernie Smith" Cc: "PLT Scheme List" Sent: Thursday, September 11, 2008 7:55 PM Subject: Re: [plt-scheme] Noticeable absence of (with-output-to-port ...)and(with-input-from-port ...) > The absence of with-output-to-port has no deep foundation. It can easily > be made by yourself: > > (define-syntax with-output-to-port > (syntax-rules () > ((_ port thunk) > (parameterize ((current-output-port port)) (thunk))))) > From andre.mayers at usherbrooke.ca Thu Sep 11 14:06:39 2008 From: andre.mayers at usherbrooke.ca (Andre Mayers) Date: Thu Mar 26 02:27:59 2009 Subject: [plt-scheme] What are the utilities of box ? In-Reply-To: References: <48C91EDE.706@acanac.net> <932b2f1f0809110718o2a05f398ucac0fd75de8c015b@mail.gmail.com> Message-ID: <005201c91439$239e0620$6ada1260$@mayers@usherbrooke.ca> Why sould I write --- (define x (box 3)) (unbox x) --- instead of --- (define y 3) y --- From noelwelsh at gmail.com Thu Sep 11 14:08:16 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:27:59 2009 Subject: [plt-scheme] Noticeable absence of (with-output-to-port ...)and(with-input-from-port ...) In-Reply-To: <60ADC22B92994951AFC0599D29C36F07@uw2b2dff239c4d> References: <48C91EDE.706@acanac.net> <932b2f1f0809110718o2a05f398ucac0fd75de8c015b@mail.gmail.com> <60ADC22B92994951AFC0599D29C36F07@uw2b2dff239c4d> Message-ID: Wouldn't you want to close the port afterwards? This, to me, is the main advantage of with-output-to-file N. On Thu, Sep 11, 2008 at 7:00 PM, Jos Koot wrote: > Well a procedure is to be preferred, I think: > > (define (with-output-to-port port thunk) > (parameterize etc) > Jos From cce at ccs.neu.edu Thu Sep 11 14:12:14 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:28:00 2009 Subject: [plt-scheme] What are the utilities of box ? In-Reply-To: <-2668638984370494133@unknownmsgid> References: <48C91EDE.706@acanac.net> <932b2f1f0809110718o2a05f398ucac0fd75de8c015b@mail.gmail.com> <-2668638984370494133@unknownmsgid> Message-ID: <990e0c030809111112l6ebf335o752feabd2e10f8d7@mail.gmail.com> On Thu, Sep 11, 2008 at 2:06 PM, Andre Mayers wrote: > Why sould I write > --- > (define x (box 3)) > (unbox x) > --- > instead of > --- > (define y 3) > y A box is useful as a first-class mutable reference. If you pass y, above, to a procedure, the procedure gets 3, not the actual name y -- the procedure can mutate its own internal variables, but not your y. If you pass x, however, the procedure gets the box in x, and can use set-box! to mutate its contents. So if you want a procedure to be able to mutate what you pass in to it, you might want to use a box. -- Carl Eastlund From m.douglas.williams at gmail.com Thu Sep 11 14:52:21 2008 From: m.douglas.williams at gmail.com (Doug Williams) Date: Thu Mar 26 02:28:01 2009 Subject: [plt-scheme] Tables in Scribblings Message-ID: Is there an example that someone can point to of using a table in scribbled documentation? Doug -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080911/95b1f9d7/attachment.html From mflatt at cs.utah.edu Thu Sep 11 15:00:43 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:28:01 2009 Subject: [plt-scheme] Tables in Scribblings In-Reply-To: References: Message-ID: <20080911190044.07E68650094@mail-svr1.cs.utah.edu> At Thu, 11 Sep 2008 12:52:21 -0600, "Doug Williams" wrote: > Is there an example that someone can point to of using a table in scribbled > documentation? You might grep for uses of `make-table' in "collects/scribblings". For example, http://docs.plt-scheme.org/guide/Reading_and_Writing_Scheme_Data.html has a simple two-column table implemented in http://svn.plt-scheme.org/plt/trunk/collects/scribblings/guide/io.scrbl Another example is the table of output styles in http://docs.plt-scheme.org/drscheme/output-syntax.html has a simple two-column table implemented in http://svn..../collects/scribblings/drscheme/printing.scrbl Matthew From lunarc.lists at gmail.com Thu Sep 11 15:46:35 2008 From: lunarc.lists at gmail.com (Henk Boom) Date: Thu Mar 26 02:28:01 2009 Subject: [plt-scheme] What are the utilities of box ? In-Reply-To: <990e0c030809111112l6ebf335o752feabd2e10f8d7@mail.gmail.com> References: <48C91EDE.706@acanac.net> <932b2f1f0809110718o2a05f398ucac0fd75de8c015b@mail.gmail.com> <-2668638984370494133@unknownmsgid> <990e0c030809111112l6ebf335o752feabd2e10f8d7@mail.gmail.com> Message-ID: 2008/9/11 Carl Eastlund : > So if you want a procedure to be > able to mutate what you pass in to it, you might want to use a box. Now you, too, can write programs like a C programmer! Henk From jos.koot at telefonica.net Thu Sep 11 16:01:26 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:28:01 2009 Subject: [plt-scheme] Noticeable absence of (with-output-to-port ...)and(with-input-from-port ...) References: <48C91EDE.706@acanac.net> <932b2f1f0809110718o2a05f398ucac0fd75de8c015b@mail.gmail.com> <60ADC22B92994951AFC0599D29C36F07@uw2b2dff239c4d> Message-ID: Call-with-output-file creates a port and it's locical that it closes that port. Call-with-output-port does not create a port, and therefore it should not close it. Nevertheless you can always wrap things in a dynamic wind that makes sure the port is closed whenever control leaves the thunk (and may be reopens the port when control comes back into the thunk. Or you may want a continuation barrier around the thunk to make sure it can not be reentered by continuations that are captured by the thunk. Things depend on what you want (the reason why not all programs have been written yet) Jos ----- Original Message ----- From: "Noel Welsh" To: "Jos Koot" Cc: "PLT Scheme List" Sent: Thursday, September 11, 2008 8:08 PM Subject: Re: [plt-scheme] Noticeable absence of (with-output-to-port ...)and(with-input-from-port ...) > Wouldn't you want to close the port afterwards? This, to me, is the > main advantage of with-output-to-file > > N. > > On Thu, Sep 11, 2008 at 7:00 PM, Jos Koot wrote: >> Well a procedure is to be preferred, I think: >> >> (define (with-output-to-port port thunk) >> (parameterize etc) >> Jos > From yinso.chen at gmail.com Thu Sep 11 16:05:21 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:28:02 2009 Subject: [plt-scheme] docs.plt-scheme.org down? Message-ID: <779bf2730809111305t72e63255h22f10aa3779ca4d2@mail.gmail.com> Hi - docs.plt-scheme.org appears to be down - is this a scheduled maintenance? Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080911/c9161ba5/attachment.htm From eli at barzilay.org Thu Sep 11 16:06:32 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:28:02 2009 Subject: [plt-scheme] docs.plt-scheme.org down? In-Reply-To: <779bf2730809111305t72e63255h22f10aa3779ca4d2@mail.gmail.com> References: <779bf2730809111305t72e63255h22f10aa3779ca4d2@mail.gmail.com> Message-ID: <18633.31304.101256.262050@arabic.ccs.neu.edu> On Sep 11, YC wrote: > Hi - > > docs.plt-scheme.org appears to be down - is this a scheduled maintenance? Yes, will be back soon. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From m.douglas.williams at gmail.com Thu Sep 11 16:31:37 2008 From: m.douglas.williams at gmail.com (Doug Williams) Date: Thu Mar 26 02:28:02 2009 Subject: [plt-scheme] Tables in Scribblings In-Reply-To: <20080911190044.07E68650094@mail-svr1.cs.utah.edu> References: <20080911190044.07E68650094@mail-svr1.cs.utah.edu> Message-ID: Thanks, Matthew. One more scribble question. In the table I need an atsign as in entry (in teletype font). As part of a cell I have '(make-flow (list (make-paragraph (list @tt{at}))))' and I'd like to have an atsign (@) appear in place of the 'at'. I've tried @ by itself, \@, |@|, etc, but without any luck. How do I correctly escape the atsign in this case? Doug On Thu, Sep 11, 2008 at 1:00 PM, Matthew Flatt wrote: > At Thu, 11 Sep 2008 12:52:21 -0600, "Doug Williams" wrote: > > Is there an example that someone can point to of using a table in > scribbled > > documentation? > > You might grep for uses of `make-table' in "collects/scribblings". > > > For example, > > http://docs.plt-scheme.org/guide/Reading_and_Writing_Scheme_Data.html > > has a simple two-column table implemented in > > http://svn.plt-scheme.org/plt/trunk/collects/scribblings/guide/io.scrbl > > > Another example is the table of output styles in > > http://docs.plt-scheme.org/drscheme/output-syntax.html > > has a simple two-column table implemented in > > http://svn..../collects/scribblings/drscheme/printing.scrbl > > > Matthew > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080911/81615764/attachment.html From eli at barzilay.org Thu Sep 11 16:41:16 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:28:03 2009 Subject: [plt-scheme] Tables in Scribblings In-Reply-To: References: <20080911190044.07E68650094@mail-svr1.cs.utah.edu> Message-ID: <18633.33388.482413.962116@arabic.ccs.neu.edu> On Sep 11, Doug Williams wrote: > Thanks, Matthew. One more scribble question. > > In the table I need an atsign as in entry (in teletype font). As > part of a cell I have '(make-flow (list (make-paragraph (list > @tt{at}))))' and I'd like to have an atsign (@) appear in place of > the 'at'. I've tried @ by itself, \@, |@|, etc, but without any > luck. How do I correctly escape the atsign in this case? You can always use a Scheme string escape: @tt{@"@"} But another option is the laternative syntax for the open/close braces: @tt|{@}| Using |{ to open the body means that only }| will be recognized as closing the body, and commands inside should start with |@. If that's not enough, you can add stuff between the | and {. For example, the scribble syntax documentation (collects/scribblings/scribble/ reader.scrbl) has things like this: @scribble-examples|==={ @foo{bar baz blah} @foo{bar @baz[3] blah} @foo{bar @baz{3} blah} @foo{bar @baz[2 3]{4 5} blah} }===| -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From m.douglas.williams at gmail.com Thu Sep 11 16:55:15 2008 From: m.douglas.williams at gmail.com (Doug Williams) Date: Thu Mar 26 02:28:03 2009 Subject: [plt-scheme] Tables in Scribblings In-Reply-To: <18633.33388.482413.962116@arabic.ccs.neu.edu> References: <20080911190044.07E68650094@mail-svr1.cs.utah.edu> <18633.33388.482413.962116@arabic.ccs.neu.edu> Message-ID: Thanks, Eli. I used the @tt|{@}| alternative you gave at it works fine. While I was sure that some combination of @, |, and \ would get me there, it is confusing. Doug On Thu, Sep 11, 2008 at 2:41 PM, Eli Barzilay wrote: > On Sep 11, Doug Williams wrote: > > Thanks, Matthew. One more scribble question. > > > > In the table I need an atsign as in entry (in teletype font). As > > part of a cell I have '(make-flow (list (make-paragraph (list > > @tt{at}))))' and I'd like to have an atsign (@) appear in place of > > the 'at'. I've tried @ by itself, \@, |@|, etc, but without any > > luck. How do I correctly escape the atsign in this case? > > You can always use a Scheme string escape: > > @tt{@"@"} > > But another option is the laternative syntax for the open/close > braces: > > > @tt|{@}| > > Using |{ to open the body means that only }| will be recognized as > closing the body, and commands inside should start with |@. If that's > not enough, you can add stuff between the | and {. For example, the > scribble syntax documentation (collects/scribblings/scribble/ > reader.scrbl) has things like this: > > @scribble-examples|==={ > @foo{bar baz > blah} > @foo{bar @baz[3] > blah} > @foo{bar @baz{3} > blah} > @foo{bar @baz[2 3]{4 5} > blah} > }===| > > -- > ((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/20080911/7c7dba6c/attachment.htm From eli at barzilay.org Thu Sep 11 16:58:42 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:28:03 2009 Subject: [plt-scheme] Tables in Scribblings In-Reply-To: References: <20080911190044.07E68650094@mail-svr1.cs.utah.edu> <18633.33388.482413.962116@arabic.ccs.neu.edu> Message-ID: <18633.34434.777056.63949@arabic.ccs.neu.edu> On Sep 11, Doug Williams wrote: > Thanks, Eli. I used the @tt|{@}| alternative you gave at it works > fine. While I was sure that some combination of @, |, and \ would > get me there, it is confusing. It's all documented in the Scribble manual: http://docs.plt-scheme.org/scribble/reader.html#(part._.The_.Body_.Part) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From m.douglas.williams at gmail.com Thu Sep 11 17:07:46 2008 From: m.douglas.williams at gmail.com (Doug Williams) Date: Thu Mar 26 02:28:04 2009 Subject: [plt-scheme] Tables in Scribblings In-Reply-To: <18633.34434.777056.63949@arabic.ccs.neu.edu> References: <20080911190044.07E68650094@mail-svr1.cs.utah.edu> <18633.33388.482413.962116@arabic.ccs.neu.edu> <18633.34434.777056.63949@arabic.ccs.neu.edu> Message-ID: No offense, but the Scribble manual does little to help me actually write Scribble documentation. A Guide would be much more helpful. I tend to look for examples in the existing documentation, but that's difficult when you don't know exactly what to look for. I also don't like to complain without offering to help with a solution, but I will in this one case. Actually, has anyone started putting Scribble tidbits in the Scheme Cookbook? I didn't even think of looking there and I probably should have. Doug On Thu, Sep 11, 2008 at 2:58 PM, Eli Barzilay wrote: > On Sep 11, Doug Williams wrote: > > Thanks, Eli. I used the @tt|{@}| alternative you gave at it works > > fine. While I was sure that some combination of @, |, and \ would > > get me there, it is confusing. > > It's all documented in the Scribble manual: > > http://docs.plt-scheme.org/scribble/reader.html#(part._.The_.Body_.Part) > > -- > ((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/20080911/0803d24b/attachment.html From eli at barzilay.org Thu Sep 11 17:11:11 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:28:04 2009 Subject: [plt-scheme] Tables in Scribblings In-Reply-To: References: <20080911190044.07E68650094@mail-svr1.cs.utah.edu> <18633.33388.482413.962116@arabic.ccs.neu.edu> <18633.34434.777056.63949@arabic.ccs.neu.edu> Message-ID: <18633.35183.684669.605145@arabic.ccs.neu.edu> On Sep 11, Doug Williams wrote: > No offense, but the Scribble manual does little to help me actually > write Scribble documentation. A Guide would be much more helpful. > I tend to look for examples in the existing documentation, but > that's difficult when you don't know exactly what to look for. The syntax chapter has very little "reference" material in it -- so it reads very much like a kind of a guide. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From jay.mccarthy at gmail.com Thu Sep 11 17:12:10 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:28:04 2009 Subject: [plt-scheme] Tables in Scribblings In-Reply-To: References: <20080911190044.07E68650094@mail-svr1.cs.utah.edu> <18633.33388.482413.962116@arabic.ccs.neu.edu> <18633.34434.777056.63949@arabic.ccs.neu.edu> Message-ID: On Thu, Sep 11, 2008 at 3:07 PM, Doug Williams wrote: > No offense, but the Scribble manual does little to help me actually write > Scribble documentation. A Guide would be much more helpful. I tend to look > for examples in the existing documentation, but that's difficult when you > don't know exactly what to look for. Agreed. Every time I want to get a literal @ I look at the manual and it makes no sense. Then I look at the source of the manual and I understand. Jay -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From eli at barzilay.org Thu Sep 11 17:16:01 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:28:04 2009 Subject: [plt-scheme] Tables in Scribblings In-Reply-To: References: <20080911190044.07E68650094@mail-svr1.cs.utah.edu> <18633.33388.482413.962116@arabic.ccs.neu.edu> <18633.34434.777056.63949@arabic.ccs.neu.edu> Message-ID: <18633.35473.615071.463171@arabic.ccs.neu.edu> On Sep 11, Jay McCarthy wrote: > On Thu, Sep 11, 2008 at 3:07 PM, Doug Williams > wrote: > > No offense, but the Scribble manual does little to help me > > actually write Scribble documentation. A Guide would be much more > > helpful. I tend to look for examples in the existing > > documentation, but that's difficult when you don't know exactly > > what to look for. > > Agreed. Every time I want to get a literal @ I look at the manual > and it makes no sense. Then I look at the source of the manual and I > understand. Can you specify which parts made no sense, and how they can be improved? -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From troelskn at gmail.com Thu Sep 11 18:24:54 2008 From: troelskn at gmail.com (troels knak-nielsen) Date: Thu Mar 26 02:28:05 2009 Subject: [plt-scheme] Trouble checking the repository out Message-ID: <98b8086f0809111524h7438ac03g751a272ba16bd726@mail.gmail.com> I get this: tkn@tkn-ubuntu ~/external $ svn checkout http://svn.plt-scheme.org/plt/trunk plt A plt/doc/r6rs-std/r6rs-Z-G-27.gif A plt/doc/r6rs-std/r6rs-Z-G-28.gif ... snip ... A plt/doc/r6rs-lib-std/r6rs-lib-Z-H-20.html A plt/doc/srfi-std svn: REPORT request failed on '/plt/!svn/vcc/default' svn: REPORT of '/plt/!svn/vcc/default': Could not read response body: Connection reset by peer (http://svn.plt-scheme.org) tkn@tkn-ubuntu ~/external $ -- troels From m.douglas.williams at gmail.com Thu Sep 11 18:38:51 2008 From: m.douglas.williams at gmail.com (Doug Williams) Date: Thu Mar 26 02:28:05 2009 Subject: [plt-scheme] A PLaneT Scribble Question Message-ID: I am finally getting around to updating my PLaneT packages with scribbled documentation to replace the HTML ones. I started with a new package I just created http://planet.plt-scheme.org/display.ss?package=packed-binary.plt&owner=williams. Whenever I create (or download) the package, I get warnings like "no declared exporting libraries for definition in: ..." for all of my defprocs in the scribble file. The package builds okay and the docs are put where I expect them. However, all of the defproc'ed identifiers are underlined in red. I have a (require (for-label "packed-binary.ss")) and it doesn't complain about it. I thought that would have provided the definitions. Any ideas? [You can browse the code, including the scribble files, in PLaneT at the link above.] Thanks Doug -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080911/e1564cd7/attachment.htm From jay.mccarthy at gmail.com Thu Sep 11 18:43:03 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:28:05 2009 Subject: [plt-scheme] Tables in Scribblings In-Reply-To: <18633.35473.615071.463171@arabic.ccs.neu.edu> References: <20080911190044.07E68650094@mail-svr1.cs.utah.edu> <18633.33388.482413.962116@arabic.ccs.neu.edu> <18633.34434.777056.63949@arabic.ccs.neu.edu> <18633.35473.615071.463171@arabic.ccs.neu.edu> Message-ID: http://docs.plt-scheme.org/scribble/reader.html says: Informally, the concrete syntax of @-forms is @ ?cmd? [ ?datum?* ] { ?text-body?* } where all three parts after @ are optional, but at least one should be present. (Note that spaces are not allowed between the three parts.) @ is set as a non-terminating reader macro, so it can be used as usual in Scheme identifiers unless you want to use it as a first character of an identifier; in this case you need to quote with a backslash (\@foo) or quote the whole identifier with bars (|@foo|). (define |@foo| '\@bar@baz) Of course, @ is not treated specially in Scheme strings, character constants, etc. -- But it doesn't give an example of just getting a solitary @. So, I'm supposed to go through the following process: 1. I want a textual @. 2. I can get a scheme identifier with an @ by following those examples. But that's not what I want. 3. "Of course, @ is not treated specially in Scheme strings ..." -- none of these sounds like what I want... I'm not making a Scheme string, I want just plain old text. 4. So what do I do? 5. Oh wait, Scheme values are evaluated and displayed. 6. Thus by 4, a Scheme string with an @ in it is what I want. 7. Okay, so "@", because "..." is a Scheme string 8. Error: read: expected a closing '"' 9. Hmm, that's strange. Oh right, "..." is not a Scheme string, it is a "body" 10. How do I get just a string? 11. The concrete syntax only has function calls. Strings aren't function calls. 12. I've read the rest of this manual page. No examples. 13. I read it again, now I notice that in 3.1.2 in the third set of examples, the third example shows that @foo => foo 14. It takes a great leap to realize that this applies not only to identifiers, but any Scheme expression. I could also have noticed this by reading in 3.1.1 in the third paragraph where examples are given of lambdas and unquote. I didn't notice these earlier, because they are so complicated. 15. Alright, so I know how to get a Scheme expression in there. Pop the stack. Now I need a Scheme string. 16. I type in @"@" and it works. Painful. The amazing power of the @-reader and all its subtleties are explained in the manual. I think Doug is getting at the fact that many simple things are hard to understand. Another example is that the manual libraries are documented as Scheme calls. It is true that they are Scheme functions, but they feel like markup. Just putting examples in the @ syntax would be an amazing improvement. It is hard to tell where to use [] and where to use {} Jay On Thu, Sep 11, 2008 at 3:16 PM, Eli Barzilay wrote: > On Sep 11, Jay McCarthy wrote: >> On Thu, Sep 11, 2008 at 3:07 PM, Doug Williams >> wrote: >> > No offense, but the Scribble manual does little to help me >> > actually write Scribble documentation. A Guide would be much more >> > helpful. I tend to look for examples in the existing >> > documentation, but that's difficult when you don't know exactly >> > what to look for. >> >> Agreed. Every time I want to get a literal @ I look at the manual >> and it makes no sense. Then I look at the source of the manual and I >> understand. > > Can you specify which parts made no sense, and how they can be > improved? > > -- > ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: > http://www.barzilay.org/ Maze is Life! > -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From cce at ccs.neu.edu Thu Sep 11 19:12:01 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:28:06 2009 Subject: [plt-scheme] A PLaneT Scribble Question In-Reply-To: References: Message-ID: <990e0c030809111612m15faed43v58bb429bbc4c33bd@mail.gmail.com> The defmodule command tells Scribble where to associate all your definitions, and it works hierarchically -- in its own section and all subsections. You put it in Section 1, though, and all the defprocs in Section 2. You need to put them together into one section, or put the defmodule in the introduction (before any of the sections). On Thu, Sep 11, 2008 at 6:38 PM, Doug Williams wrote: > I am finally getting around to updating my PLaneT packages with scribbled > documentation to replace the HTML ones. I started with a new package I just > created > http://planet.plt-scheme.org/display.ss?package=packed-binary.plt&owner=williams. > Whenever I create (or download) the package, I get warnings like "no > declared exporting libraries for definition in: ..." for all of my defprocs > in the scribble file. The package builds okay and the docs are put where I > expect them. However, all of the defproc'ed identifiers are underlined in > red. I have a (require (for-label "packed-binary.ss")) and it doesn't > complain about it. I thought that would have provided the definitions. > > Any ideas? [You can browse the code, including the scribble files, in > PLaneT at the link above.] > > Thanks > Doug From m.douglas.williams at gmail.com Thu Sep 11 19:20:33 2008 From: m.douglas.williams at gmail.com (Doug Williams) Date: Thu Mar 26 02:28:06 2009 Subject: [plt-scheme] A PLaneT Scribble Question In-Reply-To: <990e0c030809111612m15faed43v58bb429bbc4c33bd@mail.gmail.com> References: <990e0c030809111612m15faed43v58bb429bbc4c33bd@mail.gmail.com> Message-ID: Thanks, Carl. That's all it was. On Thu, Sep 11, 2008 at 5:12 PM, Carl Eastlund wrote: > The defmodule command tells Scribble where to associate all your > definitions, and it works hierarchically -- in its own section and all > subsections. You put it in Section 1, though, and all the defprocs in > Section 2. You need to put them together into one section, or put the > defmodule in the introduction (before any of the sections). > > On Thu, Sep 11, 2008 at 6:38 PM, Doug Williams > wrote: > > I am finally getting around to updating my PLaneT packages with scribbled > > documentation to replace the HTML ones. I started with a new package I > just > > created > > > http://planet.plt-scheme.org/display.ss?package=packed-binary.plt&owner=williams > . > > Whenever I create (or download) the package, I get warnings like "no > > declared exporting libraries for definition in: ..." for all of my > defprocs > > in the scribble file. The package builds okay and the docs are put where > I > > expect them. However, all of the defproc'ed identifiers are underlined > in > > red. I have a (require (for-label "packed-binary.ss")) and it doesn't > > complain about it. I thought that would have provided the definitions. > > > > Any ideas? [You can browse the code, including the scribble files, in > > PLaneT at the link above.] > > > > Thanks > > Doug > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080911/c092cb3c/attachment.html From grettke at acm.org Thu Sep 11 19:27:49 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:06 2009 Subject: [plt-scheme] Tables in Scribblings In-Reply-To: <18633.35473.615071.463171@arabic.ccs.neu.edu> References: <20080911190044.07E68650094@mail-svr1.cs.utah.edu> <18633.33388.482413.962116@arabic.ccs.neu.edu> <18633.34434.777056.63949@arabic.ccs.neu.edu> <18633.35473.615071.463171@arabic.ccs.neu.edu> Message-ID: <756daca50809111627w24a33a61p5a856ad2fe7fc4b1@mail.gmail.com> Hi Eli, > Can you specify which parts made no sense, and how they can be improved? I was sort of expecting the documentation to have everything you would need to know to do %80 of your tasks in one or two pages. Instead there is a lot of material, but it isn't obvious (to me) where to look or where to start. I was excited to see Scribble when it came out; but quickly found that I just "didn't get it". I assumed it was too powerful for what I wanted to do with it, which basically amounts to what one wants to do with HTML. The best place I have to figure things out is to look at the source code for the documentation. Sometimes obvious operations seem confusing, so people post about them and knowledgeable folks answer so quickly that I feel like it must be confusing to you guys why people don't get it! :) That's not a precise reply, but, does that make sense? Best wishes, Grant From mflatt at cs.utah.edu Thu Sep 11 20:32:23 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:28:07 2009 Subject: [plt-scheme] Tables in Scribblings In-Reply-To: <756daca50809111627w24a33a61p5a856ad2fe7fc4b1@mail.gmail.com> References: <20080911190044.07E68650094@mail-svr1.cs.utah.edu> <18633.33388.482413.962116@arabic.ccs.neu.edu> <18633.34434.777056.63949@arabic.ccs.neu.edu> <18633.35473.615071.463171@arabic.ccs.neu.edu> <756daca50809111627w24a33a61p5a856ad2fe7fc4b1@mail.gmail.com> Message-ID: <20080912003225.3784D6500BC@mail-svr1.cs.utah.edu> At Thu, 11 Sep 2008 18:27:49 -0500, "Grant Rettke" wrote: > > Can you specify which parts made no sense, and how they can be improved? > > I was sort of expecting the documentation to have everything you would > need to know to do %80 of your tasks in one or two pages. Instead > there is a lot of material, but it isn't obvious (to me) where to look > or where to start. I was excited to see Scribble when it came out; but > quickly found that I just "didn't get it". I assumed it was too > powerful for what I wanted to do with it, which basically amounts to > what one wants to do with HTML. The best place I have to figure things > out is to look at the source code for the documentation. > > Sometimes obvious operations seem confusing, so people post about them > and knowledgeable folks answer so quickly that I feel like it must be > confusing to you guys why people don't get it! :) I think Eli was asking more specifically about documentation for the "@" reader syntax, but your point is well taken. It will take us a while to refine Scribble into something that meets our documentation needs, is easy to use, and has good documentation for itself. Matthew From eli at barzilay.org Thu Sep 11 21:08:57 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:28:07 2009 Subject: [plt-scheme] Tables in Scribblings In-Reply-To: References: <20080911190044.07E68650094@mail-svr1.cs.utah.edu> <18633.33388.482413.962116@arabic.ccs.neu.edu> <18633.34434.777056.63949@arabic.ccs.neu.edu> <18633.35473.615071.463171@arabic.ccs.neu.edu> Message-ID: <18633.49449.410069.518774@arabic.ccs.neu.edu> Thanks for the feedback -- I'll try to improve some things based on it, but here are a few quick comments before I do that: On Sep 11, Jay McCarthy wrote: > > But it doesn't give an example of just getting a solitary @. It doesn't feel right to me to jump right into the relevant subtelties, and the paragraph that you quoted is basically the introduction. (But I will try to put some clarifying examples close to that paragraph.) > So, I'm supposed to go through the following process: > > 1. I want a textual @. > 2. I can get a scheme identifier with an @ by following those > examples. But that's not what I want. > 3. "Of course, @ is not treated specially in Scheme strings ..." -- > none of these sounds like what I want... I'm not making a Scheme > string, I want just plain old text. [I hope that it is clear that the scribble reader represents `text' as (sequences of) strings.] > 4. So what do I do? > 5. Oh wait, Scheme values are evaluated and displayed. > 6. Thus by 4, a Scheme string with an @ in it is what I want. > 7. Okay, so "@", because "..." is a Scheme string > 8. Error: read: expected a closing '"' > 9. Hmm, that's strange. Oh right, "..." is not a Scheme string, it is a "body" > 10. How do I get just a string? > 11. The concrete syntax only has function calls. Strings aren't > function calls. OK, that's probably should be demonstrated sooner, with the above addition, probably. > > 12. I've read the rest of this manual page. No examples. There's this example, which is pretty explicit: @foo{The prefix: @"@".} reads as (foo "The prefix: @.") and then there is an example that involves both Scheme strings, and double-quotes in the text part: @foo{@"@x{y}" --> (x "y")} reads as (foo "@x{y} --> (x \"y\")") Both of these examples come before the "Alternative Body Syntax" section that has the `|{'s, and demonstrates more ways to get an at-sign in a string. > 13. I read it again, now I notice that in 3.1.2 in the third set of > examples, the third example shows that > > @foo => foo The "Scheme Expression Escapes" has lots of examples that are more than just identifiers. But I think that to make this point better, some examples should be added to "the command part" section. > 14. It takes a great leap to realize that this applies not only to > identifiers, but any Scheme expression. I could also have noticed this > by reading in 3.1.1 in the third paragraph where examples are given of > lambdas and unquote. I didn't notice these earlier, because they are > so complicated. That sounds like a possible problem, but I'm not sure how to deal with it. If I leave out the "complicated" examples, then it's not going to be complete, and leaving them in is clearly a problem. Perhaps the right approach to solve all this would be to follow the intro with a few quick common examples, but I'm not sure which set to choose that is both useful and not too confusing (for example, I'm not sure if |{...|} should be included in something like that). > [...] > Another example is that the manual libraries are documented as > Scheme calls. It is true that they are Scheme functions, but they > feel like markup. Just putting examples in the @ syntax would be an > amazing improvement. It is hard to tell where to use [] and where to > use {} That's a known problem. It comes from the current implementation of the `scheme' macro, which organizes the code according to the source information of the syntax -- but that source information is roughly the same for `@foo[x]{y}' and for `(foo x "y")'. There are certain syntax properties that mark scribble-read expressions, but reconstructing the input form from that is too difficult. Actually, Matthew: the whole expression will have a `scribble' syntax property that has '(form ), where is the number of datum arguments (or #f if no [] were used), and is the number of the following argument that originated from a body part (again, #f is there was no body). So perhaps this can be used for a simple rendering using the scribble notation? A complete solution for this would be a new `scheme'-like construct that has its body as text (eg, @scheme{...}), and it will parse this text to get to the scheme parts and to highlight them properly, but keep the text as is for the rendered version. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From eli at barzilay.org Thu Sep 11 21:15:30 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:28:07 2009 Subject: [plt-scheme] Tables in Scribblings In-Reply-To: <20080912003225.3784D6500BC@mail-svr1.cs.utah.edu> References: <20080911190044.07E68650094@mail-svr1.cs.utah.edu> <18633.33388.482413.962116@arabic.ccs.neu.edu> <18633.34434.777056.63949@arabic.ccs.neu.edu> <18633.35473.615071.463171@arabic.ccs.neu.edu> <756daca50809111627w24a33a61p5a856ad2fe7fc4b1@mail.gmail.com> <20080912003225.3784D6500BC@mail-svr1.cs.utah.edu> Message-ID: <18633.49842.758339.172640@arabic.ccs.neu.edu> On Sep 11, Matthew Flatt wrote: > At Thu, 11 Sep 2008 18:27:49 -0500, "Grant Rettke" wrote: > > > Can you specify which parts made no sense, and how they can be > > > improved? > > > > I was sort of expecting the documentation to have everything you > > would need to know to do %80 of your tasks in one or two > > pages. Instead there is a lot of material, but it isn't obvious > > (to me) where to look or where to start. I was excited to see > > Scribble when it came out; but quickly found that I just "didn't > > get it". I assumed it was too powerful for what I wanted to do > > with it, which basically amounts to what one wants to do with > > HTML. The best place I have to figure things out is to look at the > > source code for the documentation. > > > > Sometimes obvious operations seem confusing, so people post about > > them and knowledgeable folks answer so quickly that I feel like it > > must be confusing to you guys why people don't get it! :) > > I think Eli was asking more specifically about documentation for the > "@" reader syntax, (Yes.) > but your point is well taken. It will take us a while to refine > Scribble into something that meets our documentation needs, is easy > to use, and has good documentation for itself. One more thing that I want to add: if by "what one wants to do with HTML" you mean that you want to *generate* html (not generate documentation that can be rendered in html) then that's very doable, and it's the reason that the @-reader description is detailed; it can be used for anything -- including functions that will generate html. Here's a very rough example (note that #reader should come before the #lang): ---------------------------------------------------------------------- #reader scribble/reader #lang scheme/base (define (html . body) (display "\n") (for-each display body) (display "\n\n")) (define (my-page) @html{blah 1 + 2 = @(+ 1 2) blah}) (my-page) ---------------------------------------------------------------------- Running this code will print this out: ---------------------------------------------------------------------- blah 1 + 2 = 3 blah ---------------------------------------------------------------------- -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From jay.mccarthy at gmail.com Thu Sep 11 21:17:00 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:28:07 2009 Subject: [plt-scheme] Tables in Scribblings In-Reply-To: <18633.49449.410069.518774@arabic.ccs.neu.edu> References: <18633.33388.482413.962116@arabic.ccs.neu.edu> <18633.34434.777056.63949@arabic.ccs.neu.edu> <18633.35473.615071.463171@arabic.ccs.neu.edu> <18633.49449.410069.518774@arabic.ccs.neu.edu> Message-ID: On Thu, Sep 11, 2008 at 7:08 PM, Eli Barzilay wrote: >> But it doesn't give an example of just getting a solitary @. > > It doesn't feel right to me to jump right into the relevant > subtelties, and the paragraph that you quoted is basically the > introduction. (But I will try to put some clarifying examples close > to that paragraph.) I totally agree. You're in between a rock and a hard place determining the right detail. > There's this example, which is pretty explicit: > > @foo{The prefix: @"@".} reads as (foo "The prefix: @.") Now that you show them, these should have helped me a lot. But as I read through I saw @foo and said, "But I'm not writing a call or something inside a call, ignore it." If I were an extreme reader, I should have noticed. But I'm lazy documentation reader and didn't see it. (In fact, I'm sure its been there the last 6 or 7 times I've tried to remember this and I've missed it every time.) Clearly something is wrong, but it's probably me. Forgive my honesty :) >> [...] >> Another example is that the manual libraries are documented as >> Scheme calls. It is true that they are Scheme functions, but they >> feel like markup. Just putting examples in the @ syntax would be an >> amazing improvement. It is hard to tell where to use [] and where to >> use {} > > That's a known problem. It comes from the current implementation of > the `scheme' macro, which organizes the code according to the source > information of the syntax -- but that source information is roughly > the same for `@foo[x]{y}' and for `(foo x "y")'. There are certain > syntax properties that mark scribble-read expressions, but > reconstructing the input form from that is too difficult. I anticipated there was a good reason. I can't wait till your two giant brains figure it out. =) Jay -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From eli at barzilay.org Thu Sep 11 21:22:33 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:28:07 2009 Subject: [plt-scheme] Tables in Scribblings In-Reply-To: References: <18633.33388.482413.962116@arabic.ccs.neu.edu> <18633.34434.777056.63949@arabic.ccs.neu.edu> <18633.35473.615071.463171@arabic.ccs.neu.edu> <18633.49449.410069.518774@arabic.ccs.neu.edu> Message-ID: <18633.50265.226773.673775@arabic.ccs.neu.edu> On Sep 11, Jay McCarthy wrote: > On Thu, Sep 11, 2008 at 7:08 PM, Eli Barzilay wrote: > > There's this example, which is pretty explicit: > > > > @foo{The prefix: @"@".} reads as (foo "The prefix: @.") > > Now that you show them, these should have helped me a lot. But as I > read through I saw @foo and said, "But I'm not writing a call or > something inside a call, ignore it." If I were an extreme reader, I > should have noticed. But I'm lazy documentation reader and didn't > see it. (In fact, I'm sure its been there the last 6 or 7 times I've > tried to remember this and I've missed it every time.) (Yes it has, the whole thing didn't change much since it was in doc.txt form. But the fact that you missed it so many times is what makes me think that there's a problem in the current organization of the text.) > Clearly something is wrong, but it's probably me. Forgive my honesty > :) Well, I think that most people are lazy readers when it comes to reference manuals. You want to get to the point that gives you what you want. Since the reader chapter reads almost like a story with lots of examples, I think that a simpler "quick intro" paragraph will be a good thing. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From m.douglas.williams at gmail.com Thu Sep 11 21:39:35 2008 From: m.douglas.williams at gmail.com (Doug Williams) Date: Thu Mar 26 02:28:08 2009 Subject: [plt-scheme] Tables in Scribblings In-Reply-To: <18633.50265.226773.673775@arabic.ccs.neu.edu> References: <18633.34434.777056.63949@arabic.ccs.neu.edu> <18633.35473.615071.463171@arabic.ccs.neu.edu> <18633.49449.410069.518774@arabic.ccs.neu.edu> <18633.50265.226773.673775@arabic.ccs.neu.edu> Message-ID: I would disagree that most people are lazy readers in this case. I personally have skimmed the entire Scribble manual and read the @-reader part in detail and I couldn't figure it out. The same with tables. It certainly isn't obvious that the only way to actually make a table is to literally call make-table with all of its vagaries and getting exactly the right (listof (listof ...)) figured out without an example. [And, the examples we do find are often obscured behind a level of abstraction that we in turn have to figure out. It might be good coding, but not so good as an example.] I also know that things take time and I'm sure we'll have a Scribble Guide and better examples over time. And, I do appreciate the quick responses I tend to get on the list. There are many of us with PLaneT packages who are trying to catch up with Version 4.0. I'm pretty much there except for the documentation and it has been rough going for complex collections. I think the thing that would have helped the most is for someone to show us a canonical PLaneT package, with documentation, that you guys have looked over and said, "Yes, that's the right way to do it." Doug P.S. Please understand that all of this is indended as constructive criticism. We're all trying to improve the tools we have/provide. On Thu, Sep 11, 2008 at 7:22 PM, Eli Barzilay wrote: > On Sep 11, Jay McCarthy wrote: > > On Thu, Sep 11, 2008 at 7:08 PM, Eli Barzilay wrote: > > > There's this example, which is pretty explicit: > > > > > > @foo{The prefix: @"@".} reads as (foo "The prefix: @.") > > > > Now that you show them, these should have helped me a lot. But as I > > read through I saw @foo and said, "But I'm not writing a call or > > something inside a call, ignore it." If I were an extreme reader, I > > should have noticed. But I'm lazy documentation reader and didn't > > see it. (In fact, I'm sure its been there the last 6 or 7 times I've > > tried to remember this and I've missed it every time.) > > (Yes it has, the whole thing didn't change much since it was in > doc.txt form. But the fact that you missed it so many times is what > makes me think that there's a problem in the current organization of > the text.) > > > Clearly something is wrong, but it's probably me. Forgive my honesty > > :) > > Well, I think that most people are lazy readers when it comes to > reference manuals. You want to get to the point that gives you what > you want. Since the reader chapter reads almost like a story with > lots of examples, I think that a simpler "quick intro" paragraph will > be a good thing. > > -- > ((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/20080911/886cea06/attachment.htm From grettke at acm.org Thu Sep 11 22:45:29 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:08 2009 Subject: [plt-scheme] HTDP: Unit Tests vs. Solutions Message-ID: <756daca50809111945k48302666y87215d214a172eb0@mail.gmail.com> Hi, Based on a previous thread, I know why you only give out solutions to teachers. Understood. Why don't you give out the unit tests for the exercises, though? Pro: Helpful for non-students Con: Students writing functions to satisfy the tests (there are other issues here, though, not created by the unit test, though perhaps revealed by it) Best wishes, Grant From grettke at acm.org Thu Sep 11 23:58:34 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:09 2009 Subject: [plt-scheme] HTDP: Question on 7.4.4 Message-ID: <756daca50809112058u5c53e5e7n956e0ef5f671d2bd@mail.gmail.com> Hi, In 7.4.4, in each of the cond clauses I've got the question and answer "all there". In other words, I didn't break out clear-circle and clear-rectangle into separate functions. Since their bodies are tiny, I didn't see the point. One of my friends working through HTDP countered saying "Follow the advice of the book; break out complex code into separate functions." He didn't say it yet either, but I bet he'll say that it is easier to unit test, too. I feel like conceptually, I don't want to expose those because I followed the approach of exposing the clear-shape function "function per class approach" versus using a bunch of individual functions, the "function per sub-type approach". Perhaps I am over-thinking this at this point. Best wishes, Grant From yinso.chen at gmail.com Fri Sep 12 00:55:58 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:28:09 2009 Subject: [plt-scheme] contract & tail recursion Message-ID: <779bf2730809112155y3196163ch1ae97832b7fff68f@mail.gmail.com> Hi - Question regarding contracts: I am reading up on contracts, and I just found that while `any` is tail recursive, `any/c` is not. Since any/c matches one and only one return value and is not tail recursive, what about other tests that matches one and only one value? Such as `void?`, `null?`, `list?`, etc? Are they tail recursive? I assume (and hope) they are, is my assumption correct? Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080911/0c974fb1/attachment.html From clements at brinckerhoff.org Fri Sep 12 03:18:17 2008 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:28:10 2009 Subject: [plt-scheme] contract & tail recursion In-Reply-To: <779bf2730809112155y3196163ch1ae97832b7fff68f@mail.gmail.com> References: <779bf2730809112155y3196163ch1ae97832b7fff68f@mail.gmail.com> Message-ID: <8660B0C6-95CC-4F14-B845-B257AE30DFE2@brinckerhoff.org> On Sep 11, 2008, at 9:55 PM, YC wrote: > Hi - > > Question regarding contracts: > > I am reading up on contracts, and I just found that while `any` is > tail recursive, `any/c` is not. Since any/c matches one and only > one return value and is not tail recursive, what about other tests > that matches one and only one value? Such as `void?`, `null?`, > `list?`, etc? Are they tail recursive? I assume (and hope) they > are, is my assumption correct? When you say that "any" is tail recursive, I believe what you actually mean is that a procedure that uses "any" as its result contract can still be tail-calling (or tail recursive, if you prefer). This is because the "any" contract is satisfied by any value, so no check need be performed. In other cases, though, you can't have tail-calling; this is because the contract that you're specifying requires a check after the return of the procedure that the contract is applied to. To be more concrete: suppose you have a function f that's wrapped with a number? -> number? contract. Calls to f can never be tail calls, because the current continuation must be extended with a check that the result value is a number. My apologies in advance if I've misunderstood your question. 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/20080912/4b1d4094/smime.bin From noelwelsh at gmail.com Fri Sep 12 03:26:54 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:28:10 2009 Subject: [plt-scheme] HTDP: Unit Tests vs. Solutions In-Reply-To: <756daca50809111945k48302666y87215d214a172eb0@mail.gmail.com> References: <756daca50809111945k48302666y87215d214a172eb0@mail.gmail.com> Message-ID: On Fri, Sep 12, 2008 at 3:45 AM, Grant Rettke wrote: > Why don't you give out the unit tests for the exercises, though? If this was the case, I imagine that students wouldn't bother implementing their own. N. From noelwelsh at gmail.com Fri Sep 12 03:30:42 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:28:10 2009 Subject: [plt-scheme] Trouble checking the repository out In-Reply-To: <98b8086f0809111524h7438ac03g751a272ba16bd726@mail.gmail.com> References: <98b8086f0809111524h7438ac03g751a272ba16bd726@mail.gmail.com> Message-ID: The SVN repository was just upgraded to 1.5. Try again, and perhaps consider upgrading your client if it is old. N. On Thu, Sep 11, 2008 at 11:24 PM, troels knak-nielsen wrote: > I get this: > > tkn@tkn-ubuntu ~/external $ svn checkout http://svn.plt-scheme.org/plt/trunk plt > A plt/doc/r6rs-std/r6rs-Z-G-27.gif > A plt/doc/r6rs-std/r6rs-Z-G-28.gif > ... snip ... > A plt/doc/r6rs-lib-std/r6rs-lib-Z-H-20.html > A plt/doc/srfi-std > svn: REPORT request failed on '/plt/!svn/vcc/default' > svn: REPORT of '/plt/!svn/vcc/default': Could not read response body: > Connection reset by peer (http://svn.plt-scheme.org) > tkn@tkn-ubuntu ~/external $ > > -- > troels From d.j.gurnell at gmail.com Fri Sep 12 04:30:54 2008 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Thu Mar 26 02:28:10 2009 Subject: [plt-scheme] scheme/class: attaching properties to classes Message-ID: Hi all, Is there any way of attaching properties to classes? I'm thinking particularly of prop:custom-write, which would let me implement a to-string method. Cheers, -- Dave From robby at cs.uchicago.edu Fri Sep 12 07:41:45 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:28:11 2009 Subject: [plt-scheme] Replace & Find in v4.1 In-Reply-To: <5875040B90BF4D49B08B784E31C80395@IBMI> References: <932b2f1f0808150702t1bbf52f5xdddb6f33287e63a0@mail.gmail.com> <5875040B90BF4D49B08B784E31C80395@IBMI> Message-ID: <932b2f1f0809120441o3089707fy4c017c13d841ef29@mail.gmail.com> I've made a few changes to the way search works and redone the replace bit. (The nightly build should contain the changes.) Thanks for your comments. Robby From plragde at uwaterloo.ca Fri Sep 12 08:39:56 2008 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:28:11 2009 Subject: [plt-scheme] question on cond Message-ID: <48CA631C.40708@uwaterloo.ca> I have a student working in the EOPL language level who submitted programs whose cond expressions do not contain the else keyword. It isn't replaced by #t; it just isn't there. Having drunk deeply of HtDP Kool-Aid, I was not aware that a cond clause could be of the form [test-expr]. But the PLT Scheme Reference, section 2.12, says that test-expr is not in tail position with respect to the cond form. Why not? --PR From eli at barzilay.org Fri Sep 12 09:24:20 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:28:11 2009 Subject: [plt-scheme] Scribble syntax documentation Message-ID: <18634.28036.120877.919542@arabic.ccs.neu.edu> I've made considerable changes to the beginning part of the reader documentation. See the new text at http://docs.plt-scheme.org/scribble/reader.html -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From matthias at ccs.neu.edu Fri Sep 12 09:31:15 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:28:11 2009 Subject: [plt-scheme] HTDP: Unit Tests vs. Solutions In-Reply-To: References: <756daca50809111945k48302666y87215d214a172eb0@mail.gmail.com> Message-ID: <2C13F4DB-6C43-4F85-BF48-3A8BD531132E@ccs.neu.edu> Yes. I have come to believe that being able to make up your own examples (inputs, outputs) is *the* critical step in solving most problems. -- Matthias On Sep 12, 2008, at 3:26 AM, Noel Welsh wrote: > On Fri, Sep 12, 2008 at 3:45 AM, Grant Rettke wrote: >> Why don't you give out the unit tests for the exercises, though? > > If this was the case, I imagine that students wouldn't bother > implementing their own. > > N. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From czhu at cs.utah.edu Fri Sep 12 09:47:24 2008 From: czhu at cs.utah.edu (Chongkai Zhu) Date: Thu Mar 26 02:28:11 2009 Subject: [plt-scheme] question on cond In-Reply-To: <48CA631C.40708@uwaterloo.ca> References: <48CA631C.40708@uwaterloo.ca> Message-ID: <48CA72EC.2040808@cs.utah.edu> If you have to write cond as a macro in Scheme, what will you write? I will do (define-syntax cond (syntax-rules (=> else) ;other cases ((cond (test-expr) cond-clause ...) (or test-expr (cond (cond-clause ...)))))) So is the `a' in `(or a b)' in tail position as the whole or expression. No it isn't. You will have (define-syntax or (syntax-rules () ((or a b) (let ((t a)) (if t t b))))) The continuation of `a' need to test whether it is true or not, and then decide the return value of the whole expression. Chongkai Prabhakar Ragde wrote: > I have a student working in the EOPL language level who submitted > programs whose cond expressions do not contain the else keyword. It > isn't replaced by #t; it just isn't there. Having drunk deeply of HtDP > Kool-Aid, I was not aware that a cond clause could be of the form > [test-expr]. But the PLT Scheme Reference, section 2.12, says that > test-expr is not in tail position with respect to the cond form. Why > not? --PR > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From plragde at uwaterloo.ca Fri Sep 12 09:59:22 2008 From: plragde at uwaterloo.ca (Prabhakar Ragde) Date: Thu Mar 26 02:28:11 2009 Subject: [plt-scheme] question on cond In-Reply-To: <48CA72EC.2040808@cs.utah.edu> References: <48CA631C.40708@uwaterloo.ca> <48CA72EC.2040808@cs.utah.edu> Message-ID: <48CA75BA.9090405@uwaterloo.ca> Chongkai Zhu wrote: > If you have to write cond as a macro in Scheme, what will you write? I > will do > > (define-syntax cond > (syntax-rules (=> else) > ;other cases > ((cond (test-expr) > cond-clause ...) > (or test-expr > (cond (cond-clause ...)))))) > > So is the `a' in `(or a b)' in tail position as the whole or expression. > No it isn't. You will have > > (define-syntax or > (syntax-rules () > ((or a b) > (let ((t a)) > (if t t b))))) > > The continuation of `a' need to test whether it is true or not, and then > decide the return value of the whole expression. Thanks. I missed the text further up that said that if the test expression evaluates to #f, then the result depends on the rest of the cond clauses. I thought it just returned the value of the test expression unconditionally. Sorry for the noise. --PR From icfp.publicity at googlemail.com Fri Sep 12 10:17:59 2008 From: icfp.publicity at googlemail.com (Matthew Fluet (ICFP Publicity Chair)) Date: Thu Mar 26 02:28:12 2009 Subject: [plt-scheme] Workshop on Generic Programming: Call for Participation (co-located w/ ICFP08) Message-ID: <53ff55480809120717u28fe601fp3d9a1e88b101a6f3@mail.gmail.com> Dear all, the Workshop on Generic Programming is only a few days away: 20th September 2008 (http://www.regmaster.com/conf/icfp2008.html). ==> Invited talk: The Generic Paradigm ==> Lambert Meertens (Utrecht University) ==> We have reserved 20 minutes for *lightning talks*. If you plan to ==> attend and if you would like to give a short talk (about half-baked, ==> exciting, new stuff) please drop me a short note. Slots will be ==> reserved on a first-come-first-serve basis. Looking forward to seeing you in Victoria, Ralf Hinze ============================================================================ CALL FOR PARTICIPATION Workshop on Generic Programming 2008 Victoria, Canada, 20th September 2008 http://www.comlab.ox.ac.uk/ralf.hinze/wgp2008/cfp.{html,pdf,ps,txt} The Workshop on Generic Programming is sponsored by ACM SIGPLAN and forms part of ICFP 2008. Previous Workshops on Generic Programming have been held in Marstrand (affiliated with MPC), Ponte de Lima (affiliated with MPC), Nottingham (informal workshop), Dagstuhl (IFIP WG2.1 Working Conference), Oxford (informal workshop), Utrecht (informal workshop), and Portland (affiliated with ICFP). ============================================================================ Preliminary program ------------------- 9:00 - 10:00, Session Chair: Ralf Hinze (University of Oxford) Welcome Invited talk: The Generic Paradigm Lambert Meertens (Utrecht University) 10:30 - 12:00, Session Chair: Jeremy Gibbons (University of Oxford) A Functional Model-View-Controller Software Architecture for Command-oriented Programs Alley Stoughton (Kansas State University) A Lightweight Approach to Datatype-Generic Rewriting Thomas van Noort (Radboud University Nijmegen), Alexey Rodriguez, Stefan Holdermans (Utrecht University), Johan Jeuring (Utrecht University and Open University of the Netherlands), Bastiaan Heeren (Open University of the Netherlands) Lightning talks 13:30 - 15:00, Session Chair: Ralf Hinze (University of Oxford) Report from the program chair Ralf Hinze (University of Oxford) Scala for Generic Programmers Bruno C. d. S. Oliveira, Jeremy Gibbons (University of Oxford) A Comparison of C++ Concepts and Haskell Type Classes Jean-Philippe Bernardy, Patrik Jansson, Marcin Zalewski, Sibylle Schupp, Andreas Priesnitz (Chalmers University of Technology and University of Gothenburg) Lightning talks 15:30 - 17:30, Session Chair: Patrik Jansson (Chalmers University of Technology and University of Gothenburg) Polytypic Programming in Coq Wendy Verbruggen, Edsko de Vries, Arthur Hughes (Trinity College Dublin) Bialgebra Views: A Way for Polytypic Programming to Cohabit with Data Abstraction Pablo Nogueira, Juan Jose Moreno-Navarro (Universidad Politecnica de Madrid) Discussion ============================================================================ From michael at schuerig.de Fri Sep 12 10:35:39 2008 From: michael at schuerig.de (Michael Schuerig) Date: Thu Mar 26 02:28:12 2009 Subject: [plt-scheme] Generating PDF docs? Message-ID: <200809121635.39419.michael@schuerig.de> I know that I can generate docs in PDF format using $ setup-plt --doc-pdf However, that unnecessarily(?) runs the entire setup process again. Is it possible to have the PDF docs generate automatically on the initial make install? Michael -- Michael Schuerig mailto:michael@schuerig.de http://www.schuerig.de/michael/ From mflatt at cs.utah.edu Fri Sep 12 10:51:23 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:28:12 2009 Subject: [plt-scheme] Generating PDF docs? In-Reply-To: <200809121635.39419.michael@schuerig.de> References: <200809121635.39419.michael@schuerig.de> Message-ID: <20080912145125.5042C650057@mail-svr1.cs.utah.edu> At Fri, 12 Sep 2008 16:35:39 +0200, Michael Schuerig wrote: > > I know that I can generate docs in PDF format using > > $ setup-plt --doc-pdf > > However, that unnecessarily(?) runs the entire setup process again. Is > it possible to have the PDF docs generate automatically on the initial > make install? You could install with `make plain-install' and then run either `setup-plt' or `mzscheme -l setup' manually. I recommend just installing normally and then running `setup-plt', though. Even though unning `setup-plt' checks all the work that it did before, it shouldn't repeat much actual work. For example, it shouldn't re-build any ".zo" files. Also, you could move things along a little bit by supplying `-n' before `--doc-pdf', which tells `setup-plt' not to bother checking all the ".zo" files. Matthew From mflatt at cs.utah.edu Fri Sep 12 11:15:03 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:28:12 2009 Subject: [plt-scheme] scheme/class: attaching properties to classes In-Reply-To: References: Message-ID: <20080912151503.7804F6500A8@mail-svr1.cs.utah.edu> At Fri, 12 Sep 2008 09:30:54 +0100, Dave Gurnell wrote: > Is there any way of attaching properties to classes? Not currently. A potential problem is that a property (through its guard) can get information about the structure type that it is attached to, but the representation of objects is supposed to be private. So far, our strategy has been to include direct support for some trusted properties, such as the one for serialization. > I'm thinking particularly of prop:custom-write, which would let me > implement a to-string method. We should build support for custom writing into the class system (like for serialization). I remember that you've asked once before already, and I'll try to add it soon. Matthew From grettke at acm.org Fri Sep 12 11:15:03 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:12 2009 Subject: [plt-scheme] scheme/class: attaching properties to classes In-Reply-To: References: Message-ID: <756daca50809120815v42cdff65hf2b30661db1cde36@mail.gmail.com> > I'm thinking particularly of prop:custom-write, which would let me implement > a to-string method. How does that work differently than sending it a "to-string" message? Just wondering. From michael at schuerig.de Fri Sep 12 11:20:55 2008 From: michael at schuerig.de (Michael Schuerig) Date: Thu Mar 26 02:28:12 2009 Subject: [plt-scheme] Re: Generating PDF docs? In-Reply-To: <20080912145125.5042C650057@mail-svr1.cs.utah.edu> References: <200809121635.39419.michael@schuerig.de> <20080912145125.5042C650057@mail-svr1.cs.utah.edu> Message-ID: <200809121720.55270.michael@schuerig.de> On Friday 12 September 2008, Matthew Flatt wrote: > At Fri, 12 Sep 2008 16:35:39 +0200, Michael Schuerig wrote: > I recommend just installing normally and then running `setup-plt', > though. Even though unning `setup-plt' checks all the work that it > did before, it shouldn't repeat much actual work. For example, it > shouldn't re-build any ".zo" files. Also, you could move things along > a little bit by supplying `-n' before `--doc-pdf', which tells > `setup-plt' not to bother checking all the ".zo" files. Thanks, that's what I'm doing now. Michael -- Michael Schuerig mailto:michael@schuerig.de http://www.schuerig.de/michael/ From noelwelsh at gmail.com Fri Sep 12 12:00:29 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:28:12 2009 Subject: [plt-scheme] scheme/class: attaching properties to classes In-Reply-To: <756daca50809120815v42cdff65hf2b30661db1cde36@mail.gmail.com> References: <756daca50809120815v42cdff65hf2b30661db1cde36@mail.gmail.com> Message-ID: On Fri, Sep 12, 2008 at 4:15 PM, Grant Rettke wrote: >> I'm thinking particularly of prop:custom-write, which would let me implement >> a to-string method. > > How does that work differently than sending it a "to-string" message? > Just wondering. The printing procedures (write, print, maybe display) will use a user specified function to print a structure if the structure has a prop:custom-write property. Dave wants to extend this to objects, so he can specify how his objects are printed, so he can uniformly print his data (which could include objects, in addition to other types) in his desired format. N. From 84jkdl202 at sneakemail.com Fri Sep 12 11:28:28 2008 From: 84jkdl202 at sneakemail.com (///) Date: Thu Mar 26 02:28:13 2009 Subject: [plt-scheme] Using previously-defined macros within the "transformer environment" Message-ID: I'm using PLT Scheme to write a Web site. In order to make PLT Scheme more usable (that is, more like Common Lisp), I've been spending some time writing a few macros. First, I wrote a new version of the "lambda" form. It's just like the original lambda, except it understands &OPTIONAL, &KEY, and &REST, like Common Lisp (&KEY is especially important). It was a first step in porting some of my CL code over to Scheme. Next, I decided to try to write a DEFMACRO form that understands the same sort of lambda-list. (PLT is generous enough to provide "define- macro", but macros defined this way can only have Scheme lambda-lists, and the macros I'm trying to port rely heavily on &KEY-- a simple dot will not do!) The easiest way to do this would be to use the LAMBDA macro I previously wrote, so that the macro-expansion invokes the LAMBDA macro and automatically inherits its lambda-list processing capabilities. Unfortunately, it turns out that my LAMBDA macro is not visible in the transformer environment, even though I used (require- for-syntax cl-lambda) to import the module that defines it. I would hate to have to copy and paste the source for the LAMBDA form (and all the local functions it depends on) to get my DEFMACRO form to work, but at the moment it looks like that's what you have to do to satisfy the Hygienic Macro System. I tried to solve the problem with Google (which has helped on countless occasions), but apparently nobody has ever tried to use one macro to expand another in Scheme. Here's what the defmacro macro looks like: (define-macro (defmacro name lambda-list . body) (let* ((rest-arg (gensym)) (simple-lambda-list (make-simple-lambda-list (fold-optional-args-into-rest lambda-list rest-arg)))) `(define-macro ,(cons name simple-lambda-list) (apply (cl-lambda ,lambda-list ,@body) ,(cons-to-rest-arg-if-necessary simple-lambda-list rest- arg))))) "simple-lambda-list" converts a CL lambda-list into a Scheme one (including that stupid little dot), while "fold-optional-args-into-rest" removes all &OPTIONAL and &KEY arguments and adds a &REST argument to replace them (and also replaces any user-provided &REST arguments with its own definition). (foo bar &optional baz &rest haha) becomes (foo bar &rest g39). It expands as expected: (defmacro foobar (x &optional y) `(list ,x ,y)) expands into: (define-macro (foobar x . g73) (apply (cl-lambda (x &optional y) (quasiquote (list (unquote x) (unquote y)))) (cons x g73))) However, the above macro can't be expanded any further because: reference to undefined identifier: cl-lambda I know the problem is caused by the transformer environment because the cl-lambda form works from the REPL. In fact, if you define x and g73 in a let form and paste in the definition of the above macro, you get the expansion that should result from the macro: (let ((x 1) (g73 '(2))) (apply (cl-lambda (x &optional y) (quasiquote (list (unquote x) (unquote y)))) (cons x g73))) ==> (list 1 2) define-for-syntax allows you to define functions in the transformer environment, but there is no such thing as define-macro-for-syntax, or even define-syntax-for-syntax. The PLT Scheme reference manual is absolutely silent on this issue, except that it seems to suggest (incorrectly) that require-for-syntax should solve the problem (it only helps with functions). Has anyone ever done this sort of thing in Scheme before? Is it fixed in a later version of PLT Scheme? My ISP is using MzScheme 360. From meanwhile.the.ocelot at gmail.com Fri Sep 12 14:29:26 2008 From: meanwhile.the.ocelot at gmail.com (Thomas Brendel) Date: Thu Mar 26 02:28:13 2009 Subject: [plt-scheme] "Standard Output" window when running stand-alone exe Message-ID: <64e70c900809121129j7e7bbf3au7a62f941de59c95c@mail.gmail.com> Hi, I'm fairly new to Scheme and I'm trying to make a stand-alone executable of my program, but the documentation for mzc makes my head spin. I finally managed to get something that works the way it's supposed to, except that it also creates a window called "Standard Output," which displays #t upon opening and [Exited] after I close my program window. Is there anything I can do to stop this from appearing? Thanks, Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080912/c9c4ec98/attachment.html From troelskn at gmail.com Fri Sep 12 14:39:07 2008 From: troelskn at gmail.com (troels knak-nielsen) Date: Thu Mar 26 02:28:13 2009 Subject: [plt-scheme] Trouble checking the repository out In-Reply-To: References: <98b8086f0809111524h7438ac03g751a272ba16bd726@mail.gmail.com> Message-ID: <98b8086f0809121139m79080d8al3e567c6add5672e4@mail.gmail.com> Seems I just picked the wrong time then; It's working fine now. Thanks for your time. -- troels On Fri, Sep 12, 2008 at 9:30 AM, Noel Welsh wrote: > The SVN repository was just upgraded to 1.5. Try again, and perhaps > consider upgrading your client if it is old. > > N. > > On Thu, Sep 11, 2008 at 11:24 PM, troels knak-nielsen > wrote: >> I get this: >> >> tkn@tkn-ubuntu ~/external $ svn checkout http://svn.plt-scheme.org/plt/trunk plt >> A plt/doc/r6rs-std/r6rs-Z-G-27.gif >> A plt/doc/r6rs-std/r6rs-Z-G-28.gif >> ... snip ... >> A plt/doc/r6rs-lib-std/r6rs-lib-Z-H-20.html >> A plt/doc/srfi-std >> svn: REPORT request failed on '/plt/!svn/vcc/default' >> svn: REPORT of '/plt/!svn/vcc/default': Could not read response body: >> Connection reset by peer (http://svn.plt-scheme.org) >> tkn@tkn-ubuntu ~/external $ >> >> -- >> troels > From yinso.chen at gmail.com Fri Sep 12 14:55:18 2008 From: yinso.chen at gmail.com (YC) Date: Thu Mar 26 02:28:14 2009 Subject: [plt-scheme] contract & tail recursion In-Reply-To: <8660B0C6-95CC-4F14-B845-B257AE30DFE2@brinckerhoff.org> References: <779bf2730809112155y3196163ch1ae97832b7fff68f@mail.gmail.com> <8660B0C6-95CC-4F14-B845-B257AE30DFE2@brinckerhoff.org> Message-ID: <779bf2730809121155i2eeade57rf1e038a2cd23252b@mail.gmail.com> On Fri, Sep 12, 2008 at 12:18 AM, John Clements wrote: > > When you say that "any" is tail recursive, I believe what you actually mean > is that a procedure that uses "any" as its result contract can still be > tail-calling (or tail recursive, if you prefer). This is because the "any" > contract is satisfied by any value, so no check need be performed. > > In other cases, though, you can't have tail-calling; this is because the > contract that you're specifying requires a check after the return of the > procedure that the contract is applied to. > > To be more concrete: suppose you have a function f that's wrapped with a > number? -> number? contract. Calls to f can never be tail calls, because > the current continuation must be extended with a check that the result value > is a number. > Thanks for the response. I apologize for my unclear writing. What you say makes sense, to me it means that if we care about space efficiency we cannot use anything besides `any` for the result contract, unless we can foresee how the function would be used ahead of time, or have a way to conditionally circumvent contracts. Thanks, yc -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080912/dbbb94f4/attachment.htm From robby at cs.uchicago.edu Fri Sep 12 14:57:49 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:28:14 2009 Subject: [plt-scheme] contract & tail recursion In-Reply-To: <779bf2730809121155i2eeade57rf1e038a2cd23252b@mail.gmail.com> References: <779bf2730809112155y3196163ch1ae97832b7fff68f@mail.gmail.com> <8660B0C6-95CC-4F14-B845-B257AE30DFE2@brinckerhoff.org> <779bf2730809121155i2eeade57rf1e038a2cd23252b@mail.gmail.com> Message-ID: <932b2f1f0809121157s3b9d3758xee049ba7f95ec6a8@mail.gmail.com> On Fri, Sep 12, 2008 at 1:55 PM, YC wrote: > > > On Fri, Sep 12, 2008 at 12:18 AM, John Clements > wrote: >> >> When you say that "any" is tail recursive, I believe what you actually >> mean is that a procedure that uses "any" as its result contract can still be >> tail-calling (or tail recursive, if you prefer). This is because the "any" >> contract is satisfied by any value, so no check need be performed. >> >> In other cases, though, you can't have tail-calling; this is because the >> contract that you're specifying requires a check after the return of the >> procedure that the contract is applied to. >> >> To be more concrete: suppose you have a function f that's wrapped with a >> number? -> number? contract. Calls to f can never be tail calls, because >> the current continuation must be extended with a check that the result value >> is a number. > > Thanks for the response. I apologize for my unclear writing. > > What you say makes sense, to me it means that if we care about space > efficiency we cannot use anything besides `any` for the result contract, > unless we can foresee how the function would be used ahead of time, or have > a way to conditionally circumvent contracts. I don't think it is quite that dire! For example, I care about space efficiency, but still use result contracts all the time. In general, if the function is not involved in loops, you're fine. Also note that contracts are not checked "internally" to a module. So a recursive function with a result contract is still going to be fine. Robby From czhu at cs.utah.edu Fri Sep 12 15:11:35 2008 From: czhu at cs.utah.edu (Chongkai Zhu) Date: Thu Mar 26 02:28:14 2009 Subject: [plt-scheme] "Standard Output" window when running stand-alone exe In-Reply-To: <64e70c900809121129j7e7bbf3au7a62f941de59c95c@mail.gmail.com> References: <64e70c900809121129j7e7bbf3au7a62f941de59c95c@mail.gmail.com> Message-ID: <48CABEE7.602@cs.utah.edu> Your program `write'/`print'/`display' a "#t" to the `standard-output-port'. You need to check the your source code to remove that. Chongkai Thomas Brendel wrote: > Hi, > > I'm fairly new to Scheme and I'm trying to make a stand-alone > executable of my program, but the documentation for mzc makes my head > spin. I finally managed to get something that works the way it's > supposed to, except that it also creates a window called "Standard > Output," which displays #t upon opening and [Exited] after I close my > program window. Is there anything I can do to stop this from appearing? > > Thanks, > Thomas > ------------------------------------------------------------------------ > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From robby at cs.uchicago.edu Fri Sep 12 15:15:04 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:28:15 2009 Subject: [plt-scheme] "Standard Output" window when running stand-alone exe In-Reply-To: <48CABEE7.602@cs.utah.edu> References: <64e70c900809121129j7e7bbf3au7a62f941de59c95c@mail.gmail.com> <48CABEE7.602@cs.utah.edu> Message-ID: <932b2f1f0809121215j7f5c7df1q58be363a74501d05@mail.gmail.com> Such printouts also occur if values are returned to the top-level in the "scheme" family of languages. Robby On Fri, Sep 12, 2008 at 2:11 PM, Chongkai Zhu wrote: > Your program `write'/`print'/`display' a "#t" to the `standard-output-port'. > You need to check the your source code to remove that. > > Chongkai > > Thomas Brendel wrote: >> >> Hi, >> >> I'm fairly new to Scheme and I'm trying to make a stand-alone executable >> of my program, but the documentation for mzc makes my head spin. I finally >> managed to get something that works the way it's supposed to, except that it >> also creates a window called "Standard Output," which displays #t upon >> opening and [Exited] after I close my program window. Is there anything I >> can do to stop this from appearing? >> >> Thanks, >> Thomas >> ------------------------------------------------------------------------ >> >> _________________________________________________ >> 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 troelskn at gmail.com Fri Sep 12 16:10:08 2008 From: troelskn at gmail.com (troels knak-nielsen) Date: Thu Mar 26 02:28:15 2009 Subject: [plt-scheme] Problem with mzscheme Message-ID: <98b8086f0809121310w68283e8xa3ce407c9786b3b5@mail.gmail.com> Hi list, I've compiled the trunk version of plt and DrScheme is working fine, but I can't run the commandline mzscheme. Or rather, it doesn't work. This is the result of my session: tkn@tkn-ubuntu ~/external/plt/bin $ ./mzscheme Welcome to MzScheme v4.1.0.3 [3m], Copyright (c) 2004-2008 PLT Scheme Inc. split-path: expects argument of type ; given #f > (exit) stdin::0: compile: bad syntax; function application is not allowed, because no #%app syntax transformer is bound in: (#%top-interaction exit) I suppose that the split-path error at startup is somehow connected to this issue, but I'm not sure what to do? -- troels From troelskn at gmail.com Fri Sep 12 16:27:20 2008 From: troelskn at gmail.com (troels knak-nielsen) Date: Thu Mar 26 02:28:15 2009 Subject: [plt-scheme] Re: Problem with mzscheme In-Reply-To: <98b8086f0809121310w68283e8xa3ce407c9786b3b5@mail.gmail.com> References: <98b8086f0809121310w68283e8xa3ce407c9786b3b5@mail.gmail.com> Message-ID: <98b8086f0809121327p13423b3x911f90a678ce7b1f@mail.gmail.com> Stupid me! Soon after hitting send, I realised that it had to do with file-system paths somehow. If I run mzscheme from one directory up, it works as it should. Hope this helps anyone else with the same problem. I guess I should copy the contents of ~/external/plt/collects somewhere central? Where would the proper place be for that? (I'm running linux) -- troels On Fri, Sep 12, 2008 at 10:10 PM, troels knak-nielsen wrote: > Hi list, > > I've compiled the trunk version of plt and DrScheme is working fine, > but I can't run the commandline mzscheme. Or rather, it doesn't work. > This is the result of my session: > > tkn@tkn-ubuntu ~/external/plt/bin $ ./mzscheme > Welcome to MzScheme v4.1.0.3 [3m], Copyright (c) 2004-2008 PLT Scheme Inc. > split-path: expects argument of type string>; given #f >> (exit) > stdin::0: compile: bad syntax; function application is not allowed, > because no #%app syntax transformer is bound in: (#%top-interaction > exit) > > I suppose that the split-path error at startup is somehow connected to > this issue, but I'm not sure what to do? > > -- > troels > From robby at cs.uchicago.edu Fri Sep 12 18:01:41 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:28:15 2009 Subject: [plt-scheme] Re: test-coverage and colorblindness In-Reply-To: <20080911145458.GA28580@cs.brown.edu> References: <20080911041457.GA12539@cs.brown.edu> <20080911145458.GA28580@cs.brown.edu> Message-ID: <932b2f1f0809121501w27e4df2euc54e5a3477e12fc1@mail.gmail.com> Thanks. There is no way to change it, except by editing the source code and recompiling. It is not difficult to do. Around line 1000 in plt/collects/drscheme/private/debug.ss, you'll find the string "firebrick". Replace it with "maroon" and I think things will be better. You should probably run setup-plt after that (but I don't think it is, strictly speaking, necessary). I've made this change in SVN, so it should be better in future versions. Here's a screenshot so you can see how it looks: http://people.cs.uchicago.edu/~robby/tmp/new-colors.png As far as "never ... with only color" goes, that seems too difficult to me. I've tried to instead feed drscheme into various color blindness filters from time to time to see how it looks and tried to work with that. (One problem with the bold suggestion: bold letter are not reliably the same width as their non-bold counterparts, even in so-called 'monospaced' fonts.) Anyways, if those colors aren't good, please let me know! Thanks, Robby On Thu, Sep 11, 2008 at 9:54 AM, Aleks Bromfield wrote: > Note that my email was prompted by an email from a student: > >> I have red-green color blindness and I can't see the color differences >> between the tested and untested lines. Until I read this email carefully, I >> thought that "syntactic test suite coverage" was just broken on my machine. >> >> Can these colors be changed? I didn't see relevant options in a cursory look >> through Preferences. > > ~ Aleks > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From aleks at cs.brown.edu Fri Sep 12 18:04:46 2008 From: aleks at cs.brown.edu (Aleks Bromfield) Date: Thu Mar 26 02:28:15 2009 Subject: [plt-scheme] Re: test-coverage and colorblindness In-Reply-To: <932b2f1f0809121501w27e4df2euc54e5a3477e12fc1@mail.gmail.com> References: <20080911041457.GA12539@cs.brown.edu> <20080911145458.GA28580@cs.brown.edu> <932b2f1f0809121501w27e4df2euc54e5a3477e12fc1@mail.gmail.com> Message-ID: <20080912220446.GB4591@cs.brown.edu> Thanks for the change! Is there a reason the color/style couldn't be made configurable? It looks like there are similar option for Java. ~ Aleks On Fri, Sep 12, 2008 at 05:01:41PM -0500, Robby Findler wrote: > Thanks. There is no way to change it, except by editing the source > code and recompiling. It is not difficult to do. Around line 1000 in > plt/collects/drscheme/private/debug.ss, you'll find the string > "firebrick". Replace it with "maroon" and I think things will be > better. You should probably run setup-plt after that (but I don't > think it is, strictly speaking, necessary). > > I've made this change in SVN, so it should be better in future versions. > > Here's a screenshot so you can see how it looks: > > http://people.cs.uchicago.edu/~robby/tmp/new-colors.png > > As far as "never ... with only color" goes, that seems too difficult > to me. I've tried to instead feed drscheme into various color > blindness filters from time to time to see how it looks and tried to > work with that. (One problem with the bold suggestion: bold letter are > not reliably the same width as their non-bold counterparts, even in > so-called 'monospaced' fonts.) > > Anyways, if those colors aren't good, please let me know! > > Thanks, > Robby > > On Thu, Sep 11, 2008 at 9:54 AM, Aleks Bromfield wrote: > > Note that my email was prompted by an email from a student: > > > >> I have red-green color blindness and I can't see the color differences > >> between the tested and untested lines. Until I read this email carefully, I > >> thought that "syntactic test suite coverage" was just broken on my machine. > >> > >> Can these colors be changed? I didn't see relevant options in a cursory look > >> through Preferences. > > > > ~ Aleks > > > > _________________________________________________ > > For list-related administrative tasks: > > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > > > > From robby at cs.uchicago.edu Fri Sep 12 18:24:58 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:28:15 2009 Subject: [plt-scheme] Re: test-coverage and colorblindness In-Reply-To: <20080912220446.GB4591@cs.brown.edu> References: <20080911041457.GA12539@cs.brown.edu> <20080911145458.GA28580@cs.brown.edu> <932b2f1f0809121501w27e4df2euc54e5a3477e12fc1@mail.gmail.com> <20080912220446.GB4591@cs.brown.edu> Message-ID: <932b2f1f0809121524w58ef72fqfc54b6bfc03c2dcf@mail.gmail.com> Just that its more work. You're welcome to supply a patch (or perhaps a more compelling reason :). On Fri, Sep 12, 2008 at 5:04 PM, Aleks Bromfield wrote: > Thanks for the change! > > Is there a reason the color/style couldn't be made configurable? It > looks like there are similar option for Java. > > ~ Aleks > > On Fri, Sep 12, 2008 at 05:01:41PM -0500, Robby Findler wrote: >> Thanks. There is no way to change it, except by editing the source >> code and recompiling. It is not difficult to do. Around line 1000 in >> plt/collects/drscheme/private/debug.ss, you'll find the string >> "firebrick". Replace it with "maroon" and I think things will be >> better. You should probably run setup-plt after that (but I don't >> think it is, strictly speaking, necessary). >> >> I've made this change in SVN, so it should be better in future versions. >> >> Here's a screenshot so you can see how it looks: >> >> http://people.cs.uchicago.edu/~robby/tmp/new-colors.png >> >> As far as "never ... with only color" goes, that seems too difficult >> to me. I've tried to instead feed drscheme into various color >> blindness filters from time to time to see how it looks and tried to >> work with that. (One problem with the bold suggestion: bold letter are >> not reliably the same width as their non-bold counterparts, even in >> so-called 'monospaced' fonts.) >> >> Anyways, if those colors aren't good, please let me know! >> >> Thanks, >> Robby >> >> On Thu, Sep 11, 2008 at 9:54 AM, Aleks Bromfield wrote: >> > Note that my email was prompted by an email from a student: >> > >> >> I have red-green color blindness and I can't see the color differences >> >> between the tested and untested lines. Until I read this email carefully, I >> >> thought that "syntactic test suite coverage" was just broken on my machine. >> >> >> >> Can these colors be changed? I didn't see relevant options in a cursory look >> >> through Preferences. >> > >> > ~ Aleks >> > >> > _________________________________________________ >> > For list-related administrative tasks: >> > http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > >> > >> > > From danprager at optusnet.com.au Fri Sep 12 19:01:27 2008 From: danprager at optusnet.com.au (danprager@optusnet.com.au) Date: Thu Mar 26 02:28:15 2009 Subject: [plt-scheme] Applying DRY in macros Message-ID: <200809122301.m8CN1SAu003878@mail06.syd.optusnet.com.au> I found a recent tutorial http://willdonnelly.wordpress.com/2008/09/04/a-scheme-syntax-rules-primer/ helpful in starting to come to grips with syntax-rules. It concluded with this example (define-syntax for (syntax-rules (in as) ((for element in list body ...) (map (lambda (element) body ...) list)) ((for list as element body ...) (map (lambda (element) body ...) list)) This left me wondering how to eliminate the repetition -- as per Don't Repeat Yourself (DRY) -- within the macro itself, in this case the repeated template: (map (lambda (element) body ...) list) In the reddit comments about the tutorial http://www.reddit.com/r/programming/comments/710el/a_scheme_syntaxrules_primer/ the following refactoring was suggested (define-syntax for (syntax-rules (in as) ((for element in list body ...) (map (lambda (element) body ...) list)) ((for list as element body ...) (for element in list body ...)))) which does eliminate the template duplication, but repeats the line (for element in list body ...) first as a pattern, then as a template. Can anyone suggest further improvements? * * * What I would _like_ to be able to write is something like: (define-syntax for (syntax-rules-with-**magic** (in as) (**magic** ([template (map (lambda (element) body ...) list)])) ((for element in list body ...) template) ((for element in list body ...) template))) Are constructions like this already possible without further extending the existing macro facilities? If so, how is it done? Or could syntax-rules-with-**magic** (or similar) be easily written? From pivanyi at freemail.hu Fri Sep 12 19:33:55 2008 From: pivanyi at freemail.hu (Ivanyi Peter) Date: Thu Mar 26 02:28:16 2009 Subject: [plt-scheme] Event bug under MS Windows Message-ID: Hi, The program below tries to simulate a tooltip window. If you try it under MS Windows and you move the mouse from top to bottom over the button, you should notice, that it will print repeatedly: enter motion leave It is very strange, as when you move the mouse from bottom to top over the button it prints one 'enter, a lot of motion and one 'leave message. I think this is a bug in MrEd. Can it be fixed? Thanks. Peter Ivanyi --------------------------------------------------------------------------- (module tooltip mzscheme (require (lib "class.ss") (lib "mred.ss" "mred") (lib "framework.ss" "framework")) (define mred-button-tooltip% (class button% (init-field (tooltip-text " ") ) ; this is the timer (define timer #f) ; whether the tooltip window is shown (define shown? #f) ; the tooltip window (define tooltip #f) (define (tooltip:clear) (if timer (begin (send timer stop) (set! timer #f) ) ) (if (and tooltip shown?) (begin (send tooltip show #f) (set! tooltip #f) (set! shown? #f) ) ) ) (define (tooltip:timer) (tooltip:clear) ) (define (tooltip:setup text x y) (let-values (((sx sy) (send this client->screen x y))) (let* ((frame (new frame% (parent #f) (label "") (stretchable-height #f) (stretchable-width #f) (x sx) (y sy) (width 46) (height 17) (border 2) (style '(no-system-menu no-caption no-resize-border float)) ) ) (message (new message% (parent frame) (label text))) ) (set! tooltip frame) (set! timer (new timer% (notify-callback tooltip:timer) (interval 3000) (just-once? #t) )) (send tooltip show #t) (set! shown? #t) ) ) ) (define/override (on-subwindow-event w e) (cond ( (equal? (send e get-event-type) 'leave) (tooltip:clear) ) ( (member (send e get-event-type) '(enter)) (if (not shown?) (tooltip:setup tooltip-text (send e get-x) (send e get-y)) ) ) ) (display (send e get-event-type))(newline) #f ) (super-new) ) ) (define f (new frame% (label "Test"))) (define b (new mred-button-tooltip% (parent f) (label "Hello") (tooltip-text "Button") )) (send f show #t) ) _______________________________________ LEGY?L TE IS KLIKKBR?KER! - Befektet?si alapok online az [origo] klikkbankban! Ne b?zd m?sra a p?nz?gyeidet! Kattints! k?rjen aj?nlatot most!http://www.klikkbank.hu/klikkbroker/index.html From mflatt at cs.utah.edu Fri Sep 12 19:36:03 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:28:16 2009 Subject: [plt-scheme] scheme/class: attaching properties to classes In-Reply-To: <20080912151503.7804F6500A8@mail-svr1.cs.utah.edu> References: <20080912151503.7804F6500A8@mail-svr1.cs.utah.edu> Message-ID: <20080912233604.F35EA6500AF@mail-svr1.cs.utah.edu> At Fri, 12 Sep 2008 09:15:03 -0600, Matthew Flatt wrote: > We should build support for custom writing into the class system (like > for serialization). With the latest in SVN, a class can implement `printable<%>' (which is exported by `scheme/class') and define its `custom-write' and `custom-display' methods to get custom printing. Matthew From jensaxel at soegaard.net Fri Sep 12 19:38:47 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:28:16 2009 Subject: [plt-scheme] Applying DRY in macros In-Reply-To: <200809122301.m8CN1SAu003878@mail06.syd.optusnet.com.au> References: <200809122301.m8CN1SAu003878@mail06.syd.optusnet.com.au> Message-ID: <48CAFD87.9060407@soegaard.net> danprager@optusnet.com.au wrote: > In the reddit comments about the tutorial > > http://www.reddit.com/r/programming/comments/710el/a_scheme_syntaxrules_primer/ > > the following refactoring was suggested > > (define-syntax for > (syntax-rules (in as) > ((for element in list body ...) > (map (lambda (element) > body ...) > list)) > ((for list as element body ...) > (for element in list body ...)))) > > which does eliminate the template duplication, but repeats the line > > (for element in list body ...) > > first as a pattern, then as a template. > > Can anyone suggest further improvements? (define-syntax (for stx) (syntax-case stx () [(for element in/as list body ...) (or (free-identifier=? #'in/as #'in) (free-identifier=? #'in/as #'as)) #'(map (lambda (element) body ...) list)])) -- Jens Axel S?gaard From grettke at acm.org Fri Sep 12 19:50:37 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:16 2009 Subject: [plt-scheme] scheme/class: attaching properties to classes In-Reply-To: <20080912233604.F35EA6500AF@mail-svr1.cs.utah.edu> References: <20080912151503.7804F6500A8@mail-svr1.cs.utah.edu> <20080912233604.F35EA6500AF@mail-svr1.cs.utah.edu> Message-ID: <756daca50809121650y5e1e8d33ud63290c431774c11@mail.gmail.com> > With the latest in SVN, a class can implement `printable<%>' (which is > exported by `scheme/class') and define its `custom-write' and > `custom-display' methods to get custom printing. Nice. From grettke at acm.org Fri Sep 12 20:11:17 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:16 2009 Subject: [plt-scheme] Tables in Scribblings In-Reply-To: <18633.49842.758339.172640@arabic.ccs.neu.edu> References: <18633.33388.482413.962116@arabic.ccs.neu.edu> <18633.34434.777056.63949@arabic.ccs.neu.edu> <18633.35473.615071.463171@arabic.ccs.neu.edu> <756daca50809111627w24a33a61p5a856ad2fe7fc4b1@mail.gmail.com> <20080912003225.3784D6500BC@mail-svr1.cs.utah.edu> <18633.49842.758339.172640@arabic.ccs.neu.edu> Message-ID: <756daca50809121711n53e7ea66p2849b833d798930d@mail.gmail.com> On Thu, Sep 11, 2008 at 8:15 PM, Eli Barzilay wrote: > On Sep 11, Matthew Flatt wrote: >> At Thu, 11 Sep 2008 18:27:49 -0500, "Grant Rettke" wrote: >> > > Can you specify which parts made no sense, and how they can be >> > > improved? >> > >> > I was sort of expecting the documentation to have everything you >> > would need to know to do %80 of your tasks in one or two >> > pages. Instead there is a lot of material, but it isn't obvious >> > (to me) where to look or where to start. I was excited to see >> > Scribble when it came out; but quickly found that I just "didn't >> > get it". I assumed it was too powerful for what I wanted to do >> > with it, which basically amounts to what one wants to do with >> > HTML. The best place I have to figure things out is to look at the >> > source code for the documentation. >> > >> > Sometimes obvious operations seem confusing, so people post about >> > them and knowledgeable folks answer so quickly that I feel like it >> > must be confusing to you guys why people don't get it! :) >> >> I think Eli was asking more specifically about documentation for the >> "@" reader syntax, > > (Yes.) > > >> but your point is well taken. It will take us a while to refine >> Scribble into something that meets our documentation needs, is easy >> to use, and has good documentation for itself. > > One more thing that I want to add: if by "what one wants to do with > HTML" you mean that you want to I was thinking of something like when I went to use Scribble, basically I wanted to know about the HTML equivelant of: - Header Sizes - Font Formatting - Text Structure - How to add special characters like @ I suspect that those features along with things that are already documented compose most of what people use; but lack of understanding of how Scribble was supposed to be used made me feel like someone who understood it would write something up. I wanted to see how things panned out basically. From acowley at seas.upenn.edu Fri Sep 12 20:21:19 2008 From: acowley at seas.upenn.edu (Anthony Cowley) Date: Thu Mar 26 02:28:17 2009 Subject: [plt-scheme] Applying DRY in macros In-Reply-To: <48CAFD87.9060407@soegaard.net> References: <200809122301.m8CN1SAu003878@mail06.syd.optusnet.com.au> <48CAFD87.9060407@soegaard.net> Message-ID: <81addec70809121721y15143fadxdff3a23cb290b3a9@mail.gmail.com> Does that one do the right thing? I thought it would have been phrased more like... (define-syntax (for3 stx) (syntax-case stx () ((for x in/as y body ...) (let-values (((element list) (cond ((free-identifier=? #'in/as #'in) (values #'x #'y)) ((free-identifier=? #'in/as #'as) (values #'y #'x)) (else (error 'for "Invalid syntax"))))) #`(map (lambda (#,element) body ...) #,list))))) Anthony On Fri, Sep 12, 2008 at 7:38 PM, Jens Axel Soegaard wrote: > danprager@optusnet.com.au wrote: > >> In the reddit comments about the tutorial >> >> >> http://www.reddit.com/r/programming/comments/710el/a_scheme_syntaxrules_primer/ >> >> the following refactoring was suggested >> >> (define-syntax for >> (syntax-rules (in as) >> ((for element in list body ...) >> (map (lambda (element) >> body ...) >> list)) >> ((for list as element body ...) >> (for element in list body ...)))) >> >> which does eliminate the template duplication, but repeats the line >> (for element in list body ...) >> >> first as a pattern, then as a template. >> >> Can anyone suggest further improvements? >> > > (define-syntax (for stx) > (syntax-case stx () > [(for element in/as list body ...) > (or (free-identifier=? #'in/as #'in) > (free-identifier=? #'in/as #'as)) > #'(map (lambda (element) body ...) list)])) > > > -- > Jens Axel S?gaard > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080912/a5ac9e36/attachment.html From grettke at acm.org Fri Sep 12 20:38:41 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:17 2009 Subject: [plt-scheme] HtDP: Exercises 7.5.* Message-ID: <756daca50809121738g680f2273qcafea56a60dfe99a@mail.gmail.com> Hi, Was sub-chapter 7.5 a point of contention? I like contracts, but it doesn't feel like it fits. Evidence: * Less than 3 pages * We are encouraged to raise errors, but we haven't got a unit-testing tool to actually check if they were raised. I argued that the goal is to show that we grok how to provide checked versions of our functions to clients, so function documentation and unit tests aren't required here. Best wishes, Grant From mflatt at cs.utah.edu Fri Sep 12 21:18:54 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:28:17 2009 Subject: [plt-scheme] Using previously-defined macros within the "transformer environment" In-Reply-To: References: Message-ID: <20080913011855.907CF650085@mail-svr1.cs.utah.edu> At Fri, 12 Sep 2008 08:28:28 -0700 (PDT), "///" wrote: > I'm using PLT Scheme to write a Web site. In order to make PLT Scheme > more usable (that is, more like Common Lisp), I've been spending some > time writing a few macros. First, I wrote a new version of the > "lambda" form. It's just like the original lambda, except it > understands &OPTIONAL, &KEY, and &REST, like Common Lisp (&KEY is > especially important). It was a first step in porting some of my CL > code over to Scheme. > > Next, I decided to try to write a DEFMACRO form that understands the > same sort of lambda-list. (PLT is generous enough to provide "define- > macro", but macros defined this way can only have Scheme lambda-lists, > and the macros I'm trying to port rely heavily on &KEY-- a simple dot > will not do!) The easiest way to do this would be to use the LAMBDA > macro I previously wrote, so that the macro-expansion invokes the > LAMBDA macro and automatically inherits its lambda-list processing > capabilities. Unfortunately, it turns out that my LAMBDA macro is not > visible in the transformer environment, even though I used (require- > for-syntax cl-lambda) to import the module that defines it. I would > hate to have to copy and paste the source for the LAMBDA form (and all > the local functions it depends on) to get my DEFMACRO form to work, > but at the moment it looks like that's what you have to do to satisfy > the Hygienic Macro System. I tried to solve the problem with Google > (which has helped on countless occasions), but apparently nobody has > ever tried to use one macro to expand another in Scheme. > > Here's what the defmacro macro looks like: > > (define-macro (defmacro name lambda-list . body) > (let* ((rest-arg (gensym)) > (simple-lambda-list (make-simple-lambda-list > (fold-optional-args-into-rest > lambda-list rest-arg)))) > `(define-macro ,(cons name simple-lambda-list) > (apply (cl-lambda ,lambda-list ,@body) > ,(cons-to-rest-arg-if-necessary simple-lambda-list rest- > arg))))) > > "simple-lambda-list" converts a CL lambda-list into a Scheme one > (including that > stupid little dot), while "fold-optional-args-into-rest" removes all > &OPTIONAL and > &KEY arguments and adds a &REST argument to replace them (and also > replaces > any user-provided &REST arguments with its own definition). > (foo bar &optional baz &rest haha) becomes (foo bar &rest g39). > > It expands as expected: (defmacro foobar (x &optional y) > `(list ,x ,y)) expands into: > > (define-macro (foobar x . g73) > (apply (cl-lambda (x &optional y) (quasiquote (list (unquote x) > (unquote y)))) > (cons x g73))) > > However, the above macro can't be expanded any further because: > > reference to undefined identifier: cl-lambda > > I know the problem is caused by the transformer environment because > the cl-lambda form works from the REPL. In fact, if you define x and > g73 in a let form and paste in the definition of the above macro, you > get the expansion that should result from the macro: > > (let ((x 1) > (g73 '(2))) > (apply (cl-lambda (x &optional y) (quasiquote (list (unquote x) > (unquote y)))) > (cons x g73))) > > ==> (list 1 2) > > define-for-syntax allows you to define functions in the transformer > environment, but there is no such thing as define-macro-for-syntax, or > even define-syntax-for-syntax. The PLT Scheme reference manual is > absolutely silent on this issue, except that it seems to suggest > (incorrectly) that require-for-syntax should solve the problem (it > only helps with functions). `require-for-syntax' really is the solution for macros as well as functions. > Has anyone ever done this sort of thing in > Scheme before? A lot, especially in PLT Scheme. > Is it fixed in a later version of PLT Scheme? > > My ISP is using MzScheme 360. Version 4.1 offers many improvements, including better documentation. In particular, the following part of the current PLT Scheme Guide offers an explanation of the problem that you're hitting, along with its solution: http://docs.plt-scheme.org/guide/stx-phases.html In that part of the Guide, the example is a `check-ids' function, but the same line of reasoning applies to a macro like `cl-lambda'. The essential part of the solution is to put the revised `cl-lambda' macro in a module, and then you can use it in run-time expressions by `require'ing the module, and you can use it in compile-time expressions by using `require' with `for-syntax'. It's the same in v360, except that `require' with a `for-syntax' sub-form is written as a `require-for-syntax' form. Matthew From robby at cs.uchicago.edu Fri Sep 12 22:17:40 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:28:17 2009 Subject: [plt-scheme] Using previously-defined macros within the "transformer environment" In-Reply-To: <20080913011855.907CF650085@mail-svr1.cs.utah.edu> References: <20080913011855.907CF650085@mail-svr1.cs.utah.edu> Message-ID: <932b2f1f0809121917l19afab38l3d31dc50ff1b422d@mail.gmail.com> And just in case you weren't aware, v4.1 has keyword, optional, and rest arguments built in. Robby On Fri, Sep 12, 2008 at 8:18 PM, Matthew Flatt wrote: > At Fri, 12 Sep 2008 08:28:28 -0700 (PDT), "///" wrote: >> I'm using PLT Scheme to write a Web site. In order to make PLT Scheme >> more usable (that is, more like Common Lisp), I've been spending some >> time writing a few macros. First, I wrote a new version of the >> "lambda" form. It's just like the original lambda, except it >> understands &OPTIONAL, &KEY, and &REST, like Common Lisp (&KEY is >> especially important). It was a first step in porting some of my CL >> code over to Scheme. >> >> Next, I decided to try to write a DEFMACRO form that understands the >> same sort of lambda-list. (PLT is generous enough to provide "define- >> macro", but macros defined this way can only have Scheme lambda-lists, >> and the macros I'm trying to port rely heavily on &KEY-- a simple dot >> will not do!) The easiest way to do this would be to use the LAMBDA >> macro I previously wrote, so that the macro-expansion invokes the >> LAMBDA macro and automatically inherits its lambda-list processing >> capabilities. Unfortunately, it turns out that my LAMBDA macro is not >> visible in the transformer environment, even though I used (require- >> for-syntax cl-lambda) to import the module that defines it. I would >> hate to have to copy and paste the source for the LAMBDA form (and all >> the local functions it depends on) to get my DEFMACRO form to work, >> but at the moment it looks like that's what you have to do to satisfy >> the Hygienic Macro System. I tried to solve the problem with Google >> (which has helped on countless occasions), but apparently nobody has >> ever tried to use one macro to expand another in Scheme. >> >> Here's what the defmacro macro looks like: >> >> (define-macro (defmacro name lambda-list . body) >> (let* ((rest-arg (gensym)) >> (simple-lambda-list (make-simple-lambda-list >> (fold-optional-args-into-rest >> lambda-list rest-arg)))) >> `(define-macro ,(cons name simple-lambda-list) >> (apply (cl-lambda ,lambda-list ,@body) >> ,(cons-to-rest-arg-if-necessary simple-lambda-list rest- >> arg))))) >> >> "simple-lambda-list" converts a CL lambda-list into a Scheme one >> (including that >> stupid little dot), while "fold-optional-args-into-rest" removes all >> &OPTIONAL and >> &KEY arguments and adds a &REST argument to replace them (and also >> replaces >> any user-provided &REST arguments with its own definition). >> (foo bar &optional baz &rest haha) becomes (foo bar &rest g39). >> >> It expands as expected: (defmacro foobar (x &optional y) >> `(list ,x ,y)) expands into: >> >> (define-macro (foobar x . g73) >> (apply (cl-lambda (x &optional y) (quasiquote (list (unquote x) >> (unquote y)))) >> (cons x g73))) >> >> However, the above macro can't be expanded any further because: >> >> reference to undefined identifier: cl-lambda >> >> I know the problem is caused by the transformer environment because >> the cl-lambda form works from the REPL. In fact, if you define x and >> g73 in a let form and paste in the definition of the above macro, you >> get the expansion that should result from the macro: >> >> (let ((x 1) >> (g73 '(2))) >> (apply (cl-lambda (x &optional y) (quasiquote (list (unquote x) >> (unquote y)))) >> (cons x g73))) >> >> ==> (list 1 2) >> >> define-for-syntax allows you to define functions in the transformer >> environment, but there is no such thing as define-macro-for-syntax, or >> even define-syntax-for-syntax. The PLT Scheme reference manual is >> absolutely silent on this issue, except that it seems to suggest >> (incorrectly) that require-for-syntax should solve the problem (it >> only helps with functions). > > > `require-for-syntax' really is the solution for macros as well as > functions. > > >> Has anyone ever done this sort of thing in >> Scheme before? > > A lot, especially in PLT Scheme. > > >> Is it fixed in a later version of PLT Scheme? >> >> My ISP is using MzScheme 360. > > Version 4.1 offers many improvements, including better documentation. > In particular, the following part of the current PLT Scheme Guide > offers an explanation of the problem that you're hitting, along with > its solution: > > http://docs.plt-scheme.org/guide/stx-phases.html > > In that part of the Guide, the example is a `check-ids' function, but > the same line of reasoning applies to a macro like `cl-lambda'. > > The essential part of the solution is to put the revised `cl-lambda' > macro in a module, and then you can use it in run-time expressions by > `require'ing the module, and you can use it in compile-time expressions > by using `require' with `for-syntax'. > > It's the same in v360, except that `require' with a `for-syntax' > sub-form is written as a `require-for-syntax' form. > > > Matthew > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From jensaxel at soegaard.net Sat Sep 13 07:32:59 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:28:17 2009 Subject: [plt-scheme] Applying DRY in macros In-Reply-To: <81addec70809121721y15143fadxdff3a23cb290b3a9@mail.gmail.com> References: <200809122301.m8CN1SAu003878@mail06.syd.optusnet.com.au> <48CAFD87.9060407@soegaard.net> <81addec70809121721y15143fadxdff3a23cb290b3a9@mail.gmail.com> Message-ID: <48CBA4EB.7080608@soegaard.net> Anthony Cowley skrev: > Does that one do the right thing? I thought it would have been phrased > more like... > > (define-syntax (for3 stx) > (syntax-case stx () > ((for x in/as y body ...) > (let-values (((element list) (cond > ((free-identifier=? #'in/as #'in) > (values #'x #'y)) > ((free-identifier=? #'in/as #'as) > (values #'y #'x)) > (else (error 'for "Invalid > syntax"))))) > #`(map (lambda (#,element) body ...) #,list))))) > Nope, I missed that the fact that the order was reversed. Here is an alternative: (define-syntax (for stx) (define (template var list-expr bodies) #`(map (lambda (#,var) #,@bodies) #,list-expr)) (syntax-case stx (in as) [(for element in list body ...) (template #'element #'list #'(body ...))] [(for list as element body ...) (template #'element #'list #'(body ...))])) -- Jens Axel S?gaard From jos.koot at telefonica.net Sat Sep 13 10:10:39 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:28:18 2009 Subject: [plt-scheme] Replace & Find in v4.1 References: <932b2f1f0808150702t1bbf52f5xdddb6f33287e63a0@mail.gmail.com><5875040B90BF4D49B08B784E31C80395@IBMI> <932b2f1f0809120441o3089707fy4c017c13d841ef29@mail.gmail.com> Message-ID: Very nice indeed. Thanks. Would it be possible to allow return to be entered in the search/replacement line? (as was possible in the old docked search) Now return does "search next" and to enter a return in the search/replacement text I have to copy paste it. May be control/return if you want to maintain the search-next function of the return key. Jos ----- Original Message ----- From: "Robby Findler" To: "PLTScheme List" Sent: Friday, September 12, 2008 1:41 PM Subject: Re: [plt-scheme] Replace & Find in v4.1 > I've made a few changes to the way search works and redone the replace > bit. (The nightly build should contain the changes.) Thanks for your > comments. > > Robby > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From robby at cs.uchicago.edu Sat Sep 13 11:08:00 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:28:18 2009 Subject: [plt-scheme] Replace & Find in v4.1 In-Reply-To: References: <932b2f1f0808150702t1bbf52f5xdddb6f33287e63a0@mail.gmail.com> <5875040B90BF4D49B08B784E31C80395@IBMI> <932b2f1f0809120441o3089707fy4c017c13d841ef29@mail.gmail.com> Message-ID: <932b2f1f0809130808x535092b5w881bee3bd9e58fb5@mail.gmail.com> Thanks. Believe it or not, return-as-search was one of the most requested changes to the old one. :) Anyways, I've mapping control-return and alt-return to actually insert a newline into the editor. Robby On Sat, Sep 13, 2008 at 9:10 AM, Jos Koot wrote: > Very nice indeed. Thanks. > Would it be possible to allow return to be entered in the search/replacement > line? (as was possible in the old docked search) Now return does "search > next" and to enter a return in the search/replacement text I have to copy > paste it. May be control/return if you want to maintain the search-next > function of the return key. > Jos > > ----- Original Message ----- From: "Robby Findler" > To: "PLTScheme List" > Sent: Friday, September 12, 2008 1:41 PM > Subject: Re: [plt-scheme] Replace & Find in v4.1 > > >> I've made a few changes to the way search works and redone the replace >> bit. (The nightly build should contain the changes.) Thanks for your >> comments. >> >> Robby >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > > > From marek at xivilization.net Sat Sep 13 11:34:23 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:28:18 2009 Subject: [plt-scheme] PLT search plugin Message-ID: <20080913173423.32b933e4@halmanfloyd.lan.local> Hi! I just created a PLT Search plugin for browsers, see . If would be nice if the PLT docs could provide a link to it (either directly a install-link or a link for OpenSearch autodiscovery), as described here: so other people could find it too. regards, Marek From robby at cs.uchicago.edu Sat Sep 13 11:39:14 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:28:18 2009 Subject: [plt-scheme] PLT search plugin In-Reply-To: <20080913173423.32b933e4@halmanfloyd.lan.local> References: <20080913173423.32b933e4@halmanfloyd.lan.local> Message-ID: <932b2f1f0809130839v2b64572ey216f6df72ba38b93@mail.gmail.com> Neat! Do you know if there is a way, via the keyboard, to switch between google and searching plt? Or perhaps a way to get two search bars up there? Robby On Sat, Sep 13, 2008 at 10:34 AM, Marek Kubica wrote: > Hi! > > I just created a PLT Search plugin for browsers, see > . > > If would be nice if the PLT docs could provide a link to it (either > directly a install-link or a link for OpenSearch autodiscovery), as > described here: so > other people could find it too. > > regards, > Marek > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From jos.koot at telefonica.net Sat Sep 13 11:43:52 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:28:18 2009 Subject: [plt-scheme] Replace & Find in v4.1 References: <932b2f1f0808150702t1bbf52f5xdddb6f33287e63a0@mail.gmail.com> <5875040B90BF4D49B08B784E31C80395@IBMI> <932b2f1f0809120441o3089707fy4c017c13d841ef29@mail.gmail.com> <932b2f1f0809130808x535092b5w881bee3bd9e58fb5@mail.gmail.com> Message-ID: <8748F95EFDB049DEB129038B23E5D410@uw2b2dff239c4d> I believe you. Therefore a very strong THANKS INDEED! Jos ----- Original Message ----- From: "Robby Findler" To: "Jos Koot" Cc: "PLTScheme List" Sent: Saturday, September 13, 2008 5:08 PM Subject: Re: [plt-scheme] Replace & Find in v4.1 > Thanks. > > Believe it or not, return-as-search was one of the most requested > changes to the old one. :) > > Anyways, I've mapping control-return and alt-return to actually insert > a newline into the editor. > > Robby > > On Sat, Sep 13, 2008 at 9:10 AM, Jos Koot wrote: >> Very nice indeed. Thanks. >> Would it be possible to allow return to be entered in the >> search/replacement >> line? (as was possible in the old docked search) Now return does "search >> next" and to enter a return in the search/replacement text I have to copy >> paste it. May be control/return if you want to maintain the search-next >> function of the return key. >> Jos >> >> ----- Original Message ----- From: "Robby Findler" >> >> To: "PLTScheme List" >> Sent: Friday, September 12, 2008 1:41 PM >> Subject: Re: [plt-scheme] Replace & Find in v4.1 >> >> >>> I've made a few changes to the way search works and redone the replace >>> bit. (The nightly build should contain the changes.) Thanks for your >>> comments. >>> >>> Robby >>> _________________________________________________ >>> For list-related administrative tasks: >>> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >>> >> >> >> > From marek at xivilization.net Sat Sep 13 11:51:27 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:28:19 2009 Subject: [plt-scheme] PLT search plugin In-Reply-To: <932b2f1f0809130839v2b64572ey216f6df72ba38b93@mail.gmail.com> References: <20080913173423.32b933e4@halmanfloyd.lan.local> <932b2f1f0809130839v2b64572ey216f6df72ba38b93@mail.gmail.com> Message-ID: <20080913175127.06024b96@halmanfloyd.lan.local> On Sat, 13 Sep 2008 10:39:14 -0500 "Robby Findler" wrote: > Do you know if there is a way, via the keyboard, to switch between > google and searching plt? Or perhaps a way to get two search bars up > there? When you are in the the search bar (Ctrl-K) you can cycle the search engines via Ctrl-Up and Down. If you order them so that PLT comes after Google (or before Google! :) you can switch quite easily. Two search bars are getting harder, the best thing I have found was the Second Search extension: regards, Marek From robby at cs.uchicago.edu Sat Sep 13 11:56:44 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:28:19 2009 Subject: [plt-scheme] PLT search plugin In-Reply-To: <20080913175127.06024b96@halmanfloyd.lan.local> References: <20080913173423.32b933e4@halmanfloyd.lan.local> <932b2f1f0809130839v2b64572ey216f6df72ba38b93@mail.gmail.com> <20080913175127.06024b96@halmanfloyd.lan.local> Message-ID: <932b2f1f0809130856w66df887gf1ea548900011a32@mail.gmail.com> Thanks! (On the mac, it is command and the arrow keys and alt-arrow-keys pops up a menu, apparently) Robby On Sat, Sep 13, 2008 at 10:51 AM, Marek Kubica wrote: > On Sat, 13 Sep 2008 10:39:14 -0500 > "Robby Findler" wrote: > >> Do you know if there is a way, via the keyboard, to switch between >> google and searching plt? Or perhaps a way to get two search bars up >> there? > > When you are in the the search bar (Ctrl-K) you can cycle the search > engines via Ctrl-Up and Down. If you order them so that PLT comes after > Google (or before Google! :) you can switch quite easily. > > Two search bars are getting harder, the best thing I have found was > the Second Search extension: > > > regards, > Marek > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From robby at cs.uchicago.edu Sat Sep 13 11:58:52 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:28:19 2009 Subject: [plt-scheme] PLT search plugin In-Reply-To: <932b2f1f0809130856w66df887gf1ea548900011a32@mail.gmail.com> References: <20080913173423.32b933e4@halmanfloyd.lan.local> <932b2f1f0809130839v2b64572ey216f6df72ba38b93@mail.gmail.com> <20080913175127.06024b96@halmanfloyd.lan.local> <932b2f1f0809130856w66df887gf1ea548900011a32@mail.gmail.com> Message-ID: <932b2f1f0809130858o330c4913o8c65cf202bff30c0@mail.gmail.com> It also looks like one can add the keyword "plt" to the search and then typing "plt whatever" in the address bar searches for "whatever" in the plt docs. Robby On Sat, Sep 13, 2008 at 10:56 AM, Robby Findler wrote: > Thanks! > > (On the mac, it is command and the arrow keys and alt-arrow-keys pops > up a menu, apparently) > > Robby > > On Sat, Sep 13, 2008 at 10:51 AM, Marek Kubica wrote: >> On Sat, 13 Sep 2008 10:39:14 -0500 >> "Robby Findler" wrote: >> >>> Do you know if there is a way, via the keyboard, to switch between >>> google and searching plt? Or perhaps a way to get two search bars up >>> there? >> >> When you are in the the search bar (Ctrl-K) you can cycle the search >> engines via Ctrl-Up and Down. If you order them so that PLT comes after >> Google (or before Google! :) you can switch quite easily. >> >> Two search bars are getting harder, the best thing I have found was >> the Second Search extension: >> >> >> regards, >> Marek >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> >> > From grettke at acm.org Sat Sep 13 12:08:21 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:19 2009 Subject: [plt-scheme] PLT search plugin In-Reply-To: <20080913173423.32b933e4@halmanfloyd.lan.local> References: <20080913173423.32b933e4@halmanfloyd.lan.local> Message-ID: <756daca50809130908i6ea8b450h88e7e6d8302e460f@mail.gmail.com> > I just created a PLT Search plugin for browsers, see > . Very neat! From toddobryan at gmail.com Sat Sep 13 12:23:48 2008 From: toddobryan at gmail.com (Todd O'Bryan) Date: Thu Mar 26 02:28:20 2009 Subject: [plt-scheme] HtDP: Exercises 7.5.* In-Reply-To: <904774730809130923n7bd7886ai55364710e2661d77@mail.gmail.com> References: <756daca50809121738g680f2273qcafea56a60dfe99a@mail.gmail.com> <904774730809130923n7bd7886ai55364710e2661d77@mail.gmail.com> Message-ID: <904774730809130923q6633d3a1ob539dbe20614329e@mail.gmail.com> Realize that the book is 5 years behind the latest tools, so you'll find some inconsistencies and weirdness. You can check that errors are thrown by using the (check-error ...) version of test cases. Here's a working example: (define (blah x) (error 'blah "undefined")) (check-error (blah 5) "blah: undefined") Todd On Fri, Sep 12, 2008 at 8:38 PM, Grant Rettke wrote: > Hi, > > Was sub-chapter 7.5 a point of contention? > > I like contracts, but it doesn't feel like it fits. > > Evidence: > * Less than 3 pages > * We are encouraged to raise errors, but we haven't got a unit-testing > tool to actually check if they were raised. > > I argued that the goal is to show that we grok how to provide checked > versions of our functions to clients, so function documentation and > unit tests aren't required here. > > Best wishes, > > Grant > _________________________________________________ > 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/20080913/112c5064/attachment.htm From dherman at ccs.neu.edu Sat Sep 13 14:06:58 2008 From: dherman at ccs.neu.edu (Dave Herman) Date: Thu Mar 26 02:28:20 2009 Subject: [plt-scheme] awesome Message-ID: <48CC0142.1080305@ccs.neu.edu> I'm still learning & discovering the details of the new search/replace but I just now noticed that Ctrl-F is its own "inverse," i.e. that if you go to the search bar with Ctrl-F and then you want to return the focus to where it was before, you can just hit Ctrl-F a second time. Similarly, closing the search bar (e.g. by hitting Esc) sends the focus back to where it was before. This is hands-down my favorite new development. Thanks Robby!! Dave From danprager at optusnet.com.au Sat Sep 13 17:35:38 2008 From: danprager at optusnet.com.au (danprager@optusnet.com.au) Date: Thu Mar 26 02:28:20 2009 Subject: [plt-scheme] Applying DRY in macros Message-ID: <200809132135.m8DLZc2F026508@mail08.syd.optusnet.com.au> Thanks Jens. I was wondering whether syntax-case -- which I haven't yet come to grips with -- might hold some clues to writing macros more briefly and clearly, so your rewrite is welcome: > Here is an alternative: > > (define-syntax (for stx) > (define (template var list-expr bodies) > #`(map (lambda (#,var) #,@bodies) #,list-expr)) > (syntax-case stx (in as) > [(for element in list body ...) > (template #'element #'list #'(body ...))] > [(for list as element body ...) > (template #'element #'list #'(body ...))])) In this instance, however, it looks to me as if the amount of duplication has remained the same, while the apparent complexity -- #`, #,@, #' -- has increased. Compare with the earlier: (define-syntax for (syntax-rules (in as) ((for element in list body ...) (map (lambda (element) body ...) list)) ((for list as element body ...) (for element in list body ...)))) which I was hoping could be improved on. Thanks again Dan From matthias at ccs.neu.edu Sat Sep 13 16:28:14 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:28:20 2009 Subject: [plt-scheme] HTDP: Question on 7.4.4 In-Reply-To: <756daca50809112058u5c53e5e7n956e0ef5f671d2bd@mail.gmail.com> References: <756daca50809112058u5c53e5e7n956e0ef5f671d2bd@mail.gmail.com> Message-ID: <73CF8F78-3FED-4B95-B0FC-0D93A9DFC80C@ccs.neu.edu> You are. My rule tends to be this. If I use the data definitions Shape is one of: Circle Rectangle Circle is ... Rectangle is ... then I design three area functions. If I use the following, however, Shape is one of: -- (make-circle ...) -- (make-rectangle ...) I in-line things. On Sep 11, 2008, at 11:58 PM, Grant Rettke wrote: > Hi, > > In 7.4.4, in each of the cond clauses I've got the question and answer > "all there". In other words, I didn't break out clear-circle and > clear-rectangle into separate functions. Since their bodies are tiny, > I didn't see the point. > > One of my friends working through HTDP countered saying "Follow the > advice of the book; break out complex code into separate functions." > He didn't say it yet either, but I bet he'll say that it is easier to > unit test, too. > > I feel like conceptually, I don't want to expose those because I > followed the approach of exposing the clear-shape function "function > per class approach" versus using a bunch of individual functions, the > "function per sub-type approach". > > Perhaps I am over-thinking this at this point. > > Best wishes, > > Grant > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From matthias at ccs.neu.edu Sat Sep 13 16:34:22 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:28:20 2009 Subject: [plt-scheme] HtDP: Exercises 7.5.* In-Reply-To: <756daca50809121738g680f2273qcafea56a60dfe99a@mail.gmail.com> References: <756daca50809121738g680f2273qcafea56a60dfe99a@mail.gmail.com> Message-ID: <41036AF3-A7D2-435E-9A1B-73A33DD30299@ccs.neu.edu> On Sep 12, 2008, at 8:38 PM, Grant Rettke wrote: > Hi, > > Was sub-chapter 7.5 a point of contention? There is never any contention. > I like contracts, but it doesn't feel like it fits. > > Evidence: > * Less than 3 pages > * We are encouraged to raise errors, but we haven't got a unit-testing > tool to actually check if they were raised. > > I argued that the goal is to show that we grok how to provide checked > versions of our functions to clients, so function documentation and > unit tests aren't required here. > Yes. -- Matthias > Best wishes, > > Grant > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From noelwelsh at gmail.com Sat Sep 13 18:02:06 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:28:20 2009 Subject: [plt-scheme] Applying DRY in macros In-Reply-To: <200809132135.m8DLZc2F026508@mail08.syd.optusnet.com.au> References: <200809132135.m8DLZc2F026508@mail08.syd.optusnet.com.au> Message-ID: On Sat, Sep 13, 2008 at 10:35 PM, wrote: > > In this instance, however, it looks to me as if the amount of duplication has remained the same, while the apparent complexity -- #`, #,@, #' -- has increased. Compare with the earlier: > > (define-syntax for > (syntax-rules (in as) > ((for element in list body ...) > (map (lambda (element) > body ...) > list)) > ((for list as element body ...) > (for element in list body ...)))) > > which I was hoping could be improved on. The above is how I'd write it; you can't have an "OR" in a pattern in syntax-rules or syntax-case. I imagine this is to remove ambiguity in the parser. But, there is a better way: apply DRY to the macro specification, remove one of the choices, and the problem goes away. :) N. N. From jensaxel at soegaard.net Sat Sep 13 18:26:04 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:28:21 2009 Subject: [plt-scheme] Applying DRY in macros In-Reply-To: <200809132135.m8DLZc2F026508@mail08.syd.optusnet.com.au> References: <200809132135.m8DLZc2F026508@mail08.syd.optusnet.com.au> Message-ID: <48CC3DFC.1020104@soegaard.net> danprager@optusnet.com.au wrote: > Thanks Jens. I was wondering whether syntax-case -- which I haven't yet come to grips with -- might hold some clues to writing macros more briefly and clearly, so your rewrite is welcome: > > >> Here is an alternative: >> >> (define-syntax (for stx) >> (define (template var list-expr bodies) >> #`(map (lambda (#,var) #,@bodies) #,list-expr)) >> (syntax-case stx (in as) >> [(for element in list body ...) >> (template #'element #'list #'(body ...))] >> [(for list as element body ...) >> (template #'element #'list #'(body ...))])) >> > > In this instance, however, it looks to me as if the amount of duplication has remained the same, The game as I understood it, was to write the macro with the use of only one template. In the solution above the only template is #`(map (lambda (#,var) #,@bodies) #,list-expr) . > while the apparent complexity -- #`, #,@, #' -- has increased. My solution was meant to illustrate how to implement your magic syntax-rules solution. Therefore you should compare agains that. > Compare with the earlier: > > (define-syntax for > (syntax-rules (in as) > ((for element in list body ...) > (map (lambda (element) > body ...) > list)) > ((for list as element body ...) > (for element in list body ...)))) > > which I was hoping could be improved on. > And later you asked: > What I would _like_ to be able to write is something like: > (define-syntax for > (syntax-rules-with-**magic** (in as) > (**magic** ([template > (map (lambda (element) > body ...) > list)])) > ((for element in list body ...) template) > ((for element in list body ...) template))) so my solution should be seen as an implementation of the magic solution. Let's examine the magic solution, and imagine the syntax expander must expand (for x in (list 1 2 3) (display x)). First the expander compares the for-expression agains the patterns on the left hand side, until it finds a match. Then it binds the pattern variables with the pieces of syntax they matched in the for-expression. In this case element is bound to x, and body ... is bound to (display x). In a normal syntax-rules expander the righthand side must be a template. The expander would therefore substitute occurences of the pattern variables element and body ... in the template. In the magic syntax-rules solution the righthand side is a "template variable" bound to the template (map (lambda (element) body ...). Thus some mechanism is needed to lookup template. Also since the definition of template happens before the pattern variables come into scope, there need to be a way to transfer the values of the pattern variables in order to make the substitution. I now claim that the syntax-case solution implements the what the magic solution does. The difference is that the transfer is explicit. A function called template is to used to transfer the values of the pattern variables and make the substitution. The function receives the values of the pattern variables and perform the substitution: (define (template var list-expr bodies) #`(map (lambda (#,var) #,@bodies) #,list-expr)) If you prefer one can avoid the line noise and use with-syntax (The difference is purely cosmetic though). (define (template var list-expr bodies) (with-syntax ([var var] [list-expr list-expr] [(body ...) bodies]) (syntax (map (lambda (var) body ...) list-expr))) Then in the righthand side in the syntax-case macro (syntax-case stx (in as) [(for element in list body ...) (template #'element #'list #'(body ...))] nothing happens but the transferal of the values of the pattern variables. The lookup of the "template variable" template is replace with a normal lookup of a function. Conclusion: It wouldn't be too difficult to implement the magic-syntax-rules. But back to this: (define-syntax for (syntax-rules (in as) ((for element in list body ...) (map (lambda (element) body ...) list)) ((for list as element body ...) (for element in list body ...)))) I don't consider the two occurences of (for element in list body ...) for duplication of code. The first occurrence defines what (for element in list body ...) means. Thus the first occurence does not count as a use of a for-expression. The second occurence is a use of the new language constract Compare the situation with the definition of a recursive function: (define (loop n) (display "*") (loop n)) Here (loop n) isn't duplicated code. The first (loop n) defines what the function loop. The second is a use of the newly defined function. -- Jens Axel S?gaard From grettke at acm.org Sat Sep 13 18:46:45 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:21 2009 Subject: [plt-scheme] HTDP: 9.5.5 Message-ID: <756daca50809131546j662a4c16yed969de3ad4d7057@mail.gmail.com> Hi, I'm working on the 'convert' function in 9.5.5. Reading the problem description, and then jotting out how I would solve this problem by hand, I ended up with something like this (assuming the list of numbers were 3 digits long) Add up --------- n1 * 10^(3-3) n2 * 10^(3-2) n3 * 10^(3-1) To get the answer. The only problem with that to implement it would require an accumulator (the original length of the list, and the current step, which are used to determine the exponent of 10). The only problem with this is that this concept hasn't been introduced yet. Am I reading the problem right? Based on the fact that the "The first digit is the least significant, and so on." then I assume this to be true: (check-expect (convert empty) 0) (check-expect (convert (cons 1 empty)) 1) (check-expect (convert (cons 0 (cons 1 empty))) 10) (check-expect (convert (cons 0 (cons 0 (cons 1 empty)))) 100) If the first digit were the *most* significant digit, though, I could implement the solution to this function using this approach: Add up --------- n1 * (10^(length of the rest of the numbers in the list)) n2 * (10^(length of the rest of the numbers in the list)) n3 * (10^(length of the rest of the numbers in the list)) I'm confused by this one. Best wishes, Grant From robby at cs.uchicago.edu Sat Sep 13 18:46:54 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:28:21 2009 Subject: [plt-scheme] contracts & coercing Message-ID: <932b2f1f0809131546h5c0e9807p360abde92a5dd76b@mail.gmail.com> I've cleaned up and extended the code that coerced non-contracts to contracts. It used to be that only predicates were turned into contracts automatically, but now symbols, booleans, regular expressions and a bunch of other things can all be used directly as contracts (all of them just use an appropriate equality predicate to compare the contract value to the value that shows up, except regexps which accept strings & bytess and match their inputs -- see coerce-contract in the docs for details). If there are other values that are natural contracts that I've missed, please let me know. Also, if you're writing contract combinators, use coerce-contract (or one of its new friends) on your combinator's arguments. (Also the nightly builds don't yet have this, but will tomorrow, I expect.) Robby From jensaxel at soegaard.net Sat Sep 13 18:57:19 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:28:21 2009 Subject: [plt-scheme] HTDP: 9.5.5 In-Reply-To: <756daca50809131546j662a4c16yed969de3ad4d7057@mail.gmail.com> References: <756daca50809131546j662a4c16yed969de3ad4d7057@mail.gmail.com> Message-ID: <48CC454F.2060600@soegaard.net> Grant Rettke skrev: > Hi, > > I'm working on the 'convert' function in 9.5.5. Reading the problem > description, and then jotting out how I would solve this problem by > hand, I ended up with something like this (assuming the list of > numbers were 3 digits long) > > Think recursively: 1234 = 4 + 10*123 -- Jens Axel S?gaard From grettke at acm.org Sat Sep 13 19:33:16 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:21 2009 Subject: [plt-scheme] HTDP: 9.5.5 In-Reply-To: <48CC454F.2060600@soegaard.net> References: <756daca50809131546j662a4c16yed969de3ad4d7057@mail.gmail.com> <48CC454F.2060600@soegaard.net> Message-ID: <756daca50809131633l317506eeod70fa58bb303925e@mail.gmail.com> On Sat, Sep 13, 2008 at 5:57 PM, Jens Axel Soegaard wrote: > Think recursively: > > 1234 = 4 + 10*123 I see! Thanks Jens. From matthias at ccs.neu.edu Sat Sep 13 19:43:10 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:28:21 2009 Subject: [plt-scheme] HTDP: 9.5.5 In-Reply-To: <756daca50809131633l317506eeod70fa58bb303925e@mail.gmail.com> References: <756daca50809131546j662a4c16yed969de3ad4d7057@mail.gmail.com> <48CC454F.2060600@soegaard.net> <756daca50809131633l317506eeod70fa58bb303925e@mail.gmail.com> Message-ID: <11C1B73E-6826-42D0-B71F-14690EAB59DF@ccs.neu.edu> Now discover Jens's hint by following the design recipe. On Sep 13, 2008, at 7:33 PM, Grant Rettke wrote: > On Sat, Sep 13, 2008 at 5:57 PM, Jens Axel Soegaard > wrote: >> Think recursively: >> >> 1234 = 4 + 10*123 > > I see! Thanks Jens. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From marek at xivilization.net Sat Sep 13 20:19:58 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:28:22 2009 Subject: [plt-scheme] Square braces in MrEd Message-ID: <20080914021958.463b6bbc@halmanfloyd.lan.local> Hi, I'm still in the middle of writing my first non-trivial Scheme programs but I am a bit confused at this point. The PLT documentation sometimes uses [ square braces ] in the code (e.g. command-line) whereas MrEd only lets me enter ( parentheses ). It looks like they are doing just the same - that's why I ask what the difference between them is and what to use. regards, Marek P.S.: It would be nice, if the COMMAND-LINE example would show also setting a value to a flag instead of just #t. It took me a bit of time to figure out that there can be an optional id specified. Otherwise the example is very helpful. From matthias at ccs.neu.edu Sat Sep 13 21:12:52 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:28:22 2009 Subject: [plt-scheme] Square braces in MrEd In-Reply-To: <20080914021958.463b6bbc@halmanfloyd.lan.local> References: <20080914021958.463b6bbc@halmanfloyd.lan.local> Message-ID: <1988E500-291A-43A2-801C-6484108DD0A0@ccs.neu.edu> On Sep 13, 2008, at 8:19 PM, Marek Kubica wrote: > Hi, > > I'm still in the middle of writing my first non-trivial Scheme > programs > but I am a bit confused at this point. The PLT documentation sometimes > uses [ square braces ] in the code (e.g. command-line) whereas MrEd > only lets me enter ( parentheses ). It looks like they are doing just > the same - that's why I ask what the difference between them is and > what to use. Convention. Good convention. -- Matthias From toddobryan at gmail.com Sat Sep 13 22:34:03 2008 From: toddobryan at gmail.com (Todd O'Bryan) Date: Thu Mar 26 02:28:22 2009 Subject: [plt-scheme] HTDP: 9.5.5 In-Reply-To: <11C1B73E-6826-42D0-B71F-14690EAB59DF@ccs.neu.edu> References: <756daca50809131546j662a4c16yed969de3ad4d7057@mail.gmail.com> <48CC454F.2060600@soegaard.net> <756daca50809131633l317506eeod70fa58bb303925e@mail.gmail.com> <11C1B73E-6826-42D0-B71F-14690EAB59DF@ccs.neu.edu> Message-ID: <904774730809131934r3f7ce6f4vc6db904493b915fd@mail.gmail.com> That's the absolutely essential part! Let's look at the template for a list-of-number function: ;; lon-fun: list-of-number -> ? ;; ? (define (lon-fun alon) (cond [(empty? alon) ] [(cons? alon) (first alon) (lon-fun (rest alon)])) Now replace lon-fun with convert: ;; convert: list-of-number -> number ;; consumes a list of digits from least to most significant ;; produces the corresponding number (define (convert alon) (cond [(empty? alon) ] [(cons? alon) (first alon) (convert (rest alon)])) (check-expect (convert (cons 4 (cons 3 (cons 2 (cons 1 empty))))) 1234) The template itself gives you two pieces when the list is non-empty, the first element and the function called on the rest of the list. In this example, you get 4 and 123. Your job is to figure out how to combine those two pieces together to get the answer you desire. That's the key point that I constantly push with my students. The shape of the data encourages a particular shape for the functions that manipulate the data. The shape of the function already does much of the work for you. Your job is to look at what you get "for free" and figure out how to massage it to get what you want. HTH, Todd On Sat, Sep 13, 2008 at 7:43 PM, Matthias Felleisen wrote: > > Now discover Jens's hint by following the design recipe. > > > On Sep 13, 2008, at 7:33 PM, Grant Rettke wrote: > >> On Sat, Sep 13, 2008 at 5:57 PM, Jens Axel Soegaard >> wrote: >>> >>> Think recursively: >>> >>> 1234 = 4 + 10*123 >> >> I see! Thanks Jens. >> _________________________________________________ >> 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 Sat Sep 13 22:55:27 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:22 2009 Subject: [plt-scheme] HTDP: Question on 7.4.4 In-Reply-To: <73CF8F78-3FED-4B95-B0FC-0D93A9DFC80C@ccs.neu.edu> References: <756daca50809112058u5c53e5e7n956e0ef5f671d2bd@mail.gmail.com> <73CF8F78-3FED-4B95-B0FC-0D93A9DFC80C@ccs.neu.edu> Message-ID: <756daca50809131955w31792be1m76f330141698fa81@mail.gmail.com> > If I use the data definitions > If I use the following, however, Figure 19! I like the one on the left. From grettke at acm.org Sat Sep 13 23:06:16 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:22 2009 Subject: [plt-scheme] HTDP: 9.5.5 In-Reply-To: <11C1B73E-6826-42D0-B71F-14690EAB59DF@ccs.neu.edu> References: <756daca50809131546j662a4c16yed969de3ad4d7057@mail.gmail.com> <48CC454F.2060600@soegaard.net> <756daca50809131633l317506eeod70fa58bb303925e@mail.gmail.com> <11C1B73E-6826-42D0-B71F-14690EAB59DF@ccs.neu.edu> Message-ID: <756daca50809132006g73e5857fy91f1cd6ca787975a@mail.gmail.com> > Now discover Jens's hint by following the design recipe. Where did I go wrong? (Here is not where I expect you to be psychic, so let me elaborate) I followed the recipe by defining the recursive data (I re-used list of numbers), created a bunch of tests, walked through the implementation of the body (cond clauses, selector expressions, natural recursion), implemented the answer for the base case (zero), and then was left with: [else ... (first a-list-of-numbers) ... ... (convert (rest a-list-of-numbers) ...)] I think I was too preoccupied with shoe-horning in my approach than looking at the data. What I *didn't* do was to take something one more complex than the base case, like this, which is a test I had written before I implemented the function: (check-expect (convert (cons 1 empty)) 1) That at least would have gotten me to the first part of the equation in the else clause, 1 plus ... Then I would have looked at: (check-expect (convert (cons 0 (cons 1 empty))) 10) and maybe though zero plus something times the 2nd part, and finally plus zero. Is that the thought process, step by step satisfy the test by revising the calculation? You start with the simplest thing from the base condition? My approach thus far has been to write *all* of the tests up front, I was staring at this while I tried to implement the body: (check-expect (convert empty) 0) (check-expect (convert (cons 1 empty)) 1) (check-expect (convert (cons 0 (cons 1 empty))) 10) (check-expect (convert (cons 1 (cons 1 empty))) 11) (check-expect (convert (cons 0 (cons 0 (cons 1 empty)))) 100) (check-expect (convert (cons 1 (cons 1 (cons 1 empty)))) 111) This was a point where I totally didn't understand it and I felt like the recipe wasn't taking me there, which I was I posted a long-ish email. Please point me in the right direction to get back on track with what I missed from the recipe. From robby at cs.uchicago.edu Sat Sep 13 23:35:48 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:28:23 2009 Subject: [plt-scheme] HTDP: 9.5.5 In-Reply-To: <756daca50809132006g73e5857fy91f1cd6ca787975a@mail.gmail.com> References: <756daca50809131546j662a4c16yed969de3ad4d7057@mail.gmail.com> <48CC454F.2060600@soegaard.net> <756daca50809131633l317506eeod70fa58bb303925e@mail.gmail.com> <11C1B73E-6826-42D0-B71F-14690EAB59DF@ccs.neu.edu> <756daca50809132006g73e5857fy91f1cd6ca787975a@mail.gmail.com> Message-ID: <932b2f1f0809132035h23603e6bh1a275ed4e94db7d@mail.gmail.com> You're definitely right that looking carefully at examples and figuring out what particular pieces of the template work out to be for those examples, and then working from those pieces to the whole is an important skill to learn (and part of what Matthias meant when he said that examples are critical). Robby On Sat, Sep 13, 2008 at 10:06 PM, Grant Rettke wrote: >> Now discover Jens's hint by following the design recipe. > > Where did I go wrong? (Here is not where I expect you to be psychic, > so let me elaborate) > > I followed the recipe by defining the recursive data (I re-used list > of numbers), created a bunch of tests, walked through the > implementation of the body (cond clauses, selector expressions, > natural recursion), implemented the answer for the base case (zero), > and then was left with: > > [else > ... (first a-list-of-numbers) ... > ... (convert (rest a-list-of-numbers) ...)] > > I think I was too preoccupied with shoe-horning in my approach than > looking at the data. What I *didn't* do was to take something one more > complex than the base case, like this, which is a test I had written > before I implemented the function: > > (check-expect (convert (cons 1 empty)) 1) > > That at least would have gotten me to the first part of the equation > in the else clause, 1 plus ... > > Then I would have looked at: > > (check-expect (convert (cons 0 (cons 1 empty))) 10) > > and maybe though zero plus something times the 2nd part, and finally plus zero. > > Is that the thought process, step by step satisfy the test by revising > the calculation? You start with the simplest thing from the base > condition? > > My approach thus far has been to write *all* of the tests up front, I > was staring at this while I tried to implement the body: > > (check-expect (convert empty) 0) > (check-expect (convert (cons 1 empty)) 1) > (check-expect (convert (cons 0 (cons 1 empty))) 10) > (check-expect (convert (cons 1 (cons 1 empty))) 11) > (check-expect (convert (cons 0 (cons 0 (cons 1 empty)))) 100) > (check-expect (convert (cons 1 (cons 1 (cons 1 empty)))) 111) > > This was a point where I totally didn't understand it and I felt like > the recipe wasn't taking me there, which I was I posted a long-ish > email. > > Please point me in the right direction to get back on track with what > I missed from the recipe. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From diggerrrrr at gmail.com Sun Sep 14 03:35:37 2008 From: diggerrrrr at gmail.com (Veer) Date: Thu Mar 26 02:28:23 2009 Subject: [plt-scheme] HTDP: 9.5.5 In-Reply-To: <756daca50809132006g73e5857fy91f1cd6ca787975a@mail.gmail.com> References: <756daca50809131546j662a4c16yed969de3ad4d7057@mail.gmail.com> <48CC454F.2060600@soegaard.net> <756daca50809131633l317506eeod70fa58bb303925e@mail.gmail.com> <11C1B73E-6826-42D0-B71F-14690EAB59DF@ccs.neu.edu> <756daca50809132006g73e5857fy91f1cd6ca787975a@mail.gmail.com> Message-ID: I think this is a problem of understanding recursion than anything else. It took me while to understand recursion. When i was stuck , Matthias wrote this (i am substituting 'arrangements' with 'convert') : [quote] When you go from templates to definitions, read out the PURPOSE statement for the recursive template expression: ;;(convert a-list) produce the number that can be formed from all ;; digits in a-list. ;; (convert (rest a-list)) therefore produces the number that can be formed ;; from all the digits in the rest of a-list (What does this mean for a concrete example? Use the examples!!) And then ask yourself how a primitive or a helper function can use this and the rest of the template (line) to get the real result.. [unquote] For example: ;;(convert a-list) (convert (cons 1 (cons 2 (cons 3 empty))) produces what ;;(convert (rest a-list)) (convert (cons 2 (cons 3 empty))) produces what So does this help? On 9/14/08, Grant Rettke wrote: >> Now discover Jens's hint by following the design recipe. > > Where did I go wrong? (Here is not where I expect you to be psychic, > so let me elaborate) > > I followed the recipe by defining the recursive data (I re-used list > of numbers), created a bunch of tests, walked through the > implementation of the body (cond clauses, selector expressions, > natural recursion), implemented the answer for the base case (zero), > and then was left with: > > [else > ... (first a-list-of-numbers) ... > ... (convert (rest a-list-of-numbers) ...)] > > I think I was too preoccupied with shoe-horning in my approach than > looking at the data. What I *didn't* do was to take something one more > complex than the base case, like this, which is a test I had written > before I implemented the function: > > (check-expect (convert (cons 1 empty)) 1) > > That at least would have gotten me to the first part of the equation > in the else clause, 1 plus ... > > Then I would have looked at: > > (check-expect (convert (cons 0 (cons 1 empty))) 10) > > and maybe though zero plus something times the 2nd part, and finally plus > zero. > > Is that the thought process, step by step satisfy the test by revising > the calculation? You start with the simplest thing from the base > condition? > > My approach thus far has been to write *all* of the tests up front, I > was staring at this while I tried to implement the body: > > (check-expect (convert empty) 0) > (check-expect (convert (cons 1 empty)) 1) > (check-expect (convert (cons 0 (cons 1 empty))) 10) > (check-expect (convert (cons 1 (cons 1 empty))) 11) > (check-expect (convert (cons 0 (cons 0 (cons 1 empty)))) 100) > (check-expect (convert (cons 1 (cons 1 (cons 1 empty)))) 111) > > This was a point where I totally didn't understand it and I felt like > the recipe wasn't taking me there, which I was I posted a long-ish > email. > > Please point me in the right direction to get back on track with what > I missed from the recipe. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From marek at xivilization.net Sun Sep 14 05:54:54 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:28:23 2009 Subject: [plt-scheme] Square braces in MrEd In-Reply-To: <1988E500-291A-43A2-801C-6484108DD0A0@ccs.neu.edu> References: <20080914021958.463b6bbc@halmanfloyd.lan.local> <1988E500-291A-43A2-801C-6484108DD0A0@ccs.neu.edu> Message-ID: <20080914115454.36bba200@halmanfloyd.lan.local> Hi, On Sat, 13 Sep 2008 21:12:52 -0400 Matthias Felleisen wrote: > > I'm still in the middle of writing my first non-trivial Scheme > > programs > > but I am a bit confused at this point. The PLT documentation > > sometimes uses [ square braces ] in the code (e.g. command-line) > > whereas MrEd only lets me enter ( parentheses ). It looks like they > > are doing just the same - that's why I ask what the difference > > between them is and what to use. > > Convention. Good convention. -- Matthias Forgivebe the stupid question, but how to enter [ or ] in MrEd then? Everytime I try, it gets replaced by ( and ). regards, Marek From danprager at optusnet.com.au Sun Sep 14 06:09:22 2008 From: danprager at optusnet.com.au (Dan Prager) Date: Thu Mar 26 02:28:23 2009 Subject: [plt-scheme] Applying DRY in macros References: <200809132135.m8DLZc2F026508@mail08.syd.optusnet.com.au> <48CC3DFC.1020104@soegaard.net> Message-ID: <002001c91651$f66e8510$c701000a@user8x14u15h2h> Noel and especially Jens Thanks for your replies. I agree that Jens's solution succeeds in demonstrating a 'magic' approach using syntax-case, albeit at the cost of increasing complexity. Noel's point that you cannot 'or' patterns in syntax-rules[case] excludes another idea for eliminating the repetition. Another possibility, creating a macro-generating macro to allow for briefer 'magic' definitions or to permit the or-ing patterns are certainly beyond me and I imagine that neither is an easy task. I take it that Jens's comment about 'explicit transfer' in his solution connotes that 'implicit transfer' could not be easily achieved. As to whether the repeated sexp (for list as element body ...) constitutes repetition, I would say that it is certainly a textual duplicate! Thanks again Dan From d.j.gurnell at gmail.com Sun Sep 14 06:22:25 2008 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Thu Mar 26 02:28:23 2009 Subject: [plt-scheme] scheme/class: attaching properties to classes In-Reply-To: <20080912233604.F35EA6500AF@mail-svr1.cs.utah.edu> References: <20080912151503.7804F6500A8@mail-svr1.cs.utah.edu> <20080912233604.F35EA6500AF@mail-svr1.cs.utah.edu> Message-ID: <98AC04B6-D45F-485F-8E8D-6FE1227A0DF5@gmail.com> > With the latest in SVN, a class can implement `printable<%>' (which is > exported by `scheme/class') and define its `custom-write' and > `custom-display' methods to get custom printing. Excellent, thanks! -- Dave From d.j.gurnell at gmail.com Sun Sep 14 06:31:03 2008 From: d.j.gurnell at gmail.com (Dave Gurnell) Date: Thu Mar 26 02:28:23 2009 Subject: [plt-scheme] Square braces in MrEd In-Reply-To: <20080914115454.36bba200@halmanfloyd.lan.local> References: <20080914021958.463b6bbc@halmanfloyd.lan.local> <1988E500-291A-43A2-801C-6484108DD0A0@ccs.neu.edu> <20080914115454.36bba200@halmanfloyd.lan.local> Message-ID: > Forgive the stupid question, but how to enter [ or ] in MrEd then? > Everytime I try, it gets replaced by ( and ). In DrScheme preferences, go to the "Editing" tab and the "Scheme" sub- tab and uncheck "Automatically adjust opening square brackets". On a semi-related note, having "Automatically adjust closing parens" checked can be quite useful. This automatically changes closing parentheses so they match the next unclosed opening parenthesis on the left of the cursor. For example, type "[)" and it'll get corrected to "[]". Cheers, -- Dave From jensaxel at soegaard.net Sun Sep 14 06:49:31 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:28:24 2009 Subject: [plt-scheme] Applying DRY in macros In-Reply-To: <002001c91651$f66e8510$c701000a@user8x14u15h2h> References: <200809132135.m8DLZc2F026508@mail08.syd.optusnet.com.au> <48CC3DFC.1020104@soegaard.net> <002001c91651$f66e8510$c701000a@user8x14u15h2h> Message-ID: <48CCEC3B.8020309@soegaard.net> Dan Prager skrev: > Noel and especially Jens > > Thanks for your replies. I agree that Jens's solution succeeds in > demonstrating a > 'magic' approach using syntax-case, albeit at the cost of increasing > complexity. > > Noel's point that you cannot 'or' patterns in syntax-rules[case] > excludes another > idea for eliminating the repetition. > > Another possibility, creating a macro-generating macro to allow for > briefer 'magic' definitions > or to permit the or-ing patterns are certainly beyond me and I imagine > that neither is an easy task. > I take it that Jens's comment about 'explicit transfer' in his > solution connotes that 'implicit transfer' > could not be easily achieved. That's a bit much to read into it. Since no one has implemented magic-syntax-rules yet, so to show how magic-syntax-rules would work, one must use what is available, namely syntax-case. The hard part of implementing magic-syntax-rules is to figure out what it does in detail. When the semantics are in place, all that's left to do is to use syntax-case to implement it. write a syntax- > As to whether the repeated sexp (for list as element body ...) > constitutes repetition, > I would say that it is certainly a textual duplicate! I think, that in order to count as real duplication of code, the two occurences should *mean* the same thing. In this sentence First Alice said "Bob", then Alice said "Charlie". there is duplication (Alice is repeated twice with the same meaning), so one normally rephrases it as: First Alice said "Bob", then she said "Charlie". Now consider the sentence: Dan says "Dan". Is there duplication here? -- Jens Axel S?gaard From robby at cs.uchicago.edu Sun Sep 14 07:36:20 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:28:24 2009 Subject: [plt-scheme] Square braces in MrEd In-Reply-To: References: <20080914021958.463b6bbc@halmanfloyd.lan.local> <1988E500-291A-43A2-801C-6484108DD0A0@ccs.neu.edu> <20080914115454.36bba200@halmanfloyd.lan.local> Message-ID: <932b2f1f0809140436x474fa53fn713b7773fd1a5547@mail.gmail.com> You can also type control-[ to temporarily override the auto correction. (The goal with these two corrections is to save you from ever havign to type () which, at least on american keyboards, are shifted characters, whereas [] are not.) Robby On Sun, Sep 14, 2008 at 5:31 AM, Dave Gurnell wrote: >> Forgive the stupid question, but how to enter [ or ] in MrEd then? >> Everytime I try, it gets replaced by ( and ). > > In DrScheme preferences, go to the "Editing" tab and the "Scheme" sub-tab > and uncheck "Automatically adjust opening square brackets". > > On a semi-related note, having "Automatically adjust closing parens" checked > can be quite useful. This automatically changes closing parentheses so they > match the next unclosed opening parenthesis on the left of the cursor. For > example, type "[)" and it'll get corrected to "[]". > > Cheers, > > -- Dave > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From matthias at ccs.neu.edu Sun Sep 14 07:47:37 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:28:24 2009 Subject: [plt-scheme] HTDP: Question on 7.4.4 In-Reply-To: <756daca50809131955w31792be1m76f330141698fa81@mail.gmail.com> References: <756daca50809112058u5c53e5e7n956e0ef5f671d2bd@mail.gmail.com> <73CF8F78-3FED-4B95-B0FC-0D93A9DFC80C@ccs.neu.edu> <756daca50809131955w31792be1m76f330141698fa81@mail.gmail.com> Message-ID: <3ADF5A62-D9AA-4C89-9E5F-5D6267D96553@ccs.neu.edu> It doesn't matter which one you like. It matters that you follow the process no matter which one is chosen for you. -- Matthias On Sep 13, 2008, at 10:55 PM, Grant Rettke wrote: >> If I use the data definitions >> If I use the following, however, > > Figure 19! I like the one on the left. From matthias at ccs.neu.edu Sun Sep 14 08:11:31 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:28:24 2009 Subject: [plt-scheme] HTDP: 9.5.5 In-Reply-To: References: <756daca50809131546j662a4c16yed969de3ad4d7057@mail.gmail.com> <48CC454F.2060600@soegaard.net> <756daca50809131633l317506eeod70fa58bb303925e@mail.gmail.com> <11C1B73E-6826-42D0-B71F-14690EAB59DF@ccs.neu.edu> <756daca50809132006g73e5857fy91f1cd6ca787975a@mail.gmail.com> Message-ID: <124F8BD0-6B74-47AA-B538-8FB9526682C7@ccs.neu.edu> Beautiful!! When the student becomes a teacher and explains it just right, he's understood and he's learning more. Grant: When we teach this stuff, we ask three template questions at this stage (how many clauses in the DD and what do they distinguish; are any of them structures, extract the fields; do you see self- references, that's where you indicate recursion) and then we give three hints for coding: -- start with the case(s) that don't use recursion; the examples should tell you how to compute the result there -- then remind yourself what each subexpression in the remaining clauses computes -- find a "combinator" that uses just those values and produces the proper result. If kids are really stuck with the latter, we go like this: use the examples, apply the sub-expressions, what should the result be? Tabulate this and add examples until you see what the "combinator" is. -- Matthias On Sep 14, 2008, at 3:35 AM, Veer wrote: > I think this is a problem of understanding recursion than anything > else. > It took me while to understand recursion. > > When i was stuck , Matthias wrote this (i am substituting > 'arrangements' with 'convert') : > > [quote] > > When you go from templates to definitions, read out the PURPOSE > statement for the recursive template expression: > > ;;(convert a-list) produce the number that can be formed from all > ;; digits in a-list. > > ;; (convert (rest a-list)) therefore produces the number that can > be formed > ;; from all the digits in the rest of a-list > (What does this mean for a concrete example? Use the examples!!) > > And then ask yourself how a primitive or a helper function can > use this and the rest of the template (line) to get the real > result.. > [unquote] > > For example: > ;;(convert a-list) > (convert (cons 1 (cons 2 (cons 3 empty))) produces what > > ;;(convert (rest a-list)) > (convert (cons 2 (cons 3 empty))) produces what > > So does this help? > > > On 9/14/08, Grant Rettke wrote: >>> Now discover Jens's hint by following the design recipe. >> >> Where did I go wrong? (Here is not where I expect you to be psychic, >> so let me elaborate) >> >> I followed the recipe by defining the recursive data (I re-used list >> of numbers), created a bunch of tests, walked through the >> implementation of the body (cond clauses, selector expressions, >> natural recursion), implemented the answer for the base case (zero), >> and then was left with: >> >> [else >> ... (first a-list-of-numbers) ... >> ... (convert (rest a-list-of-numbers) ...)] >> >> I think I was too preoccupied with shoe-horning in my approach than >> looking at the data. What I *didn't* do was to take something one >> more >> complex than the base case, like this, which is a test I had written >> before I implemented the function: >> >> (check-expect (convert (cons 1 empty)) 1) >> >> That at least would have gotten me to the first part of the equation >> in the else clause, 1 plus ... >> >> Then I would have looked at: >> >> (check-expect (convert (cons 0 (cons 1 empty))) 10) >> >> and maybe though zero plus something times the 2nd part, and >> finally plus >> zero. >> >> Is that the thought process, step by step satisfy the test by >> revising >> the calculation? You start with the simplest thing from the base >> condition? >> >> My approach thus far has been to write *all* of the tests up front, I >> was staring at this while I tried to implement the body: >> >> (check-expect (convert empty) 0) >> (check-expect (convert (cons 1 empty)) 1) >> (check-expect (convert (cons 0 (cons 1 empty))) 10) >> (check-expect (convert (cons 1 (cons 1 empty))) 11) >> (check-expect (convert (cons 0 (cons 0 (cons 1 empty)))) 100) >> (check-expect (convert (cons 1 (cons 1 (cons 1 empty)))) 111) >> >> This was a point where I totally didn't understand it and I felt like >> the recipe wasn't taking me there, which I was I posted a long-ish >> email. >> >> Please point me in the right direction to get back on track with what >> I missed from the recipe. >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> From 84jkdl202 at sneakemail.com Sat Sep 13 09:30:01 2008 From: 84jkdl202 at sneakemail.com (///) Date: Thu Mar 26 02:28:24 2009 Subject: [plt-scheme] Re: Using previously-defined macros within the "transformer environment" In-Reply-To: <20080913011855.907CF650085@mail-svr1.cs.utah.edu> References: <20080913011855.907CF650085@mail-svr1.cs.utah.edu> Message-ID: <771d4263-c79b-45c7-9530-5d635a3aae44@m45g2000hsb.googlegroups.com> On Sep 12, 9:18 pm, Matthew Flatt wrote: > At Fri, 12 Sep 2008 08:28:28 -0700 (PDT), "///" wrote: > > > > > I'm using PLT Scheme to write a Web site. In order to make PLT Scheme > > more usable (that is, more like Common Lisp), I've been spending some > > time writing a few macros. First, I wrote a new version of the > > "lambda" form. It's just like the original lambda, except it > > understands &OPTIONAL, &KEY, and &REST, like Common Lisp (&KEY is > > especially important). It was a first step in porting some of my CL > > code over to Scheme. > > > Next, I decided to try to write a DEFMACRO form that understands the > > same sort of lambda-list. (PLT is generous enough to provide "define- > > macro", but macros defined this way can only have Scheme lambda-lists, > > and the macros I'm trying to port rely heavily on &KEY-- a simple dot > > will not do!) The easiest way to do this would be to use the LAMBDA > > macro I previously wrote, so that the macro-expansion invokes the > > LAMBDA macro and automatically inherits its lambda-list processing > > capabilities. Unfortunately, it turns out that my LAMBDA macro is not > > visible in the transformer environment, even though I used (require- > > for-syntax cl-lambda) to import the module that defines it. I would > > hate to have to copy and paste the source for the LAMBDA form (and all > > the local functions it depends on) to get my DEFMACRO form to work, > > but at the moment it looks like that's what you have to do to satisfy > > the Hygienic Macro System. I tried to solve the problem with Google > > (which has helped on countless occasions), but apparently nobody has > > ever tried to use one macro to expand another in Scheme. > > > Here's what the defmacro macro looks like: > > > (define-macro (defmacro name lambda-list . body) > > (let* ((rest-arg (gensym)) > > (simple-lambda-list (make-simple-lambda-list > > (fold-optional-args-into-rest > > lambda-list rest-arg)))) > > `(define-macro ,(cons name simple-lambda-list) > > (apply (cl-lambda ,lambda-list ,@body) > > ,(cons-to-rest-arg-if-necessary simple-lambda-list rest- > > arg))))) > > > "simple-lambda-list" converts a CL lambda-list into a Scheme one > > (including that > > stupid little dot), while "fold-optional-args-into-rest" removes all > > &OPTIONAL and > > &KEY arguments and adds a &REST argument to replace them (and also > > replaces > > any user-provided &REST arguments with its own definition). > > (foo bar &optional baz &rest haha) becomes (foo bar &rest g39). > > > It expands as expected: (defmacro foobar (x &optional y) > > `(list ,x ,y)) expands into: > > > (define-macro (foobar x . g73) > > (apply (cl-lambda (x &optional y) (quasiquote (list (unquote x) > > (unquote y)))) > > (cons x g73))) > > > However, the above macro can't be expanded any further because: > > > reference to undefined identifier: cl-lambda > > > I know the problem is caused by the transformer environment because > > the cl-lambda form works from the REPL. In fact, if you define x and > > g73 in a let form and paste in the definition of the above macro, you > > get the expansion that should result from the macro: > > > (let ((x 1) > > (g73 '(2))) > > (apply (cl-lambda (x &optional y) (quasiquote (list (unquote x) > > (unquote y)))) > > (cons x g73))) > > > ==> (list 1 2) > > > define-for-syntax allows you to define functions in the transformer > > environment, but there is no such thing as define-macro-for-syntax, or > > even define-syntax-for-syntax. The PLT Scheme reference manual is > > absolutely silent on this issue, except that it seems to suggest > > (incorrectly) that require-for-syntax should solve the problem (it > > only helps with functions). > > `require-for-syntax' really is the solution for macros as well as > functions. > > > Has anyone ever done this sort of thing in > > Scheme before? > > A lot, especially in PLT Scheme. > > > Is it fixed in a later version of PLT Scheme? > > > My ISP is using MzScheme 360. > > Version 4.1 offers many improvements, including better documentation. > In particular, the following part of the current PLT Scheme Guide > offers an explanation of the problem that you're hitting, along with > its solution: > > http://docs.plt-scheme.org/guide/stx-phases.html Already been there. > The essential part of the solution is to put the revised `cl-lambda' > macro in a module, and then you can use it in run-time expressions by > `require'ing the module, and you can use it in compile-time expressions > by using `require' with `for-syntax'. > > It's the same in v360, except that `require' with a `for-syntax' > sub-form is written as a `require-for-syntax' form. > I've already been using 'require-for-syntax', but it's kind of funny when it comes to macros. I've since managed to get my defmacro form to work from the toplevel (by explicitly expanding the cl-lambda with expand-once), but I get the same old error message if I use the defmacro form within a module, even if I import all modules with both 'require' and 'require-for-syntax'. From noelwelsh at gmail.com Sun Sep 14 09:13:17 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:28:24 2009 Subject: [plt-scheme] Re: Using previously-defined macros within the "transformer environment" In-Reply-To: <771d4263-c79b-45c7-9530-5d635a3aae44@m45g2000hsb.googlegroups.com> References: <20080913011855.907CF650085@mail-svr1.cs.utah.edu> <771d4263-c79b-45c7-9530-5d635a3aae44@m45g2000hsb.googlegroups.com> Message-ID: Including the error message would help debug the issue, and including your code, if it is sufficiently compact, would be good. Having one macro expand into another is a fairly standard thing, so I'm surprised you're having problems. A trivial example is: Module a: #lang scheme/base (provide a) (define-syntax a (syntax-rules () [(a) (display "a!\n")])) Module b: lang scheme/base (require "a.ss") (provide b) (define-syntax b (syntax-rules () [(b) (a)])) Usage: > (require "b.ss") > (b) a! A more complex example is define-check in SchemeUnit: http://planet.plt-scheme.org/package-source/schematics/schemeunit.plt/3/3/check.ss Here, a macro generates a macro which depends on functions defined in another module. So this stuff is fairly standard. Were I writing the code, I would start by using syntax-rules/syntax-case to define the base macros, even if the macros they defined were more like defmacro. The former have more examples, more documentation, and more safeguards. Once it was working with syntax-rules/case porting to define-macro could be done incrementally (though I don't see any value in doing this). As an aside, there is no harm in trimming your email replies, nor in being a bit more polite. N. From narutocanada at gmail.com Sun Sep 14 09:59:45 2008 From: narutocanada at gmail.com (narutocanada@gmail.com) Date: Thu Mar 26 02:28:25 2009 Subject: [plt-scheme] Is there a way to do this? Message-ID: <9197aea9-e68d-4285-9be5-611b09914919@m36g2000hse.googlegroups.com> hi Is there a way to find out during the interpretation of a program that any error was encountered, either syntactical or run time error-- currently mzscheme always return 0 at the shell level: cat any.sc | mzscheme ; echo $? # always 0 Providing a user defined error function only catches certain error but not syntactical or other run time error-- like "identifier not found". I need a way to catch any error and exit with any value other then 0 for batch processing large number of test files. Thanks. From mflatt at cs.utah.edu Sun Sep 14 10:07:52 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:28:25 2009 Subject: [plt-scheme] Is there a way to do this? In-Reply-To: <9197aea9-e68d-4285-9be5-611b09914919@m36g2000hse.googlegroups.com> References: <9197aea9-e68d-4285-9be5-611b09914919@m36g2000hse.googlegroups.com> Message-ID: <20080914140753.927896500AC@mail-svr1.cs.utah.edu> At Sun, 14 Sep 2008 06:59:45 -0700 (PDT), "narutocanada@gmail.com" wrote: > Is there a way to find out during the interpretation of a program that > any error was encountered, either syntactical or run time error-- > currently mzscheme always return 0 at the shell level: > > cat any.sc | mzscheme ; echo $? > # always 0 > > Providing a user defined error function only catches certain error but > not syntactical or other run time error-- like "identifier not found". > I need a way to catch any error and exit with any value other then 0 > for batch processing large number of test files. The exit status for `mzscheme' indicates an error if an error occurs during a command-line eval (using -e, etc.), load (using -f, -r, etc.), or require (using -l, etc.) when no read-eval-print loop is started. Otherwise, the exit status is 0 or determined by a call to exit. (That's from 16.1.1 in the PLT Scheme reference, but I edited it a little to fill in some context.) So you might just want mzscheme any.sc ; echo $? If you really need to pipe expressions into the REPL, then you could set `uncaught-exception-handler' to call `exit' with a non-0 value. Matthew From narutocanada at gmail.com Sun Sep 14 10:34:42 2008 From: narutocanada at gmail.com (narutocanada@gmail.com) Date: Thu Mar 26 02:28:25 2009 Subject: [plt-scheme] Re: Is there a way to do this? In-Reply-To: <20080914140753.927896500AC@mail-svr1.cs.utah.edu> References: <9197aea9-e68d-4285-9be5-611b09914919@m36g2000hse.googlegroups.com> <20080914140753.927896500AC@mail-svr1.cs.utah.edu> Message-ID: <59217a0b-61cc-4cd5-9087-6c6b91c9326c@x16g2000prn.googlegroups.com> On Sep 14, 2:07 pm, Matthew Flatt wrote: > At Sun, 14 Sep 2008 06:59:45 -0700 (PDT), "narutocan...@gmail.com" wrote: > > > Is there a way to find out during the interpretation of a program that > > any error was encountered, either syntactical or run time error-- > > currently mzscheme always return 0 at the shell level: > > > cat any.sc | mzscheme ; echo $? > > # always 0 > > > Providing a user defined error function only catches certain error but > > not syntactical or other run time error-- like "identifier not found". > > I need a way to catch any error and exit with any value other then 0 > > for batch processing large number of test files. > > The exit status for `mzscheme' indicates an error if an error occurs > during a command-line eval (using -e, etc.), load (using -f, -r, etc.), > or require (using -l, etc.) when no read-eval-print loop is started. > Otherwise, the exit status is 0 or determined by a call to exit. > > (That's from 16.1.1 in the PLT Scheme reference, but I edited it a > little to fill in some context.) > > So you might just want > > mzscheme any.sc ; echo $? > > If you really need to pipe expressions into the REPL, then you could > set `uncaught-exception-handler' to call `exit' with a non-0 value. Can you provide an example, I'm reading the manual at "http://download.plt-scheme.org/doc/html/reference/ exns.html#(def._((quote._~23~25kernel)._uncaught-exception-handler))" , but it does not suggest an usage example. I can't figure out what to feed "with-handlers" or simply set! uncaught-exception-handler to exit? I simply need mzscheme to exit on any error and return none 0 (like other unix programs). It seems mzscheme has some complicated exception system. Thanks. > > Matthew > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From eli at barzilay.org Sun Sep 14 10:40:11 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:28:25 2009 Subject: [plt-scheme] Re: Is there a way to do this? In-Reply-To: <59217a0b-61cc-4cd5-9087-6c6b91c9326c@x16g2000prn.googlegroups.com> References: <9197aea9-e68d-4285-9be5-611b09914919@m36g2000hse.googlegroups.com> <20080914140753.927896500AC@mail-svr1.cs.utah.edu> <59217a0b-61cc-4cd5-9087-6c6b91c9326c@x16g2000prn.googlegroups.com> Message-ID: <18637.8779.715329.504223@arabic.ccs.neu.edu> On Sep 14, narutocanada@gmail.com wrote: > On Sep 14, 2:07 pm, Matthew Flatt wrote: > > > > If you really need to pipe expressions into the REPL, then you could > > set `uncaught-exception-handler' to call `exit' with a non-0 value. > > Can you provide an example, I'm reading the manual at > "http://download.plt-scheme.org/doc/html/reference/ > exns.html#(def._((quote._~23~25kernel)._uncaught-exception-handler))" > , but it does not suggest an usage example. I can't figure out what to > feed "with-handlers" or simply set! uncaught-exception-handler to > exit? I simply need mzscheme to exit on any error and return none 0 > (like other unix programs). It seems mzscheme has some complicated > exception system. Something like (uncaught-exception-handler (lambda (exn) (exit 1))) should do what you want. But Matthew's suggestion of writing a proper script file and run it as `mzscheme script' is much better. One thing is that you won't get it to print the prompts and the welcome banner line. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From narutocanada at gmail.com Sun Sep 14 11:30:32 2008 From: narutocanada at gmail.com (narutocanada@gmail.com) Date: Thu Mar 26 02:28:25 2009 Subject: [plt-scheme] Re: Is there a way to do this? In-Reply-To: <18637.8779.715329.504223@arabic.ccs.neu.edu> References: <9197aea9-e68d-4285-9be5-611b09914919@m36g2000hse.googlegroups.com> <20080914140753.927896500AC@mail-svr1.cs.utah.edu> <59217a0b-61cc-4cd5-9087-6c6b91c9326c@x16g2000prn.googlegroups.com> <18637.8779.715329.504223@arabic.ccs.neu.edu> Message-ID: Eli Barzilay wrote: > On Sep 14, narutocanada@gmail.com wrote: > > On Sep 14, 2:07 pm, Matthew Flatt wrote: > > > > > > If you really need to pipe expressions into the REPL, then you could > > > set `uncaught-exception-handler' to call `exit' with a non-0 value. > > > > Can you provide an example, I'm reading the manual at > > "http://download.plt-scheme.org/doc/html/reference/ > > exns.html#(def._((quote._~23~25kernel)._uncaught-exception-handler))" > > , but it does not suggest an usage example. I can't figure out what to > > feed "with-handlers" or simply set! uncaught-exception-handler to > > exit? I simply need mzscheme to exit on any error and return none 0 > > (like other unix programs). It seems mzscheme has some complicated > > exception system. > > Something like > > (uncaught-exception-handler (lambda (exn) (exit 1))) > > should do what you want. But Matthew's suggestion of writing a proper > script file and run it as `mzscheme script' is much better. One thing > is that you won't get it to print the prompts and the welcome banner > line. I need to pipe files for unbiased results for transformations. I like to clearly separate my own code, and the code I'm processing that's why I ask for it. I don't need to worry about prompts or banners, because any meaning preserving transformation should not alter the results for the same interpreter (mzscheme). Thanks. > > -- > ((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 grettke at acm.org Sun Sep 14 12:29:29 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:25 2009 Subject: [plt-scheme] Square braces in MrEd In-Reply-To: <932b2f1f0809140436x474fa53fn713b7773fd1a5547@mail.gmail.com> References: <20080914021958.463b6bbc@halmanfloyd.lan.local> <1988E500-291A-43A2-801C-6484108DD0A0@ccs.neu.edu> <20080914115454.36bba200@halmanfloyd.lan.local> <932b2f1f0809140436x474fa53fn713b7773fd1a5547@mail.gmail.com> Message-ID: <756daca50809140929y5876086dn305e7bf9cb98e9c4@mail.gmail.com> You can also do alt-[ to get matching brackets. From marek at xivilization.net Sun Sep 14 12:52:08 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:28:25 2009 Subject: [plt-scheme] Square braces in MrEd In-Reply-To: <756daca50809140929y5876086dn305e7bf9cb98e9c4@mail.gmail.com> References: <20080914021958.463b6bbc@halmanfloyd.lan.local> <1988E500-291A-43A2-801C-6484108DD0A0@ccs.neu.edu> <20080914115454.36bba200@halmanfloyd.lan.local> <932b2f1f0809140436x474fa53fn713b7773fd1a5547@mail.gmail.com> <756daca50809140929y5876086dn305e7bf9cb98e9c4@mail.gmail.com> Message-ID: <20080914185208.1b41ae15@halmanfloyd.lan.local> On Sun, 14 Sep 2008 11:29:29 -0500 "Grant Rettke" wrote: > You can also do alt-[ to get matching brackets. Thanks you all for the explanations and tips! Now I even know why such a setting is there in the first place. On the german keyboard layout ( and ) are shift keys too, but [ and ] are keys cou can only get with the Alt-Gr (right Alt) key, and are quite awkward to type. Oh, and the automatic adjusting of the proper closing paren is handy. regards, Marek From marek at xivilization.net Sun Sep 14 13:00:03 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:28:26 2009 Subject: [plt-scheme] Documenting Scheme code Message-ID: <20080914190003.657234d4@halmanfloyd.lan.local> Hi again! PLT Scheme has the nice Scribble tool which can be used to create text documentation about a program. But as far as I see, it is not intended for API documentation in a JavaDoc or PyDoc-style. I like the stardarized Python docstrings (= first string in a function is it's docstring) and that's why I'm asking. How would you, experienced Scheme programmers document funtions, and definitions in Scheme files? I couldn't find any advice on how to document code yet. Or am I just thinking too much about it and it would be best to write a documentation comment using ; before the function definition? Thanks in advance! regards, Marek From eli at barzilay.org Sun Sep 14 13:02:17 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:28:26 2009 Subject: [plt-scheme] Re: Is there a way to do this? In-Reply-To: References: <9197aea9-e68d-4285-9be5-611b09914919@m36g2000hse.googlegroups.com> <20080914140753.927896500AC@mail-svr1.cs.utah.edu> <59217a0b-61cc-4cd5-9087-6c6b91c9326c@x16g2000prn.googlegroups.com> <18637.8779.715329.504223@arabic.ccs.neu.edu> Message-ID: <18637.17305.747548.689131@arabic.ccs.neu.edu> On Sep 14, narutocanada@gmail.com wrote: > > Something like > > > > (uncaught-exception-handler (lambda (exn) (exit 1))) > > > > should do what you want. But Matthew's suggestion of writing a proper > > script file and run it as `mzscheme script' is much better. One thing > > is that you won't get it to print the prompts and the welcome banner > > line. > > I need to pipe files for unbiased results for transformations. > I like to clearly separate my own code, and the code I'm processing > that's why I ask for it. I don't need to worry about prompts or > banners, because any meaning preserving transformation should not > alter the results for the same interpreter (mzscheme). I don't know what you mean by that, but even in a case where you have arbitrary files to evaluate you can use `load', or `eval'. (They're not that great either, but starting a new process and feeding it code on its input is really not a good solution.) -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From matthias at ccs.neu.edu Sun Sep 14 13:29:01 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:28:26 2009 Subject: [plt-scheme] Documenting Scheme code In-Reply-To: <20080914190003.657234d4@halmanfloyd.lan.local> References: <20080914190003.657234d4@halmanfloyd.lan.local> Message-ID: I use scrible to document APIs all the time. See world.scrbl, which is an API for teachers and students. On Sep 14, 2008, at 1:00 PM, Marek Kubica wrote: > Hi again! > > PLT Scheme has the nice Scribble tool which can be used to create text > documentation about a program. But as far as I see, it is not intended > for API documentation in a JavaDoc or PyDoc-style. > > I like the stardarized Python docstrings (= first string in a function > is it's docstring) and that's why I'm asking. How would you, > experienced Scheme programmers document funtions, and definitions in > Scheme files? I couldn't find any advice on how to document code yet. > > Or am I just thinking too much about it and it would be best to > write a > documentation comment using ; before the function definition? > > Thanks in advance! > > regards, > Marek > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From grettke at acm.org Sun Sep 14 13:40:49 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:26 2009 Subject: [plt-scheme] Documenting Scheme code In-Reply-To: <20080914190003.657234d4@halmanfloyd.lan.local> References: <20080914190003.657234d4@halmanfloyd.lan.local> Message-ID: <756daca50809141040s61a0b66cy8e339f13c0268d03@mail.gmail.com> On Sun, Sep 14, 2008 at 12:00 PM, Marek Kubica wrote: > Or am I just thinking too much about it and it would be best to write a > documentation comment using ; before the function definition? Marek what you are touching upon is a philosophical decision everyone makes regarding how they document the API for their code: In the code or outside of it. There are pros and cons to each approach. PLT does it in Scribble files outside of the code. From grettke at acm.org Sun Sep 14 13:43:06 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:26 2009 Subject: [plt-scheme] Square braces in MrEd In-Reply-To: <20080914185208.1b41ae15@halmanfloyd.lan.local> References: <20080914021958.463b6bbc@halmanfloyd.lan.local> <1988E500-291A-43A2-801C-6484108DD0A0@ccs.neu.edu> <20080914115454.36bba200@halmanfloyd.lan.local> <932b2f1f0809140436x474fa53fn713b7773fd1a5547@mail.gmail.com> <756daca50809140929y5876086dn305e7bf9cb98e9c4@mail.gmail.com> <20080914185208.1b41ae15@halmanfloyd.lan.local> Message-ID: <756daca50809141043s7a018b99y27f5d6b07f780f38@mail.gmail.com> > Oh, and the automatic adjusting of the proper closing paren is handy. I tried to document everything that I think is handy in this post: http://www.wisdomandwonder.com/article/139/working-with-drscheme-372 From grettke at acm.org Sun Sep 14 13:49:02 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:26 2009 Subject: [plt-scheme] Square braces in MrEd In-Reply-To: <756daca50809141043s7a018b99y27f5d6b07f780f38@mail.gmail.com> References: <20080914021958.463b6bbc@halmanfloyd.lan.local> <1988E500-291A-43A2-801C-6484108DD0A0@ccs.neu.edu> <20080914115454.36bba200@halmanfloyd.lan.local> <932b2f1f0809140436x474fa53fn713b7773fd1a5547@mail.gmail.com> <756daca50809140929y5876086dn305e7bf9cb98e9c4@mail.gmail.com> <20080914185208.1b41ae15@halmanfloyd.lan.local> <756daca50809141043s7a018b99y27f5d6b07f780f38@mail.gmail.com> Message-ID: <756daca50809141049w62ac1047j93e9ce3f9b1d8f56@mail.gmail.com> On Sun, Sep 14, 2008 at 12:43 PM, Grant Rettke wrote: >> Oh, and the automatic adjusting of the proper closing paren is handy. > > I tried to document everything that I think is handy in this post: > > http://www.wisdomandwonder.com/article/139/working-with-drscheme-372 I know that Emacs is *the* standard for editing Lisp (I'm not an Emacs power-user, so I'm basing this on observations and discussion), but DrScheme actually provides a lot of really good functionality, and I'm fairly picky coming from IntelliJ Idea (if you do Java you know what I mean, Idea is the *the* programmers IDE for Java, everything else is basically dissapointing). Calling DrScheme an Emacs competitor would be an insult to DrScheme. I know that DrScheme is a pedagogic tool, but it is also a pretty good IDE. What *would* DrScheme look like if everyone who used it cut over to DrScheme %100 of the time? From wookiz at hotmail.com Sun Sep 14 14:31:00 2008 From: wookiz at hotmail.com (wooks) Date: Thu Mar 26 02:28:27 2009 Subject: [plt-scheme] Re: HTDP: 9.5.5 In-Reply-To: <756daca50809131546j662a4c16yed969de3ad4d7057@mail.gmail.com> References: <756daca50809131546j662a4c16yed969de3ad4d7057@mail.gmail.com> Message-ID: On Sep 13, 6:46?pm, "Grant Rettke" wrote: > Hi, > > I'm working on the 'convert' function in 9.5.5. Reading the problem > description, and then jotting out how I would solve this problem by > hand, I ended up with something like this (assuming the list of > numbers were 3 digits long) > Don't forget to google comp.lang.scheme and the PLT archives. For instance http://groups.google.com/group/comp.lang.scheme/browse_thread/thread/b2c4634fdde77cec/dc9965c41b8ff28c?lnk=gst&q=htdp+9.5.5#dc9965c41b8ff28c From robby at cs.uchicago.edu Sun Sep 14 17:33:13 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:28:27 2009 Subject: [plt-scheme] Documenting Scheme code In-Reply-To: <756daca50809141040s61a0b66cy8e339f13c0268d03@mail.gmail.com> References: <20080914190003.657234d4@halmanfloyd.lan.local> <756daca50809141040s61a0b66cy8e339f13c0268d03@mail.gmail.com> Message-ID: <932b2f1f0809141433q58d30b8flb5cbfe8c8b74cd16@mail.gmail.com> Also inside the code. See provide/doc. Robby On Sun, Sep 14, 2008 at 12:40 PM, Grant Rettke wrote: > On Sun, Sep 14, 2008 at 12:00 PM, Marek Kubica wrote: >> Or am I just thinking too much about it and it would be best to write a >> documentation comment using ; before the function definition? > > Marek what you are touching upon is a philosophical decision everyone > makes regarding how they document the API for their code: > > In the code or outside of it. > > There are pros and cons to each approach. > > PLT does it in Scribble files outside of the code. > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From grettke at acm.org Sun Sep 14 18:46:46 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:27 2009 Subject: [plt-scheme] Documenting Scheme code In-Reply-To: <932b2f1f0809141433q58d30b8flb5cbfe8c8b74cd16@mail.gmail.com> References: <20080914190003.657234d4@halmanfloyd.lan.local> <756daca50809141040s61a0b66cy8e339f13c0268d03@mail.gmail.com> <932b2f1f0809141433q58d30b8flb5cbfe8c8b74cd16@mail.gmail.com> Message-ID: <756daca50809141546n5fcaead7sbc501576e1046c7c@mail.gmail.com> On Sun, Sep 14, 2008 at 4:33 PM, Robby Findler wrote: > Also inside the code. See provide/doc. Is 'provide/doc' something for which we can search in the docs? Or is it under something else? From robby at cs.uchicago.edu Sun Sep 14 18:55:49 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:28:27 2009 Subject: [plt-scheme] Documenting Scheme code In-Reply-To: <756daca50809141546n5fcaead7sbc501576e1046c7c@mail.gmail.com> References: <20080914190003.657234d4@halmanfloyd.lan.local> <756daca50809141040s61a0b66cy8e339f13c0268d03@mail.gmail.com> <932b2f1f0809141433q58d30b8flb5cbfe8c8b74cd16@mail.gmail.com> <756daca50809141546n5fcaead7sbc501576e1046c7c@mail.gmail.com> Message-ID: <932b2f1f0809141555t577c64e7q4bf26763d18e5161@mail.gmail.com> Oh, I see that it isn't documented yet. I thought that it was ready for consumption, apologies. Lets say that, for now, scribble's infrastructure supports in-code docs and we're testing it out ourselves. Robby On Sun, Sep 14, 2008 at 5:46 PM, Grant Rettke wrote: > On Sun, Sep 14, 2008 at 4:33 PM, Robby Findler wrote: >> Also inside the code. See provide/doc. > > Is 'provide/doc' something for which we can search in the docs? Or is > it under something else? > > From iba at westmont.edu Sun Sep 14 18:40:06 2008 From: iba at westmont.edu (wayne iba) Date: Thu Mar 26 02:28:27 2009 Subject: [plt-scheme] Steal your face Scheme T-shirts Message-ID: <1221432006.10040.7.camel@wfi-laptop> I was planning to print up a set of T-shirts with the steal your face plt-scheme logo. Mostly, I wanted a few for myself, but since the printers have a minimum order, I was going to use some extras as prizes for the top scores on exams or some such nonsense. So while I'm at it, I thought I would check in with you'all to see if anyone here would be interested. (I'm only sampling interest -- I'll send out the actual design and final price with shipping later if there is interest.) On a related note, I'm wondering about letting the logo speak for itself, simply put "DrScheme" under the logo, or have some other text printed. If something else, what would you suggest? A Grateful Dead pun would be ideal, but nothing has come to mind yet. Cheers, --Wayne From workmin at ccs.neu.edu Sun Sep 14 19:09:50 2008 From: workmin at ccs.neu.edu (Jon Rafkind) Date: Thu Mar 26 02:28:27 2009 Subject: [plt-scheme] errotrace in 4.0? Message-ID: <48CD99BE.2040809@ccs.neu.edu> Does errortrace work in 4.0? I can't seem to get it to work. Nothing happens if I give '-l errortrace' on the command line, and I mean my program isn't even run. $ mzscheme -l errortrace x.ss $ If I add (require errortrace) to my program I don't see any profiling information #lang scheme (require errortrace) (profiling-enabled #t) (define (foo n) (if (= n 0) 0 (+ n (foo (sub1 n))))) (foo 200) (output-profile-results #t #t) $ mzscheme x.ss 20100 Sorting profile data... Total samples: 0 From sk at cs.brown.edu Sun Sep 14 19:36:00 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:28:27 2009 Subject: [plt-scheme] Steal your face Scheme T-shirts In-Reply-To: <1221432006.10040.7.camel@wfi-laptop> References: <1221432006.10040.7.camel@wfi-laptop> Message-ID: You do know the lambdahead logo, yes? http://people.cs.uchicago.edu/~robby/logos/ Back before Matthew became respectable. S. On Sun, Sep 14, 2008 at 5:40 PM, wayne iba wrote: > I was planning to print up a set of T-shirts with the steal your face > plt-scheme logo. Mostly, I wanted a few for myself, but since the > printers have a minimum order, I was going to use some extras as prizes > for the top scores on exams or some such nonsense. So while I'm at it, > I thought I would check in with you'all to see if anyone here would be > interested. (I'm only sampling interest -- I'll send out the actual > design and final price with shipping later if there is interest.) > > On a related note, I'm wondering about letting the logo speak for > itself, simply put "DrScheme" under the logo, or have some other text > printed. If something else, what would you suggest? A Grateful Dead > pun would be ideal, but nothing has come to mind yet. > > Cheers, > --Wayne > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From eli at barzilay.org Sun Sep 14 19:44:02 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:28:28 2009 Subject: [plt-scheme] errotrace in 4.0? In-Reply-To: <48CD99BE.2040809@ccs.neu.edu> References: <48CD99BE.2040809@ccs.neu.edu> Message-ID: <18637.41410.618896.962198@arabic.ccs.neu.edu> On Sep 14, Jon Rafkind wrote: > Does errortrace work in 4.0? I can't seem to get it to work. > > Nothing happens if I give '-l errortrace' on the command line, and I > mean my program isn't even run. > $ mzscheme -l errortrace x.ss http://docs.plt-scheme.org/errortrace/quick-instructions.html -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From workmin at ccs.neu.edu Sun Sep 14 19:50:29 2008 From: workmin at ccs.neu.edu (Jon Rafkind) Date: Thu Mar 26 02:28:28 2009 Subject: [plt-scheme] errotrace in 4.0? In-Reply-To: <18637.41410.618896.962198@arabic.ccs.neu.edu> References: <48CD99BE.2040809@ccs.neu.edu> <18637.41410.618896.962198@arabic.ccs.neu.edu> Message-ID: <48CDA345.5070804@ccs.neu.edu> Eli Barzilay wrote: > On Sep 14, Jon Rafkind wrote: > >> Does errortrace work in 4.0? I can't seem to get it to work. >> >> Nothing happens if I give '-l errortrace' on the command line, and I >> mean my program isn't even run. >> $ mzscheme -l errortrace x.ss >> > > http://docs.plt-scheme.org/errortrace/quick-instructions.html > > * Throw away ".zo" versions of your source. Done * (require errortrace) Tried that, doesn't work * mzscheme -l errortrace ... Tried that, doesn't work * The errortrace module is strange; don?t import it into another module. Instead, the errortrace module is meant to be invoked from the top-level, so that it can install an evaluation handler, exception handler, etc. Ok, so maybe if I run a repl it will work $ mzscheme > (require errortrace) > (require "x.ss") Same output as before. From gregory.woodhouse at gmail.com Sun Sep 14 20:38:40 2008 From: gregory.woodhouse at gmail.com (Woodhouse Gregory) Date: Thu Mar 26 02:28:29 2009 Subject: [plt-scheme] Steal your face Scheme T-shirts In-Reply-To: References: <1221432006.10040.7.camel@wfi-laptop> Message-ID: <0114C548-8A03-49B5-BAC7-9B41BE686B7C@gmail.com> I don't suppose it would make a great T-shirt, but I like the "do it yourself" lambda at Rice. Hmm... The lambdahead logo wouldn't be my first choice, but a T-shirt with the standard PLT logo sounds like something I'd like. Now, if Judy Collins were to do a tour of the PLT universities... Metaphors be with you. http://www.gwoodhouse.com http://GregWoodhouse.ImageKind.com On Sep 14, 2008, at 4:36 PM, Shriram Krishnamurthi wrote: > You do know the lambdahead logo, yes? > > http://people.cs.uchicago.edu/~robby/logos/ > > Back before Matthew became respectable. > > S. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080914/e0e3ed18/attachment.html From eli at barzilay.org Sun Sep 14 20:43:33 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:28:29 2009 Subject: [plt-scheme] errotrace in 4.0? In-Reply-To: <48CDA345.5070804@ccs.neu.edu> References: <48CD99BE.2040809@ccs.neu.edu> <18637.41410.618896.962198@arabic.ccs.neu.edu> <48CDA345.5070804@ccs.neu.edu> Message-ID: <18637.44981.912478.210041@arabic.ccs.neu.edu> On Sep 14, Jon Rafkind wrote: > Eli Barzilay wrote: > > On Sep 14, Jon Rafkind wrote: > > > >> Nothing happens if I give '-l errortrace' on the command line, and I > >> mean my program isn't even run. > >> $ mzscheme -l errortrace x.ss Going back to this, it doesn't run your code because you specify a flag to load errortrace, but no flag to load your code. Your code is loaded only if you specify only configuration options before your file, and `-l' is not a configuration option. But in any case, I missed the fact that you want the profiler. > > http://docs.plt-scheme.org/errortrace/quick-instructions.html > > > * Throw away ".zo" versions of your source. > Done [shuffling] > * mzscheme -l errortrace ... > Tried that, doesn't work Same as above. > * (require errortrace) > Tried that, doesn't work In the previous email you've put this inside the module -- but that's too late. The errortrace tool sets up evaluation hooks to instrument the code, which is a form of a side-effect, and must be done before you load the code. This is what this: > * The errortrace module is strange; don?t import it into another > module. Instead, the errortrace module is meant to be invoked from > the top-level, so that it can install an evaluation handler, > exception handler, etc. is telling you to do. > Ok, so maybe if I run a repl it will work > $ mzscheme > > (require errortrace) > > (require "x.ss") > > Same output as before. Right -- this is because, as the docs say, "Errortrace?s profiling instrumentation is #f by default". You need to begin mzscheme and load errortrace like you did here, or by running "mz -il errortrace", then turn on profiling, then load & run your code: winooski:/tmp eli> mz -il errortrace Welcome to MzScheme v4.1.0.3 [3m], Copyright (c) 2004-2008 PLT Scheme Inc. -> (profiling-enabled #t) -> (require "x.ss") 20100 -> (output-profile-results #t #t) Sorting profile data... ========================================================= time = 0 : no. = 201 : foo in # ========================================================= time = 0 : no. = 1 : #f in # Total samples: 0 -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From workmin at ccs.neu.edu Sun Sep 14 20:57:20 2008 From: workmin at ccs.neu.edu (Jon Rafkind) Date: Thu Mar 26 02:28:29 2009 Subject: [plt-scheme] errotrace in 4.0? In-Reply-To: <18637.44981.912478.210041@arabic.ccs.neu.edu> References: <48CD99BE.2040809@ccs.neu.edu> <18637.41410.618896.962198@arabic.ccs.neu.edu> <48CDA345.5070804@ccs.neu.edu> <18637.44981.912478.210041@arabic.ccs.neu.edu> Message-ID: <48CDB2F0.5040207@ccs.neu.edu> Eli Barzilay wrote: > On Sep 14, Jon Rafkind wrote: > >> Eli Barzilay wrote: >> >>> On Sep 14, Jon Rafkind wrote: >>> >>> >>>> Nothing happens if I give '-l errortrace' on the command line, and I >>>> mean my program isn't even run. >>>> $ mzscheme -l errortrace x.ss >>>> > > Going back to this, it doesn't run your code because you specify a > flag to load errortrace, but no flag to load your code. Your code is > loaded only if you specify only configuration options before your > file, and `-l' is not a configuration option. But in any case, I > missed the fact that you want the profiler. > > Oh *rolls eyes*. Regardless of whether I wanted the profiler I need to do something like mzscheme -l errortrace -f somefile.ss And if I want the profiler then I should really do mzscheme -f top-level.ss where top-level.ss doesn't have #lang scheme and does the work of require'ing errortrace and turning profiling information on. That would be nice to put in the quick start guide. Anyway, thanks for setting me straight. >> Ok, so maybe if I run a repl it will work >> $ mzscheme >> > (require errortrace) >> > (require "x.ss") >> >> Same output as before. >> > > Right -- this is because, as the docs say, "Errortrace?s profiling > instrumentation is #f by default". > > You need to begin mzscheme and load errortrace like you did here, or > by running "mz -il errortrace", then turn on profiling, then load & > run your code: > Yea, I should have realized that I had to do (profiling-enabled #t). From grettke at acm.org Sun Sep 14 21:01:33 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:29 2009 Subject: [plt-scheme] HTDP: 9.5.5 In-Reply-To: <124F8BD0-6B74-47AA-B538-8FB9526682C7@ccs.neu.edu> References: <756daca50809131546j662a4c16yed969de3ad4d7057@mail.gmail.com> <48CC454F.2060600@soegaard.net> <756daca50809131633l317506eeod70fa58bb303925e@mail.gmail.com> <11C1B73E-6826-42D0-B71F-14690EAB59DF@ccs.neu.edu> <756daca50809132006g73e5857fy91f1cd6ca787975a@mail.gmail.com> <124F8BD0-6B74-47AA-B538-8FB9526682C7@ccs.neu.edu> Message-ID: <756daca50809141801t2ca4bdcnf02d182547135b1c@mail.gmail.com> > Grant: When we teach this stuff, we ask three template questions at this > stage (how many clauses in the DD and what do they distinguish; are any of > them structures, extract the fields; do you see self-references, that's > where you indicate recursion) and then we give three hints for coding: > > -- start with the case(s) that don't use recursion; the examples should > tell you how to compute the result there Understood. The base cases are the starting point, and the recipe takes you here. > -- then remind yourself what each subexpression in the remaining clauses > computes That is what I *didn't* do. > -- find a "combinator" that uses just those values and produces the proper > result. I see that (fun (rest a-list-of-something)) is whatever the value for the base condition, and that is how to start figuring out how to replace the template with a combinator (?) that takes you where you want to go. From eli at barzilay.org Sun Sep 14 21:09:14 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:28:29 2009 Subject: [plt-scheme] errotrace in 4.0? In-Reply-To: <48CDB2F0.5040207@ccs.neu.edu> References: <48CD99BE.2040809@ccs.neu.edu> <18637.41410.618896.962198@arabic.ccs.neu.edu> <48CDA345.5070804@ccs.neu.edu> <18637.44981.912478.210041@arabic.ccs.neu.edu> <48CDB2F0.5040207@ccs.neu.edu> Message-ID: <18637.46522.566223.484544@arabic.ccs.neu.edu> On Sep 14, Jon Rafkind wrote: > Oh *rolls eyes*. Regardless of whether I wanted the profiler I need > to do something like > > mzscheme -l errortrace -f somefile.ss > > And if I want the profiler then I should really do > > mzscheme -f top-level.ss > > where top-level.ss doesn't have #lang scheme and does the work of > require'ing errortrace and turning profiling information on. > > That would be nice to put in the quick start guide. Anyway, thanks > for setting me straight. A non-quick-start option: * Get http://barzilay.org/interactive.ss, and load it from your ~/.mzschemerc, winooski:/tmp eli> mz Welcome to MzScheme v4.1.0.3 [3m], Copyright (c) 2004-2008 PLT Scheme Inc. -> ,prof + -> ,r x.ss 20100 -> ,prof * Sorting profile data... ========================================================= time = 0 : no. = 201 : foo in # ========================================================= time = 0 : no. = 1 : #f in # Total samples: 0 -> ,h prof profile (prof): profiler control > ,prof [ ...] [...blah blah blah...] -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From mark.engelberg at gmail.com Sun Sep 14 22:20:01 2008 From: mark.engelberg at gmail.com (Mark Engelberg) Date: Thu Mar 26 02:28:30 2009 Subject: [plt-scheme] Steal your face Scheme T-shirts In-Reply-To: <0114C548-8A03-49B5-BAC7-9B41BE686B7C@gmail.com> References: <1221432006.10040.7.camel@wfi-laptop> <0114C548-8A03-49B5-BAC7-9B41BE686B7C@gmail.com> Message-ID: I would be interested in a T-shirt with the standard PLT logo, but not the version with the skull. From matthias at ccs.neu.edu Sun Sep 14 22:25:59 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:28:30 2009 Subject: [plt-scheme] HTDP: 9.5.5 In-Reply-To: <756daca50809141801t2ca4bdcnf02d182547135b1c@mail.gmail.com> References: <756daca50809131546j662a4c16yed969de3ad4d7057@mail.gmail.com> <48CC454F.2060600@soegaard.net> <756daca50809131633l317506eeod70fa58bb303925e@mail.gmail.com> <11C1B73E-6826-42D0-B71F-14690EAB59DF@ccs.neu.edu> <756daca50809132006g73e5857fy91f1cd6ca787975a@mail.gmail.com> <124F8BD0-6B74-47AA-B538-8FB9526682C7@ccs.neu.edu> <756daca50809141801t2ca4bdcnf02d182547135b1c@mail.gmail.com> Message-ID: On Sep 14, 2008, at 9:01 PM, Grant Rettke wrote: > >> -- then remind yourself what each subexpression in the remaining >> clauses >> computes > > That is what I *didn't* do. You can. Interpret the PURPOSE statement properly and you have it. >> -- find a "combinator" that uses just those values and produces >> the proper >> result. > > I see that (fun (rest a-list-of-something)) is whatever the value for > the base condition, and that is how to start figuring out how to > replace the template with a combinator (?) that takes you where you > want to go. NO NEED to unwind anything. See above. From dherman at ccs.neu.edu Sun Sep 14 22:28:18 2008 From: dherman at ccs.neu.edu (Dave Herman) Date: Thu Mar 26 02:28:30 2009 Subject: [plt-scheme] scheme/class: attaching properties to classes In-Reply-To: <20080912233604.F35EA6500AF@mail-svr1.cs.utah.edu> References: <20080912151503.7804F6500A8@mail-svr1.cs.utah.edu> <20080912233604.F35EA6500AF@mail-svr1.cs.utah.edu> Message-ID: <48CDC842.3010104@ccs.neu.edu> > With the latest in SVN, a class can implement `printable<%>' (which is > exported by `scheme/class') and define its `custom-write' and > `custom-display' methods to get custom printing. Classy. ;) Dave From grettke at acm.org Sun Sep 14 23:32:56 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:30 2009 Subject: [plt-scheme] HTDP: 9.5.5 In-Reply-To: References: <756daca50809131546j662a4c16yed969de3ad4d7057@mail.gmail.com> <48CC454F.2060600@soegaard.net> <756daca50809131633l317506eeod70fa58bb303925e@mail.gmail.com> <11C1B73E-6826-42D0-B71F-14690EAB59DF@ccs.neu.edu> <756daca50809132006g73e5857fy91f1cd6ca787975a@mail.gmail.com> <124F8BD0-6B74-47AA-B538-8FB9526682C7@ccs.neu.edu> <756daca50809141801t2ca4bdcnf02d182547135b1c@mail.gmail.com> Message-ID: <756daca50809142032yd4a5e15rdc4eabb2f1d45eca@mail.gmail.com> > You can. Interpret the PURPOSE statement properly and you have it. > NO NEED to unwind anything. See above. I'll keep at it. From iba at westmont.edu Mon Sep 15 01:36:28 2008 From: iba at westmont.edu (wayne iba) Date: Thu Mar 26 02:28:30 2009 Subject: [plt-scheme] Steal your face Scheme T-shirts In-Reply-To: References: <1221432006.10040.7.camel@wfi-laptop> Message-ID: <1221456988.18813.1.camel@wfi-laptop> I was thinking of using Brad Lucier's Steal-your-face version rather than Matthew's original lambdahead. Brad and/or Matthew: do you have any objections to my using one of your images? --Wayne On Sun, 2008-09-14 at 18:36 -0500, Shriram Krishnamurthi wrote: > You do know the lambdahead logo, yes? > > http://people.cs.uchicago.edu/~robby/logos/ > > Back before Matthew became respectable. > > S. > > On Sun, Sep 14, 2008 at 5:40 PM, wayne iba wrote: > > I was planning to print up a set of T-shirts with the steal your face > > plt-scheme logo. Mostly, I wanted a few for myself, but since the > > printers have a minimum order, I was going to use some extras as prizes > > for the top scores on exams or some such nonsense. So while I'm at it, > > I thought I would check in with you'all to see if anyone here would be > > interested. (I'm only sampling interest -- I'll send out the actual > > design and final price with shipping later if there is interest.) > > > > On a related note, I'm wondering about letting the logo speak for > > itself, simply put "DrScheme" under the logo, or have some other text > > printed. If something else, what would you suggest? A Grateful Dead > > pun would be ideal, but nothing has come to mind yet. > > > > Cheers, > > --Wayne > > > > _________________________________________________ > > For list-related administrative tasks: > > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From mvanier42 at gmail.com Mon Sep 15 01:39:55 2008 From: mvanier42 at gmail.com (Michael Vanier) Date: Thu Mar 26 02:28:31 2009 Subject: [plt-scheme] Using check-expect in the module language Message-ID: <48CDF52B.6030805@cs.caltech.edu> I'm trying to use the check-expect form from the teaching languages in the module language, but it doesn't work the way I expected. For instance: > > #lang scheme > > (require test-engine/scheme-tests) > > (define (double x) > (* x 2)) > > (check-expect (double 10) 30.2) > Doesn't report an error. What do I need to do to get it to report the error in the same form as in the teaching languages? Thanks, Mike From grettke at acm.org Mon Sep 15 01:54:35 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:31 2009 Subject: [plt-scheme] Using check-expect in the module language In-Reply-To: <48CDF52B.6030805@cs.caltech.edu> References: <48CDF52B.6030805@cs.caltech.edu> Message-ID: <756daca50809142254q44e8c6acg3539e9d000bb6487@mail.gmail.com> #lang scheme (require htdp/testing) (check-expect 1 2) (generate-report) htdp/testing exports everything from test-engine/scheme-tests. From mvanier42 at gmail.com Mon Sep 15 02:00:04 2008 From: mvanier42 at gmail.com (Michael Vanier) Date: Thu Mar 26 02:28:31 2009 Subject: [plt-scheme] Using check-expect in the module language In-Reply-To: <756daca50809142254q44e8c6acg3539e9d000bb6487@mail.gmail.com> References: <48CDF52B.6030805@cs.caltech.edu> <756daca50809142254q44e8c6acg3539e9d000bb6487@mail.gmail.com> Message-ID: <48CDF9E4.7090200@cs.caltech.edu> Grant Rettke wrote: > #lang scheme > (require htdp/testing) > (check-expect 1 2) > (generate-report) > > htdp/testing exports everything from test-engine/scheme-tests. > Cool, that's just what I need. I kind of like the HtDP display of the results, though, which this doesn't give. Do you know how to get that? It's not important, but I'm curious. Mike From marek at xivilization.net Mon Sep 15 05:05:51 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:28:31 2009 Subject: [plt-scheme] Documenting Scheme code In-Reply-To: <932b2f1f0809141555t577c64e7q4bf26763d18e5161@mail.gmail.com> References: <20080914190003.657234d4@halmanfloyd.lan.local> <756daca50809141040s61a0b66cy8e339f13c0268d03@mail.gmail.com> <932b2f1f0809141433q58d30b8flb5cbfe8c8b74cd16@mail.gmail.com> <756daca50809141546n5fcaead7sbc501576e1046c7c@mail.gmail.com> <932b2f1f0809141555t577c64e7q4bf26763d18e5161@mail.gmail.com> Message-ID: <20080915110551.216a0b65@halmanfloyd.lan.local> On Sun, 14 Sep 2008 17:55:49 -0500 "Robby Findler" wrote: > Oh, I see that it isn't documented yet. I thought that it was ready > for consumption, apologies. I was puzzled yesterday, too. But I thought it was just another of these "Marek does not know how to search" cases. > Lets say that, for now, scribble's infrastructure supports in-code > docs and we're testing it out ourselves. Good to know - then Scribble is the way to go. And until it provide/doc is ready, I'll use out of code documentation just like Grant and Matthias said. Maybe I'll even like it :) So again, thanks for all your answers! regards, Marek From grettke at acm.org Mon Sep 15 10:43:23 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:31 2009 Subject: [plt-scheme] Using check-expect in the module language In-Reply-To: <48CDF9E4.7090200@cs.caltech.edu> References: <48CDF52B.6030805@cs.caltech.edu> <756daca50809142254q44e8c6acg3539e9d000bb6487@mail.gmail.com> <48CDF9E4.7090200@cs.caltech.edu> Message-ID: <756daca50809150743s3765fa35la8b30e8c2c383493@mail.gmail.com> On Mon, Sep 15, 2008 at 1:00 AM, Michael Vanier wrote: > Grant Rettke wrote: >> >> #lang scheme >> (require htdp/testing) >> (check-expect 1 2) >> (generate-report) >> >> htdp/testing exports everything from test-engine/scheme-tests. >> > > Cool, that's just what I need. I kind of like the HtDP display of the > results, though, which this doesn't give. Do you know how to get that? > It's not important, but I'm curious. *I* don't, but I bet someone else here does :). From clements at brinckerhoff.org Thu Sep 11 13:31:02 2008 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:28:32 2009 Subject: [plt-scheme] Re: test-coverage and colorblindness In-Reply-To: <20080911145458.GA28580@cs.brown.edu> References: <20080911041457.GA12539@cs.brown.edu> <20080911145458.GA28580@cs.brown.edu> Message-ID: <989FDA43-795F-4E7B-A9BD-EA3EEAF27CF2@brinckerhoff.org> On Sep 11, 2008, at 7:54 AM, Aleks Bromfield wrote: > Note that my email was prompted by an email from a student: > >> I have red-green color blindness and I can't see the color >> differences >> between the tested and untested lines. Until I read this email >> carefully, I >> thought that "syntactic test suite coverage" was just broken on my >> machine. >> >> Can these colors be changed? I didn't see relevant options in a >> cursory look >> through Preferences. I also had a student last year with this complaint. 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/20080911/bc8778a7/smime.bin From clements at brinckerhoff.org Mon Sep 15 13:00:38 2008 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:28:32 2009 Subject: [plt-scheme] Re: test-coverage and colorblindness In-Reply-To: <989FDA43-795F-4E7B-A9BD-EA3EEAF27CF2@brinckerhoff.org> References: <20080911041457.GA12539@cs.brown.edu> <20080911145458.GA28580@cs.brown.edu> <989FDA43-795F-4E7B-A9BD-EA3EEAF27CF2@brinckerhoff.org> Message-ID: <978E63AB-F682-4224-A81F-5641ACDB0779@brinckerhoff.org> On Sep 11, 2008, at 10:31 AM, John Clements wrote: > > On Sep 11, 2008, at 7:54 AM, Aleks Bromfield wrote: > >> Note that my email was prompted by an email from a student: >> >>> I have red-green color blindness and I can't see the color >>> differences >>> between the tested and untested lines. Until I read this email >>> carefully, I >>> thought that "syntactic test suite coverage" was just broken on my >>> machine. >>> >>> Can these colors be changed? I didn't see relevant options in a >>> cursory look >>> through Preferences. > > I also had a student last year with this complaint. Feh... slow mailer, please ignore. 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/20080915/e13ee83f/smime.bin From kathryn.gray at cl.cam.ac.uk Mon Sep 15 16:33:17 2008 From: kathryn.gray at cl.cam.ac.uk (Kathy Gray) Date: Thu Mar 26 02:28:33 2009 Subject: [plt-scheme] Re: Using check-expect in the module language In-Reply-To: <20080915160036.4BCC8402A6@qua.cs.brown.edu> References: <20080915160036.4BCC8402A6@qua.cs.brown.edu> Message-ID: <328A23F6-49D7-41EA-8657-9A191B32D713@cl.cam.ac.uk> >>> > Date: Sun, 14 Sep 2008 22:39:55 -0700 > From: Michael Vanier > Subject: [plt-scheme] Using check-expect in the module language > To: plt-scheme@list.cs.brown.edu > Message-ID: <48CDF52B.6030805@cs.caltech.edu> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > I'm trying to use the check-expect form from the teaching languages > in the module language, but it doesn't work the way I expected. For > instance: > >> >> #lang scheme >> >> (require test-engine/scheme-tests) >> >> (define (double x) >> (* x 2)) >> >> (check-expect (double 10) 30.2) >> > > Doesn't report an error. What do I need to do to get it to report > the error in the same form as in the teaching languages? > Calling the function test (with no arguments) produces a textual error report on run (like generate-report produces from htdp/testing). If you want the graphical report, you should require test-engine/scheme- gui instead; it provides all of the same functions but opens a window when run instead. At this time, the integrated error window only works in the teaching languages (and the ProfessorJ languages). -Kathy p.s. htdp/testing is deprecated and shouldn't be used From mflatt at cs.utah.edu Mon Sep 15 17:37:13 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:28:33 2009 Subject: [plt-scheme] Event bug under MS Windows In-Reply-To: References: Message-ID: <20080915213713.71A8F65008C@mail-svr1.cs.utah.edu> This was confusing, but I think it's not a bug in MrEd. When you move the mouse down, you end up moving the mouse over the tooltip window --- so the mouse effectively leaves the button window and moves into the tooltip window. When you move up, then you're not moving on top of the initial tooltip window, so you don't get extra leave and enter events. For a while, I thought it really was a bug, because I didn't see the effect that you describe under Mac OS X. But that's just because the window-placement rules are a little strange. Subtract the result of `(get-display-left-top-inset)' from the result of `client->screen' to get the location in the right kind of coordinates. (See the docs for `client->screen' for more information.) With that change, the program runs the same in Mac OS X and Windows: moving down generates extra leave and enter events. You might want to look at `mrlib/switchable-button' to see how it implements tooltips. (It would be nice, of course, to have the tooltip functionality implemented in its own library.) At Sat, 13 Sep 2008 01:33:55 +0200 (CEST), Ivanyi Peter wrote: > Hi, > > The program below tries to simulate a tooltip window. > If you try it under MS Windows and you move the mouse from top > to bottom over the button, you should notice, that it will > print > repeatedly: > > enter > motion > leave > > It is very strange, as when you move the mouse from bottom > to top > over the button it prints one 'enter, a lot of motion and > one 'leave > message. I think this is a bug in MrEd. > Can it be fixed? > > Thanks. > > Peter Ivanyi > > --------------------------------------------------------------------------- > > (module tooltip mzscheme > (require (lib "class.ss") (lib "mred.ss" "mred") (lib > "framework.ss" "framework")) > > (define mred-button-tooltip% > (class button% > > (init-field > (tooltip-text " ") > ) > > ; this is the timer > (define timer #f) > ; whether the tooltip window is shown > (define shown? #f) > ; the tooltip window > (define tooltip #f) > > (define (tooltip:clear) > (if timer > (begin > (send timer stop) > (set! timer #f) > ) > ) > (if (and tooltip shown?) > (begin > (send tooltip show #f) > (set! tooltip #f) > (set! shown? #f) > ) > ) > ) > > (define (tooltip:timer) > (tooltip:clear) > ) > > (define (tooltip:setup text x y) > (let-values > (((sx sy) (send this client->screen x y))) > (let* > ((frame (new frame% > (parent #f) > (label "") > (stretchable-height #f) > (stretchable-width #f) > (x sx) > (y sy) > (width 46) > (height 17) > (border 2) > (style '(no-system-menu no-caption > no-resize-border float)) > ) > ) > (message (new message% (parent frame) (label > text))) > ) > (set! tooltip frame) > (set! timer (new timer% (notify-callback > tooltip:timer) > (interval 3000) > (just-once? #t) > )) > (send tooltip show #t) > (set! shown? #t) > ) > ) > ) > > > (define/override (on-subwindow-event w e) > (cond > ( (equal? (send e get-event-type) 'leave) > (tooltip:clear) > ) > ( (member (send e get-event-type) '(enter)) > (if (not shown?) > (tooltip:setup tooltip-text (send e get-x) > (send e get-y)) > ) > ) > ) > > > (display (send e get-event-type))(newline) > #f > ) > > (super-new) > ) > ) > > (define f (new frame% (label "Test"))) > (define b (new mred-button-tooltip% (parent f) (label > "Hello") (tooltip-text "Button") )) > (send f show #t) > > > ) > > > _______________________________________ > LEGY?L TE IS KLIKKBR?KER! - Befektet?si alapok online az [origo] klikkbankban! > Ne b?zd m?sra a p?nz?gyeidet! Kattints! > k?rjen aj?nlatot most!http://www.klikkbank.hu/klikkbroker/index.html > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From mikeegg1 at mac.com Sun Sep 14 22:22:24 2008 From: mikeegg1 at mac.com (Mike Eggleston) Date: Thu Mar 26 02:28:33 2009 Subject: [plt-scheme] Steal your face Scheme T-shirts In-Reply-To: References: <1221432006.10040.7.camel@wfi-laptop> <0114C548-8A03-49B5-BAC7-9B41BE686B7C@gmail.com> Message-ID: <20080915022224.GC2319@mail.mac.com> On Sun, 14 Sep 2008, Mark Engelberg might have said: > I would be interested in a T-shirt with the standard PLT logo, but not > the version with the skull. I'm odd enough that I'm interested in both! The skull version is like a crossing between _Alien_ and a future dimension. (Not in white, though.) Mike From van_178 at yahoo.co.in Tue Sep 16 04:38:29 2008 From: van_178 at yahoo.co.in (Varoun P) Date: Thu Mar 26 02:28:33 2009 Subject: [plt-scheme] r5rs in plt-scheme 4 and srfi 23 Message-ID: <511809.84372.qm@web8404.mail.in.yahoo.com> Using r5rs in DrScheme, how do I import srfi-23? I've tried setting DrScheme to use the module language and putting the following lines at the beginning of the definitions window: #lang r5rs (require srfi/23) This does not work. --varoun Connect with friends all over the world. Get Yahoo! India Messenger at http://in.messenger.yahoo.com/?wm=n/ From mvanier42 at gmail.com Tue Sep 16 04:57:08 2008 From: mvanier42 at gmail.com (Michael Vanier) Date: Thu Mar 26 02:28:33 2009 Subject: [plt-scheme] rpms for DrScheme 4.1? Message-ID: <48CF74E4.7060604@cs.caltech.edu> Does anyone have an rpm for DrScheme 4.1 that will work on a Red Hat Linux system (RHEL 5 in this case, but Fedora will probably also work)? Mike From mflatt at cs.utah.edu Tue Sep 16 06:45:21 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:28:33 2009 Subject: [plt-scheme] r5rs in plt-scheme 4 and srfi 23 In-Reply-To: <511809.84372.qm@web8404.mail.in.yahoo.com> References: <511809.84372.qm@web8404.mail.in.yahoo.com> Message-ID: <20080916104523.AB2CC650091@mail-svr1.cs.utah.edu> At Tue, 16 Sep 2008 14:08:29 +0530 (IST), Varoun P wrote: > Using r5rs in DrScheme, how do I import srfi-23? I've tried > setting DrScheme to use the module language and putting the following lines at > the beginning of the definitions window: > > #lang r5rs > (require srfi/23) > > This does not work. You can use `#%require': #lang r5rs (#%require srfi/23) Matthew From van_178 at yahoo.co.in Tue Sep 16 09:09:02 2008 From: van_178 at yahoo.co.in (Varoun P) Date: Thu Mar 26 02:28:34 2009 Subject: [plt-scheme] r5rs in plt-scheme 4 and srfi 23 In-Reply-To: <20080916104523.AB2CC650091@mail-svr1.cs.utah.edu> Message-ID: <836812.30106.qm@web8402.mail.in.yahoo.com> --- On Tue, 16/9/08, Matthew Flatt wrote: > From: Matthew Flatt > Subject: Re: [plt-scheme] r5rs in plt-scheme 4 and srfi 23 > To: van_178@yahoo.co.in > Cc: plt-scheme@list.cs.brown.edu > Date: Tuesday, 16 September, 2008, 4:15 PM > At Tue, 16 Sep 2008 14:08:29 +0530 (IST), Varoun P wrote: > > Using r5rs in DrScheme, how do I import srfi-23? > I've tried > > setting DrScheme to use the module language and > putting the following lines at > > the beginning of the definitions window: > > > > #lang r5rs > > (require srfi/23) > > > > This does not work. > > You can use `#%require': > > #lang r5rs > (#%require srfi/23) > > > Matthew That worked. Thanks! --varoun Connect with friends all over the world. Get Yahoo! India Messenger at http://in.messenger.yahoo.com/?wm=n/ From eli at barzilay.org Tue Sep 16 09:09:25 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:28:34 2009 Subject: [plt-scheme] rpms for DrScheme 4.1? In-Reply-To: <48CF74E4.7060604@cs.caltech.edu> References: <48CF74E4.7060604@cs.caltech.edu> Message-ID: <18639.45061.745430.100112@arabic.ccs.neu.edu> On Sep 16, Michael Vanier wrote: > Does anyone have an rpm for DrScheme 4.1 that will work on a Red Hat > Linux system (RHEL 5 in this case, but Fedora will probably also work)? The most recent RPM that I see is 4.0 (for Fedora, which is likely to work on RHEL). But you can also use the installers that we have (on download.plt-scheme.org) -- you can either use them to install plt in a single directory (which is convenient to move or update), or you can use the "unixstyle" thing that spreads the files into the right places. In the latter case it will also create a "plt-uninstall" script that will remove the files from all of these places (and running a later installer will find such a script, if it's there, and will run it for you). -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From pivanyi at freemail.hu Tue Sep 16 12:54:33 2008 From: pivanyi at freemail.hu (Ivanyi Peter) Date: Thu Mar 26 02:28:34 2009 Subject: [plt-scheme] Event bug under MS Windows In-Reply-To: <20080915213713.71A8F65008C@mail-svr1.cs.utah.edu> Message-ID: Matthew Flatt ?rta: > This was confusing, but I think it's not a bug in MrEd. > > When you move the mouse down, you end up moving the mouse over the > tooltip window --- so the mouse effectively leaves the button window > and moves into the tooltip window. > > When you move up, then you're not moving on top of the initial tooltip > window, so you don't get extra leave and enter events. Oh, suga.... Matthew you are a genius. :-))) Yes it makes perfect sense. Sorry, it is my mistake. Thanks very much. Best regards, Peter

________________________________________________________
Pr?b?lja ki a Mal?v-Citibank Hitelk?rty?t 0 Ft els? ?ves d?jjal ?s aj?nd?kozza meg mag?t b?nusz rep?l?jeggyel! R?szletek From garcia at cs.indiana.edu Tue Sep 16 12:52:50 2008 From: garcia at cs.indiana.edu (Ronald Garcia) Date: Thu Mar 26 02:28:34 2009 Subject: [plt-scheme] [redex] Alternative to named holes Message-ID: Howdy, I am looking at upgrading a project to use the version of PLT Redex that ships with PLT Scheme v4.1, but I am using named holes and I noticed that named holes have been removed from the system. First, why were they removed? Second, are there any standard or suggested workarounds for their absence? Thanks, ron From Ryan at ryanaghdam.com Tue Sep 16 11:47:47 2008 From: Ryan at ryanaghdam.com (Ryan Aghdam) Date: Thu Mar 26 02:28:34 2009 Subject: [plt-scheme] Re: Steal your face Scheme T-shirts In-Reply-To: <20080915022224.GC2319@mail.mac.com> References: <1221432006.10040.7.camel@wfi-laptop> <0114C548-8A03-49B5-BAC7-9B41BE686B7C@gmail.com> <20080915022224.GC2319@mail.mac.com> Message-ID: <7032f50a-64ab-4f84-a484-193595255a72@2g2000hsn.googlegroups.com> I'd definately buy the Grateful Dead one. On Sep 14, 10:22?pm, Mike Eggleston wrote: > On Sun, 14 Sep 2008, Mark Engelberg might have said: > > > I would be interested in a T-shirt with the standard PLT logo, but not > > the version with the skull. > > I'm odd enough that I'm interested in both! The skull version is > like a crossing between _Alien_ and a future dimension. (Not in > white, though.) > > Mike > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme From robby at cs.uchicago.edu Tue Sep 16 14:18:02 2008 From: robby at cs.uchicago.edu (robby@cs.uchicago.edu) Date: Thu Mar 26 02:28:35 2009 Subject: [plt-scheme] Re: [redex] Alternative to named holes In-Reply-To: References: Message-ID: <932b2f1f0809161118i3e525554j628485d329dcb13a@mail.gmail.com> They were removed because all of the (non-trivial) uses of them we know of were broken, in the sense that any language that used them also had the property that they triggered the "zero/multiple holes" error, for some expression in the language. Also, all of those uses could be rewritten to fix the error but also to remove the use if multiple holes. If you're not sure how to rewrite out the named holes, send me something and I can probably help. Robby On 9/16/08, Ronald Garcia wrote: > Howdy, > > I am looking at upgrading a project to use the version of PLT Redex > that ships with PLT Scheme v4.1, but I am using named holes and I > noticed that named holes have been removed from the system. First, > why were they removed? Second, are there any standard or suggested > workarounds for their absence? > > Thanks, > ron > > > From mikeegg1 at mac.com Tue Sep 16 16:54:48 2008 From: mikeegg1 at mac.com (Mike Eggleston) Date: Thu Mar 26 02:28:35 2009 Subject: [plt-scheme] documents? Message-ID: <20080916205448.GG10189@mail.mac.com> Morning, I've misplaced my links to the documents (HtDP, etc). I looked at http://plt-scheme.org, but didn't find any pdf files. Am I looking in the wrong place or are there no longer any pdf files? Mike From eli at barzilay.org Tue Sep 16 18:25:05 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:28:35 2009 Subject: [plt-scheme] documents? In-Reply-To: <20080916205448.GG10189@mail.mac.com> References: <20080916205448.GG10189@mail.mac.com> Message-ID: <18640.12865.334089.241383@arabic.ccs.neu.edu> On Sep 16, Mike Eggleston wrote: > Morning, > > I've misplaced my links to the documents (HtDP, etc). I looked at > http://plt-scheme.org, but didn't find any pdf files. Am I looking > in the wrong place or are there no longer any pdf files? There is no PDF version of HtDP, see also http://list.cs.brown.edu/pipermail/plt-scheme/2008-March/023935.html -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From jay.mccarthy at gmail.com Tue Sep 16 18:59:22 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:28:35 2009 Subject: [plt-scheme] Formlets in PLT Message-ID: The Links group has created formlets: http://groups.inf.ed.ac.uk/links/formlets/ I have spent the afternoon implementing formlets in PLT. -- In the latest SVN, there is a web-server/formlets directory with a 'formlets' module. Here is a simple example: ==== Define some basic functions & structures #lang scheme (require web-server/formlets/formlets) (define-struct date (month day)) (define (date->xml d) (format "~a/~a" (date-month d) (date-day d))) (define (submit t) `(input ([type "submit"]) ,t)) ==== Now for the first formlet: (define date-formlet (formlet (div "Month:" ,{input-int . => . month} "Day:" ,{input-int . => . day}) (make-date month day))) ==== The first part is the display of the formlet, the second is how it should be processed. The => syntax tells the formlet macro that month and day should be bound in the processor as the result of inputing integers. (formlet-display date-formlet) ==== Displaying this formlet returns the following xexpr forest (list): ((div () "Month:" (input ((name "input_0"))) "Day:" (input ((name "input_1"))))) ==== The input names are automatically generated. ==== Formlets can be composed: (define travel-formlet (formlet (#%# "Name:" ,{input-string . => . name} (div "Arrive:" ,{date-formlet . => . arrive} "Depart:" ,{date-formlet . => . depart}) ,@(list "1" "2" "3") ,(submit "Submit")) (list name arrive depart))) ==== The #%# is to note an xexpr forest. Notice that date-formlet is used to embed the date formlet twice in the travel formlet. The display portion of a formlet is implicitly in a quasiquote, so ,@ and , work as before. (formlet-display travel-formlet) ==== The travel formlet is displayed as follows: ("Name:" (input ((name "input_0"))) (div () "Arrive:" (div () "Month:" (input ((name "input_1"))) "Day:" (input ((name "input_2")))) "Depart:" (div () "Month:" (input ((name "input_3"))) "Day:" (input ((name "input_4"))))) "1" "2" "3" (input ((type "submit")) "Submit")) ==== Notice the input names are guaranteed to not conflict. ==== Let's embed this formlet into a web page that does the following with the result: (define display-itinernary (match-lambda [(list name arrive depart) `(html (head (title "Itinerary")) (body "Itinerary for: " ,name "Arriving:" ,(date->xml arrive) "Departing:" ,(date->xml depart)))])) ==== This provides send/formlet, which wraps a formlet in send/suspend (require web-server/formlets/servlet) (define (start request) (display-itinernary (send/formlet travel-formlet))) ==== embed-formlet is also available to put a formlet inside of send/suspend/dispatch -- Currently formlet combinators are provided for input-string, input-integer, and input-symbol. More will come as the library is used. I also plan on working on input validation, etc. Jay -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From rob.hunter at gmail.com Tue Sep 16 20:59:41 2008 From: rob.hunter at gmail.com (Rob Hunter) Date: Thu Mar 26 02:28:35 2009 Subject: [plt-scheme] Using web-server/servlet-env to host a root level servlet Message-ID: Hi, I'm trying out the web server code described here (http://docs.plt-scheme.org/web-server/servlet-env_ss.html), but I can't figure out how to make my servlet hosted at the root level. For example, the program (require web-server/servlet-env) (serve/servlet (lambda (req) "hiya") #:servlet-path (string->path "foo.ss")) gives my a page at http://localhost:8000/foo.ss, but changing the path to "" or "." doesn't work. Any suggestions? Thanks, Rob From matthias at ccs.neu.edu Tue Sep 16 22:07:16 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:28:35 2009 Subject: [plt-scheme] documents? In-Reply-To: <20080916205448.GG10189@mail.mac.com> References: <20080916205448.GG10189@mail.mac.com> Message-ID: http://www.htdp.org On Sep 16, 2008, at 4:54 PM, Mike Eggleston wrote: > Morning, > > I've misplaced my links to the documents (HtDP, etc). > I looked at http://plt-scheme.org, but didn't find any pdf files. > Am I looking in the wrong place or are there no longer any pdf files? > > Mike > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From noelwelsh at gmail.com Wed Sep 17 02:18:45 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:28:35 2009 Subject: [plt-scheme] Formlets in PLT In-Reply-To: References: Message-ID: Awesome! I just read the paper yesterday and was thinking along the same lines. N. On Tue, Sep 16, 2008 at 11:59 PM, Jay McCarthy wrote: > The Links group has created formlets: > > http://groups.inf.ed.ac.uk/links/formlets/ > > I have spent the afternoon implementing formlets in PLT. ... From marek at xivilization.net Wed Sep 17 05:17:34 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:28:36 2009 Subject: [plt-scheme] documents? In-Reply-To: <20080916205448.GG10189@mail.mac.com> References: <20080916205448.GG10189@mail.mac.com> Message-ID: <20080917111734.4c13c97e@halmanfloyd.lan.local> On Tue, 16 Sep 2008 15:54:48 -0500 Mike Eggleston wrote: > I've misplaced my links to the documents (HtDP, etc). > I looked at http://plt-scheme.org, but didn't find any pdf files. > Am I looking in the wrong place or are there no longer any pdf files? If you're looking for the PLT docs; the latest release can be downloaded here: . regards, Marek From dherman at ccs.neu.edu Wed Sep 17 06:38:45 2008 From: dherman at ccs.neu.edu (Dave Herman) Date: Thu Mar 26 02:28:36 2009 Subject: [plt-scheme] Formlets in PLT In-Reply-To: References: Message-ID: <48D0DE35.2070308@ccs.neu.edu> > In the latest SVN, there is a web-server/formlets directory with a > 'formlets' module. How about a `main' module in the web-server/formlets directory... > (require web-server/formlets/formlets) ...so you could write (require web-server/formlets)? Dave From spdegabrielle at gmail.com Wed Sep 17 06:53:49 2008 From: spdegabrielle at gmail.com (Stephen De Gabrielle) Date: Thu Mar 26 02:28:36 2009 Subject: [plt-scheme] DrScheme tool development practices Message-ID: <595b9ab20809170353h35020b0en9df0842dd8011bfa@mail.gmail.com> Hi, I'm just hunting for tips on how to speed up my DrScheme tool development activities; I'm currently doing the following rain dance - planet create - planet fileinject - start DrScheme - test - stop DrScheme - planet remove - edit and depending on my machine I may have one or two installs of drscheme running (one for editing, one for testing) does anyone have any tips? Cheers, Stephen -- Stephen De Gabrielle s.degabrielle@cs.ucl.ac.uk Telephone +44 (0)20 7679 0693 (x30693) Mobile 079 851 890 45 Project: Making Sense of Information (MaSI) Work:http://www.uclic.ucl.ac.uk/annb/MaSI.html Home:http://www.degabrielle.name/stephen UCL Interaction Centre MPEB 8th floor University College London Gower Street London WC1E 6BT -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080917/63283353/attachment.htm From eli at barzilay.org Wed Sep 17 06:54:35 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:28:36 2009 Subject: [plt-scheme] Formlets in PLT In-Reply-To: <48D0DE35.2070308@ccs.neu.edu> References: <48D0DE35.2070308@ccs.neu.edu> Message-ID: <18640.57835.359784.558389@arabic.ccs.neu.edu> On Sep 17, Dave Herman wrote: > > In the latest SVN, there is a web-server/formlets directory with a > > 'formlets' module. > > How about a `main' module in the web-server/formlets directory... > > > (require web-server/formlets/formlets) > > ...so you could write (require web-server/formlets)? The `main.ss' thing works only at the top level of a collection. -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From dherman at ccs.neu.edu Wed Sep 17 07:01:47 2008 From: dherman at ccs.neu.edu (Dave Herman) Date: Thu Mar 26 02:28:37 2009 Subject: [plt-scheme] Formlets in PLT In-Reply-To: <18640.57835.359784.558389@arabic.ccs.neu.edu> References: <48D0DE35.2070308@ccs.neu.edu> <18640.57835.359784.558389@arabic.ccs.neu.edu> Message-ID: <48D0E39B.2040805@ccs.neu.edu> > The `main.ss' thing works only at the top level of a collection. Oh right. Foo. From mikeegg1 at mac.com Wed Sep 17 07:32:50 2008 From: mikeegg1 at mac.com (Mike Eggleston) Date: Thu Mar 26 02:28:37 2009 Subject: [plt-scheme] documents? In-Reply-To: <20080917111734.4c13c97e@halmanfloyd.lan.local> References: <20080916205448.GG10189@mail.mac.com> <20080917111734.4c13c97e@halmanfloyd.lan.local> Message-ID: <20080917113250.GB13147@mail.mac.com> On Wed, 17 Sep 2008, Marek Kubica might have said: > On Tue, 16 Sep 2008 15:54:48 -0500 > Mike Eggleston wrote: > > > I've misplaced my links to the documents (HtDP, etc). > > I looked at http://plt-scheme.org, but didn't find any pdf files. > > Am I looking in the wrong place or are there no longer any pdf files? > > If you're looking for the PLT docs; the latest release can be downloaded > here: . > > regards, > Marek I'll look there as soon as I finish my morning server checks. I've been researching the Amazon Kindle and since it doesn't support PDFs, I'll use 'pdftotext' for converting the PDF files to text. I could use wget then links to generate text documents from html pages, but I thinking text from pdf will look and read better. Mike From marek at xivilization.net Wed Sep 17 07:40:48 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:28:37 2009 Subject: [plt-scheme] documents? In-Reply-To: <20080917113250.GB13147@mail.mac.com> References: <20080916205448.GG10189@mail.mac.com> <20080917111734.4c13c97e@halmanfloyd.lan.local> <20080917113250.GB13147@mail.mac.com> Message-ID: <20080917134048.4eb35b74@halmanfloyd.lan.local> On Wed, 17 Sep 2008 06:32:50 -0500 Mike Eggleston wrote: > I'll look there as soon as I finish my morning server checks. I've > been researching the Amazon Kindle and since it doesn't support PDFs, > I'll use 'pdftotext' for converting the PDF files to text. I could > use wget then links to generate text documents from html pages, but I > thinking text from pdf will look and read better. Big parts of the PLT documentation are written using Scribble-markup which then is converted into HTML. But Scribble can also output text directly, so if you regenerate the documentation as text, you don't have to mess with PDF at all. regards, Marek From mflatt at cs.utah.edu Wed Sep 17 07:49:12 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:28:37 2009 Subject: [plt-scheme] Formlets in PLT In-Reply-To: <18640.57835.359784.558389@arabic.ccs.neu.edu> References: <48D0DE35.2070308@ccs.neu.edu> <18640.57835.359784.558389@arabic.ccs.neu.edu> Message-ID: <20080917114914.1574F650091@mail-svr1.cs.utah.edu> At Wed, 17 Sep 2008 06:54:35 -0400, Eli Barzilay wrote: > On Sep 17, Dave Herman wrote: > > > In the latest SVN, there is a web-server/formlets directory with a > > > 'formlets' module. > > > > How about a `main' module in the web-server/formlets directory... > > > > > (require web-server/formlets/formlets) > > > > ...so you could write (require web-server/formlets)? > > The `main.ss' thing works only at the top level of a collection. But if you want to use the path `web-server/formlets' (which seems like a good idea to me), you just create a "formlets.ss" in the "web-server" collection. From eli at barzilay.org Wed Sep 17 07:59:06 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:28:37 2009 Subject: [plt-scheme] Formlets in PLT In-Reply-To: <20080917114914.1574F650091@mail-svr1.cs.utah.edu> References: <48D0DE35.2070308@ccs.neu.edu> <18640.57835.359784.558389@arabic.ccs.neu.edu> <20080917114914.1574F650091@mail-svr1.cs.utah.edu> Message-ID: <18640.61706.23074.719443@arabic.ccs.neu.edu> On Sep 17, Matthew Flatt wrote: > At Wed, 17 Sep 2008 06:54:35 -0400, Eli Barzilay wrote: > > On Sep 17, Dave Herman wrote: > > > > In the latest SVN, there is a web-server/formlets directory with a > > > > 'formlets' module. > > > > > > How about a `main' module in the web-server/formlets directory... > > > > > > > (require web-server/formlets/formlets) > > > > > > ...so you could write (require web-server/formlets)? > > > > The `main.ss' thing works only at the top level of a collection. > > But if you want to use the path `web-server/formlets' (which seems > like a good idea to me), you just create a "formlets.ss" in the > "web-server" collection. I should have mentioned that... And BTW -- it might seem bad to have the formlet functionality "leak" out to the webserver collection just to get a more convenient name, but there's a solution for that: keep the code inside the formlets directory, and make "web-server/formlets.ss" be a simple wrapper module that reprovides everything from the directory (which is roughly the same as a symlink in its complexity). -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From mikeegg1 at mac.com Wed Sep 17 08:02:45 2008 From: mikeegg1 at mac.com (Mike Eggleston) Date: Thu Mar 26 02:28:37 2009 Subject: [plt-scheme] documents? In-Reply-To: References: <20080916205448.GG10189@mail.mac.com> <20080917111734.4c13c97e@halmanfloyd.lan.local> <20080917113250.GB13147@mail.mac.com> Message-ID: <20080917120245.GD13147@mail.mac.com> On Wed, 17 Sep 2008, Matt Jadud might have said: > On Wed, Sep 17, 2008 at 7:32 AM, Mike Eggleston wrote: > > I'll look there as soon as I finish my morning server checks. I've been > > researching the Amazon Kindle and since it doesn't support PDFs, I'll use > > 'pdftotext' for converting the PDF files to text. I could use wget then > > links to generate text documents from html pages, but I thinking text > > from pdf will look and read better. > > Hi Mike, > > The iLiad is a bit more open than the Kindle, and will support PDF (as > well as a number of other formats). You pay for the openness... it's > more expensive. > > Likewise, I think the Sony reader will play will with PDF. Again, even > from Sony, probably more open. > > I will say that I think (but am not sure) that we'll be seeing 8.5 x > 11 sized readers (or possibly A4) sometime within the year. At least, > there's more than one company out there with working prototypes of > full-page sized devices. I've owned an iLiad for some time, and find > it is only useful for content that is formatted to A5 or 1/2 US > Letter. Anything else, and it's a pain to use. (Well, I loose patience > scrolling around with a stylus.) > > Cheers, > Matt I have heard of the Sony and I do like not having a cellular radio that can be used to track my movements (like the Kindle has, though the radio can be turned off). I've not heard of the iLiad. I'll research it today. Thanks. Mike From grettke at acm.org Wed Sep 17 08:40:33 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:37 2009 Subject: [plt-scheme] DrScheme tool development practices In-Reply-To: <595b9ab20809170353h35020b0en9df0842dd8011bfa@mail.gmail.com> References: <595b9ab20809170353h35020b0en9df0842dd8011bfa@mail.gmail.com> Message-ID: <756daca50809170540p183a3f2cl6aa21395c4144f9d@mail.gmail.com> Hi Stephen, On Wed, Sep 17, 2008 at 5:53 AM, Stephen De Gabrielle wrote: > I'm currently doing the following rain dance > and depending on my machine I may have one or two installs of drscheme > running (one for editing, one for testing) > > does anyone have any tips? http://docs.plt-scheme.org/planet/Developing_Packages_for_PLaneT.html#(part._devlinks) From noelwelsh at gmail.com Wed Sep 17 08:53:03 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:28:38 2009 Subject: [plt-scheme] DrScheme tool development practices In-Reply-To: <595b9ab20809170353h35020b0en9df0842dd8011bfa@mail.gmail.com> References: <595b9ab20809170353h35020b0en9df0842dd8011bfa@mail.gmail.com> Message-ID: Sake. On PLaneT. Beer. In the fridge. N. On Wed, Sep 17, 2008 at 11:53 AM, Stephen De Gabrielle wrote: > Hi, > > I'm just hunting for tips on how to speed up my DrScheme tool development > activities; ... From spdegabrielle at gmail.com Wed Sep 17 08:56:04 2008 From: spdegabrielle at gmail.com (Stephen De Gabrielle) Date: Thu Mar 26 02:28:38 2009 Subject: [plt-scheme] DrScheme tool development practices In-Reply-To: References: <595b9ab20809170353h35020b0en9df0842dd8011bfa@mail.gmail.com> Message-ID: <595b9ab20809170556n7bfbb258h86fe3630f1bc2953@mail.gmail.com> Have given up beer fro a while to lose some weight and stop snoring. I never realised it helped in developing on DrScheme, s. On Wed, Sep 17, 2008 at 1:53 PM, Noel Welsh wrote: > Sake. On PLaneT. > > Beer. In the fridge. > > N. > > On Wed, Sep 17, 2008 at 11:53 AM, Stephen De Gabrielle > wrote: > > Hi, > > > > I'm just hunting for tips on how to speed up my DrScheme tool development > > activities; > ... > -- Cheers, Stephen -- Stephen De Gabrielle s.degabrielle@cs.ucl.ac.uk Telephone +44 (0)20 7679 0693 (x30693) Mobile 079 851 890 45 Project: Making Sense of Information (MaSI) Work:http://www.uclic.ucl.ac.uk/annb/MaSI.html Home:http://www.degabrielle.name/stephen UCL Interaction Centre MPEB 8th floor University College London Gower Street London WC1E 6BT -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080917/ac193ca0/attachment.html From marek at xivilization.net Wed Sep 17 09:01:15 2008 From: marek at xivilization.net (Marek Kubica) Date: Thu Mar 26 02:28:38 2009 Subject: [plt-scheme] documents? In-Reply-To: <20080917120245.GD13147@mail.mac.com> References: <20080916205448.GG10189@mail.mac.com> <20080917111734.4c13c97e@halmanfloyd.lan.local> <20080917113250.GB13147@mail.mac.com> <20080917120245.GD13147@mail.mac.com> Message-ID: <20080917150115.4e13fed8@halmanfloyd.lan.local> On Wed, 17 Sep 2008 07:02:45 -0500 Mike Eggleston wrote: > I have heard of the Sony and I do like not having a cellular radio > that can be used to track my movements (like the Kindle has, though > the radio can be turned off). I've not heard of the iLiad. I'll > research it today. According to Wikipedia, you can also convert PDF to AZW, which probably yields better results. regards, Marek From gustavo at oma.org.ar Tue Sep 16 16:37:14 2008 From: gustavo at oma.org.ar (Gustavo Massaccesi) Date: Thu Mar 26 02:28:38 2009 Subject: [plt-scheme] immutable? and numbers Message-ID: I tried this: -------- Welcome to DrScheme, version 372 [3m]. Language: Textual (MzScheme, includes R5RS) custom. > (immutable? 5) false > -------- I was surprised because it returns #f and not #t. It is the correct behaviour, according to the manual. But, since it is impossible to mutate 5, it is not the result I expected. Gustavo From mflatt at cs.utah.edu Wed Sep 17 09:15:44 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:28:39 2009 Subject: [plt-scheme] immutable? and numbers In-Reply-To: References: Message-ID: <20080917131546.2C3D465009C@mail-svr1.cs.utah.edu> At Tue, 16 Sep 2008 17:37:14 -0300, "Gustavo Massaccesi" wrote: > I tried this: > > -------- > Welcome to DrScheme, version 372 [3m]. > Language: Textual (MzScheme, includes R5RS) custom. > > (immutable? 5) > false > > > -------- > > I was surprised because it returns #f and not #t. > > It is the correct behaviour, according to the manual. But, since it is > impossible to mutate 5, it is not the result I expected. Agreed. `immutable?' really should have been called something like `immutable-variant-of-datatype-that-could-be-mutable?'. Matthew From noelwelsh at gmail.com Wed Sep 17 09:21:49 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:28:39 2009 Subject: [plt-scheme] DrScheme tool development practices In-Reply-To: <595b9ab20809170556n7bfbb258h86fe3630f1bc2953@mail.gmail.com> References: <595b9ab20809170353h35020b0en9df0842dd8011bfa@mail.gmail.com> <595b9ab20809170556n7bfbb258h86fe3630f1bc2953@mail.gmail.com> Message-ID: On Wed, Sep 17, 2008 at 1:56 PM, Stephen De Gabrielle wrote: > .... I never realised it helped in developing on DrScheme. It probably doesn't, but it certainly does make subjective time pass faster. N. From eli at barzilay.org Wed Sep 17 09:23:29 2008 From: eli at barzilay.org (Eli Barzilay) Date: Thu Mar 26 02:28:39 2009 Subject: [plt-scheme] immutable? and numbers In-Reply-To: <20080917131546.2C3D465009C@mail-svr1.cs.utah.edu> References: <20080917131546.2C3D465009C@mail-svr1.cs.utah.edu> Message-ID: <18641.1233.994056.416880@arabic.ccs.neu.edu> On Sep 17, Matthew Flatt wrote: > At Tue, 16 Sep 2008 17:37:14 -0300, "Gustavo Massaccesi" wrote: > > I tried this: > > > > -------- > > Welcome to DrScheme, version 372 [3m]. > > Language: Textual (MzScheme, includes R5RS) custom. > > > (immutable? 5) > > false > > > > > -------- > > > > I was surprised because it returns #f and not #t. > > > > It is the correct behaviour, according to the manual. But, since it is > > impossible to mutate 5, it is not the result I expected. > > Agreed. `immutable?' really should have been called something like > `immutable-variant-of-datatype-that-could-be-mutable?'. Perhaps simpler organization would be to have a `mutable?' with a similar implementation (rough, half-guessed sketch): static Scheme_Object * mutablep (int argc, Scheme_Object *argv[]) { Scheme_Object *v = argv[0]; return (!SCHEME_INTP(v) && !SCHEME_IMMUTABLEP(v) && (SCHEME_VECTORP(v) || SCHEME_BYTE_STRINGP(v) || SCHEME_CHAR_STRINGP(v) || SCHEME_BOXP(v) || SCHEME_HASHTP(v))) ? scheme_true : scheme_false; } then define `immutable?' in terms of that? -- ((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay: http://www.barzilay.org/ Maze is Life! From spdegabrielle at gmail.com Wed Sep 17 10:02:13 2008 From: spdegabrielle at gmail.com (Stephen De Gabrielle) Date: Thu Mar 26 02:28:40 2009 Subject: [plt-scheme] DrScheme tool development practices In-Reply-To: <756daca50809170540p183a3f2cl6aa21395c4144f9d@mail.gmail.com> References: <595b9ab20809170353h35020b0en9df0842dd8011bfa@mail.gmail.com> <756daca50809170540p183a3f2cl6aa21395c4144f9d@mail.gmail.com> Message-ID: <595b9ab20809170702g37b20d68s392ec2a72a1a1b65@mail.gmail.com> Do I have devlinksright? I know you haven't used this yourself, but what do you think; - do I drop my planet fileinject/remove steps, and to replace with planet link/unlink? or - do I just link once and recompile with 'planet create .' every time I restart drscheme to test my tools progress? It makes me think I might be better off just creating a hard-link in collects/ at the os level, and just recompiling with setup-plt -l 'collect-name' restart DrScheme everytime I need to restart (deleting the bytecode if things go badly) Cheers, Stephen -- Stephen De Gabrielle s.degabrielle@cs.ucl.ac.uk Telephone +44 (0)20 7679 0693 (x30693) Mobile 079 851 890 45 Project: Making Sense of Information (MaSI) Work:http://www.uclic.ucl.ac.uk/annb/MaSI.html Home:http://www.degabrielle.name/stephen UCL Interaction Centre MPEB 8th floor University College London Gower Street London WC1E 6BT On Wed, Sep 17, 2008 at 1:40 PM, Grant Rettke wrote: > Hi Stephen, > > On Wed, Sep 17, 2008 at 5:53 AM, Stephen De Gabrielle > wrote: > > I'm currently doing the following rain dance > > and depending on my machine I may have one or two installs of drscheme > > running (one for editing, one for testing) > > > > does anyone have any tips? > > > http://docs.plt-scheme.org/planet/Developing_Packages_for_PLaneT.html#(part._devlinks) > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080917/a1838fef/attachment.htm From cce at ccs.neu.edu Wed Sep 17 10:08:46 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:28:40 2009 Subject: [plt-scheme] DrScheme tool development practices In-Reply-To: <595b9ab20809170702g37b20d68s392ec2a72a1a1b65@mail.gmail.com> References: <595b9ab20809170353h35020b0en9df0842dd8011bfa@mail.gmail.com> <756daca50809170540p183a3f2cl6aa21395c4144f9d@mail.gmail.com> <595b9ab20809170702g37b20d68s392ec2a72a1a1b65@mail.gmail.com> Message-ID: <990e0c030809170708j71f9a7c5m56afaba07a41c000@mail.gmail.com> You don't need to link/unlink, or planet create. Just planet link once, and use setup-plt -P to rebuild each time you update your code. Give it -D as well to disable scribble rebuilding and reindexing. Then planet create when you are ready to distribute, and upload the file to Planet. You should probably unlink and fileinject to test the file before releasing, but you don't need to unlink, relink, or create from scratch while developing. --Carl On Wed, Sep 17, 2008 at 10:02 AM, Stephen De Gabrielle wrote: > Do I have devlinks right? > > I know you haven't used this yourself, but what do you think; > - do I drop my planet fileinject/remove steps, and to replace with planet > link/unlink? > or > - do I just link once and recompile with 'planet create .' every time I > restart drscheme to test my tools progress? > > It makes me think I might be better off just creating a hard-link in > collects/ at the os level, and just recompiling with setup-plt -l > 'collect-name' restart DrScheme everytime I need to restart (deleting the > bytecode if things go badly) > > Cheers, > > Stephen From farr at MIT.EDU Wed Sep 17 10:14:16 2008 From: farr at MIT.EDU (Will Farr) Date: Thu Mar 26 02:28:40 2009 Subject: [plt-scheme] DrScheme tool development practices In-Reply-To: <595b9ab20809170702g37b20d68s392ec2a72a1a1b65@mail.gmail.com> References: <595b9ab20809170353h35020b0en9df0842dd8011bfa@mail.gmail.com> <756daca50809170540p183a3f2cl6aa21395c4144f9d@mail.gmail.com> <595b9ab20809170702g37b20d68s392ec2a72a1a1b65@mail.gmail.com> Message-ID: <65658AD4-D57D-46C9-9F2D-2490F344DE52@mit.edu> Stephen, Here's what I do: I have a source code repository directory, say $HOME/code/foo, for my foo planet package. When I want to do planet development, I look up the latest released version of foo; let's say it's 1.3. Then I do planet link wmfarr foo.plt 1 4 $HOME/code/foo So, now the previously released version is available to be required as 1.3, and the new version is available as 1.4 using the local link. To compile the new version (once at the start, and after any change), I do setup-plt -P wmfarr foo.plt 1 4 This also executes any pre-install/post-install hooks I have (sometimes I work with C modules, and this would also compile those in the pre-install phase). When I'm ready to release, I do planet unlink wmfarr foo.plt 1 4 cd /tmp && planet create foo planet fileinject wmfarr foo.plt 1 4 The important step that I think you were missing from your last email is the "setup-plt -P ", which re-compiles the planet package (even if it's a development link). Anyway, you may want to do something different, but I thought I'd tell you about the system that works pretty well for me. Will On Sep 17, 2008, at 10:02 AM, Stephen De Gabrielle wrote: > Do I have devlinks right? > > I know you haven't used this yourself, but what do you think; > - do I drop my planet fileinject/remove steps, and to replace with > planet link/unlink? > or > - do I just link once and recompile with 'planet create .' every > time I restart drscheme to test my tools progress? > > It makes me think I might be better off just creating a hard-link in > collects/ at the os level, and just recompiling with setup-plt -l > 'collect-name' restart DrScheme everytime I need to restart > (deleting the bytecode if things go badly) > > Cheers, > > Stephen > > -- > Stephen De Gabrielle > s.degabrielle@cs.ucl.ac.uk > Telephone +44 (0)20 7679 0693 (x30693) > Mobile 079 851 890 45 > Project: Making Sense of Information (MaSI) > Work:http://www.uclic.ucl.ac.uk/annb/MaSI.html > Home:http://www.degabrielle.name/stephen > > > UCL Interaction Centre > MPEB 8th floor > University College London > Gower Street > London WC1E 6BT > > > On Wed, Sep 17, 2008 at 1:40 PM, Grant Rettke wrote: > Hi Stephen, > > On Wed, Sep 17, 2008 at 5:53 AM, Stephen De Gabrielle > wrote: > > I'm currently doing the following rain dance > > and depending on my machine I may have one or two installs of > drscheme > > running (one for editing, one for testing) > > > > does anyone have any tips? > > http://docs.plt-scheme.org/planet/Developing_Packages_for_PLaneT.html#(part._devlinks) > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From robby at cs.uchicago.edu Wed Sep 17 10:17:11 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:28:40 2009 Subject: [plt-scheme] DrScheme tool development practices In-Reply-To: <595b9ab20809170702g37b20d68s392ec2a72a1a1b65@mail.gmail.com> References: <595b9ab20809170353h35020b0en9df0842dd8011bfa@mail.gmail.com> <756daca50809170540p183a3f2cl6aa21395c4144f9d@mail.gmail.com> <595b9ab20809170702g37b20d68s392ec2a72a1a1b65@mail.gmail.com> Message-ID: <932b2f1f0809170717x3617ef8bwa78fa04f976744b1@mail.gmail.com> You just say 'planet link' and then, if you need to recompile your .zo files use mzc. Using planet link is the currently preferred alternative to putting stuff directly into a collects directory. Robby On Wed, Sep 17, 2008 at 9:02 AM, Stephen De Gabrielle wrote: > Do I have devlinks right? > > I know you haven't used this yourself, but what do you think; > - do I drop my planet fileinject/remove steps, and to replace with planet > link/unlink? > or > - do I just link once and recompile with 'planet create .' every time I > restart drscheme to test my tools progress? > > It makes me think I might be better off just creating a hard-link in > collects/ at the os level, and just recompiling with setup-plt -l > 'collect-name' restart DrScheme everytime I need to restart (deleting the > bytecode if things go badly) > > Cheers, > > Stephen > > -- > Stephen De Gabrielle > s.degabrielle@cs.ucl.ac.uk > Telephone +44 (0)20 7679 0693 (x30693) > Mobile 079 851 890 45 > Project: Making Sense of Information (MaSI) > Work:http://www.uclic.ucl.ac.uk/annb/MaSI.html > Home:http://www.degabrielle.name/stephen > > > UCL Interaction Centre > MPEB 8th floor > University College London > Gower Street > London WC1E 6BT > > > On Wed, Sep 17, 2008 at 1:40 PM, Grant Rettke wrote: >> >> Hi Stephen, >> >> On Wed, Sep 17, 2008 at 5:53 AM, Stephen De Gabrielle >> wrote: >> > I'm currently doing the following rain dance >> > and depending on my machine I may have one or two installs of drscheme >> > running (one for editing, one for testing) >> > >> > does anyone have any tips? >> >> >> http://docs.plt-scheme.org/planet/Developing_Packages_for_PLaneT.html#(part._devlinks) > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From noelwelsh at gmail.com Wed Sep 17 10:24:36 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:28:40 2009 Subject: [plt-scheme] DrScheme tool development practices In-Reply-To: <65658AD4-D57D-46C9-9F2D-2490F344DE52@mit.edu> References: <595b9ab20809170353h35020b0en9df0842dd8011bfa@mail.gmail.com> <756daca50809170540p183a3f2cl6aa21395c4144f9d@mail.gmail.com> <595b9ab20809170702g37b20d68s392ec2a72a1a1b65@mail.gmail.com> <65658AD4-D57D-46C9-9F2D-2490F344DE52@mit.edu> Message-ID: On Wed, Sep 17, 2008 at 3:14 PM, Will Farr wrote: > Stephen, > > Here's what I do: ...good stuff omitted... This is more-or-less what I do, except I now use Sake to automate it. If you hurry, you can get download #4! (Oddly, it seems no-one else is interested in automating tedious dev. steps.) N. From jay.mccarthy at gmail.com Wed Sep 17 11:05:28 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:28:40 2009 Subject: [plt-scheme] Using web-server/servlet-env to host a root level servlet In-Reply-To: References: Message-ID: There is not an easy way to do this. Here's a hacky way: 1) Remove the filter:make around (let-values in servlet-env 2) Change (build-path servlets-root servlet-path) to (build-path servlets-root) 3) Pass "" as #:servlet-path Another way is to make a custom dispatcher that rewrites the URLs that come in to contain the ".ss" file. For example: (define (rewrite regex inner-dispatcher) (lambda (conn req) (inner-dispatcher conn (make-request ... (string->url (regexp-replace (url->string (request-url req)) regex)) ...)))) and make that the top-level dispatcher (perhaps using web-server/run.ss as a base) Jay On Tue, Sep 16, 2008 at 6:59 PM, Rob Hunter wrote: > Hi, > > I'm trying out the web server code described here > (http://docs.plt-scheme.org/web-server/servlet-env_ss.html), but I > can't figure out how to make my servlet hosted at the root level. For > example, the program > > (require web-server/servlet-env) > > (serve/servlet > (lambda (req) "hiya") > #:servlet-path (string->path "foo.ss")) > > gives my a page at http://localhost:8000/foo.ss, but changing the path > to "" or "." doesn't work. Any suggestions? > > Thanks, > Rob > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From spdegabrielle at gmail.com Wed Sep 17 11:15:51 2008 From: spdegabrielle at gmail.com (Stephen De Gabrielle) Date: Thu Mar 26 02:28:41 2009 Subject: [plt-scheme] DrScheme tool development practices In-Reply-To: <932b2f1f0809170717x3617ef8bwa78fa04f976744b1@mail.gmail.com> References: <595b9ab20809170353h35020b0en9df0842dd8011bfa@mail.gmail.com> <756daca50809170540p183a3f2cl6aa21395c4144f9d@mail.gmail.com> <595b9ab20809170702g37b20d68s392ec2a72a1a1b65@mail.gmail.com> <932b2f1f0809170717x3617ef8bwa78fa04f976744b1@mail.gmail.com> Message-ID: <595b9ab20809170815o161535e1hed96de9ce184c9f4@mail.gmail.com> Thanks Will,Robby,Grant, Noel,Carl; Do I have this right? -=- ;source code repository directory, say $HOME/code/foo planet link [dev-id] foo.plt 1 4 $HOME/code/foo ;remembering to update the package numbering to the new number so DrScheme doesn't default to the old one. ; the development loop [edit/compile/test] now only requires the compilation step setup-plt -P [dev-id] foo.plt 1 4 ; or mzc if finer control of the compilation process is required? ;; -D as well to disable scribble rebuilding and reindexing. [I'm assuming sake can be used here if your compiliation needs are not met by setup-plt or mzc] ; run your tests or restart DrScheme if your package is a plugin/tool. ; when ready to release; (use saketo automate this? ) planet unlink [dev-id] foo.plt 1 4 ;; remove the link planet create foo ;; create foo.plt file for test installation [Will - is there a reason to compile a temporary copy?] planet fileinject [dev-id] foo.plt 1 4 ;; install for testing ;run foo-tests: (require (planet [dev-id]/foo:1:4/run-tests)) ; sakeaction:test? or Restart DrScheme if it's a plugin/tool. upload foo.plt to PLaneT (and test again) -=- Thanks for all your help, If I have this right can I put it on trac? (seems a better place than the cookbook) stephen On Wed, Sep 17, 2008 at 3:17 PM, Robby Findler wrote: > You just say 'planet link' and then, if you need to recompile your .zo > files use mzc. > > Using planet link is the currently preferred alternative to putting > stuff directly into a collects directory. > > Robby > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080917/0919fe85/attachment.html From farr at MIT.EDU Wed Sep 17 11:23:45 2008 From: farr at MIT.EDU (Will Farr) Date: Thu Mar 26 02:28:41 2009 Subject: [plt-scheme] DrScheme tool development practices In-Reply-To: <595b9ab20809170815o161535e1hed96de9ce184c9f4@mail.gmail.com> References: <595b9ab20809170353h35020b0en9df0842dd8011bfa@mail.gmail.com> <756daca50809170540p183a3f2cl6aa21395c4144f9d@mail.gmail.com> <595b9ab20809170702g37b20d68s392ec2a72a1a1b65@mail.gmail.com> <932b2f1f0809170717x3617ef8bwa78fa04f976744b1@mail.gmail.com> <595b9ab20809170815o161535e1hed96de9ce184c9f4@mail.gmail.com> Message-ID: Stephen, On Sep 17, 2008, at 11:15 AM, Stephen De Gabrielle wrote: > planet create foo ;; create foo.plt file for test installation > [Will - is there a reason to compile a temporary copy?] I create a temporary local copy for two reasons: 1. It's a check that I've properly put *all* the necessary files into revision control, and haven't left something out. 2. "planet create foo" grabs the entire contents of the foo directory and stuffs it into the PLaneT package. That means that my revision control system's "pristine" copy of the files gets grabbed, too. Then, when compiling the PLaneT package, setup-plt descends into the "pristine" sub-directory, and compiles those files, too. I don't want my users to get confused by this, so I don't include it in the directory I use "planet create foo" on. Will From cce at ccs.neu.edu Wed Sep 17 11:35:11 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:28:41 2009 Subject: [plt-scheme] DrScheme tool development practices In-Reply-To: <595b9ab20809170815o161535e1hed96de9ce184c9f4@mail.gmail.com> References: <595b9ab20809170353h35020b0en9df0842dd8011bfa@mail.gmail.com> <756daca50809170540p183a3f2cl6aa21395c4144f9d@mail.gmail.com> <595b9ab20809170702g37b20d68s392ec2a72a1a1b65@mail.gmail.com> <932b2f1f0809170717x3617ef8bwa78fa04f976744b1@mail.gmail.com> <595b9ab20809170815o161535e1hed96de9ce184c9f4@mail.gmail.com> Message-ID: <990e0c030809170835h6d7d8574yf49ac3d14a5f27ff@mail.gmail.com> On Wed, Sep 17, 2008 at 11:15 AM, Stephen De Gabrielle wrote: > ;source code repository directory, say $HOME/code/foo > planet link [dev-id] foo.plt 1 4 $HOME/code/foo > ;remembering to update the package numbering to the new number so DrScheme > doesn't default to the old one. I usually don't update the version number. That's up to you, but if there is a development link DrScheme will use that rather than another installed version (from the server or from fileinject). > ; the development loop [edit/compile/test] now only requires the compilation > step > setup-plt -P [dev-id] foo.plt 1 4 ; or mzc if finer control of the > compilation process is required? > ;; -D as well to disable scribble rebuilding and reindexing. > [I'm assuming sake can be used here if your compiliation needs are not met > by setup-plt or mzc] > ; run your tests or restart DrScheme if your package is a plugin/tool. Looks good to me. > ; when ready to release; (use sake to automate this? ) > planet unlink [dev-id] foo.plt 1 4 ;; remove the link > planet create foo ;; create foo.plt file for test installation [Will - is > there a reason to compile a temporary copy?] > planet fileinject [dev-id] foo.plt 1 4 ;; install for testing You do not want to unlink the package at this point. If you take Will's (good) advice and test/build from a temporary copy, in fact, make sure to unlink the original and link the copy. When you run planet create, Planet attempts to build your Scribble documentation so it can include a rendered HTML file that will be readable on the Planet server. If you unlink your package, any internal references to (planet /foo:1:4/...) will be broken and planet create may fail. Leave your development links intact and functioning while using planet create. > ;run foo-tests: > (require (planet [dev-id]/foo:1:4/run-tests)) ; sake action:test? > or Restart DrScheme if it's a plugin/tool. > > upload foo.plt to PLaneT (and test again) Test the original, test the .plt file, test the uploaded file. Yup. -- Carl Eastlund From jay.mccarthy at gmail.com Wed Sep 17 11:43:17 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:28:42 2009 Subject: [plt-scheme] Formlets in PLT In-Reply-To: <20080917114914.1574F650091@mail-svr1.cs.utah.edu> References: <48D0DE35.2070308@ccs.neu.edu> <18640.57835.359784.558389@arabic.ccs.neu.edu> <20080917114914.1574F650091@mail-svr1.cs.utah.edu> Message-ID: I've just done this. Expect good documentation as well relatively soon. Jay On Wed, Sep 17, 2008 at 5:49 AM, Matthew Flatt wrote: > At Wed, 17 Sep 2008 06:54:35 -0400, Eli Barzilay wrote: >> On Sep 17, Dave Herman wrote: >> > > In the latest SVN, there is a web-server/formlets directory with a >> > > 'formlets' module. >> > >> > How about a `main' module in the web-server/formlets directory... >> > >> > > (require web-server/formlets/formlets) >> > >> > ...so you could write (require web-server/formlets)? >> >> The `main.ss' thing works only at the top level of a collection. > > But if you want to use the path `web-server/formlets' (which seems like > a good idea to me), you just create a "formlets.ss" in the "web-server" > collection. > > > -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From spdegabrielle at gmail.com Wed Sep 17 12:03:54 2008 From: spdegabrielle at gmail.com (Stephen De Gabrielle) Date: Thu Mar 26 02:28:42 2009 Subject: [plt-scheme] DrScheme tool development practices In-Reply-To: <990e0c030809170835h6d7d8574yf49ac3d14a5f27ff@mail.gmail.com> References: <595b9ab20809170353h35020b0en9df0842dd8011bfa@mail.gmail.com> <756daca50809170540p183a3f2cl6aa21395c4144f9d@mail.gmail.com> <595b9ab20809170702g37b20d68s392ec2a72a1a1b65@mail.gmail.com> <932b2f1f0809170717x3617ef8bwa78fa04f976744b1@mail.gmail.com> <595b9ab20809170815o161535e1hed96de9ce184c9f4@mail.gmail.com> <990e0c030809170835h6d7d8574yf49ac3d14a5f27ff@mail.gmail.com> Message-ID: <595b9ab20809170903g191eed68lc49e52e1b24719a1@mail.gmail.com> Thanks, I didn't realise that planet link items took precedence! On Wed, Sep 17, 2008 at 4:35 PM, Carl Eastlund wrote: > > ; when ready to release; (use sake to automate this? ) > > planet unlink [dev-id] foo.plt 1 4 ;; remove the link > > planet create foo ;; create foo.plt file for test installation [Will - > is > > there a reason to compile a temporary copy?] > > planet fileinject [dev-id] foo.plt 1 4 ;; install for testing > > You do not want to unlink the package at this point. If you take > Will's (good) advice and test/build from a temporary copy, in fact, > make sure to unlink the original and link the copy. I thought that link-ing or fileinject the copy were functionally equivalent? - provided you remembered to unlink the original - so linking is probably safer? When you run > planet create, Planet attempts to build your Scribble documentation so > it can include a rendered HTML file that will be readable on the > Planet server. If you unlink your package, any internal references to > (planet /foo:1:4/...) will be broken and planet create may > fail. > I don't understand - I thought the [planet]create-ed/fileinject-ed copy would have the documentation included? Leave your development links intact and functioning while using planet > create. > (because create builds the documentation?) I think I'm missing something in my understanding of building scribble documentation. Does scribble documentation need to be built in-place (via planet link) to work? [if it references other documentation?] Thanks again [to all of you] for taking the time to help me with this. Cheers Stephen -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080917/67d70792/attachment.htm From cce at ccs.neu.edu Wed Sep 17 12:11:31 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:28:42 2009 Subject: [plt-scheme] DrScheme tool development practices In-Reply-To: <595b9ab20809170903g191eed68lc49e52e1b24719a1@mail.gmail.com> References: <595b9ab20809170353h35020b0en9df0842dd8011bfa@mail.gmail.com> <756daca50809170540p183a3f2cl6aa21395c4144f9d@mail.gmail.com> <595b9ab20809170702g37b20d68s392ec2a72a1a1b65@mail.gmail.com> <932b2f1f0809170717x3617ef8bwa78fa04f976744b1@mail.gmail.com> <595b9ab20809170815o161535e1hed96de9ce184c9f4@mail.gmail.com> <990e0c030809170835h6d7d8574yf49ac3d14a5f27ff@mail.gmail.com> <595b9ab20809170903g191eed68lc49e52e1b24719a1@mail.gmail.com> Message-ID: <990e0c030809170911h498776a2kd960ccbceb5436b9@mail.gmail.com> On Wed, Sep 17, 2008 at 12:03 PM, Stephen De Gabrielle wrote: > On Wed, Sep 17, 2008 at 4:35 PM, Carl Eastlund wrote: >> >> > ; when ready to release; (use sake to automate this? ) >> > planet unlink [dev-id] foo.plt 1 4 ;; remove the link >> > planet create foo ;; create foo.plt file for test installation [Will - >> > is >> > there a reason to compile a temporary copy?] >> > planet fileinject [dev-id] foo.plt 1 4 ;; install for testing >> >> You do not want to unlink the package at this point. If you take >> Will's (good) advice and test/build from a temporary copy, in fact, >> make sure to unlink the original and link the copy. > > I thought that link-ing or fileinject the copy were functionally equivalent? > - provided you remembered to unlink the original - so linking is probably > safer? Linking is not equivalent to fileinjecting for all purposes. A development link tells Planet to use your source directory for the planet package. When you use fileinject, it tells Planet to extract the contents of a .plt file, install them in a new directory in the Planet cache, and use that for the planet package. Regardless, I meant not to unlink during the planet create, at which point you don't yet have a .plt file to inject. Move the unlink to after the create, then fileinject. Sorry for the confusion; you do need to unlink, you were just doing it too early. >> When you run >> planet create, Planet attempts to build your Scribble documentation so >> it can include a rendered HTML file that will be readable on the >> Planet server. If you unlink your package, any internal references to >> (planet /foo:1:4/...) will be broken and planet create may >> fail. > > I don't understand - I thought the [planet]create-ed/fileinject-ed copy > would have the documentation included? Yes, but only if the package was linked at time of creation. >> Leave your development links intact and functioning while using planet >> create. > > (because create builds the documentation?) Yes. > I think I'm missing something in my understanding of building scribble > documentation. > Does scribble documentation need to be built in-place (via planet link) to > work? [if it references other documentation?] Scribble documentation is built in-place when you run planet create. If you have any references to the package from itself (e.g. a defmodule in its documentation, or one file including another via a planet require spec instead of a local path), you will need the development link in place while you run planet create. If there are no such self-references, it won't matter whether you unlink before or after running planet create. I hope that clarifies the matter. Sorry for the confusion, before I said not to planet unlink, when I should have said do it after planet create but before planet fileinject. -- Carl Eastlund From spdegabrielle at gmail.com Wed Sep 17 12:14:30 2008 From: spdegabrielle at gmail.com (Stephen De Gabrielle) Date: Thu Mar 26 02:28:43 2009 Subject: [plt-scheme] DrScheme tool development practices In-Reply-To: <990e0c030809170911h498776a2kd960ccbceb5436b9@mail.gmail.com> References: <595b9ab20809170353h35020b0en9df0842dd8011bfa@mail.gmail.com> <756daca50809170540p183a3f2cl6aa21395c4144f9d@mail.gmail.com> <595b9ab20809170702g37b20d68s392ec2a72a1a1b65@mail.gmail.com> <932b2f1f0809170717x3617ef8bwa78fa04f976744b1@mail.gmail.com> <595b9ab20809170815o161535e1hed96de9ce184c9f4@mail.gmail.com> <990e0c030809170835h6d7d8574yf49ac3d14a5f27ff@mail.gmail.com> <595b9ab20809170903g191eed68lc49e52e1b24719a1@mail.gmail.com> <990e0c030809170911h498776a2kd960ccbceb5436b9@mail.gmail.com> Message-ID: <595b9ab20809170914y455c48eei1a686f354de07c9d@mail.gmail.com> Thanks Carl, Cheers, Stephen On Wed, Sep 17, 2008 at 5:11 PM, Carl Eastlund wrote: > On Wed, Sep 17, 2008 at 12:03 PM, Stephen De Gabrielle > wrote: > > On Wed, Sep 17, 2008 at 4:35 PM, Carl Eastlund wrote: > >> > >> > ; when ready to release; (use sake to automate this? ) > >> > planet unlink [dev-id] foo.plt 1 4 ;; remove the link > >> > planet create foo ;; create foo.plt file for test installation [Will > - > >> > is > >> > there a reason to compile a temporary copy?] > >> > planet fileinject [dev-id] foo.plt 1 4 ;; install for testing > >> > >> You do not want to unlink the package at this point. If you take > >> Will's (good) advice and test/build from a temporary copy, in fact, > >> make sure to unlink the original and link the copy. > > > > I thought that link-ing or fileinject the copy were functionally > equivalent? > > - provided you remembered to unlink the original - so linking is probably > > safer? > > Linking is not equivalent to fileinjecting for all purposes. A > development link tells Planet to use your source directory for the > planet package. When you use fileinject, it tells Planet to extract > the contents of a .plt file, install them in a new directory in the > Planet cache, and use that for the planet package. > > Regardless, I meant not to unlink during the planet create, at which > point you don't yet have a .plt file to inject. Move the unlink to > after the create, then fileinject. Sorry for the confusion; you do > need to unlink, you were just doing it too early. > > >> When you run > >> planet create, Planet attempts to build your Scribble documentation so > >> it can include a rendered HTML file that will be readable on the > >> Planet server. If you unlink your package, any internal references to > >> (planet /foo:1:4/...) will be broken and planet create may > >> fail. > > > > I don't understand - I thought the [planet]create-ed/fileinject-ed copy > > would have the documentation included? > > Yes, but only if the package was linked at time of creation. > > >> Leave your development links intact and functioning while using planet > >> create. > > > > (because create builds the documentation?) > > Yes. > > > I think I'm missing something in my understanding of building scribble > > documentation. > > Does scribble documentation need to be built in-place (via planet link) > to > > work? [if it references other documentation?] > > Scribble documentation is built in-place when you run planet create. > If you have any references to the package from itself (e.g. a > defmodule in its documentation, or one file including another via a > planet require spec instead of a local path), you will need the > development link in place while you run planet create. > > If there are no such self-references, it won't matter whether you > unlink before or after running planet create. > > I hope that clarifies the matter. Sorry for the confusion, before I > said not to planet unlink, when I should have said do it after planet > create but before planet fileinject. > > -- > Carl Eastlund > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080917/a1ce39bc/attachment.html From grettke at acm.org Wed Sep 17 12:26:39 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:43 2009 Subject: [plt-scheme] DrScheme tool development practices In-Reply-To: References: <595b9ab20809170353h35020b0en9df0842dd8011bfa@mail.gmail.com> <756daca50809170540p183a3f2cl6aa21395c4144f9d@mail.gmail.com> <595b9ab20809170702g37b20d68s392ec2a72a1a1b65@mail.gmail.com> <932b2f1f0809170717x3617ef8bwa78fa04f976744b1@mail.gmail.com> <595b9ab20809170815o161535e1hed96de9ce184c9f4@mail.gmail.com> Message-ID: <756daca50809170926t4253a77pfd90f6bc7e414499@mail.gmail.com> In the same spirit, I think, I create a tag, export it, and then build the PLT package from that export. On Wed, Sep 17, 2008 at 10:23 AM, Will Farr wrote: > Stephen, > > On Sep 17, 2008, at 11:15 AM, Stephen De Gabrielle wrote: > >> planet create foo ;; create foo.plt file for test installation [Will - is >> there a reason to compile a temporary copy?] > > I create a temporary local copy for two reasons: > > 1. It's a check that I've properly put *all* the necessary files into > revision control, and haven't left something out. > 2. "planet create foo" grabs the entire contents of the foo directory and > stuffs it into the PLaneT package. That means that my revision control > system's "pristine" copy of the files gets grabbed, too. Then, when > compiling the PLaneT package, setup-plt descends into the "pristine" > sub-directory, and compiles those files, too. I don't want my users to get > confused by this, so I don't include it in the directory I use "planet > create foo" on. > > Will > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- http://www.wisdomandwonder.com/ From clements at brinckerhoff.org Wed Sep 17 13:51:32 2008 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:28:44 2009 Subject: [plt-scheme] Good general term for context elements? Message-ID: <118BC7D1-9A5E-4E52-8030-3A4F9E0FB1EB@brinckerhoff.org> An evaluation context is made up of a bunch of ... frames? elements? thingies? I want to talk about the differences between a CEK-like model and an SECD-like model, where the individual context frames are grouped into activation records, and I'm wondering if there's a better term than "context frames". Anyone? 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/20080917/2c00988c/smime.bin From matthias at ccs.neu.edu Wed Sep 17 14:02:17 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:28:44 2009 Subject: [plt-scheme] Good general term for context elements? In-Reply-To: <118BC7D1-9A5E-4E52-8030-3A4F9E0FB1EB@brinckerhoff.org> References: <118BC7D1-9A5E-4E52-8030-3A4F9E0FB1EB@brinckerhoff.org> Message-ID: <861FDC75-7144-4E01-A262-215B8119DA6E@ccs.neu.edu> Bob Hieb and I used a term like 'single-layer context' for such things and hinted that these are closely related to activation records. Are you following our new Redex book? I didn't know you had a copy of the manuscript. -- Matthias On Sep 17, 2008, at 1:51 PM, John Clements wrote: > An evaluation context is made up of a bunch of ... frames? > elements? thingies? I want to talk about the differences between a > CEK-like model and an SECD-like model, where the individual context > frames are grouped into activation records, and I'm wondering if > there's a better term than "context frames". > > Anyone? > > John Clements > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From sk at cs.brown.edu Wed Sep 17 14:47:47 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:28:44 2009 Subject: [plt-scheme] Good general term for context elements? In-Reply-To: <861FDC75-7144-4E01-A262-215B8119DA6E@ccs.neu.edu> References: <118BC7D1-9A5E-4E52-8030-3A4F9E0FB1EB@brinckerhoff.org> <861FDC75-7144-4E01-A262-215B8119DA6E@ccs.neu.edu> Message-ID: I have this problem, too (it arises with kind of context, not just eval contexts, as you know). But that term is so unwieldy. Have you thought of contracting it? "sintext"? Many sintexts make a context. S. On Wed, Sep 17, 2008 at 2:02 PM, Matthias Felleisen wrote: > > > Bob Hieb and I used a term like 'single-layer context' for such things and > hinted that these are closely related to activation records. > > Are you following our new Redex book? I didn't know you had a copy of the > manuscript. -- Matthias > > > On Sep 17, 2008, at 1:51 PM, John Clements wrote: > >> An evaluation context is made up of a bunch of ... frames? elements? >> thingies? I want to talk about the differences between a CEK-like model and >> an SECD-like model, where the individual context frames are grouped into >> activation records, and I'm wondering if there's a better term than "context >> frames". >> >> Anyone? >> >> John Clements >> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From matthias at ccs.neu.edu Wed Sep 17 14:57:32 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:28:44 2009 Subject: [plt-scheme] Good general term for context elements? In-Reply-To: References: <118BC7D1-9A5E-4E52-8030-3A4F9E0FB1EB@brinckerhoff.org> <861FDC75-7144-4E01-A262-215B8119DA6E@ccs.neu.edu> Message-ID: We used it in one paper and we are only appealing to the concept in Redex. Look for E^1. -- Matthias On Sep 17, 2008, at 2:47 PM, Shriram Krishnamurthi wrote: > I have this problem, too (it arises with kind of context, not just > eval contexts, as you know). But that term is so unwieldy. Have you > thought of contracting it? "sintext"? Many sintexts make a context. > > S. > > On Wed, Sep 17, 2008 at 2:02 PM, Matthias Felleisen > wrote: >> >> >> Bob Hieb and I used a term like 'single-layer context' for such >> things and >> hinted that these are closely related to activation records. >> >> Are you following our new Redex book? I didn't know you had a copy >> of the >> manuscript. -- Matthias >> >> >> On Sep 17, 2008, at 1:51 PM, John Clements wrote: >> >>> An evaluation context is made up of a bunch of ... frames? >>> elements? >>> thingies? I want to talk about the differences between a CEK- >>> like model and >>> an SECD-like model, where the individual context frames are >>> grouped into >>> activation records, and I'm wondering if there's a better term >>> than "context >>> frames". >>> >>> Anyone? >>> >>> John Clements >>> >>> _________________________________________________ >>> 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 Wed Sep 17 15:23:49 2008 From: clements at brinckerhoff.org (John Clements) Date: Thu Mar 26 02:28:45 2009 Subject: [plt-scheme] Good general term for context elements? In-Reply-To: References: <118BC7D1-9A5E-4E52-8030-3A4F9E0FB1EB@brinckerhoff.org> <861FDC75-7144-4E01-A262-215B8119DA6E@ccs.neu.edu> Message-ID: <44BBB943-35CB-4FC8-BB44-0A38CB313054@brinckerhoff.org> On Sep 17, 2008, at 11:47 AM, Shriram Krishnamurthi wrote: > I have this problem, too (it arises with kind of context, not just > eval contexts, as you know). But that term is so unwieldy. Have you > thought of contracting it? "sintext"? Many sintexts make a context. I'm kind of "barbarous neologism-shy" after my experience with "tail cursion". In that case, of course, Dave Herman's suggestion of "tail calling" works fine. 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/20080917/0932c8c1/smime.bin From hendrik at topoi.pooq.com Wed Sep 17 15:44:09 2008 From: hendrik at topoi.pooq.com (hendrik@topoi.pooq.com) Date: Thu Mar 26 02:28:45 2009 Subject: [plt-scheme] Good general term for context elements? In-Reply-To: References: <118BC7D1-9A5E-4E52-8030-3A4F9E0FB1EB@brinckerhoff.org> <861FDC75-7144-4E01-A262-215B8119DA6E@ccs.neu.edu> Message-ID: <20080917194409.GA6197@topoi.pooq.com> On Wed, Sep 17, 2008 at 02:47:47PM -0400, Shriram Krishnamurthi wrote: > I have this problem, too (it arises with kind of context, not just > eval contexts, as you know). But that term is so unwieldy. Have you > thought of contracting it? "sintext"? Many sintexts make a context. Except for the unfortunate interpretation as sin text, of course. Maybe "singtext"? O once wrote a parser generator and called "anal" as short for "analyse", because mostly it analysed the grammar and only incidentally made a parser, almost as an afterthought. The parser that went with it was called "Parse". My students had fun with an axcretory interpretation: P Arse Anal -- hendrik From rob.hunter at gmail.com Wed Sep 17 16:03:49 2008 From: rob.hunter at gmail.com (Rob Hunter) Date: Thu Mar 26 02:28:45 2009 Subject: [plt-scheme] Using web-server/servlet-env to host a root level servlet In-Reply-To: References: Message-ID: Interesting, thanks. For completeness, I should mention that instaservlet.plt (on PLaneT) allows you to run a servlet at the root level. They probably did something like you are describing. --rob On Wed, Sep 17, 2008 at 8:05 AM, Jay McCarthy wrote: > There is not an easy way to do this. Here's a hacky way: > > 1) Remove the filter:make around (let-values in servlet-env > 2) Change (build-path servlets-root servlet-path) to (build-path servlets-root) > 3) Pass "" as #:servlet-path > > Another way is to make a custom dispatcher that rewrites the URLs that > come in to contain the ".ss" file. For example: > > (define (rewrite regex inner-dispatcher) > (lambda (conn req) > (inner-dispatcher conn (make-request ... (string->url > (regexp-replace (url->string (request-url req)) regex)) ...)))) > > and make that the top-level dispatcher (perhaps using > web-server/run.ss as a base) > > Jay > > On Tue, Sep 16, 2008 at 6:59 PM, Rob Hunter wrote: >> Hi, >> >> I'm trying out the web server code described here >> (http://docs.plt-scheme.org/web-server/servlet-env_ss.html), but I >> can't figure out how to make my servlet hosted at the root level. For >> example, the program >> >> (require web-server/servlet-env) >> >> (serve/servlet >> (lambda (req) "hiya") >> #:servlet-path (string->path "foo.ss")) >> >> gives my a page at http://localhost:8000/foo.ss, but changing the path >> to "" or "." doesn't work. Any suggestions? >> >> Thanks, >> Rob >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > > > > -- > Jay McCarthy > Assistant Professor / Brigham Young University > http://jay.teammccarthy.org > > "The glory of God is Intelligence" - D&C 93 > From rob.hunter at gmail.com Wed Sep 17 16:17:22 2008 From: rob.hunter at gmail.com (Rob Hunter) Date: Thu Mar 26 02:28:45 2009 Subject: [plt-scheme] make install error when installing mzscheme 4.1.0.3 on Ubuntu Message-ID: Has anyone else experienced a problem trying to install mzscheme 4.1.x from source on Ubuntu? I've having some sort of issue with mzschemecgc. ---rob After a (seemingly) successful "./configure", I'm all rob@hacks:~/mz-4.1.0.3/src$ make install make install-3m make[1]: Entering directory `/home/rob/mz-4.1.0.3/src' make install-3m-common make[2]: Entering directory `/home/rob/mz-4.1.0.3/src' make install-common-first make[3]: Entering directory `/home/rob/mz-4.1.0.3/src' mkdir -p "/home/rob/mz-4.1.0.3/bin" "/home/rob/mz-4.1.0.3/collects" "/home/rob/mz-4.1.0.3/doc" "/home/rob/mz-4.1.0.3/lib" "/home/rob/mz-4.1.0.3/include" "/home/rob/mz-4.1.0.3/lib" "/home/rob/mz-4.1.0.3/man" make[3]: Leaving directory `/home/rob/mz-4.1.0.3/src' cd mzscheme; make install-3m make[3]: Entering directory `/home/rob/mz-4.1.0.3/src/mzscheme' make headers make[4]: Entering directory `/home/rob/mz-4.1.0.3/src/mzscheme' ./mzschemecgc -cqu ./mkincludes.ss "/home/rob/mz-4.1.0.3/include" "." . /bin/sh: ./mzschemecgc: No such file or directory make[4]: *** [headers] Error 127 make[4]: Leaving directory `/home/rob/mz-4.1.0.3/src/mzscheme' make[3]: *** [install-3m] Error 2 make[3]: Leaving directory `/home/rob/mz-4.1.0.3/src/mzscheme' make[2]: *** [install-3m-common] Error 2 make[2]: Leaving directory `/home/rob/mz-4.1.0.3/src' make[1]: *** [install-3m] Error 2 make[1]: Leaving directory `/home/rob/mz-4.1.0.3/src' make: *** [install] Error 2 From noelwelsh at gmail.com Wed Sep 17 16:23:55 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:28:46 2009 Subject: [plt-scheme] make install error when installing mzscheme 4.1.0.3 on Ubuntu In-Reply-To: References: Message-ID: Standard advise is to make clean and try again (if you didn't make clean to start with). N. On Wed, Sep 17, 2008 at 9:17 PM, Rob Hunter wrote: > Has anyone else experienced a problem trying to install mzscheme 4.1.x > from source on Ubuntu? I've having some sort of issue with > mzschemecgc. > > ---rob > > After a (seemingly) successful "./configure", I'm all > > rob@hacks:~/mz-4.1.0.3/src$ make install ... From mflatt at cs.utah.edu Wed Sep 17 16:32:01 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:28:46 2009 Subject: [plt-scheme] make install error when installing mzscheme 4.1.0.3 on Ubuntu In-Reply-To: References: Message-ID: <20080917203201.420BC6500B2@mail-svr1.cs.utah.edu> At Wed, 17 Sep 2008 13:17:22 -0700, "Rob Hunter" wrote: > After a (seemingly) successful "./configure", I'm all > > rob@hacks:~/mz-4.1.0.3/src$ make install Did you `make' before `make install'? Matthew From rob.hunter at gmail.com Wed Sep 17 16:35:31 2008 From: rob.hunter at gmail.com (Rob Hunter) Date: Thu Mar 26 02:28:46 2009 Subject: [plt-scheme] make install error when installing mzscheme 4.1.0.3 on Ubuntu In-Reply-To: <20080917203201.420BC6500B2@mail-svr1.cs.utah.edu> References: <20080917203201.420BC6500B2@mail-svr1.cs.utah.edu> Message-ID: Well OF COURSE I typed make before...uh...oh...wait. I'm an idiot. thanks. :) rob On Wed, Sep 17, 2008 at 1:32 PM, Matthew Flatt wrote: > At Wed, 17 Sep 2008 13:17:22 -0700, "Rob Hunter" wrote: >> After a (seemingly) successful "./configure", I'm all >> >> rob@hacks:~/mz-4.1.0.3/src$ make install > > Did you `make' before `make install'? > > > Matthew > > From devonian25 at gmail.com Wed Sep 17 10:17:41 2008 From: devonian25 at gmail.com (Devin Thoma$) Date: Thu Mar 26 02:28:47 2009 Subject: [plt-scheme] Solutions Message-ID: <1a99e2960809170717t64d5a1fag35a3d4e9c1698236@mail.gmail.com> Does anyone have a name and password I can use to check solutions in the book? Thanks -- Devin Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080917/91fa8fbc/attachment.htm From sk at cs.brown.edu Wed Sep 17 20:02:28 2008 From: sk at cs.brown.edu (Shriram Krishnamurthi) Date: Thu Mar 26 02:28:47 2009 Subject: [plt-scheme] Solutions In-Reply-To: <1a99e2960809170717t64d5a1fag35a3d4e9c1698236@mail.gmail.com> References: <1a99e2960809170717t64d5a1fag35a3d4e9c1698236@mail.gmail.com> Message-ID: Yep, I've got one! On Wed, Sep 17, 2008 at 9:17 AM, Devin Thoma$ wrote: > Does anyone have a name and password I can use to check solutions in the > book? Thanks > > -- > Devin Thomas > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From dave at pawfal.org Thu Sep 18 06:05:39 2008 From: dave at pawfal.org (Dave Griffiths) Date: Thu Mar 26 02:28:47 2009 Subject: [plt-scheme] fluxus 0.15 Message-ID: Fluxus is an environment for livecoding and rapid prototyping of visible and audible worlds - games, realtime graphics and reactive audio. Fluxus builds on Linux and OSX. http://www.pawfal.org/fluxus http://www.pawfal.org/fluxus/files/fluxus-0.15rc3.tar.gz This release introduces some big new components, and the usual load of fixes, features and improvements. * Fluxa - audio synthesis designed for functional programming and livecoding * Frisbee - an experimental game engine based on PLT's FrTime language * Midi support * Support for PLT 4.x * Multiple camera/view rendering * Raytracing for collision detection and polygon sampling * Improved procedural texture operations * More methods for polygon evaluation * Lots of optimisations, fixes and other additions * New examples and documentation This build will also be availible on the upcoming release of pure:dyne, a live disk linux distribution of free audio/visual software: http://code.goto10.org/projects/puredyne/ Happy livecoding... From garcia at cs.indiana.edu Thu Sep 18 09:38:29 2008 From: garcia at cs.indiana.edu (Ronald Garcia) Date: Thu Mar 26 02:28:47 2009 Subject: [plt-scheme] Re: [redex] Alternative to named holes In-Reply-To: <932b2f1f0809161118i3e525554j628485d329dcb13a@mail.gmail.com> References: <932b2f1f0809161118i3e525554j628485d329dcb13a@mail.gmail.com> Message-ID: <621D50C7-0E7B-44F3-B81C-8E9943E142B7@cs.indiana.edu> Thanks for your fast answer. Just to clarify, is the "zero/multiple holes" error an error in particular language specifications, or an error in Redex? It sounds like you mean something that causes evaluation to get stuck but I'm not sure. Also, are you suggesting changing language syntax in some way that makes named holes unnecessary? I will give that a try and get back to you if I don't figure it out. Thanks again, ron On Sep 16, 2008, at 2:18 PM, robby@cs.uchicago.edu wrote: > They were removed because all of the (non-trivial) uses of them we > know of were broken, in the sense that any language that used them > also had the property that they triggered the "zero/multiple holes" > error, for some expression in the language. Also, all of those uses > could be rewritten to fix the error but also to remove the use if > multiple holes. > > If you're not sure how to rewrite out the named holes, send me > something and I can probably help. > > Robby > > On 9/16/08, Ronald Garcia wrote: >> Howdy, >> >> I am looking at upgrading a project to use the version of PLT Redex >> that ships with PLT Scheme v4.1, but I am using named holes and I >> noticed that named holes have been removed from the system. First, >> why were they removed? Second, are there any standard or suggested >> workarounds for their absence? >> >> Thanks, >> ron >> >> >> From robby at cs.uchicago.edu Thu Sep 18 09:41:30 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:28:47 2009 Subject: [plt-scheme] Re: [redex] Alternative to named holes In-Reply-To: <621D50C7-0E7B-44F3-B81C-8E9943E142B7@cs.indiana.edu> References: <932b2f1f0809161118i3e525554j628485d329dcb13a@mail.gmail.com> <621D50C7-0E7B-44F3-B81C-8E9943E142B7@cs.indiana.edu> Message-ID: <932b2f1f0809180641u3e4c18c5jf8168c5bef7f809e@mail.gmail.com> Redex detects an error in the specification and reports it that way. If you write: (in-hole E x) where E ::= (E E) | [] then redex doesn't know which hole you mean, so it will signal an error. You shouldn't have to change the actual syntax of the language, just the way terms decompose by writing a new grammar. But yes, that's the idea. Robby On Thu, Sep 18, 2008 at 8:38 AM, Ronald Garcia wrote: > Thanks for your fast answer. Just to clarify, is the "zero/multiple holes" > error an error in particular language specifications, or an error in Redex? > It sounds like you mean something that causes evaluation to get stuck but > I'm not sure. Also, are you suggesting changing language syntax in some > way that makes named holes unnecessary? I will give that a try and get back > to you if I don't figure it out. > > Thanks again, > ron > > > > On Sep 16, 2008, at 2:18 PM, robby@cs.uchicago.edu wrote: > >> They were removed because all of the (non-trivial) uses of them we >> know of were broken, in the sense that any language that used them >> also had the property that they triggered the "zero/multiple holes" >> error, for some expression in the language. Also, all of those uses >> could be rewritten to fix the error but also to remove the use if >> multiple holes. >> >> If you're not sure how to rewrite out the named holes, send me >> something and I can probably help. >> >> Robby >> >> On 9/16/08, Ronald Garcia wrote: >>> >>> Howdy, >>> >>> I am looking at upgrading a project to use the version of PLT Redex >>> that ships with PLT Scheme v4.1, but I am using named holes and I >>> noticed that named holes have been removed from the system. First, >>> why were they removed? Second, are there any standard or suggested >>> workarounds for their absence? >>> >>> Thanks, >>> ron >>> >>> >>> > > > From pltscheme at pnkfx.org Thu Sep 18 11:50:42 2008 From: pltscheme at pnkfx.org (Felix Klock's PLT scheme proxy) Date: Thu Mar 26 02:28:48 2009 Subject: [plt-scheme] xml.ss and DTDs Message-ID: <127ED213-D4AD-4B5F-935C-C5C9D42675BC@pnkfx.org> PLTers- From the documentation for the xml.ss library: > "The xml library does not provides [sic] Document Type Declaration > (DTD) processing, validation, expanding user-defined entities, or > reading user-defined entities in attributes." Is the phrase "DTD processing" meant to include functionality such as "reading the DOCTYPE declaration given in the input file"? From what I can tell from the observable behavior and the source text of xml.ss, the XML parsing skips over DOCTYPE declarations in the input. If the silent dropping of the DTD declaration is intentional, I think the documentation should be clearer, and I will file a bug report against the docs. If it is not intentional (or a feature waiting to be implemented), then I will file a bug report against the source code. Right now I cannot tell where the bug report belongs. -Felix p.s. Here's an example illustrating what I'm talking about: #lang scheme (require (lib "xml.ss" "xml")) (define source-html-string #< END ) (define source-document (read-xml (open-input-string source-html- string))) (write-xml source-document) (newline) ;; prints: ;; ;; and so we've lost information from the input From jay.mccarthy at gmail.com Thu Sep 18 12:02:45 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:28:48 2009 Subject: [plt-scheme] xml.ss and DTDs In-Reply-To: <127ED213-D4AD-4B5F-935C-C5C9D42675BC@pnkfx.org> References: <127ED213-D4AD-4B5F-935C-C5C9D42675BC@pnkfx.org> Message-ID: The xml library will print back the DTD if it is in the prolog struct of the document struct. However, there is no parser for DTDs, so read-xml will always have #f in the dtd field of the prolog struct. This shows up on xml/private/reader.ss:30. I imagine that the skip-dtd function therein might (roughly) know how to parse them. Now, as far as "Is this intentional?" I'm responsible for the XML library, because someone who was responsible for it once was also responsible for the web server. I've fixed maybe one bug in my tenure and never touched it otherwise. If you submit a bug, I will either update the documentation or try to write the parser. Jay On Thu, Sep 18, 2008 at 9:50 AM, Felix Klock's PLT scheme proxy wrote: > PLTers- > > From the documentation for the xml.ss library: > >> "The xml library does not provides [sic] Document Type Declaration (DTD) >> processing, validation, expanding user-defined entities, or reading >> user-defined entities in attributes." > > > Is the phrase "DTD processing" meant to include functionality such as > "reading the DOCTYPE declaration given in the input file"? > > From what I can tell from the observable behavior and the source text of > xml.ss, the XML parsing skips over DOCTYPE declarations in the input. > > If the silent dropping of the DTD declaration is intentional, I think the > documentation should be clearer, and I will file a bug report against the > docs. If it is not intentional (or a feature waiting to be implemented), > then I will file a bug report against the source code. Right now I cannot > tell where the bug report belongs. > > -Felix > > p.s. Here's an example illustrating what I'm talking about: > > #lang scheme > (require (lib "xml.ss" "xml")) > > (define source-html-string #< "-//W3C//DTD XHTML 1.0 Transitional//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > > END > ) > > (define source-document (read-xml (open-input-string source-html-string))) > > (write-xml source-document) > (newline) > ;; prints: > ;; > ;; and so we've lost information from the input > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From matthias at ccs.neu.edu Thu Sep 18 12:09:12 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:28:48 2009 Subject: [plt-scheme] xml.ss and DTDs In-Reply-To: References: <127ED213-D4AD-4B5F-935C-C5C9D42675BC@pnkfx.org> Message-ID: Go felix go! Submit a bug report :-) On Sep 18, 2008, at 12:02 PM, Jay McCarthy wrote: > The xml library will print back the DTD if it is in the prolog struct > of the document struct. However, there is no parser for DTDs, so > read-xml will always have #f in the dtd field of the prolog struct. > This shows up on xml/private/reader.ss:30. I imagine that the skip-dtd > function therein might (roughly) know how to parse them. > > Now, as far as "Is this intentional?" I'm responsible for the XML > library, because someone who was responsible for it once was also > responsible for the web server. I've fixed maybe one bug in my tenure > and never touched it otherwise. If you submit a bug, I will either > update the documentation or try to write the parser. > > Jay > > On Thu, Sep 18, 2008 at 9:50 AM, Felix Klock's PLT scheme proxy > wrote: >> PLTers- >> >> From the documentation for the xml.ss library: >> >>> "The xml library does not provides [sic] Document Type >>> Declaration (DTD) >>> processing, validation, expanding user-defined entities, or reading >>> user-defined entities in attributes." >> >> >> Is the phrase "DTD processing" meant to include functionality such as >> "reading the DOCTYPE declaration given in the input file"? >> >> From what I can tell from the observable behavior and the source >> text of >> xml.ss, the XML parsing skips over DOCTYPE declarations in the input. >> >> If the silent dropping of the DTD declaration is intentional, I >> think the >> documentation should be clearer, and I will file a bug report >> against the >> docs. If it is not intentional (or a feature waiting to be >> implemented), >> then I will file a bug report against the source code. Right now >> I cannot >> tell where the bug report belongs. >> >> -Felix >> >> p.s. Here's an example illustrating what I'm talking about: >> >> #lang scheme >> (require (lib "xml.ss" "xml")) >> >> (define source-html-string #<> > "-//W3C//DTD XHTML 1.0 Transitional//EN" >> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> >> >> END >> ) >> >> (define source-document (read-xml (open-input-string source-html- >> string))) >> >> (write-xml source-document) >> (newline) >> ;; prints: >> ;; >> ;; and so we've lost information from the input >> >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme >> > > > > -- > Jay McCarthy > Assistant Professor / Brigham Young University > http://jay.teammccarthy.org > > "The glory of God is Intelligence" - D&C 93 > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From corey.sweeney at gmail.com Thu Sep 18 15:42:04 2008 From: corey.sweeney at gmail.com (Corey Sweeney) Date: Thu Mar 26 02:28:48 2009 Subject: [plt-scheme] Load times Message-ID: I've been experiencing worse and worse load times, as I write more and more libraries. Many of my programs are supposed to run for a second, then quit, so the load times are significant. I've been running some compilation and modularization expirments, and havn't had much luck. If I understand correctly, compiling with "mzc" does not make a "static" binary, so when the code is run, all the functions that in the libraries that aren't used by the application are still loaded. Are there any recomendations for reducing load times? Is there any way to strip out unused functions? Corey -- ((lambda (y) (y y)) (lambda (y) (y y))) From noelwelsh at gmail.com Thu Sep 18 15:57:55 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:28:48 2009 Subject: [plt-scheme] Load times In-Reply-To: References: Message-ID: mzc -k your-main-file.ss You will see a dramatic difference in load time, as MzScheme can read bytecode MUCH faster than it can read and compile Scheme source. N. On Thu, Sep 18, 2008 at 8:42 PM, Corey Sweeney wrote: > I've been experiencing worse and worse load times, as I write more and > more libraries. Many of my programs are supposed to run for a second, > then quit, so the load times are significant. I've been running some > compilation and modularization expirments, and havn't had much luck. > If I understand correctly, compiling with "mzc" does not make a > "static" binary, so when the code is run, all the functions that in > the libraries that aren't used by the application are still loaded. > > Are there any recomendations for reducing load times? Is there any > way to strip out unused functions? > > Corey From psykosh at earthlink.net Thu Sep 18 17:00:14 2008 From: psykosh at earthlink.net (Psy-Kosh) Date: Thu Mar 26 02:28:48 2009 Subject: [plt-scheme] fluxus 0.15 In-Reply-To: References: Message-ID: On Thu, 18 Sep 2008 06:05:39 -0400, Dave Griffiths wrote: > Fluxus is an environment for livecoding and rapid prototyping of visible > and audible worlds - games, realtime graphics and reactive audio. Fluxus > builds on Linux and OSX. > > http://www.pawfal.org/fluxus > http://www.pawfal.org/fluxus/files/fluxus-0.15rc3.tar.gz > Any chance there'll be a win version of this eventually, or I shouldn't hold my breath on that? Either way, seen demo vids of it and I think it's cool. Psy-Kosh From corey.sweeney at gmail.com Thu Sep 18 18:40:30 2008 From: corey.sweeney at gmail.com (Corey Sweeney) Date: Thu Mar 26 02:28:48 2009 Subject: [plt-scheme] Load times In-Reply-To: References: Message-ID: Interesting. I was already compiling things, but your way seems to load about 30% faster then "mzc --extension --auto-dir" which I was doing. Corey On Thu, Sep 18, 2008 at 2:57 PM, Noel Welsh wrote: > mzc -k your-main-file.ss > > You will see a dramatic difference in load time, as MzScheme can read > bytecode MUCH faster than it can read and compile Scheme source. > > N. > > On Thu, Sep 18, 2008 at 8:42 PM, Corey Sweeney wrote: >> I've been experiencing worse and worse load times, as I write more and >> more libraries. Many of my programs are supposed to run for a second, >> then quit, so the load times are significant. I've been running some >> compilation and modularization expirments, and havn't had much luck. >> If I understand correctly, compiling with "mzc" does not make a >> "static" binary, so when the code is run, all the functions that in >> the libraries that aren't used by the application are still loaded. >> >> Are there any recomendations for reducing load times? Is there any >> way to strip out unused functions? >> >> Corey > -- ((lambda (y) (y y)) (lambda (y) (y y))) From czhu at cs.utah.edu Thu Sep 18 19:07:40 2008 From: czhu at cs.utah.edu (Chongkai Zhu) Date: Thu Mar 26 02:28:49 2009 Subject: [plt-scheme] Load times In-Reply-To: References: Message-ID: <48D2DF3C.6000905@cs.utah.edu> "mzc --extension" compiles to Native Code via C; "mzc -k" compiles to Bytecode. For PLT, Bytecode is faster than Native Code. Chongkai Corey Sweeney wrote: > Interesting. I was already compiling things, but your way seems to > load about 30% faster then "mzc --extension --auto-dir" which I was > doing. > > Corey > > On Thu, Sep 18, 2008 at 2:57 PM, Noel Welsh wrote: > >> mzc -k your-main-file.ss >> >> You will see a dramatic difference in load time, as MzScheme can read >> bytecode MUCH faster than it can read and compile Scheme source. >> >> N. >> >> On Thu, Sep 18, 2008 at 8:42 PM, Corey Sweeney wrote: >> >>> I've been experiencing worse and worse load times, as I write more and >>> more libraries. Many of my programs are supposed to run for a second, >>> then quit, so the load times are significant. I've been running some >>> compilation and modularization expirments, and havn't had much luck. >>> If I understand correctly, compiling with "mzc" does not make a >>> "static" binary, so when the code is run, all the functions that in >>> the libraries that aren't used by the application are still loaded. >>> >>> Are there any recomendations for reducing load times? Is there any >>> way to strip out unused functions? >>> >>> Corey >>> > > > > From grettke at acm.org Thu Sep 18 22:38:45 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:49 2009 Subject: [plt-scheme] fluxus 0.15 In-Reply-To: References: Message-ID: <756daca50809181938o62c06fa2i51d0436173a8ba81@mail.gmail.com> Official OSX support is a new-thing, isn't it? Surprised you didn't emphasize that. From grettke at acm.org Thu Sep 18 23:38:37 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:49 2009 Subject: [plt-scheme] HtDP: Question on 10.1.9 Message-ID: <756daca50809182038s74eb4a94m28f95e0b645b8ed8@mail.gmail.com> Hi folks, Is this data definition "going overboard" for 10.1.9? ;; A controller-cent-amount is either ;; 1. (cons 1 (cons 'cent empty)) or ;; 2. (cons n (cons 'cents empty)) where n is a non-negative number not equal to 1 ;; A controller-dollar-amount is either ;; 1. (cons 1 (cons 'dollar (cons 'and controller-cent-amount))) or ;; 2. (cons n (cons 'dollars (cons 'and controller-cent-amount))) where n is a non-negative number not equal to 1 ;; A controller-result is either ;; 1. controller-cent-amount or ;; 2. controller-dollar-amount ;; controller : number -> controller-result ;; to determine the description of the amount n It certainly made it easy to write using cond. Best wishes, Grant From dave at pawfal.org Fri Sep 19 05:12:52 2008 From: dave at pawfal.org (Dave Griffiths) Date: Thu Mar 26 02:28:49 2009 Subject: [plt-scheme] fluxus 0.15 In-Reply-To: References: Message-ID: > On Thu, 18 Sep 2008 06:05:39 -0400, Dave Griffiths > wrote: > >> Fluxus is an environment for livecoding and rapid prototyping of visible >> and audible worlds - games, realtime graphics and reactive audio. Fluxus >> builds on Linux and OSX. >> >> http://www.pawfal.org/fluxus >> http://www.pawfal.org/fluxus/files/fluxus-0.15rc3.tar.gz >> > > Any chance there'll be a win version of this eventually, or I shouldn't > hold my breath on that? There is nothing stopping a win port happening, I just don't own a windows box to do it myself. I can't right now think of anything major that would stop it compiling under cygwin, and a native port shouldn't be *too* bad - but there are some pthreads and other posix things here and there. The OSX build is maintained by other developers - I guess we just haven't attracted any windows people. > Either way, seen demo vids of it and I think it's cool. Thanks! dave From matthias at ccs.neu.edu Fri Sep 19 08:19:41 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:28:49 2009 Subject: [plt-scheme] HtDP: Question on 10.1.9 In-Reply-To: <756daca50809182038s74eb4a94m28f95e0b645b8ed8@mail.gmail.com> References: <756daca50809182038s74eb4a94m28f95e0b645b8ed8@mail.gmail.com> Message-ID: I wouldn't bother with two definitions. On Sep 18, 2008, at 11:38 PM, Grant Rettke wrote: > Hi folks, > > Is this data definition "going overboard" for 10.1.9? > > ;; A controller-cent-amount is either > ;; 1. (cons 1 (cons 'cent empty)) or > ;; 2. (cons n (cons 'cents empty)) where n is a non-negative number > not equal to 1 > > ;; A controller-dollar-amount is either > ;; 1. (cons 1 (cons 'dollar (cons 'and controller-cent-amount))) or > ;; 2. (cons n (cons 'dollars (cons 'and controller-cent-amount))) > where n is a non-negative number not equal to 1 > > ;; A controller-result is either > ;; 1. controller-cent-amount or > ;; 2. controller-dollar-amount > > ;; controller : number -> controller-result > ;; to determine the description of the amount n > > It certainly made it easy to write using cond. > > Best wishes, > > Grant > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From jensaxel at soegaard.net Fri Sep 19 09:24:46 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:28:49 2009 Subject: [plt-scheme] Trac on PLaneT Message-ID: <48D3A81E.8020800@soegaard.net> Hi All, Is Trac supposed to send me an email, when a ticket is made? If not, is there an alternative way to be informed of new tickets? By accident I discovered a series of new tickets. Fortunately (?) they all seem to be spam. http://planet.plt-scheme.org/trac/ticket/66 -- Jens Axel S?gaard From jensaxel at soegaard.net Fri Sep 19 09:36:07 2008 From: jensaxel at soegaard.net (Jens Axel Soegaard) Date: Thu Mar 26 02:28:50 2009 Subject: [plt-scheme] Trac on PLaneT In-Reply-To: <48D3A81E.8020800@soegaard.net> References: <48D3A81E.8020800@soegaard.net> Message-ID: <48D3AAC7.4080509@soegaard.net> Jens Axel Soegaard wrote: > Hi All, > > Is Trac supposed to send me an email, when a ticket is made? > If not, is there an alternative way to be informed of new > tickets? Mystery solved. The username although an email address, is not used as the notification email address. > > By accident I discovered a series of new tickets. Fortunately (?) > they all seem to be spam. > > http://planet.plt-scheme.org/trac/ticket/66 > /Jens Axel From matthias at ccs.neu.edu Fri Sep 19 10:08:31 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:28:50 2009 Subject: [plt-scheme] HtDP: Question on 10.1.9 In-Reply-To: References: <756daca50809182038s74eb4a94m28f95e0b645b8ed8@mail.gmail.com> Message-ID: <929D3923-C007-4141-932B-A6B18C50C77F@ccs.neu.edu> Here I am responding to myself -) This problem is a bit of a "look ahead" or "cheat" given to where I am posing it. Why? In general, it's a "parsing" problem and as such deserves a "structural output" recipe. PLAI is the correct place to look for this. For "freshmen" it's too challenging. ** The structure of the INPUT does not help you at all when you solve this problem. ** The structure of the OUTPUT though suggests an organization and arithmetic operations that help. So yes, DATA Defs are good simply because they help you wrap your head around the problem. But they do not suggest a template in the sense of HTDP. -- Matthias On Sep 19, 2008, at 8:19 AM, Matthias Felleisen wrote: > > I wouldn't bother with two definitions. > > On Sep 18, 2008, at 11:38 PM, Grant Rettke wrote: > >> Hi folks, >> >> Is this data definition "going overboard" for 10.1.9? >> >> ;; A controller-cent-amount is either >> ;; 1. (cons 1 (cons 'cent empty)) or >> ;; 2. (cons n (cons 'cents empty)) where n is a non-negative number >> not equal to 1 >> >> ;; A controller-dollar-amount is either >> ;; 1. (cons 1 (cons 'dollar (cons 'and controller-cent-amount))) or >> ;; 2. (cons n (cons 'dollars (cons 'and controller-cent-amount))) >> where n is a non-negative number not equal to 1 >> >> ;; A controller-result is either >> ;; 1. controller-cent-amount or >> ;; 2. controller-dollar-amount >> >> ;; controller : number -> controller-result >> ;; to determine the description of the amount n >> >> It certainly made it easy to write using cond. >> >> Best wishes, >> >> Grant >> _________________________________________________ >> For list-related administrative tasks: >> http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From jos.koot at telefonica.net Fri Sep 19 10:36:45 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:28:51 2009 Subject: [plt-scheme] module lambda-calculus Message-ID: <10BD2ED813894F4B91B9A30F30225028@uw2b2dff239c4d> Section 12.5 (Special Syntax Identifiers) of the PLT MzScheme Language Manual (version 360) shows an implementation of Lambda Calculus with applicative order evaluation. I can't find this example in the docs of version 4. (Currently I have Welcome to DrScheme, version 4.1.0.3-svn14sep2008 [3m].) Is it dropped? Or am I blind? If it's dropped, why? I find it a beautiful example :) I have adapted my own normal order lambda calculus modules for version 4. They work fine, although it worries me that some of the modules won't run (#lang scheme, DrScheme, run button) but do compile and pass tests. How can that be? There is some complaint: "compile: bad syntax; function application is not allowed, because no #%app syntax transformer is bound" which does not occur when requiring or compiling. If more info is required I would be happy to supply it (I do some nasty things in my code, but nevertheless I wonder why it won't simply run while it does compile and can be required without problems) Jos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080919/1a9942a4/attachment.html From grettke at acm.org Fri Sep 19 13:51:35 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:51 2009 Subject: [plt-scheme] HtDP: Another question on 10.1.9 Message-ID: <756daca50809191051se6d6avc6826831331e0af7@mail.gmail.com> Hi, I think I may have abused a recipe to come up with the solution for 10.1.9. Here is what I mean, my friend solved it like this: (cons (cons (cons 'and (cons (cons empty))))) This clearly works fine. I followed (abused?) a recipe by using cond and having the first clause handle any amount under 100. It looks like this: (cond [(< n 100) ] [else (cons )]) As long as the user provides >= 100, the expectation of a 5 items list is met. However, does the solution need to be recursive? Did I over do it? Best wishes, Grant From jay.mccarthy at gmail.com Fri Sep 19 17:02:27 2008 From: jay.mccarthy at gmail.com (Jay McCarthy) Date: Thu Mar 26 02:28:51 2009 Subject: [plt-scheme] Formlets in PLT In-Reply-To: References: <48D0DE35.2070308@ccs.neu.edu> <18640.57835.359784.558389@arabic.ccs.neu.edu> <20080917114914.1574F650091@mail-svr1.cs.utah.edu> Message-ID: The formlet documentation is live in SVN and at: http://docs.plt-scheme.org/web-server/formlets.html On Wed, Sep 17, 2008 at 9:43 AM, Jay McCarthy wrote: > I've just done this. Expect good documentation as well relatively soon. > > Jay > > On Wed, Sep 17, 2008 at 5:49 AM, Matthew Flatt wrote: >> At Wed, 17 Sep 2008 06:54:35 -0400, Eli Barzilay wrote: >>> On Sep 17, Dave Herman wrote: >>> > > In the latest SVN, there is a web-server/formlets directory with a >>> > > 'formlets' module. >>> > >>> > How about a `main' module in the web-server/formlets directory... >>> > >>> > > (require web-server/formlets/formlets) >>> > >>> > ...so you could write (require web-server/formlets)? >>> >>> The `main.ss' thing works only at the top level of a collection. >> >> But if you want to use the path `web-server/formlets' (which seems like >> a good idea to me), you just create a "formlets.ss" in the "web-server" >> collection. >> >> >> > > > > -- > Jay McCarthy > Assistant Professor / Brigham Young University > http://jay.teammccarthy.org > > "The glory of God is Intelligence" - D&C 93 > -- Jay McCarthy Assistant Professor / Brigham Young University http://jay.teammccarthy.org "The glory of God is Intelligence" - D&C 93 From hufflen at lifc.univ-fcomte.fr Fri Sep 19 19:09:45 2008 From: hufflen at lifc.univ-fcomte.fr (hufflen@lifc.univ-fcomte.fr) Date: Thu Mar 26 02:28:51 2009 Subject: [plt-scheme] Strange Message-ID: <48962.194.57.88.66.1221865785.squirrel@lifc-webmail.univ-fcomte.fr> Hello, PLT Schemers, I noticed soemthing strange in PLT 4.0.2 and 4.1 when using the #!r6rs mode: (write #\x) displays #\alarm Is there an explanation of that, please? On another point, there is a strange bug. If you write something like: (write '(1 . 2 . 3)) that causes an error, of course. But after the evaluation of an #!r6rs program, if I type: '(1 . 2 . 3) in the interactions' window, the result is (2 1 3). ??? Cheers, J.-M. H. From cce at ccs.neu.edu Fri Sep 19 20:29:06 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:28:51 2009 Subject: [plt-scheme] HtDP: Another question on 10.1.9 In-Reply-To: <756daca50809191051se6d6avc6826831331e0af7@mail.gmail.com> References: <756daca50809191051se6d6avc6826831331e0af7@mail.gmail.com> Message-ID: <990e0c030809191729v62cc548aobb3966b11996d72b@mail.gmail.com> On Fri, Sep 19, 2008 at 10:51 AM, Grant Rettke wrote: > > I followed (abused?) a recipe by using cond and having the first > clause handle any amount under 100. It looks like this: > > (cond > [(< n 100) ] > [else (cons )]) Natural recursion? What's so natural about it? -- Carl Eastlund From grettke at acm.org Fri Sep 19 23:44:10 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:51 2009 Subject: [plt-scheme] HtDP: Another question on 10.1.9 In-Reply-To: <990e0c030809191729v62cc548aobb3966b11996d72b@mail.gmail.com> References: <756daca50809191051se6d6avc6826831331e0af7@mail.gmail.com> <990e0c030809191729v62cc548aobb3966b11996d72b@mail.gmail.com> Message-ID: <756daca50809192044x1b4a78c1hc5e78a96593e4850@mail.gmail.com> On Fri, Sep 19, 2008 at 7:29 PM, Carl Eastlund wrote: > On Fri, Sep 19, 2008 at 10:51 AM, Grant Rettke wrote: >> >> I followed (abused?) a recipe by using cond and having the first >> clause handle any amount under 100. It looks like this: >> >> (cond >> [(< n 100) ] >> [else (cons )]) > > Natural recursion? What's so natural about it? You don't need to do all of the work at once, you handle the part that you need and let the function do the rest of it. In this case, the rest is everything under 100. Is this a valid approach if there is only one recursive step? Or were you just giving me a hard time with your reply? From pivanyi at freemail.hu Sat Sep 20 05:43:43 2008 From: pivanyi at freemail.hu (Ivanyi Peter) Date: Thu Mar 26 02:28:51 2009 Subject: [plt-scheme] [ANN] MrEd Designer 2.1.3 Message-ID: Dear All, There is a new version of MrEd Designer, version 2.1.3. In this version: - tooltips are added for the main buttons - the no-border style for the tab-panels is fixed. The program is still at http://www.hexahedron.hu/personal/peteri/mreddesigner/index.html Enjoy. Best regards, Peter Ivanyi ______________________________________________________________________ K?nyvszerda 30% kedvezm?nnyel! HVG, Typotex ?s Tinta kiad?k k?nyveinek teljes k?n?lata. http://bookline.hu/control/news?newsid=397&tabname=book&affiliate=frekszkar6632 From jos.koot at telefonica.net Sat Sep 20 06:13:54 2008 From: jos.koot at telefonica.net (Jos Koot) Date: Thu Mar 26 02:28:52 2009 Subject: [plt-scheme] Strange References: <48962.194.57.88.66.1221865785.squirrel@lifc-webmail.univ-fcomte.fr> Message-ID: In PLT Scheme (e.q. #lang scheme), (1 . + . 3) is read as (+ 1 3) allowing a kind of infix notation. That this notation is also accepted in #!r6rs probably stems from the underlying Scheme. Jos ----- Original Message ----- From: To: Sent: Saturday, September 20, 2008 1:09 AM Subject: [plt-scheme] Strange > Hello, PLT Schemers, > > I noticed soemthing strange in PLT 4.0.2 and 4.1 when using the #!r6rs > mode: > > (write #\x) displays #\alarm > > Is there an explanation of that, please? > > On another point, there is a strange bug. If you write something like: > > (write '(1 . 2 . 3)) > > that causes an error, of course. But after the evaluation of an #!r6rs > program, if I type: > > '(1 . 2 . 3) > in the interactions' window, the result is (2 1 3). > > ??? > > Cheers, > > J.-M. H. > > > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > From mflatt at cs.utah.edu Sat Sep 20 07:21:52 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:28:52 2009 Subject: [plt-scheme] Strange In-Reply-To: References: <48962.194.57.88.66.1221865785.squirrel@lifc-webmail.univ-fcomte.fr> Message-ID: <20080920112157.069D06500AE@mail-svr1.cs.utah.edu> > (write #\x) displays #\alarm > > Is there an explanation of that, please? It's a bug, now fixed in SVN. Thanks for the report! > On another point, there is a strange bug. If you write something like: > > (write '(1 . 2 . 3)) > > that causes an error, of course. But after the evaluation of an #!r6rs > program, if I type: > > '(1 . 2 . 3) > in the interactions' window, the result is (2 1 3). DrScheme can't yet configure parsing in the interactions window based on the language of a module in he definitions window. We're currently working on that improvement. Meanwhile, as Jos says, you get the PLT Scheme reader in the interactions window instead of an R6RS reader. Matthew From matthias at ccs.neu.edu Sat Sep 20 09:15:16 2008 From: matthias at ccs.neu.edu (Matthias Felleisen) Date: Thu Mar 26 02:28:52 2009 Subject: [plt-scheme] HtDP: Another question on 10.1.9 In-Reply-To: <756daca50809192044x1b4a78c1hc5e78a96593e4850@mail.gmail.com> References: <756daca50809191051se6d6avc6826831331e0af7@mail.gmail.com> <990e0c030809191729v62cc548aobb3966b11996d72b@mail.gmail.com> <756daca50809192044x1b4a78c1hc5e78a96593e4850@mail.gmail.com> Message-ID: <82B02488-2EAA-4402-99B0-969C58C941BA@ccs.neu.edu> In HtDP, the word "natural" is a technical word. It means if your INPUT data definition has a self-reference in the Nth clause for the Kth field then your template has a recursion in the Nth cond clause for the Kth field. For Part II, N is usually 1 or 2 and K is also usually 1 or 2. Try this: An RD is one of: -- 'doll -- (cons RD empty) Problem: design a function that counts the number of cons layers around 'doll. -- Matthias On Sep 19, 2008, at 11:44 PM, Grant Rettke wrote: > On Fri, Sep 19, 2008 at 7:29 PM, Carl Eastlund > wrote: >> On Fri, Sep 19, 2008 at 10:51 AM, Grant Rettke >> wrote: >>> >>> I followed (abused?) a recipe by using cond and having the first >>> clause handle any amount under 100. It looks like this: >>> >>> (cond >>> [(< n 100) ] >>> [else (cons )]) >> >> Natural recursion? What's so natural about it? > > You don't need to do all of the work at once, you handle the part that > you need and let the function do the rest of it. In this case, the > rest is everything under 100. Is this a valid approach if there is > only one recursive step? > > Or were you just giving me a hard time with your reply? > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme From cce at ccs.neu.edu Sat Sep 20 10:13:42 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:28:52 2009 Subject: [plt-scheme] HtDP: Another question on 10.1.9 In-Reply-To: <756daca50809192044x1b4a78c1hc5e78a96593e4850@mail.gmail.com> References: <756daca50809191051se6d6avc6826831331e0af7@mail.gmail.com> <990e0c030809191729v62cc548aobb3966b11996d72b@mail.gmail.com> <756daca50809192044x1b4a78c1hc5e78a96593e4850@mail.gmail.com> Message-ID: <990e0c030809200713g2c1ece5eq81f00db48fddc1d0@mail.gmail.com> On Fri, Sep 19, 2008 at 8:44 PM, Grant Rettke wrote: > On Fri, Sep 19, 2008 at 7:29 PM, Carl Eastlund wrote: >> On Fri, Sep 19, 2008 at 10:51 AM, Grant Rettke wrote: >>> >>> I followed (abused?) a recipe by using cond and having the first >>> clause handle any amount under 100. It looks like this: >>> >>> (cond >>> [(< n 100) ] >>> [else (cons )]) >> >> Natural recursion? What's so natural about it? > > You don't need to do all of the work at once, you handle the part that > you need and let the function do the rest of it. In this case, the > rest is everything under 100. Is this a valid approach if there is > only one recursive step? > > Or were you just giving me a hard time with your reply? Let me put it another way -- what's so recursion about it? To be less cryptic, if you read your purpose statement, and apply it to the recursive call, does it make sense? Are you really solving a smaller instance of the same problem, or are you just solving a smaller problem? The former is recursion; the latter is not (and suggests either inlining or a helper function). -- Carl Eastlund From grettke at acm.org Sat Sep 20 10:34:35 2008 From: grettke at acm.org (Grant Rettke) Date: Thu Mar 26 02:28:52 2009 Subject: [plt-scheme] HtDP: Another question on 10.1.9 In-Reply-To: <990e0c030809200713g2c1ece5eq81f00db48fddc1d0@mail.gmail.com> References: <756daca50809191051se6d6avc6826831331e0af7@mail.gmail.com> <990e0c030809191729v62cc548aobb3966b11996d72b@mail.gmail.com> <756daca50809192044x1b4a78c1hc5e78a96593e4850@mail.gmail.com> <990e0c030809200713g2c1ece5eq81f00db48fddc1d0@mail.gmail.com> Message-ID: <756daca50809200734w4013fabdj14100ef05abf044f@mail.gmail.com> On Sat, Sep 20, 2008 at 9:13 AM, Carl Eastlund wrote: > To be less > cryptic, if you read your purpose statement, and apply it to the > recursive call, does it make sense? No. > Are you really solving a smaller > instance of the same problem, or are you just solving a smaller > problem? A smaller problem. > The former is recursion; the latter is not (and suggests > either inlining or a helper function). Thanks, Carl and Matthias.. From cce at ccs.neu.edu Sat Sep 20 10:42:19 2008 From: cce at ccs.neu.edu (Carl Eastlund) Date: Thu Mar 26 02:28:52 2009 Subject: [plt-scheme] HtDP: Another question on 10.1.9 In-Reply-To: <756daca50809200734w4013fabdj14100ef05abf044f@mail.gmail.com> References: <756daca50809191051se6d6avc6826831331e0af7@mail.gmail.com> <990e0c030809191729v62cc548aobb3966b11996d72b@mail.gmail.com> <756daca50809192044x1b4a78c1hc5e78a96593e4850@mail.gmail.com> <990e0c030809200713g2c1ece5eq81f00db48fddc1d0@mail.gmail.com> <756daca50809200734w4013fabdj14100ef05abf044f@mail.gmail.com> Message-ID: <990e0c030809200742i447f5d38w12d00b7fb7655765@mail.gmail.com> On Sat, Sep 20, 2008 at 7:34 AM, Grant Rettke wrote: > On Sat, Sep 20, 2008 at 9:13 AM, Carl Eastlund wrote: >> To be less >> cryptic, if you read your purpose statement, and apply it to the >> recursive call, does it make sense? > > No. > >> Are you really solving a smaller >> instance of the same problem, or are you just solving a smaller >> problem? > > A smaller problem. > >> The former is recursion; the latter is not (and suggests >> either inlining or a helper function). > > Thanks, Carl and Matthias.. Glad to help. For future reference, what I described is a way to tell after the fact whether what you wrote makes sense as recursion, but what Matthias described is the part of the design recipe that tells you whether to use it or not before you even start. Focus on what he said (and what's in the book) for figuring out how to apply recursion, and you'll find you can always answer what I asked with "yes". -- Carl Eastlund From deepankar.sharma at gmail.com Sat Sep 20 11:23:32 2008 From: deepankar.sharma at gmail.com (deepankar) Date: Thu Mar 26 02:28:53 2009 Subject: [plt-scheme] Writing a game and have questions Message-ID: I am writing a game using DrScheme (actually am implementing this existing game http://www.bubblebox.com/play/puzzle/539.htm) and have some questions that I ran into along the way. I draw a tiled array of hexagons on a canvas using paths. Now I would like to detect which hexagon is beeing clicked on. One way of implementing this would be to render the hexagons to an offscreen buffer on startup - where each hexagon is drawn using a unique color. When the user clicks on screen, i fetch the color from the offscreen buffer and figure out the hexagon being clicked on. For this I have two questions 1) Is it possible to draw a canvas to an offscreen buffer ? 2) Is it possible to fetch pixel values from a canvas. Feel free to suggest any alternative approaches to solving the same problem. Thanks, Deepankar -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080920/644059b9/attachment.htm From neil at neilvandyke.org Sat Sep 20 11:49:08 2008 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:28:54 2009 Subject: [plt-scheme] Writing a game and have questions In-Reply-To: References: Message-ID: <48D51B74.3000305@neilvandyke.org> Have you considered an arithmetic or algorithmic solution, using only the coordinates of the mouse click and what you know about hexagonal grid? The input to your function would be the X and Y coordinates on your canvas where the mouse was clicked. The output of your function would be some kind of identifier for the clicked hexagon, such as an object, array index, or hexagonal-coordinates. By sketching this out on paper, I think you will see how you can at least narrow down the selected hexagon to only a few. Once you have that coarse mapping between the coordinates, trigonometry or arithmetic will tell you to which side of a diagonal line a point falls... deepankar wrote at 09/20/2008 11:23 AM: > I draw a tiled array of hexagons on a canvas using paths. Now I would > like to detect which hexagon is beeing clicked on. -- http://www.neilvandyke.org/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080920/d0f6725b/attachment.html From deepankar.sharma at gmail.com Sat Sep 20 13:54:34 2008 From: deepankar.sharma at gmail.com (Deep) Date: Thu Mar 26 02:28:54 2009 Subject: [plt-scheme] Re: Writing a game and have questions In-Reply-To: <48D51B74.3000305@neilvandyke.org> References: <48D51B74.3000305@neilvandyke.org> Message-ID: I had thought about this - it certainly is possible to narrow down any click down to 2-4 hexagons depending on how youre slicing the screen up. The reason for the offscreen buffer scheme was that its a bit more general. In the sense that if tomm I was using some ill defined shapes (like say a Monster which would be an image with alpha) I could still render their outlines to the offscreen click map and get the results. I can also express the shapes as convex polygons and do the standard point inside polygon method - but wanted to know if a cheaper test was feasible since the click offscreen buffer can be rendered once on startup and used. On Sep 20, 11:49?am, Neil Van Dyke wrote: > Have you considered an arithmetic or algorithmic solution, using only > the coordinates of the mouse click and what you know about hexagonal grid? > > The input to your function would be the X and Y coordinates on your > canvas where the mouse was clicked. ?The output of your function would > be some kind of identifier for the clicked hexagon, such as an object, > array index, or hexagonal-coordinates. > > By sketching this out on paper, I think you will see how you can at > least narrow down the selected hexagon to only a few. ?Once you have > that coarse mapping between the coordinates, trigonometry or arithmetic > will tell you to which side of a diagonal line a point falls... > > deepankar wrote at 09/20/2008 11:23 AM: > > > I draw a tiled array of hexagons on a canvas using paths. Now I would > > like to detect which hexagon is beeing clicked on. > > --http://www.neilvandyke.org/ > > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme From goetter at mazama.net Sat Sep 20 15:20:14 2008 From: goetter at mazama.net (Ben Goetter) Date: Thu Mar 26 02:28:54 2009 Subject: [plt-scheme] Is collects/games/doors dead code? Message-ID: <48D54CEE.1020401@mazama.net> Assuming that collects/games/doors is not dead, how does one instantiate door-game%? My first guess of (require mred games/doors/doors) (define f (instantiate frame% ("Test") (width 700) (height 600))) (define g (instantiate door-game% ((f 6 6))) (send f show #t) draws only an empty frame. (It appears that the setup sequence needs to call new-player and new-thing with some image data....) I was grepping for usages of bitmap->gl-list, and was intrigued. Thanks, Ben From neil at neilvandyke.org Sat Sep 20 15:35:13 2008 From: neil at neilvandyke.org (Neil Van Dyke) Date: Thu Mar 26 02:28:54 2009 Subject: [plt-scheme] Re: Writing a game and have questions In-Reply-To: References: <48D51B74.3000305@neilvandyke.org> Message-ID: <48D55071.9050604@neilvandyke.org> I don't know the answer to the offscreen buffer question. If you decide not to go that route, and these objects like monsters are not all bound to particular hex tiles or do not fill the tiles completely for purposes of picking (so you can't just find the hex tile and then check a data structure to see whether there's a monster associated with the hex tile), you might consider implementing this kind of object picking as a two-step algorithm. The first step would be to determine which if any of the monster-like objects is clicked (by, e.g., scanning linearly through lists of them and checking for point inside polygons, or by using a fancy computational geometry method). The second step would be, if no monster-like thing was clicked, to use the simple arithmetic means of determining which hex tile was clicked. I think that would be more of the CAD way of doing things, and it is not subject to some of the limitations and potential headaches of the off-screen pixel-peeping method. Probably for your game, either approach would be fine, but just thought I'd mention it, in case you have trouble with pixel-peeping or you later need to implement something that scale better. (You did ask originally for other approach suggestions. :) Deep wrote at 09/20/2008 01:54 PM: > The reason for the offscreen buffer scheme was that its a bit more > general. In the sense that if tomm I was using some ill defined shapes > (like say a Monster which would be an image with alpha) I could still > render their outlines to the offscreen click map and get the results. > -- http://www.neilvandyke.org/ From robby at cs.uchicago.edu Sat Sep 20 15:51:31 2008 From: robby at cs.uchicago.edu (Robby Findler) Date: Thu Mar 26 02:28:54 2009 Subject: [plt-scheme] Re: Writing a game and have questions In-Reply-To: <48D55071.9050604@neilvandyke.org> References: <48D51B74.3000305@neilvandyke.org> <48D55071.9050604@neilvandyke.org> Message-ID: <932b2f1f0809201251h48b81e07vd7ed52fe4b99236d@mail.gmail.com> In the specific case of PLT Scheme's GUI toolkit, probably the easiest thing to do is to both draw and determine if points are in regions via region% object or dc-path% objects. Robby On Sat, Sep 20, 2008 at 2:35 PM, Neil Van Dyke wrote: > I don't know the answer to the offscreen buffer question. > > If you decide not to go that route, and these objects like monsters are not > all bound to particular hex tiles or do not fill the tiles completely for > purposes of picking (so you can't just find the hex tile and then check a > data structure to see whether there's a monster associated with the hex > tile), you might consider implementing this kind of object picking as a > two-step algorithm. The first step would be to determine which if any of > the monster-like objects is clicked (by, e.g., scanning linearly through > lists of them and checking for point inside polygons, or by using a fancy > computational geometry method). The second step would be, if no > monster-like thing was clicked, to use the simple arithmetic means of > determining which hex tile was clicked. I think that would be more of the > CAD way of doing things, and it is not subject to some of the limitations > and potential headaches of the off-screen pixel-peeping method. > > Probably for your game, either approach would be fine, but just thought I'd > mention it, in case you have trouble with pixel-peeping or you later need to > implement something that scale better. (You did ask originally for other > approach suggestions. :) > > Deep wrote at 09/20/2008 01:54 PM: >> >> The reason for the offscreen buffer scheme was that its a bit more >> general. In the sense that if tomm I was using some ill defined shapes >> (like say a Monster which would be an image with alpha) I could still >> render their outlines to the offscreen click map and get the results. >> > > > -- > http://www.neilvandyke.org/ > _________________________________________________ > For list-related administrative tasks: > http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > From noelwelsh at gmail.com Sat Sep 20 17:02:25 2008 From: noelwelsh at gmail.com (Noel Welsh) Date: Thu Mar 26 02:28:55 2009 Subject: [plt-scheme] Fluxus + video processing Message-ID: Hi all, I've almost built up the courage to attempt installing fluxus. Before doing so, I have a question about video processing. I'm primarily interested in turning video streams into audio, via extracting, e.g. movement. Am I correct in thinking that fluxus has no libraries for doing so at the moment? Does anyone know a package (pure data?) that does support this? I'll probably still play around with fluxus, but I'd like to get a quick idea of what is feasible. Thanks, Noel From mflatt at cs.utah.edu Sun Sep 21 09:58:51 2008 From: mflatt at cs.utah.edu (Matthew Flatt) Date: Thu Mar 26 02:28:55 2009 Subject: [plt-scheme] Writing a game and have questions In-Reply-To: References: Message-ID: <20080921135852.E2A9865009C@mail-svr1.cs.utah.edu> Neil and Robby have given you good general answers --- compute the target without referring to the image, or use regions instead of an offscreen image --- but I'll answer the original questions: At Sat, 20 Sep 2008 11:23:32 -0400, "deepankar" wrote: > 1) Is it possible to draw a canvas to an offscreen buffer ? You can take a function that draws to a canvas and redirect it so that it draws to an offscreen image (i.e., swap a `bitmap-dc%' in place of a canvas `dc<%>'). > 2) Is it possible to fetch pixel values from a canvas. Canvas drawing is one-way only: you can send an image out to the user to see, but you cannot programmatically "look" at the canvas. Also, there's no way to take a snapshot of the canvas to get back an offscreen image. If you redirect a drawing function to an offscreen image, then you can, of course, inspect the pixels of the offscreen image. Matthew From m.douglas.williams at gmail.com Sun Sep 21 11:02:42 2008 From: m.douglas.williams at gmail.com (Doug Williams) Date: Thu Mar 26 02:28:56 2009 Subject: [plt-scheme] Writing a game and have questions In-Reply-To: <20080921135852.E2A9865009C@mail-svr1.cs.utah.edu> References: <20080921135852.E2A9865009C@mail-svr1.cs.utah.edu> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: animated-canvas.ss Type: application/octet-stream Size: 3488 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080921/d2b911f1/animated-canvas.obj From deepankar.sharma at gmail.com Sun Sep 21 11:18:48 2008 From: deepankar.sharma at gmail.com (Deep) Date: Thu Mar 26 02:28:56 2009 Subject: [plt-scheme] Re: Writing a game and have questions In-Reply-To: References: <20080921135852.E2A9865009C@mail-svr1.cs.utah.edu> Message-ID: Thanks for the very detailed, prompt and helpful answers. I decided to ditch the offscreen-buffer based approach and instead decided to implement a convex polygon + point in poly approach. Neil - thanks for the suggestions, I found them really helpful. Mathew - thanks for the rendering tips, i have a feeling they will be useful in the future. Doug - It would be great if you could send me an example app. Thanks, Deepankar On Sep 21, 11:02?am, "Doug Williams" wrote: > I have an animated canvas that I use for animation. ?I've never put it up on > PLaneT, but use it for many of my own applications. ?I can send an example > app if you want. > > Doug > > On Sun, Sep 21, 2008 at 7:58 AM, Matthew Flatt wrote: > > Neil and Robby have given you good general answers --- compute the > > target without referring to the image, or use regions instead of an > > offscreen image --- but I'll answer the original questions: > > > At Sat, 20 Sep 2008 11:23:32 -0400, "deepankar" wrote: > > > 1) Is it possible to draw a canvas to an offscreen buffer ? > > > You can take a function that draws to a canvas and redirect it so that > > it draws to an offscreen image (i.e., swap a `bitmap-dc%' in place of a > > canvas `dc<%>'). > > > > 2) Is it possible to fetch pixel values from a canvas. > > > Canvas drawing is one-way only: you can send an image out to the user > > to see, but you cannot programmatically "look" at the canvas. Also, > > there's no way to take a snapshot of the canvas to get back an > > offscreen image. > > > If you redirect a drawing function to an offscreen image, then you > > can, of course, inspect the pixels of the offscreen image. > > > Matthew > > > _________________________________________________ > > ?For list-related administrative tasks: > > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > > > ?animated-canvas.ss > 4KViewDownload > > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme From deepankar.sharma at gmail.com Sun Sep 21 11:18:48 2008 From: deepankar.sharma at gmail.com (Deep) Date: Thu Mar 26 02:28:56 2009 Subject: [plt-scheme] Re: Writing a game and have questions In-Reply-To: References: <20080921135852.E2A9865009C@mail-svr1.cs.utah.edu> Message-ID: Thanks for the very detailed, prompt and helpful answers. I decided to ditch the offscreen-buffer based approach and instead decided to implement a convex polygon + point in poly approach. Neil - thanks for the suggestions, I found them really helpful. Mathew - thanks for the rendering tips, i have a feeling they will be useful in the future. Doug - It would be great if you could send me an example app. Thanks, Deepankar On Sep 21, 11:02?am, "Doug Williams" wrote: > I have an animated canvas that I use for animation. ?I've never put it up on > PLaneT, but use it for many of my own applications. ?I can send an example > app if you want. > > Doug > > On Sun, Sep 21, 2008 at 7:58 AM, Matthew Flatt wrote: > > Neil and Robby have given you good general answers --- compute the > > target without referring to the image, or use regions instead of an > > offscreen image --- but I'll answer the original questions: > > > At Sat, 20 Sep 2008 11:23:32 -0400, "deepankar" wrote: > > > 1) Is it possible to draw a canvas to an offscreen buffer ? > > > You can take a function that draws to a canvas and redirect it so that > > it draws to an offscreen image (i.e., swap a `bitmap-dc%' in place of a > > canvas `dc<%>'). > > > > 2) Is it possible to fetch pixel values from a canvas. > > > Canvas drawing is one-way only: you can send an image out to the user > > to see, but you cannot programmatically "look" at the canvas. Also, > > there's no way to take a snapshot of the canvas to get back an > > offscreen image. > > > If you redirect a drawing function to an offscreen image, then you > > can, of course, inspect the pixels of the offscreen image. > > > Matthew > > > _________________________________________________ > > ?For list-related administrative tasks: > > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme > > > > ?animated-canvas.ss > 4KViewDownload > > _________________________________________________ > ? For list-related administrative tasks: > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme From m.douglas.williams at gmail.com Sun Sep 21 11:20:30 2008 From: m.douglas.williams at gmail.com (Doug Williams) Date: Thu Mar 26 02:28:57 2009 Subject: [plt-scheme] Writing a game and have questions In-Reply-To: References: <20080921135852.E2A9865009C@mail-svr1.cs.utah.edu> Message-ID: Skipped content of type multipart/alternative-------------- next part -------------- A non-text attachment was scrubbed... Name: boids.ss Type: application/octet-stream Size: 4348 bytes Desc: not available Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080921/0609bc0a/boids.obj From workmin at ccs.neu.edu Sun Sep 21 12:57:26 2008 From: workmin at ccs.neu.edu (Jon Rafkind) Date: Thu Mar 26 02:28:58 2009 Subject: [plt-scheme] preformatted text in scribble Message-ID: <48D67CF6.2010202@ccs.neu.edu> How can I write preformatted plain text in scribble? Something equivalent to HTML's
 tag. I thought maybe it was @t but that 
didn't work out right. As a very awful hack I used @schemeblock which 
preserves formatting (at the expense of making everything strings).

From m.douglas.williams at gmail.com  Sun Sep 21 13:01:22 2008
From: m.douglas.williams at gmail.com (Doug Williams)
Date: Thu Mar 26 02:28:58 2009
Subject: [plt-scheme] preformatted text in scribble
In-Reply-To: <48D67CF6.2010202@ccs.neu.edu>
References: <48D67CF6.2010202@ccs.neu.edu>
Message-ID: 

I use @verbatim{...}, which works for me.

On Sun, Sep 21, 2008 at 10:57 AM, Jon Rafkind  wrote:

> How can I write preformatted plain text in scribble? Something equivalent
> to HTML's 
 tag. I thought maybe it was @t but that didn't work out
> right. As a very awful hack I used @schemeblock which preserves formatting
> (at the expense of making everything strings).
> _________________________________________________
>  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/20080921/0546789f/attachment.htm
From workmin at ccs.neu.edu  Sun Sep 21 13:09:29 2008
From: workmin at ccs.neu.edu (Jon Rafkind)
Date: Thu Mar 26 02:28:58 2009
Subject: [plt-scheme] preformatted text in scribble
In-Reply-To: 
References: <48D67CF6.2010202@ccs.neu.edu>
	
Message-ID: <48D67FC9.10501@ccs.neu.edu>

Doug Williams wrote:
> I use @verbatim{...}, which works for me.
>
That works, thanks.
> On Sun, Sep 21, 2008 at 10:57 AM, Jon Rafkind  > wrote:
>
>     How can I write preformatted plain text in scribble? Something
>     equivalent to HTML's 
 tag. I thought maybe it was @t but that
>     didn't work out right. As a very awful hack I used @schemeblock
>     which preserves formatting (at the expense of making everything
>     strings).
>     _________________________________________________
>      For list-related administrative tasks:
>      http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
>


From m.douglas.williams at gmail.com  Sun Sep 21 13:58:25 2008
From: m.douglas.williams at gmail.com (Doug Williams)
Date: Thu Mar 26 02:28:59 2009
Subject: [plt-scheme] Some More Scribble Questions
Message-ID: 

I finally have the science collection documentation converted to Scribble,
but have some warnings I'd like to get rid of.

The problem is that I am using sub-collections and have some interdependent
sets of functionality (specifically, gamma, psi, and zeta functions) that
are in a single module, but documented in separate sections.  Let me give a
simplified example.

main.scrbl
...
@include-section["section.scrbl"]
...

section.scrbl
...
@defmodule[(planet williams/main/section)]
...
@section{Section One}
...
@defmodule[(planet williams/main/section/shared)]
...
@section{Section Two}
...
@defmodule[(planet williams/main/section/shared)]
...

Note that the first defmodule is for the entire sub-collection - it requires
and provides all of the modules in the subcollection.  But, the user can
also just require the modules they are using, if they want - for example the
shared module above.

I get a warning the it collected information multiple times on (mod-path
"(planet williams/main/section/shared)") and (index-entry (mod-path "(planet
williams/main/section/shared)")).  Is there an alternative to the second
defmodule that won't give the warning?  [The warning is visible to the user
when they first require the package from PLaneT and it is downloaded and
built.]

I also get a warning that it collected information multiple times on
"(exporting-libraries #f)".  Is that likely from the same problem or a
different one (like a different defmodule problem elsewhere)?  [There are a
lot of defmodules in the documentation and I've notice that I can mistype
planet references and not get an error, so there might be one lingering
somwhere.  Warning don't give any source location information, so it can be
hard to tell where they originate.]

---

Second question: I am including (require (for-label (planet
../science-with-graphics.ss")) in each of the scribble files, but I'm not
sure it it's necessary if I have the defmodules.  I assume it is used to
resolve references for hyperlinking, but do the defprocs, etc provide the
same information?

And, I guess a related question:  in my defmodules I am using the planet
reference, but I used the relative reference in the for-label.  It seems
logical to me to do that since the defmodule renders into something the user
sees - and they know about the planet collection, while the for-label is
internal to the scribble files and not visible to the user.  Does the planet
deference in defmodule refer to the copy in the planet repository (on my
machine) or to the source code being used to build it?  That is, do I have
to have already built a .plt and fileinjected it for the defmodule to work?

---

One last question:  How can I include an appendix (or at least an unnumbered
section-include?  I have the GNU Free Documentation License I need to
include with the documentation, but would rather it wasn't a numbered
section.

---

And, some general comments and kudos.

I was pleasantly surprised that the @math{} functionality was as developed
as it is.  The documentation says that _ and ^ may be added in the future.
Well, apparently I downloaded through a time warp, because they work - at
least for many cases (and I could use @subscript and @superscript in the
others).  I assume it's still a work in progress, but I was able to render
many of the mathematical equations directly.

One nice feature would be something like @equation{...} that takes a TeX
equation and renders it to an image.  That's probably a bit too deep into
the Scribble code for me to attempt, but it would be a great feature if
someone wanted to tackle it.  [Doing that manually is how I did the more
advanced equations - integrals, summations, etc - that @math couldn't
handle.]

I'm very happy with how the science documentation looks in scribble.

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080921/595cdcee/attachment.html
From robby at cs.uchicago.edu  Sun Sep 21 16:14:42 2008
From: robby at cs.uchicago.edu (Robby Findler)
Date: Thu Mar 26 02:28:59 2009
Subject: [plt-scheme] Re: Writing a game and have questions
In-Reply-To: 
References: 
	<20080921135852.E2A9865009C@mail-svr1.cs.utah.edu>
	
	
Message-ID: <932b2f1f0809211314s6a1cb081x7a41e774aa48a99e@mail.gmail.com>

On Sun, Sep 21, 2008 at 10:18 AM, Deep  wrote:
> Thanks for the very detailed, prompt and helpful answers. I decided to
> ditch the offscreen-buffer based approach and instead decided to
> implement a convex polygon + point in poly approach.

Just in case you missed that earlier -- the GUI library in PLT Scheme
has support for that, so you don't need to dig out your old graphics
textbook.

Robby

> Neil - thanks for the suggestions, I found them really helpful.
> Mathew - thanks for the rendering tips, i have a feeling they will be
> useful in the future.
> Doug - It would be great if you could send me an example app.
>
> Thanks,
> Deepankar
>
>
>
> On Sep 21, 11:02 am, "Doug Williams" 
> wrote:
>> I have an animated canvas that I use for animation.  I've never put it up on
>> PLaneT, but use it for many of my own applications.  I can send an example
>> app if you want.
>>
>> Doug
>>
>> On Sun, Sep 21, 2008 at 7:58 AM, Matthew Flatt  wrote:
>> > Neil and Robby have given you good general answers --- compute the
>> > target without referring to the image, or use regions instead of an
>> > offscreen image --- but I'll answer the original questions:
>>
>> > At Sat, 20 Sep 2008 11:23:32 -0400, "deepankar" wrote:
>> > > 1) Is it possible to draw a canvas to an offscreen buffer ?
>>
>> > You can take a function that draws to a canvas and redirect it so that
>> > it draws to an offscreen image (i.e., swap a `bitmap-dc%' in place of a
>> > canvas `dc<%>').
>>
>> > > 2) Is it possible to fetch pixel values from a canvas.
>>
>> > Canvas drawing is one-way only: you can send an image out to the user
>> > to see, but you cannot programmatically "look" at the canvas. Also,
>> > there's no way to take a snapshot of the canvas to get back an
>> > offscreen image.
>>
>> > If you redirect a drawing function to an offscreen image, then you
>> > can, of course, inspect the pixels of the offscreen image.
>>
>> > Matthew
>>
>> > _________________________________________________
>> >  For list-related administrative tasks:
>> >  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>>
>>
>>
>>  animated-canvas.ss
>> 4KViewDownload
>>
>> _________________________________________________
>>   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 tom at zwizwa.be  Mon Sep 22 04:22:04 2008
From: tom at zwizwa.be (Tom Schouten)
Date: Thu Mar 26 02:29:00 2009
Subject: [plt-scheme] scheme_set_primordial_stack_base
Message-ID: <20080922082204.GE9243@zzz.i>

Hello,

Looks like in 4.1 the following function changed name (include/plt/scheme.h)
MZ_EXTERN void scheme_set_primordial_stack_base(void *base, int no_auto_statics);

Did it also change meaning?

Cheers,
Tom


From mflatt at cs.utah.edu  Mon Sep 22 09:27:58 2008
From: mflatt at cs.utah.edu (Matthew Flatt)
Date: Thu Mar 26 02:29:00 2009
Subject: [plt-scheme] Some More Scribble Questions
In-Reply-To: 
References: 
Message-ID: <20080922132759.BAFB16500B2@mail-svr1.cs.utah.edu>

At Sun, 21 Sep 2008 11:58:25 -0600, "Doug Williams" wrote:
> I get a warning the it collected information multiple times on (mod-path
> "(planet williams/main/section/shared)") and (index-entry (mod-path "(planet
> williams/main/section/shared)")).  Is there an alternative to the second
> defmodule that won't give the warning? 

`defmodule*/no-declare'.

> I also get a warning that it collected information multiple times on
> "(exporting-libraries #f)".  Is that likely from the same problem or a
> different one (like a different defmodule problem elsewhere)? 

That's likely a `defproc' (or `defthing', etc.) inside a section that
doesn't have a `defmodule' (either in the immediate section or an
enclosing section).

> Second question: I am including (require (for-label (planet
> ../science-with-graphics.ss")) in each of the scribble files, but I'm not
> sure it it's necessary if I have the defmodules.  I assume it is used to
> resolve references for hyperlinking, but do the defprocs, etc provide the
> same information?

You need both, currently. The `defmodule's determine the hyperlink
bindings created the `defproc's, etc. The `require .... for-label's
determine uses of identifiers to be hyperlinked. The same bit of text
naming a function in a `defproc' both serves as a hyperlink target and
is hyperlinked to itself. (Of course, hyperlinking to itself isn't
really useful, but by "hyperlink" in this case I also mean getting the
right text style, such as blue versus bold black.)

> And, I guess a related question:  in my defmodules I am using the planet
> reference, but I used the relative reference in the for-label.  It seems
> logical to me to do that since the defmodule renders into something the user
> sees - and they know about the planet collection, while the for-label is
> internal to the scribble files and not visible to the user.

Right.

> Does the planet
> deference in defmodule refer to the copy in the planet repository (on my
> machine) or to the source code being used to build it?  That is, do I have
> to have already built a .plt and fileinjected it for the defmodule to work?

Yes, or you need to have a development link. This is definitely a place
to improve in the future.

> One last question:  How can I include an appendix (or at least an unnumbered
> section-include?  I have the GNU Free Documentation License I need to
> include with the documentation, but would rather it wasn't a numbered
> section.

You can use `make-unnumbered-part'. There doesn't seem to be a style on
`section' (or anything like that) to write the start of an unnumbered
section more directly. We should add something, or maybe unnumberedness
should have been a style instead of a different structure type.


Matthew


From m.douglas.williams at gmail.com  Mon Sep 22 09:28:21 2008
From: m.douglas.williams at gmail.com (Doug Williams)
Date: Thu Mar 26 02:29:01 2009
Subject: [plt-scheme] Re: Some More Scribble Questions
In-Reply-To: 
References: 
Message-ID: 

To partially answer my own e-mail:

For the multiple defmodules, I removed all by one of the defmodules for
shared and replaced the last ones with @scheme[(require (planet
williams/main/section/shared))].  This eliminated the warnings and pretty
much looks the same in the documentation.  [The require line isn'toutlined
in a pastel pinkish box, but I don't think anyone will notice.]

There is one warning/message that I get now when I initially download and
install the collection.  It says it is removing the .zo for the GFDL.scrbl
file.  I'm not sure why that one file is different than any of the other
@include-sections.  It has no code references to it since it is just text is
all.

I have released the package update to PLaneT with the new documentation.

Doug

On Sun, Sep 21, 2008 at 11:58 AM, Doug Williams <
m.douglas.williams@gmail.com> wrote:

> I finally have the science collection documentation converted to Scribble,
> but have some warnings I'd like to get rid of.
>
> The problem is that I am using sub-collections and have some interdependent
> sets of functionality (specifically, gamma, psi, and zeta functions) that
> are in a single module, but documented in separate sections.  Let me give a
> simplified example.
>
> main.scrbl
> ...
> @include-section["section.scrbl"]
> ...
>
> section.scrbl
> ...
> @defmodule[(planet williams/main/section)]
> ...
> @section{Section One}
> ...
> @defmodule[(planet williams/main/section/shared)]
> ...
> @section{Section Two}
> ...
> @defmodule[(planet williams/main/section/shared)]
> ...
>
> Note that the first defmodule is for the entire sub-collection - it
> requires and provides all of the modules in the subcollection.  But, the
> user can also just require the modules they are using, if they want - for
> example the shared module above.
>
> I get a warning the it collected information multiple times on (mod-path
> "(planet williams/main/section/shared)") and (index-entry (mod-path "(planet
> williams/main/section/shared)")).  Is there an alternative to the second
> defmodule that won't give the warning?  [The warning is visible to the user
> when they first require the package from PLaneT and it is downloaded and
> built.]
>
> I also get a warning that it collected information multiple times on
> "(exporting-libraries #f)".  Is that likely from the same problem or a
> different one (like a different defmodule problem elsewhere)?  [There are a
> lot of defmodules in the documentation and I've notice that I can mistype
> planet references and not get an error, so there might be one lingering
> somwhere.  Warning don't give any source location information, so it can be
> hard to tell where they originate.]
>
> ---
>
> Second question: I am including (require (for-label (planet
> ../science-with-graphics.ss")) in each of the scribble files, but I'm not
> sure it it's necessary if I have the defmodules.  I assume it is used to
> resolve references for hyperlinking, but do the defprocs, etc provide the
> same information?
>
> And, I guess a related question:  in my defmodules I am using the planet
> reference, but I used the relative reference in the for-label.  It seems
> logical to me to do that since the defmodule renders into something the user
> sees - and they know about the planet collection, while the for-label is
> internal to the scribble files and not visible to the user.  Does the planet
> deference in defmodule refer to the copy in the planet repository (on my
> machine) or to the source code being used to build it?  That is, do I have
> to have already built a .plt and fileinjected it for the defmodule to work?
>
> ---
>
> One last question:  How can I include an appendix (or at least an
> unnumbered section-include?  I have the GNU Free Documentation License I
> need to include with the documentation, but would rather it wasn't a
> numbered section.
>
> ---
>
> And, some general comments and kudos.
>
> I was pleasantly surprised that the @math{} functionality was as developed
> as it is.  The documentation says that _ and ^ may be added in the future.
> Well, apparently I downloaded through a time warp, because they work - at
> least for many cases (and I could use @subscript and @superscript in the
> others).  I assume it's still a work in progress, but I was able to render
> many of the mathematical equations directly.
>
> One nice feature would be something like @equation{...} that takes a TeX
> equation and renders it to an image.  That's probably a bit too deep into
> the Scribble code for me to attempt, but it would be a great feature if
> someone wanted to tackle it.  [Doing that manually is how I did the more
> advanced equations - integrals, summations, etc - that @math couldn't
> handle.]
>
> I'm very happy with how the science documentation looks in scribble.
>
> Thanks
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080922/50de610d/attachment.htm
From m.douglas.williams at gmail.com  Mon Sep 22 09:58:17 2008
From: m.douglas.williams at gmail.com (Doug Williams)
Date: Thu Mar 26 02:29:01 2009
Subject: [plt-scheme] Some More Scribble Questions
In-Reply-To: <20080922132759.BAFB16500B2@mail-svr1.cs.utah.edu>
References: 
	<20080922132759.BAFB16500B2@mail-svr1.cs.utah.edu>
Message-ID: 

Thanks, Matthew.  It's in good enough shape now to release - which I have.
I'll move on to the simulation and inference collection documentation now.
I don't think they'll be as hard as the science collection was.

At some point in time - hopefully within a month or so - I'll revisit the
science collection documentation and code.  One thing I have noticed from
reading the PLT Scheme Reference Manual is the inclusion of exact integer
booleans- things like exact-non-negative integer?.  I assume these are the
right things to use in the contracts for any arguments that eventually are
used as vector indices, etc.  I also assume that contract error messages for
exact-nonnegative-integer? would give a more informative message than for
(and/c exact? natural-number/c?), etc.

It also seems that there is now a mismatch between how we specify arguments
and contracts in Scribble, which is very nice, and in the contracts in the
code.  The defproc format seems to be more intuitive.  I haven't revisited
the contracts section of the documentations yet - and probably should.

Anyway, thanks for answering all the questions I've had.

Doug

On Mon, Sep 22, 2008 at 7:27 AM, Matthew Flatt  wrote:

> At Sun, 21 Sep 2008 11:58:25 -0600, "Doug Williams" wrote:
> > I get a warning the it collected information multiple times on (mod-path
> > "(planet williams/main/section/shared)") and (index-entry (mod-path
> "(planet
> > williams/main/section/shared)")).  Is there an alternative to the second
> > defmodule that won't give the warning?
>
> `defmodule*/no-declare'.
>
> > I also get a warning that it collected information multiple times on
> > "(exporting-libraries #f)".  Is that likely from the same problem or a
> > different one (like a different defmodule problem elsewhere)?
>
> That's likely a `defproc' (or `defthing', etc.) inside a section that
> doesn't have a `defmodule' (either in the immediate section or an
> enclosing section).
>
> > Second question: I am including (require (for-label (planet
> > ../science-with-graphics.ss")) in each of the scribble files, but I'm not
> > sure it it's necessary if I have the defmodules.  I assume it is used to
> > resolve references for hyperlinking, but do the defprocs, etc provide the
> > same information?
>
> You need both, currently. The `defmodule's determine the hyperlink
> bindings created the `defproc's, etc. The `require .... for-label's
> determine uses of identifiers to be hyperlinked. The same bit of text
> naming a function in a `defproc' both serves as a hyperlink target and
> is hyperlinked to itself. (Of course, hyperlinking to itself isn't
> really useful, but by "hyperlink" in this case I also mean getting the
> right text style, such as blue versus bold black.)
>
> > And, I guess a related question:  in my defmodules I am using the planet
> > reference, but I used the relative reference in the for-label.  It seems
> > logical to me to do that since the defmodule renders into something the
> user
> > sees - and they know about the planet collection, while the for-label is
> > internal to the scribble files and not visible to the user.
>
> Right.
>
> > Does the planet
> > deference in defmodule refer to the copy in the planet repository (on my
> > machine) or to the source code being used to build it?  That is, do I
> have
> > to have already built a .plt and fileinjected it for the defmodule to
> work?
>
> Yes, or you need to have a development link. This is definitely a place
> to improve in the future.
>
> > One last question:  How can I include an appendix (or at least an
> unnumbered
> > section-include?  I have the GNU Free Documentation License I need to
> > include with the documentation, but would rather it wasn't a numbered
> > section.
>
> You can use `make-unnumbered-part'. There doesn't seem to be a style on
> `section' (or anything like that) to write the start of an unnumbered
> section more directly. We should add something, or maybe unnumberedness
> should have been a style instead of a different structure type.
>
>
> Matthew
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080922/c4dd6231/attachment.html
From m.douglas.williams at gmail.com  Mon Sep 22 10:13:26 2008
From: m.douglas.williams at gmail.com (Doug Williams)
Date: Thu Mar 26 02:29:02 2009
Subject: [plt-scheme] Some More Scribble Questions
In-Reply-To: 
References: 
	<20080922132759.BAFB16500B2@mail-svr1.cs.utah.edu>
	
Message-ID: 

I just went and read natural-number/c and it is for an exact non-negative
integer.  Is there any appreciable difference between using
exact-nonnegative-integer? and natural/number/c.  [If so, I think we should
have a positive-number/c to match exact-positive-integer?]  Or, should I
move to the exact integer booleans in contracts now?

That may be a Robby question instead of a Matthew one.

On Mon, Sep 22, 2008 at 7:58 AM, Doug Williams  wrote:

> Thanks, Matthew.  It's in good enough shape now to release - which I have.
> I'll move on to the simulation and inference collection documentation now.
> I don't think they'll be as hard as the science collection was.
>
> At some point in time - hopefully within a month or so - I'll revisit the
> science collection documentation and code.  One thing I have noticed from
> reading the PLT Scheme Reference Manual is the inclusion of exact integer
> booleans- things like exact-non-negative integer?.  I assume these are the
> right things to use in the contracts for any arguments that eventually are
> used as vector indices, etc.  I also assume that contract error messages for
> exact-nonnegative-integer? would give a more informative message than for
> (and/c exact? natural-number/c?), etc.
>
> It also seems that there is now a mismatch between how we specify arguments
> and contracts in Scribble, which is very nice, and in the contracts in the
> code.  The defproc format seems to be more intuitive.  I haven't revisited
> the contracts section of the documentations yet - and probably should.
>
> Anyway, thanks for answering all the questions I've had.
>
> Doug
>
>
> On Mon, Sep 22, 2008 at 7:27 AM, Matthew Flatt  wrote:
>
>> At Sun, 21 Sep 2008 11:58:25 -0600, "Doug Williams" wrote:
>> > I get a warning the it collected information multiple times on (mod-path
>> > "(planet williams/main/section/shared)") and (index-entry (mod-path
>> "(planet
>> > williams/main/section/shared)")).  Is there an alternative to the second
>> > defmodule that won't give the warning?
>>
>> `defmodule*/no-declare'.
>>
>> > I also get a warning that it collected information multiple times on
>> > "(exporting-libraries #f)".  Is that likely from the same problem or a
>> > different one (like a different defmodule problem elsewhere)?
>>
>> That's likely a `defproc' (or `defthing', etc.) inside a section that
>> doesn't have a `defmodule' (either in the immediate section or an
>> enclosing section).
>>
>> > Second question: I am including (require (for-label (planet
>> > ../science-with-graphics.ss")) in each of the scribble files, but I'm
>> not
>> > sure it it's necessary if I have the defmodules.  I assume it is used to
>> > resolve references for hyperlinking, but do the defprocs, etc provide
>> the
>> > same information?
>>
>> You need both, currently. The `defmodule's determine the hyperlink
>> bindings created the `defproc's, etc. The `require .... for-label's
>> determine uses of identifiers to be hyperlinked. The same bit of text
>> naming a function in a `defproc' both serves as a hyperlink target and
>> is hyperlinked to itself. (Of course, hyperlinking to itself isn't
>> really useful, but by "hyperlink" in this case I also mean getting the
>> right text style, such as blue versus bold black.)
>>
>> > And, I guess a related question:  in my defmodules I am using the planet
>> > reference, but I used the relative reference in the for-label.  It seems
>> > logical to me to do that since the defmodule renders into something the
>> user
>> > sees - and they know about the planet collection, while the for-label is
>> > internal to the scribble files and not visible to the user.
>>
>> Right.
>>
>> > Does the planet
>> > deference in defmodule refer to the copy in the planet repository (on my
>> > machine) or to the source code being used to build it?  That is, do I
>> have
>> > to have already built a .plt and fileinjected it for the defmodule to
>> work?
>>
>> Yes, or you need to have a development link. This is definitely a place
>> to improve in the future.
>>
>> > One last question:  How can I include an appendix (or at least an
>> unnumbered
>> > section-include?  I have the GNU Free Documentation License I need to
>> > include with the documentation, but would rather it wasn't a numbered
>> > section.
>>
>> You can use `make-unnumbered-part'. There doesn't seem to be a style on
>> `section' (or anything like that) to write the start of an unnumbered
>> section more directly. We should add something, or maybe unnumberedness
>> should have been a style instead of a different structure type.
>>
>>
>> Matthew
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080922/4e01fb48/attachment.htm
From robby at cs.uchicago.edu  Mon Sep 22 10:16:36 2008
From: robby at cs.uchicago.edu (Robby Findler)
Date: Thu Mar 26 02:29:02 2009
Subject: [plt-scheme] Some More Scribble Questions
In-Reply-To: 
References: 
	<20080922132759.BAFB16500B2@mail-svr1.cs.utah.edu>
	
	
Message-ID: <932b2f1f0809220716w43b65487kf4750492305b4a8a@mail.gmail.com>

I think that I added natural-number/c a very long time ago and Matthew
added exact-nonnegative-integer? at some point when he was adding
contracts to various primitives and probably just neither of us
noticed that they are the same thing. Probably the thing to do is to
get rid of one of them.

Robby

On Mon, Sep 22, 2008 at 9:13 AM, Doug Williams
 wrote:
> I just went and read natural-number/c and it is for an exact non-negative
> integer.  Is there any appreciable difference between using
> exact-nonnegative-integer? and natural/number/c.  [If so, I think we should
> have a positive-number/c to match exact-positive-integer?]  Or, should I
> move to the exact integer booleans in contracts now?
>
> That may be a Robby question instead of a Matthew one.
>
> On Mon, Sep 22, 2008 at 7:58 AM, Doug Williams
>  wrote:
>>
>> Thanks, Matthew.  It's in good enough shape now to release - which I
>> have.  I'll move on to the simulation and inference collection documentation
>> now.  I don't think they'll be as hard as the science collection was.
>>
>> At some point in time - hopefully within a month or so - I'll revisit the
>> science collection documentation and code.  One thing I have noticed from
>> reading the PLT Scheme Reference Manual is the inclusion of exact integer
>> booleans- things like exact-non-negative integer?.  I assume these are the
>> right things to use in the contracts for any arguments that eventually are
>> used as vector indices, etc.  I also assume that contract error messages for
>> exact-nonnegative-integer? would give a more informative message than for
>> (and/c exact? natural-number/c?), etc.
>>
>> It also seems that there is now a mismatch between how we specify
>> arguments and contracts in Scribble, which is very nice, and in the
>> contracts in the code.  The defproc format seems to be more intuitive.  I
>> haven't revisited the contracts section of the documentations yet - and
>> probably should.
>>
>> Anyway, thanks for answering all the questions I've had.
>>
>> Doug
>>
>> On Mon, Sep 22, 2008 at 7:27 AM, Matthew Flatt  wrote:
>>>
>>> At Sun, 21 Sep 2008 11:58:25 -0600, "Doug Williams" wrote:
>>> > I get a warning the it collected information multiple times on
>>> > (mod-path
>>> > "(planet williams/main/section/shared)") and (index-entry (mod-path
>>> > "(planet
>>> > williams/main/section/shared)")).  Is there an alternative to the
>>> > second
>>> > defmodule that won't give the warning?
>>>
>>> `defmodule*/no-declare'.
>>>
>>> > I also get a warning that it collected information multiple times on
>>> > "(exporting-libraries #f)".  Is that likely from the same problem or a
>>> > different one (like a different defmodule problem elsewhere)?
>>>
>>> That's likely a `defproc' (or `defthing', etc.) inside a section that
>>> doesn't have a `defmodule' (either in the immediate section or an
>>> enclosing section).
>>>
>>> > Second question: I am including (require (for-label (planet
>>> > ../science-with-graphics.ss")) in each of the scribble files, but I'm
>>> > not
>>> > sure it it's necessary if I have the defmodules.  I assume it is used
>>> > to
>>> > resolve references for hyperlinking, but do the defprocs, etc provide
>>> > the
>>> > same information?
>>>
>>> You need both, currently. The `defmodule's determine the hyperlink
>>> bindings created the `defproc's, etc. The `require .... for-label's
>>> determine uses of identifiers to be hyperlinked. The same bit of text
>>> naming a function in a `defproc' both serves as a hyperlink target and
>>> is hyperlinked to itself. (Of course, hyperlinking to itself isn't
>>> really useful, but by "hyperlink" in this case I also mean getting the
>>> right text style, such as blue versus bold black.)
>>>
>>> > And, I guess a related question:  in my defmodules I am using the
>>> > planet
>>> > reference, but I used the relative reference in the for-label.  It
>>> > seems
>>> > logical to me to do that since the defmodule renders into something the
>>> > user
>>> > sees - and they know about the planet collection, while the for-label
>>> > is
>>> > internal to the scribble files and not visible to the user.
>>>
>>> Right.
>>>
>>> > Does the planet
>>> > deference in defmodule refer to the copy in the planet repository (on
>>> > my
>>> > machine) or to the source code being used to build it?  That is, do I
>>> > have
>>> > to have already built a .plt and fileinjected it for the defmodule to
>>> > work?
>>>
>>> Yes, or you need to have a development link. This is definitely a place
>>> to improve in the future.
>>>
>>> > One last question:  How can I include an appendix (or at least an
>>> > unnumbered
>>> > section-include?  I have the GNU Free Documentation License I need to
>>> > include with the documentation, but would rather it wasn't a numbered
>>> > section.
>>>
>>> You can use `make-unnumbered-part'. There doesn't seem to be a style on
>>> `section' (or anything like that) to write the start of an unnumbered
>>> section more directly. We should add something, or maybe unnumberedness
>>> should have been a style instead of a different structure type.
>>>
>>>
>>> Matthew
>>>
>>
>
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
>

From mflatt at cs.utah.edu  Mon Sep 22 10:51:02 2008
From: mflatt at cs.utah.edu (Matthew Flatt)
Date: Thu Mar 26 02:29:02 2009
Subject: [plt-scheme] scheme_set_primordial_stack_base
In-Reply-To: <20080922082204.GE9243@zzz.i>
References: <20080922082204.GE9243@zzz.i>
Message-ID: <20080922145104.31D9465008C@mail-svr1.cs.utah.edu>

At Mon, 22 Sep 2008 10:22:04 +0200, Tom Schouten wrote:
> Hello,
> 
> Looks like in 4.1 the following function changed name (include/plt/scheme.h)
> MZ_EXTERN void scheme_set_primordial_stack_base(void *base, int 
> no_auto_statics);
> 
> Did it also change meaning?

No --- but I think we should change the name back. We didn't mean to
change the external API.

In any case, you might consider switching to scheme_main_stack_setup(),
which was new in v4. It helps avoid some pitfalls in setting up the
stack base, especially with 3m.


Matthew


From dyoo at cs.wpi.edu  Mon Sep 22 11:21:35 2008
From: dyoo at cs.wpi.edu (Danny Yoo)
Date: Thu Mar 26 02:29:03 2009
Subject: [plt-scheme] How to do flickerless update for MrEd widget changes?
Message-ID: 

Hi everyone,

I'm writing a program that occasionally removes all of the children
from a frame and repopulates its contents with new widgets.  At the
moment, the screen flickers quite a bit and the user is exposed to the
intermediate state of the frame.  I'd like to have something like
begin-edit-sequence that works on arbitrary area containers.  Is there
such a beast?  Any help would be appreciated.

From mflatt at cs.utah.edu  Mon Sep 22 11:27:52 2008
From: mflatt at cs.utah.edu (Matthew Flatt)
Date: Thu Mar 26 02:29:03 2009
Subject: [plt-scheme] How to do flickerless update for MrEd widget changes?
In-Reply-To: 
References: 
Message-ID: <20080922152755.1BBD465008D@mail-svr1.cs.utah.edu>

At Mon, 22 Sep 2008 11:21:35 -0400, "Danny Yoo" wrote:
> I'm writing a program that occasionally removes all of the children
> from a frame and repopulates its contents with new widgets.  At the
> moment, the screen flickers quite a bit and the user is exposed to the
> intermediate state of the frame.  I'd like to have something like
> begin-edit-sequence that works on arbitrary area containers.  Is there
> such a beast?

`begin-container-sequence'


Matthew


From robby at cs.uchicago.edu  Mon Sep 22 18:57:38 2008
From: robby at cs.uchicago.edu (Robby Findler)
Date: Thu Mar 26 02:29:03 2009
Subject: [plt-scheme] trac spam (and other things)
Message-ID: <932b2f1f0809221557h5601e11fqa742fd87d73a764f@mail.gmail.com>

spam:

I've added a mandatory field with no default to the trac bug report
submissions (that is filled in by drscheme when you submit that way),
so hopefully that'll cut down on the bug report spam we've been
getting.


email notifications:

I also enabled trac email notifications, but didn't add everyone's
password in to their trac accounts. I wanted to, but couldn't quite
figure out how to do iit and then it occurred to me that people might
just be happy not to get notifications. I'm not sure it is a good
idea, but for now you'll have to enter your email address into trac
yourself if you want to get emails about your tickets.


planet.plt-scheme.org page speedup:

the front page was computing the top bug closers on each page load
which seems to be quite expensive once you get about ... 20 tickets.
Sigh. I didn't see a way to speed that up, so the top bug closers list
is only recomputed hourly now.

Robby

From grettke at acm.org  Tue Sep 23 08:40:23 2008
From: grettke at acm.org (Grant Rettke)
Date: Thu Mar 26 02:29:03 2009
Subject: [plt-scheme] HtDP: Use of require?
Message-ID: <756daca50809230540o5c48df34w86e1f278e84cc6f4@mail.gmail.com>

Hi,

How soon should students be using require in htDP?

Best wishes,

Grant

From grettke at acm.org  Tue Sep 23 08:43:11 2008
From: grettke at acm.org (Grant Rettke)
Date: Thu Mar 26 02:29:03 2009
Subject: [plt-scheme] HtDP: Should students read the language definitions?
Message-ID: <756daca50809230543o6713fedds61d5e3e936dfc963@mail.gmail.com>

Hi,

Should students read the language definitions?

I haven't because I figured the book would cover it, but someone
pointed out to me that the book is 5 years old so I should take that
into consideration.

Best wishes,

Grant

From matthias at ccs.neu.edu  Tue Sep 23 09:36:02 2008
From: matthias at ccs.neu.edu (Matthias Felleisen)
Date: Thu Mar 26 02:29:04 2009
Subject: [plt-scheme] HtDP: Use of require?
In-Reply-To: <756daca50809230540o5c48df34w86e1f278e84cc6f4@mail.gmail.com>
References: <756daca50809230540o5c48df34w86e1f278e84cc6f4@mail.gmail.com>
Message-ID: <2FB6A41E-51DC-469C-A714-D0591F67193D@ccs.neu.edu>


Never. Use teachpacks from Language.

On Sep 23, 2008, at 8:40 AM, Grant Rettke wrote:

> Hi,
>
> How soon should students be using require in htDP?
>
> Best wishes,
>
> Grant
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme


From matthias at ccs.neu.edu  Tue Sep 23 09:36:24 2008
From: matthias at ccs.neu.edu (Matthias Felleisen)
Date: Thu Mar 26 02:29:04 2009
Subject: [plt-scheme] HtDP: Should students read the language definitions?
In-Reply-To: <756daca50809230543o6713fedds61d5e3e936dfc963@mail.gmail.com>
References: <756daca50809230543o6713fedds61d5e3e936dfc963@mail.gmail.com>
Message-ID: <8C4B7491-4ECC-4F4E-8437-071C51237B6A@ccs.neu.edu>


The intermezzos are the language definitions, in principle.


On Sep 23, 2008, at 8:43 AM, Grant Rettke wrote:

> Hi,
>
> Should students read the language definitions?
>
> I haven't because I figured the book would cover it, but someone
> pointed out to me that the book is 5 years old so I should take that
> into consideration.
>
> Best wishes,
>
> Grant
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme


From grettke at acm.org  Tue Sep 23 13:45:07 2008
From: grettke at acm.org (Grant Rettke)
Date: Thu Mar 26 02:29:04 2009
Subject: [plt-scheme] HtDP: Use of require?
In-Reply-To: <2FB6A41E-51DC-469C-A714-D0591F67193D@ccs.neu.edu>
References: <756daca50809230540o5c48df34w86e1f278e84cc6f4@mail.gmail.com>
	<2FB6A41E-51DC-469C-A714-D0591F67193D@ccs.neu.edu>
Message-ID: <756daca50809231045g463133cv9255ec25670c5f80@mail.gmail.com>

On Tue, Sep 23, 2008 at 8:36 AM, Matthias Felleisen
 wrote:
> Never. Use teachpacks from Language.

Sorry I didn't phrase that precisely.

The beginning student language provides 'require', how soon should
they start using it?

There is a lot of reuse in the book, but I had glossed over require
since the book never mentioned it.

From grettke at acm.org  Tue Sep 23 13:45:38 2008
From: grettke at acm.org (Grant Rettke)
Date: Thu Mar 26 02:29:04 2009
Subject: [plt-scheme] HtDP: Should students read the language definitions?
In-Reply-To: <8C4B7491-4ECC-4F4E-8437-071C51237B6A@ccs.neu.edu>
References: <756daca50809230543o6713fedds61d5e3e936dfc963@mail.gmail.com>
	<8C4B7491-4ECC-4F4E-8437-071C51237B6A@ccs.neu.edu>
Message-ID: <756daca50809231045p49c9031fq3b2016337612a01a@mail.gmail.com>

On Tue, Sep 23, 2008 at 8:36 AM, Matthias Felleisen
 wrote:
>
> The intermezzos are the language definitions, in principle.

I'm afraid I'm going to miss stuff in the language that has been added
since the book was printed.

From matthias at ccs.neu.edu  Tue Sep 23 15:00:25 2008
From: matthias at ccs.neu.edu (Matthias Felleisen)
Date: Thu Mar 26 02:29:04 2009
Subject: [plt-scheme] HtDP: Should students read the language definitions?
In-Reply-To: <756daca50809231045p49c9031fq3b2016337612a01a@mail.gmail.com>
References: <756daca50809230543o6713fedds61d5e3e936dfc963@mail.gmail.com>
	<8C4B7491-4ECC-4F4E-8437-071C51237B6A@ccs.neu.edu>
	<756daca50809231045p49c9031fq3b2016337612a01a@mail.gmail.com>
Message-ID: <059F4DCD-E8D0-4D1A-BCAD-8440A41714D3@ccs.neu.edu>


The languages didn't change, except for accidental omissions being  
restored. Teachpacks changed, way too much -- Matthias


On Sep 23, 2008, at 1:45 PM, Grant Rettke wrote:

> On Tue, Sep 23, 2008 at 8:36 AM, Matthias Felleisen
>  wrote:
>>
>> The intermezzos are the language definitions, in principle.
>
> I'm afraid I'm going to miss stuff in the language that has been added
> since the book was printed.


From matthias at ccs.neu.edu  Tue Sep 23 15:01:12 2008
From: matthias at ccs.neu.edu (Matthias Felleisen)
Date: Thu Mar 26 02:29:05 2009
Subject: [plt-scheme] HtDP: Use of require?
In-Reply-To: <756daca50809231045g463133cv9255ec25670c5f80@mail.gmail.com>
References: <756daca50809230540o5c48df34w86e1f278e84cc6f4@mail.gmail.com>
	<2FB6A41E-51DC-469C-A714-D0591F67193D@ccs.neu.edu>
	<756daca50809231045g463133cv9255ec25670c5f80@mail.gmail.com>
Message-ID: <860AA54B-6CE3-48F2-AA00-7D38B591978B@ccs.neu.edu>


Really: Never. Use teachpacks from Language. There is no provide (yet).

On Sep 23, 2008, at 1:45 PM, Grant Rettke wrote:

> On Tue, Sep 23, 2008 at 8:36 AM, Matthias Felleisen
>  wrote:
>> Never. Use teachpacks from Language.
>
> Sorry I didn't phrase that precisely.
>
> The beginning student language provides 'require', how soon should
> they start using it?
>
> There is a lot of reuse in the book, but I had glossed over require
> since the book never mentioned it.


From geb_a at yahoo.com  Tue Sep 23 17:30:51 2008
From: geb_a at yahoo.com (geb a)
Date: Thu Mar 26 02:29:05 2009
Subject: [plt-scheme] formlets...
Message-ID: <991417.50405.qm@web50906.mail.re2.yahoo.com>

I was very excited to see the new concept of formlets so I downloaded version  4.1.0.4-svn23sep2008 from svn and tried the example from the documentation.

The example gives the following error:

(formlet (div "Name:" (unquote (=> input-string name)) (div "Arrive:" (unquote (=> date-formlet arrive)) "Depart:" (unquote (=> date-formlet depart))) (list name arrive depart)))


The code is below:
(require web-server/formlets/formlets)
(define-struct date (month day))

(define date-formlet
  (formlet
   (div
    "Month:" ,{input-int . => . month}
    "Day:" ,{input-int . => . day})
   (make-date month day)))

(define travel-formlet
  (formlet
   (div
    "Name:" ,{input-string . => . name}
    (div
     "Arrive:" ,{date-formlet . => . arrive}
     "Depart:" ,{date-formlet . => . depart})
    (list name arrive depart))))


      

From jay.mccarthy at gmail.com  Tue Sep 23 17:45:46 2008
From: jay.mccarthy at gmail.com (Jay McCarthy)
Date: Thu Mar 26 02:29:05 2009
Subject: [plt-scheme] formlets...
In-Reply-To: <991417.50405.qm@web50906.mail.re2.yahoo.com>
References: <991417.50405.qm@web50906.mail.re2.yahoo.com>
Message-ID: 

On Tue, Sep 23, 2008 at 3:30 PM, geb a  wrote:
> The code is below:
> (require web-server/formlets/formlets)

This should be: web-server/formlets

> (define-struct date (month day))
>
> (define date-formlet
>  (formlet
>   (div
>    "Month:" ,{input-int . => . month}
>    "Day:" ,{input-int . => . day})
>   (make-date month day)))
>
> (define travel-formlet
>  (formlet
>   (div
>    "Name:" ,{input-string . => . name}
>    (div
>     "Arrive:" ,{date-formlet . => . arrive}
>     "Depart:" ,{date-formlet . => . depart})

You are missing a ) right here

>    (list name arrive depart))))

(define travel-formlet
  (formlet
   (div
    "Name:" ,{input-string . => . name}
    (div
     "Arrive:" ,{date-formlet . => . arrive}
     "Depart:" ,{date-formlet . => . depart}))
   (list name arrive depart)))

Let me know if you have more problems.

Jay

-- 
Jay McCarthy 
Assistant Professor / Brigham Young University
http://jay.teammccarthy.org

"The glory of God is Intelligence" - D&C 93

From cce at ccs.neu.edu  Tue Sep 23 20:36:57 2008
From: cce at ccs.neu.edu (Carl Eastlund)
Date: Thu Mar 26 02:29:05 2009
Subject: [plt-scheme] FastTest random testing library
Message-ID: <990e0c030809231736m65ce991aq728c7d9f4f528f4c@mail.gmail.com>

I've just updated FastTest to Planet version (3 2).  FastTest is an
automated, randomized test case generation library inspired by
QuickCheck [1].  This is the first version with Scribble documentation
and follows a fairly major redesign, so check it out if you've been
using one of the older versions.  The new design no longer has a
"generator" type, and instead produces random values directly, which
makes custom random distributions a little more natural to write - for
instance, you can write:

(list 'posn (random-integer) (random-integer)),

whereas before you might write:

(generate (random-apply list (nonrandom 'posn) (random-int-between
-1000 1000) (random-int-between -1000 1000))).

The SchemeUnit integration now makes use of keywords for its optional
arguments, which may make code more readable:

(test-random #:name "Example"
 ([x (random-integer) #:where (odd? x)]
  [y (random-integer) #:where (odd? y)])
 (check-pred even? (+ x y)))

Check out FastTest at:
http://planet.plt-scheme.org/display.ss?package=fasttest.plt&owner=cce

-- 
Carl Eastlund

[1] Claessen, K. and J. Hughes. QuickCheck: a lightweight tool for
random testing of Haskell programs. In ACM SIGPLAN International
Conference on Functional Programming, pages 268?279, 2000.
http://www.math.chalmers.se/~rjmh/QuickCheck/

From deepankar.sharma at gmail.com  Wed Sep 24 00:25:26 2008
From: deepankar.sharma at gmail.com (Deep)
Date: Thu Mar 26 02:29:05 2009
Subject: [plt-scheme] String equality and other questions
Message-ID: <1cbfac59-80b8-428c-b9d3-be7618d91fa3@c65g2000hsa.googlegroups.com>

While writing a game in scheme I recently ran into an issue where
using equal? to compare strings would wait on the equality test and
hog the cpu 60-70% of the time.  Oddly enough it worked sometimes. I
looked through my code suspecting a recursive call gone amuck but
eventually narrowed the issue down to this call.  I had unfortunately
run into http://www.federated.com/~jim/schintro-v14/schintro_102.html
when searching for "scheme string equality" and used equal?.

Once I looked again and changed the code to use string=? things work
just fine. I wanted to know what does equal? do when used against
strings. Why does it work sometimes and why does it just hang on other
occasions?

Btw this is on Max OSX using the latest version of DrScheme.

From eli at barzilay.org  Wed Sep 24 00:43:48 2008
From: eli at barzilay.org (Eli Barzilay)
Date: Thu Mar 26 02:29:05 2009
Subject: [plt-scheme] String equality and other questions
In-Reply-To: <1cbfac59-80b8-428c-b9d3-be7618d91fa3@c65g2000hsa.googlegroups.com>
References: <1cbfac59-80b8-428c-b9d3-be7618d91fa3@c65g2000hsa.googlegroups.com>
Message-ID: <18649.50564.828054.471127@arabic.ccs.neu.edu>

On Sep 23, Deep wrote:
> While writing a game in scheme I recently ran into an issue where
> using equal? to compare strings would wait on the equality test and
> hog the cpu 60-70% of the time.  Oddly enough it worked sometimes. I
> looked through my code suspecting a recursive call gone amuck but
> eventually narrowed the issue down to this call.  I had
> unfortunately run into
> http://www.federated.com/~jim/schintro-v14/schintro_102.html when
> searching for "scheme string equality" and used equal?.
> 
> Once I looked again and changed the code to use string=? things work
> just fine. I wanted to know what does equal? do when used against
> strings. Why does it work sometimes and why does it just hang on
> other occasions?
> 
> Btw this is on Max OSX using the latest version of DrScheme.

They should have roughly the same runtime, maybe you're running into a
bug?

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

From wand at ccs.neu.edu  Wed Sep 24 01:16:44 2008
From: wand at ccs.neu.edu (Mitchell Wand)
Date: Thu Mar 26 02:29:06 2009
Subject: [plt-scheme] [Scheme Steering Committee announcements] Scheme
	Language Steering Committee election: preliminary announcement
Message-ID: <1bd18ad50809232216n236ebfadoad8930b9a4060ae5@mail.gmail.com>

Skipped content of type multipart/alternative-------------- next part --------------
_______________________________________________
Scheme-announcements mailing list
Scheme-announcements@lists.ccs.neu.edu
https://lists.ccs.neu.edu/bin/listinfo/scheme-announcements
From wand at ccs.neu.edu  Wed Sep 24 01:16:44 2008
From: wand at ccs.neu.edu (Mitchell Wand)
Date: Thu Mar 26 02:29:07 2009
Subject: [plt-scheme] [Scheme Steering Committee announcements] Scheme
	Language Steering Committee election: preliminary announcement
Message-ID: <1bd18ad50809232216n236ebfadoad8930b9a4060ae5@mail.gmail.com>

Skipped content of type multipart/alternative-------------- next part --------------
_______________________________________________
Scheme-announcements mailing list
Scheme-announcements@lists.ccs.neu.edu
https://lists.ccs.neu.edu/bin/listinfo/scheme-announcements
From noelwelsh at gmail.com  Wed Sep 24 04:39:10 2008
From: noelwelsh at gmail.com (Noel Welsh)
Date: Thu Mar 26 02:29:07 2009
Subject: [plt-scheme] FastTest random testing library
In-Reply-To: <990e0c030809231736m65ce991aq728c7d9f4f528f4c@mail.gmail.com>
References: <990e0c030809231736m65ce991aq728c7d9f4f528f4c@mail.gmail.com>
Message-ID: 

Sweet!  Any reason to choose SchemeUnit 2 over 3?

N.

On Wed, Sep 24, 2008 at 1:36 AM, Carl Eastlund  wrote:
> I've just updated FastTest to Planet version (3 2). ...
>
> The SchemeUnit integration now makes use of keywords for its optional
> arguments, which may make code more readable:

From DekuDekuplex at Yahoo.com  Wed Sep 24 06:21:28 2008
From: DekuDekuplex at Yahoo.com (Benjamin L.Russell)
Date: Thu Mar 26 02:29:07 2009
Subject: [plt-scheme] How to update MzScheme from v352 to v4.1?
Message-ID: 

With MzScheme v352 and DrScheme, version 4.1, english, installed on
Windows XP Professional, Service Pack 2, I would like to upgrade
MzScheme to v4.1 so that I can use it at the command line and in
Emacs.

However, according to "Download MzScheme v4.1" (see
http://download.plt-scheme.org/mzscheme/mz-4-1-bin-i386-win32-exe.html),
>Note: If you have a previously installed version of MzScheme,
uninstall it before using this installer. 

Unfortunately, it is not quite clear how to do this.  MzScheme is not
listed in the Add/Remove Programs control panel applet, and there is
no Uninstall.exe or similar file in the MzScheme folder.  Also, the
included documents do not describe specifically how to uninstall it.

What should I do to upgrade from MzScheme v352 to v4.1?

Also, in trying to figure out how to uninstall MzScheme v352, I opened
the "Setup PLT.exe" file in the MzScheme directory.  Does this mean
that I now need to uninstall and reinstall DrScheme, version 4.1,
english?  I tried it out, and it seems to continue to work fine.

Thanks in advance for any assistance.

-- Benjamin L. Russell


From DekuDekuplex at Yahoo.com  Wed Sep 24 06:49:48 2008
From: DekuDekuplex at Yahoo.com (Benjamin L.Russell)
Date: Thu Mar 26 02:29:07 2009
Subject: [plt-scheme] (fwd) ICFP programming contest results
Message-ID: 

The ICFP programming contest results are out!

On Wed, 24 Sep 2008 06:06:05 +0100, in gmane.comp.lang.haskell.general
Malcolm Wallace  wrote:

>The ICFP programming contest results presentation:
>http://video.google.com/videoplay?docid=-4697764813432201693
>
>Feel free to pass on this link to any other appropriate forum.

-- Benjamin L. Russell


From mflatt at cs.utah.edu  Wed Sep 24 09:02:49 2008
From: mflatt at cs.utah.edu (Matthew Flatt)
Date: Thu Mar 26 02:29:07 2009
Subject: [plt-scheme] String equality and other questions
In-Reply-To: <1cbfac59-80b8-428c-b9d3-be7618d91fa3@c65g2000hsa.googlegroups.com>
References: <1cbfac59-80b8-428c-b9d3-be7618d91fa3@c65g2000hsa.googlegroups.com>
Message-ID: <20080924130251.284146500AA@mail-svr1.cs.utah.edu>

At Tue, 23 Sep 2008 21:25:26 -0700 (PDT), Deep wrote:
> While writing a game in scheme I recently ran into an issue where
> using equal? to compare strings would wait on the equality test and
> hog the cpu 60-70% of the time.  Oddly enough it worked sometimes. I
> looked through my code suspecting a recursive call gone amuck but
> eventually narrowed the issue down to this call.  I had unfortunately
> run into http://www.federated.com/~jim/schintro-v14/schintro_102.html
> when searching for "scheme string equality" and used equal?.
> 
> Once I looked again and changed the code to use string=? things work
> just fine. I wanted to know what does equal? do when used against
> strings. Why does it work sometimes and why does it just hang on other
> occasions?

As Eli says, that's a surprising result. The `equal?' function is
commonly used on strings, and assuming that you're using a language
like `scheme/base', R5RS, or R6RS (all the same `equal?'), then
`equal?' fairly quickly determines when it's given strings and then
does the same thing as `string=?'.

If your program is something that you can send to me, then I'm
interested to try it myself (with `equal?' in place of `string=?').

Matthew


From cce at ccs.neu.edu  Wed Sep 24 12:04:29 2008
From: cce at ccs.neu.edu (Carl Eastlund)
Date: Thu Mar 26 02:29:07 2009
Subject: [plt-scheme] FastTest random testing library
In-Reply-To: 
References: <990e0c030809231736m65ce991aq728c7d9f4f528f4c@mail.gmail.com>
	
Message-ID: <990e0c030809240904x58a678a5r8dfa711cba1eb83a@mail.gmail.com>

GUI.

On Wed, Sep 24, 2008 at 1:39 AM, Noel Welsh  wrote:
> Sweet!  Any reason to choose SchemeUnit 2 over 3?
>
> N.
>
> On Wed, Sep 24, 2008 at 1:36 AM, Carl Eastlund  wrote:
>> I've just updated FastTest to Planet version (3 2). ...
>>
>> The SchemeUnit integration now makes use of keywords for its optional
>> arguments, which may make code more readable:

-- 
Carl Eastlund

From news at aspden.com  Wed Sep 24 17:23:52 2008
From: news at aspden.com (John Lawrence Aspden)
Date: Thu Mar 26 02:29:07 2009
Subject: [plt-scheme] module constants and tracing
Message-ID: 

Hi, 

Is there anyway to set (compile-enforce-module-constants #f) as the default
for DrScheme? I'd like to be able to trace function calls without having to
reload the program from scratch.

I'm playing with the meta-circular evaluator from SICP, and wishing to be
modern I've started the program with #lang scheme, and dealt with the
mutable pairs issues. The program is in a file "bookevaluator.ss"

I can run it by loading "bookevaluator.ss" into drscheme, and pressing the
run button. Then in my interactions window I can type:

> (me "hi")
"hi"

(me calls the evaluator on an expression)

It works fine, but if I want to trace functions, and I type:
(require (lib "trace.ss"))
(trace self-evaluating?)

then I get the error:

set!: cannot modify a constant: self-evaluating?

I've found by trial and error that if I create a second
file "interactiveevaluator.ss" that contains:

(define (go) (eval '(begin
                      (require scheme/enter) 
                      (require (lib "trace.ss"))
                      (compile-enforce-module-constants #f)
                      (load "bookevaluator.ss")
                      (enter! "bookevaluator.ss"))))

and then load that into a *different* window, and press the run button, and
then type (go), then I end up with a REPL where tracing works, and I can
say:

> (me ((?(a b)(* a b)) 1 2))
2

> (trace apply-primitive-procedure)
> (me ((?(a b)(* a b)) 1 2))
|(apply-primitive-procedure (primitive #) (1 2))
|2
2

But it would be nice to be able to do this in my original window. Nothing I
try will make this happen at all. Am I missing something simple to get this
to work? I'm using 4.1.0.3-svn11sep2008 [3m].

Cheers, John.








-- 
Contractor in Cambridge UK -- http://www.aspden.com


From billclem at gmail.com  Wed Sep 24 17:45:36 2008
From: billclem at gmail.com (Bill Clementson)
Date: Thu Mar 26 02:29:08 2009
Subject: [plt-scheme] Re: Vancouver Lisp Users Group meeting for September
	2008 - The BKNR Common Lisp web application development environment
In-Reply-To: <8757cb490809040945gcb0c97fsabfd40c9d09b921d@mail.gmail.com>
References: <8757cb490809040945gcb0c97fsabfd40c9d09b921d@mail.gmail.com>
Message-ID: <8757cb490809241445q7e266344pf2b24893ab52a8a9@mail.gmail.com>

Hi all,
Just a reminder of tomorrow's lispvan meeting. As I've noted in my updated
blog entry (http://bc.tech.coop/blog/080904.html), we won't be able to use
the "new" venue and will instead have to hold the meeting again at Calhoun's
coffee shop:

Calhoun's , 3035 West Broadway,
Vancouver

See you there!

- Bill

On Thu, Sep 4, 2008 at 9:45 AM, Bill Clementson  wrote:

> Hi all,
>
> We've had a few presentations on web application development
> environments/frameworks at lispvan. For our September lispvan meeting,
> Hans H?bner will be flying over from Berlin (actually, he's coming for
> the ICFP conference in Victoria, but has graciously agreed to come
> over to Vancouver for the evening while he's in the area) to give us a
> presentation on BKNR. BKNR is neat in that it provides it's own object
> persistence layer as part of the web application development
> environment. It's nice to be able to hear about different web
> application development frameworks from the authors/users of those
> frameworks and it will be interesting to be able to compare/contrast
> BKNR with the others we've seen at lispvan meetings.
>
> We are planning to have the meeting at our new location (with a
> projector and a special meeting room!) as the owner of the new cafe
> (which is located right next door to the Mac Market) expects the
> construction work to be completed by our meeting date. I'll update
> this post closer to the meeting date with any changes (in the event
> that the new meeting venue isn't ready in time).
>
> Here's the "official" meeting notice:
>
> Topic: The BKNR Common Lisp web application development environment
> Presenter: Hans H?bner
> Date: Thursday, September 25th, 2008
> Time: 7pm - 10pm (or whenever)
> Venue: no-name cafe next door to the Mac Market, 2774 West 4th Avenue
> (at MacDonald Street), Vancouver
> Summary: BKNR is a collection of Common Lisp packages used to develop
> and deploy web applications. It consists of a number of open source
> Lisp modules and adds several framework level modules. The goal is to
> have a one-stop repository for all base software to aid in easy
> deployment and configuration reproducability.
>
> The major component in the BKNR framework is the pure Lisp
> transaction-based persistence layer. It provides for in-memory object
> persistence and delivers high performance with small development
> overhead. The web components of BKNR make it easy to serve persistent
> objects using HTTP in XML, HTML or other formats.
>
> The presentation shows the guiding principles for BKNR, architectures
> and features of the data store and web components, current
> applications and future plans.
>
> The presenter: Hans H?bner has been a hacker for over 20 years. Coming
> from an object oriented and system programming background with
> extensive commercial development experience in C++ and Perl, he
> discovered Common Lisp as his favourite programming language in 2001.
> He is currently a freelance consultant with Clozure Associates and ITA
> Software. His research interests include persistence systems and
> hardware to support dynamic programming.
>
> Some links:
> http://bknr.net/
> http://vaxbusters.org/workshop/secd.xml
> http://headcraft.de/
>
> Join us for a beer/coffee and a chance to see/discuss the BKNR Common
> Lisp web application development environment.
>
> Any updates (and a copy of this notice with additional links) will be
> posted on my blog: http://bc.tech.coop/blog/080904.html
>
> --
> Bill Clementson
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080924/5332b563/attachment.html
From DekuDekuplex at Yahoo.com  Thu Sep 25 01:11:07 2008
From: DekuDekuplex at Yahoo.com (Benjamin L.Russell)
Date: Thu Mar 26 02:29:08 2009
Subject: [plt-scheme] Re: How to update MzScheme from v352 to v4.1?
References: 
Message-ID: 

On Wed, 24 Sep 2008 19:21:28 +0900, Benjamin L.Russell
 wrote:

>With MzScheme v352 and DrScheme, version 4.1, english, installed on
>Windows XP Professional, Service Pack 2, I would like to upgrade
>MzScheme to v4.1 so that I can use it at the command line and in
>Emacs.
>
>However, according to "Download MzScheme v4.1" (see
>http://download.plt-scheme.org/mzscheme/mz-4-1-bin-i386-win32-exe.html),
>>Note: If you have a previously installed version of MzScheme,
>uninstall it before using this installer. 
>
>Unfortunately, it is not quite clear how to do this.  MzScheme is not
>listed in the Add/Remove Programs control panel applet, and there is
>no Uninstall.exe or similar file in the MzScheme folder.  Also, the
>included documents do not describe specifically how to uninstall it.
>
>What should I do to upgrade from MzScheme v352 to v4.1?

Actually, I just discovered the answer to this question:  In the post
"[plt-scheme] switching between MzScheme versions" (see
http://www.cs.brown.edu/pipermail/plt-scheme/2006-August/014401.html),
dated "Tue Aug 15 20:35:50 EDT 2006," Eli Barzilay wrote:

>On Aug 16, Matthew Flatt wrote:
>> At Tue, 15 Aug 2006 13:17:49 +0200, "Jos Koot" wrote:
>> > I frequently download the most recent version of the SVN
>> > repository trunk.  In some cases it would be nice to switch
>> > quickly from one version to another one, particularly in case a
>> > newer version makes my programs produce other results.
>> 
>> You can install any number of versions at the same time, whether
>> they're normal releases or nightly builds --- as long as you don't
>> install them to the same directory, obviously.
>> 
>> The only collision is that the latest install is the one you get
>> when you double-click ".scm" files.
>
>Actually there's more -- there are several registry keys that are in
>charge of binding file suffixes (.ss, .scm, .plt), and there are other
>keys that contain information regarding how to uninstall.  But the
>nightly builds are special in that they're put in a place that does
>not conflict with a stable release installation.
>
>The bottom line is that if you want to use nightly builds and a stable
>release on the same machine, then everything should be fine.  If you
>want several different stable releases, then install them in
>chronological order, to different directories, and to uninstall any
>version except for the last one, simply remove the directory.
>
>Of course you will need to find some way to start them up -- either
>different startup-menu entries, or hack some script.

So, either rename or remove the old directory, or rename the new
directory.

>Also, in trying to figure out how to uninstall MzScheme v352, I opened
>the "Setup PLT.exe" file in the MzScheme directory.  Does this mean
>that I now need to uninstall and reinstall DrScheme, version 4.1,
>english?  I tried it out, and it seems to continue to work fine.

Unfortunately, this question wasn't answered by that post, and a
search on Google did not reveal any answers.  If anybody knows the
answer, please respond in this thread if possible.

-- Benjamin L. Russell


From eli at barzilay.org  Thu Sep 25 01:20:47 2008
From: eli at barzilay.org (Eli Barzilay)
Date: Thu Mar 26 02:29:09 2009
Subject: [plt-scheme] Re: How to update MzScheme from v352 to v4.1?
In-Reply-To: 
References: 
	
Message-ID: <18651.8111.473796.88589@arabic.ccs.neu.edu>

On Sep 25, Benjamin L.Russell wrote:
> On Wed, 24 Sep 2008 19:21:28 +0900, Benjamin L.Russell
>  wrote:
> 
> >With MzScheme v352 and DrScheme, version 4.1, english, installed on
> >Windows XP Professional, Service Pack 2, I would like to upgrade
> >MzScheme to v4.1 so that I can use it at the command line and in
> >Emacs.
> >
> >However, according to "Download MzScheme v4.1" (see
> >http://download.plt-scheme.org/mzscheme/mz-4-1-bin-i386-win32-exe.html),
> >>Note: If you have a previously installed version of MzScheme,
> >uninstall it before using this installer. 
> >
> >Unfortunately, it is not quite clear how to do this.  MzScheme is not
> >listed in the Add/Remove Programs control panel applet, and there is
> >no Uninstall.exe or similar file in the MzScheme folder.  Also, the
> >included documents do not describe specifically how to uninstall it.
> >
> >What should I do to upgrade from MzScheme v352 to v4.1?
> 
> Actually, I just discovered the answer to this question: In the post
> "[plt-scheme] switching between MzScheme versions" (see
> http://www.cs.brown.edu/pipermail/plt-scheme/2006-August/014401.html),
> dated "Tue Aug 15 20:35:50 EDT 2006," Eli Barzilay wrote:
> [...]
> So, either rename or remove the old directory, or rename the new
> directory.

If you're referring to the mzscheme distribution (not the plt scheme
one), then there is no uninstaller -- the installation basically
creates the directory and does nothing else.  So to "uninstall", you
just delete the directory.

The usual PLT Scheme installer does the usual things -- you get an
uninstaller, and it should also be possible to uninstall from the
Windows software thing.


> >Also, in trying to figure out how to uninstall MzScheme v352, I opened
> >the "Setup PLT.exe" file in the MzScheme directory.  Does this mean
> >that I now need to uninstall and reinstall DrScheme, version 4.1,
> >english?  I tried it out, and it seems to continue to work fine.
> 
> Unfortunately, this question wasn't answered by that post, and a
> search on Google did not reveal any answers.  If anybody knows the
> answer, please respond in this thread if possible.

You can install anything you want, any number of times.  if you use a
different directory name, then the only things that will be
overwritten are:

* the .scm/.ss/.plt associations will use the most recently installed
  version

* the start menu entry will point at the recent version

* and the registry keys for uninstallation

If you just run DrScheme/MzScheme directly (rather than double click a
file), then you shouldn't have any issues.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

From mflatt at cs.utah.edu  Thu Sep 25 01:21:30 2008
From: mflatt at cs.utah.edu (Matthew Flatt)
Date: Thu Mar 26 02:29:09 2009
Subject: [plt-scheme] String equality and other questions
In-Reply-To: <20080924130251.284146500AA@mail-svr1.cs.utah.edu>
References: <1cbfac59-80b8-428c-b9d3-be7618d91fa3@c65g2000hsa.googlegroups.com>
	<20080924130251.284146500AA@mail-svr1.cs.utah.edu>
Message-ID: <20080925052131.6AA506500AA@mail-svr1.cs.utah.edu>

Thanks for sending me some code.

Your program imports SRFI 63, which apparently provides its own
`equal?' that is shadowing the usual one. (I noticed this by clicking
Check Syntax in DrScheme and then mousing over the `equal?' identifier
in your program.)

The `equal?' in the SRFI 63 implementation, meanwhile, seems to have
been completely broken. I committed a repair to SVN.

Matthew

At Wed, 24 Sep 2008 06:02:49 -0700, Matthew Flatt wrote:
> At Tue, 23 Sep 2008 21:25:26 -0700 (PDT), Deep wrote:
> > While writing a game in scheme I recently ran into an issue where
> > using equal? to compare strings would wait on the equality test and
> > hog the cpu 60-70% of the time.  Oddly enough it worked sometimes. I
> > looked through my code suspecting a recursive call gone amuck but
> > eventually narrowed the issue down to this call.  I had unfortunately
> > run into http://www.federated.com/~jim/schintro-v14/schintro_102.html
> > when searching for "scheme string equality" and used equal?.
> > 
> > Once I looked again and changed the code to use string=? things work
> > just fine. I wanted to know what does equal? do when used against
> > strings. Why does it work sometimes and why does it just hang on other
> > occasions?
> 
> As Eli says, that's a surprising result. The `equal?' function is
> commonly used on strings, and assuming that you're using a language
> like `scheme/base', R5RS, or R6RS (all the same `equal?'), then
> `equal?' fairly quickly determines when it's given strings and then
> does the same thing as `string=?'.
> 
> If your program is something that you can send to me, then I'm
> interested to try it myself (with `equal?' in place of `string=?').
> 
> Matthew
> 
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme

From DekuDekuplex at Yahoo.com  Thu Sep 25 02:57:06 2008
From: DekuDekuplex at Yahoo.com (Benjamin L.Russell)
Date: Thu Mar 26 02:29:09 2009
Subject: [plt-scheme] How to invoke errortrace with MzScheme v4.1?
Message-ID: 

I would like to invoke MzScheme v4.1 with errortrace, a la 

>MzScheme.exe -M errortrace

as was possible in v372, but for some reason, according to the help
provided by 

>MzScheme.exe -h

the -M option, which used to be mapped to 

>-e '(require (lib ".ss" ""))'

no longer exists.

So, I tried running

>MzScheme.exe -e '(require (lib ".ss" ""))' errortrace

only to get the following error message:

>#f::1: read: expected a `)' to close `('

How do I invoke errortrace with MzScheme v4.1?

-- Benjamin L. Russell


From eli at barzilay.org  Thu Sep 25 03:07:00 2008
From: eli at barzilay.org (Eli Barzilay)
Date: Thu Mar 26 02:29:09 2009
Subject: [plt-scheme] How to invoke errortrace with MzScheme v4.1?
In-Reply-To: 
References: 
Message-ID: <18651.14484.832132.53855@arabic.ccs.neu.edu>

On Sep 25, Benjamin L.Russell wrote:
> 
> How do I invoke errortrace with MzScheme v4.1?

http://docs.plt-scheme.org/errortrace/quick-instructions.html

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

From neil at neilvandyke.org  Thu Sep 25 03:08:53 2008
From: neil at neilvandyke.org (Neil Van Dyke)
Date: Thu Mar 26 02:29:09 2009
Subject: [plt-scheme] How to invoke errortrace with MzScheme v4.1?
In-Reply-To: 
References: 
Message-ID: <48DB3905.80007@neilvandyke.org>

Benjamin L.Russell wrote at 09/25/2008 02:57 AM:
> How do I invoke errortrace with MzScheme v4.1?

Matthew had several emails on this when I asked about errortrace in 4.0.2:
http://list.cs.brown.edu/pipermail/plt-scheme/2008-August/026250.html

For a client's system, we have gotten sufficient backtraces under PLT 
4.x by always running with JIT disabled.  Since we started doing this, I 
don't think we've really needed errortrace.

-- 
http://www.neilvandyke.org/

From DekuDekuplex at Yahoo.com  Thu Sep 25 04:06:40 2008
From: DekuDekuplex at Yahoo.com (Benjamin L.Russell)
Date: Thu Mar 26 02:29:09 2009
Subject: [plt-scheme] Re: How to invoke errortrace with MzScheme v4.1?
References: 
	
	<48DB3905.80007@neilvandyke.org>
Message-ID: <2fhmd4dvsqh100qi79a4bprlv51q5gttgg@4ax.com>

On Thu, 25 Sep 2008 03:07:00 -0400, Eli Barzilay
 wrote:

>On Sep 25, Benjamin L.Russell wrote:
>> 
>> How do I invoke errortrace with MzScheme v4.1?
>
>http://docs.plt-scheme.org/errortrace/quick-instructions.html

On Thu, 25 Sep 2008 03:08:53 -0400, Neil Van Dyke
 wrote:

>Benjamin L.Russell wrote at 09/25/2008 02:57 AM:
>> How do I invoke errortrace with MzScheme v4.1?
>
>Matthew had several emails on this when I asked about errortrace in 4.0.2:
>http://list.cs.brown.edu/pipermail/plt-scheme/2008-August/026250.html
>
>For a client's system, we have gotten sufficient backtraces under PLT 
>4.x by always running with JIT disabled.  Since we started doing this, I 
>don't think we've really needed errortrace.

Thank you both, Eli and Neil.

The following command now works fine in GNU Emacs 22.1.1
(i386-mingw-nt5.1.2600) of 2007-06-02 on RELEASE:

>mzscheme -i -l errortrace

-- Benjamin L. Russell


From ruchi.bajoria at gmail.com  Thu Sep 25 04:52:55 2008
From: ruchi.bajoria at gmail.com (Ruchi Bajoria)
Date: Thu Mar 26 02:29:10 2009
Subject: [plt-scheme] Microphone input in drscheme
Message-ID: <2a97e60a0809250152t1fd6b4edkef9acbbae6f5f325@mail.gmail.com>

Hi,

Im trying to make a scheme program which takes input from a microphone
and uses the decibel information (mainly the volume level) to perform
certain other tasks. I have no idea how to go about it, can anyone help?


Ruchi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080925/73359ea3/attachment.htm
From czhu at cs.utah.edu  Thu Sep 25 08:34:43 2008
From: czhu at cs.utah.edu (Chongkai Zhu)
Date: Thu Mar 26 02:29:10 2009
Subject: [plt-scheme] module constants and tracing
In-Reply-To: 
References: 
Message-ID: <48DB8563.600@cs.utah.edu>

If you are using DrScheme for SICP, use the pretty big language.

Chongkai

John Lawrence Aspden wrote:
> Hi, 
>
> Is there anyway to set (compile-enforce-module-constants #f) as the default
> for DrScheme? I'd like to be able to trace function calls without having to
> reload the program from scratch.
>
> I'm playing with the meta-circular evaluator from SICP, and wishing to be
> modern I've started the program with #lang scheme, and dealt with the
> mutable pairs issues. The program is in a file "bookevaluator.ss"
>
> I can run it by loading "bookevaluator.ss" into drscheme, and pressing the
> run button. Then in my interactions window I can type:
>
>   
>> (me "hi")
>>     
> "hi"
>
> (me calls the evaluator on an expression)
>
> It works fine, but if I want to trace functions, and I type:
> (require (lib "trace.ss"))
> (trace self-evaluating?)
>
> then I get the error:
>
> set!: cannot modify a constant: self-evaluating?
>
> I've found by trial and error that if I create a second
> file "interactiveevaluator.ss" that contains:
>
> (define (go) (eval '(begin
>                       (require scheme/enter) 
>                       (require (lib "trace.ss"))
>                       (compile-enforce-module-constants #f)
>                       (load "bookevaluator.ss")
>                       (enter! "bookevaluator.ss"))))
>
> and then load that into a *different* window, and press the run button, and
> then type (go), then I end up with a REPL where tracing works, and I can
> say:
>
>   
>> (me ((?(a b)(* a b)) 1 2))
>>     
> 2
>
>   
>> (trace apply-primitive-procedure)
>> (me ((?(a b)(* a b)) 1 2))
>>     
> |(apply-primitive-procedure (primitive #) (1 2))
> |2
> 2
>
> But it would be nice to be able to do this in my original window. Nothing I
> try will make this happen at all. Am I missing something simple to get this
> to work? I'm using 4.1.0.3-svn11sep2008 [3m].
>
> Cheers, John.
>
>
>
>
>
>
>
>
>   


From deepankar.sharma at gmail.com  Thu Sep 25 09:33:31 2008
From: deepankar.sharma at gmail.com (Deep)
Date: Thu Mar 26 02:29:10 2009
Subject: [plt-scheme] Re: String equality and other questions
In-Reply-To: <20080925052131.6AA506500AA@mail-svr1.cs.utah.edu>
References: <1cbfac59-80b8-428c-b9d3-be7618d91fa3@c65g2000hsa.googlegroups.com>
	<20080924130251.284146500AA@mail-svr1.cs.utah.edu>
	<20080925052131.6AA506500AA@mail-svr1.cs.utah.edu>
Message-ID: 

Thanks for the speedy fix!

On Sep 25, 1:21?am, Matthew Flatt  wrote:
> Thanks for sending me some code.
>
> Your program imports SRFI 63, which apparently provides its own
> `equal?' that is shadowing the usual one. (I noticed this by clicking
> Check Syntax in DrScheme and then mousing over the `equal?' identifier
> in your program.)
>
> The `equal?' in the SRFI 63 implementation, meanwhile, seems to have
> been completely broken. I committed a repair to SVN.
>
> Matthew
>
> At Wed, 24 Sep 2008 06:02:49 -0700, Matthew Flatt wrote:
>
>
>
> > At Tue, 23 Sep 2008 21:25:26 -0700 (PDT), Deep wrote:
> > > While writing a game in scheme I recently ran into an issue where
> > > using equal? to compare strings would wait on the equality test and
> > > hog the cpu 60-70% of the time. ?Oddly enough it worked sometimes. I
> > > looked through my code suspecting a recursive call gone amuck but
> > > eventually narrowed the issue down to this call. ?I had unfortunately
> > > run intohttp://www.federated.com/~jim/schintro-v14/schintro_102.html
> > > when searching for "scheme string equality" and used equal?.
>
> > > Once I looked again and changed the code to use string=? things work
> > > just fine. I wanted to know what does equal? do when used against
> > > strings. Why does it work sometimes and why does it just hang on other
> > > occasions?
>
> > As Eli says, that's a surprising result. The `equal?' function is
> > commonly used on strings, and assuming that you're using a language
> > like `scheme/base', R5RS, or R6RS (all the same `equal?'), then
> > `equal?' fairly quickly determines when it's given strings and then
> > does the same thing as `string=?'.
>
> > If your program is something that you can send to me, then I'm
> > interested to try it myself (with `equal?' in place of `string=?').
>
> > Matthew
>
> > _________________________________________________
> > ? For list-related administrative tasks:
> > ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
> _________________________________________________
> ? For list-related administrative tasks:
> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme- Hide quoted text -
>
> - Show quoted text -

From rcleis at mac.com  Thu Sep 25 09:43:19 2008
From: rcleis at mac.com (Richard Cleis)
Date: Thu Mar 26 02:29:11 2009
Subject: [plt-scheme] Microphone input in drscheme
In-Reply-To: <2a97e60a0809250152t1fd6b4edkef9acbbae6f5f325@mail.gmail.com>
References: <2a97e60a0809250152t1fd6b4edkef9acbbae6f5f325@mail.gmail.com>
Message-ID: <5224528C-53F7-4203-AEB8-67E556D8E353@mac.com>

Are you trying to make it work on all platforms, or just your own  
computer?

rac



On Sep 25, 2008, at 2:52 AM, Ruchi Bajoria wrote:

> Hi,
>
> Im trying to make a scheme program which takes input from a microphone
> and uses the decibel information (mainly the volume level) to  
> perform certain other tasks. I have no idea how to go about it, can  
> anyone help?
>
>
>
> Ruchi
>
>
> _________________________________________________
>  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/20080925/ca908b2f/attachment.html
From ruchi.bajoria at gmail.com  Thu Sep 25 11:12:48 2008
From: ruchi.bajoria at gmail.com (Ruchi Bajoria)
Date: Thu Mar 26 02:29:11 2009
Subject: [plt-scheme] Microphone input in drscheme
In-Reply-To: <5224528C-53F7-4203-AEB8-67E556D8E353@mac.com>
References: <2a97e60a0809250152t1fd6b4edkef9acbbae6f5f325@mail.gmail.com>
	<5224528C-53F7-4203-AEB8-67E556D8E353@mac.com>
Message-ID: <2a97e60a0809250812p6a557036nf2a7ba829cea7fb0@mail.gmail.com>

I aim to make it work on all platforms but I havent found much help on
how to get about doing it.

Ruchi

On 9/25/08, Richard Cleis  wrote:
> Are you trying to make it work on all platforms, or just your own
> computer?
>
> rac
>
>
>
> On Sep 25, 2008, at 2:52 AM, Ruchi Bajoria wrote:
>
>> Hi,
>>
>> Im trying to make a scheme program which takes input from a microphone
>> and uses the decibel information (mainly the volume level) to
>> perform certain other tasks. I have no idea how to go about it, can
>> anyone help?
>>
>>
>>
>> Ruchi
>>
>>
>> _________________________________________________
>>  For list-related administrative tasks:
>>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
>

From mike at sharedlogic.ca  Thu Sep 25 11:37:09 2008
From: mike at sharedlogic.ca (Michael Forster)
Date: Thu Mar 26 02:29:11 2009
Subject: [plt-scheme] Formlets in PLT
In-Reply-To: 
References: 
Message-ID: 


On 16-Sep-08, at 5:59 PM, Jay McCarthy wrote:

> The Links group has created formlets:
>
> http://groups.inf.ed.ac.uk/links/formlets/
>
> I have spent the afternoon implementing formlets in PLT.
> --
>


Interesting, and I'm delighted to see that PLT Scheme developers won't  
hesitate
to 'push the envelope'.

However, as a commercial developer writing and delivering applications  
with
PLT Scheme, I wonder what are the advantages of the formlet approach  
compared
to the typed interactions approach described in the HTDP extended  
exercise,
"Interacting on the Web."  Specifically, if one revises (as I have,  
snippets below)
the latter to use PLT class-based input fields to permit more  
convenient inheritance
and composition, then it, too, would seem to address the problems  
targeted by
formlets:

- static association between form and handler
- processing of raw HTML strings into structured values
- composition, involving fresh eld names at runtime


(define input%
   (class object%
     (init-field prompt)
     (init (value #f))
     (define _value value)
     (super-new)
     (define/public (generate name value)
       `(input ((name ,(symbol->string name)
                     (type "text")
                     (value ,value)))
     (define/public (extract name binding)
       (and (exists-binding? name binding)
                 (extract-binding/single name binding)))
     (define/public (type? value)
	(string? value))))

(define boolean-input%
   (class input%
    ...))

(define string-input%
   (class input%
     (init (min-length #f))
     (define _min-length min-length)
     (init (max-length #f))
     (define _max-length max-length)
     ...))

(define number-input%
   (class input%
     (init (min-value #f))
     (define _min-value min-value)
     (init (max-value #f))
     (define _max-value max-value)
     ...))

(define decimal-input%
   (class number-input%
    ...))

(define calendar-date-input%
   (class input%
    ...))

...

(define (query names-and-inputs
                            #:title (title "Query")
                            #:form-generator (form-generator standard- 
form-generator)
                            #:submit-buttons (submit-buttons (list  
"OK"))
                            #:cancel-button (cancel-button "Cancel"))
   ...)


--
Michael Forster
mike@sharedlogic.ca




From jay.mccarthy at gmail.com  Thu Sep 25 11:54:58 2008
From: jay.mccarthy at gmail.com (Jay McCarthy)
Date: Thu Mar 26 02:29:11 2009
Subject: [plt-scheme] Formlets in PLT
In-Reply-To: 
References: 
	
Message-ID: 

Michael,

I haven't spent a lot of time using formlets just yet. They seem to me
to be quite elegant in their terseness and ability to hide a lot of
annoying details, like generating names and composing conversion
routines. I certainly will not argue that they are "the one true way"
to deal with forms.

The way I look at it is that they standardize a whole bunch of code
I've been copying every time I start a new Web app. If your tools are
equally powerful, I would not advocate change. If yours are more
powerful, maybe we can improve formlets? [Obviously being class-based
adds a lot, but I'm wondering at what cost in simplicity.]

Basically, I don't want to argue either way, but I don't want to
ignore your email. =)

Jay

On Thu, Sep 25, 2008 at 9:37 AM, Michael Forster  wrote:
>
> On 16-Sep-08, at 5:59 PM, Jay McCarthy wrote:
>
>> The Links group has created formlets:
>>
>> http://groups.inf.ed.ac.uk/links/formlets/
>>
>> I have spent the afternoon implementing formlets in PLT.
>> --
>>
>
>
> Interesting, and I'm delighted to see that PLT Scheme developers won't
> hesitate
> to 'push the envelope'.
>
> However, as a commercial developer writing and delivering applications with
> PLT Scheme, I wonder what are the advantages of the formlet approach
> compared
> to the typed interactions approach described in the HTDP extended exercise,
> "Interacting on the Web."  Specifically, if one revises (as I have, snippets
> below)
> the latter to use PLT class-based input fields to permit more convenient
> inheritance
> and composition, then it, too, would seem to address the problems targeted
> by
> formlets:
>
> - static association between form and handler
> - processing of raw HTML strings into structured values
> - composition, involving fresh eld names at runtime
>
>
> (define input%
>  (class object%
>    (init-field prompt)
>    (init (value #f))
>    (define _value value)
>    (super-new)
>    (define/public (generate name value)
>      `(input ((name ,(symbol->string name)
>                    (type "text")
>                    (value ,value)))
>    (define/public (extract name binding)
>      (and (exists-binding? name binding)
>                (extract-binding/single name binding)))
>    (define/public (type? value)
>        (string? value))))
>
> (define boolean-input%
>  (class input%
>   ...))
>
> (define string-input%
>  (class input%
>    (init (min-length #f))
>    (define _min-length min-length)
>    (init (max-length #f))
>    (define _max-length max-length)
>    ...))
>
> (define number-input%
>  (class input%
>    (init (min-value #f))
>    (define _min-value min-value)
>    (init (max-value #f))
>    (define _max-value max-value)
>    ...))
>
> (define decimal-input%
>  (class number-input%
>   ...))
>
> (define calendar-date-input%
>  (class input%
>   ...))
>
> ...
>
> (define (query names-and-inputs
>                           #:title (title "Query")
>                           #:form-generator (form-generator
> standard-form-generator)
>                           #:submit-buttons (submit-buttons (list "OK"))
>                           #:cancel-button (cancel-button "Cancel"))
>  ...)
>
>
> --
> Michael Forster
> mike@sharedlogic.ca
>
>
>
>



-- 
Jay McCarthy 
Assistant Professor / Brigham Young University
http://jay.teammccarthy.org

"The glory of God is Intelligence" - D&C 93

From noelwelsh at gmail.com  Thu Sep 25 12:01:02 2008
From: noelwelsh at gmail.com (Noel Welsh)
Date: Thu Mar 26 02:29:12 2009
Subject: [plt-scheme] Microphone input in drscheme
In-Reply-To: <2a97e60a0809250812p6a557036nf2a7ba829cea7fb0@mail.gmail.com>
References: <2a97e60a0809250152t1fd6b4edkef9acbbae6f5f325@mail.gmail.com>
	<5224528C-53F7-4203-AEB8-67E556D8E353@mac.com>
	<2a97e60a0809250812p6a557036nf2a7ba829cea7fb0@mail.gmail.com>
Message-ID: 

Binding to the portaudio library

  http://www.portaudio.com/

using the FFI

  http://docs.plt-scheme.org/foreign/index.html

is the way I would approach this.

N.

On Thu, Sep 25, 2008 at 4:12 PM, Ruchi Bajoria  wrote:
> I aim to make it work on all platforms but I havent found much help on
> how to get about doing it.
>
> Ruchi

From mike at sharedlogic.ca  Thu Sep 25 12:18:02 2008
From: mike at sharedlogic.ca (Michael Forster)
Date: Thu Mar 26 02:29:12 2009
Subject: [plt-scheme] Formlets in PLT
In-Reply-To: 
References: 
	
	
Message-ID: 


On 25-Sep-08, at 10:54 AM, Jay McCarthy wrote:

> Michael,
>
> I haven't spent a lot of time using formlets just yet. They seem to me
> to be quite elegant in their terseness and ability to hide a lot of
> annoying details, like generating names and composing conversion
> routines. I certainly will not argue that they are "the one true way"
> to deal with forms.
>
> The way I look at it is that they standardize a whole bunch of code
> I've been copying every time I start a new Web app. If your tools are
> equally powerful, I would not advocate change. If yours are more
> powerful, maybe we can improve formlets? [Obviously being class-based
> adds a lot, but I'm wondering at what cost in simplicity.]
>
> Basically, I don't want to argue either way, but I don't want to
> ignore your email. =)
>
> Jay


Thanks for the reply, Jay!

I agree, wholeheartedly, with your observations regarding elegance and
hiding of details, and that's why I posed the question.  I've been  
seeking
to solve these very same problems, while leveraging, as much as  
possible,
the existing direction and efforts of PLT -- I am a commercial  
developer ;-)

Originally, using the HTDP design seemed like the smartest place to  
start,
but, if formlets come to surpass that approach in the PLT community (and
I recognise that won't happen in one day), I'm inclined to throw my own
time and effort behind formlets instead.  Of course, I'm not expecting  
you or
anyone else here to tell me which way the wind will blow :-)

I will take a closer look at formlets and, time permitting, see if I  
can't help
out.  BTW, I actually do prefer the syntactic over everything-as-a-class
approach to solving these kinds of problems; the latter was just the  
easier
for someone not yet fluent with scheme-style macros.

Cheers!

--
Michael Forster
mike@sharedlogic.ca




From grettke at acm.org  Thu Sep 25 12:21:50 2008
From: grettke at acm.org (Grant Rettke)
Date: Thu Mar 26 02:29:12 2009
Subject: [plt-scheme] Formlets in PLT
In-Reply-To: 
References: 
	
	
	
Message-ID: <756daca50809250921k173f2be5m4f02c423c8e860c@mail.gmail.com>

Is the HtDP design you mentioned part of the web server, or something
discussed in HtDP?

Is it commonly used by people using the web server?

From mike at sharedlogic.ca  Thu Sep 25 12:28:58 2008
From: mike at sharedlogic.ca (Michael Forster)
Date: Thu Mar 26 02:29:12 2009
Subject: [plt-scheme] Formlets in PLT
In-Reply-To: <756daca50809250921k173f2be5m4f02c423c8e860c@mail.gmail.com>
References: 
	
	
	
	<756daca50809250921k173f2be5m4f02c423c8e860c@mail.gmail.com>
Message-ID: <1892A9DA-0850-4C33-93BF-AEF1F38F0900@sharedlogic.ca>


On 25-Sep-08, at 11:21 AM, Grant Rettke wrote:

> Is the HtDP design you mentioned part of the web server, or something
> discussed in HtDP?
>
> Is it commonly used by people using the web server?



The original design is described in the following:

	http://www.ccs.neu.edu/home/matthias/HtDP/Extended/servlets.html

I believe it's available under the htdp collection, in htdp/servlet2.ss.
However, I wrote my own library with a similar interface and class-based
input fields.

--
Michael Forster
mike@sharedlogic.ca




From grettke at acm.org  Thu Sep 25 12:34:49 2008
From: grettke at acm.org (Grant Rettke)
Date: Thu Mar 26 02:29:12 2009
Subject: [plt-scheme] Formlets in PLT
In-Reply-To: <1892A9DA-0850-4C33-93BF-AEF1F38F0900@sharedlogic.ca>
References: 
	
	
	
	<756daca50809250921k173f2be5m4f02c423c8e860c@mail.gmail.com>
	<1892A9DA-0850-4C33-93BF-AEF1F38F0900@sharedlogic.ca>
Message-ID: <756daca50809250934y7d0196a1q7fe9a2e1fb5e5694@mail.gmail.com>

Interesting. Is your library public, or on PLaneT?

On Thu, Sep 25, 2008 at 11:28 AM, Michael Forster  wrote:
>
> On 25-Sep-08, at 11:21 AM, Grant Rettke wrote:
>
>> Is the HtDP design you mentioned part of the web server, or something
>> discussed in HtDP?
>>
>> Is it commonly used by people using the web server?
>
>
>
> The original design is described in the following:
>
>        http://www.ccs.neu.edu/home/matthias/HtDP/Extended/servlets.html
>
> I believe it's available under the htdp collection, in htdp/servlet2.ss.
> However, I wrote my own library with a similar interface and class-based
> input fields.
>
> --
> Michael Forster
> mike@sharedlogic.ca
>
>
>
>



-- 
http://www.wisdomandwonder.com/

From michael at schuerig.de  Thu Sep 25 12:57:16 2008
From: michael at schuerig.de (Michael Schuerig)
Date: Thu Mar 26 02:29:12 2009
Subject: [plt-scheme] Re: Formlets in PLT
In-Reply-To: 
References: 
	
	
Message-ID: <200809251857.16139.michael@schuerig.de>

On Thursday 25 September 2008, Michael Forster wrote:
> I agree, wholeheartedly, with your observations regarding elegance
> and hiding of details, and that's why I posed the question. ?I've
> been seeking
> to solve these very same problems, while leveraging, as much as ?
> possible,
> the existing direction and efforts of PLT -- I am a commercial ?
> developer ;-)

When I see X-exps and other approaches that abstract away from HTML, 
there's a concern that invariably comes to my mind: How do you work 
with web designers who only know HTML, CSS, and possibly JavaScript? 
The easiest answer, of course, is that you don't. Either you're doing 
the design yourself or coax the designer into writing X-exps (somewhat 
unlikely). Translating plain HTML/CSS pages to another, more programmer 
friendly notation, is rather tedious especially when the design is 
still evolving.

Michael

-- 
Michael Schuerig
mailto:michael@schuerig.de
http://www.schuerig.de/michael/

From matthias at ccs.neu.edu  Thu Sep 25 13:16:33 2008
From: matthias at ccs.neu.edu (Matthias Felleisen)
Date: Thu Mar 26 02:29:13 2009
Subject: [plt-scheme] Formlets in PLT
In-Reply-To: <1892A9DA-0850-4C33-93BF-AEF1F38F0900@sharedlogic.ca>
References: 
	
	
	
	<756daca50809250921k173f2be5m4f02c423c8e860c@mail.gmail.com>
	<1892A9DA-0850-4C33-93BF-AEF1F38F0900@sharedlogic.ca>
Message-ID: <8E32429C-D667-480D-A6D7-D27A5A963DCC@ccs.neu.edu>


The library and the material that came with it was pedagogical, made  
as simple as possible. When I wrote the pages and servlets for my  
wife's page I found this way to restrictive. -- Matthias



On Sep 25, 2008, at 12:28 PM, Michael Forster wrote:

>
> On 25-Sep-08, at 11:21 AM, Grant Rettke wrote:
>
>> Is the HtDP design you mentioned part of the web server, or something
>> discussed in HtDP?
>>
>> Is it commonly used by people using the web server?
>
>
>
> The original design is described in the following:
>
> 	http://www.ccs.neu.edu/home/matthias/HtDP/Extended/servlets.html
>
> I believe it's available under the htdp collection, in htdp/ 
> servlet2.ss.
> However, I wrote my own library with a similar interface and class- 
> based
> input fields.
>
> --
> Michael Forster
> mike@sharedlogic.ca
>
>
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme


From mike at sharedlogic.ca  Thu Sep 25 13:18:55 2008
From: mike at sharedlogic.ca (Michael Forster)
Date: Thu Mar 26 02:29:13 2009
Subject: [plt-scheme] Formlets in PLT
In-Reply-To: <756daca50809250934y7d0196a1q7fe9a2e1fb5e5694@mail.gmail.com>
References: 
	
	
	
	<756daca50809250921k173f2be5m4f02c423c8e860c@mail.gmail.com>
	<1892A9DA-0850-4C33-93BF-AEF1F38F0900@sharedlogic.ca>
	<756daca50809250934y7d0196a1q7fe9a2e1fb5e5694@mail.gmail.com>
Message-ID: 

On Thu, Sep 25, 2008 at 11:34 AM, Grant Rettke  wrote:
> Interesting. Is your library public, or on PLaneT?

Hi Grant,

No, sorry.  Not a copyright issue.  We just don't have the resources
to properly maintain an open source project, and the world has seen
enough unmaintained amateur-ware ;-)

-Mike

From mike at sharedlogic.ca  Thu Sep 25 13:25:51 2008
From: mike at sharedlogic.ca (Michael Forster)
Date: Thu Mar 26 02:29:13 2009
Subject: [plt-scheme] Re: Formlets in PLT
In-Reply-To: <200809251857.16139.michael@schuerig.de>
References: 
	
	
	<200809251857.16139.michael@schuerig.de>
Message-ID: 

On Thu, Sep 25, 2008 at 11:57 AM, Michael Schuerig  wrote:
[...]
>
> When I see X-exps and other approaches that abstract away from HTML,
> there's a concern that invariably comes to my mind: How do you work
> with web designers who only know HTML, CSS, and possibly JavaScript?
> The easiest answer, of course, is that you don't. Either you're doing
> the design yourself or coax the designer into writing X-exps (somewhat
> unlikely). Translating plain HTML/CSS pages to another, more programmer
> friendly notation, is rather tedious especially when the design is
> still evolving.

Our answer: We don't :-)

Of course, our needs and audience are very specific.  We develop database
applications with web-based front-end.  Note: I didn't write "database-backed
dynamic website" or whatever web developers like to call them.  We use web
technologies to replace things like PowerBuilder in the traditional corporate
database application environment.  There are no "web designers" worth the
trouble in our neck of the woods, and, frankly, we don't need a unique design
for every page.  We need a Microsoft Access-like web-based front-end.  We
need components, widgets, gadgets, etc., _not_ templates.  We're very much
in line with Avi Bryant regarding this:

http://www.cincomsmalltalk.com/userblogs/avi/blogView?showComments=true&entry=3257728961

Cheers,

Mike

From samdphillips at gmail.com  Thu Sep 25 14:22:24 2008
From: samdphillips at gmail.com (Sam Phillips)
Date: Thu Mar 26 02:29:13 2009
Subject: [plt-scheme] FFI: problem with define-cpointer-type
Message-ID: <73b251310809251122j2fd16705k5c276a6558a64bd9@mail.gmail.com>

Hi,

I'm having problems using a type defined by define-cpointer-type as an
argument to a foreign function.  Whenever I call out I get:

  Scheme->C: expects argument of type ; given #

Basically the code involved looks like:

;;; there is actually more in this struct...
(define-struct my-type (ptr))

(define-cpointer-type _my-type-ptr #f
  (lambda (v)
    (if (my-type? v)
      (my-type-ptr v)
      (error "cannot coerce to _my-type-ptr")))
  (lambda (ptr)
    (if ptr
      (make-my-type ptr)
      (error "got null"))))

(define my-type-maker
  (get-ffi-obj "my_type_maker" lib
    (_fun -> (ret : _my-type-ptr/null)
          -> (if ret ret (error "got null")))))

(define my-type-operation
  (get-ffi-obj "my_type_operation" lib
    (_fun _my-type-ptr -> _int)))

(define a (my-type-maker)) ; a is a proper my-type struct
(my-type-operation a)      ; throws above error

I can't seem to find any examples in Planet or core collects that use
define-cpointer-type in this way.  The closest thing I found was in the
examples magick.ss in defining the _PixelIterator type, and it uses a
ctype and not a cpointer.

Am I just doing this the totally incorrect way?

Thanks,
Sam

From grettke at acm.org  Thu Sep 25 14:41:40 2008
From: grettke at acm.org (Grant Rettke)
Date: Thu Mar 26 02:29:13 2009
Subject: [plt-scheme] Re: Formlets in PLT
In-Reply-To: 
References: 
	
	
	<200809251857.16139.michael@schuerig.de>
	
Message-ID: <756daca50809251141jc124103obaa4a691841f77e8@mail.gmail.com>

On Thu, Sep 25, 2008 at 12:25 PM, Michael Forster  wrote:
> We're very much in line with Avi Bryant regarding this:

It is hard to argue with such a developer-friendly take on things!

From eli at barzilay.org  Thu Sep 25 15:11:24 2008
From: eli at barzilay.org (Eli Barzilay)
Date: Thu Mar 26 02:29:13 2009
Subject: [plt-scheme] FFI: problem with define-cpointer-type
In-Reply-To: <73b251310809251122j2fd16705k5c276a6558a64bd9@mail.gmail.com>
References: <73b251310809251122j2fd16705k5c276a6558a64bd9@mail.gmail.com>
Message-ID: <18651.57948.394898.736650@arabic.ccs.neu.edu>

On Sep 25, Sam Phillips wrote:
> Hi,
> 
> I'm having problems using a type defined by define-cpointer-type as
> an argument to a foreign function.  Whenever I call out I get:
> 
>   Scheme->C: expects argument of type ; given #
> 
> Basically the code involved looks like:
> 
> ;;; there is actually more in this struct...
> (define-struct my-type (ptr))
> 
> (define-cpointer-type _my-type-ptr #f
>   (lambda (v)
>     (if (my-type? v)
>       (my-type-ptr v)
>       (error "cannot coerce to _my-type-ptr")))
>   (lambda (ptr)
>     (if ptr
>       (make-my-type ptr)
>       (error "got null"))))
> 
> (define my-type-maker
>   (get-ffi-obj "my_type_maker" lib
>     (_fun -> (ret : _my-type-ptr/null)
>           -> (if ret ret (error "got null")))))
> 
> (define my-type-operation
>   (get-ffi-obj "my_type_operation" lib
>     (_fun _my-type-ptr -> _int)))
> 
> (define a (my-type-maker)) ; a is a proper my-type struct
> (my-type-operation a)      ; throws above error

I don't see anything wrong here offhand, but it looks like some
context is missing.  Specifically, the question is what exactly does
`my-type-maker' return -- what's the contents of it's `ptr' field.
You can also just add a printf to the Scheme->C part of your
definition to see that it gets to run, and check out its input/output.


> I can't seem to find any examples in Planet or core collects that
> use define-cpointer-type in this way.  The closest thing I found was
> in the examples magick.ss in defining the _PixelIterator type, and
> it uses a ctype and not a cpointer.

The main difference is that ctype is the basic functionality, where
you translate some value to some other value that is "closer" to being
translatable to C.  For example, you build a _foo type as an extension
of _int by providing functions to translate from some value to an
integer and back.  The cpointer thing is similar, but deal with the
extra bookkeeping that is needed to deal with null pointers and
sub-pointers.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

From news at aspden.com  Thu Sep 25 15:14:01 2008
From: news at aspden.com (John Lawrence Aspden)
Date: Thu Mar 26 02:29:13 2009
Subject: [plt-scheme] Re: module constants and tracing
References:  <48DB8563.600@cs.utah.edu>
Message-ID: 

Hi, thanks for the tip, but actually one of the things I want to learn is
all the extra plt stuff. For instance I'm currently splitting my evaluator
into modules and putting contracts everywhere. Converting the SICP programs
to use mutable pairs is not difficult, although actually surprisingly
instructive.... 

It would seem odd to learn an old/(obsolete?) version of what seems to be a
thoroughly good tool with lots of nice libraries.

Is there some special reason why the module 'constants' can't be mutable? If
I put set! or trace statements for each function in the code itself so that
the compiler stops assuming they're constants then everything seems to
work.

If there's no way to do it from the IDE, can I hack DrScheme itself? I
compiled it from source. Is there a place where the compiler is invoked and
a command line can be changed?

Apologies if this has been covered before. I did do a considerable amount of
reading and experimentation before posting. Is there something I should be
googling for?

It seems odd that a useful feature for interactive development is disabled
in the IDE (only). Am I supposed to be using emacs/mzscheme instead? Surely
something like trace has value for student programmers too?

Cheers, John.



Chongkai Zhu wrote:

> If you are using DrScheme for SICP, use the pretty big language.
> 
> Chongkai
> 
> John Lawrence Aspden wrote:
>> Hi,
>>
>> Is there anyway to set (compile-enforce-module-constants #f) as the
>> default for DrScheme? I'd like to be able to trace function calls without
>> having to reload the program from scratch.
>>
>> I'm playing with the meta-circular evaluator from SICP, and wishing to be
>> modern I've started the program with #lang scheme, and dealt with the
>> mutable pairs issues. The program is in a file "bookevaluator.ss"
>>
>> I can run it by loading "bookevaluator.ss" into drscheme, and pressing
>> the run button. Then in my interactions window I can type:
>>
>>   
>>> (me "hi")
>>>     
>> "hi"
>>
>> (me calls the evaluator on an expression)
>>
>> It works fine, but if I want to trace functions, and I type:
>> (require (lib "trace.ss"))
>> (trace self-evaluating?)
>>
>> then I get the error:
>>
>> set!: cannot modify a constant: self-evaluating?
>>
>> I've found by trial and error that if I create a second
>> file "interactiveevaluator.ss" that contains:
>>
>> (define (go) (eval '(begin
>>                       (require scheme/enter)
>>                       (require (lib "trace.ss"))
>>                       (compile-enforce-module-constants #f)
>>                       (load "bookevaluator.ss")
>>                       (enter! "bookevaluator.ss"))))
>>
>> and then load that into a *different* window, and press the run button,
>> and then type (go), then I end up with a REPL where tracing works, and I
>> can say:
>>
>>   
>>> (me ((?(a b)(* a b)) 1 2))
>>>     
>> 2
>>
>>   
>>> (trace apply-primitive-procedure)
>>> (me ((?(a b)(* a b)) 1 2))
>>>     
>> |(apply-primitive-procedure (primitive #) (1 2))
>> |2
>> 2
>>
>> But it would be nice to be able to do this in my original window. Nothing
>> I try will make this happen at all. Am I missing something simple to get
>> this to work? I'm using 4.1.0.3-svn11sep2008 [3m].
>>
>> Cheers, John.
>>
>>
>>
>>
>>
>>
>>
>>
>>   
> 
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme

-- 
Contractor in Cambridge UK -- http://www.aspden.com


From samdphillips at gmail.com  Thu Sep 25 15:42:15 2008
From: samdphillips at gmail.com (Sam Phillips)
Date: Thu Mar 26 02:29:14 2009
Subject: [plt-scheme] FFI: problem with define-cpointer-type
In-Reply-To: <18651.57948.394898.736650@arabic.ccs.neu.edu>
References: <73b251310809251122j2fd16705k5c276a6558a64bd9@mail.gmail.com>
	<18651.57948.394898.736650@arabic.ccs.neu.edu>
Message-ID: <73b251310809251242tc4d9c94xb3c8ce4e5828bd44@mail.gmail.com>

On Thu, Sep 25, 2008 at 12:11 PM, Eli Barzilay  wrote:
> I don't see anything wrong here offhand, but it looks like some
> context is missing.  Specifically, the question is what exactly does
> `my-type-maker' return -- what's the contents of it's `ptr' field.
> You can also just add a printf to the Scheme->C part of your
> definition to see that it gets to run, and check out its input/output.

(my-type-maker) returns a my-type struct the ptr field is an
#.

I placed a printf in the scheme->C lambda checking on what kind of value
is being returned and it is a #.

I'm trying to come up with a more concrete simple test (that could
actually just be run), that should expose the behavior.  Just need to find
a simple libc func to use...

Cheers,
Sam

From jay.mccarthy at gmail.com  Thu Sep 25 15:43:33 2008
From: jay.mccarthy at gmail.com (Jay McCarthy)
Date: Thu Mar 26 02:29:14 2009
Subject: [plt-scheme] Re: Formlets in PLT
In-Reply-To: <200809251857.16139.michael@schuerig.de>
References: 
	
	
	<200809251857.16139.michael@schuerig.de>
Message-ID: 

On Thu, Sep 25, 2008 at 10:57 AM, Michael Schuerig  wrote:
> When I see X-exps and other approaches that abstract away from HTML,
> there's a concern that invariably comes to my mind: How do you work
> with web designers who only know HTML, CSS, and possibly JavaScript?
> The easiest answer, of course, is that you don't. Either you're doing
> the design yourself or coax the designer into writing X-exps (somewhat
> unlikely). Translating plain HTML/CSS pages to another, more programmer
> friendly notation, is rather tedious especially when the design is
> still evolving.

I'm working on a template language (a la Cheetah and Ruby Views) to
deal with this problem. I agree it is a problem. The solution will be
independent of and interoperable with formlets and other technologies.

Jay

-- 
Jay McCarthy 
Assistant Professor / Brigham Young University
http://jay.teammccarthy.org

"The glory of God is Intelligence" - D&C 93

From eli at barzilay.org  Thu Sep 25 15:59:54 2008
From: eli at barzilay.org (Eli Barzilay)
Date: Thu Mar 26 02:29:14 2009
Subject: [plt-scheme] FFI: problem with define-cpointer-type
In-Reply-To: <73b251310809251242tc4d9c94xb3c8ce4e5828bd44@mail.gmail.com>
References: <73b251310809251122j2fd16705k5c276a6558a64bd9@mail.gmail.com>
	<18651.57948.394898.736650@arabic.ccs.neu.edu>
	<73b251310809251242tc4d9c94xb3c8ce4e5828bd44@mail.gmail.com>
Message-ID: <18651.60858.519624.175329@arabic.ccs.neu.edu>

On Sep 25, Sam Phillips wrote:
> On Thu, Sep 25, 2008 at 12:11 PM, Eli Barzilay  wrote:
> > I don't see anything wrong here offhand, but it looks like some
> > context is missing.  Specifically, the question is what exactly does
> > `my-type-maker' return -- what's the contents of it's `ptr' field.
> > You can also just add a printf to the Scheme->C part of your
> > definition to see that it gets to run, and check out its input/output.
> 
> (my-type-maker) returns a my-type struct the ptr field is an
> #.

This sounds suspicious.  I'd expect it to return a `my-type' struct
with a plain cpointer.  Sounds like you have a `my-type' that is
holding a `my-type'.  You might want to add a test:

(define-cpointer-type _my-type-ptr #f
  (lambda (v)
    (if (my-type? v)
      (my-type-ptr v)  ; <<--- here
      (error "cannot coerce to _my-type-ptr")))
  ...)

that checks that the result is a plain pointer.


> I placed a printf in the scheme->C lambda checking on what kind of value
> is being returned and it is a #.
> 
> I'm trying to come up with a more concrete simple test (that could
> actually just be run), that should expose the behavior.  Just need to find
> a simple libc func to use...

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

From samdphillips at gmail.com  Thu Sep 25 18:02:46 2008
From: samdphillips at gmail.com (Sam Phillips)
Date: Thu Mar 26 02:29:15 2009
Subject: [plt-scheme] FFI: problem with define-cpointer-type
In-Reply-To: <73b251310809251242tc4d9c94xb3c8ce4e5828bd44@mail.gmail.com>
References: <73b251310809251122j2fd16705k5c276a6558a64bd9@mail.gmail.com>
	<18651.57948.394898.736650@arabic.ccs.neu.edu>
	<73b251310809251242tc4d9c94xb3c8ce4e5828bd44@mail.gmail.com>
Message-ID: <73b251310809251502k4768c890qb549dfc5a6319234@mail.gmail.com>

On Thu, Sep 25, 2008 at 12:42 PM, Sam Phillips  wrote:
> I'm trying to come up with a more concrete simple test (that could
> actually just be run), that should expose the behavior.  Just need to find
> a simple libc func to use...

Ok attached is a more concrete test.  It's some simple C code and some
ffi bindings that shows what I'm seeing.  Here's the output I get on
Linux with PLT4.1

$ mzscheme my-lib.ss
a is #
directly using ptr: 42
s->c got #
s->c returning #
Scheme->C: expects argument of type ; given #

Cheers,
Sam
-------------- next part --------------
A non-text attachment was scrubbed...
Name: my-lib.tar.gz
Type: application/x-gzip
Size: 859 bytes
Desc: not available
Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080925/2e11dfad/my-lib.tar.bin
From m.douglas.williams at gmail.com  Fri Sep 26 09:13:49 2008
From: m.douglas.williams at gmail.com (Doug Williams)
Date: Thu Mar 26 02:29:15 2009
Subject: [plt-scheme] PDF Versions of PLaneT Package Scribble Documentation
Message-ID: 

What is the best way to make a pdf version of the scribbled documentation
for a PLanet package?  Is there a good way to have the pdfs automatically
created and available for download?

Thanks,
Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080926/e346f230/attachment.html
From geoff at knauth.org  Fri Sep 26 11:32:27 2008
From: geoff at knauth.org (Geoffrey S. Knauth)
Date: Thu Mar 26 02:29:15 2009
Subject: [plt-scheme] [ANN] MrEd Designer 2.1.3
Message-ID: 

[ Peter deserves a public thank-you anyway; here it's because I sent  
single-recipient mail which bounced. ]

Thank you SO MUCH!!

I'm sorry not to have replied to your earlier messages last week.  I  
was buried with work.

I appreciate your tool and the latest improvements very much.

Best wishes,
Geoffrey

From noelwelsh at gmail.com  Fri Sep 26 14:28:13 2008
From: noelwelsh at gmail.com (Noel Welsh)
Date: Thu Mar 26 02:29:15 2009
Subject: [plt-scheme] PDF Versions of PLaneT Package Scribble Documentation
In-Reply-To: 
References: 
Message-ID: 

On Fri, Sep 26, 2008 at 2:13 PM, Doug Williams
 wrote:
> What is the best way to make a pdf version of the scribbled documentation
> for a PLanet package?

If you call the scribble executable with the --latex flag... well,
that name speaks for itself.  From this you can generate PDFs.  That's
the only way I know of to generate PDFs.

> Is there a good way to have the pdfs automatically created and available for download?

No PLaneT support that I know of.  I use Sake to automate this kind of
repetitive task.

N.

From rob.hunter at gmail.com  Fri Sep 26 19:42:31 2008
From: rob.hunter at gmail.com (Rob Hunter)
Date: Thu Mar 26 02:29:16 2009
Subject: [plt-scheme] "top bug closers" list -- updating?
Message-ID: 

I closed a bug last night
(http://planet.plt-scheme.org/trac/ticket/59), but don't see myself on
the list.  Is this a PLaneT bug?  I want recognition!! ;)

Thanks,
Rob

From robby at cs.uchicago.edu  Fri Sep 26 21:04:26 2008
From: robby at cs.uchicago.edu (Robby Findler)
Date: Thu Mar 26 02:29:16 2009
Subject: [plt-scheme] "top bug closers" list -- updating?
In-Reply-To: 
References: 
Message-ID: <932b2f1f0809261804v5563fc95wc7c5043238b1ba60@mail.gmail.com>

It is updating, but only contains the top 3. Get cracking! :)

Robby

On Fri, Sep 26, 2008 at 6:42 PM, Rob Hunter  wrote:
> I closed a bug last night
> (http://planet.plt-scheme.org/trac/ticket/59), but don't see myself on
> the list.  Is this a PLaneT bug?  I want recognition!! ;)
>
> Thanks,
> Rob
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
>

From eli at barzilay.org  Sat Sep 27 02:37:10 2008
From: eli at barzilay.org (Eli Barzilay)
Date: Thu Mar 26 02:29:16 2009
Subject: [plt-scheme] FFI: problem with define-cpointer-type
In-Reply-To: <73b251310809251502k4768c890qb549dfc5a6319234@mail.gmail.com>
References: <73b251310809251122j2fd16705k5c276a6558a64bd9@mail.gmail.com>
	<18651.57948.394898.736650@arabic.ccs.neu.edu>
	<73b251310809251242tc4d9c94xb3c8ce4e5828bd44@mail.gmail.com>
	<73b251310809251502k4768c890qb549dfc5a6319234@mail.gmail.com>
Message-ID: <18653.54422.547632.317172@arabic.ccs.neu.edu>

On Sep 25, Sam Phillips wrote:
> On Thu, Sep 25, 2008 at 12:42 PM, Sam Phillips  wrote:
> > I'm trying to come up with a more concrete simple test (that could
> > actually just be run), that should expose the behavior.  Just need to find
> > a simple libc func to use...
> 
> Ok attached is a more concrete test.  It's some simple C code and
> some ffi bindings that shows what I'm seeing.  [...]

Thanks -- that does seem like a bug, which I fixed in svn.

[The thing is that supplying translation functions to a cpointer type
is questionable, which is why it wasn't used so far.  In your case, I
think that using a plain ctype definition can make things simpler.]

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

From geofflane at gmail.com  Sat Sep 27 12:13:24 2008
From: geofflane at gmail.com (Geoffrey Lane)
Date: Thu Mar 26 02:29:16 2009
Subject: [plt-scheme] HTDP: 14.3.4 Retaining Values
Message-ID: <48CB4527-0C7F-4F32-9485-63587A70B9DE@gmail.com>

I hope this is ok, it's my first post to the group.

14.3.4 Basically counts the max depth of nested lists (what are called
Web Pages in the example)
'(foo) is 0 - no nesting
'(foo (bar)
        (baz)
        (quux (zorch))) is 3 for the maximum depth.

It's supposed to just take the Web Page (list of lists) - but I could
only figure it out when I passed an initial zero that I could then
increment in the proper condition (when I'm going down a level).
Am I missing something? The reason I ask, is there's a question in 15
that wants to do a similar thing.

Code I came up with:

;; depth: WP  ->  number
;; to count the depth of sub-pages that occur in a-wp
(define (depth a-wp n)
(count-depth a-wp 0))

;; count-depth: WP number -> number
;; count the depth of the sub-pages of a-wp
(define (count-depth a-wp n)
(cond
   [(empty? a-wp) n]
   [(symbol? (first a-wp)) (count-depth (rest a-wp) n)]
   [else (max (count-depth (first a-wp) (add1 n)) (count-depth (rest a-
wp) n))]))

Thanks for the help.

-- 
Geoff Lane 




From matthias at ccs.neu.edu  Sat Sep 27 12:27:18 2008
From: matthias at ccs.neu.edu (Matthias Felleisen)
Date: Thu Mar 26 02:29:16 2009
Subject: [plt-scheme] HTDP: 14.3.4 Retaining Values
In-Reply-To: <48CB4527-0C7F-4F32-9485-63587A70B9DE@gmail.com>
References: <48CB4527-0C7F-4F32-9485-63587A70B9DE@gmail.com>
Message-ID: <1FC690BE-ED4C-484C-95BF-6CC02A73BF36@ccs.neu.edu>


Yes, you are missing one of two key aspect of the design recipe for  
this stage of learning. Once you have designed the template for a  
function, or a bunch of functions for the same input type, you must  
ask and answer the following three questions:

1. What is the result for those cond lines that don't refer back to  
the original function? Typically, your examples tell you the answer  
here.

In your example: 0

2. What do the expressions in the other (complex) cases compute? Here  
a well-articulated purpose statement tells you almost instantaneously  
what you want.

In your example: (depth (first wp)) computes the depth of the first  
web page on the list, and (depth-list (rest wp)) computes the maximal  
depth of the remaining items on the list.

3. How do you have to combine the values of these expressions to get  
the result for the actually given input (wp on your example)? This is  
the most creative step and the focus of the entire design recipe  
approach. I have usually recommended to work through any of the  
examples you have developed first. One of my TAs has come up with an  
improvement of this suggestion: line up things in a table.

In your example:

wp:                '(foo (bar) (baz) (quix (zorch)))
desired result:     3
(first wp):        'foo
(depth (first wp)): 0  ;; your first example says so
(rest wp):          '((bar) (baz) (quix (zorch))
(depth-list (rest:  2

Make additional examples. What you will see is that you want (+ 1  
(max (depth (first wp)) (depth-list (rest wp))))

-- Matthias








On Sep 27, 2008, at 12:13 PM, Geoffrey Lane wrote:

> I hope this is ok, it's my first post to the group.
>
> 14.3.4 Basically counts the max depth of nested lists (what are called
> Web Pages in the example)
> '(foo) is 0 - no nesting
> '(foo (bar)
>        (baz)
>        (quux (zorch))) is 3 for the maximum depth.
>
> It's supposed to just take the Web Page (list of lists) - but I could
> only figure it out when I passed an initial zero that I could then
> increment in the proper condition (when I'm going down a level).
> Am I missing something? The reason I ask, is there's a question in 15
> that wants to do a similar thing.
>
> Code I came up with:
>
> ;; depth: WP  ->  number
> ;; to count the depth of sub-pages that occur in a-wp
> (define (depth a-wp n)
> (count-depth a-wp 0))
>
> ;; count-depth: WP number -> number
> ;; count the depth of the sub-pages of a-wp
> (define (count-depth a-wp n)
> (cond
>   [(empty? a-wp) n]
>   [(symbol? (first a-wp)) (count-depth (rest a-wp) n)]
>   [else (max (count-depth (first a-wp) (add1 n)) (count-depth (rest a-
> wp) n))]))
>
> Thanks for the help.
>
> -- 
> Geoff Lane 
>
>
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme


From matthias at ccs.neu.edu  Sat Sep 27 12:45:59 2008
From: matthias at ccs.neu.edu (Matthias Felleisen)
Date: Thu Mar 26 02:29:16 2009
Subject: [plt-scheme] HTDP: 14.3.4 Retaining Values
In-Reply-To: <48CB4527-0C7F-4F32-9485-63587A70B9DE@gmail.com>
References: <48CB4527-0C7F-4F32-9485-63587A70B9DE@gmail.com>
Message-ID: <4E042349-7735-46FD-8C36-D84E7DF28CC7@ccs.neu.edu>


P.S. The design that you came up with also has a name:

  structural recursion with accumulator

It is neither required nor really desirable in this particular  
situation.

As you move beyond Part III in HtDP (up to VI) you will encounter the  
following:

  structural recursion design
  design by abstraction, use of abstraction (aka "loops")
  generative recursion design (quick sort, merge sort vs insertion sort)
  structural and generative recursive design with accumulators

On exams and homeworks, I ask my students to identify which design  
strategy they chose to solve the problem to make them more  
conscientious problem solvers. Not everyone who solves a problem  
though can answer this question.

;; ---

Also note that HtDP (and HtDC) expose the Turing Tarpit Problem of  
Homework Assignments. Most people think that after introducing  
students to assignments, if, for/while, and arrays, the kids can more  
or less solve any problem. In principle they are correct because the  
language is equivalent to Turing machines.

In reality though, students don't know enough problem solving  
strategies to crack all problems nor do they understand enough about  
iterative refinement, the other theme in HtDP/C. So HtD is carefully  
designed so that all problems stated in section N can be solved with  
nothing but the problem solving strategies from sections 1 .. N and  
usually in a direct and immediate manner. Of course, the more you get  
to know problem solving strategies the less "immediate and obvious"  
things become because you can challenge students with more complex  
problems.

;; ---

If you also move beyond Part VI, you will get

  structural/generative recursive design with state manipulation

This is difficult, and I have started pushing this part into the HtDC  
part of the first year because I want more time for basic strategies  
to sink in.








On Sep 27, 2008, at 12:13 PM, Geoffrey Lane wrote:

> I hope this is ok, it's my first post to the group.
>
> 14.3.4 Basically counts the max depth of nested lists (what are called
> Web Pages in the example)
> '(foo) is 0 - no nesting
> '(foo (bar)
>        (baz)
>        (quux (zorch))) is 3 for the maximum depth.
>
> It's supposed to just take the Web Page (list of lists) - but I could
> only figure it out when I passed an initial zero that I could then
> increment in the proper condition (when I'm going down a level).
> Am I missing something? The reason I ask, is there's a question in 15
> that wants to do a similar thing.
>
> Code I came up with:
>
> ;; depth: WP  ->  number
> ;; to count the depth of sub-pages that occur in a-wp
> (define (depth a-wp n)
> (count-depth a-wp 0))
>
> ;; count-depth: WP number -> number
> ;; count the depth of the sub-pages of a-wp
> (define (count-depth a-wp n)
> (cond
>   [(empty? a-wp) n]
>   [(symbol? (first a-wp)) (count-depth (rest a-wp) n)]
>   [else (max (count-depth (first a-wp) (add1 n)) (count-depth (rest a-
> wp) n))]))
>
> Thanks for the help.
>
> -- 
> Geoff Lane 
>
>
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme


From geb_a at yahoo.com  Sat Sep 27 16:01:13 2008
From: geb_a at yahoo.com (geb a)
Date: Thu Mar 26 02:29:17 2009
Subject: [plt-scheme] microphone
In-Reply-To: <20080925160031.2A364402BF@qua.cs.brown.edu>
Message-ID: <265896.6660.qm@web50904.mail.re2.yahoo.com>

Have you looked at supercollider with rsc?  rsc is a scheme interface to supercollider that was written by Rohan Drape.  It is well written and amazing in scope and depth.  You can do anything with a sound but it is industrial strength.


      

From e.jelly at gmail.com  Sat Sep 27 17:50:18 2008
From: e.jelly at gmail.com (e.jel 2.7)
Date: Thu Mar 26 02:29:17 2009
Subject: [plt-scheme] Using DrScheme Debugger
Message-ID: 

Hi everyone,

I'm new to Scheme and just start using DrScheme as the IDE. I still
have trouble using the debug feature of DrScheme.

When run normally, I click on the Run button and then enter some
expression such as (fact 2) in the interaction window and it will
return the result to me. However, when I try to debug by click on the
debug button, and then enter the same expression in the interaction
window, I got the following error message:

send: target is not an object: #f for method: get-tab

I'm sure that I must do something fundamentally wrong but I could not
figure it out. I hope you could tell me what it is or what is the
right way to use the debug function.

Thank you in advance.
ejel

From geofflane at gmail.com  Sat Sep 27 19:08:47 2008
From: geofflane at gmail.com (Geoffrey Lane)
Date: Thu Mar 26 02:29:17 2009
Subject: [plt-scheme] HTDP: 14.3.4 Retaining Values
In-Reply-To: <1FC690BE-ED4C-484C-95BF-6CC02A73BF36@ccs.neu.edu>
References: <48CB4527-0C7F-4F32-9485-63587A70B9DE@gmail.com>
	<1FC690BE-ED4C-484C-95BF-6CC02A73BF36@ccs.neu.edu>
Message-ID: 


On Sep 27, 2008, at 11:27 AM, Matthias Felleisen wrote:

>
> Yes, you are missing one of two key aspect of the design recipe for  
> this stage of learning. Once you have designed the template for a  
> function, or a bunch of functions for the same input type, you must  
> ask and answer the following three questions:
>
> 1. What is the result for those cond lines that don't refer back to  
> the original function? Typically, your examples tell you the answer  
> here.
>
> In your example: 0
>
> 2. What do the expressions in the other (complex) cases compute?  
> Here a well-articulated purpose statement tells you almost  
> instantaneously what you want.
>
> In your example: (depth (first wp)) computes the depth of the first  
> web page on the list, and (depth-list (rest wp)) computes the  
> maximal depth of the remaining items on the list.
>
> 3. How do you have to combine the values of these expressions to get  
> the result for the actually given input (wp on your example)? This  
> is the most creative step and the focus of the entire design recipe  
> approach. I have usually recommended to work through any of the  
> examples you have developed first. One of my TAs has come up with an  
> improvement of this suggestion: line up things in a table.
>
> In your example:
>
> wp:                '(foo (bar) (baz) (quix (zorch)))
> desired result:     3
> (first wp):        'foo
> (depth (first wp)): 0  ;; your first example says so
> (rest wp):          '((bar) (baz) (quix (zorch))
> (depth-list (rest:  2
>
> Make additional examples. What you will see is that you want (+ 1  
> (max (depth (first wp)) (depth-list (rest wp))))

I ended up with something slightly different - but it works:

(max (+ 1 (depth (first a-wp)))
                     (depth (rest a-wp)))

My current understanding is that (+ 1 (max  (depth ... ends up  
counting all of the sub-lists in the top-level list.
(which is the same as if no max was used)

While (max (+ 1 (depth finds the  maximum depth of any sub-list -  
which is what I think I was looking for.

Thanks for the explanation though, it put me back on the right track  
(until/unless you tell me this is wrong somehow :-)).

-- 
Geoff Lane 




From matthias at ccs.neu.edu  Sat Sep 27 19:43:29 2008
From: matthias at ccs.neu.edu (Matthias Felleisen)
Date: Thu Mar 26 02:29:17 2009
Subject: [plt-scheme] HTDP: 14.3.4 Retaining Values
In-Reply-To: 
References: <48CB4527-0C7F-4F32-9485-63587A70B9DE@gmail.com>
	<1FC690BE-ED4C-484C-95BF-6CC02A73BF36@ccs.neu.edu>
	
Message-ID: 


On Sep 27, 2008, at 7:08 PM, Geoffrey Lane wrote:

> (max (+ 1 (depth (first a-wp)))
>                     (depth (rest a-wp)))

Yes, I made a mistake :-) 

From grettke at acm.org  Sun Sep 28 09:50:17 2008
From: grettke at acm.org (Grant Rettke)
Date: Thu Mar 26 02:29:17 2009
Subject: [plt-scheme] Using DrScheme Debugger
In-Reply-To: 
References: 
Message-ID: <756daca50809280650p36fbc71fgf63bfdf3cb20a70b@mail.gmail.com>

Hi Ejel,

May you please post the code you are trying to debug?

Best wishes,

Grant

From e.jelly at gmail.com  Sun Sep 28 12:49:28 2008
From: e.jelly at gmail.com (e.jel 2.7)
Date: Thu Mar 26 02:29:17 2009
Subject: [plt-scheme] Using DrScheme Debugger
In-Reply-To: <756daca50809280650p36fbc71fgf63bfdf3cb20a70b@mail.gmail.com>
References: 
	<756daca50809280650p36fbc71fgf63bfdf3cb20a70b@mail.gmail.com>
Message-ID: 

Well, the error when running the debugger occurs on every / any code
that I wrote. The example I used to demonstrate this error is the
basic factorial function in definition window:

(define (fact n)
  (if (= n 1)
      1
      (* n (fact (- n 1)))))

I run the debugger by click on the debug button, and type in the
following snippet into the interaction window:

(fact 2)

And the error message:

send: target is not an object: #f for method: get-tab

is shown. Note that I'm using Essentials of Programming Languages (3rd
edition) as the language. Though running the code in normal "run" mode
does not pose this error.

According to Greg's email, it seems that this is a known bug which has
just been fixed?

ejel

On Sun, Sep 28, 2008 at 9:50 AM, Grant Rettke  wrote:
> Hi Ejel,
>
> May you please post the code you are trying to debug?
>
> Best wishes,
>
> Grant
>

From gregory.woodhouse at gmail.com  Sun Sep 28 13:52:04 2008
From: gregory.woodhouse at gmail.com (Woodhouse Gregory)
Date: Thu Mar 26 02:29:18 2009
Subject: [plt-scheme] Using DrScheme Debugger
In-Reply-To: 
References: 
	<756daca50809280650p36fbc71fgf63bfdf3cb20a70b@mail.gmail.com>
	
Message-ID: 

How are you invoking the debugger and what is the version. I  
typically put a call like (fact 6) in the definitions window and then  
click debug rather than run. I have no problems in 4.1.0.3.


"If everything seems under control,
you're just not going fast enough."
-- Mario Andretti

http://www.gwoodhouse.com
http://GregWoodhouse.ImageKind.com




On Sep 28, 2008, at 9:49 AM, e.jel 2.7 wrote:

> (define (fact n)
>   (if (= n 1)
>       1
>       (* n (fact (- n 1)))))

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080928/7e11cfc5/attachment.htm
From e.jelly at gmail.com  Sun Sep 28 14:13:51 2008
From: e.jelly at gmail.com (e.jel 2.7)
Date: Thu Mar 26 02:29:18 2009
Subject: [plt-scheme] Using DrScheme Debugger
In-Reply-To: 
References: 
	<756daca50809280650p36fbc71fgf63bfdf3cb20a70b@mail.gmail.com>
	
	
Message-ID: 

If I put (fact 6) in  the definitions window, it would run fine. The
error only occurs when I put (fact 6) in the interaction window.
However, isn't interaction window is the expected place to enter this
kind of expression to be evaluated?



On Sun, Sep 28, 2008 at 1:52 PM, Woodhouse Gregory
 wrote:
> How are you invoking the debugger and what is the version. I typically put a
> call like (fact 6) in the definitions window and then click debug rather
> than run. I have no problems in 4.1.0.3.
>
>
> "If everything seems under control,
> you're just not going fast enough."
> -- Mario Andretti
> http://www.gwoodhouse.com
> http://GregWoodhouse.ImageKind.com
>
>
>
> On Sep 28, 2008, at 9:49 AM, e.jel 2.7 wrote:
>
> (define (fact n)
>
>   (if (= n 1)
>
>       1
>
>       (* n (fact (- n 1)))))
>

From s.degabrielle at cs.ucl.ac.uk  Mon Sep 29 05:16:36 2008
From: s.degabrielle at cs.ucl.ac.uk (Stephen De Gabrielle)
Date: Thu Mar 26 02:29:18 2009
Subject: [plt-scheme] Find
Message-ID: <595b9ab20809290216t39c7baeeof60ec0fcbdb3c2b6@mail.gmail.com>

Ha, 'real programmers count from zero'
I just realised find enumerates matches from zero :)

-- 
Sent from Google Mail for mobile | mobile.google.com

Cheers,

Stephen

--
Stephen De Gabrielle
s.degabrielle@cs.ucl.ac.uk
Telephone +44 (0)20 7679 0693 (x30693)
Mobile                  079 851 890 45
Project: Making Sense of Information (MaSI)
Work:http://www.uclic.ucl.ac.uk/annb/MaSI.html
Home:http://www.degabrielle.name/stephen


UCL Interaction Centre
MPEB 8th floor
University College London
Gower Street
London WC1E 6BT

From geoff at knauth.org  Mon Sep 29 08:10:43 2008
From: geoff at knauth.org (Geoffrey S. Knauth)
Date: Thu Mar 26 02:29:19 2009
Subject: [plt-scheme] Using DrScheme Debugger
In-Reply-To: 
References: 
	<756daca50809280650p36fbc71fgf63bfdf3cb20a70b@mail.gmail.com>
	
Message-ID: <96D9FC63-3246-45E5-9035-A4A31FF3F16A@knauth.org>

On Sep 28, 2008, at 12:49, e.jel 2.7 wrote:
> send: target is not an object: #f for method: get-tab

I saw something like that the other day, but I was developing a GUI in  
DrScheme, so I added:

#lang scheme/gui

to the top of my file and the error went away.  It sounds like you're  
doing something different and you're in EOPL3, but maybe this is a  
clue.  I last updated from svn a couple of weeks ago.

From geoff at knauth.org  Mon Sep 29 07:48:57 2008
From: geoff at knauth.org (Geoffrey S. Knauth)
Date: Thu Mar 26 02:29:19 2009
Subject: [plt-scheme] max width of text-field?
Message-ID: 

Is there a way to set the max width of a text-field?

From fredm at cs.uml.edu  Sun Sep 28 22:25:45 2008
From: fredm at cs.uml.edu (Fred G. Martin)
Date: Thu Mar 26 02:29:19 2009
Subject: [plt-scheme] Henderson picture language in version 4.x?
Message-ID: 

Hi everyone,

I am trying to run a version of the Henderson picture language stuff
for my students.  It works fine in PLT 3.72 with Textual (MzScheme,
includes R5RS).  The images display in the listener.

In PLT 4.1, I can load the code when choosing Full Swindle, but
instead of images in the listener, I get a lovely "image-snip"
message:

> (paint (load-painter "einstein"))
#

Can anyone point me in the right direction?  The code I am running
from my colleague Holly Yanco's last version, problem set 4 at
http://www.cs.uml.edu/~holly/91.301/ .

Thanks all.

Fred


From robby at cs.uchicago.edu  Mon Sep 29 15:19:48 2008
From: robby at cs.uchicago.edu (Robby Findler)
Date: Thu Mar 26 02:29:19 2009
Subject: [plt-scheme] Henderson picture language in version 4.x?
In-Reply-To: 
References: 
Message-ID: <932b2f1f0809291219m5d1760easc48599e64976ec83@mail.gmail.com>

Just a quick thing to try: how about pretty big instead of swindle?

Robby

On Sun, Sep 28, 2008 at 9:25 PM, Fred G. Martin  wrote:
> Hi everyone,
>
> I am trying to run a version of the Henderson picture language stuff
> for my students.  It works fine in PLT 3.72 with Textual (MzScheme,
> includes R5RS).  The images display in the listener.
>
> In PLT 4.1, I can load the code when choosing Full Swindle, but
> instead of images in the listener, I get a lovely "image-snip"
> message:
>
>> (paint (load-painter "einstein"))
> #
>
> Can anyone point me in the right direction?  The code I am running
> from my colleague Holly Yanco's last version, problem set 4 at
> http://www.cs.uml.edu/~holly/91.301/ .
>
> Thanks all.
>
> Fred
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
>

From mflatt at cs.utah.edu  Mon Sep 29 15:40:34 2008
From: mflatt at cs.utah.edu (Matthew Flatt)
Date: Thu Mar 26 02:29:19 2009
Subject: [plt-scheme] max width of text-field?
In-Reply-To: 
References: 
Message-ID: <20080929194034.E7DDD6500A9@mail-svr1.cs.utah.edu>

At Mon, 29 Sep 2008 07:48:57 -0400, "Geoffrey S. Knauth" wrote:
> Is there a way to set the max width of a text-field?

No, not without creating a new kind of panel that arranges its children
taking into account a maximum for each.

(In other words, there's no notion of a "maximum size" built into the
existing layout system --- only "minimum size" and "stretchability".)


Matthew


From jensaxel at soegaard.net  Mon Sep 29 15:38:17 2008
From: jensaxel at soegaard.net (Jens Axel Soegaard)
Date: Thu Mar 26 02:29:19 2009
Subject: [plt-scheme] Henderson picture language in version 4.x?
In-Reply-To: 
References: 
Message-ID: <48E12EA9.2000803@soegaard.net>

Fred G. Martin wrote:
> I am trying to run a version of the Henderson picture language stuff
> for my students.  It works fine in PLT 3.72 with Textual (MzScheme,
> includes R5RS).  The images display in the listener.
>
> In PLT 4.1, I can load the code when choosing Full Swindle, but
> instead of images in the listener, I get a lovely "image-snip"
> message:
>
>   
>> (paint (load-painter "einstein"))
>>     
> #
>
> Can anyone point me in the right direction?  The code I am running
> from my colleague Holly Yanco's last version, problem set 4 at
> http://www.cs.uml.edu/~holly/91.301/ .
>   
Just curious, are you using features not present in the SICP package 
available on PLaneT?
(I think they share most of the code)

The following will display Einstein (use the module langauge).

#lang scheme
(require (planet "sicp.ss" ("soegaard" "sicp.plt" 2 0)))
(paint (load-painter "einstein"))

The einstein painter happens to be builtin, it was defined like
this (more or less).

(define einstein (load-painter "einstein.gif"))

See the documentation here:

http://planet.plt-scheme.org/package-source/soegaard/sicp.plt/2/0/planet-docs/sicp-manual/index.html


-- 
Jens Axel S?gaard


From robby at cs.uchicago.edu  Mon Sep 29 16:24:36 2008
From: robby at cs.uchicago.edu (Robby Findler)
Date: Thu Mar 26 02:29:20 2009
Subject: [plt-scheme] max width of text-field?
In-Reply-To: <20080929194034.E7DDD6500A9@mail-svr1.cs.utah.edu>
References: 
	<20080929194034.E7DDD6500A9@mail-svr1.cs.utah.edu>
Message-ID: <932b2f1f0809291324o11a86d16i7e9833b3b16e31bc@mail.gmail.com>

On Mon, Sep 29, 2008 at 2:40 PM, Matthew Flatt  wrote:
> At Mon, 29 Sep 2008 07:48:57 -0400, "Geoffrey S. Knauth" wrote:
>> Is there a way to set the max width of a text-field?
>
> No, not without creating a new kind of panel that arranges its children
> taking into account a maximum for each.
>
> (In other words, there's no notion of a "maximum size" built into the
> existing layout system --- only "minimum size" and "stretchability".)

And just in case it wasn't clear, the best approximation we have to a
maximum width is to set the minimum width to something and then turn
off the stretchability.

Robby

From fredm at cs.uml.edu  Mon Sep 29 17:05:06 2008
From: fredm at cs.uml.edu (Fred G. Martin)
Date: Thu Mar 26 02:29:20 2009
Subject: [plt-scheme] Henderson picture language in version 4.x?
In-Reply-To: <48E12EA9.2000803@soegaard.net>
References: 
	<48E12EA9.2000803@soegaard.net>
Message-ID: <72ef860f0809291405o58ae0778jb7e8c3206104c17a@mail.gmail.com>

Jens, I have it working now, thanks.
I think I inherited a modified copy of code when it is far simpler to run
the official distro (now that I understand how to do so :-).

Can I ask, what is important about using "Module"?

Thanks for your prompt help.

Fred


On Mon, Sep 29, 2008 at 3:38 PM, Jens Axel Soegaard
wrote:

> Fred G. Martin wrote:
>
>> I am trying to run a version of the Henderson picture language stuff
>> for my students.  It works fine in PLT 3.72 with Textual (MzScheme,
>> includes R5RS).  The images display in the listener.
>>
>> In PLT 4.1, I can load the code when choosing Full Swindle, but
>> instead of images in the listener, I get a lovely "image-snip"
>> message:
>>
>>
>>
>>> (paint (load-painter "einstein"))
>>>
>>>
>> #
>>
>> Can anyone point me in the right direction?  The code I am running
>> from my colleague Holly Yanco's last version, problem set 4 at
>> http://www.cs.uml.edu/~holly/91.301/ .
>>
>>
> Just curious, are you using features not present in the SICP package
> available on PLaneT?
> (I think they share most of the code)
>
> The following will display Einstein (use the module langauge).
>
> #lang scheme
> (require (planet "sicp.ss" ("soegaard" "sicp.plt" 2 0)))
> (paint (load-painter "einstein"))
>
> The einstein painter happens to be builtin, it was defined like
> this (more or less).
>
> (define einstein (load-painter "einstein.gif"))
>
> See the documentation here:
>
>
> http://planet.plt-scheme.org/package-source/soegaard/sicp.plt/2/0/planet-docs/sicp-manual/index.html
>
>
> --
> Jens Axel S?gaard
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080929/239a18ab/attachment.html
From jensaxel at soegaard.net  Mon Sep 29 17:13:13 2008
From: jensaxel at soegaard.net (Jens Axel Soegaard)
Date: Thu Mar 26 02:29:21 2009
Subject: [plt-scheme] Henderson picture language in version 4.x?
In-Reply-To: <72ef860f0809291405o58ae0778jb7e8c3206104c17a@mail.gmail.com>
References: 	<48E12EA9.2000803@soegaard.net>
	<72ef860f0809291405o58ae0778jb7e8c3206104c17a@mail.gmail.com>
Message-ID: <48E144E9.1010307@soegaard.net>

Hi Fred,
> Jens, I have it working now, thanks.

Great.
> I think I inherited a modified copy of code when it is far simpler to 
> run the official distro (now that I understand how to do so :-).
>
> Can I ask, what is important about using "Module"?
When using "Module" as language the first line (in this case  #lang 
scheme) is
used to determine the language used. There is nothing wrong with using the
Pretty Big Language (and dropping the line #lang scheme), but since most 
programs
grow it is usually more convenient to use modules from the beginning.
Whether this is relevant for teaching purposes is another matter.

-- 
Jens Axel S?gaard


From goetter at mazama.net  Mon Sep 29 21:02:17 2008
From: goetter at mazama.net (Ben Goetter)
Date: Thu Mar 26 02:29:21 2009
Subject: [plt-scheme] Extensibility of MrEd
In-Reply-To: <20080909170301.8AB6E65009D@mail-svr1.cs.utah.edu>
References: <48960316.8060809@mazama.net>		<4896184E.5070903@mazama.net>
	<20080804121107.8C4B16500AD@mail-svr1.cs.utah.edu>		<48C6A882.3060102@mazama.net>
	<20080909170301.8AB6E65009D@mail-svr1.cs.utah.edu>
Message-ID: <48E17A99.3060706@mazama.net>

Matthew Flatt wrote:
> At the Scheme level, there's a `get-eventspace' method on
> `top-level-window<%>', so you should have access to the relevant
> eventspace whenever you have access to a frame's HWND.
>
> Meanwhile, `mred/private/kernel' exports `middle-queue-key'. Its value
> is recognized specially by `queue-callback' when supplied as the
> "boolean" second argument, and it causes a callback to be added with
> the same priority as a GUI event. (Of course, the module
> `mred/private/kernel' is meant to be private to MrEd, but if you have
> enough privileges to load an extension, then it's probably fine also to
> access that module.)
>   
Following this advice and also looting the contents of 
mred/private/helper, I came up with

(require mred (prefix-in wx: mred/private/kernel)
(define (queue-window-callback w cb)
 (parameterize ((current-eventspace (send (send w get-top-level-window) 
get-eventspace)))
  (queue-callback cb wx:middle-queue-key)))

which seems to work when called like so

(define (foo-callback hwnd x y)
 (let ((w0 (assq hwnd *window-set*))) ;; alist of hwnd, canvas% pairs
  (unless w0 (error ...))
  (let ((w (cdr w0)))
    (queue-window-callback w (lambda () (send w on-foo (list '(foo) x 
y))))))
  #t)

This foo-callback proc is passed as a (_fun _uint _uint _uint -> _bool) 
FFI callback to a stub C DLL which does little more than subclass a 
canvas with

WNDPROC OldWndProc = 0; // set to the original wndproc of the canvas%
typedef BOOL (*SCHEME_CALLBACK)(HWND, UINT, UINT);
SCHEME_CALLBACK Dispatch = 0; // set via FFI to foo-callback
LRESULT CALLBACK NewWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM 
lParam)
{ if (uMsg == WM_RBUTTONDOWN) // easy enough to catch
  { Dispatch(hwnd, LOWORD(lParam), HIWORD(lParam)); return 0; }
  return CallWindowProc(OldWndProc, hwnd, uMsg, wParam, lParam); }

This all works just fine under mred.exe. Continuing with this simple 
example, a canvas in my application window is subclassed to catch right 
mouse downs, and does some boring stuff when it's dispatched an on-foo 
with the coordinates of that right mouse down.  No big deal.  Run under 
the drscheme debugger, however, my program faults frequently in 
MrEdDispatchEvent after catching a few right-mouse-downs, the debugger 
displaying a lot of suspiciously zeroed registers.  You did warn me once

> Beware that there's a bad interaction between PLT Scheme threads and
> Windows: a Scheme-level thread swap cannot be allowed while handling a
> Windows message. The solution is usually to handle a message by just
> queuing a callback in the eventspace, and then return to Windows
> immediately; that works when you don't need to compute any particular
> return value for the message.
>   
Am I doing something here that would trigger a thread swap under the 
debugger?  Perhaps the transition through the callback into Scheme?  Or 
is my implementation of queue-window-callback toxic?

Thanks,
Ben


From emailaliclark at gmail.com  Mon Sep 29 21:21:31 2008
From: emailaliclark at gmail.com (Ali)
Date: Thu Mar 26 02:29:21 2009
Subject: [plt-scheme] How to use a custom procedure as read?
Message-ID: 

Hi,
I'm sorry to ask this question, since it has been asked before, but I could
not make any sense of it at all.
My query is fairly simple, and after an hour or two of searching and trial
and error, I hope I can get the answer an easier way here!

Looked in the reference, this seems to be what I want, but all I'm not sure
exactly how to use it.
http://docs.plt-scheme.org/syntax/reader-helpers.html#(part._module-reader)

Read this and seemed to make sense, but not sure how to apply it to my
problem.
http://www.htus.org/Book/Staging/how-to-use-modules/

I believe the answer is in here, but again, I haven't been able to get it
working.
http://groups.google.com/group/plt-scheme/browse_thread/thread/8aabfc15e0a392df/8a67d42dfcdadcae?lnk=gst&q=reader#8a67d42dfcdadcae

Problem:
I've got a Scheme procedure which I would like to temporarily use as the
read procedure, eg.

(swap-the-reader-in)
... code using custom reader ...
(swap-the-reader-out)
... normal reader again ...

My MzScheme version is 372. I'd be really grateful for an example of how to
temporarily use a custom procedure as the reader function.
Thanks, Al
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080930/25c37310/attachment.htm
From czhu at cs.utah.edu  Mon Sep 29 21:30:41 2008
From: czhu at cs.utah.edu (Chongkai Zhu)
Date: Thu Mar 26 02:29:21 2009
Subject: [plt-scheme] How to use a custom procedure as read?
In-Reply-To: 
References: 
Message-ID: <48E18141.9050309@cs.utah.edu>

Ali wrote:
> Hi,
> I'm sorry to ask this question, since it has been asked before, but I 
> could not make any sense of it at all.
> My query is fairly simple, and after an hour or two of searching and 
> trial and error, I hope I can get the answer an easier way here!
>
> Looked in the reference, this seems to be what I want, but all I'm not 
> sure exactly how to use it.
> http://docs.plt-scheme.org/syntax/reader-helpers.html#(part._module-reader) 
> 
>
> Read this and seemed to make sense, but not sure how to apply it to my 
> problem.
> http://www.htus.org/Book/Staging/how-to-use-modules/
>
> I believe the answer is in here, but again, I haven't been able to get 
> it working.
> http://groups.google.com/group/plt-scheme/browse_thread/thread/8aabfc15e0a392df/8a67d42dfcdadcae?lnk=gst&q=reader#8a67d42dfcdadcae 
> 
>
> Problem:
> I've got a Scheme procedure which I would like to temporarily use as 
> the read procedure, eg.
>
> (swap-the-reader-in)
> ... code using custom reader ...
> (swap-the-reader-out)
> ... normal reader again ...
>
> My MzScheme version is 372. I'd be really grateful for an example of 
> how to temporarily use a custom procedure as the reader function.
> Thanks, Al


You should put `code using custom reader' in a separate module that use 
your own reader, and rest code in other (normal) modules. Hope you can 
figure out the rest on your own by reading the docs.

Chongkai

From emailaliclark at gmail.com  Mon Sep 29 22:45:14 2008
From: emailaliclark at gmail.com (Ali)
Date: Thu Mar 26 02:29:22 2009
Subject: [plt-scheme] Re: How to use a custom procedure as read?
In-Reply-To: <48E18141.9050309@cs.utah.edu>
References:  
	<48E18141.9050309@cs.utah.edu>
Message-ID: 



On Sep 30, 2:30?am, Chongkai Zhu  wrote:
> Ali wrote:
> > Hi,
> > I'm sorry to ask this question, since it has been asked before, but I
> > could not make any sense of it at all.
> > My query is fairly simple, and after an hour or two of searching and
> > trial and error, I hope I can get the answer an easier way here!
>
> > Looked in the reference, this seems to be what I want, but all I'm not
> > sure exactly how to use it.
> >http://docs.plt-scheme.org/syntax/reader-helpers.html#(part._module-r...)
> > 
>
> > Read this and seemed to make sense, but not sure how to apply it to my
> > problem.
> >http://www.htus.org/Book/Staging/how-to-use-modules/
>
> > I believe the answer is in here, but again, I haven't been able to get
> > it working.
> >http://groups.google.com/group/plt-scheme/browse_thread/thread/8aabfc...
> > 
>
> > Problem:
> > I've got a Scheme procedure which I would like to temporarily use as
> > the read procedure, eg.
>
> > (swap-the-reader-in)
> > ... code using custom reader ...
> > (swap-the-reader-out)
> > ... normal reader again ...
>
> > My MzScheme version is 372. I'd be really grateful for an example of
> > how to temporarily use a custom procedure as the reader function.
> > Thanks, Al
>
> You should put `code using custom reader' in a separate module that use
> your own reader, and rest code in other (normal) modules. Hope you can
> figure out the rest on your own by reading the docs.
>
> Chongkai
> _________________________________________________
> ? For list-related administrative tasks:
> ?http://list.cs.brown.edu/mailman/listinfo/plt-scheme

Thanks. Do I have to write the code in a module? I'd much rather be
able to swap in and out of the custom reader mode as with above.

I'm sure that I can figure it out from the docs, but couldn't say how
long it will take, and I really don't enjoy spending hours upon hours
on a seemingly small problem.

Now I know its equally annoying for you to receive an email from a
mere newb who just_doesn't_get_it, but in my humble opinion there is
one too few simple examples of how to do this in MzScheme and it would
be really really nice if someone can post it.

Heck, if someone equally as dumb as me has the same problem later on,
it will already have a bow on it with this thread.

Can I re-iterate: I have looked for the answer. The problem is that my
attempts have led to excitement when I thought I had it, and lots and
lots of despair after each fail.

All I need is a tiny code example of how to change the reader to a
procedure called "custom-reader".

(set! read custom-reader)

was my first thought, but didn't work. Really hope someone can help on
this while I still have hair.

From czhu at cs.utah.edu  Mon Sep 29 23:18:20 2008
From: czhu at cs.utah.edu (Chongkai Zhu)
Date: Thu Mar 26 02:29:22 2009
Subject: [plt-scheme] Re: How to use a custom procedure as read?
In-Reply-To: 
References: 
	<48E18141.9050309@cs.utah.edu>
	
Message-ID: <48E19A7C.30103@cs.utah.edu>

Ali wrote:
> On Sep 30, 2:30 am, Chongkai Zhu  wrote:
>   
>> Ali wrote:
>>     
>>> Hi,
>>> I'm sorry to ask this question, since it has been asked before, but I
>>> could not make any sense of it at all.
>>> My query is fairly simple, and after an hour or two of searching and
>>> trial and error, I hope I can get the answer an easier way here!
>>>       
>>> Looked in the reference, this seems to be what I want, but all I'm not
>>> sure exactly how to use it.
>>> http://docs.plt-scheme.org/syntax/reader-helpers.html#(part._module-r...)
>>> 
>>>       
>>> Read this and seemed to make sense, but not sure how to apply it to my
>>> problem.
>>> http://www.htus.org/Book/Staging/how-to-use-modules/
>>>       
>>> I believe the answer is in here, but again, I haven't been able to get
>>> it working.
>>> http://groups.google.com/group/plt-scheme/browse_thread/thread/8aabfc...
>>> 
>>>       
>>> Problem:
>>> I've got a Scheme procedure which I would like to temporarily use as
>>> the read procedure, eg.
>>>       
>>> (swap-the-reader-in)
>>> ... code using custom reader ...
>>> (swap-the-reader-out)
>>> ... normal reader again ...
>>>       
>>> My MzScheme version is 372. I'd be really grateful for an example of
>>> how to temporarily use a custom procedure as the reader function.
>>> Thanks, Al
>>>       
>> You should put `code using custom reader' in a separate module that use
>> your own reader, and rest code in other (normal) modules. Hope you can
>> figure out the rest on your own by reading the docs.
>>
>> Chongkai
>> _________________________________________________
>>   For list-related administrative tasks:
>>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>>     
>
> Thanks. Do I have to write the code in a module? I'd much rather be
> able to swap in and out of the custom reader mode as with above.
>
>   

Yes, you do have to write the code in a module. Then you can set the 
reader for that module.

> I'm sure that I can figure it out from the docs, but couldn't say how
> long it will take, and I really don't enjoy spending hours upon hours
> on a seemingly small problem.
>
> Now I know its equally annoying for you to receive an email from a
> mere newb who just_doesn't_get_it, but in my humble opinion there is
> one too few simple examples of how to do this in MzScheme and it would
> be really really nice if someone can post it.
>
> Heck, if someone equally as dumb as me has the same problem later on,
> it will already have a bow on it with this thread.
>
> Can I re-iterate: I have looked for the answer. The problem is that my
> attempts have led to excitement when I thought I had it, and lots and
> lots of despair after each fail.
>
> All I need is a tiny code example of how to change the reader to a
> procedure called "custom-reader".
>
> (set! read custom-reader)
>
> was my first thought, but didn't work. Really hope someone can help on
> this while I still have hair.
>   

No, it doesn't work this way.

Chongkai


From goetter at mazama.net  Tue Sep 30 01:17:09 2008
From: goetter at mazama.net (Ben Goetter)
Date: Thu Mar 26 02:29:22 2009
Subject: [plt-scheme] Extensibility of MrEd
In-Reply-To: <48E17A99.3060706@mazama.net>
References: <48960316.8060809@mazama.net>		<4896184E.5070903@mazama.net>	<20080804121107.8C4B16500AD@mail-svr1.cs.utah.edu>		<48C6A882.3060102@mazama.net>	<20080909170301.8AB6E65009D@mail-svr1.cs.utah.edu>
	<48E17A99.3060706@mazama.net>
Message-ID: <48E1B655.9090906@mazama.net>

I wrote:
> LRESULT CALLBACK NewWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, 
> LPARAM lParam)
> { if (uMsg == WM_RBUTTONDOWN) // easy enough to catch
>  { Dispatch(hwnd, LOWORD(lParam), HIWORD(lParam)); return 0; }
>  return CallWindowProc(OldWndProc, hwnd, uMsg, wParam, lParam); }
Fixed it by wrapping the call to Dispatch in scheme_start_atomic() and 
scheme_end_atomic_no_swap().  Resulting stub wndproc now looks like

LRESULT CALLBACK NewWndProc(HWND h, UINT n, WPARAM w, LPARAM l)
{
  if (n == WM_RBUTTONDOWN) {
    scheme_start_atomic();
    Dispatch(h, LOWORD(l), HIWORD(l)); /* queues a callback from Scheme */
    scheme_end_atomic_no_swap();
    return 0;
  }
  return CallWindowProc(OldWndProc, h, n, w, l);
}

"Never mind,"
Ben

From goetter at mazama.net  Tue Sep 30 03:49:55 2008
From: goetter at mazama.net (Ben Goetter)
Date: Thu Mar 26 02:29:22 2009
Subject: [plt-scheme] Extensibility of MrEd
In-Reply-To: <48E1B655.9090906@mazama.net>
References: <48960316.8060809@mazama.net>		<4896184E.5070903@mazama.net>	<20080804121107.8C4B16500AD@mail-svr1.cs.utah.edu>		<48C6A882.3060102@mazama.net>	<20080909170301.8AB6E65009D@mail-svr1.cs.utah.edu>	<48E17A99.3060706@mazama.net>
	<48E1B655.9090906@mazama.net>
Message-ID: <48E1DA23.6000306@mazama.net>


> Fixed it 
...no, I didn't.  The problem apparently lies elsewhere (somewhere under 
the C->Scheme callback thunk).  Please disregard.

I apologize for the noise to the list.

"Those responsible have been sacked,"
Ben


From clements at brinckerhoff.org  Tue Sep 30 04:07:22 2008
From: clements at brinckerhoff.org (John Clements)
Date: Thu Mar 26 02:29:23 2009
Subject: template for output <-> inversion problem (was: Re: [plt-scheme]
	HtDP: Question on 10.1.9)
In-Reply-To: <929D3923-C007-4141-932B-A6B18C50C77F@ccs.neu.edu>
References: <756daca50809182038s74eb4a94m28f95e0b645b8ed8@mail.gmail.com>
	
	<929D3923-C007-4141-932B-A6B18C50C77F@ccs.neu.edu>
Message-ID: <72BB1997-0A46-4E31-A146-BFC7F7DF2A20@brinckerhoff.org>


On Sep 19, 2008, at 7:08 AM, Matthias Felleisen wrote:

>  	
> Here I am responding to myself -)
>
> This problem is a bit of a "look ahead" or "cheat" given to where I  
> am posing it.
>
> Why? In general, it's a "parsing" problem and as such deserves a  
> "structural output" recipe. PLAI is the correct place to look for  
> this. For "freshmen" it's too challenging.
>
> ** The structure of the INPUT does not help you at all when you  
> solve this problem.
>
> ** The structure of the OUTPUT though suggests an organization and  
> arithmetic operations that help.

More generally; it would appear to me that this inversion  
(structuring the program around the output rather than the input)  
occurs whenever the program you're defining is the inverse of a nice  
simple structural recursion.  In the case of parsing, it's the  
inverse of a simple flattening operation.

This also provides another way to look at a function that consumes a  
number and produces a list of the given length (containing arbitrary  
data); it's just the inverse of length.

Of course, most of the HtDP functions are not 1-to-1, hence not  
invertible, so this is pretty rarely useful.

This is all fairly obvious, I suppose, but I've never heard parsing  
described as the inversion of a flattening function, or the  
difficulty of parsing described as being a consequence of the  
difficulty (or impossibility) of inverting a simple structurally  
recursive flatten operation.

I suppose in a logic language you could just define the flatten  
function and run it backwards.

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/20080930/5cb94b80/smime.bin
From fredm at cs.uml.edu  Tue Sep 30 06:23:03 2008
From: fredm at cs.uml.edu (Fred G. Martin)
Date: Thu Mar 26 02:29:24 2009
Subject: [plt-scheme] meaning of "->" in proc name
Message-ID: <72ef860f0809300323k33d03ae0sd2264dbd2c1f436b@mail.gmail.com>

Hey all,
Is there any operational significance to "->" in a procedure name
(e..g, picture->painter, round->exact)?

I am guessing it is merely a cultural standard to indicate a proc that does
type conversion, similar to the use of ? in predicates?

Fred
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080930/40607cb8/attachment.htm
From noelwelsh at gmail.com  Tue Sep 30 07:48:47 2008
From: noelwelsh at gmail.com (Noel Welsh)
Date: Thu Mar 26 02:29:24 2009
Subject: [plt-scheme] meaning of "->" in proc name
In-Reply-To: <72ef860f0809300323k33d03ae0sd2264dbd2c1f436b@mail.gmail.com>
References: <72ef860f0809300323k33d03ae0sd2264dbd2c1f436b@mail.gmail.com>
Message-ID: 

On Tue, Sep 30, 2008 at 11:23 AM, Fred G. Martin  wrote:
> I am guessing it is merely a cultural standard to indicate a proc that does
> type conversion, similar to the use of ? in predicates?

This is correct.  If you're used to languages like PHP you should be
aware that Scheme is a very uniform language, and few (none?) of the
special cases that such languages have.

N.

From sk at cs.brown.edu  Tue Sep 30 07:49:31 2008
From: sk at cs.brown.edu (Shriram Krishnamurthi)
Date: Thu Mar 26 02:29:24 2009
Subject: [plt-scheme] meaning of "->" in proc name
In-Reply-To: <72ef860f0809300323k33d03ae0sd2264dbd2c1f436b@mail.gmail.com>
References: <72ef860f0809300323k33d03ae0sd2264dbd2c1f436b@mail.gmail.com>
Message-ID: 

Correct.  Scheme does not interpret any of these letters in the middle of names.

On Tue, Sep 30, 2008 at 5:23 AM, Fred G. Martin  wrote:
> Hey all,
> Is there any operational significance to "->" in a procedure name
> (e..g, picture->painter, round->exact)?
> I am guessing it is merely a cultural standard to indicate a proc that does
> type conversion, similar to the use of ? in predicates?
> Fred
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
>

From troelskn at gmail.com  Tue Sep 30 08:10:19 2008
From: troelskn at gmail.com (troels knak-nielsen)
Date: Thu Mar 26 02:29:24 2009
Subject: [plt-scheme] meaning of "->" in proc name
In-Reply-To: <72ef860f0809300323k33d03ae0sd2264dbd2c1f436b@mail.gmail.com>
References: <72ef860f0809300323k33d03ae0sd2264dbd2c1f436b@mail.gmail.com>
Message-ID: <98b8086f0809300510o3a9bfd19w314dc686aed32da4@mail.gmail.com>

Also, in case you didn't know already, an arrow is used in math to
describe a transformation (A function). So you may see notations such
as `a b -> c`, meaning "A function that takes two input values of type
a and b, and returns one value of type c". So picture->painter isn't
just a name - it's also a description of its signature.

One really cool thing about plt-scheme, is that you can declare
contracts, which are like interfaces, but for functions. The syntax
for declaring a contract uses a symbol with the name `->`. So you
could see a contract like this:

    (provide/contract [foo (-> integer? string? Integer?)] )

Which should read as: The function, named `foo`, has the signature
`integer string -> integer`.

This may all be very basic stuff, but being new to Scheme myself, this
is something I've just recently picked up.

--
troels

On Tue, Sep 30, 2008 at 12:23 PM, Fred G. Martin  wrote:
> Hey all,
> Is there any operational significance to "->" in a procedure name
> (e..g, picture->painter, round->exact)?
> I am guessing it is merely a cultural standard to indicate a proc that does
> type conversion, similar to the use of ? in predicates?
> Fred
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
>

From noelwelsh at gmail.com  Tue Sep 30 08:12:24 2008
From: noelwelsh at gmail.com (Noel Welsh)
Date: Thu Mar 26 02:29:24 2009
Subject: [plt-scheme] Re: How to use a custom procedure as read?
In-Reply-To: 
References: 
	<48E18141.9050309@cs.utah.edu>
	
Message-ID: 

On Tue, Sep 30, 2008 at 3:45 AM, Ali  wrote:
>> > (swap-the-reader-in)
>> > ... code using custom reader ...
>> > (swap-the-reader-out)
>> > ... normal reader again ...
...
> Thanks. Do I have to write the code in a module? I'd much rather be
> able to swap in and out of the custom reader mode as with above.

You have to write your code in a separate module.  If you did not,
Scheme would have to evaluate your code as the module was loaded to
work out that you were swapping in a new reader.  This would break a
lot of things, the module system being the prime one.

Note the documentation you are reading is for v4, while you're using
v3.  I suggest you upgrade your installation.

Finally, writing a custom reader is a fairly advanced task.  What is
the problem you're trying to solve?  Perhaps list members can suggest
a simpler way of solving it.

HTH,
N.

From matthias at ccs.neu.edu  Tue Sep 30 08:13:09 2008
From: matthias at ccs.neu.edu (Matthias Felleisen)
Date: Thu Mar 26 02:29:24 2009
Subject: template for output <-> inversion problem (was: Re: [plt-scheme]
	HtDP: Question on 10.1.9)
In-Reply-To: <72BB1997-0A46-4E31-A146-BFC7F7DF2A20@brinckerhoff.org>
References: <756daca50809182038s74eb4a94m28f95e0b645b8ed8@mail.gmail.com>
	
	<929D3923-C007-4141-932B-A6B18C50C77F@ccs.neu.edu>
	<72BB1997-0A46-4E31-A146-BFC7F7DF2A20@brinckerhoff.org>
Message-ID: <80DFA20D-9F35-4D00-AA08-95DBFEE39A53@ccs.neu.edu>


On Sep 30, 2008, at 4:07 AM, John Clements wrote:

>
> I suppose in a logic language you could just define the flatten  
> function and run it backwards.


In principle, as they say, but the results aren't pretty nor  
interesting. -- Matthias, Mr Prolog in 1983 

From emailaliclark at gmail.com  Tue Sep 30 09:37:28 2008
From: emailaliclark at gmail.com (Ali)
Date: Thu Mar 26 02:29:24 2009
Subject: [plt-scheme] Re: How to use a custom procedure as read?
In-Reply-To: 
References:  
	<48E18141.9050309@cs.utah.edu>
	
	
Message-ID: 


On Sep 30, 1:12 pm, "Noel Welsh"  wrote:
> On Tue, Sep 30, 2008 at 3:45 AM, Ali  wrote:
> >> > (swap-the-reader-in)
> >> > ... code using custom reader ...
> >> > (swap-the-reader-out)
> >> > ... normal reader again ...
> ...
> > Thanks. Do I have to write the code in a module? I'd much rather be
> > able to swap in and out of the custom reader mode as with above.
>
> You have to write your code in a separate module.  If you did not,
> Scheme would have to evaluate your code as the module was loaded to
> work out that you were swapping in a new reader.  This would break a
> lot of things, the module system being the prime one.

Okay, fair enough. So to take this example of a module named canvas,
how could I modify it to specify that to use my custom-reader?

(module canvas mzscheme

  ... code implementing canvas using custom-reader as the reader ...

  (provide new-canvas draw-dot! display-canvas))

>
> Note the documentation you are reading is for v4, while you're using
> v3.  I suggest you upgrade your installation.

Thanks. I upgraded Mzscheme. Tried a few things, but I've still got no
idea what code I have to run, do I need a file in a certain place etc.
Can't really remember the last time I was this confused, so at least
its an experience for me!)

>
> Finally, writing a custom reader is a fairly advanced task.  What is
> the problem you're trying to solve?  Perhaps list members can suggest
> a simpler way of solving it.

I'd like to try writing code using SRFI 49 (http://srfi.schemers.org/
srfi-49/srfi-49.html). With a couple of minor changes I can run the
example implementation in guile, using (setf! read sugar-read). Works
fine. With a few more changes, Mzscheme can load the reader. All I
need now is the Mzscheme equivalent for (setf! read sugar-read), which
apparently doesn't do anything in mzscheme.

Sorry for not saying this explicitly before, but I was concerned the
discussion would be side-tracked to reasons why I shouldn't be using
SRFI 49 in the first place.

Anyway, thanks for telling me about the docs version, and making it
clear that I need to use a module. Really hope someone can give just
the smallest bit of example usage, just an equivalent for (set! read
sugar-read), where sugar-read is a user defined procedure. Or point me
to an existing example usage. Sorry if my irritation shows, I am
actually very grateful for your time, and I know there are more
enjoyable things one can do with it!

From news at aspden.com  Tue Sep 30 09:50:01 2008
From: news at aspden.com (John Lawrence Aspden)
Date: Thu Mar 26 02:29:25 2009
Subject: [plt-scheme] redefinition of built in function needs to be done
	twice to be recursive?
Message-ID: 

Hi, in the process of porting a program with a different definition of assq,
I encountered some behaviour which I'm having trouble understanding:

pasted verbatim from interactions window, definitions window contains (only)
#lang scheme, run button freshly pressed:

Welcome to DrScheme, version 4.1.0.3 [3m].
Language: Module; memory limit: 228 megabytes.
> (define (assq a alist) (if (null? alist) #f (if (eq? (caar alist) a) alist
(assq a (cdr alist)))))
> (assq 'b '((a . 1)(b . 2)))
(b . 2)
> (define (assq a alist) (if (null? alist) #f (if (eq? (caar alist) a) alist
(assq a (cdr alist)))))
> (assq 'b '((a . 1)(b . 2)))
((b . 2))
> 

It seems that the first definition works like let and the second (identical)
definition works like letrec.

It doesn't happen if you put the definitions in the definition window, and
it doesn't seem to happen if the function's called my-assq.

Can anyone explain what's going on? 

Cheers, John.

-- 
Contractor in Cambridge UK -- http://www.aspden.com


From eli at barzilay.org  Tue Sep 30 09:54:18 2008
From: eli at barzilay.org (Eli Barzilay)
Date: Thu Mar 26 02:29:25 2009
Subject: [plt-scheme] Re: How to use a custom procedure as read?
In-Reply-To: 
References: 
	<48E18141.9050309@cs.utah.edu>
	
	
	
Message-ID: <18658.12170.146105.201205@arabic.ccs.neu.edu>

On Sep 30, Ali wrote:
> 
> On Sep 30, 1:12 pm, "Noel Welsh"  wrote:
> > On Tue, Sep 30, 2008 at 3:45 AM, Ali  wrote:
> > >> > (swap-the-reader-in)
> > >> > ... code using custom reader ...
> > >> > (swap-the-reader-out)
> > >> > ... normal reader again ...
> > ...
> > > Thanks. Do I have to write the code in a module? I'd much rather be
> > > able to swap in and out of the custom reader mode as with above.
> >
> > You have to write your code in a separate module.  If you did not,
> > Scheme would have to evaluate your code as the module was loaded to
> > work out that you were swapping in a new reader.  This would break a
> > lot of things, the module system being the prime one.
> 
> Okay, fair enough. So to take this example of a module named canvas,
> how could I modify it to specify that to use my custom-reader?
> 
> (module canvas mzscheme
> 
>   ... code implementing canvas using custom-reader as the reader ...
> 
>   (provide new-canvas draw-dot! display-canvas))

1. You write a reader function, it will often use `read', so you'll
   want to call it something else, say `read*'; you also need to do
   the same for `read-syntax'.

2. You provide them as `read' and `read-syntax':
     (provide (rename-out [read* read] [read-syntax* read-syntax]))

3. You can now use
     #reader "path-to-your-module"
   and the following expression will be read using your reader.  In
   your case, the expression will be the whole module, for example:

     #reader "my-reader.ss"
     module foo scheme/base
       define blah 123
       ...

There is also a way to change the current readtable, but that's a
really bad idea, and is almost never what you want it to be.


> > Note the documentation you are reading is for v4, while you're
> > using v3.  I suggest you upgrade your installation.
> 
> Thanks. I upgraded Mzscheme. Tried a few things, but I've still got
> no idea what code I have to run, do I need a file in a certain place
> etc.  Can't really remember the last time I was this confused, so at
> least its an experience for me!)

[FWIW, my guess is that what I wrote above is not going to help much
unless you know how to use the module system.]


> > Finally, writing a custom reader is a fairly advanced task.  What is
> > the problem you're trying to solve?  Perhaps list members can suggest
> > a simpler way of solving it.
> 
> I'd like to try writing code using SRFI 49
> (http://srfi.schemers.org/srfi-49/srfi-49.html). With a couple of
> minor changes I can run the example implementation in guile, using
> (setf! read sugar-read). Works fine. With a few more changes,
> Mzscheme can load the reader. All I need now is the Mzscheme
> equivalent for (setf! read sugar-read), which apparently doesn't do
> anything in mzscheme.

Yes, mzscheme tends to be more well behaved in this regard.


> Sorry for not saying this explicitly before, but I was concerned the
> discussion would be side-tracked to reasons why I shouldn't be using
> SRFI 49 in the first place.

[A valid concern, since it is a bad idea.  Even worse than you think.]


> Anyway, thanks for telling me about the docs version, and making it
> clear that I need to use a module. Really hope someone can give just
> the smallest bit of example usage, just an equivalent for (set! read
> sugar-read), where sugar-read is a user defined procedure. Or point
> me to an existing example usage. Sorry if my irritation shows, I am
> actually very grateful for your time, and I know there are more
> enjoyable things one can do with it!

You can look at "collects/scribble/reader.ss" in the distribution --
that implements the scribble syntax, and can be used as:

  #reader scribble/reader 

Note that getting a `read' function is usually just half of the work.
MzScheme uses `read-syntax' to read code, which returns syntactic
objects that contain source information.  Getting `read-syntax'
working is usually more difficult.  You can try to make it the same as
`read' just to experiment with things, but syntax errors are not going
to have source information.
-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

From matthias at ccs.neu.edu  Tue Sep 30 10:20:59 2008
From: matthias at ccs.neu.edu (Matthias Felleisen)
Date: Thu Mar 26 02:29:25 2009
Subject: [plt-scheme] redefinition of built in function needs to be done
	twice to be recursive?
In-Reply-To: 
References: 
Message-ID: <8B047EC9-AAB7-4FF6-8B32-DEC44930B1D3@ccs.neu.edu>


This sure looks like a bug.


On Sep 30, 2008, at 9:50 AM, John Lawrence Aspden wrote:

> Hi, in the process of porting a program with a different definition  
> of assq,
> I encountered some behaviour which I'm having trouble understanding:
>
> pasted verbatim from interactions window, definitions window  
> contains (only)
> #lang scheme, run button freshly pressed:
>
> Welcome to DrScheme, version 4.1.0.3 [3m].
> Language: Module; memory limit: 228 megabytes.
>> (define (assq a alist) (if (null? alist) #f (if (eq? (caar alist)  
>> a) alist
> (assq a (cdr alist)))))
>> (assq 'b '((a . 1)(b . 2)))
> (b . 2)
>> (define (assq a alist) (if (null? alist) #f (if (eq? (caar alist)  
>> a) alist
> (assq a (cdr alist)))))
>> (assq 'b '((a . 1)(b . 2)))
> ((b . 2))
>>
>
> It seems that the first definition works like let and the second  
> (identical)
> definition works like letrec.
>
> It doesn't happen if you put the definitions in the definition  
> window, and
> it doesn't seem to happen if the function's called my-assq.
>
> Can anyone explain what's going on?
>
> Cheers, John.
>
> -- 
> Contractor in Cambridge UK -- http://www.aspden.com
>
> _________________________________________________
>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme


From eli at barzilay.org  Tue Sep 30 10:29:42 2008
From: eli at barzilay.org (Eli Barzilay)
Date: Thu Mar 26 02:29:25 2009
Subject: [plt-scheme] redefinition of built in function needs to be done
	twice to be recursive?
In-Reply-To: 
References: 
Message-ID: <18658.14294.482488.443415@arabic.ccs.neu.edu>

On Sep 30, John Lawrence Aspden wrote:
> Hi, in the process of porting a program with a different definition of assq,
> I encountered some behaviour which I'm having trouble understanding:
> 
> pasted verbatim from interactions window, definitions window contains (only)
> #lang scheme, run button freshly pressed:
> 
> Welcome to DrScheme, version 4.1.0.3 [3m].
> Language: Module; memory limit: 228 megabytes.
> > (define (assq a alist) (if (null? alist) #f (if (eq? (caar alist) a) alist
> (assq a (cdr alist)))))
> > (assq 'b '((a . 1)(b . 2)))
> (b . 2)
> > (define (assq a alist) (if (null? alist) #f (if (eq? (caar alist) a) alist
> (assq a (cdr alist)))))
> > (assq 'b '((a . 1)(b . 2)))
> ((b . 2))
> > 
> 
> It seems that the first definition works like let and the second (identical)
> definition works like letrec.
> 
> It doesn't happen if you put the definitions in the definition window, and
> it doesn't seem to happen if the function's called my-assq.
> 
> Can anyone explain what's going on? 

While the first expression is compiled, `assq' is a known constant
that gets inlined.  So the definition is not recursive, and you can
get the same by using

  (define (assq a alist) (assq a alist))

When the second expression is compiled, it's (`assq') is no longer the
known constant, so it is not inlined.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

From mflatt at cs.utah.edu  Tue Sep 30 10:32:47 2008
From: mflatt at cs.utah.edu (Matthew Flatt)
Date: Thu Mar 26 02:29:25 2009
Subject: [plt-scheme] redefinition of built in function needs to be done
	twice to be recursive?
In-Reply-To: <8B047EC9-AAB7-4FF6-8B32-DEC44930B1D3@ccs.neu.edu>
References: 
	<8B047EC9-AAB7-4FF6-8B32-DEC44930B1D3@ccs.neu.edu>
Message-ID: <20080930143253.E6AA26500AA@mail-svr1.cs.utah.edu>

At Tue, 30 Sep 2008 10:20:59 -0400, Matthias Felleisen wrote:
> 
> This sure looks like a bug.

Well, this is the same old problem. The top level is hopeless.

The problem is that the definition of `assq' below is expanded and
compiled before it is evaluated. At the time that it's expanded, `assq'
isn't a defined variable; it's an import from `scheme/base'. So the use
of `assq' is compiled as a reference to the built-in `assq',
independent of top-level definitions.

Then the definition is evaluated, so that `assq' at the top-level
switches its binding from an import to a top-level variable.

The second time you expand/compile the definition of `assq', then the
reference to `assq' is compiled as a reference to a variable, and so it
works as expected.

See also

 http://list.cs.brown.edu/pipermail/plt-scheme/2005-November/010348.html


Matthew

> On Sep 30, 2008, at 9:50 AM, John Lawrence Aspden wrote:
> 
> > Hi, in the process of porting a program with a different definition  
> > of assq,
> > I encountered some behaviour which I'm having trouble understanding:
> >
> > pasted verbatim from interactions window, definitions window  
> > contains (only)
> > #lang scheme, run button freshly pressed:
> >
> > Welcome to DrScheme, version 4.1.0.3 [3m].
> > Language: Module; memory limit: 228 megabytes.
> >> (define (assq a alist) (if (null? alist) #f (if (eq? (caar alist)  
> >> a) alist
> > (assq a (cdr alist)))))
> >> (assq 'b '((a . 1)(b . 2)))
> > (b . 2)
> >> (define (assq a alist) (if (null? alist) #f (if (eq? (caar alist)  
> >> a) alist
> > (assq a (cdr alist)))))
> >> (assq 'b '((a . 1)(b . 2)))
> > ((b . 2))
> >>
> >
> > It seems that the first definition works like let and the second  
> > (identical)
> > definition works like letrec.
> >
> > It doesn't happen if you put the definitions in the definition  
> > window, and
> > it doesn't seem to happen if the function's called my-assq.
> >
> > Can anyone explain what's going on?
> >
> > Cheers, John.
> >
> > -- 
> > Contractor in Cambridge UK -- http://www.aspden.com
> >
> > _________________________________________________
> >   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 dherman at ccs.neu.edu  Tue Sep 30 10:38:47 2008
From: dherman at ccs.neu.edu (Dave Herman)
Date: Thu Mar 26 02:29:25 2009
Subject: [plt-scheme] dude, where's my stats?
Message-ID: <48E239F7.9020908@ccs.neu.edu>

I know this is *totally* vain, but I think the PLaneT page isn't giving 
correct stats about bug-closing-- I've closed around 7 or 8 bugs since 
yesterday and it's only added one.

Sorry this is pedantic...

Thanks,
Dave

From robby at cs.uchicago.edu  Tue Sep 30 11:10:06 2008
From: robby at cs.uchicago.edu (Robby Findler)
Date: Thu Mar 26 02:29:26 2009
Subject: [plt-scheme] dude, where's my stats?
In-Reply-To: <48E239F7.9020908@ccs.neu.edu>
References: <48E239F7.9020908@ccs.neu.edu>
Message-ID: <932b2f1f0809300810t4df2f80dy59f8ecec3f8f6eb6@mail.gmail.com>

It only gives you credit for closing bug reports that you didn't
create. I added that because it seemed unfair to pump up your own
stats.

Robby

On Tue, Sep 30, 2008 at 9:38 AM, Dave Herman  wrote:
> I know this is *totally* vain, but I think the PLaneT page isn't giving
> correct stats about bug-closing-- I've closed around 7 or 8 bugs since
> yesterday and it's only added one.
>
> Sorry this is pedantic...
>
> Thanks,
> Dave
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
>

From news at aspden.com  Tue Sep 30 11:17:24 2008
From: news at aspden.com (John Lawrence Aspden)
Date: Thu Mar 26 02:29:26 2009
Subject: [plt-scheme] Re: redefinition of built in function needs to be done
	twice to be recursive?
References: 
Message-ID: 

Thanks everyone, I think I see.

Serves me right for using run time eval. I'm testing and profiling my
various meta-evals by comparing them with the real eval.

I'll change the name of my function.

Cheers, John.

-- 
Contractor in Cambridge UK -- http://www.aspden.com


From emailaliclark at gmail.com  Tue Sep 30 11:18:34 2008
From: emailaliclark at gmail.com (Ali)
Date: Thu Mar 26 02:29:26 2009
Subject: [plt-scheme] Re: How to use a custom procedure as read?
In-Reply-To: <18658.12170.146105.201205@arabic.ccs.neu.edu>
References:  
	<48E18141.9050309@cs.utah.edu>
	
	 
	 
	<18658.12170.146105.201205@arabic.ccs.neu.edu>
Message-ID: <3c6cc0ad-e70d-455c-9dda-55e6c933abd1@w32g2000hsf.googlegroups.com>



On Sep 30, 2:54 pm, Eli Barzilay  wrote:
> On Sep 30, Ali wrote:
>
>
>
>
>
> > On Sep 30, 1:12 pm, "Noel Welsh"  wrote:
> > > On Tue, Sep 30, 2008 at 3:45 AM, Ali  wrote:
> > > >> > (swap-the-reader-in)
> > > >> > ... code using custom reader ...
> > > >> > (swap-the-reader-out)
> > > >> > ... normal reader again ...
> > > ...
> > > > Thanks. Do I have to write the code in a module? I'd much rather be
> > > > able to swap in and out of the custom reader mode as with above.
>
> > > You have to write your code in a separate module.  If you did not,
> > > Scheme would have to evaluate your code as the module was loaded to
> > > work out that you were swapping in a new reader.  This would break a
> > > lot of things, the module system being the prime one.
>
> > Okay, fair enough. So to take this example of a module named canvas,
> > how could I modify it to specify that to use my custom-reader?
>
> > (module canvas mzscheme
>
> >   ... code implementing canvas using custom-reader as the reader ...
>
> >   (provide new-canvas draw-dot! display-canvas))
>
> 1. You write a reader function, it will often use `read', so you'll
>    want to call it something else, say `read*'; you also need to do
>    the same for `read-syntax'.
>
> 2. You provide them as `read' and `read-syntax':
>      (provide (rename-out [read* read] [read-syntax* read-syntax]))
>
> 3. You can now use
>      #reader "path-to-your-module"
>    and the following expression will be read using your reader.  In
>    your case, the expression will be the whole module, for example:
>
>      #reader "my-reader.ss"
>      module foo scheme/base
>        define blah 123
>        ...
>
> There is also a way to change the current readtable, but that's a
> really bad idea, and is almost never what you want it to be.
>
> > > Note the documentation you are reading is for v4, while you're
> > > using v3.  I suggest you upgrade your installation.
>
> > Thanks. I upgraded Mzscheme. Tried a few things, but I've still got
> > no idea what code I have to run, do I need a file in a certain place
> > etc.  Can't really remember the last time I was this confused, so at
> > least its an experience for me!)
>
> [FWIW, my guess is that what I wrote above is not going to help much
> unless you know how to use the module system.]
>
> > > Finally, writing a custom reader is a fairly advanced task.  What is
> > > the problem you're trying to solve?  Perhaps list members can suggest
> > > a simpler way of solving it.
>
> > I'd like to try writing code using SRFI 49
> > (http://srfi.schemers.org/srfi-49/srfi-49.html). With a couple of
> > minor changes I can run the example implementation in guile, using
> > (setf! read sugar-read). Works fine. With a few more changes,
> > Mzscheme can load the reader. All I need now is the Mzscheme
> > equivalent for (setf! read sugar-read), which apparently doesn't do
> > anything in mzscheme.
>
> Yes, mzscheme tends to be more well behaved in this regard.
>
> > Sorry for not saying this explicitly before, but I was concerned the
> > discussion would be side-tracked to reasons why I shouldn't be using
> > SRFI 49 in the first place.
>
> [A valid concern, since it is a bad idea.  Even worse than you think.]
>
> > Anyway, thanks for telling me about the docs version, and making it
> > clear that I need to use a module. Really hope someone can give just
> > the smallest bit of example usage, just an equivalent for (set! read
> > sugar-read), where sugar-read is a user defined procedure. Or point
> > me to an existing example usage. Sorry if my irritation shows, I am
> > actually very grateful for your time, and I know there are more
> > enjoyable things one can do with it!
>
> You can look at "collects/scribble/reader.ss" in the distribution --
> that implements the scribble syntax, and can be used as:
>
>   #reader scribble/reader 
>
> Note that getting a `read' function is usually just half of the work.
> MzScheme uses `read-syntax' to read code, which returns syntactic
> objects that contain source information.  Getting `read-syntax'
> working is usually more difficult.  You can try to make it the same as
> `read' just to experiment with things, but syntax errors are not going
> to have source information.
> --
>           ((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

Excellent, thanks. It still doesn't work, but I'm hopeful that after
I've written read-syntax it might work, and this clears up the idea of
putting the code in a module definition.

From jensaxel at soegaard.net  Tue Sep 30 12:40:44 2008
From: jensaxel at soegaard.net (Jens Axel Soegaard)
Date: Thu Mar 26 02:29:26 2009
Subject: [plt-scheme] dude, where's my stats?
In-Reply-To: <932b2f1f0809300810t4df2f80dy59f8ecec3f8f6eb6@mail.gmail.com>
References: <48E239F7.9020908@ccs.neu.edu>
	<932b2f1f0809300810t4df2f80dy59f8ecec3f8f6eb6@mail.gmail.com>
Message-ID: <48E2568C.6010904@soegaard.net>



Robby Findler skrev:
> It only gives you credit for closing bug reports that you didn't
> create. I added that because it seemed unfair to pump up your own
> stats.
>   

Maybe it were better to use (or combine it with) some some sort of decay 
model?
This way old timers won't be on the top of the list for ever.

/Jens Axel


From gregory.woodhouse at gmail.com  Tue Sep 30 13:13:11 2008
From: gregory.woodhouse at gmail.com (Greg Woodhouse)
Date: Thu Mar 26 02:29:27 2009
Subject: [plt-scheme] When are two paths equal?
Message-ID: <5f07325f0809301013l4b9ed87cy7e62e268c3b1290f@mail.gmail.com>

I want to write a utility that recursively compares the contents of two
directory trees. I was going to check to see if applying path->string to the
members of the list of (relative) paths returned by directory-list were
equal?, but then I wonder if this is (guaranteed to be) true when the paths
themselves are equal? This would be nice because I could use member? instead
opf writing my own test. Then again, I will probably have tests comparing
file sizes and other attributes, too.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080930/96ce6d5d/attachment.html
From robby at cs.uchicago.edu  Tue Sep 30 13:37:25 2008
From: robby at cs.uchicago.edu (Robby Findler)
Date: Thu Mar 26 02:29:27 2009
Subject: [plt-scheme] dude, where's my stats?
In-Reply-To: <48E2568C.6010904@soegaard.net>
References: <48E239F7.9020908@ccs.neu.edu>
	<932b2f1f0809300810t4df2f80dy59f8ecec3f8f6eb6@mail.gmail.com>
	<48E2568C.6010904@soegaard.net>
Message-ID: <932b2f1f0809301037s46190923l43f8336428c4b4a8@mail.gmail.com>

On Tue, Sep 30, 2008 at 11:40 AM, Jens Axel Soegaard
 wrote:
>
> Robby Findler skrev:
>>
>> It only gives you credit for closing bug reports that you didn't
>> create. I added that because it seemed unfair to pump up your own
>> stats.
>>
>
> Maybe it were better to use (or combine it with) some some sort of decay
> model?
> This way old timers won't be on the top of the list for ever.

Yea, I agree. At some point, I'm planning to have a top bug closers of
the month or quarter or something, but I've not gotten to that yet
(partly because the bug report system hasn't been around long enough
yet).

Robby

From eli at barzilay.org  Tue Sep 30 13:54:54 2008
From: eli at barzilay.org (Eli Barzilay)
Date: Thu Mar 26 02:29:27 2009
Subject: [plt-scheme] When are two paths equal?
In-Reply-To: <5f07325f0809301013l4b9ed87cy7e62e268c3b1290f@mail.gmail.com>
References: <5f07325f0809301013l4b9ed87cy7e62e268c3b1290f@mail.gmail.com>
Message-ID: <18658.26606.485396.481472@arabic.ccs.neu.edu>

On Sep 30, Greg Woodhouse wrote:
> I want to write a utility that recursively compares the contents of
> two directory trees. I was going to check to see if applying
> path->string to the members of the list of (relative) paths returned
> by directory-list were equal?, but then I wonder if this is
> (guaranteed to be) true when the paths themselves are equal? This
> would be nice because I could use member? instead opf writing my own
> test. Then again, I will probably have tests comparing file sizes
> and other attributes, too.

You probably want to use something like `explode-path' to avoid issues
with slashes or backslashes on windows.  Also, it might not be needed
in your case since you're building the paths yourself, but in general
you'd want to simplify them too (`simplify-path' with #t for the
second argument).

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

From gregory.woodhouse at gmail.com  Tue Sep 30 14:52:24 2008
From: gregory.woodhouse at gmail.com (Greg Woodhouse)
Date: Thu Mar 26 02:29:27 2009
Subject: [plt-scheme] Is there any way to make a file writable?
Message-ID: <5f07325f0809301152q4d84ee00sc54c0d5ef9510b43@mail.gmail.com>

I see that you can get a file's permissions with
file-or-directory-permissions, but there doesn't seem to be any way to
change them. Am I missing something?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080930/e4c20784/attachment.htm
From clklein at cs.uchicago.edu  Tue Sep 30 15:55:50 2008
From: clklein at cs.uchicago.edu (Casey Klein)
Date: Thu Mar 26 02:29:28 2009
Subject: [plt-scheme] for-label-based hyperlinks when building with scribble
	command-line executable
Message-ID: 

When I build the following with scribble --html, the identifier
`big-bang' in the typeset code is underlined in red:

#lang scribble/doc

@(require scribble/manual (for-label teachpack/htdp/world))
@schemeblock[(big-bang width height r world0)]

I apologize if I should be able to figure this out from the
documentation, but what do I need to do to turn identifiers like this
one to hyperlinks?

From fredm at cs.uml.edu  Tue Sep 30 17:50:16 2008
From: fredm at cs.uml.edu (Fred G. Martin)
Date: Thu Mar 26 02:29:28 2009
Subject: [plt-scheme] rotate90 is clockwise on einstein; CCW on zorro
In-Reply-To: <72ef860f0809301031x228dc296p81e978db48366751@mail.gmail.com>
References: <72ef860f0809301031x228dc296p81e978db48366751@mail.gmail.com>
Message-ID: <72ef860f0809301450n3adfb096u2e8f2fc1c20e29f6@mail.gmail.com>

Dear Henderson-users,

OK, this one threw us for a loop.  I loaded soegaard's version of the
Henderson stuff:

(require (planet "sicp.ss" ("soegaard" "sicp.plt" 2 0)))

Then I tried rotate90 on einstein and mark-of-zorro.

einstein gets rotated clockwise, but mark-of-zorro is rotated
counter-clockwise (see attached).


Here is another (related?) anomoly.  In looking at the code for zorro,
it appears that (0,0) is in the lower-left and (1,) is in the
upper-right:

(define mark-of-zorro
 (let ((v1 (make-vect .1 .9))
       (v2 (make-vect .8 .9))
       (v3 (make-vect .1 .2))
       (v4 (make-vect .9 .3)))
   (segments->painter
    (list (make-segment v1 v2)
          (make-segment v2 v3)
          (make-segment v3 v4)))))


But when we tried the diagonal shader, it seems that (0,0) is in the
UPPER-left.  my-diag performs the same as the provided
diagonal-shading:

(define my-diag
 (procedure->painter (lambda (x y) (* 127 (+ x y)))))

Help?

Fred
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rotating-einstein-vs-zorro.gif
Type: image/gif
Size: 22086 bytes
Desc: not available
Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080930/0cd8c886/rotating-einstein-vs-zorro.gif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diagonal-shading.jpg
Type: image/jpeg
Size: 11232 bytes
Desc: not available
Url : http://list.cs.brown.edu/pipermail/plt-scheme/attachments/20080930/0cd8c886/diagonal-shading.jpg