How to not import `with` from Kernel so it can be redefined

@Crowdhailer Yes, exactly. All special forms have one or more properties that would make it impossible or undesirable to be implemented as a macro. For with, it accepts a variable number of arguments, which is a feature that is not available to any macro.

The term came from lisps, which also have special forms.

There is a very simple variation of this and not as invasive which is to prefix the with special form with a macro and that way you can emulate var args:

async with left <- right,
          foo <- bar do
  {left, foo}
end
2 Likes