• 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. Custom IC SKILL
  3. sklint function

Stats

  • Locked Locked
  • Replies 5
  • Subscribers 143
  • Views 5246
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

sklint function

Curtisma
Curtisma over 1 year ago

Hello:

I'm trying to write a SKILL++ wrapper function to lint multiple SKILL++ files with the same settings. 

However I can't get it to work.  The sklint() function appears to contain nlambda functions or some other feature that is not compatible with SKILL++.

Can someone confirm that sklint is just not compatible with SKILL++?

At some point I received the following warning:
*WARNING* (sklint): calling NLambda from Scheme code - sklint(?file funcall((Path->Cat) (lint_settings->testsDir) "data_types/Path.ils") ?outputFile funcall((Path->Cat) (lint_settings->outputDir) "lint_report_Path.txt") ?prefixes (lint_settings->prefixes))
*WARNING* (sklint): calling NLambda from Scheme code - sklint(?file funcall((Path->Cat) (lint_settings->testsDir) "data_types/test_Path.ils") ?outputFile funcall((Path->Cat) (lint_settings->outputDir) "lint_report_test_Path.txt") ?prefixes (lint_settings->prefixes))

Here's my latest try to create a SKILL++ wrapper around sklint.  I am trying to return a Dpl that I can use to call the RunLint() function.  However, I receive the following error.

Error:

lint_settings=VrtImport->Test->Fixtures->lint_settings()
(nil RunLint funobj@0x27d8a070 outputDir "/prj/ids_dev/work_libs/mayberc/skill/virtue/test"
prefixes (Vrt VrtImport) testsDir "/prj/ids_dev/work_libs/mayberc/skill/virtue/tests"
)
lint_settings->RunLint("../virtue/Str.ils")
*** Error in routine eval:
Message: *Error* eval: unbound variable - file
Entering new debug toplevel due to error:

Code:

procedure(lint_settings()
"Test"
let(((outputDir simplifyFilename(Path->Cat(dir_path "../test")))
(prefixes '(Vrt VrtImport))
)


createDirHier(Path->Cat(outputDir "data_types"))

procedure(RunLint(relativeFilePath)
"Run lint on a file relative to the tests directory"
let(((file Path->Cat(dir_path relativeFilePath))
(outputFile
Path->Cat(outputDir strcat(
"lint_report_"
Path->RemoveExtension(Path->FileName(relativeFilePath))
".txt"))
)
)
sklint(
?file file
?outputFile outputFile
?prefixes prefixes
)
))

list(nil
'RunLint RunLint
'outputDir outputDir
'prefixes prefixes
'testsDir dir_path
)
))

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 1 year ago

    Unfortunately sklint() is one of the relatively small number of nlambda functions (usually defined with nprocedure) left. These don't evaluate their arguments up-front and instead selectively evaluate the arguments within the function (I'm not sure there's a terribly good reason for sklint to be implemented this way, and even if there was there is a better way of doing this nowadays). Because of the evaluation within the function, these don't understand SKILL++ lexical environments.

    The good news is that you can workaround this by changing your sklint() call to:

    funcall(sklint
      ?file file
      ?outputFile outputFile
      ?prefixes prefixes
    )

    The funcall will evaluate all the arguments up front lexically, and then call the actual function.This shouldn't then give the warning and I think should work as you wish (I didn't try it with your code but with something simpler in the interests of time).

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Curtisma
    Curtisma over 1 year ago in reply to Andrew Beckett

    Ok, I'll try that.  Thanks Andrew!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Curtisma
    Curtisma over 1 year ago in reply to Andrew Beckett

    Ok, I'll try that.  Thanks Andrew!

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • Curtisma
    Curtisma over 1 year ago in reply to Curtisma

    I'll submit a ticket to fix the sklint to make it compatible directly with SKILL++ by removing the nlambda functions.  This wasted too much debug time.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • AurelBuche
    AurelBuche over 1 year ago in reply to Curtisma

    Hi,

    Also do not expect wonderful results while using the Linter on SKILL++

    It was meant to be used on SKILL and struggles with many SKILL++ behaviors such as local functions.

    Also a little tip about unused function arguments :

    I don't believe this is documented but if you prefix functions arguments that you are not using with  underscores "_".

    You get an info instead of a warning message

    This can be useful for instance with callbacks

    (hiCreateButton ?name 'close_button ?buttonText "Close" ?callback (lambda (_button form) (hiFormCancel form)))

    Cheers,
    Aurélien

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 1 year ago in reply to AurelBuche

    Hi Aurélien,

    It's actually much better than it used to be, which is quite remarkable given that it was designed a very long time ago before SKILL++ was even considered.

    BTW, the use of the underscore to prefix an unused argument is now documented in the SKILL IDE documentation; I asked for this to be done relatively recently when I discovered that it wasn't documented (I think it was implemented in IC6.1.8/ICADVM20.1 ISR29). I also filed CCR 2756155 to request that SKILL Lint flags any used arguments that begin with underscore (that hasn't been implemented).

    Curtis - I found the reason why sklint is a nprocedure. It's related to an incompatible change made over 25 years ago, so I don't think there's a particularly good reason for this to remain! There are still a reasonable number of nlambda functions that exist, but luckily most of them are not typically those that you want to call from code (I rarely hit the problem and write a lot of SKILL++ code).

    Andrew

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel

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