@shriramk this is how #seed7 does syntax declarations:

https://seed7.net/examples/for_decl.htm

Essentially it's a mechanism for generating overloaded function definitions.

Seed7 Example: Template declaring a statement

Seed7 - The extensible programming language

@genode ... which in turn inspired me to take a look at #Seed7 It's a very interesting project. Not in love with the syntax, I must say, but otherwise it seem pretty cool.
Seed7 Homepage

Seed7 - The extensible programming language

Seed7 Homepage

Seed7 - The extensible programming language

Installing and Using the Seed7 Programming Language in Ubuntu - Marc Stuff

Projects and Writings of Marc Carson.