[REBOL] Re: Bug! in assignment to date! values with stacked set-path values
From: g:santilli:tiscalinet:it at: 20-Nov-2002 12:58
Hi Romano,
On Monday, November 18, 2002, 10:40:21 PM, you wrote:
RPT> Yes you are right and this is what i want to point. I did not want to say that
RPT> set-path does not exists in absolute, but that in some situations it is like a
RPT> path. I could make an example: a block which, if at some point contains the
RPT> word list!, start to behaviour like a list!. Only in this sense i said that it
RPT> is not a true datatype!.
One could argue that all any-block! types actually share the same
implementation internally. This doesn't make them one datatype;
parens and blocks differ only in the delimitator, and paths and
set-paths differ only in that set-path! ends with a colon. (REBOL
is so small because most datatypes share the same
implementation...)
RPT> or
RPT> open: func [file type [block!]][
RPT> if find type 'direct [ ;direct]
RPT> if find type 'no-wait [ ;no-wait]
RPT> if find type 'binary [ ;binary]
Basically, any function that requires a lot of optional arguments
would require its own dialect. To make things cleaner, Carl
thought of refinements as a common way that can be used by all the
functions.
Of course, we miss a clean way to propagate refinements, etc.
However, I don't think that your proposal of having:
f: func [] [[[1]]]
f/1 ; == [1]
f/1/1 ; == 1
makes really sense out of this simple example. I would find the
following really unintuitive:
f: func [a b c] [reduce [a b c]]
f/1 1 2 3 ; == 1
f/2 1 2 3 ; == 2
; etc.
(Imagine it when you have less trivial arguments, as in a long
expression.) I would much prefer:
(f 1 2 3)/1
(f 1 2 3)/2
etc.
Anyway, the path notation is just a shortcut notation. When you
can't use paths, you can use PICK and POKE, so there's no real
limitation.
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r