Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CL-USER> (DEFUN do-four NIL (DO ((temp-one 1 (1+ temp-one) )(temp-two 0 (1- temp-two) ) )((> (- temp-one temp-two) 5) temp-one)() ) )
- ```
- ```prolog
- :- lisp_compiled_eval(
- [ defun,
- u_do_four,
- [],
- [ do,
- [ [u_temp_one, 1, ['1+', u_temp_one]],
- [u_temp_two, 0, ['1-', u_temp_two]]
- ],
- [[>, [-, u_temp_one, u_temp_two], 5], u_temp_one],
- []
- ]
- ]).
- ## COMPILER
- :- side_effect(generate_function_or_macro_name([name='GLOBAL', environ=env_1],
- u_do_four,
- kw_function,
- f_u_do_four)).
- % 1,576,189 inferences, 0.399 CPU in 0.422 seconds (95% CPU, 3950916 Lips)
- lambda_def(defun, u_do_four, f_u_do_four, [], [[do, [[u_temp_one, 1, ['1+', u_temp_one]], [u_temp_two, 0, ['1-', u_temp_two]]], [[>, [-, u_temp_one, u_temp_two], 5], u_temp_one], []]]).
- arglist_info(u_do_four, f_u_do_four, [], arginfo{all:0, allow_other_keys:0, aux:0, body:0, complex:0, env:0, key:0, names:[], opt:0, req:0, rest:0, sublists:0, whole:0}).
- init_args(x, f_u_do_four).
- ```
- ### Compiled Function: `U::DO-FOUR`
- ```prolog
- f_u_do_four(FnResult) :-
- CDR=[],
- catch(( ( BlockExitEnv=[bv(u_temp_one, 1), bv(u_temp_two, 0)|CDR],
- catch(( call_addr_block(BlockExitEnv,
- (push_label(do_label_1), get_var(BlockExitEnv, u_temp_one, Temp_one_Get26), get_var(BlockExitEnv, u_temp_two, Temp_two_Get27), 'f_-'(Temp_one_Get26, Temp_two_Get27, PredArg1Result29), (PredArg1Result29>5->get_var(BlockExitEnv, u_temp_one, RetResult30), throw(block_exit([], RetResult30)), _TBResult=ThrowResult31;get_var(BlockExitEnv, u_temp_one, Temp_one_Get34), 'f_1+'(Temp_one_Get34, Temp_one), get_var(BlockExitEnv, u_temp_two, Temp_two_Get35), 'f_1-'(Temp_two_Get35, Temp_two), set_var(BlockExitEnv, u_temp_one, Temp_one), set_var(BlockExitEnv, u_temp_two, Temp_two), goto(do_label_1, BlockExitEnv), _TBResult=_GORES36)),
- [ addr(addr_tagbody_1_do_label_1,
- do_label_1,
- '$unused',
- BlockExitEnv,
- (get_var(BlockExitEnv, u_temp_one, Get_var_Ret), get_var(BlockExitEnv, u_temp_two, Get_var_Ret46), 'f_-'(Get_var_Ret, Get_var_Ret46, _1724), (_1724>5->get_var(BlockExitEnv, u_temp_one, Temp_one_Get16), throw(block_exit([], Temp_one_Get16)), _1740=ThrowResult;get_var(BlockExitEnv, u_temp_one, Temp_one_Get18), 'f_1+'(Temp_one_Get18, Set_var_Ret), get_var(BlockExitEnv, u_temp_two, Temp_two_Get19), 'f_1-'(Temp_two_Get19, Set_var_Ret48), set_var(BlockExitEnv, u_temp_one, Set_var_Ret), set_var(BlockExitEnv, u_temp_two, Set_var_Ret48), goto(do_label_1, BlockExitEnv), _1740=_GORES)))
- ]),
- []=LetResult
- ),
- block_exit([], LetResult),
- true)
- ),
- LetResult=FnResult
- ),
- block_exit(u_do_four, FnResult),
- true).
- :- set_opv(u_do_four, symbol_function, f_u_do_four),
- DefunResult=u_do_four.
- ## EXEC
- % 399 inferences, 0.000 CPU in 0.000 seconds (99% CPU, 1376161 Lips)
- DO-FOUR
- ```
- ```cl
- CL-USER> (is = 4 (do-four) )
- ```
- ```prolog
- :- lisp_compiled_eval([sys_is, =, 4, [u_do_four]]).
- % ( kw_special
- % -> sf_sys_is
- % ).
- ## COMPILER% 167,406 inferences, 0.041 CPU in 0.041 seconds (100% CPU, 4120782 Lips)
- :- sf_sys_is(ReplEnv, =, 4, [u_do_four], Is_Ret).
- ## EXEClisp_format('$ARRAY'([*],claz_base_character,"OK: ~a is ~a to ~a~%"),[4,=,[u_do_four]])
- % 161,743 inferences, 0.053 CPU in 0.053 seconds (100% CPU, 3067592 Lips)
- T
- ```
- ```cl
- CL-USER>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement