summaryrefslogtreecommitdiffstats
path: root/txr.c
Commit message (Collapse)AuthorAgeFilesLines
* Preparations for bundling Cygwin library.Kaz Kylheku2016-06-271-11/+25
| | | | | | | | | | * LICENSE-CYG: New file. * METALICENSE: Include a note about the use of Cygwin in accordance with LGPL. * txr.c (license): Use glob to iterate over all files in the txr share directory which match the LICENSE* pattern.
* New --free-all option for freeing memory on exit.Kaz Kylheku2016-06-071-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although we are garbage-collected, being able to clean up on shutdown is nevertheless useful for uncovering leaks. Leaks can occur, for instance, due to neglect to free out-of-heap satellite data from objects that are reclaimed by gc. This feature is long overdue. * arith.c, arith.h (arith_free_all): New function. * gc.c, gc.h (gc_free_all): New function. * lib.c (init): Remove program name parameter and redundant initialization of progname globl variable. * lib.h (progname): Superfluous declaration removed. This is already declared in txr.h. (init): Declaration updated. * regex.c (char_set_destroy): Do not check the static allocation flag here; just destroy the object. Do check for a null pointer, though. (char_set_cobj_destroy): This cobj destructor now checks the static flag of the char set object and avoids freeing it. Thus our char set singletons are left alone by gc, but our global freeing function takes care of them. (wide_cs): New static variable moved out of wide_display_char_p to static scope. (regex_free_all): New function. * regex.h (regex_free_all): Declared. * txr.c (progname): const qualifier and initializer removed. (main): Ensure progname is always dynamically allocated, even in the argv[0] == 0 case. Do not pass progname to init; it doesn't take that argument any more. (free_all): New static function. (txr_main): Implement --free-all option. * txr.h (progname): Declaration updated.
* The stdlib variable gets a trailing slash.Kaz Kylheku2016-06-051-1/+9
| | | | | | | | | | | | | | | | | | | * txr.c (sysroot_init): Add slash to stdlib_path. (sysroot_compat_fixup): Replace user-visible stdlib variable with a path that doesn't have a slash, if compatibility is 143 or lower. (compat): Call sysroot_compat_fixup. * lisplib.c (place_set_entries, ver_set_entries, ifa_set_entries, txr_case_set_entries, with_resources_set_entries, path_test_set_entries, struct_set_entries, with_stream_set_entries, hash_set_entries, except_set_entries, type_set_entries, yield_set_entries, sock_set_entries, termios_set_entries): Remove slash from format string since the directory includes it. * txr.1: Added note under stdlib about the slash, and also an entry COMPATIBILITY.
* Stand-alone application support.Kaz Kylheku2016-05-251-18/+43
| | | | | | | | | | | | | | | | | | | * txr.c (sysroot_init): Don't print "unable to calculate sysroot" error message in the fallback case, and use the absolute path of the executable directory as the sysroot in this case. (txr_main): Define static area prefixed by @(txr): header. If a string is present in this data area then process it as an argument. Treat the *args* variable carefully. If we use the stored string as the argument, save the args in orig_args variable, then later bind *args* to that. In the -e, -p and related options processing, we bind *args* to the original list so args are available to the expression being evaluated. If the expression mutates *args* then we keep the mutated args whether or not we are processing the stored string. * txr.1: Documented in new sction, STAND-ALONE APPLICATION SUPPORT.
* New variable: txr-path.Kaz Kylheku2016-05-251-0/+7
| | | | | | | * txr.c (dirname): New static function. (sysroot_init): Register txr-path variable. * txr.1: documented txr-path.
* Bugfix: strange diagostic for -B-c.Kaz Kylheku2016-05-231-2/+7
| | | | | | * txr.c (txr_main): Diagnose unrecognized long option in if/else statement that handles long options, rather than clumsily in switch for non-clumping options.
* Few more drop_privilege calls in txr_main.Kaz Kylheku2016-05-231-0/+2
| | | | | | * txr.c (txr_main): Drop setuid privilege as soon as we know we are just going to exit, before producing any diagnostic output, like in existing cases.
* Help text upkeep.Kaz Kylheku2016-05-181-0/+7
| | | | | * txr.c (help): Note the existence of --args and --eargs, without giving a full description.
* New feature: self-load-path symbol macro.Kaz Kylheku2016-05-181-0/+2
| | | | | | | | | | | | | | | | | | | | | * eval.c (self_load_path_s): New symbol variable. (sys_load): Save, set-up and restore self-load-path around load. (set_get_symacro): New function. (eval_init): Register load function using sys_load_s instead of redundant intern. * eval.h (set_get_symacro): Declared. * match.c (v_load): Save, set-up and restore self-load-path macro. * parser.c (load_rcfile): Likewise. * txr.c (txr_main: Set up self-load-path when opening file. * txr.1: Documented self-load-path.
* *args*, *args-full* and self-path in listener.Kaz Kylheku2016-05-071-8/+10
| | | | | | | * txr.c (txr_main): Register *args-full* variable before first branch to repl. In repl section, register or re-register *args* to any remaining args, and self-path to the string "listener".
* Copyright in --help text.Kaz Kylheku2016-05-051-1/+1
| | | | | txr.c (help): 2015 was so last year. Let's make it a range from 2009 to current.
* Condense --help text.Reini Urban2016-05-051-1/+0
| | | | | txr.c (help): Remove blank line between name and copyright line.
* Typo in --help.Reini Urban2016-05-051-1/+1
| | | | txr.c (help): "sare" -> "are".
* New --reexec option.Kaz Kylheku2016-05-051-0/+8
| | | | | | | | | | | | | | | | | This helps with setuid hash bang scripting on Mac OS, and other plaforms where the interpreter executed out of a hash bang script runs with orinary privilege, even if marked setuid. * sysif.c (exec_wrap): Static function turns extern. * sysif.h (exec-wrap): Declared. * txr.1: Documented --reexec. Added notes about setuid under Hash Bang Support. * txr.c (help): List --reexec option. (txr_main): Implement --reexec option.
* Fix treatment of "false" in out-of-memory handler.Kaz Kylheku2016-05-041-1/+2
| | | | | | * txr.c (oom_realloc_handler): When terminating, only print the word false if the print-bindings option -B is in effect. Also, print it to standard output, not standard error.
* Calculate sysroot even if executable is renamed.Kaz Kylheku2016-05-041-1/+17
| | | | | | | | | | | If txr is renamed to something else in the same installation directory, we can still calculate the sysroot. * txr.c (substitute_basename): New function. (sysroot_init): Make one more attempt to calculate the sysroot by substituting the actual base name of the program into the compile-time relative path, and using that path agains the full path name.
* Consolidate sysroot calculation.Kaz Kylheku2016-05-041-16/+19
| | | | | | | | | | | | * txr.c (sysroot_path): New static variable. (progpath): Variable renamed to prog_path. (sysroot_helper): Function removed. (maybe_sysroot): New function. (sysroot): Function now just catenates previously calculated sysroot path onto target without. (sysroot_init): Follow rename of progpath to prog_path. GC-protect sysroot_path. Calculate sysroot path; if not able, emit warning message and use empty string.
* Implement setgid script support.Kaz Kylheku2016-05-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TXR now notices that it's running setgid, and implements setgid logic for scripts. * sysif.c (orig_egid, real_gid, is_setgid): New static variables. (repress_privilege): Treat real and effective group ID similarly to user ID. Save them in global variables, and set the is_setgid flag. (drop_privilege): Drop setgid privilege similarly to setuid. Operate selectively: if neither setuid nor setgid is in effect, do nothing, but if just one is in effect, don't do anything for the other. (simulate_setuid): Function renamed to simulate_setuid_setgid. A small change is made here: if the fstat fails, just drop privilege, don't abort. Implement setgid operation independently of setuid. The is_setgid and is_setuid flags are manipulated here now to get the drop_privileges function to selectively drop setuid if we are running a script which is only segid, or drop setgid if we are running a setuid only script. * sysif.h (simulate_setuid): Declaration name change to simulate_setuid_setgid. * txr.c (txr_main): Follow rename of simulate_setuid. * txr.1: SETUID OPERATION section changed to SETUID/SETGID operation, and setgid description worked into the text.
* Close source files after parsing.Kaz Kylheku2016-04-151-0/+4
| | | | | | | | | | | | | * eval.c (sys_load): close stream in all cases. * match.c (v_load): Likewise. * parser.c (load_rcfile): Close stream in unwind block, if open. * txr.c (txr_main): Close stream after parsing in all cases. If stream is std_input, or a string stream, close_stream does nothing.
* Adding --eargs mechanism.Kaz Kylheku2016-02-021-1/+22
| | | | | | * txr.c (txr_main): Implement --eargs. * txr.1: Documented.
* Support setuid operation.Kaz Kylheku2016-01-231-1/+28
| | | | | | | | | | | | | | | | | | | | | * sysif.c (orig_euid, real_uid, repress_called, is_setuid): New static variables. (repress_privilege, drop_privilage, simulate_setuid): New functions. (RC_MAGIC): New preprocessor symbol. * sysif.c (repress_privilege, drop_privilage, simulate_setuid): Declared. * txr.c (txr_main): Call repress_privilege to check and remember whether we are in setuid mode, and temporarily drop the effective uid to the real one. (txr_main): Permanently drop privileges in all cases except script execution. In script execution cases, go through simulate_setuid to either set or preserve the effective user ID, or else drop privs. * txr.1: Documented setuid operation in new section.
* Header file cleanup.Kaz Kylheku2016-01-221-2/+0
| | | | | | | * arith.c, cadr.c, debug.c, eval.c, filter.c, gencadr.txr, glob.c, hash.c, linenoise/linenoise.c, lisplib.c, match.c, parser.c, rand.c, regex.c, signal.c, stream.c, struct.c, sysif.c, syslog.c, txr.c, unwind.c, utf8.c: Remove unncessary header files.
* Copyright year bump.Kaz Kylheku2015-12-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | * LICENSE, METALICENSE, Makefile, args.c, args.h, arith.c, arith.h, cadr.c, cadr.h, combi.c, combi.h, configure, debug.c, debug.h, eval.c, eval.h, filter.c, filter.h, gc.c, gc.h, glob.c, glob.h, hash.c, hash.h, jmp.S, lib.c, lib.h, lisplib.c, lisplib.h, match.c, match.h, parser.c, parser.h, parser.l, parser.y, rand.c, rand.h, regex.c, regex.h, share/txr/stdlib/cadr.tl, share/txr/stdlib/except.tl, share/txr/stdlib/hash.tl, share/txr/stdlib/ifa.tl, share/txr/stdlib/path-test.tl, share/txr/stdlib/place.tl, share/txr/stdlib/struct.tl, share/txr/stdlib/txr-case.tl, share/txr/stdlib/type.tl, share/txr/stdlib/with-resources.tl, share/txr/stdlib/with-stream.tl, share/txr/stdlib/yield.tl, signal.c, signal.h, stream.c, stream.h, struct.c, struct.h, sysif.c, sysif.h, syslog.c, syslog.h, txr.1, txr.c, txr.h, unwind.c, unwind.h, utf8.c, utf8.h: Add 2016 copyright. * linenoise/LICENSE, linenoise/linenoise.c, linenoise/linenoise.h: Bump one principal author's copyright from 2014 to 2015. The code is based on a snapshot of 2015 upstream work.
* New --debug-expansion option.Kaz Kylheku2015-12-181-0/+11
| | | | | | | | | | | | | * txr.c (opt_dbg_expansion): New global variable. (help): Print summary for --debug-expansion. (txr_main): Recognize new option and set flag. * parser.y (parse_once): Suppress debug stepping around parser if opt_dbg_expansion is false. * txr.1 (opt_dbg_expansion): Declared. * txr.1: Documented new option.
* TXR_COMPAT option.Kaz Kylheku2015-11-201-0/+23
| | | | | | | | | * txr.c (txr_main): Implement handling of TXR_COMPAT environment variable. Also, before entering interactive mode, if compatibility has been set via TXR_COMPAT, emit an informative message about this. * txr.1: Documented TXR_COMPAT.
* Stop using C library setjmp/longjmp.Kaz Kylheku2015-10-251-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TXR is moving to custom assembly-language routines. This is mainly motivated by a very dubious thing done in the GNU C Library setjmp and longjmp in the name of security. Evidently, glibc's setjmp "mangles" certain pointer values which are stored into the jmp_buf buffer. It's been that way since 2005, evidently. This means that, firstly, all along, the use of setjmp in gc.c to get registers into a buffer so they can be scanned has not actually worked properly. More importantly, this pointer mangling in setjmp and longjmp is very hostile to a stack copying implementation of delimited continuations. The reason is that continuations contain jmp_buf buffers, which get relocated in the process of capturing and reviving a continuation. Any pointers in a jmp_buf which point into the captured stack segment have to be fixed up to point into the relocated location. Mangled pointers make this difficult, requiring hacks which are specific to glibc and the machine architecture. We might as well implement a clean, well-behaved setjmp and longjmp. * Makefile (jmp.o): New object file. (dbg/%.o, opt/%.o): New rules for .S prerequisites. * args.c, arith.c, cadr.c, combi.c, cadr.c, combi.c, debug.c, eval.c, filter.c, glob.c, hash.c, lib.c, match.c, parser.c, rand.c, regex.c, signal.c, stream.c, struct.c, sysif.c, syslog.c, txr.c, unwind.c, utf8.c: Removed <setjmp.h> include. * gc.c: Switch to struct jmp and jmp_save, instead of jmp_buf and setjmp. * jmp.S: New source file. * signal.h (struct jmp): New struct type. (jmp_save, jmp_restore): New function declarations denoting assembly language routines in jmp.S. (extended_jmp_buf): Uses struct jmp instead of setjmp. (extended_setjmp): Use jmp_save instead of setjmp. (extended_longjmp): Use jmp_restore instead of longjmp.
* Most uses of auto_str should be static_str.Kaz Kylheku2015-10-161-3/+3
| | | | | | | | | These functions do exactly same thing, but communicate something different to the reader of the code. An auto_str is on the stack, and so must not be passed somewhere where it will be retained. * txr.c (help, compat, txr_main): Use static_str on version.
* Go into listener if no arguments are given.Kaz Kylheku2015-10-131-0/+24
| | | | | | | | * txr.c (help): Document the behavior. (banner): New static function. (txr_main): If listener support compiled in, show the banner and go to REPL instead of showing the usage hint and bailing.
* Capitalization in help text.Kaz Kylheku2015-10-131-3/+3
| | | | * txr.c (help): Capitalize TXR, Copyright and Usage.
* Bugfix: *args* not bound for command line expressions.Kaz Kylheku2015-09-101-2/+7
| | | | | | | | | | | | | | | | The documentation says that *args* is bound to nil, but actually it is not bound at all. Let us fix this by actualy binding *args* to the remaining arguments, and by also allowing modification of *args* to dynamically take effect. * txr.c: Set up value of *args* prior to processing any option which evaluates TXR Lisp. Afterwards, reload the argument list from that variable. * txr.1: Documented semantics of *args* during command line processing.
* Bugfix: make self-path visible to Lisp.Kaz Kylheku2015-09-101-2/+5
| | | | | | | | | | | | | | | The self-path variable is not bound in TXR Lisp scripts or the command line. * txr.c (txr_main): Set self-path to "cmdline-expr" before command line Lisp evaluations. (For TXR pattern language syntax invoked in a -c, it continues to be "cmdline"). Set self-path to the file name when reading a Lisp file. Also, the legacy, undocumented *self-path* is only set for TXR scripts, and is reverted to being a special variable, not a global lexical. * txr.1: Documented self-path in more detail.
* C++: fix goto repl which skips initializations.Kaz Kylheku2015-09-091-3/+3
| | | | | | | * txr.c (txr_main): Move the labeled code to the end of the function, so it's not sitting in the scope of of names whose initialization is skipped. This is a better organization: thank you, C++.
* Wrap call to repl with #if HAVE_TERMIOS.Kaz Kylheku2015-09-091-0/+2
| | | | | * txr.c (txr_main): The repl funtion is not declared unless HAVE_TERMIOS is present and nonzero.
* Go into repl after processing txr file also.Kaz Kylheku2015-09-071-2/+9
| | | | | | | | | | | * match.c (extract): Return match result as cons, rather than int termination status. * match.h (extract): Declaration updated. * txr.c (txr_main): Handle result cons. If repl mode is selected, pass bindings from car(result) to repl. Otherwise use match success indication in cdr(result) to determine termination status.
* Enter repl after processing options and loading file.Kaz Kylheku2015-09-071-3/+15
| | | | | * txr.c (txr_main): i option sets a flag only, processed later in the function.
* Better stream name for command line expressions.Kaz Kylheku2015-09-061-2/+3
| | | | | | | * txr.c (txr_main): Pass the name argument to lisp_parse instead of defaulting it, so that errors against expressions passed on the command line are referred to "cmdline-expr" rather than the generic "string".
* Syntax errors refer to REPL line number.Kaz Kylheku2015-09-051-2/+3
| | | | | | | | | | | | | | | | | | * eval.c (eval_init): Registrations of lisp-parse and read must account for new optional argument. * lib.c (func_n5o): New function. * lib.h (func_n5o): Declared. * parser.c (lisp_parse): New argument for passing in line number. This is punched into the parser object. (read_eval_stream): Call to lisp_parse defaults new argument. (repl): Pass repl line number to lisp_parse. * parser.h (lisp_parse): Declaration updated. * txr.c (txr_main): Call to lisp_parse defaults new argument.
* Basic REPL based on linenoise.Kaz Kylheku2015-09-051-0/+12
| | | | | | | | | | | | | | | | * Makefile (OBJS): Only include linenoise.o if have_termios is y. * configure: Adding test for termios. (have_termios): New configure and config.make variable. (gen_config_make): Generate have_termios variable. * parser.c (repl): New function. * parser.h (repl): Declared. * txr.c (help): Summarize new -i option. (txr_main): Implement -i repl.
* Document previously undocumented command line options.Kaz Kylheku2015-08-241-0/+3
| | | | | | * txr.1: Documented --gc-debug, --vg-debug and --dv-regex. * txr.c (help): Cover above options.
* New --yydebug option.Kaz Kylheku2015-08-241-0/+14
| | | | | | | | | | | * parser.y (have_yydebug): New global constant. (yydebug_onoff): New function. * parser.h (have_yydebug, yydebug_onof): Declared. (yydebug_onoff): New function. * txr.c (help): List --yydebug option. (txr_main): --yydebug option implemented.
* Fix TEXT macro clash on Windows.Kaz Kylheku2015-08-141-0/+1
| | | | | * txr.c (TEXT): Undefined this macro after including <windows.h>. It clashes with a TEXT macro in y.tab.h.
* Crafting a better parser-priming hack.Kaz Kylheku2015-08-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The method of inserting a character sequence which generates a SECRET_TOKEN_E token is being replaced with a purely token based method. Because we don't manipulate the input stream, the lexer is not involved. We don't have to flush its state and deal with the carry-over of the yy_hold_char. This comes about because recent changes expose a weakness in the old scheme. Now that a top-level expression can have the form expr.expr, it means that the Yacc parser reads one token ahead, to see whether there is a dot or something else. This lookahead token is discarded. We must re-create it when we call yyparse again. This re-creation is done by creating a custom yylex function, which can maintain pushback tokens. We can prime this array of pushback tokens to generate the SECRET_TOKEN_E, as well as to re-inject the lookahead symbol that was thrown away by the previous yyparse. To know which lookahead symbol to re-inject is simple: the scanner just keeps a copy of the most recent token that it returns to the parser. When the parser returns, that token must be the lookahead one. The tokens we keep now in the parser structure are subject to garbage collection, and so we must mark them. Since the YYSTYPE union has no type field, a new API is opened up into the garbage collector to help implement a conservative GC technique. * gc.c (gc_is_heap_obj): New function. * gc.h (gc_is_heap_obj): Declared. * match.c: Include y.tab.h. This is now needed by any module that needs to instantiate a parser_t structure, because members of type YYSTYPE occur in the structure. (parser.h can still be included without y.tab.h, but only an incomplete declaration for the parser strucure is then given, and a few functions are not declared.) * parser.c (yy_tok_mark): New static function. (parser_mark): Mark the recent token and the pushback tokens. (parser_common_init): Initialize the recent token, the pushback tokens, and the pushback stack index. (pushback_token): New static function. (prime_parser): hold_byte argument removed. Body considerably simplified. The catenated stream trick is no longer required. All we do here is set up two pushback tokens and prime the scanner, if necessary, so it is in the right start state for Lisp. * parser.l (YY_DECL): Take over definition of scanning function, renaming to yylex_impl, so we can implement yylex. (grammar): Rule which produces SECRET_ESCAPE_E token removed. (reset_scanner): Function removed. (yylex): New function. * parser.h (struct parser): Now only forward-declared unless y.tab.h has been included. New members, recent_tok, tok_pushback and tok_idx. (yyset_hold_char): Declared. (reset_scanner): Declaration removed. (yylex): Declared (if y.tab.h included). (prime_parser): Declaration updated. (prime_scanner): Declared. * Makefile: express new dependency on existence of y.tab.h of txr.o, match.o and parser.o.
* Suppress debug stepping into auto-loaded library code.Kaz Kylheku2015-08-061-6/+22
| | | | | | | | | | | | | | | | | | | | | * debug.c (debug_set_state, debug_restore_state): New functions. * debug.h (debug_state_t): New type. (debug_set_state, debug_restore_state): Declared, and defined as dummy macros in non-debug-support build. * lisplib.c (opt_dbg_autoload): New global variable. (lisplib_try_load): Disable or enable debugging around library loading based on opt_dbg_autoload option. * lisplib.h (opt_dbg_autoload): Declared. * txr.c (help): List --debug-autoload option. (no_dbg_support): New static function to avoid repeated code. (txr_main): Add debugger option. Change duplicate no debug support error messages into calls to no_dbg_support. * txr.1: Document --debug-autoload
* * txr.c (txr_main): Bugfix: debugger long option nonfunctional.Kaz Kylheku2015-08-061-1/+1
|
* Switching some globals to lexical and changing some names.Kaz Kylheku2015-08-031-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * arith.c (arith-init): Changing *flo-...* from special to lexical, and adding un-earmuffed variants. The earmuffed versions are obsolescent. Adding %pi% and %e% global lexicals. Earmuffed versions are also made global lexical, and obsolescent. * eval.c (lookup_global_var, lookup_global_var_l): New functions. (lookup_var): Uses lookup_global_var. (reg_varl): New function. (reg_var): Uses reg_var. (eval_init): Register global lexicals user-package, system-package and keyword-package. Old symbols with earmuffs are obsoleted, and also turned into global lexicals. (top-vb, top-fb): Changed to lexical. * eval.h (lookup_global_var, lookup_global_var_l, reg_varl): Declared. * genvim.txr: Scan ver.tl so that the lib-version variable is included. Extract reg_varl calls. * glob.c (glob_init): glob-err and other variables made lexical. * lib.c (get_user_package, get_system_package, get_keyword_package): Use lookup_global_var_l to avoid searching dynamic scope for lexicals which cannot be dynamically rebound. * share/txr/stdlib/ver.tl (lib-version): New global lexical variable. (*lib-version*): Turned lexical. Obsolescent. * signal.c (sig-init): sig-* variables turned lexical. * sysif.c (sysif-init): s-*, poll-* and w-* variables turned lexical. * syslog.c (syslog-init): log-* variables turned lexical. * txr.c (sysroot-init): stdlib and *txr-version* variables turned lexical. txr-version variable added, and *txr-version* is obsolescent. (txr-main): self-path variable added. *self-path* turns lexical and is obsolescent. * txr.1: Documentation updated. Lexical variables not referred to as special. Special variables referred to as special.
* * txr.c (txr_main): Bugfix: register *args-full*, the variableKaz Kylheku2015-08-031-0/+1
| | | | | described in the documentation! We keep *full-args* for backward compatibility, as an obsolescent feature.
* Hash-bang support for .tl files.Kaz Kylheku2015-07-021-1/+1
| | | | | | | | | | | | | | | | * parser.c (read_eval_stream): New boolean argument to request hash bang support. * parser.h (read_eval_stream): Declaration updated. * eval.c (sys_load): Pass new thid argument to read_eval_stream, to decline hash bang support. * match.c (v_load): Likewise. * txr.c (txr_main): Request hash bang support from read_eval_stream. Thus files referenced from the txr command line can have a #! line, which is ignored.
* Adding anaphoric ifa macro.Kaz Kylheku2015-06-171-2/+5
| | | | | | | | | | | | | | | | | | | | * Makefile (install): Install .tl files present in stdlib directory. (INSTALL): Handle argument 2 being a list. * eval.c (load): New function. * eval.h (load): Declared. * lisplib.c (ifa_set_entries, ifa_instantiate): New functions to lazily load ifa.tl. (lisplib_init): Register new functions. * txr.c (stdlib_path): New variable. (sysroot_init): Store the stdlib path in stdlib_path. * txr.h (stdlib_path): Declared. * share/txr/stdlib/ifa.tl: New file.
* New --lisp option: treat unsuffixed files as Lisp.Kaz Kylheku2015-06-131-0/+4
| | | | | * txr.c (help): Added help text. (txr_main): Handle lisp option.
* * txr.c (txr_main): Handle Lisp files.Kaz Kylheku2015-06-131-0/+3
|