You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by GitBox <gi...@apache.org> on 2021/02/17 00:39:37 UTC

[GitHub] [groovy] paulk-asert commented on pull request #1492: GROOVY-9946: Add `@ConstantString` to mark constant result of `toString`

paulk-asert commented on pull request #1492:
URL: https://github.com/apache/groovy/pull/1492#issuecomment-780211010


   I am thinking this could be generalised. If instead of having a very specific class annotation, we had a `@Pure` or `@Constant` annotation and place it on the `toString` method itself, then the annotation could be used in more places. `@Memoized` could annotate the methods it generates (giving the caching optimization for free on memoized `toString` methods) and future type checkers could ensure that the return value of "pure" methods only comes from expressions involving constants or other pure methods - kind of what Frege does.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org