Re: Symbol clashes: how to avoid them. Part 2
- From: budden <budden01@xxxxxxxxxx>
- Date: Fri, 31 Oct 2008 13:51:30 -0700 (PDT)
Again. No. I didn't just started. This is a list with some of my
_lisp_ projects which I made for 9 years.
1. Delphi VCL to CL mappings via SWIG and FFC. Not finished (failed to
translate windows.h). What was implemented: Delphi VCL events handled
by lisp, lisp exception handlers for Delphi exceptions, C++ pointers
to lisp values. Garbage collection support for C++ objects which are
registered to be owned by lisp. That is, delete is invoked on C++ side
when lisp delegate of that C++ object is about to become a garbage
(had fun)
2. Multi-threaded oven control. One thread reads from thermometer,
second does strategy and prints info, third controls heater, fourth
accepts user commands (had fun)
3. Wind power station modeling (tiny DSL). Parsing of meteo archives
and calculating misc stats upon all system including modeling of
current accumulator battery charge (had fun)
4. SQL metadata generation for reports (earned some money)
5. C++ code generation for making Qt/Firebird database application
(earned some money)
6. DSL for describing dictionaries of SQL tables with attributes used
in UI generator (earned some money)
7. Tiny library for generating other languages from lexical trees
(helped a neighbour to make a web site)
Currently I am working under rather simple task: replace TADODataset
to TexADODataset in a Delphi app (lexical analysys of .pas and .dfm
and accurate replacement of words, parsing "uses" statements and
replacing lists of units used. Would earn some money.
Is it enough or I should work 3 months more?
(BTW, I'm looking for a lisp job all the time, but unable to find one.
Feel free to contact).
(defun analyze-statistic (statistics &option (type 'total))
(let* ((statistic (slot-value statistics type) ;;
First of all, you don't need to make this a slot. OO engine is
mistified, but it is very simple in its basic principle. Just arrays
with a named slots. Well for lisp they are hashes. You may use just an
array - it is exactly the same in terms of performance. E.g., in
Delphi this would be like this (don't remember exact syntax of
pointers etc).
type PVariant = ^variant;
type slot_names = (unemployed, employed, total);
type statistics = record
lispy_slots : array[statistics_type] of variant;
function slot_value(slot_name:statistics);
end;
function
statistics.slot_value(obj:statistics;slot_name:statistics):Pvariant;
begin
result:=@(obj.lispy_slots[slot_name]);
end;
You asked me about notation, not about language. JavaScript solution
would be much simplier and more straightforward as javascript has
getAttribute function or something like this. Of course, there may be
a lispy language with infix notation.
function analyze_statistic (statistics, optional [ type = total ] ) {
var statistic = statistics.getAttribute(type);
var a = calculate-a(statistic);
var b = calculate-b(statistic);
} // it is almost a javaScript
Well, I admit that lisp is rather fast and very flexible. And, of
course, it outperforms python, perl, etc... As fast as Java, but much
more dynamic. But we're talking about notation, not about runtime/
compiler.
Now a new version of both A and B comes out. It so happens that A:FOO isremoved from A (or no longer exported), and at the same time,
a new symbol B:FOO appears in B, also naming a function.
No, I didn't overlook it. But this event is rather improbable. If so,
it is likely that A:FOO and B:FOO would differ in their arguments and
compiler would note that. If they are likely in argments and program
won't fail on (the ) checks, but would work incorrectly... well, this
is just not a lucky day... See what I wrote before about Delphi app
I'm currently working with. It would be a great pain to manage
windows.pas exports manually...
.
- Follow-Ups:
- Re: Symbol clashes: how to avoid them. Part 2
- From: budden
- Re: Symbol clashes: how to avoid them. Part 2
- From: Tamas K Papp
- Re: Symbol clashes: how to avoid them. Part 2
- References:
- Re: Symbol clashes: how to avoid them. Part 2
- From: Lars Rune Nøstdal
- Re: Symbol clashes: how to avoid them. Part 2
- From: budden
- Re: Symbol clashes: how to avoid them. Part 2
- From: Tamas K Papp
- Re: Symbol clashes: how to avoid them. Part 2
- Prev by Date: Re: Symbol clashes: how to avoid them. Part 2
- Next by Date: Re: OT: Ruby evangelists in c.l.l
- Previous by thread: Re: Symbol clashes: how to avoid them. Part 2
- Next by thread: Re: Symbol clashes: how to avoid them. Part 2
- Index(es):
Relevant Pages
|