Error messages from GeomLab

This page lists most of the error messages that can be produced by GeomLab, with an explanation of the circumstances that can lead to each one. After an error has occurred, you can use the command 'Help/Help after an error ...' to jump to the part of this page that describes the error. If you did exactly that, and it brought you to the top of this page, then either no error has occurred at all, or the message you've seen is one of a few that are not covered on this page.

There are two kinds of error messages. One kind happens because GeomLab can't work out how your input conforms to the rules of the language; these messages begin "Oops: ...", and the expression you have typed is left in the bottom pane of the GeomLab window, with a highlight on the first symbol in your expression that GeomLab can't deal with. Up to this point, the expression obeys the rules of the language, but the highlit symbol is one that can't possibly come next. Usually, the error message will give some indication of what symbols could come next.

The other kind of error message appears when you enter an expression that obeys the rules of the language, but GeomLab fails to compute the value of the expression, most likely because the expression calls for an operation that is impossible for one reason or another. These messages begin "Aargh: ...". GeomLab cannot point out where in your expression the error occurred, because it is likely to result from interactions between parts of your expression and definitions you have made previously.

The labels "Oops" and "Aargh" are meant to remind you that the errors you make while experimenting with programming need not be taken too seriously. Everyone makes mistakes!

Here is the list of error messages:

Oops: unterminated comment
Comments in the GeomLab language are enclosed in braces { ... }. Your expression contains an opening brace without a matching closing brace, so that all the last part of the expression was taken as a comment by GeomLab.
Oops: Can't find matching '{'
A closing brace (which should end a comment) appears in your expression without a previous opening brace.
Oops: unterminated string constant
A string constant (beginning with a double quote character) appears in your expression without a matching double quote before the end of the line.
Oops: unknown symbol
GeomLab does not recognise a character as one of those that can appear in a valid expression.
Oops: I expected symbol here
At this point, the only acceptable symbol is the one indicated, but a different symbol occurred in the input.
Oops: Can't find matching '('
A closing parenthesis in the expression you entered does not have a matching opening parenthesis, perhaps because your expression contains fewer '('s than ')'s altogether. For complex expressions, the option that's enabled by the command 'Options/Match brackets' will help you to make sure that parentheses match correctly.
Oops: Can't find matching '['
A closing square bracket (ending a possible list expression) does not have a matching opening bracket. A possible cause of this (if the opening bracket is not just missing) is that round brackets and square ones have become muddled, so that a ')' is needed before the ']' that matches the earlier '['. Again, the option 'Options/Match brackets' can help you to keep things straight.
Oops: extra text appears after the end of the expression
The input begins with a valid expression, but there is more text after the end of the expression that could not be part of any longer expression.
Oops: I don't recognise this expression
An expression should appear here, but the next symbol is not the start of any valid expression.
Oops: I expected an expression here
A further expression should appear, but the input ends at this point.
Oops: I expected an operator symbol here
An operator symbol like + should appear here, but another symbol was found.
Oops: the same function name should appear in each equation
When a function definition consists of more than one clause, the same function name should appear in each clause.
Oops: each equation should have the same number of arguments
When a function definition consists of more than one clause, each clause should contain the same number of argument patterns.
Oops: I don't recognise this pattern
A pattern should appear here, but the next symbol does not begin any valid pattern.
Aargh: function f called with n arguments but needs m
Each function in GeomLab takes a fixed number of arguments: for example, the function pair defined by define pair(p, q) = p $ flip(q) takes two pictures as its arguments. It makes no sense to call a function with a different number of arguments: so the expressions pair(man) and pair(man, woman, star) have no value.
Aargh: function f undefined for arguments (x, y, z)
The function f has been called with the arguments shown, but none of the clauses in the definition of f match the arguments.
Aargh: recursion went too deep
Can this ever happen? Let us know!
Aargh: sorry, that took too long
Aargh: sorry, that took too much memory
GeomLab spends no more than a certain time (by default, 10 seconds) and no more than a certain amount of memory space (by default, 50000 objects) in trying to evaluate any expression you type. This is necessary in order to catch expressions that would never finish evaluating, and to stop the memory space of the computer from becoming so clogged up that GeomLab ceases to function properly. Since all the expressions you'll need to evaluate as you follow the worksheets fall well within these limits, the most likely thing is that the expression you've typed would never produce a value. Most commonly, this is because some recursive function f in your program either leads from a call of f(n) to another call of f(n) with the same value of n, or has no proper 'base case', so that calling f(0) leads to calls of f(-1), f(-2), and so on forever.
Aargh: applying a non-function
An expression f(x, y, z) makes sense only if f is a function. In this case, it is some other value. Perhaps you defined a name with define f = ... when you meant to write define f(x) = ...?
Aargh: boolean required in condition
In an expression "if condition then expression-1 else expression-2", evaluating the condition must yield a Boolean value, either true or false. In this case, the condition has yielded some other value.
Aargh: x is not defined
The name x has been used in an expression, but it does not have a value.
Aargh: can't replace built-in definition of x
You have attempted to redefine one of the constants or functions that are built-in to GeomLab. To prevent confusion, this is not permitted: choose a different name for you new object.
Aargh: primitive f not understood
An object named f has been called as a primitive function, but GeomLab has no method for evaluating it. This can only happen because of a bug in GeomLab itself, or in some plug-in module.
Aargh: taking head of the empty list / a non-list
The function head(xs) yields a value only if xs is a non-empty list: in this case, the value is the first element of the list. It has been applied in a context where xs is either the empty list [], or is not a list at all.
Aargh: taking tail of the empty list / a non-list
The function tail(xs) yields a value only if xs is a non-empty list: in this case, the value is a list containing all but the first element of xs. It has been applied in a context where xs is either the empty list [], or is not a list at all.
Aargh: f expects a kind argument
The function f expects an argument of some specific kind: a number, a picture, etc.. The argument it received was not of some other kind.
Aargh: install failure - details
An attempt to install a plug-in module into GeomLab has failed for the reason shown.
Aargh: taking square root of a negative number
The function sqrt(x) is defined only if x >= 0, but somehow it has been invoked when x < 0.
Aargh: division by zero
In an expression x / y, the value of y was zero.
Aargh: bad arguments to operator '++'
The binary operator ++ is used to concatenate two lists, but the left-hand operand is not a well-formed list.
Aargh: not expects a boolean operand
In the expression not p, the operand p should be a boolean value: either true or false.
Aargh: bad argument to function 'reverse'
The function reverse(xs) is used to reverse a list xs, but xs is not a well-formed list.
Aargh: bad argument to function 'length'
The function length(xs) is used to find the length of a list xs, but xs is not a well-formed list.
Failure: details
This message appears only after an unexpected failure in the evaluation mechanism of GeomLab: you should never see it, and if you do, then that is evidence of a bug in GeomLab itself. See if you can reproduce the circumstances that led to the failure, and if so, please write to us and give us enough information for us to reproduce the bug ourselves, so that we can fix it.