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

Re: Lambda The Ultimate: use failure-thunk instead of default value?

This page is part of the web mail archives of SRFI 69 from before July 7th, 2015. The new archives for SRFI 69 contain all messages, not just those from before July 7th, 2015.



On Thu, Jul 07, 2005 at 02:14:03PM +0100, Tony Garnock-Jones wrote:
> Another alternative might be to have either
>   (hash-table-get ht key [failure-thunk])
>   (hash-table-get/default ht key default)

Yet another alternative would be to have
(hash-table-get* ht key [thunk])
and
(define-syntax hash-table-get
  (syntax-rules ()
    ((_ ht key) (hash-table-get* ht key))
    ((_ ht key expr ...) (hash-table-get* ht key (lambda () expr ...)))))

but maybe people don't like macros for such simple stuff.

Panu

-- 
personal contact: atehwa@xxxxxx, +35841 5323835, +3589 85619369
work contact: pkalliok@xxxxxxxxxxxxxxxx, +35850 3678003
kotisivu (henkkoht):	http://www.iki.fi/atehwa/
homepage (technical):	http://sange.fi/~atehwa/