ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.20.3 | Fund Crystal's development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
bjz has quit [Ping timeout: 248 seconds]
bjz has joined #crystal-lang
<FromGitter> <TheLonelyGhost> Is the process of putting together the DEB, RPM, or other packages from source for the compiler documented anywhere?
<FromGitter> <TheLonelyGhost> (btw, just noticed official support of RPMs came in recently. kudos!)
DavidAlexander[m has left #crystal-lang ["User left"]
<BlaXpirit> TheLonelyGhost, you may find something at https://github.com/crystal-lang/omnibus-crystal
<FromGitter> <TheLonelyGhost> Perfect. Didn't realize it was being tracked in another repo. :)
Kug3lis has joined #crystal-lang
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 246 seconds]
Kug3lis has quit [Quit: Textual IRC Client: www.textualapp.com]
txdv has quit [Ping timeout: 258 seconds]
txdv has joined #crystal-lang
Kug3lis has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<literal> what's a good statement profiler for a Crystal application on Linux?
Kug3lis is now known as Kug3lis_off
bjz has joined #crystal-lang
vivus-ignis has quit [Ping timeout: 252 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox_ has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox_ has quit [Remote host closed the connection]
<crystal-gh> [crystal] MakeNowJust opened pull request #3821: Add Hash#compact and Hash#compact! (master...feature/hash/compact) https://github.com/crystal-lang/crystal/pull/3821
<DeBot> https://github.com/crystal-lang/crystal/pull/3821 (Add Hash#compact and Hash#compact!)
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 264 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 246 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
mahlgrimm has joined #crystal-lang
Kug3lis_off is now known as Kug3lis
<FromGitter> <splattael> "linux perf" works for me
Kug3lis is now known as Kug3lis_off
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Philpax_ has joined #crystal-lang
Philpax has quit [Ping timeout: 256 seconds]
soveran has joined #crystal-lang
Philpax_ has quit [Ping timeout: 268 seconds]
mahlgrimm has quit [Quit: mahlgrimm]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
Kug3lis_off is now known as Kug3lis
pawnbox has quit [Remote host closed the connection]
Kug3lis is now known as Kug3lis_off
Kug3lis has joined #crystal-lang
pawnbox has joined #crystal-lang
_whitelogger has joined #crystal-lang
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 258 seconds]
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kug3lis has joined #crystal-lang
ssvb has quit [Remote host closed the connection]
matp has quit [Read error: Connection reset by peer]
Philpax_ has joined #crystal-lang
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
matp has joined #crystal-lang
Kug3lis has joined #crystal-lang
_whitelogger has joined #crystal-lang
Raimondii has joined #crystal-lang
hmans has quit [Quit: ZNC 1.6.3+deb1+xenial0 - http://znc.in]
hmans has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
hmans has quit [Client Quit]
hmans has joined #crystal-lang
bjz has joined #crystal-lang
bjz_ has quit [Ping timeout: 265 seconds]
<Yxhuvud> you can probably use valgrind too
<RX14> literal, callgrind or perf work great
<RX14> `valgrind --tool=callgrind --dump-instr=yes --collect-jumps=yes --simulate-cache=yes --toggle-collect=GC_init --collect-atstart=yes` is what I use for callgrind
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kug3lis has joined #crystal-lang
<literal> cool
<RX14> literal, also make sure to compile with debug info
pawnbox has quit [Remote host closed the connection]
soveran has quit [Remote host closed the connection]
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pawnbox has joined #crystal-lang
Kug3lis_off has quit [Ping timeout: 246 seconds]
jaitaiwan has joined #crystal-lang
<jaitaiwan> Hey Guys, anyone in here know how to get or has a basic example of UDP multicast in crystal?
<literal> RX14: yeah
soveran has joined #crystal-lang
<splitty_> Hey, how can I export Crystal functions to C or Asm?
<splitty_> Ah, so I just define a glue-function?
<splitty_> Sounds good, thanks :)
Kug3lis has joined #crystal-lang
<splitty_> Can I use {% for ... %} with integers instead of arrays?
<splitty_> I wanna do something like 256.times do { |i| ... } but with {% for %} syntax
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vMqMu
<crystal-gh> crystal/master 29fe3de TSUYUSATO Kitsune: Avoid allocation in Iterator#with_index(&block)
<RX14> splitty_, try using a range
<BlaXpirit> splitty_, namely https://carc.in/#/r/1itz
<splitty_> Seems to work, thanks
<splitty_> I didn't think it would work because I had issues with ranges previously
<splitty_> Okay, now.. is it possible to obtain a pointer to a C function inside a lib?
<splitty_> In C I'd just do (unsigned)the_function
<splitty_> To get the address
<BlaXpirit> splitty_, uhhh i dont quite remember. ttry &->functio
pawnbox has quit [Remote host closed the connection]
<splitty_> &->foo doesn't work
<splitty_> Is there some official documentation on this?
pawnbox has joined #crystal-lang
<BlaXpirit> splitty_, I think this should work. &->Lib.fun(Int32)
<BlaXpirit> give more details, maybe there is a misunderstanding
<splitty_> BlaXpirit, I'm writing a driver for my OS and I need to import 256 functions from assembly code to be used within the Crystal driver
<splitty_> I have a private lib LibIDT
<splitty_> And I'm defining the functions using: {% for i in 0..IDT_GATE_NUM %} fun isr{{ i }} {% end %}
<splitty_> Now I need to get a UInt16 with the address of each of the functions
<splitty_> I'm doing this within a macro: %base = &->LibIDT.{{ func_name }}
<splitty_> But when compiling I'm getting Syntax error in expanded macro: set_gate:2: unexpected token: &
<BlaXpirit> splitty_, are you doing this INSIDE the lib definition?
<splitty_> Nope, outside of the lib definition inside of a macro
<BlaXpirit> splitty_, hm, try simply dropping the '&'
<FromGitter> <foi> i've started with crystal and i can't understand how initialize type for this type of hash ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ , why this ok - https://carc.in/#/r/1iu0, but that failed - https://carc.in/#/r/1iu1 [https://gitter.im/crystal-lang/crystal?at=586a4b4d7a3f79ef5dc8abfd]
<splitty_> BlaXpirit, I'm getting a Proc then
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<BlaXpirit> splitty_, well it probably means you're one step away from getting the pointer
pawnbox has quit [Remote host closed the connection]
<splitty_> Awesome. Can I just use pointerof with the Proc?
Chronium has joined #crystal-lang
pawnbox has joined #crystal-lang
<splitty_> Ah I see, there's a pointer member
unshadow has joined #crystal-lang
<FromGitter> <foi> sorry about my post, i don't know crystal doesn't use : as key delimiter in hash ( => does
<BlaXpirit> foi, what does this data structure represent? are you working with json?
<FromGitter> <foi> @FromIRC yes, json :( i've tried with => and it also fails https://carc.in/#/r/1iu4
<BlaXpirit> foi, this is extremely unidiomatic crystal code, that's why it's so hard. you can do this though https://carc.in/#/r/1iu6
<BlaXpirit> the problem with your code above. line 1 has no effect because that variable is immediately rewritten with a variable of a different type in the next line. line 3 tries to put a hash that is of a slightly different type - `Hash(String, Bool)` can't be assigned where `Hash(String, String | Int32 | Bool)` is expected
<FromGitter> <foi> @FromIRC <BlaXpirit> Thanks!
am_ has joined #crystal-lang
<jaitaiwan> Trying again... anyone here have a multicast example for crystal or point me in the right direction?
<RX14> jaitaiwan, there's a UDP sockets example, you're just going to have to work it out from that
<RX14> i don't know what you need to do special to bind multicast
<jaitaiwan> RX14 thanks. I'd got that far. Right now I can only get multicast working with allhost casting which is not idea so I'm trying to figure out exactly what's going on... THanks for the nidge
am_ has quit [Read error: Connection reset by peer]
DTZUZU2 has quit [Ping timeout: 245 seconds]
vivus-ignis has joined #crystal-lang
<RX14> jaitaiwan, the best way would be to work out how you would do it in C then find those function's usaged in the stdlib
<RX14> it might not be possible
<RX14> (yet)
Ven has joined #crystal-lang
vivus-ignis has quit [Ping timeout: 246 seconds]
Ven has quit [Ping timeout: 252 seconds]
ome has joined #crystal-lang
user9998 has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kug3lis has joined #crystal-lang
<splitty_> Is a StaticArray contiguous?
<RX14> a StaticArray is exactly like a C array iirc splitty_
<splitty_> RX14, does Crystal change endianness on structures?
<splitty_> This is really strange
<RX14> pretty sure it doesn't
<splitty_> I had to calculate the GDT entries by hand with bit shifts and masking because just using a struct triple-faulted
<splitty_> Apparently, a C struct with a size of 64 bits is not the same as the same data encoded directly into a UInt64
<splitty_> And now we're having the same problem with the IDT
<RX14> well
pawnbox has quit [Remote host closed the connection]
<RX14> it should be
<RX14> it's a bug at some level of the stack
<splitty_> I'll do some testing on this
<RX14> maybe you can work out a pattern of what is being written
<FromGitter> <asterite> splitty: are you using the @[Packed] attribute?
<splitty_> Yes asterite, I am
_whitelogger has joined #crystal-lang
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kug3lis has joined #crystal-lang
vivus-ignis has joined #crystal-lang
vivus-ignis has quit [Ping timeout: 264 seconds]
vivus-ignis has joined #crystal-lang
pawnbox has joined #crystal-lang
vivus-ignis has quit [Ping timeout: 246 seconds]
vivus-ignis has joined #crystal-lang
user9998 has quit [Quit: Leaving]
soveran has quit [Remote host closed the connection]
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kug3lis has joined #crystal-lang
<literal> this is a bug in the standard library, right? https://gist.github.com/hinrik/b6dc2122a00a8df666edacb74add5b39
vivus-ignis has quit [Quit: vivus-ignis]
vivus-ignis has joined #crystal-lang
<FromGitter> <maiha_twitter> literal: `new(0,0,0,0)` means `0 days` + `new(0,0,0)`
<literal> ah, I misread the docs as h+m+s and h+m+s+ms, didn't see the day
pawnbox has quit [Remote host closed the connection]
unshadow has quit [Ping timeout: 246 seconds]
<FromGitter> <maiha_twitter> Yup, it's better 4th args means `ms` I think. But it is :)
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
pawnbox has joined #crystal-lang
Dreamer3 has joined #crystal-lang
soveran has joined #crystal-lang
lacour has joined #crystal-lang
vivus-ignis has quit [Ping timeout: 258 seconds]
vivus-ignis1 has joined #crystal-lang
vivus-ignis1 is now known as vivus-ignis
ome has quit [Quit: Connection closed for inactivity]
DTZUZU2 has joined #crystal-lang
vivus-ignis has quit [Ping timeout: 248 seconds]
unshadow has joined #crystal-lang
<unshadow> What is the right way to use the 'parallel' call ?
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 268 seconds]
<BlaXpirit> unshadow, result1, result2 = parallel(expression1, expression2)
<BlaXpirit> uhm, it seems like this macro can return uninitialized variables if jobs raise an exception
<unshadow> Thanks BlaXpirit
Kug3lis has quit [Ping timeout: 245 seconds]
chino has quit [Ping timeout: 240 seconds]
poikon has quit [Ping timeout: 240 seconds]
aarongodin has quit [Ping timeout: 245 seconds]
emmanueloga has quit [Ping timeout: 246 seconds]
twisterghost has quit [Ping timeout: 240 seconds]
kiliankoe has quit [Ping timeout: 245 seconds]
poikon has joined #crystal-lang
aarongodin has joined #crystal-lang
twisterghost has joined #crystal-lang
emmanueloga has joined #crystal-lang
kiliankoe has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
chino has joined #crystal-lang
pawnbox has joined #crystal-lang
<unshadow> Is there a way to kill or abort a Fiber from the outside?
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<splitty_> RX14, Papierkorb, my IDT is still not working
<splitty_> I've been trying to fix this for the last four hours
<splitty_> It really looks like C structs are broken in some cases
<splitty_> Which I can't really imagine.. they should be well tested
<BlaXpirit> unshadow, i don't think so
<BlaXpirit> obviously it should be possible to make the event loop just forget about it
<BlaXpirit> but it's completely unpredictable what garbage will be left behind by it
<unshadow> BlaXpirit: I'm trying to implamente a FiberPool (like a thread pool) and want to have a shutdown option where all Fibers in the pool are stoped
<BlaXpirit> unshadow, ideologically a FiberPool is nonsense
<unshadow> how come ?
<BlaXpirit> there is little to no advantage in their reuse, compared to ending one fiber and starting another
<BlaXpirit> just end fibers together with the task they carried out, and you'll never need to kill em
<BlaXpirit> if it is for the purpose of limiting the number of active tasks, that's also doable but it doesn't mean you have to implement a classic pool
<unshadow> BlaXpirit: not regarding reuse, more about a "task pool" , lets you decide a max running tasks at any giving time, and it has a queue where new jobs are witing untill the max jobs are down
<unshadow> BlaXpirit: exactly :)
<BlaXpirit> start N tasks. when a task ends, it sends something to a channel. the fiber ends. receiver of that channel will start the next task.
<BlaXpirit> ...in a new fiber
<splitty_> BlaXpirit, do you have experience with setting up an IDT, by any chance? :P
<BlaXpirit> splitty_, you speak in terms i don't know about
<splitty_> I'm trying to enable interrupts in my kernel and I just can't get it to work
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<BlaXpirit> unshadow, i have no idea what that 'value.kill' does
<BlaXpirit> presumably Fiber#kill but where is it defined?
<unshadow> BlaXpirit: it's not XD I just added it there to show what I wanted to achive, but I guess cleaning the hash will just tell the GC to swipe the Fibers up right ?
<BlaXpirit> unshadow, certainly not
Dreamer3 has quit [Quit: Computer has gone to sleep.]
<BlaXpirit> event loop remembers the fibers and you cant do anything (within sane bounds) to make it forget about them, until they end
Dreamer3 has joined #crystal-lang
<unshadow> BlaXpirit: I guess that it make more sense to just not handle a shutdown then
<BlaXpirit> if you insist on this approach, then i guess so
<BlaXpirit> unshadow, if you add the "limitation" that the fiber pool ends as soon as there are no more tasks, then a different approach comes to mind
<splitty_> BlaXpirit, do you see anything obviously wrong with this? https://github.com/TheKernelCorp/NuummiteOS/blob/idt_dev/kernel/src/lib/hal/idt.cr
<BlaXpirit> unshadow, just make a fiber that feeds tasks into a non blocking channel, and worker fibers that pull tasks from it and end when there is nothing more
<BlaXpirit> unshadow, but i would still recommend 1 fiber per task
<BlaXpirit> splitty_, be very careful not to mix up the meaning of `pointerof`
<BlaXpirit> for example, pointerof(gates) - do you want a pointer to a pointer - or a pointer to the first item
<BlaXpirit> although i probably pointed this out some days ago
<BlaXpirit> if that was you
<splitty_> BlaXpirit, I want the address of the whole thing
<BlaXpirit> what whole thing
<splitty_> Oh wait
<splitty_> Does unitialized already create a pointer?
<splitty_> uninitialized*
<BlaXpirit> splitty_, i;'m not sure. i assume that a StaticArray works much like a Slice, but i may be wrong
<splitty_> I just need a pointer to the first item, so it points to a contiguous block of memory
<BlaXpirit> >> a = uninitialized Int32[5]; p({pointerof(a), a.to_unsafe})
<DeBot> BlaXpirit: in line 4: can't execute OpAssign in a macro - https://carc.in/#/r/1iwd
<BlaXpirit> dammit
<BlaXpirit> output is {Pointer(StaticArray(Int32, 5))@0xbff07f1c, Pointer(Int32)@0xbff07f1c}
<BlaXpirit> so this does seem to be correct
<BlaXpirit> i dont see anything obviously wrong. sorry, i'm off
<splitty_> okay thank you
Dreamer3 has quit [Quit: Computer has gone to sleep.]
Dreamer3 has joined #crystal-lang
Dreamer3 has quit [Quit: Computer has gone to sleep.]
soveran has quit [Remote host closed the connection]
vivus-ignis has joined #crystal-lang
Chronium has quit [Quit: Leaving]
emmanueloga has left #crystal-lang [#crystal-lang]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 246 seconds]
bjz has joined #crystal-lang
matp has quit [Ping timeout: 252 seconds]
mgarciaisaia1 has joined #crystal-lang
matp has joined #crystal-lang
mgarciaisaia has quit [Ping timeout: 265 seconds]
soveran has joined #crystal-lang
<crystal-gh> [crystal] wmoxam opened pull request #3823: Use the OpenBSD version of LLVM when cross-compiling for it (master...fix-openbsd-cross-compile) https://git.io/vMmGF
<DeBot> https://github.com/crystal-lang/crystal/pull/3823 (Use the OpenBSD version of LLVM when cross-compiling for it)
soveran has quit [Ping timeout: 258 seconds]
wmoxam_ is now known as wmoxam
wmoxam has quit [Changing host]
wmoxam has joined #crystal-lang
<wmoxam> If anyone would like to run a recent version of Crystal on OpenBSD I have a port here: https://github.com/wmoxam/crystal-openbsd-port
<Papierkorb> A c library bound fun wants me to pass argc, argv. argc is simple, but how do I turn ARGV into a LibC::Char** ?
<Papierkorb> Do I have to build that myself?
<Papierkorb> `ARGV.map(&.to_unsafe).to_unsafe` to the rescue I guess
Ven has joined #crystal-lang
Chronium has joined #crystal-lang
<Chronium> Is there an easy way to convert this to Crystal? https://github.com/GruntTheDivine/infinity/blob/master/kernel/src/drivers/fb_font.h
<wmoxam> wow, 0.20.3 is so much faster on OpenBSD than 0.19.4 was
Ven has quit [Ping timeout: 264 seconds]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
vivus-ignis has quit [Ping timeout: 258 seconds]
<Papierkorb> Chronium: Depends on your definition of easy'
<Papierkorb> The #define b could be turned into a macro I guess
Ven has quit [Ping timeout: 258 seconds]
<Chronium> Easy as in not take half a day
<Papierkorb> Chronium: rewrite the macro, then make use of `sed` or similar to rewrite the C code to something that Crystal will parse
<Papierkorb> Chronium: If you're in a Kernel you'll want to turn that stuff into a binary string btw
<Papierkorb> In which case I'd suggest using a small ruby script
<Chronium> What do you mean by binary string?
<Papierkorb> "\x12\x34"
<Chronium> Ah
<Chronium> Papierkorb: I think it would be easier just to get C to write out the binary string in text format as it already knows how to interpret it so I don't have much work to do xD
Ven has joined #crystal-lang
<Papierkorb> Or that way, anyway really ;)
<Chronium> Thanks for the suggestions :D
<splitty_> Btw Papierkorb, are you German? :D
<Papierkorb> Ja
<splitty_> Ah nice, I suspected that the whole time because of your nick but wasn't sure because of your really good English :P
<Papierkorb> And now, I have to turn that mess into something nice with classes and stuff https://gist.github.com/Papierkorb/0eb344194e1297cf3aeb44806e30abb1 but it works
<FromGitter> <crisward> how do back references work in crystal sub - `"hello".sub(/e/,"*\1*")` I'd expect this to equal - `h*e*llo`, but it outputs `"h*\u{1}*llo"`
<Papierkorb> crisward, use single quotes instead: '*\1*'
Philpax_ has quit [Ping timeout: 268 seconds]
bjz has joined #crystal-lang
<FromGitter> <crisward> thought single quotes are for characters?
<FromGitter> <crisward> found it
<FromGitter> <crisward> `"hello".gsub(/(e)/,"*\\1*",true)` double slashes and true at the end to use back references.
<FromGitter> <crisward> Thanks Papierkorb... should really check the docs first. Think your answer is correct for Ruby though.
<Papierkorb> crisward, ah damnit we're in #crystal-lang, sorry
<crystal-gh> [crystal] maiha opened pull request #3824: Add `String#sub(Regex, NamedTuple)` (master...string-sub-named-tuple) https://git.io/vMm4r
<DeBot> https://github.com/crystal-lang/crystal/pull/3824 (Add `String#sub(Regex, NamedTuple)`)
<literal> is there a PEG implementation or something similar for Crystal?
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<literal> or any interesting parsing tools really
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
<crystal-gh> [crystal] bcardiff closed pull request #3823: Use the OpenBSD version of LLVM when cross-compiling for it (master...fix-openbsd-cross-compile) https://git.io/vMmGF
<DeBot> https://github.com/crystal-lang/crystal/pull/3823 (Use the OpenBSD version of LLVM when cross-compiling for it)
DTZUZU2 has quit [Ping timeout: 246 seconds]
soveran has quit [Remote host closed the connection]
<splitty_> Hey, can I wrote a function prototype as an alias?
<splitty_> I tried it using the proc syntax but that doesn't seem to be working
<splitty_> write*
pawnbox has quit [Ping timeout: 264 seconds]
<BlaXpirit> splitty_, what is "prototype"
<splitty_> Well, a function prototype :D I think it's called a Proc in Crystal slang
<RX14> proc is more thana function prototype
<splitty_> I want to have an Array of callbacks.
<splitty_> And I wanted to alias the callback to InterruptHandler
<splitty_> So it's easier to work with
<RX14> it's a function pointer with attached context
<splitty_> Ah, yeah
<splitty_> I looked here
<RX14> alias Interrupthandler = Foo, bar -> Baz should work
<splitty_> But I can't really find what I'm looking for there
<RX14> then you can do array of that
<splitty_> RX14, do I have to specify the return type?
<RX14> yes
<splitty_> alias InterruptHandler = frame : LibIDT::StackFrame* -> Nil
<splitty_> expecting token 'CONST', not 'frame'
<RX14> thats not proc syntax
<RX14> proc syntax is type, type -> type
<RX14> no names
<RX14> because the names dont matter
<splitty_> Ah okay, that makes sense
<splitty_> Thank you
Philpax_ has joined #crystal-lang
<splitty_> RX14, can I pass Crystal functions that way, or does that only work with Procs?
<RX14> a crystal function can be converted to a proc using ->
<RX14> ->function(Type)
<RX14> you need to specify the types for every argument
<splitty_> So passing Crystal functions as an argument is only possible via Procs?
<RX14> are you trying to pass a crystal function to C?
<splitty_> Nope, to Crystal
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
<splitty_> I just wanna pass functions around so I can call them from my interrupt handler (which is written in Crystal)
<RX14> yes, then procs
<splitty_> Okay, thanks again
soveran has quit [Ping timeout: 256 seconds]