• 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. *Error* *INTERNAL*: helper function missing for - syntax...

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 142
  • Views 1320
  • 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

*Error* *INTERNAL*: helper function missing for - syntax:or

archive
archive over 17 years ago

I'm trying to work my way through this famous paper about Functional Programming. Naturally, I'm trying to use my favorite language, SKILL!

Unfortunately, I've run into something curious when I try to run this code in SKILL++ mode:

; Here's a function to sum a list. (define (sum list) (if (null list) 0 (plus (car list) (sum (cdr list))))) ; Note the "0" and "plus" are the only parts unique to (sum). ; We can modularise sum by glueing together a general recursive pattern: (define (reduce f x list) (if (null list) x (f (car list) (reduce f x (cdr list))))) ; Now we can redefine sum: (define (sum list) (reduce plus 0 list)) ; We can also reap benefits by re-using reduce to write other functions: (define (product list) (reduce times 1 list)) (define (anytrue list) (reduce or nil list))

All this code works fine, until I get to anytrue():

(anytrue '(nil nil t)) *Error* *INTERNAL*: helper function missing for - syntax:or

Yet this works if I re-write reduce() to use funcall():

(define (reduce f x list) (if (null list) x (funcall f (car list) (reduce f x (cdr list))))) (anytrue '(nil nil t)) t (anytrue '(nil nil nil)) nil

What's going on here?


Originally posted in cdnusers.org by tweeks
  • Cancel
Parents
  • archive
    archive over 17 years ago

    Looks like a fairly obscure bug in the SKILL Virtual Machine. I filed CCR 569072 to get this fixed. Whilst syntax forms (e.g. or, and) are a little different (they don't evaluate their arguments before calling - they selectively evaluate depending on the value of each argument in turn), I don't see any reason why this should fail in this case.

    I suspect it may be something to do with the fact that the compiler cannot correctly produce the VM code that it normally would for a call to "or" because it can't see that the (f) call is actually a syntax form. But I'll leave it to R&D to check that.

    Regards,

    Andrew.


    Originally posted in cdnusers.org by adbeckett
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • archive
    archive over 17 years ago

    Looks like a fairly obscure bug in the SKILL Virtual Machine. I filed CCR 569072 to get this fixed. Whilst syntax forms (e.g. or, and) are a little different (they don't evaluate their arguments before calling - they selectively evaluate depending on the value of each argument in turn), I don't see any reason why this should fail in this case.

    I suspect it may be something to do with the fact that the compiler cannot correctly produce the VM code that it normally would for a call to "or" because it can't see that the (f) call is actually a syntax form. But I'll leave it to R&D to check that.

    Regards,

    Andrew.


    Originally posted in cdnusers.org by adbeckett
    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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