« first day (1639 days earlier)      last day (2141 days later) » 

12:22 AM
@rgchris Hmm. Philosophically how far would that extend though? Should all parses that end in failure empty the list? The implementation guts are kind of recursive and it seems a bit arbitrary to just pick rule alternates to backtrack.
 
12:43 AM
"Q: How do you recode a digital elephant?" => "A: One byte at a time."
 
1:11 AM
obj: object [x: … y: …]
parse stuff [blah blah obj blah blah]
Creative ideas for the application of that? It's an error today. It could match--literally--that object value if you were doing block parsing. But you could get that with LIT obj. Might there be something "cooler"?
 
@HostileFork I wouldn't say it is arbitrary—it would be recursive, it'd be consistent. Start a new branch at each block, restart it at pipe if first rule fails, fold the branch into parent at the conclusion of a successful rule. That I continually come across the need for this pattern and want to implement it in Rebol Parse rules (2 and 3) would suggest this is how COLLECT/KEEP should work. Might get heavy, but would be so useful...
StyleTalk has many mark and capture calls to try and get a hint of this functionality.
 
@rgchris It's more reasonable to have a parse keyword doing such magic than to try (for instance) to roll back the effects of a paren. If you're comfortable with the rule being a failed block nest level such that parse [a a a] [collect [keep 'a [keep 'a keep 'b]]] will give you [a], then I guess it could be considered well-defined. But philosophically I like to think the blocks are transparent if no operator is applied on them. I'm unsure if any other construct treats it otherwise.
The idea that [keep 'a [keep 'a keep 'b]] isn't functionally equivalent to [keep 'a keep 'a keep 'b] is a "new idea in the mix"
 
1:27 AM
It's not functionally equivalent, but both rules fail.
Internally functionally equivalent.
It's functionally equivalent to me, the Parse user.
 
@rgchris My point is, can you think of any other effectively completed rule before a block opens where it is different? [complete-rule-1 [complete-rule-2 complete-rule-3]] being functionally inequivalent to [complete-rule-1 complete-rule-2 complete-rule-3]? The thing is that blocks are used for another purpose which is composition and avoiding repetition, which is why I mention it being nice that they are "transparent"
composite: [complete-rule-2 complete-rule-3]
parse ... [complete-rule-1 composite]
You're tying two things together, the block-as-unit-of-reuse with block-as-unit-of-meaning
 
It wouldn't have meaning, not to the Parse user—I'd still expect [a a b] if the input was [a a b], I would just expect failure if it were [a a a].
 
It is different meaning if it generates different results. The function call result of parse isn't the only unit of meaning; the output of collect being different counts as having distinct meaning.
 
But the output of collect wouldn't be different.
red> parse [a a b][collect [keep 'a [keep 'a keep 'b]]]
 
Can you elaborate on that?
; Brought to you by: try.rebol.nl
== [a a b]
 
1:34 AM
Okay so parse [a a a] [collect [keep 'a [keep 'a keep 'b]]] gives you X and parse [a a a] [collect [keep 'a keep 'a keep 'b]] gives you Y... you say X = Y?
Thus what you mean is that it is collect itself that is the barrier, not the block of the rule running?
 
No, they'd be the same.
 
Thus your well-defined boundary is that a collect is either all or nothing?
 
Collect as-is is the block barrier:
red> parse [a a b][collect [keep 'a collect [keep 'a keep 'b]]]
 
; Brought to you by: try.rebol.nl
== [a [a b]]
 
What you said was "I wonder if the COLLECT/KEEP concept in Red could be refined to ignore KEEP calls on failed branches"
I said, effectively, "what counts as a branch?"
 
1:37 AM
I would just like it so it didn't collect the results of a failed rule:
red> parse [a b c][collect [keep 'a [keep 'b keep 'd | keep 'b keep 'c]]]
 
You said: "Start a new branch at each block, restart it at pipe if first rule fails, fold the branch into parent at the conclusion of a successful rule."
 
; Brought to you by: try.rebol.nl
== [a b b c]
 
I don't know that I think calling out pipe in particular makes a lot of sense.
 
Why wouldn't it? That's the specific point where it needs to be...
 
What is so special about a pipe rule failing vs other failures? Why start a new branch point at each block and then need a pipe in that block to trigger rollback?
This is a relationship between COLLECT/KEEP, pipe, AND block. It's not simple.
I understand where you're coming from, it's saying "I only want this keep if the rule I'm trying to match gets all the way through"
But you were asking about mechanical/implementation problems. The problem is that instinctively I feel your "I only want this keep if the rule I'm trying to match gets all the way through" has a selectivity in it of what it would mean to do that in a general sense.
"this rule I'm trying to match" has somehow become "this optional in a pipe" and the barrier for keep is "the last block I opened"
I'll stick with the observation above that we use blocks in service of PARSE for substitution, by breaking the transparency rule you are suddenly taking away the abstraction ability to pull out a rule like my composite
I might not refactor a parse rule to reduce redundancy because it would mean opening a block, and opening a block would change the rollback point for COLLECT/KEEP
If you want a new rollback point, that sounds like a place for a new COLLECT node (or something of the sort) to make it more intentional.
Then you could say that a COLLECT is either all-or-nothing.
 
1:54 AM
It could still get messy going that route though.
 
Maybe. But thinking outside the box via codereview/etc. might get people thinking of what a cleaner solution would look like. COLLECT is new in PARSE and hasn't had a lot of review.
 
Trying to see what it might look like if I were to implement it without COLLECT/KEEP: gist.github.com/rgchris/4159dd40eb2eda76e2ae
Perhaps a bit long for RebolBot, but it returns the desired [a b c].
 
@rgchris Still using tabs? :-)
Tabs are evil!
 
For now...
Still using Rebol 2 as well, old habits die hard...
 
When looking at the "side-effects and then undo" I wonder what parsec would be like on such problems.
Wish I had more time to devote to Haskell, but I don't think that's something I was meant to contribute to in this lifetime.
 
2:11 AM
I was thinking about this from the point of view of parsing source code (got my ticket reopened, yay!). Would make tokenisation really easy...
red> word1: charset [#"a" - #"z"]
word+: union word1 charset [#"0" - #"9"]
space: charset " "

parse "a few words" [
    collect [
        some [
            space | keep ('word) keep [word1 any word+]
        ]
    ]
]
 
; Brought to you by: try.rebol.nl
== [word #"a" word "few" word "words"]
 
Hmmm. If it matched one character you get a character, but many a string?
 
Yes, didn't expect that.
 
@redbot
parse "a" [collect ["a" keep (1 + 2)]]
 
; Brought to you by: try.rebol.nl
== [3]
 
2:15 AM
There was, at least in the past, resistance to letting you do that sort of thing.
The idea that PARSE did not use the results of parens to fulfill "rule slots"
I've come to believe now that every directory in a complex software project needs--at minimum--a README.md to explain why that directory is there and what should or should not be in it.
GitHub is lending a hand here by showing that README in markdown format when you browse into the directory. Might as well take advantage of it.
@rgchris Any ideas on my question above about what a PARSE rule that hits an OBJECT! might do? PAREN! does something interesting besides match the paren via equality, which you could do with LIT prn. BLOCK! does something interesting besides match the block via equality, which you could do with LIT blk. Now, OBJECT!...
obj: [foo: ... bar: ...]
parse "some string" [blah blah obj blah blah]
How could that be "interesting"?
 
Oh, you mean object! as an element of the rule?
 
Yup.
 
Hm. It certainly could be interesting!
 
It could do some kind of dispatch. parse [foo bar] [obj obj] for instance, might look up the word it finds as a key and "do something"
But I was attacking it first by wondering if it could have meaning on strings or binaries
 
Indeed.
 
2:30 AM
I will split interesting-idea-of-the-day with @memophenon for backslash as expression barrier / unset! literal... maybe cut you in a little too for KEEP rollback... :-)
 
Just 'cause it came up earlier: dot-word: make object! [type: word! conforms-to: ["." to end]] parse [.word] [dot-word]
(a spitball-level attempt)
 
Got to start somewhere. No wrong answers when you're starting from "error!"
But I feel like MAP! and/or OBJECT! should probably focus on key lookup, likely word-based
a sort of way of doing a SWITCH statement, where obj: [foo: [...rule1...] bar: [...rule2...]] would dispatch to the rule to process what follows
With object literals you could get them in there directly.
 
It opens up a lot of possibilities, for sure...
 
It would be nice to have a "default" though.
But we've discussed spec blocks for objects.
foo: object [default: 304] [a: 10 b: 20] => foo/c => 304
And if it were actually a map, you could do a sort of character dispatch table or similar.
Or with binary!, a byte (multi-byte via binary! keys?) dispatch table
Hard to say when you try to move more than one unit at a time, though. How would string matching know what to do with "a" and "aa" keys? when matching across "aaaa"? Who'd win if there's no ordering?
 
2:48 AM
Longest match?
 
There's no efficient way to do that test
"aa" and "a" could hash completely differently
So you can't even get a fast narrow candidate set of "all matches starting with 'a'"
This seems to rule out series keys altogether. (Unless something were to fundamentally change)
Rebol isn't C++, it doesn't have unordered_map vs. map. for instance.
And even if it did have the ordered variant, you don't want parse to have to walk the keylist in O(n) time to do your comparisons.
With the comparisons themselves being O(length(key)).
Doesn't mean the idea isn't interesting, it just means that if you want an ordered series of tests you'll have to stick to vertical pipe
 
3:39 AM
https://github.com/red/red/pull/1121
GitHub
Red Pull Req—FEAT: using hashtable to search symbols
qtxie
1430084175
 
 
7 hours later…
 
1 hour later…
11:46 AM
Hmmm...I think the first feature I will add is ICMP protocol support, so shadwolf will come back and use Rebol3.
 
12:02 PM
Is Shadwolf still out there .... somewhere? :-)
 
12:15 PM
@pekr His last post via googling shadwolf rebol on Google is on a Swift (and Taylor Swift) post on that French forum: digicamsoft.com/cgi-bin/…
 
12:27 PM
@kealist So how's the Amiga build going? :-)
I think what we need for that is to be able to run it in an emulator.
I couldn't get an emulator to even start up, I didn't have the right combination of files.
 
@HostileFork Well, I sort of stopped when I saw the only build for rebol 3 was for OS 4 PPC
AFAIK there is no emulator for PPC Amiga OS
I assume r3-make will not run (using Rebol 2.5 instead)
 
Hard to say
 
I'll play around a little more
 
One might try and patch it until it does. I know for instance that it avoids use of new-defined FUNCTION it at least works for that; you can use pre-open source r3 to bootstrap
 
My dad found is SAS C compiler for Amiga, but it's on floppies and probably not an easy way to get it to ADF without piracy or buying expensive hardware
 
12:56 PM
@kealist $9.95 for USB to RS-232 adapter... can Rebol2 on amiga speak serial?
Hum, the adapters tend to be "male" as are the amiga's ports. Wonder why.
I guess the peripherals tended to be "female" and the intention is you'd adapt to a peripheral not to the host
It doesn't have to be Amiga, could also try something like AROS?
AROS Research Operating System (AROS - pronounced "AR-OS") is a free and open source multi media centric implementation of the AmigaOS 3.1 APIs. Designed to be portable and flexible, ports are currently available for x86-based and PowerPC-based PCs in native and hosted flavors, with other architectures in development. AROS, in a show of full circle, was also ported to the m68k-based Amiga 1200. == Name and Identity == AROS originally stood for Amiga Research Operating System, but to avoid any trademark issues with the Amiga name, it was changed to the recursive acronym AROS Research Operating...
Point is to pick something non-Linux, non-Windows, non-OSX, non-Android, non-iPhone. Something old. A compass point to say that dependencies haven't "gotten out of hand"
We've got HaikuOS, there's one.
But why not a few more?
 
1:51 PM
Is R3 build for Haiku avaiable? I remember that some folks there did not welcome Rebol much. Especially one idiot from OSNews, who hated it because of Kaj/Syllable ...
 
@pekr Should be available, but hasn't been built by me since things like the FUNCTION renaming...so unless someone else built it, the version up on rebolsource is old
Haiku seems to have slowed to a crawl, themselves. I don't know what the leading "unknown" OS is... people talk sometimes about KolibriOS
 
Hmm, interesting. I read something about Haiku, there was some heated discussion, as some members tried some alternative aproach to mak to Linux kernel or something like that. But not sure, it was xy months ago ....
 
It's not good to have absolutely everything be Linux based
Sort of chokes innovation or thinking about a fresh sheet or perspective...all groupthink
 
2:06 PM
btw - here's the osnews related haiku discussion - osnews.com/comments/28032
 
People sure can spend a lot more time talking than coding :-)
 
 
5 hours later…
7:05 PM
Yep Haiku the other project never to get anywhere ;-)
https://www.youtube.com/watch?v=_D9nnCc0jlA
 
7:31 PM
@HostileFork The addition of /AFTER to WHILE has made me more demanding. I have six cases now, and only three of them can be implemented in an elegant way so far. Suppose C is a condition, and A and B are pieces of code that yield some value. I'll present the cases in the format execution => returned value.
Case 1: A any (B A) => value of A. Not implemented.
Case 2: A any (B A) => none | value of B. Implemented by while [A C] [B].
Case 3: some (B A) => value of A. Implemented by while/after [C] [B A].
Case 4: some (B A) => value of B. Implemented by while/after [A C] [B].
Case 5: A some (B A) => value of A. Not implemented.
Case 6: A some (B A) => value of B. Not implemented.
I'm not sure whether cases 5 and 6 are useful. But implementation of case 1 would make me happier. A tiny bit.
I tried while/also [C] [B] [A] for case 1, but don't really like it.
It would automatically implement case 5: while/after/also [C] [B] [A].
 
 
1 hour later…
9:10 PM
@Memophenon Hmmm... interesting study
The goal being to avoid needing to repeat the code more than once or put it in a variable, or use flags to tweak the control structure, as the goal for /AFTER was
 
9:45 PM
@pekr Yup, Haiku build of R3 (from mainline rebol/rebol sources) is available on rebolsource.net.
 
 
2 hours later…
11:59 PM
@Memophenon Seeking symmetries is desirable. But @earl raised a point when I was trying to get a "single-arity-while" that would take one block and keep looping over it while it was TRUE? and stop when it wasn't. I was trying to imagine how it could return a meaningful value that wasn't always false or none, such as by (perhaps?) returning the evaluation result of the block from the last successful run.
 

« first day (1639 days earlier)      last day (2141 days later) »