Hi Kashyap,
> Gentle reminder :)
Yeah, good! :)
I think it looks good, not much to say on a short glance.
*If* anything at all, I would only mention minor stuff like
> > (while (not (= (peek) "\""))
Better (until (= (peek) "\"")
> > (case (peek)
> > ("\\" (char) (link (char)))
> > (T (link (char))))))
As there are only two cases, an 'if' would be shorter. In this case, I would use
'ifn'
(link
(ifn (= "\\" (peek))
(char)
(char)
(link (char)) ) )
but anyway can be reduced to
(and (= "\\" (peek)) (char))
(link (char))
> > (let R
> > (pack
> > (make (do (length W) (link (char)))))
> > (prog (unless (= W R) (quit (pack "Expected " W ", got " R))) R)))
The 'prog' seems not necessary.
> > (let (
> > Neg (if (= "-" (peek)) (char))
Personally I would not use 'if' here, I use it only if there is also an 'else'
body. 'and' or 'when' feels better.
> > (while (not (= (peek) E))
as above
> > (if (= (peek) ",") (prog (char) (skip) (if (= E (peek)) (quit
> > "Incorrect collection termination"))))))
Here the 'prog' can probably avoided too.
In general, if 'prog' is used, then very often there is another conditional
which handles it directly.
> > (de isNum (n) (or (= "." n) (num? (format n))))
'n' -> 'N'
(num? (format N))) -> (format N)
All without guarantee, I haven't tested :)
☺/ A!ex
--
UNSUBSCRIBE: mailto:[email protected]?subject=Unsubscribe