Arc Forumnew | comments | leaders | submit | chaos's commentslogin
2 points by chaos 6276 days ago | link | parent | on: Comparison operator inconsistencies

    (type 2.0) -> int
Choosing the best possible type for numbers is imho a good thing. And it's (probably) taken directly from mzscheme.

    (type 2.1) -> num
    (integer? 2.0) -> #t

-----

7 points by chaos 6276 days ago | link | parent | on: Regular expressions

patch for ac.scm:

    1089a1090,1094
    > (xdef 'regexp regexp)
    > (xdef 'r-match regexp-match)
    > (xdef 'r-match-pos regexp-match-positions)
    > (xdef 'r-replace regexp-replace)
    > 

    arc> (= r (regexp "(-[0-9]*)+"))
    #rx"(-[0-9]*)+"
    arc> (r-match r "a-12--345b")     
    ("-12--345" "-345")
Just add what you need.

-----

1 point by chaos 6276 days ago | link | parent | on: Questions on Arc's type system

From arc.arc:

   1475 ; Lower priority ideas
   [...]
   1490 ; idea: get rid of strings and just use symbols
   1491 ; could a string be (#\a #\b . "") ?

-----

3 points by chaos 6277 days ago | link | parent | on: Show us your Arc code

Because I'm reddit-damaged:

    (def unfold (f x)
      (let res (f x)
        (if res
            (cons (car res) (unfold f (cdr res)))
            ())))

    (def romanize (i)
      (let r '((M 1000)(CM 900)(D 500)(CD 400)(C 100)(L 50)(XL 40)(X 10)(IX 9)(V 5)(IV 4)(I 1))
        (unfold 
         (fn ((i . ((r n) . rst)))
             (if (is i 0)
                   ()
                 (>= i n)
                   (cons r (cons (- i n) `((,r ,n) . ,rst)))
                   (cons "" (cons i rst))))
         (cons i r))))
    (apply string (romanize 999))

-----

4 points by chaos 6278 days ago | link | parent | on: Welcome

blog.arc seems to work with v360. :)

-----

2 points by bootload 6278 days ago | link

"... blog.arc seems to work with v360. :) ..."

Same here on a ubuntu 7.10 gutsy 64amd. There's no (easy) way to do an install for v352 w/o doing a source compile (works) and manually installing the files (can't be stuffed).

-----