Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -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]

View file

@ -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]]