Best thing to do is load up crystal play and play around with stuff.
For really small examples.
Stephan Langeveld
@Fanna1119
whats the difference between block one and 2 ?
1.upto(100) do |x|
puts x
end
1.upto(100) {|x| puts x}
Kent 'picat' Gruber
@picatz
Basically a do can be a { and a end can be a }.
So, my understanding is, basically nothing.
Stephan Langeveld
@Fanna1119
@picatz ahh thank you :), coming from a non ruby background. i am still in the phase where i don't what works and what doesn't as well as not sure what is the "right" way of doing some things just yet haha
Kent 'picat' Gruber
@picatz
No worries :+1:
I don't mind helping out, at least as much as I can :joy:
cevarief
@cevarief
Is it possible to call a class without instantiating but still keep overloading?
cevarief
@cevarief
yes possible
But it should be all using self. Can self call non self method?
when you use a c binding in crystal and compile your crystal file, is the c library included into the compilation ?
ShalokShalom
@ShalokShalom
@picatz somebody here told and link me, that there is actually a difference between {} and do/end
ShalokShalom
@ShalokShalom
Papierkorb: I just read your line "Though I'm currently most interested in Widgets, as they're the definitive source of correct native look n' feel" again and realised, that there is stuff like Kirigami, which provides a native look n`feel standard for QML: https://dot.kde.org/2017/08/02/plasma-rocks-akademy
Its a Tier1 as told, so works without any other KDE framework. :)
From IRC (bridge bot)
@FromIRC
<Groogy>@Fanna1119 yes if it is a statically linked library I think it is?
<Groogy> but if it is a shared library it will onmly contain the code to dynamically link with it
_
@Fanna1119, I'm a bot, bleep, bloop. I relay messages between IRC (#crystal-lang on chat.freenode.net) and here
Stephan Langeveld
@Fanna1119
@FromIRC just to clarify, a shared a library is usually ".so", and statically linked is .o ?
or do i have it backwards haha
From IRC (bridge bot)
@FromIRC
<Groogy> statically linked is .a on Linux at least
<Groogy> it's an archive of object(.o) though
<Groogy> but I am not 100% sure because I haven't tried linking statically with Crystal yet
Rubi
@codenoid
agree
schoening
@schoening
should modules start with an uppercase?
Bar Hofesh
@bararchy
It seems that read_timeout and write_timeout does not work for pipes
@vegai thank you, crystal has it all specified nicely. I was actually trying to ask in the typescript room :p
From IRC (bridge bot)
@FromIRC
<vegai> :}
Bar Hofesh
@bararchy
Can I cast an Array(UInt8) to Slice(UInt8) ?
Ghost
@ghost~55586c4815522ed4b3e08557
You should be able to do #to_slice on it
Bar Hofesh
@bararchy
@bew Error in line 3: undefined method 'to_slice' for Array(UInt8)
From IRC (bridge bot)
@FromIRC
<Papierkorb>@bew, that never went through lul
Bar Hofesh
@bararchy
So... no way I guess right ?
Ghost
@ghost~55586c4815522ed4b3e08557
Huh right not defined... Why? Idk
Well, could do Slice.new(arr.to_unsafe, arr.size) but it's not pretty..
Bar Hofesh
@bararchy
Better then nothing
:)
kipar
@konovod
There was a discussion about it. @asterite said that Slice is supposed to be safe, but Array.to_slice isn't safe at all - array can be reallocated after this call, making slice bad. So creating slice should be ugly)
From IRC (bridge bot)
@FromIRC
<Papierkorb>cough StaticArray
kipar
@konovod
for StaticArray there is to_slice as it's safe. But their usage is of course limited. Size can't be too big etc