On September 13, 2016 7:22:55 PM EDT, Alan Manuel Gloria <almkg...@gmail.com>
wrote:
>On Tue, Sep 13, 2016 at 8:11 AM, David A. Wheeler
><dwhee...@dwheeler.com>
>wrote:
>
>>
>> >4. Backquotes "invert" the use of a symbol: foo is a prefix symbol,
>> >`foo`
>> >is an infix symbol; while + is an infix symbol while `+` is a prefix
>> >symbol.
>>
>> How will you identify quasi quoting? Or do users simply have to use
>the
>> full name quasiquote ?
>>
>
>Full name, sadly ^^
>
>The target I'm planning for these rules is not, technically speaking, a
>Lisp (a dynamically-typed language whose primary data type is used to
>represent its code) but rather a Haskell-like language.
>
>The point of this is to allow a Scheme macro processor to be used on a
>Haskell-like language. So, quasiquote is a lot less needed.
>
>syntax `<-`
>syntax do
>. transform
>. . do
>. . . p <- x
>. to $ syntaxError "do: last form cannot be `p <- x'" p
>. transform
>. . do
>. . . x
>. to
>. . x
>. transform
>. . do
>. . . p <- x
>. . . y
>. . . ...
>. to
>. . . x >>= \ p -> do y ...
>. transform
>. . do
>. . . x
>. . . y
>. . . ...
>. to
>. . x >>= \ _ -> do y ...
>
>(well, "\" would also have to be prefix-defaulted, and the "function"
>syntax would be `->` rather than \ here, with \ being a dummy stand in)
>
>Still, let (or "where", which is a more common idiom in Haskell-like
>languages, although "let" does still exist) is difficult to express in
>a
>good indentation form....
>
>fix :: ((a -> b) -> (a -> b)) -> (a -> b)
>map = value
>. fix rec
>. where
>. . rec map f (a:as) = f a:map f as
>. . rec map f Nil = Nil
>{-
>(map = (value
> (fix rec)
> (where
> ((rec map f (a:as)) = ((f a):(map f as)))
> ((rec map f NIl) = Nil))))
>-}
>
>blech!
>
>Sincerely,
>AmkG
I don't know if it would help your use case, but you could use vertical bars to
surround symbols that you don't intend to use as in fix. E.g.:
(1 + 2 ) => (+ 1 2)
while
(1 |+| 2 ) => (1 |+| 2)
Then you could more easily write expressions that would be interpreted the same
way on both traditional readers and your new reader.
However, if you're not really reading lisp code, then the sky is the limit.
Haskell includes its own system, as I'm sure you know.
Can you post a few examples of representative expressions, and then maybe we
can backtrack to see what alternatives exist?
--- David A.Wheeler
------------------------------------------------------------------------------
_______________________________________________
Readable-discuss mailing list
Readable-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/readable-discuss