summaryrefslogtreecommitdiffstats
path: root/Makefile
Commit message (Collapse)AuthorAgeFilesLines
...
* * Makefile (all): Mark as phony target.Kaz Kylheku2014-12-091-0/+1
|
* Condensed make output.Kaz Kylheku2014-12-091-48/+65
| | | | | | | | | | | | | | | | * Makefile (VERBOSE): New variable. (V, ABBREV, ABBREV1, ABBREV3): New macro variables. (dbg/%.o, opt/%.o): Use V, ABBREV1 for concensed output. ($(PROG), $(PROG)-dbg, lex.yy.c, y.tab.c, %.out, %.ok, INSTALL): Likewise, but use ABBREV. (tests, GREP_CHECK, config.make, conftest.yacc, conftest.clean): Use $(V) instead of @. (tests.clean): Remove @; do not hide remove commands. (INSTALL): Use $(V) instead of @ and use ABBREV3 to provide condensed output. (install): Use $(V) on $(PREINSTALL) so we don't see : in the output. (install-tests): Put $(V) on all steps.
* Debug builds optional with --debug-also config option.Kaz Kylheku2014-12-071-2/+1
| | | | | | | | | * Makefile (PROG): Variable removed, now set in config.make. (all): Target now depends on $(BUILD_TARGETS) variable, set in config.make. * configure (debug_also) New variable. (gen_config_make): Generate PROG and BUILD_TARGETS variables.
* * Makefile (INSTALL): Bugfix: touch -r $(2) does not workKaz Kylheku2014-12-051-2/+2
| | | | | | right when $(2) is a wildcard like path/to/*.txr. It touches files in the source tree to the timestamp of the argument after -r. Putting in a shell loop to handle this.
* * Makefile (TESTS_TMP): New variable.Kaz Kylheku2014-12-051-8/+7
| | | | | | | | | | (TESTS_OUT): Depends on $(PROG). (TESTS_OK): Does not dependon $(PROG). (tests): Does not depend on tests.clean. (retest): Target removed. (%.out : %.txr): Generate to temporary file, then move to .out. (tests.clean): Remove $(TESTS_TMP).
* * Makefile (SRCS): Compute from top_srcdir, so we don't get a warningKaz Kylheku2014-12-051-2/+5
| | | | from git, and "make enforce" works from out of three builds.
* TXR now builds optimized and debug at the same time.Kaz Kylheku2014-12-041-13/+33
| | | | | | | | | | | | | | | | | | | | | | | | Optimized object files are under opt/ and debug object files are under dbg/. The debug txr executable is called txr-dbg. * Makefile (CFLAGS): $(OPT_FLAGS) is omitted from CFLAGS, so we can expand it where appropriate. (ADD_CONF, EACH_CONF): New variables, used as macros. (DBG_OBJS, OPT_OBJS): New variables. (dbg/%.o, opt/%.o): New rules. (all): New target. ($(PROG)-dbg): New target. (clean): Remove the object directories with rm -rf. Remove $(PROG)-dbg. (depend): Pass $(OPT_OBJS) and $(DBG_OBJS) to depend.txr Also: various target-specific assignments for object files had to be split for rel and dbg. * depend.txr: Updated to handle dbg/ or rel/ prefix on object file paths. * dep.mk: Regenerated.
* * Makefile (clean): add tests.clean as prerequisite.Kaz Kylheku2014-12-041-4/+10
| | | | | (tests): Add tests.clean as prerequiste, remove rm command. (retest, tests.clean): New rules.
* * Makefile (tests/009/json.out): Use eager assignmentKaz Kylheku2014-12-041-1/+1
| | | | intead of lazy assignment to set TXR_ARGS.
* * Makefile (TXR): New variable. We use this to run txrKaz Kylheku2014-12-041-27/+36
| | | | | | | | | | | | | | | | | | | | | | | rather than ./$(PROG). This way we can override the variable from the command line if necessary. (TESTS): Variable removed. (TESTS_OUT, TESTS_OK): New variables, replace TESTS. (tests): Prerequisites is now $(TESTS_OK), which are actual timestamp files. Also depends on $(PROG). (tests/%/%): Target specific assignments are now for .out targets rather than .ok targets. (%.out): New pattern target, made from half of previous %.ok rule. (%.ok): Smaller rule, only performs diff between .out and .expected, and touches the .ok stamp. (%.expected): Bugfix: this rule now just copies .out to .expected, and its prerequisite is %.out rather than %.txr. Previously it tried to run txr, but it wouldn't use the correct options, which depended on the target-specific assignments for various .ok files. (install-tests): Bugfix: in the "make -s -n" call use the new TXR variable to specify the program's path. This fixes the issue that ./ was prepended to the txr commands, resulting in nonworking run.sh. (txr-manpage.html): Use TXR to invoke txr rather than PROG.
* * Makefile: Adding empty .SUFFIXES: to disable built-in suffixes.Kaz Kylheku2014-12-041-0/+6
| | | | | Also set MAKEFLAGS to disable all built-in rules. The only one rule we used is .c to .o, so we provide it ourselves.
* GNU Flex's libfl library provides nothing. Let us not refer to it. ItKaz Kylheku2014-10-241-1/+1
| | | | | | | | | | | | only causes build issues on some systems where it is not provided in the standard location, or is not cross-compiled properly. * Makefile (LEXLIB): Reference to variable removed. * configure (lexlib): Variable removed. (LEXLIB): config.make variable not generated. * parser.l (yywrap): Provide this trivial function as inline.
* * Makefile: Removing trailing spaces.Kaz Kylheku2014-10-241-9/+16
| | | | | | | | | | (GREP_CHECK): New macro. (enforce): Rewritten using GREP_CHECK, with new checks. * arith.c, combi.c, debug.c, eval.c, filter.c, gc.c, hash.c, lib.c, * lib.h, match.c, parser.l, parser.y, rand.c, regex.c, signal.c, * signal.h, stream.c, syslog.c, txr.c, unwind.c, utf8.c: Remove trailing spaces.
* Purge stray occurrences of "void *" from code base.Kaz Kylheku2014-10-171-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib.c (cobj_print_op): In the format call, cast the C pointer to val, since the ~p conversion now takes a val rather than void *. (cptr_equal_op, obj_print, obj_pprint): Remove cast to void *, since obj now already has the type that ~p expects. * lib.h (struct any): Use mem_t * instead of void *. * parser.h (yyscan_t): Repeat the definition from inside the Flex-generated lex.yy.c. (yylex_init, yylex_destroy, yyget_extra, yyset_extra): Re-declare using yyscan_t typedef in place of void *. * parser.l (yyget_column, yyerrprepf): Re-declare using yyscan_t. (grammar): Use yyg in place of yyscanner in calls to yyerrprepf. * parser.y (yylex, %lex-param): Use yyscan_t instead of void *. (parse): Use yyscan_t for local variable. * signal.c (stack): Change type from void * to mem_t *. * stream.c (vformat): Conversion specifier p extracts val instead of void *. (run): Use casts that only remove const, not all the way to void *. * txr.1: Documented p conversion specifier of format. * Makefile (OBJS-y): Initialize with := to make sure it is a simple variable, and not a macro. (SRCS): New variable, listing source files. (enforce): New rule for enforcing coding conventions. Currently checks for void * occurrences.
* Moving system interface functions to separate module out ofKaz Kylheku2014-10-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the eval and stream modules. * Makefile (OBJS): Add sysif.o. * dep.mk: Regenerated. * eval.c (errno_wrap, daemon_wrap, exit_wrap, usleep_wrap, getpid_wrap, getppid_wrap, env_hash): Functions moved to sysif.c and changed to static functions. (eval_init): Registrations of functions moved to sysif.c. * lib.c (init): Call sysif_init. * stream.c (w_stat, statf, mkdir_wrap, chdir_wrap, getcwd_wrap, makedev_wrap, minor_wrap, major_wrap, mknod_wrap): Functions moved to sysif.c and become static functions. (stream_init): Registration of stat moved to sysif.c. (open_files, open_files_star): Bugfix: no longer erroneously included in #ifdef HAVE_UNISTD_H block. * stream.h (mkdir_wrap, chdir_wrap, getcwd_wrap, makedev_wrap, minor_wrap, major_wrap, mknod_wrap, symlink_wrap, link_wrap, readlink_wrap): Declarations removed. * sysif.c: New file. * sysif.h: New file.
* Add test case for recent breakage.Kaz Kylheku2014-10-081-0/+1
| | | | | | | | | | * tests/006/freeform-3.expected: New file. * tests/006/freeform-3.txr: New file. * tests/006/passwd: New file. * Makefile (TXR_ARGS): Set up for new test case.
* Version 99.txr-99Kaz Kylheku2014-10-051-8/+9
| | | | | | | | | | | | * RELNOTES: Updated. * configure, txr.1: Bumped version. * share/txr/stdlib/ver.txr: Likewise * Makefile: Improve binary packaging rules. * regex.c: #include <stdarg.h> added.
* * Makefile: rules that rely on values from config.makeKaz Kylheku2014-10-031-2/+4
| | | | now have config.make as a prerequisite.
* * Makefile (txr-manpage.pdf): New target.Kaz Kylheku2014-09-221-0/+3
|
* * Makefile, arith.c, arith.h, combi.c, combi.h, configure, debug.c,Kaz Kylheku2014-07-231-19/+16
| | | | | | | | debug.h, eval.c, eval.h, filter.c, filter.h, gc.c, gc.h, hash.c, hash.h, lib.c, lib.h, match.c, match.h, parser.h, parser.l, parser.y, rand.c, rand.h, regex.c, regex.h, signal.c, signal.h, stream.c, stream.h, syslog.c, syslog.h, txr.c, txr.h, unwind.c, unwind.h, utf8.c, utf8.h: Synchronize license header with LICENSE.
* * Makefile (conftest, conftest2): Link mathKaz Kylheku2014-07-181-2/+2
| | | | | | | | | | | | | | | | | | | library so we can test for math functions. * arith.c (log2_init): New static function. (log2, logtwo): New functions. (l2): New static variable. (arith_init): Call log2_init. * configure (lang_flags): Switching _XOPEN_SOURCE from 500 to 600 to reveal log2. Adding test for log2. * eval.c (eval_init): Register log2 intrinsic. * lib.h (logtwo): Declared. * txr.1: Documented log2.
* * Makefile: install the LICENSE and METALICENSE files into the dataKaz Kylheku2014-07-071-0/+2
| | | | | | | | | | | | directory. * txr.c (help): Help text updated to document --license option. (license): New function. (txr_main): Implement --license option. * unwind.h (uw_catch): Add cast to suppress warning about unused symbol. * txr.1: Document --license option.
* * Makefile: use $(EXE) in install: recipe.Kaz Kylheku2014-07-021-1/+1
| | | | * configure: set up EXE variable in config.make, not exe.
* * Makefile: Install share/txr/stdlib/*.txr material.Kaz Kylheku2014-06-121-0/+1
| | | | | | | | | | | * match.c (do_txeval): If a variable is not in the bindings, fall back on treating it as a TXR Lisp dynamic variable. This allows us to refer to the stdlib variable from a quasistring in a @(load ...) directive. * txr.c (sysroot_init): Register new variable, *txr-version*. * share/txr/stdlib/ver.txr: New file.
* * Makefile (txr.o): Pass TXR_VER preprocessor symbol on gcc commandKaz Kylheku2014-06-111-0/+20
| | | | | | | | | | | | | | | | | | | | line. (PREINSTALL): New variable holding a step for the install recipe. (pax tar zip): New targets. * configure (txr_ver): Version now added to config.make, passed through to txr.c. (gen_config_make): bindir, datadir and mandir are established using gmake's regular macro assignment (=) rather than expanding assignment (:=). This allows us to override the prefix variable after configure time. * lib.h (wli_noex): New macro. (wli): Retarget to wli_noex, so that argument is subject to macro replacement. * txr.c (version): Use TXR_VER defined on compiler command line, rather than hard-coded string literal.
* 2014-06-10 Kaz Kylheku <kaz@kylheku.com>Kaz Kylheku2014-06-101-5/+11
| | | | | | | | | | | | | | | * Makefile (PROG): Removing ./ prefix from variable name; adding it to invocations of $(PROG) in some rules. (txr.o): Pass several strings as macros on the command line: TXR_REL_PATH, EXE_SUFF and PROG_NAME. * configure (bindir, datadir, mandir): These variables become just relative paths from the prefix. * txr.c (sysroot): Use the TXR_REL_PATH, EXE_SUFF and PROG_NAME preprocessor symbols defined on the command line to avoid hard-coding strings like "bin/txr" and "bin/txr.exe" which actually should reflect the value of the bindir variable.
* * Makefile: fix broken tests; numerous test cases outputKaz Kylheku2014-06-091-1/+8
| | | | | bindings, and need the -B option. One test case does not need the -l option which now implies -B.
* * Makefile (lex.yy.c): Remove lex.yy.c before trying to regenerate it.Kaz Kylheku2014-03-021-1/+3
| | | | | | (y.tab.c, y.tab.h): Remove y.tab.c before running yacc. Write-protect y.tab.c, not $@, which could expand to the y.tab.h target if that is what triggered the rule.
* * parser.y (unquotes_occur): Fix use of unquote_s rather than sys_unquote_sKaz Kylheku2014-03-021-1/+2
| | | | | | | | | which breaks backquote, caught by tests/010/reghash.txr. I thought fixed this already! But I must have made the change to y.tab.c rather than parser.y. * Makefile (lex.yy.c, y.tab.c): Make these files readonly to prevent unintended edits.
* * Makefile: Use target-specific assignmentKaz Kylheku2014-02-281-0/+2
| | | | | to suppress TXR_DBG_OPTS for tests under tests/011. The --gen-gc makes mandel.txr run too slow.
* * Makefile (OBJS): New object file, combi.o.Kaz Kylheku2014-02-111-1/+1
| | | | | | | | | | | | | | | | * dep.mk: Updated. * eval.c: Removed combination and permutation functions; they now reside in combi.c. (generate): Changed from static to external linkage. * eval.h (generate): Declared. * combi.c: New file. * combi.h: New file. * txr.vim: Regenerated.
* Long overdue MinGW port maintenance.Kaz Kylheku2014-01-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Makefile: Use new EXE variable from config.mk. * configure (exe, have_windows_h): New variables. Handle situations with .exe suffix; on MiGW, the rm command doesn't work on executables if the .exe suffix is not given. New tests for localtime_r and gmtime_r. * lib.c: Supply declarations which are missing on MinGW because we use gcc -ansi, because MinGW doesn't follow established conventions like -D_POSIX_SOURCE. Supply definitions for gmtime_r, localtime_r, setenv and unsetenv. * parser.l: Supply declarations which are missing on MinGW. * signal.h (async_sig_enabled): Declare differently based on HAVE_POSIX_SIGS. Misspelled typedef fixed in the code for !HAVE_POSIX_SIGS that has hitherto not been compiled. (sig_mask): Wrap declaration in #ifdef HAVE_POSIX_SIGS because it relies on sigset_t. * stream.c: Supply declarations which are missing on MinGW. Include <windows.h> if we have it. (sleep): Define for Windows. (statf): Handle missing st_blksize and st_blocks members in struct stat. (stream_init): Handle numerous missing S_* macros. * utf8.c: Supply declarations which are missing on MinGW.
* First cut at signal handling support.Kaz Kylheku2013-12-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Makefile (OBJS-y): Include signal.o if have_posix_sigs is "y". * configure (have_posix_sigs): New variable, set by detecting POSIX signal stuff. * dep.mk: Regenerated. * arith.c, debug.c, eval.c, filter.c, hash.c, match.c, parser.y, parser.l, rand.c, regex.c, syslog.c, txr.c, utf8.c: Include new signal.h header, now required by unwind, and the <signal.h> system header. * eval.c (exit_wrap): New function. (eval_init): New functions registered as intrinsics: exit_wrap, set_sig_handler, get_sig_handler, sig_check. * gc.c (release): Unused functions removed. * gc.h (release): Declaration removed. * lib.c (init): Call sig_init. * stream.c (set_putc, se_getc, se_fflush): New static functions. (stdio_put_char_callback, stdio_get_char_callback, stdio_put_byte, stdio_flush, stdio_get_byte): Use new functions to enable signals when blocked on I/O. (tail_strategy): Allow signals across sleep. (pipev_close): Allow signals across waitpid. (se_pclose): New static function. (pipe_close): Use new function to enable signals across pclose. * unwind.c (uw_unwind_to_exit_point): use extended_longjmp instead of longjmp. * unwind.h (struct uw_block, struct uw_catch): jb member changes from jmp_buf to extended_jmp_buf. (uw_block_begin, uw_simple_catch_begin, uw_catch_begin): Use extended_setjmp instead of setjmp. * signal.c: New file. * signal.h: New file.
* Bumping copyrights to 2014 and expressing them as year ranges.Kaz Kylheku2013-12-101-1/+1
| | | | Fixing some errors in copyright comments.
* syslog support; bitwise logior and logand functions become variadic.Kaz Kylheku2013-12-101-3/+4
| | | | | | | | | | | | | | | | | | | | * Makefile: Use -iquote to restrict our #include search paths from being processed for #include <...>. Add syslog.o to OBJS-y if have_syslog is y. * configure (have_syslog): New variable, set by detecting syslog API. * eval.c (eval_init): logand and logior registrations changed to go to variadic versions. New syslog variables and functions registered. * lib.c (logandv, logiorv): New functions. * lib.h (logandv, logiorv): Declared. * txr.c (main): Call syslog_init. * syslog.c: New file. * syslog.h: New file.
* * Changelog: missing entries reconstructed.Kaz Kylheku2013-11-271-1/+1
| | | | | | | | | | | | | * Makefile (conftest.clean): Use @ to suppress output. * configure (have_unistd): New variable. Set true by every successful test that compiles something that contains #include <unistd.h>. HAVE_UNISTD_H is conditionally generated in config.h based on this variable. Minor cleanup. * parser.l: Inclusion of <unistd.h> wrapped in #if/#endif. * stream.c: Conditional inclusion of <unistd.h> based on new HAVE_UNISTD_H symbol.
* * Makefile (clean): depends on conftest.cleanKaz Kylheku2013-10-281-1/+7
| | | | | | | | (conftest.clean): New target. * configure: Use "make conftest.clean" to clean up conftest stuff. Note that there was a bug here: brace expansion was used, but the shell is /bin/sh, so conftest.err wasn't being removed.
* Fixes for configuring and building in a separate directory.Kaz Kylheku2012-04-201-4/+4
| | | | | | | | | | * configure: MPI is now extracted and patched in the build directory, not in the source directory. * Makefile (CFLAGS): Refer to mpi headers relative to current directory, not $(top_srcdir). (repatch): Run MPI repatching steps in correct directory. (clean): Remove extracted MPI from build directory.
* More NetBSD porting.Kaz Kylheku2012-04-101-1/+1
| | | | | | | | | | | | | | | | | | * Makefile (EXTRA_FLAGS): Handy new variable for additional ad-hoc CFLAGS. Needed by a new test in configure. * configure: Check for annoying warnings about char being used as an array subscript when calling the macros from <ctype.h>. If this occurs, suppress it by #undef-ing the macros. (lang_flags): Switching fromm _XOPEN_SOURCE to _XOPEN_SOURCE=2 because this is needed on NetBSD to obtain declarations of popen and pclose. * stream.c (pipe_close): If we don't have the WIFCONTINUED macro, then define it to expand to zero. It's absent on NetBSD and they already seem to have a hack for this because there is a warning about the function not being defined, but then the program links anyway. Let's do it properly and not rely on their hack.
* * Makefile (conftest.ccver): New phony target.Kaz Kylheku2012-04-101-0/+4
| | | | | | | * configure: The test for non-working 128 bit integers in the gcc used by NetBSD 5.1 is not good enough to catch the bug. Adding a test which will assume that gcc 4.3.x and lesser does not have working 128 bit types.
* Fixes to get configure ccname=g++ working on OSX Lion.Kaz Kylheku2012-04-071-1/+1
| | | | | | | | | | | | | | | | * Makefile (conftest.syms): Use -n flag in nm so that the output is not alphabetically sorted, but numerically. We need this to get the symbols ordered by increasing offset. * configure (read_syms): New function. Factors out logic used in two places for reading the output of nm. On OSX Lion, it looks like we do not get symbol sizes but offsets only, when compiling with g++. The symbols are in an S section. When compiling with gcc, we get a common C section with symbol sizes. So the hack is to use the deltas between offsets to get the sizes. The objects had to be re-ordered in decreasing rank so alignment doesn't create padding that will get counted as the size. Interleaved dummy objects of type char should also work.
* * Makefile (TXR_ARGS): Pass new file to tests/009/json.txr test.Kaz Kylheku2012-03-231-1/+1
| | | | | | | | | | * tests/009/json.expected: Updated. * tests/009/json.txr: Updated source. Translates to a more native representation with vectors and hash tables. Numbers go to floating point instead of remaining as strings. * tests/009/pass1.json: New file: a test case from json.org.
* * Makefile: link in -lm, which is needed now on some systems.Kaz Kylheku2012-03-211-1/+1
| | | | | * arith.c (plus, minus): Eliminated some unnecessary (double) casts. (abso, mul): Floating support.
* This test case would have caught the prior regression.Kaz Kylheku2012-02-021-0/+1
| | | | | | | | | | * Makefile (TXR_ARGS): Defined for new test case. * tests/010/align-columns.dat: New file. * tests/010/align-columns.expected: New file. * tests/010/align-columns.txr: New file.
* Improved debugging. Debug nesting depth counter maintainedKaz Kylheku2012-01-211-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and used for next/step/finish stepping. * Makefile (OBJS): debug.o moved to OBJS-y or OBJS-. (OBJS-y, OBJS-): New variables. $(PROG): Depends on OBJS-y also. clean: clean $(OBJS-y). depend: include $(OBJS-y) in dependency generation. * configure: Underscores and dashes are interchangeable in configure variables. (yaccname_given, yacc_given): Default value is y, not yes. (debug_support): New config variable. (CONFIG_DEBUG_SUPPORT): New config.h symbol. * debug.c (debug_depth): New global variable. (debug_block_s): New symbol variable. (next_depth): New static variable. (debug): Renamed some commands. Introduced separate next, step and finish. (debug_init): debug_block_s initialized. * debug.h (debug_depth, debug_block_s): Declared. (debug_enter, debug_leave, debug_return): New macros. (debug_check, debug_init): Conditionally defined based on if this is a debug build. * dep.mk: Regenerated. * eval.c (eval): Instrumented with debug_enter, debug_leave, debug_return. * match.c (match_line, v_fun, match_files): Likewise. * txr.c (txr_main): Bail if -d or --debug used in build that lacks debug support.
* * Makefile (OBJS): new object file, rand.o.Kaz Kylheku2011-12-211-1/+1
| | | | | | | | | | | | * eval.c: Includes rand.h header. (eval_init): New variable and functions from rand module registered. * lib.c: Includes rand.h header. (init): Call rand_init. * rand.c: New file. * rand.h: New file.
* * Makefile (distclean): use rm -rf on mpi directory.Kaz Kylheku2011-12-211-1/+2
|
* * Makefile (repatch): New phony target.Kaz Kylheku2011-12-131-2/+7
| | | | (distclean): Remove mpi directory.
* Bignum support, here we go!Kaz Kylheku2011-12-091-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bignums, based on Michael Fromberger's MPI library, are integrated into the input syntax, stream output, equality testing, the garbage collector, and hashing. The plus operation handles transitions between fixnums and bignums. Other operations are still fixnum only. * Makefile (CFLAGS): Add mpi directory to include file search. (OBJS): Include new arith.o module and all of MPI_OBJS. (MPI_OBJS, MPI_OBJS_BASE): New variables. * configure (mpi_version, have_quilt, have_patch): New variables. Script detects whether patch and quilt are available. Unpacks mpi library, applies patches. Detects 128 bit integer type. Records more information in config.h about the sizes of types. * dep.mk: Updated. * depend.txr: Make work with paths that have directory components. * eval.c (eval_init): Rename of nump to fixnump. * gc.c (finalize, mark_obj): Handle BGNUM case. * hash.c: (hash_c_str): Changed to return unsigned long instead of long. (equal_hash): Handle BGNUM case. (eql_hash): Handle bignums with equal-hash, but other objects as eq. * lib.c (num_s): Variable renamed to fixnum_s. (bignum_s): New symbol variable. (code2type): Follow rename of num_s. Handle BGNUM case. (typeof): Follow rename of num_s. (eql): Handle bignums using equal, and other types using eq. (equal): Handle BGNUM case. (chk_calloc): New function. (c_num): Wording change in error message: is not a fixnum. (nump): Renamed to fixnump. (bignump): New function. (plus): Function removed, reimplemented in arith.c. (int_str): Handle integers which are too large for wcstol using bignum conversion. Base 0 is no longer passed to wcstol but converted to 10 because the special semantics for 0 would be inconsistent for bignums. (obj_init): Follow rename of num_s. Initialize bignum_s.
* Task #11436Kaz Kylheku2011-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Lisp interpreter added. * gc.c (finalize, mark_obj): Handle ENV objects. * hash.c (struct hash): acons_new_l_fun function pointer order of arguments change. (equal_hash): Handle ENV. (make_hash, gethash_l): Use cobj_handle for type safety. Follow change in acons_new_l. (gethash, gethash_f, remhash, hash_count, hash_get_userdata, hash_set_userdata, hash_next): Use cobj_handle. (gethash_n): New function. * hash.h (gethash_n): Declared. * lib.c (env_s): New symbol variable. (code2type, equal): Handle ENV. (plusv, minusv, mul, mulv, trunc, mod, gtv, ltv, gev, lev, maxv, minv, int_str): New functions. (rehome_sym): New static function. (func_f0, func_f1, func_f2, func_f3, func_f4, func_n0, func_n1, func_n2, func_n3, func_n4): Initialize new fields of struct func. (func_f0v, func_f1v, func_f2v, func_f3v, func_f4v, func_n0v, func_n1v, func_n2v, func_n3v, func_n4v, func_interp): New functions. (apply): Function removed: sanely re-implemented in new eval.c file. (funcall, funcall1, funcall2, funcall3, funcall4): Handle variadic and interpreted functions. (acons, acons_new, acons_new_l, aconsq_new, aconsq_new_l): Reordered arguments for compatibility with Common Lisp acons. (obj_init): Special hack to prepare hash_s symbol, which is needed for type checking inside the hash table funtions invoked by make_package, at a time when the symbol is not yet interned. Initialize new env_s variable. (obj_print, obj_pprint): Handle ENV. Fix confusing rendering of of function type. (init): Call new function eval_init. * lib.h (enum type): New enumeration member ENV. (struct func): functype member changed to bitfield. New bitfied members minparam and variadic. New members in f union: f0v, f1v, f2v, f3v, f4v, n0v, n1v, n2v, n3v, n4v. (struct env): New type. (union obj): New member e of type struct env. (env_s): Variable declared. (plusv, minusv, mul, mulv, trunc, mod, gtv, ltv, gev, lev, maxv, minv,