Joshua D. Guttman | 5 Apr 21:58 1995
Picon

Exiting after (start-threads)

Banner: 
  Welcome to Scheme 48 0.36 (made by guttman on Thu Dec 22 17:13:32 EST 1994).

I do 

> ,open big-scheme threads more-threads 
> (start-threads)
Multitasking started

after which I load code which starts some threads which encounter
errors.  If I then issue the command 

> ,exit 

I get a core dump.  Is this a known bug?  Is there some way to destroy
the threads and exit cleanly?  Would you like to see a real example?
Thanks.   

	Josh

Olin Shivers | 19 Apr 18:43 1995
Picon

table package

table-walk is not the right primitive, or at least should be augmented
by table-reduce.

(table-reduce proc seed table) would allow side-effect free ways to
loop over a table, computing some value. table->list, max-elt, etc., etc.
are all defineable with this primitive (as is table-walk).

Generally speaking, I feel that iteration patterns are best primitively 
expressed in two ways:
    - a reducer
    - a generator
Generators are nice because they let you integrate the iteration pattern
in with other iteration patterns -- i.e. if you want a loop that
    - loops x over the elts of a hash table
    -       y over the elts of another hash table
    -       z over a vector
then having generators for all three allows you to merge them into a common
loop. Single-data structure reducers don't allow this.

A general generator interface might be
    (table-cursor table)		; A cursor captures iteration state.
    (eos-cursor? cursor table)		; At end of sequence?
    (step-cursor cursor table) -> [cursor' elt] or error if at end of iteration

For a vector, the cursor is an integer index.
One could argue about whether or not the cursor should contain the
object into which it points -- flushing the TABLE arg from the CURSOR-DONE?
and STEP-CURSOR procs.

As a further sleaze, one could hardwire the end-of-sequence cursor to be #f,
(Continue reading)

Jim Blandy | 19 Apr 19:18 1995
Picon
Picon

table package


>table-walk is not the right primitive, or at least should be augmented
>by table-reduce.

Henry Baker has published a diatribe against iterators (what you call
"cursors" or "generators"):

"Iterators: Signs of Weakness in Object-Oriented Languages".  ACM OOPS
Messenger 4, 3 (July 1993), 18-25. If your language requires iterators
in order to get anything done, your language's control structures are
grossly deficient.

also available as

ftp://ftp.netcom.com/pub/hb/Iterator.html

The most graceful approach to iteration I have yet seen appears in
Haskell and Miranda, making good use of normal-order evaluation.  A
function generating a list of indices can be used in a loop.  Given a
proper implementation, the list itself will never be generated, and
the list of indices need not be finite.  The "list comprehension"
notation provides a remarkably general way to do several iterations at
once.

kelsey | 19 Apr 20:09 1995
Picon

Re: table package


   From: Olin Shivers <shivers <at> clark.lcs.mit.edu>
   Date: Wed, 19 Apr 95 12:43:08 -0400

   (table-reduce proc seed table) would allow side-effect free ways to
   loop over a table, computing some value. table->list, max-elt, etc., etc.
   are all defineable with this primitive (as is table-walk).

Sounds good.

   Generally speaking, I feel that iteration patterns are best primitively 
   expressed in two ways:
       - a reducer
       - a generator
   Generators are nice because they let you integrate the iteration pattern
   in with other iteration patterns -- i.e. if you want a loop that
       - loops x over the elts of a hash table
       -       y over the elts of another hash table
       -       z over a vector
   then having generators for all three allows you to merge them into a common
   loop. Single-data structure reducers don't allow this.

Simultaneous iteration over several sets makes sense only if the
sets are ordered, and tables aren't.  Mapping a function over
a collection of randomly selected element pairs from two tables
is rarely going to be useful.
                                      -Richard

jsc | 24 Apr 07:26 1995
Picon

Scheme48 fails test.scm

There is an R4RS compliance tester called test.scm that's available from
the Scheme resources home page. I ran it under scheme48 (v0.36) and it
fails several of the tests, mostly dealing with numbers.

ftp://ftp.cs.indiana.edu:pub/scheme-repository/code/lang/test.scm


Gmane