Converting JS files to ST classes

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

Converting JS files to ST classes

XumuK
Greetings!
It is possible to convert created JS file to ST classes in Amber? 

--
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: Converting JS files to ST classes

Nicolas Petton
I don't understand :) Can you show us an example of what you want to do?

Cheers,
Nico

On Apr 4, 2013, at 8:54 PM, XumuK <[hidden email]> wrote:

Greetings!
It is possible to convert created JS file to ST classes in Amber? 

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

Re: Converting JS files to ST classes

XumuK
For example i have some JavaScript code. And i want to edit it but in amber.
I know that Amber compile Smalltalk to JavaScript. Is it possible to port javascript code to smalltalk and create package?

For example i have somelib.js and want i want to see it in left panel in Amber IDE...

Is it clear? )))

пятница, 5 апреля 2013 г., 2:34:16 UTC+4 пользователь nicolas petton написал:
I don't understand :) Can you show us an example of what you want to do?

Cheers,
Nico

On Apr 4, 2013, at 8:54 PM, XumuK <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="n7j34lpTVSEJ">hubb...@...> wrote:

Greetings!
It is possible to convert created JS file to ST classes in Amber? 

--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="n7j34lpTVSEJ">amber-lang+...@googlegroups.com.
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.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Converting JS files to ST classes

XumuK
In reply to this post by XumuK
I want to rewrite arbor.js example using Amber. It will help me to understand Amber more. Could somebody help me with it?

четверг, 4 апреля 2013 г., 22:54:35 UTC+4 пользователь XumuK написал:
Greetings!
It is possible to convert created JS file to ST classes in Amber? 

--
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.
 
 

main.js (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Converting JS files to ST classes

xekoukou
I am currently working and learning the canvas element myself. What is the difficulty?
Getting the canvas element is the least documented thing you need to do.



2013/4/5 XumuK <[hidden email]>
I want to rewrite arbor.js example using Amber. It will help me to understand Amber more. Could somebody help me with it?

четверг, 4 апреля 2013 г., 22:54:35 UTC+4 пользователь XumuK написал:
Greetings!
It is possible to convert created JS file to ST classes in Amber? 

--
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.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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: Converting JS files to ST classes

XumuK
I have some troubles with converting javascript to smalltalk. It`s hard for me, and i want to port this JS to Amber for learning..

пятница, 5 апреля 2013 г., 11:08:15 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
I am currently working and learning the canvas element myself. What is the difficulty?
Getting the canvas element is the least documented thing you need to do.



2013/4/5 XumuK <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="9KGarUBnBB8J">hubb...@...>
I want to rewrite arbor.js example using Amber. It will help me to understand Amber more. Could somebody help me with it?

четверг, 4 апреля 2013 г., 22:54:35 UTC+4 пользователь XumuK написал:
Greetings!
It is possible to convert created JS file to ST classes in Amber? 

--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="9KGarUBnBB8J">amber-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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: Converting JS files to ST classes

xekoukou
Here is a function which I use to draw a line:

on: aCanvasId start: aStartPoint end: anEndPoint

|canvas ctx|

canvas :=  ('#',aCanvasId) asJQuery at:0.
console log:canvas.
ctx := canvas getContext: '2d'.
ctx beginPath.
ctx moveTo: (aStartPoint x) and: (aStartPoint y).
ctx lineTo: (anEndPoint x) and: (anEndPoint y).
ctx stroke.



2013/4/5 XumuK <[hidden email]>
I have some troubles with converting javascript to smalltalk. It`s hard for me, and i want to port this JS to Amber for learning..

пятница, 5 апреля 2013 г., 11:08:15 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
I am currently working and learning the canvas element myself. What is the difficulty?
Getting the canvas element is the least documented thing you need to do.



2013/4/5 XumuK <[hidden email]>
I want to rewrite arbor.js example using Amber. It will help me to understand Amber more. Could somebody help me with it?

четверг, 4 апреля 2013 г., 22:54:35 UTC+4 пользователь XumuK написал:
Greetings!
It is possible to convert created JS file to ST classes in Amber? 

--
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 amber-lang+...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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: Converting JS files to ST classes

XumuK
It is clear. Troubles are connected with such code:

var Renderer = function(canvas){
var that = {
init:function(system){
                                      ...
},
      
redraw:function(){
    ....
}
                       initMouseHandling:function(){
                                    .....
                       }
                       $(canvas).mousedown(handler.clicked);
                }
         return that;
}

пятница, 5 апреля 2013 г., 12:15:55 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
Here is a function which I use to draw a line:

on: aCanvasId start: aStartPoint end: anEndPoint

|canvas ctx|

canvas :=  ('#',aCanvasId) asJQuery at:0.
console log:canvas.
ctx := canvas getContext: '2d'.
ctx beginPath.
ctx moveTo: (aStartPoint x) and: (aStartPoint y).
ctx lineTo: (anEndPoint x) and: (anEndPoint y).
ctx stroke.



2013/4/5 XumuK <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="IRa2VPp01cYJ">hubb...@...>
I have some troubles with converting javascript to smalltalk. It`s hard for me, and i want to port this JS to Amber for learning..

пятница, 5 апреля 2013 г., 11:08:15 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
I am currently working and learning the canvas element myself. What is the difficulty?
Getting the canvas element is the least documented thing you need to do.



2013/4/5 XumuK <[hidden email]>
I want to rewrite arbor.js example using Amber. It will help me to understand Amber more. Could somebody help me with it?

четверг, 4 апреля 2013 г., 22:54:35 UTC+4 пользователь XumuK написал:
Greetings!
It is possible to convert created JS file to ST classes in Amber? 

--
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 amber-lang+...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="IRa2VPp01cYJ">amber-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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: Converting JS files to ST classes

XumuK
Found more simple example:

var o = {
      test: 5,
      bla: true
}

How to interpret this?

| obj |
obj := (Object new) test: 5; bla: true. 

Doesn`t work...



пятница, 5 апреля 2013 г., 12:54:54 UTC+4 пользователь XumuK написал:
It is clear. Troubles are connected with such code:

var Renderer = function(canvas){
var that = {
init:function(system){
                                      ...
},
      
redraw:function(){
    ....
}
                       initMouseHandling:function(){
                                    .....
                       }
                       $(canvas).mousedown(handler.clicked);
                }
         return that;
}

пятница, 5 апреля 2013 г., 12:15:55 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
Here is a function which I use to draw a line:

on: aCanvasId start: aStartPoint end: anEndPoint

|canvas ctx|

canvas :=  ('#',aCanvasId) asJQuery at:0.
console log:canvas.
ctx := canvas getContext: '2d'.
ctx beginPath.
ctx moveTo: (aStartPoint x) and: (aStartPoint y).
ctx lineTo: (anEndPoint x) and: (anEndPoint y).
ctx stroke.



2013/4/5 XumuK <[hidden email]>
I have some troubles with converting javascript to smalltalk. It`s hard for me, and i want to port this JS to Amber for learning..

пятница, 5 апреля 2013 г., 11:08:15 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
I am currently working and learning the canvas element myself. What is the difficulty?
Getting the canvas element is the least documented thing you need to do.



2013/4/5 XumuK <[hidden email]>
I want to rewrite arbor.js example using Amber. It will help me to understand Amber more. Could somebody help me with it?

четверг, 4 апреля 2013 г., 22:54:35 UTC+4 пользователь XumuK написал:
Greetings!
It is possible to convert created JS file to ST classes in Amber? 

--
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 amber-lang+...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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 amber-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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: Converting JS files to ST classes

XumuK
Solved. Sorry for my stupid questions...))

пятница, 5 апреля 2013 г., 15:31:17 UTC+4 пользователь XumuK написал:
Found more simple example:

var o = {
      test: 5,
      bla: true
}

How to interpret this?

| obj |
obj := (Object new) test: 5; bla: true. 

Doesn`t work...



пятница, 5 апреля 2013 г., 12:54:54 UTC+4 пользователь XumuK написал:
It is clear. Troubles are connected with such code:

var Renderer = function(canvas){
var that = {
init:function(system){
                                      ...
},
      
redraw:function(){
    ....
}
                       initMouseHandling:function(){
                                    .....
                       }
                       $(canvas).mousedown(handler.clicked);
                }
         return that;
}

пятница, 5 апреля 2013 г., 12:15:55 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
Here is a function which I use to draw a line:

on: aCanvasId start: aStartPoint end: anEndPoint

|canvas ctx|

canvas :=  ('#',aCanvasId) asJQuery at:0.
console log:canvas.
ctx := canvas getContext: '2d'.
ctx beginPath.
ctx moveTo: (aStartPoint x) and: (aStartPoint y).
ctx lineTo: (anEndPoint x) and: (anEndPoint y).
ctx stroke.



2013/4/5 XumuK <[hidden email]>
I have some troubles with converting javascript to smalltalk. It`s hard for me, and i want to port this JS to Amber for learning..

пятница, 5 апреля 2013 г., 11:08:15 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
I am currently working and learning the canvas element myself. What is the difficulty?
Getting the canvas element is the least documented thing you need to do.



2013/4/5 XumuK <[hidden email]>
I want to rewrite arbor.js example using Amber. It will help me to understand Amber more. Could somebody help me with it?

четверг, 4 апреля 2013 г., 22:54:35 UTC+4 пользователь XumuK написал:
Greetings!
It is possible to convert created JS file to ST classes in Amber? 

--
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 amber-lang+...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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 amber-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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: Converting JS files to ST classes

XumuK
Not solved...

How can I write

var a = {
        first: function(parameter){
        }
        second: function() {
        }
}


in Amber? Please, help me to understand...

пятница, 5 апреля 2013 г., 15:55:04 UTC+4 пользователь XumuK написал:
Solved. Sorry for my stupid questions...))

пятница, 5 апреля 2013 г., 15:31:17 UTC+4 пользователь XumuK написал:
Found more simple example:

var o = {
      test: 5,
      bla: true
}

How to interpret this?

| obj |
obj := (Object new) test: 5; bla: true. 

Doesn`t work...



пятница, 5 апреля 2013 г., 12:54:54 UTC+4 пользователь XumuK написал:
It is clear. Troubles are connected with such code:

var Renderer = function(canvas){
var that = {
init:function(system){
                                      ...
},
      
redraw:function(){
    ....
}
                       initMouseHandling:function(){
                                    .....
                       }
                       $(canvas).mousedown(handler.clicked);
                }
         return that;
}

пятница, 5 апреля 2013 г., 12:15:55 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
Here is a function which I use to draw a line:

on: aCanvasId start: aStartPoint end: anEndPoint

|canvas ctx|

canvas :=  ('#',aCanvasId) asJQuery at:0.
console log:canvas.
ctx := canvas getContext: '2d'.
ctx beginPath.
ctx moveTo: (aStartPoint x) and: (aStartPoint y).
ctx lineTo: (anEndPoint x) and: (anEndPoint y).
ctx stroke.



2013/4/5 XumuK <[hidden email]>
I have some troubles with converting javascript to smalltalk. It`s hard for me, and i want to port this JS to Amber for learning..

пятница, 5 апреля 2013 г., 11:08:15 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
I am currently working and learning the canvas element myself. What is the difficulty?
Getting the canvas element is the least documented thing you need to do.



2013/4/5 XumuK <[hidden email]>
I want to rewrite arbor.js example using Amber. It will help me to understand Amber more. Could somebody help me with it?

четверг, 4 апреля 2013 г., 22:54:35 UTC+4 пользователь XumuK написал:
Greetings!
It is possible to convert created JS file to ST classes in Amber? 

--
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 amber-lang+...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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 amber-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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: Converting JS files to ST classes

Ryan Simmons-2
a := #{
   'first' -> [:parameter | ]. 
   'second' -> []
}


On 9 April 2013 20:53, XumuK <[hidden email]> wrote:
Not solved...

How can I write

var a = {
        first: function(parameter){
        }
        second: function() {
        }
}


in Amber? Please, help me to understand...

пятница, 5 апреля 2013 г., 15:55:04 UTC+4 пользователь XumuK написал:
Solved. Sorry for my stupid questions...))

пятница, 5 апреля 2013 г., 15:31:17 UTC+4 пользователь XumuK написал:
Found more simple example:

var o = {
      test: 5,
      bla: true
}

How to interpret this?

| obj |
obj := (Object new) test: 5; bla: true. 

Doesn`t work...



пятница, 5 апреля 2013 г., 12:54:54 UTC+4 пользователь XumuK написал:
It is clear. Troubles are connected with such code:

var Renderer = function(canvas){
var that = {
init:function(system){
                                      ...
},
      
redraw:function(){
    ....
}
                       initMouseHandling:function(){
                                    .....
                       }
                       $(canvas).mousedown(handler.clicked);
                }
         return that;
}

пятница, 5 апреля 2013 г., 12:15:55 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
Here is a function which I use to draw a line:

on: aCanvasId start: aStartPoint end: anEndPoint

|canvas ctx|

canvas :=  ('#',aCanvasId) asJQuery at:0.
console log:canvas.
ctx := canvas getContext: '2d'.
ctx beginPath.
ctx moveTo: (aStartPoint x) and: (aStartPoint y).
ctx lineTo: (anEndPoint x) and: (anEndPoint y).
ctx stroke.



2013/4/5 XumuK <[hidden email]>
I have some troubles with converting javascript to smalltalk. It`s hard for me, and i want to port this JS to Amber for learning..

пятница, 5 апреля 2013 г., 11:08:15 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
I am currently working and learning the canvas element myself. What is the difficulty?
Getting the canvas element is the least documented thing you need to do.



2013/4/5 XumuK <[hidden email]>
I want to rewrite arbor.js example using Amber. It will help me to understand Amber more. Could somebody help me with it?

четверг, 4 апреля 2013 г., 22:54:35 UTC+4 пользователь XumuK написал:
Greetings!
It is possible to convert created JS file to ST classes in Amber? 

--
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 amber-lang+...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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 amber-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

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

Re: Converting JS files to ST classes

xekoukou
Excuse my ignorance, but isnt what Xumuk describes the javascript equivalent of defining methods for an object which should be replaced with the definition of methods in the smalltalk way?


2013/4/9 Ryan Simmons <[hidden email]>
a := #{
   'first' -> [:parameter | ]. 
   'second' -> []
}


On 9 April 2013 20:53, XumuK <[hidden email]> wrote:
Not solved...

How can I write

var a = {
        first: function(parameter){
        }
        second: function() {
        }
}


in Amber? Please, help me to understand...

пятница, 5 апреля 2013 г., 15:55:04 UTC+4 пользователь XumuK написал:
Solved. Sorry for my stupid questions...))

пятница, 5 апреля 2013 г., 15:31:17 UTC+4 пользователь XumuK написал:
Found more simple example:

var o = {
      test: 5,
      bla: true
}

How to interpret this?

| obj |
obj := (Object new) test: 5; bla: true. 

Doesn`t work...



пятница, 5 апреля 2013 г., 12:54:54 UTC+4 пользователь XumuK написал:
It is clear. Troubles are connected with such code:

var Renderer = function(canvas){
var that = {
init:function(system){
                                      ...
},
      
redraw:function(){
    ....
}
                       initMouseHandling:function(){
                                    .....
                       }
                       $(canvas).mousedown(handler.clicked);
                }
         return that;
}

пятница, 5 апреля 2013 г., 12:15:55 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
Here is a function which I use to draw a line:

on: aCanvasId start: aStartPoint end: anEndPoint

|canvas ctx|

canvas :=  ('#',aCanvasId) asJQuery at:0.
console log:canvas.
ctx := canvas getContext: '2d'.
ctx beginPath.
ctx moveTo: (aStartPoint x) and: (aStartPoint y).
ctx lineTo: (anEndPoint x) and: (anEndPoint y).
ctx stroke.



2013/4/5 XumuK <[hidden email]>
I have some troubles with converting javascript to smalltalk. It`s hard for me, and i want to port this JS to Amber for learning..

пятница, 5 апреля 2013 г., 11:08:15 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
I am currently working and learning the canvas element myself. What is the difficulty?
Getting the canvas element is the least documented thing you need to do.



2013/4/5 XumuK <[hidden email]>
I want to rewrite arbor.js example using Amber. It will help me to understand Amber more. Could somebody help me with it?

четверг, 4 апреля 2013 г., 22:54:35 UTC+4 пользователь XumuK написал:
Greetings!
It is possible to convert created JS file to ST classes in Amber? 

--
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 amber-lang+...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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 amber-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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: Converting JS files to ST classes

Ryan Simmons-2
You are right, I assumed he just wanted to pass some data to another js library.
Sorry


On 9 April 2013 21:10, Apostolis Xekoukoulotakis <[hidden email]> wrote:
Excuse my ignorance, but isnt what Xumuk describes the javascript equivalent of defining methods for an object which should be replaced with the definition of methods in the smalltalk way?


2013/4/9 Ryan Simmons <[hidden email]>
a := #{
   'first' -> [:parameter | ]. 
   'second' -> []
}


On 9 April 2013 20:53, XumuK <[hidden email]> wrote:
Not solved...

How can I write

var a = {
        first: function(parameter){
        }
        second: function() {
        }
}


in Amber? Please, help me to understand...

пятница, 5 апреля 2013 г., 15:55:04 UTC+4 пользователь XumuK написал:
Solved. Sorry for my stupid questions...))

пятница, 5 апреля 2013 г., 15:31:17 UTC+4 пользователь XumuK написал:
Found more simple example:

var o = {
      test: 5,
      bla: true
}

How to interpret this?

| obj |
obj := (Object new) test: 5; bla: true. 

Doesn`t work...



пятница, 5 апреля 2013 г., 12:54:54 UTC+4 пользователь XumuK написал:
It is clear. Troubles are connected with such code:

var Renderer = function(canvas){
var that = {
init:function(system){
                                      ...
},
      
redraw:function(){
    ....
}
                       initMouseHandling:function(){
                                    .....
                       }
                       $(canvas).mousedown(handler.clicked);
                }
         return that;
}

пятница, 5 апреля 2013 г., 12:15:55 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
Here is a function which I use to draw a line:

on: aCanvasId start: aStartPoint end: anEndPoint

|canvas ctx|

canvas :=  ('#',aCanvasId) asJQuery at:0.
console log:canvas.
ctx := canvas getContext: '2d'.
ctx beginPath.
ctx moveTo: (aStartPoint x) and: (aStartPoint y).
ctx lineTo: (anEndPoint x) and: (anEndPoint y).
ctx stroke.



2013/4/5 XumuK <[hidden email]>
I have some troubles with converting javascript to smalltalk. It`s hard for me, and i want to port this JS to Amber for learning..

пятница, 5 апреля 2013 г., 11:08:15 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
I am currently working and learning the canvas element myself. What is the difficulty?
Getting the canvas element is the least documented thing you need to do.



2013/4/5 XumuK <[hidden email]>
I want to rewrite arbor.js example using Amber. It will help me to understand Amber more. Could somebody help me with it?

четверг, 4 апреля 2013 г., 22:54:35 UTC+4 пользователь XumuK написал:
Greetings!
It is possible to convert created JS file to ST classes in Amber? 

--
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 amber-lang+...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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 amber-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

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

Re: Converting JS files to ST classes

Ryan Simmons-2
Here is an attempt at converting the "Renderer" object from the file main.js that you attached earlier. I have not tested this though hopefully it leads you in the right direction.


the js line to create the renderer
 sys.renderer = Renderer("#viewport").
would be changed to
  sys renderer: (ArbourRenderer newWithCanvas: '#viewport' ) jsInterface



On 9 April 2013 21:20, Ryan Simmons <[hidden email]> wrote:
You are right, I assumed he just wanted to pass some data to another js library.
Sorry


On 9 April 2013 21:10, Apostolis Xekoukoulotakis <[hidden email]> wrote:
Excuse my ignorance, but isnt what Xumuk describes the javascript equivalent of defining methods for an object which should be replaced with the definition of methods in the smalltalk way?


2013/4/9 Ryan Simmons <[hidden email]>
a := #{
   'first' -> [:parameter | ]. 
   'second' -> []
}


On 9 April 2013 20:53, XumuK <[hidden email]> wrote:
Not solved...

How can I write

var a = {
        first: function(parameter){
        }
        second: function() {
        }
}


in Amber? Please, help me to understand...

пятница, 5 апреля 2013 г., 15:55:04 UTC+4 пользователь XumuK написал:
Solved. Sorry for my stupid questions...))

пятница, 5 апреля 2013 г., 15:31:17 UTC+4 пользователь XumuK написал:
Found more simple example:

var o = {
      test: 5,
      bla: true
}

How to interpret this?

| obj |
obj := (Object new) test: 5; bla: true. 

Doesn`t work...



пятница, 5 апреля 2013 г., 12:54:54 UTC+4 пользователь XumuK написал:
It is clear. Troubles are connected with such code:

var Renderer = function(canvas){
var that = {
init:function(system){
                                      ...
},
      
redraw:function(){
    ....
}
                       initMouseHandling:function(){
                                    .....
                       }
                       $(canvas).mousedown(handler.clicked);
                }
         return that;
}

пятница, 5 апреля 2013 г., 12:15:55 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
Here is a function which I use to draw a line:

on: aCanvasId start: aStartPoint end: anEndPoint

|canvas ctx|

canvas :=  ('#',aCanvasId) asJQuery at:0.
console log:canvas.
ctx := canvas getContext: '2d'.
ctx beginPath.
ctx moveTo: (aStartPoint x) and: (aStartPoint y).
ctx lineTo: (anEndPoint x) and: (anEndPoint y).
ctx stroke.



2013/4/5 XumuK <[hidden email]>
I have some troubles with converting javascript to smalltalk. It`s hard for me, and i want to port this JS to Amber for learning..

пятница, 5 апреля 2013 г., 11:08:15 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
I am currently working and learning the canvas element myself. What is the difficulty?
Getting the canvas element is the least documented thing you need to do.



2013/4/5 XumuK <[hidden email]>
I want to rewrite arbor.js example using Amber. It will help me to understand Amber more. Could somebody help me with it?

четверг, 4 апреля 2013 г., 22:54:35 UTC+4 пользователь XumuK написал:
Greetings!
It is possible to convert created JS file to ST classes in Amber? 

--
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 amber-lang+...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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 amber-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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.
 
 

Arbour.st (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Converting JS files to ST classes

Ryan Simmons-2
Sorry to load in the code from the previous message load the st file into a Workspace, select all and then press "file in"


On 9 April 2013 22:58, Ryan Simmons <[hidden email]> wrote:
Here is an attempt at converting the "Renderer" object from the file main.js that you attached earlier. I have not tested this though hopefully it leads you in the right direction.


the js line to create the renderer
 sys.renderer = Renderer("#viewport").
would be changed to
  sys renderer: (ArbourRenderer newWithCanvas: '#viewport' ) jsInterface



On 9 April 2013 21:20, Ryan Simmons <[hidden email]> wrote:
You are right, I assumed he just wanted to pass some data to another js library.
Sorry


On 9 April 2013 21:10, Apostolis Xekoukoulotakis <[hidden email]> wrote:
Excuse my ignorance, but isnt what Xumuk describes the javascript equivalent of defining methods for an object which should be replaced with the definition of methods in the smalltalk way?


2013/4/9 Ryan Simmons <[hidden email]>
a := #{
   'first' -> [:parameter | ]. 
   'second' -> []
}


On 9 April 2013 20:53, XumuK <[hidden email]> wrote:
Not solved...

How can I write

var a = {
        first: function(parameter){
        }
        second: function() {
        }
}


in Amber? Please, help me to understand...

пятница, 5 апреля 2013 г., 15:55:04 UTC+4 пользователь XumuK написал:
Solved. Sorry for my stupid questions...))

пятница, 5 апреля 2013 г., 15:31:17 UTC+4 пользователь XumuK написал:
Found more simple example:

var o = {
      test: 5,
      bla: true
}

How to interpret this?

| obj |
obj := (Object new) test: 5; bla: true. 

Doesn`t work...



пятница, 5 апреля 2013 г., 12:54:54 UTC+4 пользователь XumuK написал:
It is clear. Troubles are connected with such code:

var Renderer = function(canvas){
var that = {
init:function(system){
                                      ...
},
      
redraw:function(){
    ....
}
                       initMouseHandling:function(){
                                    .....
                       }
                       $(canvas).mousedown(handler.clicked);
                }
         return that;
}

пятница, 5 апреля 2013 г., 12:15:55 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
Here is a function which I use to draw a line:

on: aCanvasId start: aStartPoint end: anEndPoint

|canvas ctx|

canvas :=  ('#',aCanvasId) asJQuery at:0.
console log:canvas.
ctx := canvas getContext: '2d'.
ctx beginPath.
ctx moveTo: (aStartPoint x) and: (aStartPoint y).
ctx lineTo: (anEndPoint x) and: (anEndPoint y).
ctx stroke.



2013/4/5 XumuK <[hidden email]>
I have some troubles with converting javascript to smalltalk. It`s hard for me, and i want to port this JS to Amber for learning..

пятница, 5 апреля 2013 г., 11:08:15 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
I am currently working and learning the canvas element myself. What is the difficulty?
Getting the canvas element is the least documented thing you need to do.



2013/4/5 XumuK <[hidden email]>
I want to rewrite arbor.js example using Amber. It will help me to understand Amber more. Could somebody help me with it?

четверг, 4 апреля 2013 г., 22:54:35 UTC+4 пользователь XumuK написал:
Greetings!
It is possible to convert created JS file to ST classes in Amber? 

--
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 amber-lang+...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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 amber-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

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

Re: Converting JS files to ST classes

XumuK
Thanks a lot! 
It`s would be very helpfull in future for me!
Sorry for taking your time

среда, 10 апреля 2013 г., 1:00:35 UTC+4 пользователь Ryan Simmons написал:
Sorry to load in the code from the previous message load the st file into a Workspace, select all and then press "file in"


On 9 April 2013 22:58, Ryan Simmons <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="anOcg3U4MpEJ">ryan.crai...@...> wrote:
Here is an attempt at converting the "Renderer" object from the file main.js that you attached earlier. I have not tested this though hopefully it leads you in the right direction.


the js line to create the renderer
 sys.renderer = Renderer("#viewport").
would be changed to
  sys renderer: (ArbourRenderer newWithCanvas: '#viewport' ) jsInterface



On 9 April 2013 21:20, Ryan Simmons <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="anOcg3U4MpEJ">ryan.crai...@...> wrote:
You are right, I assumed he just wanted to pass some data to another js library.
Sorry


On 9 April 2013 21:10, Apostolis Xekoukoulotakis <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="anOcg3U4MpEJ">xeko...@...> wrote:
Excuse my ignorance, but isnt what Xumuk describes the javascript equivalent of defining methods for an object which should be replaced with the definition of methods in the smalltalk way?


2013/4/9 Ryan Simmons <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="anOcg3U4MpEJ">ryan.crai...@...>
a := #{
   'first' -> [:parameter | ]. 
   'second' -> []
}


On 9 April 2013 20:53, XumuK <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="anOcg3U4MpEJ">hubb...@...> wrote:
Not solved...

How can I write

var a = {
        first: function(parameter){
        }
        second: function() {
        }
}


in Amber? Please, help me to understand...

пятница, 5 апреля 2013 г., 15:55:04 UTC+4 пользователь XumuK написал:
Solved. Sorry for my stupid questions...))

пятница, 5 апреля 2013 г., 15:31:17 UTC+4 пользователь XumuK написал:
Found more simple example:

var o = {
      test: 5,
      bla: true
}

How to interpret this?

| obj |
obj := (Object new) test: 5; bla: true. 

Doesn`t work...



пятница, 5 апреля 2013 г., 12:54:54 UTC+4 пользователь XumuK написал:
It is clear. Troubles are connected with such code:

var Renderer = function(canvas){
var that = {
init:function(system){
                                      ...
},
      
redraw:function(){
    ....
}
                       initMouseHandling:function(){
                                    .....
                       }
                       $(canvas).mousedown(handler.clicked);
                }
         return that;
}

пятница, 5 апреля 2013 г., 12:15:55 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
Here is a function which I use to draw a line:

on: aCanvasId start: aStartPoint end: anEndPoint

|canvas ctx|

canvas :=  ('#',aCanvasId) asJQuery at:0.
console log:canvas.
ctx := canvas getContext: '2d'.
ctx beginPath.
ctx moveTo: (aStartPoint x) and: (aStartPoint y).
ctx lineTo: (anEndPoint x) and: (anEndPoint y).
ctx stroke.



2013/4/5 XumuK <[hidden email]>
I have some troubles with converting javascript to smalltalk. It`s hard for me, and i want to port this JS to Amber for learning..

пятница, 5 апреля 2013 г., 11:08:15 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
I am currently working and learning the canvas element myself. What is the difficulty?
Getting the canvas element is the least documented thing you need to do.



2013/4/5 XumuK <[hidden email]>
I want to rewrite arbor.js example using Amber. It will help me to understand Amber more. Could somebody help me with it?

четверг, 4 апреля 2013 г., 22:54:35 UTC+4 пользователь XumuK написал:
Greetings!
It is possible to convert created JS file to ST classes in Amber? 

--
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 amber-lang+...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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 amber-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="anOcg3U4MpEJ">amber-lang+...@googlegroups.com.
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="anOcg3U4MpEJ">amber-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="anOcg3U4MpEJ">amber-lang+...@googlegroups.com.
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.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Converting JS files to ST classes

XumuK
In reply to this post by Ryan Simmons-2
Here it must be changed to ( sys asJQuery ) attr: 'renderer' set: ( (ArbourRenderer newWithCanvas: '#viewport' ) jsInterface )
because of sys object don`t have a renderer field.

среда, 10 апреля 2013 г., 0:58:55 UTC+4 пользователь Ryan Simmons написал:
Here is an attempt at converting the "Renderer" object from the file main.js that you attached earlier. I have not tested this though hopefully it leads you in the right direction.


the js line to create the renderer
 sys.renderer = Renderer("#viewport").
would be changed to
  sys renderer: (ArbourRenderer newWithCanvas: '#viewport' ) jsInterface



On 9 April 2013 21:20, Ryan Simmons <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="3tzNnzrRl-oJ">ryan.crai...@...> wrote:
You are right, I assumed he just wanted to pass some data to another js library.
Sorry


On 9 April 2013 21:10, Apostolis Xekoukoulotakis <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="3tzNnzrRl-oJ">xeko...@...> wrote:
Excuse my ignorance, but isnt what Xumuk describes the javascript equivalent of defining methods for an object which should be replaced with the definition of methods in the smalltalk way?


2013/4/9 Ryan Simmons <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="3tzNnzrRl-oJ">ryan.crai...@...>
a := #{
   'first' -> [:parameter | ]. 
   'second' -> []
}


On 9 April 2013 20:53, XumuK <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="3tzNnzrRl-oJ">hubb...@...> wrote:
Not solved...

How can I write

var a = {
        first: function(parameter){
        }
        second: function() {
        }
}


in Amber? Please, help me to understand...

пятница, 5 апреля 2013 г., 15:55:04 UTC+4 пользователь XumuK написал:
Solved. Sorry for my stupid questions...))

пятница, 5 апреля 2013 г., 15:31:17 UTC+4 пользователь XumuK написал:
Found more simple example:

var o = {
      test: 5,
      bla: true
}

How to interpret this?

| obj |
obj := (Object new) test: 5; bla: true. 

Doesn`t work...



пятница, 5 апреля 2013 г., 12:54:54 UTC+4 пользователь XumuK написал:
It is clear. Troubles are connected with such code:

var Renderer = function(canvas){
var that = {
init:function(system){
                                      ...
},
      
redraw:function(){
    ....
}
                       initMouseHandling:function(){
                                    .....
                       }
                       $(canvas).mousedown(handler.clicked);
                }
         return that;
}

пятница, 5 апреля 2013 г., 12:15:55 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
Here is a function which I use to draw a line:

on: aCanvasId start: aStartPoint end: anEndPoint

|canvas ctx|

canvas :=  ('#',aCanvasId) asJQuery at:0.
console log:canvas.
ctx := canvas getContext: '2d'.
ctx beginPath.
ctx moveTo: (aStartPoint x) and: (aStartPoint y).
ctx lineTo: (anEndPoint x) and: (anEndPoint y).
ctx stroke.



2013/4/5 XumuK <[hidden email]>
I have some troubles with converting javascript to smalltalk. It`s hard for me, and i want to port this JS to Amber for learning..

пятница, 5 апреля 2013 г., 11:08:15 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
I am currently working and learning the canvas element myself. What is the difficulty?
Getting the canvas element is the least documented thing you need to do.



2013/4/5 XumuK <[hidden email]>
I want to rewrite arbor.js example using Amber. It will help me to understand Amber more. Could somebody help me with it?

четверг, 4 апреля 2013 г., 22:54:35 UTC+4 пользователь XumuK написал:
Greetings!
It is possible to convert created JS file to ST classes in Amber? 

--
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 amber-lang+...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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 amber-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="3tzNnzrRl-oJ">amber-lang+...@googlegroups.com.
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="3tzNnzrRl-oJ">amber-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="3tzNnzrRl-oJ">amber-lang+...@googlegroups.com.
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.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Converting JS files to ST classes

XumuK
Also there is an error in mouseHandler class.
In function 
getMousePositionForEvent: event
     ......
     mousePosition := arbor Point: (event pageX - pos left) y: (event pageY - pos top).
     mousePosition := NativeFunction constructor: 'arbor.Point' value:  (event pageX - pos left)  value: (event pageY - pos top).
     ......

Thanks.

среда, 10 апреля 2013 г., 15:01:09 UTC+4 пользователь XumuK написал:
Here it must be changed to ( sys asJQuery ) attr: 'renderer' set: ( (ArbourRenderer newWithCanvas: '#viewport' ) jsInterface )
because of sys object don`t have a renderer field.

среда, 10 апреля 2013 г., 0:58:55 UTC+4 пользователь Ryan Simmons написал:
Here is an attempt at converting the "Renderer" object from the file main.js that you attached earlier. I have not tested this though hopefully it leads you in the right direction.


the js line to create the renderer
 sys.renderer = Renderer("#viewport").
would be changed to
  sys renderer: (ArbourRenderer newWithCanvas: '#viewport' ) jsInterface



On 9 April 2013 21:20, Ryan Simmons <[hidden email]> wrote:
You are right, I assumed he just wanted to pass some data to another js library.
Sorry


On 9 April 2013 21:10, Apostolis Xekoukoulotakis <[hidden email]> wrote:
Excuse my ignorance, but isnt what Xumuk describes the javascript equivalent of defining methods for an object which should be replaced with the definition of methods in the smalltalk way?


2013/4/9 Ryan Simmons <[hidden email]>
a := #{
   'first' -> [:parameter | ]. 
   'second' -> []
}


On 9 April 2013 20:53, XumuK <[hidden email]> wrote:
Not solved...

How can I write

var a = {
        first: function(parameter){
        }
        second: function() {
        }
}


in Amber? Please, help me to understand...

пятница, 5 апреля 2013 г., 15:55:04 UTC+4 пользователь XumuK написал:
Solved. Sorry for my stupid questions...))

пятница, 5 апреля 2013 г., 15:31:17 UTC+4 пользователь XumuK написал:
Found more simple example:

var o = {
      test: 5,
      bla: true
}

How to interpret this?

| obj |
obj := (Object new) test: 5; bla: true. 

Doesn`t work...



пятница, 5 апреля 2013 г., 12:54:54 UTC+4 пользователь XumuK написал:
It is clear. Troubles are connected with such code:

var Renderer = function(canvas){
var that = {
init:function(system){
                                      ...
},
      
redraw:function(){
    ....
}
                       initMouseHandling:function(){
                                    .....
                       }
                       $(canvas).mousedown(handler.clicked);
                }
         return that;
}

пятница, 5 апреля 2013 г., 12:15:55 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
Here is a function which I use to draw a line:

on: aCanvasId start: aStartPoint end: anEndPoint

|canvas ctx|

canvas :=  ('#',aCanvasId) asJQuery at:0.
console log:canvas.
ctx := canvas getContext: '2d'.
ctx beginPath.
ctx moveTo: (aStartPoint x) and: (aStartPoint y).
ctx lineTo: (anEndPoint x) and: (anEndPoint y).
ctx stroke.



2013/4/5 XumuK <[hidden email]>
I have some troubles with converting javascript to smalltalk. It`s hard for me, and i want to port this JS to Amber for learning..

пятница, 5 апреля 2013 г., 11:08:15 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
I am currently working and learning the canvas element myself. What is the difficulty?
Getting the canvas element is the least documented thing you need to do.



2013/4/5 XumuK <[hidden email]>
I want to rewrite arbor.js example using Amber. It will help me to understand Amber more. Could somebody help me with it?

четверг, 4 апреля 2013 г., 22:54:35 UTC+4 пользователь XumuK написал:
Greetings!
It is possible to convert created JS file to ST classes in Amber? 

--
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 amber-lang+...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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 amber-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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 amber-lang+...@googlegroups.com.
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 amber-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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 amber-lang+...@googlegroups.com.
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.
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Converting JS files to ST classes

Manfred Kröhnert
Hello Xumuk,

sorry for popping in late.
From looking at the thread your main issue was to understand the JS code and how to transform it into an Amber equivalent structure, right?

Best,
Manfred



On Thu, Apr 11, 2013 at 8:50 AM, XumuK <[hidden email]> wrote:
Also there is an error in mouseHandler class.
In function 
getMousePositionForEvent: event
     ......
     mousePosition := arbor Point: (event pageX - pos left) y: (event pageY - pos top).
     mousePosition := NativeFunction constructor: 'arbor.Point' value:  (event pageX - pos left)  value: (event pageY - pos top).
     ......

Thanks.

среда, 10 апреля 2013 г., 15:01:09 UTC+4 пользователь XumuK написал:
Here it must be changed to ( sys asJQuery ) attr: 'renderer' set: ( (ArbourRenderer newWithCanvas: '#viewport' ) jsInterface )
because of sys object don`t have a renderer field.

среда, 10 апреля 2013 г., 0:58:55 UTC+4 пользователь Ryan Simmons написал:
Here is an attempt at converting the "Renderer" object from the file main.js that you attached earlier. I have not tested this though hopefully it leads you in the right direction.


the js line to create the renderer
 sys.renderer = Renderer("#viewport").
would be changed to
  sys renderer: (ArbourRenderer newWithCanvas: '#viewport' ) jsInterface



On 9 April 2013 21:20, Ryan Simmons <[hidden email]> wrote:
You are right, I assumed he just wanted to pass some data to another js library.
Sorry


On 9 April 2013 21:10, Apostolis Xekoukoulotakis <[hidden email]> wrote:
Excuse my ignorance, but isnt what Xumuk describes the javascript equivalent of defining methods for an object which should be replaced with the definition of methods in the smalltalk way?


2013/4/9 Ryan Simmons <[hidden email]>
a := #{
   'first' -> [:parameter | ]. 
   'second' -> []
}


On 9 April 2013 20:53, XumuK <[hidden email]> wrote:
Not solved...

How can I write

var a = {
        first: function(parameter){
        }
        second: function() {
        }
}


in Amber? Please, help me to understand...

пятница, 5 апреля 2013 г., 15:55:04 UTC+4 пользователь XumuK написал:
Solved. Sorry for my stupid questions...))

пятница, 5 апреля 2013 г., 15:31:17 UTC+4 пользователь XumuK написал:
Found more simple example:

var o = {
      test: 5,
      bla: true
}

How to interpret this?

| obj |
obj := (Object new) test: 5; bla: true. 

Doesn`t work...



пятница, 5 апреля 2013 г., 12:54:54 UTC+4 пользователь XumuK написал:
It is clear. Troubles are connected with such code:

var Renderer = function(canvas){
var that = {
init:function(system){
                                      ...
},
      
redraw:function(){
    ....
}
                       initMouseHandling:function(){
                                    .....
                       }
                       $(canvas).mousedown(handler.clicked);
                }
         return that;
}

пятница, 5 апреля 2013 г., 12:15:55 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
Here is a function which I use to draw a line:

on: aCanvasId start: aStartPoint end: anEndPoint

|canvas ctx|

canvas :=  ('#',aCanvasId) asJQuery at:0.
console log:canvas.
ctx := canvas getContext: '2d'.
ctx beginPath.
ctx moveTo: (aStartPoint x) and: (aStartPoint y).
ctx lineTo: (anEndPoint x) and: (anEndPoint y).
ctx stroke.



2013/4/5 XumuK <[hidden email]>
I have some troubles with converting javascript to smalltalk. It`s hard for me, and i want to port this JS to Amber for learning..

пятница, 5 апреля 2013 г., 11:08:15 UTC+4 пользователь Apostolis Xekoukoulotakis написал:
I am currently working and learning the canvas element myself. What is the difficulty?
Getting the canvas element is the least documented thing you need to do.



2013/4/5 XumuK <[hidden email]>
I want to rewrite arbor.js example using Amber. It will help me to understand Amber more. Could somebody help me with it?

четверг, 4 апреля 2013 г., 22:54:35 UTC+4 пользователь XumuK написал:
Greetings!
It is possible to convert created JS file to ST classes in Amber? 

--
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 amber-lang+...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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 amber-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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 amber-lang+...@googlegroups.com.
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 amber-lang+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--

Sincerely yours, 
     Apostolis Xekoukoulotakis

--
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 amber-lang+...@googlegroups.com.
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.
 
 

--
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