Block vs List
[1/4] from: Patrick::Philipot::laposte::net at: 19-Jun-2004 11:30
Hi List
What is the difference between a block and a list?
The only thing I've got from the Core manual is that a block is a "Blocks of values"
and a
list a "Linked lists".
Is there a command that can be used on a block and cannot be used on a
list?
>> a: [1 2 3 4]
== [1 2 3 4]
>> b: make list! [1 2 3 4]
== make list! [1 2 3 4]
>> type? a
== block!
>> type? b
== list!
--
Regards
Patrick
[2/4] from: carl:cybercraft at: 19-Jun-2004 23:42
>=== Original Message >
>Hi List
<<quoted lines omitted: 3>>
>Is there a command that can be used on a block and cannot be used on a
>list?
Not that I know of, but some give different results. The Core manual does give a good
explanation of lists in the Values section and how they differ - I suspect you just missed
it. See...
http://www.rebol.com/docs/core23/rebolcore-16.html#section-2.8
HTH.
-- Carl Read
[3/4] from: rotenca:telvia:it at: 19-Jun-2004 20:32
Hi Patrik,
> Is there a command that can be used on a block and cannot be used on a
> list?
All action! which can work with block! can work also with list! and hash!.
But there are many native! and function! which are different:
1) set
l: make list! [1 2]
b: make block! [1 2]
set [a b] b print [a b]
set [a b] l print [a b]
2) list! and hash! cannot be filled with code to execute. Every command which
requires a block to be executed does not accept a list! or an hash!.
Functions that require a block! for some parameters and do not accept a series
are many dozens.
---
Ciao
Romano
[4/4] from: atruter:labyrinth:au at: 20-Jun-2004 10:34
Hi Patrick,
> What is the difference between a block and a list?
You may be interested in some performance comparisons I did last time this
question came up:
http://www.rebol.org/cgi-bin/cgiwrap/rebol/ml-display-message.r?m=rmlQMYQ
Regards,
Ashley
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted