Discussion:
[Larceny-users] Exporting 'fields'
Eduardo Cavazos
2009-12-29 08:49:38 UTC
Permalink
Hello,

I have a library which acts as a wrapper around the '(rnrs)' library.
I.e. it simply re-exports some stuff from rnrs plus some other things.

In the library that I use with Ikarus and Ypsilon, I export 'fields'
which is used with 'define-record-type'. However, 'fields' isn't
exported by '(rnrs)' in Larceny.

So... any suggestions for how to write the library portably? Should
'fields' be exported by '(rnrs)'?

Ed
Marco Maggi
2009-12-29 09:37:50 UTC
Permalink
I have a library which acts as a wrapper around the
'(rnrs)' library. I.e. it simply re-exports some stuff
from rnrs plus some other things.
This is what I do in the following libraries:

<http://github.com/marcomaggi/nausicaa/raw/master/scheme/src/libraries/nausicaa.larceny.sls>
<http://github.com/marcomaggi/nausicaa/raw/master/scheme/src/libraries/nausicaa.ikarus.sls>
<http://github.com/marcomaggi/nausicaa/raw/master/scheme/src/libraries/nausicaa.mosh.sls>
<http://github.com/marcomaggi/nausicaa/raw/master/scheme/src/libraries/nausicaa.ypsilon.sls>

HTH
--
Marco Maggi
Eduardo Cavazos
2009-12-30 11:49:42 UTC
Permalink
Post by Eduardo Cavazos
I have a library which acts as a wrapper around the '(rnrs)' library.
I.e. it simply re-exports some stuff from rnrs plus some other things.
In the library that I use with Ikarus and Ypsilon, I export 'fields'
which is used with 'define-record-type'. However, 'fields' isn't
exported by '(rnrs)' in Larceny.
So... any suggestions for how to write the library portably? Should
'fields' be exported by '(rnrs)'?
Aha!
Eduardo Cavazos
2010-02-11 12:48:30 UTC
Permalink
Post by Eduardo Cavazos
I have a library which acts as a wrapper around the '(rnrs)' library.
I.e. it simply re-exports some stuff from rnrs plus some other things.
In the library that I use with Ikarus and Ypsilon, I export 'fields'
which is used with 'define-record-type'. However, 'fields' isn't
exported by '(rnrs)' in Larceny.
So... any suggestions for how to write the library portably? Should
'fields' be exported by '(rnrs)'?
I thought I'd mention that this issue came about while getting my 'mpl'
project running with Larceny. Some info about mpl:

http://github.com/dharmatech/mpl/blob/master/mpl.org

In particular, the library '(mpl rnrs-sans)':

http://github.com/dharmatech/mpl/blob/master/rnrs-sans.sls

is what's trying to export 'fields'.

It'd be great to add Larceny to the list of supported Schemes.

Ed
Eduardo Cavazos
2010-05-18 05:02:19 UTC
Permalink
Post by Eduardo Cavazos
Post by Eduardo Cavazos
I have a library which acts as a wrapper around the '(rnrs)' library.
I.e. it simply re-exports some stuff from rnrs plus some other things.
In the library that I use with Ikarus and Ypsilon, I export 'fields'
which is used with 'define-record-type'. However, 'fields' isn't
exported by '(rnrs)' in Larceny.
So... any suggestions for how to write the library portably? Should
'fields' be exported by '(rnrs)'?
I thought I'd mention that this issue came about while getting my 'mpl'
   http://github.com/dharmatech/mpl/blob/master/mpl.org
   http://github.com/dharmatech/mpl/blob/master/rnrs-sans.sls
is what's trying to export 'fields'.
It'd be great to add Larceny to the list of supported Schemes.
I was curious to see if Larceny would run the test suite so I setup a
branch which doesn't export 'fields' and other auxilliary items. It
passed all but 2 of the 227 tests. And those two are related to the
'(exp 0)' -> 1.0 behaviour. So this is good news.

The tests are at:

http://github.com/dharmatech/mpl/blob/master/test.sls

Ed

w***@ccs.neu.edu
2010-02-14 16:19:56 UTC
Permalink
Post by Eduardo Cavazos
So... any suggestions for how to write the library portably?
Because the fields identifier is not exported by the
(rnrs records syntactic) library, I believe the best
way to write the library portably is to stick with the
procedural layer.
Post by Eduardo Cavazos
Should 'fields' be exported by '(rnrs)'?
In formal comment 267, I noted inconsistencies within the
5.94 draft. Example: According to that draft, 'fields'
was to have been exported by (rnrs records syntactic), but
'big' was not to have been exported by (rnrs bytevector):

http://www.r6rs.org/formal-comments/comment-267.txt

In response to my formal comment, a majority of the editors
decided to fix the inconsistency by not exporting any of
the syntactic keywords. The 5.94 draft language that had
'fields' being exported from (rnrs records syntactic) was
removed from the report. According the R6RS documents that
were ratified by about two-thirds of the electorate, the
'fields' keyword is not exported.

In Larceny's lib/R6RS/rnrs/records/syntactic.sls, there is
a FIXME comment asking whether 'fields' should be exported
by (rnrs records syntactic). That comment may precede the
ratification of the R6RS, and may have motivated my filing
of formal comment 267.

If a clear consensus of R6RS implementors and users have
decided that not exporting syntactic keywords is a bug, then
we will certainly change Larceny's behavior. As we have said,
we are not committed to conforming to known errors within the
R6RS documents, even when those errors represent deliberate
weakness and restrictions (as in the editors' response to
formal comment 267).

Will
Eduardo Cavazos
2010-02-14 17:10:52 UTC
Permalink
Post by w***@ccs.neu.edu
If a clear consensus of R6RS implementors and users have
decided that not exporting syntactic keywords is a bug, then
we will certainly change Larceny's behavior. As we have said,
we are not committed to conforming to known errors within the
R6RS documents, even when those errors represent deliberate
weakness and restrictions (as in the editors' response to
formal comment 267).
Thanks for the throrough explanation Will.

As far as a consensus goes, I can't speak for implementors and users.
But, this script:

(import (only (rnrs records syntactic) fields))

loads without error in Ikarus, Ypsilon, Chez, and Mosh on my system.

Ed
Andrew Reilly
2010-02-14 22:22:34 UTC
Permalink
On Sun, 14 Feb 2010 11:10:52 -0600
Post by Eduardo Cavazos
Post by w***@ccs.neu.edu
If a clear consensus of R6RS implementors and users have
decided that not exporting syntactic keywords is a bug, then
we will certainly change Larceny's behavior. As we have said,
we are not committed to conforming to known errors within the
R6RS documents, even when those errors represent deliberate
weakness and restrictions (as in the editors' response to
formal comment 267).
Thanks for the throrough explanation Will.
As far as a consensus goes, I can't speak for implementors and users.
(import (only (rnrs records syntactic) fields))
loads without error in Ikarus, Ypsilon, Chez, and Mosh on my system.
FWIW, that line didn't seem to cause a problem on mzscheme
(4.2.2) on my system, either.

Cheers,
--
Andrew
Loading...