Skip to content

Instantly share code, notes, and snippets.

@pmurias
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmurias/46e8a79a1e1d47822dda to your computer and use it in GitHub Desktop.
Save pmurias/46e8a79a1e1d47822dda to your computer and use it in GitHub Desktop.

List of stuff we want to be able to do with macros/slangs.

  • Something like the Smart::Comments perl5 module https://metacpan.org/pod/Smart::Comments#SYNOPSIS

  • A test module that has smart test failure messages

     ok($foo eq 'foo') 
    

    should behave like

     is($foo eq 'foo');
    
  • A LOG macro that gets optimized out in production

    Assuming we have a LOG function defined as such:

     constant LOGGING = False;
     sub LOG($message) {
         if LOGGING {
             $*ERR.say: $message;
         }
     }
     LOG "The value is: {hard‐to‐compute()}";
    

    We want to be able to define a version of LOG that won't call hard‐to‐compute when logging is disabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment