Anonymous user
Multiple distinct objects: Difference between revisions
m
Formatting fix, added headers
(new task (inspired by the *name* of "Create a Sequence of unique elements")) |
m (Formatting fix, added headers) |
||
Line 8:
This task mostly makes sense for languages operating in the pass-references-by-value style (most object-oriented or 'dynamic' languages).
=={{header|C}}==
(Or if no particular initialization is needed, skip that part, or use <
==Common Lisp==▼
▲=={{header|Common Lisp}}==
The mistake is often written as one of these:
which are incorrect since <code>(make-the-distinct-thing)</code> is only evaluated once. A common correct version is:
which evaluates <
=={{header|Haskell}}==
If the creator of the distinct thing is in some monad, then one can write
in an appropriate do block. If it is distinguished by, say, a numeric label, one could write
|