git @ Cat's Eye Technologies Exanoke / b7d6bec
Add BSD license, not really WIP anymore, add shadowing-ok test. catseye 12 years ago
2 changed file(s) with 67 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
0 Exanoke is distributed under the following BSD-compatible licenses.
1
2 All documentation and tests are covered by this license, modelled
3 after the "Report on the Programming Language Haskell 98" license:
4
5 -----------------------------------------------------------------------------
6
7 Copyright (c)2012 Chris Pressey, Cat's Eye Technologies.
8
9 The authors intend this Report to belong to the entire Exanoke
10 community, and so we grant permission to copy and distribute it for
11 any purpose, provided that it is reproduced in its entirety,
12 including this Notice. Modified versions of this Report may also be
13 copied and distributed for any purpose, provided that the modified
14 version is clearly presented as such, and that it does not claim to
15 be a definition of the Exanoke Programming Language.
16
17 -----------------------------------------------------------------------------
18
19 All source code for the reference interpreter is covered by this license:
20
21 -----------------------------------------------------------------------------
22
23 Copyright (c)2012 Chris Pressey, Cat's Eye Technologies.
24 All rights reserved.
25
26 Redistribution and use in source and binary forms, with or without
27 modification, are permitted provided that the following conditions
28 are met:
29
30 1. Redistributions of source code must retain the above copyright
31 notices, this list of conditions and the following disclaimer.
32 2. Redistributions in binary form must reproduce the above copyright
33 notices, this list of conditions, and the following disclaimer in
34 the documentation and/or other materials provided with the
35 distribution.
36 3. Neither the names of the copyright holders nor the names of their
37 contributors may be used to endorse or promote products derived
38 from this software without specific prior written permission.
39
40 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
41 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
42 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
43 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
44 COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
45 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
46 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
47 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
48 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
50 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
51 POSSIBILITY OF SUCH DAMAGE.
00 Exanoke
11 =======
2
3 *This language is a work very much in progress.*
42
53 _Exanoke_ is a pure functional language which is syntactically restricted to
64 expressing the primitive recursive functions.
133131 The first argument to a function does not have a user-defined name; it is
134132 simply referred to as `#`.
135133
136 The names of arguments defined in a function shall not shadow the names of
137 any previously-defined functions.
138
139134 Note that `<if` does not seem to be truly necessary. Its only use is to embed
140135 a conditional into the first argument being passed to a recursive call. You
141136 could also use a regular `if` and make the recursive call in both branches,
142 one with `TRUE` as the first argument and the other with `FALSE`. I think.
137 one with `TRUE` as the first argument and the other with `FALSE`.
143138
144139 Examples
145140 --------
297292 | MEOW
298293 ? Undefined function "double"
299294
295 Argument names may shadow previously-defined functions, because we
296 can syntactically tell them apart.
297
298 | def snoc(#, other)
299 | cons(other, #)
300 | def snocsnoc(#, snoc)
301 | snoc(snoc(snoc, #), #)
302 | snocsnoc(BLARCH, GLAMCH)
303 = (BLARCH (BLARCH GLAMCH))
304
300305 | def urff(#)
301306 | self(<tail #, <head #)
302307 | urff(WOOF)
352357 | urff(cons(GRAAAAP, FARRRRP))
353358 ? tail: Not a cons cell
354359
355 TODO more examples here...
360 TODO
361 ----
362
363 Give a practical example computing, say, factorial.
356364
357365 Discussion
358366 ----------
359367
360 I'm pretty sure this holds water, at this point.
361
362368 The name "Exanoke" started life as a typo for the word "example".