« first day (3566 days earlier)      last day (214 days later) » 

12:39 AM
    g: generator [yield 1 yield 2 yield 3]
    c: chain [:g | func [x [<opt> any-value!]] [if x [x + 10]]]
    did all [
        c = 11
        c = 12
        c = 13
        c = null
        c = null
    ]
Well, I did something today. Fixed the CHAIN issue with generators. There's probably a better way of fixing it, depends on some changes that might affect tasks.
2
 
 
7 hours later…
7:25 AM
There's still loose ends in the UTF-8 Everywhere work that have to be tied up. :-( It's working for the most part, but there are still ways to do things like generate corrupt strings though binary aliases...because not every binary modification routine is going through the checked paths. Working on one of those now, can get pretty fiddly.
But I do think it's a pretty good anchor. You'll note in the Red lexer they still have to convert their fixed-size buffers into UTF-8 to scan it. I think the long tail is that these decodes and string widenings are things to be avoided in most cases; and as I've argued the cases where you want to do something more elaborately algorithmic you probably would like each "cell" in your string to be able to be more than a codepoint.
So I'll re-suggest that idea that make block! "abc" => [#"a" #"b" #"c"]. If you have a crazy string algorithm that needs to operate on fixed-sized objects it's a little more costly, but that algorithm probably can do more optimization with more options per cell.
 
8:10 AM
    (
        str: "Tæke Pært"
        bin: as binary! str
        true
    )

    ('bad-utf8-bin-edit = pick trap [take/part bin 2] 'id)
    (str = {Tæke Pært})

    ((as binary! "Tæ") = take/part bin 3)
    ((probe str) = "ke Pært")

    ('bad-utf8-bin-edit = pick trap [take/part bin 5] 'id)
    (str = "ke Pært")

    ((as binary! "ke Pæ") = take/part bin 6)
    (str = "rt")
^-- these are the kinds of things I'm talking about. Tough to get right. Would help if there were more vigorous tests...but...it's the thought that counts, right? In any case, what's there shows that it's viable--even if it isn't yet bulletproof.
 
@HostileForksaysdonttrustSE Works! Now to find how to get this from the VM into the rEAL WORLD.
 
What you see there is that since the æ encodes as two UTF-8 bytes, it's not letting you break that up in a TAKE operation when you alias it as a binary as half-a-codepoint. Quite a nuisance.
@iArnold Or just a different virtual world. Well, good luck I guess.
 
Thank you!
 
 
5 hours later…
 
10 hours later…
11:11 PM
One level at which Ren-C has been a true success is as a prototyping breadboard for Rebol features. Which is what it set out to be. There's a certain strong foundation in how the various layers were shored up to enable rapid experimentation "with confidence".
 
11:34 PM
>> for-each: func ['var data body <local> i] [
    bind body i: iterates/vars data var
    while [i] body
]

>> for-each x [1 2 3] [print [x]]
1
2
3

>> for-each [x y] [1 2 3] [print [x y]]
1 2
3
I could make that about as fast as I could think of it. But what happens is, then you get to the "deeper" questions...like how can this ITERATES be able to take a safe hold on something that can change out from under it (a MAP!, for instance) and then release it in the event of errors/throws.
DEFER isn't terrible, but it means then you'd have to say:
>> for-each: func ['var data body <local> i] [
    bind body i: iterates/vars data var
    defer [free :i]
    while [i] body
]
And beyond saying it, you have to have a "destructor-like" knowledge that the action made by ITERATES needs to get a hook to handle its freeing, to release the locks.
GO went this route; they don't use constructors/destructors, they have you explicitly call cleanup functions and you just write "do this later" and it makes the cleanup. It's very much like what I proposed (before I saw it). It seems like an okay name for it (though it competes with "deferred enfix" which I was using defer for, but I could come up with another name for that)
 

« first day (3566 days earlier)      last day (214 days later) »