ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/microscheme/scheme.c
(Generate patch)

Comparing cvsroot/microscheme/scheme.c (file contents):
Revision 1.35 by root, Sun Nov 29 00:02:21 2015 UTC vs.
Revision 1.44 by root, Mon Nov 30 06:49:11 2015 UTC

16 * (MINISCM) This is a revised and modified version by Akira KIDA. 16 * (MINISCM) This is a revised and modified version by Akira KIDA.
17 * (MINISCM) current version is 0.85k4 (15 May 1994) 17 * (MINISCM) current version is 0.85k4 (15 May 1994)
18 * 18 *
19 */ 19 */
20 20
21#define EXPERIMENT 1
22
21#define PAGE_SIZE 4096 /* does not work on sparc/alpha */ 23#define PAGE_SIZE 4096 /* does not work on sparc/alpha */
22#include "malloc.c" 24#include "malloc.c"
23 25
24#define SCHEME_SOURCE 26#define SCHEME_SOURCE
25#include "scheme-private.h" 27#include "scheme-private.h"
74 TOK_SHARP_CONST, 76 TOK_SHARP_CONST,
75 TOK_VEC 77 TOK_VEC
76}; 78};
77 79
78#define BACKQUOTE '`' 80#define BACKQUOTE '`'
79#define DELIMITERS "()\";\f\t\v\n\r " 81#define WHITESPACE " \t\r\n\v\f"
82#define DELIMITERS "()\";" WHITESPACE
80 83
81#define NIL (&SCHEME_V->xNIL) //TODO: make this 0? 84#define NIL (&SCHEME_V->xNIL) //TODO: make this 0?
82#define S_T (&SCHEME_V->xT) //TODO: magic ptr value? 85#define S_T (&SCHEME_V->xT) //TODO: magic ptr value?
83#define S_F (&SCHEME_V->xF) //TODO: magic ptr value? 86#define S_F (&SCHEME_V->xF) //TODO: magic ptr value?
84#define S_SINK (&SCHEME_V->xsink) 87#define S_SINK (&SCHEME_V->xsink)
406} 409}
407 410
408INTERFACE char * 411INTERFACE char *
409symname (pointer p) 412symname (pointer p)
410{ 413{
411 return strvalue (car (p)); 414 return strvalue (p);
412} 415}
413 416
414#if USE_PLIST 417#if USE_PLIST
418#define symprop(p) cdr(p)
415SCHEME_EXPORT int 419SCHEME_EXPORT int
416hasprop (pointer p) 420hasprop (pointer p)
417{ 421{
418 return typeflag (p) & T_SYMBOL; 422 return typeflag (p) & T_SYMBOL;
419} 423}
420
421# define symprop(p) cdr(p)
422#endif 424#endif
423 425
424INTERFACE int 426INTERFACE int
425is_syntax (pointer p) 427is_syntax (pointer p)
426{ 428{
440} 442}
441 443
442INTERFACE char * 444INTERFACE char *
443syntaxname (pointer p) 445syntaxname (pointer p)
444{ 446{
445 return strvalue (car (p)); 447 return strvalue (p);
446} 448}
447 449
448#define procnum(p) ivalue_unchecked (p) 450#define procnum(p) ivalue_unchecked (p)
449static const char *procname (pointer x); 451static const char *procname (pointer x);
450 452
1092 set_cdr (x, b); 1094 set_cdr (x, b);
1093 1095
1094 return x; 1096 return x;
1095} 1097}
1096 1098
1097/* ========== oblist implementation ========== */
1098
1099static pointer 1099static pointer
1100generate_symbol (SCHEME_P_ const char *name) 1100generate_symbol (SCHEME_P_ const char *name)
1101{ 1101{
1102 pointer x = mk_string (SCHEME_A_ name); 1102 pointer x = mk_string (SCHEME_A_ name);
1103 setimmutable (x); 1103 setimmutable (x);
1104 x = immutable_cons (x, NIL);
1105 set_typeflag (x, T_SYMBOL); 1104 set_typeflag (x, T_SYMBOL | T_ATOM);
1106 return x; 1105 return x;
1107} 1106}
1107
1108/* ========== oblist implementation ========== */
1108 1109
1109#ifndef USE_OBJECT_LIST 1110#ifndef USE_OBJECT_LIST
1110 1111
1111static int 1112static int
1112hash_fn (const char *key, int table_size) 1113hash_fn (const char *key, int table_size)
1354 1355
1355 for (i = start; i < veclength (vec); i++) 1356 for (i = start; i < veclength (vec); i++)
1356 vecvalue (vec)[i] = obj; 1357 vecvalue (vec)[i] = obj;
1357} 1358}
1358 1359
1360INTERFACE void
1361vector_resize (pointer vec, uint32_t newsize, pointer fill)
1362{
1363 uint32_t oldsize = veclength (vec);
1364 vecvalue (vec) = realloc (vecvalue (vec), newsize * sizeof (pointer));
1365 veclength (vec) = newsize;
1366 fill_vector (vec, oldsize, fill);
1367}
1368
1359INTERFACE pointer 1369INTERFACE pointer
1360vector_get (pointer vec, uint32_t ielem) 1370vector_get (pointer vec, uint32_t ielem)
1361{ 1371{
1362 return vecvalue(vec)[ielem]; 1372 return vecvalue(vec)[ielem];
1363} 1373}
1384INTERFACE pointer 1394INTERFACE pointer
1385gensym (SCHEME_P) 1395gensym (SCHEME_P)
1386{ 1396{
1387 pointer x; 1397 pointer x;
1388 char name[40] = "gensym-"; 1398 char name[40] = "gensym-";
1389 xnum (name + 7, SCHEME_V->gensym_cnt); 1399 xnum (name + 7, ++SCHEME_V->gensym_cnt);
1390 1400
1391 return generate_symbol (SCHEME_A_ name); 1401 return generate_symbol (SCHEME_A_ name);
1402}
1403
1404static int
1405is_gensym (SCHEME_P_ pointer x)
1406{
1407 return is_symbol (x) && oblist_find_by_name (SCHEME_A_ strvalue (x)) != x;
1392} 1408}
1393 1409
1394/* make symbol or number atom from string */ 1410/* make symbol or number atom from string */
1395static pointer 1411static pointer
1396mk_atom (SCHEME_P_ char *q) 1412mk_atom (SCHEME_P_ char *q)
1640 /* garbage collect */ 1656 /* garbage collect */
1641 clrmark (NIL); 1657 clrmark (NIL);
1642 SCHEME_V->fcells = 0; 1658 SCHEME_V->fcells = 0;
1643 SCHEME_V->free_cell = NIL; 1659 SCHEME_V->free_cell = NIL;
1644 1660
1645 /* free-list is kept sorted by address so as to maintain consecutive 1661 uint32_t total = 0;
1646 ranges, if possible, for use with vectors. Here we scan the cells 1662
1647 (which are also kept sorted by address) downwards to build the 1663 /* Here we scan the cells to build the free-list. */
1648 free-list in sorted order.
1649 */
1650 for (i = SCHEME_V->last_cell_seg; i >= 0; i--) 1664 for (i = SCHEME_V->last_cell_seg; i >= 0; i--)
1651 { 1665 {
1652 p = SCHEME_V->cell_seg[i] + SCHEME_V->cell_segsize [i]; 1666 pointer end = SCHEME_V->cell_seg[i] + SCHEME_V->cell_segsize [i];
1667 total += SCHEME_V->cell_segsize [i];
1653 1668
1654 while (--p >= SCHEME_V->cell_seg[i]) 1669 for (p = SCHEME_V->cell_seg[i]; p < end; ++p)
1655 { 1670 {
1656 if (is_mark (p)) 1671 if (is_mark (p))
1657 clrmark (p); 1672 clrmark (p);
1658 else 1673 else
1659 { 1674 {
1672 } 1687 }
1673 } 1688 }
1674 1689
1675 if (SCHEME_V->gc_verbose) 1690 if (SCHEME_V->gc_verbose)
1676 { 1691 {
1677 xwrstr ("done: "); xwrnum (SCHEME_V->fcells); xwrstr (" cells were recovered.\n"); 1692 xwrstr ("done: "); xwrnum (SCHEME_V->fcells); xwrstr (" out of "); xwrnum (total); xwrstr (" cells were recovered.\n");
1678 } 1693 }
1679} 1694}
1680 1695
1681static void 1696static void
1682finalize_cell (SCHEME_P_ pointer a) 1697finalize_cell (SCHEME_P_ pointer a)
1683{ 1698{
1684 /* TODO, fast bitmap check? */ 1699 /* TODO, fast bitmap check? */
1685 if (is_string (a)) 1700 if (is_string (a) || is_symbol (a))
1686 free (strvalue (a)); 1701 free (strvalue (a));
1687 else if (is_vector (a)) 1702 else if (is_vector (a))
1688 free (vecvalue (a)); 1703 free (vecvalue (a));
1689#if USE_PORTS 1704#if USE_PORTS
1690 else if (is_port (a)) 1705 else if (is_port (a))
2256 2271
2257/* check c is in chars */ 2272/* check c is in chars */
2258ecb_inline int 2273ecb_inline int
2259is_one_of (const char *s, int c) 2274is_one_of (const char *s, int c)
2260{ 2275{
2261 if (c == EOF)
2262 return 1;
2263
2264 return !!strchr (s, c); 2276 return c == EOF || !!strchr (s, c);
2265} 2277}
2266 2278
2267/* skip white characters */ 2279/* skip white characters */
2268ecb_inline int 2280ecb_inline int
2269skipspace (SCHEME_P) 2281skipspace (SCHEME_P)
2271 int c, curr_line = 0; 2283 int c, curr_line = 0;
2272 2284
2273 do 2285 do
2274 { 2286 {
2275 c = inchar (SCHEME_A); 2287 c = inchar (SCHEME_A);
2288
2276#if SHOW_ERROR_LINE 2289#if SHOW_ERROR_LINE
2277 if (c == '\n') 2290 if (ecb_expect_false (c == '\n'))
2278 curr_line++; 2291 curr_line++;
2279#endif 2292#endif
2293
2294 if (ecb_expect_false (c == EOF))
2295 return c;
2280 } 2296 }
2281 while (c == ' ' || c == '\n' || c == '\r' || c == '\t'); 2297 while (is_one_of (WHITESPACE, c));
2282 2298
2283 /* record it */ 2299 /* record it */
2284#if SHOW_ERROR_LINE 2300#if SHOW_ERROR_LINE
2285 if (SCHEME_V->load_stack[SCHEME_V->file_i].kind & port_file) 2301 if (SCHEME_V->load_stack[SCHEME_V->file_i].kind & port_file)
2286 SCHEME_V->load_stack[SCHEME_V->file_i].rep.stdio.curr_line += curr_line; 2302 SCHEME_V->load_stack[SCHEME_V->file_i].rep.stdio.curr_line += curr_line;
2287#endif 2303#endif
2288 2304
2289 if (c != EOF)
2290 {
2291 backchar (SCHEME_A_ c); 2305 backchar (SCHEME_A_ c);
2292 return 1; 2306 return 1;
2293 }
2294 else
2295 return EOF;
2296} 2307}
2297 2308
2298/* get token */ 2309/* get token */
2299static int 2310static int
2300token (SCHEME_P) 2311token (SCHEME_P)
2316 return TOK_RPAREN; 2327 return TOK_RPAREN;
2317 2328
2318 case '.': 2329 case '.':
2319 c = inchar (SCHEME_A); 2330 c = inchar (SCHEME_A);
2320 2331
2321 if (is_one_of (" \n\t", c)) 2332 if (is_one_of (WHITESPACE, c))
2322 return TOK_DOT; 2333 return TOK_DOT;
2323 else 2334 else
2324 { 2335 {
2325 backchar (SCHEME_A_ c); 2336 backchar (SCHEME_A_ c);
2326 return TOK_DOTATOM; 2337 return TOK_DOTATOM;
2467 } 2478 }
2468 2479
2469 putcharacter (SCHEME_A_ '"'); 2480 putcharacter (SCHEME_A_ '"');
2470} 2481}
2471 2482
2472
2473/* print atoms */ 2483/* print atoms */
2474static void 2484static void
2475printatom (SCHEME_P_ pointer l, int f) 2485printatom (SCHEME_P_ pointer l, int f)
2476{ 2486{
2477 char *p; 2487 char *p;
2478 int len; 2488 int len;
2479 2489
2480 atom2str (SCHEME_A_ l, f, &p, &len); 2490 atom2str (SCHEME_A_ l, f, &p, &len);
2481 putchars (SCHEME_A_ p, len); 2491 putchars (SCHEME_A_ p, len);
2482} 2492}
2483
2484 2493
2485/* Uses internal buffer unless string pointer is already available */ 2494/* Uses internal buffer unless string pointer is already available */
2486static void 2495static void
2487atom2str (SCHEME_P_ pointer l, int f, char **pp, int *plen) 2496atom2str (SCHEME_P_ pointer l, int f, char **pp, int *plen)
2488{ 2497{
2649#endif 2658#endif
2650 } 2659 }
2651 else if (is_continuation (l)) 2660 else if (is_continuation (l))
2652 p = "#<CONTINUATION>"; 2661 p = "#<CONTINUATION>";
2653 else 2662 else
2663 {
2664#if USE_PRINTF
2665 p = SCHEME_V->strbuff;
2666 snprintf (p, STRBUFFSIZE, "#<ERROR %x>", (int)typeflag (l));
2667#else
2654 p = "#<ERROR>"; 2668 p = "#<ERROR>";
2669#endif
2670 }
2655 2671
2656 *pp = p; 2672 *pp = p;
2657 *plen = strlen (p); 2673 *plen = strlen (p);
2658} 2674}
2659 2675
2929#endif /* USE_ALIST_ENV else */ 2945#endif /* USE_ALIST_ENV else */
2930 2946
2931ecb_inline void 2947ecb_inline void
2932new_slot_in_env (SCHEME_P_ pointer variable, pointer value) 2948new_slot_in_env (SCHEME_P_ pointer variable, pointer value)
2933{ 2949{
2950 assert (is_symbol (variable));//TODO: bug in current-ws/OP_LET2
2934 new_slot_spec_in_env (SCHEME_A_ SCHEME_V->envir, variable, value); 2951 new_slot_spec_in_env (SCHEME_A_ SCHEME_V->envir, variable, value);
2935} 2952}
2936 2953
2937ecb_inline void 2954ecb_inline void
2938set_slot_in_env (SCHEME_P_ pointer slot, pointer value) 2955set_slot_in_env (SCHEME_P_ pointer slot, pointer value)
3230 3247
3231#endif 3248#endif
3232 3249
3233#define s_retbool(tf) s_return ((tf) ? S_T : S_F) 3250#define s_retbool(tf) s_return ((tf) ? S_T : S_F)
3234 3251
3252#if EXPERIMENT
3253static int
3254debug (SCHEME_P_ int indent, pointer x)
3255{
3256 int c;
3257
3258 if (is_syntax (x))
3259 {
3260 printf ("%*ssyntax<%s,%d>\n", indent, "", syntaxname(x),syntaxnum(x));
3261 return 8 + 8;
3262 }
3263
3264 if (x == NIL)
3265 {
3266 printf ("%*sNIL\n", indent, "");
3267 return 3;
3268 }
3269
3270 switch (type (x))
3271 {
3272 case T_INTEGER:
3273 printf ("%*sI<%d>%p\n", indent, "", (int)ivalue_unchecked (x), x);
3274 return 32+8;
3275
3276 case T_SYMBOL:
3277 printf ("%*sS<%s>\n", indent, "", symname (x));
3278 return 24+8;
3279
3280 case T_CLOSURE:
3281 printf ("%*sS<%s>\n", indent, "", "closure");
3282 debug (SCHEME_A_ indent + 3, cdr(x));
3283 return 32 + debug (SCHEME_A_ indent + 3, car (x));
3284
3285 case T_PAIR:
3286 printf ("%*spair %p %p\n", indent, "", car(x),cdr(x));
3287 c = debug (SCHEME_A_ indent + 3, car (x));
3288 c += debug (SCHEME_A_ indent + 3, cdr (x));
3289 return c + 1;
3290
3291 case T_PORT:
3292 printf ("%*sS<%s>\n", indent, "", "port");
3293 return 24+8;
3294
3295 case T_VECTOR:
3296 printf ("%*sS<%s>\n", indent, "", "vector");
3297 return 24+8;
3298
3299 case T_ENVIRONMENT:
3300 printf ("%*sS<%s>\n", indent, "", "environment");
3301 return 0 + debug (SCHEME_A_ indent + 3, car (x));
3302
3303 default:
3304 printf ("unhandled type %d\n", type (x));
3305 break;
3306 }
3307}
3308#endif
3309
3235static int 3310static int
3236opexe_0 (SCHEME_P_ enum scheme_opcodes op) 3311opexe_0 (SCHEME_P_ enum scheme_opcodes op)
3237{ 3312{
3238 pointer args = SCHEME_V->args; 3313 pointer args = SCHEME_V->args;
3239 pointer x, y; 3314 pointer x, y;
3240 3315
3241 switch (op) 3316 switch (op)
3242 { 3317 {
3318#if EXPERIMENT //D
3319 case OP_DEBUG:
3320 printf ("len = %d\n", debug (SCHEME_A_ 0, args) / 8);
3321 printf ("\n");
3322 s_return (S_T);
3323#endif
3243 case OP_LOAD: /* load */ 3324 case OP_LOAD: /* load */
3244 if (file_interactive (SCHEME_A)) 3325 if (file_interactive (SCHEME_A))
3245 { 3326 {
3246 xwrstr ("Loading "); xwrstr (strvalue (car (args))); xwrstr ("\n"); 3327 xwrstr ("Loading "); xwrstr (strvalue (car (args))); xwrstr ("\n");
3247 //D fprintf (SCHEME_V->outport->object.port->rep.stdio.file, "Loading %s\n", strvalue (car (args))); 3328 //D fprintf (SCHEME_V->outport->object.port->rep.stdio.file, "Loading %s\n", strvalue (car (args)));
3370 } 3451 }
3371 else 3452 else
3372 s_return (SCHEME_V->code); 3453 s_return (SCHEME_V->code);
3373 3454
3374 case OP_E0ARGS: /* eval arguments */ 3455 case OP_E0ARGS: /* eval arguments */
3375 if (is_macro (SCHEME_V->value)) /* macro expansion */ 3456 if (ecb_expect_false (is_macro (SCHEME_V->value))) /* macro expansion */
3376 { 3457 {
3377 s_save (SCHEME_A_ OP_DOMACRO, NIL, NIL); 3458 s_save (SCHEME_A_ OP_DOMACRO, NIL, NIL);
3378 SCHEME_V->args = cons (SCHEME_V->code, NIL); 3459 SCHEME_V->args = cons (SCHEME_V->code, NIL);
3379 SCHEME_V->code = SCHEME_V->value; 3460 SCHEME_V->code = SCHEME_V->value;
3380 s_goto (OP_APPLY); 3461 s_goto (OP_APPLY);
4378 } 4459 }
4379 4460
4380 case OP_VECLEN: /* vector-length */ 4461 case OP_VECLEN: /* vector-length */
4381 s_return (mk_integer (SCHEME_A_ veclength (x))); 4462 s_return (mk_integer (SCHEME_A_ veclength (x)));
4382 4463
4464 case OP_VECRESIZE:
4465 vector_resize (x, ivalue_unchecked (cadr (args)), caddr (args));
4466 s_return (x);
4467
4383 case OP_VECREF: /* vector-ref */ 4468 case OP_VECREF: /* vector-ref */
4384 { 4469 {
4385 int index = ivalue_unchecked (cadr (args)); 4470 int index = ivalue_unchecked (cadr (args));
4386 4471
4387 if (index >= veclength (car (args)) && USE_ERROR_CHECKING) 4472 if (index >= veclength (car (args)) && USE_ERROR_CHECKING)
4447 pointer d = cdr (args); 4532 pointer d = cdr (args);
4448 int r; 4533 int r;
4449 4534
4450 switch (op) 4535 switch (op)
4451 { 4536 {
4452 case OP_NOT: /* not */ r = is_false (a) ; break; 4537 case OP_NOT: /* not */ r = is_false (a) ; break;
4453 case OP_BOOLP: /* boolean? */ r = a == S_F || a == S_T; break; 4538 case OP_BOOLP: /* boolean? */ r = a == S_F || a == S_T ; break;
4454 case OP_EOFOBJP: /* eof-object? */ r = a == S_EOF ; break; 4539 case OP_EOFOBJP: /* eof-object? */ r = a == S_EOF ; break;
4455 case OP_NULLP: /* null? */ r = a == NIL ; break; 4540 case OP_NULLP: /* null? */ r = a == NIL ; break;
4456 case OP_SYMBOLP: /* symbol? */ r = is_symbol (a) ; break; 4541 case OP_SYMBOLP: /* symbol? */ r = is_symbol (a) ; break;
4542 case OP_GENSYMP: /* gensym? */ r = is_gensym (SCHEME_A_ a); break;
4457 case OP_NUMBERP: /* number? */ r = is_number (a) ; break; 4543 case OP_NUMBERP: /* number? */ r = is_number (a) ; break;
4458 case OP_STRINGP: /* string? */ r = is_string (a) ; break; 4544 case OP_STRINGP: /* string? */ r = is_string (a) ; break;
4459 case OP_INTEGERP: /* integer? */ r = is_integer (a) ; break; 4545 case OP_INTEGERP: /* integer? */ r = is_integer (a) ; break;
4460 case OP_REALP: /* real? */ r = is_number (a) ; break; /* all numbers are real */ 4546 case OP_REALP: /* real? */ r = is_number (a) ; break; /* all numbers are real */
4461 case OP_CHARP: /* char? */ r = is_character (a) ; break; 4547 case OP_CHARP: /* char? */ r = is_character (a) ; break;
4462 4548
4463#if USE_CHAR_CLASSIFIERS 4549#if USE_CHAR_CLASSIFIERS
4464 case OP_CHARAP: /* char-alphabetic? */ r = Cisalpha (ivalue_unchecked (a)); break; 4550 case OP_CHARAP: /* char-alphabetic? */ r = Cisalpha (ivalue_unchecked (a)); break;
4465 case OP_CHARNP: /* char-numeric? */ r = Cisdigit (ivalue_unchecked (a)); break; 4551 case OP_CHARNP: /* char-numeric? */ r = Cisdigit (ivalue_unchecked (a)); break;
4466 case OP_CHARWP: /* char-whitespace? */ r = Cisspace (ivalue_unchecked (a)); break; 4552 case OP_CHARWP: /* char-whitespace? */ r = Cisspace (ivalue_unchecked (a)); break;
4947 s_return (mk_atom (SCHEME_A_ readstr_upto (SCHEME_A_ 0, DELIMITERS))); 5033 s_return (mk_atom (SCHEME_A_ readstr_upto (SCHEME_A_ 0, DELIMITERS)));
4948 5034
4949 case TOK_DOTATOM: 5035 case TOK_DOTATOM:
4950 SCHEME_V->strbuff[0] = '.'; 5036 SCHEME_V->strbuff[0] = '.';
4951 s_return (mk_atom (SCHEME_A_ readstr_upto (SCHEME_A_ 1, DELIMITERS))); 5037 s_return (mk_atom (SCHEME_A_ readstr_upto (SCHEME_A_ 1, DELIMITERS)));
5038
5039 case TOK_STRATOM:
5040 x = readstrexp (SCHEME_A_ '|');
5041 //TODO: haven't checked whether the garbage collector could interfere
5042 s_return (mk_atom (SCHEME_A_ strvalue (x)));
4952 5043
4953 case TOK_DQUOTE: 5044 case TOK_DQUOTE:
4954 x = readstrexp (SCHEME_A_ '"'); 5045 x = readstrexp (SCHEME_A_ '"');
4955 5046
4956 if (x == S_F) 5047 if (x == S_F)
5203 5294
5204 case OP_CLOSUREP: /* closure? */ 5295 case OP_CLOSUREP: /* closure? */
5205 /* 5296 /*
5206 * Note, macro object is also a closure. 5297 * Note, macro object is also a closure.
5207 * Therefore, (closure? <#MACRO>) ==> #t 5298 * Therefore, (closure? <#MACRO>) ==> #t
5299 * (schmorp) well, obviously not, fix? TODO
5208 */ 5300 */
5209 s_retbool (is_closure (a)); 5301 s_retbool (is_closure (a));
5210 5302
5211 case OP_MACROP: /* macro? */ 5303 case OP_MACROP: /* macro? */
5212 s_retbool (is_macro (a)); 5304 s_retbool (is_macro (a));
5453 5545
5454/* Hard-coded for the given keywords. Remember to rewrite if more are added! */ 5546/* Hard-coded for the given keywords. Remember to rewrite if more are added! */
5455static int 5547static int
5456syntaxnum (pointer p) 5548syntaxnum (pointer p)
5457{ 5549{
5458 const char *s = strvalue (car (p)); 5550 const char *s = strvalue (p);
5459 5551
5460 switch (strlength (car (p))) 5552 switch (strlength (p))
5461 { 5553 {
5462 case 2: 5554 case 2:
5463 if (s[0] == 'i') 5555 if (s[0] == 'i')
5464 return OP_IF0; /* if */ 5556 return OP_IF0; /* if */
5465 else 5557 else
5901# endif 5993# endif
5902 int fin; 5994 int fin;
5903 char *file_name = InitFile; 5995 char *file_name = InitFile;
5904 int retcode; 5996 int retcode;
5905 int isfile = 1; 5997 int isfile = 1;
5998 system ("ps v $PPID");//D
5906 5999
5907 if (argc == 2 && strcmp (argv[1], "-?") == 0) 6000 if (argc == 2 && strcmp (argv[1], "-?") == 0)
5908 { 6001 {
5909 xwrstr ("Usage: tinyscheme -?\n"); 6002 xwrstr ("Usage: tinyscheme -?\n");
5910 xwrstr ("or: tinyscheme [<file1> <file2> ...]\n"); 6003 xwrstr ("or: tinyscheme [<file1> <file2> ...]\n");

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines