[gambit-list] A |table-for-each| /whose traversal continuation is/ wrapped in a closure

Mikael mikael.rcv at gmail.com
Mon Sep 22 11:11:01 EDT 2014


Dear Marc,

A |table-for-each| whose traversal continuation is wrapped in a closure
would be much needed!

Actually, this could be delivered by a |table-for-each| that is wrapped
completely into a closure i.e.

(table-enumerator table) => a procedure either returning a pair (key .
value), or #f = reached table's end.

Preferably this should implemented as part of Gambit itself, as the
hashtables functionality is Gambit-internal.


The reason for the need is that sometimes you need to be able to return at
dynamic points within a table traversal in the same fashion as you can in
an ordinary Scheme loop.

It's easy to traverse a list or a vector in this fashion using |car|/|cdr|
and |vector-ref| , however for tables right now there's no way to do the
same but all that is locked into |for-each|'s semanstics which is
incredibly limited as long as you don't work around it using |call/cc| ,
which is really unnecessary - so, |table-enumerator| implementation time? :D

Reflections?

Thanks,
Mikael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20140922/d6036972/attachment.htm>


More information about the Gambit-list mailing list