<hightower3>
Daniel-Worrall: Done, thanks, good suggestions
<hightower3>
Blacksmoke16 cool, static events seem like a really interesting approach to certain types of requirements
<FromGitter>
<Blacksmoke16> Yea, the requirement you did for like removing and adding dynamically makes it a bit trickier
<FromGitter>
<Blacksmoke16> As we found out hq
<FromGitter>
<Blacksmoke16> Ha
<hightower3>
hehe :)
<FromGitter>
<ilanpillemer> methods via class seem much slower than methods just in a module.. is that expected?
<FromGitter>
<Blacksmoke16> Benchmark it?
dwdv has left #crystal-lang ["leave"]
<FromGitter>
<ilanpillemer> well.. the one version finishes running and the other doesnt
<FromGitter>
<ilanpillemer> so I cant benchmark something so slow it never finishes!
<FromGitter>
<ilanpillemer> maybe if I left it overnight..
<FromGitter>
<ilanpillemer> just wondering if that is expected
<FromGitter>
<tenebrousedge> not really
<hightower3>
Hey remind me please, how can I see what text macros expanded into at some point in code? I thought it was something like {{ debug }} but can't get it to work
<FromGitter>
<Blacksmoke16> That's it but you have to add it to the macro or within begin end tags
<hightower3>
It seems that method description is not preserved over more than 1 macro... like... (example follows :)
<hightower3>
I have also tried defining macros in a single line to avoid the potential issue of a newline appearing between documentation and "class", but it didn't help
<hightower3>
Also while doing that I seem to have found that while e.g. "def x()nospaceMoreText" works, "macro x()nospaceMoreText" throws error
<hightower3>
Well, at least in some cases it doesn't... got one example where it works, one where not
<FromGitter>
<Daniel-Worrall> hightower3 do you know if your event lib is MT safe?
<hightower3>
The only part where it writes something is when it is adding the handler into the array of handlers, or when removing something from that array.
<hightower3>
It uses #insert_at and #delete for that.
<hightower3>
So... should have a good chance for yes?
<FromGitter>
<phangs> hello, newbie here
<FromGitter>
<Blacksmoke16> o/
<hightower3>
\o
<FromGitter>
<phangs> i'm new in programming but have done few small apps using node, the basic stuff. html, css, js. now i want to shift to real programming and decided to use crystal. unfortunately there are a very few resource for newbies. any pointers? i tried using amber and followed starter guide but i realized i should not use a framework to automate some tasks.
<FromGitter>
<tenebrousedge> I like using frameworks and automation
<FromGitter>
<Blacksmoke16> hightower3: what would the use case be for supporting removing listeners at runtime?
<hightower3>
Blacksmoke16 well just one which I've seen in the source code I was looking at, a handler attaches itself and then removes itself if it detects a more suitable handler being subscribed
<FromGitter>
<phangs> those are great resources, bookmarked
<FromGitter>
<Blacksmoke16> im trying to think if i should support it
<FromGitter>
<phangs> thank you very much
<FromGitter>
<Blacksmoke16> np
<hightower3>
another reason would be anything conditional, like e.g. turning mouse events on/off at will
<FromGitter>
<Blacksmoke16> was thinking more so in the web framework context
<FromGitter>
<Blacksmoke16> i mean if i can do it i my as well?
<FromGitter>
<Blacksmoke16> im sure someone could come up with something where "oh i wish i could do x"
<hightower3>
certainly :)
<FromGitter>
<Blacksmoke16> ill keep you posted π i think it'll be pretty clean
<FromGitter>
<Blacksmoke16> ah the default value breaks it
<FromGitter>
<Blacksmoke16> that should prob be an error...
<FromGitter>
<ImAHopelessDev_gitlab> @watzon it's going well! I've been a code warrior with Crystal lately
<FromGitter>
<ImAHopelessDev_gitlab> @phangs just take a look at the gitbook tbh. that's what i did
f1refly has joined #crystal-lang
FromGitter has quit [Remote host closed the connection]
FromGitter has joined #crystal-lang
f1reflyylmao has quit [Ping timeout: 268 seconds]
f1refly has quit [Ping timeout: 240 seconds]
f1reflyylmao has joined #crystal-lang
<FromGitter>
<Daniel-Worrall> Blacksmoke, hot loading and removing plugins that act on events. Ability to add and remove at runtime is a large benefit.
<FromGitter>
<Blacksmoke16> would you be ok with a more explicit way of adding them dynamically?
<FromGitter>
<Blacksmoke16> cant do much casting magic like i can at runtime
<FromGitter>
<Blacksmoke16> well could use a macro to help i think, so maybe wouldnt be *too* bad
ht_ has joined #crystal-lang
<FromGitter>
<watzon> @Blacksmoke16 how goes adding that feature to CrSerializer?
ht_ has quit [Remote host closed the connection]
Stephanie has quit [Ping timeout: 240 seconds]
Vexatos has quit [Ping timeout: 240 seconds]
Stephie has joined #crystal-lang
alexherbo27 has joined #crystal-lang
alexherbo27 has quit [Read error: Connection reset by peer]
Vexatos has joined #crystal-lang
alexherbo27 has joined #crystal-lang
_whitelogger has joined #crystal-lang
DTZUZO has quit [Ping timeout: 268 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 240 seconds]
HumanG33k has joined #crystal-lang
olbat[m] has quit [Remote host closed the connection]
beepdog has quit [Remote host closed the connection]
vegai has quit [Remote host closed the connection]
ternarysolo has quit [Write error: Connection reset by peer]
erdnaxeli has quit [Read error: Connection reset by peer]
DTZUZO has joined #crystal-lang
duane has quit [Ping timeout: 240 seconds]
return0e has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
DTZUZO has quit [Ping timeout: 246 seconds]
<FromGitter>
<Blacksmoke16> @watzon debating if i should try to support nested types
<FromGitter>
<Blacksmoke16> is a bit tricker as i need to do everything so its format agnostic
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
<hightower3>
Who can be contacted regarding (re)enabling SSL on crystal-ann ?
vegai has joined #crystal-lang
DTZUZO has joined #crystal-lang
DTZUZO has quit [Remote host closed the connection]
<hightower3>
Is there anything to be discussed regarding Tenebrousedge's related question, as to why https://play.crystal-lang.org/#/r/807s couldn't automatically use the block as a proc?
<hightower3>
actually... I'm not sure what the question was there.
<FromGitter>
<tenebrousedge> it's related to the React problem on Exercism
<hightower3>
I notice one inconvenient behavior. I thought the first line of documentation is taken as headline / short description. However, only the first sentence on the first line is taken.
<hightower3>
What's the general opinion on this, and was this added because too much documentation was improperly formatted, having overly long first lines?
woodruffw has quit [Ping timeout: 268 seconds]
<repo>
not sure if i have an opinion on that
<repo>
i guess i would prefer treating the whole line as a headline/short description
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
woodruffw has joined #crystal-lang
dannyAAM has joined #crystal-lang
gangstacat has joined #crystal-lang
<FromGitter>
<Blacksmoke16> its the first sentence or the first line
<FromGitter>
<Blacksmoke16> er let me rephrase
<FromGitter>
<Blacksmoke16> its always the first sentence, either the ending character is a newline or a period
<hightower3>
Yes, yes, and I found it inconvenient to be first sentence. I hoped for first line, regardless of dots appearing in it.
Human_G33k has joined #crystal-lang
HumanG33k has quit [Ping timeout: 268 seconds]
<repo>
hmmm it seems HTTP::Client isn't threadsafe
<repo>
if i wrap the @client.exec(...) in a mutex it works
<hightower3>
mm I see that if I do "x = true", it doesn't show up in documentation with documented type, whereas if I do "x : Bool[ = value]" it does. Is this a known limitation of crystal 'docs' command?
<FromGitter>
<Blacksmoke16> why would it? its just text
<hightower3>
Also I find it suboptimal that if I do "x : Bool = true", the default of 'true' is not documented; it only shows type.
<FromGitter>
<Blacksmoke16> or do you mean when you do like `def foo(x = true)`
<hightower3>
I have like this exactly: "class_property? async = true". I first had to add type("async : Bool") for the type to show in the docs, but "= true" didn't show in any case.
return0e has quit [Remote host closed the connection]
return0e has joined #crystal-lang
<FromGitter>
<Blacksmoke16> prob is a side affect of having optional types, in that case, the type of async was inferred from the bool
<FromGitter>
<Blacksmoke16> i always specify both type and default for that purpose, and just makes it more clear in the future
<hightower3>
yes, I did so but still no default value showing
<FromGitter>
<Blacksmoke16> prob is more so because the default is applied to the class var, which neither class vars nor ivars are shown in the docs
<FromGitter>
<Blacksmoke16> only methods
<hightower3>
yeah, that must be it
<hightower3>
almost forces me to define a constant with default value then set var's default to that constant
<hightower3>
so that at least the constant is documented
<FromGitter>
<Blacksmoke16> does it make sense for it to be a class level thing?
<FromGitter>
<Blacksmoke16> never going to need to have one instance be async and another not?
<hightower3>
Yes, well even more specifically I define it on the module... just 3 or 4 globally configurable knobs
<FromGitter>
<Blacksmoke16> fair enough
alexherbo276 has quit [Ping timeout: 240 seconds]
alexherbo276 has joined #crystal-lang
<FromGitter>
<watzon> @Blacksmoke16 nested types would be nice af, but if not there are worse things if you're not able to
<FromGitter>
<Blacksmoke16> yea would be nice but i'll have to mess with it more
<FromGitter>
<Blacksmoke16> kinda got sidetracked with my event thing
<FromGitter>
<watzon> Ahh making an event handler for Athena?
<FromGitter>
<Blacksmoke16> will be its own shard, but used in Athena yea
<FromGitter>
<watzon> I may integrate that into my library too. I'm gonna need a good event management library.
<FromGitter>
<Blacksmoke16> idea is for it to replace `HTTP::Handler` middleware
<FromGitter>
<Blacksmoke16> i.e. another shard, or another Athena component could simply define a listener on like `request` on `exception`, and it would just work
<FromGitter>
<Blacksmoke16> w/o having to add it to the handlers array
<FromGitter>
<watzon> That's cool
<FromGitter>
<Blacksmoke16> main use case would be mainly on exception and request
<FromGitter>
<Blacksmoke16> request event could handle stuff like CORs
<FromGitter>
<Blacksmoke16> request listeners*
<FromGitter>
<Blacksmoke16> while exception could first globally log the exception before returning the response etc
<FromGitter>
<Blacksmoke16> is the plan at least :p
<FromGitter>
<tenebrousedge> It's been broken for a long time
<hightower3>
I looked at it about 10 days ago, also didn't work
<FromGitter>
<bajro17> @vladfaust are you here :)
<FromGitter>
<igor-alexandrov> Hi guys, just wanted to pay your attention once again to Shrine.cr: https://github.com/jetrockets/shrine.cr. For the previous month I stabilized API, added documentation and more specs. Plan is to finish `Shrine::UploadedFile` API till the end of November and start working on a ORM integrations in December.