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

coding style



Is anyone willing to step forth with ideas about how es code could look?
Obviously, what works is the first criterion, but there seems to be a
kind of a Lisping quality to es that benefits a lot from clear indenting,
and possibly some logical operations that I don't see yet.

for example, the following rc

	if (~ $TERM () || ~ $TERM '') {
		TERM = unknown
	} else if (~ $TERM *' '*) {
		t = () {
			eval 't = (' $TERM ')'
			TERM = $t(1)^-^$t(2)
		}
	} else if (~ $TERM *vt520) {
		TERM = vt52
	}

translates to es?

	%or	{%and {~ $TERM () || ~ $TERM ''} {TERM = unknown}}
		{%and {~ $TERM *' '*} {
			let (t = ()) {
				eval 't = (' $TERM ')'
				TERM = $t(1)^-^$t(2)
			}
		}}
		{%and {~ $TERM *vt520} {$TERM = vt52}}

(we were having problems with flaky TERM values, obviously)
I'm not proposing the above, I'm exposing my ineptitude in the hope that
someone will be inspired to improve on it.

	Donn Cave, University Computing Services, University of Washington
	donn@cac.washington.edu