« first day (750 days earlier)      last day (3030 days later) » 

5:54 AM
It's not as fluid a concept as if but surely beats if not in everyday code. I've seen elsewhere [code] unless (condition)—but I'd see that as more problematic.
Hmm, unless returned? tape [apply customer fury]
 
 
4 hours later…
9:37 AM
0
Q: How to use PARSE dialect to read in a line from a CSV?

HostileForkI'm trying to use PARSE to turn a CSV line into a Rebol block. Easy enough to write in open code, but as with other questions I am trying to learn what the dialect can do without that. So if a line says: "Look, that's ""MR. Fork"" to you!",Hostile Fork,,http://hostilefork.com Then I want the...

I am pretty used to reading IF NOT, but UNLESS uses one fewer "node"/token of code.
Well, in english we would more often say [bring a sweater]...unless it's warm outside instead of unless it's warm outside [bring a sweater]
 
 
1 hour later…
11:06 AM
...and another, though I found a workaround
0
Q: How in the PARSE dialect does one seek TO or THRU a CHARSET?

HostileForkFirst I'll state my intention: I'm trying to write a parse rule for potentially obfuscated 10-digit phone numbers. So imagine cases like "callmeNOW...555___555____5555!" The place I thought to start from is Wikipedia's list of valid area codes. Then I transform these into pipe-delimited STRING...

 
11:53 AM
And another, without a workaround...
0
Q: Behavior change from Rebol 2 to Rebol 3 for empty BITSET! testing; how to test EMPTY?

HostileForkIn Rebol 2 you could check for an empty bitset with EMPTY? >> empty? make bitset! #{00} == true In Rebol 3 (Build 21-Feb-2011/0:44:24) this is not the case. >> empty? make bitset! #{00} == false Bug or new behavior? Either way, how else might I do this test? Empty bitsets of d...

 
 
3 hours later…
2:28 PM
Yey, my area code is first in the list :)
 
Wow, thanks for the fast response in CSV parsing!
Just trying it, with
>> parse-csv "A^/a"
== [["A"] ["a"]]
But the double quote thing doesn't seem to take:
>> parse-csv {A^/"""a"""}
== none
(What I'd be looking for in that case would be [["A"] [{"a"}]] or equivalent.)
If 205 is your area code, you do keep some pretty interesting hours...I thought you might be French or something. :-)
Mine is 323 but as XKCD maps it out, that only tells you where I lived in 2005. xkcd.com/1129
 
2:48 PM
Same :)
>> parse-csv {A^/"""a"""}
== [["A"] [{"a"}]]
That's in R2 though, R3 doesn't like quotes apparently.
 
Hrrrm. I need R3 for other reasons.
I'm doing a bit of Rebol evangelism to try and get a friend who was going to use regular expressions for a data analysis project to not use regular expressions for something they are vastly unsuited for.
He's a bit of a "connector" in the tipping point sense. Wish Carl would give the ammo to say "...and it's not a proprietary dead-end! Look, source!"
 
Indeed.
 
That will open a lot of doors, but what exactly is it we're waiting for?
 
I don't immediately see why R3 doesn't like quotes.
Ah, I think quote is a keyword in R3 parse.
 
Tricky. How about [quote-char comma-char end-char]
A bit unsettling, I really liked space showing up in R3 but this points out how such common words are likely to be reused in dialects.
Rebol has that edge to it, like English.
 
3:00 PM
Indeed. I changed it to qmark, quote-char would probably be better.
 
Good enough. Well, let's hope that the open sourcing brings enough attention to the table where people would even bother to care about these subtleties. :)
 
Not French, my avatar is a clue—a Scot living in Philadelphia.
 
Ah, well I'm a "never-lived-in-a-city-longer-than-5-years" American, currently in Austin.
 
Need to visit Austin some time, heard much about it. Miss the southern climate, oddly enough.
 
Don't visit in the summer.
 
3:09 PM
I play a weekend soccer tournament every June in AL, I consider it my test of endurance.
 
Hmmm...even with the qmark I'm still getting the none result in R3...did it work for you e.g. on parse-csv {A^/"""a"""}
 
Yes.
>> parse-csv {A^/"""a"""}
== [["A"] [{"a"}]]
Again, A111
 
Got it! (Re-copy-pasted your source, maybe you made other changes from the moment I'd grabbed it...or maybe my search-replace-fu isn't as good as I think.)
 
I did make one or two other small changes.
 
Awesome. Amazing turnaround. It would be nice to see a rabid Rebol-problem-solving community that could keep pace with the likes of the C++ questions I follow here...
Graham's board is nice and all, but I think too much of the Rebol user-base is hiding from the future...the GitHubs and the StackOverflow...not willing to "plug in"
I'm glad you're here!
 
3:18 PM
SO is nice. I'm not sure why there isn't more Rebol activity here.
This is related to the way I approached the CSV question: reb4.me/r/extract-urls
 
The adherence to AltME always baffled me. As you're Scottish, you are probably familiar with the "All Things Scottish" SNL sketch where Mike Meyers would throw fits about the idea that "If it's not Scottish, IT'S CRAP!"
The Rebol groupthink of "If it's not Rebol, IT'S CRAP!" was a very strong flavor of Kool-Aid.
 
Yes, that quote has come up in the occasional conversation :)
(and it's true)
 
3:34 PM
Since I'm doing R3 stuff here and trying to evangelize, I'm substituting LF for your ending.
It seems people are kind of divided on the R2/R3 thing. I don't know...have there been any philosophical regressions in R3? To me, it seems like the main issue is just that it isn't finished...but does anyone think the direction itself is wrong?
 
LF seems reasonable, note though you should be able to use different endings.
ending: "^M^/" should work for crlf CSV files, such that they exist.
I don't believe there's any regression in philosophy. I'm not fully comfortable with some of the string handling, but that may well be because I am so invested in the way R2 works.
That there are a lot of quirky differences (especially at the console), and that it's not finished, I don't want to switch away from the R2 binaries that I am familiar with until I can depend on it.
That said, I try to keep an open mind and be mindful of how a script will need to be adapted in the event I make the switch.
 
4:09 PM
Yes, the console is frustrating, but that's one of those things that I feel the open sourcing will get people onto straightaway...it may be harder to tackle core interpreter logic, but that's low-hanging fruit.
So what should I do about this inability to test for empty? on R3 bitset? :-( It's the last issue I have to tackle before I can send this script to my friend.
I can just skip bitsets and use a series of chars with UNIQUE etc.
I personally think it's a bug, and like many Rebol bugs I feel a decent regression suite of invariants would prevent this from happening. If empty? make bitset! #{00} <> true then don't push the executable. :-/
 
4:41 PM
This works in R2 and R3: empty? make bitset! #{}
 
Well, yes, but my bitsets are the result of charsetting and unioning and intersecting...
So I want an answer after all is said and done. I'm not explicitly concerned with testing empty on constant-declared bitsets. :)
 
Ah, so as in this case: a: charset "a" empty? exclude a a
Definite bug, I'd say.
Weird:
>> empty? exclude a a
== true
>> empty? make bitset! #{}
== true
>> equal? exclude a a make bitset! #{}
== false
(R2)
 
5:01 PM
(where a: charset "a")
 
5:23 PM
I switched to using series of chars, they may be slower but have the ability to intersect and test for emptiness of said intersection...good enough for now!
Okay, I've not really slept much so I need to take a break here. Thanks again for all the help! Cool stuff, hope we can get some more Rebol folks in on the StackOverflow game.
 
 
2 hours later…
7:30 PM
A hack would be: empty-set?: func [set [bitset!]][parse/all mold set ["make bitset! #{" any "00" "}"]]
empty-set?: func [set [bitset!]][parse/all mold set ["make bitset! #{" any ["00" | newline] "}"]]
This hack should work in R2 and R3.
Unless you have system/options/binary-base set to other than 16 :)
Or...
empty-set?: func [set [bitset!]][parse/all third load mold set [some #"^@"]]
Arg!
empty-set?: func [set [bitset!]][parse/all third load mold set [any #"^@"]]
 
 
4 hours later…
11:56 PM
From Ladislav: empty-set?: func [bitset [bitset!]][parse/all to binary! bitset [any #{00}]]
^^^ should work in R2 and R3.
From Cyphre: empty-set?: func [bitset [bitset!]][empty? bitset or #{}]
Faster, but R3-only ^^^^^
 

« first day (750 days earlier)      last day (3030 days later) »