00:07
trapped has quit [Read error: Connection reset by peer]
00:10
Philpax has joined #crystal-lang
00:12
Raimondi has joined #crystal-lang
00:24
A124 has joined #crystal-lang
00:27
krtv` has quit [Ping timeout: 244 seconds]
00:39
pawnbox has joined #crystal-lang
00:42
soveran has joined #crystal-lang
00:43
pawnbox has quit [Ping timeout: 260 seconds]
00:47
soveran has quit [Ping timeout: 276 seconds]
00:51
bjz_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
00:55
Philpax has quit [Ping timeout: 260 seconds]
01:05
Philpax has joined #crystal-lang
01:08
kfpratt has quit []
01:12
bjz has joined #crystal-lang
01:15
bjz_ has joined #crystal-lang
01:15
ragmaanir has quit [Quit: Leaving]
01:16
bjz has quit [Ping timeout: 244 seconds]
01:43
soveran has joined #crystal-lang
01:43
Philpax has quit [Ping timeout: 260 seconds]
01:48
soveran has quit [Ping timeout: 276 seconds]
01:51
Philpax has joined #crystal-lang
01:59
Gasher has quit [Quit: Leaving]
02:09
pawnbox has joined #crystal-lang
02:14
pawnbox has quit [Ping timeout: 276 seconds]
02:15
fridgerator has joined #crystal-lang
02:18
Gasher has joined #crystal-lang
02:29
Gasher has quit [Ping timeout: 244 seconds]
02:44
Gasher has joined #crystal-lang
02:45
soveran has joined #crystal-lang
02:49
tony_ has joined #crystal-lang
02:49
soveran has quit [Ping timeout: 244 seconds]
03:19
pawnbox has joined #crystal-lang
03:24
pawnbox has quit [Ping timeout: 264 seconds]
03:31
fridgerator has joined #crystal-lang
03:31
fridgerator has quit [Client Quit]
03:31
fridgerator has joined #crystal-lang
04:16
tony_ has quit [Ping timeout: 248 seconds]
04:33
fridgerator has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
04:34
pawnbox has joined #crystal-lang
04:37
pawnbox has quit [Remote host closed the connection]
04:37
pawnbox has joined #crystal-lang
04:38
bcardiff has joined #crystal-lang
04:46
soveran has joined #crystal-lang
04:50
pawnbox has quit [Remote host closed the connection]
04:52
soveran has quit [Ping timeout: 276 seconds]
04:59
pawnbox has joined #crystal-lang
05:13
pawnbox has quit []
05:13
Philpax has quit [Ping timeout: 260 seconds]
05:14
pawnbox has joined #crystal-lang
05:18
fridgerator has joined #crystal-lang
05:23
Philpax has joined #crystal-lang
05:47
Philpax has quit [Ping timeout: 260 seconds]
05:47
soveran has joined #crystal-lang
05:47
soveran has joined #crystal-lang
05:52
soveran has quit [Ping timeout: 252 seconds]
06:00
stef__ has quit [Quit: Leaving]
06:25
soveran has joined #crystal-lang
06:29
petercommand has quit [Ping timeout: 260 seconds]
06:30
petercommand has joined #crystal-lang
06:46
pawnbox has quit [Ping timeout: 248 seconds]
06:52
zodiak has joined #crystal-lang
06:57
zodiak has quit [Client Quit]
06:58
zodiak has joined #crystal-lang
07:06
pawnbox has joined #crystal-lang
07:10
pawnbox has quit [Ping timeout: 252 seconds]
07:11
Philpax has joined #crystal-lang
07:17
<
crystal-gh >
crystal/master 85bccef Brian J. Cardiff: playground: #2355 aproximate solution to allow macro calls inside class/module. and the usage of record macro.
07:28
marcosdsanchez has quit [Read error: Connection reset by peer]
07:29
marcosdsanchez has joined #crystal-lang
07:31
trapped has joined #crystal-lang
07:49
bcardiff has quit [Quit: bcardiff]
08:10
A124 has quit [Quit: '']
08:12
A124 has joined #crystal-lang
08:16
trapped has quit [Read error: Connection reset by peer]
08:26
pawnbox has joined #crystal-lang
09:01
willl has quit [Quit: Connection closed for inactivity]
09:45
pawnbox has quit [Remote host closed the connection]
09:48
pawnbox has joined #crystal-lang
10:13
Gasher has quit [Quit: Leaving]
10:15
ql6wlld has joined #crystal-lang
10:16
waghanza has joined #crystal-lang
10:16
<
waghanza >
hi, how rpm are build ?
10:17
<
waghanza >
(trying to build crystal ;-)
10:20
soveran has quit [Ping timeout: 248 seconds]
10:23
soveran has joined #crystal-lang
10:45
Philpax has quit [Ping timeout: 260 seconds]
10:54
renews has joined #crystal-lang
11:13
soveran has quit [Remote host closed the connection]
11:21
renews has joined #crystal-lang
11:39
soveran has joined #crystal-lang
11:47
renews has joined #crystal-lang
11:56
waghanza has quit [Ping timeout: 244 seconds]
12:08
donpdonp has quit [Ping timeout: 260 seconds]
12:09
donpdonp has joined #crystal-lang
12:12
waghanza has joined #crystal-lang
12:33
trapped has joined #crystal-lang
13:04
soveran has quit [Remote host closed the connection]
13:22
ruslux has joined #crystal-lang
13:26
Philpax has joined #crystal-lang
13:41
soveran has joined #crystal-lang
13:42
emancu has joined #crystal-lang
14:03
tony__ has joined #crystal-lang
14:04
tony__ has quit [Read error: Connection reset by peer]
14:08
tony__ has joined #crystal-lang
14:12
trapped has quit [Read error: Connection reset by peer]
14:34
bcardiff has joined #crystal-lang
14:35
Philpax has quit [Ping timeout: 240 seconds]
14:45
<
crystal-gh >
crystal/master b7f070d Brian J. Cardiff: fix #2362 ToSVisitor was rendering Visibility enum with the default enum case instead of using crystal syntax.
14:55
<
crystal-gh >
crystal/master 06d093b Brian J. Cardiff: add spec related to #2362
15:11
jnylen has joined #crystal-lang
15:13
steamy has quit [*.net *.split]
15:13
Cyrus has quit [*.net *.split]
15:13
wmoxam_ has quit [*.net *.split]
15:15
jnylen is now known as steamu
15:15
steamu is now known as steamy
15:18
<
tilpner >
>> def array(v : T); [v]; end; array 42 # Why does this work...
15:18
marcosdsanchez has quit [Read error: Connection reset by peer]
15:18
<
tilpner >
>> def array(v : T) : Array(T); [v]; end; array 42 # ... but this doesn't?
15:19
marcosdsanchez has joined #crystal-lang
15:21
<
BlaXpirit >
tilpner: strange
15:21
<
BlaXpirit >
well it's not really needed anyway
15:22
<
tilpner >
This is just an example I'm using to understand another oddity, where it's required.
15:23
tony__ has quit [Ping timeout: 264 seconds]
15:25
Cyrus has joined #crystal-lang
15:25
Cyrus is now known as Guest36566
15:26
<
tilpner >
>> def maybe(v : T?, &block : T -> U) : U?; if v; yield v; else; nil; end; end; p maybe("foo", &.reverse) # What about this, BlaXpirit?
15:28
<
BlaXpirit >
>> def maybe(v); yield v if v; end; p maybe("foo", &.reverse)
15:28
<
BlaXpirit >
tilpner:
15:29
wmoxam_ has joined #crystal-lang
15:31
soveran has quit []
15:32
emmanueloga has quit [Ping timeout: 248 seconds]
15:33
<
BlaXpirit >
I mean it's great to state these types for documentation and it sucks that this doesn't work but yeah...
15:34
emmanueloga has joined #crystal-lang
15:35
<
tilpner >
Oh, I see. Is there some syntax for this? Is it possible to write foo.maybe(&.reverse)?
15:35
<
tilpner >
(I mean, syntax I've missed that does something similar to "maybe")
15:36
<
BlaXpirit >
tilpner: you can add methods to types
15:37
<
BlaXpirit >
struct Object; and whatever
15:37
<
BlaXpirit >
and there is this thing indeed
15:37
<
BlaXpirit >
foo.try &.reverse
15:37
<
BlaXpirit >
>> [1,2,3].try &.reverse
15:37
<
tilpner >
I've read that I can, but isn't that frowned upon (adding methods to Object)?
15:40
tony_ has joined #crystal-lang
15:40
<
tilpner >
>> nil.try &.reverse
15:40
<
tilpner >
Ah, okay.
15:40
<
ruslux >
Sry. Anybody have docs in .pdf?
15:40
<
tilpner >
Thanks a lot, BlaXpirit! Do you know if there's an issue for this?
15:40
<
BlaXpirit >
I don't know. I forgot this feature even existed outside of classes
15:41
<
BlaXpirit >
ruslux: crystal-lang.org/docs in pdf?
15:42
<
BlaXpirit >
ruslux: I don't think they exist but that can be arranged
15:43
<
ruslux >
I tried a lot of site-to-pdf-converters, but all of them convert only 1 page
15:44
<
ruslux >
In any case, tnx!
15:46
<
ruslux >
Where i can find docs sources?
15:49
<
BlaXpirit >
ruslux, install 'calibre'; gitbook pdf _gitbook
15:50
<
crystal-gh >
crystal/master 0309024 Brian J. Cardiff: Playground: do not instrument constants declarations #2353
15:52
<
BlaXpirit >
neat stuff
15:53
<
BlaXpirit >
I would suggest putting it up on the website but generating pdf every time is gonna do quite a number on the repository size
15:55
<
ruslux >
Wow, it's awesome! Thank you!
15:55
kfpratt has joined #crystal-lang
16:04
bcardiff has quit [Quit: bcardiff]
16:06
ruslux has quit [Remote host closed the connection]
16:15
pawnbox has quit [Remote host closed the connection]
16:25
pawnbox has joined #crystal-lang
16:30
pawnbox has quit [Ping timeout: 252 seconds]
16:32
trapped has joined #crystal-lang
16:45
pawnbox has joined #crystal-lang
16:57
ql6wlld has quit [Quit: WeeChat 1.4]
18:07
tony__ has joined #crystal-lang
18:11
tony_ has quit [Ping timeout: 260 seconds]
18:22
ssvb has quit [Ping timeout: 244 seconds]
18:30
tony__ has quit [Ping timeout: 260 seconds]
18:31
ssvb has joined #crystal-lang
18:34
ssvb has quit [Read error: Connection reset by peer]
18:35
ssvb has joined #crystal-lang
18:37
<
crystal-gh >
[crystal] DougEverly opened pull request #2363: Added Process.daemonize (master...daemonize)
https://git.io/vaxHy
18:52
renews has quit [Remote host closed the connection]
18:55
Ven has joined #crystal-lang
18:59
tony_ has joined #crystal-lang
19:03
tony_ has quit [Ping timeout: 260 seconds]
19:04
<
emancu >
how can I print the code generated by some macros ?
19:04
<
emancu >
i mean, i want to call a few macros and see the output before transforming to llvm
19:08
<
BlaXpirit >
emancu, {{debug}}
19:09
<
emancu >
just put {{debug}} and that's it ?
19:09
<
BlaXpirit >
if i remember correctly
19:09
<
BlaXpirit >
and i don'y
19:09
<
BlaXpirit >
and i don't
19:11
<
emancu >
BlaXpirit: do you know a way to insert code passed by an array of blocks ?
19:11
<
emancu >
i want to define a few blocks
19:11
<
emancu >
and when I call a macro
19:11
<
BlaXpirit >
array of blocks? hmm i don't think that's possible
19:11
<
emancu >
insert the code inside of those blocks
19:12
<
emancu >
Array( -> _)
19:12
<
emancu >
that is an array of blocks with no args
19:12
<
emancu >
which is exactly what i want
19:13
<
BlaXpirit >
emancu, how do you do it with 1 block?>
19:13
<
emancu >
lets say that block1 is { emancu_test = 1} and blcok2 is {blaxpirit_test = 1}
19:13
<
emancu >
and I have an array with block1, block2
19:14
<
emancu >
I want to define a macro `build` which receives a block BUT first inserts block1 and block2 code BEFORE the actual {{yield}}
19:15
<
emancu >
asterite: ^
19:15
<
emancu >
BlaXpirit: sorry, i don't get you :/
19:17
<
BlaXpirit >
emancu, please show how you pass these blocks
19:18
<
BlaXpirit >
even if you don't use them in the macro, how can you pass them?
19:19
<
emancu >
well, to a macro, i don't know how to do that ^^
19:19
<
emancu >
i was keeping track of them on a class variable
19:19
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
19:20
willl has joined #crystal-lang
19:21
<
emancu >
i would like to compose code doing that but i'm afraid that would be impossible
19:21
<
BlaXpirit >
emancu, appears so
19:21
<
BlaXpirit >
at least you can use strings
19:22
<
emancu >
question.. the macros are resolved BEFORE infer the types ?
19:22
<
BlaXpirit >
macros are just a templating language
19:24
<
emancu >
so maybe it is possible
19:24
<
BlaXpirit >
.id is really .to_s
19:25
<
emancu >
hmmm that is really ugly to do :/
19:26
<
emancu >
but it works
19:27
<
BlaXpirit >
emancu, I can't seem to pass a multi-statement block anyway
19:27
<
BlaXpirit >
at that point may as well use strings
19:27
tony_ has joined #crystal-lang
19:29
<
emancu >
BlaXpirit: let me give you some context and maybe you helpe me to find a clever solution
19:30
<
emancu >
i'm writing a test framework and I want to define a `before` block
19:30
<
emancu >
to run before each test
19:31
<
emancu >
the thing is, i want to share the code defined so i can use the variables from the `before` block inside a test
19:33
<
BlaXpirit >
i don't believe that this hasn't been solved elsewhere
19:33
waghanza has quit [Remote host closed the connection]
19:35
<
emancu >
i didn't find it in `crystal/spec`
19:37
Ven has joined #crystal-lang
19:40
<
RX14 >
emancu, use spec2
19:40
<
RX14 >
it has before/after
19:40
<
RX14 >
and other nice things
19:41
<
RX14 >
i also reccomend power_assert for assertions
19:47
<
emancu >
RX14: do you have the repo ?
19:49
<
emancu >
i don't like it.
19:49
<
emancu >
it adds too many things that i don't need
19:49
<
emancu >
and also pollutes the Object class
19:49
<
RX14 >
just don't use them?
19:50
<
RX14 >
spec2 doesn't pollute object
19:50
<
RX14 >
it's literally right there under "goals"
19:52
<
RX14 >
it has Object class patching behind a flag
19:52
<
RX14 >
and default spec pollutes Object a lot
19:53
<
emancu >
yes, that is why i don't want to use default spec
19:53
<
RX14 >
so use spec2
19:53
<
RX14 >
it solves all your problems
19:54
<
emancu >
i want to keep it simple as cutest in ruby
19:57
<
RX14 >
oh, that's not working
19:59
tony_ has quit [Ping timeout: 264 seconds]
20:05
tony_ has joined #crystal-lang
20:10
Ven has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
20:11
dsounded has joined #crystal-lang
20:11
<
dsounded >
hello, I've got this:
20:11
<
dsounded >
Error while requiring "prelude" How to fix it ?
20:12
dsounded has quit [Client Quit]
20:18
<
BlaXpirit >
emancu, you don't seem to understand these concepts at all
20:19
<
RX14 >
emancu, macros recieve AST nodes
20:19
<
BlaXpirit >
you can't pass a runtime object to a macro
20:19
<
RX14 >
not variables
20:19
<
RX14 >
the type of blocks is a varref
20:19
<
emancu >
BlaXpirit: right!
20:19
<
BlaXpirit >
like i said, it's basically a templating language
20:19
<
RX14 >
it operates before typings and such
20:20
<
RX14 >
and it's much more than a templating langauge
20:20
<
RX14 >
it gets AST nodes
20:20
<
RX14 >
which is really useful for manipulating the AST
20:20
<
RX14 >
but you can't make an array of blocks
20:20
<
RX14 >
because blocks have no runtime type
20:20
<
RX14 >
you have to use procs
20:20
<
emancu >
but, i think there is a way to keep track of the AST nodes and use them
20:20
<
emancu >
or i hope that
20:21
<
emancu >
if i can use procs to paste code, it is ok for me
20:23
renews has joined #crystal-lang
20:24
renews has quit [Client Quit]
20:26
renews has joined #crystal-lang
20:27
<
emancu >
there are too many nested things it is easy to get lost :S
20:27
<
RX14 >
because that array is created in the macro VM
20:27
<
RX14 >
and blocks ARE objects in the macro universe
20:29
<
RX14 >
the basic rule is, blocks can only be passed to methods
20:29
<
RX14 >
and only 1 block passed
20:29
<
emancu >
is there any docs about it ?
20:30
<
RX14 >
spec2 has one "after" macro which recieves this proc and stores it, which is possible because it's a mcro
20:30
<
RX14 >
but you can't pass multiple blocks to 1 macro
20:30
<
RX14 >
you have to call the mcro multiple times
20:30
<
RX14 >
emancu, not really any docs, just common sense
20:32
<
emancu >
well but I can compose blocks and pass it to a macro and end building the entire "block" with all the code nested
20:32
<
emancu >
or again I'm missing something
20:32
<
RX14 >
what do you mean?
20:37
pawnbox has quit [Remote host closed the connection]
20:39
<
emancu >
maybe the macro `before` should define a "method" where I can extract the code later on macro `it`
20:42
<
emancu >
in other words, how can I get the AST of an already defined method ?
20:54
tony_ has quit [Ping timeout: 260 seconds]
20:55
tony_ has joined #crystal-lang
21:11
<
emancu >
RX14: asterite ^
21:32
marcosdsanchez has quit [Read error: Connection reset by peer]
21:32
marcosdsanchez has joined #crystal-lang
21:33
[spoiler] has quit [Ping timeout: 240 seconds]
21:34
victor_lowther has quit [Ping timeout: 240 seconds]
21:34
iamstef has quit [Ping timeout: 240 seconds]
21:34
aemadrid has quit [Ping timeout: 240 seconds]
21:34
guilleiguaran__ has quit [Ping timeout: 240 seconds]
21:34
x0f has quit [Ping timeout: 240 seconds]
21:36
victor_lowther has joined #crystal-lang
21:37
iamstef has joined #crystal-lang
21:38
aemadrid has joined #crystal-lang
21:38
guilleiguaran__ has joined #crystal-lang
21:38
bjz_ has quit [Max SendQ exceeded]
21:39
_kfpratt has joined #crystal-lang
21:39
[spoiler] has joined #crystal-lang
21:39
x0f has joined #crystal-lang
21:41
kfpratt has quit [Ping timeout: 240 seconds]
21:44
bjz has joined #crystal-lang
21:44
wmoxam_ has quit [*.net *.split]
21:46
<
RX14 >
emancu, i don't think you can
22:00
wmoxam_ has joined #crystal-lang
22:37
pawnbox has joined #crystal-lang
22:41
pawnbox has quit [Ping timeout: 240 seconds]
22:44
trapped has quit [Read error: Connection reset by peer]
23:36
pawnbox has joined #crystal-lang
23:37
matp has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
23:42
pawnbox has quit [Ping timeout: 276 seconds]
23:51
tony_ has quit [Ping timeout: 260 seconds]