Search found 3 matches

by vitomzev
Sat Nov 11, 2017 3:58 am
Forum: Scheme
Topic: How to make a scheme program accept inputs
Replies: 1
Views: 2738

How to make a scheme program accept inputs

I have the following program (define (cat . nums) (apply string-append (map number->string nums))) (define (my-compare a b) (string>? (cat a b) (cat b a))) (map (lambda (xs) (string->number (apply cat (sort xs my-compare)))) '((1 34 3 98 9 76 45 4) (54 546 548 60))) and I would like it to accept inp...
by vitomzev
Sat Nov 11, 2017 3:11 am
Forum: Scheme
Topic: How to fix an unbound variable error in scheme?
Replies: 3
Views: 8674

Re: How to fix an unbound variable error in scheme?

(define (cat . nums) (apply string-append (map number->string nums))) (define (my-compare a b) (string>? (cat a b) (cat b a))) (map (lambda (xs) (string->number (apply cat (sort xs my-compare)))) '((1 34 3 98 9 76 45 4) (54 546 548 60))) I have changed the code but I would like it to worksuch that I...
by vitomzev
Tue Nov 07, 2017 1:00 am
Forum: Scheme
Topic: How to fix an unbound variable error in scheme?
Replies: 3
Views: 8674

How to fix an unbound variable error in scheme?

I have written the following program in scheme which should receive a list of numbers and it should then form the largest number possible from that: (define (my-procedure lsts) (map (lambda (xs) (string->number (apply cat(sort xs my-compare)))) lsts)) and I would like it to behave in the following w...