Skip to content
This repository was archived by the owner on Nov 11, 2021. It is now read-only.
This repository was archived by the owner on Nov 11, 2021. It is now read-only.

macros are TOO safe #74

@drocha87

Description

@drocha87

Recently I was playing with a new keyword defined so we can check up front if a word is already defined, so we can for example avoid including a file twice or change the library behavior if some macro is already defined.

But for this happen I should have the ability to redefine a macro, something like this.

defined std.porth 0 = if
macro std.porth 1 end
...
end // defined std.porth

or

defined SOMETHING 0 = if   // if SOMETHING is not defined
    macro SOMETHING 69 end // define a default value in case of SOMETHING is undefined 
end

I don't know if this new keyword will be useful, but I think the ability to redefine a macro should be possible. What you guys think about it? Should macros behave like a constant expression?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions