[436] in Coldmud discussion meeting

root meeting help first first in chain previous in chain previous next next in chain last in chain last

code formatting in-db

daemon@ATHENA.MIT.EDU (Thu Sep 22 19:14:02 1994 )

From: deforest@netcom.com (Robert de Forest)
To: coldstuff@netcom.com
Date: Thu, 22 Sep 1994 11:05:11 -0700 (PDT)

I mentioned doing code formatting in-db in a very long post, but didn't
 demonstrate how this coudl be done, assumng reares were fairly resourceful.

:)

It is a hack, but here is a sketch:

Create an object "$development_root" which overrides .compile and
 .list_method. In .compile it finds all the formatting that will be lost
 in actual compilation and stores it in the code as comments. .list_method
 reverses the process.

A pre-compiled piece of code might look like

@program me.example
 arg x, y, z;
 
 // FORMATTED: info starts at 5
 .tell(x, y, z);
 // FMT_INFO: line_break, line 4, col 10
 // FMT_INFO: indent, line 5, spaces 6
 ...
 // END_FMT
.

So it could be done :P

I am for in-server formatting, but I don't think it's a step towards a server
 with a lot of cruft.

Someone mentioned treating <CR> as whitespace. THis would be ok, but would be
 lost at compile time.

One other idea is to provide a function to list methods in a more raw form to
 allow the db to do whatever it wants with it. I suppose you'd need a compile
 that worked the other way too. This change is along the same lines as the
 traceback() change in 0.11.

Crag / Robert de Forest