If I have :
run(X) :- X.
What is the difference between :
... :- ..., call(Y).
and :
... :- ..., run(Y).
A call provision is a clause in the contract for a bond (known as the “bond indenture”) that allows its issuer to pay off the bond before its maturity date. This is known as redeeming the bond. For example, say you bought a 10-year bond with a call provision.
In contrast to callable bonds (and not as common), putable bonds provide more control of the outcome for the bondholder. Owners of putable bonds have essentially purchased a put option built into the bond.
Usually, when an investor wants a bond at a higher interest rate, they must pay a bond premium, meaning that they pay more than the face value for the bond. With a callable bond, however, the investor can receive higher interest payments without a bond premium.
Make whole calls caused little investor concern until the low yield environment resulted in unexpected losses. Make whole provisions fail to protect short-term investors when bond spreads fall below make whole levels. Yield volatility in Treasury securities complicates matters and increases risk for cash investors.
If you have:
run(X) :- X.
then you can see that it is equivalent to using call/1
explicitly via
?- listing(run/1). run(A) :- call(A).
From this, it follows that call(X)
is also declaratively equivalent to run(X)
. However, unless your Prolog compiler performs some kind of inlining, usingcall/1
directly is almost certainly at least very, very slightly more efficient than calling run/1
and have that invoke call/1
.
As food for thought, think of cases like run(!)
, and how in general using !
in meta-calls could affect programs if X
were not equivalent to call(X)
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With