create menu references programmatically

S

Svenn Are Bjerkem

Guest
Hi,

I am currently trying to implement my Ocean menu item in the CIW window
and have a problem because I need to create unique references for the
menu items. A non-working skeleton is shown below to illustrate what I
want. (Actually I want to traverse a directory structure and look for
ocn suffixes, but that is for later). I somehow have to make the
oceanMenuItem below unique. In Tcl I would have done it like this

for {set i 0} {$i < $arg1} {incr i} {
set oceanMenuItem$i [hiCreateMenuItem \$oceanMenuItem$i ....
}

just to illustrate what my problem is. I need to automatically make
variable names, and that is something which I do not understand how to
do with SKILL yet.

(defun SABfillMenu (arg1)
(for i 0 arg1
(setq oceanMenuItem (hiCreateMenuItem
?name 'oceanMenuItem
?itemText "MenuItem"
?callback "printf(\"MenuItem\")"))
(hiAddMenuItem sabOceanMenu oceanMenuItem)))
--
Svenn
 
Svenn Are Bjerkem <svenn.are@bjerkem.de> writes:

I need to automatically make variable names,
You should be able to do that with gensym.

Yours,

--
Jean-Marc
 
In article <pxbfyug5fgn.fsf@news.bourguet.org>, jm@bourguet.org says...
Svenn Are Bjerkem <svenn.are@bjerkem.de> writes:

I need to automatically make variable names,

You should be able to do that with gensym.
Great,
learned something new today.
--
Svenn
 
You should be able to do that with gensym.
(this will generate a unique symbol from the 'root' you pass in argument)

also, one can use

stringToSymbol( sprintf(nil "menuItem%s" i) )

for example

stéphane
 
"S. Badel" <stephane.badel@REMOVETHISepfl.ch> writes:

You should be able to do that with gensym.


(this will generate a unique symbol from the 'root' you pass in argument)

also, one can use

stringToSymbol( sprintf(nil "menuItem%s" i) )

for example
Ah, that's how they have renamed intern (you can see that I'm more
used to Common Lisp than skill).

Yours,

--
Jean-Marc
 
In article <pxby8883wht.fsf@news.bourguet.org> Jean-Marc Bourguet <jm@bourguet.org> writes:
"S. Badel" <stephane.badel@REMOVETHISepfl.ch> writes:
also, one can use

stringToSymbol( sprintf(nil "menuItem%s" i) )

for example

Ah, that's how they have renamed intern (you can see that I'm more
used to Common Lisp than skill).
Skill is based on Franz Lisp.

And I would use concat() rather than stringToSymbol( sprintf() ):

concat( "menuItem" i )

-Pete Zakel
(phz@seeheader.nospam)

Eggnog is a traditional holiday drink invented by the English. Many
people wonder where the word "eggnog" comes from. The first syllable
comes from the English word "egg", meaning "egg". I don't know where
the "nog" comes from.

To make eggnog, you'll need rum, whiskey, wine, gin and, if they are in
season, eggs...
 
In article <42d84f7a$1@news.cadence.com>, pxhxz@cadence.com says...
Skill is based on Franz Lisp.
I went over to www.franz.com to see for myself what its all about, and
it is probably not something that an engineer like me, who like to play
around with tools on his spare time, will get a license for. I have had
several discussions over lunch on what language is the better to use as
glue in EDA applications. Lisp is a language that I am not so familiar
with as I do not use emacs as my editor and it is a way of thinking that
I am comfortable with.

I doubt that it is possible to have an "evaluation" version of SKILL
which somebody like me can install on his Linux machine at home to play
around with to get comfortable with the language since tool integration
is not my main task.

That's why languages like Tcl with their BSD license fit so well as
glue: I can "practise" the language at home and then do the real stuff
at work. Cadence do offer Tcl as glue for some of their digital
simulators, but I am working on analog. The nice side effect of Tcl is
Tk, which make it very convenient on Windows PC's where it is a lot
easier to work with GUI elements than the command line.

I have geda installed at home and they also use some kind of lisp,
guile, but I found that it is almost impossible to use the little I have
learned in SKILL to be able to use guile. The only thing is the use of
parenthesis and the reverse polish notation which is strict in guile.

I once thought that the computer was there to serve people, but soon
realized that we live to serve the matrix.

Well, time to get back to my symbols ...
--
Svenn
 
On Mon, 18 Jul 2005 10:00:06 +0200, Svenn Are Bjerkem <svenn.are@bjerkem.de>
wrote:

In article <42d84f7a$1@news.cadence.com>, pxhxz@cadence.com says...
Skill is based on Franz Lisp.

I went over to www.franz.com to see for myself what its all about, and
it is probably not something that an engineer like me, who like to play
around with tools on his spare time, will get a license for. I have had
several discussions over lunch on what language is the better to use as
glue in EDA applications. Lisp is a language that I am not so familiar
with as I do not use emacs as my editor and it is a way of thinking that
I am comfortable with.
Whilst SKILL is based on Franz Lisp, the Lisp provided by Franz Inc is not...
They supply a Common Lisp (Allegro Common Lisp) whereas Franz Lisp predated
Common Lisp:

http://www.idiom.com/free-compilers/TOOL/Lisp-4.html

That's the trouble with a language as old as Lisp - where the
"standardisation" came rather late in its life. Too many variants were out
there by the time Common Lisp (and SCHEME) came along.

And then Cadence also allowed a more conventional language entry (infix
operators, etc) to avoid scaring off engineers who weren't familiar with Lisp.

Regards,

Andrew.
 
In article <0dqmd1huqhv0vqhomdqoggkpk46e7bvihk@4ax.com>,
andrewb@DcEaLdEeTnEcTe.HcIoSm says...
Whilst SKILL is based on Franz Lisp, the Lisp provided by Franz Inc is not...
Damn, is this something like "GNU is Not Unix": Franz is Lisp but not
Franz Lisp. I would probably not be able to see the difference anyway.
I'll probably leave the can of worms securely closed ...

--
Svenn
 
On Tue, 19 Jul 2005 08:25:55 +0200, Svenn Are Bjerkem <svenn.are@bjerkem.de>
wrote:

In article <0dqmd1huqhv0vqhomdqoggkpk46e7bvihk@4ax.com>,
andrewb@DcEaLdEeTnEcTe.HcIoSm says...
Whilst SKILL is based on Franz Lisp, the Lisp provided by Franz Inc is not...

Damn, is this something like "GNU is Not Unix": Franz is Lisp but not
Franz Lisp. I would probably not be able to see the difference anyway.
I'll probably leave the can of worms securely closed ...
Ah yes. I've thrown all my tin openers away for this precise reason ;-)

Andrew.
 
Andrew Beckett wrote:

On Tue, 19 Jul 2005 08:25:55 +0200, Svenn Are Bjerkem <svenn.are@bjerkem.de
wrote:


In article <0dqmd1huqhv0vqhomdqoggkpk46e7bvihk@4ax.com>,
andrewb@DcEaLdEeTnEcTe.HcIoSm says...

Whilst SKILL is based on Franz Lisp, the Lisp provided by Franz Inc is not...

Damn, is this something like "GNU is Not Unix": Franz is Lisp but not
Franz Lisp. I would probably not be able to see the difference anyway.
I'll probably leave the can of worms securely closed ...


Ah yes. I've thrown all my tin openers away for this precise reason ;-)
Did I see at some point an argument for open-sourcing SKILL ?

Svenn,
leave the worms, and bite the bullet instead. You can install and run enough
of IC itself at home, on your linux machine, to get more comfortable with SKILL.
 
In article <11ekkhm3qgm9b3c@news.supernews.com>,
cad_support@skipthisandunderscores.catena.nl says...
Did I see at some point an argument for open-sourcing SKILL ?
At some point I thought that the idea of an infix-friendly Lisp would be
a friendly entry for non-lispers. In the mean time I have found that
hard-core lispers often use lisp because of the RPN just like some
people love HP calculators with that ENTER button.

Svenn,
leave the worms, and bite the bullet instead. You can install and run enough
of IC itself at home, on your linux machine, to get more comfortable with SKILL.
Maybe Cadence also offer courtesy copies of their software not just the
Function Quick Reference? (Dream on dude)
--
Svenn
 
Svenn Are Bjerkem wrote:

In article <11ekkhm3qgm9b3c@news.supernews.com>,
cad_support@skipthisandunderscores.catena.nl says...
Did I see at some point an argument for open-sourcing SKILL ?
At some point I thought that the idea of an infix-friendly Lisp would be
a friendly entry for non-lispers. In the mean time I have found that
hard-core lispers often use lisp because of the RPN just like some
people love HP calculators with that ENTER button.
Ah well...habits.
I used to have a lot of fun with with hp48 , but I was still using it in infix
mode as soon as the expression got bigger.

Svenn,
leave the worms, and bite the bullet instead. You can install and run enough
of IC itself at home, on your linux machine, to get more comfortable with SKILL.

Maybe Cadence also offer courtesy copies of their software not just the
Function Quick Reference? (Dream on dude)
You never know until you try ... did you ever investigate what the practical
license requirements are for the "skill" executable, or the workbench
executables (icda and such) ?
 
In article <11f7b00ag8ng324@news.supernews.com>,
cad_support@skipthisandunderscores.catena.nl says...
You never know until you try ... did you ever investigate what the practical
license requirements are for the "skill" executable, or the workbench
executables (icda and such) ?
I'm not quite sure I understand what you mean. I'm not going to copy any
software from my company computer to my home computer if that is what
you want to say. I like my job too much to risk anything like that.

If Cadence motivate their users in any way to take interest in their
main work tool on the spare time by setting up some kind of program to
allow this I would welcome this. My life is covered by German law so my
employer own anything I invent, even on my spare time, so there is not
much danger that I will use any such employee-spare-time-hacking
licenses to make a second living during the night. But it would make it
much more easy for me to try out features of my main work tool in peace
so that I can increase my productivity during paid work hours.

Maybe it is different in other countries.
--
Svenn
 

Welcome to EDABoard.com

Sponsor

Back
Top