On Tuesday, 10 March 2020 17:31:33 UTC, Jon Perryman wrote:
>
> If proposal https://github.com/golang/go/issues/37292 fails, everyone 
> will lose out on a great opportunity.
>

This is not a proposal, as it specifies neither the syntax nor the 
semantics.  I therefore down-voted on that basis alone.
 

>
> This compiler called function replaces the #gettext( ... ) as follows:
>
> #gettext(msgid="jon001", number, time)
>     would be replaced with
> gettext("jon001", nil, gettext.Number(number), gettext.TimeLocal(time) )
>
>
That looks like a macro.  But the issue says "Don't confuse this with C 
macro's nor code generators. Nor is this an alternative for functions."  
You've said what it isn't, but not what it is.

In the above example, what does the definition of the #gettext entity look 
like?

Is it run at compile time, and the *output* of the macro is Go source code 
or AST which is inserted at the call point?  In that case it's a code 
generator.

Or is it just an in-place substitution of one form with another, i.e. a 
templated substitution in the AST? (Macro)

I'd suggest the best way to take this forward would be:
1. Make an initial implementation as a front-end preprocessor to go
2. Let people review the resulting syntax and semantics in practice, when 
you can give concrete examples

You might find it integrates nicely with the go generate 
<https://blog.golang.org/generate> mechanism.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/6698d1ea-ec0a-4b28-9f94-66e9cf45d948%40googlegroups.com.

Reply via email to