Menu

#100 b as a monadic function

0.6.5
wont-fix
nobody
None
2016-02-24
2016-02-18
No

Hi there,

It seems to me like I often when using the function b, that I want to use it base 10. Since there's no single-argument version, perhaps using b as a monadic operator could in effect do the same thing as Ab does now?

Discussion

  • aditsu

    aditsu - 2016-02-20

    What do you mean by "using b as a monadic operator"?

     
  • Andrew Simmons

    Andrew Simmons - 2016-02-22

    I mean it in the sense of APL and J use it, as a function with a single input.

     
  • aditsu

    aditsu - 2016-02-22

    Why are you assuming that I know APL or J? Anyway, in case you mean unary operator, then do you want to change its arity? Or have it work as both a binary and a unary operator? How would you distinguish the arity in the latter case?

     
  • Andrew Simmons

    Andrew Simmons - 2016-02-22

    I meant you could have it work as a binary and unary operator, and that's a very good point which I should have thought of before I posted this..

    I suppose you could have the following: if stack looks like

    [something that's not an integer] [array]

    then applying b would effectively implement Ab. But that seems very much like an edge case now.

     
  • aditsu

    aditsu - 2016-02-24
    • status: open --> wont-fix
     
  • aditsu

    aditsu - 2016-02-24

    Well, I don't think it's worth implementing it like that. It would only save 1 byte, in fairly rare cases, and it would make it weird and confusing (an operator that looks at a 2nd argument to decide whether to be unary or not).

     

Log in to post a comment.

MongoDB Logo MongoDB