Re: [racket] TR error message

2010-09-21 Thread Vincent St-Amour
At Tue, 21 Sep 2010 23:04:04 -0400, Sam Tobin-Hochstadt wrote: > > On Tue, Sep 21, 2010 at 10:31 PM, Matthias Felleisen > wrote: > > > > On Sep 21, 2010, at 9:01 PM, Shriram Krishnamurthi wrote: > > > >> If so why are many of the combinations missing? > > > > Because this is work in progress to s

Re: [racket] TR error message

2010-09-21 Thread Sam Tobin-Hochstadt
On Tue, Sep 21, 2010 at 10:31 PM, Matthias Felleisen wrote: > > On Sep 21, 2010, at 9:01 PM, Shriram Krishnamurthi wrote: > >> If so why are many of the combinations missing? > > Because this is work in progress to support typed-based optimizations. > Roughly speaking, with types TR can macro-gen

Re: [racket] TR error message

2010-09-21 Thread Matthias Felleisen
On Sep 21, 2010, at 9:01 PM, Shriram Krishnamurthi wrote: > If so why are many of the combinations missing? Because this is work in progress to support typed-based optimizations. Roughly speaking, with types TR can macro-generate code that exploits Racket's specialized primitives to an extent

[racket] TR error message

2010-09-21 Thread Shriram Krishnamurthi
I have a function that consumes two Number's and tries to compare them using <=. Rightfully, TR gives a type error. The message says: Type Checker: No function domains matched in function application: Domains: Fixnum Zero Integer Zero Positive-Fixnum Fixnum Nonnegative

Re: [racket] match plus #:super structs => no nice fit?

2010-09-21 Thread John Clements
On Sep 21, 2010, at 4:08 PM, Robby Findler wrote: > Just in case: John, yo know you can write (struct b a (f3)) to > statically declare the super struct, right? Fooey! No! Reading the docs more carefully, of course, it's right there in front of me. When I discovered that (define-struct (b a) (

Re: [racket] match plus #:super structs => no nice fit?

2010-09-21 Thread Robby Findler
Just in case: John, yo know you can write (struct b a (f3)) to statically declare the super struct, right? Robby On Tue, Sep 21, 2010 at 4:31 PM, John Clements wrote: > It looks to me like match doesn't work nicely with #:super structs.  For > instance, this program: > > #lang racket > > (struc

[racket] Scripting on the Mac

2010-09-21 Thread Michael Smith
Hi, I am a Mac user and have just started to learn Scheme. Many apps on the Mac are scriptable via Applescript. Is there any Scheme way to leverage this capability, like an Applescript bridge? Thanks, Mike _ For list-related administrative t

Re: [racket] match plus #:super structs => no nice fit?

2010-09-21 Thread Sam Tobin-Hochstadt
On Tue, Sep 21, 2010 at 5:45 PM, Ryan Culpepper wrote: > On 09/21/2010 03:36 PM, Sam Tobin-Hochstadt wrote: >> >> On Tue, Sep 21, 2010 at 5:31 PM, John Clements >>  wrote: >>> >>> It looks to me like match doesn't work nicely with #:super structs.  For >>> instance, this program: >> >> [snip] >>

Re: [racket] match plus #:super structs => no nice fit?

2010-09-21 Thread Ryan Culpepper
On 09/21/2010 03:36 PM, Sam Tobin-Hochstadt wrote: On Tue, Sep 21, 2010 at 5:31 PM, John Clements wrote: It looks to me like match doesn't work nicely with #:super structs. For instance, this program: [snip] It's easy to work around this, but it would be nice if it worked. Am I missing

Re: [racket] match plus #:super structs => no nice fit?

2010-09-21 Thread Jay McCarthy
This isn't going to work because #:super uses runtime information to find the super struct while struct can only communicate with match statically. Jay On Tue, Sep 21, 2010 at 3:31 PM, John Clements wrote: > It looks to me like match doesn't work nicely with #:super structs.  For > instance, th

Re: [racket] match plus #:super structs => no nice fit?

2010-09-21 Thread Sam Tobin-Hochstadt
On Tue, Sep 21, 2010 at 5:31 PM, John Clements wrote: > It looks to me like match doesn't work nicely with #:super structs.  For > instance, this program: [snip] > It's easy to work around this, but it would be nice if it worked.  Am I > missing something obvious? I don't know if it's obvious

[racket] match plus #:super structs => no nice fit?

2010-09-21 Thread John Clements
It looks to me like match doesn't work nicely with #:super structs. For instance, this program: #lang racket (struct a (f1 f2)) (struct b (f3) #:super struct:a) (match 'whocares [(struct b (f1 f2 f3)) 13]) signals the error: match: wrong number for fields for structure b: expected 1 but g

Re: [racket] Bug report: collects/htdp/hangman.rkt

2010-09-21 Thread Robby Findler
In htdp/2e I think we could probably pass the "word" part in the (define-struct word ...) and that would not require any special powers nor the "secrets" security hole. Robby On Tue, Sep 21, 2010 at 3:41 PM, Matthias Felleisen wrote: > > Thanks a lot!! > > (This is indeed a dirty secret part; a

Re: [racket] Bug report: collects/htdp/hangman.rkt

2010-09-21 Thread Matthias Felleisen
Thanks a lot!! (This is indeed a dirty secret part; a change to structs in *sl shouldn't trigger a change to a teachpack.) And in 2htdp, we'll abolish it. -- Matthias On Sep 21, 2010, at 4:30 PM, Robby Findler wrote: > Okay. Looks like that was the only thing. At least the first example >

Re: [racket] Hosting other languages on Racket

2010-09-21 Thread Grant Rettke
On Tue, Sep 21, 2010 at 2:27 PM, Neil Van Dyke wrote: > Jay McCarthy wrote at 09/21/2010 03:14 PM: >> >> I don't think any generate bytecode. >> >> My personal opinion is that this is a sign of a good thing. >> > > Me too.  Using Scheme as a target language was one of the reasons I moved > almost

Re: [racket] Java Conversion Utility [very very early stages]

2010-09-21 Thread Mathew Kurian
thank you martin On Tue, Sep 21, 2010 at 2:21 PM, Martin DeMello wrote: > On Sun, Sep 19, 2010 at 6:13 AM, Mathew Kurian > wrote: > > BTW...i didnt know Moby already did this > > If I could see Moby's code, we could probably merge these together and I > > could add Netbeans features such as draw

Re: [racket] Bug report: collects/htdp/hangman.rkt

2010-09-21 Thread Robby Findler
Okay. Looks like that was the only thing. At least the first example below works properly and is now codified in a test suite (altho the correct incantation seems to be (hangman make-word reveal symbol?)). It just does the below and then waits for a "Hangman" frame to appear. If one does, the test

Re: [racket] Hosting other languages on Racket

2010-09-21 Thread Neil Van Dyke
Jay McCarthy wrote at 09/21/2010 03:14 PM: I don't think any generate bytecode. My personal opinion is that this is a sign of a good thing. Me too. Using Scheme as a target language was one of the reasons I moved almost all my work to Scheme (maybe 9 years ago). I wasted a shameful amou

Re: [racket] Hosting other languages on Racket

2010-09-21 Thread Shriram Krishnamurthi
On the other hand, the fact that the bytecodes are wel-documented (both text docs, as well as a Redex model) has been a huge boon to apps that can rely on all these front-ends to do their job, and then port just the back-end to other platforms. For the reasons Jay explains, I'd be hard-pressed to

Re: [racket] Hosting other languages on Racket

2010-09-21 Thread Jay McCarthy
On Tue, Sep 21, 2010 at 1:14 PM, Sam Tobin-Hochstadt wrote: > More seriously, the bytecode is harder to generate, > not more expressive (I think) and generating it loses you > optimizations. I can only think of one optimization that runs on byte code. The byte code is more expressive though, beca

Re: [racket] Hosting other languages on Racket

2010-09-21 Thread Sam Tobin-Hochstadt
On Tue, Sep 21, 2010 at 3:11 PM, Neil Van Dyke wrote: > Jay McCarthy wrote at 09/21/2010 03:02 PM: >> >> We already have hosted Javascript, Algol 60, Datalog, R5RS, and R6RS. In >> the past, we've had version of Java in the core. We have Python and SML out >> there from people at Utah. >> > > Do t

Re: [racket] Hosting other languages on Racket

2010-09-21 Thread Jay McCarthy
I don't think any generate bytecode. My personal opinion is that this is a sign of a good thing. Languages target the JVM because targeting Java is so painful, so we should not be surprised that people DON'T do it. Targeting Racket is designed to be easy with the syntactic extension system, so w

Re: [racket] Hosting other languages on Racket

2010-09-21 Thread Neil Van Dyke
Jay McCarthy wrote at 09/21/2010 03:02 PM: We already have hosted Javascript, Algol 60, Datalog, R5RS, and R6RS. In the past, we've had version of Java in the core. We have Python and SML out there from people at Utah. Do these all translate to Racket syntax, and then the normal Racket in

Re: [racket] Hosting other languages on Racket

2010-09-21 Thread Jay McCarthy
We already have hosted Javascript, Algol 60, Datalog, R5RS, and R6RS. In the past, we've had version of Java in the core. We have Python and SML out there from people at Utah. Jay On Tue, Sep 21, 2010 at 12:55 PM, Grant Rettke wrote: > Hi, > > Is there a precedent for hosting other languages on

Re: [racket] Hosting other languages on Racket

2010-09-21 Thread Sam Tobin-Hochstadt
On Tue, Sep 21, 2010 at 2:55 PM, Grant Rettke wrote: > Is there a precedent for hosting other languages on the Racket VM in > the same way that JRuby and Clojure live in the JVM or F# and > IronPython live on the CLR? See the Algol60 experimental language, the #lang datalog language, Dave Herman'

[racket] Hosting other languages on Racket

2010-09-21 Thread Grant Rettke
Hi, Is there a precedent for hosting other languages on the Racket VM in the same way that JRuby and Clojure live in the JVM or F# and IronPython live on the CLR? Is that interesting to users? Or implementers? How technically difficult is it? (days/months/years) Are there research opportunities

Re: [racket] Survey of Syntax and Hygienic Macro Systems?

2010-09-21 Thread Raoul Duke
On Tue, Sep 21, 2010 at 10:54 AM, Will M. Farr wrote: > it's interesting.  Have a look at OCaml's Camlp4: a macro language where > people sometimes *actually* use there's also nemerle's approach that supports non/ast versions. http://nemerle.org/macros.html sincerely. __

Re: [racket] Survey of Syntax and Hygienic Macro Systems?

2010-09-21 Thread John Clements
On Sep 21, 2010, at 10:54 AM, Anton van Straaten wrote: > John Clements wrote: >> Student: wouldn't it be cool if you could specify source-to-source >> translations for languages like c++ by defining the operations at the AST >> level, after they're parsed? >> Me: AST level <=> s-expressions. E

Re: [racket] Survey of Syntax and Hygienic Macro Systems?

2010-09-21 Thread Anton van Straaten
John Clements wrote: Student: wouldn't it be cool if you could specify source-to-source translations for languages like c++ by defining the operations at the AST level, after they're parsed? Me: AST level <=> s-expressions. Everyone who tries this eventually decides that it's easier to simply

Re: [racket] Survey of Syntax and Hygienic Macro Systems?

2010-09-21 Thread Will M. Farr
John, I know this isn't the survey you asked for, but rather one data point in such a survey; nevertheless, I hope it's interesting. Have a look at OCaml's Camlp4: a macro language where people sometimes *actually* use the AST to write transformations (sometimes quotations just won't cut it).

Re: [racket] Survey of Syntax and Hygienic Macro Systems?

2010-09-21 Thread Shriram Krishnamurthi
> Me: AST level <=> s-expressions. Not true. S-expressions are one step removed from true abstract syntax. The conveyor of the former into the latter is parse. > So here's my question: is there a good *survey* of syntax & hygienic > macro systems that tries to provide some insight into what we'

[racket] Survey of Syntax and Hygienic Macro Systems?

2010-09-21 Thread John Clements
Me: what are you interested in? Student: wouldn't it be cool if you could specify source-to-source translations for languages like c++ by defining the operations at the AST level, after they're parsed? Me: AST level <=> s-expressions. Everyone who tries this eventually decides that it's easier

Re: [racket] testing in P4P

2010-09-21 Thread Shriram Krishnamurthi
Thanks for the feedback! > - I wish conditionals were lighter weight. >  Maybe cond: Q0, A0, ... else: An I expressly want the signposts for intermediate expressions. It makes clearer what you're looking at -- a question or an answer. Though I'm not a fan of cond's syntax, at least we have sig

Re: [racket] Bug report: collects/htdp/hangman.rkt

2010-09-21 Thread Matthias Felleisen
htdp/tests/hangman1.rkt ; run (hangman make-reveal make-reveal add1) in REPL htdp/tests/hangman-error.rkt ; just run ignore errors On Sep 21, 2010, at 9:58 AM, Robby Findler wrote: > I've fixed the problem that was introduced when signatures were added, > but there seem to be other proble

Re: [racket] Bug report: collects/htdp/hangman.rkt

2010-09-21 Thread Robby Findler
I've fixed the problem that was introduced when signatures were added, but there seem to be other problems with the teachpack. If someone would be kind enough to provide a test case (a sample non-"solution" that at least runs) I'll keep working on it and put it into drdr so that we don't have this

Re: [racket] Bug report: collects/htdp/hangman.rkt

2010-09-21 Thread Matthias Felleisen
(require htdp/hangman) (define-struct wrd (a b c)) (hangman make-wrd make-wrd add1) It's time to admit, nobody gets hung anymore. On Sep 20, 2010, at 10:09 PM, Frodo theGreat wrote: > DrRacket, version 5.0.1 [3m] > Line 253, char 51. > > The `4' should be replaced with `5'. > > Frodo > > __

[racket] Eugene Kohlbecker's dissertation

2010-09-21 Thread wooks .
Spooky. 2 weeks ago I saw a reference to this while reading the macros chapter in SAtoP and was looking for a copy online. _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/

Re: [racket] keyboard input help?

2010-09-21 Thread Richard Cleis
Have you read about get-key-code (and other related functions) in the docs? On earlier versions of PLT Scheme I was investigating things like: (on-subwindow-char the-win key-event) (display (send key-event get-key-code)) I don't know how much things have changed since then. >From the short desc

Re: [racket] keyboard input help?

2010-09-21 Thread Neil Van Dyke
I haven't tested the following with Racket 5.x, but either they'll work or give you some idea of how easy the FFI makes many things: http://groups.google.com/group/plt-scheme/browse_frm/thread/5c41593f90ef/68f322eedcdb4dff?hl=en&lnk=gst&q=curses#68f322eedcdb4dff Note: There is also a "curse