<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="https://peda.net/:static/532/atom.xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>1.1 Peruslaskut ja laskujärjestys</title>
<id>https://peda.net/id/c0624a208</id>
<updated>2015-11-06T09:26:52+02:00</updated>
<link href="https://peda.net/id/c0624a208:atom" rel="self" />
<link href="https://peda.net/p/jamspe/omat-atk-t/ohjelmointi/racket/1-racket-alkeet/1pjl#top" rel="alternate" />
<logo>https://peda.net/:static/532/peda.net.logo.bg.svg</logo>
<rights type="html">&lt;div class=&quot;license&quot;&gt;Tämän sivun lisenssi &lt;a rel=&quot;license&quot; href=&quot;https://peda.net/info&quot;&gt;Peda.net-yleislisenssi&lt;/a&gt;&lt;/div&gt;&#10;</rights>

<entry>
<title>1.1 Peruslaskut ja laskujärjestys</title>
<id>https://peda.net/id/f9973bf28</id>
<updated>2015-11-06T09:28:28+02:00</updated>
<link href="https://peda.net/p/jamspe/omat-atk-t/ohjelmointi/racket/1-racket-alkeet/1pjl/1pjl#top" />
<content type="html">&lt;p&gt;Harjoitellaan kirjoittamaan Racket-kielen lausekkeita. Racket kielessä lähes kaikki operaatiot, joita suoritetaan ovat &lt;span&gt;funktioita&lt;/span&gt;. Yhteenlasku on funktio, jonka nimi on &lt;span class=&quot;RktSym&quot;&gt;&lt;a class=&quot;RktValLink&quot; href=&quot;http://racket.koodiaapinen.fi/manuaali/peruslaskutoimitukset.html#%28def._%28%28lib._fin-doc%2Ffi-beginner..rkt%29._%2B%29%29&quot; rel=&quot;nofollow ugc noopener&quot;&gt;&lt;!--filtered attribute: data-pltdoc=&quot;x&quot;--&gt;+&lt;/a&gt;&lt;/span&gt;, ympyrä piirretään funktiolla, jonka nimi on &lt;span class=&quot;RktSym&quot;&gt;&lt;a class=&quot;RktValLink&quot; href=&quot;http://racket.koodiaapinen.fi/manuaali/ympyrat_ja_ellipsit.html#%28def._%28%28lib._fin-doc%2Ffi-image..rkt%29._circle%29%29&quot; rel=&quot;nofollow ugc noopener&quot;&gt;&lt;!--filtered attribute: data-pltdoc=&quot;x&quot;--&gt;circle&lt;/a&gt;&lt;/span&gt; jne. Racket-kielessä jokainen&lt;span&gt;funktiokutsu&lt;/span&gt; alkaa &lt;span class=&quot;RktInBG&quot;&gt;&lt;span class=&quot;RktIn&quot;&gt;(&lt;/span&gt;&lt;/span&gt;-merkillä, sitten tulee funktion nimi esim. &lt;span class=&quot;RktSym&quot;&gt;&lt;a class=&quot;RktValLink&quot; href=&quot;http://racket.koodiaapinen.fi/manuaali/peruslaskutoimitukset.html#%28def._%28%28lib._fin-doc%2Ffi-beginner..rkt%29._%2B%29%29&quot; rel=&quot;nofollow ugc noopener&quot;&gt;&lt;!--filtered attribute: data-pltdoc=&quot;x&quot;--&gt;+&lt;/a&gt;&lt;/span&gt; ja sen jälkeen&lt;span&gt;argumentteja&lt;/span&gt; esim. &lt;span class=&quot;RktInBG&quot;&gt;&lt;span class=&quot;RktIn&quot;&gt;2&lt;/span&gt;&lt;/span&gt; ja &lt;span class=&quot;RktInBG&quot;&gt;&lt;span class=&quot;RktIn&quot;&gt;3&lt;/span&gt;&lt;/span&gt; ja sitten &lt;span class=&quot;RktInBG&quot;&gt;&lt;span class=&quot;RktIn&quot;&gt;)&lt;/span&gt;&lt;/span&gt;-merkki.&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;&lt;span class=&quot;RktPn&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;RktSym&quot;&gt;&lt;a class=&quot;RktValLink&quot; href=&quot;http://racket.koodiaapinen.fi/manuaali/peruslaskutoimitukset.html#%28def._%28%28lib._fin-doc%2Ffi-beginner..rkt%29._%2B%29%29&quot; rel=&quot;nofollow ugc noopener&quot;&gt;&lt;!--filtered attribute: data-pltdoc=&quot;x&quot;--&gt;+&lt;/a&gt;&lt;/span&gt;&lt;span class=&quot;hspace&quot;&gt; &lt;/span&gt;&lt;span class=&quot;RktVal&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;hspace&quot;&gt; &lt;/span&gt;&lt;span class=&quot;RktVal&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;RktPn&quot;&gt;)&lt;/span&gt;&lt;/p&gt;&#10;&lt;/blockquote&gt;&#10;&lt;p&gt;Kirjoita ylläoleva lauseke &lt;span&gt;&lt;a href=&quot;http://racket.koodiaapinen.fi/manuaali/sanasto.html#%28part._interaktioikkuna%29&quot; rel=&quot;nofollow ugc noopener&quot;&gt;interaktioikkunaan&lt;/a&gt;&lt;/span&gt; ja paina &lt;span&gt;&amp;lt;enter&amp;gt;&lt;/span&gt;. Kirjoita se sitten&lt;span&gt;&lt;a href=&quot;http://racket.koodiaapinen.fi/manuaali/sanasto.html#%28part._m__rittelyikkuna%29&quot; rel=&quot;nofollow ugc noopener&quot;&gt;määrittelyikkunaan&lt;/a&gt;&lt;/span&gt; ja paina &lt;span&gt;run&lt;/span&gt;.&lt;/p&gt;&#10;&lt;p&gt;Tutustu käsikirjan avulla muihin peruslaskutoimituksiin ja kokeile niitä interaktioikkunassa:&lt;/p&gt;&#10;&lt;p&gt; &lt;/p&gt;&#10;&lt;table class=&quot;boxed&quot;&gt;&lt;!--filtered attribute: cellspacing=&quot;0&quot;--&gt;&lt;!--filtered attribute: cellpadding=&quot;0&quot;--&gt;&#10;&lt;tbody&gt;&#10;&lt;tr&gt;&#10;&lt;td&gt;&#10;&lt;p&gt;&lt;span class=&quot;RktSym&quot;&gt;&lt;a class=&quot;RktValLink&quot; href=&quot;http://racket.koodiaapinen.fi/manuaali/peruslaskutoimitukset.html#%28def._%28%28lib._fin-doc%2Ffi-beginner..rkt%29._%2B%29%29&quot; rel=&quot;nofollow ugc noopener&quot;&gt;&lt;!--filtered attribute: data-pltdoc=&quot;x&quot;--&gt;+&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&#10;&lt;/td&gt;&#10;&lt;td&gt;&#10;&lt;p&gt;&lt;span class=&quot;hspace&quot;&gt;   &lt;/span&gt;&lt;/p&gt;&#10;&lt;/td&gt;&#10;&lt;td&gt;&#10;&lt;p&gt;&lt;span class=&quot;RktSym&quot;&gt;&lt;a class=&quot;RktValLink&quot; href=&quot;http://racket.koodiaapinen.fi/manuaali/peruslaskutoimitukset.html#%28def._%28%28lib._fin-doc%2Ffi-beginner..rkt%29._-%29%29&quot; rel=&quot;nofollow ugc noopener&quot;&gt;&lt;!--filtered attribute: data-pltdoc=&quot;x&quot;--&gt;&lt;span class=&quot;nobreak&quot;&gt;-&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&#10;&lt;/td&gt;&#10;&lt;td&gt;&#10;&lt;p&gt;&lt;span class=&quot;hspace&quot;&gt;   &lt;/span&gt;&lt;/p&gt;&#10;&lt;/td&gt;&#10;&lt;td&gt;&#10;&lt;p&gt;&lt;span class=&quot;RktSym&quot;&gt;&lt;a class=&quot;RktValLink&quot; href=&quot;http://racket.koodiaapinen.fi/manuaali/peruslaskutoimitukset.html#%28def._%28%28lib._fin-doc%2Ffi-beginner..rkt%29._%2A%29%29&quot; rel=&quot;nofollow ugc noopener&quot;&gt;&lt;!--filtered attribute: data-pltdoc=&quot;x&quot;--&gt;*&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&#10;&lt;/td&gt;&#10;&lt;td&gt;&#10;&lt;p&gt;&lt;span class=&quot;hspace&quot;&gt;   &lt;/span&gt;&lt;/p&gt;&#10;&lt;/td&gt;&#10;&lt;td&gt;&#10;&lt;p&gt;&lt;span class=&quot;RktSym&quot;&gt;&lt;a class=&quot;RktValLink&quot; href=&quot;http://racket.koodiaapinen.fi/manuaali/peruslaskutoimitukset.html#%28def._%28%28lib._fin-doc%2Ffi-beginner..rkt%29._%2F%29%29&quot; rel=&quot;nofollow ugc noopener&quot;&gt;&lt;!--filtered attribute: data-pltdoc=&quot;x&quot;--&gt;/&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&#10;&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;p&gt; &lt;/p&gt;&#10;&lt;p&gt;Jos haluaa yhdistää useamman funktion ne pitää kirjoittaa sisäkkäin. Kirjoita seuraava lause määrittelyikkunaan ja aja se &lt;a href=&quot;http://racket.koodiaapinen.fi/manuaali/sanasto.html#%28part._askeltaja___stepperi%29&quot; rel=&quot;nofollow ugc noopener&quot;&gt;stepperin kautta:&lt;/a&gt;&lt;/p&gt;&#10;&lt;blockquote&gt;&#10;&lt;p&gt;&lt;span class=&quot;RktPn&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;RktSym&quot;&gt;&lt;a class=&quot;RktValLink&quot; href=&quot;http://racket.koodiaapinen.fi/manuaali/peruslaskutoimitukset.html#%28def._%28%28lib._fin-doc%2Ffi-beginner..rkt%29._%2F%29%29&quot; rel=&quot;nofollow ugc noopener&quot;&gt;&lt;!--filtered attribute: data-pltdoc=&quot;x&quot;--&gt;/&lt;/a&gt;&lt;/span&gt;&lt;span class=&quot;hspace&quot;&gt; &lt;/span&gt;&lt;span class=&quot;RktPn&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;RktSym&quot;&gt;&lt;a class=&quot;RktValLink&quot; href=&quot;http://racket.koodiaapinen.fi/manuaali/peruslaskutoimitukset.html#%28def._%28%28lib._fin-doc%2Ffi-beginner..rkt%29._%2B%29%29&quot; rel=&quot;nofollow ugc noopener&quot;&gt;&lt;!--filtered attribute: data-pltdoc=&quot;x&quot;--&gt;+&lt;/a&gt;&lt;/span&gt;&lt;span class=&quot;hspace&quot;&gt; &lt;/span&gt;&lt;span class=&quot;RktVal&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;hspace&quot;&gt; &lt;/span&gt;&lt;span class=&quot;RktVal&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;RktPn&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hspace&quot;&gt; &lt;/span&gt;&lt;span class=&quot;RktPn&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;RktSym&quot;&gt;&lt;a class=&quot;RktValLink&quot; href=&quot;http://racket.koodiaapinen.fi/manuaali/peruslaskutoimitukset.html#%28def._%28%28lib._fin-doc%2Ffi-beginner..rkt%29._-%29%29&quot; rel=&quot;nofollow ugc noopener&quot;&gt;&lt;!--filtered attribute: data-pltdoc=&quot;x&quot;--&gt;&lt;span class=&quot;nobreak&quot;&gt;-&lt;/span&gt;&lt;/a&gt;&lt;/span&gt;&lt;span class=&quot;hspace&quot;&gt; &lt;/span&gt;&lt;span class=&quot;RktVal&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;hspace&quot;&gt; &lt;/span&gt;&lt;span class=&quot;RktVal&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;RktPn&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;RktPn&quot;&gt;)&lt;/span&gt;&lt;/p&gt;&#10;&lt;/blockquote&gt;</content>
<published>2015-11-06T09:28:28+02:00</published>
</entry>


</feed>