Something that From smalltalk to javascript and back doesn't address is how to deal with user-defined objects and their constructors. For example,
--
I can code part of this as:
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. |
Does this
http://stackoverflow.com/questions/23337995/how-do-i-translate-javascript-constructors-to-amber-smalltalk help? On 6/28/15, Richard Eng <[hidden email]> wrote: > Something that From smalltalk to javascript and back > <https://github.com/amber-smalltalk/amber/wiki/From-smalltalk-to-javascript-and-back> > doesn't > address is how to deal with user-defined objects and their constructors. > For example, > > camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window. > innerHeight, 0.1, 1000 ); > > I can code part of this as: > > camera := THREE PerspectiveCamera: 75 aspect: (window innerWidth)/(window > innerHeight) near: 0.1 far: 1000. > > But without 'new', is the object created? Syntactically, how do you do > this? > > -- > 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. |
In reply to this post by horrido
Dňa 28. júna 2015 17:22:42 CEST používateľ Richard Eng <[hidden email]> napísal: > Something that From smalltalk to javascript and back > <https://github.com/amber-smalltalk/amber/wiki/From-smalltalk-to-javascript-and-back> > doesn't > address is how to deal with user-defined objects and their > constructors. > For example, > > camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window. > innerHeight, 0.1, 1000 ); > > I can code part of this as: > > camera := THREE PerspectiveCamera: 75 aspect: (window > innerWidth)/(window > innerHeight) near: 0.1 far: 1000. > > But without 'new', is the object created? Syntactically, how do you do > this? Syntactically, you don't. Librarically, you use NativeFunction API. -- 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. |
Dňa 28. júna 2015 18:09:12 CEST používateľ "Herby Vojčík" <[hidden email]> napísal: > > > Dňa 28. júna 2015 17:22:42 CEST používateľ Richard Eng > <[hidden email]> napísal: > > Something that From smalltalk to javascript and back > > > <https://github.com/amber-smalltalk/amber/wiki/From-smalltalk-to-javascript-and-back> > > doesn't > > address is how to deal with user-defined objects and their > > constructors. > > For example, > > > > camera = new THREE.PerspectiveCamera( 75, window.innerWidth / > window. > > innerHeight, 0.1, 1000 ); > > > > I can code part of this as: > > > > camera := THREE PerspectiveCamera: 75 aspect: (window > > innerWidth)/(window > > innerHeight) near: 0.1 far: 1000. > > > > But without 'new', is the object created? Syntactically, how do you > do > > this? > > Syntactically, you don't. > > Librarically, you use NativeFunction API. Fixing myself: no, you use normal BlockClosure API: #new, #newValue: and the rest. -- 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. |
In reply to this post by Hannes Hirzel
Yes, I think this does help. But my example requires 4 arguments, and the best I can do with #newValue: is
--
I need one more argument. On Sunday, 28 June 2015 12:05:03 UTC-4, Hannes wrote: Does this 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. |
Okay, I got it. I just use #newWithValues:.
-- On Sunday, 28 June 2015 12:35:21 UTC-4, Richard Eng wrote:
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. |
Free forum by Nabble | Edit this page |