metaprogramming in smalltalk

Hi! Please could you help me understand smalltalk capabilities in metaprogramming? Q: could I construct arbitrary message by program? Create keywords from strings and than build sequence of them to make a message. Mm? Or may be store keywords in variables and then pass variables withing messages extracting stored keywords? Am I dreamer?) -- View this message in context: http://forum.world.st/metaprogramming-in-smalltalk-tp4595928p4595928.html Sent from the ESUG mailing list archive at Nabble.com.

Mmhm - sounds like a home assignment to me... Go to www.pharo.org download it and have a look in the browser. - Francisco On 29 Apr 2012, at 09:25, vittly <vitaly.kosenko@gmail.com> wrote:
Hi! Please could you help me understand smalltalk capabilities in metaprogramming? Q: could I construct arbitrary message by program? Create keywords from strings and than build sequence of them to make a message. Mm? Or may be store keywords in variables and then pass variables withing messages extracting stored keywords? Am I dreamer?)
-- View this message in context: http://forum.world.st/metaprogramming-in-smalltalk-tp4595928p4595928.html Sent from the ESUG mailing list archive at Nabble.com.
_______________________________________________ Esug-list mailing list Esug-list@lists.esug.org http://lists.esug.org/mailman/listinfo/esug-list_lists.esug.org

Smalltalk is fully reflective, designed to be so right from the start. So the answer to your question is "Yes". -----Original Message----- From: vittly [mailto:vitaly.kosenko@gmail.com] Sent: April-29-12 10:25 AM To: esug-list@lists.esug.org Subject: [Esug-list] metaprogramming in smalltalk Hi! Please could you help me understand smalltalk capabilities in metaprogramming? Q: could I construct arbitrary message by program? Create keywords from strings and than build sequence of them to make a message. Mm? Or may be store keywords in variables and then pass variables withing messages extracting stored keywords? Am I dreamer?) -- View this message in context: http://forum.world.st/metaprogramming-in-smalltalk-tp4595928p4595928.html Sent from the ESUG mailing list archive at Nabble.com. _______________________________________________ Esug-list mailing list Esug-list@lists.esug.org http://lists.esug.org/mailman/listinfo/esug-list_lists.esug.org

Please try to understand the following code: | a b c | a := 3. b := 4. c := '+'. ^a perform: c asSymbol with: b Georg Heeg eK, Dortmund und Köthen, HR Dortmund A 12812 Wallstraße 22, 06366 Köthen Tel. +49-3496-214328, Fax +49-3496-214712 -----Ursprüngliche Nachricht----- Von: esug-list-bounces@lists.esug.org [mailto:esug-list-bounces@lists.esug.org] Im Auftrag von vittly Gesendet: Sonntag, 29. April 2012 10:25 An: esug-list@lists.esug.org Betreff: [Esug-list] metaprogramming in smalltalk Hi! Please could you help me understand smalltalk capabilities in metaprogramming? Q: could I construct arbitrary message by program? Create keywords from strings and than build sequence of them to make a message. Mm? Or may be store keywords in variables and then pass variables withing messages extracting stored keywords? Am I dreamer?) -- View this message in context: http://forum.world.st/metaprogramming-in-smalltalk-tp4595928p4595928.html Sent from the ESUG mailing list archive at Nabble.com. _______________________________________________ Esug-list mailing list Esug-list@lists.esug.org http://lists.esug.org/mailman/listinfo/esug-list_lists.esug.org

Mmm thnx for replie! I'll run this code and experemt with it 2012/4/29 Georg Heeg [via Smalltalk] < ml-node+s1294792n4596217h96@n4.nabble.com>
Please try to understand the following code:
| a b c |
a := 3. b := 4. c := '+'. ^a perform: c asSymbol with: b
Georg Heeg eK, Dortmund und Köthen, HR Dortmund A 12812 Wallstraße 22, 06366 Köthen Tel. +49-3496-214328, Fax +49-3496-214712
-----Ursprüngliche Nachricht----- Von: [hidden email] <http://user/SendEmail.jtp?type=node&node=4596217&i=0> [mailto:[hidden email]<http://user/SendEmail.jtp?type=node&node=4596217&i=1>] Im Auftrag von vittly Gesendet: Sonntag, 29. April 2012 10:25 An: [hidden email] <http://user/SendEmail.jtp?type=node&node=4596217&i=2> Betreff: [Esug-list] metaprogramming in smalltalk
Hi! Please could you help me understand smalltalk capabilities in metaprogramming? Q: could I construct arbitrary message by program? Create keywords from strings and than build sequence of them to make a message. Mm? Or may be store keywords in variables and then pass variables withing messages extracting stored keywords? Am I dreamer?)
-- View this message in context: http://forum.world.st/metaprogramming-in-smalltalk-tp4595928p4595928.html Sent from the ESUG mailing list archive at Nabble.com.
_______________________________________________ Esug-list mailing list [hidden email] <http://user/SendEmail.jtp?type=node&node=4596217&i=3> http://lists.esug.org/mailman/listinfo/esug-list_lists.esug.org
_______________________________________________ Esug-list mailing list [hidden email] <http://user/SendEmail.jtp?type=node&node=4596217&i=4> http://lists.esug.org/mailman/listinfo/esug-list_lists.esug.org
------------------------------ If you reply to this email, your message will be added to the discussion below: http://forum.world.st/metaprogramming-in-smalltalk-tp4595928p4596217.html To unsubscribe from metaprogramming in smalltalk, click here<http://forum.world.st/template/NamlServlet.jtp?macro=unsubscribe_by_code&nod...> . NAML<http://forum.world.st/template/NamlServlet.jtp?macro=macro_viewer&id=instant...>
-- View this message in context: http://forum.world.st/metaprogramming-in-smalltalk-tp4595928p4596244.html Sent from the ESUG mailing list archive at Nabble.com.

Ok. perform: is working for arithmetic but what about perform: itself? | x y plu perf wi args | x := 3. y := 4. plu := '+'. perf := 'perform:'. wi := 'with:'. args := Array new: 3. args at: 1 put: plu asSymbol; at: 2 put: wi asSymbol; at: 3 put: y. x perform: perf asSymbol withArguments: args. This code tells me that there is wrong number of arguments in permforn: How can I fix it? 2012/4/29 vittly <vitaly.kosenko@gmail.com>
Mmm thnx for replie! I'll run this code and experemt with it
2012/4/29 Georg Heeg [via Smalltalk] <[hidden email]<http://user/SendEmail.jtp?type=node&node=4596244&i=0>
Please try to understand the following code:
| a b c |
a := 3. b := 4. c := '+'. ^a perform: c asSymbol with: b
Georg Heeg eK, Dortmund und Köthen, HR Dortmund A 12812 Wallstraße 22, 06366 Köthen Tel. +49-3496-214328, Fax +49-3496-214712
-----Ursprüngliche Nachricht----- Von: [hidden email]<http://user/SendEmail.jtp?type=node&node=4596217&i=0> [mailto:[hidden email]<http://user/SendEmail.jtp?type=node&node=4596217&i=1>] Im Auftrag von vittly Gesendet: Sonntag, 29. April 2012 10:25 An: [hidden email] <http://user/SendEmail.jtp?type=node&node=4596217&i=2> Betreff: [Esug-list] metaprogramming in smalltalk
Hi! Please could you help me understand smalltalk capabilities in metaprogramming? Q: could I construct arbitrary message by program? Create keywords from strings and than build sequence of them to make a message. Mm? Or may be store keywords in variables and then pass variables withing messages extracting stored keywords? Am I dreamer?)
-- View this message in context: http://forum.world.st/metaprogramming-in-smalltalk-tp4595928p4595928.html Sent from the ESUG mailing list archive at Nabble.com.
_______________________________________________ Esug-list mailing list [hidden email] <http://user/SendEmail.jtp?type=node&node=4596217&i=3> http://lists.esug.org/mailman/listinfo/esug-list_lists.esug.org
_______________________________________________ Esug-list mailing list [hidden email] <http://user/SendEmail.jtp?type=node&node=4596217&i=4> http://lists.esug.org/mailman/listinfo/esug-list_lists.esug.org
------------------------------ If you reply to this email, your message will be added to the discussion below: http://forum.world.st/metaprogramming-in-smalltalk-tp4595928p4596217.html To unsubscribe from metaprogramming in smalltalk, click here. NAML<http://forum.world.st/template/NamlServlet.jtp?macro=macro_viewer&id=instant...>
------------------------------ View this message in context: Re: metaprogramming in smalltalk<http://forum.world.st/metaprogramming-in-smalltalk-tp4595928p4596244.html>
Sent from the ESUG mailing list archive<http://forum.world.st/ESUG-f1589038.html>at Nabble.com.
_______________________________________________ Esug-list mailing list Esug-list@lists.esug.org http://lists.esug.org/mailman/listinfo/esug-list_lists.esug.org

Nice! Almost as elegant as Ward's legendary Symbol>>value: anObject ^anObject perform: self On 29.04.12 13:49, Georg Heeg wrote:
Please try to understand the following code:
| a b c |
a := 3. b := 4. c := '+'. ^a perform: c asSymbol with: b
Georg Heeg eK, Dortmund und Köthen, HR Dortmund A 12812 Wallstraße 22, 06366 Köthen Tel. +49-3496-214328, Fax +49-3496-214712
-----Ursprüngliche Nachricht----- Von: esug-list-bounces@lists.esug.org [mailto:esug-list-bounces@lists.esug.org] Im Auftrag von vittly Gesendet: Sonntag, 29. April 2012 10:25 An: esug-list@lists.esug.org Betreff: [Esug-list] metaprogramming in smalltalk
Hi! Please could you help me understand smalltalk capabilities in metaprogramming? Q: could I construct arbitrary message by program? Create keywords from strings and than build sequence of them to make a message. Mm? Or may be store keywords in variables and then pass variables withing messages extracting stored keywords? Am I dreamer?)
-- View this message in context: http://forum.world.st/metaprogramming-in-smalltalk-tp4595928p4595928.html Sent from the ESUG mailing list archive at Nabble.com.
_______________________________________________ Esug-list mailing list Esug-list@lists.esug.org http://lists.esug.org/mailman/listinfo/esug-list_lists.esug.org
_______________________________________________ Esug-list mailing list Esug-list@lists.esug.org http://lists.esug.org/mailman/listinfo/esug-list_lists.esug.org
-- Joseph Pelrine [ | ] MetaProg GmbH Email: jpelrine@metaprog.com Web: http://www.metaprog.com As soon as you introduce people, things become complex.

Hi, you may enjoy http://www.pharocasts.com/search/label/metaprogramming Cheers, Laurent On Sun, Apr 29, 2012 at 10:25 AM, vittly <vitaly.kosenko@gmail.com> wrote:
Hi! Please could you help me understand smalltalk capabilities in metaprogramming? Q: could I construct arbitrary message by program? Create keywords from strings and than build sequence of them to make a message. Mm? Or may be store keywords in variables and then pass variables withing messages extracting stored keywords? Am I dreamer?)
-- View this message in context: http://forum.world.st/metaprogramming-in-smalltalk-tp4595928p4595928.html Sent from the ESUG mailing list archive at Nabble.com.
_______________________________________________ Esug-list mailing list Esug-list@lists.esug.org http://lists.esug.org/mailman/listinfo/esug-list_lists.esug.org
participants (7)
-
Francisco Garau
-
Georg Heeg
-
Joseph Pelrine
-
laurent laffont
-
Richard Sargent
-
Vitaly Kosenko
-
vittly