[cmucl-imp] fdefns for flets
In the December snapshot (fdefinition '(flet lisp::frob wild-pathname-p)) returns a function. Is that a feature or a bug? Helmut
On 1/19/11 5:14 PM, Helmut Eller wrote:
In the December snapshot
(fdefinition '(flet lisp::frob wild-pathname-p))
returns a function. Is that a feature or a bug? I think that's a feature. Or least, I think that's how cmucl can trace flets and labels. Perhaps that shouldn't have been exposed to users?
Ray
* Raymond Toy [2011-01-20 02:04] writes:
On 1/19/11 5:14 PM, Helmut Eller wrote:
In the December snapshot
(fdefinition '(flet lisp::frob wild-pathname-p))
returns a function. Is that a feature or a bug? I think that's a feature. Or least, I think that's how cmucl can trace flets and labels. Perhaps that shouldn't have been exposed to users?
I think this is only generated by genesis. Or is there another way how such names can end up in globaldb? Helmut
On 1/20/11 2:22 AM, Helmut Eller wrote:
* Raymond Toy [2011-01-20 02:04] writes:
On 1/19/11 5:14 PM, Helmut Eller wrote:
In the December snapshot
(fdefinition '(flet lisp::frob wild-pathname-p))
returns a function. Is that a feature or a bug? I think that's a feature. Or least, I think that's how cmucl can trace flets and labels. Perhaps that shouldn't have been exposed to users? I think this is only generated by genesis. Or is there another way how such names can end up in globaldb? I'm sorry, I don't quite follow. What is only generated by genesis?
Ray
* Raymond Toy [2011-01-21 15:42] writes:
I think this is only generated by genesis. Or is there another way how such names can end up in globaldb? I'm sorry, I don't quite follow. What is only generated by genesis?
The fdefn objects for flet/labels. fdefn objects are needed for those functions that are called by name. As symbols in CMUCL have no function slot the place to store named functions are fdefn objects. The loader needs to find the fdefn object for a symbol so somebody has to put it in globaldb first. Usually that's done by %%defun but %%defun is not a options during genesis so the compiler additionally emits fop-fset. fop-fset is a nop after genesis. fop-fset is emitted in c::dump-one-entry and it's guarded by (when (and name (or (symbolp name) (listp name))) ... flet/labels don't need fdefns because those are always called with local-call. Those could probably be filtered out. For trace, we probably only need the global name; with that we can find the code component and then scan the functions in the component for a matching flet/labels name. Macros seem to have names like (:macro foo) and we probably need to keep them. Helmut
* Raymond Toy [2011-01-21 15:42] writes:
I think this is only generated by genesis. Or is there another way how such names can end up in globaldb? I'm sorry, I don't quite follow. What is only generated by genesis? The fdefn objects for flet/labels. fdefn objects are needed for those functions that are called by name. As symbols in CMUCL have no function slot the place to store named functions are fdefn objects.
The loader needs to find the fdefn object for a symbol so somebody has to put it in globaldb first. Usually that's done by %%defun but %%defun is not a options during genesis so the compiler additionally emits fop-fset. fop-fset is a nop after genesis.
fop-fset is emitted in c::dump-one-entry and it's guarded by
(when (and name (or (symbolp name) (listp name))) ...
flet/labels don't need fdefns because those are always called with local-call. Those could probably be filtered out. For trace, we probably only need the global name; with that we can find the code component and then scan the functions in the component for a matching flet/labels name. I changed the above code to skip over list names starting with flet/labels. No problem with that. But now tracing doesn't work. So
On 1/21/11 1:33 PM, Helmut Eller wrote: trace will have to grovel the code component to find the name. That would take some work to do; I'm not that familiar with the code component, and it's been a while since I've looked at that. Ray
participants (2)
-
Helmut Eller -
Raymond Toy