#568 inchar: "string"; inchar: 9

closed
nobody
Lisp Core (471)
3
2010-04-05
2004-05-10
No

inchar:"q"$
(q28) foo$
(q29) q28; => q28
(q30) "q28" => foo
!!! It has assigned a value to a string, which is
illegal:
(q31) "q28": 234234; => improper value assignment

especially amusing if you assign inchar:""....

inchar also allows itself to be assigned a number:

inchar:"9"
(932) foo$
(933) ?\932; => foo

Discussion

  • Robert Dodier

    Robert Dodier - 2006-07-29
    • labels: --> Lisp Core
    • priority: 5 --> 3
     
  • Robert Dodier

    Robert Dodier - 2006-07-29

    Logged In: YES
    user_id=501686

    Observed in 5.9.3cvs. Although the final example is:

    (%i1) inchar:"9";
    (%o1) 9
    (92) foo;
    (%o2) foo
    (93) "914";
    (%o3) 914

     
  • Dieter Kaiser

    Dieter Kaiser - 2010-03-21

    I do not see a problem with the assignment of values to $inchar with Maxima 5.20post.

    The labels are build up in the routine makelabel out of the value of $inchar and the current linenum. The function $concat is called to do this. The first argument of $concat determines the type of the label. It does not matter what type we have for $inchar, we always get a symbol.

    If we set $inchar to a string we get:

    (%i2) inchar:"string";
    (%o2) string

    (string3) foo$

    We refer the input line string3. Internally it is the symbol $string3:

    (string4) string3;
    (%o4) foo

    But we can not refer the input line with a string. This bevavior is correct:

    (string5) "string3";
    (%o5) string3

    Internally a label is build up from $inchar and the current linenum:

    (string6) :lisp (makelabel $inchar)
    $STRING6

    The type of the label is always a symbol:

    (string6) :lisp (type-of (makelabel $inchar))
    SYMBOL

    If we set $inchar to a number we get a symbol too:

    (%i2) inchar:9$

    The input label is not a number but the symbol $93:

    (93) :lisp (makelabel $inchar)
    $93

    Again with a string out of a number. We get the same result. The label is again $93:

    (%i2) inchar:"9"$
    (93) :lisp (makelabel $inchar)
    $93

    This works even for an empty string:

    (%i2) inchar:""$
    (3) :lisp (makelabel $inchar)
    $3

    We can not refer the line from the command line with a number:

    (4) foo$
    (5) 4;
    (%o5) 4

    But we can do it the following way:

    (6) ?$4;
    (%o6) foo

    Setting the status to pending and the resolution to "works for me".
    Dieter Kaiser

     
  • Dieter Kaiser

    Dieter Kaiser - 2010-03-21
    • status: open --> pending
     
  • SourceForge Robot

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
  • SourceForge Robot

    • status: pending --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks