• re: Apprenticeship

    From B. Pym@Nobody447095@here-nor-there.org to comp.lang.lisp,comp.lang.scheme on Sat Sep 7 05:48:14 2024
    From Newsgroup: comp.lang.scheme

    (let ((e-mail-address "PGIUHOGT@VGIHKRR.TKZ"))
    (loop with new-string = (make-string (length e-mail-address))
    for count from 0 to (1- (length e-mail-address))
    for char-code = (char-code (aref e-mail-address count))
    for new-char-code =
    (if (and (> char-code 64)(< char-code 123))
    (+ (mod (+ 13 char-code) 52) 65)
    char-code)
    do (setf (aref new-string count) (code-char new-char-code))
    finally (return new-string)))

    Gauche Scheme

    (string-map
    (^c (let1 n (char->integer c)
    (integer->char
    (if (< 64 n 123) (+ (modulo (+ 13 n) 52) 65) n))))
    "PGIUHOGT@VGIHKRR.TKZ")
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Kaz Kylheku@643-408-1753@kylheku.com to comp.lang.lisp,comp.lang.scheme on Sat Sep 7 15:14:10 2024
    From Newsgroup: comp.lang.scheme

    On 2024-09-07, B. Pym <Nobody447095@here-nor-there.org> wrote:
    (let ((e-mail-address "PGIUHOGT@VGIHKRR.TKZ"))
    (loop with new-string = (make-string (length e-mail-address))
    for count from 0 to (1- (length e-mail-address))
    for char-code = (char-code (aref e-mail-address count))
    for new-char-code =
    (if (and (> char-code 64)(< char-code 123))
    (+ (mod (+ 13 char-code) 52) 65)
    char-code)
    do (setf (aref new-string count) (code-char new-char-code))
    finally (return new-string)))

    Gauche Scheme

    (string-map
    (^c (let1 n (char->integer c)
    (integer->char
    (if (< 64 n 123) (+ (modulo (+ 13 n) 52) 65) n))))
    "PGIUHOGT@VGIHKRR.TKZ")

    TXR Lisp:

    (mapcar [iffi chr-isupper (op wrap #\a #\z)] "PGIUHOGT@VGIHKRR.TKZ")
    "jacobian@pacbell.net"

    The pacbell.net domain is defunct, so no point in concealing.
    --
    TXR Programming Language: http://nongnu.org/txr
    Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
    Mastodon: @Kazinator@mstdn.ca
    --- Synchronet 3.22a-Linux NewsLink 1.2