FOOP colon method invocation from string
Posted: Thu Aug 08, 2013 10:28 pm
Hi there,
i play with newLISP from time to time because writing code in 'real world' languages feels like merry go round. So to avoid a lapse of reason i'm playing atm with my imaginary programming task which goes :
Take list of method names stored in list of strings ( or symbols - i'm an ignorant noob) and invoke them on an object.
What i have now:
This is my first post, so it's a good time to thank you people, who are behind newLISP for this outstanding piece of software :-)
I'd like to follow with a few more questions considering FOOP in this same thread if you don't mind. The context of newLISP is main reason for using this language to me, so forgive me i started learning from this point and not the basics. I just can't figure out if context from newLISP works for me or not. I'm trying to build my own approach to OOP paradigm. Based on composition, without inheritance. I want to replace PHP with NewLISP as a foundament.
cheers
i play with newLISP from time to time because writing code in 'real world' languages feels like merry go round. So to avoid a lapse of reason i'm playing atm with my imaginary programming task which goes :
Take list of method names stored in list of strings ( or symbols - i'm an ignorant noob) and invoke them on an object.
What i have now:
Code: Select all
(define (Circle:area)
(mul (pow (self 3) 2) (acos 0) 2))
(set 'method1 '(:area))
(set 'mycircle (Circle 1 2 10))
((nth 0 method1)(nth 1 method1) mycircle)
I'd like to follow with a few more questions considering FOOP in this same thread if you don't mind. The context of newLISP is main reason for using this language to me, so forgive me i started learning from this point and not the basics. I just can't figure out if context from newLISP works for me or not. I'm trying to build my own approach to OOP paradigm. Based on composition, without inheritance. I want to replace PHP with NewLISP as a foundament.
cheers