#599 maplist inconsistent with args

open
nobody
Lisp Core (471)
4
2016-12-15
2004-09-27
No

maplist(foo,a[i]) => error

while

map(foo,args(a[i])) => [foo(i)]

I'd think these should do the same thing, especially
since maplist does act like a "part" function in other
ways (e.g. in respecting inflag).

-s

Discussion

  • Robert Dodier

    Robert Dodier - 2006-07-31
    • labels: --> Lisp Core
     
  • Robert Dodier

    Robert Dodier - 2006-07-31

    Logged In: YES
    user_id=501686

    In 5.9.3cvs, maplist(foo, a[i]) => error and also map(foo,
    a[i]) => error.

    maplist(foo, a[i]) should yield [foo(i)] as suggested above.
    map(foo, a[i]) should yield a[foo(i)] (by analogy with
    map(foo, a(i))).

     
  • Kris Katterjohn

    Kris Katterjohn - 2016-12-15

    I agree that this seems inconsistent:

    (%i1) map (foo, bar (i, j, k));
    (%o1) bar(foo(i),foo(j),foo(k))
    
    (%i2) map (foo, bar [i, j, k]);
    map: improper argument: bar[i,j,k]
     -- an error. To debug this try: debugmode(true);
    

    But since bar[i,j,k] is a mapatom, isn't this the expected behavior? To change this we would need to change the definition of a mapatom.

    Was changing mapatom implicit in the previous comments, or...?

     

Log in to post a comment.

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

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks