Simple Printing/formatting a list in Scheme
Posted: Thu Mar 31, 2016 3:58 pm
Hi everyone,
I just want to print out a list (containing a string and a number) in this format:
Orange : 3
With my code, I'm getting the following error:
Orange : (3). . application: not a procedure;
expected a procedure that can be applied to arguments
given: #<void>
arguments...:
Would appreciate the guidance.
Thanks!
I just want to print out a list (containing a string and a number) in this format:
Orange : 3
With my code, I'm getting the following error:
Orange : (3). . application: not a procedure;
expected a procedure that can be applied to arguments
given: #<void>
arguments...:
Would appreciate the guidance.
Thanks!
Code: Select all
#lang scheme
(define t '( "Orange" 3))
(define print-object (lambda (m)
(
(display (name m))
(display " : ")
(display (priority m))
)))
(print-object t)