LangWart: Method congestion from mutate multiplicty

Neil Hodgson nhodgson at iinet.net.au
Sun Feb 10 16:57:22 EST 2013


Rick Johnson:

> Really?

    Yes.

 >> a = [1,2]
=> [1, 2]
 >> a.push(3)
=> [1, 2, 3]
 >> a
=> [1, 2, 3]

    This could be called "mutation without exclamation".

 >> require 'WEBrick'
=> true
 >> vowels = "[aeiou]+"
=> "[aeiou]+"
 >> vowels.object_id
=> 2234951380
 >> WEBrick::HTTPUtils._make_regex!(vowels)
=> /([^\[aeiou\]\+])/n
 >> vowels
=> "[aeiou]+"
 >> vowels.object_id
=> 2234951380

    The counterpart, exclamation without mutation.

    Neil



More information about the Python-list mailing list