x11start
Guest
when I was little, there was a toy (which I always dreamed of and never received!), which was composed of many colorful cubes and with electrical contacts on some sides. These cubes contained electrical and electronic circuits, which performed a specific function. By approaching these cubes to each other, it was possible to create devices of a certain complexity, following the instructions of a small manual.
the concept is exactly that of autolisp subs.
Until now, when I wanted to create a new command, I began to open my old list and went to "copy & paste". now I would like to start keeping separate in my "cubes" in single files and create the new command "by assembling" the various cubes by (load"name of thecubo").
This idea of separate files is similar to the approach obtained with projects in visual lisp (prj), however also in that case the files belonging to the project I put them all in a folder and then I rewrite the routines every time.
I would like in this post to start making available a series of "modules" so that they become a "freedom" from which to load the modules (or cubes!) that I need. the advantage is to obtain a result much faster and in being able to improve in later times the single module, propagating the improvement to all the commands that use it.
This involves the need to create very well structured modules, with clear indications of the variables required in input and those that are obtained in output and above all be careful not to vary the n. and the type of variables in input and output, if the previous list is not working. for greater clarity I thought that the outgoing ones, being "globals", I want to mark them with a & in front of the name, so as to recognize them: autolisp unlike other languages does not go much for the subtle on the characters used for the various types of variables!
then start with 2 modules called 'x11:tasto' and 'x11:messaggio' (note the x11 as prefix: it is a small vezzo!), these are used in the command 'choice' and 'choice1', both contained in the 'choice.lsp' file.
Well: I threw the first stone.... to you the task of "lapidarmi" with other modules!
the concept is exactly that of autolisp subs.
Until now, when I wanted to create a new command, I began to open my old list and went to "copy & paste". now I would like to start keeping separate in my "cubes" in single files and create the new command "by assembling" the various cubes by (load"name of thecubo").
This idea of separate files is similar to the approach obtained with projects in visual lisp (prj), however also in that case the files belonging to the project I put them all in a folder and then I rewrite the routines every time.
I would like in this post to start making available a series of "modules" so that they become a "freedom" from which to load the modules (or cubes!) that I need. the advantage is to obtain a result much faster and in being able to improve in later times the single module, propagating the improvement to all the commands that use it.
This involves the need to create very well structured modules, with clear indications of the variables required in input and those that are obtained in output and above all be careful not to vary the n. and the type of variables in input and output, if the previous list is not working. for greater clarity I thought that the outgoing ones, being "globals", I want to mark them with a & in front of the name, so as to recognize them: autolisp unlike other languages does not go much for the subtle on the characters used for the various types of variables!
then start with 2 modules called 'x11:tasto' and 'x11:messaggio' (note the x11 as prefix: it is a small vezzo!), these are used in the command 'choice' and 'choice1', both contained in the 'choice.lsp' file.
Well: I threw the first stone.... to you the task of "lapidarmi" with other modules!