hauleth, to random
@hauleth@fosstodon.org avatar

So I was nerdsniped by @PragTob to implement defconst for Elixir. It is a simple macro that looks like a function, but is evaluated at compile time to provide runtime constant.

https://github.com/hauleth/defconst

I have added defonce that will lazily evaluate code during first call as an icing on that cake.

Available on Hex as defconstant because of naming clash

https://hex.pm/packages/defconstant

#elixirstatus

hauleth, to random
@hauleth@fosstodon.org avatar

When writing ExUnit files always add @subject module attribute containing name of the module that you are testing. It allows you to automatically see what exactly is tested without keeping the context at the back of your head.

#elixirstatus #tip @erlang_discussions

  • All
  • Subscribed
  • Moderated
  • Favorites
  • provamag3
  • kavyap
  • DreamBathrooms
  • InstantRegret
  • magazineikmin
  • thenastyranch
  • ngwrru68w68
  • Youngstown
  • everett
  • slotface
  • rosin
  • ethstaker
  • Durango
  • GTA5RPClips
  • megavids
  • cubers
  • modclub
  • mdbf
  • khanakhh
  • vwfavf
  • osvaldo12
  • cisconetworking
  • tester
  • Leos
  • tacticalgear
  • anitta
  • normalnudes
  • JUstTest
  • All magazines