Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This expression (explained here by Leonid) evaluates fine unless Evaluation->Debugger is enabled:

h[x : (_Integer) : 1] := x

Syntax::sntxf: "x:" cannot be followed by "(_Integer):1".
Syntax::tsntxi: "(_Integer):1" is incomplete; more input is needed.
Syntax::sntxi: Incomplete expression; more input is needed .

Strangely it works if the parentheses are removed:

h[x : _Integer : 1] := x

But both of these fail when debugging:

h[x : (_Integer | None) : None] := x
h[x : Alternatives[_Integer, None] : None] := x

(* Workaround: *)
ptn = _Integer | None;
h[x : ptn : None] := x

All this was with Mathematica 8.0.4 Linux

What is the debugger up to?

share|improve this question
Seems to work OK in Mma 9.0 – Dr. belisarius Nov 7 '13 at 0:14
The obligatory question: what version are you running? – rcollyer Nov 7 '13 at 14:48
@rcollyer "All this was with Mathematica 8.0.4 Linux" :) – ssch Nov 7 '13 at 14:49
Yeah, yeah. I should read the whole thing before I comment. I know, I know. :P – rcollyer Nov 7 '13 at 14:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.