Im not sure if you missed my question at the end. With this piece of code
{$ELSEIF TOFFEE}
var isDirectory := false;
result := NSFileManager.defaultManager.fileExistsAtPath(mapped) isDirectory(var isDirectory) and not isDirectory;
{$ELSEIF ECHOES}
is it ok to do {$ELSEIF DARWIN} instead rather than going into the ISLAND section ?
if the Toffee implementation is is using pure Cocoa Apis, either would be fine, yes. In most cases (such as this one, if it were implemented ;), the Island FRTL version would probably use the same API that the TOFFEE define does.
so the above could be written with IF DARWIN instead of IF TOFFEE, and work. it comes down to (admittedly academic) consistency, I suppose. Would we rather have the same code path for all island platforms, or the same code path for all Cocoa platforms (even iff it then differs between Island/Darwin vs the other Island platforms.
If all the abstractions are implemented 100% perfect; it should make no difference to the end user; bt for cases where there are leaky abstractions, it might. Say, if Island RTL implemented Exists on its down and it differed subtly (a stretch for a function as simple as this one, but go with it). That’d be a bug, but would we rather have not broken between Island/Darwin vs Island/Windows (say), or consistent for Island, but broken between Island and Toffee?