Lugaru's Epsilon
Programmer's
Editor 14.04

Context:
 Epsilon User's Manual and Reference
 Epsilon Extension Language
 . . .
 Order of Evaluation
 Expressions
 . . .
 Assignment Operators
 Function Calls
 Miscellaneous Operators
 Constant Expressions
 . . .

 Previous Up Next Function Calls Epsilon Extension Language Constant Expressions

### Miscellaneous Operators

expression:
expression `?` expression `:` expression
expression `,` expression
expression `[` expression `]`
expression `->` identifier
expression `.` identifier

The conditional operator `?` `:` has three operands. The first operand is always evaluated first. If nonzero, the second operand is evaluated, and that is the value of the result. Otherwise, the third operand is evaluated, and that is the value of the result. Exactly one of the second and third operands is evaluated. The first operand may be a number, spot, or pointer. The second and third operands may either both be numbers, both spots, both pointers to the same type of object, or one may be a pointer or spot and the other the constant zero. In the first case the result is an int, and in the last two cases the result is a spot or a pointer of the same type.

The `,` operator first evaluates its first argument and throws away the result. It then evaluates its second argument, and the result has that value and type. In any context where a comma has a special meaning (such as in a list of arguments), EEL assumes that any commas it finds are used for that special meaning.

The `[ ]` operator is EEL's subscripting operator. Because of the special way that addition of a pointer and a number works, we can define the subscripting operator in terms of other operators. The expression `e1[e2]` is the same as `*((e1)+(e2))`, and since addition is commutative, also the same as `e2[e1]`. In practice, subscripting works in the expected way. Note that the first object in an array has subscript 0, however. One of the operands must be a pointer and the other a number. The type of the result is that of the pointed-to object.

The `.` operator disassembles structures or unions. Its operand is an lvalue which is a structure or union. After the `.` an identifier naming one of the operand's members must appear. The result is an lvalue referring to that member.

The `->` operator is an abbreviation for a dereference (unary `*`) followed by a member selection as above. Its operand is a pointer to a structure or union, and it is followed by the name of one of the structure's or union's members. The result is an lvalue referring to that member. The expression `strptr->membername` is the same as the expression `(*strptr).membername`.

 Previous Up Next Function Calls Epsilon Extension Language Constant Expressions

Epsilon Programmer's Editor 14.04 manual. Copyright (C) 1984, 2021 by Lugaru Software Ltd. All rights reserved.