I'm shipping encrypted data between RAM, DB, and network and wondering
if there's an efficient way to the parsing.

(struct spec (type mode) #:transparent) ; cf 'cipher-spec' in crypto module
(define s (spec "aes" "cbc"))

(match-define (struct* spec ([type (app string->symbol type)]
                                             [mode (app string->symbol mode)]))
   s)

> s
(spec "aes" "cbc")
> type
'aes
> mode
'cbc

(match-define (and (struct* spec ([type (app string->symbol type)]
                                                     [mode (app
string->symbol mode)]))
                               ...something...)
   s)

> cipher-descriptor  ; bound in the '...something...' section
'(aes cbc)

What would go in the '...something...' slot in order to make this
work?  I've played around with various combinations and been through
the docs but can't quite wrap my head around it.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to