ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:91766] [Ruby trunk Misc#15654] Documentation for Complex is wrong or misleading
       [not found] <redmine.issue-15654.20190311084336@ruby-lang.org>
@ 2019-03-11  8:47 ` sawadatsuyoshi
  2019-03-11  9:19 ` [ruby-core:91768] " hanmac
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: sawadatsuyoshi @ 2019-03-11  8:47 UTC (permalink / raw)
  To: ruby-core

Issue #15654 has been reported by sawa (Tsuyoshi Sawada).

----------------------------------------
Misc #15654: Documentation for Complex is wrong or misleading
https://bugs.ruby-lang.org/issues/15654

* Author: sawa (Tsuyoshi Sawada)
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
The documentation for `Complex` https://ruby-doc.org/core-2.6/Complex.html says or implies that a complex can be created by literal like `2+1i`, but that is actually calling the method `+` on receiver `2` with argument `1i`. The description should be changed to make it clear that `2+ 1i` is not a literal but is applying a method.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:91768] [Ruby trunk Misc#15654] Documentation for Complex is wrong or misleading
       [not found] <redmine.issue-15654.20190311084336@ruby-lang.org>
  2019-03-11  8:47 ` [ruby-core:91766] [Ruby trunk Misc#15654] Documentation for Complex is wrong or misleading sawadatsuyoshi
@ 2019-03-11  9:19 ` hanmac
  2019-03-11  9:28 ` [ruby-core:91769] " sawadatsuyoshi
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: hanmac @ 2019-03-11  9:19 UTC (permalink / raw)
  To: ruby-core

Issue #15654 has been updated by Hanmac (Hans Mackowiak).


@nobu: i don't know if that would be better, but can the parser be changed to support that stuff like "2+1i" would create the Complex object directly?

----------------------------------------
Misc #15654: Documentation for Complex is wrong or misleading
https://bugs.ruby-lang.org/issues/15654#change-77044

* Author: sawa (Tsuyoshi Sawada)
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
The documentation for `Complex` https://ruby-doc.org/core-2.6/Complex.html says or implies that a complex can be created by literal like `2+1i`, but that is actually calling the method `+` on receiver `2` with argument `1i`. The description should be changed to make it clear that `2+ 1i` is not a literal but is applying a method.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:91769] [Ruby trunk Misc#15654] Documentation for Complex is wrong or misleading
       [not found] <redmine.issue-15654.20190311084336@ruby-lang.org>
  2019-03-11  8:47 ` [ruby-core:91766] [Ruby trunk Misc#15654] Documentation for Complex is wrong or misleading sawadatsuyoshi
  2019-03-11  9:19 ` [ruby-core:91768] " hanmac
@ 2019-03-11  9:28 ` sawadatsuyoshi
  2019-03-11  9:32 ` [ruby-core:91770] " hanmac
  2019-03-11 12:02 ` [ruby-core:91775] " nobu
  4 siblings, 0 replies; 5+ messages in thread
From: sawadatsuyoshi @ 2019-03-11  9:28 UTC (permalink / raw)
  To: ruby-core

Issue #15654 has been updated by sawa (Tsuyoshi Sawada).


Actually, currently, there is no literal for complex numbers whose real part is non-zero. I think we need a literal to cover such cases. If something along nobu's suggestion works, that would be preferable.

----------------------------------------
Misc #15654: Documentation for Complex is wrong or misleading
https://bugs.ruby-lang.org/issues/15654#change-77045

* Author: sawa (Tsuyoshi Sawada)
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
The documentation for `Complex` https://ruby-doc.org/core-2.6/Complex.html says or implies that a complex can be created by literal like `2+1i`, but that is actually calling the method `+` on receiver `2` with argument `1i`. The description should be changed to make it clear that `2+ 1i` is not a literal but is applying a method.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:91770] [Ruby trunk Misc#15654] Documentation for Complex is wrong or misleading
       [not found] <redmine.issue-15654.20190311084336@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2019-03-11  9:28 ` [ruby-core:91769] " sawadatsuyoshi
@ 2019-03-11  9:32 ` hanmac
  2019-03-11 12:02 ` [ruby-core:91775] " nobu
  4 siblings, 0 replies; 5+ messages in thread
From: hanmac @ 2019-03-11  9:32 UTC (permalink / raw)
  To: ruby-core

Issue #15654 has been updated by Hanmac (Hans Mackowiak).


sawa (Tsuyoshi Sawada) wrote:
> Actually, currently, there is no literal for complex numbers whose real part is non-zero. I think we need a literal to cover such cases. If something along nobu's suggestion works, that would be preferable.

it wasn't a suggestion from him, i just wanted to ping him so he can see the message

----------------------------------------
Misc #15654: Documentation for Complex is wrong or misleading
https://bugs.ruby-lang.org/issues/15654#change-77046

* Author: sawa (Tsuyoshi Sawada)
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
The documentation for `Complex` https://ruby-doc.org/core-2.6/Complex.html says or implies that a complex can be created by literal like `2+1i`, but that is actually calling the method `+` on receiver `2` with argument `1i`. The description should be changed to make it clear that `2+ 1i` is not a literal but is applying a method.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [ruby-core:91775] [Ruby trunk Misc#15654] Documentation for Complex is wrong or misleading
       [not found] <redmine.issue-15654.20190311084336@ruby-lang.org>
                   ` (3 preceding siblings ...)
  2019-03-11  9:32 ` [ruby-core:91770] " hanmac
@ 2019-03-11 12:02 ` nobu
  4 siblings, 0 replies; 5+ messages in thread
From: nobu @ 2019-03-11 12:02 UTC (permalink / raw)
  To: ruby-core

Issue #15654 has been updated by nobu (Nobuyoshi Nakada).


There would be a chance to optimize such expressions, but it is not a single literal syntactically, and constant folding is disabled in Ruby for its dynamic nature.
New literal syntax will be needed for an (impurely) imaginary number literal, but I doubt that we really need it.


----------------------------------------
Misc #15654: Documentation for Complex is wrong or misleading
https://bugs.ruby-lang.org/issues/15654#change-77052

* Author: sawa (Tsuyoshi Sawada)
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
The documentation for `Complex` https://ruby-doc.org/core-2.6/Complex.html says or implies that a complex can be created by literal like `2+1i`, but that is actually calling the method `+` on receiver `2` with argument `1i`. The description should be changed to make it clear that `2+ 1i` is not a literal but is applying a method.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-03-11 12:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-15654.20190311084336@ruby-lang.org>
2019-03-11  8:47 ` [ruby-core:91766] [Ruby trunk Misc#15654] Documentation for Complex is wrong or misleading sawadatsuyoshi
2019-03-11  9:19 ` [ruby-core:91768] " hanmac
2019-03-11  9:28 ` [ruby-core:91769] " sawadatsuyoshi
2019-03-11  9:32 ` [ruby-core:91770] " hanmac
2019-03-11 12:02 ` [ruby-core:91775] " nobu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).