Article View: comp.lang.misc
Article #2319Re: Two questions
From: Dave Mason
Date: Tue, 06 Oct 1992 14:34
Date: Tue, 06 Oct 1992 14:34
38 lines
1535 bytes
1535 bytes
In article <1992Oct2.164936.20520@cs.brown.edu> sdm@cs.brown.edu (Scott Meyers) writes:
> 2. Some languages allow for multiple assignments as part of the same
> statement, where the semantics are that all right-hand sides are
> evaluated before any left-hand sides. To swap x and y, then, you can
> just write this:
>
> x = y, y = x
>
> This is completely deterministic -- it's not the same as saying that
> the two assignments are carried out in parallel.
Dijkstra's guarded command language, although the syntax is:
x,y := y,x
@book{gries:science,
title="The Science of Programming",
author="David Gries",
publisher="Springer-Verlag",
year=1981,
address=SV-addr,
isbn="0-387-90641-X",
call="QA76.6.G747"
}
SML also allows this, with syntax:
val (x,y) = (y,x)
@book{
AUTHOR={Robin Milner and Mads Tofte and Robert Harper},
TITLE={The definition of Standard ML},
address={Cambridge, Mass.},
publisher={MIT Press},
year=1990,
ISBN="0262132559"
}
../Dave
Technical Details
Message-ID:
<DMASON.92Oct6103445@plg.plg.uwaterloo.ca>Path:
arc1-ca.pugleaf.net!sparky!uunet!utcsri!skule.ecf!torn!watserv2.uwaterloo.ca!watmath!math!dmasonReferences:
<1992Oct2.164936.20520@cs.brown.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.misc Path: arc1-ca.pugleaf.net!sparky!uunet!utcsri!skule.ecf!torn!watserv2.uwaterloo.ca!watmath!math!dmason From: dmason@plg.uwaterloo.ca (Dave Mason) Subject: Re: Two questions In-Reply-To: sdm@cs.brown.edu's message of 2 Oct 92 16:49:36 GMT Message-ID: <DMASON.92Oct6103445@plg.plg.uwaterloo.ca> Sender: news@math.uwaterloo.ca (News Owner) Organization: /u2/dmason/.organization References: <1992Oct2.164936.20520@cs.brown.edu> Date: Tue, 6 Oct 1992 14:34:45 GMT Lines: 38