Re: [racket] Nested scope in D vs Racket

2010-08-23 Thread Eli Barzilay
On Aug 23, Matthew Flatt wrote: > At Mon, 23 Aug 2010 12:39:14 -0400, Eli Barzilay wrote: > > > It certainly is a mighty pity that typing "internal define" yields > > > no hits in Help Desk. (Eli, are you reading?) > > > > It's a matter of adding an index term, IIRC. Maybe Jon will want > > to a

Re: [racket] Nested scope in D vs Racket

2010-08-23 Thread Matthew Flatt
At Mon, 23 Aug 2010 12:39:14 -0400, Eli Barzilay wrote: > > It certainly is a mighty pity that typing "internal define" yields > > no hits in Help Desk. (Eli, are you reading?) > > It's a matter of adding an index term, IIRC. Maybe Jon will want to > add that? It's already indexed as "internal

Re: [racket] Nested scope in D vs Racket

2010-08-23 Thread Eli Barzilay
On Aug 21, Paul Ojanen wrote: > I have been forced to learn the options of require due to naming > conflicts. Is this global masking not being allowed? Or are my > require conflicts problematic because my imported identifiers are > coming in AT THE SAME LEVEL? [...] The latter -- requiring the

Re: [racket] Nested scope in D vs Racket

2010-08-23 Thread Eli Barzilay
On Aug 21, Shriram Krishnamurthi wrote: > I *think* this was in the 5.0.1 release announcement? The 5.0.1 change was to allow definitions anywhere in the body: (define (foo) (printf "hello ") (define x 'world) (displayln x)) (Note that that's not in the teaching languages.) >

Re: [racket] Nested scope in D vs Racket

2010-08-23 Thread Eli Barzilay
On Aug 23, John Clements wrote: > "Hopefully we can agree that the value of this program is 8 (the > left x in the addition evaluates to 5, the right x is given the > value 3 by the inner with, so the sum is 8). The refined > substitution algorithm, however, converts this expression into > > {with

Re: [racket] Nested scope in D vs Racket

2010-08-23 Thread John Clements
This brings up an interesting moment in PLAI that always elicits totally blank stares: the moment in lecture that matches this part of the book, on page 34 of the current online version: "Hopefully we can agree that the value of this program is 8 (the left x in the addition evaluates to 5, the

Re: [racket] Nested scope in D vs Racket

2010-08-22 Thread Stephen Bloch
So the short-and-sweet message is that "local" and "internal define" act more like "letrec" than like "let"? That makes sense, as it allows people to write recursive functions. Intuitively, it seems useful to have both semantics available to programmers. Stephen Bloch sbl...@adelphi.edu

Re: [racket] Nested scope in D vs Racket

2010-08-21 Thread Richard Cleis
On Aug 21, 2010, at 1:21 PM, Shriram Krishnamurthi wrote: Your reduction of this guideline to what you claim Hansen preached (I haven't seen that essay) is unfair. The D guideline does not say "don't have nested scope". It says to not allow lexical re-binding, which is a much, much finer

Re: [racket] Nested scope in D vs Racket

2010-08-21 Thread Shriram Krishnamurthi
I *think* this was in the 5.0.1 release announcement? It certainly is a mighty pity that typing "internal define" yields no hits in Help Desk. (Eli, are you reading?) On Sat, Aug 21, 2010 at 1:50 PM, Mark Engelberg wrote: > On Sat, Aug 21, 2010 at 8:39 AM, Shriram Krishnamurthi > wrote: >> Or

Re: [racket] Nested scope in D vs Racket

2010-08-21 Thread Shriram Krishnamurthi
Your reduction of this guideline to what you claim Hansen preached (I haven't seen that essay) is unfair. The D guideline does not say "don't have nested scope". It says to not allow lexical re-binding, which is a much, much finer point. Given how many languages get this sort of thing just plain

Re: [racket] Nested scope in D vs Racket

2010-08-21 Thread Mark Engelberg
On Sat, Aug 21, 2010 at 8:39 AM, Shriram Krishnamurthi wrote: > Or if you prefer the new direction we're going in: > (define (bar x) >  (lambda () >    (define x x) >    x)) I like the new direction. Where are all the possible places that a define can go without wrapping it in a local? How do

Re: [racket] Nested scope in D vs Racket

2010-08-21 Thread Jos Koot
> >> Felleisen > >> Sent: 21 August 2010 17:43 > >> To: Shriram Krishnamurthi > >> Cc: users@racket-lang.org; Eduardo Cavazos > >> Subject: Re: [racket] Nested scope in D vs Racket > >> > >> > >> Okay, that's the one thin

Re: [racket] Nested scope in D vs Racket

2010-08-21 Thread Shriram Krishnamurthi
t; >> -Original Message- >> From: users-boun...@racket-lang.org >> [mailto:users-boun...@racket-lang.org] On Behalf Of Matthias Felleisen >> Sent: 21 August 2010 17:43 >> To: Shriram Krishnamurthi >> Cc: users@racket-lang.org; Eduardo Cavazos >> Su

Re: [racket] Nested scope in D vs Racket

2010-08-21 Thread Jos Koot
t 2010 17:43 > To: Shriram Krishnamurthi > Cc: users@racket-lang.org; Eduardo Cavazos > Subject: Re: [racket] Nested scope in D vs Racket > > > Okay, that's the one thing why I dislike local and internal define. > But should we really throw out the

Re: [racket] Nested scope in D vs Racket

2010-08-21 Thread Matthias Felleisen
Okay, that's the one thing why I dislike local and internal define. But should we really throw out the idea of nested x defs for this one flaw? On Aug 21, 2010, at 11:39 AM, Shriram Krishnamurthi wrote: > On Sat, Aug 21, 2010 at 10:53 AM, Matthias Felleisen > wrote: >> >> It's not about te

Re: [racket] Nested scope in D vs Racket

2010-08-21 Thread Shriram Krishnamurthi
On Sat, Aug 21, 2010 at 10:53 AM, Matthias Felleisen wrote: > > It's not about teaching, it's about freedom of expression. > This is one of the least problems for programmers and I can't > think of a bug I have seen that involved this issue. Radio Free Matthias is broadcasting from back his Schem

Re: [racket] Nested scope in D vs Racket

2010-08-21 Thread Matthias Felleisen
racket-lang.org] >> On Behalf Of Paul Ojanen >> Sent: Saturday, August 21, 2010 8:17 AM >> To: 'Eduardo Cavazos'; users@racket-lang.org >> Subject: Re: [racket] Nested scope in D vs Racket >> >> How about these two points from the referenced rationale: >

Re: [racket] Nested scope in D vs Racket

2010-08-21 Thread Paul Ojanen
ingful variable names, I would say enclosing-scope masking is very > important as a feature. Not necessary but certainly not useless. > > -Paul > > > -Original Message- > > From: users-boun...@racket-lang.org [mailto:users-boun...@racket- > lang.org] > >

Re: [racket] Nested scope in D vs Racket

2010-08-21 Thread Paul Ojanen
sage- > From: users-boun...@racket-lang.org [mailto:users-boun...@racket-lang.org] > On Behalf Of Eduardo Cavazos > Sent: Saturday, August 21, 2010 3:33 AM > To: users@racket-lang.org > Subject: [racket] Nested scope in D vs Racket > > Hello, > > The first example in this n

Re: [racket] Nested scope in D vs Racket

2010-08-21 Thread Stephen Bloch
On Aug 21, 2010, at 3:32 AM, Eduardo Cavazos wrote: (let ((a 20)) (let ((a 30)) ...)) It sounds like the D designers are "protecting" the programmers. The Racket team is of course concerned with the "teachability" of their languages and have experience with the known pitfalls in lan

[racket] Nested scope in D vs Racket

2010-08-21 Thread Eduardo Cavazos
Hello, The first example in this note is illegal in the D programming language: http://lists.puremagic.com/pipermail/digitalmars-d/2010-August/081424.html Coming from a Scheme background, I was surprised as this is allowed in Scheme. I.e. this is the quivalent code in Scheme: (let ((a 20))