What about having two bits of syntax, current-filename and current-file-path? Or better yet, current-filename and current-file-directory, with the guarantee that (string-append (current-file-directory) path-separator (current-filename)) points to the file when it was compiled?
It is more intuitive to me that (current-filename) would return only the file name, with no other path components, and that I would use some other form to get those. Noah On Sun, Feb 19, 2012 at 4:23 PM, Andy Wingo <[email protected]> wrote: > On Sun 19 Feb 2012 22:02, [email protected] (Ludovic Courtès) writes: > >>> See Neil's use case here: >>> >>> http://thread.gmane.org/gmane.lisp.guile.devel/13440/focus=13621 >>> >>> Can we do something that makes sense for both cases? >> >> Well, (add-to-load-path (dirname (canonicalize-path (current-filename)))) ? >> >> Yes it’s verbose, but it’s predictable and clearly specified. > > It's terribly verbose, IMO. If we can do something better for those > users, we should. What did you think of my other suggestion about > searching for the file in the load path, and only canonicalizing if it > was not found in the load path? (If it is found in the load path, then > it would be returned in its relative form.) > > Andy > -- > http://wingolog.org/ >
