SKILL Q: Lispish version of "obj1~>points = obj2~>points"

Discussion in 'Cadence' started by Edward, Jul 4, 2007.

  1. Edward

    Edward Guest

    After failing to get SKILL mode working in Emacs, I decided to write
    all my SKILL code using standard Lisp sexp-notation. I did this
    because Emacs has plenty of lisp modes for my mark-up and indentation
    needs. But recently I ran into code that refused to work with "set"
    or "setq." I finally had to revert to this in order to get this
    simple swap to work:

    temp = obj1~>points
    obj1~>points = obj2~>points
    obj2~>points = temp

    The (non-working) Lispish version looked like this:

    (setq temp obj1~>points)
    (set obj1~>points obj2~points)
    (set obj2~>points temp)

    Anyone know the magic here? Is there some specialized set command
    that works only with db objects?
     
    Edward, Jul 4, 2007
    #1
  2. From memory, something like this should work (not tested, first thing I'd
    test if it doesn't would be not to quote points)

    (let ((temp (dbGetq obj1 'points)))
    (dbSetq obj1 (dbGetq obj2 'points) 'points)
    (dbSetq obj2 temp 'points))

    Yours,
     
    Jean-Marc Bourguet, Jul 4, 2007
    #2
  3. Edward

    Edward Guest

    Yes, Jean-Marc, this was just what I needed! However, the property
    name is expressed as a string ("points") instead of a symbol
    ('points). Thanks for the information.

    Kindly,

    Edward
     
    Edward, Jul 11, 2007
    #3
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.