ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.23.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
<cptaffe> Similar question, has anyone run into `crystal-db` stalling on an `insert ... returning`?
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
chamar has quit [Quit: Konversation terminated!]
andrewzah has joined #crystal-lang
snsei has joined #crystal-lang
andrewzah has quit [Ping timeout: 240 seconds]
_whitelogger has joined #crystal-lang
weston has joined #crystal-lang
weston_[m] has joined #crystal-lang
rohitpaulk has joined #crystal-lang
snsei has quit [Remote host closed the connection]
rohitpaulk has quit [Ping timeout: 260 seconds]
snsei has joined #crystal-lang
weston has quit [Ping timeout: 248 seconds]
andrewzah has joined #crystal-lang
andrewzah has quit [Ping timeout: 240 seconds]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
rohitpaulk has joined #crystal-lang
weston has joined #crystal-lang
snsei has quit [Remote host closed the connection]
rohitpaulk has quit [Ping timeout: 248 seconds]
_whitelogger has joined #crystal-lang
weston has quit [Ping timeout: 260 seconds]
snsei has joined #crystal-lang
Philpax__ has quit [Ping timeout: 240 seconds]
Philpax__ has joined #crystal-lang
sz0 has joined #crystal-lang
_whitelogger has joined #crystal-lang
claudiuinberlin 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]
mounibec has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Read error: Connection reset by peer]
mounibec has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
fiete has quit [Quit: WeeChat 1.9]
mounibec has joined #crystal-lang
mounibec has quit [Client Quit]
fiete has joined #crystal-lang
sz0 has quit [Quit: Connection closed for inactivity]
<FromGitter> <sdogruyol> Morning everyone
<FromGitter> <krypton97> Morning all
rohitpaulk has joined #crystal-lang
<cptaffe> Hi
andrewzah has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 264 seconds]
A124 has quit [Read error: No route to host]
A124 has joined #crystal-lang
Rinkana has joined #crystal-lang
<Rinkana> Hmm, i'm trying to get something like this working: https://play.crystal-lang.org/#/r/2p64
<FromGitter> <bararchy> Well
<FromGitter> <bararchy> item.is_a?(item_class)
<FromGitter> <bararchy> is not a class
<FromGitter> <bararchy> item_class should be a Class or a Generic type
<Rinkana> Do you know a workaround for it? So the get method returns the class requested or raises
<FromGitter> <bararchy> else .is_a?() wont work with it
<FromGitter> <bararchy> TBH this: `return item if item.is_a?(item_class.class)` which seems not to work
<FromGitter> <bararchy> not sure whty
<Rinkana> This seems to work
<Rinkana> However i'm expecting union issues later on.
<Rinkana> Argh, there they are
<Rinkana> Hmm, i don't want to append `.as()` to every call.
rohitpaulk has joined #crystal-lang
bmcginty has quit [Ping timeout: 240 seconds]
bmcginty has joined #crystal-lang
<FromGitter> <villzor> Morning all! I'm trying to invoke a getter call to a lazily read property from inside a method call, e.g. ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Anyone knows how to accomplish this? [https://gitter.im/crystal-lang/crystal?at=59b5119e319100804e18c274]
rohitpaulk has quit [Ping timeout: 248 seconds]
<FromGitter> <villzor> Ahh never mind I figured it out >_< I had written @ingredients which doesn't invoke the getter call. The above code works as expected... Sorry for bothering.
ShalokShalom_ has joined #crystal-lang
ShalokShalom has quit [Ping timeout: 240 seconds]
_whitelogger has joined #crystal-lang
Devros has joined #crystal-lang
Devros has quit [Client Quit]
<Rinkana> https://play.crystal-lang.org/#/r/2p6q Oh wow, this works!
andrewzah has quit [Ping timeout: 246 seconds]
rohitpaulk has joined #crystal-lang
alex`` has joined #crystal-lang
<Groogy> hmm where is the documentation for LibC?
<RX14> Groogy, there is none because its not really meant to be used outside the stdlib
<Groogy> well it's good for binding libraries
<Groogy> and I want to ensure Long is the right size
<RX14> yeah
<RX14> we should really document the types
<RX14> not the functions
<RX14> but probably the typesd
<Groogy> yeah that would be nice
<RX14> thing is that libs can't be documented currently
<RX14> they're always ignored
<Groogy> standard for signed long is **at least** 32bit
<Groogy> don't know what conditions are for it being bigger though
<Groogy> ah think I found on intel's webpage the difference
<Papierkorb> Groogy: `LibC::Long` et al are supposed to mirror the sizes of their C counterparts
<Groogy> yeah so (when windows is supported) it will be 32bit on Windows 64bit but 64bit on Linux/MacOS when the OS is 64 as well
<Groogy> and 32bit when its a 32bit system
<Papierkorb> anything else would at least be a severe bug
<Groogy> yeah I will have to assume it should work like this, though would be nice with some docs on it since its quite useful for doing bindings
<RX14> of course ia-32 and ia-64 are entirely unrelated processor architectures
<RX14> why would intel make it simple
<Papierkorb> ia64 is itanium, not x86
<Groogy> well they say that theirs are compliant with Microsoft C++ and GCC
rohitpaulk has quit [Ping timeout: 240 seconds]
<RX14> Papierkorb, yeah its annoying
<Papierkorb> At least it's dead for good
<RX14> well
<RX14> i hope we're not stuck on x86 for the rest of my life
<Papierkorb> The next thing needs to be "better", whatever that means
<Papierkorb> And as far I hear, none other currently existing architectures are actually better
<RX14> i've watched the mill architecture talks and they're really interesting
<RX14> can't wait until they get to the FPGA and we can see if it's "real"
<Papierkorb> > In addition, the size of a "long double" also varies by operating system. On Windows*, the size is 8 bytes by default. On Linux or Mac OS X, 10 bytes are used for the representation of a long double, although the allocated size may be larger (12 bytes on IA-32 Linux; 16 bytes elsewhere).
<Papierkorb> wtf
rohitpaulk has joined #crystal-lang
<Groogy> that's for memory alignment isn't it? Though feels unnessecary if you gonna allocate more why not just use all of it
<RX14> because you get more performance by not?
<FromGitter> <faustinoaq> Hi, When Crystal supports Windows how libraries and dependencies will work? Do we will need to install a bunch of dll before execute a crystal binaries?
<Papierkorb> I wasn't referring to the alignment, which is fine. But that, again, Windows is different to everyone else
<Papierkorb> faustinoaq, well, DLL hell like with every other program on Windows
<Rinkana> Can i force procs to always return Nil?
<FromGitter> <sdogruyol> @Rinkana yes
<Rinkana> Ah great, thanks!
<FromGitter> <sdogruyol> np 👍
andrewzah has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
_whitelogger has joined #crystal-lang
<oprypin> sdogruyol, wait, how is that related
<oprypin> RX14, how does the current state of Windows support in Crystal compare to that fork that was considered messy?
<RX14> well its not complete
<Rinkana> sdogruyol My compiler starts complaining about T values. This is what i have currently: https://play.crystal-lang.org/#/r/2p7q
<RX14> oprypin, i doubt you could do anything in current crystal on windows
<oprypin> how does txe iterate on it?
<RX14> by implementing more in Crystal::System
<RX14> IO is the big problerm
<RX14> IO is the big problem
<RX14> once we have that sorted out
<oprypin> RX14, but how do we know that code works?
<RX14> then the rest we can sort out slowly
<RX14> oprypin, because it's taken from a fork that works
<RX14> you eman the LibC base?
<oprypin> i mean everything
<RX14> you mean CI?
<RX14> im not sure what you're asking
<oprypin> no, i mean i could put some random code and say trust me this works on windows but i actually have no idea
<oprypin> and neither do you when merging
<RX14> so... CI
<RX14> because thats what PR ci is for
<oprypin> CI is only one of the ways to confirm it, but it's obviously missing for Windows
<RX14> well a certain amount of trust is required
<RX14> i don't see the issue myself
<RX14> whats the point in putting something in which you know doesn't work
<oprypin> the fact that we don't have Crystal working at all on Windows complicates so many things
<oprypin> you can't properly work on it, you can't confirm it works
<RX14> all we've merged is the LibC base and the linker stuff
<RX14> and a few refactors
<RX14> next thing to sort out is IO
<RX14> and once we have IO we can start
<RX14> also we can compile for windows with --prelude=empty
<RX14> and just require whatever we need to test
<oprypin> that's nice then
<oprypin> maybe i should look into exception hierarchy
<RX14> well whats the alternative?
<RX14> oprypin, please do, i'd love a PR to remove that annoying Errno
<oprypin> merge messy fork, then fix it up
<RX14> yeah but fix it up never happens
<RX14> it would remain as technical debt for a long time
<RX14> slowing down everything on linux
<RX14> which is bad for everyone
<RX14> i know that we'd all refret it if we had duplicated every single platform-specific file
<RX14> regret*
rohitpaulk has joined #crystal-lang
andrewzah has quit [Ping timeout: 240 seconds]
<oprypin> hey, the situation with exceptions is not so bad. I think that `WinError < Errno` is, in fact, the right way to go, just with better names and a bunch of subclasses
<oprypin> thats what python does kinda, but there are some fake relationships due to legacy
rohitpaulk has quit [Ping timeout: 240 seconds]
andrewzah has joined #crystal-lang
<RX14> oprypin, i don't think we should keep errno
<oprypin> rename it to OSError
<RX14> i think that it's a very C way to do things
<oprypin> it works very well in Python
<RX14> and would have clearly not been the way to do things if we didnt have ruby or C heritage
<RX14> i think the correct way is to have a seperate exception class for each type of error, *with machine-readable fields* and use those
<oprypin> RX14, there are way too many possible kinds of errors, it's not worth making a class for each of them
<RX14> perhaps there might be an abstract OSError
<RX14> oprypin, well that's how it's done in java and C#
<RX14> and it works just fine
<RX14> i think it's one of the few parts of those languages which are well done
<RX14> or more accurately, would translate well to crystal
<FromGitter> <bararchy> We need more fine-grained errors for sure
<FromGitter> <bararchy> right now half the code pash is `raise "ho no!!"`
rohitpaulk has joined #crystal-lang
ShalokShalom_ is now known as ShalokShalom
rohitpaulk has quit [Ping timeout: 248 seconds]
<FromGitter> <faustinoaq> Hi people, I'm creating a new shard, `require "my-new-library"` vs `require "my_new_library"` both are valid, but which is more recommended? What are the shard name conventions?
<oprypin> i thought `require "my-new-library"` is invalid. underscores is definitely the way to go
<RX14> its not invalid
<oprypin> faustinoaq, require "my_new_library" to get MyNewLibrary module. repository name can be anything
<RX14> but it's atypical
<RX14> what oprypin said
snsei has joined #crystal-lang
Inause has joined #crystal-lang
<Inause> good morning 😊
<FromGitter> <bew> hi!
snsei has quit [Remote host closed the connection]
Inause has quit [Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org]
andrewzah has quit [Ping timeout: 240 seconds]
weston has joined #crystal-lang
andrewzah has joined #crystal-lang
snsei has joined #crystal-lang
andrewzah has quit [Ping timeout: 248 seconds]
<Rinkana> Is there any difference between to_unsafe and pointerof ?
andrewzah has joined #crystal-lang
andrewzah has quit [Ping timeout: 260 seconds]
weston has quit [Ping timeout: 240 seconds]
hightower3 has joined #crystal-lang
<oprypin> Rinkana, yes. for a class, to_unsafe returns the pointer, pointerof returns the pointer to the pointer
<crystal-gh> [crystal] asterite opened pull request #4945: GC.enable: raise if GC is not disabled (master...bug/gc-enable) https://git.io/v5PIf
hightower2 has quit [Ping timeout: 240 seconds]
<Rinkana> Meh, https://play.crystal-lang.org/#/r/2p9n . Can i fix this without moving the require down?
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<Rinkana> Hmm, i'm thinking if it is even logical to have it at the top by default
snsei has quit [Remote host closed the connection]
<RX14> oprypin, in #4943 do you mean defined but not used?
<RX14> because you said it the other way around
andrewzah has joined #crystal-lang
<oprypin> RX14, no
andrewzah has quit [Ping timeout: 240 seconds]
<oprypin> RX14, `ESHUTDOWN = LibC::ESHUTDOWN` <- used here but not defined
<RX14> oh you wan LibC::ESHUTDOWN isn't defined?
<RX14> mean*
<RX14> how does that work then?
<oprypin> RX14, compiler ignores until they're used
<RX14> huh
<RX14> rip my github notifications
<FromGitter> <sdogruyol> use octobox :P
<Rinkana> Can i get the location of the current file. I taught it was some kind of global (like the PHP __FILE__ const) but i can't seem to find it
<RX14> @sdogruyol oh wow thank you so much this changes everything
<RX14> Rinkana, uhh __FILE__ works
<Rinkana> Oh god, i'm retarded :/
<Rinkana> Thanks!
<FromGitter> <sdogruyol> @RX14 you're welcome :)
Philpax__ has quit [Ping timeout: 248 seconds]
<crystal-gh> [crystal] RX14 closed pull request #3476: Add specs for debug info output (master...debug/spec-with-gdb) https://git.io/vXvbA
snsei has joined #crystal-lang
<crystal-gh> [crystal] RX14 pushed 1 new commit to master: https://git.io/v5Pqs
<crystal-gh> crystal/master 203ab9f TSUYUSATO Kitsune: Format: fix #4620, to format /= after else in case (#4627)...
andrewzah has joined #crystal-lang
andrewzah has quit [Ping timeout: 240 seconds]
<travis-ci> crystal-lang/crystal#203ab9f (master - Format: fix #4620, to format /= after else in case (#4627)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/273888421
andrewzah has joined #crystal-lang
andrewzah has quit [Ping timeout: 260 seconds]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
rohitpaulk has joined #crystal-lang
sp4rrow has joined #crystal-lang
<sp4rrow> does the new LLVM effect crystal ?
<FromGitter> <sdogruyol> Haven't tried out yet
<sp4rrow> hmm
andrewzah has joined #crystal-lang
<sp4rrow> I wonder if it will make the concurrency implementation easier to implement
linuksz has joined #crystal-lang
<wmoxam> I doubt it has any effect
<wmoxam> Crystal only recently dropped support for versions < 3.6
andrewzah has quit [Ping timeout: 260 seconds]
* sp4rrow those changes seem to be different then what I expected from the announcement
<hightower3> Is our friend Ari back to working on Crystal or just doing minimal/maintenance work?
<sp4rrow> was he gone?
<linuksz> I want to parse a YAML file that has the following structure:
<linuksz> filename1:
<linuksz> keyword1:
<linuksz> - date2
<linuksz> - date1
<linuksz> keyword2:
<linuksz> - date3
<linuksz> filename2:
<linuksz> keyword3:
<linuksz> - date4
<FromGitter> <sdogruyol> ugh
<linuksz> etc...
<linuksz> The file can contain unlimited filename, with unlimited keyword and unlimited date.
<FromGitter> <sdogruyol> that's not good
<linuksz> The usage of YAML.mapping is not clear for me. There is a FileHistory class, and I want to use YAML.mapping for parsing the file. I created a HistoryOfFile class, that manages the keywords and dates. There is a Hash of String => HistoryOfFile. The keys are the filenames. Is it possible to parse the YAML file using YAML.mapping in the FileHistory class for building the hash that indexes the filenames, and using YAML.mapping for the
<FromGitter> <sdogruyol> please use a gist
<linuksz> history of each filename to convert it to HistoryOfFile ?
<Groogy> use pastebin for stuff like that
<hightower3> sp4rrow, yes, he left Manas and there was an announcement about it
<linuksz> for 9 lines?
<Groogy> yeah it's still better to put it in a gist/pastebin etc.
<linuksz> ok, i will do it next time
<sp4rrow> hightower3 do you have a link to that ?
<Groogy> Also I haven't used YAML.mapping so no idea on how to answer that, I just read things manually
<sp4rrow> I have been gone for a while and I missed that
<Groogy> since I need to solve bit more complex references
<Groogy> linuksz doesn't this page answer it for you? https://crystal-lang.org/api/0.23.1/YAML.html
<Groogy> or already read that?
<linuksz> i read this
<linuksz> but it's not clear
<sp4rrow> I think there was another YAML lib someone sent me about a year ago
<sp4rrow> I am not sure if it is still maintained
<hightower3> sp4rrow, can't find it now, but it was discussed in this chat as well, try searching the chat logs. (I can't remember when was it - maybe 2 months ago?)
<Groogy> but yeahfrom what I get it should be possible?
<Groogy> you just define that the type of the variable is a HistoryOfFile?
<linuksz> the problem is that if i understood it well, in each variable in YAML.mapping represents a YAML key
<linuksz> but
<linuksz> the keys are filenames
<linuksz> and there is a lot of them
<Groogy> well the variable that holds the hash would be a Hash(String, HistoryOfFile) type right?
<Papierkorb> `Hash(String, HistoryOfFile).from_yaml(...)`
rohitpaulk has quit [Ping timeout: 248 seconds]
<linuksz> Papierkorb: i will try it to read the file, but my program have to write it first. how can i dump it to YAML?
<Groogy> to_yaml?
<linuksz> and should the HistoryOfFile class have a YAML.mapping method in this case?
<Groogy> yeah since you need to define the variables so it knows how to serialize them
<Groogy> I think?
<Papierkorb> yes
<linuksz> but the problem is that the key names are the contents of the variables
<linuksz> what should i do in that case
<linuksz> ?
rohitpaulk has joined #crystal-lang
<linuksz> and YAML.mapping needs to know the key name that is different in every case
<Groogy> if it's a Hash var then it puts the key name into the key part of the hash
<linuksz> but what should i give as instead of key name to the argument of YAML.mapping?
sp4rrow has quit [Quit: Textual]
<Groogy> in HistoryOfFile or FileHistory?
<linuksz> HistoryOfFile
<Groogy> The FileHistory has a collection of HistoryOfFile wich are identified by filenames right?
<linuksz> yes {} of String => HistoryOfFile
<Groogy> what entries in HistoryOfFile have different variables?
<Groogy> because for one, Crystal doesn't support adding variables dynamically at runtime
<linuksz> the history of file's data is this:
<linuksz> @keywords = {} of String => Array(Time)
<linuksz> the String is the keyword
<Groogy> then that's how you define the type in the mapping as well
<Groogy> Hash(String, Array(Time))
<Groogy> done
sp4rrow has joined #crystal-lang
<linuksz> ok, but what should i give to the arguments of YAML.mapping?
<linuksz> it excepts something similar to this:
<linuksz> something: Hash(String, Array(Time))
<linuksz> YAML.mapping(
<linuksz> )
<linuksz> but there isn't 'something' key in the yaml file
<Groogy> also ugh why does FreeType have to be so special with how it defines its enums. Can I define 1 byte chars somehow easily? Like '\8a' or something
andrewzah has joined #crystal-lang
<Groogy> well you have to provide data to something, YAML probably doesn't write anything if there's nothing in there
<linuksz> the YAML key name is the Hash's key
<RX14> linuksz, you don't *need* to use YAML.mapping
<RX14> you're trying to fudge it in where you shouldn't use it
<linuksz> but how else can i do it?
<RX14> if your dasastructure is truly a Hash(String, Hash(String, Array(String))) then thats what you parse from yaml
<RX14> and thats the same datastructure your program should use internally
<RX14> and for you, it seems to be the case
<linuksz> no, because the HistoryOfFile defines methods
<RX14> what is a historyoffile
<RX14> in that case then you should define a def initialize(yaml : YAML::PullParser)
<RX14> then use @foo = Hash(String, Array(String)).new(yaml)
<linuksz> i am creating a paste. wait a moment
<RX14> which gets you your deserialization
<Papierkorb> or just split logic code from storage ♪
<RX14> and the same for to_yaml
<RX14> Papierkorb, or that
<RX14> but it's perfectly possible to take both approaches
<RX14> im going to have dinner rn
<RX14> so i wont be able to reply
<Groogy> linuksz YAML.mapping is for when you want to directly mimic/serialize the object and its structure into YAML format
andrewzah has quit [Ping timeout: 240 seconds]
<Groogy> if that's not what you want (i.e you don't want @something to be shown) then you don't want YAML.mapping anymore
snsei_ has joined #crystal-lang
<Groogy> then you have RX14 or you can just traverse the nodes yourself
<FromGitter> <asterite> YAML.parse
<RX14> @asterite that's not what linuksz wants either...
<Groogy> YAML.parse(io) will get you a YAML::Any object, from there you can navigate the entire tree
snsei has quit [Ping timeout: 240 seconds]
<RX14> but if we stick with the combined logic and storage it's still posible
<linuksz> here is the FileHistory class: http://sprunge.us/jKCY
<linuksz> currently its rewriting is in progress
snsei_ has quit [Remote host closed the connection]
<linuksz> the methods don't work
<Groogy> anyway is there a way to create 8bit chars literals somehow? Need it for freetype binding which is super annoying in how they create their enums which are a bit bonkers
<Papierkorb> Groogy: wtf is that .. In any case: `enum Foo : UInt8; Bar = 'a'.ord; end` should work
<Groogy> THey bitshift the chars into a unique identifier for each encoding
<Groogy> which is weird
<Papierkorb> Sounds like ioctl()
<Papierkorb> Use a helper method
<Papierkorb> Erm .. not sure if that'll work. A macro will however.
<Groogy> though I am not sure since they are cstyle casting a bunch
<Groogy> so
<Groogy> in what order will this evaluate? THe casting first or the bitshift?
<Groogy> i.e is it bitshifting on 8bit or 32bit? because if it is 32bit I guess it should be fine?
<Papierkorb> Cast binds stronger
<Groogy> and the 128 first characters in unicode is same as ansi so should be fine
<Papierkorb> Yup
rohitpaulk has quit [Ping timeout: 240 seconds]
<Groogy> huh you can't define macros in lib
<Groogy> interesting
<Groogy> hmmm
<Groogy> so 's' does not count as a constant?
<Groogy> (nevermind the value argument in the macro, spotted that and fixed it but still same error)
<Groogy> obviously the 0's for NONE works but 's' it doesn't like and it's not a constant D:
snsei has joined #crystal-lang
<crystal-gh> [crystal] asterite closed pull request #4675: change computation of hash value. (master...hasher1) https://git.io/vQ23E
<Papierkorb> Groogy: I take that as you'll be happy to build a freetype shard with bindgen after its next release :P (May take another week)
snsei has quit [Remote host closed the connection]
rohitpaulk has joined #crystal-lang
<Groogy> hah oh yes definetly
<Groogy> I am just doing this so I can get text rendering, it is not meant to be permanent (except the rendering part)
snsei has joined #crystal-lang
<Groogy> let me know when you think bindgen can deal with freetype and I'll happily maintain freetype and freeimage
<Groogy> also alright so 's' does count as valid constant value for a enum it seems, BUT not for a macro
<Papierkorb> Yah the next architecture overhaul will make it much more flexible, so it should be able to cope with pure C as long it doesn't get too whacky
<Groogy> I am feeling like just manually calculating what each encoding value will be and set it manually <_<
<Groogy> becaus this is dumb
<Papierkorb> Lul you should be able to use the clang/bindgen tool for that *cough*
<Groogy> it's a macro to define enum values though?
<Papierkorb> Well, it'll give you a JSON document containing the enum constants with values, so close enough
<Groogy> ah how does it work?
<Papierkorb> I ask clang really nice to give me those
<Papierkorb> Which should work for your case too, otherwise it wouldn't be valid C code
<Groogy> oh you mean bindgen will automatically find out what the enum value here would be?
<Papierkorb> Yes
<Groogy> oh please sweet Odin yes <3
<Papierkorb> Try this $ clang/bindgen -e NameOfEnumHere /path/to/header.h
<Papierkorb> Pipe that through `jq .` if you have it for nice formatting
<Groogy> tons of errors because freetype seem to be safeguarding the header if you don't include things in the right order :/
<Papierkorb> Do you have a sample program or something?
<Groogy> Unless I am doing something wrong
<Papierkorb> Just pass a path to that
<Groogy> clang -e FT_Encoding /usr/include/freetype2/freetype/freetype.h -o ./freetype.h.gch
<Papierkorb> Oh, not `clang` itself, the `clang/bindgen` (that's a path) tool part of the bindgen project
<Groogy> oh okay thought you meant clang *or* my bindgen tool
<Papierkorb> Or if you don't wanna mess with clang, just copy/paste all of the enum 'constants' over in a simple C main() which printf()s all of the values
<Papierkorb> May be the fastest option if you don't have a bindgen installation handy (or if building it fails)
<Groogy> yeah doesn't seem to be any arch package for it
<Groogy> so I'll just do the bruteforce way
andrewzah has joined #crystal-lang
<Groogy> if anyone ever wonders what those magical enums are....
<Groogy> FT_ENCODING_MS_SYMBOL=1937337698
<Groogy> FT_ENCODING_UNICODE=1970170211
andrewzah has quit [Ping timeout: 246 seconds]
<Groogy> (ノ `Д´)ノ ~┻━┻
rohitpaulk has quit [Ping timeout: 264 seconds]
DeBot has joined #crystal-lang
asterite_ has joined #crystal-lang
asterite has quit [Ping timeout: 240 seconds]
asterite_ is now known as asterite
jhass has quit [Ping timeout: 255 seconds]
jhass has joined #crystal-lang
asterite has quit [Ping timeout: 240 seconds]
DeBot_ has joined #crystal-lang
asterite has joined #crystal-lang
jhass has quit [Ping timeout: 252 seconds]
jhass has joined #crystal-lang
DeBot has quit [Ping timeout: 252 seconds]
andrewzah has joined #crystal-lang
andrewzah has quit [Ping timeout: 240 seconds]
linuksz has quit [Quit: Leaving.]
snsei_ has joined #crystal-lang
snsei_ has quit [Remote host closed the connection]
snsei has quit [Ping timeout: 264 seconds]
snsei has joined #crystal-lang
sp4rrow has quit [Ping timeout: 240 seconds]
<FromGitter> <sdogruyol> lol
andrewzah has joined #crystal-lang
alex`` has quit [Quit: WeeChat 1.9]
andrewzah has quit [Ping timeout: 240 seconds]
andrewzah has joined #crystal-lang
andrewzah has quit [Ping timeout: 255 seconds]
snsei_ has joined #crystal-lang
snsei_ has quit [Remote host closed the connection]
snsei has quit [Ping timeout: 248 seconds]
<FromGitter> <straight-shoota> Wow, I just had 4 pages of updated issues in the github repo from the last 5-6 hours - most of them having one (or even more) comment from @asterite . It's great to see so much being done! =)
<FromGitter> <krypton97> 👏
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
rohitpaulk has joined #crystal-lang
snsei has joined #crystal-lang
sz0 has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
<crystal-gh> [crystal] asterite opened pull request #4946: Introduce Crystal::Hasher for computing a `hash` value (master...refactor/hash) https://git.io/v5P0b
<crystal-gh> [crystal] asterite closed pull request #4575: MatchData: refactor to_s (master...fix/regex-match-data/refactor-to-s) https://git.io/vHNG1
<18VAB6LRW> [crystal] asterite pushed 1 new commit to master: https://git.io/v5PEW
<18VAB6LRW> crystal/master 7369daa TSUYUSATO Kitsune: MatchData: refactor to_s
<crystal-gh> [crystal] asterite closed pull request #3493: allow rand with zero value (master...rand_zero) https://git.io/vXOR0
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/v5PEB
<crystal-gh> crystal/master 325288a Laurent Vallar: [vagrant box] add Debian distribs
<FromGitter> <molovo> Quick question, is there a simple way to check if a constant exists at compile time? For example, I’m building a library that can accept `Kemal::ParamParser` in one of its overloads, but I don’t want to include kemal as a dependency just for that one overload, I’d rather just exclude it at compile time if `Kemal::ParamParser` is not present.
snsei has quit [Remote host closed the connection]
<travis-ci> crystal-lang/crystal#6202e37 (master - allow rand from zero value): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/273971723
<travis-ci> crystal-lang/crystal#7369daa (master - MatchData: refactor to_s): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/273971153
<travis-ci> crystal-lang/crystal#325288a (master - [vagrant box] add Debian distribs): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/273971997
sz0 has quit [Quit: Connection closed for inactivity]