From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Re: Executing part of the code instead of another Date: Wed, 7 Oct 2020 16:01:50 +0200 Message-ID: <20201007140150.GA2289@tuxteam.de> References: <87imbm3llg.fsf@ebih.ebihd> <87blhe3kxg.fsf@ebih.ebihd> <875z7m4bdx.fsf@ebih.ebihd> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="qMm9M+Fa2AknHoGS" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28780"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/1.5.21 (2010-09-15) Cc: help-gnu-emacs@gnu.org, moasenwood@zoho.eu To: Christopher Dimech Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 07 16:03:49 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kQA2n-0007Q3-IX for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 07 Oct 2020 16:03:49 +0200 Original-Received: from localhost ([::1]:34638 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kQA2m-0008TG-Js for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 07 Oct 2020 10:03:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36118) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kQA1s-0008Rg-72 for help-gnu-emacs@gnu.org; Wed, 07 Oct 2020 10:02:54 -0400 Original-Received: from mail.tuxteam.de ([5.199.139.25]:53067) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.90_1) (envelope-from ) id 1kQA1p-0000f4-Qv for help-gnu-emacs@gnu.org; Wed, 07 Oct 2020 10:02:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=mail; h=From:In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:Date; bh=dnyg/xO19DHn7gQOB7kjoWOSiXdmeUFj3ujjzEaeSY8=; b=BWZ8pNaA6LH2oxl8j0mvZ21OikrCzgEQgpYfHNkLEfHu+kZimddNQDWM5XiPNzuODpsl22YfOPi3i+Su36q6c0DUqlS6aQRBntH68NuHcPLezKODsvJ49Tfkz9XnjhLJdBn9is4Lyshu28w9HcmeD9JankOxTu0AiyUKPxLxIRSohbhcs6C1YG54G3338cE/2DgfvChX962xMTJOkzuhvO31kSxZ6B97wWQw3aW/txf0HqnRWCWofB2GR289TEDIL7SjrkFAIPZ1FJuo+DA1f/8rrJIXFnTLmXX86AwMHXO3Gwox8EXr3FqIOCqkUSKRjIaCBzDVn3XrOKVKATc1Bw==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1kQA12-0001ON-CG; Wed, 07 Oct 2020 16:02:00 +0200 Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=5.199.139.25; envelope-from=tomas@tuxteam.de; helo=mail.tuxteam.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/07 10:02:31 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:124361 Archived-At: --qMm9M+Fa2AknHoGS Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 07, 2020 at 03:48:51PM +0200, Christopher Dimech wrote: > It would be better if you explain to me this progn stuff >=20 > Have tried an example like this >=20 > (setq na 8) > (setq nb 13) > ( if (> nb na) > progn ( > (message "nb > na condition [condition is true]") > (message "nb > na condition [condition is true]") > ) No. Written in Lisp, it's (progn (thing 1) (thing 2) ...) In C (and in conventional maths, you'd write it as you did above). Note that it's the same way as you write (message "foo") [you don't write message("foo"), as you'd do in C or Python or what not). Progn is a form to bundle a sequence of forms, which are evaluated one after the other. The value of progn is that of the last form evaluated (that's the -n), as opposed to prog1, which would do the same as progn, but return the value of its first form. Cheers - t --qMm9M+Fa2AknHoGS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAl99yk4ACgkQBcgs9XrR2kavlgCfdsFZPLIRhjFelyIqvqZqlD/z ikwAn3YDKIlN23CEVdDXZeHDgkCPJQL6 =uymc -----END PGP SIGNATURE----- --qMm9M+Fa2AknHoGS--