r3wp [groups: 83 posts: 189283]
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

World: r3wp

[!REBOL3-OLD1]

xavier
7-Jan-2009
[9282]
brian, is there another function that is specified for loading human 
data ?
btiffin
7-Jan-2009
[9283]
Adding foreign! doesn't really change LOAD does it?  It changes the 
native  make  phase  no?
BrianH
7-Jan-2009
[9284]
We don't want foreign! by default though (or ever, but that is another 
matter), and you can't provide options to TO. We would have to support 
foreign!, or better yet fallback, incrementally with TRANSCODE.
Chris
7-Jan-2009
[9285]
Quick 'n' dirty 'load-junk (cvts: for R2; junk! is string!; blocks 
mess things up): http://www.ross-gill.com/r/load-junk.r
BrianH
7-Jan-2009
[9286]
See, that is what we need! A separate function.
Chris
7-Jan-2009
[9287x3]
Ignores comments!
Agreed Mr. B.
comments == commas...
BrianH
7-Jan-2009
[9290x2]
Look how complex LOAD is already. That is why it is now mezzanine: 
The complexity is better handled by REBOL code.
It's still fast though :)
Graham
7-Jan-2009
[9292]
Chris, 404s for me
Steeve
7-Jan-2009
[9293]
hum... Brian, switch is not faster than case in load ?
Chris
7-Jan-2009
[9294]
Hmm, that'd be http://www.ross-gill.com/r/junk.r
BrianH
7-Jan-2009
[9295x2]
Nope, case is one of the fastest functions in REBOL, even R2.
We profile everything :)
Steeve
7-Jan-2009
[9297]
i know for R2, but in R3 switch is native, no  ?
btiffin
7-Jan-2009
[9298]
Ok, I'd gladly accept a separate function, but ship it with REBOL 
for grandma and the professors of the world.  Don't make them hunt 
it down and DO it as a special case.    But to be honest, I'd still 
prefer a foreign! datatype! and advertise REBOL as a human readable 
language.  Much power in that ad imho.
Maxim
7-Jan-2009
[9299]
but we also need an unknown!  ,   junk!  ,   or  WTF!   datatype 
   ;-)    

note the intentional use of commas  ;-)
BrianH
7-Jan-2009
[9300x2]
Switch is native in R2 as well.
At least for the last few years.
Steeve
7-Jan-2009
[9302]
not in the version i use, sigh...
btiffin
7-Jan-2009
[9303]
Maxim;  And let cunning linguists write some scripts that tally the 
amount of WTF! information in wikipedia.   ;)
BrianH
7-Jan-2009
[9304]
What platform are you on? If Windows or Linux, use 2.7.6.
Chris
7-Jan-2009
[9305]
wtf! and associated query: wtf?
BrianH
7-Jan-2009
[9306]
If you are doing one comparison, IF, UNLESS or EITHER is fastest. 
For 2 to 6ish comparisons, CASE is faster. Anything above that use 
SWITCH. Profile your code patterns to see which is best in your case.
Maxim
7-Jan-2009
[9307]
I can already see it...

>> to-wtf
Steeve
7-Jan-2009
[9308]
currently, i tested with the first alpha, switch is faster than case
Maxim
7-Jan-2009
[9309]
make WTF! none
Steeve
7-Jan-2009
[9310]
BRIAN !!!!!
btiffin
7-Jan-2009
[9311]
I can see Brian's and Gabriele's point.   Clear, concise REBOL is 
power.  But so is letting non-techies use the console.  Power in 
numbers.  And it's sooo close already.
BrianH
7-Jan-2009
[9312x2]
Steeve, do you mean:
>> to-wtf none
== "BRIAN !!!!!"
:)
Maxim
7-Jan-2009
[9314]
hahahha
xavier
7-Jan-2009
[9315]
lolllll
Steeve
7-Jan-2009
[9316]
>>a: 1
>> t loop 1000000 [case [block? a [] integer? a []]] tt
0:00:00.534

>> t loop 1000000 [switch type?/word a  [block! [] integer! []]] 
tt
0:00:00.433
Chris
7-Jan-2009
[9317]
BT: It should at least be a separate function, but I suggest separate 
from the language too.  a) it's too much baggage, and b) the scope 
for recognising string patterns could better be handled in a more 
open way.
BrianH
7-Jan-2009
[9318]
I did say that errors should complain loudly, but I didn't mean complain 
to me personally :)
Steeve
7-Jan-2009
[9319]
so what did you profile Brian ?
btiffin
7-Jan-2009
[9320]
Too much baggage for the pros, yes.  Just right for a Professor of 
Geography or home user, imho.   Don't fear those that don't normally 
program, help them.  No?
Chris
7-Jan-2009
[9321]
Too much baggage for the language.  Perhaps it could be incorporated 
into a beginner's binary?  I understand the need, even for pros too...
BrianH
7-Jan-2009
[9322]
I look forward to R3 modules - then we won't have to be as picky 
about what gets included because it won't all get loaded by default.
btiffin
7-Jan-2009
[9323]
I still don't see how a lexical foreign! would be that expensive. 
 Am I just not getting it?   Again, you cant   ADD email! url!  but 
they are valid types.  Make foreign! a valid type and then REBOL 
loads anything and series! operations can operate freely.
BrianH
7-Jan-2009
[9324]
Adding a lexical foreign! means you add the overhead of checking 
for valid syntax to *all* REBOL code, not just LOAD. It removes your 
ability to trust that what comes out of LOAD is valid. That is a 
huge overhead to all REBOL code, and would be the source of most 
REBOL bugs in the future. It is a horrible thing to do to the community.
btiffin
7-Jan-2009
[9325x2]
Well, what do you mean by valid?  foreign! would be valid, no?
It becomes a new datatype! with the semantics of junk.
BrianH
7-Jan-2009
[9327]
No, it wouldn't, it would be meaningless. It would be like #[unset!].
Maxim
7-Jan-2009
[9328]
I agree that allowing junk to linger, would mean that all code needs 
to handle junk... which can be sort of awkward
BrianH
7-Jan-2009
[9329]
It can't throw an error, or you wouldn't be able to parse it to get 
anything ot of it. If it is another string type you'd have to check 
for it at every evaluation, because you aren't getting a nice error 
to escape out of yor code. It's either useless or a nightmare.
btiffin
7-Jan-2009
[9330]
Yes, meaningless; but there would be less syntax errors.  And once 
in a block, cleaning could be done, but wouldn't have to be.  That 
would be up to the domain problem at hand.   I may never be convinced 
that having rules for what can be added would be that much different 
if REBOL were allowed to   make foreign!
Steeve
7-Jan-2009
[9331]
it depends how rebol handles junked newline in code