curv3d / curv

a language for making art using mathematics
Apache License 2.0
1.14k stars 73 forks source link

Definitions scope: block "let ... in ... where (...)" #52

Closed ivocavalcante closed 5 years ago

ivocavalcante commented 5 years ago

Describe the bug Code below used to work, now it doesn't. Is it by design? Seems most internal "let" can't see outside block definitions.

Curv Program

let
    dummy = 1;
in
    let
        b = a;
    in
        b;
where
    (
        a = sphere;
    )

Expected behavior A simple sphere drawn on Viewer window. Getting this instead:

ERROR: a: not defined
b = a;
    ^

System Information (please complete the following information):

doug-moen commented 5 years ago

Thanks for reporting this. Fixed.

ivocavalcante commented 5 years ago

Thanks Doug, you're the one! Was really worried about having to change my previous code (and had no idea how to do that).