Thread overview
[Issue 10135] New: core.bitop: btc, btr, btc is "pure" but have side effects
May 22, 2013
mimocrocodil
May 23, 2013
Don
May 22, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10135

           Summary: core.bitop: btc, btr, btc is "pure" but have side
                    effects
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: trivial
          Priority: P2
         Component: druntime
        AssignedTo: nobody@puremagic.com
        ReportedBy: 4denizzz@gmail.com


--- Comment #0 from mimocrocodil <4denizzz@gmail.com> 2013-05-22 08:57:12 PDT ---
core.bitop: btc, btr, btc is "pure" but have side effects

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 23, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10135



--- Comment #1 from Don <clugdbug@yahoo.com.au> 2013-05-23 01:13:40 PDT ---
> core.bitop: btc, btr, btc is "pure" but have side effects

What do you mean? They don't modify any globals.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 23, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10135


Alex Rønne Petersen <alex@lycus.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |alex@lycus.org
         Resolution|                            |INVALID


--- Comment #2 from Alex Rønne Petersen <alex@lycus.org> 2013-05-23 10:16:55 CEST ---
Yes, they are pure per the D definition. Even if a function mutates the memory pointed to by a pointer given to the function, it is still pure because that pointer is considered an input.

See: http://klickverbot.at/blog/2012/05/purity-in-d/

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------