DerisiveLogic has quit [Ping timeout: 264 seconds]
zamith has quit [Quit: Be back later ...]
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zamith has joined #crystal-lang
zamith has quit [Client Quit]
zamith has joined #crystal-lang
zamith has quit [Client Quit]
zamith_ has joined #crystal-lang
datanoise has joined #crystal-lang
mdz_ has joined #crystal-lang
mdz_ has quit [Ping timeout: 245 seconds]
zipR4ND has joined #crystal-lang
<zipR4ND>
hey jhass: regarding yesterdays question: is there a way to capture a block, save it to some variable and then yield it later with a given environment: like: my_variable = (with @env yield &my_saved_proc)
<jhass>
oh, I thought that was your initial question
<zipR4ND>
hmm, yes your right. sorry, i was confused. so the answer is: no ..
<jhass>
yes ;D
<zipR4ND>
and it can't be achieved with a macro or smth?
<jhass>
you can do def yield_with(env); with env yield; end; yield_with(@env, &block)
<jhass>
that'll compile but the block's context won't be changed
<jhass>
that's what I meant last time
<jhass>
for now builder style simply will give you the least headaches
<jhass>
check crystal hierarchy, really only one ancestry called Environment?
<zipR4ND>
jhass: yes
<jhass>
weird
<jhass>
welp, no code no help I guess
<zipR4ND>
the error occurs when i pass self (which is of class MyEnvironment << Environment) to a proc, that i defined as ->(String, Environment)-> ..
<zipR4ND>
sorry, the code is pretty complicated atm and i didn't manage to strip it down to a simple example because of the hierarchies and proc passing ..
<jhass>
what happens if you try to cast it? .call(env as Environment) ?
<zipR4ND>
the same ..
<zipR4ND>
this Environment+ i dont know what it means, tried not_nil! and casting ..
<jhass>
might be a type interference bug, I don't know :/
<jhass>
Environment+ means that it's a base class for other classes
asterite has joined #crystal-lang
<jhass>
do you ever make an instance of Environment itself?
<asterite>
zipR4ND: you'll have to try to reduce your code, or just give us the code to try it... I'm trying to reproduce it but can't
<BlaXpirit>
asterite, how is Nim? :p
<asterite>
BlaXpirit: you are there too? :-)
<zipR4ND>
jhass, yes i do
<BlaXpirit>
were
<asterite>
Nim is nice, I like it
<zipR4ND>
asterite: your right, maybe i have to do that ..
<asterite>
I listened to the scala talk, but they only talked about the syntax sugar to write less java... I wanted to learn more about other things :(
<BlaXpirit>
that one was indeed slow and boring
<asterite>
and it's called "Building logging services with Scala"
<asterite>
:-S
<BlaXpirit>
ikr
<BlaXpirit>
now u maybe have an idea of what Nim's macros can do
<BlaXpirit>
sure is a unique feature
<asterite>
Definitely, though I'm not entirely convinced too much compile-time power is good... it becomes hard to debug and understand what's going on
<BlaXpirit>
asterite, did u give that lib generator another try?
<BlaXpirit>
i identified your problem yesterday
<asterite>
Yes! It worked, though it didn't work for some lib I tried, can't remember which
<asterite>
maybe sqlite3
<BlaXpirit>
needs a lot of polish for stability
<asterite>
i'd like to continue crystal_lib, actually, but it takes a lot of time
<asterite>
I wish I had a binding generator to generate clang bindings, and then use that to generate the binding generator... hmmm...
<BlaXpirit>
i don't entirely understand
<BlaXpirit>
is this a joke? :
<asterite>
oh, just a silly recursive joke...
<asterite>
why everything has to be recursive in computers?
<BlaXpirit>
well that's not true
<BlaXpirit>
so.. don't you already have clang bindings?
<asterite>
we were writing them as we tried to do crystal_lib, but they are incomplete
<BlaXpirit>
sure takes a lot of work if u want object wrapper
asterite has quit [Quit: Page closed]
<zipR4ND>
ok, i managed to reproduce with a minimal example:
<zipR4ND>
first this one, its running as expected: