Suppose you have these files:
and suppose both b.saw and c.saw do include_once "../a/a.saw", and c.saw also includes b.saw.
Then from the perspective of c.saw the path of a.saw is ../a/a.saw, but from the perspective of b.saw the path is ../b/../a/a.saw, because we try to make includes relative to where they're included from. But include_once just looks at the path strings, and they're different, so this doesn't work as intended.
This does, however, seem like a reasonable thing to do and to want include_once to work for, so I guess we do need it to normalize paths for comparison... much as normalizing paths is annoying and generally wrong. (That or we could check the system-level file identity... but I'm not sure how you do that from Haskell or whether it's workable in Windows.)
@qsctr
Suppose you have these files:
and suppose both
b.sawandc.sawdoinclude_once "../a/a.saw", andc.sawalso includesb.saw.Then from the perspective of
c.sawthe path ofa.sawis../a/a.saw, but from the perspective ofb.sawthe path is../b/../a/a.saw, because we try to make includes relative to where they're included from. Butinclude_oncejust looks at the path strings, and they're different, so this doesn't work as intended.This does, however, seem like a reasonable thing to do and to want
include_onceto work for, so I guess we do need it to normalize paths for comparison... much as normalizing paths is annoying and generally wrong. (That or we could check the system-level file identity... but I'm not sure how you do that from Haskell or whether it's workable in Windows.)@qsctr