Subject: mailing-list for TeXmacs Users
List archive
From : Massimiliano Gubinelli <address@hidden>- To: Wolfgang Lindner <address@hidden>
- Cc: "address@hidden" <address@hidden>
- Subject: Re: read in TeXmacs's Guile
- Date: Tue, 13 Dec 2022 09:12:27 +0000
If you get stuck try to ask questions on the forum (http://forum.texmacs.cn/) it is easier to get rapid answers there and also to search for content.
And let us know if you come up with a nice piece of code, we are always looking to examples to show on TeXmacs twitter feed.
Best
Max
On 13 Dec 2022, at 09:08, Wolfgang Lindner <address@hidden> wrote:Thanks for your hints and links, Max.I will follow your advice with great interest.PS: I like TeXmacs and the possibility to run programs like Maxima, Octave, Pari, Macauly, Scheme etc. in it very much.Thanks for all wizzards, who develop this nice piece of software.Wolfgang--Am 12.12.2022 um 17:07 schrieb Massimiliano Gubinelli <address@hidden>:TeXmacs/Guile can interact with the user via popup windows in the UI. Please give a look at the files$TEXMACS_PATH/progs/kernel/texmacs/tm-dialogue.scmwhere you have functions like the following:;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Questions with user interaction;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;(define-public (user-ask prompt cont)(tm-interactive cont(if (string? prompt)(list (build-interactive-arg prompt))(list prompt))))(define-public (user-confirm prompt default cont)(let ((k (lambda (answ) (cont (yes? answ)))))(if default(user-ask (list prompt "question" (translate "yes") (translate "no")) k)(user-ask (list prompt "question" (translate "no") (translate "yes")) k))))(define-public (user-url prompt type cont)(user-delayed (lambda () (choose-file cont prompt type))))(define-public (user-delayed cont)(exec-delayed cont))they work via continuations, so you will have to rewrite a bit your program.Also you can create full-fedged widgets, look for example the file$TEXMACS_PATH/progs/kernel/gui/tm-menu-test.scmBestMaxOn 12 Dec 2022, at 15:11, Wolfgang Lindner <address@hidden> wrote:Hi group,Currently I work through the book of G Springer about Scheme using TeXmacs/Guile.Until ch. 5 there were no problems and all programs run like a charm.Now in Ch.6 about input/output I run into problems.Here is a typical one.;------------------------------------------------------------------; - Program 6.6, pg. 174 -(define read-demo(lambda ()(display "Enter data (enter done when finished): ")(let ((response (read)))(cond((eq? response 'done) (display "Thank you. Good-bye."))(else (display "You entered: ")(write response)(newline)(read-demo)))))); - End Program -;------------------------------------------------------------------Is it possible to use Texmacs-Guile interactive?I know: use ‚format ..' instead of write/display ..But what to do with (read) ??How to work with user input and output?Any hints or making the program about working are very welcome-Best, Wolfgang----
Dr. Wolfgang Lindner
Leichlingen, Germany
send from my iMac
- read in TeXmacs's Guile, Wolfgang Lindner, 12/12/2022
- Re: read in TeXmacs's Guile, Massimiliano Gubinelli, 12/12/2022
- Re: read in TeXmacs's Guile, Wolfgang Lindner, 12/13/2022
- Re: read in TeXmacs's Guile, Massimiliano Gubinelli, 12/13/2022
- Re: read in TeXmacs's Guile, Wolfgang Lindner, 12/13/2022
- Re: read in TeXmacs's Guile, Massimiliano Gubinelli, 12/12/2022
Archive powered by MHonArc 2.6.24.