« first day (2037 days earlier)      last day (1743 days later) » 

1:01 AM
@GrahamChiu Right. That is what IE used to do and it was wrong.
 
 
3 hours later…
3:41 AM
I just posted my first attempt to use 8th to grab form variables, session cookie from a web page here github.com/gchiu/8th/blob/master/htmlforms.8th
We should use more higher order functions in rebol for iterating over series
 
 
3 hours later…
6:31 AM
@GrahamChiu Yes. I found that in code golf, while Rebmu is aggressive in a number of areas that are unique, languages with higher order functions composing will frequently demolish anything it can do without them.
Short announcement on this matter... soon. As soon as I can figure out a memory corruption bug in specialization of variadics.
 
7:07 AM
Function Changes on Rebol3 Porting Guide ("Ren-C" branch)
# Rebol2, R3-Alpha foo: function ['a [unset! integer!]] [ either unset? :a [ "special no-arg allowance" ][a] ] >> foo 10 10 >> do [foo] "...
 
 
1 hour later…
8:18 AM
Function Changes on Rebol3 Porting Guide ("Ren-C" branch)
# Rebol2/R3-Alpha >> type? :+ == op! >> foo: :+ >> 1 foo 2 3 # Red 0.6.0 >> foo: func [a b] [print [a b]] >> infix-foo: make op! :foo >> 1 infix-foo 2 1 2...
✍ 1 comment
 
 
2 hours later…
10:28 AM
@MarkI Interesting outcome of our discussions on voids, I think, is that while we have a few exceptions we know of where a function still has an effect (examples on the table being RETURN ()...it still returns... and SET/OPT 'x ()... it unsets) it should strongly be discouraged. I'd argue that the default framing of SET and UNSET as not accepting voids is important, e.g. there needs to be a way to get "the job done" without...
...but given this bias, it makes function specialization have a natural idea that empty variables in the frame mean "unspecialized", not "opt out".
That's much cleaner, but it points to the idea that you wouldn't be able to (for instance) specialize RETURN with a void, because that would be a RETURN with an unspecialized argument... e.g. normal return
Which makes a fairly strong case that functions need a definitional LEAVE by default, as you cannot specialize a return-void otherwise.
Good news is that I think it takes the informal suggestion previously made and amps it up. Do not give meaning to the taking of void arguments other than "don't have an effect". If you ever deem it worthy in a design to have an effect, be sure whatever that effect is can be accessed some other way.
e.g. the reason that it's "worthy" for RETURN to take a void and act as returning it is for chaining. It's a common pattern to want to wrap one function with another, and return whatever it returns. You don't want to have to change your wrapper if one day it returned an integer and the next a void. But you should have a "really worthy" idea like that to justify these passthroughs, knowing that <opt> and specialization won't mix.
Well, actually, hm, you can...since specialization is offering evals. So return-void: specialize :return [value: quote ()]. But that needs to be controllable with a refinement, e.g. a SPECIALIZE/ONLY that doesn't do that. (or a SPECIALIZE/COMPOSE required to ask for it.)
 
 
1 hour later…
11:54 AM
Function Changes on Rebol3 Porting Guide ("Ren-C" branch)
### Ren-C >> b: 10 >> reach-in: [a] -> [print a | b: 20 | print b] >> reach-in 30 30 20 >> print b 10 ;-- the -> was FUNCTION semantics >> reach-out: [a] <- [pr...
 
12:46 PM
lambda: function [args [<end> word! block!] :body [any-value! <...>] /only][
    f: either only :func :function
    f case [
        not set? 'args [[]]
        word? args [reduce [args]]
        'default [args]
    ] case [
        block? first body [take body]
        'default [make block! body]
    ]
]

set-infix '-> :lambda
set-infix '<- (specialize :lambda [only: true])
And that, folks, is all it is.
 
 
11 hours later…
11:41 PM
@giuliolunati If you look at the <end> feature, when that is used with infix it means that it can tell if the first argument is present or not. So a + b could be infix, while (+ 1 2 3 4 5) could be variadic and do a sum!
So similar to how help can tell if it has an argument or not, except instead of seeing there's nothing after it sees there's nothing before...
 
@HostileFork Is this implemented now :) ?
 
@GrahamChiu The <end> feature is implemented. I show the implementation for a similarly variadic lambda above. It would be about the same.
 
@HostileFork (+ 1 2 3 4 5) works?
 
    set/lookback '+ func [a [<end> any-value!] b [<...> any-value!]] [
        either set? 'a [add a take b] [
            accum: 0 | while [not tail? b] [accum: add accum take b]
        ]
    ]

    >> 10 + 20
    == 30

    >> (+ 10 20 30)
    == 60
@GrahamChiu ^--- yes, if you do that it does.
But it's doing exactly what it looks like, sensing nothing is before it and reacting accordingly. If you say (10 + 20 30 40) you will get the same thing you get today, which is 40.
But I'm experimenting with some more parts... e.g. 10 + <| + 20 30 40, as an alternative to 10 + (+ 20 30 40), say.
 
@HostileFork kewl
so not

+ ( 10 20 30 )
 
11:53 PM
Which doesn't necessarily look better in that case, but this is about having options, and each part doing something novel.
@GrahamChiu You could if you really thought it important to do so. You'd quote.
 set/lookback '+ func [a [<end> any-value!] :b [any-value!]] [
    either set? 'a [add a b] [
        accum: 0 | while [not tail? b] [accum: add accum first+ b]
    ]
]

>> 10 + 20
== 30

>> + (10 20 30)
== 60
 
looks very promising. May not be Rebol as Carl imagined it though, lol
 
It's possible to make "sniffers" which can quote or not with variadics, so it could quote and look and see it was a GROUP! and decide not to evaluate it, but use a non-quoted variadic alternative to proceed the evaluation otherwise. You have one lookahead unit.
Well Rebol is supposed to be freeform and dialected. What's the difference between saying my-processing-dialect [+ (10 20 30)] and having a somewhat stylized mechanism for hooking the evaluator?
 

« first day (2037 days earlier)      last day (1743 days later) »