You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A possible workaround for supporting camlp5 on UTop #485
Currently UTop directly passes an input string to UTop.parse_toplevel_phrase which in turn calls Parse.toplevel_phrase.
This implies that even if a user installs a custom preprocessor using camlp5, the input text isn't preprocessed using this.
For example, in HOL Light, a special quotation `x` means an expression called 'term' type, and its camlp5 preprocesses it as parse_term "x". However, this is not being successfully treated:
Rather than finding a solution for fully supporting camlp5, there seems to be a quick possible workaround. If I store `1 + 2 = 3`;; as a temporary file, say tmp.ml, and load it using the #use command, this works great.
A downside of this solution is that UTop cannot track the history of parsed phrases, but this cost is okay to take I believe.
As a possible solution for supporting camlp5, I would like to discuss about adding this as an option to UTop.
--
I created a pull request that seems to be more proper solution than the temporary #use-based solution: #486
Activity
Octachron commentedon Jul 22, 2025
The fix has been merged. There might be some potential issue with
use_filebut as this is only partially related, I am closing this specific issue.[new release] utop (2.16.0)
[new release] utop (2.16.0)
[new release] utop (2.16.0)
[new release] utop (2.16.0)
[new release] utop (2.16.0)
[new release] utop (2.16.0)