gnu-arch-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] Round IV: xl and all that (looking ahead, mostly)


From: Matthieu MOY
Subject: Re: [Gnu-arch-users] Round IV: xl and all that (looking ahead, mostly)
Date: Mon, 26 Jul 2004 18:02:52 +0200
User-agent: Internet Messaging Program (IMP) 3.1

Quoting Peter Conrad <address@hidden>:

> On Fri, Jul 23, 2004 at 06:55:59PM -0700, Tom Lord wrote:
> > 
> >     (define main 
> >           (exit (and (print "hello")
> >                      (print " ")
> >                      (print "world\(nl)"))))
> 

[...]

> So my question is: since there are no syntactic hints on the order of
> evaluation, is there some general rule that I have missed, or does the
> programmer have to "just know" how different expressions are evaluated?
> 
> Bye,
>       Peter

In LISP (not yet an expert in xl1 ;-), the order of evaluation is: argument,
from left to right first, then, call the function. In some particular cases like
(and ) and (or ), not all arguments are evaluated ("and" stops on the first
false argument, "or" stops on the first true argument). In this case, the
program would print "hello", " ", "world\(nl\)", and then, the function exit
would be called and the program would exit.

-- 
Matthieu

-------------------------------------------------
envoyé via Webmail/IMAG !





reply via email to

[Prev in Thread] Current Thread [Next in Thread]