Skip to content

Instantly share code, notes, and snippets.

Josh Tilles MerelyAPseudonym

Block or report user

Report or block MerelyAPseudonym

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@MerelyAPseudonym
MerelyAPseudonym / Praxis19Aug2011.rkt
Created Sep 8, 2011
Programming Praxis 19 Aug 2011 (first non-repeating char) solution in PLT Racket
View Praxis19Aug2011.rkt
#lang racket
(define (first-uniq chars)
(when (empty? chars)
(raise "There are no unique letters"))
(let ([c (first chars)])
(if (memq c (rest chars)) ; MEMQ is like MEMBER with EQ?
(first-uniq (remq* (list c) chars)) ; N.B the tail-recursion here
c)))
You can’t perform that action at this time.