5 Oct 23:22
[ruby-core:19132] [Feature #615] "with" operator
From: Lavir the Whiolet <redmine <at> ruby-lang.org>
Subject: [ruby-core:19132] [Feature #615] "with" operator
Newsgroups: gmane.comp.lang.ruby.core
Date: 2008-10-05 21:24:46 GMT
Subject: [ruby-core:19132] [Feature #615] "with" operator
Newsgroups: gmane.comp.lang.ruby.core
Date: 2008-10-05 21:24:46 GMT
Feature #615: "with" operator http://redmine.ruby-lang.org/issues/show/615 Author: Lavir the Whiolet Status: Open, Priority: Normal Category: core, Target version: 2.0 "with" operator is required. It must work like an ordinary method which gets one arguemnt and a block. All expressions in the block are not required to point the argument explicitly; all method calls are related to the argument by default. Example: x = "Sample" with x do puts class puts reverse end would produce: String elpmaS ---------------------------------------- http://redmine.ruby-lang.org
Yes indeed. I think your experience helped Matz quite a bit
for his decision.
>But I agree with you: if a library can be confident that its inputs are at
>least ASCII-comptible, quite a bit of your efforts could be saved.
>If on top of that, if it can be reasonably sure that all its inputs are
>encoding compatible, then it's even better.
I think this is not about confidence. In the software world,
there is no confidence about input. It's much more about what
expectation a library sets and documents. I think there are
quite a few possibilities:
a) The library accepts and produces only UTF-8. Best used with -U.
b) The library accepts, in one run, a single arbitrary encoding,
and returns the same encoding, if that encoding is ASCII-compatible.
c) Same as before, but extended for non-ASCII-compatible.
(what James has done with the CVS library, as far I understand it)
RSS Feed