You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In 03_numbers.ex there is a koan for checking for range
koan"Is this a range?"doassertRange.range?(1..10)==___assertRange.range?(0)==___end
Range.range?/1 is deprecated.
This is a kind of a hard to replace because of the learning path. Behind the scenes a Range is a struct. But pattern matching and structs don't get "taught" until later in the koan journey.
But I'm not sure if this really helps learn "check if it's a range". It might make more sense to remove this specific koan from 03_numbers.ex and move a modified version to pattern matching or structs.
I think moving it to structs or pattern matching could makes more sense.
koan"A Range is also a struct"do%Range{first: first,last: last}=1..10assertfirst==___# 1assertlast==__# 10end
A few other ideas to check for a range: match?(%Range{}, 1..10) Range{} = Range.new(1, 10) %Range{} = 1..10
Or that specific koan could be removed, which I don't see as harmful to the learning path.
The text was updated successfully, but these errors were encountered:
Thanks for the report! It's probably high time that some of the maintainers give a run through the Koans to think about the journey again. It's hard to intuit these types of reports without fresh experience with the flow itself. I suspect your intuition is spot on.
I ended up fixing the deprecation warning in #253 by adding a couple of helper functions in order to keep the existing koan. I guess it hints at the Range struct without potentially getting in the way of the learning path?
In
03_numbers.ex
there is a koan for checking for rangeRange.range?/1
is deprecated.This is a kind of a hard to replace because of the learning path. Behind the scenes a Range is a struct. But pattern matching and structs don't get "taught" until later in the koan journey.
Could replace the equality check with:
But I'm not sure if this really helps learn "check if it's a range". It might make more sense to remove this specific koan from
03_numbers.ex
and move a modified version to pattern matching or structs.I think moving it to structs or pattern matching could makes more sense.
A few other ideas to check for a range:
match?(%Range{}, 1..10)
Range{} = Range.new(1, 10)
%Range{} = 1..10
Or that specific koan could be removed, which I don't see as harmful to the learning path.
The text was updated successfully, but these errors were encountered: