[Ecls-list] ecldev.info hello.lsp example

T. Kurt Bond tkb at tkb.mpl.com
Fri Aug 6 10:47:03 UTC 2004


T. Kurt Bond writes:
> Ok, now about problem with the hello.lsp example from ecldev.info.
> Here's  hello.lsp:
>     (princ "Hello world!")
>     (terpri)
>     (quit)
> I tried to compile it following the directiosn in ecldev.info, and it
> failed during the C compilation, complaining about compitler_data_text
> and compilter_data_text size being undeclared. 

(The files hello.h, hello.data, and hello.c discussed below are all
generated by ecl when hello.lsp is compiled.)

The function data-dump in src/cmp/cmpwt.lsp only wrote out the
definition of compiler_data_text to hello.data if the value returned
by data-size was non-zero, but compiler_data_text was *always* used.
I changed data-dump to write out a definition even if data-size
returned zero.

Then I found that that the function ctop-write in src/cmp/cmptop.lsp
does a "#define VV NULL" when data-size returns zero, but there is
an assigment to VV in the hello.c file, so compilation still fails.
So I changed ctop-write to always define VV as a variable.

Once I'd made those two changes I was able to compile hello.lsp
properly and use c:build-program to build a standalone program from
it.

I'm sure this problem never shows with real programs because they
always have something that gets written to compiler_data_text, but
it's very frustrating to a new user when the "hello, world" program
used as an example in the manual doesn't compile.

Here's a patch.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ecls-mod.patch
Type: application/octet-stream
Size: 2071 bytes
Desc: Fix problems compiling standalone hello.lsp
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20040806/19217c98/attachment.obj>
-------------- next part --------------

-- 
T. Kurt Bond, tkb at tkb.mpl.com


More information about the ecl-devel mailing list