Just when it's less than 2 weeks to spec freeze.... I once had to code this expression:
force(car(force(unwrap-box(s)))) And it's ugly. I could use I-expressions: force . car . . force . . . unwrap-box s But that wastes precious vertical space. So I propose the SUBLIST semantic. Informally: 1. If the SUBLIST symbol "$" is found in the middle of a line, then it is an implied "promise" to insert a "(" at that point with a ")" automagically inserted at the end of the block (i.e. before the next line with the same or lesser indent than this one). So: force $ car $ force $ unwrap-box s is equivalent to: (force ( car ( force ( unwrap-box s )))) The only time that the promise will not get used is if there is only a single term after the $: thus: foo $ bar is: (foo bar) ; no ( ) automagically inserted around bar FORMAL Spec: (i-expr lvl) -> head hspace+ SUBLIST hspace+ (i-expr lvl) (append $1 (list $5)) 1. SUBLIST considers the rest of the line as a new expression at the same indentation level as the current line. This new expression is then used as the last member of the list being built. -- This syntax reduces the need for foo:bar syntax in Arc, BTW. : is more compact as it needs no space, and it can be used in higher-order functions, but $ is at the reader level, and does not require magic when used in head position (unlike Arc, where officially foo:bar means (compose foo bar) but (foo:bar nitz) really means (foo (bar nitz)) to make macros composable). ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Readable-discuss mailing list Readable-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/readable-discuss