Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#502 genmatrix/lambda translate problem

closed
nobody
5
2008-07-03
2004-01-29
Stavros Macrakis
No

f():=genmatrix(lambda([i,j],3),1,1)
f() => matrix([3]) OK
translate(f)
f() => error

This is because genmatrix's semantics are screwy.

genmatrix allows a lambda-expression as a first argument
(undocumented), but not a named function (because it
treats symbols as array names) or a compiled function.

This violates referential transparency. It also breaks
translate. The translate case can be patched, either by
allowing translated functions as first arg (more
inconsistency!), or by having translate cons up a lambda-
expression (yuck!).

Discussion

  • Robert Dodier
    Robert Dodier
    2006-04-10

    • labels: --> Lisp Core - Translator
     
  • Barton Willis
    Barton Willis
    2008-03-02

    Logged In: YES
    user_id=895922
    Originator: NO

    The linearalgebra functions polytocompanion, toeplitz, diag_matrix, hankel, use
    genmatrix(lambda...)). So linearalgebra.mac should not be compiled :(

     
  • Barton Willis
    Barton Willis
    2008-03-07

    Logged In: YES
    user_id=895922
    Originator: NO

    See comm2.lisp cvs revision 1.20

     
  • Robert Dodier
    Robert Dodier
    2008-07-03

    Logged In: YES
    user_id=501686
    Originator: NO

    Not observed in 5.15.0 + GCL + Windows nor 5.15.0cvs + Clisp + Linux. Looks like it was fixed by r1.20 src/comm2.lisp as noted before. Closing this report as fixed.

     
  • Robert Dodier
    Robert Dodier
    2008-07-03

    • status: open --> closed