Skip to content
This repository was archived by the owner on Sep 20, 2025. It is now read-only.
This repository was archived by the owner on Sep 20, 2025. It is now read-only.

Discuss how to approach macro-heavy libraries #276

@wende

Description

@wende

In Elixir a lot of libraries rely on macros and while these used inside functions can be easily mimicked and wrapped, when it comes to those as top scope definitions (right inside modules f.i) it starts to become quite unwieldy

One of the simplest examples is how to write a test. Let's say we've got a standard ExUnit.Case macro.

defmodule MyTest do
  use ExUnit.Case

  test "I want to test something" do 
    assert 1 == 1
  end
end

Right now there is no way to express that in Elchemy.
And while it is possible to do some tricks like

module MyTest do

{- ex 
  use ExUnit.Case
  test "my_test" do
     assert execute_test()
  end
-}

executeTest : Bool
executeTest = 
  1 == 1

end

While this is correct code that would work i'd say it's quite far from what we would call an elegant solution.
This issue's purpose is to discuss all the possibilities and come out with something most that solves most problems without causing too much over-complication

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions