[YG Conlang Archives] > [engelang group] > messages [Date Index] [Thread Index] >
Mart�n Bald�n, On 16/05/2006 00:07:
--- In engelang@yahoogroups.com, And Rosta <a.rosta@...> wrote:As I said in one of my messages yesterday, fixed arity means nobrackets, and variable arity needs just an unlabelled right bracket. And in reverse polish, you need just an unlabelled left bracket. But variable-arity, nested expressions need nested parenthesis, and their numbers can grow quickly. Having lots of brackets in a row is both verbous and confusing, that's the reason for using labeledbrackets.
Have two right brackets. One marks the final operand and precedes it. This avoids nesting. The other marks either zero arity and follows the operator, or else precedes the first operand.
And I don't think having right brackets only is enough for my purposes. Let's see:How would you represent the following expressions?:exp1: (and (or a b) (xor c d ) e ) exp2: (and (or a b (xor c d) ) e ) Would it be something like this? :exp1: and or a b) xor c d ) e exp2: and or a b xor c d) eI suspect it is. This seems much more concise, but there's a catch: you are assuming that some lexemes, such as "and", "or" and "xor" have the privileged status ofoperators,
Yes.
while others, like "a", "b", "c", "d", "e" don't, and so they can never be the "head" of an expression, only its arguments.
No.
In Lisp, you can define new operators all the time, and the syntax is unafected, which gives Lisp its legendary flexibility. The problem is that you also need more brackets. The key is to make use of this flexibility in clever ways, to keep a reasonable number of brackets. A frequent trick is using macros, with which you can get results just as concise as in other notations, with the advantage that it's fully customizable. Actually, some Lisp fans say that the ease of making powerful macros is one of the key strong points of Lisp. So, I'll have to study the issue of Lisp macros and see how to implement them in a spoken language. Meanwhile, I thought it was a good idea to have a user-friendly notation for deeply nested brackets, since I know I'll need them.
Can you give some sort of example -- a hypthetical example in your conlang, I mean? I don't grasp what the catch is yet. --And.