home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / PROG / MISC / XLSP21TC.ZIP / XL-006.BUG / text0000.txt < prev   
Encoding:
Text File  |  1991-04-14  |  2.3 KB  |  113 lines

  1.  
  2.                                 12/4/89
  3.  
  4. I was trying some examples in Common Lisp: The Reference, and found some
  5. bugs (both real and compatibility) in XLISP 2.0/2.1
  6.  
  7. ********************
  8.  
  9. Double quotes are not escaped when printing.
  10. (Fix needed in putqstring to handle case of '"').
  11.  
  12. change:
  13.     if (ch < 040 || ch == '\\' || ch > 0176) {
  14. to:
  15.     if (ch < 040 || ch == '\\' || ch == '"' || ch > 0176) {
  16.  
  17. change:
  18.     case '\\':
  19.     xlputc(fptr,'\\');
  20.     break;
  21.  
  22. to:
  23.     case '\\':
  24.     case '"':
  25.     xlputc(fptr,ch);
  26.     break;
  27.  
  28. ******************
  29. In version 2.1, #S() construct doesn't quote element values. 
  30. ":" not allowed on keywords, nor are the printed.
  31.  
  32. Example:
  33.  
  34. (defstruct foo (x 10))
  35.  
  36.  
  37. #S(foo)   prints #S(foo x 10) instead of #S(foo :x 10)
  38.  
  39. #S(foo :x 10)  gives an error
  40.  
  41. #S(foo x (+ 3 4)) gives #S(foo x 7) instead of #S(foo :x (+3 4))
  42.  
  43. In xlrdstruct() (xlstruct.c)
  44.  
  45. change:
  46.     sprintf(buf,":%s",getstring(getpname(slotname)));
  47.  
  48.     /* add the slot keyword */
  49.     rplacd(last,cons(xlenter(buf),NIL));
  50.  
  51. to:
  52.  
  53.  
  54.     /* add the slot keyword */
  55.     if (*(getstring(getpname(slotname))) != ':') { /* add colon */
  56.         sprintf(buf,":%s",getstring(getpname(slotname)));
  57.         rplacd(last,cons(xlenter(buf),NIL));
  58.     }
  59.     else {
  60.         rplacd(last,cons(slotname,NIL));
  61.     }
  62.  
  63. and change:
  64.     /* add the value expression */
  65.     rplacd(last,cons(car(list),NIL));
  66.     last = cdr(last);
  67.     list = cdr(list);
  68.  
  69. to:
  70.     /* add the value expression  -- QUOTED (TAA MOD) */
  71.     rplacd(last,cons(NIL,NIL));
  72.     last = cdr(last);
  73.     rplaca(last, (slotname = cons(s_quote,NIL)));
  74.     rplacd(slotname, cons(car(list), NIL));
  75.     list = cdr(list);
  76.  
  77.  
  78.  
  79. In xlprstruct(), replace:
  80.     xlputc(fptr,' ');
  81.  
  82. with:
  83.     xlputstr(fptr," :");    /* TAA MOD, colons should show */
  84.  
  85. ****************
  86. In XLISP 2.1, attempts to write to a structure element beyond the end of
  87. the structure (i.e. wrong access function used) tends to cause a crash.
  88.  
  89. FIX: in both xstrref() and xstrset() (in xlstruct.c) 
  90.  
  91. after:
  92.     xllastarg(); 
  93.  
  94. add:
  95.     if (i >= getsize(str)) /* wrong structure*/
  96.     xlerror("Bad structure reference",str);
  97.  
  98.  
  99. *********************
  100. I added #. macro, to eval at read time.    
  101. To switch statement in rmhash add:
  102.  
  103.     case '.':
  104.         readone(fptr,&car(val));
  105.         rplaca(val,xleval(car(val)));
  106.         break;
  107.  
  108. Tom Almy
  109. toma@tekgvs.labs.tek.com
  110. Standard Disclaimers Apply
  111.  
  112.  
  113.