From 7ba7773711ff5df98e963291dfd776793de1d690 Mon Sep 17 00:00:00 2001 From: Nathan Marz Date: Sun, 4 Sep 2016 11:25:06 -0400 Subject: [PATCH] Updated Specter's inline caching implementation (markdown) --- Specter's-inline-caching-implementation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Specter's-inline-caching-implementation.md b/Specter's-inline-caching-implementation.md index 611a06d..14f5ed8 100644 --- a/Specter's-inline-caching-implementation.md +++ b/Specter's-inline-caching-implementation.md @@ -64,13 +64,13 @@ The first example shows how sequential static navigators get precompiled togethe The last example shows what Specter does when it has a local variable in the position of a navigator. Since Specter does not know if `b` is an implementation of `RichNavigator`, it cannot put it into a `comp-navs` call directly. `b` could be an implicit navigator like `:some-keyword`, or it could be an uncompiled path like `[ALL even?]`. So it inserts the call to `coerce-nav` to determine that at runtime. If you know for sure a symbol or form will create a `RichNavigator` object, then you can annotate it with metadata like this: -``` +```clojure [:a ^:direct-nav b :c] => (comp-navs b ) ``` The same thing works for dynamic var references and special forms: -``` +```clojure [*a-dynamic-var*] => (coerce-nav *a-dynamic-*var) [^:direct-nav *a-dynamic-var*] => *a-dynamic-*var