2009-12-28

unifying pointers and functions

9.6: adda/unifying pointers and functions:
. ptr is a sort of array often,
it should have the same hint-syntax as array: a/.target .
a ptr is a function that remembers its arg:
instead of f(x), the ptr says same thing as:
(f`= x; f/) .

9.12: adda/syntax/unifying functions and pointers:
. how can syntax indicate ptr and fun are similar?
.(x).y -- function type
.#(x).y -- array type
./.y -- pointer to type
./(dom).y -- pointer to certain addresses (locals, externals, protected, ...)
of type"y .
f= {.(x).y function point generator}
A = (.(x).y array point generator)
-- arrays can define their list of items
the same way functions generate their set of points .

! means unique so it can also mean constant (unique value over time)
x!t -- constant type"t .
x!/!t -- constant pointer to constant type"t .

9.27: adda/syntax/ptr's like functions:
. review how ptr's syntax is like function's:
x/.type,
how to get addr? x`to, x`:, x`@ ?
[9.29: if the assignment is to a pointer, then take it's address?
what if the source is the destination?
then I should be able choose:
get the pointers value or its address:
in the lisp they use quoted symbols: ptr`= "(symbol)
]
. how to assign a ptr?
like function gets assigned code,
like it's done in c:
(x) = ptr
(x/) = ptr`target`value .