Arc Forumnew | comments | leaders | submitlogin
2 points by jsgrahamus 3273 days ago | link | parent

Here is a follow on problem as I'm going through the tutorial: obj does not work and the error message seems to access memory not involved with the obj.

  arc> (printlst alist)

  ARR(1)="PARSE    ; PARSE OUTPUT OF ^%RFIND INTO RSD/RTN/TAG"

  ARR(2)="         N ARR,FND,I,RSD,RTN,STOP,TXT"

  ARR(3)="         W !!,"PASTE""

  ARR(4)="         F  R !,X:15 Q:'$T  S ARR($I(ARR))=X"

  ARR(5)="         K RSDS"



  ""
  arc> (= codes (obj "Boston" 'bos "San Francisco" 'sfo "Paris" 'cdg))
  Error: "list-ref: contract violation\n  expected: exact-nonnegative-integer?\n  given: '(((codes (obj \"Boston\" (quote bos . nil) \"San Francisco\" (quote sfo . nil) \"Paris\" (quote cdg . nil) . nil) . nil) . nil))\n  argument position: 2nd\n  other arguments...:\n   '(\"\\nARR(1)=\\\"PARSE    ; PARSE OUTPUT OF ^%RFIND INTO RSD/RTN/TAG\\\"\" \"\\nARR(2)=\\\"         N ARR,FND,I,RSD,RTN,STOP,TXT\\\"\" \"\\nARR(3)=\\\"         W !!,\\\"PASTE\\\"\\\"\" \"\\nARR(4)=\\\"         F  R !,X:15 Q:'$T  S ARR($I(ARR))=X\\\"\" \"\\nARR(5)=\\\"         K RSDS\\..."
  arc>


2 points by rocketnia 3272 days ago | link

Judging by that error message, it looks like the variable "=" or one of its dependencies might have been reassigned somewhere along the line. The second argument in that error message indicates that = is getting hold of your read-in data somehow, so it might be something you've defined for processing this data.

The dependencies of = include expand=list, expand=, map, pair, and setforms (among others), so if any of these has been overwritten, it might do something like what you're seeing.

By the way, I think if you're not using Anarki, there's a known bug in (readline ...) where it will spuriously combine each empty line with the following line (https://sites.google.com/site/arclanguagewiki/arc-3_1/known-...). Maybe this could explain the extra \n you're getting.

-----

2 points by jsgrahamus 3272 days ago | link

Thank you.

-----