jeandrek / do-it

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

Block structure #5

Closed jeandrek closed 8 years ago

jeandrek commented 8 years ago

do-it should have block structure

Possibilities:

BookOwl commented 8 years ago

How about a block special form that works just likes, begin, except that it creates a new scope?

jeandrek commented 8 years ago

That's what I meant by the second possibility.

jeandrek commented 8 years ago

I could leave popping the local variables to the end of the procedure, but then the rest of the procedure would be taking more stack space than necessary… I should add another item to the stack at the start of a block but rather than it starting at 0 have it start at the same, and run cleanup at the end of the block

jeandrek commented 8 years ago

I've implemented a block special form on the block branch and it works

EDIT: And I made for use block instead of begin

jeandrek commented 8 years ago

Added with #6