Arc Forumnew | comments | leaders | submitlogin
4 points by drcode 5679 days ago | link | parent

  arc> (= foo (obj a (obj x 1)))
  #hash((a . #hash((x . 1))))
  arc> (= ((foo 'a) 'x) 8)
  8 
  arc> (= (foo!a 'x) 7) 
  Error: "Can't invert  ((foo (quote a)) (quote x))"
I would argue that the fact that you can't just say foo!a!x is a borderline bug, as well.

Also, I wish this would work right:

  (map `[x _ z] '(1 2 3))
It should give the same result as (map [list 'x _ 'y] '(1 2 3))

Some primitive data types leak scheme internals when printed, such as hash tables- I would call this a bug.

Also, all datatypes should really be readable. For instance,

   (read (tostring (pr (obj a 1 b 2))))
should not give an error.

As an aside, if you haven't looked at the map/vector syntax in clojure you really should... The fact that you can write [1 2 (+ x 1)] to yield the same result as (list 1 2 (+ x 1)) or `(1 2 ,(+ x 1)) is very compact, clever and useful for writing succinct code.

(It'll create a vector not a list of course, but that's orthogonal to my point, since all clojure sequence functions can use these two interchangeably)



4 points by pg 5670 days ago | link

Looks like the first can be fixed thus:

    (def expand-metafn-call (f args)
      (if (is (car f) 'compose)
           ((afn (fs)
              (if (caris (car fs) 'compose)            ; nested compose
                   (self (join (cdr (car fs)) (cdr fs)))
                  (cdr fs)
                   (list (car fs) (self (cdr fs)))
                  (cons (car fs) args)))
            (cdr f))
          (is (car f) 'no)
           (err "Can't invert " (cons f args))
           (cons f args)))

-----

2 points by CatDancer 5678 days ago | link

Here's a patch against arc2 which implements reading and writing tables: http://catdancer.github.com/table-reader-writer.html

-----