ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.32.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
alex`` has quit [Ping timeout: 240 seconds]
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e321caa40da694c5eec3e13]
<FromGitter> <Blacksmoke16> you can use the `||=` operator for this
<FromGitter> <elorest> @kinxer I appreciate you trying to help out here.
<FromGitter> <Blacksmoke16> something like `(@errors[key]? ||= Array(String).new) << message`
<FromGitter> <tenebrousedge> `errors.fetch(key) { errors[key] = Array(String).new << message }`
<FromGitter> <tenebrousedge> or better yet, set a default block on `errors`
<FromGitter> <Blacksmoke16> oo yea good call
<FromGitter> <Nicolab> @Blacksmoke16 It's good for `name.id`. Probably a remnant of my attempt to make the call dynamic.
<FromGitter> <kinxer> @elorest Sorry I wasn't any help, though... I'm suprised, though, 'cause on a normal file, it doesn't make much sense to block on read, but it clearly does make sense for a file descriptor, and I can't see anywhere that `File` overwrites a crucial method.
<FromGitter> <tenebrousedge> Hash default block info (https://crystal-lang.org/api/0.32.1/Hash.html#new(block:Hash(K,V),K-%3EV?=nil,*,initial_capacity=nil)-class-method)
<FromGitter> <Nicolab> @Blacksmoke16 @tenebrousedge Sound good also
<FromGitter> <Nicolab> @tenebrousedge nice
<FromGitter> <elorest> @kinxer still for the sake of something like Tail it does or monitoring a log it would make sense to be able wait until data is available like normal, `gets`
<FromGitter> <Nicolab> Hmm the repository name must have the same name that the shard name. I update it
<FromGitter> <Nicolab> ```validator: ⏎ github: nicolab/crystal-validator ⏎ version: 1.0.0-beta``` ⏎ ⏎ For the install `shards` does not use the path specified in the `github:` key? [https://gitter.im/crystal-lang/crystal?at=5e321fdbf6945f41ef3d6fc1]
<FromGitter> <Nicolab> It must be the name of the version or something else because the shards don't necessarily have the same name as the repo.
alex`` has joined #crystal-lang
alex`` has quit [Ping timeout: 272 seconds]
<FromGitter> <DanielCoulbourne> Howdy everyone. Crystal noob here, but my podcast cohost and I talked each other and our whole audience into working together on a Crystal app, so now I have to learn it 😂
<FromGitter> <Blacksmoke16> o/
<FromGitter> <tenebrousedge> @DanielCoulbourne are you familiar with Ruby?
<FromGitter> <DanielCoulbourne> I've written a little ruby. I mostly write Javascript and PHP these days. So far the syntax hasn't been too difficult. Just the transition to writing desktop software coming from web-dev.
<FromGitter> <DanielCoulbourne> I'm getting there, slowly.
<FromGitter> <Blacksmoke16> Desktop app eh?
<FromGitter> <DanielCoulbourne> Well, for now it's a command line app. We're punting on a gui
<FromGitter> <DanielCoulbourne> basically just a wrapper around ffmpeg
<FromGitter> <DanielCoulbourne> so a lot of Process
<FromGitter> <Blacksmoke16> Gotcha
<FromGitter> <DanielCoulbourne> I'm struggling a bit with understanding how to work with output from `Process` using backtick syntax is really simple, but the warnings about passing in user input totally apply here, so I need to use Process.new
<FromGitter> <Blacksmoke16> Process.run might also be helpful
<FromGitter> <DanielCoulbourne> not totally clear on the difference yet. is `run` synchronous and `new` just gives me a process and it's up to me to keep track of when it finishes asynchronously?
<FromGitter> <Blacksmoke16> Run news up a process and waits for it to complete
<FromGitter> <Blacksmoke16> Otherwise it happens in another fiber and you would have to call wait on it
<FromGitter> <Blacksmoke16> Process docs deff could use some improvements 😬
<FromGitter> <DanielCoulbourne> for sure. Doing a lot of trial and error there
<FromGitter> <tenebrousedge> @Blacksmoke16 knows everything so definitely ask them all the questions
<FromGitter> <Blacksmoke16> Ha, not entirely true but I try 😉
<FromGitter> <Daniel-Worrall> Weird, `shards build` doesn't output build warnings
<FromGitter> <Daniel-Worrall> like I put `Time.now`
<FromGitter> <Blacksmoke16> What happens if you manually pass the flag
sagax has joined #crystal-lang
ur5us has joined #crystal-lang
ur5us has quit [Ping timeout: 260 seconds]
duane has quit [Ping timeout: 272 seconds]
_whitelogger has joined #crystal-lang
fifr has quit [Ping timeout: 265 seconds]
fifr has joined #crystal-lang
fifr has quit [Ping timeout: 272 seconds]
fifr has joined #crystal-lang
flaviodesousa has joined #crystal-lang
_ht has joined #crystal-lang
yukai has quit [Ping timeout: 260 seconds]
<FromGitter> <bew> Hello! Anyone going to FOSDEM this weekend in Bruxelles? I'll be there with a friend
<repo> goooood morning!
<FromGitter> <bew> o/
_ht has quit [Remote host closed the connection]
<FromGitter> <confact> Is it possible to do something like IO.popen in Ruby in Crystal? I want to do a RPC server for git (like grack in ruby)
<FromGitter> <confact> Found `Process`. Which is the one i was looking for. Was just called differently in Crystal :)
<repo> chachasmooth: sure :)
ua_ has quit [Ping timeout: 265 seconds]
alex`` has joined #crystal-lang
<FromGitter> <straight-shoota> @bew RX14 is going to be there
ua has joined #crystal-lang
ua has quit [Excess Flood]
ternarysolo has quit [Quit: User has been idle for 30+ days.]
ua has joined #crystal-lang
ua has quit [Excess Flood]
ua has joined #crystal-lang
<FromGitter> <jgillich> In a macro, how do you cast a `ASTNode | Nop` to `ASTNode`, similar to `not_nil!`?
<FromGitter> <rurounijones_gitlab> So how to I split a string such as "keya=valuea,keyb=valueb" up and assign it to a hash with symbol keys? Since there is no s.to_sym in crystal
duane has joined #crystal-lang
<FromGitter> <tenebrousedge> @rurounijones_gitlab you can't do that at runtime. But you can do: ⏎ ⏎ ```"keya=vala,keyb=valb".scan(/(\w+)=(\w+)/).to_h ⏎ #=> {"keya" => "vala", "keyb" => "valb"}``` [https://gitter.im/crystal-lang/crystal?at=5e32de6458f02e349749c713]
<FromGitter> <Nicolab> One line :D
<FromGitter> <tenebrousedge> you can interpolate in the regex to use `END_OF_FIELD` and `FIELD_SEPARATOR` if you want.
<FromGitter> <rurounijones_gitlab> This is part of a larger StringScanner, I need the keys in Symbols, not Strings
<FromGitter> <tenebrousedge> you can't do that at runtime
<FromGitter> <rurounijones_gitlab> Is there a way to do equality on :string and "string" to see if they match?
<FromGitter> <Blacksmoke16> they wont since they're diff types
<FromGitter> <tenebrousedge> ```a = :foo ⏎ a.to_s == "foo"``` [https://gitter.im/crystal-lang/crystal?at=5e32e39815941335583ebfae]
<FromGitter> <Blacksmoke16> ^
<FromGitter> <rurounijones_gitlab> Ah, you can do symbol to string but not vice versa. Gotcha
<FromGitter> <tenebrousedge> you might also be able to define `==(other : String)` for Symbol
<FromGitter> <tenebrousedge> ```struct Symbol ⏎ def ==(other : String) ⏎ to_s == other ⏎ end ⏎ end``` ⏎ ⏎ @rurounijones_gitlab [https://gitter.im/crystal-lang/crystal?at=5e32e488bfe65274eac4dbd3]
duane has quit [Ping timeout: 272 seconds]
<FromGitter> <digitalextremist> Seem to be having a hell of a time trying to convert between `MessagePack` strings and `BSON` ... anyone know a smooth conversion approach for this?
<FromGitter> <tenebrousedge> @digitalextremist what are you doing now?
<FromGitter> <digitalextremist> @tenebrousedge making a gist:
flaviodesousa has quit [Quit: KVIrc 4.9.3 Aria http://www.kvirc.net/]
<FromGitter> <digitalextremist> @tenebrousedge here's an example: https://gist.github.com/digitalextremist/98406f67aec7eb80226c6f9c27edfbed
<FromGitter> <Nicolab> `shards` doesn't seem to support versions like 1.0.0-beta1?
<FromGitter> <digitalextremist> Even when I throw in injections to supply `#bytesize` for various object types, it still behaves differently than a `Hash` which was never touched by `MessagePack`
<FromGitter> <Nicolab> but 1.0.0-rc1 seems ok, right?
<FromGitter> <tenebrousedge> @digitalextremist so converting to a string works, but converting to a hash doesn't work? is there a reason you need the hash?
<FromGitter> <digitalextremist> @tenebrousedge trying to convert `MessagePack` strings into `BSON` to use with the `mongo.cr` shard. Converting to a `Hash` works fine, it's the final conversion to a `BSON` object ⏎ ⏎ I seem to run into this type of issue a lot, with unions of various possible types
<FromGitter> <tenebrousedge> unions can usually be constrained with `as`
<FromGitter> <tenebrousedge> can you use a record instead of a hash?
<FromGitter> <digitalextremist> @tenebrousedge what shard provides that object?
<FromGitter> <tenebrousedge> crystal stdlib
<FromGitter> <tenebrousedge> `record` is a macro to create structs
<FromGitter> <tenebrousedge> https://crystal-lang.org/api/0.32.1/toplevel.html#record(name,*properties)-macro
<FromGitter> <tenebrousedge> if you need to convert arbitrary messages it's not as useful, but if you know what messages you're dealing with it could maybe help with type issues
<repo> is it possible to make a string literal in crystal that doesn't care about backslashes? preferably with heredoc
<FromGitter> <tenebrousedge> isn't there a heredoc that doesn't do interpolation?
<repo> i dunno
<FromGitter> <tenebrousedge> To denote a heredoc without interpolation or escapes, the opening heredoc identifier is enclosed in single quotes: ⏎ ⏎ <<-'HERE' # => "hello \\n \#{world}" ⏎ hello \n #{world} ⏎ HERE [https://gitter.im/crystal-lang/crystal?at=5e32ecd1594a0517c25032e0]
<repo> also not sure if \ counts as interpolation
<repo> ah
<repo> nice
<FromGitter> <tenebrousedge> :plus1:
<repo> thanks!
<FromGitter> <digitalextremist> @tenebrousedge `record` looks useful for other things, but for this I am mostly trying to remove any unions I guess; wonder if there's a way to essentially process out unions and resolve a value to its actual type
<FromGitter> <tenebrousedge> @digitalextremist you can cast with `as`
<FromGitter> <tenebrousedge> `some_union_type.as(MyType)`
<repo> tenebrousedge: thanks to you i could make this amazing web app!
<FromGitter> <tenebrousedge> repo, I'm in awe. Truly stunning. It's about tea-time, innit?
<repo> :)
<FromGitter> <grkek> How can I define macro names with symbols as well ?
<repo> whenever you want it to be thanks to this ground breaking service
<FromGitter> <grkek> non-alphanumeric characters
<FromGitter> <grkek> like <>
<FromGitter> <grkek> etc.
<FromGitter> <tenebrousedge> @grkek why?
<repo> tenebrousedge: i hope you paid attention to the details and looked at the status code
<FromGitter> <grkek> I want to know if you can do that, just for experiments nothing else :)
<FromGitter> <grkek> @tenebrousedge
<FromGitter> <tenebrousedge> repo, of course 😄 seems like a proper implementation of RFC 2324 to me
<FromGitter> <grkek> Why is that even a thing
<FromGitter> <digitalextremist> @tenebrousedge in this case, I can't see how explicitly casting with `as` would work though, unless you mean rebuilding the object with `as`?
<FromGitter> <tenebrousedge> @digitalextremist that's kinda your option for narrowing types. There may be some macro magic that you could do as well, but that sounds like a bear
<FromGitter> <digitalextremist> 😦 seems so. Was looking for a way to use `popcorn` some how, but more wondering if there is a shard out there to just strip and rebuild objects without unions... for `MessagePack::Type` or `BSON::Field`, etc
<FromGitter> <tenebrousedge> I mean, how is the hash conversion written?
<FromGitter> <tenebrousedge> it seems like it's creating keys that have the union type
<FromGitter> <tenebrousedge> you should be able to write a quick recursive function that would only ever use string keys
<FromGitter> <digitalextremist> It's the recursive unions that get particularly sticky
fifr[m] has joined #crystal-lang
Human_G33k has quit [Quit: Leaving]
<Stephie> Anyone happen to have any neat examples of using flow typing in their crystal project?
<FromGitter> <Blacksmoke16> hm?
<FromGitter> <confact> is it possible to make a String of name of a class to a class? Similar to `.constantize`
<FromGitter> <confact> And method call as well, "method_name" and call it.
<Stephie> no
<FromGitter> <tenebrousedge> @confact not at runtime
<FromGitter> <tenebrousedge> Crystal doesn't have `send`
<FromGitter> <confact> I have an array of methods, and based on what the http request is, i want to call the method name in the array.
<FromGitter> <digitalextremist> @confact there is a very bad way though:
<FromGitter> <tenebrousedge> you can use a hash of procs to achieve something like that
<FromGitter> <Blacksmoke16> or a case on the name and call the related method
<FromGitter> <digitalextremist> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e32f7ebe8a8383559fede1d]
<FromGitter> <Blacksmoke16> yea like that
<FromGitter> <Blacksmoke16> but with your static array of method names
<FromGitter> <Blacksmoke16> got an example? might be a better approach tho
<FromGitter> <confact> I am trying to port grack in ruby to an HTTP handler :) I will probably rewrite the whole thing from scratch as i need to rethink the whole thing as most of the stuff it use to work won't work in crystal.
<FromGitter> <Blacksmoke16> sounds like a plan
<FromGitter> <tenebrousedge> Ruby's metaprogramming is so nice :(
<FromGitter> <tenebrousedge> it's also why Ruby is 300 times slower
<FromGitter> <confact> This is the array I was talking about: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e32f9aabfe65274eac58941]
<Stephie> you can write that in crystal, it'd just be {"POST", ->service_rpc, "...", "..."}
<Stephie> i.e. Tuple(String, Proc(_), String, String)
<FromGitter> <tenebrousedge> or `Tuple(Http::Request::Type, Proc(_), Regex)`
<FromGitter> <confact> Yea, you understood the second one is the method I want to call? :) I am new to the Tuple and such, Do you have any example code that is used and being called and such I can use as a reference?
<FromGitter> <tenebrousedge> or some other representation of the request type other than a string
<FromGitter> <confact> Thanks, really appreciate it. Don't know what i would do without your thoughts and feedback :)
<FromGitter> <tenebrousedge> so there's a `HTTP::Request#method`, but it returns a string <____<
<FromGitter> <grkek> @confact you use regex for your routes ?
<FromGitter> <confact> Yea, at least right now. It is coming from the grack repo. I think it is because of the path can be different based on repo name, branch name and such. But I haven't look into deep hole of git RPC yet.
<FromGitter> <grkek> That looks tasty af
<FromGitter> <confact> I am sure people will think it will be tasty when I make it work. My plan is to maybe make a github/gitlab in crystal.
<FromGitter> <confact> but the regex is sure tasty already now.
<FromGitter> <grkek> Oh my that sounds nice
<FromGitter> <grkek> is it opensource ?
<FromGitter> <Blacksmoke16> as a fun pet project?
<FromGitter> <confact> a fun project that might be an opensource with a paid hosted version. Will see. I am pretty sure I will make it opensource when I got it working. I will for sure release my grack port when I get it working. Next is to find a libgit shard or make my own.
<FromGitter> <confact> grack port as opensource that is.
<FromGitter> <grkek> Well good luck with it
<FromGitter> <grkek> I would say use grip but I only support JSON
<FromGitter> <grkek> 😆
<FromGitter> <grkek> How do you get the defined methods in a class ?
<FromGitter> <grkek> How do you list them
<FromGitter> <Blacksmoke16> at compile time or?
<FromGitter> <grkek> Compile time yeah
<FromGitter> <grkek> thank you
alex`` has quit [Ping timeout: 245 seconds]
alex`` has joined #crystal-lang
duane has joined #crystal-lang
<FromGitter> <grkek> Can I define a macro with a macro?
return0__ has quit [Ping timeout: 265 seconds]
<f1refly> When I create a set as `Set(A).new` und have a class `B < A`, I cant objects of type `B` to that set. Is this supposed to be working or am I doing something wrong?
_ht has joined #crystal-lang
<FromGitter> <tenebrousedge> ```class A; end; class B < A; end ⏎ a = Set.new(A) ⏎ a << B.new ⏎ a.to_a #=> [B]``` [https://gitter.im/crystal-lang/crystal?at=5e33110fe8a8383559ff997c]
<FromGitter> <Blacksmoke16> @grkek yes
<FromGitter> <Blacksmoke16> notice you need to escape the macro code you want the inner macro to use
<FromGitter> <Blacksmoke16> i.e. `\{{yield}}` versus `{{yield}}`
<FromGitter> <digitalextremist> Finally got the `.from_msgpack` through `.to_bson` and loop back sorted out: https://gist.github.com/digitalextremist/d8102988c4cba4f69fec68d6f3dd8e63
<FromGitter> <digitalextremist> Pushing out in the `clarity` shard soon
<FromGitter> <grkek> yeah
<FromGitter> <grkek> I found it
<FromGitter> <grkek> thank you @Blacksmoke16
<FromGitter> <grkek> @Blacksmoke16 how can I resolve a method with a symbol
<FromGitter> <grkek> for exmaple
<FromGitter> <grkek> I want to call a method that is
<FromGitter> <grkek> defined as a symbol
<FromGitter> <grkek> :a
<FromGitter> <grkek> and
<FromGitter> <grkek> A has a method a
<FromGitter> <Blacksmoke16> within your macro?
<FromGitter> <grkek> i want to do something like
<FromGitter> <Blacksmoke16> like `run :a`?
<FromGitter> <grkek> A.a
<FromGitter> <grkek> but from :a
<FromGitter> <Blacksmoke16> `A.{{name.id}}`?
<FromGitter> <tenebrousedge> @digitalextremist good show :plus1:
<FromGitter> <digitalextremist> :) Can start growing my hair back
<FromGitter> <grkek> thank u
<FromGitter> <grkek> oh nice
<FromGitter> <grkek> not within a macro no
<FromGitter> <Blacksmoke16> at runtime then?
<FromGitter> <Blacksmoke16> if so you cant
<FromGitter> <grkek> oh
<FromGitter> <grkek> no
<FromGitter> <grkek> :(
alex`` has quit [Ping timeout: 268 seconds]
alex`` has joined #crystal-lang
<FromGitter> <digitalextremist> Any best practice to convert from `UIntXX` to `IntXX` without involving `popcorn`?
<FromGitter> <Blacksmoke16> `.to_i32`?
<FromGitter> <tenebrousedge> uh. `to_i`?
<FromGitter> <digitalextremist> Was rejecting that actually, will see if that's still true
<FromGitter> <grkek> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e3320e1f6945f41ef44b520]
<FromGitter> <grkek> its giving me a
<FromGitter> <grkek> Error: undefined macro variable 'route'
<FromGitter> <grkek> what am I doing wrong ? ;(
<FromGitter> <Blacksmoke16> why not just do the iteration at compile time?
<FromGitter> <Blacksmoke16> ```{% for route in routes %} ⏎ ... ⏎ {% end %}``` [https://gitter.im/crystal-lang/crystal?at=5e3321066f9d3d3498083495]
<FromGitter> <grkek> you are right !!!
<FromGitter> <Blacksmoke16> would avoid the runtime overhead of the loop
duane has quit [Remote host closed the connection]
<FromGitter> <grkek> Error: undefined macro method 'Call#[]'
<FromGitter> <grkek> -_- what does it want now
<FromGitter> <grkek> agh macros
<FromGitter> <grkek> I even removed the contents of the macro
<FromGitter> <grkek> still that error
<FromGitter> <grkek> ->>>>>???
<FromGitter> <Blacksmoke16> got some example code
<FromGitter> <grkek> okay so commenting out
<FromGitter> <grkek> doesnt work in macros ?
<FromGitter> <grkek> :D
<FromGitter> <grkek> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e33233c15941335584097eb]
<FromGitter> <grkek> that is a nasty looking macro
<FromGitter> <grkek> Okay I got it to work
<FromGitter> <grkek> yay
<FromGitter> <Blacksmoke16> 👍
return0e has joined #crystal-lang
return0e_ has joined #crystal-lang
<FromGitter> <grkek> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e3326fc159413355840af7a]
<FromGitter> <grkek> how do you guys deal with this issue
<FromGitter> <Blacksmoke16> use a generic
<FromGitter> <grkek> how
<FromGitter> <grkek> ?
<FromGitter> <grkek> I mean If I try using a generic it will just fail
<FromGitter> <grkek> sadly
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e332748dc52c34ace30823f]
<FromGitter> <grkek> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e3327b573ddad4acd7b1569]
<FromGitter> <grkek> > yet
<FromGitter> <grkek> > :(
<FromGitter> <Blacksmoke16> well what are you giving it?
<FromGitter> <Blacksmoke16> you would have to do like `Grip::HttpRoute(String). new ...`
<FromGitter> <grkek> JSON::Type::Any
<FromGitter> <Blacksmoke16> :thinking:
<FromGitter> <kinxer> Is there a less verbose way to create a new array with one arbitrary element (by index) removed than `arr[...i] + arr[i + 1..]`?
<FromGitter> <Blacksmoke16> https://crystal-lang.org/api/master/Array.html#delete_at(index:Int)-instance-method ?
<FromGitter> <kinxer> `arr.clone.delete_at i` is still pretty verbose, but I guess it's better semantically.
<FromGitter> <Blacksmoke16> sure makes what you want more clear
<FromGitter> <Blacksmoke16> could also use `dup` if you just want a new array but retain the same values as the original
<FromGitter> <kinxer> Actually, to output the clone, you need to do `arr.clone.tap(&.delete_at(i))`
<FromGitter> <kinxer> Ah... One letter less is something, I guess.
<FromGitter> <grkek> what is that weird syntax for avoiding nils again
<FromGitter> <tenebrousedge> `try` or `not_nil!`
<FromGitter> <grkek> try
<FromGitter> <grkek> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e332e1140da694c5ef3bd5e]
<FromGitter> <grkek> updated the routing
<FromGitter> <grkek> again
<FromGitter> <grkek> :^)
<FromGitter> <Blacksmoke16> hmm
<FromGitter> <grkek> does it look stupid :D ?
<FromGitter> <Blacksmoke16> is pretty much how rails and such does it
<FromGitter> <grkek> I have to work with phoenix a lot and it influenced me
<FromGitter> <Blacksmoke16> fair enough
<FromGitter> <Blacksmoke16> still think you should make the 2nd argument the status and default it to `200`
<FromGitter> <Blacksmoke16> 50% less typing :p
<FromGitter> <grkek> correct
<FromGitter> <grkek> Doneee
<FromGitter> <confact> @Blacksmoke16 i get this error when trying to use Proc, what do I do wrong? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e3331d1433e1d40397fe3c1]
<FromGitter> <confact> and it is in the class: `def service_rpc`
<FromGitter> <tenebrousedge> you're probably in the class context
<FromGitter> <Blacksmoke16> `def self.service_rpc`
<FromGitter> <tenebrousedge> ^
<FromGitter> <Blacksmoke16> otherwise would have to be called on an instance of your server
<FromGitter> <Blacksmoke16> like
<FromGitter> <Blacksmoke16> ```server = GitServer.new ⏎ ->server.service_rpc``` [https://gitter.im/crystal-lang/crystal?at=5e333312d9895b17c3b94b75]
<FromGitter> <confact> i noticed it on the same time you answered ^^
<FromGitter> <confact> thanks
return0e has quit []
<FromGitter> <grkek> ```Grip::BaseConsumer+```
<FromGitter> <grkek> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5e33376658f02e34974c655a]
<FromGitter> <grkek> what does the + even mean
<FromGitter> <grkek> If I define two classes it errors out because of that ?
<FromGitter> <grkek> two classes inharited from the same base
<FromGitter> <grkek> inherited*
<FromGitter> <grkek> Oh sweet
<FromGitter> <grkek> How to tell the compiler that I know what I am doing and for it to just ignore these errors ?
<FromGitter> <Blacksmoke16> maybe `.as(YourType)`?
<FromGitter> <grkek> That might be just right
<FromGitter> <grkek> well Ill be damned
<FromGitter> <grkek> that worked
<FromGitter> <grkek> thank you so much ;)
duane has joined #crystal-lang
sagax has quit [Remote host closed the connection]
sagax has joined #crystal-lang
<FromGitter> <ImAHopelessDev_gitlab> `-` working on arrays = mind blown
<FromGitter> <ImAHopelessDev_gitlab> me likey
<FromGitter> <tenebrousedge> o.o
<FromGitter> <tenebrousedge> ```def pangram?(phrase) ⏎ (('a'..'z').to_a - phrase.downcase.chars).empty? ⏎ end``` [https://gitter.im/crystal-lang/crystal?at=5e334bbbf6945f41ef45f2d2]
<FromGitter> <ImAHopelessDev_gitlab> `pangram? "abcdefghijklmnopqrstuvwxyz"` :D :D :D
<FromGitter> <Daniel-Worrall> Use a set
<f1refly> Is there a way to check an xml node against a schema or do I have to fall back to regular expressions and external tools for more sophisticated documents?
<FromGitter> <tenebrousedge> @Daniel-Worrall it's about the same, performance-wise
FromGitter has quit [Read error: Connection reset by peer]
FromGitter has joined #crystal-lang
<FromGitter> <tenebrousedge> there's a DTDVALID flag
<FromGitter> <Blacksmoke16> prob could just use `xmllint`
<FromGitter> <Blacksmoke16> and pass it the schema
<FromGitter> <Blacksmoke16> xml module links to `libxml2` so might be a way to expose those functions if they arent already
<FromGitter> <Blacksmoke16> http://www.xmlsoft.org/html/libxml-xmlschemas.html#xmlSchemaValidateFile or somet @ImAHopelessDev_gitlab ng
<FromGitter> <Blacksmoke16> oops
<FromGitter> <Blacksmoke16> or something like that*
_ht has quit [Quit: _ht]
<f1refly> Yeah, seems easiest to just use xmllint
sagax has quit [Ping timeout: 240 seconds]
yukai has joined #crystal-lang
alex`` has quit [Ping timeout: 265 seconds]
_whitelogger has joined #crystal-lang