libera/#clasp - IRC Chatlog
Search
13:42:41
drmeister
Would there be a problem defining `!` (exclamation mark) as a reader macro in cando that would take everything to the next carriage return and invoke (ext:system "xxx")?
13:43:29
drmeister
So - within jupyterlab or slime: `! mkdir foo<cr>` would evaluate `(ext:system "mkdir foo")`
13:47:42
drmeister
I've got the ability to build spiroligomers now and I'm streamlining the workflow on the HPC to build the training molecules before I move on and forget all the complicated back and forth I did in the shell and submitting jobs to the HPC queue.
13:47:56
yitzi
I don't think it is a problem. Its basically like magic commands in the Python shell.
13:48:25
drmeister
If I could do everything from within a jupyter notebook then a jupyter notebook that submits jobs to the HPC queue becomes documentation for the next time I do it.
13:56:46
drmeister
Leap script allows: `foo = 1234`. I'd like to use `#@ foo = 1234` and `#@ foo = { 1 2\<cr> 3 4}`
13:59:31
drmeister
I assume I can't use a reader macro if there are symbols that contain the reader macro sequence.
14:00:17
yitzi
You make [ a dispatch reader macro that reads everything up to the next ]. It then feeds the string to leap-eval.
14:06:27
drmeister
Gah! We already have a `#!` reader macro in clasp . https://github.com/clasp-developers/clasp/blob/main/src/lisp/kernel/lsp/mislib.lisp#L267
14:07:33
drmeister
yitzi: If there is a `[` reader macro - doesn't that mean I can't edit source files that contain symbols like COMPILER:%T*[DUMMY]% ?
14:11:37
drmeister
That would work within a jupyter notebook and if I exported the jupyter input cells as a script it would work within Cando.
14:12:46
drmeister
We could still use: `foo = 1234` in jupyter input cells because that's what users will want - but that can't be exported to a script unless you go back and wrap each leap command in `#[` and `]` - right?
14:14:10
drmeister
yitzi: The current `#!` macro could be there to support the --script option of clasp - does that sound right?
14:20:38
yitzi
It was probably an early attempt to ignore shebangs. It added the --script option so shebangs will never be seen by the reader
14:23:20
yitzi
There are tools to do stuff like that, we could either make sure the tool wraps with #[] when needed or add a feature to Cando's REPL that emulates the Leap/Lisp pattern of Jupyter kernel
14:24:26
yitzi
There is also an ASDF system in common-lisp-jupyter that will convert a lisp file into a Jupyter notebook. Just fyi
14:35:06
yitzi
Well, to be fair Jupyter is it's own repl. It does all the usual repl stuff like binding /, //, etc. ;)
14:36:11
yitzi
The difference is that I compile the code and maintain source code references so you can actually debug step through a cell.
15:10:10
drmeister
So that doesn't sound too bad. I worry though about breaking the slime repl by adding leap script.