function pointer bug?

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Mon Oct 27 19:34:03 PDT 2014


On Tue, 28 Oct 2014 01:36:01 +0000
bitwise via Digitalmars-d <digitalmars-d at puremagic.com> wrote:

> I have actually found a work around as well, which was to wrap 
> the actual retrieval of the function address in a lambda, and 
> pass the lambda by template parameter instead:
it's not a "workaround", it's almost exactly what i did in my sample,
just not that hairy.

you can't get address of anything in compile time, 'cause there is no
such address. but you can do it in runtime, of course. that's what you
doing: postponing "&" to runtime.

> as far as I could google, no one has attempted this yet.
no one published it yet, not "no one attempted". i desperately need
runtime reflection for my (still private) component builder project, so
i'm slowly writing that mechanics. and my "command console" using
similar technique to allow user inspect variables and classes, and call
function/methods in runtime.

yet the thing is still in post-alpha stage (but it works). i also found
some compiler bugs while writing it, but not yet filled bugreports (i
know, i know, i shouldn't be so lazy).

> My prototype works pretty much as he has described, less a feature 
> here and there.
ah, that's good. i'm not aiming for full reflection mechanics, but i
want to have it. ;-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20141028/7b140b55/attachment.sig>


More information about the Digitalmars-d mailing list