ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.30.1 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
alex`` has quit [Ping timeout: 245 seconds]
return0e has quit [Read error: Connection reset by peer]
return0e has joined #crystal-lang
<FromGitter> <watzon> @Blacksmoke16 why would it be giving me the error ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d69de975c4d6813a533e67f]
<FromGitter> <watzon> I can't figure out why it's trying to instantiate `EchoBot` in the macro
<FromGitter> <watzon> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d69dec3b156cd5e75b2b756]
chemist69 has quit [Ping timeout: 276 seconds]
<FromGitter> <watzon> Well fuck ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d69eccdb156cd5e75b30a1b]
chemist69 has joined #crystal-lang
DeBot has quit [Quit: Crystal IRC]
jhass has quit [Read error: Connection reset by peer]
asterite has quit [Read error: Connection reset by peer]
absolutejam has joined #crystal-lang
ht_ has joined #crystal-lang
devil_tux has joined #crystal-lang
devil_tux has quit [Ping timeout: 258 seconds]
alex`` has joined #crystal-lang
devil_tux has joined #crystal-lang
absolutejam has quit [Quit: WeeChat 2.5]
<FromGitter> <zhenfeng-zhu> does crystal has abstract class or interface?
<FromGitter> <absolutejam_gitlab> Both
<FromGitter> <absolutejam_gitlab> Abstract classes and modules with include
<FromGitter> <absolutejam_gitlab> That act as an interface
<FromGitter> <watzon> Yup. There are also abstract methods for abstract classes.
alex`` has quit [Ping timeout: 245 seconds]
<FromGitter> <zhenfeng-zhu> got it,thanks
alex`` has joined #crystal-lang
devil_tux has quit [Ping timeout: 245 seconds]
devil_tux has joined #crystal-lang
Human_G33k has quit [Remote host closed the connection]
devil_tux has quit [Ping timeout: 244 seconds]
devil_tux has joined #crystal-lang
devil_tux has quit [Ping timeout: 245 seconds]
devil_tux has joined #crystal-lang
<FromGitter> <Blacksmoke16> @watzon rip
devil_tux has quit [Ping timeout: 258 seconds]
<FromGitter> <absolutejam_gitlab> Flutter looks interesting but dart just looks like typescript
<FromGitter> <absolutejam_gitlab> Unrelated but I know @watzon has raved about it before, and I just decided to check it out
<FromGitter> <zhenfeng-zhu> Error: undefined method 'get_text' for Nil (compile-time type is (SimpleToken | Nil))
<FromGitter> <j8r> @zhenfeng-zhu https://play.crystal-lang.org/ please
<FromGitter> <zhenfeng-zhu> @j8r sorry,I can't open the website
<FromGitter> <tenebrousedge> you need to make sure that object won't ever be nil. We can't help without more context. If that website is blocked, use a pastebin
<FromGitter> <zhenfeng-zhu> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d6a8542d3fda15e743fe7e3]
<FromGitter> <zhenfeng-zhu> yeah, i found that the object is nil
<FromGitter> <zhenfeng-zhu> this is my function
<FromGitter> <tenebrousedge> no, your function is calling `get_text`
<FromGitter> <zhenfeng-zhu> > ``` ⏎ > def read ⏎ > if @pos < @tokens.size ⏎ > t = @tokens[@pos] ⏎ > @pos += 1 ... [https://gitter.im/crystal-lang/crystal?at=5d6a8654375cc34fdeeefc90]
<FromGitter> <zhenfeng-zhu> if pos
<FromGitter> <tenebrousedge> I would probably use Iterator (https://crystal-lang.org/api/0.28.0/Iterator.html) and define a `next` method
<FromGitter> <tenebrousedge> but I'm not sure if that's your problem right now
<FromGitter> <zhenfeng-zhu> ```code paste, see link``` ⏎ ⏎ i got a instance from the read function, but the instance mybe nil, but i want to use the instance when it not be nil [https://gitter.im/crystal-lang/crystal?at=5d6a87a438499c13a6780078]
<FromGitter> <tenebrousedge> you should actually compare the class there, not do a string comparison
<FromGitter> <tenebrousedge> `is_a?`
<FromGitter> <tenebrousedge> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d6a882e7b263a4c9c88f409]
<FromGitter> <zhenfeng-zhu> @tenebrousedge thank you!!!!
<FromGitter> <tenebrousedge> Iterator would let you write: ⏎ ⏎ ```tokenReader.each { |token| puts "#{token.get_text}\t\t#{token.get_type}" }``` [https://gitter.im/crystal-lang/crystal?at=5d6a88a829dba2421cdcb8e6]
DTZUZO has quit [Ping timeout: 268 seconds]
<FromGitter> <Daniel-Worrall> I would say
<FromGitter> <Daniel-Worrall> ``````
<FromGitter> <Daniel-Worrall> okay, mobile gitter sucks
devil_tux has joined #crystal-lang
<FromGitter> <absolutejam_gitlab> ``````
devil_tux has quit [Ping timeout: 244 seconds]
mps has joined #crystal-lang
devil_tux has joined #crystal-lang
return0e has quit [Read error: Connection reset by peer]
<FromGitter> <Daniel-Worrall> I've found something weird. I can't seem to SIGKILL (Ctrl+C) this code ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d6aa158375cc34fdeefbd47]
return0e has joined #crystal-lang
<FromGitter> <Daniel-Worrall> I've already tried reducing it further with no luck
devil_tux has quit [Ping timeout: 245 seconds]
devil_tux has joined #crystal-lang
<FromGitter> <tenebrousedge> @Daniel-Worrall have you tried sending it with `kill`?
<FromGitter> <Daniel-Worrall> kills fine... I *think* kemal might be binding the signals and it isn't getting a chance to run once inside the while loop
DTZUZO has joined #crystal-lang
<FromGitter> <asterite> `while true; end` will block forever that fiber. Try doing `sleep` (without args) instead
<FromGitter> <Daniel-Worrall> True, but it still recognises a Kemal flaw in that it traps the sigkill
<FromGitter> <Daniel-Worrall> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d6aae1c418f705d876c89e7]
<FromGitter> <asterite> sorry, I don't understnad the bug or problem
<FromGitter> <Daniel-Worrall> Not an immediate problem I guess, but Kemal are working on allowing multiple kemal servers per app and so it would need to be able to handle both on sigkill to exit gracefully
<FromGitter> <Daniel-Worrall> unless you can register 2 of those
<FromGitter> <Daniel-Worrall> idk
<FromGitter> <Daniel-Worrall> yeah, it just overwrites the block
<FromGitter> <Daniel-Worrall> Could trap be changed to allow extending the code ran?
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
devil_tux has quit [Ping timeout: 245 seconds]
<FromGitter> <kalinon> Anyone know of a way to find all the included modules in class using macros? Or better yet all iterate through a list of classes the module was included in? aka something like `all_subclasses` but for modules.
<FromGitter> <Blacksmoke16> doesnt exist atm
<FromGitter> <kalinon> Was afraid of that
<FromGitter> <kalinon> didnt see anything in the source
<FromGitter> <kalinon> ok, will need to do some hacking
<FromGitter> <kalinon> lol
<FromGitter> <Blacksmoke16> sec
<FromGitter> <kalinon> oooo. guessing you have an example
<FromGitter> <kalinon> i wasn't able to tell if a class had a module (via `Object.all_subclasses`) so i was thinking i may need to switch to an annotation, to then inject a module instead
<FromGitter> <kalinon> yess
<FromGitter> <kalinon> Ive been digging into the compiler more, but no where near i can start making PRs. but i will use yours as a learning opportunity.
<FromGitter> <kalinon> i find these macros amazingly powerful
<FromGitter> <Blacksmoke16> you got lucky and i happened to be messing with this a week or so ago haha
<FromGitter> <kalinon> yeah for your assert lib?
<FromGitter> <Blacksmoke16> i think so? dont really remember
<FromGitter> <kalinon> heh
Groogy has joined #crystal-lang
<FromGitter> <Blacksmoke16> i think i determined a parent abstract class was better for this usecase
<FromGitter> <watzon> @absolutejam_gitlab I'd say dart is closer to Java tbh, but really they're all kinda similar. Dart has some benefits over typescript, but it's also missing some things that typescript has, like Unions
devil_tux has joined #crystal-lang
devil_tux has quit [Ping timeout: 258 seconds]
devil_tux has joined #crystal-lang
<FromGitter> <lbarasti> Hi folks, I'm looking into `Response#content_length`, which in turn calls HTTP.content_length: https://github.com/crystal-lang/crystal/blob/cbf651affab414c0f8f02c5d4ed3c77fd69b744d/src/http/common.cr#L271 ⏎ ⏎ When hitting a simple Kemal server with something like ⏎ ⏎ ```Unhandled exception in spawn: Invalid UInt64: Nil (ArgumentError)``` [https://gitter.im/cryst
<FromGitter> ... al-lang/crystal?at=5d6acc1cb156cd5e75b8e412]
<FromGitter> <lbarasti> is this expected? Is `HTTP.content_length` ever going to return `Nil` as the compiled signature suggests?
<FromGitter> <absolutejam_gitlab> shouldn't that method cast it to an int?
<FromGitter> <absolutejam_gitlab> I'm surprised the crystal source uses type inference as much as it does
<FromGitter> <absolutejam_gitlab> I'm a big fan of explicit type declarations
<FromGitter> <tenebrousedge> you've mentioned
<FromGitter> <absolutejam_gitlab> I know they probably have test coverage but it's kinda a place I'd have expected as safety as possible
<FromGitter> <absolutejam_gitlab> did I mention I like explicit type declarations?
<FromGitter> <absolutejam_gitlab> as much safety*
<FromGitter> <absolutejam_gitlab> I accidentally a word
<FromGitter> <tenebrousedge> yes
<FromGitter> <tenebrousedge> @absolutejam_gitlab do you cook?
<FromGitter> <absolutejam_gitlab> as much as I need to feed my family
<FromGitter> <absolutejam_gitlab> don't have time for much beyond
<FromGitter> <tenebrousedge> I'm casting about for new recipe ideas
<FromGitter> <watzon> @lbarasti content length isn't always going to be defined as far as I know, so it's definitely possible for it to be nil
<FromGitter> <lbarasti> the thing is @watzon, even when suppressing the header explicitly, as in ⏎ ⏎ ```curl http://0.0.0.0:3000/ -H "Content-Length:"``` ⏎ ⏎ the header is parsed as `0`, as far as I can see [https://gitter.im/crystal-lang/crystal?at=5d6ad2f329dba2421cde9eca]
<FromGitter> <lbarasti> sorry, that's not true. The header suppression does work on GET, but not on POST ⏎ ⏎ ```curl -X POST http://0.0.0.0:3000/ -H "Content-Length:"``` ⏎ ⏎ will parse as content-length: 0 [https://gitter.im/crystal-lang/crystal?at=5d6ad3f6b156cd5e75b91a7b]
<FromGitter> <lbarasti> so I think I get why the signature for content_length is `UInt64 | Nil` :)
<FromGitter> <lbarasti> the `Unhandled exception in spawn: Invalid UInt64: Nil (ArgumentError)` on invalid content-length header seems undesirable to me, though. Thoughts?
<FromGitter> <Blacksmoke16> hmm
<FromGitter> <Blacksmoke16> the error makes sense but im wondering where the Nil comes from
<FromGitter> <absolutejam_gitlab> so, I'm a bit useless when it comes to understanding compile-time operations, but
<FromGitter> <lbarasti> The thing with the error as is is that it makes it really hard for me to handle it in a graceful way
<FromGitter> <Blacksmoke16> cant you just catch it?
<FromGitter> <absolutejam_gitlab> I can validate the contents of an array and such that I would do at run-time, also at compile-time right?
<FromGitter> <Blacksmoke16> i.e. return a 500 if something throws you're not handling
<FromGitter> <absolutejam_gitlab> I've been working on a CLI parser and I have logic to verify that some mutually exclusive parts aren't used, but it's currently validated at runtime because it's all I knew at the time
<FromGitter> <Blacksmoke16> @absolutejam_gitlab im assuming you mean like an array assigned to a const?
<FromGitter> <lbarasti> I guess I should add a custom request handler https://github.com/kemalcr/kemal/blob/master/src/kemal/helpers/helpers.cr#L17
<FromGitter> <absolutejam_gitlab> Well, the person using the lib would instantiate a `Command` class and add their flags, etc.
<FromGitter> <lbarasti> and make it a 400 rather than a 500 I guess @Blacksmoke16, as it's the client that sent garbage in
<FromGitter> <absolutejam_gitlab> would I need a macro that's called?
<FromGitter> <Blacksmoke16> @lbarasti in this case yea
<FromGitter> <Blacksmoke16> but i mean you should prob return 500 for *any* unhandled exceptions
<FromGitter> <Blacksmoke16> since you can catch this one now you can change that to a 400
<FromGitter> <lbarasti> I'm happy with this, thanks for your help everyone :) ⏎ ⏎ > but i mean you should prob return 500 for *any* unhandled exceptions ⏎ ⏎ makes sense [https://gitter.im/crystal-lang/crystal?at=5d6ada12fda04e4c9d4dfcb8]
<FromGitter> <Blacksmoke16> yea, then you can handle the actionable ones gracefully
<FromGitter> <Blacksmoke16> @absolutejam_gitlab id need an example, but you cant access runtime values at compile time obs
<FromGitter> <absolutejam_gitlab> So, a bad example from the WIP docs
<FromGitter> <absolutejam_gitlab> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d6adaacb156cd5e75b946d6]
<FromGitter> <absolutejam_gitlab> say the user called `add_flag` where both of them had the same `flag.long` or `flag.short`, it should fail
<FromGitter> <Blacksmoke16> hmm
<FromGitter> <absolutejam_gitlab> Currently, I do all that checking at runtime
<FromGitter> <Blacksmoke16> i think you'd have to
<FromGitter> <Blacksmoke16> i doubt you have access to those values at compile time
ht_ has quit [Quit: ht_]
<FromGitter> <Blacksmoke16> could use annotations applied to the class or something
<FromGitter> <Blacksmoke16> then could access the files at compile time
<FromGitter> <j8r> I made a CLI builder which is compile-time safe: https://github.com/j8r/clicr
<FromGitter> <absolutejam_gitlab> yeah, I saw that
<FromGitter> <j8r> But, that's all about macros
<FromGitter> <absolutejam_gitlab> appreciate what it does but the syntax isn't for me
<FromGitter> <j8r> I plan in the future to make completion, won't be hard
<FromGitter> <Blacksmoke16> could do something like
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d6add677b263a4c9c8b3acc]
<FromGitter> <Blacksmoke16> could also do something like what i did for `Assert`, have a `Arg` and `Flag` struct that you can new up based on ann values
<FromGitter> <absolutejam_gitlab> am I confused in thinking that my example won't be available at compile time?
<FromGitter> <Blacksmoke16> then you get compile time errors if they forget to supply `name` or pass `"foo"` to `required`
<FromGitter> <Blacksmoke16> i dont think it is
<FromGitter> <Blacksmoke16> because those methods run at runtime
<FromGitter> <absolutejam_gitlab> ah
<FromGitter> <absolutejam_gitlab> I see
<FromGitter> <absolutejam_gitlab> I didn't think about that
<FromGitter> <absolutejam_gitlab> Makes sense
<FromGitter> <absolutejam_gitlab> I don't mind it failing at run-time, it just needs to be noted in the docs and have it print a nice error message from a custom exception
<FromGitter> <Blacksmoke16> 👍
<FromGitter> <absolutejam_gitlab> Just wondered if I could make it happen at compile-time as it is
<FromGitter> <Blacksmoke16> not without entering macro/annotation land
<FromGitter> <Blacksmoke16> might be worth looking into, can do some cool stuff
<FromGitter> <absolutejam_gitlab> I kinda wanted to avoid that unless it's really providing me with a lot of benefit
<FromGitter> <Blacksmoke16> i think it does :p
<FromGitter> <Blacksmoke16> sec
<FromGitter> <absolutejam_gitlab> most of the CLI libraries I saw were so macro heavy and I just wanted a (what I consider) idiomatic way of defining them based on classes & methods
<FromGitter> <absolutejam_gitlab> I mean, I don't want to start going down the DSL route of ⏎ ⏎ ```command do |cmd| ⏎ ... ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=5d6adf18418f705d876de772]
<FromGitter> <absolutejam_gitlab> when I'm just building a nested class structure
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d6ae09e8b7327421dcdc004]
<FromGitter> <Blacksmoke16> like notice what happens if you dont add `name` to flag/arg ann
<FromGitter> <Blacksmoke16> or if you remove the `required`
<FromGitter> <Blacksmoke16> could very easily build out a hash of like `String => BaseCommand`
<FromGitter> <Blacksmoke16> at compile time
<FromGitter> <kalinon> Over the last few months i have been porting Entitas-CSharp (https://github.com/sschmid/Entitas-CSharp) over to crystal. I am happy to say i feel confident to release a stable 1.0.0 of entitas.cr (https://github.com/spoved/entitas.cr). Ive achieved a 3x speed increase in some of the slowest benchmark tests compared to C#.
<FromGitter> <kalinon> pretty excited about it
devil_tux has quit [Ping timeout: 245 seconds]
<FromGitter> <watzon> @kalinon I'm not exactly sure what a entity component system is
<FromGitter> <watzon> Not something I've ever used
<FromGitter> <didactic-drunk> I started working on concurrency primitives (https://github.com/didactic-drunk/concurrent.cr). Thoughts?
<FromGitter> <kalinon> Mainly used in game development, but its an interesting architecture i want to see if it can be used elsewhere @watzon
<FromGitter> <kalinon> @didactic-drunk yeah! go for it!
<FromGitter> <Blacksmoke16> @asterite what are your thoughts on like ⏎ ⏎ ```class Foo(T) ⏎ end ⏎ ⏎ {{Foo.name.stringify}} # => "Foo(T)"``` ⏎ ⏎ Shouldnt the name of the type *not* include the type vars? [https://gitter.im/crystal-lang/crystal?at=5d6af5c48b7327421dce5428]
<FromGitter> <asterite> I don't know
<FromGitter> <asterite> Generics are problematic because of that
<FromGitter> <Blacksmoke16> esp since you can just do like `{{Foo.type_vars.stringify}} # => "[T]"` so its not like thats the only way to access them
<FromGitter> <Blacksmoke16> im having to do `assertion.name.gsub(/\(.*\)/, "")`
<FromGitter> <Blacksmoke16> because otherwise it turns out like `Foo(T)(String).new`
<FromGitter> <j8r> Any cross-compilers here? Any idea for `/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: _main.o: error adding symbols: file in wrong format`
alex`` has quit [Ping timeout: 258 seconds]
<FromGitter> <Blacksmoke16> @kalinon isnt that the same idea as modules?
<FromGitter> <kalinon> yes and no. It utilizes the module system. But it also provides caching for re-use and optimization.
<FromGitter> <kalinon> as well as systems/listeners for when the entities change
<FromGitter> <kalinon> Saves on GC times
<FromGitter> <Blacksmoke16> gotcha
<FromGitter> <kalinon> The C# entitas and all other ports also include a code generator, which is needed to be ran to optimize and generate the code
<FromGitter> <kalinon> but using crystals macros, i eliminated it :D
<FromGitter> <kalinon> This is the best image i have to kind of explain how the whole architecture works (at a high level) ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d6b0286fda04e4c9d4f0de6]
<FromGitter> <Blacksmoke16> hmm prob one of those you have to use it to see its usefulness
<FromGitter> <Blacksmoke16> know like nothing about game de
<FromGitter> <kalinon> i dont know much either lol
<FromGitter> <Blacksmoke16> :p
<FromGitter> <kalinon> but im used to working with large complicated data sets, and this architecture caught my eye
<FromGitter> <kalinon> because i can be used to manage millions of entities and data in a video game, but we dont use systems like this in enterprise level setups
<FromGitter> <kalinon> which are way slower
<FromGitter> <kalinon> so i decided to port it, and see how it worked
<FromGitter> <Blacksmoke16> sounds like a plan
<FromGitter> <kalinon> No entity or component is destroyed or GC'd but thrown back into a pool to be re-used. This doesnt have to only be for video games. Can be metrics, kubernetes pods, anything. the data and structure are agnostic.
<FromGitter> <kalinon> But im most excited because Crystal gave it a 3x speed increase
<FromGitter> <kalinon> :D
<FromGitter> <kalinon> @Blacksmoke16 you in particular may be interested to see some of the crazy shit i did in here: https://github.com/spoved/entitas.cr/blob/master/src/entitas/macros/generator.cr
<FromGitter> <kalinon> I did have to refactor it a bit after you taught me some stuff
<FromGitter> <Blacksmoke16> every time i look at the name i think of https://en.wikipedia.org/wiki/Enchilada
<FromGitter> <Blacksmoke16> 😆
<FromGitter> <kalinon> haha
<FromGitter> <Blacksmoke16> idk why
<FromGitter> <kalinon> Now ill never be able to un-see it
<FromGitter> <Blacksmoke16> `{% for comp, comp_methods in comp_map %}` i think you can add in `, idx`?
<FromGitter> <Blacksmoke16> er no thats a hash
<FromGitter> <kalinon> all thats driven off the annotations on https://github.com/spoved/entitas.cr/blob/master/spec/fixtures/components.cr
<FromGitter> <Blacksmoke16> idk if this is an issue or not, but `component_name.id.underscore` doesnt handle namespaced stuff
<FromGitter> <Blacksmoke16> i.e. `module Foo::Bar` would be `foo::bar`
<FromGitter> <Blacksmoke16> which isnt valid
<FromGitter> <kalinon> their code generators make Separate type restricted Context, Matchers, Groups, and Entities based on the different combinations of crap
<FromGitter> <kalinon> good to know, i made all mine top level
<FromGitter> <kalinon> hmm ill have to think about how to protect for that if someone adds a component in a namespace
<FromGitter> <Blacksmoke16> yea exactly
<FromGitter> <Blacksmoke16> there is the `identify` method in macro land that would turn it into `"foo__bar"`
<FromGitter> <Blacksmoke16> or could do like `.split("::").last.underscore`
<FromGitter> <kalinon> yeah. gsub works too
<FromGitter> <Blacksmoke16> or `.gsub("::", "_")`
<FromGitter> <Blacksmoke16> depending on if you want to include the namespace in the method name or not
<FromGitter> <kalinon> Since i needed to know how to initialize each component
<FromGitter> <kalinon> with args
<FromGitter> <kalinon> that one was fun. Auto generating the initialize, reset, and init. So the class could be created, wiped, and re-used
rohitpaulk has joined #crystal-lang
<FromGitter> <Blacksmoke16> looks like it
<FromGitter> <Blacksmoke16> dont know enough of whats going on to have feedback
<FromGitter> <kalinon> yeah no worries. just excited lol
<FromGitter> <Blacksmoke16> you could do inline ifs
<FromGitter> <kalinon> How so?
<FromGitter> <kalinon> you mean like `{% if kwargs[:default] %} something {% else %} something other {% end %}`
<FromGitter> <Blacksmoke16> yea
<FromGitter> <Blacksmoke16> or even like like `property {{ var.id }} : {{kype}}? {{kwargs[:default] || nil }}`
<FromGitter> <kalinon> yeah i did that in some places. it gets hard to read and the formatter doesnt always hit shit
<FromGitter> <Blacksmoke16> fair enough
<FromGitter> <kalinon> never used the `||`
<FromGitter> <kalinon> ill remember that one
<FromGitter> <Blacksmoke16> think it would have to be
<FromGitter> <Blacksmoke16> `{{kwargs[:default] != nil ? kwargs[:default] : nil }}`
<FromGitter> <Blacksmoke16> otherwise if the default was `false` it would use `nil`
<FromGitter> <kalinon> yeah
<FromGitter> <kalinon> think so
<FromGitter> <kalinon> i think i didnt do that because if it had a default, i didnt union it with nil
<FromGitter> <Blacksmoke16> ah didnt notice that
<FromGitter> <kalinon> because i (or the compiler) wouldnt want it to be unitialized.
<FromGitter> <kalinon> but if no default is given, then i have to set nil. because how do i know what a valid default is
<FromGitter> <kalinon> lol
<FromGitter> <kalinon> defaulting to "" or 0 could break whatever their code is.
<FromGitter> <Blacksmoke16> i mean its kinda redundant to set it to nil, since its the default
<FromGitter> <Blacksmoke16> but yea, is what you would have to do
<FromGitter> <kalinon> yeah. i also use the default when `reset` is called
<FromGitter> <kalinon> everything goes back to its default or nil value
<FromGitter> <Blacksmoke16> aye
<FromGitter> <kalinon> weird stuff. but learned alot
<FromGitter> <Blacksmoke16> i usually want to rewrite everything again after a few months :S
<FromGitter> <kalinon> haha yep
<FromGitter> <kalinon> But now that i have this, and theres no game systems for crystal... guess i need to learn how to make a game engine
<FromGitter> <Blacksmoke16> xD
<FromGitter> <Blacksmoke16> gl
<FromGitter> <kalinon> haha