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

Problem: with-node-name feels too verbose #300

Open
sjmackenzie opened this issue Aug 23, 2018 · 1 comment
Open

Problem: with-node-name feels too verbose #300

sjmackenzie opened this issue Aug 23, 2018 · 1 comment

Comments

@sjmackenzie
Copy link
Member

sjmackenzie commented Aug 23, 2018

To demonstrate the problem, this is what we had/still have:

  (node "new-password" ${gui.text-field})
  (edge "new-password" "out" _ "change-controls" "place" 10)
  (mesg "new-password" "in" '(init . ((label . "New password")
                                      (style . (single password)))))

notice how "new-password" is repeated many times. So this approach was developed:

  (with-node-name "new-password" (node ${gui.text-field})
                  (edge "out" "change-controls" "place" #:selection 10)
                  (mesg "in" '(init . ((label . "New password")
                                       (style . (single password))))))

It makes sense to use the word with-node instead of with-node-name.
though with-node seems clunky when sitting side-by-side (node ...) i.e.:

(with-node-name "node-name" (node {$blah}))

It would seem it's more reasonable to do this:

(with-node "new-password" ${gui.text-field}
  (edge  "new-password" "out" _ "change-controls" "place" 10)

In the case a node has already been introduced then omit the ${...}. i.e.:

(node "new-password" ${gui.text-field})

(with-node "new-password" 
  (edge  "new-password" "out" _ "change-controls" "place" 10)
@clacke
Copy link
Member

clacke commented Aug 23, 2018

Yes, this is a good way to do 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

2 participants