We're updating the issue view to help you get more done. 

There should be a way to observe platform features at runtime

Description

Reader conditionals let the reader emit code conditionally based upon a set of platform features.

This is a closed set - however, currently it is baked in as an implementation detail of the reader. Runtime code cannot access the current platform feature set.

This is problematic when writing a macro that needs to emit code conditionally based upon the platform of the code being compiled. Reader conditionals themselves won't work since macros are always themselves read in Clojure.

We should enable some mechanism for retrieving the current platform at runtime, or at least at macro expansion time.

For example, this is the kind of thing it should be possible to do:

1 2 3 4 (defmacro mymacro [] (if (*platforms* :clj) `(some-clojure-thing) `(some-cljs-thing)))

Environment

None

Status

Assignee

Unassigned

Reporter

Luke VanderHart

Labels

Approval

Triaged

Patch

None

Affects versions

Release 1.7

Priority

Major