1

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

user3450695
  • 2,281
  • 4
  • 16
  • 16
  • 4
    There is `set!` that does what you want, but it's not idiomatic. Show us your code and we can tell you how it would be written in Scheme. – uselpa Sep 27 '14 at 21:42

1 Answers1

0

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

Alaya
  • 3,287
  • 4
  • 27
  • 39