This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: or evaluates second argument if first is true?


No, or does do "short circuit" evaluation.

Khairul Azhar wrote:
I've been trying to do the following for my top-level ala Python: -

(if (or (not (environment-bound? (interaction-environment) '__main__))
	__main__)
    (display "Executing main procedure"))

Boom! I get an UnboundSymbol exception (which, incidentally, is triggered
on the (if...) line) for __main__.
That is because (environment-bound? (interaction-environment) '__main__) is returning #t even though evaluating __main__ results in Unbound Symbol.

The questions are: Should this work? Will this work? Or should I go about
this some other way e.g. using define-variable perhaps?
Don't know. There must be something special about __main__, since foo works as expected.

jim


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]