globalkeith has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
globalkeith has joined #crystal-lang
globalkeith has quit [Client Quit]
globalkeith has joined #crystal-lang
<BlaXpirit>
m4t, well you aren't wrong to expect this to work. i couldn't achieve a good result with this kind of layout
<BlaXpirit>
unfortunately if you want to combine multiple macros, seems like that's possible only by calling a macro inside a macro
ruby_ has joined #crystal-lang
<BlaXpirit>
yeah it would be a great feature to have
ruby_ has quit [Ping timeout: 244 seconds]
globalkeith has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<m4t>
Ok, In fact I have no access to the « do_something » macro (it's a library defined), so I can't call my macro
<m4t>
I will stop being lazy and define my NamedTuple manually ^^
<m4t>
or maybe there is an other way to dynamically create a NamedTuple from a range ?
soveran has joined #crystal-lang
<m4t>
or not, I can't even store it in a variable, I got the same exception
<BlaXpirit>
m4t, yeah :( I wish there was a way. strange that I never ran into such a situation
Oliphaunte has joined #crystal-lang
<BlaXpirit>
the expression passed to a macro is passed as a syntax tree, without resolving any variables
<BlaXpirit>
it's important because what if the variable/method doesn't exist but the macro still wants the expression to be valid?
A124 has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
<m4t>
I don't know, it's too deep in crystal internals for me :p
onethirtyfive has joined #crystal-lang
crystal-lang468 has joined #crystal-lang
globalkeith has joined #crystal-lang
snsei_ has quit [Remote host closed the connection]
snsei has joined #crystal-lang
onethirtyfive has quit [Ping timeout: 276 seconds]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit []
tilpner_ has joined #crystal-lang
ruby_ has joined #crystal-lang
tubbo has left #crystal-lang ["outie 5000"]
akwiatkowski has quit [*.net *.split]
tilpner has quit [*.net *.split]
bjmllr has quit [*.net *.split]
Tophe has quit [*.net *.split]
Davy_CC has quit [*.net *.split]
leafybasi has quit [*.net *.split]
tilpner_ is now known as tilpner
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 250 seconds]
ruby_ has quit [Remote host closed the connection]
ruby_ has joined #crystal-lang
ruby_ has quit [Ping timeout: 244 seconds]
bjmllr has joined #crystal-lang
Davy_CC has joined #crystal-lang
Tophe has joined #crystal-lang
akwiatkowski has joined #crystal-lang
leafybasi has joined #crystal-lang
ruby_ has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
soveran has quit [Remote host closed the connection]
pawnbox has quit [Ping timeout: 244 seconds]
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: https://git.io/viCvZ
<crystal-gh>
crystal/master 8e723f5 Ary Borenszweig: Compiler: never skip zero initializers. Fixes #3272
pawnbox has joined #crystal-lang
onethirtyfive has joined #crystal-lang
onethirtyfive has quit [Ping timeout: 244 seconds]
willl has joined #crystal-lang
<crystal-gh>
[crystal] maiha opened pull request #3275: Compiler: mark LLVM return type as Nil when program ends with no typed ASTNode (master...typeless-as-nil) https://git.io/viCkI
<FromGitter>
<Sija> anyone knows how to define array of pointers in type grammar?
snsei_ has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
mgarciaisaia1 has joined #crystal-lang
mgarciaisaia1 has left #crystal-lang [#crystal-lang]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 264 seconds]
<FromGitter>
<wrq> asterite, prepare to be *notorious*
<RX14>
@wrk, your aggressive comments don't really help your cause
<FromGitter>
<wrq> why? because it offends you? makes you uncomfortable?
<FromGitter>
<wrq> fuel for the cause, tbh. freedom isnt about what you find appealing
<RX14>
true, but asterite is *free* to regulate his community how he wishes, and I can certainly understand asterite not wanting true freedom if that means dealing with people like you
<FromGitter>
<wrq> not exactly
<FromGitter>
<wrq> a crystal fork will eventually be organized
<RX14>
ok, so of all the projects who have a code of conduct
<RX14>
exactly how many have *succesfully* forked because of dissent to it?
<FromGitter>
<wrq> im not sure what you're asking
<RX14>
you're wording it as if anybody gives a shit
<RX14>
which i disagree with
<FromGitter>
<wrq> ok
<FromGitter>
<wrq> cool
<RX14>
i would mildly prefer for the CoC to be removed
<FromGitter>
<wrq> almost everyone in that thread wants it gone
<RX14>
but i don't think that the community is t all willing to fork over it
<FromGitter>
<wrq> i didnt say the community
<FromGitter>
<wrq> manas doesnt have a lot of money to actually fund crystal. once it gets more featureful, with some of my extensions, and a little bit more elbow grease, a fork could attract much more substantial sponsors
<FromGitter>
<wrq> thats the beauty of FOSS
<RX14>
yes but forks need a reason
<FromGitter>
<wrq> wrong
<RX14>
and the CoC is not reason enough to get a single company behind you
<FromGitter>
<wrq> forks need maintainers, developers, and money
<RX14>
yes
<RX14>
and those generate additional work on the fork
<RX14>
which can progress the fork beyone the original
<RX14>
which is
<RX14>
oh guess what
<RX14>
a reason
<FromGitter>
<wrq> i cant parse whatever you just said
onethirtyfive has joined #crystal-lang
onethirtyfive has quit [Ping timeout: 244 seconds]
pduncan has joined #crystal-lang
pduncan has quit [Ping timeout: 250 seconds]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 244 seconds]
<crystal-gh>
[crystal] bcardiff opened pull request #3276: Add WeakRef class (master...feature/weakref) https://git.io/viCoT
<Yxhuvud>
.. why on earth would anyone think a code of conduct is a: worth forking for and b: a CoC-less project would get more support than one with a CoC?
<BlaXpirit>
Sija, you're trying random stuff :( Array can be an arbitrarily complex data structure, while 'ports' is just a pointer, which is just a number
<BlaXpirit>
and you're casting one to another
<FromGitter>
<Sija> hmm, that’s supposed to be a pointer to a `\NULL` terminated array of pointers of `LibSerialPort::Sp_port` structures
<BlaXpirit>
array == pointer that happens to point to an allocated block of memory
<BlaXpirit>
it being null terminated complicates things
<FromGitter>
<Sija> yes, i know that, thank you. it’s more about the complications i’m coming here
<BlaXpirit>
Sija, `arr = [] of LibSerialPort::Sp_port; while ports; arr << ports.value; ports += 1; end`
<FromGitter>
<Sija> `Invalid memory access (signal 11) at address 0x7fdfc0500000`
<BlaXpirit>
please show how you defined the function in crystal. and the code itself has a chance to contain a mistake too
<BlaXpirit>
and don't forget about the `!= SP_OK` part - in fact, it might be "not ok"
<BlaXpirit>
alright, so I guess it doesn't copy the structs but gives pointers. well the simple solution is to replace the code `ports.value` with `ports.value.value`
<BlaXpirit>
but at this point it's worth to think if it's worth trying to prevent the copying
<BlaXpirit>
but how did that compile in the first place? I must be making a mistake again
<BlaXpirit>
anyhow, this is definitely not a step in the right direction
<BlaXpirit>
I don't see why it breaks. the *gist* you last posted looks perfect to me
<FromGitter>
<Sija> my guess would be an issue with `\NULL` terminated Array
<BlaXpirit>
Sija, have you tried printing those instead of adding them to an array? (please return to the code in the gist) - does it manage to print anything before failing?
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
perks has quit [Quit: perks]
<BlaXpirit>
Sija, oh and I guess modifying the original pointer by doing +=1 wasn't such a good idea, because the original pointer is needed to pass to sp_free_port_list
<BlaXpirit>
if only there was an easy way for me to debug this on site