Epsilon: Allow the user not to close parens, quotes etc.

Created on 1 Sep 2017  Â·  4Comments  Â·  Source: numworks/epsilon

Set up:
In the calculation app, a user types 2 * ( 3 + 5 then presses [EXE].

Current situation:
The calculator tells the user that there is a syntax error.

Proposed situation:
The calculator ignores the missing closing _X_ character (in this case, _X_ being a parenthesis) and computes what the user intended: 2*(3+5), resulting in less time wasted.
To be clearer to the user, as soon as an open-_X_ character is typed, the OS would append the matching closing one to the current input, in a lighter color for instance.

Comments:

  • This could work for characters like parens (for expressions), quotes (for strings), brackets (both curly and square, for lists and matrices).
  • Support for nested characters would have to be done.
  • ... and support for characters being deleted, too, where the inserted matching closed one would go away as well.
  • Note: this is the way things work on some TI calculators (ignoring only on the z80/ez80, "grey draw" on the Nspire), and possibly others.

Example:
grey draw example

enhancement

Most helpful comment

A pretty solution, could be colored brackets.

If there is only one brackets level, stay black. Each sublevel has its own color. If a bracket is open and not closed (or closed and not opened) it's red. Colors have to be used each time it's helpful…

A mockup (I thought "1st level stay black" after drawing)
capture du 2017-10-10 18-00-16

All 4 comments

Also maybe add autocompletion support for commas. For example, if I select "sum" from the toolbox, it gives me sum(|,,), and if I type '6' then ',', it should override the present comma instead of adding another.

The Casio calculators also support missing closing brackets btw.

A pretty solution, could be colored brackets.

If there is only one brackets level, stay black. Each sublevel has its own color. If a bracket is open and not closed (or closed and not opened) it's red. Colors have to be used each time it's helpful…

A mockup (I thought "1st level stay black" after drawing)
capture du 2017-10-10 18-00-16

I think it is better if student are forced to close bracket.
We already have too many student typing 1+x/2 instead of (1+x)/2 ...

If this sort of thing get ever added, I think it should be an option disabled by defaut.

But some coloring of bracket could be good (for exemple cooloring the "cursor touched" bracked couple).

Related to #587

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Ecco picture Ecco  Â·  4Comments

streydog picture streydog  Â·  3Comments

TheElectronWill picture TheElectronWill  Â·  3Comments

boricj picture boricj  Â·  4Comments

yeKcim picture yeKcim  Â·  4Comments