25 |
#include "lisp.h" |
#include "lisp.h" |
26 |
#include "buffer.h" |
#include "buffer.h" |
27 |
|
|
|
/* Now in lisp code ("macrocode...") |
|
|
* DEFUN ("ml-defun", Fml_defun, Sml_defun, 0, UNEVALLED, 0, |
|
|
* "Define mocklisp functions") |
|
|
* (args) |
|
|
* Lisp_Object args; |
|
|
* { |
|
|
* Lisp_Object elt; |
|
|
* |
|
|
* while (!NILP (args)) |
|
|
* { |
|
|
* elt = Fcar (args); |
|
|
* Ffset (Fcar (elt), Fcons (Qmocklisp, Fcdr (elt))); |
|
|
* args = Fcdr (args); |
|
|
* } |
|
|
* return Qnil; |
|
|
* } |
|
|
*/ |
|
|
|
|
28 |
DEFUN ("ml-if", Fml_if, Sml_if, 0, UNEVALLED, 0, |
DEFUN ("ml-if", Fml_if, Sml_if, 0, UNEVALLED, 0, |
29 |
doc: /* Mocklisp version of `if'. |
doc: /* Mocklisp version of `if'. |
30 |
usage: (ml-if COND THEN ELSE...) */) |
usage: (ml-if COND THEN ELSE...) */) |
52 |
return val; |
return val; |
53 |
} |
} |
54 |
|
|
|
#if 0 /* Now converted to regular "while" by hairier conversion code. */ |
|
|
/**/DEFUN ("ml-while", Fml_while, Sml_while, 1, UNEVALLED, 0, "while for mocklisp programs") |
|
|
(args) |
|
|
Lisp_Object args; |
|
|
{ |
|
|
Lisp_Object test, body, tem; |
|
|
struct gcpro gcpro1, gcpro2; |
|
|
|
|
|
GCPRO2 (test, body); |
|
|
|
|
|
test = Fcar (args); |
|
|
body = Fcdr (args); |
|
|
while (tem = Feval (test), XINT (tem)) |
|
|
{ |
|
|
QUIT; |
|
|
Fprogn (body); |
|
|
} |
|
|
|
|
|
UNGCPRO; |
|
|
return Qnil; |
|
|
} |
|
|
#endif |
|
55 |
|
|
56 |
/* This is the main entry point to mocklisp execution. |
/* This is the main entry point to mocklisp execution. |
57 |
When eval sees a mocklisp function being called, it calls here |
When eval sees a mocklisp function being called, it calls here |
58 |
with the unevaluated argument list */ |
with the unevaluated argument list. */ |
59 |
|
|
60 |
Lisp_Object |
Lisp_Object |
61 |
ml_apply (function, args) |
ml_apply (function, args) |
141 |
return Qnil; |
return Qnil; |
142 |
} |
} |
143 |
|
|
|
#if 0 /* Now in mlsupport.el */ |
|
|
|
|
|
DEFUN ("ml-substr", Fml_substr, Sml_substr, 3, 3, 0, |
|
|
doc: /* Return a substring of STRING, starting at index FROM and of length LENGTH. |
|
|
If either FROM or LENGTH is negative, the length of STRING is added to it. */) |
|
|
(string, from, to) |
|
|
Lisp_Object string, from, to; |
|
|
{ |
|
|
CHECK_STRING (string); |
|
|
CHECK_NUMBER (from); |
|
|
CHECK_NUMBER (to); |
|
|
|
|
|
if (XINT (from) < 0) |
|
|
XSETINT (from, XINT (from) + XSTRING (string)->size); |
|
|
if (XINT (to) < 0) |
|
|
XSETINT (to, XINT (to) + XSTRING (string)->size); |
|
|
XSETINT (to, XINT (to) + XINT (from)); |
|
|
return Fsubstring (string, from, to); |
|
|
} |
|
|
#endif /* 0 */ |
|
144 |
DEFUN ("insert-string", Finsert_string, Sinsert_string, 0, MANY, 0, |
DEFUN ("insert-string", Finsert_string, Sinsert_string, 0, MANY, 0, |
145 |
doc: /* Mocklisp-compatibility insert function. |
doc: /* Mocklisp-compatibility insert function. |
146 |
Like the function `insert' except that any argument that is a number |
Like the function `insert' except that any argument that is a number |
178 |
Qmocklisp = intern ("mocklisp"); |
Qmocklisp = intern ("mocklisp"); |
179 |
staticpro (&Qmocklisp); |
staticpro (&Qmocklisp); |
180 |
|
|
|
/*defsubr (&Sml_defun);*/ |
|
181 |
defsubr (&Sml_if); |
defsubr (&Sml_if); |
|
/*defsubr (&Sml_while);*/ |
|
182 |
defsubr (&Sml_arg); |
defsubr (&Sml_arg); |
183 |
defsubr (&Sml_nargs); |
defsubr (&Sml_nargs); |
184 |
defsubr (&Sml_interactive); |
defsubr (&Sml_interactive); |
185 |
defsubr (&Sml_provide_prefix_argument); |
defsubr (&Sml_provide_prefix_argument); |
186 |
defsubr (&Sml_prefix_argument_loop); |
defsubr (&Sml_prefix_argument_loop); |
|
/*defsubr (&Sml_substr);*/ |
|
187 |
defsubr (&Sinsert_string); |
defsubr (&Sinsert_string); |
188 |
} |
} |