2 ;;; Defines the Macsyma function FIDO
4 ;;; FIDO(); tells who if anyone fido is looking for
5 ;;; FIDO(FALSE); turns off a fido
6 ;;; FIDO(Name1,Name2,...); starts fido looking for those people
8 ;;; Fido can't be made to look for someone if the alarmclock is already
9 ;;; in use, including if it is already being used by a different fido.
11 (DECLARE (*EXPR STRIPDOLLAR
)
12 (SPECIAL $FIDOLIST $FIDOTIME
))
14 (COND ((NOT (BOUNDP '$FIDOLIST
))
15 (SETQ $FIDOLIST
(NCONS '(MLIST SIMP
)))))
17 (COND ((NOT (BOUNDP '$FIDOTIME
))
18 (SETQ $FIDOTIME
30.
)))
20 (DEFUN $FIDO FEXPR
(X)
21 (COND ((NULL X
) $FIDOLIST
)
24 (SETQ $FIDOLIST
(CONS '(MLIST SIMP
) NIL
)))
26 (ERROR '|This MACSYMA
's Alarm clock already in use.|
))
28 (SETQ ALARMCLOCK
'FIDO-INTERRUPT
)
29 (ALARMCLOCK 'TIME $FIDOTIME
)
30 (SETQ $FIDOLIST
(CONS '(MLIST SIMP
) X
)))))
32 (DEFUN FIDO-INTERRUPT
(())
33 (DO ((L (CDR $FIDOLIST
) (CDR L
))
39 (PRINC '|;From FIDO
: Here | TYO
)
40 (COND ((= (LENGTH HERE
) 1.
)
42 (PRINC (CAR HERE
) TYO
))
45 (PRINC (CAR HERE
) TYO
)
53 (COND ((CDR $FIDOLIST
) (ALARMCLOCK 'TIME $FIDOTIME
))
54 (T (SETQ ALARMCLOCK NIL
))))
56 (ALARMCLOCK 'TIME $FIDOTIME
))))
57 (COND ((PROBEF `((USR) ,(SETQ TEMP
(STRIPDOLLAR (CAR L
))) HACTRN
))
59 (DELETE (CAR L
) $FIDOLIST
)))))