« first day (2792 days earlier)      last day (988 days later) » 

12:01 AM
But I'm going to say from the look of it I don't know really how much that saves for the complexity it adds. Keeping the operations simple may be best. I'll gather some metrics. Yet at a source level, I think writing uppercase copy if that is what you mean is probably for the best. There's no need to systemize uppercase+ or anything like that in the core, or add a /COPY refinement to every mutating operation.
 
 
1 hour later…
1:30 AM
posted on June 23, 2018 by @hostilefork Brian Dickens

@hostilefork wrote: In R3-Alpha, an /INTO option was added to REDUCE and COMPOSE. It blended the functionality of INSERT into these routines, so as to avoid the overhead of creating an intermediate series that would just be thrown away: >> data: copy [a b c] >> insert data reduce [10 + 20 30 + 40] >> data [30 70 a b c] >> data:

 
 
8 hours later…
9:09 AM
Slight sidebar, but hopefully of interest, might we look to a future in which append out compose [port-id: (to integer! s2)] could instead be written twice append out 'port-id: to-integer s2?
Don't mind the lit-set-word for the moment, that's a solved problem. I'm more curious about the twice, vis-a-vis whether it can be written at all, or at all efficiently.
Or also, I guess, whether it is even a good idea ... :)
 
@MarkI What in the original statement is being done twice? It is actually becoming possible-ish to say MAKE FRAME! of a variadic, which basically specializes it at that position. This is how does all [...] or similar work. One could imagine a "twice" that did the same, make a FRAME! out of the expression after it, and did a DO on that frame twice.
It would only evaluate the arguments for that ad-hoc specialization once, though. If you want to evaluate arguments multiple times, you need a block.
    >> x: 10
    >> d: does add x 20
    >> d
    == 30
    >> x: 100
    >> d
    == 30

    >> x: 10
    >> d: does [add x 20]
    >> d
    == 30
    >> x: 100
    >> d
    == 130
Oh, you meant twice append. I see. Well, yes, roughly you can do that with variadic injection like how ME and MY work
It's a bit of a hack at the moment to ask "DO/NEXT the variadic but let me stick something in there at the head", and you're saying you'd want to take the APPEND and then twice DO/NEXT whatever comes next with the variadic at the head. The mechanism that does this is reusing the argument preloading of enfix.
I could (probably) make such a TWICE relatively easily as a native but the mechanism isn't well-polished for userspace.
 
9:46 AM
@MarkI I can understand why twice print "Hi" "Mark" would print twice, but specialization-wise what would make the TWICE APPEND example you gave know that you wanted to specify "series" once (as out) but wanted to specify "value" twice? Perhaps you could use a BLOCK! if you had a preface. twice [append out] quote port-id: to-integer s2
That's actually a fairly wacky idea. MAKE FRAME! on a BLOCK! doing partial specialization, and accepting that as far as the block got is as many arguments as you wanted to specialize. :-/
 
 
6 hours later…
4:17 PM
posted on June 23, 2018 by lepinekong

[Reddit] There are subtleties in Red you'd better know, I got a lot of headache with this one so I created this code snippet for myself first as I have a bad rotten memory :) but if others need it also, you're welcome.

 

« first day (2792 days earlier)      last day (988 days later) »