00:07
<
FromGitter >
<epoch> yep appreciate the help @Blacksmoke16 @bew
00:07
<
FromGitter >
<Blacksmoke16> np
01:06
ternarysolo has joined #crystal-lang
01:11
ternarysolo has quit [Ping timeout: 240 seconds]
01:41
laaron has joined #crystal-lang
01:44
xaxisx has quit [Ping timeout: 245 seconds]
01:44
laaron- has quit [Ping timeout: 256 seconds]
01:50
xaxisx has joined #crystal-lang
02:01
xaxisx has quit [Ping timeout: 250 seconds]
02:06
xaxisx has joined #crystal-lang
02:20
Raimondi has quit [Quit: WeeChat 2.3: ¡Chau!]
02:41
smurfendrek123 has joined #crystal-lang
02:41
<
smurfendrek123 >
Hello, can I pass a type as an argument? I want to write a method that converts the current type to a new type.
02:44
xaxisx has quit [Read error: Connection reset by peer]
02:57
<
smurfendrek123 >
I discovered that i just have to say it's type is class, but can I specify the type of the class down to subclasses of a certain class?
03:07
ternarysolo has joined #crystal-lang
03:12
ternarysolo has quit [Ping timeout: 268 seconds]
03:18
DTZUZO has joined #crystal-lang
04:16
crystal-lang564 has quit [Ping timeout: 258 seconds]
04:24
<
smurfendrek123 >
When using array.new(size, value) can i still specify the type of the array? I want to fill it with nil, but it's type has to be String|Nil
04:26
chemist69 has quit [Ping timeout: 252 seconds]
04:28
chemist69 has joined #crystal-lang
04:31
<
FromGitter >
<maiha> `Array(String?).new(3, nil)` ?
04:32
<
smurfendrek123 >
maiha, that works, thanks!
04:38
<
smurfendrek123 >
I don't understand why that | doesn't work?
04:40
rohitpaulk has joined #crystal-lang
04:40
<
smurfendrek123 >
Ah, i think the problem was that i thought there were order of operations on the logical operators, where == came before |
04:51
smurfendrek123 has quit [Remote host closed the connection]
04:51
<
FromGitter >
<maiha> `||` ?
05:08
ternarysolo has joined #crystal-lang
05:13
ternarysolo has quit [Ping timeout: 268 seconds]
05:32
crystal-lang564 has joined #crystal-lang
05:37
rohitpaulk has quit [Remote host closed the connection]
07:09
ternarysolo has joined #crystal-lang
07:12
return0e has quit [Ping timeout: 272 seconds]
07:12
return0e has joined #crystal-lang
07:13
ternarysolo has quit [Ping timeout: 244 seconds]
07:21
crystal-lang564 has quit [Quit: Konversation terminated!]
09:08
crystal-lang564 has joined #crystal-lang
09:10
ternarysolo has joined #crystal-lang
09:14
ternarysolo has quit [Ping timeout: 246 seconds]
09:14
<
FromGitter >
<bararchy> How come I don't see @gring talking about new Godot here? ;)
09:15
<
FromGitter >
<bararchy> oops @girng
10:07
ua has quit [Excess Flood]
10:08
ua has joined #crystal-lang
10:19
<
FromGitter >
<girng> @bararchy :)
11:26
ternarysolo has joined #crystal-lang
12:56
lesderid has joined #crystal-lang
13:27
bmcginty has quit [Ping timeout: 240 seconds]
13:36
<
FromGitter >
<bararchy> Any way to easly search if Array_A holds all the items, in the same order and Array_B? ⏎ ([1,2,3,4,5].has?([3,4,5]) => true)
13:46
<
FromGitter >
<mamantoha> @bararchy `[3,4,5].all? { |e| [1, 2, 3,4,5].includes?(e) }`
13:49
<
z64 >
both your example and Set are unordered, though. bararchy wants to check that `[3, 4, 5]` is a subset in the same order
13:50
<
FromGitter >
<bararchy> ^ yeha, was just testing that ang got to the same conclusion,
13:50
<
FromGitter >
<bararchy> those are unordered
13:50
<
FromGitter >
<bararchy> thanks though :) @mamantoha
13:51
<
FromGitter >
<j8r> Set is based on Hash, and Hash is orderd
13:52
<
FromGitter >
<straight-shoota> @j8r That's an implementation detail and only a coincidence. By definition, `Set` is unordered.
13:52
<
FromGitter >
<j8r> So that's in fact an `OrderedSet`
13:53
<
FromGitter >
<bararchy> @j8r this will be true => `[1,2,3,4,5,6,7].to_set.superset?([3,4,7].to_set)` though in my example I would like it to be false
13:55
<
FromGitter >
<kinxer> `contains` is perhaps not the best naming, but I think the implementation is decent.
13:55
<
FromGitter >
<bararchy> Cool! @kinxer
13:55
<
FromGitter >
<kinxer> There might be a way to do it without creating so many new arrays, though.
13:59
<
FromGitter >
<straight-shoota> needle = [3, 4, 5]
14:00
lucasb has joined #crystal-lang
14:02
duane has joined #crystal-lang
14:16
<
FromGitter >
<kinxer> I'm gonna work up a benchmark carc for these... One sec.
14:18
<
FromGitter >
<yxhuvud> `(needle - superset).empty?` is slightly cleaner, but will still allocate for the missing entries
14:22
<
FromGitter >
<kinxer> That may or may not be desired behavior.
14:22
<
FromGitter >
<kinxer> Actually, let me trim that down to make it more clear...
14:25
FromGitter has quit [Remote host closed the connection]
14:31
ternarysolo has quit [Ping timeout: 250 seconds]
14:38
ternarysolo has joined #crystal-lang
15:04
laaron has quit [Remote host closed the connection]
15:11
laaron has joined #crystal-lang
15:13
bmcginty has joined #crystal-lang
17:21
gangstacat has quit [Quit: Ĝis!]
17:50
gangstacat has joined #crystal-lang
17:52
duane has quit [Ping timeout: 245 seconds]
18:07
crystal-lang564 has quit [Ping timeout: 258 seconds]
20:17
laaron has joined #crystal-lang
20:42
ternarysolo has quit [Ping timeout: 246 seconds]
21:06
ternarysolo has joined #crystal-lang
21:19
ternarysolo has quit [Ping timeout: 245 seconds]
21:46
oprypin has joined #crystal-lang
21:59
marmotini_ has joined #crystal-lang
23:03
marmotini_ has quit [Ping timeout: 250 seconds]
23:20
shmibs has quit [Quit: leaving =o]
23:20
shmibs has joined #crystal-lang
23:39
ashirase has joined #crystal-lang
23:50
ternarysolo has joined #crystal-lang