Skip to content

unicode operators #552

Closed
Closed

Description

I think that infix functions would be nice. in haskell you can call +(1,3) (as in julia or lisp). You can write it infix 1 + 3, but you can also force infix f(a,b) ==a 'f' b. (actually not ', but rather +0060)
I would be really cool if certain range of unicode could be used infix aswell, so one could define , use it like ∈([1,2,3],[2,3,9,10]) lisp style, or more intuitive [1,2,3] ∈ [2,3,9,10].

define ≟(a,b)
    a==b
end

>1≟2
false

>2≟2
true

define ∈(a,b)
 #code
end

>1∈[1,3,4]
true

And maybe a infix "keyword" would be cool as well:

function foobar(x,y)
 #code
end

5 ⍚foobar "qwertz" would be the same as foobar(5,"qwertz")
functions with names that contain nothing but +-*/%!§$?<>=#~ and a certain unicode range would be infix by default and would not need that symbol.

A nice thing that could be done would be

function >>=(a,b)
  if b
    a(b)
  end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    speculativeWhether the change will be implemented is speculativeunicodeRelated to unicode characters and encodings

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions