None of the below is meant to deter your voyage of discovery! 
Have fun and hack around!

On Oct 27, 2016, at 12:17 PM, lfacc...@jhu.edu wrote:
> I cannot name a single other example of embedded DSL in Racket that
> operates with syntax objects directly. Can you think of something better?


1) Perhaps have a look at the approach used by the `xml` and `html` and `json` 
libraries, which is 1) parse data from string, 2) store data in nested structs, 
3) generate new string from nested-struct thingy.

2) Maybe a metalanguage that embeds at the reader level, and expands certain 
source strings into S-expressions? See http://docs.racket-lang.org/debug/ for 
an example, where the `#R` prefix in source takes on special meaning.

>  ([body
>    {#:margin (40px auto)
>     #:max-width 650px
>     #:line-height 1.6
>     #:font-size 18px
>     #:color |#444|
>     #:padding (0 10px)}]
>   [h1 h2 h3
>       {#:line-height 1.2}])


Notationally, how is this an improvement over regular CSS? And if it's not, why 
not use regular CSS notation, and parse it?


> Furthermore, I implemented some ideas that I borrowed from other CSS
> preprocessors such as SASS/Less. For example, the language supports nested
> declarations and attributes, appropriately unnesting them when generating the
> CSS output.

IMHO, automating piles of repetitive CSS is the best reason to make a library. 
But I have not upgraded my terrible, horrible, no good, very bad `css-tools` 
library into something suitable for public consumption for two reasons:

1) To write a library that actually parses and generates good CSS, I'd have to 
keep up with the CSS spec, and all the browsers, and that gives me the shivers.

2) Most of what I need is basic computational work — variable substitution, 
math operations, string expansions — and I couldn't figure out what a separate 
library would add that I couldn't already do with simple Racket functions 
embedded in a Pollen source file.



-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to