JSProxyObject>>isArray // JSProxyObject>>isObject

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

JSProxyObject>>isArray // JSProxyObject>>isObject

Hannes Hirzel
Hello

How do I implement

   JSProxyObject>>isArray

and

   JSProxyObject>>isObject

?

Regards
Hannes

--
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/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: JSProxyObject>>isArray // JSProxyObject>>isObject

Nicolas Petton
Hi,

What do you want it to do?

Nico

H. Hirzel writes:

> Hello
>
> How do I implement
>
>    JSProxyObject>>isArray
>
> and
>
>    JSProxyObject>>isObject
>
> ?
>
> Regards
> Hannes


--
Nicolas Petton
http://nicolas-petton.fr

--
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/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: JSProxyObject>>isArray // JSProxyObject>>isObject

Hannes Hirzel
Thank you for asking, Nico.

I want to convert arbitrary JSON objects to an Amber equivalent

see my question here

    http://stackoverflow.com/questions/22604341/amber-and-localstorage-asjson


A JavaScript object is a JSProxyObject in Amber
A JavaScript Array is an Array in Amber.

So if I have myObj which I have got from parsing a JSON string

I can do the following checks to see how to further process it

    myObj class == JSProxyObject

    or

    myObj class == Array

Your comments?

--Hannes

On 4/1/14, Nicolas Petton <[hidden email]> wrote:

> Hi,
>
> What do you want it to do?
>
> Nico
>
> H. Hirzel writes:
>
>> Hello
>>
>> How do I implement
>>
>>    JSProxyObject>>isArray
>>
>> and
>>
>>    JSProxyObject>>isObject
>>
>> ?
>>
>> Regards
>> Hannes
>
>
> --
> Nicolas Petton
> http://nicolas-petton.fr
>
> --
> 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/d/optout.
>

--
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/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: JSProxyObject>>isArray // JSProxyObject>>isObject

Nicolas Petton
Hi!

Ok, I understand.

What's the problem with implementing `isObject` on JSObjectProxy?
Also, would JSObjectProxy>>isJSObjectProxy (also implemented on Object)
fix your issue?

Cheers,
Nico

H. Hirzel writes:

> Thank you for asking, Nico.
>
> I want to convert arbitrary JSON objects to an Amber equivalent
>
> see my question here
>
>     http://stackoverflow.com/questions/22604341/amber-and-localstorage-asjson
>
>
> A JavaScript object is a JSProxyObject in Amber
> A JavaScript Array is an Array in Amber.
>
> So if I have myObj which I have got from parsing a JSON string
>
> I can do the following checks to see how to further process it
>
>     myObj class == JSProxyObject
>
>     or
>
>     myObj class == Array
>
> Your comments?
>
> --Hannes
>
> On 4/1/14, Nicolas Petton <[hidden email]> wrote:
>> Hi,
>>
>> What do you want it to do?
>>
>> Nico
>>
>> H. Hirzel writes:
>>
>>> Hello
>>>
>>> How do I implement
>>>
>>>    JSProxyObject>>isArray
>>>
>>> and
>>>
>>>    JSProxyObject>>isObject
>>>
>>> ?
>>>
>>> Regards
>>> Hannes
>>
>>
>> --
>> Nicolas Petton
>> http://nicolas-petton.fr
>>
>> --
>> 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/d/optout.
>>


--
Nicolas Petton
http://nicolas-petton.fr

--
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/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: JSProxyObject>>isArray // JSProxyObject>>isObject

Hannes Hirzel
On 4/1/14, Nicolas Petton <[hidden email]> wrote:
> Hi!
>
> Ok, I understand.
>
> What's the problem with implementing `isObject` on JSObjectProxy?
> Also, would JSObjectProxy>>isJSObjectProxy (also implemented on Object)
> fix your issue?

Nico,
Yes, that would be convenient. But in the meantime I use

        myObj class == JSProxyObject

and

        myObj class == Array


Have a successful week!

--Hannes


> Cheers,
> Nico
>
> H. Hirzel writes:
>
>> Thank you for asking, Nico.
>>
>> I want to convert arbitrary JSON objects to an Amber equivalent
>>
>> see my question here
>>
>>
>> http://stackoverflow.com/questions/22604341/amber-and-localstorage-asjson
>>
>>
>> A JavaScript object is a JSProxyObject in Amber
>> A JavaScript Array is an Array in Amber.
>>
>> So if I have myObj which I have got from parsing a JSON string
>>
>> I can do the following checks to see how to further process it
>>
>>     myObj class == JSProxyObject
>>
>>     or
>>
>>     myObj class == Array
>>
>> Your comments?
>>
>> --Hannes
>>
>> On 4/1/14, Nicolas Petton <[hidden email]> wrote:
>>> Hi,
>>>
>>> What do you want it to do?
>>>
>>> Nico
>>>
>>> H. Hirzel writes:
>>>
>>>> Hello
>>>>
>>>> How do I implement
>>>>
>>>>    JSProxyObject>>isArray
>>>>
>>>> and
>>>>
>>>>    JSProxyObject>>isObject
>>>>
>>>> ?
>>>>

--
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/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: JSProxyObject>>isArray // JSProxyObject>>isObject

Herby Vojčík


H. Hirzel wrote:
> Yes, that would be convenient. But in the meantime I use
>
>          myObj class == JSProxyObject
>
> and
>
>          myObj class == Array

x class == y is considered harmful.
isKindOf: does not work?

> Have a successful week!
>
> --Hannes
>

--
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/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: JSProxyObject>>isArray // JSProxyObject>>isObject

Hannes Hirzel
#isKindOf:
worked fine.

Thank you for reminding me, Herby.

No need for any action on this.

--Hannes

On 4/7/14, Herby Vojčík <[hidden email]> wrote:

>
>
> H. Hirzel wrote:
>> Yes, that would be convenient. But in the meantime I use
>>
>>          myObj class == JSProxyObject
>>
>> and
>>
>>          myObj class == Array
>
> x class == y is considered harmful.
> isKindOf: does not work?
>
>> Have a successful week!
>>
>> --Hannes
>>
>
> --
> 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/d/optout.
>

--
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/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: JSProxyObject>>isArray // JSProxyObject>>isObject

Hannes Hirzel
An update:

#isKindOf: for JSObjectProxy works fine in version 0.11 because
JSObjectProxy is a subclass of Object there.

In version 0.12.3 JSObjectProxy is a subclass of  ProtoObject and does
not understand #isKindOf:

On 4/10/14, H. Hirzel <[hidden email]> wrote:

> #isKindOf:
> worked fine.
>
> Thank you for reminding me, Herby.
>
> No need for any action on this.
>
> --Hannes
>
> On 4/7/14, Herby Vojčík <[hidden email]> wrote:
>>
>>
>> H. Hirzel wrote:
>>> Yes, that would be convenient. But in the meantime I use
>>>
>>>          myObj class == JSProxyObject
>>>
>>> and
>>>
>>>          myObj class == Array
>>
>> x class == y is considered harmful.
>> isKindOf: does not work?
>>
>>> Have a successful week!
>>>
>>> --Hannes
>>>
>>
>> --
>> 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/d/optout.
>>
>

--
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/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: JSProxyObject>>isArray // JSProxyObject>>isObject

Hannes Hirzel
P.S. for the moment I am fine to use

    myObj class == JSProxyObject

    or

    myObj class == Array

do deal with this
http://stackoverflow.com/questions/22604341/amber-and-localstorage-asjson
type of problem.

On 4/10/14, H. Hirzel <[hidden email]> wrote:

> An update:
>
> #isKindOf: for JSObjectProxy works fine in version 0.11 because
> JSObjectProxy is a subclass of Object there.
>
> In version 0.12.3 JSObjectProxy is a subclass of  ProtoObject and does
> not understand #isKindOf:
>
> On 4/10/14, H. Hirzel <[hidden email]> wrote:
>> #isKindOf:
>> worked fine.
>>
>> Thank you for reminding me, Herby.
>>
>> No need for any action on this.
>>
>> --Hannes
>>
>> On 4/7/14, Herby Vojčík <[hidden email]> wrote:
>>>
>>>
>>> H. Hirzel wrote:
>>>> Yes, that would be convenient. But in the meantime I use
>>>>
>>>>          myObj class == JSProxyObject
>>>>
>>>> and
>>>>
>>>>          myObj class == Array
>>>
>>> x class == y is considered harmful.
>>> isKindOf: does not work?
>>>
>>>> Have a successful week!
>>>>
>>>> --Hannes
>>>>
>>>
>>> --
>>> 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/d/optout.
>>>
>>
>

--
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/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: JSProxyObject>>isArray // JSProxyObject>>isObject

Nicolas Petton
In reply to this post by Hannes Hirzel

H. Hirzel writes:

> An update:
>
> #isKindOf: for JSObjectProxy works fine in version 0.11 because
> JSObjectProxy is a subclass of Object there.

Can you send a PR with #isKindOf: moved in ProtoObject?

Cheers,
Nico

>
> In version 0.12.3 JSObjectProxy is a subclass of  ProtoObject and does
> not understand #isKindOf:
>
> On 4/10/14, H. Hirzel <[hidden email]> wrote:
>> #isKindOf:
>> worked fine.
>>
>> Thank you for reminding me, Herby.
>>
>> No need for any action on this.
>>
>> --Hannes
>>
>> On 4/7/14, Herby Vojčík <[hidden email]> wrote:
>>>
>>>
>>> H. Hirzel wrote:
>>>> Yes, that would be convenient. But in the meantime I use
>>>>
>>>>          myObj class == JSProxyObject
>>>>
>>>> and
>>>>
>>>>          myObj class == Array
>>>
>>> x class == y is considered harmful.
>>> isKindOf: does not work?
>>>
>>>> Have a successful week!
>>>>
>>>> --Hannes
>>>>
>>>
>>> --
>>> 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/d/optout.
>>>
>>


--
Nicolas Petton
http://nicolas-petton.fr

--
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/d/optout.