lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Behaviour of is-absolute?


From: Urs Liska
Subject: Behaviour of is-absolute?
Date: Sun, 24 Jan 2016 23:35:55 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0

Hi all,

now that is-absolute? is not broken anymore (see #4746 and #4747) I'd
like to raise the question of its *behaviour* - which seems somewhat
inconsistent to me.

Currently this function behaves differently on Windows and elsewhere,
and I think this shouldn't be the case.

is-absolute? expects a string representing a file path.
It returns true if either

it starts with a slash
or
if on Windows it starts with a drive letter.

So

(is-absolute? "/some/path")
always returns #t

but
(is-absolute? "C:\some\path")
or
(is-absolute? "C:/some/path")

returns #t on Windows but #f on Unix.

I think such a function/predicate should behave consistently, and I can
see two ways of doing so. Either it should look for both path syntaxes
so all three of the above examples return #t on all OSes. Or it should
exclusively look for the current OSes syntax, so the first example
returns #t *only* on Unix while the other return #t *only* on Windows.

Thoughts?
Urs



reply via email to

[Prev in Thread] Current Thread [Next in Thread]