-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lotta changes #1
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
… pretty much all the time
… custom behavior for objects that are in functional position, ala defcall.
… appear that fn is a first-class value, even though the gensym is hardcoded into ac.
…g with coerce, but also allows for apply to be used on macros!
Also adding a letr macro Renaming acons to cons? Renaming alist to list? Renaming no to not Also putting in an "arc3.1/backcompat.arc" file. This creates aliases for acons, alist, and no
Removing `ac-complex-getargs` because it isn't used anywhere defrule now binds `orig` to the original function
symbols. This allows things like quote, fn, assign, etc. to be overwritten/shadowed ac.ss also exposes the gensyms as ordinary variables in Arc, prefixed with %%internal- So, fn is now %%internal-fn, quote is %%internal-quote, etc. But even the %%internal- variables aren't hardcoded, so they can be overwritten/shadowed by Arc This makes it appear that all special forms are first-class, even though technically they use gensyms underneath
Conflicts: ar.ss arc.arc as.ss
It's now false by default, but if you don't specify any files, it'll go into the REPL.
pass except for one (which is intended to fail, since it's unimplemented) The old re.arc is available at "lib/re.arc.bak"
Conflicts: ac.ss ar.ss tests.sh
Hash tables also print out nicer now: 1. Keys are displayed in alphabetical order 2. Newlines/whitespace is inserted to make it easier to read As an example, (obj a 1 b 2 c 3) would print as: #hash((a . 1) (b . 2) (c . 3))
working Also tweaking repl.arc a bit
them. You can tell it to load all the files by using -a or --all Also, now the srcdir* variable is exposed to Arc
Adding in curdir, dirname, basename, and ifdlet load now handles subdirectories properly
Adding in joinpath, abspath, and absdir Adding in racket-vector->mlist and racket-mlist->vector Adding in env, script-args, script-src, and w/script-dir Also fixing some bugs with curdir, load, dirname, and basename ifdlet is no longer necessary and has been removed Renaming toscheme to toracket, and also exposing it to Arc
Removing tests.sh because it's no longer necessary Use ./arc run-tests instead
Fixing some bugs with script-args, joinpath, dirname, basename, and curdir Also tweaking the "arc" file
their argument Also changing `empty` so (empty '||) returns t
`warn` now prints to stderr rather than stdout
Fixing the problem with tests/arc by moving some more stuff into base.arc
`pipe-from` now uses Arc's stderr, so error messages should work okay now `quit` now works just like racket-exit, so it accepts an argument now
This fixes a problem where `load` didn't understand square-bracket
Also updating the README a bit
Adding in assoc-ref, which allows you to scar the assoc Adding in make-w/close, which creates things like w/infile, w/socket, etc. Adding in setters for assoc and alref, so you can now do (= (alref foo 'bar) 'qux) to assign to an association list
Adding intersect, set-diff, and diff (functions that return sets)
Conflicts: ac.ss ar.ss arc arc-test.ss arc.arc io-test-root.ss io-test.ss primitive-repl.ss readme.md strings-test.ss tests.sh tests/ac-test.ss tests/ar-test.ss
this can be changed to racket/ later Fixing all the special forms so they're gensyms, allowing for overwriting/ shadowing things like fn, if, assign, etc. Fixing it so when `apply` doesn't understand something (hash table, string, etc.) it will try to coerce it to an 'fn, rather than throwing an error Also, racket-eval no longer parameterizes current-readtable
Also changing sread to use ar-read rather than racket-read This is because ar-read already parameterizes racket-current-readtable, so it's better to just use ar-read
w/object is no longer needed and has been removed isa now understands multi-type objects Adding in del, which can delete object attributes and hash keys I plan to add in more functionality to del later
…ists: (foo 2 5) ; return the slice [2,5) (= (foo 2 5) '(4 5 6)) ; splice a list into the slice [2,5) In order to accomplish this, I fixed sref so it sends all it's arguments rather than only the first: (= (foo 1 2 3) 'bar) Now expands into: (sref foo 'bar 1 2 3) I also fixed nthcdr so it is a *lot* faster when given an index beyond the length of the list. For instance, this... (nthcdr 5839949410410444 '(0 1 2 3 4 5)) ...used to take a really long time, but now it's very fast.
Also, now (isa (object) 'object) is t Also starting some work on fixing `is` so it works correctly...
I added these as "todo's" to the readme; let me know if I missed anything. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I know it's a lot of changes, I'll try to send pull requests in smaller chunks from now on. On the plus side, I've kept up with merges, so it's up-to-date with base ar (excluding the changes I made, of course), so it'll hopefully be easy to merge.
I'll list out some of the big changes that you'll want to know about:
core.arc is the absolute bare minimum super-important stuff like def, let, etc. I would also expect the ar compiler to go into there, and also a reader written in Arc could be put into core.arc
base.arc is stuff that's still suuuuper useful and common, like each, map, =, etc. but it's still lightweight compared to arc.arc
arc.arc then contains everything else (excluding io.arc and repl.arc, of course)
To be more specific, base.arc contains stuff that I need/am interested in while I'm developing Arubic, since Arubic only loads core.arc and base.arc, which lets it load up waaaay faster than Arc.
All Arc tests are implemented with my Python-style tester. So now you use ./arc run-tests rather than sh tests.sh. It also supports some neat stuff like a -v/--verbose flag and the ability to load up individual tests, rather than all of them. It does this with a simple command line argument parser, which is found in "lib/parse-script-args.arc"
ac.ss is exactly the same as in ar, except that it implements special forms as gensyms, "apply" coerces to an fn when it doesn't understand it's argument (which gets you something similar to defcall), and racket-eval doesn't parameterize current-readtable.
I've added in a bunch of functions to arc.arc that I needed/wanted/seemed useful. I also fixed some bugs, tidied some things up, stuff like that. For instance, "dynamic" and "implicit" are a lot cleaner, no mucking around with "with" or "sref sig" or any of that junk.
All the things I talked about before (srcdir, curdir, script-args, script-src, etc.) are implemented and neatly categorized in arc.arc.
Oh yeah, and just a little thing that you might find neat. You know how w/infile and such expand into the "expander" function, which is hidden in a "let"? Well, I put in a "make-w/close" macro, so now you can easily make your own w/ stuff. For instance, here's the implementation of w/pipe-from:
(make-w/close pipe-from)
I still want to tidy up w/appendfile a bit, but I'm pretty happy with it overall.