[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Scheme-reports] ANN: first draft of R7RS small language available

10 minutes ago, Vitaly Magerya wrote:
> > Another related reason is the ability to avoid having a binding
> > for `else', without re-binding it just for that purpose.  (See
> > Andre's original post for several more.)
> Andre mentions pedagogical uses like excluding "=>" to make a
> simplified language, and renaming "else" into other (human)
> languages.  Are those actual examples of what teachers do in
> practice?

At least I do -- and I do so extensively.  (In my course I'm using a
number of languages that are all very different from Scheme.)

> BTW, how does Racket deal with such conflicts? Is this a problem in
> practice?

The only place where it was a problem are the contract and the ffi
libraries that both provide their own `->' binding.  Of course, one
way to resolve that is to match `->' symbolically, but that tend to
break hygine in the usual way, which is why it wasn't done.

And BTW -- that `->' thing would break even with some of the
"solutions" that were discussed here -- the contract library provides
a `->' macro, and the ffi library uses it as an infix keyword in the
syntax for function types.  (So if the keyword use would be the usual
comparison with another `->' symbol that is also unbound, it would
break if it gets bound by the contract library.)

> >> There are also historical reasons, i.e. it worked fine in R5RS
> >> where no modules existed (provided you don't shadow "else"
> >> locally).
> >
> > Right -- and that fact (the fact that `else' can be shadowed by a
> > local binding) is a fundamental motivation.
> I thought it was more of a bug than a feature; where can local
> shadowing of "else" or "=>" be useful?

That's probably the case if you think about uses of these that are
only inside `cond'.  To put this in other words, it's a similar
question to: "when would shadowing of `cond' be useful?".  And
obviously, it's a valid question with many languages that take the
other route and forbid any such shadowing.  (Even languages in the
Lisp family -- like CL.)  I think of this freedom as absolutely
essential for a language that should accomodate making new languages
on top of.

(But to be more concrete, consider that `->' case, or some testing
framework that uses `=>' to mark expected results, etc.)

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

Scheme-reports mailing list