Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow #ParsedHashDirectives to have argument types other than strings #17240

Closed
KevinRansom opened this issue May 24, 2024 · 1 comment
Closed

Comments

@KevinRansom
Copy link
Member

ParsedHashDirectives can currently only have string arguments.

This means that the syntax for HashDirectives is constrained to having quoted string arguments.

This makes some of the Hash directive syntax a little clunky.

#time "on"
(* Do lots of stuff here *)
#time "off"

probably would be nicer and perhaps easier to get right first time like this

#time on
(* Do lots of stuff here *)
#time off

Similarly no warn requires numeric error numbers to be integers:

#nowarn "1234" "1235" "99"

Is probably better expressed as:

#nowarn 1234 1235 99
@abelbraaksma
Copy link
Contributor

abelbraaksma commented May 24, 2024

Hey @KevinRansom, since this is technically a language syntax change (and a welcome one at that), perhaps this should better go through the fslang-suggestions, don't you agree? It appears you already opened and then closed an issue there (see fsharp/fslang-suggestions#1364).

Even if it's a slam dunk and trivial to implement, that way we won't miss it while working on the new F# spec documents, and it gets the proper exposure.

I don't mind creating a quick RFC for this (assuming it'll be approved).

EDIT: I've created a lang suggestion, see: fsharp/fslang-suggestions#1368

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants