Quantcast
Channel: Cadence Custom IC Skill Forum
Viewing all articles
Browse latest Browse all 5104

bcdp

$
0
0

bcdp is a curious function.

The documentation says it "checks if an object is a binary primitive function", without being too specific about exactly what that means.

The example given is:

bcdp(getd('plus)) => t
bcdp('plus) => nil

Which just shows that bcdp can tell the difference between a symbol and a procedure.  But what's the difference between bcdp and procedurep or isCallable?  Are they the same?

The documentation's brief description suggests bcdp is only true for "primitive" functions like primops.  My experiments in IC616-ISR8 support this interpretation: indeed, bcdp is true of every primop.  bcdp is also true of every syntax form (getFunType => syntax).  However, and rather surprisingly, bcdp is true of some other things as well:

ILS-<2> define builtins (list gets vi abs)
builtins
ILS-<2> mapcar getFunType builtins
(macro nlambda lambda)
ILS-<2> forall b builtins (bcdp b)
t

You can find other cases where bcdp is nil for macros, nlambdas, and lambdas, but I find it curious that there are "false positives".  In what sense is a macro like gets a "binary primitive function"? 


Viewing all articles
Browse latest Browse all 5104

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>