Skip to content

A scenario where analyzer fails on dependent defs #248

Open
@zampino

Description

@zampino

This reproduces the same problem of Clerk evaluating notebooks with inter-dependent LaTTe definitions.

(ns scratch
  (:require [scratch.macros :refer [dep-def]]))

(dep-def X)
(dep-def Y X)
(ns scratch.macros)

(defmacro dep-def [name & deps]
  (assert (every? #(some-> % resolve bound?) deps)
          "All deps must to be defined and bound at macro-expansion!")
  `(def ~name {:name '~name :refs '~deps}))

The assertion kicks in when analyzer encounters the second form in the scratch namespace above, and the forms have not been evaluated before.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions