is there a way of doing "callbacks" ( i.e. passing function as argument to be called later ) ?
This is a question Chris did to me and it reminded me some related questions i forgot to ask: Is there a type "function" or type "Class" ? Is there anyway for "evaluating" a string to chuck code in order to do dynamic calls ( like javascript "eval" function for instance ) ?
henrique matias wrote:
This is a question Chris did to me and it reminded me some related questions i forgot to ask:
Is there a type "function" or type "Class" ?
Class yes, function no unfortunately. The workaround I use is small "functor" classes, similar in style to inner classes in java. E.g. https://github.com/heuermh/lick/blob/c3ad1e94a226001b4c6229fb0c741cef046f743... https://github.com/heuermh/lick/blob/c3ad1e94a226001b4c6229fb0c741cef046f743... Some doc here (that needs a lot of updating) https://github.com/heuermh/lick/wiki
Is there anyway for "evaluating" a string to chuck code in order to do dynamic calls ( like javascript "eval" function for instance ) ?
You might be able to hack this by writing to a temp file and Machine.add'ing it. michael
Fucking good answer in no-time ! I fucking love this list !
Actually i would love to know more about chuck source code so i could
somehow help to improve.
I swear chuck is in my priority list, was love at first sight.
lets keep this list hot ( :
On 22 May 2012 23:19, Michael Heuer
henrique matias wrote:
This is a question Chris did to me and it reminded me some related questions i forgot to ask:
Is there a type "function" or type "Class" ?
Class yes, function no unfortunately. The workaround I use is small "functor" classes, similar in style to inner classes in java. E.g.
https://github.com/heuermh/lick/blob/c3ad1e94a226001b4c6229fb0c741cef046f743...
https://github.com/heuermh/lick/blob/c3ad1e94a226001b4c6229fb0c741cef046f743...
Some doc here (that needs a lot of updating)
https://github.com/heuermh/lick/wiki
Is there anyway for "evaluating" a string to chuck code in order to do dynamic calls ( like javascript "eval" function for instance ) ?
You might be able to hack this by writing to a temp file and Machine.add'ing it.
michael _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Is there anyway for "evaluating" a string to chuck code in order to do dynamic calls ( like javascript "eval" function for instance ) ?
You might be able to hack this by writing to a temp file and Machine.add'ing it.
Indeed. These are valid things to desire, Lisp and its decendants are alive, fun and well still (or finally, one might argue)... but I feel compelled to point out that this is the direction where old maps would write "here be dragons" and modern games would have you encounter 3 health items and a save-point. Carry on ;-) Kas.
Man, long time i didn't get that excited with programming stuff ( this year
i'll make 15 years of programming ) - like programming shit instead of
sleeping, the day my boss/coworkers start to find my late posts in the
chuck list i'll be probably fired! HAHA
Hopefully i'll be able to do some push requests to the project in this year
( i have some unfinished projects in the priority + dayjob ).
Completely changing the direction of the conversation, i know some
instituions sometimes give sponsor$hip for a period of development in open
source software, did anybody from chuck team tried that ?
happy chucking
On 23 May 2012 00:14, Kassen
Is there anyway for "evaluating" a string to chuck code in order to do dynamic calls ( like javascript "eval" function for instance ) ?
You might be able to hack this by writing to a temp file and
Machine.add'ing it.
Indeed. These are valid things to desire, Lisp and its decendants are alive, fun and well still (or finally, one might argue)... but I feel compelled to point out that this is the direction where old maps would write "here be dragons" and modern games would have you encounter 3 health items and a save-point.
Carry on ;-) Kas. _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
On Wed, May 23, 2012 at 03:27:40AM +0100, henrique matias wrote:
Man, long time i didn't get that excited with programming stuff ( this year i'll make 15 years of programming ) - like programming shit instead of sleeping, the day my boss/coworkers start to find my late posts in the chuck list i'll be probably fired! HAHA
This is really great to hear.
Hopefully i'll be able to do some push requests to the project in this year ( i have some unfinished projects in the priority + dayjob ).
Completely changing the direction of the conversation, i know some instituions sometimes give sponsor$hip for a period of development in open source software, did anybody from chuck team tried that ?
Well, Princeton and Stanford more or less sponsor ChucK by employing (most of?) the developers and of course by providing ChucK with web-space. I could imagine more of that. In the past I have speculated that there might be a institute willing to sponsor some development on making ChucK and the MiniAudicle more accessible to blind users. We have some people on board who are visually challenged and when I look at mainstream music programs I can quite easily see how they would end up with ChucK or a similar system. That said; there are reportedly still some less than ideal bits for those users. That's just one area where I could imagine that there might be some funding and where somebody might pick it up and help improve the world a bit. There are likely many more. Nice to read a mail as enthusiastic as yours. Rock on! Kas.
It will work surely.
Hopefully someone will have some energy soon to put this hack inside a
native function in chuck.
Can't wait to try stuff on the sources.
respect,
peace
On 23 May 2012 16:51, Robert Poor
On Tue, May 22, 2012 at 3:19 PM, Michael Heuer
wrote: You might be able to hack [eval] by writing to a temp file and Machine.add'ing it.
That is sooo deliciously nasty, and I don't see why it couldn't work. I wish I'd thought of it. _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
Hi All,
Henrique, I highly encourage you to take a deep look at Michael Heuer's
LiCK library. There are some great things in there that take advantage of
a functional paradigm in a generally functional-unfriendly language.
And while we're talking about functional style and other nerdery, I submit
for your consideration my attempt to implement a Closure in Chuck to avoid
overmuch global state. This should appeal to you JavaScript geeks out
there as well. It's influenced by ideas in LiCK. And while it's a bit
harder to read than your traditional Chuckian style, it's the most
bang-for-buck (in terms of lines of code) I could get out of Chuck in a
short session.
Comments most welcome.
Enjoy!
-Mike
http://michaelclemow.com
http://semiotech.org
On Wed, May 23, 2012 at 11:51 AM, Robert Poor
On Tue, May 22, 2012 at 3:19 PM, Michael Heuer
wrote: You might be able to hack [eval] by writing to a temp file and Machine.add'ing it.
That is sooo deliciously nasty, and I don't see why it couldn't work. I wish I'd thought of it. _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
I'll need a bit of time to figure out and do some tests on this tricks. I
still very kiddo on chuck, for instance i don't know what "<<" does.
Anyway i liked the Constructor workaround, and as soon as i get back to
chuck will see also how possible is to mess the source as well.
thanks for the energy on this subject
cya
On 24 May 2012 18:39, mike clemow
Hi All,
Henrique, I highly encourage you to take a deep look at Michael Heuer's LiCK library. There are some great things in there that take advantage of a functional paradigm in a generally functional-unfriendly language.
And while we're talking about functional style and other nerdery, I submit for your consideration my attempt to implement a Closure in Chuck to avoid overmuch global state. This should appeal to you JavaScript geeks out there as well. It's influenced by ideas in LiCK. And while it's a bit harder to read than your traditional Chuckian style, it's the most bang-for-buck (in terms of lines of code) I could get out of Chuck in a short session.
Comments most welcome.
Enjoy!
-Mike
http://michaelclemow.com http://semiotech.org
On Wed, May 23, 2012 at 11:51 AM, Robert Poor
wrote: On Tue, May 22, 2012 at 3:19 PM, Michael Heuer
wrote: You might be able to hack [eval] by writing to a temp file and Machine.add'ing it.
That is sooo deliciously nasty, and I don't see why it couldn't work. I wish I'd thought of it. _______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
participants (5)
-
henrique matias
-
Kassen
-
Michael Heuer
-
mike clemow
-
Robert Poor