Page 1 of 1

Simple Question

Posted: Mon May 14, 2012 1:23 pm
by g0blu324
How do you modify/edit a function that's been created? (This is the start of 2nd week of learning the language)

Re: Simple Question

Posted: Thu Jul 19, 2012 4:57 pm
by sylwester
In most lisps you can just feed the interactive session the altered definition code and the function will get redefined.
If it was not top level (you defined it inside a function) you'll need to redefine the whole top level function with the changed function in it.

Depending on what language and IDE you're using but DrRacket is a Scheme IDE where you can do your deiinitions in a file and when you change the file you can just hit run to make all your changes in effect. It has a pretty good debugger as well which also is usefull to understand code you haven't written yourself or to find bugs :)