|
|
|
|
|
by geophile
992 days ago
|
|
Thank you! One change from the stream page: > and >> now redirect to files in the traditional Unix/Linux way. (That older behavior was just too ingrained and I imagine it is for lots of people.) Use >$ and >>$ to store in variables that don't survive your session. (The $ is meant to evoke an association with variables.) Multiline functions can be defined right now: M 0.18.3 jao@loon ~$ f = (lambda: \
M +$ lambda x, y: x + y \
M +$ )
M 0.18.3 jao@loon ~$ (f(3,4))
7
So all that would be needed is a way to dump them into a file. That should be doable with
another function.One thing to note: You have choices beyond inline and imports for defining new functions. There is a startup file, typically in ~/.config/marcel/startup.py. You can define functions in there, or do imports. The REPL loop checks for modifications to that file, so if you change it, you pick up the changes for your next command. For example, I just put this into my startup file: def hello(x):
return f'Hello {x}'
and then without restarting marcel: M 0.18.3 jao@loon ~$ (hello('world'))
Hello world
|
|