Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Alternatives to sed + awk



Josh Glover writes:
 > On 10 March 2011 06:17, Stephen J. Turnbull <stephen@example.com> wrote:

 > > However, again it seems to me to be easy to abuse.
 > 
 > Sure, but so's C.

Yeah, but I don't think Ruby is in the same market segment as C. ;-)

 > > However, the basic syntax of Lisp aka "Lots of Irritating Single
 > > Parentheses" is detested by many.
 > 
 > Just like Python's whitespace requirements, you get used to it.

Right; the point is that not everybody does get used to it, and those
who don't are unlikely to grant that DSLs written in Python or Lisp
are DSLs.  Cf. Simon's post.

 > functions themselves are not first class objects as in Python; you
 > need to turn them into a Proc (or, more powerfully a Binding) object.

Ah.  I like functions as first class objects a lot.

 > > def test_crappy_class
 > >    crap = CrappyClass.new
 > >    assert_equal(0, crap.value)
 > >    crap.increment()
 > >    assert_equal(1, crap.value)
 > 
 > Sure. What's the difference, really? In Ruby, instance variables are
 > hidden by default, which is a nice signal to programmers that they
 > shouldn't be considered part of a class's API. But if you need to get
 > at them, you can do it.

I find the Python convention that identifiers named with leading
underscores are private an equally good signal in practice.



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links