Home, Up: Insert Files and User Defined Elements
On this page:
Editing a User-Defined Element, Files, Variables, and UDEs in UDE Assign Commands.
The short answer: you can't.
The longer answer: what you can do is add something before and/or after the UDE's current content:
? @myude = 3 5 7 9
? @myude = 2 @myude 13
? SHOW@ @myude
@myude = 2 3 5 7 9 13
The full answer: to edit a UDE you'd have to save your UDEs to a file, open it in an external editor, edit and save it, and retrieve your UDEs from that file:
? SAVE@ myudefile
? EDIT myudefile
? _myudefile
You could also, for instance, copy/paste the edited UDE to hy.ini.
Take care not to insert line breaks into an UDE's content -- they are allowed in insert files, but not in UDE assign commands!
Apart from numbers and operators, a UDE assign command can include insert files, variables, and UDEs — you must be aware of how they are processed, though:
? @myude = ... (somefile) ...
Often the content of a file will simply be copied to a user-defined element:
? @myude = (somefile)
If the insert file exists, its current content will be assigned (or will be part of what is assigned) to @myude.
Comment lines in the insert file will be ignored, line breaks will be replaced with spaces.
When the file later changes or is deleted, @myude will remain unaffected.
If the file does not exist at the time of the assign command, an error will occur.
? @myude = ... $somevariable ...
A variable name in a UDE assign command will not be replaced by the variable's current value, but the variable name will be part of the UDE's content.
Whether the variable exists at the time of the assign command, or what value it has at that time, makes no difference.
When the UDE is used, the current value of the variable will be applied.
If the variable does not exist when the UDE is used, an error will occur.
? @myude = ... @someude ...
If the UDE to the right of the equal sign exists, it is treated like an insert file -- if it later gets changed or deleted, @myude will remain unaffected.
If the UDE to the right of the equal sign does not exist, it is treated like a variable: its name will become part of @myude, and it will be replaced by that UDE's current content at the time when @myude is used (if it still does not exist, an error will occur).
Home, Up: Insert Files and User Defined Elements, Prev: User Defined Operators, Next Chapter: Results