...until you realize that nearly every non-pg, non-rtm Arc user prefers to use the non-canonical Anarki, and recommends it because of the sheer number of bug fixes (never mind the new features, such as 'defcall, 'defm, 'p-m:, 'sync, 'thread-local, 'file-table ... etc.)
> It could make Lisp popular, but it needs some kind of killer app. The news app is cool, but it won't be enough. Anybody's got an idea ?
There's also the other problem with canonical Arc: pg has expressly stated that he will not retain backward compatibility between versions.
This also means that if Anarki tries to keep full compliance with ArcN in the future, without pg updating ArcN reasonably frequently, eventually (in a year? half a year?) Anarki will either: 1) die out as a source of innovation, because people will simply rather wait for pg's next update rather than push a change that might be overridden by pg in the future, or 2) drift so far away from pg's internal ArcN that when pg releases it, the merge hell will be very, very hot.
Certainly I could implement that, and I think it's a good idea. The problem is pg's plans: does he intend a different meaning for #\? ? I don't dare to push this on Anarki, because if I do, I don't dare use it anyway, because pg might change its meaning in the future.
Edit: Ah, crick. I wish I can just say "Anarki promises to always keep compatibility with existing Anarki code. If pg breaks existing Anarki code in the next ArcN, we either (1) ignore the new feature, especially if we as a community feel that the existing Anarki feature is better, (2) rename pg's feature if possible, or (3) write a converter for old ArcN-1 based Anarki to ArcN based Anarki. Feel free to program in Anarki, where the magic carpet is assured of not being pulled out under you while you're exploring."
Note that a list key is compared using 'iso, not 'is (the quoted list bug notwithstanding)
> There are a few other new things. Most notably, the functional notation for accessing parts of lists/strings/hash tables is now implemented : ('(foo bar baz) 2) returns 'baz.
Cool! How'd you implement it?
I assume it doesn't have support for the 'call* table yet?
It looks a little hackish. I implemented it in the END_JUMP macro. If the object in LOCAL(0) (supposed to be a closure) is a string, a table or a cons, perform the adequate lookup operation (taking LOCAL(2) as a parameter). Then perform the actual jump : BEGIN_JUMP, PUSH(LOCAL(1) (which is the continuation)), PUSH(resut of lookup operation), END_JUMP.
call* is not implemented yet.
As for keys in hash tables, I admit I didn't really bother yet. It is quite broken in canonical Arc anyway (and in Anarki too for that matter) : it doesn't work correctly with lists and does not work correctly with strings too (if you update a string key, you're dead). If the hash itself is its own key, it breaks, but I don't know if this is supposed to be feasible or not.
So I'll focus on symbols and numbers as keys, first, as they are the most usual key types anyway, and will gradually introduce other key types.
Just wondering if it's possible to create a bunch of primitives to do the referencing?
%string-ref
%list-ref
%table-ref
Then possibly we could add to lib-ac.scm.arc:
(= call* (%table)) ;or whatever the table-creating primitive is
(%sref-table call* 'string
(fn (s i) (%string-ref s i)))
(%sref-table call* 'list
(fn (s i) (%list-ref s i)))
(%sref-table call* 'table
(fn (s i) (%table-ref s i)))
; for compatibility with existing Anarki
(set ref
(fn (c i)
(if (%is (%type c) 'string)
(%string-ref c i)
(if (%is (%type c) 'list)
(%list-ref c i)
(if (%is (%type c) 'table)
(%table-ref c i)
; dummy stub for error message, when
; errors are implemented
())))))
Then maybe change code-execute* to something like:
obj fn = SYM2OBJ("fn");
obj typ;
goto initjump;
jump:
// most common case, so check it first
if((typ = type(LOCAL(0))) == fn){
goto realjump;
} else {
memmove(&LOCAL(3),&LOCAL(2), (num_args - 2)*sizeof(obj));
++num_args;
LOCAL(2) = LOCAL(0);
LOCAL(0) = table_lookup(GLOBAL(CALL_TABLE), typ);
//possibly add a check here to see if it's a function
}
realjump:
pc = LOCAL(0)[0]; //or whichever it should be
initjump:
switch(pc){
...
It's a bug I've experienced on Windows. Apparently the windows command line thinks that the terminal program is not running, so it tries to act based on the input (hence "the syntax of the command is incorrect") but it's actually still running, so both the windows command line and the Arc command line act on your input.
Actually, "the syntax of the command is incorrect" is due to Arc not using Windows style pathnames. (Also note that the -p option is not valid on Windows.)
C:\User\Programming\Arc>mkdir -p arc/logs/
The syntax of the command is incorrect.
you'll have to wait for sacado to respond regarding this bit - I believe he's the one who added FFI to Anarki. It's highly possible that the FFI is just not compatible with Windows, and/or the FFI layer in mzscheme is subtly different between Linux and Windows.