00:07
NeverDie has quit [Quit: I'm off to sleep. ZZZzzz…]
00:08
flaviu has joined #crystal-lang
00:10
flaviu has left #crystal-lang [#crystal-lang]
00:10
flaviu has joined #crystal-lang
00:11
datanois1 has quit [Ping timeout: 250 seconds]
00:19
jtarchie has quit [Quit: Connection closed for inactivity]
00:20
NeverDie has joined #crystal-lang
00:27
mdz_ has joined #crystal-lang
00:29
datanois1 has joined #crystal-lang
00:31
mdz_ has quit [Ping timeout: 252 seconds]
00:34
vikaton has joined #crystal-lang
00:58
Cidan is now known as zz_Cidan
01:37
shama has quit [Remote host closed the connection]
01:42
shama_ has joined #crystal-lang
01:49
waj has quit [Quit: waj]
01:49
waj has joined #crystal-lang
01:52
shama_ has quit [Remote host closed the connection]
01:53
waterlink1 has joined #crystal-lang
01:55
waterlink has quit [Ping timeout: 255 seconds]
02:01
shama has joined #crystal-lang
02:01
shama has quit [Remote host closed the connection]
02:04
<
waj >
will: after travis guys (hopefully) merge your PR, that means we can start using “language: crystal” or we need to wait until they deploy it?
02:05
waterlink1 has quit [Ping timeout: 244 seconds]
02:25
mdz_ has joined #crystal-lang
02:28
<
vikaton >
not particularly meant for you, but does Crystal have pragmas?
02:29
mdz_ has quit [Ping timeout: 246 seconds]
02:30
<
waj >
you mean like parser directives?
02:32
<
vikaton >
waj, yeah
02:33
<
waj >
there is `ifdef`
02:33
<
waj >
what are you trying to do?
02:39
<
waj >
I see. There are some attributes, like “Raises” and “NoInline”
02:40
<
vikaton >
I see. waj, any news on inline assembly?
02:41
<
waj >
Not yet. I’d like to have that so we could implement more efficient coroutines ;-)
02:48
shama has joined #crystal-lang
02:50
havenwood has joined #crystal-lang
02:58
vikaton has quit []
03:06
endou_________ has quit [Remote host closed the connection]
03:06
n1ftyn8 has quit [Remote host closed the connection]
03:07
willl has quit [Remote host closed the connection]
03:28
mdz_ has joined #crystal-lang
03:33
mdz_ has quit [Ping timeout: 265 seconds]
03:34
havenwood has quit [Ping timeout: 250 seconds]
03:35
asterite has joined #crystal-lang
03:38
waj has quit [Quit: waj]
03:50
asterite has quit [Quit: Leaving.]
03:55
havenwood has joined #crystal-lang
04:00
asterite has joined #crystal-lang
04:10
asterite has quit [Quit: Page closed]
04:36
shama has quit [Quit: (╯°□°)╯︵ɐɯɐɥs]
04:37
ryanf has quit [Ping timeout: 244 seconds]
04:38
ryanf has joined #crystal-lang
04:39
Liothen has quit [Quit: The Dogmatic Law of Shadowsong]
04:39
Liothen has joined #crystal-lang
04:43
mdz_ has joined #crystal-lang
04:43
mdz_ has quit [Remote host closed the connection]
04:56
qb has quit [Ping timeout: 265 seconds]
05:17
qb has joined #crystal-lang
05:33
datanois1 has quit [Ping timeout: 258 seconds]
06:00
datanois1 has joined #crystal-lang
06:07
BlaXpirit has joined #crystal-lang
06:11
willl has joined #crystal-lang
06:12
<
willl >
waj: I'm not sure what the delta between merge and deploy travis has
06:22
n1ftyn8 has joined #crystal-lang
06:22
datanois1 has quit [Ping timeout: 246 seconds]
06:24
unshadow has quit [Quit: leaving]
06:25
endou_________ has joined #crystal-lang
06:29
mdz_ has joined #crystal-lang
06:33
mdz_ has quit [Ping timeout: 258 seconds]
06:35
emmanueloga has quit [Ping timeout: 272 seconds]
06:58
Ven has joined #crystal-lang
07:11
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
07:19
me has joined #crystal-lang
07:19
me is now known as Guest55372
07:24
Ven has joined #crystal-lang
07:27
emmanueloga has joined #crystal-lang
07:33
havenwood has quit [Ping timeout: 246 seconds]
07:38
Ven has quit [Read error: Connection reset by peer]
07:41
Ven has joined #crystal-lang
07:41
Ven has quit [Read error: Connection reset by peer]
07:55
unshadow has joined #crystal-lang
08:08
mdz_ has joined #crystal-lang
08:13
mdz_ has quit [Ping timeout: 264 seconds]
08:22
<
unshadow >
Lets say I have this array: ["cooldata", "notsomuch", "cooldata", "dontcare"], I want only the cooldata out of it, untill now I used something like "a,dummy,b,dummy = Array" but maybe there is something better out there ?
08:23
alsm has joined #crystal-lang
08:23
<
jhass >
what's the criteria? every second element?
08:24
<
jhass >
specific indexes?
08:24
<
unshadow >
I usually do this for this: dummy, remote_port, dummy, remote_ip = socket_source.to_io.peeraddr
08:24
<
unshadow >
I dont care about fammily and local port
08:25
<
unshadow >
so I want only the 2nd and 4th parameters
08:25
<
jhass >
I usually do _local_port, remote_port, _family, remote_ip =, since I find it clearer, I communicate both that I don't want the data and what it is that I don't care about
08:26
<
jhass >
but you can do remote_port, remote_ip = ...values_at(1, 3)
08:26
<
unshadow >
>> _a = 5; puts _a
08:27
<
unshadow >
lets say this is something that can be inside a massive loop, so I dont want to save to memory unnecery stuff
08:28
<
unshadow >
If I could I would do /dev/null, save_this, /dev/null, save_this_too = Array
08:28
<
jhass >
I'd hope that the optimizer is smart enough to throw away variables that are never read
08:28
<
jhass >
but see above, values_at
08:28
<
unshadow >
values_at sounds cool
08:29
<
unshadow >
>> a = [1,2,3,4]; puts a.values_at(0,3)
08:29
<
unshadow >
is that also Ruby syntax ?
08:30
Ven has joined #crystal-lang
08:30
<
jhass >
yes, though there it allocates an extra array
08:30
<
unshadow >
k, thanks :)
08:31
Ven has quit [Client Quit]
08:46
Guest55372 has quit [Remote host closed the connection]
08:51
willl has quit [Quit: Connection closed for inactivity]
09:05
c0r5um has joined #crystal-lang
09:12
Ven has joined #crystal-lang
09:29
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
09:42
<
unshadow >
Is there a way to force String encode ?
09:42
<
jhass >
no, Crystal is not encoding aware yet
09:44
<
unshadow >
if so, how can it check ascii_only? \
09:44
<
jhass >
>> 'a' < 127
09:44
<
jhass >
>> 'a'.ord < 127
09:44
<
jhass >
>> 'ä'.ord < 127
09:45
<
jhass >
chars.all? {|c| c.ord <= 127 } or whatever the range was
09:45
<
unshadow >
>> 'ש'.ord < 127
09:46
<
unshadow >
I see, so basicly everything lower then 127 is ASCII right ?
09:46
<
jhass >
UTF-8 is fully ASCII compatible
09:46
<
jhass >
so <= 127 or < 128
09:48
ponga has joined #crystal-lang
09:48
<
unshadow >
>> '�'.ord
09:48
<
unshadow >
>> 'ש'.ord
10:05
<
unshadow >
jhass: I found my issue with the socket.read stuff
10:06
<
unshadow >
apperently there is a bug or something with print
10:06
<
unshadow >
when calling STDOUT.flush manually after print the issue is resolved
10:09
rilut has joined #crystal-lang
10:11
me has joined #crystal-lang
10:11
me is now known as Guest15513
10:14
<
jhass >
you're still on 0.7.2?
10:14
<
unshadow >
Crystal 0.7.3 [4719644] (Tue Jun 9 06:55:41 UTC 2015)
10:15
<
jhass >
it should flush on \n
10:15
Ven has joined #crystal-lang
10:16
<
unshadow >
print wotn add \n, maybe this is the issue ?
10:17
<
jhass >
oh there's none in the response either?
10:17
<
unshadow >
Nope :) it's waiting for a response mid line
10:18
<
unshadow >
like Username:
10:18
<
unshadow >
or something
10:18
<
jhass >
I'm still not sure it's a good idea, but expected atm
10:18
<
unshadow >
TBH it should flush after print is called, always
10:19
<
jhass >
well sometimes it's useful to do things like printing single chars in a loop
10:19
<
jhass >
maybe we can do IO#sync like ruby
10:19
<
jhass >
IO#sync= I mean
10:20
<
unshadow >
so you can configure the flush behaivior ?
10:22
<
unshadow >
BTW, why does ruby print flushes after call then ? on default
10:22
<
unshadow >
maybe sync should default to true, unless specificly configured not to
10:28
<
jhass >
maybe only for stdout, idk
10:52
rilut has quit [Quit: Page closed]
11:02
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
11:03
BlaXpirit has quit [Quit: Quit Konversation]
11:31
<
unshadow >
is there a super-type for Int ? as in can I check Int32 and Int64 like a.is_a?(Int(both 32 and 64)) ?
11:32
<
unshadow >
in both I mean or
11:33
<
jhass >
and above that is Number I believe which includes Float (and Bignum I guess?)
11:34
<
unshadow >
>> 3.is_a?(Int)
11:34
<
unshadow >
>> 3.is_a?(Int32)
11:34
<
unshadow >
>> 3.is_a?(Number)
11:34
<
unshadow >
cool thanks
11:35
<
unshadow >
DeBot is the shizzle
11:37
strcmp1 has quit [Remote host closed the connection]
11:43
strcmp1 has joined #crystal-lang
11:44
Ven has joined #crystal-lang
11:45
Ven has quit [Client Quit]
11:50
strcmp1 has quit [Ping timeout: 245 seconds]
11:54
Ven has joined #crystal-lang
11:56
strcmp1 has joined #crystal-lang
11:58
datanois1 has joined #crystal-lang
12:06
<
unshadow >
cool :) good job for remmbering hahah
12:07
<
unshadow >
wow, you got lots of packages
12:08
<
jhass >
it accumulates over time
12:08
<
jhass >
I never sudo make install
12:09
<
unshadow >
it's a good practice
12:10
<
jhass >
btw aur4 has support for co maintainers
12:10
<
jhass >
if anyone wants to co-maintain crystal, I'm very open to that
12:12
<
unshadow >
jhass: I'll help, if you want
12:12
<
jhass >
it's not like there's much work, but say if I'm without internet for a few weeks for whatever reason that might be good
12:13
<
unshadow >
jhass: btw, datanoise said to use "print!" to force a flush
12:13
<
jhass >
I've seen it
12:14
<
jhass >
unshadow: cool, added you (it doesn't display weirdly enough)
12:14
<
unshadow >
Didn't know we had that option XD though usually I dont like to use methods with "!", usually like gsub! or split! etc..
12:16
<
unshadow >
jhass: If you want I can update the build of crystal-git0.7.2 to 0.7.3
12:17
<
jhass >
oh right, I forgot to bump the precompiled binary it uses, feel free
12:17
<
jhass >
then I can try out git subtree pull :D
12:24
waj has joined #crystal-lang
12:24
strcmp1 has quit [Ping timeout: 246 seconds]
12:35
strcmp1 has joined #crystal-lang
12:50
bcardiff has joined #crystal-lang
13:07
NeverDie has joined #crystal-lang
13:10
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
13:11
mdz_ has joined #crystal-lang
13:16
mdz_ has quit [Ping timeout: 264 seconds]
13:17
willl has joined #crystal-lang
13:37
<
unshadow >
What does this error means: "Invalid byte sequence in UTF-8 string"
13:40
<
jhass >
that you read something that's not valid UTF-8
13:42
<
unshadow >
Damn... and I cann't force encoding :(
13:43
bcardiff has quit [Quit: Leaving.]
13:45
havenwood has joined #crystal-lang
13:46
strcmp1 has quit [Quit: Leaving]
13:46
Ven has joined #crystal-lang
13:57
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
13:59
<
unshadow >
>> puts {username: "blabla", password: "blabla"}
13:59
<
unshadow >
>> puts {username => "blabla", password => "blabla"}
14:00
<
jhass >
you need the ()
14:00
<
jhass >
it's interpreted as a block this way
14:01
mdz_ has joined #crystal-lang
14:03
<
unshadow >
>> a = {key1: "test", key2: "testing"}; p a
14:03
<
unshadow >
>> a = {key1: "test", key2: "testing"}; p a[:key1]
14:04
Guest15513 has quit [Remote host closed the connection]
14:05
bcardiff has joined #crystal-lang
14:06
Ven has joined #crystal-lang
14:07
me has joined #crystal-lang
14:07
me is now known as Guest13716
14:14
asterite has joined #crystal-lang
14:14
<
asterite >
unshadow: you can do STDOUT.write(buf.to_slice, len); STDOUT.flush
14:15
<
asterite >
instead of creating a string and then printing it... in the aeon client reader loop, I mean
14:15
<
asterite >
that will be faster and won't check for UTF-8, just read and print whatever comes
14:15
<
asterite >
Yesterday I spoke with waj, we
14:16
<
asterite >
we'll make FileDescriptorIO buffered... probably turn BufferedIO into a module that you can include in an IO to make it buffered. And I guess there will be #sync, but not sure.
14:16
<
asterite >
That means File, Socket and STD* will be buffered by default
14:16
<
unshadow >
asterite: what will it mean "buffered" how will it behave differently from now ?
14:18
<
asterite >
Well, when you do File.open(...) it's not buffered at all, each time you read a byte it does a syscall (or at least invokes the read C function)
14:18
<
asterite >
with buffered, you read large chunks into a temporary buffer and reading by byte is much faster
14:18
<
asterite >
Right now you have to do BufferedIO.new(File.open(...)) but that's cumbersome, and probably %99 of the time you want that buffered because otherwise it's too slow
14:19
<
asterite >
unshadow: why do I get those question marks in the aeon client in crystal, but no in telnet?
14:19
<
asterite >
Is telnet a protocol other than read/write whatever comes? Maybe those question marks mean something in the protocol
14:20
<
asterite >
we also found that C#'s FileStream is buffered... but not in Java. Which makes sense, because Java is very beaurocratic, but C# is not
14:20
<
unshadow >
asterite: Thats a good question, it seems that maybe they know when a telnet client is connected and dont send any extra info, I'm trying to find this out with the developer, maybe though, telnet just enforces some kind of encoding ?
14:21
<
unshadow >
asterite: the BufferedIO changes sounds promising, It looks like it could help alot to speed up read\write by default.
14:23
<
unshadow >
All data octets except 0xff are transmitted over Telnet as is. -- Wikipedia
14:23
<
unshadow >
dosn't that means it's just strings ?
14:25
<
unshadow >
asterite: Hm... using Netcat, which is a raw TCP client, I also get those question marks and other non-assci stuff, apperently those are indeed telnet symbols or something
14:26
<
unshadow >
good thing that jhass said he will create a Telnet::Parser module
14:26
<
unshadow >
(joking)
14:26
<
jhass >
telnet is an aweful protocol
14:26
<
jhass >
worse than IRC
14:27
<
unshadow >
are there alot of escape letter to be parsed ?
14:28
<
jhass >
read through it
14:28
<
jhass >
"Telnet command structure" is my favorite chapter
14:29
<
unshadow >
Yeha, Ruby got it in the STDLIBS
14:30
<
unshadow >
LOL written at " May 1983" ... damn
14:31
jtarchie has joined #crystal-lang
14:33
Ven has quit [Read error: Connection reset by peer]
14:35
unshadow has quit [Quit: leaving]
14:36
c0r5um has quit [Quit: Quitte]
14:39
BlaXpirit has joined #crystal-lang
14:41
unshadow has joined #crystal-lang
14:44
<
unshadow >
TBH it seems playable with only text output , maybe i should just read each char , check that i's ASCII and only then print it
14:52
strcmp1 has joined #crystal-lang
14:57
Codcore has joined #crystal-lang
14:58
<
Codcore >
How to make macro ecr_file to work with relational path? It works only when I specify absolute system path to file...
14:59
<
asterite >
You can do "#{__DIR__}/..."
14:59
<
asterite >
__DIR__ gives you the file's directory
14:59
<
asterite >
Hm, that's missing from the docs, I'll add it later
15:00
<
Codcore >
asterite, thanks
15:05
<
Codcore >
error is normal, since ecr file doesn't exist
15:05
<
Codcore >
at my machine it works
15:05
<
asterite >
Codcore: seems to work on my machine if I create a view.ecr next to that file
15:05
<
Codcore >
asterite, thanks!
15:06
unshadow has quit [Ping timeout: 264 seconds]
15:11
datanois1 is now known as datanoise
15:16
_unshadow_ has joined #crystal-lang
15:28
asterite has quit [Ping timeout: 246 seconds]
15:30
shama has joined #crystal-lang
15:43
unshadow has joined #crystal-lang
15:56
bcardiff1 has joined #crystal-lang
15:59
bcardiff has quit [Ping timeout: 246 seconds]
15:59
<
unshadow >
>> IAC = 255.chr; puts IAC
16:00
<
unshadow >
>> puts "\000"
16:00
<
unshadow >
>> puts "ab\000ab"
16:00
<
DeBot >
unshadow: ab
16:00
<
unshadow >
>> puts "ab\000 ab"
16:00
<
DeBot >
unshadow: ab
16:03
n0xff has joined #crystal-lang
16:04
AckZ has joined #crystal-lang
16:04
<
unshadow >
The things you see when going over a very very old and unsed STDLIB code elsif AYT == $1 # respond to "IAC AYT" (are you there)
16:04
<
unshadow >
self.write("nobody here but us pigeons" + EOL)
16:15
<
unshadow >
>> "testing" =~ /bla/no
16:15
<
unshadow >
>> "testing" =~ /bla/o
16:19
NeverDie has joined #crystal-lang
16:20
<
unshadow >
>> "testing" =~ /bla/O
16:22
NeverDie has quit [Max SendQ exceeded]
16:22
NeverDie has joined #crystal-lang
16:30
vikaton has joined #crystal-lang
16:32
alsm has quit [Ping timeout: 256 seconds]
16:50
n0xff has quit [Remote host closed the connection]
16:55
Dreamer3 has quit [Read error: Connection reset by peer]
16:56
Dreamer3 has joined #crystal-lang
17:04
waj has quit [Quit: waj]
17:18
Codcore_ has joined #crystal-lang
17:19
Codcore_ has quit [Client Quit]
17:24
rpitt has joined #crystal-lang
17:27
rpitt has quit [Client Quit]
17:41
DeBot has quit [Ping timeout: 272 seconds]
17:45
zz_Cidan is now known as Cidan
17:48
unshadow has quit [Remote host closed the connection]
18:15
asterite has joined #crystal-lang
18:15
<
asterite >
Codcore: ecr_file is a macro, it accepts an AST node
18:15
<
asterite >
so you are passing a string interpolation
18:15
<
asterite >
you can't have a view file that depends on runtime values with ECR
18:17
sandelius has joined #crystal-lang
18:30
<
Codcore >
@asterite, thanks
18:41
sandelius has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
18:45
asterite has quit [Quit: Page closed]
18:58
vikaton has quit [Quit: Connection closed for inactivity]
19:26
sandelius has joined #crystal-lang
19:28
<
jhass >
>> "foo\nbar\nbaz".match(/^bar$/)
19:29
DeBot_ has joined #crystal-lang
19:29
DeBot_ has quit [Client Quit]
19:29
DeBot has joined #crystal-lang
19:29
<
jhass >
>> "foo\nbar\nbaz".match(/^bar$/)
19:29
<
jhass >
>> "foo\nbar\nbaz".match(/^bar$/m)
19:30
<
jhass >
>> "bar".match(/\Abar\z/m)
19:30
<
jhass >
>> "bar\n".match(/\Abar\z/m)
19:30
<
jhass >
>> "bar\n".match(/\Abar$/m)
19:30
<
jhass >
>> "bar\nbaz".match(/\Abar$/m)
20:01
willl has quit [Quit: Connection closed for inactivity]
20:11
havenwood has joined #crystal-lang
20:21
endou_________ has quit [Read error: Connection reset by peer]
20:21
endou_________ has joined #crystal-lang
20:42
<
ponga >
>> 10.times.to_a
20:42
<
ponga >
>> 10.times.to_a.rotate
21:01
mdz_ has quit [Remote host closed the connection]
21:14
Codcore has quit [Ping timeout: 246 seconds]
21:20
sgo has quit [Ping timeout: 258 seconds]
21:30
kulelu88 has joined #crystal-lang
21:32
sgo has joined #crystal-lang
21:45
bcardiff1 has quit [Quit: Leaving.]
21:46
Guest13716 has quit [Remote host closed the connection]
22:10
havenwood has quit [Read error: Connection reset by peer]
22:13
mdz_ has joined #crystal-lang
22:16
waterlink has joined #crystal-lang
22:41
BlaXpirit has quit [Quit: Quit Konversation]
22:43
genixefr has joined #crystal-lang
22:44
sgo has quit [Ping timeout: 264 seconds]
22:44
havenwood has joined #crystal-lang
22:49
waj has joined #crystal-lang
22:52
genixefr has quit [Ping timeout: 245 seconds]
22:53
wuehlmaus has quit [Ping timeout: 256 seconds]
22:55
mdz_ has quit [Remote host closed the connection]
23:03
wuehlmaus has joined #crystal-lang
23:04
wuehlmaus is now known as Guest93295
23:04
bcardiff has joined #crystal-lang
23:05
genixefr has joined #crystal-lang
23:09
mdz_ has joined #crystal-lang
23:24
vikaton has joined #crystal-lang
23:26
<
vikaton >
asterite, any word on the macro extention ?
23:47
asterite has joined #crystal-lang
23:48
<
asterite >
vikaton: Yes. Allowing more flexibility isn't always good
23:48
<
asterite >
Also, you didn't say how to solve the ambiguity of "foo bar baz"
23:48
<
asterite >
I also don't understand why you always want so many features from Nim into Crystal
23:49
<
vikaton >
because I like Nim features, but also really like Ruby
23:50
<
asterite >
What other examples of infix operators out there?
23:50
mdz_ has quit [Remote host closed the connection]
23:50
<
asterite >
I mean, the "and" example isn't very good, you can use "&&"
23:50
<
asterite >
The "and" would be redundant and people will have to learn two syntaxes for the same purpose
23:50
<
asterite >
(but this is just my opinion, obviously Nim considers that to be ok)
23:51
<
vikaton >
asterite: it was just a suggestion, if you dont want to implement it for your own reasons its fine
23:51
<
vikaton >
asterite: on a totally unrelated topic, you follow Messi?
23:52
<
asterite >
The football player? :-P
23:52
<
asterite >
I just don't want to add too many features to the language, I'd like to keep it simple
23:52
jbomo has joined #crystal-lang
23:52
<
asterite >
Mmm... I'm not into football, even though I'm from Argentina and that would seem a paradox :-)
23:53
<
asterite >
but I do watch the world cup... it's almost inevitable her
23:53
<
asterite >
where are you from?
23:53
<
vikaton >
oh im very sorry for your loss at the finals :(
23:53
<
vikaton >
I'm from America :P
23:53
<
vikaton >
but I follow alot of soccer (football)
23:54
<
vikaton >
I should have probably been more clear about that haha
23:55
<
asterite >
It's because I'm from America too ;-)
23:55
<
asterite >
I never understood why USA calls its country America... it's a continent
23:57
<
vikaton >
Yeah well, we do have a big ego :D
23:58
<
asterite >
My brother does watch a lot of soccer, and he's a programmer too
23:58
<
vikaton >
does he program in Crystal? :P
23:59
<
asterite >
No... he programs in Java, and I think in XML
23:59
<
asterite >
(yes, you read well)
23:59
havenwood has joined #crystal-lang