Arc Forumnew | comments | leaders | submitlogin
1 point by akkartik 4219 days ago | link | parent

Yeah, I considered the issue of perl[1]. I might use =~, but I'll probably not use =~ for regex match if I use ~= for inequality. Different things should look different, and all that. The simple option would be to just use match like in javascript. But maybe something else will present itself. Maybe just define equality between regex and string as match?

  let r (regex "a.*")
    if ("abc" = r)
      ..
[1] See the commit message at http://github.com/akkartik/wart/commit/f0e3d726eb


2 points by Pauan 4219 days ago | link

I like that idea. You're testing whether the regexp is "equal to" the string. But I'd put the regexp first, like (r = "abc")

-----