struct – Error message- `expects a number as 1st argument, given string

struct – Error message- `expects a number as 1st argument, given string

You forget the whole error message which tells you which procedure complains:

=: expects a number as 1st argument, given hearts

= compares numbers. eg. (= 3 5) ; ==> #f. You are probably looking for eq? since it compares if its the same object and symbols that look the same are in fact the same object. For a more general check to see if two things looks the same you should use equal? eg (equal? hello hello) ;==> #t.

struct – Error message- `expects a number as 1st argument, given string

Leave a Reply

Your email address will not be published. Required fields are marked *