Hacker News new | past | comments | ask | show | jobs | submit login

and Smalltalk would be:

  Object setSlot:"foo" to:12.
I have always liked Smalltalk's (via Objective-C) message syntax as it put the meaning of the function call slots where I am calling them. I hate what they've done in Swift however.

I have toyed with a scripting language that had:

  Object.[setSlot:"foo" to:12]
Still not sure on that. I immensely respect the creator of Io but it didn't click with me (my fault, not the language).



I think you misunderstand. The Smalltalk is this:

    exampleWithNumber: x
    "[ *wall-of-text elided* ]"
    | y |
    true & false not & (nil isNil) ifFalse: [self halt].
    y := self size + super size.
    #($a #a "a" 1 1.0)
        do: [ :each |
            Transcript show: (each class name);
                       show: ' '].
    ^x < y
I'm talking about an Io equivalent of the "Syntax In a Postcard" link provided above, partly reproduced here for convenience. What the code does isn't so important as how much of the syntax it covers.


Oh, sorry, yes, I got your meaning totally wrong.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: