Language definition ?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Language definition ?

Doug Mcnutt
I'm just getting started but I've been on the web since 3 AM and it's almost 2 PM.

I have found many examples of openscad code and I can make triangle files for simple things.  The target is a 3D printer and the subject is special bobbins for winding electronic coils. I expect problems with suspending thin cylinders in mid air.

I am fluent with FORTRAN, C, C++, perl, and a few assemblers but I have major problems getting code blocks to stay blocks with python.  I also don't like coding by experiment.

Is there a language definition file somewhere that just provides the rules without all of the examples? Something like an RFC?

I live in fear of changing an indentation of 4 spaces into a tab and I really don't like my braces for a single block in different horizontal positions.

Passing arguments to subroutines - er modules - isn't so clear. Call by value or by reference?  On the stack so the module can't change the original? It seems as though arguments have to be declared as name=value pairs like environment variables. That can't be true all the time. Does argument order matter?

I could probably find the definitions given to bison - yacc - but that's not really what I want to spend time with.

Can anyone suggest a link to the real definitions?
--

Applescript syntax is like English spelling:
Roughly, though not thoroughly, thought through.

Reply | Threaded
Open this post in threaded view
|

Re: Language definition ?

nophead


On 6 June 2012 21:15, Doug Mcnutt <[hidden email]> wrote:
I'm just getting started but I've been on the web since 3 AM and it's almost 2 PM.

I have found many examples of openscad code and I can make triangle files for simple things.  The target is a 3D printer and the subject is special bobbins for winding electronic coils. I expect problems with suspending thin cylinders in mid air.

I am fluent with FORTRAN, C, C++, perl, and a few assemblers but I have major problems getting code blocks to stay blocks with python.  I also don't like coding by experiment.

Is there a language definition file somewhere that just provides the rules without all of the examples? Something like an RFC?

 

I live in fear of changing an indentation of 4 spaces into a tab and I really don't like my braces for a single block in different horizontal positions.

Openscad is the same as C regarding braces and whitespace. Indentation is ignored by the compiler.

 

Passing arguments to subroutines - er modules - isn't so clear. Call by value or by reference?  On the stack so the module can't change the original? It seems as though arguments have to be declared as name=value pairs like environment variables. That can't be true all the time. Does argument order matter?

There are no true variables, nothing is mutable, so it doesn't make any difference if it is call by reference or value, other than efficiency, which would be an implementation detail rather than semantics.

Arguments can be passed with names or without. When without the position matters. I am a bit woolly on what happens if you use a mixture.

I could probably find the definitions given to bison - yacc - but that's not really what I want to spend time with.

Can anyone suggest a link to the real definitions?
--

Applescript syntax is like English spelling:
Roughly, though not thoroughly, thought through.
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad