Cleanup
[splendini.git] / ideas.txt
blob381d95eac43d2420187d9e681b25295e9cf613f9
2 Macro implementation:
3 ======================
4 (First class) macros:
5 http://people.csail.mit.edu/alan/mtt/popl00.pdf
6 http://matt.might.net/articles/metacircular-evaluation-and-first-class-run-time-macros/
7 http://www.paulgraham.com/ilc03.html
8 http://lambda-the-ultimate.org/node/2987
9 http://c2.com/cgi/wiki?DoWeWantLispMacros
10 http://norvig.com/paip/interp1.lisp
12 Macro vs. Lazy Function
13 http://stackoverflow.com/questions/7046950/lazy-evaluation-vs-macros/7047413#7047413
15 1 : and = Function({a, b}, Quote(If)(a, b, False))
16 1=> Function(List(a, b), Quote(If)(a, b, False), StaticScope)
18 2 : AttributesAdd(and, QuoteRest)
19 2=> and
21 3 : and(False,Print("no"))
22 3=> If(False, Print("no"), False)
24 4 : Evaluate(and(False,Print("no")))
25 4=> False
27 % Macros allow for a re-evaluation 
29 http://old.ycombinator.com/arc/tut.txt
30 http://www.paulgraham.com/arcll1.html
33 Documentation:
34 ===============
36 is generated for a specific target
37 file spliced together converts to target; e.g. markdown
38 documentation should contain tests
40 Data structure ReferencePage DataStructure(ReferencePage, {FunctionName..},..,
41         QuoteAll)
42 ReferencePage(FunctionName, )
44 ReferencePageToMarkDown => 
46 markdown example:
47 (https://addons.mozilla.org/en-US/firefox/addon/markdown-viewer/)
49 ----------
51 Dot
52 -----
53 dot = Function(Variadic(x), Apply(Add, Apply(Multiply,x)))
56 ----------
58 This could work
60 3 : Let({{a,b,c}={1,2,3},{d,2}},a+b+c+d)
61 3=> Let(List(Set(List(a, b, c), List(1, 2, 3)), List(d, 2)), Add(Add(Add(a, b), c), d))
63 -----
65 DefineSyntax("/", Divide, prio)
66 2/3 -> Multiply(Rational(1, 3), 2)
69 -----
71 ue_cmp_... could use memcmp
74 Tensor
75 =======
77 41 : Tensor({{1,2,3},{3,4,5},{5,6,7}})[2]
78 41=> Failed
80 42 : {{1,2,3},{3,4,5},{5,6,7}}[2]
81 42=> List(3, 4, 5)
84 List
85 ======
87 40 : Part(Tensor({1,2,3,4}), {{2},{3}})
88 40=> <Tensor(List(2, 3))>
90 41 : Part({1,2,3,4}, {{2},{3}})
91 41=> Part(List(1, 2, 3, 4), List(List(2), List(3)))
95 Call by Reference
96 ===================
98 Is there a way to emulate call-by-reference?
100 http://community.schemewiki.org/?scheme-faq-language
101 https://stackoverflow.com/questions/3262119/scheme-pass-by-reference
102 http://okmij.org/ftp/Scheme/pointer-as-closure.txt
104 -------
106 Chop(0.10000001, 10^-3)
107 0.100000000000000
109 Chop(0.00000001, 10^-3)
110 0.000000000000000
112 -------
114 use of readline like in clisp would be nice
116 ---------
118 Way to call e.g. RationalAdd from Add - overload system fuctions.