pawnbox has quit [Remote host closed the connection]
trapped has joined #crystal-lang
pawnbox has joined #crystal-lang
geoff4321 has joined #crystal-lang
geoff4321 has quit [Quit: Leaving]
pawnbox has quit [Ping timeout: 268 seconds]
nakilon has joined #crystal-lang
pawnbox has joined #crystal-lang
trapped has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pawnbox has quit [Ping timeout: 256 seconds]
pawnbox has joined #crystal-lang
jwaldrip has joined #crystal-lang
jwaldrip has quit [Ping timeout: 246 seconds]
pawnbox has quit [Remote host closed the connection]
A124 has quit [Ping timeout: 268 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
Cidan is now known as zz_Cidan
nakilon has quit [Ping timeout: 260 seconds]
A124 has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
xd1le has joined #crystal-lang
elia has joined #crystal-lang
leafybasil has joined #crystal-lang
xdougx has joined #crystal-lang
circ-user-aRHwG has joined #crystal-lang
leafybasil has quit [Ping timeout: 240 seconds]
<circ-user-aRHwG>
What's the difference between `SimpleHash` and `Hash` in Crystal? It seems that a `SimpleHash` works like a `Hash` but with less methods available. Not sure about its purpose.
hsiehadler has joined #crystal-lang
xdougx has quit [Ping timeout: 244 seconds]
alsm has joined #crystal-lang
hsiehadler is now known as adler
adler is now known as adler_hsieh
<adler_hsieh>
hi all
pawnbox has joined #crystal-lang
circ-user-aRHwG has quit [Remote host closed the connection]
nakilon has joined #crystal-lang
barosl has quit [Ping timeout: 268 seconds]
nakilon has quit [Ping timeout: 240 seconds]
xd1le has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
elia has quit [Quit: Computer has gone to sleep.]
gamemanj has joined #crystal-lang
BlaXpirit has joined #crystal-lang
barosl has joined #crystal-lang
elia has joined #crystal-lang
pawnbox has quit [Ping timeout: 256 seconds]
leafybasil has joined #crystal-lang
pawnbox has joined #crystal-lang
leafybasil has quit [Remote host closed the connection]
leafybasil has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
blue_deref has quit [Quit: bbn]
pawnbox has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
nakilon has joined #crystal-lang
nakilon has quit [Ping timeout: 240 seconds]
pawnbox has quit [Ping timeout: 260 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
jwaldrip has joined #crystal-lang
jwaldrip has quit [Ping timeout: 240 seconds]
Renich has quit [Quit: leaving]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
adler_hsieh has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
trapped has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
xdougx has joined #crystal-lang
trapped has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass>
but I'm not sure, it just ignores extra attributes in the hash
<jhass>
I don't see it in stdlib tbh
<jhass>
and once we got required keyword arguments, the record macro has it for free basically
<xdougx>
jhass: not for an stdlib, but for 3th party also, like some modules to be included to help
<xdougx>
jhass: im building a small lib for persistence, using crystal-pg, and it was a little hard to setup get/setters manually and i could solve the probleman using this macro
<xdougx>
jhass: lil bit like rails
Veejay has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
<jhass>
I think I'd ultimately like to see something that generates models by reading the schema from the DB at compile time, so you get all the compile time checks
<xdougx>
jhass: maybe when i finish this project, i have not much time to finish it, when i have a free time, thats the first thing that i want to do :)
jwaldrip has joined #crystal-lang
pawnbox has joined #crystal-lang
jwaldrip has quit [Ping timeout: 260 seconds]
trapped has joined #crystal-lang
pawnbox has quit [Ping timeout: 250 seconds]
sdogruyol has joined #crystal-lang
<sdogruyol>
is there an easy way to parse json request body
<sdogruyol>
or shall i do explicitly by myself
pawnbox has joined #crystal-lang
NeverDie has joined #crystal-lang
<jhass>
sdogruyol: JSON.mapping?
NeverDie has quit [Client Quit]
adler_hsieh has quit [Remote host closed the connection]
<sdogruyol>
jhass: yeah that's correct but can i parse it directly with HTTP::Params.parse
<sdogruyol>
jhass: what if i dont the mapping beforehand
<jhass>
then you can't use it
<sdogruyol>
jhass: you know in rails you can easily access the request params via params[:something] either application/json form e.g that's what i'm trying to achieve
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: http://git.io/vWMGl
<crystal-gh>
crystal/master 38795ee Ary Borenszweig: Document `IO#write_bytes` and `IO#read_bytes`.
<sdogruyol>
jhass: yeah i'm gonna do it later the mapping is gonna be a little bit big :P
pawnbox has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
adler_hsieh has joined #crystal-lang
jwaldrip has joined #crystal-lang
nakilon has joined #crystal-lang
<crystal-gh>
[crystal] asterite pushed 1 new commit to master: http://git.io/vWMR8
<crystal-gh>
crystal/master 98b8687 Ary Borenszweig: Fixed #1728: restrict the right-hand side of an `||` expression if the left hand side is an `var.is_a?(...)`
jwaldrip has quit [Ping timeout: 260 seconds]
adler_hsieh has quit [Remote host closed the connection]
<BlaXpirit>
how to call a class method of the current class?
jwaldrip has quit [Read error: Connection reset by peer]
<BlaXpirit>
actually, jhass, i want to use a private class method from a public method
jwaldrip has joined #crystal-lang
<jhass>
public instance method or public class method?
<BlaXpirit>
instance
<jhass>
you can't
<jhass>
do you need to access your private class method from another public class method?
<BlaXpirit>
jhass, what i'm really doing here is taking parts of a pubic method and moving them to helper private class methods
<jhass>
that doesn't answer my question
NeverDie has joined #crystal-lang
<BlaXpirit>
jhass, i want to use a private class method from a public instance method
<jhass>
that doesn't answer my question either
<BlaXpirit>
i don't have public class methods, so no
<jhass>
then just make it a private instance method
<travis-ci>
manastech/crystal#98b8687 (master - Fixed #1728: restrict the right-hand side of an `||` expression if the left hand side is an `var.is_a?(...)`): The build passed. https://travis-ci.org/manastech/crystal/builds/87674856
<BlaXpirit>
and what if i wanted to access that from a class method - why is it not allowed?
jwaldrip has quit [Ping timeout: 272 seconds]
<jhass>
I don't know
<xdougx>
jhass: in 0.9.0/src/exception.cr:90 in this definition def initialize(message = nil : String?, cause = nil : Exception?), is that possible to be message: "" instead of nil?
<jhass>
xdougx: signaling absence with nil instead of "" seems more sane, no?
<xdougx>
jhass, but, message isn't a string in the end?
<jhass>
not for all usecases
pawnbox has quit [Remote host closed the connection]
<xdougx>
what else message could be in a exception?
pawnbox has joined #crystal-lang
<jhass>
well, nothing
<jhass>
an exception's primary information is its type, the message is just specializing that information, it's not mandatory
<xdougx>
message could just be nothing, so if in run time, could i get an error without message?
<xdougx>
just trying to understand why i can even create an exception without message, and initializer is an required string and why is raising an uncought exception inside a begin/recue blocxk
<jhass>
xdougx: String? is the same as String|Nil
jwaldrip has joined #crystal-lang
<xdougx>
ok, but why i cant assign it with nil, and why it keep raising an uncaught exception inside begin/rescue block
<jhass>
Exception has no setter for message, you cannot assign it anything, including a string
<jhass>
it raises because you don't give a message when creating the exception, so the default of nil takes place and then you call .not_nil! on that nil
arcwest1 has joined #crystal-lang
<xdougx>
ok, understood, so will need to force message.to_s to chomp it
arcwest1 has quit [Quit: Page closed]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
sdogruyol has quit [Remote host closed the connection]