jeandrek / do-it

Toy compiled language
GNU General Public License v3.0
2 stars 1 forks source link

Local procedures #11

Closed jeandrek closed 8 years ago

jeandrek commented 8 years ago

Oh. I was planning to implicitly pass the values of local variables of the outer procedure as arguments to the inner procedure. But then assignment won't work properly in cases like

(defproc test (string)
  (defproc local-procedure ()
    (set string "Goodbye."))
  (display-line string)
  (local-procedure)
  (display-line string))

(test "Hello.")

which should output

Hello.
Goodbye.

but with my idea output

Hello.
Hello.
jeandrek commented 8 years ago

I could pass references but I have no idea how. Closing, for now at least