Ahhhhh, that makes sense!
Good to know!

Is this also true for 2.0?

Cheers!

On Mon, Feb 1, 2010 at 5:58 PM, Aaron Newton <[email protected]> wrote:

> guys, I think you're getting upset over nothing. MooTools 1.3 has
> Object.clone, that is, a method called clone on the Object namespace - not
> on its prototype. If, for example, there were an Array or Object that had a
> clone method, it would not collide with this.
>
> var cloner = { clone: function(){ alert('clone!'); } };
> cloner.clone(); //alerts "clone!"
> var cloned = Object.clone(cloner);
> cloned.clone(); //alerts "clone!"
>
> no collisions.
>
>
> On Mon, Feb 1, 2010 at 5:09 AM, Roman Land <[email protected]> wrote:
>
>> Here you can see the list of classes using the .clone:
>>
>> http://dev.openlayers.org/releases/OpenLayers-2.8/doc/apidocs/index/Functions2.html#C
>>
>> Looking in the code it seems they are "faking" it: (OpenLayers.LonLat
>> implementation of .clone)
>>
>> /**
>>      * APIMethod: clone
>>      *
>>      * Returns:
>>      * {<OpenLayers.LonLat>} New OpenLayers.LonLat object with the same
>> lon
>>      *                       and lat values
>>      */
>>     clone:function() {
>>         return new OpenLayers.LonLat(this.lon, this.lat);
>>
>>     },
>>
>>
>> 2010/2/1 Fábio M. Costa <[email protected]>
>>
>>> How does it works?
>>> {}.clone() returns the clone or you have to do Object.clone({})?
>>> And whats the behavior? because they might behave exactly the same.
>>>
>>> --
>>> Fábio Miranda Costa
>>> Solucione Sistemas
>>> Engenheiro de interfaces
>>>
>>>
>>> On Mon, Feb 1, 2010 at 10:56 AM, Roman Land <[email protected]>wrote:
>>>
>>>> I see I see.. so no way to opt out =/
>>>> So no friendly mode for mootools? (other then the $ friendly mode)
>>>>
>>>> Upgrading will not be as simple, maybe this can be avoided by using
>>>> closures.. I better wip up many tests eh...
>>>>
>>>> Thanks for the heads up!
>>>>
>>>>
>>>> 2010/2/1 Fábio M. Costa <[email protected]>
>>>>
>>>>> ok thanks for your time.
>>>>> All the dollar functions ($defined, $unlink, etc.) will be deprecated
>>>>> in favor of functions in theyre correct namespace. Adding a $clone would 
>>>>> add
>>>>> a deprecated function hehe. It's to minify the number of globals 
>>>>> introduced
>>>>> by Mootools on the 2.0 version.
>>>>> Not to mention that Object.clone is more readable :D.
>>>>>
>>>>> --
>>>>> Fábio Miranda Costa
>>>>> Solucione Sistemas
>>>>> Engenheiro de interfaces
>>>>>
>>>>>
>>>>> On Mon, Feb 1, 2010 at 10:42 AM, Roman Land <[email protected]>wrote:
>>>>>
>>>>>> I am building a web application that works with an iphone application,
>>>>>> I cant work with GMaps offline (they wont allow you to cache tiles),
>>>>>> unfortunately for me I found this out after already writing all the gmaps
>>>>>> stuff.. so I rewrote those classes XD
>>>>>>
>>>>>> So it just came down to licensing for me..
>>>>>>
>>>>>>
>>>>>>
>>>>>> 2010/2/1 Fábio M. Costa <[email protected]>
>>>>>>
>>>>>>> And hey, im curious, what is so good about it that you are using it
>>>>>>> instead of GMaps?
>>>>>>> It looks cool but isnt GMaps better?
>>>>>>>
>>>>>>> --
>>>>>>> Fábio Miranda Costa
>>>>>>> Solucione Sistemas
>>>>>>> Engenheiro de interfaces
>>>>>>>
>>>>>>>
>>>>>>> 2010/2/1 Fábio M. Costa <[email protected]>
>>>>>>>
>>>>>>>> hmm bad to know.
>>>>>>>> But i can see that OpenLayers uses prototype and Rico, do it work
>>>>>>>> with mootools 1.2?
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Fábio Miranda Costa
>>>>>>>> Solucione Sistemas
>>>>>>>> Engenheiro de interfaces
>>>>>>>>
>>>>>>>>
>>>>>>>> On Mon, Feb 1, 2010 at 10:30 AM, Roman Land 
>>>>>>>> <[email protected]>wrote:
>>>>>>>>
>>>>>>>>> eeeeek, bad new for me :(
>>>>>>>>>
>>>>>>>>> OpenLayers have .clone for some of their objects...
>>>>>>>>>
>>>>>>>>> OpenLayers != Moo??
>>>>>>>>>
>>>>>>>>> 2010/2/1 Fábio M. Costa <[email protected]>
>>>>>>>>>
>>>>>>>>> $unlink is the right choice.
>>>>>>>>>> But on 1.3 (it will be backwards compatible) this method will be
>>>>>>>>>> deprecated in favor of Object.clone, Array.clone etc, if im not 
>>>>>>>>>> wrong.
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Fábio Miranda Costa
>>>>>>>>>> Solucione Sistemas
>>>>>>>>>> Engenheiro de interfaces
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Mon, Feb 1, 2010 at 8:27 AM, woomla <[email protected]> wrote:
>>>>>>>>>>
>>>>>>>>>>> What is the best way to create a true copy from an object/array?
>>>>>>>>>>> By 'true copy' I mean a new object/array with the same key/index
>>>>>>>>>>> value
>>>>>>>>>>> pairs.
>>>>>>>>>>>
>>>>>>>>>>> So far I see three possibilities $extend, $merge, $unlink.
>>>>>>>>>>>
>>>>>>>>>>> W.
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> ---
>>>>>>>>> "Make everything as simple as possible, but not simpler."
>>>>>>>>>
>>>>>>>>> - Albert Einstein
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> ---
>>>>>> "Make everything as simple as possible, but not simpler."
>>>>>>
>>>>>> - Albert Einstein
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> ---
>>>> "Make everything as simple as possible, but not simpler."
>>>>
>>>> - Albert Einstein
>>>>
>>>>
>>>
>>
>>
>> --
>> ---
>> "Make everything as simple as possible, but not simpler."
>>
>> - Albert Einstein
>>
>>
>


-- 
---
"Make everything as simple as possible, but not simpler."

- Albert Einstein

Reply via email to