<jokke>
jhass: about my question yesterday.. i couldn't get an answer. Do you know why there is no possibility to assign values to instance variables in macros?
<jokke>
as in macro instance variables
<jhass>
I never head such a thing as "macro instance variables"
<jokke>
@type is one
<jokke>
ok i know i'm going pretty overkill with macros in my model project. But i've reached a point where i can't continue without something like instance variables for macros or the ability to manipulate constants by MacroId
<jokke>
the problem is that my macros all access a constanst called FIELDS which is populated on each call of the field macro
<jokke>
if another class wants to add fields to itself the FIELDS constant still contains the fields of the class before
<jhass>
that means you should maintain the FIELDS constant in the leaf class, possible with the help of macro included
<jokke>
so i'd need something like {% "#{@type.id}Fields".id << field %}
<jokke>
jhass: i'm not sure if i can manipulate constants added by macros
<asterite>
I wouldn't recommend abusing macros :-(
<jhass>
asterite: that one confuses me too though
<jhass>
can you explain it?
leafybas_ has joined #crystal-lang
ssvb has joined #crystal-lang
leafybasil has quit [Ping timeout: 246 seconds]
joe_bag_odonuts has joined #crystal-lang
<joe_bag_odonuts>
Just began looking at Crystal. Time.now shows standard time not DST. Looked at the source, see a reference to dst in Libc but no correction for it in any of the methods. Is this intended or a problem?
<jhass>
I think it defaults to UTC
<jeromegn>
Time.utc_now is utc
<jeromegn>
I guess he means, local time doesn't account for DST
<jhass>
kinda expected that they return the same that way :P
<jhass>
well, it's meant to return a localtime, if anybody wants to fix it you have very good chances of getting a patch in ;)
asie has left #crystal-lang ["WeeChat 1.1"]
<crystal-gh>
[crystal] jhass pushed 2 new commits to master: http://git.io/vntnK
<crystal-gh>
crystal/master 2b3102e WolfLee: Fix #1509 String escapes don't work with symbols
<crystal-gh>
crystal/master 007db6f Jonne Haß: Merge pull request #1516 from wolflee/fix_string_escapes_in_symbols...
<jeromegn>
jhass: I saw you were discussing SliceIO with asterite the other day. did that lead to anything? I think you had a divergence of opinion on it resizing itself
<jhass>
we probably will go with MemoryIO that resizes itself
<jhass>
(and has a constructor that allows to set the initial capacity)
<asterite>
It's a bug, apparently macro hooks are type-checked twice :o
<asterite>
So... good catch, I'll fix this :)
<trapped>
i have a spare vps (located in canada) that i can set up to sit behind e.g. cloudflare (for caching) and have you push the docs to it in an hypothetical travis build
<jhass>
asterite: gotcha, will add it to the channel rules ones we write them :P
<trapped>
but i suppose something official would be better
<jhass>
trapped: that's cool, now we just need asterite to decide on a solution :P
<asterite>
For infrastructure, you should definitely talk to waj. He's the sysadmin around here :)
<jhass>
kay, s/asterite/waj/
<waj>
\o/
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: http://git.io/vntNW
<crystal-gh>
crystal/master 3e05f80 Ary Borenszweig: Fixed: macro hooks were incorrectly double type checked
<waj>
can't we just push generated docs to a S3 bucket?
<jhass>
waj: I'd add a separate build to travis that builds the head compiler, then the docs and then uses the linked deploy support of Travis to push it to a S3 bucket at the subpath of /edge/ that's available on http://api.crystal-lang.org
<jhass>
and on release move everything out of the /edge folder into the root directory
waj has quit [Read error: Connection reset by peer]
<crystal-gh>
[crystal] waj pushed 1 new commit to master: http://git.io/vnqkn
<crystal-gh>
crystal/master 5bbf4d1 Juan Wajnerman: Temporary fix for #1402. Proper fix is coming with a small refactor in Compiler/CompileUnit/TargetMachine area.
leafybasil has joined #crystal-lang
<jokke>
jhass: how do i use the concurrent stuff?
<jhass>
with spawn
<jhass>
(ask a more specific question for a more specific answer)
leafybasil has quit [Remote host closed the connection]
<joe_bag_odonuts>
Time.now not returning DST when appropriate patch for time.cr http://pastie.org/10429552
<joe_bag_odonuts>
Code to use to solve DST problem (save as file and require it in your code) http://pastie.org/10429527
<jhass>
joe_bag_odonuts: cool, if you can add some specs we'd love your pull request ;)
<joe_bag_odonuts>
I don’t have a clone of crystal yet. I just looked at the Time api documentation and figured it out from that. If some one has a clone then the first pastie url should give them all they need.
<jhass>
clicking fork and typing git clone is that hard? :P
<joe_bag_odonuts>
Yeah its hard when your away from the office and using a nexus 7 and Juice.
<jhass>
oh, gotcha
trapped has quit [Ping timeout: 265 seconds]
apt-get has quit [Ping timeout: 264 seconds]
apt-get has joined #crystal-lang
havenwood has joined #crystal-lang
apt-get has quit [Read error: Connection reset by peer]
apt-get has joined #crystal-lang
elia has joined #crystal-lang
elia has quit [Client Quit]
elia has joined #crystal-lang
kostya has quit [Remote host closed the connection]
dyulax has quit [Quit: This computer has gone to sleep]
dyulax has joined #crystal-lang
waj has quit [Ping timeout: 260 seconds]
waj has joined #crystal-lang
dyulax93 has joined #crystal-lang
dyulax has quit [Ping timeout: 252 seconds]
leafybasil has joined #crystal-lang
elia has joined #crystal-lang
<BlaXpirit>
jhass, i just had a revelation
<BlaXpirit>
remember when we talked about storing procs in set_user_data
<BlaXpirit>
how about instead storing just a pointer to the wrapper object
<jhass>
asterite: btw do you want to commit joe_bag_odonuts' patches there ^? since you wrote compute_local_ticks
<BlaXpirit>
and then u do whatever you want in the wrapper object
<jhass>
BlaXpirit: that's what I tried to bring across iirc :P
<BlaXpirit>
jhass, hmm
<jhass>
the gotcha is to heap allocate the wrapper object (so it needs to be a class) and keep a reference so it doesn't get GC'd, I guess
<asterite>
Yes, we can add the DST thingy. If you want you can commit it directly (maybe add specs, not sure how to test it)
<jhass>
me neither, hence the "since you wrote comment" :P
<BlaXpirit>
jhass, you may remember another problem i had where i needed to not delete pointers that were given to me for temporary use?
<jhass>
doubt we can set system time on travis :/
<BlaXpirit>
uh i'm not explaining this well
<BlaXpirit>
i always created new wrapper objects even if it was the same pointer
<jhass>
asterite: maybe shell out to `date` or something? idk doesn't feel right
<BlaXpirit>
anyhow, from what I've seen, Pointers seemed magical to me in crystal
<BlaXpirit>
because Array just stores a pointer to data, and somehow it doesn't get collected
<asterite>
Time.now isn't tested, but if you are confident that code does the DST offset, then go for it :)
<BlaXpirit>
so i'm wondering whether pointers prevent an object from being deleted or not
<asterite>
(I can't right now, a bit busy)
<BlaXpirit>
it's also hard to test this kind of thing, because it's hard to make GC actually do its task unless a lot of memory is taken
<crystal-gh>
[crystal] benoist opened pull request #1520: added open timeout to http client (master...master) http://git.io/vnm5M
<BlaXpirit>
anyway, storing a pointer to the object in userdata allows you to prevent the problem of multiple objects wrapping the same pointer, you just return the same old object
<BlaXpirit>
but this can work only if pointers don't act like a reference to the object
<BlaXpirit>
so are pointers strong or weak references where is the definitive answer?
<jhass>
I'm fairly sure they are strong references
<BlaXpirit>
[:16:20] <BlaXpirit> because Array just stores a pointer to data, and somehow it doesn't get collected
<BlaXpirit>
but what if it's just because that pointer is the result of malloc?
<jhass>
mmh, yeah I guess it's actually that way
<jhass>
Foo.new where Foo is a class goes through the same malloc though
<BlaXpirit>
and why dont we have weak references? can i store the pointer as int, will it then still act as a reference (who knows how the GC works, what if it just scans the memory for this value)
<BlaXpirit>
i wanna test all these things, but how???
<BlaXpirit>
i actually tried once but failed to get any useful info
<jhass>
afaik the GC works by scanning all memory allocated by it (or given to it as root) for pointers it returned
<BlaXpirit>
that doesn't convince me either way about this int acting as a pointer to it thing
<BlaXpirit>
even if there was a reliable way for pointers to act as weak references, you can never know whether the memory was deleted by having just this pointer
<BlaXpirit>
well, if you define a finalizer then you can
<crystal-gh>
[crystal] joeydonuts opened pull request #1521: Changed 2 lines in time/time.cr to calculate local time correctily wh… (master...master) http://git.io/vnmxb
<joe_bag_odonuts>
I just did a pull request with the changes I made to time.cr
Neverdie has joined #crystal-lang
<jhass>
joe_bag_odonuts: thanks, I made a comment ;)
waj has quit [Ping timeout: 264 seconds]
waj has joined #crystal-lang
<joe_bag_odonuts>
I’ll take a look over the weekend. I first saw Crystal last night after a few beers, so I’m still getting acquainted ;)