in reply to Re^2: parse lisp style config
in thread parse lisp style config

I found those standard tools have their peculiarities and complains always, I just want to express an struture, and not too hard to parse, I heard lisp's way is easy to parse and extendable, I'm trying and practising, though using only brancket may be not a good idea which leads to express array in a funny way, I will find out, now I'm using toml as easy reading config format.

Replies are listed 'Best First'.
Re^4: parse lisp style config
by GrandFather (Saint) on Nov 28, 2024 at 06:31 UTC

    To my mind "easy to parse" is not having to write any parsing code at all. That is, use someone else's effort and focus your effort on added value. Anything else is either doing it to learn (laudable), or NIH (not invented here) syndrome (fundamentally bad).

    Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond
Re^4: parse lisp style config
by Danny (Chaplain) on Nov 28, 2024 at 17:14 UTC
    Why not just make your config a perl data structure?

        I agree. You'd basically have to rewrite the perl interpreter so that can run a copy of itself as child process in a sandbox and only return a safe, sanitized hashref. To quote RFC1925:

        (5) It is always possible to aglutenate multiple separate problems into a single complex interdependent solution. In most cases this is a bad idea.

        With enough software engineering, this is certainly possible, at least to a certain extend, but

        (3) With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under the +m as they fly overhead.

        PerlMonks XP is useless? Not anymore: XPD - Do more with your PerlMonks XP
        Also check out my sisters artwork and my weekly webcomics