<FromGitter>
<Blacksmoke16> nice was able to do some refactoring, brought compile time for specs down from 27s to 5s
<FromGitter>
<Blacksmoke16> big unions are bad ok
<FromGitter>
<Blacksmoke16> say i have a `Regex` constraint, and you want to validate a non string value what would you think is most ideal:
<FromGitter>
<Blacksmoke16> 1) Cast the value to a string ⏎ 2) Throw an exception (because it has to be a string)
<FromGitter>
<Blacksmoke16> 1) Noop
_whitelogger has joined #crystal-lang
<FromGitter>
<Blacksmoke16> i think im leaning towards 1, prob would pair well with custom `to_s` methods and such
_whitelogger has joined #crystal-lang
kotrcka has joined #crystal-lang
deavmi has quit [Ping timeout: 240 seconds]
deavmi has joined #crystal-lang
f1refly has joined #crystal-lang
f1reflyylmao has quit [Ping timeout: 260 seconds]
_whitelogger has joined #crystal-lang
<FromGitter>
<mattrberry> Anyone have any feedback/criticism for my bitfield macro? It's my first macro that's more than a couple lines. At the moment it accomplishes everything that I wanted it to, but I'd love to know if there's anything that I could be doing better! https://github.com/mattrberry/bitfield
<FromGitter>
<mattrberry> One thing I'd like to add is the ability to override the setters on the inheriting classes, but I'm not sure that that's possible in my current implementation since I add the methods in the `finished` macro..
<FromGitter>
<mattrberry> I also plan on adding a to_s method sometime soon :)
_whitelogger has joined #crystal-lang
_whitelogger has joined #crystal-lang
<FromGitter>
<grkek> How do I get the name of the class?
<FromGitter>
<naqvis> > i think im leaning towards 1, prob would pair well with custom `to_s` methods and such ⏎ ⏎ I would have gone with 2, as library shouldn't make assumptions about user. If user is not utilizing api in a way its designed, it should let the user know that. just my two cents :P
<FromGitter>
<naqvis> @Blacksmoke16 👆
alexherbo20 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 256 seconds]
alexherbo20 is now known as alexherbo2
<raz>
i think it depends on whether the object to be validated will always be passed in explicitly or not.
<raz>
if i pass in `foo` then i don't want to be surprised by the library casting it around (if i want it to be treated as string, i'll pass in `foo.to_s`)
<raz>
otoh if String is the only value-type that can make sense, and i get a solid compile-time error when i pass something wrong, hard-wiring it can also make sense
sorcus has quit [Quit: WeeChat 2.9]
sorcus has joined #crystal-lang
repo has joined #crystal-lang
repo has quit [Ping timeout: 272 seconds]
<FromGitter>
<Blacksmoke16> its a tricky thing, i can do an error but it would be a runtime error
<FromGitter>
<Blacksmoke16> i imagine most of the time people would be interacting with the annotation API, so having this happen automatically would allow you to do like
<FromGitter>
<Blacksmoke16> as the `uri` object would be passed in, turned into the string representation of it, and validated
<FromGitter>
<Blacksmoke16> plus i dont really think there's some common sense involved, like why would you be trying to assert `foo` is an `Email`?
<FromGitter>
<Blacksmoke16> i think there is some common sense involved*
yxhuvud has quit [*.net *.split]
bougyman has quit [*.net *.split]
maxpowa has quit [*.net *.split]
badeball has quit [*.net *.split]
bougyman has joined #crystal-lang
maxpowa has joined #crystal-lang
yxhuvud has joined #crystal-lang
badeball has joined #crystal-lang
ua has quit [Remote host closed the connection]
zorp has joined #crystal-lang
<FromGitter>
<maxbertinetti> @jgillich @faustinoaq @kofno can you please remove your plugins from VS Code Marketplace? ⏎ As said also by @asterite on the Forum actually the Marketplace is a mess of obsolete Crystal plugins. ⏎ Removing them will make it simple for beginner find the right one. ⏎ Also, anyone can contribute to the one on crystal-language-tool organisation (https://crystal-lang-tools.github.io/)
alexherbo2 has quit [Read error: Connection reset by peer]
alexherbo28 is now known as alexherbo2
alexherbo2 has quit [Ping timeout: 272 seconds]
alexherbo2 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 246 seconds]
alexherbo2 has joined #crystal-lang
alexherbo21 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 246 seconds]
alexherbo21 is now known as alexherbo2
HumanGeek has joined #crystal-lang
Human_G33k has quit [Ping timeout: 264 seconds]
deavmi has quit [Read error: Connection reset by peer]
deavmi has joined #crystal-lang
ua has joined #crystal-lang
<FromGitter>
<Nicolab> @maxbertinetti Just for info, the @faustinoaq plugin works a bit for me. Yours doesn't. I will test with Crystalline but it is possible that others will have the same result.
<FromGitter>
<Daniel-Worrall> +1
Nekka has quit [Read error: Connection reset by peer]