Calling Table with custom iterator

You're not committing a blasphemy. In fact, you're defining an upvalue to your own symbol, so you're in the safe zone. I think your idea of using upvalues was a good one.

Alternatives are, to define your own parsing function such as

SetAttributes[it, HoldFirst];
it[Table[expr_, {var_, start_, end_, num_Integer}]]:=
    Table[expr, Evaluate@{var, start, end, (end-start)/(num-1)}]

so when you do the following you get what you want

Table[something[x], {x, 0, 10, 23}]//it

This could be extended to multiple iterator types. For example, doing the following

iterator["numpoints"]=Function[,it[##],HoldAll];

you can now do

Table[something[x], {x, 0, 10, 23}]//iterator["numPoints"]

and extend it the same way.

You could also define a myTable function that calls table and accepts an option of the iterator type.

The possible con of your original solution is the loss of the syntax highlighting. Perhaps it's not ideal but you could change it from

myIter[L_]:={L[[1]],L[[2]],L[[3]],(L[[3]]-L[[2]])/L[[4]]}

to

myIter[st_, en_, num_]:=(Range[num]-1)(en-st)+st

and then use it

Table[sth, {x, myIter[0, 10, 12]}]

Check the function FindDivisions


In V10, there is now the function Subdivide, which specifies the number of intervals (which equals one less than the number of points) into which a range is to be divided.

The OP's example sine plot may be done as follows:

Table[Sin[x], {x, Subdivide[0.2, Pi^2, 100 - 1]}] // ListPlot

Mathematica graphics


For an approximate solution, out of the box we have:

Table[Sin[x], {x, FindDivisions[{lower,upper},nSteps]}]

It is possible to force FindDivisions to use a fixed sized delta as in:

FindDivisions[{1, 5, \[Pi]/2}, 3]

{0, [Pi]/2, [Pi], (3 [Pi])/2, 2 [Pi]}

As you can see, FindDivisions has quite a strong bias towards what it thinks are "nice" intervals.

Table[Sin[x], {x, FindDivisions[{1, 5, \[Pi]/2}, 3]}]

{0, 1, 0, -1, 0}

Hence the result may contain more or less intervals than requested, here 5 instead of 3. This effect is more evident when few intervals are required.