doug-moen / openscad2

better abstraction mechanisms for OpenSCAD
Boost Software License 1.0
25 stars 3 forks source link

Objects #7

Closed gwadej closed 9 years ago

gwadej commented 9 years ago

I'm still a bit unclear on the difference between include and use.

If I have a file 'foo.scad' that creates a function bar(), it sounds like there is a difference between the following two cases, but I'm not sure what it is:


include script( "foo.scad" );

bar(x) = 5*x;

use script( "foo.scad" );

bar(x) = 5*x;

And I understand that both are different than

foo = script( "foo.scad" );

bar(x) = 5*x;

doug-moen commented 9 years ago

The subtle and confusing difference between include and use indicated that something was wrong with the design.

I started over from scratch. There is still a use operator, but the meaning and purpose are now quite clear. Objects.md is restructured a bit.

gwadej commented 9 years ago

The new use syntax sort of reminds me of the equivalent in Perl 5.

This approach also has the advantage of changing the implicit behavior difference of include/use into something more explicit. Much better idea.