[REBOL] Parser seems to have bug - different results on multiple calls. Re:(5)

2000-07-01 Thread bhandley

Some time back. Brian Hawley referred to a discussion on Contexts. Which at
first I could not find.
However spurred on by my misunderstanding of what Rebol is doing, I made a
renewed attempt to find the discussion and was successful.

See the thread "Contexts, and related ideas" in...
http://www.rebol.org/userlist/html/threads-21.html

Brett.




[REBOL] Parser seems to have bug - different results on multiple calls. Re:(5)

2000-07-01 Thread bhandley



Thanks Ingo,
I'll just have to go away and reassemble some brain patterns...

Brett.

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, July 02, 2000 12:48 AM
Subject: [REBOL] Parser seems to have bug - different results on multiple
calls. Re:(4)


> Hi Brett,
>
> maybe this little func 'll show you what's happening ...
>
> test: func [] [
> s1: ""
> s2: copy ""
> append s1 "Hi, I'm changed"
> append s2 "I'm not ..."
> source test
> ]
>
> >> test
> test: func [][
> s1: "Hi, I'm changed"
> s2: copy ""
> append s1 "Hi, I'm changed"
> append s2 "I'm not ..."
> source test
> ]
>
> You see, s1 has literally been changed in the source-code,
> s2 has not. (It's one of the Rebol traps everyone has to
> fall into once.)
>
>
> I hope this helps
>
> Ingo
>
>
> Once upon a time [EMAIL PROTECTED] spoketh thus:
> > Thanks Allen. That certainly does work.
> >
> > But, now I'm confused. Why is that different to what I had? Or, why
didn't I
> > get a new empty string each call previously?
> >
> > Brett.
>
> --  _ ._
> ingo@)|_ /|  _| _   www./_|_) |o(_|(/_  We ARE all FREE> ingo@| |(_|o(_)| (_|
>  ._|  ._|
>




[REBOL] A data inconsistency Re:(11)

2000-07-01 Thread ingo

Hi Anton, 

it's not as if you can't do this, but you have to
'disarm the error before.

a: func [][
if error? err: try [
;
;code that may produce an error here...
;
return "a nice result here"
][
err: disarm err 
print reform ["error in function a" err/id]
]
]

regards,

Ingo


Once upon a time [EMAIL PROTECTED] spoketh thus:
> Hi,
> 
> I disagree with your last statement (at bottom), Gabriele.
> Recently, I wanted to assign 'err in a program like this (it doesn't
> work):
> 
> a: func [][
> if error? err: try [
> ;
> ;code that may produce an error here...
> ;
> return "a nice result here"
> ][print reform ["error in function a" err]]
> ]
> 
> Wouldn't that be nice?
> A view program with code like that in all it's functions would keep
> running when an error occurs,
> but prints out the error message so the user can see what happened and
> inform the programmer.
> Or it could be stored in an error log for later viewing...
> 
> Maybe we could have do/force or try/harder to continue executing code
> after the try block when an error occurs, instead of bailing out to the
> console. I can imagine a program that automatically emails the author
> when errors occur. How about seeing a brief message like this:
> 
> "Error in function blabla: 'doodle is unset. An error report has been
> sent to the author."
<...>

--
_ ._
ingo@)|_ /|  _| _   ingo@| |(_|o(_)| (_| 
 ._|  ._|




[REBOL] core 2.3 install woes Re:

2000-07-01 Thread ingo

Hi Tom,

I have the libc6 version running fine on
Debian/Gnu Linux 2.1 libc6, are you sure
you've grabbed the right version? (I'm
only asking, had _that_ error once, too)


regards,

Ingo


Once upon a time [EMAIL PROTECTED] spoketh thus:
> core 2.3 install woes
> 
> howdy guys,
> 
> just tried to upgrade to REBOL/core 2.3. I think it has already
> been mentioned that "upgrade" does not work.  I grabbed the
> libc6 version for linux, and it failed to start because it
> seemed to be looking for a libc5 shared library. I got the old
> library, tried it, and now rebol just crashes.
> 
> Is this a bug, or what's going on? version 2.2 works just fine.


--  _ ._
ingo@)|_ /|  _| _   ingo@| |(_|o(_)| (_| 
 ._|  ._|




[REBOL] Parser seems to have bug - different results on multiple calls. Re:(4)

2000-07-01 Thread ingo

Hi Brett,

maybe this little func 'll show you what's happening ...

test: func [] [
s1: "" 
s2: copy "" 
append s1 "Hi, I'm changed" 
append s2 "I'm not ..." 
source test 
]

>> test
test: func [][
s1: "Hi, I'm changed" 
s2: copy "" 
append s1 "Hi, I'm changed" 
append s2 "I'm not ..." 
source test
]

You see, s1 has literally been changed in the source-code, 
s2 has not. (It's one of the Rebol traps everyone has to
fall into once.)


I hope this helps

Ingo
 

Once upon a time [EMAIL PROTECTED] spoketh thus:
> Thanks Allen. That certainly does work.
> 
> But, now I'm confused. Why is that different to what I had? Or, why didn't I
> get a new empty string each call previously?
> 
> Brett.

--  _ ._
ingo@)|_ /|  _| _   ingo@| |(_|o(_)| (_| 
 ._|  ._|




[REBOL] A data inconsistency Re:(10)

2000-07-01 Thread anton

Hi,

I disagree with your last statement (at bottom), Gabriele.
Recently, I wanted to assign 'err in a program like this (it doesn't
work):

a: func [][
if error? err: try [
;
;code that may produce an error here...
;
return "a nice result here"
][print reform ["error in function a" err]]
]

Wouldn't that be nice?
A view program with code like that in all it's functions would keep
running when an error occurs,
but prints out the error message so the user can see what happened and
inform the programmer.
Or it could be stored in an error log for later viewing...

Maybe we could have do/force or try/harder to continue executing code
after the try block when an error occurs, instead of bailing out to the
console. I can imagine a program that automatically emails the author
when errors occur. How about seeing a brief message like this:

"Error in function blabla: 'doodle is unset. An error report has been
sent to the author."

-Anton.


> > Moreover, you cannot legally get error as a result of a
> > computation as in
> >
> > error? err: do block
>
> Which is not too bad, why should you produce an error as result of
> a computation (if it is NOT really an error that should fire)?
>
> > and if you do:
> >
> > error? err: try block
> >
> > , you can never be sure if the result Err you have is a result of
> > a successful computation or a sign of a disaster.
>
> If it is an ERROR!, it is an error ! :-)
>
> I don't think being able to return errors would be useful in real
> code.
>
> Still all IMHO,
>Gabriele.




[REBOL] Parser seems to have bug - different results on multiple calls. Re:(5)

2000-07-01 Thread bhandley

> The colon ":" is the set-word operator, which is literally:
> set the word to the left to point to the right.
> Which is not quite assignment in conventional languages.
> 
> I hope that helps!
> 

I think it will.hopefully. :\
Thanks.

Brett.




[REBOL] Parser seems to have bug - different results on multiple calls. Re:(4)

2000-07-01 Thread Al . Bri

> But, now I'm confused. Why is that different to what I had? Or, why didn't
I get a new empty string each call previously?

It's one of the differences Rebol has with other languages. When you assign
a string to a word, like this:
s: ""
You're literally assigning 's to the string just after the 's in the
above line. Therefore that string, just after the "s:" is where the contents
of the string refered to by 's reside.
By using the 'copy, as in:
s: copy ""
you get a fresh copy of the next thing after the 'copy word, into 's.\

The colon ":" is the set-word operator, which is literally:
set the word to the left to point to the right.
Which is not quite assignment in conventional languages.

I hope that helps!

Andrew Martin
Unique Rebol...
ICQ: 26227169
http://members.xoom.com/AndrewMartin/
-><-




[REBOL] Webcam URL Re:(2)

2000-07-01 Thread carl

The room behind the camera is our marketing department.

At 7/1/00 04:43 PM +1000, you wrote:
>Hm. The benefit of night time is the reflection, in the window, of the room
>the camera is in.
>It looks empty! No chairs nothin!
>Hm Implications.. Implications.. Ah - truely virtual.
>;)
>
>Brett.
> 




[REBOL] Parser seems to have bug - different results on multiple calls. Re:(3)

2000-07-01 Thread bhandley

Thanks Allen. That certainly does work.

But, now I'm confused. Why is that different to what I had? Or, why didn't I
get a new empty string each call previously?

Brett.

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 01, 2000 5:19 PM
Subject: [REBOL] Parser seems to have bug - different results on multiple
calls. Re:(2)


> Hi Brett,
>
> change
> cell-data: {}
> to
> cell-data: copy {}
>
> This ensures you get a new empty string each call.
>
> Cheers,
>
> Allen K
>
> - Original Message -
> From: <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, July 01, 2000 4:48 PM
> Subject: [REBOL] Parser seems to have bug - different results on multiple
> calls. Re:
>
>
> > How embarassing. Sent the wrong code. Here is the actual problem code.
> >
> > only-string: func[ s [any-string! none!] ][ either s [s][{}]]
> >
> > quoted-data-rule: [
> >(cell-data: {} print "--init-line--") ; This seems to be ignored
on
> > subsequent calls of parse.
> >{"} copy data to {"} {"} (append cell-data only-string data)
> >any [
> >{"} copy data to {"} {"} (append cell-data rejoin [{"}
> > only-string data])
> >]
> > ]
> > parse/all {"""Mutter."} quoted-data-rule  ; This looks ok.
> > print cell-data ;
> >
> > parse/all {"""Mutter."} quoted-data-rule  ; This is not right.
> > print cell-data ;
> >
> > parse/all {"""Mutter."} quoted-data-rule  ; Bugger.
> > print cell-data ;
> >
> >
> >
>




[REBOL] Parser seems to have bug - different results on multiple calls. Re:(2)

2000-07-01 Thread allenk

Hi Brett,

change
cell-data: {}
to
cell-data: copy {}

This ensures you get a new empty string each call.

Cheers,

Allen K

- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, July 01, 2000 4:48 PM
Subject: [REBOL] Parser seems to have bug - different results on multiple
calls. Re:


> How embarassing. Sent the wrong code. Here is the actual problem code.
>
> only-string: func[ s [any-string! none!] ][ either s [s][{}]]
>
> quoted-data-rule: [
>(cell-data: {} print "--init-line--") ; This seems to be ignored on
> subsequent calls of parse.
>{"} copy data to {"} {"} (append cell-data only-string data)
>any [
>{"} copy data to {"} {"} (append cell-data rejoin [{"}
> only-string data])
>]
> ]
> parse/all {"""Mutter."} quoted-data-rule  ; This looks ok.
> print cell-data ;
>
> parse/all {"""Mutter."} quoted-data-rule  ; This is not right.
> print cell-data ;
>
> parse/all {"""Mutter."} quoted-data-rule  ; Bugger.
> print cell-data ;
>
>
>