procedure for the validation of callsigns

This commit is contained in:
2025-09-09 15:14:26 -07:00
parent 4b438bc70d
commit 896be50c0a

View File

@@ -1,6 +1,13 @@
#! /usr/bin/env /usr/local/bin/racket #! /usr/bin/env /usr/local/bin/racket
#lang racket #lang racket
(define (call-valid? call)
(and
(<= (string-length call) 9)
(andmap
(or/c char-numeric? char-alphabetic? (curry char=? #\-))
(string->list call))))
;; get callsign, first thing passed by BPQ ;; get callsign, first thing passed by BPQ
(define call (read-line (current-input-port) 'any)) (define call (read-line (current-input-port) 'any))