R
Roger Pack
print 3
Appears I went too far--this is enough:
class Object
def print *args
super *(args + [" "])
end
end3 => nil
This works because
=> [A, Object, Kernel]
when it searches for the print it first looks in the current class, then
in Object, then in Kernel. Object now defines it, then "supers" to
Kernel.
Whoa turbo we're all trying to be respectful.
gotcha. That looks nice in terms of return values. I guess the actual
problem was better described by Tony in his other post, I misled you.
How well does it work out? Any drawbacks?
Sounds good--code it up and I'll give it a try (as Joshua said).
Persuade via code!
Make sure you write it in Ruby though no cross contamination! <said
tongue in cheek>
It will be interesting to code some ruby that looks like Python.
Anybody else know of projects that allow for this? (pre processors)
Thanks.
-=r
Nifty! Thanks.
Appears I went too far--this is enough:
class Object
def print *args
super *(args + [" "])
end
end3 => nil
This works because
=> [A, Object, Kernel]
when it searches for the print it first looks in the current class, then
in Object, then in Kernel. Object now defines it, then "supers" to
Kernel.
Aside from the fact that this wouldn't solve the problem that I'd
still have to _write_ the damned things, this is possibly the
kludgiest solution imaginable.
Whoa turbo we're all trying to be respectful.
So this could be:
arra.collect do |a|:
pass
.reject do |b|:
true
gotcha. That looks nice in terms of return values. I guess the actual
problem was better described by Tony in his other post, I misled you.
The other concern is that "the allure of magic indentation wears thin
for large docs" which fact "worked to ensure you kept your methods
short."[1]
Well, all I can say is, that's his opinion. Hasn't lost its allure for
me. And if it did lose its allure, I would think that it wouldn't be
for large docs, it would be for deeply _nested_ docs. I definitely
sympathize with his mockery of the notion that this limitation is a
blessing in disguise because it encourages you to keep your methods
short... it reminds me of how I felt when I first heard that Java's
lack of pointers meant you couldn't write any pointer bugs. But my
employer imposes a strict 80-column limit on source files including
Python, we have a lot of Python code, and it all works out.
How well does it work out? Any drawbacks?
You keep on saying this, yet I have not seen one example of code that
demonstrates that using dedent couldn't work. Basically, we're looking
for some code which, if you removed the all ends, a script following
simple deterministic rules would not be able to unambigiously decide
where to put them back. I agree that "put an end wherever you see a
dedent" is naive and wouldn't work... but "put an end wherever you see
a dedent which isn't followed by a keyword which extends the current
expression, such as elsif or rescue or ensure" might.
Sounds good--code it up and I'll give it a try (as Joshua said).
Persuade via code!
Make sure you write it in Ruby though no cross contamination! <said
tongue in cheek>
It will be interesting to code some ruby that looks like Python.
Anybody else know of projects that allow for this? (pre processors)
Thanks.
-=r