About SKILL ~> and -> Operators

R

Reotaro Hashemoto

Guest
Hello,
What are the exact function of the -> and ~> operators?
Are they quite equivalent?
Shouldn't I get some help about them if i wrote in the CIW: " ~>??
" (w/o quotes) ? I tried to do that but it gave me error:
SYNTAX ERROR found at line 3 column 4 of file *ciwInPort*
*Error* lineread/read: syntax error encountered in input

Is there anyone experience about that who might help me?
Thanks in advance,
Kind Regards,
 
On Feb 14, 8:26 am, "Reotaro Hashemoto" <ahmad.abdulgh...@gmail.com>
wrote:
Hello,
What are the exact function of the -> and ~> operators?
Are they quite equivalent?
Shouldn't I get some help about them if i wrote in the CIW: " ~>??
" (w/o quotes) ? I tried to do that but it gave me error:
SYNTAX ERROR found at line 3 column 4 of file *ciwInPort*
*Error* lineread/read: syntax error encountered in input

Is there anyone experience about that who might help me?
Thanks in advance,
Kind Regards,
I just found an extract from documentation:
Arrow (->) Operator The arrow (->) operator can be applied to
disembodied property lists, defstructs, association tables, and user
types (special application-supplied types) to access property values.
The property must always be a symbol and the value of the property can
be any valid CadenceŽ

SKILL language type. Squiggle Arrow (~>) Operator The squiggle arrow
(~>) operator is a generalization of the arrow operator. It works the
same way as an arrow operator when applied directly to an object, but
it can also accept a list of such objects. It walks the list applying
the arrow operator whenever it finds an atomic object.

But frankly speaking I have just known about ~> so I can't see any
difference yet. I mean difference in practical use.
I hope I've helped you a little bit.
 
On Feb 14, 11:03 am, "sc" <stas...@inbox.ru> wrote:
On Feb 14, 8:26 am, "Reotaro Hashemoto" <ahmad.abdulgh...@gmail.com
wrote:

Hello,
What are the exact function of the -> and ~> operators?
Are they quite equivalent?
Shouldn't I get some help about them if i wrote in the CIW: " ~>??
" (w/o quotes) ? I tried to do that but it gave me error:
SYNTAX ERROR found at line 3 column 4 of file *ciwInPort*
*Error* lineread/read: syntax error encountered in input

Is there anyone experience about that who might help me?
Thanks in advance,
Kind Regards,

I just found an extract from documentation:
Arrow (->) Operator The arrow (->) operator can be applied to
disembodied property lists, defstructs, association tables, and user
types (special application-supplied types) to access property values.
The property must always be a symbol and the value of the property can
be any valid CadenceŽ

SKILL language type. Squiggle Arrow (~>) Operator The squiggle arrow
(~>) operator is a generalization of the arrow operator. It works the
same way as an arrow operator when applied directly to an object, but
it can also accept a list of such objects. It walks the list applying
the arrow operator whenever it finds an atomic object.

But frankly speaking I have just known about ~> so I can't see any
difference yet. I mean difference in practical use.
I hope I've helped you a little bit.
Yes, many thanks,
You'd helped me a lot indeed.. but what about the "~>??" ..
Morover, i want to know where can i get a document, that's better
organized than the SKILL user-guide, including a reference of SKILL
functions, and be good organized as a reference non a manual.

Thanks and Regards,
Ahmad,
 
Reotaro Hashemoto wrote:
On Feb 14, 11:03 am, "sc" <stas...@inbox.ru> wrote:
On Feb 14, 8:26 am, "Reotaro Hashemoto" <ahmad.abdulgh...@gmail.com
wrote:

Hello,
What are the exact function of the -> and ~> operators?
Are they quite equivalent?
Shouldn't I get some help about them if i wrote in the CIW: " ~>??
" (w/o quotes) ? I tried to do that but it gave me error:
SYNTAX ERROR found at line 3 column 4 of file *ciwInPort*
*Error* lineread/read: syntax error encountered in input
Is there anyone experience about that who might help me?
Thanks in advance,
Kind Regards,
I just found an extract from documentation:
Arrow (->) Operator The arrow (->) operator can be applied to
disembodied property lists, defstructs, association tables, and user
types (special application-supplied types) to access property values.
The property must always be a symbol and the value of the property can
be any valid CadenceŽ

SKILL language type. Squiggle Arrow (~>) Operator The squiggle arrow
(~>) operator is a generalization of the arrow operator. It works the
same way as an arrow operator when applied directly to an object, but
it can also accept a list of such objects. It walks the list applying
the arrow operator whenever it finds an atomic object.

But frankly speaking I have just known about ~> so I can't see any
difference yet. I mean difference in practical use.
I hope I've helped you a little bit.

Yes, many thanks,
You'd helped me a lot indeed.. but what about the "~>??" ..
Morover, i want to know where can i get a document, that's better
organized than the SKILL user-guide, including a reference of SKILL
functions, and be good organized as a reference non a manual.

Thanks and Regards,
Ahmad,
~? will list all the available properties. Its a list of symbols when
applied to a db object.
~?? is same as above but will return list of pairs of propName and
propValue.

When applied on list, it is applied recursively, as ~>propName would do.

-
Suresh
 
Suresh Jeevanandam wrote:
Reotaro Hashemoto wrote:
On Feb 14, 11:03 am, "sc" <stas...@inbox.ru> wrote:
On Feb 14, 8:26 am, "Reotaro Hashemoto" <ahmad.abdulgh...@gmail.com
wrote:

Hello,
What are the exact function of the -> and ~> operators?
Are they quite equivalent?
Shouldn't I get some help about them if i wrote in the CIW: " ~>??
" (w/o quotes) ? I tried to do that but it gave me error:
SYNTAX ERROR found at line 3 column 4 of file *ciwInPort*
*Error* lineread/read: syntax error encountered in input
Is there anyone experience about that who might help me?
Thanks in advance,
Kind Regards,
I just found an extract from documentation:
Arrow (->) Operator The arrow (->) operator can be applied to
disembodied property lists, defstructs, association tables, and user
types (special application-supplied types) to access property values.
The property must always be a symbol and the value of the property can
be any valid CadenceŽ

SKILL language type. Squiggle Arrow (~>) Operator The squiggle arrow
(~>) operator is a generalization of the arrow operator. It works the
same way as an arrow operator when applied directly to an object, but
it can also accept a list of such objects. It walks the list applying
the arrow operator whenever it finds an atomic object.

But frankly speaking I have just known about ~> so I can't see any
difference yet. I mean difference in practical use.
I hope I've helped you a little bit.

Yes, many thanks,
You'd helped me a lot indeed.. but what about the "~>??" ..
Morover, i want to know where can i get a document, that's better
organized than the SKILL user-guide, including a reference of SKILL
functions, and be good organized as a reference non a manual.

Thanks and Regards,
Ahmad,


~? will list all the available properties. Its a list of symbols when
applied to a db object.
~?? is same as above but will return list of pairs of propName and
propValue.

When applied on list, it is applied recursively, as ~>propName would do.

-
Suresh
Some examples:
Select two or more objects in the design window and do each one and see
what is getting printed.

car(geGetSelSet())~>?

car(geGetSelSet())~>??

geGetSelSet()~>?

geGetSelSet()~>??

To see the difference between ~> and ->, do the following:

geGetSelSet()~>objType

geGetSelSet()->objType ; Must return a nil

-
Suresh
 
Hello,
What are the exact function of the -> and ~> operators?
Are they quite equivalent?
as far as I remember, they are equivalent (both evaluate to getq) except that the ~> operator, when
applied on a list, recurses over the list elements.

As an example, let's use a list of db objects :

> geGetSelSet()
(db:238579444 db:238574680 db:238575080 db:238579768 db:238585240
db:238583948 db:238589336 db:238582980 db:238589228 db:238582600
db:238583340 db:238582144 db:238583264 db:238583056
)

Let's try on a single db object :

> car(geGetSelSet())~>objType
"label"

> car(geGetSelSet())->objType
"label"

Both return the same value. Now, let's apply it to the list :

> geGetSelSet()~>objType
("label" "label" "label" "label" "inst"
"inst" "ellipse" "line" "line" "ellipse"
"line" "line" "line" "line"
)

> geGetSelSet()->objType
nil

So, ~> returns the property for each element of the list, while -> tries to get the property from
the list itself and returns nil.



Stéphane
 
On 14 Feb 2007 03:36:53 -0800, "Reotaro Hashemoto" <ahmad.abdulghany@gmail.com>
wrote:
Yes, many thanks,
You'd helped me a lot indeed.. but what about the "~>??" ..
Morover, i want to know where can i get a document, that's better
organized than the SKILL user-guide, including a reference of SKILL
functions, and be good organized as a reference non a manual.

Thanks and Regards,
Ahmad,
Well, if you want a reference guide, look in the SKILL Reference Manual,
rather than the user guide. The user guide is intended as a book about the
language, introducing concepts in a similar manner to books on programming.
Reference manuals are rather dry, and list each function by function - but are
very useful for reference.

There are also many other SKILL manuals, covering particular APIs (Application
Programming Interfaces) - you can find these by using "cdsdoc".

Also, for a quick reference, you can use the "cdsFinder" UNIX command to bring
up a simple GUI which allows you search for function names - and gives the
function template plus a short description (this is no substitute for the full
documentation, but does help as a useful reminder).

As for the original question, that's been well answered, but let me quickly add
my take on this. Essentially they are equivalent, except when it comes to lists.
If the left hand side is a list, then -> treats it as a disembodied property
list, whereas ~> does an implicit foreach mapcar on the list. So, if the left
hand side is a DPL (disembodied property list), you have to use ->, whereas if
it is a single object you can use either.

To describe the implicit foreach mapcar behaviour of ~>, here's an
example:

objList~>prop

is equivalent to:

foreach(mapcar obj objList obj~>prop)

just a little more concise.

Regards,

Andrew.
--
Andrew Beckett
Principal European Technology Leader
Cadence Design Systems, UK.
 

Welcome to EDABoard.com

Sponsor

Back
Top