I'm not sure what you're trying to do;  see comments interleaved below.

Russell, [EMAIL PROTECTED]
----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, October 09, 1999 7:30 PM
Subject: [REBOL] why cant rebol print a function word


>
> You would think REBOL would print out a bound function just as it did
> the bound value... otherwise you might think it has no value at all.
>
>
> >> x: function [x] [y] [

x is the argument of function x; y is a local variable used inside the
function

> x: function [x] [y] [

My REBOL interpreter responds with
[
here, waiting for more of the function body to be typed in.

> [    x= y ]

You're creating/referring to an external word x=  This is not the left hand
side of an assignment statement - that would be x:  But,  y has no value yet
(it's not a second argument of x, as perhaps you intended).


> x= y ]
> >> :x
> :x
> >> print x

If you want to see the definition of x, >> print [source x] will do it.
What you're asking for is to print the value of x, but you've defined x as a
function of a single argument, which is missing in the preceding statement.

(I must add, I'm no expert and perhaps I'm misinterpreting what you're
trying to do.  Are you using the most up-to-date version of REBOL for your
platform?  Using 'function [arg list][local var list][body] is
not the style recommended in the User Guide Addendum "Style".  It recommends
'func [arg list /local local var list][body].  I.E., your function x , per
this style recommendation, would be
;; ; ;'s are used for substitute prompt symbols to avoid confusion with >
used for previous messages by many email editos.
;; x: func [x /local y][ ;body of definition ]

) end of parenthetical remark :>)



> print x
> ** Script Error: x is missing its x argument.
> ** Where: print x

>From here on, it all looks ok.  The next statement is reassigning the word
'x to the integer 88.

> >> x: 88
> x: 88
> == 88
> >> :x
> :x
> == 88
> >>
>
I suggest you take a look at REBOL/core User's Guide for Version 2.1.1, part
of the documentation at www.rebol.com.
> --
> Terrence Brannon  * [EMAIL PROTECTED] * http://LNC.USC.EDU/~brannon
>      (213) 740-3397 [Office] (213) 740-5687 [Fax]
> USC, HNB, Los Angeles, CA 90089-2520
>

Reply via email to