HaxeFoundation / code-cookbook

The Haxe Code Cookbook - A community driven resource website for learning Haxe in practise
https://code.haxe.org
112 stars 87 forks source link

Remove redundancies from "Working with compiler flags." #169

Closed player-03 closed 9 months ago

player-03 commented 1 year ago

This sample re-implemented haxe.macro.Compiler.getDefine(), giving the impression that you must re-implement it. It's much better to encourage people to use standard library functionality.

The sample also re-implemented conditional compilation, and its implementation had an error. It would always call setDefine("foo", "bar") regardless of the result of isDefined(). By using conditional compilation instead, we can avoid accidentally overwriting foo.

Simn commented 9 months ago

Sorry for the late response, I don't think I receive notifications for this repo!