Improvements to namespaces and file inclusion
[shapes.git] / examples / features / warm.blank
blob2c61c61539579fe361cb3c7b5bfbbd7152734d5f
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, 2014, 2015 Henrik Tidefelt
17  **/
19 ##lookin ..Shapes
21 •str: newString
22 •msg: newString
23 •str << `Say´ << ` ´
24 •msg << `Say´ << ` ´
25 •str << `hello!´
26 •msg << `goodbye!´
27 str: •str;
28 msg: •msg;
29 •stdout << str << "{n} << msg << "{n}
31 •stdout << ( newString << `a ´ << `b´ << "{n} )
33 •dst1: newString
34 •dst2: newString
36 •dst1 << `1:´
37 •dst2 << `2:´
39 say_y: \ •dstStr → { •dstStr << `y´ }
41 /** Dynamic states is currently not a supported feature. **/
43 |** dynamic @dfoo I •stdout
45 |** foo: \ → { @dfoo << ` x ´   [say_y (@dfoo <<)] }
47 |** @dfoo: (dst1 <<)
48 |** | [foo]
49 |** @dfoo: (dst2 <<)
50 |** | [foo]
51 |** @dfoo: (dst1 <<)
52 |** | [foo]
54 endline: \ •os → { •os << `(endl)´ << "{n} }
56 [endline •dst1]
57 [endline •dst2]
58 dst1: •dst1;
59 dst2: •dst2;
61 •stdout << dst1 << dst2