On Tue, Oct 29, 2013 at 3:06 AM, Matthew Mondor <mm_li...@pulsar-zone.net>wrote:
> First a question relative to LOOP/LET and FIXNUM:
Actually nothing to do with LOOP. Replace LET -> LET* and you will see
better optimizations. The problem is that LET misses some declarations that
LET* has. Take
(LET ((A (FOO))) (DECLARE (FIXNUM A)) ...)
Internally, ECL converts this into
(LET* ((X (FOO)) (A X)) (DECLARE (FIXNUM A)) ...)
Now, since "A" is read only, it is replaced by the value X, which was not
declared to be a FIXNUM. One could fix the transformer for LET to add a
declaration on the temporary variables or, more simply, add (THE FIXNUM
...) around the value.
> This next question has to do with structure accessors:
>
> As can be seen above, a function dispatch is done to access the slots in
> read mode. But interestingly, for SETF, a more inline result is
> obtained assigning directly on the slot:[...]
> I realize that with CLOS this would be more complex, but this is a
> simple struct, with the consequences voluntarily undefined if it's
> redefined without recompiling its dependent code. Could it be that
> SETF can infer better than LET in this case? Or is there another
> reason why inline read slot access should not be done here, but that
> it's safer for SETF?
Not really. Both should be equivalent for structures but the difference is
that SETF has an analyzer for that, but ordinary function calls do not
check whether the function names a slot accessor -- the code is there, but
it is deactivated because it cannot be used with CLOS.
------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Ecls-list mailing list
Ecls-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list