www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.ide
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript
electronics




digitalmars.D - Feature Request: "self" keyword to indicate "the current function"

This would effectively give us anonymous recursion for comparatively little
effort.

Problems: "void test(typeof(self) foo, int bar);". To resolve this case
requires infinite recursion support in the type system, or a generic "this
type" type at the mangling level.

Or it could just be an error. :p On the other hand, if the above were made to
work, we could implement the Y combinator in D. Not that we'd need it at that
point. :p

 --downs
May 03 2008