chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] Made a start with CHICKEN 5 proposal


From: John Cowan
Subject: Re: [Chicken-hackers] Made a start with CHICKEN 5 proposal
Date: Mon, 25 Aug 2014 08:46:25 -0400
User-agent: Mutt/1.5.20 (2009-06-14)

Oleg Kolosov scripsit:

> Regarding continuations I think that call/cc is an advanced feature
> people brag about when advocating Scheme but not so useful in practise.

Well, I've been using it a lot in writing my set/bag package for SRFI 113,
albeit in a very stereotyped way:

(call/cc
  (lambda (return)
    (hash-table-for-each
      (lambda (key value)
         ...
         (if (whatever) (return))
         ...))))

In short, where in a C-like language I would use "break".  When iterating
down lists I can use named-let, but when using the internal iterator
of hash tables, there is no protocol for stopping the iteration,
so it's necessary to escape directly.

> Mentioning exceptions, I find whole SRFI-12 quite useless - it's just
> too clunky to use. And looking at newer proposals I find it
> disappointing that Scheme community, given it's rich computer science
> heritage, haven't produced anything better than condition properties. 

IMO condition objects are not very Schemely.  It would be much better
to allow `raise` to accept multiple arguments and deliver multiple
values to the exception handler.  Then the messiness of condition objects
and their incredibly verbose accessors (`hash-table-key-not-found-key',
anybody?) go away.

-- 
John Cowan          http://www.ccil.org/~cowan        address@hidden
Mark Twain on Cecil Rhodes: I admire him, I freely admit it,
and when his time comes I shall buy a piece of the rope for a keepsake.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]