[racket-dev] syntax-property guards? (was: Re: The Stepper strikes again)
Earlier today, Stephen Chang wrote:
>
> It seems like most people agree that it's ok to add stepper syntax
> properties to lazy racket.
I agree with that in general while development is ongoing, but
eventually it should be disconnected too.
> The problem is that the lazy language is split between two files:
> lazy/lazy.rkt and racket/private/promise.rkt, with promise.rkt also
> trying to be a generic library at the same time.
That, I *strongly* object to! The promise implementation is just
that. It is *not* a part of the lazy language implementation in a
similar way that `car' is not a part of the implementation of
languages that happen to use it.
> That was fine when a third party didnt need to communicate something
> to both files at once but now the stepper does.
>
> The duplicated function, stepper-syntax-property, is just
> syntax-property with a 'stepper key. If I do what Eli says and only
> use generic documented functions in promise.rkt, I can use
> syntax-property, but I still need to somehow communicate the 'stepper
> key to both lazy.rkt and promise.rkt.
What I object to is the property name, and more importantly, writing
code that is aware that there is a "bag of stepper properties". We
can deal with plain properties just fine, and if a property is generic
enough it should be describable independently. (And if there's no
easy way to describe it independently, then most likely it should go
away from the general API.)
> Other languages wont have this problem because the implementation is
> likely all in one place. Other tools for lazy racket may have this
> problem if they need to communicate something to both lazy.rkt and
> promise.rkt, but could possibly get away with it if everything can be
> done in the lazy.rkt section of the language.
Lazy is indeed a major client for (composable) promises, but it's not
the only one. This fact makes it unsurprising that things that the
lazy implementation needs tend to motivate designing and extending the
promise API, but that API is still independent.
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://barzilay.org/ Maze is Life!