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

World: r3wp

[All] except covered in other channels

[unknown: 5]
6-Jan-2009
[3126]
'Load can rip you off when it comes to parse:

>> a: load [$10,000]
== [$10.00]
Pekr
6-Jan-2009
[3127]
Brian: I am not sure, but what Gabriele might mean is, that such 
change is possible, but could have some consequences ....
[unknown: 5]
6-Jan-2009
[3128x2]
The search function is changing a bit.  I'm simplifying the look 
so that it is only two blocks:

db/search [logic][action]


There will no longer be a database block.  Instead a database and 
field will be inputed together such as:

db/search [my-base.field-name > 1][my-base.field-name]


In that example it would check the database called "my-base" and 
check its fieldname which is called simply "field-name" in the example 
above to see if it is greater than the value  of 1.  If it is then 
it returns the field-name value.
doh wrong group
btiffin
6-Jan-2009
[3130]
Well, technically the design does allow for more international usage; 
and that IS a good thing, but North Americans use commas.  I'll quiet 
down after this post and then repost to the issue in a few months. 
 I don't know really, but I feel a few small incremental changes 
could open up the field to more people not inclined to be programmers.


On a grander scale, for linguistics work ala Icon's power, being 
able to LOAD %somerandompoem.txt  and not worry about syntax errors 
could open up a whole new domain for REBOL.  That would require a 
junk! datatype, and sure there will be issues with correctness, but 
let the english majors worry about those.  Today they won't even 
bother to start, so there are no issues of correctness as there are 
no scripts.   But imagine some English professor or a theologist; 
LOAD %kingjames.txt and then using REBOL to do statistical analysis, 
right at the console.  A report could count how much non-REBOL data 
was in the books along with counting the times 'Moses was mentioned 
in 2 or 3 simple lines of code.


I'll stop dreaming now (for a awhile) and get back to the task of 
being a nerd.  S'alright.  ;)
BrianH
6-Jan-2009
[3131x3]
Money can't use the comma because of incompatibility with Europe, 
not parse.
Brian, load in Icon is more like READ, and Icon's analysis code is 
very much like REBOL's string parsing.
There is no equivalent to REBOL's block parsing in Icon, because 
code is not data in Icon.
Sunanda
6-Jan-2009
[3134]
Gabriele: <it needs to be a parser designed for your specific application 
- it's a user interface thing, not a language thing.>
Well said!

Turning raw, external, untested, characters into application-compatible 
data types is not trivial. It's something a language can help with, 
but the language cannot do it all.....especially when you add in 
another important stage: that of giving the user meaningful, context 
sensitive, error mesages if the characters need correcting in specific 
ways.
BrianH
6-Jan-2009
[3135]
We don't need LOAD to be relaxed (what a nightmare that would be!), 
we need commonly available library functions for parsing localised, 
sloppy user data. With those library fnctions we can stop the people 
from asking us to break LOAD.
Graham
6-Jan-2009
[3136]
Sounds like a good way to improve usability.
Gregg
6-Jan-2009
[3137]
I've asked before, but don't think I ever got an answer from Carl, 
if the money! lexicon couldn't be fixed to allow commas and dots 
to be used in either order, as group and decimal separators. Does 
anyone see a problem with that?
Graham
6-Jan-2009
[3138]
Probably the answer is to have decent widgets that filter the user 
input.   My bank just cheats and prevents any commas being entered 
into money fields.
[unknown: 5]
6-Jan-2009
[3139]
The comma is a sure fire  way to get past some parsing systems right 
now and possibly cause a crash.  Because of the following:

>> type? $10,000
== money!
>> $10,000 + 1
== $11.00
Graham
6-Jan-2009
[3140]
that's expected behaviour
[unknown: 5]
6-Jan-2009
[3141]
what is?
Graham
6-Jan-2009
[3142x2]
>> $11'000 + 1
== $11001.00
>>
$10,000 = $10.00
[unknown: 5]
6-Jan-2009
[3144]
yes but I don't think anyone new to REBOL  is going to expect 10,000 
dollar plus 1 to equal 11 dollars.
Graham
6-Jan-2009
[3145]
Carl was never concerned about money!
[unknown: 5]
6-Jan-2009
[3146]
lol
Graham
6-Jan-2009
[3147x2]
this is the failure of the REBOL development cycle.
if we have regular iterative release/development ... these issues 
could have been discussed and dealt with long ago.  Instead we have 
100s of issues, which are looked at every now and then, and it's 
just too much to handle at one time.
Chris
6-Jan-2009
[3149]
I wrote an 'as (possibly short for coerce) function for QM with the 
heady goal of recognising types from strings.  It isn't nearly as 
extensive as I'd like (if I were to do that myself, it wouldn't be 
nearly as efficient as I'd like), but the community could use an 
'as like function (with possible /next refinement):

	>> as integer! "1,000"
	== 1000
	>> as/next integer! "1,000 and 1"
	== [1000 "and 1"]
	>> as money! "$1,000"
	== $1000
	; note, this is not how 'as works in QM


And it should be independent and open source.  It's perhaps something 
the core language should not be burdened with...
Rebolek
7-Jan-2009
[3150]
Paul: 10,000 + 1 is 11, that's 100% OK, as comma is decimal delimiter 
here in Europe. And getting 10001 instead would be a terrible bug.
Gabriele
7-Jan-2009
[3151x2]
REBOL is one step away from allowing normal people access
 - Brian... is that step called AI?
So, let's do it this way. Please implement what you want LOAD to 
do using PARSE and LOAD/NEXT. Then we can discuss it.
btiffin
7-Jan-2009
[3153x4]
Ok;  I get the omens  ;)  REBOL3 went offline just as I had posted 
this ...


Ok, I wasn't going to speak to the issue for another 60 days, but 
 ;)

My main point is not making the life of rebols any easier.  The point 
is attracting mom, pop and non technically inclined academic types. 
 For instance;  imagine a CPU that refused to load a binary into 
a code segment if the image included non executable hexcodes.  I 
don't mean only loaded bits of it, it just halted.  Said chip would 
not garner a mass following.  Sure NASA and Boeing my buy them for 
their engineers, but normals would balk at such a thing.  Not even 
going as far as loading it and giving a chance for a debugger to 
examine the nasty bits would make it a non-starter for mass market. 
 I akin current REBOL from that angle (again, thinking about mom, 
pop, history professors and linguists)
rebol []
; load any garbage ... NOT recursive, JUST A QUICK EXAMPLE
; leaves nones littered about, misses spaces yadayda
loadall: func [data /local gs gb err ero val gn] [
    gs: copy data
    gb: copy []
    until [
        either error? err: try [set [val gn] load/next gs] [
            ero: disarm err
            print ["is err: " ero/arg2]
            append gb ero/arg2 append gb join " - " ero/arg1
            gn: gs: find/tail gs ero/arg2
        ][
            append gb val
            gs: gn
        ]
        any [none? gn empty? gn]
    ]
    gb
]

org: "12.3.2.2.2.2.3.32.2.2.22.3.2.32.2.23.23.23.2312212323. this 
is a test of $10,000,000.00 loadall sequence"
probe loadall org
gives
>> do %loadall.r
Script: "Untitled" (none)
is err:  12.3.2.2.2.2.3.32.2.2.22.3.2.32.2.23.23.23.2312212323.
is err:  $10,000,000.00

[{12.3.2.2.2.2.3.32.2.2.22.3.2.32.2.23.23.23.2312212323.} " - tuple" 
this is a test of "$10,000,000.00" " - money" loadall sequence]
Note how the error objects have a great clue in arg1?   This is just 
an example, the code sucks.  Don't think about that.  Think about 
a history professor sitting at a desk and typing
>> mybook: load %mybook.txt

and then fiddling with   >> unique    or  sort   or ...  while trying 
to determine how many times he invoked Godwins Law

I think this would open up reams of new REBOL communities.  Let us 
pros worry about correctness and DSL and user friendly power apps. 
 But open REBOL to general mishmash for the world at large.  No?
Graham
7-Jan-2009
[3157]
Except Carl has already posted to say Rebol is not for those people.
btiffin
7-Jan-2009
[3158]
Ahh, good point.  Let's keep the knowledge to the illuminati.  ;) 
  But more seriously, he also mentioned


I think it's time to change our message. REBOL is not for everyone. 
REBOL is advanced. It promotes the concepts of symbolics, context, 
and environment as powerful tools, going far beyond the traditional 
ideas of functions, objects, loops, and if statements.


Why not let cunning linguists (if not mom and pop) in on the party 
too?   It would still open up reams of communities. Entice them with 
"any kind of junky code that works" and then let them sit back and 
"consider each detail of their design, and sculpt it perfectly as 
a lasting work of thought." a few minutes after getting hooked?
Graham
7-Jan-2009
[3159]
I think the answer is to write a more relaxed form of load perhaps 
as a dialect in this situation.
Carl
7-Jan-2009
[3160x3]
Stopped by.  It must have taken 30 minutes to sync up with this world. 
You guys talk too much. ;)
Ah, the "comma topic" -- how many hours I've meditated on that one.
It's almost easier to invent a time machine, go back in time, and 
standardize the world's decimal point.  And, maybe if there's a little 
extra time, standardize the date format too.
Steeve
7-Jan-2009
[3163x2]
Carl, are you the "real" one ?
seems...
Carl
7-Jan-2009
[3165]
Let me pinch myself.... yes, it's me.
Steeve
7-Jan-2009
[3166]
it's been a while... :)
Carl
7-Jan-2009
[3167x2]
Long time.  I've never wanted to wait for this world to load (on 
this computer, which is in a loft).
How many messages are there in this world? More than 100'000?
Pekr
7-Jan-2009
[3169x4]
I would not expect you here :-) But, cool you stopped by here, as 
we've got some new users here in last two months ...
yes, many many messages. I wonder Altme still works without SQL backend 
:-)
(but I have limited msg display ratio to 500 msgs .... when I search 
for something, I set 5000 or so, but then it starts to crawl)
So you came by here, to announce we need more developers for R3 alpha? 
;-)
Steeve
7-Jan-2009
[3173x2]
i will not have any request (really hard), i just stay here and have 
a beer waiting for others who will begin to harass you :)
WHERE IS THE R3 !!! lol
Maxim
7-Jan-2009
[3175]
hi Carl!  long time no chat  :-)