This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-01-03
Channels
- # aws (24)
- # beginners (377)
- # calva (33)
- # cider (1)
- # circleci (22)
- # cljs-dev (7)
- # clojure (40)
- # clojure-europe (1)
- # clojure-france (9)
- # clojure-norway (3)
- # clojure-taiwan (2)
- # clojurescript (8)
- # conjure (10)
- # cryogen (2)
- # emacs (1)
- # fulcro (23)
- # helix (1)
- # hoplon (2)
- # luminus (7)
- # meander (3)
- # off-topic (2)
- # re-frame (7)
- # reagent (8)
- # reveal (38)
- # sci (13)
- # shadow-cljs (17)
- # tools-deps (17)
- # vim (1)
Is there a simple way to know, on which vars a specific parsed form depends? Say, “if these vars existed, this form would run”.
For example, if I wanted to make something like https://observablehq.com, but for Clojure by using sci.
In Observable, you have live notebooks made of several snippets of code.
These snippets may depend on each other (one of them declares x
and another one uses it in calculation), but don’t have to be in some particular order. Observable internally resolves the dependencies of snippets and executed them internally in “correct” order. Also, if x
changes, it re-runs all snippets that depend on it or depend on dependent snippets.
I wonder if sci has an API that would say: “this form you provided depends on these vars being present in context (that are currently missing)”.
This way, one could build a dependency tree of how snippets depend on each other, and execute them in “correct” order.
@timur058 I’m not sure either but I see what you want and agree that it’s important. If you had this, you could pre-evaluate all of the cells in the notebook
in proper order when it’s loaded
(as you say in the comment, duh 🙂 )
looks like a problem we need to solve!
@U017QJZ9M7W Is this something sci should solve or is this some topological sort problem that should be solved in a sci-using app? And why not use namespaces for this? The namespace system already solves this problem
@U04V15CAJ my guess is that what @timur058 wants to enable is the ability to define “cells” of some notebook out of order, and as long as everything COULD be sorted, then great. I don’t think it’s an sci-level problem since this would have to happen before feeding the forms into sci
if you use namespaces like:
(ns cell5 (:require [cell1]))
this would work, and you could artificially prepend these namespace things in front of the expressionsbrilliant, I like it
For example, if I wanted to make something like https://observablehq.com, but for Clojure by using sci.
In Observable, you have live notebooks made of several snippets of code.
These snippets may depend on each other (one of them declares x
and another one uses it in calculation), but don’t have to be in some particular order. Observable internally resolves the dependencies of snippets and executed them internally in “correct” order. Also, if x
changes, it re-runs all snippets that depend on it or depend on dependent snippets.
I wonder if sci has an API that would say: “this form you provided depends on these vars being present in context (that are currently missing)”.
This way, one could build a dependency tree of how snippets depend on each other, and execute them in “correct” order.