<br><br><div><span class="gmail_quote">On 30/11/2007, <b class="gmail_sendername">Denis</b> <<a href="mailto:firstname.lastname@example.org">email@example.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
><br>> Intermodule calls are the biggest problem, not to implement but to<br>> come up with a good syntax for it. In CL the symbol mod:func means<br>> the symbol func in the package mod, while in Scheme it is just a
<br>> normal symbol which you can tell the system it refers to the<br>> function func in the library/module mod. I will try with a<br>> suggestion, both mine and others, from a different thread:<br>><br>> (remote-call mod func arg1 arg2 ... )
<br>><br>> which is a normal function and have:<br>><br>> (: mod func arg1 arg2 ... )<br>><br>> for the special case where both mod and func are the actual names<br>> of e the module and function. This to save having to write:
<br>><br>> (remote-call 'mod 'func arg1 ... )<br>><br>> Sorry for rambling on here, but these are just some ideas I have<br>> had about it all. Probably should blogg it but I don't want to<br>> release it to a poor unsuspecting public just yet. :-) I'll be back
<br>> when I have something to show,<br>><br>> Robert<br>><br><br>Can't we use (mod:fun args) syntax for the function call ? I don't<br>know well scheme and CL, and I can't figure which are the differences
<br>internally.<br>But at a syntaxic level, I find it tedious to write (remote-call<br>mod ...) each time I want to call a function in another module. The<br>(: seems also strange to me, even if I understand it's relevance in
<br>the lisp context.<br>In the same vein, I also prefer to write (defun...) instead of<br>(define (call...). Of course, it's just a matter of taste, I don't<br>want to start a war :-)</blockquote><div><br>I sort of agree. There are some problems with (mod:fun args):
- How do I write the equivalent of Mod:fun( ... )? I can't use (Mod:fun ... ) see below.<br><br>
- How do I parse mod:fun? This is a fundamental question as the
relationship between code and data in lisp is 1-to-1. Parsed code *is* just its sexpr, there is no difference. This is one reason why it is so easy to manipulate code, for example by macros. Erlang code is has no such direct coupling to data. This fine if you going to compile the code, but it makes it more difficult to manipulate it. The problem is what do I parse mod:fun to?
<br> - In Cl it is the symbol fun in the module mod.<br> - In Scheme it is just the symbol mod:fun which can be interpreted as a call to a function in a library.<br>I mean I have to sensibly be able to handle the case where someone writes (cons a mod:fun). What does this mean?
<br><br>- Seeing this is based on Erlang I can't introduce any new data types. So with the argument above I can't have variables as a separate data type, separate from symbols/atoms. So Mod:fun will mean the same as mod:fun but with a different name. Now that was clear :-)
<br><br>So that is why I have no better suggestion for the moment to the general function (remote-call <mod> <fun> ... ) and its short hand form the macro (: mod fun ... )<br><br>Another problem for Erlisp is that while we have to have separate functions for the case of same function name with different number of arguments (it's Erlang) we don't need this for macros. In fact it might actually be better not to have it so I can define general macros which work on any number of arguments, like : above:
<br><br>(defmacro : (mod fun . args)<br> `(remote-call mod fun ,@args))<br><br>for a slightly bastardised form. Actually Scheme define-syntax does use matching to select case so it might be better. The problem is that it will be difficult to call macros as functions.
<br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">It can also be interesting to look at paul graham's arc lisp. For<br>instance, qrc replace setf by =.
<br>He also renamed lambda to fn. Not so far from fun.<br><a href="http://www.paulgraham.com/arcll1.html">http://www.paulgraham.com/arcll1.html</a></blockquote><div><br>Read it. Interesting, but nothing came of it. Although I thoroughly agree with its idea of keeping names short. Perhaps I can replace element and set_element with tget and tset. :-)
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Again, I'm not a specialist, and that's why I'm not too attached at
<br>keeping a known scheme or CL syntax.<br>My 2 cents<br>Denis<br></blockquote></div><br>Robert<br><br>