Skip to content

Remove numeric literal suffixes#97

Closed
bentsherman wants to merge 1 commit intomainfrom
simplify-numeric-literals
Closed

Remove numeric literal suffixes#97
bentsherman wants to merge 1 commit intomainfrom
simplify-numeric-literals

Conversation

@bentsherman
Copy link
Member

Remove literal suffixes like 7d, 7f, 7L, since they are not needed in Nextflow and can lead to syntax ambiguities (e.g. 7d versus 7.d)

Signed-off-by: Ben Sherman <bentshermann@gmail.com>
@pditommaso
Copy link
Member

I'm not sure about introducing such slight variation in the lang, this let to sub-dialect with minor, annoying incompatibilities across java, groovy and different nextflow versions

@pditommaso
Copy link
Member

In the specific case likely a better solution would be a type linter or checker to avoid a number is assigned to time/duration field

@bentsherman
Copy link
Member Author

Type checking won't really help here because a duration field can be initialized from a number, string, or duration literal.

As for syntax changes, I agree in general about not changing things that don't need to be changed. That's why I left the numeric syntax unchanged. But if some syntax is never used in Nextflow and creates foot-guns, I think it's fair to remove. Especially right now when we are refining the Nextflow language spec.

@bentsherman
Copy link
Member Author

The d suffix is also part of Java, which makes me less comfortable removing it. We can come up with a linter rule to catch this issue if needed

@bentsherman bentsherman deleted the simplify-numeric-literals branch February 21, 2025 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants