[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Should we MAY a "curly-write" and "neoteric-write"? Or even "sweet-write"?



I've attached a first-cut draft of curly-write and neoteric-write (they're really -simple versions).  The code is not so long that it'd be hard to put in an implementation.. but it's long enough that you'd like to have them in an implementation.

Below are outputs from curly-write, followed by outputs from neoteric-write, given the same expressions.  I think they're reasonable.

--- David A. Wheeler


'x
(a b c d e f g h i j k l m n o p q r s t u v w x y z)
(a b c d e f g h i j k l m n o p q r s t u v w x y z . 2)
{a + b}
{a + b + c}
(+ a b c . improper)
(sin (- theta))
(fact {n - 1})
(calculate (pi))
(between current min max)
(my-write . rest)
(sin x)
(- x)
(-)
(function +)
(map + '(2 4 6))
(current-time)
(1 2 3)
(4 5 . 6)
5
boring-symbol
{sqrt(x) + sqrt(y)}
`(1 2 ,@{a + b})
#'(a b c)
#( v1 v2 {2 + 3} (sin x) )
(define (is-infix-operator? x) (cond ((not (symbol? x)) #f) ((memq x special-infix-operators) #t) (#t (contains-only-punctuation? (string->list (symbol->string x))))))
fin


'x
(a b c d e f g h i j k l m n o p q r s t u v w x y z)
(a b c d e f g h i j k l m n o p q r s t u v w x y z . 2)
{a + b}
{a + b + c}
+(a b c . improper)
sin{- theta}
fact{n - 1}
calculate(pi())
between(current min max)
my-write(. rest)
sin(x)
-(x)
-()
function(+)
map(+ '(2 4 6))
current-time()
(1 2 3)
(4 5 . 6)
5
boring-symbol
{sqrt(x) + sqrt(y)}
`(1 2 ,@{a + b})
#'a(b c)
#( v1 v2 {2 + 3} sin(x) )
define(is-infix-operator?(x) cond((not(symbol?(x)) #f) (memq(x special-infix-operators) #t) (#t contains-only-punctuation?(string->list(symbol->string(x))))))
fin

Attachment: write.scm
Description: Binary data