Simple Question
Forum rules
Please respect your teacher's guidelines. Homework is a learning tool. If we just post answers, we aren't actually helping. When you post questions, be sure to show what you have tried or what you don't understand.
Please respect your teacher's guidelines. Homework is a learning tool. If we just post answers, we aren't actually helping. When you post questions, be sure to show what you have tried or what you don't understand.
Simple Question
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
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
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

I'm the author of two useless languages that uses BF as target machine.
Currently I'm planning a Scheme compiler :p
Currently I'm planning a Scheme compiler :p