clarity-lang / reference

The Clarity Reference
146 stars 34 forks source link

Alias `int-to-<ascii-or-utf8>` to `uint-to-<ascii-or-utf8>` #61

Open hugocaillard opened 1 year ago

hugocaillard commented 1 year ago

The native functions int-to-ascii and int-to-utf8 take one argument that can be an int or uint. Which is rare in Clarity, that is usually picky with types. Because of that, this function can look off at first glance:

(define-private (func (a uint))
  (int-to-ascii a)
)

A clarity developer might try to type uint-to.. but the auto-completion wouldn't be triggered, hence the suggestion add 2 aliases:

LNow commented 1 year ago

https://github.com/stacksgov/sips/pull/95#discussion_r1007250362

hugocaillard commented 1 year ago

Ah! Thanks for referencing it @LNow. Looks like the conversation did not come to a conclusion at that time 🤔

LNow commented 1 year ago

The conclusion for me was simple - no clarity in Clarity :grimacing: