Skip to content

New data structure match

Compare
Choose a tag to compare
@WeirdConstructor WeirdConstructor released this 31 May 05:33
· 435 commits to master since this release

This release adds one of the last big building blocks of WLambda: The new match
operation. It's quite fast, faster than using an if cascade of course.
Aside from that the pairs got an interesting new a => b operator for
construction, which allows for syntactic sugar in some other places than just match.
The stack space is finally dynamically grown now too.

  • Incompatible Change: The nested parenthesis matching for quoted strings
    was a bad design because you can't properly quote strings
    with non matching parenthesis anymore - which is sometimes desired if a
    regex pattern or selector pattern is to be quoted.
  • Incompatible Change: a + b ~ c is no longer a + (b ~ c) but (a + b) ~ c
    to let iter i 0 => 10 ~ std:displayln i work properly.
  • Incompatible Change: Removed old match function and replaced it with a
    structure pattern match function, which is even faster than the match
    before.
  • Feature: Allowing to use if instead of ?.
  • Feature: iter $&&i ... syntax implemented, for creating new references
    for each iteration for easier closure generation.
  • Feature: Implemented pair operator a => b which does the same as $p(a, b).
  • Feature: $iter $p(0, 10) does now the same as $iter $i(0, 10), allowing
    nice composition with the pair operator: $iter 0 => 10.
  • Feature: Implemented argument function call operators a &> f and f <& a,
    so you can write regular expressions like ? "foo" &> $r/a*b/ { ... }
    without parenthesis.
  • Feature: Implementes structure patterns as complement to the selector patterns
    and regex patterns: $M _expr_.
  • Feature: Added a jump table operation jump idx branch-a branch-b branch-c
    as supporting operation for match.
  • Feature: Updates VIM syntax file vim/wlambda.vim.
  • Optimization: VVal size is down from 48 bytes to 32 bytes.
  • Optimization: VM Op size is down from 40 bytes to 24 bytes.
  • Bugfix: The stack size is no longer fixed and is dynamically grown if
    required.