• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Allegro X PCB Editor
  3. ASK for LET Syntax(in Skill)

Stats

  • Replies 3
  • Subscribers 160
  • Views 4630
  • Members are here 0
More Content

ASK for LET Syntax(in Skill)

luanvn81
luanvn81 over 15 years ago
Hi everyone !

I’m trying to find out about commands that’s used for skillcode  writing. And I don’t understand “LET“command , who can explain this command for me ?

 

This is the Example( But I don’t understand anything)

*************************************************************************************

Ex1:

x = 5

let( ((x '(a b c)) y)

println( y ) ; Prints nil.

x)

=> (a b c) ; Returns the value of x.

 

Ex2:

procedure( test( x y )

let( ((x 6) (z "return string"))

if( (equal x y)

then z

else nil)))

test( 8 6 ) ; Call function test.

ð      "return string" ; z is returned because 6 == 6.

********************************************************************

(And this is about LET command)

let - SKILL mode

let(

l_bindings

g_expr1 ...

)

=> g_result

Description

Provides a faster alternative to prog for binding local variables only. This is a syntax form.

l_bindings is either a list of variables or a list of the form(s_variable g_value). The

bindings list is followed by one or more forms to be evaluated. The result of the let form is

the value of the last g_expr.

let is preferable to prog in all circumstances where a single exit point is acceptable, and

where the go and label constructs are not required.

Arguments

l_bindings Local variable bindings, can either be bound to a value or nil

(the default).

g_expr1 Any number of expressions.

Value Returned

ð     g_result The result of the last expression evaluated
  • Sign in to reply
  • Cancel
Parents
  • eDave
    eDave over 15 years ago

    Hi,

    Let delcares local variables within the scope included within its brackets. By default they are set to nil but you can assign a value as you have shown in your examples.

    While learning Skill I suggest that you do not assign values within the let statement.

    Your example 2 is, therefore, better written:

    procedure( test( x y )
     let( (z)
      z = "return string"
      if( (equal x y)
       then z
       else nil
      )
     )
    )

    Note that x is not included in the let statement variables because it has already been declared in the procedure variables.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • eDave
    eDave over 15 years ago

    Hi,

    Let delcares local variables within the scope included within its brackets. By default they are set to nil but you can assign a value as you have shown in your examples.

    While learning Skill I suggest that you do not assign values within the let statement.

    Your example 2 is, therefore, better written:

    procedure( test( x y )
     let( (z)
      z = "return string"
      if( (equal x y)
       then z
       else nil
      )
     )
    )

    Note that x is not included in the let statement variables because it has already been declared in the procedure variables.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Children
No Data
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information