Re: significance of newline in io?
Steve Dekorte <[email protected]>
| Newsgroups | gmane.comp.lang.io |
|---|---|
| Message-ID | <[email protected]> |
A newline in Io is like a semicolon in C - it ends the expression and returns the evaluation scope to the locals. On Aug 7, 2011, at 8:05 PM, Paul Sanwald <[email protected]> wrote: > > > working through "7 languages in 7 weeks", I noticed something interesting. This method definition me an error when invoking: > Object ancestors := method( > prototype := self proto > if (prototype != Object, > writeln("Slots of ",prototype type,"\n-------") > prototype slotNames foreach(slotName, writeln(slotName)) > writeln prototype ancestors)) > > Whereas, this definition does not: > > Object ancestors := method( > prototype := self proto > if (prototype != Object, > writeln("Slots of ",prototype type,"\n-------") > prototype slotNames foreach(slotName, writeln(slotName)) > writeln > prototype ancestors)) > > the only difference here is the newline after "writeln". what is the significance of the newline in the language? am I missing something in the docs? > > thanks for your help! > > --paul > > >