First thing to say is that the layout function takes the VID dialect as
input.
A dialect follows a syntax that may be different from "normal" rebol code.
The short answer is VID doesn't handle the print function because print does
not return a value that VID expects.
Going back to why the first example works. Well, read %file.txt returns a
string and VID can use strings.
Probe returns a value - the value that it was given so this works:
view layout [
text "hello"
probe "how do you do"
]
and so does this
view layout [
text probe "how do you do"
]
and so does this
bizarre-function: does [ for i 1 5 1 [print i] "bizarre function
result"]
view layout [
text bizarre-function
]
Also note that VID allows a single (once only) evaluation of an arbtrary
expression using the word do
Like this:
view layout [
text "hello"
do [print "how do you do"]
]
I hope that helps. Maybe someone else can put it more succinctly.
Regards,
Brett.
----- Original Message -----
From: "Rishi Oswal" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, April 10, 2001 4:42 PM
Subject: [REBOL] simple view question
> why is it that code in layout can use some rebol code
> without parenthesis. For example, you can use the
> function 'read in a layout block as shown below. In
> addition, why can some functions be used and others
> cannot...ei. you can't use the function 'print
> directly in layout.
>
> why this:
> view layout [text read %file.txt]
>
> and not this:
> view layout [
> text "hello"
> print "how do you do"
> ]
>
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail.
> http://personal.mail.yahoo.com/
> --
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the
> subject, without the quotes.
>
--
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the
subject, without the quotes.