News for hackers. Stuff that matters.
Re:The Egison Programming Language by egi on Friday July 13, 2018 @07:08PM (#17527622)
Thank you for your comment!

The power of Egison's pattern matching becomes more obvious when we consider more general pattern such as (p, p+ 100) not only (p, p+2).

We can write the first 5 prime pairs whose form is (p, p+100) with a small modification for pattern matching for twin primes.

  (take 5
       (match-all primes (list integer)
         [<join _ <cons $p <join _ <cons ,(+ p 100) _>>>>
          [p (+ p 100)]]))
  ;=>{[3 103] [7 107] [13 113] [31 131] [37 137]}
Re:The Egison Programming Language by nerdponx on Friday July 13, 2018 @07:19PM (#17527664)
I still don't see how this should require nested cons-es and 3 different types of enclosing braces.

Not only that, but you have redundancy between the ,(+ p n) part of the pattern and the emitted result of [p (+ p n)].

Point being: I applaud the attempt here, but it's not something I'll ever want to use.

Re:The Egison Programming Language by sp332 on Saturday July 14, 2018 @01:02PM (#17531131)
I guess I had just lost the context. It's pretty cool as a pattern-matching demo.