Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,23 @@
|
|||
to average :l
|
||||
output quotient apply "sum :l count :l
|
||||
end
|
||||
|
||||
to make.sma :name :period
|
||||
localmake "qn word :name ".queue
|
||||
make :qn []
|
||||
define :name `[ [n] ; parameter list
|
||||
[if equal? count :,:qn ,:period [ignore dequeue ",:qn]]
|
||||
[queue ",:qn :n]
|
||||
[output average :,:qn]
|
||||
]
|
||||
end
|
||||
|
||||
make.sma "avg3 3
|
||||
|
||||
show map "avg3 [1 2 3 4 5] ; [1 1.5 2 3 4]
|
||||
|
||||
show text "avg3 ; examine what substitutions took place
|
||||
[[n] [if equal? count :avg3.queue 3 [ignore dequeue "avg3.queue]] [queue "avg3.queue :n] [output average :avg3.queue]]
|
||||
|
||||
; the internal queue is in the global namespace, easy to inspect
|
||||
show :avg3.queue ; [3 4 5]
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
...
|
||||
localmake "qn word :name gensym
|
||||
...
|
||||
|
||||
; list user-defined functions and variables
|
||||
show procedures ; [average avg3 make.sma]
|
||||
show names ; [[[] [avg3.g1]]
|
||||
Loading…
Add table
Add a link
Reference in a new issue