https://redmine.ruby-lang.org/https://redmine.ruby-lang.org/favicon.ico?17113305112009-05-04T19:56:26ZRuby Issue Tracking SystemRuby master - Feature #1432: decrement and incrementhttps://redmine.ruby-lang.org/issues/1432?journal_id=38742009-05-04T19:56:26Zmatz (Yukihiro Matsumoto)matz@ruby.or.jp
<ul><li><strong>Status</strong> changed from <i>Open</i> to <i>Rejected</i></li></ul><p>=begin<br>
You can't define object-oriented semantics for increment/decrement operations. They are assignments in theory.</p>
<p>=end</p> Ruby master - Feature #1432: decrement and incrementhttps://redmine.ruby-lang.org/issues/1432?journal_id=38792009-05-06T11:02:35Zrogerdpack (Roger Pack)rogerpack2005@gmail.com
<ul></ul><p>=begin<br>
at times I do miss the elegance of being able to do ++<br>
though it does hide the fact that it's internally assignment. Primitives aren't quite as objecty as "normal" objects, so might be an appropriate fit. Just thinking out loud.<br>
-=r<br>
=end</p> Ruby master - Feature #1432: decrement and incrementhttps://redmine.ruby-lang.org/issues/1432?journal_id=38802009-05-06T11:31:28Zbrent (Brent Roman)brent@mbari.org
<ul></ul><p>=begin</p>
<p>Why is</p>
<p>a+=1</p>
<p>less elegant than</p>
<p>++a</p>
<p>However, I admit that using</p>
<p>(x=a; a+=1; x)</p>
<p>to replace</p>
<p>a++</p>
<p>is pretty evil looking. (The postfix variants <em>are</em> a pain to emulate<br>
correctly)</p>
<p>Are there other commonly used languages besides 'C' that support the ++ and<br>
-- operators?<br>
I always thought they were added to 'C' primarily to support efficient<br>
pointer arithmetic --<br>
something quite foreign to Ruby.</p>
<ul>
<li>brent</li>
</ul>
<p>Nobuyoshi Nakada-3 wrote:</p>
<blockquote>
<p>Issue <a class="issue tracker-2 status-6 priority-4 priority-default closed" title="Feature: decrement and increment (Rejected)" href="https://redmine.ruby-lang.org/issues/1432">#1432</a> has been updated by Roger Pack.</p>
<h2>at times I do miss the elegance of being able to do ++<br>
though it does hide the fact that it's internally assignment. Primitives<br>
aren't quite as objecty as "normal" objects, so might be an appropriate<br>
fit. Just thinking out loud.<br>
-=r</h2>
<p><a href="http://redmine.ruby-lang.org/issues/show/1432" class="external">http://redmine.ruby-lang.org/issues/show/1432</a></p>
<hr>
<p><a href="http://redmine.ruby-lang.org" class="external">http://redmine.ruby-lang.org</a></p>
</blockquote>
<p>--<br>
View this message in context: <a href="http://www.nabble.com/-ruby-core%3A23357---Feature--1432--decrement-and-increment-tp23366229p23399031.html" class="external">http://www.nabble.com/-ruby-core%3A23357---Feature--1432--decrement-and-increment-tp23366229p23399031.html</a><br>
Sent from the ruby-core mailing list archive at Nabble.com.</p>
<p>=end</p> Ruby master - Feature #1432: decrement and incrementhttps://redmine.ruby-lang.org/issues/1432?journal_id=39202009-05-09T12:33:35Zrogerdpack (Roger Pack)rogerpack2005@gmail.com
<ul></ul><p>=begin<br>
yeah ++ is the one I miss.<br>
-=r<br>
=end</p> Ruby master - Feature #1432: decrement and incrementhttps://redmine.ruby-lang.org/issues/1432?journal_id=39232009-05-09T20:42:28Zmatz (Yukihiro Matsumoto)matz@ruby.or.jp
<ul></ul><p>=begin<br>
Hi,</p>
<p>In message "Re: <a href="https://blade.ruby-lang.org/ruby-core/23405">[ruby-core:23405]</a> Re: [Feature <a class="issue tracker-2 status-6 priority-4 priority-default closed" title="Feature: decrement and increment (Rejected)" href="https://redmine.ruby-lang.org/issues/1432">#1432</a>] decrement and increment"<br>
on Sat, 9 May 2009 15:38:53 +0900, "C.E. Thornton" <a href="mailto:admin@hawthorne-press.com" class="email">admin@hawthorne-press.com</a> writes:</p>
<p>|The question comes down to this:<br>
|<br>
| Are we going to allow "Synatic Suger" of this<br>
| sort into Ruby? We already do in sense - By allowing<br>
| more than one way to do things in most situations.</p>
<p>The answer is</p>
<p>we have to mind to add sugars easily</p>
<p>just because syntax sugar is modifying the syntax, and you have to be<br>
slow to modify the syntax.</p>
<p>If we decide to add this particular sugar after serious consideration,<br>
the following question arise:</p>
<p>what is the result of "syntax sugar" conversion. simple += 1 is<br>
suffice, or no?</p>
<pre><code> matz.
</code></pre>
<p>=end</p>