Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Functional > Re: Combining m...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 7 of 16 Topic 2817 of 2841
Post > Topic >>

Re: Combining mutable objects with const references

by anonposting@[EMAIL PROTECTED] Apr 24, 2008 at 10:36 AM

Matti Nyk=E4nen:
> But his destructive update silently claims more than he knows: It
> claims that *nobody* will *ever* refer to the previous values, not
> even when the program is modified later.
>
> Uniqueness types/monads/... both enable and force the programmer to
> state such claims explicitly. IMO this is an example of how a software
> engineer reads (or should read) the Curry-Howard isomorphism.

But an imperative programmer is never forced to destructively update.
He can make a new object with the normal constructor, or make a copy
of another object using a copy constructor (i.e. a funcion which makes
a new object identical to an existing one).

However, I only brought the imperative example up as evidence for how
common these types of objects are (object for which it is natural to
destructively update them). I assume you aren't against the feature in
functional languages of having a syntax similar to
(p except .x =3D 5)
which destructively updates. (And it and can never mean "create a new
object" - rather, it is a compiler error if p is required elsewhere,
so it makes an explicit claim.)

So if you disagree with anything, it is that these objects are not
common, everyday objects. Is that so?

Pat




 16 Posts in Topic:
Combining mutable objects with const references
anonposting@[EMAIL PROTEC  2008-04-22 07:32:52 
Re: Combining mutable objects with const references
=?ISO-8859-1?Q?Pertti_Kel  2008-04-22 23:23:43 
Re: Combining mutable objects with const references
anonposting@[EMAIL PROTEC  2008-04-23 06:12:53 
Re: Combining mutable objects with const references
anonposting@[EMAIL PROTEC  2008-04-23 14:05:57 
Re: Combining mutable objects with const references
torbenm@[EMAIL PROTECTED]  2008-04-24 09:35:17 
Re: Combining mutable objects with const references
=?ISO-8859-1?Q?Matti_Nyk=  2008-04-24 09:46:58 
Re: Combining mutable objects with const references
anonposting@[EMAIL PROTEC  2008-04-24 10:36:38 
Re: Combining mutable objects with const references
Paul Rubin <http://phr  2008-04-24 11:39:31 
Re: Combining mutable objects with const references
anonposting@[EMAIL PROTEC  2008-04-24 14:13:19 
Re: Combining mutable objects with const references
Paul Rubin <http://phr  2008-04-24 19:04:30 
Re: Combining mutable objects with const references
anonposting@[EMAIL PROTEC  2008-04-25 04:13:13 
Re: Combining mutable objects with const references
rossberg@[EMAIL PROTECTED  2008-04-25 06:57:19 
Re: Combining mutable objects with const references
Paul Rubin <http://phr  2008-04-25 09:42:29 
Re: Combining mutable objects with const references
anonposting@[EMAIL PROTEC  2008-04-26 05:38:40 
Re: Combining mutable objects with const references
anonposting@[EMAIL PROTEC  2008-04-26 06:07:26 
Re: Combining mutable objects with const references
rossberg@[EMAIL PROTECTED  2008-04-26 10:04:14 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Thu May 15 21:59:43 CDT 2008.