Arc Forumnew | comments | leaders | submitlogin
2 points by aw 5516 days ago | link | parent

Though with Arc's "string" and "int" already available, my function could be written as:

  (def read-bytes ()
    (let n (int (readline))
      (string (map [coerce _ 'char] (n-of n (readb))))))
and with an analogous "char":

  (def char (x)
    (coerce x 'char))
my function is even shorter:

  (def read-bytes ()
    (let n (int (readline))
      (string (map char (n-of n (readb))))))
so perhaps I don't need "as" if I learn to use Arc's derived conversion functions :-)