~hauleth

https://hauleth.dev

~hauleth/bare-erlang-devel

Last active 3 months ago

~hauleth/public-inbox

Last active 3 months ago
View more

Recent activity

Re: cond-like macro a month ago

From Łukasz Niemier to ~technomancy/fennel

> unless I misunderstood you, `if` should be enough here, no?
> 
> (if check1 action1
>    check2 action 2)

I must have missed that syntax in the docs. Sorry for bother.

--

Łukasz Niemier
lukasz@niemier.pl

cond-like macro a month ago

From Łukasz Niemier to ~technomancy/fennel

Sometimes I need to change some conditions and **I know** that only one will be true. It would be handy to have built-in macro that would allow something like

    (cond
      check1 action1
      check2 action2)

Right now the only way to achieve something similar from what I see is to do

    (match true
      (_ ? check1) action1
      (_ ? check2) action2)

Does anyone have macro that would achieve something like that? Maybe it would be useful to have such functionality built in.