[REBOL] Re: [bug?] Problem with 'load

2003-12-04 Thread SunandaDH
Romano: > troublesome-script: { > , > REBOL [needs: [9.9.9 xxx]] > } > load-all-script: func [s][ > if s: script? s [ > load/all s > ] > ] That's ingenious!! Thanks a lot, Sunanda. -- To unsubscribe from this list, just send an email to [EMAIL PROTECTED] with un

[REBOL] Re: [bug?] Problem with 'load

2003-12-04 Thread Romano Paolo Tenca
Hi Sunanda, > troublesome-script: { > , > REBOL [needs: [9.9.9 xxx]] > } > script? troublesome-script ;; finds a valid header : correct! > load-header troublesome-script ;; Romano's script -- finds a valid header: > correct! > load troublesome-script ;; fails due to the 'need >

[REBOL] Re: [bug?] Problem with 'load

2003-12-04 Thread SunandaDH
Hi Brett, > I might have missed a message on this, but is there any reason why you > cannot use an upgraded version of REBOL? Thanks for the reply. My mistake.I got too many version of REBOL around, and I did all my pre-post testing on an older version. Load does now perform as you say,

[REBOL] Re: [bug?] Problem with 'load

2003-12-04 Thread Brett Handley
Hi Sunanda, > We know 'load is bad as it evaluates the header: > Not true - Core 2.5.2 introduced a safer LOAD. Please see: http://www.rebol.com/docs/changes.html#section-4.2 > But this problem looks like it needs a different approach. ... > Any ideas? I might have missed a message on this,

[REBOL] Re: [bug?] Problem with 'load

2003-12-04 Thread SunandaDH
More problems with load. This may not be a bug, but I can't find a workaround. I want to be able to safely load *any* script to check it has acceptable syntax before allowing it into REBOL.org. But we absolutely don't want to evaluate the header as that may execute untrusted code in server

[REBOL] Re: [bug?] Problem with 'load

2003-11-29 Thread moliad
Sunanda et al. thanks for asking me to post an example of encompass in action. I, myself, was looking for meaningfull examples, and its fun to have one in the context of a real problem. here is an example of how to patch load so that the /all refinement works as expected. I have used the met

[REBOL] Re: [bug?] Problem with 'load

2003-11-29 Thread SunandaDH
Max: > damn I was about to show you a way of doing it with encompass... :-) > That is its main purpose... fixing/improving/limiting things around... while > still keep the basic functionality. I'd appreciate seeing some more examples of what encompass can do -- it's often hard to see all t

[REBOL] Re: [bug?] Problem with 'load

2003-11-29 Thread SunandaDH
Thanks Volker: > If we use /core 2.5.6, then not. > this is oold /view 1.2.1: > >> load "rebol[print {hehe}]" > hehe > == [ > ] > and this core 2.5.6: > >> load "rebol[print {hehe}]" > == [ > ] > > IIRC its mentioned somewhere in the /core change-log. > Yep -- RT got there fi

[REBOL] Re: [bug?] Problem with 'load

2003-11-28 Thread Volker Nitsch
Am Freitag, 28. November 2003 19:50 schrieb [EMAIL PROTECTED]: > Thanks to everyone who contributed responses. > > I've now updated REBOL.org to use Romano's load-header script rather than a > direct load/all/header in all the places (lots!) we load a header to get > values about a script. > > Thi

[REBOL] Re: [bug?] Problem with 'load

2003-11-28 Thread Maxim Olivier-Adlhoch
, but in the end, being part of the problem is much more fun." > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Friday, November 28, 2003 1:50 PM > To: [EMAIL PROTECTED] > Subject: [REBOL] Re: [bug?] Problem with 'load >

[REBOL] Re: [bug?] Problem with 'load

2003-11-28 Thread SunandaDH
Thanks to everyone who contributed responses. I've now updated REBOL.org to use Romano's load-header script rather than a direct load/all/header in all the places (lots!) we load a header to get values about a script. This was a potentially damaging integrity exposure (my old-timer IBMese for

[REBOL] Re: [bug?] Problem with 'load

2003-11-28 Thread Romano Paolo Tenca
Hi Brett, > blah blah > [ REBOL [Title: "Sample"] print now] > blah blahblah blah > blah blah > > Strangely enough, the Script? function that Yos pointed out seems to give a > useful result in this case - the beginning of the embedded script, but not > when the script is not embed

[REBOL] Re: [bug?] Problem with 'load

2003-11-28 Thread Al TS
Thanks Brett for explanations. I think it is simpler for Sunanda to work with embedded script with the script function i give you than parsing for header and content information like script? do (script? is a native and we can't see the source). So we add [ at start and ] at end of temp.r exampl

[REBOL] Re: [bug?] Problem with 'load

2003-11-28 Thread Brett Handley
> I was trying to think of a way of safely doing this myself, so your script > has given me hope that it is possibleWe just need to solve the bad preamble > problem, It would be better to have it fixed, but if you need the workaround I'm pretty sure it could be done with Parse and using a par

[REBOL] Re: [bug?] Problem with 'load

2003-11-28 Thread SunandaDH
Thanks Yos, > I use this on View 1.2.1 maybe could help you Unfortunately, it fails if the preamble (stuff before the REBOL header) contains invalid words, If you try it on the test script below, you'll see what I mean: ===save next lines as temp.r=== A preamble: there is text before header,

[REBOL] Re: [bug?] Problem with 'load

2003-11-28 Thread Al TS
I use this on View 1.2.1 maybe could help you. REBOL [] script: get in context [script: func ["^/" File /header /content /compress /decompress /local script ] [script: system/words/read File script: loa

[REBOL] Re: [bug?] Problem with 'load

2003-11-28 Thread SunandaDH
Thanks Gabriele > Looks like a bug to me... I'll report it to feedback. My last email should have said: Trouble is. my prettyprinter would seem to be only able to load scripts that run under the same version that it does if the target script has a needs header entryAnnoying or what? S

[REBOL] Re: [bug?] Problem with 'load

2003-11-28 Thread Gabriele Santilli
Hi SunandaDH, On Friday, November 28, 2003, 10:07:23 AM, you wrote: Sac> We might be seeing different behaviour on different versions of REBOL -- I'm Sac> looking at Win and Unix. It looks to me like the header is *always* Sac> evaluated, including the needs check, despite the /all refinement.

[REBOL] Re: [bug?] Problem with 'load

2003-11-28 Thread SunandaDH
Thanks Anton and Max Anton: > In my tests it looks like the needs block isn't evaluated, > just examined. We might be seeing different behaviour on different versions of REBOL -- I'm looking at Win and Unix. It looks to me like the header is *always* evaluated, including the needs check, des

[REBOL] Re: [bug?] Problem with 'load

2003-11-28 Thread Gabriele Santilli
Hi SunandaDH, On Thursday, November 27, 2003, 10:49:49 PM, you wrote: >>> load/all/header "rebol [needs: [1.2.1 ]]" Sac> ** Script Error: This script needs or better to function correctly Sac> ** Near: load/all/header "rebol [needs: [1.2.1 ]]" Looks like a bug to me... Regards,

[REBOL] Re: [bug?] Problem with 'load

2003-11-27 Thread Anton Rolls
I think words in the needs block are just compared to: extract system/components 3 In my tests it looks like the needs block isn't evaluated, just examined. Anton. > I didn't know the needs: attribute was actualy evaluated. > > actually, I barely even knew that was even significant...

[REBOL] Re: [bug?] Problem with 'load

2003-11-27 Thread Maxim Olivier-Adlhoch
I didn't know the needs: attribute was actualy evaluated. actually, I barely even knew that was even significant... I just looked at the online docs and the word is referenced 3 times, where they explain the script header... but don't explain the dialect anywhere! is this dialect actualy usabl