[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Omaha.pm] Class::Date - change once set



-----Original Message-----
From: "Balázs Szabó (dLux)" [mailto:dlux@dlux.hu] 
Sent: Tuesday, November 08, 2005 11:32 AM
To: Jay Hannah
Subject: Re: Class::Date - change once set

Hi!

Immutable means if it is created one time, it should not be changed later. Like strings in Java.

So if you want to add something to a Class::Date object, then you have to create a new instance. (Of course, you can hack the values manually if you know the structure of the Class::Date object, but it is designed to be not modifiable.) It won't be the same object.

This is by design. This is why "clone" and "set" basically does the same thing: create a new object based on another one.

Regards,

Balázs / dLux

Jay Hannah wrote: 

		So Class::Date objects are immutable, and I only copied references, and
		it is not really Class::Date specific what you copy with swap1.
		
		Please understand how the @_ variable work! (But before it, understand
		what references are. :-) )
		
		If you need help, just write!
		    

	
	Since I don't even know what "immutable" means, I must not understand. -grin-  Let me study your example and get back to you.
	
	Thanks for the lesson! 
	
	j
	
	  


-- 

Szabó Balázs (dLux)
--   --  - - - -- -