Hi Carl

I am not a 'bind guru, however the following seems to work.

parse-this: func [blk rules /local str local-func value][
    str: copy ""
    local-func: func [n][append str n]
    parse blk bind rules 'str
    print str
]

Patrick

----- Original Message ----- 
From: "Carl Read" <[EMAIL PROTECTED]>
To: "REBOL List" <[EMAIL PROTECTED]>
Sent: Friday, March 29, 2002 10:02 AM
Subject: [REBOL] Calling local functions from parse rules...


> Hello all,
> 
> I'm trying to write a function that does some parsing within it and
> the parse rules require a local function to be called, but I can't get
> parse to recognise the function.  Here's an example of the problem...
> 
> parse-this: func [blk rules /local str local-func value][
>     str: copy ""
>     local-func: func [n][append str n]
>     parse blk rules
>     print str
> ]
> 
> Which give this error...
> 
> >> parse-this ["abc"][set value string! (local-func value)]
> ** Script Error: local-func has no value
> ** Where: parse-this
> ** Near: local-func value
> 
> How do I get it to recognise 'local-func without making 'local-func a
> global function?  By using 'bind perhaps?  But how?  No way I've
> tried has worked.
> 
> Also, 'value in the parse rule there becomes global...
> 
> >> ? value
> VALUE is a string of value: "abc"
> 
> I want that kept local to the function too.  Any help appreciated...
> 
> -- 
> Carl Read
> 
> -- 
> To unsubscribe from this list, please send an email to
> [EMAIL PROTECTED] with "unsubscribe" in the 
> subject, without the quotes.
> 

 
______________________________________________________________________________
ifrance.com, l'email gratuit le plus complet de l'Internet !
vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP...
http://www.ifrance.com/_reloc/email.emailif


-- 
To unsubscribe from this list, please send an email to
[EMAIL PROTECTED] with "unsubscribe" in the 
subject, without the quotes.

Reply via email to