🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #5389

Re: The need for D-scussion (was Re: D Wishlist)

#5389
From: Barry Margolin
Date: Sun, 27 Mar 1988 22:06
21 lines
1268 bytes
In article <3177@haddock.ISC.COM> karl@haddock.ima.isc.com (Karl Heuer) writes:
>In article <10763@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes:
>In Lisp, you're still returning an aggregate.  Things are a little better,
>because you can tighten the scope:
>  (setq z
>        ((lambda (qr) (+ (* (car qr) (car qr)) (* (cdr qr) (cdr qr))))
>         (div x y)))

You're behind the times in your Lisp knowledge.  Common Lisp, and
Zetalisp before it, has functions with true multiple values.  The
above would be written

(setq z (multiple-value-bind (quotient remainder)
	    (floor x y)
	  (+ (* quotient quotient) (* remainder remainder))))

Barry Margolin
Thinking Machines Corp.

barmar@think.com
uunet!think!barmar
Technical Details
Message-ID: <18580@think.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!think!barmar
References: <12176@brl-adm.ARPA> <1988Mar11.215238.976@utzoo.uucp> <719@l.cc.purdue.edu> <10763@mimsy.UUCP> <3177@haddock.ISC.COM>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!think!barmar
From: barmar@think.COM (Barry Margolin)
Newsgroups: comp.lang.misc
Subject: Re: The need for D-scussion (was Re: D Wishlist)
Message-ID: <18580@think.UUCP>
Date: 27 Mar 88 22:06:29 GMT
References: <12176@brl-adm.ARPA> <1988Mar11.215238.976@utzoo.uucp> <719@l.cc.purdue.edu> <10763@mimsy.UUCP> <3177@haddock.ISC.COM>
Sender: usenet@think.UUCP
Reply-To: barmar@fafnir.think.com.UUCP (Barry Margolin)
Organization: Thinking Machines Corporation, Cambridge, MA
Lines: 21