5

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?

ssch
  • 16,590
  • 2
  • 53
  • 88

0 Answers0