Home > Community > Forums > Custom IC SKILL > Skill equivalent commands for....

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Skill equivalent commands for.... 

Last post Thu, Aug 9 2007 11:54 PM by archive. 2 replies.
Started by archive 09 Aug 2007 11:54 PM. Topic has 2 replies and 1823 views
Page 1 of 1 (3 items)
Sort Posts:
  • Thu, Aug 9 2007 11:54 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    Skill equivalent commands for.... Reply

    Hi , There are few commands (lists) which make tcl very flexible to use. I was hoping if some of them already exist in custom skill or some one can write those commands in skill. those tcl commands I want in skill are... lrange list i j Returns the i th through j th elements from list. linsert list index arg arg .. Insert elements into list before the element at position index. Returns a new list. lreplace list i j arg arg ... Replace elements i through j of list with the args. Returns a new list. lsearch mode list value Return the index of the element in list that matches the value according to the mode, which is -exact, -glob, or -regexp. -glob is the default. Return -1 if not found. lsort switches list Sort elements of the list according to the switches: -ascii, -integer, -real, -increasing, -decreasing, -command command. Returns a new list. Hope some one can tell me if there are any skill equivalent of the above or any functions that can be written. Thanks, Sathya. ASIC Engr.


    Originally posted in cdnusers.org by rimser9
    • Post Points: 0
  • Fri, Aug 10 2007 1:08 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: Skill equivalent commands for.... Reply

    In fact, given that SKILL is really a LISP variant, support for lists is _much_ greater than in Tcl. That said, some of the Tcl commands are effectively treating a list as an array, which is not a good way to use them in SKILL (since lists are truly sequential).

    Rather than me trying to give you equivalents of the above (there aren't quite direct replacements for lrange, linsert, lreplace; lsearch is either member() or exists(); lsort is sort() with particular arguments), best is to read the SKILL User Guide and think about how you're manipulating lists. If you're doing a lot of list ranging and splicing, then that's not going to be so efficient to do in SKILL - there would almost certainly be better ways of doing this - or to use different structures.

    Regards,

    Andrew.


    Originally posted in cdnusers.org by adbeckett
    • Post Points: 0
  • Sun, Aug 12 2007 2:01 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: Skill equivalent commands for.... Reply

    I agree with what Andrew said.
    In addition, SKILL has the capability to "modify" a list, which TCL does not: the reason the functions above "return a new list" is because TCL cannot modify the existing list.

    So, for example, would you want an linsert that inserts into the current list, which could be done efficiently, or one that has to make a copy of the original list, which would be inefficient?

    It depends on exactly what you are trying to do.


    Originally posted in cdnusers.org by ian.dobinson@matrixone.com
    • Post Points: 0
Page 1 of 1 (3 items)
Sort Posts:
Started by archive at 09 Aug 2007 11:54 PM. Topic has 2 replies.