Throwaway comment in Hazrat p105: Observe that Range[10]/.{x_,y___}->y/x amounts to 10!
I can't for the life of me figure out how this works.
It seems to resolve to Sequence[2,3,4,5,6,7,8,9]/1 which then defaults to Times[2,3,4,5,6,7,8,9]/1 which seems like odd behaviour.
I checked the documentation but this doesn't resemble their examples of a sequence being ready to splice into another function.
Any comments?
Range[10] /. {x_, y___} -> FullForm[HoldComplete[y/x]]. In general, when in doubt as to how things are evaluated, look at itsFullForm[]. $\endgroup$Sequence[2,3,4,5,6,7,8,9]/1is reallyTimes[Sequence[2,3,4,5,6,7,8,9], Power[1, -1]]behind the scenes, which is the same asTimes[2,3,4,5,6,7,8,9, Power[1, -1]]. The point is thata/b // FullFormisTimes[a, Power[b, -1]]. $\endgroup$