Initializing a new JavaScript object

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
24 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Initializing a new JavaScript object

SebastianHC
Am 23.08.2013 05:37, schrieb Nicolas Petton:
<return {};>

Thank you Nicholas!

I think, I tried <return {}> and that didn't work,....

But this worked,....

I need to keep those semi colons in my mind....

And @Matthias thank you for the detailed explanation. It in fact an interesting idea to subclass HashedCollection....

Sebastian

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Initializing a new JavaScript object

Herby Vojčík
In reply to this post by matthias.springer


Matthias Springer wrote:
> Hi,
>
> just a short clarification. We are dealing with two types of
> dictionaries/objects here.
>
> Smalltalk/Amber dictionaries are instances of "HashedCollection" or
> "Dictionary". "#{...}" creates a Smalltalk Dictionary. You can access

#{...} creates HashedCollection. not dictionary; therefore it is ok to
pass it to JS code. Dictionary would not work.

Herby

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Initializing a new JavaScript object

Herby Vojčík
In reply to this post by Nicolas Petton


Nicolas Petton wrote:
> If you really need an empty JS object from Amber, I would put that into
> a separate method:
>
> emptyData
> <return {};>

I use JSON parse: '{}'.

Herby

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Eno
Reply | Threaded
Open this post in threaded view
|

Re: Initializing a new JavaScript object

Eno

What about a function object that was contracted by new Function?

is the JS object created this way also applied to the function object?


Tsun

Herby Vojčík <[hidden email]> 於 2013/8/23 下午10:21 寫道:

>
>
> Nicolas Petton wrote:
>> If you really need an empty JS object from Amber, I would put that into
>> a separate method:
>>
>> emptyData
>> <return {};>
>
> I use JSON parse: '{}'.
>
> Herby
>
> --
> You received this message because you are subscribed to the Google Groups "amber-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
> For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "amber-lang" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
12