create menu references programmatically

Discussion in 'Cadence' started by Svenn Are Bjerkem, Jul 15, 2005.

  1. 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 Are Bjerkem, Jul 15, 2005
    #1
  2. You should be able to do that with gensym.

    Yours,
     
    Jean-Marc Bourguet, Jul 15, 2005
    #2
  3. Great,
    learned something new today.
     
    Svenn Are Bjerkem, Jul 15, 2005
    #3
  4. Svenn Are Bjerkem

    S. Badel Guest

    (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, Jul 15, 2005
    #4
  5. Ah, that's how they have renamed intern (you can see that I'm more
    used to Common Lisp than skill).

    Yours,
     
    Jean-Marc Bourguet, Jul 15, 2005
    #5
  6. Svenn Are Bjerkem

    Guest Guest

    Skill is based on Franz Lisp.

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

    concat( "menuItem" i )

    -Pete Zakel
    ()

    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...
     
    Guest, Jul 16, 2005
    #6
  7. 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 Are Bjerkem, Jul 18, 2005
    #7
  8. 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.
     
    Andrew Beckett, Jul 18, 2005
    #8
  9. 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 Are Bjerkem, Jul 19, 2005
    #9
  10. Ah yes. I've thrown all my tin openers away for this precise reason ;-)

    Andrew.
     
    Andrew Beckett, Jul 19, 2005
    #10
  11. 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.
    Maybe Cadence also offer courtesy copies of their software not just the
    Function Quick Reference? (Dream on dude)
     
    Svenn Are Bjerkem, Aug 3, 2005
    #11
  12. 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 Are Bjerkem, Aug 11, 2005
    #12
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.