This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: rnrs hashtables


On Oct 13, 2010, at 6:45 PM, Per Bothner wrote:

On 10/13/2010 12:27 PM, Jamison Hope wrote:
There's obviously contention between pure (untyped) RNRS Scheme and
native (typed) Kawa; Per, is it your intention when implementing rnrs
standard libraries to export only the functions in the spec and not the
underlying data types which they use?

A library exports a set of bindings. The rnrs libraries should in principle export the bindings defined by the standard and *only those bindings*. That is the point of a module/library system: to manage name bindings. And if there is a specification for a given library, and we claim to follow the specification, then it would be a bug to export more than the specification specifies.

Fair enough. I suspected that was the intent.


That should be in the documentation, I think.

It seems implied. If the spec exports a named data type, then the implementation should export it. But it it doesn't, it shouldn't since that could cause a name clash or other portability problems.

Well, AFAIK, R6RS doesn't specify bindings for the names of any data types. The closest it comes is specifying related predicates (e.g. pair?, list?, integer?, hashtable?).


The goal is to be able to support a strictly-conforming R6RS mode,
where portable R6RS programs work correctly, and non-R6RS programs
don't work accidentally. In strict-R6RS-mode, if you want to use a
Kawa extension, you have to request it (import it) explicitly,
using a specific 'kawa' import. Of Kawa is very far from supporting
anything like that, and it's not a super-high priority, but at
least we should not deliberately do anything that contradicts that goal.

I guess in this case, I would expect the paragraph at http://www.gnu.org/software/kawa/Hash-tables.html which currently says


Both interfaces use the same underlying datatype, so it is possible to mix and match from both sets. That datatype implements java.util.Map. Freshly-written code should probably use the R6RS functions.


to also have a sentence like "The binding of this datatype to the name 'hashtable' is accessible with (import (kawa hashtable)) or (require <kawa.lib.kawa.hashtable>)." Since Kawa usually has such a strong emphasis on declaring the types of variables (and even rnrs/ hashtables.scm uses type decorations internally), it seems strange that the documentation only acknowledges that "the datatype" implements Map and doesn't actually say what it's called or where to get it.



So then in this eventual strict-R6RS-mode, Kawa's default Scheme environment won't have bindings for any of the data types and will reject the ":: type" decorations? Interesting. I can see why that's low on the priority list.

Thanks for the insight,
Jamie

--
Jamison Hope
The PTR Group
www.theptrgroup.com




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]