On Mon, May 17, 2021 at 5:16 PM Mike Schinkel <m...@newclarity.net> wrote:
> > > On May 17, 2021, at 10:50 AM, Guilliam Xavier <guilliam.xav...@gmail.com> > wrote: > > > > On Mon, May 17, 2021 at 6:58 AM Mike Schinkel <m...@newclarity.net> wrote: > >> > >> > Well, I was thinking that by changing the proposed syntax we could >> achieve >> > what is proposed and a little bit more. >> > Also we wouldn't need to worry about the number of ? needed as >> arguments. >> > Since all we need is to mark the return type as partial (closure) on the >> > fly and grab hold of what is passed as arguments. >> > >> > There are some different syntaxes that come to my mind: >> > We could still use ? but outside of the arguments list? >> > ``` >> > $partial = xyx?(..); >> > $partial = ?xyx(..); >> > ``` >> > or maybe different symbols: >> > ``` >> > $partial = :xyz(..); >> > ``` >> > >> > We might be able to even cast the return type: >> > ``` >> > $partial = (?) xyz(..); >> > $partial = (partial) xyz(..); >> > $partial = (fn) xyz(..); >> > ``` >> >> Casting is another interesting approach that does feel more consistent >> with the existing language. >> >> Since it *is* creating a closure, wouldn't this make the most sense? >> >> $partial = (closure) abc(); >> > > Ouch! definitely NOT! > > >> $partial = (closure) xyz(?,24); > > > > Mind if I ask for you to elaborate on your aversion? > > Asking for general understanding, not to debate the point. > > -Mike > Sorry I was too "raw". I mean that the cast syntax `$p = (whatever) f();` already very clearly means/does "evaluate f() [i.e. call it], then convert the evaluation result to whatever, then assign the conversion result to $p", and I think it would be a **very bad idea** to "reuse" the same syntax for something that wouldn't call f() immediately. I'm favorable to other syntaxes, but which don't look like a cast. Regards, -- Guilliam Xavier