Is there a way to change the values of variables in this language?

守給你的承諾、 提交于 2019-12-11 10:14:27

问题


I am writing a procedure in scheme and I am trying to manipulate the values of variables. I use the define function to give a value to a variable but I can't change the value. I would have used the let function but the variable change is only effective in the body of the let function. Are there other ways to manipulate variabes and be able to view the changes from anywhere in the procedure?

Thanks


回答1:


you can use set! set-car! set-cdr! after the variable has been defined



来源:https://stackoverflow.com/questions/26079480/is-there-a-way-to-change-the-values-of-variables-in-this-language

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!