No Description

Sam Newbold 97117571c3 Better polish arithmetic through .reinterpret 6 years ago
docs 2f720c884b Horrendously out of date documentation in misformated markdown 6 years ago
test_files 2e30780b99 Prototype bodies of .for .for_each_line and .stepwise 6 years ago
.gitignore 88f1bd7ca0 Selection_read outputs files in sorted order 6 years ago
COPYING b184f4eec0 rwsh v0.1 import 19 years ago
ChangeLog f8b72ae253 removing unreleased 0.2.1 and 0.2.2 versions from the official Changelog 14 years ago
KnownBugs eebd913831 Builtins have prototypes-> s/.bad_argc/.bad_args/g 6 years ago
README 97117571c3 Better polish arithmetic through .reinterpret 6 years ago
all-polish.rwsh 97117571c3 Better polish arithmetic through .reinterpret 6 years ago
arg_script.cc f692d8328a Semicolon divides statements outside of argfunctions 6 years ago
arg_script.h f692d8328a Semicolon divides statements outside of argfunctions 6 years ago
arg_spec.cc f692d8328a Semicolon divides statements outside of argfunctions 6 years ago
arg_spec.h fefded1c19 Support .{foo} and [.{bar}] 6 years ago
argfunction.basic-result 2e30780b99 Prototype bodies of .for .for_each_line and .stepwise 6 years ago
argfunction.sh 2e30780b99 Prototype bodies of .for .for_each_line and .stepwise 6 years ago
argm.cc 97117571c3 Better polish arithmetic through .reinterpret 6 years ago
argm.h 97117571c3 Better polish arithmetic through .reinterpret 6 years ago
argm_star_var.cc eb2042c28c Prototype almost all functions, deprecate non-prototype 6 years ago
boringfile 18c48735dc explaining and showing known bug for v0.3 13 years ago
builtin.cc 97117571c3 Better polish arithmetic through .reinterpret 6 years ago
builtin.h 97117571c3 Better polish arithmetic through .reinterpret 6 years ago
call_stack.cc ec8c0cb0af Statements print output and return control flow 6 years ago
call_stack.h ec8c0cb0af Statements print output and return control flow 6 years ago
clock.cc 86540cf852 actually adding clock, and documentation 17 years ago
clock.h f30e82d7de collect_errors_*, .try_catch is a looping construct 8 years ago
command_stream.cc f692d8328a Semicolon divides statements outside of argfunctions 6 years ago
command_stream.h f692d8328a Semicolon divides statements outside of argfunctions 6 years ago
counter.rwsh f76d94dbc8 Don't assume ––init-file flag in rwshrc 6 years ago
default_stream.cc 21ec9a96b0 Try readline to resolve getline() conflict with read() 7 years ago
default_stream.h 21ec9a96b0 Try readline to resolve getline() conflict with read() 7 years ago
deps.mk da07be753f a thrown exception triggers .failed_substitution 6 years ago
executable.cc 2e30780b99 Prototype bodies of .for .for_each_line and .stepwise 6 years ago
executable.h 2e30780b99 Prototype bodies of .for .for_each_line and .stepwise 6 years ago
executable_map.cc 6c67e00a6a s/.function_all_flags/.function/g 6 years ago
executable_map.h ec8c0cb0af Statements print output and return control flow 6 years ago
file_stream.cc 16ccd3e422 Throw from .set rather than returning nonzero ... 7 years ago
file_stream.h 21ec9a96b0 Try readline to resolve getline() conflict with read() 7 years ago
function.cc 97117571c3 Better polish arithmetic through .reinterpret 6 years ago
function.h 97117571c3 Better polish arithmetic through .reinterpret 6 years ago
makefile 97117571c3 Better polish arithmetic through .reinterpret 6 years ago
old_test_quick.sh 762c9e3d86 Remove leading rwsh from internal function names 6 years ago
pipe_stream.cc eb2042c28c Prototype almost all functions, deprecate non-prototype 6 years ago
pipe_stream.h 21ec9a96b0 Try readline to resolve getline() conflict with read() 7 years ago
plumber.cc c843b411f6 if and else must be in same block 6 years ago
plumber.h 21ec9a96b0 Try readline to resolve getline() conflict with read() 7 years ago
prototype.cc 97117571c3 Better polish arithmetic through .reinterpret 6 years ago
prototype.h 97117571c3 Better polish arithmetic through .reinterpret 6 years ago
read_dir.cc 508ceb3589 Stop using the deprecated readdir_r() 6 years ago
rwsh.cc 97117571c3 Better polish arithmetic through .reinterpret 6 years ago
rwsh_init.cc 97117571c3 Better polish arithmetic through .reinterpret 6 years ago
rwsh_init.h c843b411f6 if and else must be in same block 6 years ago
rwsh_stream.cc 16ccd3e422 Throw from .set rather than returning nonzero ... 7 years ago
rwsh_stream.h 16ccd3e422 Throw from .set rather than returning nonzero ... 7 years ago
rwshlib.cc 97117571c3 Better polish arithmetic through .reinterpret 6 years ago
rwshlib.h 97117571c3 Better polish arithmetic through .reinterpret 6 years ago
rwshrc 97117571c3 Better polish arithmetic through .reinterpret 6 years ago
rwshrc-basic 97117571c3 Better polish arithmetic through .reinterpret 6 years ago
rwshrc-default 97117571c3 Better polish arithmetic through .reinterpret 6 years ago
selection.cc e10137770f break&continue with outer variants, sigint throws 6 years ago
selection.h eb2042c28c Prototype almost all functions, deprecate non-prototype 6 years ago
selection_read.cc 88f1bd7ca0 Selection_read outputs files in sorted order 6 years ago
substitution_stream.cc 21ec9a96b0 Try readline to resolve getline() conflict with read() 7 years ago
substitution_stream.h 21ec9a96b0 Try readline to resolve getline() conflict with read() 7 years ago
test.result 97117571c3 Better polish arithmetic through .reinterpret 6 years ago
test_inconsistent.result 88f1bd7ca0 Selection_read outputs files in sorted order 6 years ago
test_inconsistent.sh 6c67e00a6a s/.function_all_flags/.function/g 6 years ago
test_init.rwsh 6c67e00a6a s/.function_all_flags/.function/g 6 years ago
test_main.sh 97117571c3 Better polish arithmetic through .reinterpret 6 years ago
test_quick.result 2e30780b99 Prototype bodies of .for .for_each_line and .stepwise 6 years ago
test_quick.sh 97117571c3 Better polish arithmetic through .reinterpret 6 years ago
test_rwsh_out 4dd85ab531 source doesn't do internal functions 19 years ago
tokenize.cc eb2042c28c Prototype almost all functions, deprecate non-prototype 6 years ago
variable_map.cc 97117571c3 Better polish arithmetic through .reinterpret 6 years ago
variable_map.h 97117571c3 Better polish arithmetic through .reinterpret 6 years ago

README

rwsh is a shell for Unix-like systems.

Documentation can be found in the docs directory. As it is still very much of
a proof-of-concept, there is no install or configure script.

It is not intended to be compatible with existing shells, or even to keep their
basic semantics. So please read at least the "introduction and
philosophy" document before assuming that you know what a command will do. For
example, rm without arguments may delete files (personally, I use rm without
arguments more often than with them).

Several changes are coming shortly, which may easily break scripts designed for
this version of the shell, including the following.
* .while will respond to the .retest_condition exception by testing the
condition, and ending the loop if it fails, but (unlike .continue)
continuing with the following statement if it succeeds.
* Functions will be able to take more than one argfunction with string
arguments being associated with each argfunction. For instance this
will permit .scope to take several prototypes with an argfunction for
each prototype, and will run the argfunction for which its arguments
match the corresponding prototype.
* "Soons" will be replaced with "Earlies". The syntax will not
(necessarily) change, but the meaning will. Rather than & meaning to
evaluate the first time a containing statement is evaluated and && meaning
to evaluate the second time a containing statement is evaluated, & will
mean to evaluate at the beginning of the innermost block, and && will
mean to evaluate at the beginning of the second most inner block. The
result will be that wrapping a set of statements in a .scope or
.collect_errors_* will not require changing the number of ampersands,
and that the statement ".set FOO &FOO" will have the effect of
restoring the value that $FOO had at the beginning of the block.
* Global variables will be replaced by a heirarchical set of scopes.
Functions will be declared to place their variables as a child of the
current scope (leaving none of the current variables immediately
accessible and combining all of its variables into a single value for
the current scope), or within the current scope (making all of the
current variables available and making the function's variables part of
the same map), or to attempt to do one of those two in the parent
scope. If there is no parent scope then a .no_more_turtles exception
will be thrown.
* Another use of the multiple argfunctions per statement will be the
.select_all and .select_last builtins. They will run each of their
argument functions in parallel, rotating between them when they input
or output or request to cooperate with peers. .select_all will run
until all argument functions complete, while .select_last will run
until the last argument function specified completes, sending a sigpipe
to any other argfunctions currently running.
* Variables and functions will likely share the same namespace, and using
a function as if it was a variable will be equivalent to calling it
without arguments. Running .set on such a function will call it with
the arguments, but will throw an exception if it terminates without
having the effect of setting the specified value (or throwing an
exception of its own).
* Redirections will be handled by internal functions, so that the effect
of >foo, or the configuration.
* When handling a set of arguments as a whole, rather than as a set of
words, any excess space that was included when specifying them will be
included.
* .for and .for_each_line will merge taking a separator and prototype(s)
as an argument and receiving the list to be iterated through on stdin.
Similarly, .scope and .reinterpret will take a separator with which to
split stdin, and then apply the prototype (each of which will no longer
need to be a single argument).
* .stepwise will step through the argument specifications as well as
through the statements of a function, permitting one, for example, to
identify the arguments that make use of a particular variable.
* Exception call stacks will include all of the arguments for each
function at each level of the call stack rather than just the
executable names.
* .run_logic will be replaced by a system that treats .shell as a service
which includes the request for user input, and which restarts after
each command. As with .function_not_found, a missing implementation
will be replaced with a simple implementation.
* a "/" will be used to define a heirarchy amongst executables and
variables. $foo/bar cannot be defined without defining $foo, and it
will return the portion of $foo that immediately follows "bar=".
Running "foo bar" will run the function that was named "foo/bar".
* Currently, $foo$3 returns the third word of the variable foo. This will
be replaced with a system of filters, which can be used to select
members of a structure without being limited to whitespace-delimited
structures, as well as being able to optionally handle variables that
are not defined.
* There will be "default redirections", so that interactive commands will
not necessarily have either their input or output connected to the
terminal. The builtin .is_default_input should be used to determine
whether a command is receiving its input effectively from the user, and
.is_default_output should be used to determine whether output is
intended to be printed on the terminal.
Other large changes are likely. To illustrate, before version 0.3, ERRNO was a
special variable, that would prevent the execution of control flow statements
such as .if and .while. Experience working with this setup convinced me that
the problem I was aiming at was worth taking on, but that my first solution was
actually an enormous pain most of the times it came up. I could very easily
come to the same conclusion about some other feature that I have already
implemented or will soon implement.