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

World: r3wp

[!REBOL3-OLD1]

Pekr
8-Jan-2009
[9393]
That is also why I asked Carl, if it would be possible to read national 
locale properties from OS, but I can imagine it could get tricky
btiffin
8-Jan-2009
[9394]
well no   load/somerefine "$123,45"   would / should  still parse 
as   [money!] with $123.45 as the value, s'okay.
Pekr
8-Jan-2009
[9395]
OK, but what do you gain? I would like to know, what is the usage 
case, other than being cool showing someone tricks directly in console? 
:-) You would have to parse the junk! datatype by string parsing 
later anyway, no?
btiffin
8-Jan-2009
[9396]
just as today   $123,45  loads as $123.45   I'm ok with that.   REBOL 
reports the type as money! and math won't break.  math (and other 
ops) would reject foreign!  just as it does now for email! or url!
Pekr
8-Jan-2009
[9397]
To state my position - I have nothing against adding such functionality 
(if it does not slow central rebol parser). I did not use it, and 
I would feel more safe with string parsing anyway :-) I just need 
Carl to implement Parse proposal enhancements, and even lamers like 
me would be able to create decent parsing schemas :-)
btiffin
8-Jan-2009
[9398]
Gain?    load/whatever %kingjames.txt    now I can sort, do counts, 
analyze text files.   If I blindly do this block foreign! would throw 
error on eval, or use in math etc...
Pekr
8-Jan-2009
[9399]
In your cases, I do:

result: copy []

foreach line read/lines %kinggames.txt [parse-the-line-and-append-to-result-structure]
btiffin
8-Jan-2009
[9400x3]
I'm aiming to open up REBOL to "all data" analysis and I don't see 
where that should scare normal rebols from going about producing 
good clean parses just as today;  with the addition of a foreign! 
datatype that has semantics of "junk"
yeah parse-the-line-and ... is not code a History Professor may feel 
comfortable writing.   I want REBOL to open up new domains, and I 
don't think this change really hurts existing usage.
But now it's sack time for me and I've broken a promise that I'd 
keep quiet on the issue (for another 2 months ... then I'll whinge 
again)   ;)
Pekr
8-Jan-2009
[9403]
OK, I don't mind either way. Talk to gurus, as i can't see the consequences. 
If it does not slow rebol code parser, then it is OK. And as BrianH 
said - 'load is a mezzanine. It can be patched. I think that adding 
one refinement would not hurt us ...
btiffin
8-Jan-2009
[9404x2]
Well, a refinement and a datatype with semantics of junk, power in 
my opinion, scary REBOL breaking crud to others (others that I do 
respect the opinion of), but I can't see the fear of this datatype!
But anyway Petr; have a good day, I'm off
Maxim
8-Jan-2009
[9406x4]
Pekr parse is a hell of a complex programming paradigm.
conceptually even more complex than regular expressions cause they 
are recursive and stacked, when you build real parsers.
the syntax is pretty, but the concept of parsing is like lisping... 
and how popular is lisp... hummm... try learning lisp to your mom...
rebol's litteral value handling within load is SOOOO fast. having 
to build to build your own parser to replicate what load does is 
NOT simple.  we always talk about simplicity, how beautifull it is...
Pekr
8-Jan-2009
[9410]
you have to be kidding, right? Even lamer like me can write some 
parse expression. Not much complicated, but can. But I can't write 
a bit of regexp. Any person stating that regexp can be more easily 
tought to our mums needs a medicine :-)
Maxim
8-Jan-2009
[9411]
I said the mechanics of it... not the syntax.
Pekr
8-Jan-2009
[9412]
Where I had problem with parse was with some recursion, and variables 
not beeing local to the recursion level. That is going to be fixed 
with parse proposal. There are some really nice helpers suggested, 
so if we got them, parse is the king ...
Maxim
8-Jan-2009
[9413]
but parsing is a hell of a complicated thing.  on the surface it 
looks easy, then you start trying stuff and the vast majority of 
people are stumped.
Pekr
8-Jan-2009
[9414x2]
I think that if loading non rebol values would make many rebollers 
happy, and if there are no consequences to add such functionality 
to rebol, then there is not reason to actually not have it available 
...
not reason = no reason
Maxim
8-Jan-2009
[9416]
I just think that adding some kind of classification to the current 
string type could be really usefull.
Pekr
8-Jan-2009
[9417]
What do you mean by classification, please?
Maxim
8-Jan-2009
[9418x3]
when parsing stuff, it would be fun to be able to assign some kind 
of meta tags or internal labels to litterals.
a bit like we can add invisible line-feeds in block.
so that you can assign an additional type to any value.
d
Sunanda
8-Jan-2009
[9421]
We need something like load/markup.....That splits a string into 
<tags> and "strings". The strings can then be processed separately 
from the tags.

So load/datatypes -- split a string into recognisable REBOL datatypes, 
and other! (aka Junk!)
Maxim
8-Jan-2009
[9422x4]
a bit like saying that series is the super type of both string and 
block.
we could assign our own sub types to anything.
when parsing it could be usefull sometimes, to be able to assign 
a label to a block, so we can leave it where it lay and know later 
on that its a block of some type.
its like adding "meaning" to data, without adding any data to the 
source data.
Pekr
8-Jan-2009
[9426]
Maxim - you can do so via added functionality, no? Adding some objects, 
storing them as references to pointed data ...
Maxim
8-Jan-2009
[9427x3]
that means additional transformations, memory management, and in 
other setups, it means your labellin is outside of the data...
adding some kind of tags to a data element means you are describing 
IT.  you can do whatever you want with it, that info always stays 
with it.
adding this basic functionality in the language would allow us to 
use it directly in load and then just have a simple mechanism where 
either a new word, like 'ASSIMILATE is used and indentifies foreign 
data with a  !foreign!   label.
Pekr
8-Jan-2009
[9430x2]
but internally, it is a data structure anyway, which is just automatically 
attached to data you want to describe, no? How large such label could 
be? What structure? That might get complex, no?
but - that is guru talk, so I will shut up now :-)
Maxim
8-Jan-2009
[9432]
I don't think so... its exactly like the "context" concept of the 
relavance db.
Pekr
8-Jan-2009
[9433]
So, why not propose it to Carl on r3-alpha then? You are there, aren't 
you?
Maxim
8-Jan-2009
[9434x2]
you add some context to data.  the data doesn't change, it just knows 
that its now part of something greater.... the data now "MEANS" something, 
its not just dead.
not anymore, I guess I should get involved again, now that I have 
some time for it.
Pekr
8-Jan-2009
[9436x3]
Maybe we need REPs section on Wiki! Parse document is good example, 
of when good info gets recorded. Lot's of maybe good ideas scrolls 
out ....
I remember Ladislav writing some REPs too in the past ...
Max - you have account there. Maybe you have some dafault password? 
Or we have to find someone, who can reset password for you there 
...
Maxim
8-Jan-2009
[9439x3]
wow... 600 files to download mmmannn I've been away too long  ;-)
damn.. it crashed!
seems to be working now... <phew>
BrianH
8-Jan-2009
[9442]
Brian, what you aren't getting is that foreign! could *either* throw 
an error *or* be analyzed, but not *both*. If it throws an error 
at all, it will throw an error when analyzed. This means that foreign! 
is either a useless error (only useful *because* it is an error), 
or something that every line of REBOL code in existence would need 
to screen for (because it doesn't throw an error), a huge overhead 
for all code. Either way, most existing REBOL code would break.