summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschottstaedt <schottstaedt@b278ec2f-9027-4a79-a958-f306da2c2c68>2020-09-28 09:37:59 +0000
committerschottstaedt <schottstaedt@b278ec2f-9027-4a79-a958-f306da2c2c68>2020-09-28 09:37:59 +0000
commit273f923170d251526c8e61039cd624955ec0a276 (patch)
treeff157763c0a399248b41aad750214fdab8659ee6
parente10053eff7c339940e557d378c9fc6bd8d1e940b (diff)
minor cleanups
git-svn-id: https://svn.code.sf.net/p/snd/svn1/trunk@958 b278ec2f-9027-4a79-a958-f306da2c2c68
-rw-r--r--s7.c23
-rw-r--r--s7.h2
-rw-r--r--s7test.scm17
-rw-r--r--snd.h2
4 files changed, 25 insertions, 19 deletions
diff --git a/s7.c b/s7.c
index 84df3ea..5f22831 100644
--- a/s7.c
+++ b/s7.c
@@ -9793,17 +9793,10 @@ static bool tree_is_cyclic(s7_scheme *sc, s7_pointer tree)
result = tree_is_cyclic_or_has_pairs(sc, tree);
if (result == TREE_NOT_CYCLIC) return(false);
if (result == TREE_CYCLIC) return(true);
-
-#if S7_DEBUGGING
- if (sc->tree_pointers_top != 0)
- fprintf(stderr, "top: %d\n", sc->tree_pointers_top);
-#endif
-
result = tree_is_cyclic_1(sc, tree);
for (i = 0; i < sc->tree_pointers_top; i++)
tree_clear_collected(sc->tree_pointers[i]);
sc->tree_pointers_top = 0;
-
return(result);
}
@@ -52389,7 +52382,7 @@ static s7_pointer c_object_to_let(s7_scheme *sc, s7_pointer obj)
((has_active_methods(sc, clet)) || (has_active_methods(sc, obj))))
{
s7_pointer func;
- func = find_method(sc, clet, sc->object_to_let_symbol); /* TODO: method in obj or is check above redundant? */
+ func = find_method(sc, clet, sc->object_to_let_symbol);
if (func != sc->undefined)
call_method(sc, clet, func, list_2(sc, obj, let));
}
@@ -74302,7 +74295,6 @@ static opt_t optimize_func_two_args(s7_scheme *sc, s7_pointer expr, s7_pointer f
set_opt3_arglen(expr, small_two);
return(OPT_F);
}
- /* TODO: [safe_]closure*_(f|p)p */
#if (UNOPT_PRINT > 1)
if (!is_optimized(expr)) fprintf(stderr, "%s[%d]: %s\n", __func__, __LINE__, display(expr));
#endif
@@ -74332,7 +74324,6 @@ static opt_t optimize_func_two_args(s7_scheme *sc, s7_pointer expr, s7_pointer f
#if (UNOPT_PRINT > 1)
if (!is_optimized(expr)) fprintf(stderr, "%s[%d]: %s\n", __func__, __LINE__, display(expr));
#endif
- /* TODO: lots of oddities here: (float-vector-set! v1 arg) file-mtime/directory (s7test) */
return((is_optimized(expr)) ? OPT_T : OPT_F);
}
@@ -74950,7 +74941,6 @@ static opt_t optimize_func_many_args(s7_scheme *sc, s7_pointer expr, s7_pointer
#if (UNOPT_PRINT > 1)
if (!is_optimized(expr)) fprintf(stderr, "%s[%d]: %s\n", __func__, __LINE__, display(expr));
#endif
- /* inlet + many args TODO: closure*_fp (s7test tiny-cl) */
return((is_optimized(expr)) ? OPT_T : OPT_F);
}
@@ -97837,7 +97827,7 @@ void s7_free(s7_scheme *sc)
s7_int i;
gc_list_t *gp;
- g_gc(sc, sc->nil); /* probably not needed */
+ g_gc(sc, sc->nil); /* probably not needed (my simple tests work fine if the gc call is omitted) */
gp = sc->vectors;
for (i = 0; i < gp->loc; i++)
@@ -97868,7 +97858,6 @@ void s7_free(s7_scheme *sc)
free(gp->list);
free(gp);
- /* TODO: Windows is different I think */
gp = sc->input_ports;
for (i = 0; i < gp->loc; i++)
if ((unchecked_port_data_block(gp->list[i])) &&
@@ -98169,7 +98158,7 @@ int main(int argc, char **argv)
* tsort 4156 | 3043 | 3031 2989 2989 3690
* tset 6616 | 3083 | 3168 3175 3175 3166
* tmac 3391 | 3186 | 3176 3171 3167 3257
- * tnum | | 3518 3257
+ * tnum | | 3518 3257 61.3
* teq 4081 | 3804 | 3806 3804 3800 3813
* dup | | 3232 3171 3926
* tfft 4288 | 3816 | 3785 3846 3844 11.5
@@ -98190,5 +98179,9 @@ int main(int argc, char **argv)
*
* --------------------------------------------------------------------------
*
- * nrepl+notcurses, menu items, (if selection, C-space+move also), colorize?
+ * nrepl+notcurses, menu items, (if selection, C-space+move also),
+ * colorize: offer hook into all repl output and example of colorizing
+ * support for 1.7.2 in fedora 32?
+ * nc-display, but what about input?
+ * t725 gaps
*/
diff --git a/s7.h b/s7.h
index 94ececc..18c655c 100644
--- a/s7.h
+++ b/s7.h
@@ -2,7 +2,7 @@
#define S7_H
#define S7_VERSION "9.6"
-#define S7_DATE "28-9-20"
+#define S7_DATE "29-9-20"
#include <stdint.h> /* for int64_t */
diff --git a/s7test.scm b/s7test.scm
index 4e75261..d7d0c1b 100644
--- a/s7test.scm
+++ b/s7test.scm
@@ -6400,7 +6400,7 @@ i" (lambda (p) (eval (read p)))) pi)
(test (string-copy "" (make-string 4 #\.)) "....")
(test (string-copy "ho" "") "")
(test (string-copy "ho" ".") "h")
-(test (let () (define (func) (string-copy "abc" (substring "0123" 1))) (func)) "0abc") ; string_substring_chooser incorrectly from string_copy
+(test (let () (define (func) (string-copy "abc" (substring "0123" 1))) (func)) "abc") ; string_substring_chooser incorrectly from string_copy
(for-each
(lambda (arg)
@@ -40690,7 +40690,20 @@ or better (define-macro (prog vars . body) `(call-with-exit (lambda (return) (ta
(test (set! (documentation abs) "X the unknown") 'error)
(test (let ((str (documentation abs))) (set! ((documentation abs) 1) #\x) (equal? str (documentation abs))) #t)
(test (let ((str (documentation abs))) (fill! (documentation abs) #\x) (equal? str (documentation abs))) #t)
-
+(test (let ()
+ (define f1 (let ((+documentation+ "f1's doc"))
+ (lambda ()
+ (define f2 (lambda () 2))
+ (documentation f2))))
+ (f1)) "")
+(test (let ()
+ (define f1 (let ((+documentation+ "f1's doc"))
+ (lambda ()
+ (define f2
+ (let ((+documentation+ "f2's doc"))
+ (lambda () 2)))
+ (documentation f2))))
+ (f1)) "f2's doc")
(let ()
(define amac (let ((+documentation+ "this is a string")) (define-macro (_ a) `(+ ,a 1))))
(test-wi (documentation amac) "this is a string"))
diff --git a/snd.h b/snd.h
index 78a7d92..913f0ce 100644
--- a/snd.h
+++ b/snd.h
@@ -47,7 +47,7 @@
#include "snd-strings.h"
-#define SND_DATE "28-Sep-20"
+#define SND_DATE "29-Sep-20"
#ifndef SND_VERSION
#define SND_VERSION "20.8"
#endif