Arc Forumnew | comments | leaders | submitlogin
3 points by akkartik 2134 days ago | link | parent

I'm skeptical. Are you doing coercions that often? That seems like bad practice. But if you share a little program or app, that may persuade me otherwise.

For coercions, I usually use the `as` alias:

    (as type expr)
rather than

    (coerce expr 'type)
I find it a lot more convenient because `type` is usually atomic while `expr` can be arbitrarily complex. It makes for a more readable result for the short arguments to come first.

In Anarki, `as` is more common than `coerce`, though we still do a lot of `coerce` that could probably stand to be cleaned up:

    $ grep '[:(]as\>' lib/*.arc |wc -l
    26
    $ grep '[:(]coerce\>' lib/*.arc |wc -l
    15


2 points by kinnard 2133 days ago | link

Touché.

-----