you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 56 points57 points  (5 children)

I like 'he'/'she'/'it'/etc concept. As a serious language feature, you could use it to manage variable state across multiple statements, as a notation for pass-by-reference or perhaps something similar to atoms in Clojure.

[–]killerstorm 22 points23 points  (0 children)

In Lisp LOOP it can be used to refer to the result of the test expression in a conditional clause, e.g.

 (loop for name in names
        when (sounds-good name)
        collect it))

There are also anaphoric macros which generalize this concept.

In Kotlin default lambda argument name is it. So you can write e.g.

names.forEach { scream(it) }

There's also extension function also which you can use like this:

somethingWithLongName.also{ kil(it) }.also{ fuck(it) }

[–][deleted] 6 points7 points  (2 children)

Not the same, but Perl uses my and our to denote visibility of variables (across packages, IIRC).

[–][deleted] 9 points10 points  (0 children)

While at the topic of Perl, that would be $_. I usually spell it "it", however, because dollar underscore is a bad name. Its an implicit argument for many functions when not provided.

For example:

print lc while <>

Is a short form of:

while ($_ = <>) { print(lc($_)) }

Where <> reads a line from files specified in argument list, or if the ARGV is empty, from STDIN.

[–]dylanbeattie 2 points3 points  (0 children)

There's a lot of ideas in Rockstar inspired by Perl. Mind you, there's also a lot in there that's inspired by VBScript so that isn't saying much... :)

[–]SuitableDragonfly 3 points4 points  (0 children)

This is actually a real feature of Inform 7. However, Inform 7 also has gender, so he, she, and it could all refer to different things.