bakpakin on master
Remove stack inversion code for… Merge branch 'master' of github… (compare)
bakpakin on master
Remove stack inversion code for… (compare)
They do work, I just tested locally. I think the issue is you are making use of things like
eval-string inside your "hooks" file. These are inherently dependent on the context they are run in - you would have the same issues in any programming language. Using "require" or "dofile" does not just bring all of the bindings from the given path into the current environment, it returns a fully encapsulated module table. Even *import will auto-prefix bindings before bringing them into the current environment table.
Also, the effect of import or *import has no effect until the top level block is executed. You cannot do:
(do (import my-mod) (my-mod/abc 123))
(import my-mod) (my-mod/abc 123)
This is because Janet use incremental compilation, basically a repl. The first example (using do) has the following flow:
(do (import ...))
The second working form has the following flow:
my-mod/abcwas defined in the previous form, this evaluates without compilation error.
This incremental compilation is pretty common to Lisps and is not the stringly typed dynamism that is from a language like TCL.
(defn post-sync  (match ((cfg "config" "node.name") :text) "citadel" (do (os/execute ["vdirsyncer" "sync"] :p) (os/execute ["wiki" "calendar_commit"] :p) (os/execute ["wiki" "contacts_commit" "--no_pull"] :p))))
I am working c++ (gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.1), trying to add a key to a janet table.
I get the table with: JanetTable *tt = janet_table(0); .
I try to add an entry with: janet_table_put(tt, janet_wrap_string("count"), janet_wrap_number(10)); .
The key shows up as "" when I print the table in the repl?
thank you in advance!
@bakpakin:matrix.org It is not a problem with Janet. I figured out the problem. The Documentation should include a note to Check-Mark the C++ Build tools when installing the VS Build Tools. Now when i type cl.exe it gives me this: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools>cl.exe
Microsoft (R) C/C++ Optimizing Compiler Version 19.16.27048 for x86
Copyright (C) Microsoft Corporation. All rights reserved.
usage: cl [ option... ] filename... [ /link linkoption... ]
sudo jpm deps:
$ sudo jpm deps From https://github.com/janet-lang/json * branch HEAD -> FETCH_HEAD HEAD is now at c4671e8 Use normal, module level import in test file. compiling json.c to build/json.o... json.c:23:10: fatal error: 'janet.h' file not found #include <janet.h> ^~~~~~~~~ 1 error generated. error: command failed with non-zero exit code 1 error: build fail in pdag [/opt/homebrew/Cellar/janet/1.22.0/lib/janet/jpm/dagbuild.janet] (tailcall) on line 79, column 23 in <anonymous> [/opt/homebrew/Cellar/janet/1.22.0/lib/janet/jpm/pm.janet] on line 215, column 9 in <anonymous> [/opt/homebrew/Cellar/janet/1.22.0/lib/janet/jpm/pm.janet] on line 200, column 5 in bundle-install [/opt/homebrew/Cellar/janet/1.22.0/lib/janet/jpm/pm.janet] on line 198, column 3 in deps [/opt/homebrew/Cellar/janet/1.22.0/lib/janet/jpm/commands.janet] (tailcall) on line 198, column 7 in _thunk [/usr/local/bin/jpm] (tailcall) on line -1, column -1 in cli-main [boot.janet] on line 3759, column 17
I would be careful with a Common Lisp tutorial, Janet is not common lisp.
Your issue is that you need to declare a binding first with def. For example, (def name (getline)) will store a buffer in a binding name.