great video as always, and here is what i think to be a nicer way to overide the functions in chunks: local block = [[print(1)]] local chunk = load(block) setfenv(chunk, { print = function(x) print(x + 1) end }) chunk(1)
ya, i'm familiar with setfenv, but when I had tried this before I sometimes ran into problems with functions that were already defined and called recursively. I don't remember if I was messing something up or not, but I had some mixed results.
Dude's rewriting org mode in nvim
Next video: "Adding emacs keybindings!"
love the advent of christmas content! thx
great video as always, and here is what i think to be a nicer way to overide the functions in chunks:
local block = [[print(1)]]
local chunk = load(block)
setfenv(chunk, {
print = function(x)
print(x + 1)
end
})
chunk(1)
ya, i'm familiar with setfenv, but when I had tried this before I sometimes ran into problems with functions that were already defined and called recursively. I don't remember if I was messing something up or not, but I had some mixed results.
Is it maybe better to store a reference to the original print function on startup? Capturing on the fly feels dangerous
Yes to extending this plugin for other languages!
Good lord. Try THAT VSC**e.
lol