discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Local function and local modules definitions inside a module.

R
royasutton
Wed, Jan 9, 2019 4:39 PM

Just discovered that functions and modules can be defined locally within a
module. After searching the documentation and forum, can't determine if this
is an officially supported feature.

Question: Is this a feature of the language or might it go away at some
point?

...very useful!

RAS

--
Sent from: http://forum.openscad.org/

Just discovered that functions and modules can be defined locally within a module. After searching the documentation and forum, can't determine if this is an officially supported feature. *Question*: Is this a feature of the language or might it go away at some point? ...very useful! RAS -- Sent from: http://forum.openscad.org/
M
MichaelAtOz
Wed, Jan 9, 2019 8:27 PM

It's widely used, so won't be going anywhere.


Admin - email* me if you need anything, or if I've done something stupid...

  • click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/  time is running out!

Sent from: http://forum.openscad.org/

It's widely used, so won't be going anywhere. ----- Admin - email* me if you need anything, or if I've done something stupid... * click on my MichaelAtOz label, there is a link to email me. Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out! -- Sent from: http://forum.openscad.org/
T
Troberg
Thu, Jan 10, 2019 7:26 AM

What?

You mean I can do a:

module mypart(){
module mysubpart(){
//Do stuff
}

 mysubpart();

}

Mysubpart wouldn't be visible outside mypart?

That would be amazingly useful, and should definitely be documented!

--
Sent from: http://forum.openscad.org/

What? You mean I can do a: module mypart(){ module mysubpart(){ //Do stuff } mysubpart(); } Mysubpart wouldn't be visible outside mypart? That would be amazingly useful, and should definitely be documented! -- Sent from: http://forum.openscad.org/
NH
nop head
Thu, Jan 10, 2019 8:29 AM

Yes you can do that. Also mysubpart() can access the variables in mypart().

On Thu, 10 Jan 2019 at 07:26, Troberg troberg.anders@gmail.com wrote:

What?

You mean I can do a:

module mypart(){
module mysubpart(){
//Do stuff
}

  mysubpart();

}

Mysubpart wouldn't be visible outside mypart?

That would be amazingly useful, and should definitely be documented!

--
Sent from: http://forum.openscad.org/


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Yes you can do that. Also mysubpart() can access the variables in mypart(). On Thu, 10 Jan 2019 at 07:26, Troberg <troberg.anders@gmail.com> wrote: > What? > > You mean I can do a: > > module mypart(){ > module mysubpart(){ > //Do stuff > } > > mysubpart(); > } > > Mysubpart wouldn't be visible outside mypart? > > That would be amazingly useful, and should definitely be documented! > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
M
MichaelAtOz
Sun, Jan 13, 2019 1:56 AM

Troberg wrote

That would be amazingly useful, and should definitely be documented!

Now mentioned in the  wiki
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/User-Defined_Functions_and_Modules
.


Admin - email* me if you need anything, or if I've done something stupid...

  • click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/  time is running out!

Sent from: http://forum.openscad.org/

Troberg wrote > That would be amazingly useful, and should definitely be documented! Now mentioned in the wiki <https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/User-Defined_Functions_and_Modules> . ----- Admin - email* me if you need anything, or if I've done something stupid... * click on my MichaelAtOz label, there is a link to email me. Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out! -- Sent from: http://forum.openscad.org/