|
1 | 1 | from mathics.builtin import builtins |
2 | | -from mathics.builtin.base import Predefined |
| 2 | +from mathics.builtin.base import Builtin |
3 | 3 | from mathics.builtin.assignment import Set |
4 | 4 | from mathics.core.definitions import Definitions |
5 | | -from mathics.core.expression import (Expression, Symbol) |
6 | | -from mathics.core.expression import (Expression, Symbol) |
| 5 | +from mathics.core.expression import Expression, Symbol |
7 | 6 |
|
8 | | -# FullFormInput = Definition("Global`$FullFormInput", defaultvalues=[True], |
9 | | -# ownvalues=[True], builtin=True) |
| 7 | +from mathicsscript.version import __version__ |
10 | 8 |
|
11 | | -FullFormInput = Symbol("Global`$FullFormInput") |
12 | | -true = Symbol("System`True") |
13 | | -xx = Set(FullFormInput, true, expression=False) |
14 | | -definitions = Definitions(add_builtin=True) |
15 | | -from trepan.api import debug; debug() |
16 | | -xx.apply(FullFormInput, true, definitions) |
17 | | -print(xx) |
| 9 | +pymathics_version_data = { |
| 10 | + "author": "The Mathics Team", |
| 11 | + "version": __version__, |
| 12 | + "requires": [], |
| 13 | +} |
18 | 14 |
|
19 | 15 |
|
20 | | -# class FullFormInput(Predefined): |
21 | | -# """ |
22 | | -# <dl> |
23 | | -# <dt>'$FullFormInput' |
24 | | -# <dd> |
25 | | -# </dl> |
| 16 | +class ShowFullFormInput(Builtin): |
| 17 | + """ |
| 18 | + <dl> |
| 19 | + <dt>$ShowFullFormInput' |
| 20 | + <dd> If True, show the FullForm parse of terminal input |
| 21 | + </dl> |
| 22 | + """ |
26 | 23 |
|
27 | | -# Example: |
28 | | -# <pre> |
29 | | -# In[1] = $FullFormInput |
30 | | -# Out[1] = False |
31 | | -# </pre> |
| 24 | + name = "$ShowFullFormInput" |
| 25 | + attributes = ("Unprotected",) |
32 | 26 |
|
33 | | -# >> Head[$FullFormInteger] == Boolean |
34 | | -# = True |
35 | | -# """ |
| 27 | + def apply(self, lhs, rhs, evaluation): |
| 28 | + "lhs_ = rhs_" |
36 | 29 |
|
37 | | -# name = "$FullFormInput" |
| 30 | + self.assign(lhs, rhs, evaluation) |
| 31 | + return rhs |
| 32 | + |
| 33 | + def evaluate(self, evaluation) -> Symbol: |
| 34 | + return self.value |
38 | 35 |
|
39 | | -# def evaluate(self, evaluation) -> Expression: |
40 | | -# return True |
41 | 36 |
|
42 | | -# instance = FullFormInput() |
43 | | -# builtins['$FullFormInput'] = instance |
44 | 37 | # definitions.get_attributes(').clear() |
0 commit comments