Re: [racket] macro expansion function in Scheme

2011-07-12 Thread Matthias Felleisen
On Jul 12, 2011, at 7:08 PM, Bas Steunebrink wrote: > Any anomalies (such as "lambda:2" -> "lambda") are easily fixed. :-) That's not an anomaly but an annotation from the expander that may matter (as in, use a different lambda here). But I assume you know that. Glad we could help -- Matthia

Re: [racket] macro expansion function in Scheme

2011-07-12 Thread Bas Steunebrink
Excellent idea! I looked at the source code of macro-debugger but there was quite an intimidating amount of it. :-s So I took the ugliest but fastest path: simply catch the textual output of the expand/step-text function and use Racket's reader to get the result of the last step as a datum (I k

Re: [racket] What are the roles for teachpacks these days?

2011-07-12 Thread Robby Findler
On Tue, Jul 12, 2011 at 3:29 PM, Danny Yoo wrote: >> On Tue, Jul 12, 2011 at 3:54 PM, Robby Findler >> wrote: >>> I don't have any plans to make the menu-based teachpacks work with >>> #lang languages. They all have require-based interfaces, tho (eg >>> (require 2htdp/image) and (require htdp/ima

Re: [racket] What are the roles for teachpacks these days?

2011-07-12 Thread Danny Yoo
> On Tue, Jul 12, 2011 at 3:54 PM, Robby Findler > wrote: >> I don't have any plans to make the menu-based teachpacks work with >> #lang languages. They all have require-based interfaces, tho (eg >> (require 2htdp/image) and (require htdp/image)); are those not >> sufficient somehow? No, using r

Re: [racket] What are the roles for teachpacks these days?

2011-07-12 Thread Todd O'Bryan
Yeah. Could we just have the Language menu and Teachpacks fade away? I've been bitten so many times by the hidden stuff that I think it's easier to have students explicitly write #lang htdp/bsl (require 2htdp/image) at the top of files. I'd prefer something like #lang beginner, but I don't reall

Re: [racket] What are the roles for teachpacks these days?

2011-07-12 Thread Robby Findler
I don't have any plans to make the menu-based teachpacks work with #lang languages. They all have require-based interfaces, tho (eg (require 2htdp/image) and (require htdp/image)); are those not sufficient somehow? Robby On Tue, Jul 12, 2011 at 12:35 PM, Danny Yoo wrote: > So let's say that I'm

[racket] What are the roles for teachpacks these days?

2011-07-12 Thread Danny Yoo
So let's say that I'm designing a new #lang-implemented language. I'd love to automatically work with teachpacks and other external modules. So I can get require-like functionality with my language, and that seems to work ok. But when I click on Language/Add Teachpack, DrRacket responds by sayin

Re: [racket] Tools for new languages

2011-07-12 Thread Matthias Felleisen
As much as I welcome the idea of another experimental language in DrRacket, I need to warn you of the potential dangers in your particular case. What I mean specifically with 'your' case is the choice of 'ugly' syntax for Grace. You seem to be determined to use a non-S-expression language (whi

Re: [racket] Tools for new languages

2011-07-12 Thread Eric Tanter
On Jul 12, 2011, at 9:02 AM, Sam Tobin-Hochstadt wrote: > An excellent reference for this (which is also OO in a > non-racket/class like way) is Dave Herman's javascript.plt Planet > package: > http://planet.racket-lang.org/display.ss?package=javascript.plt&owner=dherman intrigued, I opened 5.1.1

Re: [racket] Amazon Linux update causes `require' in 5.1.1 to hang indefinitely?

2011-07-12 Thread Greg Hendershott
> I'd guess it's the what the jit is compiling to as opposed to the > memory manipulations themselves that is causing it to spin. Ah, I see what you mean. In fact that's evident from the "context" for the error message, which differs for JIT on or off: ===[ JIT off ]==

Re: [racket] Amazon Linux update causes `require' in 5.1.1 to hang indefinitely?

2011-07-12 Thread Ray Racine
On Mon, Jul 11, 2011 at 10:46 PM, Eli Barzilay wrote: > An hour and a half ago, Greg Hendershott wrote: > > I've discovered that the problem does NOT happen if I start racket > > with -j a.k.a. --no-jit. > > > > ? > > It might be one of these things that prevent data execution. I helped debug t

Re: [racket] Amazon Linux update causes `require' in 5.1.1 to hang indefinitely?

2011-07-12 Thread Greg Hendershott
> It might be one of these things that prevent data execution. With the > jit on, Racket is basically throwing some numbers into memory and then > executes them -- which is a power that some people don't like. It > (Racket) does do the right thing an marks those memory pages as > executable, but

[racket] Lambda keyboard shortcut

2011-07-12 Thread Ismael Figueroa Palet
Hi all, In DrRacket 5.0.1 in OS X I can press "Cmd + (key left to the non-numeric pad 1)" to write λ. However in DrRacket 5.1.1 I need to press "Cmd + Option/Alt + the other key". In both versions, the Insert Menu shows that to write a lambda you press Cmd + \. is it a bug in previous versions? c

Re: [racket] help: how to make eval see local bindings?

2011-07-12 Thread maurizio.giorda
On Tue, Jul 12, 2011 at 4:36 PM, maurizio.giorda wrote: Hi Matthias, ... I will play with your example (it is better than all the words I spent with my looong

Re: [racket] macro expansion function in Scheme

2011-07-12 Thread Sam Tobin-Hochstadt
I think you want to use `expand' and `eval-syntax', and avoid `syntax->datum' entirely. On Tue, Jul 12, 2011 at 10:30 AM, Bas Steunebrink wrote: > Thanks Matthias and Eli, I understand what expand does and that > syntax->datum throws away too much (by design). Still my question remains of > how t

Re: [racket] macro expansion function in Scheme

2011-07-12 Thread Matthias Felleisen
Since Ryan's stepper does that and renders the expression for you, I suspect he could supply something close to syntax->datum*. On Jul 12, 2011, at 10:30 AM, Bas Steunebrink wrote: > Thanks Matthias and Eli, I understand what expand does and that syntax->datum > throws away too muc

Re: [racket] macro expansion function in Scheme

2011-07-12 Thread Bas Steunebrink
Thanks Matthias and Eli, I understand what expand does and that syntax->datum throws away too much (by design). Still my question remains of how to obtain a datum that is equivalent to a given quoted expression (when eval'ed) but with all macros expanded (generating fresh symbols where necessar

Re: [racket] macro expansion function in Scheme

2011-07-12 Thread Matthias Felleisen
On Jul 12, 2011, at 10:16 AM, Eli Barzilay wrote: > 8 minutes ago, Matthias Felleisen wrote: >> >> The following experiment produces a bit more insight: >> >>> (((eval (expand '(m y))) #t) #f) >> #t >> >> The result of expand compiles to the correct closure. >> >> So the docs for syntax->d

Re: [racket] macro expansion function in Scheme

2011-07-12 Thread Eli Barzilay
8 minutes ago, Matthias Felleisen wrote: > > The following experiment produces a bit more insight: > > > (((eval (expand '(m y))) #t) #f) > #t > > The result of expand compiles to the correct closure. > > So the docs for syntax->datum are dead serious when they say that it > "returns a datum

Re: [racket] help: how to make eval see local bindings?

2011-07-12 Thread Markku Rontu
On Tue, Jul 12, 2011 at 4:36 PM, maurizio.giorda wrote: > ** > Hi Matthias, > > ... I will play with your example (it is better than all the words I spent > with my looong > description: > > Here is what I meant: > > #lang racket > > (define-syntax-rule > (mm x) > (lambda (w) (displayln `(,

Re: [racket] macro expansion function in Scheme

2011-07-12 Thread Matthias Felleisen
On Jul 12, 2011, at 9:32 AM, Bas Steunebrink wrote: > Wow, it was right under my nose! :-) Thanks! > > So I've been playing around with expand but it does not always return what > I'd expect, particularly with making fresh variables. For example: > > > (define-syntax m >(syntax-rules () >

Re: [racket] help: how to make eval see local bindings?

2011-07-12 Thread maurizio.giorda
Hi Matthias, ... I will play with your example (it is better than all the words I spent with my looong description: Here is what I meant:  #lang racket (define-syntax-rule

Re: [racket] macro expansion function in Scheme

2011-07-12 Thread Bas Steunebrink
Wow, it was right under my nose! :-) Thanks! So I've been playing around with expand but it does not always return what I'd expect, particularly with making fresh variables. For example: > (define-syntax m (syntax-rules () ((_ x) (lambda (x) (lambda (y) x) > (((m y) #t) #f

Re: [racket] help: how to make eval see local bindings?

2011-07-12 Thread Matthias Felleisen
On Jul 12, 2011, at 6:41 AM, Maurizio Giordano wrote: > Hi Matthias, hi schemers, > > 2011/7/11 Matthias Felleisen > > Now I don't understand at all why you want to use eval in the macro. > If the right-hand side just returned the lambda that you have there, > it would automatically capture th

Re: [racket] Tools for new languages

2011-07-12 Thread Sam Tobin-Hochstadt
On Tue, Jul 12, 2011 at 8:37 AM, Robby Findler wrote: > Probably the right path is to write a parser (using the parser > collection) that essentially just turns everything into a fully > parenthesized language and then use the macro system from there to > compile into some variant of Racket (you c

Re: [racket] Tools for new languages

2011-07-12 Thread Robby Findler
In the Racket world, OO tends to be a library; it doesn't have to be baked in a low-level thanks to the macro system (specifically the racket/class system is probably the most widely used oo system in Racket). Probably the right path is to write a parser (using the parser collection) that essentia

Re: [racket] macro expansion function in Scheme

2011-07-12 Thread Pierpaolo Bernardi
On Tue, Jul 12, 2011 at 13:49, Bas Steunebrink wrote: > Ciao a tutti, > > I'm looking for a Scheme function that can perform macro expansion on a > quoted expression. I bet someone has implemented such a thing before, but I > can't find it. Maybe someone can point me in the right direction? http:

[racket] Tools for new languages

2011-07-12 Thread Chris Fincher
Hey folks, I'm working with a project that's designing a new pedagogical object-oriented language called Grace . My job is to find a good IDE, and so far, DrRacket has looked like a good choice. I've been slowly figuring out how to get a Grace parser written in Racket, bu

[racket] macro expansion function in Scheme

2011-07-12 Thread Bas Steunebrink
Ciao a tutti, I'm looking for a Scheme function that can perform macro expansion on a quoted expression. I bet someone has implemented such a thing before, but I can't find it. Maybe someone can point me in the right direction? For example, I'm looking for something that works along the follo

Re: [racket] help: how to make eval see local bindings?

2011-07-12 Thread Maurizio Giordano
Hi Matthias, hi schemers, 2011/7/11 Matthias Felleisen > > Now I don't understand at all why you want to use eval in the macro. > If the right-hand side just returned the lambda that you have there, > it would automatically capture the variables in the context of the > gama rule. > > > Have you

[racket] rash (Was:interactive hack)

2011-07-12 Thread Neil Van Dyke
Eli Barzilay wrote at 07/11/2011 11:39 PM: Yesterday, D Herring wrote: rash: racket shell This one should be used by an actual shell-thing. Some student should shamelessly steal "scsh" shell, retrofitting Racket, renaming "rash". -- http://www.neilvandyke.org/ __

[racket] suspicious timing in running test program

2011-07-12 Thread Marco Maggi
Ciao, I am using "plt-r6rs" from Racket 5.1.1 (compiled with default options) on a i686-pc-linux-gnu; when running the tests ofNausicaa/Scheme[1] revision 0.2d10, with precompiled libraries, I get some suspicious timing. First I run a test file[2] which uses some technique