[Issue 6715] Using a custom pow function for ^^
https://issues.dlang.org/show_bug.cgi?id=6715 Iain Buclaw changed: What|Removed |Added Priority|P2 |P4 --
[Issue 6715] Using a custom pow function for ^^
https://issues.dlang.org/show_bug.cgi?id=6715 Iain Buclaw changed: What|Removed |Added CC||ibuc...@gdcproject.org --- Comment #4 from Iain Buclaw --- The function rewrite should really be targeting `core.math` instead of `std.math`. Or, granted that this is an operation with a special syntax, the initial template could be part of object.d, which then forwards to the correct function as appropriate. --
[Issue 6715] Using a custom pow function for ^^
http://d.puremagic.com/issues/show_bug.cgi?id=6715 --- Comment #3 from siegelords_ab...@yahoo.com 2012-12-29 08:08:04 PST --- (In reply to comment #2) > (In reply to comment #0) > > > Can we have ^^ rewritten into a simple pow? > > Note: I think that currently a^^b is optimized in some special cases by the > compiler (like b = 2). A simple function call causes a loss of those handy > optimizations. I never asked for those optimizations to be disabled. I am solely talking about the cases when ^^ is rewritten as a function. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6715] Using a custom pow function for ^^
http://d.puremagic.com/issues/show_bug.cgi?id=6715 bearophile_h...@eml.cc changed: What|Removed |Added CC||bearophile_h...@eml.cc --- Comment #2 from bearophile_h...@eml.cc 2012-04-04 16:17:36 PDT --- (In reply to comment #0) > Can we have ^^ rewritten into a simple pow? Note: I think that currently a^^b is optimized in some special cases by the compiler (like b = 2). A simple function call causes a loss of those handy optimizations. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6715] Using a custom pow function for ^^
http://d.puremagic.com/issues/show_bug.cgi?id=6715 siegelords_ab...@yahoo.com changed: What|Removed |Added Platform|Other |All OS/Version|Linux |All --- Comment #1 from siegelords_ab...@yahoo.com 2012-04-04 16:01:30 PDT --- An even better idea occurred to me today, now that UFCS has been introduced. Instead of my original proposal, why not do this: a^^b turns into a.pow(b) Due to the way properties are looked up this is safer than the original proposal (bad things won't happen if you have variables named 'pow' for example). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---