Skip to content

[enh] Abbreviating macro names #10

Description

@Technologicat

On some occasions it would be useful to abbreviate macro names.

Particularly ast_literal is a rather long name, and if a short quasiquoted expression includes several of them, this can make the structure of the expression difficult to see.

Example from the cond macro in unpythonic (example, implementation):

return hq[ast_literal[then] if ast_literal[test] else ast_literal[_cond(more)]]

This would read better as:

a = abbrev[ast_literal]
return hq[a[then] if a[test] else a[_cond(more)]]

if there was an abbrev macro.

[edit: fix link]
[edit2: fix doc link]

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions