Help getting with lua: 'in' ; lecture notes 7 ; how is lua extensible

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Help getting with lua: 'in' ; lecture notes 7 ; how is lua extensible

Luke
1. what does 'in' do in e.g. the following from lecture notes 6
image.png

2  lecture notes 7 "more about 'functions", slide 5'says

I have the following in the lua dema



3. the first set of lecture notes saywhat does this mean?

To be specific, I am using lua as a middle layer, with a API designed' by Brian Clarkson, of orthogonal devices, to an er-301 as the cpu. This is a eurorack synthesizer module for manipulation and generation of audio and control voltages. I am wondering if I can program lua to interface (I think is the right word) with CSound code.

Apologies if I have sent this twice!

Thanks
Luke


Reply | Threaded
Open this post in threaded view
|

Re: Help getting with lua: 'in' ; lecture notes 7 ; how is lua extensible

Luke
Apologies, but I don't think all screen-grabs are showing up

The code in lecture 7, for my 2nd question, reads:

function add(...)
local sum = 0
for _, n in ipairs ({ ... }) do
sum = sum + n
end
return sum
end
df = derivative(function (x) return x * x * x end)
print(df(5))

and gives the output

input:8: attempt to call a nil value (global 'derivative')

The 3rd question I asked just quotes that

Lua is an extensible extension language, focusing on multi-language development

Cheers,
Luke
Reply | Threaded
Open this post in threaded view
|

Re: Help getting with lua: 'in' ; lecture notes 7 ; how is lua extensible

Luke
Sorry but in fact the code example should read

image.png
And I get an error at 1e-4

I'm sorry.