help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Executing part of the code instead of another


From: Christopher Dimech
Subject: Re: Executing part of the code instead of another
Date: Wed, 7 Oct 2020 15:48:51 +0200

It would be better if you explain to me this progn stuff

Have tried an example like this

(setq na 8)
(setq nb 13)
( if (> nb na)
    progn (
      (message "nb > na condition [condition is true]")
      (message "nb > na condition [condition is true]")
    )
    progn (
      (message "condition false")
      (message "condition false")
    )
)


> Sent: Wednesday, October 07, 2020 at 11:46 AM
> From: "Emanuel Berg via Users list for the GNU Emacs text editor" 
> <help-gnu-emacs@gnu.org>
> To: help-gnu-emacs@gnu.org
> Subject: Re: Executing part of the code instead of another
>
> Gregory Heytings via Users list for the GNU Emacs text editor wrote:
>
> > In general you can do:
> >
> > (if [condition]
> >   (progn
> >     [multiple statements of the "then" part])
> >  [multiple statements of the "else" part"])
>
> And the value returned, if condition, is the one of
> the last one in the "then" or progn part - the
> nth one!
>
> There is also a `prog1'!
>
> But no prog2 :(
>
> --
> underground experts united
> http://user.it.uu.se/~embe8573
> https://dataswamp.org/~incal
>
>
>



reply via email to

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