Skip to content

[SUGGESTION] GH Discussions #577

Closed
Closed
@jmafc

Description

@jmafc

This is not a suggestion regarding syntax or the tool itself. I just tried using cppfront on a program that used a standalone function with a default argument and got a message saying:

error: Cpp2 is currently exploring the path of not allowing default arguments - use overloading instead

It wasn't too difficult to add a second function that called the first with an extra fixed argument, but I was intrigued so I looked in the wiki and also searched the open issues for "default" or "default arg" and found nothing. I realize that this is your experiment and you're probably quite busy to be answering queries like explaining the rationale for the above, but I'd like to suggest that the project use GitHub Discussions to allow such questions to be posed. For this particular instance, you could alternatively have a documentation label until the grammar and its documentation are more settled down.

As an aside, although I understand that, based on your CPPcon 2022 talk, many design/syntax decisions are geared at not having to teach parts of C++ that are, shall we say, "undesired", the tradeoff is that many developers will have to "unlearn" practices that are not necessarily "bad", but --at least-- in the current state of Cpp2/cppfront-- add quite a bit of verbosity.

If you don't want to use GH Discussions, please go ahead and close the issue.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions