Skip to content

Multi-setter example in the tutorial #417

@g-leech

Description

@g-leech

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")) )
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions