ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.24.2 | 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
qard has quit [Quit: qard]
<FromGitter> <girng> hello my friends!
<FromGitter> <girng> is it possible to run WSL on Windows 7?
<FromGitter> <girng> i saw this: http://babun.github.io/ would it be possible to runc rystal in that environment?
<FromGitter> <girng> i posted here (https://github.com/babun/babun/issues/828) hope they can help
snsei has joined #crystal-lang
<FromGitter> <faustinoaq> @girng I used to use Windows 7 Enterprise at work and in the section "Add/Remove Windows Features" I saw something like "UNIX subsystem", never tried it, though
<FromGitter> <girng> lol really
<FromGitter> <faustinoaq> I guess was only available on Windows 7 Enterprise
<FromGitter> <faustinoaq> Now, I'm using Windows 10 and WSL works out the box 😉
<FromGitter> <girng> i have windwos 10. but i don't like it anymore, im frustrated at it
<FromGitter> <girng> i like windows 7...
<FromGitter> <girng> i have linux mint on a virtual machine with crystal installed. but i want to edit my files in sublime in windows 7
<FromGitter> <girng> i wonder if that is possible, i guess that could work right
<wmoxam> You should be able to do it through an nfs share
<FromGitter> <girng> *furiously googling nfs share*
<wmoxam> That's how I do it on OSX
<FromGitter> <Blacksmoke16> is there a way to require a method param if another is used
<FromGitter> <Blacksmoke16> say i have param1 and param2
<FromGitter> <Blacksmoke16> i.e. if someone calls a method with param1, require them to supply param2 as well
<FromGitter> <bew> don't give param2 a default value? (this way it's a required arg)
<FromGitter> <Blacksmoke16> but what if it should be optional if param1 isnt supplied
<FromGitter> <Blacksmoke16> er not required*
<FromGitter> <bew> then do 2 methods
<FromGitter> <bew> one with no args, one with 2 args
<FromGitter> <Blacksmoke16> as an overload?
<FromGitter> <Blacksmoke16> ah smart
<FromGitter> <bew> yes exactly
<FromGitter> <faustinoaq> > i have linux mint on a virtual machine with crystal installed. but i want to edit my files in sublime in windows 7 ⏎ ⏎ You can use samba share as well 😄
<FromGitter> <faustinoaq> I used to use it at work
<FromGitter> <girng> screw it i just go back to w10
<FromGitter> <faustinoaq> Ok :)
<FromGitter> <girng> i dun like it but i have to
<FromGitter> <girng> crystal is important to me
<FromGitter> <faustinoaq> `mount.cifs //10.42.0.45/Users/FAguilar/Projects /home/main/Public/Projects -o user=faguilar`
<FromGitter> <faustinoaq> ^ This was the command I use to edit my files inn WIndows 7 from Manjaro Linux
<FromGitter> <girng> dats not bad
<FromGitter> <girng> i might try that
<FromGitter> <faustinoaq> I tried NFS but Windows 7 client had some problems trying to edit files
<FromGitter> <girng> you're a good man
<FromGitter> <faustinoaq> Also remember to mount a cifs folder under linux you should edit to `/etc/fstab` like this:
<FromGitter> <faustinoaq> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5ac96e5a27c509a774eb3c4c]
<FromGitter> <faustinoaq> Just change `faguilar` by your user
<FromGitter> <girng> ok will try dat
<FromGitter> <faustinoaq> ^ BTW, you should share your folder in Windows 7 before mounting it on Linux
<FromGitter> <girng> ok
<FromGitter> <faustinoaq> ^ Remember to enable full access (write/read permissions)
<FromGitter> <faustinoaq> I checked my zsh_history, seems the command I used was: `mount.cifs //10.42.0.45/Users /home/main/Public/Users -o user=faguilar` 😅
<FromGitter> <girng> hehe dat space
<FromGitter> <Blacksmoke16> that worked pretty good @bew thanks
Creatornator has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #crystal-lang
Creatornator has quit [Client Quit]
Creatornator has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 276 seconds]
<crystal-gh> [crystal] ddrscott opened pull request #5929: add spec to reproduce sizeof(typeof(v)) bug (master...ISSUE_5717) https://git.io/vxQ4l
ashirase has joined #crystal-lang
snsei has joined #crystal-lang
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
Yxhuvud has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei_ has joined #crystal-lang
snsei_ has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 245 seconds]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 276 seconds]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 245 seconds]
ashirase has quit [Ping timeout: 265 seconds]
ashirase has joined #crystal-lang
<FromGitter> <bararchy> Morning all :)
<FromGitter> <bararchy> anyone knows about people who uses Crystal in Belarus ? XD
<FromGitter> <girng> good morning!!
<FromGitter> <girng> it's crystal time
<FromGitter> <bararchy> @girng how goes your game engine?
<FromGitter> <bararchy> game server
<FromGitter> <bararchy> sorry
<FromGitter> <girng> @bararchy it is going good. im very pleased with it. crystal communicates really nice with godot's tcp api. it's seamless to set up
<FromGitter> <bararchy> awsome!
<FromGitter> <bararchy> sounds like you're having fun
<FromGitter> <bararchy> when will your game be ready?
<FromGitter> <bararchy> also, what's it about?
<FromGitter> <girng> it's going to be an action RPG similar to diablo 2, but top down / not isometric (don't have enough art for top down sprite animations) :O
<FromGitter> <girng> once im done wih the master server, i need to implement the game instance server. which handles monster ai / relay players location
<FromGitter> <girng> with a fixed timestep on the server (tickrate)
<FromGitter> <girng> it will be harder i think. so glad crystal has good community incase i get stuck some more :D
<FromGitter> <girng> this is why `loop do sleep xx end` will be my best friend :D
snsei has joined #crystal-lang
<FromGitter> <Qwerp-Derp> So I have a class Hedron::Box, but I want to use Crystal's Box. How do I specify to use Crystal's Box?
snsei has quit [Ping timeout: 255 seconds]
<FromGitter> <bararchy> @girng really cool, sounds a little like ultima :) ⏎ Would you be adding gathering, structres etc?
<FromGitter> <girng> @bararchy nah not really unfortunately. more of killing monsters and getting their loot. it's all about itemization and skills, and farming / multiplayer playing with friends
<FromGitter> <bararchy> that's cool :)
<FromGitter> <girng> @bararchy thx for asking me about it. it makes me really giddy. im excited!
<FromGitter> <bararchy> YW
<FromGitter> <faustinoaq> ((https://user-images.githubusercontent.com/3067335/38460902-30aa72b4-3a89-11e8-97eb-090300d0b1ca.gif)) ⏎ ⏎ ^ Crystal + Assembly + Game Boy emulator = video game debugging 😍
<FromGitter> <girng> lol that's cool
<FromGitter> <bararchy> @faustinoaq Nice :)
<FromGitter> <bararchy> I see gaming is getting stronger in Crystal
<FromGitter> <faustinoaq> Yeah, people are making nice things with Crystal 🎉
<FromGitter> <bararchy> Also saw the sushichain
<FromGitter> <bararchy> interesting project
<FromGitter> <faustinoaq> Yeah, I like the crystal ecosystem is pretty decentralized, so crystal can be used on many things and not just web development 😉
<FromGitter> <girng> im doing a server manager in godot here soon. so i can manage the instance servers from the cheap $5 VPSs. ⏎ not only that, but the ability to watch the usage of the master server, game chat as admin / manage global announcements, etc. it's going to have: players logged in, where they are at in a game, number of connections, number of games open, etc. i'll post screenshots later
<FromGitter> <bararchy> @girng that's cool :) ⏎ It will be interesting seeing how many users the event loop can manage on a single thread, or, would you use multi-process with `reuse port` ?
<FromGitter> <girng> and will also show memory usage, cpu usage, etc. that get sent periodically in a `loop do sleep xx end`. which will use godot's UI circular progress bars for it. going to look really cool. all over a simple tcp connection that gets `to_json` very easy to use the data in godot after that.
<FromGitter> <girng> @bararchy well, the thing is the game instance servers gonna be on cheap single core machines so it's like perfect!
<FromGitter> <bararchy> why not use MSGPACK instead? JSON is quite large as a TCP based data structure
<FromGitter> <bararchy> I guess you don't have a web interace doing the json action right?
<FromGitter> <girng> @bararchy i wasthinking of that, but unfortunately godot afaik doesn't have a msgpack library to decode it :(
<FromGitter> <girng> @bararchy nah all done with godot's parse_json method :D
<FromGitter> <bararchy> yeha, seems they don't support it yet
<FromGitter> <girng> oh wow didn't see that
<FromGitter> <girng> @bararchy for the game instance server that runs on a tick rate, i think i will not use to_json. but we'll see. i could always just do message|message|message and split them in godot and create my own message decoder. will be harder, but for player movement locations and stuff, using to_json is kinda overkill you are correct
<FromGitter> <faustinoaq> ^ I like to read comments by crystal newcomers, so we can fix those things they think we're doing wrong 😄
<FromGitter> <faustinoaq> ^ Ref: youtube video (https://www.youtube.com/watch?v=-6V8fUxTLV8&feature=youtu.be)
<FromGitter> <faustinoaq> BTW, Hey @/all !, KDE Team just approved my commits on Kate (KDE text editor) to support crystal highlighting 🎉 ⏎ ⏎ ^^ https://phabricator.kde.org/D7909
<FromGitter> <girng> @bararchy i commented 12134, thx for issue.
<FromGitter> <bararchy> @faustinoaq that's good news :) ⏎ @girng happy to help
robacarp has quit [Ping timeout: 256 seconds]
robacarp has joined #crystal-lang
<FromGitter> <girng> =]]
<oprypin> faustinoaq, that's great! if you want to double check it works correctly, you can use these resources https://bitbucket.org/birkenfeld/pygments-main/src/7941677dc77d4f2bf0bbd6140ade85a9454b8b80/tests/examplefiles/test.cr https://gist.github.com/03bc702c151542c1172d
<oprypin> maybe you also want to post the diff of what you changed compared to ruby
<FromGitter> <faustinoaq> oprypin, very nice, Thank you! :)
<oprypin> faustinoaq, oh man, there are many problems with it :(
<FromGitter> <faustinoaq> Yeah, I just copied the ruby syntax, I'll try to fix them 😅
<oprypin> faustinoaq, did you really just copy it without changes D:
<FromGitter> <faustinoaq> oprypin, no, I just tried to add macros and some crystal keywords
<oprypin> welp, the example file shows that %} is broken just like when using ruby highlighting
<FromGitter> <faustinoaq> Oh, I guess I tested it wrong, Let me try to implement macros again 😅
<FromGitter> <faustinoaq> I mean highlighting macros ;)
<oprypin> how the hell does one comment on that site?
<FromGitter> <bararchy> lol
<oprypin> i managed it! needed to scroll a few times back and forth between the very top and the very bottom of the page
<oprypin> how do they keep screwing up the UI so badly? just copy github and call it a day
<FromGitter> <faustinoaq> oprypin, Yeah the phabricator UI is a bit confusing at beginning XD
<FromGitter> <Qwerp-Derp> So in my module, Hedron, I have a class called Box - I want to use the Crystal default class Box in another class, say Hedron::Foo, how do I reference the Crystal class Box without the compiler getting it confused with Hedron::Box?
<oprypin> Qwerp-Derp, `::Box`
<oprypin> faustinoaq, from what i see at least `struct` keyword is missing. hopefully the diff i sent can help with that. also somehow there's a lack of colors https://imgur.com/wVSxpLX
<FromGitter> <bararchy> I love the way sublime colors
<FromGitter> <faustinoaq> oprypin, Ok, I'll try to fix that, Thank you again for the diff! 👍
<oprypin> heh, that diff also needs updating, e.g. `ifdef` is gone
<FromGitter> <bararchy> what's ifdef ?
<FromGitter> <bararchy> ok ok
<FromGitter> <bararchy> what's known as flag
<FromGitter> <girng> @bararchy same, love sublime.
<FromGitter> <Qwerp-Derp> Do I need multiple `@@` variables in the class if I have multiple functions that send `Proc`s as `Void*`?
<oprypin> seems likely
<FromGitter> <girng> what is Void* a pointer?
<FromGitter> <Qwerp-Derp> Yeah, Void* is an alias for Pointer(Void)
<FromGitter> <girng> o, interesting
rohitpaulk has joined #crystal-lang
<oprypin> faustinoaq, i dont think it's deprecated. it's just some haskell-specific stuf that's deprecated
<oprypin> you
<oprypin> you're in the right place
<FromGitter> <girng> lol haskell
robacarp has quit [Ping timeout: 240 seconds]
robacarp has joined #crystal-lang
<FromGitter> <codenoid> yeah from the first time i learn programming
<FromGitter> <codenoid> i use sublime
<FromGitter> <codenoid> bcoz it's simple and lightweight
<FromGitter> <girng> ye .crystal formatter works great w/ it too
<FromGitter> <girng> although, each time i save my file i get a cmd pop for 2 seconds but idc lol
<oprypin> D:
<oprypin> that must be the formatter
<FromGitter> <girng> :DD
<FromGitter> <girng> i've grown to love my cmd popups. feels perfectly normal now
<FromGitter> <girng> gives me confirmation that the text is being changed
rohitpaulk has quit [Ping timeout: 276 seconds]
<FromGitter> <bararchy> @girng on Windows ?
<FromGitter> <bararchy> because i just have a small delay until it finishes on Linux
<FromGitter> <girng> yah w10 :D
<Groogy> We use sublime for our own script language at work as well
<Groogy> one of the content designer put together a linter plugin and stuff
<Groogy> though I've started seeing some programmers use VS Code as a text editor
<FromGitter> <Qwerp-Derp> @Groogy I personally use VSCode, it's better than Sublime IMO
<Groogy> I'm just so used to sublime I guess
<Groogy> I use VSCode for coding but for script, localisation etc I use Sublime
<FromGitter> <bararchy> I want to love VSCode, but I can't see how it's better then sublime, I see @faustinoaq does crazy stuff with it but for me it wont even call the formatter
<Groogy> hmm is there a way to do a setter protected?
<oprypin> Groogy, maybe just write `protected setter x` lol
<oprypin> it actually works
<oprypin> even protected property
<Groogy> haha lol
<Groogy> though does it work if I am defining several setters?
<Groogy> or is it just a quirk because setter expands in place?
<Groogy> (i.e it will work for the first method)
<oprypin> i think it really just works
<Groogy> *magic*
<Groogy> kewl
<Groogy> though I realized I need to apply it somehow differently :/ I have an object that should be pretty much immutable after it been read from a file and trying to have the interface correspond to that
<Groogy> though the manager needs to do a second pass after load to make sure all references are setup correctly.
<oprypin> Groogy, sounds like you've avoiding the builder pattern
<oprypin> which really sucks but i havent heard a more perfect use case for it
<Groogy> haha actually no, the problem is just one of "chicken or the egg" kind of problem
<Groogy> template1 references template2, but template2 is not created yet
<Groogy> and trying to figure out how to have the "on_post_load" method but without having it be public
<crystal-gh> [crystal] MakeNowJust opened pull request #5930: Raise syntax error when method argument name is keyword (master...fix/crystal/dont-use-invalid-internal-arg-name) https://git.io/vxQKZ
<Groogy> though I guess... hmmm protected method can be called by subclasses right?
<Groogy> as in classes that are defined within a class
robacarp has quit [Ping timeout: 260 seconds]
robacarp has joined #crystal-lang
rohitpaulk has joined #crystal-lang
That_Guy_Anon has joined #crystal-lang
alex`` has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <girng> is it possible to use select * with the db module? For example, look here (https://i.gyazo.com/b77986863904c6da88dae620b0f6ab4e.png). i need to select all that data. or do i have to manualy write my own ` DB.mapping({`?
rohitpaulk has quit [Ping timeout: 260 seconds]
<oprypin> girng, well it certainly cant do anything with the types if you dont at least specify those
<oprypin> and select * would put them in an arbitrary order probably
<oprypin> so yeah, it's the most straightforward to write db mapping
<FromGitter> <girng> ok understood. i should prob stop complaining about it prob would have been half way done hahahaha
<oprypin> need this for db schemas :D https://watzon.me/projects/json-to-crystal
<FromGitter> <girng> oh WOW
<FromGitter> <girng> bookmarked!
<oprypin> cc @watzon
rohitpaulk has joined #crystal-lang
<FromGitter> <faustinoaq> > but for me it wont even call the formatter ⏎ ⏎ @bararchy Doesn't the VSCode formatter work for you? Remember you can't enable auto-formatting on settings using `"editor.formatOnSave": false` in your `settings.json` file
never has joined #crystal-lang
<never> Hello
<never> Is there any way to convert a String to a MacroId or a StringLiteral
<FromGitter> <faustinoaq> > I see @faustinoaq does crazy stuff with it ⏎ ⏎ I guess I have some experience using VSCode 😉
<FromGitter> <bararchy> what is a Macrold ? sounds like food
<never> so I can use a constant in both a macro and a normal function
<FromGitter> <girng> lol
<FromGitter> <bararchy> @faustinoaq I don't know, maybe you need to share your json config ?
<FromGitter> <bararchy> never sorry I don't really know how to help, I don't use macros too much, maybe oprypin
<oprypin> never, > use a constant in both a macro and a normal function -- sure, do that, just call .resolve on it
<oprypin> but the first question you asked was pretty bad, because that one is actually impossible
<never> sad
<never> basically I want to create classes from a constant array
<never> and I would have liked to get that constant array from an external file
<oprypin> so do that
<never> I will, however my initial idea was to make it a json (like the rest of my external files so far)
<never> I'll just make another source file
<never> it was just for the sake of consistency
<FromGitter> <faustinoaq> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5aca1dd9109bb043329e0b3e]
<FromGitter> <faustinoaq> ^^ @bararchy Here you are ^ 😄
<FromGitter> <bararchy> cool :) thanks
hightower2 has joined #crystal-lang
<FromGitter> <bararchy> and you also use scry ?
<FromGitter> <bararchy> @faustinoaq ?
hightower3 has quit [Ping timeout: 260 seconds]
<FromGitter> <faustinoaq> Not yet, I found some issues and I'm working on solve that right now 😄
<FromGitter> <faustinoaq> ^ BTW, There is a capture of my VSCode configuration 😄
<FromGitter> <bararchy> @faustinoaq awsome thanks
<FromGitter> <girng> @faustinoaq does vscode cause cmd popup on save like on sublime?
<FromGitter> <girng> if not, i might switch to vscode then, looks really nice
That_Guy_Anon has quit [Ping timeout: 265 seconds]
<Groogy> why does this result in Nil for me? https://pastebin.com/91FhRvUb
<Groogy> the value of @value is "food" though
<Groogy> klass is also a String
<Groogy> but for some reason it evaluates to nil for me
<oprypin> Groogy, pls no pastebin.com, just replace it with bpaste.net for all purposes
<oprypin> Groogy, for types there's a stupid hack where it checks klass.is_a? Bool
<Groogy> meh I redid the method signature instead. Instead of trying to narrow down the type I just pass it through. The method was done to single out the base serialized types (String, etc. etc.)
<Groogy> compared to objects so it can pick the right signature
<Groogy> don't need to know the exact type for those though
<Groogy> was a nice to have
<Groogy> just so I can both have node.unmarshal "categories", Array(String) and node.unmarshal "terrains", Hash(String, TerrainType)
rohitpaulk has quit [Ping timeout: 264 seconds]
never has quit [Remote host closed the connection]
<FromGitter> <Sjoerrdd> Hi :)
<FromGitter> <girng> hello Sjoerd welcome back!!
<FromGitter> <Sjoerrdd> Thanks
<FromGitter> <faustinoaq> > does vscode cause cmd popup on save like on sublime? ⏎ ⏎ Not, it doesn't 😄
<FromGitter> <girng> @faustinoaq omg it's instant!
<FromGitter> <girng> i want...
<FromGitter> <faustinoaq> I never saw a cmd popup on sublime, though
<FromGitter> <girng> u on windows 10?
<Groogy> I would love to use it but it also formats my contracts on methds :(
<oprypin> i dont think this is windows
<Groogy> i.e I have the annonation infront of a method it will put newlines inbetween
<FromGitter> <Sjoerrdd> Crystal is the best language I've ever used?
<oprypin> Groogy, dont worry, the formatter is horrible
<oprypin> i mean don't feel bad about it
<Groogy> ^^ would be nice to have stuff automated for me
<FromGitter> <Sjoerrdd> Sometimes it's hard to find something in the docs, and the community is not the biggest, but it's a great language, thanks (:
<FromGitter> <bararchy> oprypin tbh I really really like the formatter
<oprypin> i explicitly disagree with many of its choices
<FromGitter> <girng> LOL
<oprypin> on windows you should be happy it works at all
<FromGitter> <girng> yes i'm happy ijust think itsfunny
<FromGitter> <faustinoaq> Groogy, What editor you use? Emacs?
Yxhvd has joined #crystal-lang
<FromGitter> <faustinoaq> @girng, Oh, that's because sublime is using `cmd.exe` to execute crystal, maybe you should edit the `crystal_cmd`in your sublime settings 😅
<FromGitter> <faustinoaq> Maybe using some `.vbs` (Visual Basic Script) that hides the cmd window
Yxhuvud has quit [Ping timeout: 260 seconds]
Yxhvd has quit [Remote host closed the connection]
Yxhuvud has joined #crystal-lang
<FromGitter> <girng> good idea :D
<FromGitter> <faustinoaq> Mmm... That won't work because the arguments aren't passed to the batch file
<FromGitter> <faustinoaq> @girng Can you open an issue about that sublime glitch? here: https://github.com/crystal-lang-tools/sublime-crystal/issues
<FromGitter> <faustinoaq> BTW, you can convert your video to gif using this tool: https://ezgif.com/video-to-gif
<oprypin> why would you, though?
<FromGitter> <faustinoaq> I guess I need to modify this line instead: https://github.com/faustinoaq/crystal-windows-installer/blob/master/crystal.bat#L2
<FromGitter> <faustinoaq> or use a compiled `crystal.exe` that simulates the `crystal.bat` functionality
<FromGitter> <girng> @faustinoaq will do,t hx for help
<FromGitter> <faustinoaq> I tried to create a `crystal.exe` before but it was detected as a virus because `Arbitrary code execution` 😅
<FromGitter> <faustinoaq> So I had to use a `.bat` file
<FromGitter> <faustinoaq> I was able to keep `play.exe` though
<oprypin> barebones launcher exe
<FromGitter> <faustinoaq> Oh, nice! 👍
<oprypin> and CreateProcess has flags to not create a console window which you may need to add
<oprypin> here i didnt need that
<FromGitter> <faustinoaq> oprypin, but your `.windows` approach requires Visual Studio installed, no?
<oprypin> uses visual studio to produce the .exe
<oprypin> how else would you make an exe
<FromGitter> <faustinoaq> Oh, yeah 👍
never has joined #crystal-lang
<FromGitter> <faustinoaq> I was using a `.bat` to `.exe` converter 😅
<oprypin> 😅 indeed
<FromGitter> <faustinoaq> lol
<oprypin> what
<FromGitter> <faustinoaq> We should fix sublime-crystal then
rohitpaulk has joined #crystal-lang
<FromGitter> <faustinoaq> ^ We can do something similar to prevent the cmd popup
<oprypin> oh. well that's pretty straightforward then, lol
<oprypin> i had no idea you were already doing this
<oprypin> in python especially
<FromGitter> <girng> how do i enumerate over all the properties in a class?
rohitpaulk has quit [Ping timeout: 240 seconds]
<oprypin> girng, property is just a macro that creates a variable and 2 methods. you can iterate over all variables or all methods.
<FromGitter> <girng> so something like ⏎ ⏎ ```Class.each do |propertyname| ⏎ puts propertyname ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=5aca30b27c3a01610dbe29aa]
<oprypin> https://crystal-lang.org/api/0.23.1/Crystal/Macros/TypeNode.html#instance_vars%3ACrystal%3A%3AMacros%3A%3AArrayLiteral%28MetaVar%29-instance-method
Jenz has joined #crystal-lang
<oprypin> faustinoaq, not gonna mention me on the issue? :p also i think you can paste this link instead of copypasting source code https://github.com/coin-or/pulp/blob/bac6d9d2214ba773d638d2de5149940cfd711359/src/pulp/solvers.py#L378-L382
<oprypin> and it will automatically substitute
<FromGitter> <girng> holy macros is like a whole new ball game
<oprypin> yes
<FromGitter> <girng> cz!!
<FromGitter> <bararchy> @girng its exciting, but lacks real info. Who is the full time developer? What features is he working on? Is it stdlib or compiler? Multi-threading or win support ?
<FromGitter> <bararchy> Etc..
<oprypin> i think it's a theoretical concept and nobody is actually going to work full time ...
<FromGitter> <girng> multi-threading is possible? i thought it was only possible in functional languages like elixir?
<oprypin> what....
<FromGitter> <Sjoerrdd> Somebody who can help me?
<FromGitter> <Sjoerrdd> I get the following error while sending a post request: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5aca369e080a3850530d5c7a]
<oprypin> show code
<FromGitter> <Sjoerrdd> code: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5aca3708080a3850530d5e97]
<oprypin> makes no sense to me
<oprypin> this is not part of Crystal standard library at least
<FromGitter> <Sjoerrdd> True, it's amber
<oprypin> ask them
<FromGitter> <Sjoerrdd> I'll do
alex`` has quit [Quit: WeeChat 2.1]
alex`` has joined #crystal-lang
<FromGitter> <girng> > Macros are methods that receive AST nodes at compile-time and produce code that is pasted into a program
<FromGitter> <girng> what does AST stand for?
<FromGitter> <Sjoerrdd> Abstract syntax tree
<FromGitter> <girng> what the hell is that
<oprypin> girng, https://www.google.com/search?q=AST+(computing)
<FromGitter> <girng> oh, so like a syntax tree with branches?
<FromGitter> <girng> im going to be studying https://crystal-lang.org/docs/syntax_and_semantics/macros.html for a bit forgive my questionz
<FromGitter> <bararchy> @Sjoerrdd basically you searched for a hash key (x forwarded...) That didn't exist, the headers are a hash, so if the header key isn't there you will get this error
<FromGitter> <bararchy> You can use `?` in the end to get nil or value instead of exception
Jenz has quit [Quit: Lost terminal]
<FromGitter> <girng> can macros in crystal be used like how c++ macros are? i could create my own syntax basically?
aurieeeh has joined #crystal-lang
mps has left #crystal-lang [#crystal-lang]
<FromGitter> <faustinoaq> @girng No, you can't do that in crystal, because the macros can only create valid crystal code
<FromGitter> <faustinoaq> I guess there is some tricks, though
<FromGitter> <girng> @faustinoaq interesting
<FromGitter> <girng> well im not going to dive into macros im too confused
rohitpaulk has joined #crystal-lang
<FromGitter> <faustinoaq> > and it will automatically substitute ⏎ ⏎ oprypin, No, the github permalinks, seems to be nice replaced by code just if the permalink is from your own repo
Creatornator has joined #crystal-lang
faustinoaq has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
<woodruffw> anybody have any tips on handling `errno` idiomatically in C bindings? i'd like to cover the failure cases of these C functions without writing a bunch of boilerplate for each
faustinoaq has quit [Ping timeout: 245 seconds]
<oprypin> woodruffw, make them merge https://github.com/crystal-lang/crystal/pull/5003 :D
faustinoaq has joined #crystal-lang
<oprypin> regardless of that, could you show an example with the boilerplate?
faustinoaq has quit [Read error: Connection reset by peer]
faustinoaq has joined #crystal-lang
<woodruffw> well, i'm currently writing bindings for `libqrencode`, and it has various functions that set `errno`, e.g. https://fukuchi.org/works/qrencode/manual/qrencode_8h.html#a4cebc3c670efe1b8866b14c42737fc8f
<woodruffw> so i was thinking that i'll need checks like `if Errno.value ...` after those sorts of calls, but that feels really clunky
<FromGitter> <faustinoaq> > not gonna mention me on the issue? ⏎ ⏎ oprypin, done! 😅
<woodruffw> oh, i'm stupid. i should just be NULL-checking and creating an errno on that condition
<faustinoaq> Gitter has nice features but sometimes is very slow, gonna try IRC again for a while :)
never has quit [Remote host closed the connection]
<FromGitter> <dbachinin> Hi! Please tell me. How can parse binary file as 32 native endian? (Like Ruby pack('L*'))
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <dbachinin> Sorry my Enlish
<FromGitter> <dbachinin> @FromIRC Thank you!
alex`` has quit [Quit: WeeChat 2.1]
<faustinoaq> np, FromIR is a bridge bot between IRC and Gitter, I'm faustinoaq :)
<FromGitter> <dbachinin> @faustinoaq ou. Thanks! :) Somehow i reply to bot!
<faustinoaq> no problem :)
<FromGitter> <girng> trying to use https://github.com/amberframework/granite but how do i query from a table
<FromGitter> <girng> specific table*.... wtf
<FromGitter> <girng> `# ORDER BY Example ⏎ posts = Post.all("ORDER BY created_at DESC")` what in the heck does Post refer to? the table name?
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
<FromGitter> <girng> ```code paste, see link``` ⏎ ⏎ ok i think i got. but now i am getting: `/usr/bin/ld: cannot find -lyaml ⏎ collect2: error: ld returned 1 exit status` lol [https://gitter.im/crystal-lang/crystal?at=5aca53cc6d7e07082bd0d7ac]
<oprypin> girng, install libyaml-dev
<FromGitter> <girng> haha faust we posted same time xDD
<FromGitter> <girng> thx @oprypin and faust, got it working now ;)
alex`` has joined #crystal-lang
<faustinoaq> Nice! :)
<woodruffw> anybody have any ideas about this failure? `crystal spec` works locally: https://travis-ci.org/woodruffw/qrencode.cr/builds/363827592
<woodruffw> same `crystal --version` and all, so i'm not sure what could be causing that :(
<oprypin> woodruffw, make sure u have `require "spec"` in each file
<oprypin> this could be due to arbitrary order of require *
<woodruffw> ah, i didn't require my spec_helper in one of the specs...
<woodruffw> thanks!
Papierkorb has joined #crystal-lang
Papierkorb has left #crystal-lang ["Konversation terminated!"]
Papierkorb has joined #crystal-lang
rohitpaulk has joined #crystal-lang
Papierkorb has left #crystal-lang ["Konversation terminated!"]
alex`` has quit [Quit: WeeChat 2.1]
Creatornator has joined #crystal-lang
Papierkorb has joined #crystal-lang
Papierkorb has left #crystal-lang ["Konversation terminated!"]
rohitpaulk has quit [Ping timeout: 260 seconds]
Papierkorb has joined #crystal-lang
Papierkorb has left #crystal-lang ["Konversation terminated!"]
qard has joined #crystal-lang
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Mihai_ has joined #crystal-lang
<faustinoaq> Hi community, I'm trying to install some shards dependencies and I'm getting this error https://gist.githubusercontent.com/faustinoaq/ab152aee0e2d6cf5613d39e88363f9c7/raw/dec3ae37742a912b0db137c1ffe5903093d470d4/shards-error.txt
<oprypin> faustinoaq, https://github.com/ChangJoo-Park/gravatarcr/tree/0.1.0 is missing "v"
<oprypin> u can use tag: or branch: to work around, or tell them to fix the repo
Mihai_ is now known as pbodev1
pbodev1 has quit [Quit: ChatZilla 0.9.93 [Firefox 56.0/20170903140023]]
pbodev1 has joined #crystal-lang
snsei has joined #crystal-lang
pbodev1 has quit [Quit: ChatZilla 0.9.93 [Firefox 56.0/20170903140023]]
pbodev1 has joined #crystal-lang
andrewzah has quit [Ping timeout: 265 seconds]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<FromGitter> <j8r> question: is it normal to have `"A"` returned instead of `"B"` ? https://carc.in/#/r/3ui4
<FromGitter> <j8r> because this is not the case when `var` is a `String`
<FromGitter> <girng> github made me verify my email i wonder what i did .. hope no 1 reported me i'm sorry
pbodev1 has quit [Quit: ChatZilla 0.9.93 [Firefox 56.0/20170903140023]]
<oprypin> j8r, is normal, the Hash is being passed by reference and you're modifying the same object
<oprypin> normally methods shouldn't mutate objects passed to them, especially `initialize`
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
Creatornator has joined #crystal-lang
lvmbdv has joined #crystal-lang
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 276 seconds]
qard has quit [Quit: qard]
qard has joined #crystal-lang
<faustinoaq> oprypin, oh, ok thank you!
snsei_ has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
andrewzah has joined #crystal-lang
andrewzah has quit [Client Quit]
baweaver_away is now known as baweaver
<FromGitter> <j8r> I would like not to modify the hash, how can i do that?
<FromGitter> <j8r> Just pass it as an argument
<oprypin> j8r, delete the line that modifies the Hash
<FromGitter> <j8r> I mean, I would like each object have their own `@var`, modify theirs
<oprypin> `@var = passed_arg.dup`
<FromGitter> <j8r> Yeah thanks, I passed `var.dup` as argument :)
<FromGitter> <j8r> Thx @oprypin !
qard has quit [Quit: qard]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
qard has joined #crystal-lang
qard has quit [Client Quit]