`recipient'

Subject: `recipient'
From: Alexander Taranov <tay@xxxxxxxxxx>
Date: Mon, 27 Apr 1998 16:13:45 +0400 (MSD)
Steve Tinney writes:
 > Could someone explain in simple terms and with an example or two the
 > utility of the `=> recipient' construct in cond clauses?
Simple example

(cond ((assoc 'me  paylist) => cdr)
      (else "theree is no money for you))


without => to avoid double evaluation of assoc you should write

(let ((payment (assoc 'me  paylist)))
   (cond (payment (cdr payment))
         (else "theree is no money for you)))

so => remember result of test and passes it to proc of 1 arg.



 > 
 > This is one of those things that looks like it should be the basis of
 > neat tricks, but I don't really get it yet.
 > 
 > Thanks,
 > 
 >  Steve
 > 
 > ----------------------------------------------------------------------
 > Steve Tinney                                        Babylonian Section
 >                                  *   University of Pennsylvania Museum
 > stinney@xxxxxxxxxxxxx                          Phila, PA. 215-898-4047
 > 
 > 
 >  DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread
  • `recipient'
    • Steve Tinney - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id HAA18273Mon, 27 Apr 1998 07:49:11 -0400 (EDT)
      • Alexander Taranov - from mail1.ability.netby web4-1.ability.net (8.8.5/8.6.12) with ESMTP id IAA18769Mon, 27 Apr 1998 08:16:08 -0400 (EDT) <=