D-Programming-Language/dmd — pull request #2811 by yebblies (2013-11-18 08:35:44+00:00)
Title: [Unified Frontend] Implement a callback-based builtin hook using mangled names

@ibuclaw @klickverbot @redstar Does this look suitable for adding your own builtins?

Basically call `add_builtin("_D4core4math3sinFNaNbNfeZe", &eval_sin);`

Where the eval function has the signature: `Expression *function(Loc loc, FuncDeclaration *fd, Expressions *arguments)`

This assumes `fd->mangleExact()` will return a unique string for each possible builtin.

(I know it needs a hash and caching)