Search
Saturday, 23rd of December 2017, 11:15:44 UTC
15:28:52
Posterdati
please how can I overwrite a line with format? Thanks
15:29:05
pjb
This is not a feature of format.
15:29:30
pjb
The best way to do it, would be to use cl-charms (ncurses).
15:29:51
pjb
However, in practice, you may also make some implementation dependent assumptions.
15:30:27
pjb
Like, if your implementation writes ASCII bytes converted from your character, then you could use the semi-standard character name #\return.
15:30:28
loke
Posterdati: You _might_ be able to do it by sending a CR.
15:30:55
pjb
(format t "Foo Bar Baz~CBar~%" #\return)
15:31:07
pjb
Yes, if it is available, it's its name.
15:31:43
pjb
#+#.(cl:if (cl:ignore-errors (cl:read-from-string "#\\return")) '(:and) '(:or)) (format t "Foo Bar Baz~CBar~%" #\return)
15:31:55
pjb
Posterdati: yes, I forgot to mention the condition: if your terminal interprets it.
15:32:05
pjb
Posterdati: ie. not in slime!
15:32:34
pjb
For slime have a look at: https://framagit.org/nasium-lse/nasium-lse/blob/master/src/swank-terminal.lisp
15:32:56
pjb
Posterdati: So you have to use a I/O layer with #+swank/#-swank
15:33:07
pjb
check this nasium-lse project for more example about this.
15:34:18
pjb
There's also another way: you can open a xterm from a running program. So even if you use swank/slime, you can still open an xterm and send it ECMA-048 control sequences.
15:34:51
pjb
But it relies on implementation specific features, to open a pipe to the xterm and make a stream of it.
16:53:33
makomo
is there anything in CL like haskell's mapConcat?
16:54:00
makomo
map a function over multiple lists, concatenate the resuting lists and return that
16:54:34
jackdaniel
(reduce 'append (mapcar 'foo list-1 list-2)) ;?
16:55:03
makomo
err, mapping over one list at a time
16:55:18
makomo
unless i'm mistaken about how MAPCAR (& co.) work?
16:55:52
makomo
from what i understand, if you give MAPCAR multiple lists it calls the function by passing it all of the current heads at the same time
16:56:22
jackdaniel
and what do you want to do? one after another?
16:56:33
makomo
an example of what i want would be (map-concat #'1+ '(1 2 3) '(4 5 6)) == (2 3 4 5 6 7)
16:59:27
jackdaniel
I think there isn't something builtin
16:59:47
jackdaniel
(mapcar #'1+ (flatten list-1 list-2 …))
17:00:30
jackdaniel
or not flatten, append rather
17:01:45
makomo
jackdaniel: ah that's much nicer, i was going to do it with a loop
19:35:39
alandipert
makomo i think mapcat =~ mapConcat/flatMap
19:37:09
alandipert
ACTION scrolls up and sees thats not exactly what you want though
19:38:02
alandipert
another related thing is the nconc keyword in loop macro
19:38:22
alandipert
just ran across it the other day, pretty weird. of course i'm in the loop macro fetish camp, ymmv
19:39:01
makomo
hm, coming back to what i said, i think i might have described it in a wrong way
Saturday, 23rd of December 2017, 23:15:44 UTC