diff --git a/.gitignore b/.gitignore index 0eefab1..9b8e5a4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ build/ tags +vgcore* *.swp *.vims pl diff --git a/src/calc.c b/src/calc.c index 76a4b2e..0e77d3d 100644 --- a/src/calc.c +++ b/src/calc.c @@ -536,6 +536,7 @@ void af(const char* name, Object (* func)(Object*, int, struct Environment*), st static struct Environment pebbleEnv() { struct Environment e = defaultEnv(); + setGlobal(&e); af("window", &add_window, &e); af("sc", &run_script, &e); af("cw", &createWindow, &e); diff --git a/src/env.c b/src/env.c index 66a2d50..5391806 100644 --- a/src/env.c +++ b/src/env.c @@ -47,7 +47,6 @@ struct helpText helpTexts[100]; struct symFunc { const char* sym; - Object (* func)(Object*, int, struct Environment*); }; diff --git a/src/env.h b/src/env.h index fe01c15..f2aaca2 100644 --- a/src/env.h +++ b/src/env.h @@ -15,12 +15,10 @@ struct EnvElement { }; struct Environment; + struct Environment { struct Environment* outer; struct ObjectTable table; - // struct EnvElement* elements; // iterative - // int capacity; // iterative - int refs; }; diff --git a/src/examples/pebblisp.pbl b/src/examples/pebblisp.pbl index 197ed30..8c6ce29 100644 --- a/src/examples/pebblisp.pbl +++ b/src/examples/pebblisp.pbl @@ -62,6 +62,7 @@ (Alias "ls" "ls --color") (Alias "alias" "(alias)") (Alias "pbl" (cat (env "EDITOR") " ~/.pebblisp.pbl")) + (Alias "tags" "ctags --exclude=node_modules -f newtags -R . && mv newtags tags") (Alias "r" "(reloadConfig)") ))