ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.31.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
dwdv has quit [Quit: quit]
return0e has quit [Remote host closed the connection]
<FromGitter> <sam0x17> anyone know a way (via macros) to get the ivars for the current scope? like local variables?
<FromGitter> <sam0x17> *not ivars, just local variables
<FromGitter> <Blacksmoke16> No
<FromGitter> <meltheadorable> it’s been a while - how’s folks?
<FromGitter> <tenebrousedge> πŸ‘
<FromGitter> <meltheadorable> cool
<FromGitter> <tenebrousedge> @meltheadorable what's been up to?
<FromGitter> <meltheadorable> just doing stuff besides crystal
<FromGitter> <meltheadorable> reading a lot of books that have nothing to do with coding
<FromGitter> <meltheadorable> etc
<FromGitter> <meltheadorable> suppose nothing major has changed recently?
<FromGitter> <Blacksmoke16> multithreading is an opt in feature now
<FromGitter> <meltheadorable> i did hear about that but i’m not sure it means much to me
<FromGitter> <sam0x17> @tenebrousedge woah what do I need to require to use that stuff
<FromGitter> <sam0x17> aha
<FromGitter> <sam0x17> ok yeah @tenebrousedge this is a way better approach
<FromGitter> <tenebrousedge> cool, I couldn't tell if it was useful
<FromGitter> <meltheadorable> is writing bindings always tedious?
<FromGitter> <Blacksmoke16> checkout https://github.com/crystal-lang/crystal/pull/8336
<FromGitter> <tenebrousedge> people have been after `ifdef` for a while, I think
<FromGitter> <sam0x17> @tenebrousedge looks like you can parse stuff and execute the nodes directly
<FromGitter> <sam0x17> which means I could glue on new nodes to make a repl in theory
<FromGitter> <tenebrousedge> how does that dovetail with what you've been doing?
<FromGitter> <sam0x17> I've just been trying to make a repl
<FromGitter> <tenebrousedge> by serializing data structures, yes
<FromGitter> <sam0x17> this could be a more direct route
<FromGitter> <sam0x17> so far I've been going at it from two approaches, one the serialization approach, and two seeing if I can just save the heap / stack / program counter to a file and re-load them, mixing with new code *somehow*
<FromGitter> <sam0x17> this gets me a lot closer to the second one
<FromGitter> <sam0x17> potentially
<FromGitter> <tenebrousedge> huh. I don't see how, myself, but I have limited insight here
<FromGitter> <sam0x17> I didn't look for something like this because I didn't think it would exist
<FromGitter> <tenebrousedge> oh
<FromGitter> <sam0x17> you can basically call all the compiler internals directly
<FromGitter> <tenebrousedge> yes. Crystal is self-hosted
<FromGitter> <sam0x17> I just didnt realize it would be to the point where you can go "parse this string as crystal source code and give me the AST nodes"
<FromGitter> <sam0x17> and then run that plz k thx bye
<FromGitter> <sam0x17> thought it would be this whole complicated thing
<FromGitter> <tenebrousedge> ah. No, it seems to be relatively painless.
<FromGitter> <sam0x17> right
return0e has joined #crystal-lang
<FromGitter> <Blacksmoke16> https://github.com/Blacksmoke16/oq/pull/37 if anyone wants to review my pr ^.^
<FromGitter> <sam0x17> I guess it didn't occur to me that the compiler modules would be available to whoever includes them
<FromGitter> <sam0x17> from the context of a regular crystal program
<FromGitter> <sam0x17> silly me
<FromGitter> <tenebrousedge> well. Let us know where this gets you. I'm definitely quite interested in your efforts
<FromGitter> <sam0x17> will do!
<FromGitter> <tenebrousedge> I'd even help, if I had a clue what I was about
<FromGitter> <sam0x17> I'm just following various shots into the dark
<FromGitter> <meltheadorable> i’ve got no idea what you’re doing but best of luck
<FromGitter> <Blacksmoke16> finally got the XML deserialization stuff into a spot im decently happy with
<FromGitter> <Blacksmoke16> πŸ’―
return0e has quit [Ping timeout: 268 seconds]
f1refly has quit [Ping timeout: 250 seconds]
f1refly has joined #crystal-lang
sagax has joined #crystal-lang
dostoyevsky has quit [Quit: leaving]
dostoyevsky has joined #crystal-lang
ht_ has joined #crystal-lang
ht_ has quit [Remote host closed the connection]
<FromGitter> <rishavs> Are other folks also seeing this warning in the Crystal compiler? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5dad427ec86aec24c67e3cfb]
absolutejam2 has joined #crystal-lang
return0e has joined #crystal-lang
return0e has quit [Ping timeout: 268 seconds]
absolutejam2 has quit [Ping timeout: 240 seconds]
<FromGitter> <ImAHopelessDev_gitlab> yeah while back
<FromGitter> <ImAHopelessDev_gitlab> i changed and use `verify`
absolutejam2 has joined #crystal-lang
DTZUZO has quit [Ping timeout: 268 seconds]
absolutejam2 has quit [Ping timeout: 265 seconds]
alexherbo2 has joined #crystal-lang
absolutejam2 has joined #crystal-lang
<FromGitter> <absolutejam_gitlab> Does `YAML::Serializable` iterate over union types?
<FromGitter> <absolutejam_gitlab> whend deserializing?
<FromGitter> <absolutejam_gitlab> > I just didnt realize it would be to the point where you can go "parse this string as crystal source code and give me the AST nodes" ⏎ ⏎ Does this mean we could get a more powerful macro system, or would that means actually changing the compiler?
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 250 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 240 seconds]
absolutejam2 has quit [Ping timeout: 240 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 245 seconds]
return0e has joined #crystal-lang
alexherbo22 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 252 seconds]
return0e has quit [Ping timeout: 265 seconds]
alexherbo220 has joined #crystal-lang
alexherbo22 has quit [Ping timeout: 268 seconds]
rohitpaulk has joined #crystal-lang
absolutejam2 has joined #crystal-lang
DTZUZO has joined #crystal-lang
DTZUZO has quit [Remote host closed the connection]
absolutejam2 has quit [Ping timeout: 265 seconds]
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 240 seconds]
DTZUZO has joined #crystal-lang
<FromGitter> <Blacksmoke16> @absolutejam_gitlab it does yea, uses the first one that doesnt error
<Stephanie> wish i wasn't always so behind with github issues :<
<FromGitter> <ImAHopelessDev_gitlab> hi @Blacksmoke16
<FromGitter> <ImAHopelessDev_gitlab> Wow, that post ❀️
<FromGitter> <ImAHopelessDev_gitlab> 2004 πŸ˜† Damnnnn
<FromGitter> <absolutejam_twitter> @Blacksmoke16 in the order specified by the union?
alexherbo220 has quit [Quit: The Lounge - https://thelounge.chat]
rohitpaulk has quit [Ping timeout: 240 seconds]
Nekka has quit [Ping timeout: 240 seconds]
return0e has joined #crystal-lang
<FromGitter> <Blacksmoke16> yea so `One | Two |Three` would go in that order
duane has quit [Ping timeout: 276 seconds]
DTZUZO has quit [Ping timeout: 250 seconds]
<FromGitter> <Blacksmoke16> taking the first one that works
duane has joined #crystal-lang
<jhass> don't we sort unions?
<jhass> >> typeof([] of String|Int32)
<DeBot> jhass: # => Array(Int32 | String) - https://carc.in/#/r/7uk3
rohitpaulk has joined #crystal-lang
DTZUZO has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 276 seconds]
HumanGeek has joined #crystal-lang
DTZUZO has quit [Ping timeout: 276 seconds]
Human_G33k has quit [Ping timeout: 268 seconds]
<FromGitter> <ilanpillemer> @ImAHopelessDev_gitlab it doesnt even mention acme
<FromGitter> <ilanpillemer> I am trying out different colours in acme now
<FromGitter> <ilanpillemer> also doesn’t mention acme
<FromGitter> <sam0x17> I'm not familiar with acme
<FromGitter> <ilanpillemer> https://research.swtch.com/acme
<FromGitter> <sam0x17> other than the grocery store and the fictitious company in loony toons
<FromGitter> <ilanpillemer> Its a niche editor
<FromGitter> <sam0x17> nice
<FromGitter> <ilanpillemer> but used by very well respected people such as Ritchie, Stroustrup, Cox, Pike, Thompson
flaviodesousa has joined #crystal-lang
<FromGitter> <ilanpillemer> it has a dedicated community that goes back decades
<FromGitter> <ilanpillemer> based on ideas from Oberon
<FromGitter> <ilanpillemer> http://www.projectoberon.com
<FromGitter> <sam0x17> very nice
<FromGitter> <sam0x17> I need to get around to making my dream terminal editor someday
<FromGitter> <ilanpillemer> I think its been done already and called `acme`
duane has quit [Ping timeout: 268 seconds]
<FromGitter> <sam0x17> can I right click context menu and drag select with a mouse if I get lazy
<FromGitter> <sam0x17> ?
<FromGitter> <ilanpillemer> you can snarf
<FromGitter> <ilanpillemer> and you can plumb
<FromGitter> <ilanpillemer> and you can drag select, but there are no context menus.
<FromGitter> <sam0x17> well drag selection is a plus at least
<FromGitter> <ilanpillemer> Also as quicky if you click inside curlied,, its all selected
<FromGitter> <ilanpillemer> I wrote a Crystal formatter on save for it
<FromGitter> <ilanpillemer> using the `crystal tool format` command
rohitpaulk has joined #crystal-lang
<FromGitter> <andrius> Hi, what I want: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ How I can achieve this? I have multiple classes where shall do something upfront. ... [https://gitter.im/crystal-lang/crystal?at=5dadba78ef84ab37866e8ea6]
<FromGitter> <Blacksmoke16> upfront? like when the class is initializied?
rohitpaulk has quit [Ping timeout: 265 seconds]
<FromGitter> <andrius> yes, but I initialize it with class.from_json
<FromGitter> <Blacksmoke16> ```def after_initialize ⏎ puts "foo" ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=5dadbb362a6494729c12bbce]
<FromGitter> <Blacksmoke16> that gets ran after the obj has been deserialized
<FromGitter> <andrius> great, works! thank you (works only if I create it from json)
duane has joined #crystal-lang
Nekka has joined #crystal-lang
absolutejam2 has joined #crystal-lang
<FromGitter> <Blacksmoke16> correct
<FromGitter> <absolutejam_gitlab> Can't you use symbols in function signatures?
<FromGitter> <Blacksmoke16> example?
<FromGitter> <absolutejam_gitlab> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5dadbe1a7477946bada3b4c6]
<FromGitter> <absolutejam_gitlab> 1) the `Symbol`, I just added that to test
<FromGitter> <absolutejam_gitlab> That makes more sense
<FromGitter> <absolutejam_gitlab> In a pattern-matching scenario
<FromGitter> <sam0x17> at that point do you even want a class? you could just have a module full of methods
<FromGitter> <Blacksmoke16> or an enum
<FromGitter> <Blacksmoke16> but no, symbols dont work like that
<FromGitter> <absolutejam_gitlab> > at that point do you even want a class? you could just have a module full of methods ⏎ ⏎ Probably what I would do
<FromGitter> <sam0x17> conversely though, it sounds like you're trying to do some kind of "Runnable", as in a lightweight class with a run method. In crystal you are better off just using a block or a proc for that
<FromGitter> <absolutejam_gitlab> Just thinking of how I'd write a function header in Elixir. I realise they're completely different paradigms, but it's a useful way to work and symbols don't seem to be awfully useful in Crystal
<FromGitter> <sam0x17> I use symbols a lot
<FromGitter> <absolutejam_gitlab> wasn't there even talk of removing them?
<FromGitter> <sam0x17> the tricky part is you can go symbol => string but not string => symbol (even though at compile time it should be possible)
<FromGitter> <Blacksmoke16> there is
<FromGitter> <absolutejam_gitlab> or did I misconstrue that?
<FromGitter> <sam0x17> yeah but too many libs rely on them
<FromGitter> <sam0x17> I'd cry
<FromGitter> <ImAHopelessDev_gitlab> @sam0x17 > other than the grocery store and the fictitious company in loony toons ⏎ LOL
<FromGitter> <sam0x17> its funny cuz I literally just shopped at acme 20 mins before that
<FromGitter> <Blacksmoke16> only uses they have are namedTuple keys and enum auto casting
<FromGitter> <absolutejam_gitlab> I guess I get a bit too tunnel vision on Elixir's pattern matching when there alternative tools in Crystal
<FromGitter> <Blacksmoke16> the talk was making them be solely auto casting feature
<FromGitter> <absolutejam_gitlab> but I'm very fond of that paradigm
<FromGitter> <sam0x17> the problem with that is (as far as I know) there is no way of "re-opening" an enum
<FromGitter> <Blacksmoke16> right, how is that a problem?
<FromGitter> <tenebrousedge> if you need to add to it later, use a `Hash`
<FromGitter> <ImAHopelessDev_gitlab> @sam0x17 I wrote about my experience with Notepad https://forum.crystal-lang.org/t/surprisingly-a-great-experience-with-notepad/1277
<FromGitter> <absolutejam_gitlab> > yea so `One | Two | Three` would go in that order ⏎ ⏎ and thanks, didn't see this. Tried it earlier and it didn't seem to work how I'd expect but I'll revisit
<FromGitter> <sam0x17> so if you write a shard that has something that uses symbols (or now just an enum), and a user of the shard wants to have more symbols in there that define custom functionality, you can't because you cant add things to the enum?
<FromGitter> <sam0x17> unless you can monkey patch enums, in which case that's cool af
<FromGitter> <absolutejam_gitlab> Why would you use Notepad/
<FromGitter> <sam0x17> tbh on macos it's a pain in the ass not having a dumb text editor
<FromGitter> <Blacksmoke16> well not all symbols would be enums
<FromGitter> <absolutejam_gitlab> Even the default encoding is fucky
<FromGitter> <sam0x17> TextEdit does not cut it
<FromGitter> <absolutejam_gitlab> vim
<FromGitter> <sam0x17> I just nano
<FromGitter> <absolutejam_gitlab> πŸ˜‰
<FromGitter> <Blacksmoke16> most symbols could prob just be strings
<FromGitter> <Blacksmoke16> essentially the same
<FromGitter> <sam0x17> or use URL bar as a text buffer like a pro
<FromGitter> <tenebrousedge> nano is good. Spacevim Is ❀️
<FromGitter> <sam0x17> in fact, I want that, like a system tray icon that I click and it expands to a dumb text area that has no formatting or purpose other than being an intermediate buffer
<FromGitter> <absolutejam_gitlab> sticky notes...?
<FromGitter> <sam0x17> I bet it tries to do some kind of formatty crap but haven't tried
<FromGitter> <meltheadorable> @sam0x17 to the extent i ever care about having a dumb editor, textedit is dumb enough as long as you switch its default mode to plain text from rich text
<FromGitter> <sam0x17> I just hate that when I open it its like "where do you want to store this"
<FromGitter> <sam0x17> while I'm panicking on the phone with someone like hold on hold on opening a text editor
<FromGitter> <meltheadorable> i mostly use textmate for that purpose though
<FromGitter> <sam0x17> I really miss gedit
<FromGitter> <sam0x17> might download the mac version (if it works)
<FromGitter> <absolutejam_gitlab> I always have a tmux session open and just use kakoune
<FromGitter> <sam0x17> yeah I'm weird, I think all this tmux / i3 / etc stuff is cool af, but I'm not going to use it if it doesn't also support mouse stuff like resizing the panes via a mouse, right clicking, etc
<FromGitter> <sam0x17> I'll have a literal anxiety attack if I can't do that
<FromGitter> <meltheadorable> nobody should code in notepad though
<FromGitter> <absolutejam_gitlab> they do
<FromGitter> <absolutejam_gitlab> tmux does
<FromGitter> <absolutejam_gitlab> and i3 does
<FromGitter> <sam0x17> that's cool then, I wasn't able to get that part working xD
<FromGitter> <absolutejam_gitlab> bspwm is my favourite wm
<FromGitter> <sam0x17> oh and I still want all my usual GUI for the system
<FromGitter> <absolutejam_gitlab> but I'm on macOS full time atm because of shitty graphics drivers on liux
<FromGitter> <sam0x17> just i3 in a window basically
<FromGitter> <absolutejam_gitlab> you can get scripts that emulate it for other WMs
<FromGitter> <absolutejam_gitlab> like KDE has one that does tiling
<FromGitter> <absolutejam_gitlab> so you get the best of both
<FromGitter> <absolutejam_gitlab> Or use something like Spectacle on macOS
<FromGitter> <absolutejam_gitlab> at least for pseudo-tiling
<FromGitter> <absolutejam_gitlab> I tried chunkWM but it was a bit buggy with some apps
<FromGitter> <absolutejam_gitlab> since it's basically fighting against aqua
<FromGitter> <sam0x17> on that note, I also want browser tabs in my vscode
<FromGitter> <sam0x17> I bet there is an addon tho
<FromGitter> <meltheadorable> i only use vscode for C, i use atom for everything else
<FromGitter> <tenebrousedge> I'm using VSCode for JS and Ruby, spacevim for Crystal
<FromGitter> <absolutejam_gitlab> I use Goland for Go - although, I've been trying VSCode again for it and it's just as good ⏎ PHPStorm for PHP (because the code jumping & refactor features rock), but I've been doing small, quick bits in Kakoune as the language server is awesome ⏎ JS in kakoune because I do so little and don't really need many features, Crystal in Kakoune, ⏎ yaml in Kakoune, ⏎ html/pug/whatever alternative
<FromGitter> ... to writing HTML in VSCode [https://gitter.im/crystal-lang/crystal?at=5dadc2eb10bd4128a135a621]
<FromGitter> <meltheadorable> i can’t get into terminal editors, they’re just worse
<FromGitter> <absolutejam_gitlab> Every once in a while I just use VSCode because it's awesome at everything though
<FromGitter> <tenebrousedge> VSCode + vim keybindings
<FromGitter> <absolutejam_gitlab> I used to use them but I find vim keybinds outside of VIM either super clunky or super buggy
<FromGitter> <absolutejam_gitlab> I use the vim plugin for Chrome but basically only use hjkl and x
<FromGitter> <tenebrousedge> ew
<FromGitter> <absolutejam_gitlab> might try and train myself to rely on some of the extra features of kakoune & tmux
<FromGitter> <absolutejam_gitlab> keep meaning to
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
absolutejam2 has quit [Ping timeout: 240 seconds]
dannyAAM has joined #crystal-lang
<FromGitter> <repromancer_gitlab> @absolutejam_gitlab Thanks for bringing up Kakuone; I think I'd seen the name around, but never noticed it was an editor.
alexherbo2 has joined #crystal-lang
<FromGitter> <repromancer_gitlab> I'm one of those people who can't use anything less than my vim setup anymore, so I'm waiting on OniVim2 for an actually usable VS Code alternative. Kakuone looks like a very compelling alternative to Vim itself, though (I don't consider emacs compelling).
dwdv has joined #crystal-lang
<FromGitter> <christopherzimmerman> Is it possible use a comparison operator in a macro? So calling it would look something like `mask_helper(>, gt)`
absolutejam2 has joined #crystal-lang
<FromGitter> <sam0x17> btw to all using vscode, highly recommend vscodium as a zero-telemetry fork
<FromGitter> <asterite> @sam0x17 for the unions you can either use the full union name, or there's a `crystal_type_id` that will give you a unique id for each type (though that might change between compilations)
absolutejam2 has quit [Ping timeout: 250 seconds]
<FromGitter> <asterite> I think you should look at how Ruby's Marhsal is done. As I said, I might tackle this much later myself, though now I don't have time plus it's not a priority. You also might need to take into account recursion (like a parent-child relationship). In that case you want the marhsaller to remember each object marshalled with a number, then if you find that object again you put a reference to it instead of
<FromGitter> ... marshalling it again. Then the unmarshaller needs to remember the objects unmarshalled in the same way. But there's no way to use `Reference` yet so you have to go the `Void*` route, which make things more low-level than what one would like. In summary, marhsalling is hard.
<FromGitter> <naqvis> *voilΓ * so nice to see Crystal making itself into TIOBE Index (https://www.tiobe.com/tiobe-index/) Top 50 languages πŸ‘
ht__ has joined #crystal-lang
<FromGitter> <ImAHopelessDev_gitlab> @naqvis Cool!! πŸ‘
<FromGitter> <naqvis> :plus1:
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 250 seconds]
sorcus has quit [Ping timeout: 246 seconds]
<FromGitter> <sam0x17> @asterite my problem has been how to instantiate a type based on its type id --- all my attempts casting an Int32 to a Class using things like unsafe_as fail because of restrictions on pointerof(*T) and that sort of thing
alexherbo2 has quit [Ping timeout: 240 seconds]
<FromGitter> <sam0x17> I might have to do it with the string names of the types
<FromGitter> <sam0x17> and in fact, that is probably a better approach because while it uses more memory, I bet the crystal_type_ids are specific to a particular compilation
alexherbo2 has joined #crystal-lang
<FromGitter> <sam0x17> the recursive approach that you describe is basically what I do -- if something is a reference, I recursively visit it, if it has instance variables, I recursively store each of those, and if it is just a raw Value, I store its raw bytes
<FromGitter> <sam0x17> unions will fully work for me if I can just encode what the actual type was on that instantiation of the union
<FromGitter> <kinxer> @Blacksmoke16 :P I now know what to expect when you give me a YouTube link. I'll take a look at that later, but I've saved it.
<FromGitter> <Blacksmoke16> πŸ‘ is from their new album coming up
duane has quit [Ping timeout: 240 seconds]
sorcus has joined #crystal-lang
flaviodesousa has quit [Quit: KVIrc 4.9.3 Aria http://www.kvirc.net/]
adam12 has joined #crystal-lang
sagax has quit [Ping timeout: 268 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 268 seconds]
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
<FromGitter> <ilanpillemer> Better than Rick Astley?
absolutejam2 has joined #crystal-lang
DTZUZO has joined #crystal-lang
<FromGitter> <wontruefree> while talking to Brian about next months meetup collecting talk ideas came up
<FromGitter> <wontruefree> if anyone has any good talk ideas we would love to hear them https://forms.gle/1stfALi5drojhy2r6
<FromGitter> <tenebrousedge> currently, I want to know more about generics, specifically how the type inference works. Probably MT would be good to talk about, too
<FromGitter> <asterite> Sam Johnson: with recursion I mean, if a type Parent has a field Child, and Child has a field Parent, you have to find a way to stop the recursion when serializing either of them
<FromGitter> <wontruefree> @tenebrousedge I will add those to my list and see if we can find someone who would be willing to give a talk on it
<FromGitter> <sam0x17> @asterite ah, DAGs, hadn't thought of that yet. Yes that's another problem
<FromGitter> <sam0x17> might have to cache things by address
<FromGitter> <sam0x17> I'm of a mind now that it might be simpler to simply dump the current heap and deal with all references that way
<FromGitter> <sam0x17> (if building a repl)
<FromGitter> <sam0x17> so addresses from the previous compilation will still be valid since the heap space will be identical
<FromGitter> <ilanpillemer> can you use StringScanner directly on STDIN?
<FromGitter> <tenebrousedge> no, you need some sort of `get`
<FromGitter> <tenebrousedge> StringScanner doesn't work on files
Nekka has quit [Ping timeout: 245 seconds]
<FromGitter> <ilanpillemer> something like `StringScanner.new(STDIN.gets_to_end)`?
<FromGitter> <rishavs> My monthly Bountysource for Crystal hasn't charged since Aug. ANyone else faced this issue?
<FromGitter> <tenebrousedge> @ilanpillemer yes
<FromGitter> <ilanpillemer> what is bountysource?
Nekka has joined #crystal-lang
<FromGitter> <rishavs> its a way to donate to the community via a subscription model
<FromGitter> <rishavs> If I have to retake a subscription, which one is better? Open collective or bountysource?
Nekka has quit [Ping timeout: 265 seconds]
Nekka has joined #crystal-lang
<FromGitter> <kinxer> Does Crystal monomorphize generics or is there some cost to that which motivates not doing so?
<FromGitter> <tenebrousedge> monomorphize?
<FromGitter> <kinxer> Turn generic definitions of things into concrete definitions during compilation.
<FromGitter> <tenebrousedge> yes, it does that
<FromGitter> <kinxer> Solid. Thanks.
ht__ has quit [Quit: ht__]
OvermindDL1 has joined #crystal-lang
rohitpaulk has joined #crystal-lang
absolutejam2 has quit [Ping timeout: 240 seconds]
sagax has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
absolutejam2 has joined #crystal-lang
teardown has quit [Ping timeout: 276 seconds]
DTZUZU has quit [Read error: Connection reset by peer]
DTZUZU has joined #crystal-lang
duane has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter> <absolutejam_gitlab> Is there not currently a way to decompose a tuple on assignment?
<FromGitter> <absolutejam_gitlab> `{a, b} = foo()` or `a, b = foo()`
<FromGitter> <tenebrousedge> the second should work
<FromGitter> <tenebrousedge> ```a, b = {1, 2} ⏎ b #=> 2 ⏎ c = -> { {1,2} } ⏎ d, e = c.call ⏎ e #=> 2``` [https://gitter.im/crystal-lang/crystal?at=5dae34f42f8a034357b1fbf9]
<FromGitter> <absolutejam_gitlab> it's failing because I'm using `.find` which falls back to `Nil`
<FromGitter> <tenebrousedge> so use `find {}.try do |(a, b)| `
<FromGitter> <absolutejam_gitlab> I used `find(if_none: {nil, nil})` haha
<FromGitter> <absolutejam_gitlab> I do need to get used to `.try`
<FromGitter> <tenebrousedge> I find it preferable. It adds a layer of nesting, but avoids conditionals, and assignment in conditionals
<FromGitter> <absolutejam_gitlab> I'm not sure how I'd use `try` here?
<FromGitter> <absolutejam_gitlab> I've always avoided it as it seemed a bit less obvious that assignment in a conditional
<FromGitter> <tenebrousedge> `find { find_stuff }.try {|(a, b)| `
<FromGitter> <tenebrousedge> `try` on `nil` returns `nil`
<FromGitter> <tenebrousedge> otherwise the block is executed
<FromGitter> <absolutejam_gitlab> but I couldn't do `a, b = ...` with this could I?
<FromGitter> <absolutejam_gitlab> I'd have to do the logic inside the block
<FromGitter> <absolutejam_gitlab> eh, that works thuogh
<FromGitter> <tenebrousedge> I mean, you could do `.try &.itself` I guess
<FromGitter> <absolutejam_gitlab> I was only assigning to return the 2nd item
<FromGitter> <tenebrousedge> so `try &.last`
<FromGitter> <absolutejam_gitlab> ` @spec.definitions.find { |k, v| k == name }.try { |k, v| return v }`
<FromGitter> <absolutejam_gitlab> oh, that's nice
<FromGitter> <absolutejam_gitlab> there's so many explicit methods that I forget about
<FromGitter> <tenebrousedge> if you're doing `k == name` why not just `definitons[name]?` ?
<FromGitter> <tenebrousedge> :P
rohitpaulk has joined #crystal-lang
absolutejam2 has quit [Ping timeout: 250 seconds]
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter> <Blacksmoke16> πŸ˜†
teardown has joined #crystal-lang
dwdv has quit [Ping timeout: 240 seconds]
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]