On 30-Apr-09, at 4:54 PM, Briggs, Jamie wrote:
The readtable stuff in gambit is different, obviously, so how would I go about tackling this problem? I've done some reading and trying different things but my scheme chops are weak and at this point I'm stumped.
You'll have to use some of the hidden readtable features. Attached is what you want.
Marc
That did the trick, thank you!
I'm curious, why are these features "hidden"? Is the API still under development or is it just that the documentation hasn't caught up yet?
- Jamie
Afficher les réponses par date
On 1-May-09, at 6:04 PM, Jamie Briggs wrote:
On 30-Apr-09, at 4:54 PM, Briggs, Jamie wrote:
The readtable stuff in gambit is different, obviously, so how
would
I go about tackling this problem? I've done some reading and trying different things but my scheme
chops
are weak and at this point I'm stumped.
You'll have to use some of the hidden readtable features. Attached is what you want.
Marc
That did the trick, thank you!
I'm curious, why are these features "hidden"? Is the API still under development or is it just that the documentation hasn't caught up yet?
The API of that readtable functionality is imperative (it side-effects the readtable). I would prefer a functional API (I admit, not too hard to do). Anyway, the thing is that I view the "##" primitives as more fluid in their API as the non-## primitives. There are no guarantees that the ## primitives will maintain their API over future versions of Gambit. There are no guarantees for the non-## primitives either, but I would need a very good reason to change the API. So the user can rely on the non-## primitives much more than the non-## ones.
Marc
On 1-May-09, at 6:40 PM, Marc Feeley wrote:
The API of that readtable functionality is imperative (it side-effects the readtable). I would prefer a functional API (I admit, not too hard to do). Anyway, the thing is that I view the "##" primitives as more fluid in their API as the non-## primitives. There are no guarantees that the ## primitives will maintain their API over future versions of Gambit. There are no guarantees for the non-## primitives either, but I would need a very good reason to change the API. So the user can rely on the non-## primitives much more than the non-## ones.
Of course I meant "... more than the ## ones".
In the case of the readtable procedure ##readtable-char-class-set! I hesitate to make that particular API final. Currently the API is:
(##readtable-char-class-set! rt c delimiter? handler)
The readtable rt will classify the character c as a delimiter (iff delimiter? is true) and when character c is encountered by the reader as an initial character of a token, it will call the handler procedure. The handler's API is
(handler re c)
Here re is the "read-environment", a structure which packages various information useful for the reader (the input port, the readtable, the location information, etc), and c is the character that caused this handler to be called (multiple characters can have the same handler, for example open parenthesis and open bracket).
All of this is "reasonable", but might change in the future. Moreover documenting this stuff is a slippery slope cause it exposes the reader's implementation, and the reader is a pretty complex beast.
Marc