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

accept multiple sets of inputs/output #29

Open
imarko opened this issue Aug 17, 2017 · 2 comments
Open

accept multiple sets of inputs/output #29

imarko opened this issue Aug 17, 2017 · 2 comments

Comments

@imarko
Copy link

imarko commented Aug 17, 2017

It would be neat if I could specify multiple sets of inputs and outputs and get suggestions that satisfy all of them. For example if I am looking for an expression to check if a string starts with a substring I could specify:

"f" "foo" => t
"f" "barf" => nil
"b" "bar" => t

@Wilfred
Copy link
Owner

Wilfred commented Aug 18, 2017

Yep, totally agreed: it'd be a really nice feature, especially for predicate functions.

Do you have any opinions on what the UI should look like? I'm not sure what would work best.

@Fuco1
Copy link

Fuco1 commented Nov 3, 2017

I quite like the syntax we use in dash docs:

(sexp) ;; => result

You can easily split on the comment token, then read the result as a regular sexp. It is pretty compact too. Maybe even get away with the comment and just use => token to separate input and output. After all, it is a valid lisp token so the parser wouldn't really complain about it.

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

No branches or pull requests

3 participants