[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[sc-dev] Re: Towards SC 4
- To: sc-dev@xxxxxxxxxxxxxxxx
- Subject: [sc-dev] Re: Towards SC 4
- From: Rohan Drape <rohan.drape@xxxxxxxxx>
- Date: Sat, 07 Dec 2013 10:30:45 +1100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:user-agent:mime-version :content-type; bh=piSnVKZQ2wT0E3dd7G3FwhrhI6jYwNSCoy4g/kiY08E=; b=ce520gB4xDI2QOj7NbUAAgNy9uLKkmSGPoYj/kdRq6oID773U0xzNdpmmOvDjzrpOB H9PrOEDZv+Ih6pQi6xiLNwSixIN40cHQ84rDUquR5j9ogGRC/q1fanAnsSjNUsJfQxIv X58QaIwKJkM14am7+m77qD7XbST7VAkW7WxSL+nAKfuL3QmRczcTNCq9GxDk+bDnMrSp 4Q2zNI7m5DbnmqChoguT7RnFMb2b9+w1q4fQmK8MKpQfoqdZisqQJYOy6jsAwwNKZhQ1 n6VzbJST5+1HqWA2LtLnjun0BMMrSYS1RgL8oCC/m+NeexTjl6x2fgfI51R6qKUnMWBN TayQ==
- List-id: SuperCollider developers mailing list <sc-devel.create.ucsb.edu>
- Reply-to: sc-dev@xxxxxxxxxxxxxxxx
- Sender: owner-sc-dev@xxxxxxxxxxxxxxxx
- User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)
Dear List (& Miguel),
This is all a little off-topic here, so very briefly.
I'm afraid I can't help about non-Emacs editors.
About types & references though:
Haskell does has various forms of mutable references.
The notation is different, but the type constraints are
the same as those in sclanguage.
In sclanguage, if you change the latent type of a value
bound to a reference you will get an error when you try
to use the value.
f = 5;
g = {|n| f - n};
g.(4) == 1;
f = "5";
g.(4); /* ==> error */
In haskell the interpreter won't let you write a type
incoherent value to a reference.
It's more or less the "same difference"?
The error arrives one step earlier.
f <- newIORef (5::Integer)
let g n = fmap (subtract n) (readIORef f)
fmap (== 1) (g 4)
writeIORef f "5" {- ==> error -}
But mutable references are like heterogenous sequences,
rather esoteric & only very rarely necessary!
Best,
Rohan
_______________________________________________
sc-dev mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/