Changes between Initial Version and Version 1 of Ticket #1351, comment 2


Ignore:
Timestamp:
03/10/17 20:31:07 (8 years ago)
Author:
sjamaan
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #1351, comment 2

    initial v1  
    1 Another interesting case for which we should probably give an error, but we silently return the wrong result:
     1Here's a slightly different but simpler case that exhibits the same error:
    22
    33{{{
     
    77     '(print (x y ...) ...))))
    88
     9(foo (1 2 3) ((a b) (c d)))
     10
     11Error: (map) during expansion of (foo ...) - lists are not of same length: (())
     12}}}
     13
     14Another invocation of the same macro for which we should also give an error, but we silently return the wrong result:
     15
     16{{{
    917(foo (1 2) ((a b) (c d) (e f))) => (print (1 a b) (2 c d))
    1018}}}
    1119
    12 Racket and Guile give an error when you try to invoke this macro, Chibi and Gauche fail exactly in the same way as we do.
     20Racket and Guile give an error when you try to invoke this macro with unbalanced argument counts, Chibi and Gauche always stop early.
    1321
    1422It looks like this is due to how "map" works: It doesn't (always) check the list lengths, it either stops on the shortest list (giving this comment's problematic behaviour) or it gives an error that the lists aren't the same length (giving the error in the ticket body).