Fable: add a preprocessor symbol to indicate FABLE compilation

Created on 8 Aug 2016  ·  4Comments  ·  Source: fable-compiler/Fable

Would help writing code that is automatically portable between FABLE and FSC. Can do this anyway with com line symbols but this would make such functionality work out of the box.
Proposed symbol:


(adjust underscores to be compatible with global conventions I probably don't know)

feature

Most helpful comment

Yes I would go with FABLE_COMPILER

All 4 comments

Maybe it could add antoher symbol which gives version information. But not sure if that's practical.

Given that Fable is evolving very quickly now, probably including version information won't be very practical indeed. In F# I think usually the double underscore is used for macros like __SOURCE_DIRECTORY__, but compilation symbols tend to be simpler (INTERACTIVE). Probably just FABLE would be too simple. FABLE_COMPILER?

Yes I would go with FABLE_COMPILER

FABLE_COMPILER is good with me.

However, I'd still wonder whether _FABLE_COMPILER_ or _FABLE_COMPILER would be better with the underscores indicating system-level status. I defer to whatever others more familiar with F#/Javascript conventions think.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

forki picture forki  ·  3Comments

jwosty picture jwosty  ·  3Comments

SirUppyPancakes picture SirUppyPancakes  ·  3Comments

rommsen picture rommsen  ·  3Comments

krauthaufen picture krauthaufen  ·  3Comments