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
fazibear has joined #crystal-lang
fazibear has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 276 seconds]
rohitpaulk has quit [Ping timeout: 240 seconds]
fazibear has joined #crystal-lang
fazibear has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
fazibear has joined #crystal-lang
fazibear has quit [Ping timeout: 260 seconds]
aemadrid_ has joined #crystal-lang
avdi_ has joined #crystal-lang
danzilio_ has joined #crystal-lang
t-richards_ has joined #crystal-lang
ome_ has joined #crystal-lang
miketheman_ has joined #crystal-lang
t-richards has quit [*.net *.split]
ome has quit [*.net *.split]
DeBot has quit [*.net *.split]
miketheman has quit [*.net *.split]
aemadrid has quit [*.net *.split]
avdi has quit [*.net *.split]
danzilio has quit [*.net *.split]
t-richards_ is now known as t-richards
aemadrid_ is now known as aemadrid
ome_ is now known as ome
miketheman_ is now known as miketheman
avdi_ is now known as avdi
danzilio_ is now known as danzilio
baweaver_away is now known as baweaver
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 246 seconds]
z64 has quit [Ping timeout: 260 seconds]
z64 has joined #crystal-lang
adam12 is now known as adam
fazibear has joined #crystal-lang
adam is now known as Guest62357
foca has quit [Quit: :wq]
fazibear has quit [Ping timeout: 240 seconds]
snsei has joined #crystal-lang
z64 has quit [Ping timeout: 255 seconds]
foca has joined #crystal-lang
z64 has joined #crystal-lang
<FromGitter> <codenoid> sup
<FromGitter> <codenoid> how to customizing my app process (how long) with this https://github.com/askn/progress
<FromGitter> <fridgerator> there is a sample app and api right in the readme, whats your question?
<FromGitter> <codenoid> bar run with bar.inc ,
rohitpaulk has quit [Ping timeout: 240 seconds]
snsei_ has joined #crystal-lang
<FromGitter> <codenoid> not by my app process
snsei has quit [Ping timeout: 255 seconds]
fazibear has joined #crystal-lang
snsei has joined #crystal-lang
snsei_ has quit [Ping timeout: 255 seconds]
fazibear has quit [Ping timeout: 260 seconds]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
fazibear has joined #crystal-lang
<FromGitter> <codenoid> i dont
fazibear has quit [Ping timeout: 260 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
hightower2 has joined #crystal-lang
fazibear has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
fazibear has quit [Ping timeout: 248 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
Raimondi has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
fazibear has joined #crystal-lang
fazibear has quit [Ping timeout: 240 seconds]
<FromGitter> <distinct> Im getting "cast from Int64 to Float+ failed" without a line number as an exception..
<FromGitter> <distinct> Is there a way to find the line this is happening on?
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
hightower3 has joined #crystal-lang
hightower4 has quit [Ping timeout: 240 seconds]
Manj-1603-Lxqt has joined #crystal-lang
Raimondi has joined #crystal-lang
<FromGitter> <bararchy> Groogy -- https://github.com/Groogy/boleite cool !
<FromGitter> <bararchy> @distinct Where to you do `.as Float` or `.to_f32` in your code ?
mark_66 has joined #crystal-lang
<FromGitter> <bararchy> is it in more then one place ?
Raimondi has quit [Ping timeout: 268 seconds]
fazibear has joined #crystal-lang
crack08 has joined #crystal-lang
fazibear has quit [Ping timeout: 255 seconds]
Manj-1603-Lxqt has quit [Quit: Leaving]
fazibear has joined #crystal-lang
Groogy has quit [Disconnected by services]
Groogy_ is now known as Groogy
<Groogy> Morning!
<Groogy> Oh thanks @bararchy, how did you find it? :P
Groogy2 has joined #crystal-lang
Raimondi has joined #crystal-lang
<Groogy> There's not much there right now, working on the backend structure right now
Raimondi has quit [Ping timeout: 268 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <rishavs> Hi ⏎ I am sending a post request from my browser on a kemal webapp as: ⏎ ⏎ ```code paste, see link``` ⏎ ... [https://gitter.im/crystal-lang/crystal?at=596dc4ad329651f46e9a8d75]
rohitpaulk has quit [Ping timeout: 246 seconds]
fazibear has quit [Ping timeout: 255 seconds]
<Yxhuvud> groogy: https://github.com/Groogy/boleite/blob/master/src/boleite/math/vector.cr#L38 <-- off by one error I think. I'd use N.times {|i| }
<Yxhuvud> I didn't know it was possible to put numbers into the generic argument to the type algebra. That is a nice thing to know of
<FromGitter> <bararchy> Groogy: I'm stocking you ;) (tbh I just brwose daily in the shard.xyz to find interesting new projects)
<Groogy> Yxhuvud haha yeah several people were suprised when I showed the vector code some days ago
<Groogy> They were "Well that doesn't work anyway" "Well it compiles so...." "wat?"
<Groogy> though the argument is really really limited, it isn't actually a number it seems, it just gets expanded like a macro [[N}} it seems like
<Groogy> or something to that effect, been a lot of trial and errors
<Groogy> TL;DR - it feels very much like a work in progress feature
fazibear has joined #crystal-lang
<FromGitter> <straight-shoota> and is not documented anywhere ;)
<FromGitter> <straight-shoota> but as your use case shows, there are valid applications (beside StaticArray)
<Groogy> yeah would be nice if it would accept like some math and if you could save it into a CONST as that doesn't work right now
<Groogy> though that might be something from C++ that I am just used to do
<FromGitter> <straight-shoota> you could probably wrap this in a macro... but it's not as nice
<Groogy> dat makes me go "Wat"
<FromGitter> <straight-shoota> very experimental^^
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
<FromGitter> <rishavs> > Hi ⏎ I am sending a post request from my browser on a kemal webapp as: ⏎ ⏎ ```code paste, see link``` ⏎ ... [https://gitter.im/crystal-lang/crystal?at=596dd4533230e14f3a6d48bb]
fazibear has quit [Ping timeout: 255 seconds]
<FromGitter> <akzhan> @rishavs please ask for kemal at https://gitter.im/sdogruyol/kemal
Philpax has joined #crystal-lang
<FromGitter> <rishavs> thanks @akzhan . i dont think its a kemal issue. i am making some very basic mistake in how post or xhr is supposed to work.
gewo has joined #crystal-lang
<FromGitter> <akzhan> Is your JS page originated on same resource - http://localhost:3000?
<FromGitter> <akzhan> please read about CORS, looks it’s your problem. https://en.wikipedia.org/wiki/Cross-origin_resource_sharing
<FromGitter> <rishavs> thanks! i will check it out .
<FromGitter> <bew> @straight-shoota look at #4722 I think you mixed compile-time vs runting printings
<FromGitter> <akzhan> @rishavs you should know that ACAO header should be set to referrer site, not to ‘*’, for https protocol.
<FromGitter> <akzhan> something like (pseudocode): ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Response.add_header "Access-Control-Allow-Origin», acao [https://gitter.im/crystal-lang/crystal?at=596dd8adbc46472974feb94d]
<FromGitter> <akzhan> I’m sorry, forgot that Gitter message edits looks ugly for IIRC.
<FromGitter> <bew> one that accept a block and one who dosn't @NARKOZ
<FromGitter> <bew> look the second, there is a `yield` that will inline the passed block
fazibear has joined #crystal-lang
Raimondi has joined #crystal-lang
pwned has joined #crystal-lang
<FromGitter> <NARKOZ> how comes that methods don't get overwritten?
rohitpaulk has joined #crystal-lang
<FromGitter> <bew> because a method that accept a block and one that doesn't are 2 different methods, they don't override each other, even though they have the same name
<FromGitter> <straight-shoota> @bew I was dumb :(
Raimondi has quit [Ping timeout: 260 seconds]
<Groogy> And back from lunch
<Groogy> it would be nice though if the number could work as any other number in the example I showed
<Groogy> If you switch out the NUMBER constant for the N generic argument it works as expected
<FromGitter> <bew> @straight-shoota it got me more than once!
fazibear has quit [Ping timeout: 268 seconds]
fazibear has joined #crystal-lang
<Groogy> also thanks Yxhuvud, commited fix now
<FromGitter> <straight-shoota> @bew Where did you find this final word?
<FromGitter> <straight-shoota> I understood @bcardiff in https://github.com/crystal-lang/crystal/issues/236#issuecomment-302734259 (3) as it would be preferable to change precedence
<FromGitter> <straight-shoota> this aspect got lost though in the remainder which was about top level macros
fazibear has quit [Ping timeout: 255 seconds]
fazibear has joined #crystal-lang
Raimondi has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
<FromGitter> <bew> @straight-shoota right, that was what I remembered, but can't find it again
<FromGitter> <sdogruyol> Morning everyone :)
<Groogy> It's midday but okay :P
<FromGitter> <sdogruyol> haha yeah :D
<FromGitter> <bew> Midday everyone then :P
<FromGitter> <bew> @straight-shoota I edited my comment to remove the "final word"
<FromGitter> <straight-shoota> ^^
fazibear has quit [Ping timeout: 276 seconds]
fazibear has joined #crystal-lang
crack08 has quit [Ping timeout: 258 seconds]
<FromGitter> <bew> @straight-shoota if like you say, all your examples should call the method, how do we do to call the macro `foo`? Do we need to use special syntax?
<FromGitter> <bararchy> Head is broken on Arch Linux ? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=596df26d4bcd78af56bff396]
<FromGitter> <bew> Can you try to build manually?
<FromGitter> <konovod> @bararchy same error message is in #4719 with Ubuntu. Don't know the cause.
<FromGitter> <straight-shoota> @bew you can call it like a class method: https://carc.in/#/r/2dsw
<Groogy> @bararchy you building with the aur package crystal-git?
<Groogy> if you have bauerbill you can just do bb-wrapper --aur -S crystal-git
<Groogy> and that should just install latest for you
fazibear has quit [Ping timeout: 246 seconds]
<Groogy> at least I have 0.23.0+13 from (2017-07-17) installed through that
<FromGitter> <bew> @straight-shoota but this makes that you need to know where the macro is defined, and it breaks the logic of `include`-ing a module with methods and macros and being able to simply call them
<FromGitter> <straight-shoota> If `self.class.my_macro` worked this shouldn't be a problem I think
<FromGitter> <bew> this is quite ugly..
<FromGitter> <straight-shoota> True, but currently you need to prefix method calls with `self.` as well, so it's not that different
<FromGitter> <straight-shoota> at least if macros are visible but methods have precedence
<crystal-gh> [crystal] ysbaddaden closed pull request #4636: Remove MT19937 PRNG (master...master) https://git.io/vQ8aV
<FromGitter> <bew> also, self.class is the runtime class of the instance, the compiler who needs to find which macro to call can't know what you want I think
<FromGitter> <straight-shoota> I'm currently working on refactoring Kemal to use encapsulation instead of global state. There I have a macro `Kemal::Base.get` and an instance method `Kemal::Base#get`. Currently, when I call `get` from inside a instance method, it calls the macro, but I would expect it to call the instance method. And it's ugly if you have to invoke the instance method with explicit receiver...
<FromGitter> <bew> you could use `with my_obj yield` to specify a strong implicit receiver
<FromGitter> <straight-shoota> this only works with a block, not if you're directly inside a method
<FromGitter> <bew> what is the macro `get` for ?
<FromGitter> <crisward> @straight-shoota If you're doing that, FWIW perhaps look at how express.js does it. Ie. ⏎ ⏎ ```app = Kemal.new ⏎ app.get "/" do |env| ⏎ "hello ⏎ end ⏎ app.run``` [https://gitter.im/crystal-lang/crystal?at=596df8621c8697534a36ad48]
<FromGitter> <bew> how do you want the users of your lib to use either the method or the macro?
<FromGitter> <straight-shoota> The macros create a DSL at class scope, the method at instance scope
<FromGitter> <straight-shoota> @crisward this is already possible in my branch
<FromGitter> <straight-shoota> an alternative is ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=596df93cf5b3458e305a9be0]
Raimondi has joined #crystal-lang
<FromGitter> <bew> should this call the macro or the method? can you show an example using the 2?
<FromGitter> <straight-shoota> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=596df9dd3230e14f3a6df871]
<FromGitter> <straight-shoota> Line 2 targets the maro, line 6 the instance method
Raimondi has quit [Ping timeout: 268 seconds]
<travis-ci> crystal-lang/crystal#abbb8de (master - Removed MT19937 PRNG): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/254823597
fazibear has joined #crystal-lang
<FromGitter> <bew> I don't get the use case of instance routes, but an idea of impl could be: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=596dfc602723db8d5e2162a1]
<travis-ci> crystal-lang/crystal#abbb8de (master - Removed MT19937 PRNG): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/254823597
<travis-ci> crystal-lang/crystal#abbb8de (master - Removed MT19937 PRNG): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/254823597
<oprypin> removed really
<Groogy> mersenne twister random generation isn't that good though :/
<FromGitter> <straight-shoota> Well the `initialize_instance_routes` method is not part of the DSL, it could be any method defined in a custom application subclass.
fazibear has quit [Ping timeout: 240 seconds]
<FromGitter> <bew> I like the idea of macro only for class scope though!
<FromGitter> <straight-shoota> The use case is that you might want to optionally add routes depending on configuration values or some other decision run-time
<FromGitter> <bew> but in this case, you should have a Router object, that you configure via methods or sth like that
rohitpaulk has quit [Ping timeout: 240 seconds]
<FromGitter> <straight-shoota> The router is configured through the application
<FromGitter> <straight-shoota> `get` method would actually call `route_handler.add_route("GET", path, &block)`
<FromGitter> <bew> like: ⏎ ⏎ ```class App < Kemal::Application ⏎ def some_method ⏎ end ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=596dff2b2723db8d5e216efc]
snsei has quit [Remote host closed the connection]
<FromGitter> <straight-shoota> I think the idea is to put these abstractions away
snsei has joined #crystal-lang
fazibear has joined #crystal-lang
fazibear has quit [Ping timeout: 240 seconds]
fazibear has joined #crystal-lang
Raimondi has joined #crystal-lang
snsei has quit [Read error: Connection reset by peer]
snsei has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
Raimondi has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
hightower2 has quit [Ping timeout: 240 seconds]
<FromGitter> <bararchy> Is there a PDF creator in Crystal ?
rohitpaulk has joined #crystal-lang
Philpax has quit [Ping timeout: 240 seconds]
fazibear has quit [Ping timeout: 255 seconds]
fazibear has joined #crystal-lang
fazibear has quit [Ping timeout: 248 seconds]
mark_66 has quit [Remote host closed the connection]
fazibear has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 260 seconds]
fazibear has quit [Ping timeout: 255 seconds]
fazibear has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 258 seconds]
hightower has joined #crystal-lang
fazibear has quit [Ping timeout: 248 seconds]
<FromGitter> <crisward> Int24 in crystal anyone?
greengriminal has joined #crystal-lang
<oprypin> no
greengriminal has quit [Quit: This computer has gone to sleep]
fazibear has joined #crystal-lang
greengriminal has joined #crystal-lang
fazibear has quit [Ping timeout: 260 seconds]
<FromGitter> <yvendruscolo> hello, ⏎ how may I get the current path (pwd) at run time, instead of at compile time? ⏎ ⏎ I mean if I use ⏎ ... [https://gitter.im/crystal-lang/crystal?at=596e41af3230e14f3a6f6b90]
<FromGitter> <yvendruscolo> hello, ⏎ how can I get current working dir path (pwd) at run time? ⏎ basically I need to access other files that are going to be at the same folder, but if I either use "./file_name" or Dir.current+"/fie_name", crystal gets the path at compile time, and if I place this same folder anywhere else, it tries to look for those files at the dir I compiled it. ⏎ thanks!
<FromGitter> <bew> `Dir.current` should give you the runtime current working directory
fenicks has left #crystal-lang [#crystal-lang]
<FromGitter> <crisward> Didn't think so...
<FromGitter> <bew> It calls internally getcwd which does just that
<FromGitter> <splattael> As Crystal 0.23.1 is out, is there a timeline to release 0.23.1 as a docker image on https://hub.docker.com/r/crystallang/crystal/?
<FromGitter> <yvendruscolo> I have compiled simply : ⏎ ⏎ ```puts Dir.current``` ⏎ ⏎ and I got: ... [https://gitter.im/crystal-lang/crystal?at=596e49cf1c8697534a3861de]
<FromGitter> <bew> Well, it gives you your current working directory, not the directory from where the binary is. I can in your prompt that you are in `~` which corresponds to your home, which is `/Users/yuri`.
rohitpaulk has joined #crystal-lang
<FromGitter> <bew> The binary is in Desktop, but you launched it from your home
<FromGitter> <yvendruscolo> in that case, is there a way to get the dir where the binary is?
<oprypin> yvendruscolo, it's `File.dirname(PROGRAM_NAME)`
<FromGitter> <yvendruscolo> thanks guys!
<Papierkorb> $PROGRAM_NAME can be changed, by the running program, or by the program executing it
<oprypin> sorry what
<oprypin> this is the better alternative, but i dont get your comment about PROGRAM_NAME
<Papierkorb> program name is the *name*, which doesn't have to be the name of the binary.
<oprypin> demonstrate
<FromGitter> <marceloboeira> Hello Guys
<Papierkorb> See exec(3).
<FromGitter> <marceloboeira> quick question, is it possible to get the real class/type of a object from a macro?
<oprypin> marceloboeira, `{{ @type }}`
<oprypin> that's fair. @yvendruscolo, see Papierkorb's suggestion. `File.dirname(Process.executable_path)`
<FromGitter> <marceloboeira> hmm, not sure. the type of a given parameter of a macro ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=596e4dee0de4d2545e3dd1dd]
<FromGitter> <marceloboeira> given "hello" I want to create MyGenericClass(String).new("hello")
<oprypin> marceloboeira, macros deal only with literals
<FromGitter> <marceloboeira> that's what I thought :/
<oprypin> that would hopefully be `MyGenericClass.new({{value}})`
<Papierkorb> marceloboeira, that syntax should work fine without for this case: The generic type can be auto-deduced from the arguments given to #initialize
<oprypin> `MyGenericClass(typeof({{value}})).new({{value}})` might work but is redundant
<FromGitter> <marceloboeira> hmm
<FromGitter> <marceloboeira> the typeof works!!1
<FromGitter> <marceloboeira> thanks :)
<oprypin> marceloboeira, yeah but pls dont ignore the part about not needing it
<FromGitter> <marceloboeira> yes, I actually am experimenting the limits of the macros
<FromGitter> <marceloboeira> it is nothing serious
<Papierkorb> Macros are quite capable in general, up to the point that you can call external programs (!), or as long you adhere to the Crystal language syntax, implement your own little 'script' language with it.
<Papierkorb> The latter because you have pretty good access to the AST if passed as argument
deep-book-gk_ has joined #crystal-lang
deep-book-gk_ has left #crystal-lang [#crystal-lang]
<FromGitter> <marceloboeira> interesting that, given a default name of a class (upper camelcase), I can't define a macro with a similar structure. e.g.: ⏎ ⏎ ```... expecting token 'CONST', not 'nil'``` [https://gitter.im/crystal-lang/crystal?at=596e52ac1c8697534a388a94]
<FromGitter> <marceloboeira> even if I don't have a class with the same name, which would be understandable...
<FromGitter> <bew> a macro name, like methods should start with a lowercase letter
<FromGitter> <bew> a word starting by an upper case letter is recognized as a CONST (a type, a constant, ..)
<FromGitter> <marceloboeira> 👍
<FromGitter> <marceloboeira> but that's because of the order of evaluation of the macro?
<FromGitter> <bew> the conventions are explained here: https://crystal-lang.org/docs/conventions/coding_style.html
<FromGitter> <bew> no it has nothing to do with the order of execution, but with the parser: `FooBar(...)` is recognized as a generic type (like `Array(String)`)
<FromGitter> <bew> and it mess up something when trying to parse it
<FromGitter> <marceloboeira> I thought maybe the macro expansion happened before the rest of the evaluation/parsing. But it makes sense to happen after considering that you need to check the types
Guest62357 is now known as adam12
<oprypin> that's the magical part
<oprypin> macros need to be evaluated before everything but also after everything :D
<oprypin> in simple cases macros are evaluated before everything, but for example if you refer to the current type in the macro, that delays the expansion until the type's semantics are figured out
<FromGitter> <marceloboeira> > macros need to be evaluated before everything but also after everything :⁠D ⏎ http://www.reactiongifs.com/wp-content/uploads/2013/10/tim-and-eric-mind-blown.gif
rohitpaulk has quit [Ping timeout: 260 seconds]
Renich has joined #crystal-lang
<FromGitter> <marceloboeira> https://github.com/marceloboeira/option.cr
<Papierkorb> Why
<FromGitter> <marceloboeira> just experimenting, I wanted to do it with macros, but then I've realised that it does not make any sense considering that you might have dynamic results
<Papierkorb> For real code, you'd just rely on Nil
<Papierkorb> In your example, it'd simply be a `Unsafe.new.io || "Empty..."`
<FromGitter> <crisward> Just need 4,027 more stars to overtake ruby... https://github.com/showcases/programming-languages 😉
<FromGitter> <marceloboeira> But considering everything can be nil, ⏎ Unsafe.new.io.foo.bar ⏎ you would have to ⏎ ⏎ ```(((Unsafe.new.io || "default").foo) || "default_2").bar``` [https://gitter.im/crystal-lang/crystal?at=596e6762f5b3458e305cdc7e]
<Papierkorb> No
<Papierkorb> Everything *can't* be nil
<FromGitter> <marceloboeira> not everything, but the calls to unsafe things
<FromGitter> <marceloboeira> IO related
<Papierkorb> That's the whole point. Nil is a type on its own in Crystal. Try this: `def foo(a : String); a; end; foo(nil)` - Won't work
<Papierkorb> ..huh
<Papierkorb> IO is a type. If you expect an `IO`, or pledge to return an `IO`, you can only return that, no nil
<Papierkorb> Impossible. If you do find a way, it's a serious compiler bug
<RX14> if you do find a way you'll get segfaults lol
<Papierkorb> The only way to 'escape' having to return something matching the method prototype is raising an Exception. Another common theme is something like this: `def read_input : String?; ...; end`. It may return a String, or nil. In this case, the compiler will force you to work with the result in a type-safe manner
<FromGitter> <marceloboeira> ```User.where(foo: "bar").first.name``` ⏎ ⏎ will never be nil? [https://gitter.im/crystal-lang/crystal?at=596e688d76a757f80822ffc7]
<Papierkorb> If #where, #first and #name are not nil-able, never.
<RX14> @marceloboeira have a pay with nil, you'll find out what works and what doesn't.
<FromGitter> <marceloboeira> you mean because of the nilable `String?`, ok, fair enough
<Papierkorb> The type system of Crystal alone safes you from having to clutter your code with `Just(x)` etc.
hightower has quit [Ping timeout: 240 seconds]
<FromGitter> <johnjansen> ok people, can someone point me at the solution to this on `Ubuntu 16.04.2 LTS` ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=596e714dbf7e6af22cef6f99]
<Papierkorb> That is a compiler crash
<Papierkorb> Can you share the code?
<FromGitter> <fridgerator> @johnjansen its an issue with the latest build
<FromGitter> <johnjansen> thanks @fridgerator, i feel another broken record coming on ;-)
<FromGitter> <fridgerator> lol
<FromGitter> <fridgerator> nah there is a workaround for this one
<FromGitter> <fridgerator> add `--no-debug`
<FromGitter> <johnjansen> thanks, reading all that would have taken an age
pwned has quit [Ping timeout: 255 seconds]
Renich has quit [Quit: Renich]
<FromGitter> <crisward> @johnjansen Just tried compiling with --release and --no-debug and I'm get a strange bug where my app doesn't recognise '/' as a path. Will try and isolate the specific bug tomorrow.
<FromGitter> <johnjansen> interesting
<FromGitter> <crisward> It's fine without --release, which means it's probably something to do with an llvm optimisation.
greengriminal has quit [Quit: This computer has gone to sleep]
rohitpaulk has joined #crystal-lang
greengriminal has joined #crystal-lang
greengriminal has quit [Quit: This computer has gone to sleep]