Merge branch 'ht/newline-before-EOF' into maint
[shapes.git] / examples / features / warm.shape
blob89570a0de198c635b9705dd83f24efed2719a600
1 /** This file is part of Shapes.
2  **
3  ** Shapes is free software: you can redistribute it and/or modify
4  ** it under the terms of the GNU General Public License as published by
5  ** the Free Software Foundation, either version 3 of the License, or
6  ** any later version.
7  **
8  ** Shapes is distributed in the hope that it will be useful,
9  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
10  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11  ** GNU General Public License for more details.
12  **
13  ** You should have received a copy of the GNU General Public License
14  ** along with Shapes.  If not, see <http://www.gnu.org/licenses/>.
15  **
16  ** Copyright 2008 Henrik Tidefelt
17  **/
19 •str: newString
20 •msg: newString
21 •str << `Say´ << ` ´
22 •msg << `Say´ << ` ´
23 •str << `hello!´
24 •msg << `goodbye!´
25 str: •str;
26 msg: •msg;
27 •stderr << str << "{n} << msg << "{n}
29 •stderr << ( newString << `a ´ << `b´ << "{n} )
31 •dst1: newString
32 •dst2: newString
34 •dst1 << `1:´
35 •dst2 << `2:´
37 say_y: \ •dstStr → { •dstStr << `y´ }
39 /** Dynamic states is currently not a supported feature. **/
41 |** dynamic @dfoo I stderr
43 |** foo: \ → { @dfoo << ` x ´   [say_y (@dfoo <<)] }
45 |** @dfoo: (dst1 <<)
46 |** | [foo]
47 |** @dfoo: (dst2 <<)
48 |** | [foo]
49 |** @dfoo: (dst1 <<)
50 |** | [foo]
52 endline: \ •os → { •os << `(endl)´ << "{n} }
54 [endline •dst1]
55 [endline •dst2]
56 dst1: •dst1;
57 dst2: •dst2;
59 •stderr << dst1 << dst2
61 /** Prevent empty output error. **/
62 [stroke (0cm,0cm)--(1cm,1cm)]