<FromGitter>
<Daniel-Worrall> Windows support would be very handy for me since I primarily develop from Windows (gamer luls) and I wish to distribute client facing apps to Windows users
<hightower3>
Certainly, Windows support would be amazing. Not for me personally, but seeing that PHP and Python work on Windows... :)
DTZUZU is now known as toxix
<FromGitter>
<ImAHopelessDev_gitlab> @Daniel-Worrall why not just use electron? you can distribute to every platform
deavmi has quit [Ping timeout: 240 seconds]
<FromGitter>
<Daniel-Worrall> Because I like crystal?
<FromGitter>
<ImAHopelessDev_gitlab> :D
<FromGitter>
<ImAHopelessDev_gitlab> i forgot /s srry
duane has quit [Ping timeout: 264 seconds]
duane has joined #crystal-lang
deavmi has joined #crystal-lang
<FromGitter>
<3n-k1> i'm getting `Error: undefined macro method 'Call#inspect'` on this code: `temp = {% x.inspect %}` ⏎ but the api docs for macro say it inherits the inspect method
<FromGitter>
<3n-k1> "instance methods inherited from object"
<FromGitter>
<Blacksmoke16> Mm yea I dunno if that's totally accurate
<FromGitter>
<3n-k1> oh i bet i want stringify
<FromGitter>
<Blacksmoke16> Just do pp x
<FromGitter>
<3n-k1> i don't wanna print it tho
<FromGitter>
<Blacksmoke16> Oh ok
<FromGitter>
<3n-k1> sounds like the issue is the docs for macro are for a fictional package, and so the documenation generator just assumes it must inherit from object even though it doesn't
<FromGitter>
<Blacksmoke16> That sounds about right
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 260 seconds]
<FromGitter>
<3n-k1> is there a way to restrict the type of a macro argument?
<FromGitter>
<Blacksmoke16> no but you can do like `{% raise "Value should be a String" unless value.is_a? StringLiteral %}`
<FromGitter>
<3n-k1> coolio ty
<FromGitter>
<3n-k1> i love that you're basically just my crystal mentor right now haha
<FromGitter>
<Blacksmoke16> things get slower in US tz :p
<FromGitter>
<3n-k1> i don't know what it says about me that i'm currently in the us
<FromGitter>
<3n-k1> also, seems that line doesn't work for an enum
<FromGitter>
<Blacksmoke16> got some example code?
<straight-shoota>
We're missing a proper guide to stdlib unfortunately
hightower4 has quit [Ping timeout: 256 seconds]
toxix is now known as DTZUZU
Nekka has quit [Ping timeout: 246 seconds]
<raz>
hmm, a minor thing that i keep bumping into: ''. do we really need these single-purpose, c-style single quotes?
Nekka has joined #crystal-lang
<FromGitter>
<j8r> for chars?
<raz>
yea
<raz>
like how often do people need a literal char? i use it like once a month maybe. but bump into accidental single-quoted strings all the time when switching between ruby and crystal
<FromGitter>
<j8r> no, you can use `97.unsafe_chr` if you prefer haha
<raz>
well yea, i'd be happy to do that if i can then use single quotes for strings :p
<FromGitter>
<j8r> always use double everywhere
<raz>
on my keyboard a double quote takes twice the work!
<FromGitter>
<j8r> that's a convention
<FromGitter>
<j8r> maybe, there will always have some guy with an exotic keyboard to have a similar issue
<raz>
i'm not sure i'd call US-layout exotic :p
<FromGitter>
<j8r> trlol :3
<FromGitter>
<j8r> that's not that problematic
<FromGitter>
<j8r> then never use caps
<straight-shoota>
raz, yeah I've run into that as well
<straight-shoota>
But nowadays it doesn't even make a difference in Ruby, so you could just get used to double everywhere
<FromGitter>
<j8r> Use Azerty - problem solved, and 100 more created
<FromGitter>
<j8r> haha
<raz>
yup, but ruby convention is the exact opposite
<straight-shoota>
Almost every language uses double quotes
<FromGitter>
<j8r> what would you use for char literals then?
<raz>
well, the two ones i use the most (ruby and JS) don't
<raz>
97.chr
<FromGitter>
<Blacksmoke16> PHP doesnt, `'` is still for non interpolation, but both work :shrug:
<raz>
i mean really how often do you need that?
<straight-shoota>
ruby and JS also use double quotes
<straight-shoota>
but you can use singles as well
<FromGitter>
<3n-k1> i'm amazed y'all are talking about keyboard layouts and nobody mentioned dvorak lol
<raz>
yup, most people i know just default to singles cause it's easier to type, slightly cleaner on the eyes
<straight-shoota>
great to have you help out =)
<FromGitter>
<j8r> or Bepo @3n-k1
<FromGitter>
<j8r> dvorak is quite good
<raz>
where is the single quote on dvorak?
* raz
imagines it to involve a foot pedal
<FromGitter>
<j8r> designing a language around the US QWERTY sounds to be a bad idea
<straight-shoota>
a foot pedal could be the solution to your problem
<FromGitter>
<3n-k1> i'm sure it involves playing beethoven on a piano, and dvorak proponents will say it makes sense
<straight-shoota>
just configure it to double quote character
<straight-shoota>
and you could use a font that displays double quotes as singles
<FromGitter>
<3n-k1> i have a friend who types like 30 wpm on a normal us-layout because he's so used to dvorak lol
<FromGitter>
<j8r> or speech to text, when you say "quotes" quotes will be written :)
<FromGitter>
<Blacksmoke16> im sure you could switch the key, i.e. shift + ' == "
<raz>
great idea with the font. so i don't even see when i got it wrong until the compiler barfs at me :p
<FromGitter>
<Blacksmoke16> er == `'`
<raz>
but i might actually try to map ' to " in my editor hmm
<straight-shoota>
well the font would obviously show something else for single quotes
<straight-shoota>
maybe a little kitten
<FromGitter>
<j8r> raz: map " to ' and ' to " ?
<straight-shoota>
to bad you won't see any of them
<raz>
j8r: no, only ' to ". only for crystal files since i pretty much never need ' there
<FromGitter>
<j8r> maybe, replacing double ' to " with a `sed` command?
<raz>
and then i'll get a midi foot pedal for when i actually need a literal char
<raz>
well, sed is too rough. that would surely break that one file in my codebase that actually has a char ¯\_(ツ)_/¯
<FromGitter>
<j8r> noo
<FromGitter>
<j8r> because double simple quote one after another
<raz>
straight-shoota: ha, my laptop has a touchbar. this could actually finally become useful
<raz>
just a full-width single-quote button
<FromGitter>
<Blacksmoke16> i know that works for like `should_not be_nil`, but i dont remember if that case was also supported...
<FromGitter>
<Simerax> @Blacksmoke16 Nice that works!
<FromGitter>
<Blacksmoke16> 👍
<FromGitter>
<Blacksmoke16> or maybe `var.should(be_a(TypeX)).tap &.flag.should(be_true)` :S
<straight-shoota>
raz: But honestly, I see the point about char literals not being very useful. Unless you're writing a parser or some data format implementation, you're unlikely to need one.
<straight-shoota>
It's too late to change the syntax now.
<FromGitter>
<Simerax> i think i'll stick with the first one its clear and easy :P
<straight-shoota>
And having double and single do the same thing would be like an alias, so a big NO in Crystal :D
<straight-shoota>
Except that there are about a dozen different string literals ¯\_(ツ)_/¯
<raz>
yup, that's how i see it, too. there's certain types of code where you need lots of chars (protocol parsers indeed). but i find those very rare.
<straight-shoota>
A nice alternative syntax for char literals could be similar to number literals, like `0cA`
<oprypin>
what no
<straight-shoota>
It's not even more to write and makes it clear that it's something different than a string
<straight-shoota>
Just talking crazy ideas, opryping. Not gonna happen