mirror of
https://github.com/not-kennethreitz/convore.json.git
synced 2026-06-21 07:31:00 +00:00
1 line
3.6 KiB
JSON
1 line
3.6 KiB
JSON
[{"user_id": 32737, "stars": [], "topic_id": 36109, "date_created": 1305891775.541013, "message": "So my question is, should w/infile, etc. do the same? For instance, (w/infile x \"foo/bar.arc\" ...) should curdir be \"foo\" inside of w/infile, and reverted back when w/infile is done, just like load? I'm leaning toward yes, and here's why.", "group_id": 9739, "id": 1124496}, {"user_id": 32737, "stars": [], "topic_id": 36109, "date_created": 1305891920.539933, "message": "The downside is, if you *don't* want to change the current directory, you need to do this: (let orig curdir (w/infile x path (w/curdir orig ...))) But I think that it's far more common to want to change the directory than not, so I think this would be a net win.", "group_id": 9739, "id": 1124528}, {"user_id": 32737, "stars": [], "topic_id": 36109, "date_created": 1305891704.276818, "message": "I changed `load` so it changes the current directory, so if you do (load \"foo/bar.arc\"), then the current directory will be changed to \"foo\" until the call to `load` is finished, then it'll be changed back.\n\nThis is a Good Thing(tm) since it lets Arc files load libraries relative to their directory, rather than whatever directory happens to be the current directory at the time.", "group_id": 9739, "id": 1124485}, {"user_id": 32737, "stars": [], "topic_id": 36109, "date_created": 1305893941.1634851, "message": "Oh yeah, and if you use (system ...) Basically, it only matters in the situations where the current directory matters.", "group_id": 9739, "id": 1124869}, {"user_id": 32737, "stars": [], "topic_id": 36109, "date_created": 1305891837.0390241, "message": "Right now, you need to do this: (w/curdir (dirname path) (w/infile x (basename path) ...))\n\nWith this change, you would be able to just do this: (w/infile x path ...) Shorter! Yay!", "group_id": 9739, "id": 1124511}, {"user_id": 32737, "stars": [], "topic_id": 36109, "date_created": 1305893469.212853, "message": "Though I'm not actually sure whether it's more common or not, so it'd be nice to see some evidence one way or the other. In any case, it'd be more consistent with load, and having a nice consistent interface for dealing with files would be good, all else being equal.", "group_id": 9739, "id": 1124806}, {"user_id": 32737, "stars": [], "topic_id": 36109, "date_created": 1305893709.9253981, "message": "By the way, this change only applies in the situations where you read/eval the file: (w/infile x foo (eval (read ...))) or do something with file I/O, like load: (w/infile x foo (load ...))", "group_id": 9739, "id": 1124849}, {"user_id": 25438, "stars": [], "topic_id": 36109, "date_created": 1305907242.4635179, "message": "I often use w/infile, but I can't think of many examples off the top of my head where I wanted to change the current directory at the same time. But for the sake of argument, suppose I often did. In the cases where I didn't want it, even if they were rare, I wouldn't want have to add extra code to work around that w/infile is doing something extra which I don't want. So I'd still want access to a more primitive w/infile which just did w/infile.\n\nBut, continuing to suppose that I often did want to change directories when I used w/infile, the more primitive version wouldn't have to be called \"w/infile\". Which ever version is used more often can be given the shorter name and the other can be given a longer name.", "group_id": 9739, "id": 1127255}, {"user_id": 32737, "stars": [], "topic_id": 36109, "date_created": 1305961589.08131, "message": "Alright, that sounds reasonable. Though I'm not actually sure which semantics would be preferable as the default...", "group_id": 9739, "id": 1133087}] |