ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.19.4 | Fund Crystals development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
txdv has quit [Ping timeout: 244 seconds]
coderobe has quit [Read error: Connection reset by peer]
coderobe has joined #crystal-lang
txdv has joined #crystal-lang
Renich has joined #crystal-lang
shawn42 has quit [Quit: Connection closed for inactivity]
dostoyevsky has quit [Ping timeout: 250 seconds]
dostoyevsky has joined #crystal-lang
Renich has quit [Quit: leaving]
shawn42 has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 258 seconds]
snsei has joined #crystal-lang
snsei has quit [Client Quit]
matp_ has joined #crystal-lang
matp has quit [Ping timeout: 250 seconds]
Raimondi has quit [Ping timeout: 244 seconds]
Raimondi has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 260 seconds]
Raimondi has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
Raimondi has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
Philpax has quit [Ping timeout: 265 seconds]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 248 seconds]
mgarciaisaia has quit [Quit: Leaving.]
go|dfish has quit [Ping timeout: 244 seconds]
go|dfish has joined #crystal-lang
Raimondi has joined #crystal-lang
<FromGitter> <choallin> Is there a way in Crystal to instantiate an Object from a String? Something like ```string_from_trustworthy_source.constantize.new```
Raimondi has quit [Ping timeout: 244 seconds]
pawnbox has joined #crystal-lang
soveran has joined #crystal-lang
<FromGitter> <overnet> Hi @drosehn, thank you for the reply. ⏎ Could you please give me an example how would you split this regexes? ⏎ ⏎ 1) some_keyword(value_1|value_2|value_3)some_keyword_2(value_4|value_5|value_6)some_keyword_3 ⏎ 2) some_keyword(value_1|value_2|.....value_10000)some_keyword_2(value_4|value_5|.....value_200000)some_keyword_3 ... [https://gitter.im/crystal-lang/crystal?at=582d65a0e097df7575c14d48]
mark_66 has joined #crystal-lang
Raimondi has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
Raimondi has joined #crystal-lang
j2k has joined #crystal-lang
p0p0pr37 has quit [Read error: Connection reset by peer]
p0p0pr37 has joined #crystal-lang
p0p0pr37 has joined #crystal-lang
p0p0pr37 has quit [Changing host]
gloscombe has joined #crystal-lang
akwiatkowski has joined #crystal-lang
matp_ has quit [Ping timeout: 246 seconds]
j2k has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
matp has joined #crystal-lang
j2k has joined #crystal-lang
kulelu88 has joined #crystal-lang
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
<FromGitter> <raydf> @overnet, is this for full text search?
<FromGitter> <luislavena> @choallin no, as a compiled language, types needs to be known at compilation time. You can workaround that by using a `case` against the string and instantiate that constant, or build a hash as mapping for those.
<crystal-gh> [crystal] asterite pushed 3 new commits to master: https://git.io/vXHag
<crystal-gh> crystal/master be619da Ary Borenszweig: Fixed #3523: only use short block notation when stringifying a call if the arguments are the ones reserved by the language (like __arg0)
<crystal-gh> crystal/master df20bdc Ary Borenszweig: Added `@def` inside macros that takes the value of the current method. Fixes #1582
<crystal-gh> crystal/master f2854ea Ary Borenszweig: Add __END_LINE__ magic constant in default argument value. Fixes #3552
j2k has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pawnbox has quit [Ping timeout: 240 seconds]
pawnbox has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
<FromGitter> <overnet> @raydf, no, there is a description of what I am trying to implement in the yesterday's posts.
<travis-ci> crystal-lang/crystal#be619da (master - Fixed #3523: only use short block notation when stringifying a call if the arguments are the ones reserved by the language (like __arg0)): The build was broken. https://travis-ci.org/crystal-lang/crystal/builds/176689139
<DeBot> https://github.com/crystal-lang/crystal/issues/3523 (Macro yields are producing invalid code)
<FromGitter> <asterite> @overnet What are you trying to implement? What's the program?
Philpax has joined #crystal-lang
pawnbox has quit [Ping timeout: 258 seconds]
Raimondi has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vXH6f
<crystal-gh> crystal/master 381b4fd Ary Borenszweig: Reformat file
AckZ has joined #crystal-lang
<FromGitter> <overnet> @asterite read posts from yesterday, the system that I build is very complex, it is difficult to describe shortly, it is currently built with ruby, but ruby is slow in processing large regexes, I have tried crystal but crystal does not allow to use lage regexes.
<FromGitter> <luislavena> appears that final regex is 2.5MB size (or something like that)
<FromGitter> <luislavena> AFAIK default setting of PCRE is way smaller than that :smile:
pawnbox has joined #crystal-lang
j2k has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
<BlaXpirit> overnet, why would Ruby be slow in processing large regexes? there's no reason for that. maybe you should just listen to what people are saying and realize that regex is actually not usable here
<FromGitter> <overnet> @BlaXpirit have you tried to find elements from the array of strings by very, very long regex in ruby when the array contains 100000 elements? I show some samples above, could you show me please an example of how to resize these regexes, or tell me what is usable here?
<travis-ci> crystal-lang/crystal#381b4fd (master - Reformat file): The build was fixed. https://travis-ci.org/crystal-lang/crystal/builds/176698005
pawnbox has joined #crystal-lang
hako_ has joined #crystal-lang
gloscombe has quit [Ping timeout: 246 seconds]
gloscombe has joined #crystal-lang
Philpax has quit [Ping timeout: 260 seconds]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vXHyh
<crystal-gh> crystal/master 53be65d Tatsujin Chin: Add intro sort to Array (#3514)
<FromGitter> <asterite> @overnet What I mean is, if you are using such long regexes there might be a chance that it's not the correct solution for the problem
<FromGitter> <asterite> So we need to know the problem first to know if we really need a long regex as a solution
j2k has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<travis-ci> crystal-lang/crystal#53be65d (master - Add intro sort to Array (#3514)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/176714057
<DeBot> https://github.com/crystal-lang/crystal/pull/3514 (Add intro sort to Array)
hako_ has quit [Remote host closed the connection]
j2k has joined #crystal-lang
j2k has quit [Client Quit]
soveran has quit [Remote host closed the connection]
mhib has joined #crystal-lang
mhib has quit [Client Quit]
gloscombe has quit [Quit: Lost terminal]
mgarciaisaia has joined #crystal-lang
mark_66 has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 250 seconds]
mgarciaisaia has left #crystal-lang [#crystal-lang]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<maxpowa> Is there a way to use a char as a type in a yaml mapping? I seem to be getting "undefined method 'new' for Char:Class" if I try to use it as the type in the mapping...
ruby has joined #crystal-lang
ruby is now known as Guest75271
<maxpowa> example: https://carc.in/#/r/1e9q
<RX14> maxpowa, custom converter it seems
<maxpowa> ok :V
<RX14> you can PR it
<RX14> or monkeypatch it in
<FromGitter> <drosehn> @overnet -- I'd need to know more context before I'd say how I'd approach the problem. For instance, on the project where I talked about "matching the middle in one regex, and then processing the `lhs` and `rhs` afterwards", that worked because the middle regex was guaranteed to be distinctive. It was a very effective solution, but only because I knew all about the specific data I needed to parse.
<FromGitter> <drosehn> It sounds like you are tackling a large project (which is certainly a good thing to try to do in crystal), but we're not going to know what tactics to suggest if we're looking at a tiny part of the total problem. I've lived through this before, on both sides of a chat-discussion. All that happens is everyone (on both sides) will get frustrated.
hako_ has joined #crystal-lang
<FromGitter> <drosehn> "distinctive" in the sense that if (for example) the middle was the regex `(fred | barney | wilma | betty)`, I was absolutely certain that none of those words would show up in either the left-hand-side or right-hand-side of the data line.
<FromGitter> <redcodefinal> Morning Crystal Bros
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 265 seconds]
<FromGitter> <sdogruyol> @redcodefinal morning / evening
pawnbox has quit [Ping timeout: 246 seconds]
pawnbox has joined #crystal-lang
lacour has joined #crystal-lang
hako_ has quit [Read error: Connection reset by peer]
hako_ has joined #crystal-lang
<FromGitter> <jots_twitter> @overnet if you can normalize your data (strip and squeeze whitespace, downcase etc) then I think this will work much faster for you then a regex: ⏎ (if i'm understanding your problem correctly.) ⏎ ⏎ ```code paste, see link``` ⏎ ... [https://gitter.im/crystal-lang/crystal?at=582e1429e51081951edb93b3]
pawnbox has quit [Remote host closed the connection]
soveran has joined #crystal-lang
<FromGitter> <johnjansen> @sdogruyol anything like a HAML that works with kemal
w400z has joined #crystal-lang
soveran has quit [Ping timeout: 260 seconds]
<FromGitter> <jots_twitter> @johnjansen there is slang which appears similar: https://github.com/jeromegn/slang
<FromGitter> <sdogruyol> @johnjansen slang
<FromGitter> <johnjansen> thanks @jots_twitter
<FromGitter> <drosehn> @jots_twitter ... okay, how do you get gitter to show a block of code-text like that? three "`"s followed by cr?
<FromGitter> <johnjansen> yeps ;-)
<FromGitter> <jots_twitter> yes and then end it with three backticks
<FromGitter> <johnjansen> three backticks new line code new line three backticks
<FromGitter> <drosehn> Okay. thanks. that seemed likely, but I didn't want to try it and then find out I made the wrong guess!
<FromGitter> <drosehn> @overnet But to answer the question you asked: **Iff* I was **certain** that `some_keyword`, `some_keyword_2` and `some_keyword_3` could never show up except at the spots you listed, and I'll assume there is some delimiter around the keywords (such as spaces), I would:
<FromGitter> <drosehn> ```left_vals = $~[2] ⏎ right_vals = $~[4]``` ⏎ ⏎ [hrm. that didn't work!] [https://gitter.im/crystal-lang/crystal?at=582e1e43004785313cbb2917]
<FromGitter> <drosehn> [no, wait, maybe it did]
<FromGitter> <drosehn> I'd also save copies of `$~[1]`, `$~[3]` and `$~[5]` if there was more than one keyword possible for each "keyword position", and I needed to keep track of which keywords matched. That way, the regex's needed to process `left_vals` and `right_vals` could be considerably smaller than if I have everything in one huge regex. But I suspect that you'll look at this and say *"that won't work for me, due to details which I haven't told
<FromGitter> ... anyone yet!".* That's what will get both you and us frustrated.
soveran has joined #crystal-lang
<FromGitter> <drosehn> ignore the initial "cr" before the "dataline"...
<FromGitter> <drosehn> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=582e1ffbc3afa78a1e1ff0a9]
<FromGitter> <drosehn> Okay, that worked better!
soveran has quit [Remote host closed the connection]
kulelu88 has quit [Quit: Leaving]
akwiatkowski has quit [Ping timeout: 264 seconds]
miketheman has quit [Ping timeout: 256 seconds]
miketheman has joined #crystal-lang
Philpax has joined #crystal-lang