PicoLisp / REPL Emacs
Hi all, I have seen the docs about Emacs and found one webblog dealing with PicoLisp Emacs but the information is quite old.. Do you use Emacs and Company ? How do you integrate the PicoLisp REPL into Emacs ? I'd like to avoid auto complete because I already have a quitte tricky configuration for Company and I guess that running both completion systems in the same time is not perfect.. Thanks for any fresh pointer Kind regards jerome -- J.MOLIERE - Mentor/J
Re: PicoLisp / REPL Emacs
Hi Jerome, I'm using Emacs (on Linux), and I was very happy how easy it was to use picolisp source blocks in Emacs org-mode. Even with sessions enabled. But that is no answer to your question, I think. I do not understand the term Do you use Emacs and Company?. Does 'Company' mean software or an office? I did not integrate the REPL into Emacs, as I often ran into probs with the Emacs e-shell with other tasks, so that I never tried with picolisp. Regards, Olaf On 29.09.2014 10:38, jerome moliere wrote: Hi all, I have seen the docs about Emacs and found one webblog dealing with PicoLisp Emacs but the information is quite old.. Do you use Emacs and Company ? How do you integrate the PicoLisp REPL into Emacs ? I'd like to avoid auto complete because I already have a quitte tricky configuration for Company and I guess that running both completion systems in the same time is not perfect.. Thanks for any fresh pointer Kind regards jerome -- JMOLIERE - Mentor/J --080100070709040005010007 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit html head meta content=text/html; charset=utf-8 http-equiv=Content-Type /head body bgcolor=#FF text=#00 font face=monospaceHi Jerome,br br I'm using Emacs (on Linux), and I was very happy how easy it was to use picolisp source blocks in Emacs org-mode.br Even with sessions enabled.br br But that is no answer to your question, I think. br I do not understand the term Do you use Emacs and Company?. Does 'Company' mean software or an office?br br I did not integrate the REPL into Emacs, as I often ran into probs with the Emacs e-shell with other tasks, so that I never tried with picolisp.br br Regards,br Olafbr br br /font div class=moz-cite-prefixOn 29.09.2014 10:38, jerome moliere wrote:br /div blockquote cite=mid:CADVEE2+A1o5C3fvmEs9p2ZVOW9Yi1NXG+t=skhvnvtzzxhy...@mail.gmail.com type=cite div dir=ltrHi all, divI have seen the docs about Emacs and found one webblog dealing with/div divPicoLisp amp; Emacs but the information is quite old../div divDo you use Emacs and Company ? How do you integrate the PicoLisp REPL into Emacs ? I'd like to avoid auto complete because I already have a quitte tricky configuration for Company and I guess that running both completion systems in the same time is not perfect../div divbr /div divThanks for any fresh pointer /div divKind regards/div divjeromebr clear=all divbr /div -- br JMOLIERE - Mentor/J /div /div /blockquote br /body /html --080100070709040005010007-- -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: REPL script and @
Hi Alex, On 18. Dec, 2013, at 21:19, Alexander Burger a...@software-lab.de wrote: Hi Jon, I just wrote a little PicoLisp script (for pil32) that simulates the REPL, quite similar to the one I did for Ersatz a while ago, http://picolisp.com/5000/!wiki?SwingRepl. The new REPL script looks like this: (in NIL (until (eof) (let (ProgText (pack (line)) Prog (str ProgText) Result (run Prog) ) (prinl - (sym Result)) (flush) ) ) ) It works quite fine, but one minor flaw is that, when you're running this REPL, '@' always returns NIL. Is there some simple way to fix that? Yes, you could bind the symbol '@', like in (in NIL (use (Exe Res) (while (setq Exe (read)) (prin - ) (println (setq Res (let @ Res (eval Exe) ) ) ) ) ) ) Note that I here use 'read', 'eval' and 'print' directly, so there is no need to operate on the string level with 'pack', 'line', 'str' and 'sym'. Note also that this REPL exits when NIL is read (while .. (read)), as this is also the behavior of the built-in REPL. If you don't want this, then your way of (until (eof) ..) is better. ♪♫ Alex I just noticed that doing the (prin - ) before the (eval Exe) causes the arrow to be printed before the first printed line, e.g. when entering an expression like (for N 3 (prinl N)). Instead, the arrow should appear just before the final result. I have now ended up with this: (in NIL (use Res (until (eof) (setq Res (let @ Res (eval (read)) ) ) (prin - ) (println Res) (flush) ) ) ) (bye) /Jon
Re: REPL script and @
Hi Jon, I just noticed that doing the (prin - ) before the (eval Exe) causes the arrow to be printed before the first printed line, e.g. when entering an expression like (for N 3 (prinl N)). Instead, the arrow should appear just before the final result. I have now ended up with this: (in NIL (use Res (until (eof) (setq Res (let @ Res (eval (read)) ) ) (prin - ) (println Res) (flush) ) ) ) Yes, right. That's better. The (flush) at the end is actually not needed, because the end-of-line in 'println' flushes the output automatically. However 'prin' does not, so I would move the (flush) up: (prin - ) (flush) (println Res) ) ) ) This is critical only when printing the result takes a long time. You see that, for example, if you calculate a big number which takes time to convert upon output. : (** 1 1) The - appears immediately due to the (flush), but the digits 1000... only after a second or so. ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe
Re: REPL script and @
Hi Alex, On 29. Sep, 2014, at 15:40, Alexander Burger a...@software-lab.de wrote: Hi Jon, I just noticed that doing the (prin - ) before the (eval Exe) causes the arrow to be printed before the first printed line, e.g. when entering an expression like (for N 3 (prinl N)). Instead, the arrow should appear just before the final result. I have now ended up with this: (in NIL (use Res (until (eof) (setq Res (let @ Res (eval (read)) ) ) (prin - ) (println Res) (flush) ) ) ) Yes, right. That's better. The (flush) at the end is actually not needed, because the end-of-line in 'println' flushes the output automatically. However 'prin' does not, so I would move the (flush) up: (prin - ) (flush) (println Res) ) ) ) This is critical only when printing the result takes a long time. You see that, for example, if you calculate a big number which takes time to convert upon output. : (** 1 1) The - appears immediately due to the (flush), but the digits 1000... only after a second or so. ♪♫ Alex Thanks. I tried moving (flush) up, but it didn’t work well in my websocketd setup. The effect was that the arrow and result didn’t appear until I entered a new command, so it seemed as if ‘println’ didn’t flush. I’ll keep my (flush) at the end. ;-) I’m using 32-bit PicoLisp. /Jon
Re: REPL script and @
Hi Jon, Thanks. I tried moving (flush) up, but it didn’t work well in my websocketd setup. Ah, I should have said that Stdout in Unix is flushed at end of line only if output is to a TTY. So you actually need two (flush)s. ♪♫ Alex -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe