proposal: @mixin functions to auto-mixin at call site
Dicebot
public at dicebot.lv
Wed Sep 4 07:54:45 PDT 2013
On Wednesday, 4 September 2013 at 14:44:50 UTC, Ary Borenszweig
wrote:
> Why would anyone do that?
By an accident - mixins are not hygienic.
> Do you use other people's source code without reading the
> documentation or reading the source code?
Yes, all the time. Documentation is always lacking and reading
full 10 MLOC code base to tweak a single function is never an
option.
> How would the author of "updateGui()" know that you named your
> variable "st"?
He has no idea how you may name your variables, that is the key
point. Thus he has no idea what safe symbol names to use.
> What if "updateGui()" does "rm -rf /" ?
>
> What if "updateGui()" always does a null pointer dereference?
You will have a bugged/malicious function in your code base, one
very easy to detect and fix. Nothing in common with discussed
problem.
More information about the Digitalmars-d
mailing list