Annotation of functions

psychoticRabbit meagain at meagain.com
Tue Feb 20 12:15:57 UTC 2018


I've noticed that Go and Rust annotate functions.

func (in go)
fn (in rust)

I was kind of wondering why they made that choice, given 
compilers in many languages do not.

Would this be a useful feature in D?

Everything else seems to have an annotation (e.g structs, 
classes.) So why not functions?

What are people's thoughts about it?

My first thought is to make it an optional annotation, for the 
benefit of developing source code analysis tools that can 'more 
easily' find functions in source code (i.e. The D compiler can 
just strip it off and do nothing with it.).  That way programmers 
that see no benefit in it, don't have to deal with it.



More information about the Digitalmars-d mailing list