You then still have to add the following lines to your. Normally, the required pure-mode elisp files should be installed automatically in your emacs/site-lisp directory if Emacs is detected at configure time. Here's a screenshot showing Emacs with Pure mode in action: If you're friends with GNU Emacs then the Emacs Pure mode distributed with the Pure sources is probably the most convenient way to run Pure for you. (In particular, it has been found that on MS Windows, readline lacks support for AltGr key combinations on international keyboards.) Pure and Emacs This might be useful in situations where readline doesn't work properly. You can also disable readline support on the command line, by invoking the interpreter with the -noediting option. Please note that this feature is only available if the interpreter was built with readline support (which is the default if it's available). Moreover, Pure's pure-readline module provides an interface to the readline library so that you can use it in your Pure programs, too. pure_history file in your home directory between different invocations of the interpreter. The cursor up and down keys can then be used to walk through the command history, existing commands can be edited and resubmitted with the Return key, etc. When running interactively, the Pure interpreter usually employs the GNU readline library to provide some useful command line editing facilities. Please refer to the Pure Manual for details.Ī number of other command line options are available try pure -h for a list of those. This considerably reduces startup times and lets you deploy Pure programs on systems without an installation of the Pure interpreter (the runtime library is still needed, though). Of course you can also run your scripts directly from the command line, as follows: More information about the debugger can be found in the Pure Manual. ![]() ![]() If you know other source level debuggers like gdb then you should feel right at home. But at the debugger prompt : you can also enter various special debugger commands, e.g., to print and navigate the call stack, step over the current call, or continue the evaluation unattended until you hit another breakpoint. In the above example we just kept hitting the carriage return key to walk through the evaluation step by step. The prefix ++ denotes reductions which were actually performed during the evaluation and the results that were returned by the function call (printed as -> return value). Lines beginning with ** indicate that the evaluation was interrupted to show the rule which is currently being considered, along with the current depth of the call stack, the invoked function and the values of parameters and other local variables in the current lexical environment. fact n::int = if n>0 then n*fact (n-1) else 1 > break fact > fact 1 ** fact: fact n::int = if n>0 then n*fact (n-1) else 1 n = 1 (Type 'h' for help.) : ** fact: fact n::int = if n>0 then n*fact (n-1) else 1 n = 0 : ++ fact: fact n::int = if n>0 then n*fact (n-1) else 1 n = 0 -> 1 ** (*): x::int*y::int = x*y x = 1 y = 1 : ++ (*): x::int*y::int = x*y x = 1 y = 1 -> 1 ++ fact: fact n::int = if n>0 then n*fact (n-1) else 1 n = 1 -> 1 1
0 Comments
Leave a Reply. |