ponga has quit [Quit: Connection closed for inactivity]
<BlaXpirit>
Module validation failed: Incorrect number of arguments passed to called function! \n %6 = call %"String::Builder.170"* @"*Pointer(Void)@Object::to_s<String::Builder>:String::Builder"(%"String::Builder.170"* %5)
<BlaXpirit>
I know this is probably related to my abuse of string interpolation during code generation, but how to debug this?
<BlaXpirit>
this comes from LLVM, seemingly at one of the final stages of compilation
Renich has quit [Ping timeout: 276 seconds]
Renich has joined #crystal-lang
soveran has joined #crystal-lang
A124 has joined #crystal-lang
Renich has quit [Ping timeout: 260 seconds]
avdi has quit [Ping timeout: 260 seconds]
danzilio has quit [Ping timeout: 250 seconds]
daemonwrangler has quit [Ping timeout: 250 seconds]
avdi has joined #crystal-lang
xmgx has quit [Remote host closed the connection]
daemonwrangler has joined #crystal-lang
<FromGitter>
<crisward> trying to pass a variable into a macro, but it's complaining. Any ideas?
<BlaXpirit>
crisward, a good idea would be to provide any kind of information
<FromGitter>
<crisward> just check anyone was listening first...
<FromGitter>
<crisward> using kemal
<FromGitter>
<crisward> need to pass variable into render
<FromGitter>
<crisward> the template comes from a database
<FromGitter>
<crisward> getting the error `undefined macro method 'Var#split'`
<FromGitter>
<crisward> in in macro 'render' /projects/crystal2/libs/kilt/kilt.cr:22, line 2:
danzilio has joined #crystal-lang
<BlaXpirit>
crisward, ok, don't pass a variable, it has to be a literal probably
<BlaXpirit>
but nah, I'm just guessing, this is still no info
<FromGitter>
<crisward> it works with a literal, but how can I create a literal from a variable if that's not a stupid question
<BlaXpirit>
crisward, you can't, the point is that it can't be a runtime value, it is baked into an executable
<BlaXpirit>
or maybe you're using something wrong but i see no code and no traceback
<BlaXpirit>
use a pastebin, like gist.github.com
<FromGitter>
<crisward> sorry, just trying to get my head around macros. So macros get build into real code by the compiler and therefore can't do it with code which is not available at compile time?
<BlaXpirit>
crisward, yes. macros generate code to be compiled
<FromGitter>
<crisward> So if I have a list of templates, at compile time, then use a case statement against my variable, that should work?
<BlaXpirit>
i think so
<FromGitter>
<crisward> Yep that worked!
mgarciaisaia has joined #crystal-lang
mgarciaisaia has left #crystal-lang [#crystal-lang]
soveran has quit [Remote host closed the connection]
masukomi has quit [Quit: masukomi]
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
<jeromegn>
am I guaranteed to always get the same constant values from a C lib bindings?
<jeromegn>
they’re defined like "extern ZOOAPI struct ACL_vector ZOO_OPEN_ACL_UNSAFE;” in zookeeper
<jeromegn>
I don’t understand how those are mapped in the c bindings. I mean, I’ve defined them as prescribed and it works, but I wonder if their values will change on another computer for instance… or another architecture.
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
<BlaXpirit>
jeromegn, did u bind them with a $ ?
<jeromegn>
yes
<BlaXpirit>
jeromegn, they're set in .c files at runtime