coalton-lang / coalton

Coalton is an efficient, statically typed functional programming language that supercharges Common Lisp.
https://coalton-lang.github.io/
MIT License
1.15k stars 70 forks source link

Adds `as` macro #1170

Closed Izaakwltn closed 2 months ago

Izaakwltn commented 3 months ago

This adds the as macro, changing:

(the <type> (into <expr>))

into:

(as <type> <expr>)
stylewarning commented 3 months ago

Would like @eliaslfox to take a look. Obviously like other things this would be better as a bonafide language feature, but it's useful enough now that I think it warrants inclusion.

stylewarning commented 3 months ago

@macrologist We are doing this for many stdlib stuff now. It has its pros and cons.

stylewarning commented 3 months ago

@eliaslfox As a compromise, I will do a little more due diligence on existing code to determine how frequent the pattern occurs.