[load vs load/all] [how to//handle untrusted data] load v loa...
[1/6] from: SunandaDH:aol at: 18-Nov-2004 4:49
Gariele:
> Release version is a older version of REBOL for me. (Actually, an
> obsolete version of REBOL for me.) Don't blame me for this, that's
> really too old for any practical purpose. :)
It's a mindset thing, I think.
A test pilot spends their working day in airplanes that have unproven but
state-of-the-art and highly advanced engines. It's a lot more fun than flying
cargo for a living.
But I bet not a single person at DevCon deliberately tried to travel on an
airline that uses only experimental engines in their aircraft.
:-)
Sunanda
[2/6] from: lmecir::mbox::vol::cz at: 18-Nov-2004 11:17
[SunandaDH--aol--com] napsal:
>It's a mindset thing, I think.
>A test pilot spends their working day in airplanes that have unproven but
<<quoted lines omitted: 4>>
>:-)
>Sunanda
you are right, Sunanda, but the fact is, that a version like 1.2.10
should be promoted to official, because:
1) it not only is more advanced, but it actually is an official SDK
distribution
2) according to my tests, it is much more reliable than the late
official version
-L
[3/6] from: gabriele:colellachiara at: 18-Nov-2004 12:45
Hi SunandaDH,
On Thursday, November 18, 2004, 10:49:27 AM, you wrote:
Sac> But I bet not a single person at DevCon deliberately tried to travel on an
Sac> airline that uses only experimental engines in their aircraft.
I'm not a test pilot when developing commercial applications, but
I need to use the SDK, and the official SDK is basically View
1.2.10. Also, there are serious bugs that you need fixed if you
want to build commercial applications (the window title bug in
some versions of the SDK is one), so you are FORCED to use a beta
version of the SDK.
It's like if the airline was using an old engine, that was known
to break randomnly every 10 flights. I'm not sure I would feel
comfortable with it just because it was less experimental. :-)
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amiga Group Italia sez. L'Aquila --- SOON: http://www.rebol.it/
[4/6] from: maarten:vrijheid at: 18-Nov-2004 13:07
> I'm not a test pilot when developing commercial applications, but
> I need to use the SDK, and the official SDK is basically View
> 1.2.10. Also, there are serious bugs that you need fixed if you
> want to build commercial applications (the window title bug in
> some versions of the SDK is one), so you are FORCED to use a beta
> version of the SDK.
IIRC we are using an encapcmd in the 1.2.4x series for the SURFnet
Detective because it is more stable...
> It's like if the airline was using an old engine, that was known
> to break randomnly every 10 flights. I'm not sure I would feel
> comfortable with it just because it was less experimental. :-)
....and we're flying
--Maarten
[5/6] from: gabriele::colellachiara::com at: 18-Nov-2004 13:17
Hi Maarten,
On Thursday, November 18, 2004, 1:07:30 PM, you wrote:
MK> IIRC we are using an encapcmd in the 1.2.4x series for the SURFnet
MK> Detective because it is more stable...
Yes. And, we're still full of workarounds to avoid crashes and
other important bugs, so I wouldn't wait much to switch to any new
version that had these bugs fixed. :-)
Regards,
Gabriele.
--
Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer
Amiga Group Italia sez. L'Aquila --- SOON: http://www.rebol.it/
[6/6] from: SunandaDH::aol::com at: 18-Nov-2004 10:52
Peter:
> 4. It is advisable to wrap the to-block or load of untrusted data in an
> error/try block as some strings will give problems. For example:
That's a good summary. Thanks for doing that.
Another technique that has it's uses is simply trying to convert the
untrusted string directly into the type you want:
internal-item: to date! "a string"
This needs error trapping as it can fail on bad strings. And you need to test
the end result to be none, meaning the conversion failed.
Here's a reconstructed function based on something half-remembered on the ML
for converting a data item into an expected datatype:
to-type: func [dt [datatype! block!] item [string!]
/local temp
][
if not block? dt
[dt: copy reduce [dt]]
trim/lines item
foreach dte reduce dt
[
error? try
[
temp: to dte item
if not none? temp [return temp]
]
]
return none
]
Uses:
>>print to-type date! " 4-6-04 "
4-Jun-2004 ;; it's a date
>>print to-type date! " 404 "
none ;; it's not a date
>> print to-type [pair! date!] " 4-6-04"
4-Jun-2004 ;; it's a date
>> print to-type [pair! date!] " 66x66 "
66x66 ;; it's a pair
>> print to-type [pair! date!] " 3.14159 "
none ;; not a date or a pair
Sunanda
Notes
- Quoted lines have been omitted from some messages.
View the message alone to see the lines that have been omitted