Anonymous user
Letter frequency: Difference between revisions
defined format-table in terms of for-each
(completely RNRS Scheme with the exception of format, uses native Scheme character representations, more canonical indentation, and an association list instead of a vector) |
(defined format-table in terms of for-each) |
||
Line 2,277:
=={{header|Scheme}}==
Using guile scheme 2.0.11
Note that this prints the scheme representations of characters in no particular order.
Line 2,296:
(define (format-table table)
▲ (format #t "~10s~10d~%" (caar table) (cadar table))
(define (print-freq filename)
Line 2,308 ⟶ 2,304:
Output when reading own source:
#\(
#\u
#\s 9
#\e
#\- 19
#\m 9
#\o
#\d 19
#\l
#\space
#\i
#\c 28
#\9 1
#\f
#\r
#\a
#\t
#\)
#\newline
#\n
#\h
#\q 7
#\p 9
#\b
#\j 1
#\?
#\k 1
#\1 4
#\+ 1
#\# 2
#\" 4
#\~ 3
|