Arc Forumnew | comments | leaders | submitlogin
Wart now handles list/string slices
3 points by akkartik 5081 days ago | 1 comment

  $ git clone http://github.com/akkartik/wart.git
  $ cd wart
  $ git checkout bb67ea6b51
  $ wart
  20 hunks added in last 10 commits

  wart> = l '(1 2 3)
  (1 2 3)
  wart> = l.1 4
  wart> l
  (1 4 3)
  wart> = (l 1 2) '(5 6)
  wart> l
  (1 5 6 3)
  wart> = (l 1 3) nil
  wart> l
  (1 3) ; delete

  wart> = s "abc"
  abc
  wart> = (s 1 2) "def"
  wart> s
  adefc
  wart> = (s 1 4) ""
  wart> s
  ac ; delete
Pauan first suggested this feature: http://arclanguage.org/item?id=14656

(Another thread: http://arclanguage.org/item?id=15074)

---

I ran into heavy weather building this over the last two days, because of a basic bug with unquote-splice: I was splicing in lists without first creating a copy:

http://github.com/akkartik/wart/compare/8c4e2a6bb3...19380f8ff8#diff-3



1 point by akkartik 5079 days ago | link

There was a big hole in slices: you couldn't delete at the start of a list because that involves rebinding the var. This is now fixed, after overhauling all of assignment support.

http://github.com/akkartik/wart/compare/eb581bedda...abb579c...

-----