[Openmcl-devel] compute values in place
Taoufik Dachraoui
dachraoui.taoufik at gmail.com
Sun Sep 30 02:49:16 PDT 2012
I was thinking about getmemloc to return the real memory address and not
finding the conses in the expr
I am thinking about something like C pointers
Taoufik
On Sun, Sep 30, 2012 at 11:38 AM, Pascal J. Bourguignon <
pjb at informatimago.com> wrote:
> Taoufik Dachraoui <dachraoui.taoufik at gmail.com> writes:
>
> > is it possible to have something like this:
> >
> > (let ((a '(#1=expr #1#))
> > (setmemloc (getmemloc (car a)) (eval (car a))))
>
> So it's Sunday, brains are sleeping…
>
> What do you think
>
> > (let* ((form '#1=(+ 1 2))
> > (nv (eval form))
> > (sexp '(#1# 3 #1# #(4 #1# #(5 #1# 6) #1#))))
> > (values (mapcar (lambda (g.s) (funcall (cdr g.s) nv))
> > (find-all-places sexp form))
> > sexp))
>
> is?
>
> (defun getmemloc (sexp form)
> (find-all-places sexp form))
>
> (defun setmemloc (places new-value)
> (mapcar (lambda (g.s) (funcall (cdr g.s) new-value)) places))
>
> (let ((a '(#1=(+ 1 2) 3 #1# #(4 #1# #(5 #1# 6) #1#))))
> (setmemloc (getmemloc a (car a)) (eval (car a)))
> a)
> --> (3 3 3 #(4 3 #(5 3 6) 3))
>
> --
> __Pascal Bourguignon__ http://www.informatimago.com/
> A bad day in () is better than a good day in {}.
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20120930/4786d298/attachment.htm>
More information about the Openmcl-devel
mailing list