libera/#commonlisp - IRC Chatlog
Search
18:24:18
random-nick
pjb: VincentVega's project is apparently based on garnet+kr and something called multi-garnet
19:45:49
jackdaniel
atgreen: lately I'm generating code from xml specification and it turns out nicely thanks to a pretty printer
19:46:07
jackdaniel
atgreen: like this: turtleware.eu/static/paste/803e5a8aeeee09b91b7e2e4823cc18149f994861-xproto.lisp
19:53:32
atgreen
the problem I've just hit with the pretty printer is that package names are a problem... Right now I'm generating a string like "(myfun foo:bar)". I can't read that and print it because it's complaining about package "foo" missing
19:54:43
atgreen
my project is a java source code transpiler.. converting all of the jre source files to lisp
19:58:30
jackdaniel
suppose that you have an instance #<jre-file> that defines a package that has the symbol foo:bar
19:58:45
jackdaniel
in that case the first thing you will pretty print is the package definition (and in-package)
19:59:53
jackdaniel
it may not be seen in the example I gave, but the defpackage in there will have :export clause with all defined symbols
20:00:31
jackdaniel
so if something acesses clx.xcb-proto.xproto:rectangle, then both package and the symbol will be present
20:02:45
atgreen
very basic stuff is working... I just want to change how code is emitted so it is nicely formatted
20:03:32
jackdaniel
I'm not very experienced with pretty printer but I've found it very nice with tasks I'm doing (both with generating common lisp and c99 code)
20:18:12
jackdaniel
it is probably part of the symbol reader, but if you make #\: a macro that is not constitudent then you will read two symbols
20:22:43
jackdaniel
but why can't you define the package with appropriate exports? or put a double colon?
20:28:43
jackdaniel
you have a common lisp code (as text) that you want to print as a common lisp code?
20:29:37
jackdaniel
I thougth that you have some ast representation that you want to print as common lisp (like me :)
20:33:02
atgreen
I'm generating CL source code from an AST. I'm going to try this: https://github.com/yitzchak/cl-indentify
4:10:27
beach
atgreen: If you use Eclector to read your code, you can customize the symbol reader function.