[REBOL] Re: On mutability and sameness
From: agem:crosswinds at: 8-Jun-2001 11:53
Hi Joel and all
>Next step -- place all REBOL data types at the correct spot in
>the above table.tryied to sort
tried that a bit. with some /view around it ;-)
Comments & Corrections welcome :)
-Volker
the code:
[REBOL [title: {describe behavior of types as arguments}]
;protect-system
;???: func ['word value] [ print [mold :word " : " mold :value]
word :value]
/do [
echo %echo.txt
help datatype!
echo none
]
colors1: reduce [beige orange gold cyan]
special-color: red
legend: [origin 0x0 size 500x480 backdrop white
style tta tt as-is 500
tta {
=============================================================
Class of data SAME?-ness EQUAL?-ity Values
Sample types in class based on based on mutable?
======================== ========== ========== ========
}
tta black (colors1/1) {1 Atomic scalar data value
data value no
CHAR!, INTEGER!
}
tta black (colors1/2) {2 Composite scalar data value
data value yes, via
DATE!, TIME! refinemts
}
tta black (colors1/3) {3 Built-in reference reference
content yes
STRING!, BLOCK! comparison comparison
}
tta black (colors1/4) {4 User-defined reference reference
unsupported yes
OBJECT! comparison (always false)
}
tta black red
{>= 5 special effects like getting executed without [:word].
not well sorted yet.
5 like 3, references, but gets executed
6 even more special, error! pseudo like any-word!, ..
7 don't know behavior yet
8 special, don't know behavior yet
9 words are like atoms, but
there is an assosiated value accessible
which makes words a special kind of reference
pathes are a mystrious thing, mix of series, words and functions.
}
tta black {
=============================================================
}
]
types: [
action! 5 {}
any-block! 3 {any-}
any-function! 5 {any-}
any-string! 3 {any-}
any-type! 6 {any-}
any-word! 6 {any-, can be execute (set-word!)}
binary! 3 {}
bitset! 7 {have to check ops}
block! 3 {}
char! 1 {}
datatype! 1 {base for to}
date! 2 {}
decimal! 1 {}
email! 3 {}
error! 8 {throws itself, needs tests}
event! 8 {needs tests}
file! 3 {}
function! 5 {}
get-word! 9 {}
hash! 3 {}
image! 3 {}
integer! 1 {}
issue! 3 {}
library! 6 {/pro special}
list! 3 {}
lit-path! 6 {transforms to path after assignment. always?}
lit-word! 6 {transforms to word after assignment. always?}
logic! 1 {}
money! 1 {a/2: 3 sets full value!}
native! 5 {but no parts-access}
none! 1 {well, type too..}
number! 1 {any-}
object! 4 {}
op! 5 {exceptional argument-access}
pair! 2 {}
paren! 5 {a execute-block}
path! 5 {}
port! 3 {95% sure}
refinement! 9 {}
routine! 5 {/pro special}
series! 3 {any-, can be execute with paren!}
set-path! 6 {}
set-word! 6 {}
string! 3 {}
struct! 7 {/pro}
symbol! 7 {whats that?}
tag! 3 {}
time! 2 {}
tuple! 2 {}
unset! 6 {}
url! 3 {}
word! 9 {}
]
cnt: 0
view center-face layout [
across
panel legend
cl: list 400x480 [
style tx text
across tx 120x18 tx 12 tx 240
] supply [
count: count + cnt
face/text: face/color: none
offset: count - 1 * 3
if none? pick types offset + 3 [return]
face/color: any [pick colors1 pick types offset + 2
special-color]
face/text: mold pick types offset + index
]
sl: slider cl/size * 0x1 + 16x0 [
c: to-integer ((1 / 3 * length? types) - (480 / 19) *
value)
if cnt <> c [cnt: c show cl]
]
return
]
]