Navigation
Synopsis The special variable it occurs outside a reducer expression.
Description A Rascal:Reducer is used to reduce all elements in a collection to a sngle value. The special variable it represents the currently reduced value and can be modified inside the reducer. This error is generated when it i used otuside the a reducer.

Remedies:
  • You have accidentially used a variable with the name it; rename your variable to something else.
  • Place the expression that contains it in a reducer expression.
Examples This is correct way to add all elements in a list:
rascal>(0 | it + n | int n <- [1,5,9] )
int: 15
Using it outside a reducer gives an error:
rascal>it + 3
|stdin:///|(0,2,<1,0>,<1,2>): Use of 'it' special variable is only allowed within reducers
Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.