<bmcginty>
I'm wondering if I've found a bug in Crystal. If you use gets with a delimiter of type char, and a max size, the gets call seems to read past your max size. Not sure if this is supposed to happen though?
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
pawnbox has joined #crystal-lang
onethirtyfive has joined #crystal-lang
pawnbox has quit [Ping timeout: 268 seconds]
onethirtyfive has quit [Ping timeout: 250 seconds]
ruby_ has joined #crystal-lang
pawnbox has joined #crystal-lang
Philpax has quit [Ping timeout: 268 seconds]
pawnbox has quit [Ping timeout: 260 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 250 seconds]
Philpax has joined #crystal-lang
havenwood has quit [Remote host closed the connection]
havenwood has joined #crystal-lang
havenwood has quit [Changing host]
havenwood has joined #crystal-lang
pawnbox has joined #crystal-lang
havenwood has quit [Read error: Connection reset by peer]
havenwood has joined #crystal-lang
havenwood has quit [Changing host]
havenwood has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
kulelu88 has quit [Quit: Leaving]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 250 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
onethirtyfive has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
ryanf_ is now known as ryanf
Philpax has quit [Ping timeout: 268 seconds]
eizua has joined #crystal-lang
Philpax has joined #crystal-lang
<crystal-gh>
[crystal] dukex opened pull request #3409: add support to many html entities (master...add-support-to-all-html-entities) https://git.io/vPECt
matp has quit [Read error: Connection reset by peer]
matp has joined #crystal-lang
tilpner has quit [*.net *.split]
tilpner has joined #crystal-lang
Philpax has quit [Ping timeout: 248 seconds]
onethirtyfive has quit [Remote host closed the connection]
<FromGitter>
<raydf> String and nil doesn't have an each method and that's why there's a compilation error.
<FromGitter>
<raydf> @wmoxam, try this example with generics, the compiler will help you to detect invalid calls to foo method: ⏎ https://play.crystal-lang.org/#/r/1bs2
<FromGitter>
<raydf> @wmoxam, sorry i was misleading you. The correct answer: ⏎ https://play.crystal-lang.org/#/r/1bs6 ⏎ You'll need to use local variables before restricting the then scope of the if.
pawnbox has joined #crystal-lang
superobservation has joined #crystal-lang
<superobservation>
here to learn and observe
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
pawnbox has quit [Ping timeout: 248 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 250 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 248 seconds]
braidn has quit [Ping timeout: 240 seconds]
g3funk has joined #crystal-lang
jamie-discord3 has quit [Read error: Connection reset by peer]
zatherz has joined #crystal-lang
<zatherz>
hey, is there any way to load an arbitrary crystal script at runtime?
<zatherz>
like a way to compile it into some sort of library form
<FromGitter>
<raydf> like a javascript runtime?
<FromGitter>
<raydf> @zatherz?
<zatherz>
I've never really written in javascript so I'm not sure. what I mean is that I want to have the program load "plugins" from a special directory
<zatherz>
and I don't want the user to have to recompile
<zatherz>
the whole thing every single time they change something
<FromGitter>
<raydf> shards doesn't recompile on changes of the main app
<FromGitter>
<raydf> but i'm almost sure is better to use shards if plugins doesn't change a lot.
<zatherz>
uh
<zatherz>
I don't want to use javascript lol
<FromGitter>
<raydf> :)
<FromGitter>
<raydf> for crystal you'll need to compile it.
<zatherz>
does crystal have some sort of library with an API for compiling?
<FromGitter>
<raydf> what you want is dynamically loaded libraries.
<zatherz>
yeah
<FromGitter>
<raydf> dynlibs in mac and so in linux
<FromGitter>
<raydf> crystal doesn't have this feature yet.
<FromGitter>
<raydf> if you make the library in c you can use it with a crystal wrapper.
djellemah has joined #crystal-lang
bjz has joined #crystal-lang
mark_66 has joined #crystal-lang
pawnbox has joined #crystal-lang
bjz has quit [Read error: Connection reset by peer]
bjz 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
mark_66 has quit [Ping timeout: 240 seconds]
trajing has quit [Ping timeout: 240 seconds]
RX14 has quit [Ping timeout: 240 seconds]
mjblack has quit [Ping timeout: 240 seconds]
early` has quit [Ping timeout: 240 seconds]
_whitelogger has joined #crystal-lang
superobservation has quit [*.net *.split]
onethirtyfive has quit [*.net *.split]
Yxhuvud has quit [*.net *.split]
mose has quit [*.net *.split]
jamie_ca has quit [*.net *.split]
foca has quit [*.net *.split]
elomatreb has quit [*.net *.split]
oddmunds has quit [*.net *.split]
grindhold has quit [*.net *.split]
endou has quit [*.net *.split]
avdi has quit [*.net *.split]
bazaar has quit [*.net *.split]
pawnbox has quit [*.net *.split]
sandelius has quit [*.net *.split]
dom96 has quit [*.net *.split]
ryanf has quit [*.net *.split]
onionhammer1 has quit [*.net *.split]
Tophe_ has quit [*.net *.split]
rkeene has quit [*.net *.split]
swav has quit [*.net *.split]
leex has quit [*.net *.split]
badeball has quit [*.net *.split]
leafybasil has quit [*.net *.split]
m94asr has quit [*.net *.split]
coderobe has quit [*.net *.split]
jokke has quit [*.net *.split]
BlaXpirit has quit [*.net *.split]
fedruantine has quit [*.net *.split]
justinmcp has quit [*.net *.split]
pleiosaur has quit [*.net *.split]
dzv_ has quit [*.net *.split]
bjmllr has quit [*.net *.split]
CompanionCube has quit [*.net *.split]
ssvb has quit [*.net *.split]
Papierkorb has quit [*.net *.split]
Raimondi has quit [*.net *.split]
g3funk has quit [*.net *.split]
eizua has quit [*.net *.split]
ruby_ has quit [*.net *.split]
jadams has quit [*.net *.split]
rtl has quit [*.net *.split]
adam12 has quit [*.net *.split]
gewo has quit [*.net *.split]
bjz has quit [*.net *.split]
tliff has quit [*.net *.split]
bmcginty has quit [*.net *.split]
wmoxam has quit [*.net *.split]
_jungh4ns has quit [*.net *.split]
pabs has quit [*.net *.split]
zatherz has quit [*.net *.split]
soveran has quit [*.net *.split]
tilpner has quit [*.net *.split]
kiliankoe has quit [*.net *.split]
Majost has quit [*.net *.split]
aemadrid has quit [*.net *.split]
mroth has quit [*.net *.split]
Guest37817 has quit [*.net *.split]
greenbigfrog has quit [*.net *.split]
Kilo`byte has quit [*.net *.split]
djellemah has quit [*.net *.split]
matp has quit [*.net *.split]
havenwood has quit [*.net *.split]
willl has quit [*.net *.split]
yossarian has quit [*.net *.split]
x0f has quit [*.net *.split]
DeBot has quit [*.net *.split]
guilleiguaran__ has quit [*.net *.split]
vifino has quit [*.net *.split]
danzilio_ has quit [*.net *.split]
nickc2 has quit [*.net *.split]
jhass has quit [*.net *.split]
Liothen has quit [*.net *.split]
dostoyevsky has quit [*.net *.split]
[spoiler] has quit [*.net *.split]
pataphysics has quit [*.net *.split]
emmanueloga has quit [*.net *.split]
jfontan has quit [*.net *.split]
maxpowa has quit [*.net *.split]
aarongodin has quit [*.net *.split]
go|dfish has quit [*.net *.split]
txdv has quit [*.net *.split]
miketheman has quit [*.net *.split]
daemonwrangler has quit [*.net *.split]
jeromegn has quit [*.net *.split]
pabs has joined #crystal-lang
greenbigfrog has joined #crystal-lang
Guest37817 has joined #crystal-lang
rkeene has joined #crystal-lang
x0f has joined #crystal-lang
nickc2 has joined #crystal-lang
vifino has joined #crystal-lang
guilleiguaran__ has joined #crystal-lang
pataphysics has joined #crystal-lang
maxpowa has joined #crystal-lang
ponga has quit [Ping timeout: 256 seconds]
jwaldrip has quit [Ping timeout: 256 seconds]
ponga has joined #crystal-lang
jwaldrip has joined #crystal-lang
bjz has joined #crystal-lang
djellemah has joined #crystal-lang
onethirtyfive has joined #crystal-lang
onethirtyfive has quit [Ping timeout: 248 seconds]
optikfluffel has joined #crystal-lang
optikfluffel has quit [Client Quit]
optikfluffel has joined #crystal-lang
optikfluffel has quit [Client Quit]
optikfluffel has joined #crystal-lang
optikfluffel has quit [Client Quit]
optikfluffel has joined #crystal-lang
optikfluffel has quit [Client Quit]
optikfluffel has joined #crystal-lang
optikfluffel has quit [Client Quit]
optikfluffel has joined #crystal-lang
optikfluffel has quit [Client Quit]
trapped has joined #crystal-lang
trapped has quit [Read error: Connection reset by peer]
trapped has joined #crystal-lang
pawnbox has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
pawnbox_ has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
optikfluffel has joined #crystal-lang
pawnbox_ has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
Nik736 has joined #crystal-lang
Nik736 has quit [Client Quit]
<wmoxam>
Thanks @raydf
michael_campbell has joined #crystal-lang
michael_campbell has left #crystal-lang ["*"]
michael_campbell has joined #crystal-lang
<michael_campbell>
Is there some setting about this channel that makes the background a different color than all my other channels, or is it my IRC client?
<BlaXpirit>
michael_campbell, background of what exactly...?
djellemah has quit [Ping timeout: 240 seconds]
<BlaXpirit>
it could be so many things, like the only channel (not) having unread messages, or even the currently active channel lol
<BlaXpirit>
or maybe you mean nicknames of people here
<michael_campbell>
the background of the entire pane where messages show. For #crystal-lang, it's white with black text. Every other channel is dark grey with light grey text. Never had that happen before.
<michael_campbell>
very weird.
<BlaXpirit>
weird indeed
<BlaXpirit>
michael_campbell, it could be the only channel you have without the "collors not allowed" mode (C)
<BlaXpirit>
michael_campbell, you can try out #pocoo , which is just a random channel that also allows colors, to check this theory
djellemah has joined #crystal-lang
<michael_campbell>
it's the same as #crystal-lang
<michael_campbell>
I work in a "dim" environment, so the all white backgrounds are not just garish, but eye-strain-y
<BlaXpirit>
michael_campbell, well fix the color scheme in ur client. it explicitly says that the background is white so that text colors look as intended on it
<michael_campbell>
It is fixed, on every other channel I am in but this one =) Not sure where to look, but will do some digging.
<michael_campbell>
<sigh> Solved, I think. I changed "theme" on the client, and it changed this channel to the new theme. Changed back to my original, and it changed as well. Buggy software/user error. Thanks for your patience.
<michael_campbell>
Ok, so ... to crystal. Is "kemal" the framework of choice for a low volume, rapid development REST-y type service? Happened across it yesterday and since I'm familiar with Sinatra, looks very similar and nice to use. Or is another framework popular?
<michael_campbell>
I like Kemal's websocket support, too.
<BlaXpirit>
sure, se kemal
<BlaXpirit>
use
mark_66 has joined #crystal-lang
mark_66 has quit [Ping timeout: 240 seconds]
mark_66 has joined #crystal-lang
mark_66 has quit [Client Quit]
mark_66 has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<FromGitter>
<sdogruyol> @michael_campbell it's not for low volume, quite contrary for high traffic services
<michael_campbell>
Sorry, I didn't mean to mischaracterize it as that; I just meant that MY use case is low volume, and would it be ok for a rapid development type thing. Some things work ok at prototyping, some don't.
<michael_campbell>
You *can* prototype a service in J2EE, but you damn sure don't want to. ;-)
pawnbox has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
zatherz has joined #crystal-lang
ua has joined #crystal-lang
<ua>
hi
<FromGitter>
<sdogruyol> @michael_campbell oh i see
<FromGitter>
<sdogruyol> @ua hey
<ua>
is there a gem that allows to use compiled crystal code from ruby?
<ua>
if not i propose a name 'meth' for it
<Papierkorb>
Call it `rhodes`. that guy's tall enough to stand with each foot in crystal and ruby
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
optikfluffel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
snsei has joined #crystal-lang
soveran has quit [Remote host closed the connection]
optikfluffel has joined #crystal-lang
mark_66 has quit [Remote host closed the connection]
<FromGitter>
<TheLonelyGhost> I'm having some difficulty with documentation on linking C++ libs with Crystal. Anyone have docs or example code to help?
<FromGitter>
<TheLonelyGhost> I'm looking at ddefreyne's new Glove library as an example currently, but it appears to only apply to MacOS...?
<FromGitter>
<TheLonelyGhost> Eventually I'd love to integrate a library that doesn't have a pkg-config file included, but I'd be happy to step back and use an easier example to learn the underlying concepts
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
<zatherz>
if matchdata.begin return cut_off(input, matchdata.begin) else raise "Parsing failed!" end
<zatherz>
compiler error: "no overload matches 'Coredq::Tokenizer#cut_off' with types String, (Int32 | Nil)"
<FromGitter>
<johnjansen> this is not a final solution, but the error is telling you *i think* that your match data might be nil
<FromGitter>
<raydf> if you don't need them use ⏎ matchdata.try &.begin
<FromGitter>
<johnjansen> you need to be more defensive
<zatherz>
no it's definitely about .begin
<zatherz>
I haven't posted the whole output
<zatherz>
and I have an `if matchdata` before that
<FromGitter>
<johnjansen> i dont know what Coredq::Tokenizer is, but cut_off wants a specific type, and the compiler thinks it isnt getting a the same type passed to it on all occasions, the second type can sometimes be Nil
<FromGitter>
<johnjansen> your trap `if matchdata` ensures that matchdata exists, but doesn’t guarantee the non-nilness of matchdata.begin
<zatherz>
why doesn't the `if matchdata.begin` work though?
<zatherz>
neither did `if !matchdata.begin.nil?` work
<FromGitter>
<raydf> zatherz try ⏎ if matchdata.try &.begin
<zatherz>
nope
<zatherz>
same thing
<FromGitter>
<raydf> maybe create a play.crystal-lang.org example ?
<FromGitter>
<raydf> this way we could see if it's a bug.
<FromGitter>
<johnjansen> @raydf the `begin` is a method, so it should also be captured, such that you only call it once so it has a fixed type through the block
<FromGitter>
<raydf> yeah, in my example i tested how the mutability could return the result to nil :) after you're inside the then part of the if.
<FromGitter>
<johnjansen> right on
pawnbox_ has quit [Remote host closed the connection]
soveran has quit [Remote host closed the connection]
havenwood has joined #crystal-lang
havenwood has joined #crystal-lang
havenwood has quit [Changing host]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
<FromGitter>
<johnjansen> check the source ⏎ property! # Defines raise-on-nil property methods for each of the given arguments ⏎ property? # Defines query property methods for each of the given arguments. ⏎ property # Defines property methods for each of the given arguments. ⏎ ... [https://gitter.im/crystal-lang/crystal?at=57fd25f30aa72e3c5bf308f4]
soveran has quit [Ping timeout: 260 seconds]
fryguy9 has joined #crystal-lang
<crystal-gh>
[crystal] Val opened pull request #3411: Add workaround to handle zero sized files in /proc (master...proposed_fix_for_#3410) https://git.io/vPux9
djellemah has joined #crystal-lang
ua has quit [Quit: Leaving]
trapped has quit [Quit: int random { /* ensure randomness */ return 3; }]
hello_ has joined #crystal-lang
hello_ has quit [Client Quit]
zatherz has quit [Ping timeout: 260 seconds]
ponga has quit [Quit: Connection closed for inactivity]
kulelu88 has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 248 seconds]
djellemah has quit [Ping timeout: 260 seconds]
zatherz has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
soveran has joined #crystal-lang
bjz has joined #crystal-lang
pawnbox has joined #crystal-lang
soveran has quit [Ping timeout: 260 seconds]
pawnbox has quit [Ping timeout: 265 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 250 seconds]
matp has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]