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

Multi-setter example in the tutorial #417

Open
g-leech opened this issue Jul 15, 2018 · 2 comments
Open

Multi-setter example in the tutorial #417

g-leech opened this issue Jul 15, 2018 · 2 comments

Comments

@g-leech
Copy link

g-leech commented Jul 15, 2018

In the section "Defining Objects with the do() method", the code snippet fails when pasting into Terminal (Ubuntu 17.04, bash 4.4.19), resulting in only name and setName being defined:

Contact := Object clone do( 
  name ::= nil 
  address ::= nil 
  city ::= nil 
  fullAddress := method(list(name, address, city) join("\n")) 
)

This is because of the bare value nil (the same failure occurs for bare integer values). This works though:

Contact := Object clone do( 
  (name ::= nil) 
  (address ::= nil)
  (city ::= nil)
  ( fullAddress := method(list(name, address, city) join("\n")) )
)
@stevedekorte
Copy link
Member

Thanks for the bug report. I think that may be a terminal issue. Does it work in a file?

@g-leech
Copy link
Author

g-leech commented Jul 16, 2018

You're right, it works from a file.

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