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 for doc strings in chuck-defined classes #233

Open
nshaheed opened this issue Oct 12, 2022 · 0 comments
Open

Allow for doc strings in chuck-defined classes #233

nshaheed opened this issue Oct 12, 2022 · 0 comments

Comments

@nshaheed
Copy link
Contributor

I think it would be useful to allow for doc string in classes made with chuck so that .help()'s features are consistent.

I'm not sure how this would look, but one option is to have python-style doc strings that are defined at the top of a class and class methods like this:

class Foo {
  """ This is the class doc string """;

  fun void Bar {
    """ This is the function doc string """;
  }
}

Something like this fairly simple and would be understood by people coming from python, but it doesn't seem very idiomatic with chuck.

Another options could be to add a doc function to this which would contextually supply a docstring to the class or function, like this:

class Foo {
  this.doc("This is the class doc string");

  fun void Bar {
    this.doc("This is the function doc string";
  }
}

However, this would require contextually different behaviors with this.doc which is kind of awkward and prone to confusion.

I don't think either of these ways would be the right approach for this, but they're a couple of ideas to get the ball rolling

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

No branches or pull requests

1 participant