I've started reading the first volume of Christopher Alexander's
four-volume work The Nature Of
Order. It has apparently taken him twenty-seven years to
research and write, and it looks to contain some fairly heavy ideas. As
such, it'll be a challenge to make it right through to the other end of
book four, but I believe that there could be some profoundly significant
ideas in it that could have a great impact on what I could do with Ngake.
If he can deliver on his promise to provide "a theory in which statements about relative degree of harmony, or life, or wholeness - basic aspects of order - are understood as potentially true or false," and generally rescue architecture from its apparently dire state, then this should be very useful in designing information architectures that people will find effective and satisfying to work with. Or so I imagine.
Anyway, it occurred to me that if I kept notes in my weblog about my reactions to the books, things that I found particularly useful or startling or thought-provoking, and ideas about how I might be able to apply what I'm learning, then this might help me persevere right through the series where otherwise I'd run out of steam.
So we'll see how we go.
Also, I see that Luke Crook has written a HOWTO for the CCL FFI.
[Update: I've implemented my own version of the Lisp hooks, based on Kurt's paper.]
OK. On the 17th, we switch to a new Paradise.net plan, and our monthly
bandwidth quota goes from 500MB to 1536MB (or possibly 1536MiB). But
apparently there's no way to avoid getting stung for the extra 600MB or
so of ICMP traffic that the Welchia worm generated for us.
I'm moving synchromesh.co.nz and micro.co.nz to Free Parking, 'cause they're cheaper and they have online DIY DNS management.
Here are a few links I'll come back and check out next week (I've started reading BoingBoing again):
I did "splurge" on some NASA images to use as wallpaper on my laptop:
As the latest chunk of Tranz Rail work
nears completion, I am of course distracted by other things. Such as the
next phase of my AP5HID library.
The story so far:
I did a little dynamic programming to figure out an approximate solution to the positions of the LEDs. I have made a little VRML model of my results, and it definitely looks a lot like my P5 glove, which is good.
I checked the Essential Reality discussion fora, and it seems that ER have gone into survival mode, which is not entirely surprising I suppose, but it does imply that we won't be getting any driver updates for a while.
However, I did find a few quoted IRC comments attributed to Jason McMullan, author of the open-source Linux driver the C source of which I used to decode the USB datastream. Some choice quotes:
I'm working on a "best fit plane" technique to derive tilt from the IR data points.Interestingly, only 4 leds are returned by the device at a time. The other leds are interpolated.Everytime you poll the P5 device for info, the mouse device sends a mouse position packet. ... Actually, that the *only* time it sends mouse data.Interestingly, if you poll the P5 "too fast", it resets the device."[I] draw the current IR positions, and the ***puted [sic] surface normal of the hand (which is, currently, often wrong).
So, I plugged best fit plane into Google and found this, which smells like the right direction to me. Verily, the mighty Google has been a tremendous boon to the solo R&D-er.
Last night at about 2015, my sister Kate gave birth to a healthy 8 pound
baby girl. Mother and daughter are doing well, much to everyone's
relief. Chris is looking pretty cheerful about it all, too. ;)
No name has been decided on as yet.
Perhaps now we can get back to work...
[Update: It has been confirmed, the name is to be "Holly."]
While composing an email to Mark
Billinghurst about his GloveGRASP
work, I followed a few more links and found some other potentially
useful stuff:
Via a Joel Spolsky article,
we have ESR's book The Art of Unix
Programming. Looks like it could actually be worth a read. If only
for other interesting links
to be found within.
And now I've just ordered Christopher Alexander's magnum opus. I'm pretty sure it'll be worth the money. Not that I've actually yet tackled the last such book I bought.
(fboundp 'syn::test-fn1) => T
I guess it's time to stick the project(s) into source control...
Well, you might've thought that five weeks holiday would've been
enough, but despite (or perhaps because) of that, I've needed most of
the last three weeks as well before I've felt sufficiently
"reinvigorated" to want to do much work.
However, I'm now feeling much better. Not that I was feeling really down, but I was having some difficulty feeling positive about things for a while there. And then plink, suddenly I'm rearing to go...
I did resolve not to feel guilty about it, which helped. Plus I'm getting into the meditation a bit more, and I'm hoping that will help me cultivate my equanimity in future.
'You think I'm experiencing a mood swing, Slick?''Yeah.''I'm enjoying a mood swing.'
Shit, have I really been working for myself for almost four years? Fortunately I now find it fairly easy not to freak myself out about this fact, but I admit I dread having to describe to anyone exactly what I've been doing all this time.
But still, I am (fairly) happy with where I am now and how I'm doing. Obviously I would like to be further forward than I am, but then I was even more willfully naïve about the problems I had to tackle when I started than I thought at the time.
So I'm still short on the "actual working software" front, but I'm pleased with my design, I've learnt a lot, I'm working better now than I ever have, and in the meantime the IT world is slowly moving towards the point where something like the Ngake VR IDE application in all its glory could actually have something like a receptive market waiting for it. So there.
Which isn't to say that a bit of a break working with some other talented, motivated people on some suitably interesting project for a decent lump of cash wouldn't be worth a go for a while. Stay tuned...
I saw the Matrix
Revolutions movie last week. I liked it, I thought they did a great
job tying it all up. I'm now really looking forward to the Directors'
Cut Special Extended Edition Deluxe Boxed Set...
In a few years, this stuff will become mainstream. This will validate, I believe, the ideas I had when I started Synchromesh (my ideas about manipulating higher-level models of code, if not my ideas about the effectiveness of VR interfaces). If I could just make a bit more progress with the actual software, that would be good.
The magazine looks to have some very interesting articles in it. I read one on personal fabrication by Neil Gershenfeld that I thought was very insightful.
At some point Ngake is supposed to be able to fully parse idiomatic C
and C++. This is going to be tricky. I've found some good information
and a lot of useful links here. This page
has a link to the Ph.D. thesis of one Edward Willink, entitled Meta-Compilation for C++, which looks like it could be well worth
reading. All 412 pages of it...
I've also found some documentation for the Edison Design Group's C++ Front End that I'll be checking out.
Of course, I'm hoping that integration with Visual Studio will provide an effective alternative/complementary approach.
I think the #lisp channel on IRC is pretty cool. I'm trying not
to act too much like a newbie. Today I shared a moment of Australasian
humour with a guy called Luke, and when this happened
<dan-b> nice Road To Lisp, synchromeshI must admit I experienced a small thrill. Great, I'm a Lisp fanboy... Context: Dan Barlow is one of the principal maintainers of Steel Bank Common Lisp (SBCL), and the author of CLiki (the Common Lisp Wiki), amongst other groovy free Lisp stuff.
* dan-b catches up on essential reading
<synchromesh> Cheers, I'd forgotten about that.
The Road to Lisp is a "newby-by-newby informal survey" on CLiki where people can post a description of how they came to be using Lisp. I wrote one myself. It has made a (the?) Top Ten. Cool! ;) [Update: the RtLS has been moved to the ALU Wiki, and my entry is here.]
And the filk? Well, someone posted a link to this song, being the recording of these lyrics. Like it says at the top, no warranty expressed or implied...
I've tidied up this blog, mainly as a procrastination exercise. Note the
"archives" at the top, and the use of CSS to make it look exactly like
it did before. A pleasant distraction, until I had to break out my
mouldy Camel book, which was a sign that it was time to get back to some
real work. After lunch...
I also found some groovy PDF quick reference cards here: CSS1, bash, vim etc.
An interesting story in the Guardian about Cybersyn.
I found this story quite impressive, since it took place around the time
I was born. It just goes to show what you can achieve with the right mix
of brilliance, revolutionary fervour and centralised authority. And the
Americans are the bad guys! Also, it arguably makes today's IT
"innovations" aimed at allowing people to work together and be more
productive by sharing information blah blah seem rather tired and
unambitious, I think, given that we're supposed to have made all this
"progress" in the intervening thirty years. Or not. Whatever. Anyway, a
sense of perspective is important.
Another good story in the New York Times magazine concerning affective forecasting, or how we determine how happy (or not) we think outcomes wil make us. Apparently we're not very good at it.
I've also (re-)discovered IRC, specifically the #lisp channel. I'm using mIRC, which looks like it might be worth USD20. #lisp is looking quite interesting so far; already I've found a few pointers (some fairly oblique) to useful stuff, like Building Applications Using DUIM, which describes the Dylan successor to CLIM (although this wasn't the DUIM vs. CLIM comparison that was mentioned). It's interesting to see what Lispers chat about, too...
monad, mon'ad, n. the number one: a unit: an ultimate unit of being, material and psychical: a spirit: God: a hypothetical primitive living organism or unit of organic life: a flagellate of the genus Monas or akin to it: a univalent element, atom or radical.-Also adj.-adjs. monad'ic, -al; monad'iform, like a monad.-ns. mon'adism, monadol'ogy, a theory or doctrine of monads, esp. Leibniz's; mon'as, a monad: Monas, a genus of flagellates. [Gr. monas, -ados, a unit-monos, alone.]
sys directory and produces massively crosslinked, properly
indented, colourised HTML files. Features would ideally include:
Well, I've found the XP pretty-printer that comes with Corman Lisp, and I'm printing the original MIT AI Lab technical report that seems to be the documentation.
If you introduce reality into a virtual world, it's no longer a virtual world: it's just an adjunct to the real world. It ceases to be a place, and reverts to being a medium. Immersion is enhanced by closeness to reality, but thwarted by isomorphism with it: the act of will required to suspend disbelief is what sustains a player's drive to be, but it disappears when there is no disbelief required.
Richard A. Bartle, Not Yet, you Fools!
maverik_wrapper.dll library to hide
all references to structures passed by value in
libmaverik.dll (i.e. function parameters as well as
return values).relax.lisp and finally figure out
where the P5 IR LEDs are. This will also be my first "non-trivial"
CCL & Maverik program.ap5hid.lib P5 glove interface library.DEFUN-DLL forms at run-time to link to foreign functions.
With Ngake everything will either be statically linked or at least
linked to a known set of functions in a DLL. Once again, delving below
the hood of the CCL FFI would allow me to customise a useful
solution.And we leave for the UK in six weeks...
I've finally released all the programs (and even some
documentation!) to South Park, so that they can start their
acceptance testing in earnest. Huzzah!
Now I'm free to do, ooh, all sorts of stuff:
At least I've got rid of the millstone that was the old ThinkPad 760 I foolishly bought; I hope David actually gets some useful benefit from it while he's overseas...
Complexity is a perceived quality that comes from the difficulty in understanding or describing many layers of inter-related parts. An Organic Information Visualization provides a means for viewers to engage in an active deconstruction of a data set. The complexity is pulled apart through a combination of real-time user interaction as well as control of the data set through modification of the rules used for representation.From the introduction to his Masters thesis, Organic Information Design.
Oops, I've just bought LoudBomb and LiveDog98. Kids, don't drink & surf.
I also downloaded (somewhat accidentally) the new P5 Windows SDK, all forty-odd megabytes of it. This unpacked to over eighty megabytes, about seven of which was useful, the rest being build byproducts and gratuitous auxiliary "media" files for the sample applications. So I posted a message complaining about the bloated SDK.
I'm looking forward to finishing up the South Park work, so that I can get back to this for a few days and make a bit more progress.
There's a review
of a WAP version of Elite. Wow, major
flashbacks to all the hours I spent playing this game on my humble Acorn
Electron. I love the quote at the end of the review: "converting one
out of date technology to another." ;)
But that's not the interesting part. He talks a bit about Game elements in non-game applications and using ambient music in an interface, which I'd been thinking about myself (no, really). [Update: I found another good post by one Larry O'Brien, talking about how increases in hardware performance haven't impacted programmer productivity.]
One thing's for sure, editing in XEmacs, saving, and re-evaluating
(load "...") in the CCL IDE is definitely the wrong thing.
David mentions in his README that SBCL needs a port of Eric Marsden's XREF cross-referencing facility. A quick Google finds Eric mentioning that he's apparently working on improvements to XREF in CMUCL. So if/when a port to CCL is attempted, it would be good to start with his latest code. I wonder what compiler hooks are needed?
[Update: I think I've found the most recent version of xref.lisp, dated 12 June.]
[Update: Neil van Dyke mentions in his July 3rd weblog entry that he's thinking of using the Franz ELI/LEP protocol for his Quack project. He's packaged the Franz files up here.]
Obviously you can't edit program source code without editing text. But I don't want to make a text editor embedded in a VR scene.
So that means that one of the "user manipulation modes" has to be something that feels like using a text editor, except it isn't just text you're editing; you can manipulate any small, inline, non-text widgets that happen to be in there as well. This means layout managers, focus & selection handlers etc. that together provide an editor-like idiom.
Reading about CLIM, Genera, and Lisp Machines, it becomes apparent that this sort of thing has been done before, in the "desktop" world:
One of the most common ways to get a foothold in Genera for debugging something is to (1) find a place where the thing you want to use appears visually, (2) click Super-Left to get the object into your hands for read-eval-print, inspection, etc, (3) use (ed (type-of *)) to find its source reliably and with no foreknowledge of what the type is, who wrote the program, what their file conventions were, who loaded it, or any of myriad other things that other systems make me do.Kent M. Pitman, comp.lang.lisp 1999
Links:
What's the central philosophy behind the evolution of computing in general and Genera in particular?Free programmers from thinking about unnecessary details and they can accomplish more. The more abstractly they are allowed to think, the bigger and harder the problems they can solve.
Genera Concepts manual
Also, via CLiki, this discussion of user interface management systems in general and CLIM in particular.
And, the Symbolics Lisp Machine Museum. Argh, I must get back to work...
The fundamental question we should attempt to answer is how do we make representations of knowledge -- such as blogs, wikis, The Brain, knowledge management systems, libraries, encyclopedias, etc. -- provide three competing services: a graceful way for new readers to learn the content; a way for experienced users to find new information; and a way to encourage growth not just at the edges (temporal or otherwise), but organically throughout the system.
OK, perhaps that isn't that earth-shattering an observation, but generally he's pretty good.
Just goes to show that these things take time... It was interesting reading the comments on the interview; the same "Lisp has been doing this for decades," vs. "'average', 'working' programmers don't want/need these sophisticated tools/languages" ideas that I've seen quite often elsewhere.
I'm persevering on the basis of this theory:
Starting with the USB headers from the Microsoft DDK and the USB input record format described in Jason McMullan's P5 Linux library, I've developed it to the point where I can decode the sensor positions and bend data.
I'm now working on figuring out the 3D coordinates of the sensors, given the distances between them all (measured to 0.1mm resolution with a pair of digital calipers). This is proving a useful exercise in both fundamental coordinate geometry and expositive Lisp programming.
Scancode Map in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard
Layout with the following data:
0000 0000 0000 0000 0300 0000 1D00
3A00 3A00 1D00 0000 0000
It bloody works, though. Just like Linux...
[Updated 3/12/03: Damn, looks like I copied that byte sequence incorrectly. It should be correct now.]
Another good pointer
from Chis Double, this
time to a post
describing why continuations were removed from REBOL. The interesting part was a
comparison of finite state machines versus stack machines for language
interpreters. Not sure how/if this relates to Ngake, since although it
is based on state machines, it isn't a language interpreter.
Also: Real Programmers Do Not Use Parser Generators, Why Bison is Becoming Extinct, and Real Programmers Don't Write Specs ("Strong typing is for people with weak memories"). Finally, a good article on abstractions.
Aside: I think I want Enter the Matrix (the computer game) for my birthday.

This is quite cool. Bevan and I got a
chuckle out of this when we saw Trinity and the other "good guys" using
the "right tools for the job." Nmap is "an open
source utility for network exploration or security auditing... Nmap uses
raw IP packets in novel ways to determine what hosts are available on
the network, what services (ports) they are offering, what operating
system (and OS version) they are running, what type of packet
filters/firewalls are in use, and dozens of other characteristics."
[Update: It has been pointed out that using a 10.0.0.0 IP address was a missed opportunity for another tie-in, though.]
There's a good review of The Matrix Reloaded in Salon. I've stashed a local copy here, although you can read theirs for free (if you sit through an ad). [Update: the NY Times review is here.]
Only a day and a half until the Matrix
Reloaded premiere... We saw The Animatrix on the weekend.
That Second Renaissance Part
2 was pretty grim, but I liked them all. Roll on the DVD release
in June.
Also, there's an interview with the guys who did the video for the Queens Of The Stone Age song Go With The Flow. (Nothing to do with The Matrix, obviously.)
I think there's almost enough groundswell to
start a petition that "the essays are all very
good, but we want Paul Graham to ship Arc."
Or perhaps I'm exaggerating. ;) Oh well. I found this MP3 webcast by the man himself, which I shall listen to later. And now, back to writing my weekly report.
Now that I've settled on Lisp (again), I can continue doing the exercises from his book.
I've taken the clconsole.cpp
code that comes with Corman Common Lisp and edited it into
ngake-0.cpp and some support files. It seems to work well.
Now I'm ready to bolt on the Maverik half, hook up the electrodes, raise
the copper weathervane through the skylight into the dark and stormy sky
and wait for the lightning to strike.
The question is, what interface should I provide to the CCL server? (I think I'll just call it the "Lisp engine", or possibly just "CCL".) I don't want to just "cheat" and provide, say, a socket connection to another console process.
Well, what's it for? Ngake contains code written in C, C++ and Lisp. So the Lisp engine is there to execute the Lisp code. Another purpose is to allow the system to be developed at least partially while it is running. That is, the user (as a Ngake developer) can load, examine, modify and save the Lisp source code, and the Lisp engine can recompile it into the running system. Additionally, the Lisp engine accepts "commands" from the user, i.e. it allows the user to invoke the Ngake Lisp functions directly. This is a complementary interface to the "virtual reality user interface" (VRUI). So, in summary, the purpose of the Lisp engine is:
The point is, if I want Ngake to be "self-hosting" as soon as possible, then I have to provide the "load, examine, modify, save" capabilities mentioned above. Eventually, this will be provided by the first Ngake application, that is, the first application of the Ngake framework will be to build a "VR IDE" sufficient to fully describe and maintain both Ngake and the application itself. In the meantime, I have a small problem of bootstrapping.
The key idea is self-reference.
I'm still
conflicted about the whole Lisp-or-Scheme, Windows-and/or-Linux thing
(much to my sister's amusement).
You have to have a Windows version, obviously. But I'm convinced that although the quality of their software is in general very high, Microsoft, not to put too fine a point on it, are the Borg (no offence, Jon ;)). I'm not saying they're actually evil, but let's just say that it's very important to me that my software runs on at least one non-Windows platform. At this point in time, Linux is the best choice there.
I'm also convinced that Lisp or Scheme (plus some C/C++ glue) is the way to go as far as development languages are concerned. I don't have enough experience in writing this kind of software to design a solution in enough detail to be able to implement it entirely in C/C++/Java/etc. without getting bogged down. I'm learning what I need as I go (which is fine), and Lisp's "extend the language in the direction of the solution" approach, coupled with the killer combo of garbage collection, the read-evaluate-print loop (REPL), macros, and a fully-integrated compiler, allows me to explore my way forwards without sacrificing any of the performance benefits of lower-level languages. It really looks like being the secret weapon I need to successfully realise my vision.
There are other requirements that point to Lisp as the Right Thing. First, the success of Ngake depends on the success of its 3D VR user interface. I anticipate an incredible amount of tweaking and fiddling with the UI code, often while another "guinea pig" user is sitting (im)patiently next to me, repeating some usability test for the nth time. So I need the REPL of some embedded language in there somewhere so that I can tune it on the fly.
Second, the hierarchical state machines that drive the system have to operate at interactive frame rates, so performance is important. Having to keep rewriting bits of event handler code in C++ because Python (or whichever interpreted embedded language I'm using) isn't fast enough would defeat the purpose I've just described. Lisp is the only language I've seen (except perhaps GOO) that allows you to compile (and recompile) code you've entered/modified interactively.
So ideally I'd like a Lisp implementation that lets me develop on Windows and Linux. (Due to a limited apparent choice, I started looking at Schemes as well.) My other requirements are:
chicken and gcc on your Scheme file and
dynamically load the resulting object code into your application
process, but only once. You can't then tweak the Scheme, recompile and
reload.In short, Corman Common Lisp meets all my requirements except that it doesn't have a Linux version. This isn't surprising; its level of support for e.g. native threads is, shall we say, incompatible with Linux, where native threads aren't even particularly native. Also, its excellent FFI speaks of a focused, pragmatic approach to working with foreign code in order to produce better applications; the Linux Lisp systems that I looked at (CMUCL and SBCL) didn't feel like that.
So I guess I should relax about the Linux version, let go of my Bill Gates phobia for a while and focus on getting the bloody code written using the best tool(s) available.
Here's my current scorecard for building CHICKEN Scheme on
Windows and Linux:
The Cygwin build fails with undefined
reference to `_WinMain@16' in cygchicken-0.dll, for
which the FAQ says "try adding an
empty main(), or perhaps you have `-lm' too
early in the command line." There's no -lm at all: the full
transcript is:
gcc -Wl,--base-file,.libs/cygchicken-0.dll-base -Wl,-e,__cygwin_dll_entry@12 -o \
.libs/cygchicken-0.dll libchicken_la-runtime.lo libchicken_la-library.lo libchicken_la-eval.lo \
libchicken_la-syntax-case.lo libchicken_la-profiler.lo libchicken_la-scheduler.lo
/usr/lib/gcc-lib/i686-pc-cygwin/3.2/../../../libcygwin.a(libcmain.o)(.text+0x7c): undefined reference to `_WinMain@16'
collect2: ld returned 1 exit status
make[1]: *** [libchicken.la] Error 1
The CVS sources (updated this morning, after Felix's
email) build on Linux, but when I try to run csi I get
Error: (string-append) bad argument type
- not a string: quote. Yesterday's error was... nope, it's
scrolled off the top of my xterm, but it was something
about `##sys#error-hook' is not defined
- execution terminated.
Still, I have working versions on Linux and Windows, so I'm OK for the moment. It would just be nice to be able to update & build from CVS, rather than having to keep downloading snapshots. Although admittedly that does make it easier to build on both platforms.
[Update: The CVS build problem has been fixed.]
I've also managed to get Jeff's (1998 vintage) Libretto working, after buying a replacement system board on eBay. It needs a new CMOS battery, and the floppy drive is poked, but hey, it works. It even has the full 32MB of RAM now. It's only a Pentium 120 MMX; you can overclock them to a mighty 166MHz, but it's like, what's the point? ;) Note the wireless Ethernet card in the photo below.
After reading this interview with some of the FreeBSD core developers, I thought I'd stick it on the Libretto (christened "bit"). I've ordered a FreeBSD 4.8 DVD from Aussie, since there are currently no decent local mirrors. Paradise has 4.7, and you can download the 4.8 mini-ISO, but that's about it, although the NZ FreeBSD Users Group are working on a full mirror, apparently. This way I might get some stickers (like I did with the OpenBSD 2.6 CD). Installing it with no floppy will be a bit of a challenge, but if I do it via the old ThinkPad it should work.
It now has two useful purposes:
If you look closely in the corner of the photo above, you'll see my tickets to the Matrix Reloaded midnight premiere in two weeks time. These are the upholstered seats, with the 'La-Z-Boy' footrest and the little table for your beer. The bastards at Warner Brothers/Roadshow may have denied us our rightful place as the first in the world to see this film (note it says "Fri 16" and not "Thu 15"), but at least the cinema is showing it at the earliest possible opportunity. I can't wait...
And on Karlin Lillington's blog I saw a link to a 1967 CBC broadcast of a young, hippie Bill Gibson. Very cool. Apparently he's going to stop blogging, 'cause it interferes with his novel-gestation processes. Bummer, but fair enough, I suppose.
[Update: the man himself comments on the footage here.]
golem. When I run the equivalent of the following code:
(load-foreign "/home/john/src/maverik-6.2/lib/libmaverik.so")
(define-alien-routine ("mav_initialiseNoArgs" initialise-no-args) void)
(initialise-no-args)
in each, I get the Maverik "splash screen" in CMUCL, but in SBCL I get:
GNU Maverik v6.2 - Copyright (C) 1999-2002 Advanced Interfaces Group
XIO: fatal IO error 0 (Success) on X server ":0.0"
after 7 requests (6 known processed) with 0 events remaining.
which is bad. Well, the last two lines are. Actually, I see the above
when running via the PuTTY ssh client; if I run it locally, it says:
GNU Maverik v6.2 - Copyright (C) 1999-2002 Advanced Interfaces Group
XIO: fatal IO error 0 (Success) on X server ":0.0"
after 0 requests (0 known processed) with 0 events remaining.
FLET and LABELS,
MACROLET allows you to define local macros, that is, macros
that are defined in the lexical environment in which the
macrolet form appears. The format is the same as
DEFMACRO. The definition can include declarations, but
these do not include the bodies of the expander functions in their
scope.
Also, the "consequences are undefined if the local macro definitions reference any variable or function bindings that are visible in [the] lexical environment."
However, the following test code produced the same output on CCL, SBCL, CMUCL, Allegro CL and CLISP:
(defun macrolet-foo (x y)
(macrolet ((m (x) `(format t "1: ~A 2: ~A~%" ,x x)))
(m y)))
* (macrolet-foo "one" "two")
1: two 2: one
NIL
eg5.lisp working, modulo the keyboard handling. The
callbacks work, though. I don't need that "defun-callback" stuff in
parse-c-decls.lisp, so I'll rip it out.
I've thought of adding a CamelCase-to-dashed name mangler to the header parser, but (a) it would probably increase the number of name collisions, and (b) I think the mixed style helps the 'foreign' code stand out. The whole point is to build abstractions on top of this in Lisp, and thus hide the nasty C-isms.
I guess the keyboard handling is broken because the
clconsole.exe and the Maverik window are competing for the
keystrokes. Some slightly more cunning way of embedding the Lisp in the
Maverik application is required.
But my next trick will be to get the equivalent of
eg5.lisp running in Allegro CL and/or CHICKEN Scheme
(and/or MzScheme, since both Schemes have SWIG back-ends).
I am now officially ahead of where I was in December.
eg4.lisp to work under CCL 2.01, and I had to set
far too many breakpoints in disassembled code on the way.
In the end, breaking up my monolithic chunk of premasticated C
headers into about five (polylithic?) bits before feeding them to
parse-c-decls.lisp seemed to make the difference, echoing a
recent thread on the mailing list. In other words, I don't know exactly
what was causing the problem. ;) Of course, all this code
worked fine under version 1.5.
I've modified my parse-c-decls.lisp
to stick "+" characters around constants parsed from
#defines, to avoid any potential name collisions. (Is "+"
the standard idiom? Or should I be using "*"?)
Now I can try to get eg5.lisp working, that being the
one with the callbacks from C to Lisp.
Damn, my schedule says I'm supposed to be writing SQL stored procedures today... Oh well, I'll continue this tomorrow.
To be precise, if I run up the console and say (load
"d:/src/.../eg1.lisp) (eg1), it immediately drops me back to the
command line. If I cons anything first, then I get the error dialog.
OK, there was a bug in eg1.lisp [inconceivable!] ;).
Hmmm, eg4.lisp seems to be failing when the Maverik code accesses memory I've allocated and initialised via Lisp. Let's see if we can't build & debug all this lot in Visual Studio .NET. First thing, set the zlib project run-time library to "multithreaded" to match CormanLispServer, so the thing will link.
THE
didn't ring any bells.
the lets you declare some or all of the type(s) of a (possibly
multiply-valued) expression. e.g.:
(the fixnum (+ 5 7)) => 12 (the integer (truncate 3.2 2)) => 1, 1.2 (the (values integer) (truncate 3.2 2)) => 1, 1.2 (the (values integer float) (truncate 3.2 2)) => 1, 1.2 (the (values integer float symbol) (truncate 3.2 2)) => 1, 1.2CCL 2.01 doesn't check the bracketed type forms. Apparently "[t]he consequences are undefined if any result is not of the declared type"; CCL will raise an error when a single type specifier symbol is given, e.g. for
(the symbol (+ 2 2)) but not for (the
(values symbol) (+ 2 2)).
I occasionally wonder how Roger is getting on, since he switched to being Corman Technologies full-time.
Python Paste