mirror of
https://github.com/not-kennethreitz/convore.json.git
synced 2026-06-05 23:20:19 +00:00
1 line
4.8 KiB
JSON
1 line
4.8 KiB
JSON
[{"user_id": 32737, "stars": [], "topic_id": 36083, "date_created": 1305867513.464396, "message": "First off, the \"arc\" file now behaves as follows: if you specify no arguments, it will simply give you the REPL.\n\nIf you specify 1+ arguments, it will load the first argument only, and won't go into the REPL.\n\nIf you want it to load a file and go into the REPL, you can use the --repl flag:\n\n./arc --repl foo.arc\n\nAnd if you want it to load all the files, rather than only the first one, use the -a or --all options:\n\n./arc -a foo.arc bar.arc qux.arc", "group_id": 9739, "id": 1120682}, {"user_id": 32737, "stars": [], "topic_id": 36083, "date_created": 1305867177.4902401, "message": "I've already been tweaking ar (of course) to suit my needs better. Here's some of the changes I've done, and plan to do to make it more pleasant to write shell scripts using Arc/ar.", "group_id": 9739, "id": 1120646}, {"user_id": 32737, "stars": [], "topic_id": 36083, "date_created": 1305867636.3931749, "message": "Also, the srcdir* variable is now available in Arc.\n\nOne thing I might do is also put in an implicit variable curdir* which would be the current directory. This would let you do things like change the current directory, and parameterize it.\n\nI can then change Arc's `load` so it properly handles subdirectories.", "group_id": 9739, "id": 1120693}, {"user_id": 32737, "stars": [], "topic_id": 36083, "date_created": 1305875024.520956, "message": "Alright, srcdir and curdir are now implicit variables. I also added in ifdlet, dirname, and basename. I also changed load so it handles subdirectories properly.", "group_id": 9739, "id": 1121738}, {"user_id": 32737, "stars": [], "topic_id": 36083, "date_created": 1305876879.018275, "message": "Also, should load be aware of Unixy stuff like ~ or $HOME? Perhaps that could be delegated to a separate function/macro.", "group_id": 9739, "id": 1122053}, {"user_id": 32737, "stars": [], "topic_id": 36083, "date_created": 1305875310.760927, "message": "The next challenge is command line arguments. If you call ./foo bar qux, it should be easy to extract out the args, and it should also be easy to specify options, so that... say... -n does something.\n\nSo, there's two things I need to do:\n\n1) Make a nice low-level way to access all the arguments, similar to \"racket-current-command-line-arguments\" but waaaay shorter and easier to use (returning a list rather than a vector, for instance)\n\n2) Write a command line parsing library", "group_id": 9739, "id": 1121752}, {"user_id": 32737, "stars": [], "topic_id": 36083, "date_created": 1305875434.9467881, "message": "Another thing, it should be possible to easily load a file relative to the script's directory. So if the script is at ~/.local/bin/foo, it should be easy to load a library at ~/.local/bin/lib/bar, without needing to hardcode directories.\n\nI should be able to write this as a macro, like \"w/scriptdir\" or something.", "group_id": 9739, "id": 1121759}, {"user_id": 32737, "stars": [], "topic_id": 36083, "date_created": 1305887809.9621241, "message": "(should I rename curdir to cd? it would break consistency with srcdir, but it would be more consistent with Unix in general)", "group_id": 9739, "id": 1124148}, {"user_id": 32737, "stars": [], "topic_id": 36083, "date_created": 1305887419.089951, "message": "Oh, and by the way, for convenience, `last` now works on strings, and anything else that supports indexing. So (last \"foobar\") returns #\\r", "group_id": 9739, "id": 1124126}, {"user_id": 32737, "stars": [], "topic_id": 36083, "date_created": 1305887337.428004, "message": "I also added in env, script-args, script-src, and w/script-dir\n\nenv lets you get/set environment variables, like HOME\n\nscript-args is just a list of all the command line arguments, so if you call ./foo bar qux, then script-args will be (bar qux)\n\nscript-src is the source for the script file, so if foo is located at /usr/local/bin/foo, then script-src will be /usr/local/bin/foo\n\nw/script-dir is a macro that lets you load files relative to the script's directory. So let's say foo is located at /usr/local/bin/foo, and you used this:\n\n(w/script-dir (load \"../lib/bar.arc\"))\n\nThen it would load /usr/local/lib/bar.arc\n\nIt would be trivial to write similar macros for other purposes, since I already set up w/curdir, thanks to aw's earlier post (https://convore.com/arc-runtime-project/the-load-function-and-similar-should-change-the-current-directory/1015150/)", "group_id": 9739, "id": 1124112}, {"user_id": 32737, "stars": [], "topic_id": 36083, "date_created": 1305886967.3533659, "message": "I added in some more functions: joinpath, abspath, and absdir\n\njoinpath works like os.path.join in Python (or at least, I think it does) which is different from simply concatenating the paths together", "group_id": 9739, "id": 1124051}] |