[#25272] [Feature #2032] Change the license to "GPLv2+ or Ruby's original". — Yui NARUSE <redmine@...>

Feature #2032: Change the license to "GPLv2+ or Ruby's original".

51 messages 2009/09/02
[#25368] [Feature #2032] Change the license to "GPLv2+ or Ruby's original". — Kazuhiko Shiozaki <redmine@...> 2009/09/04

Issue #2032 has been updated by Kazuhiko Shiozaki.

[#25461] Re: [Feature #2032] Change the license to "GPLv2+ or Ruby's original". — Gregory Brown <gregory.t.brown@...> 2009/09/07

On Fri, Sep 4, 2009 at 1:10 PM, Kazuhiko Shiozaki<redmine@ruby-lang.org> wrote:

[#25463] Re: [Feature #2032] Change the license to "GPLv2+ or Ruby's original". — Yukihiro Matsumoto <matz@...> 2009/09/08

Hi,

[#30610] [Feature #2032] Change the license to "GPLv2+ or Ruby's original". — Shyouhei Urabe <redmine@...> 2010/06/06

Issue #2032 has been updated by Shyouhei Urabe.

[#30611] Re: [Feature #2032] Change the license to "GPLv2+ or Ruby's original". — Yusuke ENDOH <mame@...> 2010/06/06

Hi,

[#30614] Re: [Feature #2032] Change the license to "GPLv2+ or Ruby's original". — Urabe Shyouhei <shyouhei@...> 2010/06/06

> To avoid enbugging a new bug, we must choose the another solutions.

[#30616] Re: [Feature #2032] Change the license to "GPLv2+ or Ruby's original". — Yusuke ENDOH <mame@...> 2010/06/06

2010/6/6 Urabe Shyouhei <shyouhei@ruby-lang.org>:

[#30652] Re: [Feature #2032] Change the license to "GPLv2+ or Ruby's original". — Urabe Shyouhei <shyouhei@...> 2010/06/08

(2010/06/06 20:27), Yusuke ENDOH wrote:

[#25285] [Feature #2033] Move Core Development to Git — Run Paint Run Run <redmine@...>

Feature #2033: Move Core Development to Git

75 messages 2009/09/02
[#25290] [Feature #2033] Move Core Development to Git — Yui NARUSE <redmine@...> 2009/09/02

Issue #2033 has been updated by Yui NARUSE.

[#25297] Re: [Feature #2033] Move Core Development to Git — Jon <jon.forums@...> 2009/09/02

> Some commiter of Ruby live on Windows.

[#25342] Re: [Feature #2033] Move Core Development to Git — Urabe Shyouhei <shyouhei@...> 2009/09/03

Jon wrote:

[#25343] Re: [Feature #2033] Move Core Development to Git — Michal Suchanek <hramrach@...> 2009/09/03

2009/9/4 Urabe Shyouhei <shyouhei@ruby-lang.org>:

[#25345] Re: [Feature #2033] Move Core Development to Git — Urabe Shyouhei <shyouhei@...> 2009/09/03

Michal Suchanek wrote:

[#25299] Re: [Feature #2033] Move Core Development to Git — Eric Hodel <drbrain@...7.net> 2009/09/02

On Sep 2, 2009, at 11:19, Run Paint Run Run wrote:

[#25306] [Feature #2034] Consider the ICU Library for Improving and Expanding Unicode Support — Run Paint Run Run <redmine@...>

Feature #2034: Consider the ICU Library for Improving and Expanding Unicode Support

16 messages 2009/09/03

[#25394] Unmaintained code (Was: Move Core Development to Git) — Eric Hodel <drbrain@...7.net>

On Sep 4, 2009, at 02:16, Urabe Shyouhei wrote:

10 messages 2009/09/05

[#25420] [Bug #2054] Onigurma Isn't Documented — Run Paint Run Run <redmine@...>

Bug #2054: Onigurma Isn't Documented

17 messages 2009/09/05

[#25442] turning off indentation warnings — Aaron Patterson <aaron@...>

Is there a way in 1.9 to turn off only indentation warnings? I like

19 messages 2009/09/06
[#25510] Re: turning off indentation warnings — Nobuyoshi Nakada <nobu@...> 2009/09/10

Hi,

[#25511] [Bug #2079] win32ole's OLEGEN does not create all classes needed when a TLB has more than one class defined — Bruno Antunes <redmine@...>

Bug #2079: win32ole's OLEGEN does not create all classes needed when a TLB has more than one class defined

18 messages 2009/09/10

[#25644] [Bug #2121] mathn/rational destroys Fixnum#/, Fixnum#quo and Bignum#/, Bignum#quo — Charles Nutter <redmine@...>

Bug #2121: mathn/rational destroys Fixnum#/, Fixnum#quo and Bignum#/, Bignum#quo

12 messages 2009/09/19

[#25709] [Bug #2131] f(not x) => syntax error — "James M. Lawrence" <redmine@...>

Bug #2131: f(not x) => syntax error

16 messages 2009/09/22

[#25769] A challenge: Enumerator#next in JRuby — Charles Oliver Nutter <headius@...>

I have a challenge for anyone who wants to discuss, propose

25 messages 2009/09/25
[#25782] Re: A challenge: Enumerator#next in JRuby — Tanaka Akira <akr@...> 2009/09/26

In article <f04d2210909251312q46bd51c0teacc4b0a8c417f0c@mail.gmail.com>,

[#25820] [Feature #2152] Split functionality of Float#inspect and Float#to_s — Roger Pack <redmine@...>

Feature #2152: Split functionality of Float#inspect and Float#to_s

32 messages 2009/09/28

[#25853] [Bug #2160] JSON can't parse input where top-level object is a string — caleb clausen <redmine@...>

Bug #2160: JSON can't parse input where top-level object is a string

11 messages 2009/09/29

[ruby-core:25663] Re: [Bug #2121] mathn/rational destroys Fixnum#/, Fixnum#quo and Bignum#/, Bignum#quo

From: brian ford <brixen@...>
Date: 2009-09-20 07:29:03 UTC
List: ruby-core #25663
Hi,

On Sat, Sep 19, 2009 at 1:04 AM, Charles Oliver Nutter
<headius@headius.com> wrote:
> On Sat, Sep 19, 2009 at 12:28 AM, Joel VanderWerf
> <vjoel@path.berkeley.edu> wrote:
>> Perhaps it should be the responsibility of users of numeric operators to
>> #floor explicitly when that is the intent, rather than rely on the (mostly
>> standard, sometimes convenient, but questionable) 1/2==0 behavior. Doing so
>> would make it easier to adapt the code to float, rational, or other numeric
>> types.
>>
>> In your proposal, would Rational(1,3) be the preferred notation, since
>> 1/3==0? Or would there be something else, 1//3 or ...?
>>
>> I've always thought of mathn as a kind of alternate ruby, not just another
>> core library, hence to be used with caution...
>
> I think Brian Ford expressed what I feel best...there should always be
> another method or operator. Using another operator or method is an
> explicit "buy-in" by the user--rather than a potential (at some
> undetermined time in the future) that everything you know about
> integral division in your program changes wildly. It should not be
> possible for any library to undermine the basic mathematical
> expectations of my program. Doing so, or expecting the user to do
> extra work to guarantee the *common case*, is a recipe for serious
> failure.

There are a number of issues combined here, but I think they generally
reduce to these:

1. How do you model the abstractions that are number systems in the
abstractions that are classes and methods.
2. Should the behavior of mathn be acceptable in the core language.

We seem to think of the basic mathematical operations +, -, *, / as
being roughly equal. But of these four, division on the integers is
distinct. The set of integers is closed under addition, subtraction,
and multiplication. Given any two integers, you can add, subtract, or
multiply them and get an integer. But the result of dividing one
integer by another is not always an integer. The integers are not
closed under division. In mathematics, whether a set is closed under
an operation is a significant property.

As such, there is nothing at all questionable about defining division
on the integers to be essentially floor(real(a)/real(b)) (where
real(x) returns the (mathematical) real number corresponding to the
value x, because the integers are embedded in the reals and the reals
are closed under division). You basically have five choices:

1. floor(real(a)/real(b))
2. ceil(real(a)/real(b))
3. round(real(a)/real(b)) where round may use floor or ceil
4. real(a)/real(b)
5. raise an exception

In computer programming, there are a number of reasons for choosing 1,
2 or 3 but basically it is because that's the only way to get the
"closest" integer (i.e. define division in a way that the integers are
closed under the operation) . Convention has selected option 1.
Numerous algorithms are implemented with the assumption that integral
division is implement as option 1. It's not right or wrong, but the
convention has certain advantages. In programming, we are typically
implementing algorithms, not just "doing math" in some approximations
of these abstractions called number systems. Any system for doing math
takes serious steps to implement the real number system in as
mathematically correct form as possible.

My contention that we should always have two operators for integral
division is a compromise between the need to implement algorithms and
the desire to have concise "operator" notation for doing more
math-oriented computation. Given that programming in Ruby is more
about algorithms than it is about doing math, it's unreasonable to
expect (a/b).floor instead of a / b. At the same time, math-oriented
programs are not going to be happy with a.quo b. The reasons for
options 1 and 4 above are not mutually exclusive nor can one override
the other.

The mathn library is clearly exploiting an implementation detail. Were
Ruby implemented like Smalltalk (or Rubinius), mathn would have never
been written as it is. The fact that it is even possible to load mathn
results from the fact that countless critical algorithms in MRI are in
the walled garden of C code. That's not true for your Ruby programs.
Any algorithm you implement that relies on the very reasonable
assumption of integral division will be broken by mathn.

You can say, "but mathn is in the standard library, you have to
require it to use it". But that ignores the fact that requiring the
library fundamentally changes assumptions that are at the very core of
writing algorithms. Essential computer programming and mathn can never
coexist without jumping through hoops.

This is the point were some grandiose scheme like selector namespaces
are suggested. But I think the simple solution of two distinct
operators handily solves the problem of the messy facts of
mathematical number systems implemented in very untheoretic (i.e.
really real) silicon.

As for which symbol to select, what about '/.' for real(a)/real(b).

Cheers,
Brian

In This Thread