Re: porting SRFIs to PLT
Jens Axel Søgaard <[email protected]> Mon, 09 May 2005 15:10:48 +0200
| Newsgroups | gmane.lisp.scheme.plt.schematics |
|---|---|
| Message-ID | <[email protected]> |
Chongkai Zhu wrote:
> I still think that my current porting is right.
> SRFI-45 redefine "delay" and "force" of R5RS.
> "promise?" is obviously related to "delay" and
> "force".
>=20
> The key point is: R5RS doesn't define "promise?" but
> MzScheme do.
>=20
> Actually my port just provide two interface. (require
> (lib "43.ss" "srfi")) provides "delay" "force" and
> "promise?" (and others) whose semantics agrees with
> those of MzScheme. (require lib "lazy.ss" "43" "srfi")
> provides "s:delay" "s:force" and "srfi-45-promise?",
> for use inside a module.
The question of how to load srfi-1 in mzscheme comes up
again and again. The reasons are 1) that people think it
is loaded like the rest of the srfis, 2) that people
use mzscheme and doesn't check the HelpDesk 3) that
the special way of loading srfi-1 is mentioned at the bottom
of the page explaining srfis in the HelpDesk. [and since
it isn't on screen most people miss it]
The beginner friendly solution of letting (lib (lib "1.ss" "srfi"))
names conflicting with mzscheme with a prefixed s: would
work until people incidently need the corner case, where there
is a difference. The problem is that they never get a warning.
The fail-early approach is to export the conflicting names
in (lib "1.ss" "srfi") which will force users to choose between
the conflicting names -- this requires more knowledge of the
module system.
Since bugs in situations without warnings are hard to catch, the
fail-early approach is probably best. BUT it requires the
documentation to include examples.
In short, I think it would be best if (lib "43.ss" "srfi"))
exported delay, force and promise with the srfi-semantics and,
say, (lib "no-conflicts.ss" "43" "srfi") exported the both
the mzscheme ones (with normal names) and the srfi ones
(with a prefixed s:).
Alternatively, we could lobby for extra syntax to specify
the srfis together with the base language - and let the
module system handle conflicts.
E.g.
(module foo (mzscheme srfi-1 srfi-47)
<top-level-exprs>)
"expands" to
(module foo mzscheme-without-srfi-1-and-srfi-47-names
(require (lib "1.ss" "srfi"))
(require (lib "47.ss" "srfi"))
<top-level-exprs>)
--=20
Jens Axel S=F8gaard
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20