| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
's-expression' is too jargon-y.
|
|
|
|
| |
Only non-obvious changes here are handling the early exits.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Jumps forward are harder than jumps back. You can't create a
continuation until you get to it. And we don't have a way to return
things from a continuation yet. That's a flaw. Maybe we need a
'reply-from' operator.
But for now, this small bit of code we can just inline and duplicate.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Works beautifully!
This is the first step to hoisting all the code for reading a key into
its own function. In other languages extracting arbitrary code into a
function requires passing all arguments into it, which is annoying and
hard to read. In mu you can just pass your default-space to it to share
all local variables. But there's been one additional complication until
now: labels, which are namespaced by function. Now we can replace
labels with continuations and extract arbitrary code into new functions.
Might be confusing to lose a few stack frames. Might end up undoing
values of some important local. We'll see if we run into that.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
We'll make 'buffer' properly generic at some point. Basically need to
support multi-word types.
x:list:integer <- copy y:list:integer # ok
x:list <- copy y:list:integer # ok
x:list:integer <- copy y:list # error
We'll need a separate runtime operator like maybe-coerce for the third
case.
|
|
|
|
| |
Style lesson: always save args the moment you enter the function.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the right time for this change I've been meaning to make,
because it lets me drop my hack in 'abort-to'.
'abort-to' is likely still a bad idea because:
a) Just because this example doesn't need to clear a few things on
abort doesn't mean such use cases don't exist. In other words, there's
no way to tell if your stack frame recently returned from an abort.
That question isn't even well-posed at the moment; what does
'recently' even mean?
b) I may need to run deferred statements on each stack frame, and it's
not clear how to rewrite 'defer' to be robust to aborts. Exceptions
entering through the back door?
Looks like all this is expected when implementing exception-like
behavior using continuations:
http://matt.might.net/articles/implementing-exceptions
c) Of course we don't have composable exceptions. I still don't grok
the value of that. We don't need yield since we have channels. What
else might we need continuations for? Let's try to come up with a
clean way to implement the amb operator or something.
http://www.randomhacks.net/2005/10/11/amb-operator
|
| |
|
|
|
|
|
|
|
| |
Poor man's continuation. Not first class or delimited yet. And we see
the problem: hard to specify precisely what to do after unwinding the
stack. We start reaching for a try/catch statement. But let's see if
there's a better way.
|
| |
|
|
|
|
| |
Yet another 'grow-buffer' bug.
|
|
|
|
| |
'grow-buffer' was never working until now. Too much spiking lately.
|
| |
|
|
|
|
|
| |
(flush-output) does the trick as suggested in
https://github.com/hopkinsr/terminal-color/issues/1
|
| |
|
| |
|
|
|
|
| |
Stop misusing the 'result' convention.
|
|
|
|
|
|
|
| |
Make use of the escape list to break out of strings and comments.
Also fixes a bug in backspacing past start of comment: was prematurely
terminating the current command.
|
| |
|
|
|
|
| |
'#\\' only contains one escape character: the first backslash
|
|
|
|
| |
Another spot to fix 647.
|
| |
|
|
|
|
| |
Extract a function; baby steps to better backspace support.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
I'd worried last night that I'd have to track the points where
comments/strings begin, but at least so far this is elegant. Might run
into problems when I try to backspace over strings after ending them.
And backspacing over comments after terminating them is a whole
different ball of wax. We still can't backspace over newlines because we
can't move the cursor across lines because we can't tell where our
cursor currently is. And even if we could tell we'd need to track how
long each line is. A new data structure is needed..
|
|
|
|
|
|
|
|
| |
Ran into this in color-repl.mu: I wasn't checking struct variables in
'get' operations.
Still no way to test for use-before-set logic. But we'll fix it when we
leave arc behind.
|
| |
|
|
|
|
|
|
| |
Looping/breaking more than one block feels brittle somehow. It's not
like java where the language can distinguish loops from other blocks. I
think I'm just going to use jumps for more than one block.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Backspace kinda works. Parens are colored in three rotating colors which
helps with balancing. Comments and strings are colored.
But it's hard to handle backspace in all situations. Like if you
backspace over a quote you have to either quit the string-slurping
routine you're in, or return to string slurping mode. Similarly for
comments; *there* you don't even have a end delimiter to let you know
you're back in a comment. You have to keep track of what came before.
I experimented with a library but it interacts poorly with the charterm
library I'm already using. Ended up with a gross inefficient approach
instead.
|
|
|
|
|
| |
We'll never be able to avoid dying on syntax errors.
But hopefully we can make sessions easy to restore.
|
|
|
|
|
|
|
| |
Next step: convenience features like balancing parens, coloring parens.
For that I'll have to leave line-based buffering behind.
My workflow seems to be spike-test-clean.
|
| |
|
| |
|
| |
|
| |
|
| |
|