<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://ftm2.ircam.fr/index.php?action=history&amp;feed=atom&amp;title=If_method</id>
		<title>If method - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://ftm2.ircam.fr/index.php?action=history&amp;feed=atom&amp;title=If_method"/>
		<link rel="alternate" type="text/html" href="https://ftm2.ircam.fr/index.php?title=If_method&amp;action=history"/>
		<updated>2026-05-16T08:27:11Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.28.0</generator>

	<entry>
		<id>https://ftm2.ircam.fr/index.php?title=If_method&amp;diff=2612&amp;oldid=prev</id>
		<title>Beller at 08:45, 5 May 2009</title>
		<link rel="alternate" type="text/html" href="https://ftm2.ircam.fr/index.php?title=If_method&amp;diff=2612&amp;oldid=prev"/>
				<updated>2009-05-05T08:45:53Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;if &amp;lt;num: condition&amp;gt; &amp;lt;any: true value&amp;gt; &amp;lt;any: false value&amp;gt; &lt;br /&gt;
&lt;br /&gt;
- choose between two values (both conditional values are evaluated)&lt;br /&gt;
&lt;br /&gt;
The 'if' function (not method) should be pretty clear if you keep in mind the&lt;br /&gt;
two drawbacks:&lt;br /&gt;
&lt;br /&gt;
1. it is a function, i.e. all arguments are evaluated before the 'if' gets to&lt;br /&gt;
decide which one to output, i.e. something like&lt;br /&gt;
    &lt;br /&gt;
    (if ($1 != 1) ($myfmat mul 2) ($myfmat zero))&lt;br /&gt;
&lt;br /&gt;
always multiplies and then zeros the myfmat!&lt;br /&gt;
&lt;br /&gt;
2. The result of 'if' can only be one atom, not a list.  If you want to output&lt;br /&gt;
one list or another, use tuples, with a subsequent ftm.list, or the&lt;br /&gt;
soon-to-be-official #untup feature of ftm.mess.  This can be used with a 'route'&lt;br /&gt;
to send a list out to one or another connection.&lt;br /&gt;
&lt;br /&gt;
    (if ($mydict exists $1) {1 $mydict[$1]} {2 $1 42})&lt;br /&gt;
    |&lt;br /&gt;
    ftm.list&lt;br /&gt;
    |&lt;br /&gt;
    route 1 2&lt;/div&gt;</summary>
		<author><name>Beller</name></author>	</entry>

	</feed>