Subject: mailing-list for TeXmacs Users
List archive
From : Dan Synek <address@hidden>- To: address@hidden
- Subject: Help needed: addressing a session from scheme
- Date: Mon, 12 Aug 2002 16:01:41 +0200
Hello,
This is my first letter to the mail group. My name is Dan Synek, I work and live in Nijmegen, Netherlands,
and work in a group where we develop formalized mathematics (that is mathematical staments and proofs that are so formal that they can be checked by a computer program),
I am trying to interface the coq proof assistant to texmacs.
I have a question on interfacing texmacs to a cas (in my case its actually a proof assistant, but that is not so important here).
The examples that are given in the texmacs documentation are all about the user entering text after a prompt and
having it sent to a computer algebra system.
However, one often want commands sent directly from a menu or other command and have the actual communication in a special window.
Browsing around in source code I found something like that in the giac.scm.
In the file a function giac-insert is defined, which maybe does what I want, but I do not understand the code.
Could someone please enlighten me, or propose another solution.
I am also interested how this relates to a session, so that
something like giac-insert can be defined that takes a particular session as an argument It could then be used
in a situation where there is more than one ongoing session..
Thanks
Dan
Here is the beginning of that file :
(define (giac-cursor-pos l)
(cond ((null? l) 0)
((null? (cdr l)) 1)
((and (equal? (car l) #\() (equal? (cadr l) #\))) 1)
((and (equal? (car l) #\() (equal? (cadr l) #\,)) 1)
((and (equal? (car l) #\,) (equal? (cadr l) #\))) 1)
((and (equal? (car l) #\,) (equal? (cadr l) #\,)) 1)
(else (+ (giac-cursor-pos (cdr l)) 1))))
(define (giac-insert s)
(insert-tree-go-to (object->tree s)
(list (giac-cursor-pos (string->list s)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Giac menu
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define giac-functions-menu
'(("normal" (giac-insert "normal()"))
("factor" (giac-insert "factor()"))
("simplify" (giac-insert "simplify()"))
("partfrac" (giac-insert "partfrac()"))
---
- Help needed: addressing a session from scheme, Dan Synek, 08/12/2002
Archive powered by MHonArc 2.6.19.