World: r3wp
[All] except covered in other channels
older newer | first last |
BrianH 31-Mar-2009 [3401x2] | We want that failure in LOAD though - it's what makes it trustworthy and fast. Check out TRANSCODE/error, but keep in mind that code to cope with foreign data is much more complex than regular code. Beginners should stick to REBOL data. |
Or to data loaded by codecs called by DECODE. | |
btiffin 31-Mar-2009 [3403] | Again ... I'll side with Doc, push come to shove ... but ... it can't be more complex than throwing a runtime error in an action! when given invalid datatypes, no? foreign! on action! or evaluation would trigger a throw. The only operation I'd allow is to string! or a test such as foreign? But I'll now try and hold my tongue for another 2 months. ;) |
Izkata 31-Mar-2009 [3404] | In regards to my "Why not load as a string! ?" comment, I was thinking of some sort of load/safe refinement |
BrianH 31-Mar-2009 [3405x3] | LOAD is safe already. The fact that it throws an error on bad data is what makes it safe. |
We changed it to be even more strict in R3 to make it even safer. | |
The "more strict" is making LOAD/header actually require a REBOL script, if not the header itself. | |
Graham 31-Mar-2009 [3408] | I haven't followed this thread |
btiffin 31-Mar-2009 [3409] | Ok, fine two minutes then. ;) "bad data" would be a new foreign! datatype. No longer "bad". It'd be no more a code hassle than doing email! + url! Take the hit then. But you still have a "valid REBOL series!" to play with. Even with a $$10,000.00\\ floating around in the series ... semantically equivalent to email! or file! out of context for those functions that require particular datums. |
Graham 31-Mar-2009 [3410x4] | but usually you want to parse data knowing what datatypes you are expecting. |
would it be possible to do a to-block on that data accepting only certain datatypes and anything else is coerced to string? | |
eg telephone numbers are recognized as invalid time values | |
>> to-block " 345-6789 " ** Syntax Error: Invalid date -- 345-6789 ** Near: (line 1) 345-6789 >> | |
BrianH 31-Mar-2009 [3414] | Foreign data will have codecs. No need to try to treat it like REBOL data. The foreign! type is the worst possible situation, since it would take the overhead of dealing with foreign data away from the actual input proces, and add that overhead to every bit of REBOL code that called LOAD, because LOAD would no longer be trustworthy. |
Graham 31-Mar-2009 [3415x2] | or perhaps rebol by adding a telephone number data type |
fix rebol | |
BrianH 31-Mar-2009 [3417] | Right now you can count on LOAD returning REBOL data, or an error. This is what makes LOAD trustworthy enough for DO. |
Graham 31-Mar-2009 [3418] | seems a significant omission ... |
BrianH 31-Mar-2009 [3419] | Really? Do you mean #1-773-555-1212 ? |
Graham 31-Mar-2009 [3420] | how many times do you see phone numbers like that in real data ? |
BrianH 31-Mar-2009 [3421] | In REBOL data, plenty. I thought we were talking about LOAD, not input processing. |
Graham 31-Mar-2009 [3422] | to block is clearly evaluating |
BrianH 31-Mar-2009 [3423x3] | Processing UTF-8 to parse REBOL data, yes. |
I say UTF-8 because this is R3 LOAD we are talking about - R2's LOAD won't change again. | |
Listen, we had this discussion before and the compromise endied up being TRANSCODE/error (added in alpha 39). | |
Graham 31-Mar-2009 [3426x3] | Is the r3 group? |
this | |
didn't know that | |
Anton 31-Mar-2009 [3429] | Yes, I've noticed the same arguments put forward as before. |
Graham 31-Mar-2009 [3430] | Oh well, we need a FAQ then ! |
BrianH 31-Mar-2009 [3431] | This discussion pertains to R3, since it is a request for changes to REBOL. R2 isn't changing. |
btiffin 31-Mar-2009 [3432] | I'll do the same thing in another 2 months or so ... It's a new quirk of mine Anton. ;) I'll continue to do so until the kids on compsci.ca see REBOL as a worthy thing to study, instead of writing it off with comments like "I can't stand the syntax". |
Anton 31-Mar-2009 [3433] | That gets really tiresome. |
Graham 31-Mar-2009 [3434x2] | someone will accuse you of trolling |
some of us just have short memories! | |
BrianH 31-Mar-2009 [3436x2] | No Brian, you won't because Carl already made the change in alpha 39, and is currently writing DECODE. |
Even my compromise from the last time you brought this up was rejected. TRANSCODE/error and codecs is what we got. Live with it. | |
btiffin 31-Mar-2009 [3438] | I'm doing it with well meaning intent. I really do struggle trying to get young up and coming university students to give REBOL the chance I know it deserves. And sorry Brian, I've haven't tried A39 yet. I'm still running the A33 for Linux. |
BrianH 31-Mar-2009 [3439x3] | Well, I already rewrote LOAD to take advantage of the TRANSCODE changes. It should go in the next build. |
This includes LOAD/next, btw. | |
Like LOAD/header, it is better than R2 :) | |
btiffin 1-Apr-2009 [3442] | This is very cool news ... I'll crank up wine again on an a40.exe to see ... time to catch up with recent developments again. |
BrianH 1-Apr-2009 [3443x2] | I think upgrade works with the Linux version now, and there are Linux builds on the releases page. |
Even cooler news from the upcoming LOAD: >> load ["print 'hello" "print 'there"] == [[print 'hello] [print 'there]] Works with files and urls too - Carl's idea :) | |
Steeve 1-Apr-2009 [3445] | uh ? |
btiffin 1-Apr-2009 [3446x2] | I've been trying upgrade ... just did a minute ago ... it stashed an r3-a40.exe so I wouldn't have bothered to look ... but am now as you made me all keen and curious. And yes, the releases page has updates I didn't notice. |
Thanks Brian | |
BrianH 1-Apr-2009 [3448x3] | LOAD of a block will treat the block as a collection of things to load, so it will load all of them The code is this: map x source [apply :load [:x header next all unbound]] |
Yeah, the upgrade returns anLinux binary with a Windows name :) | |
an -> a | |
older newer | first last |