From: Christophe Turle
Subject: design incertitude
Date: 
Message-ID: <cbugq5$bch$1@amma.irisa.fr>
hi,

i'm not sure this is well designed, a suggestion ?

(defun def-simple-balise ( balise )
  (let ((fn-name      (intern balise))
	(balise-debut (format nil "<~a>" balise))
	(balise-fin   (format nil "</~a>" balise)) )
    (eval `(defun ,fn-name ( content )
	     (concatenate 'string ,balise-debut content ,balise-fin) ))))

(defun def-balises ()
  ;; definir toutes les balises simples de H1 � H9
  (loop for i from 1 to 9
        as balise-name = (format nil "H~d" i)
	do (def-simple-balise balise-name) ))


ctu.

From: Kenny Tilton
Subject: Re: design incertitude
Date: 
Message-ID: <UFAEc.13778$4h7.1301758@twister.nyc.rr.com>
Christophe Turle wrote:

> 
> hi,
> 
> i'm not sure this is well designed, a suggestion ?

Lisez "On Lisp", Graham. :)

When will def-balises be run to actually get the H<n> functions defined? 
With macros the functions get defined when the form is evaluated/loaded:

(defun def-simple-balise ( balise )
   (let ((fn-name      (intern balise))
         (balise-debut (format nil "<~a>" balise))
         (balise-fin   (format nil "</~a>" balise)) )
     `(defun ,fn-name ( content )
        (concatenate 'string ,balise-debut content ,balise-fin) )))

(defmacro def-balises ()
   ; definir toutes les balises simples de H1 � H9
   `(progn
      ,@(loop for i from 1 to 9
            as balise-name = (format nil "H~d" i)
            collecting (def-simple-balise balise-name) )))

(def-balises)

#test
(macroexpand-1 '(def-balises))
=>(PROGN (DEFUN H1 (CONTENT) (CONCATENATE 'STRING "<H1>" CONTENT "</H1>"))
        (DEFUN H2 (CONTENT) (CONCATENATE 'STRING "<H2>" CONTENT "</H2>"))
        (DEFUN H3 (CONTENT) (CONCATENATE 'STRING "<H3>" CONTENT "</H3>"))
        (DEFUN H4 (CONTENT) (CONCATENATE 'STRING "<H4>" CONTENT "</H4>"))
        (DEFUN H5 (CONTENT) (CONCATENATE 'STRING "<H5>" CONTENT "</H5>"))
        (DEFUN H6 (CONTENT) (CONCATENATE 'STRING "<H6>" CONTENT "</H6>"))
        (DEFUN H7 (CONTENT) (CONCATENATE 'STRING "<H7>" CONTENT "</H7>"))
        (DEFUN H8 (CONTENT) (CONCATENATE 'STRING "<H8>" CONTENT "</H8>"))
        (DEFUN H9 (CONTENT) (CONCATENATE 'STRING "<H9>" CONTENT "</H9>")))


Maintenant:

(defun def-plus-simple-balise ( balise )
   `(defun ,(intern balise) ( content )
      (format nil "<~a>~a</~a>" balise content balise)))

Mais c'est aussi simple qu'il ne faut pas employer def-plus-simple-balise:

(defmacro def-balises-complet ()
   ; definir toutes les balises simples de H1 � H9
   `(progn
      ,@(loop for i from 1 to 9
            as balise = (format nil "H~d" i)
            collecting `(defun ,(intern balise) ( content )
                          (format nil ,(format nil "<~a>~~a</~a>" balise 
balise) content)) )))

(def-balises-complet)
=>
(PROGN (DEFUN H1 (CONTENT) (FORMAT NIL "<H1>~a</H1>" CONTENT))
        (DEFUN H2 (CONTENT) (FORMAT NIL "<H2>~a</H2>" CONTENT))
        (DEFUN H3 (CONTENT) (FORMAT NIL "<H3>~a</H3>" CONTENT))
        (DEFUN H4 (CONTENT) (FORMAT NIL "<H4>~a</H4>" CONTENT))
        (DEFUN H5 (CONTENT) (FORMAT NIL "<H5>~a</H5>" CONTENT))
        (DEFUN H6 (CONTENT) (FORMAT NIL "<H6>~a</H6>" CONTENT))
        (DEFUN H7 (CONTENT) (FORMAT NIL "<H7>~a</H7>" CONTENT))
        (DEFUN H8 (CONTENT) (FORMAT NIL "<H8>~a</H8>" CONTENT))
        (DEFUN H9 (CONTENT) (FORMAT NIL "<H9>~a</H9>" CONTENT)))

Viola! :)

kt


-- 
Home? http://tilton-technology.com
Cells? http://www.common-lisp.net/project/cells/
Cello? http://www.common-lisp.net/project/cello/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
Your Project Here! http://alu.cliki.net/Industry%20Application
From: Christophe Turle
Subject: Re: design incertitude
Date: 
Message-ID: <cbupl9$e20$1@amma.irisa.fr>
Kenny Tilton wrote:
> 
> 
> Christophe Turle wrote:
> 
>>
>> hi,
>>
>> i'm not sure this is well designed, a suggestion ?
> 
> 
> Lisez "On Lisp", Graham. :)

i read it. surely not enough ...

> 
> When will def-balises be run to actually get the H<n> functions defined?

after loading file.

> With macros the functions get defined when the form is evaluated/loaded:
> 
> (defun def-simple-balise ( balise )
>   (let ((fn-name      (intern balise))
>         (balise-debut (format nil "<~a>" balise))
>         (balise-fin   (format nil "</~a>" balise)) )
>     `(defun ,fn-name ( content )
>        (concatenate 'string ,balise-debut content ,balise-fin) )))

ok with the removal of "eval". "eval" to outer edges !

> 
> (defmacro def-balises ()
>   ; definir toutes les balises simples de H1 � H9
>   `(progn
>      ,@(loop for i from 1 to 9
>            as balise-name = (format nil "H~d" i)
>            collecting (def-simple-balise balise-name) )))
>
>
> (def-balises)
> 
> #test
> (macroexpand-1 '(def-balises))
> =>(PROGN (DEFUN H1 (CONTENT) (CONCATENATE 'STRING "<H1>" CONTENT "</H1>"))
>        (DEFUN H2 (CONTENT) (CONCATENATE 'STRING "<H2>" CONTENT "</H2>"))
>        (DEFUN H3 (CONTENT) (CONCATENATE 'STRING "<H3>" CONTENT "</H3>"))
>        (DEFUN H4 (CONTENT) (CONCATENATE 'STRING "<H4>" CONTENT "</H4>"))
>        (DEFUN H5 (CONTENT) (CONCATENATE 'STRING "<H5>" CONTENT "</H5>"))
>        (DEFUN H6 (CONTENT) (CONCATENATE 'STRING "<H6>" CONTENT "</H6>"))
>        (DEFUN H7 (CONTENT) (CONCATENATE 'STRING "<H7>" CONTENT "</H7>"))
>        (DEFUN H8 (CONTENT) (CONCATENATE 'STRING "<H8>" CONTENT "</H8>"))
>        (DEFUN H9 (CONTENT) (CONCATENATE 'STRING "<H9>" CONTENT "</H9>")))
> 

collecting instead of eval : You just gain in rapidity using more space ?

(defun def-balises ()
  ;; definir toutes les balises simples de H1 � H9
  (loop for i from 1 to 9
    as balise-name = (format nil "H~d" i)
    do (eval (def-simple-balise balise-name)) ))


> Maintenant:
> 
> (defun def-plus-simple-balise ( balise )
>   `(defun ,(intern balise) ( content )
>      (format nil "<~a>~a</~a>" balise content balise)))
> 

i agree with you if you give me the function which converts "def-simple-balise" to "def-plus-simple-balise" ;)

> Mais c'est aussi simple qu'il ne faut pas employer def-plus-simple-balise:
> 
> (defmacro def-balises-complet ()
>   ; definir toutes les balises simples de H1 � H9
>   `(progn
>      ,@(loop for i from 1 to 9
>            as balise = (format nil "H~d" i)
>            collecting `(defun ,(intern balise) ( content )
>                          (format nil ,(format nil "<~a>~~a</~a>" balise 
> balise) content)) )))

It's more difficult to generate automatically. But it's just me.


merci !

ctu.
 
From: Kenny Tilton
Subject: Re: design incertitude
Date: 
Message-ID: <%5XEc.15266$4h7.1568589@twister.nyc.rr.com>
Christophe Turle wrote:

> Kenny Tilton wrote:
> 
>>
>>
>> Christophe Turle wrote:
>>
>>>
>>> hi,
>>>
>>> i'm not sure this is well designed, a suggestion ?
>>
>>
>>
>> Lisez "On Lisp", Graham. :)
> 
> 
> i read it. surely not enough ...
> 
>>
>> When will def-balises be run to actually get the H<n> functions defined?
> 
> 
> after loading file.

Sorry, I was too terse. Loading the file will not cause the 
header-generating functions to be defined. You would need to run the 
function which you had created which itself executed the defuns. In the 
meantime, everywhere you coded (h1 ...) you would get a warning that h1 
was undefined. You could add (as I did):

(def-balises)

...at the top-level to get them defined. This was a relatively minor point.

> 
>> With macros the functions get defined when the form is evaluated/loaded:
>>
>> (defun def-simple-balise ( balise )
>>   (let ((fn-name      (intern balise))
>>         (balise-debut (format nil "<~a>" balise))
>>         (balise-fin   (format nil "</~a>" balise)) )
>>     `(defun ,fn-name ( content )
>>        (concatenate 'string ,balise-debut content ,balise-fin) )))
> 
> 
> ok with the removal of "eval". "eval" to outer edges !
> 
>>
>> (defmacro def-balises ()
>>   ; definir toutes les balises simples de H1 � H9
>>   `(progn
>>      ,@(loop for i from 1 to 9
>>            as balise-name = (format nil "H~d" i)
>>            collecting (def-simple-balise balise-name) )))
>>
>>
>> (def-balises)
>>
>> #test
>> (macroexpand-1 '(def-balises))
>> =>(PROGN (DEFUN H1 (CONTENT) (CONCATENATE 'STRING "<H1>" CONTENT 
>> "</H1>"))
>>        (DEFUN H2 (CONTENT) (CONCATENATE 'STRING "<H2>" CONTENT "</H2>"))
>>        (DEFUN H3 (CONTENT) (CONCATENATE 'STRING "<H3>" CONTENT "</H3>"))
>>        (DEFUN H4 (CONTENT) (CONCATENATE 'STRING "<H4>" CONTENT "</H4>"))
>>        (DEFUN H5 (CONTENT) (CONCATENATE 'STRING "<H5>" CONTENT "</H5>"))
>>        (DEFUN H6 (CONTENT) (CONCATENATE 'STRING "<H6>" CONTENT "</H6>"))
>>        (DEFUN H7 (CONTENT) (CONCATENATE 'STRING "<H7>" CONTENT "</H7>"))
>>        (DEFUN H8 (CONTENT) (CONCATENATE 'STRING "<H8>" CONTENT "</H8>"))
>>        (DEFUN H9 (CONTENT) (CONCATENATE 'STRING "<H9>" CONTENT "</H9>")))
>>
> 
> collecting instead of eval : You just gain in rapidity using more space ?

But the (negligible) space is used at compile-time, not run-time. Your 
code re-implements Lisp's macro capability: you do not need to eval the 
forms, you just need to return them from a macro function and the 
compiler will do the rest.


> 
> (defun def-balises ()
>  ;; definir toutes les balises simples de H1 � H9
>  (loop for i from 1 to 9
>    as balise-name = (format nil "H~d" i)
>    do (eval (def-simple-balise balise-name)) ))
> 
> 
>> Maintenant:
>>
>> (defun def-plus-simple-balise ( balise )
>>   `(defun ,(intern balise) ( content )
>>      (format nil "<~a>~a</~a>" balise content balise)))
>>
> 
> i agree with you if you give me the function which converts 
> "def-simple-balise" to "def-plus-simple-balise" ;)

subsitution? I just took your code and tossed the intermediate steps, 
substituting the right side of each intermediate binding where the left 
side was used.


> 
>> Mais c'est aussi simple qu'il ne faut pas employer 
>> def-plus-simple-balise:
>>
>> (defmacro def-balises-complet ()
>>   ; definir toutes les balises simples de H1 � H9
>>   `(progn
>>      ,@(loop for i from 1 to 9
>>            as balise = (format nil "H~d" i)
>>            collecting `(defun ,(intern balise) ( content )
>>                          (format nil ,(format nil "<~a>~~a</~a>" 
>> balise balise) content)) )))
> 
> 
> It's more difficult to generate automatically. But it's just me.
> 
> 
> merci !
>

de rien.

kt


-- 
Home? http://tilton-technology.com
Cells? http://www.common-lisp.net/project/cells/
Cello? http://www.common-lisp.net/project/cello/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
Your Project Here! http://alu.cliki.net/Industry%20Application
From: Christophe Turle
Subject: Re: design incertitude
Date: 
Message-ID: <cc3svb$nj9$1@amma.irisa.fr>
>>> (defmacro def-balises ()
>>>   ; definir toutes les balises simples de H1 � H9
>>>   `(progn
>>>      ,@(loop for i from 1 to 9
>>>            as balise-name = (format nil "H~d" i)
>>>            collecting (def-simple-balise balise-name) )))
>>>
>>>
>>> (def-balises)
>>>
>>> #test
>>> (macroexpand-1 '(def-balises))
>>> =>(PROGN (DEFUN H1 (CONTENT) (CONCATENATE 'STRING "<H1>" CONTENT 
>>> "</H1>"))
>>>        (DEFUN H2 (CONTENT) (CONCATENATE 'STRING "<H2>" CONTENT "</H2>"))
>>>        (DEFUN H3 (CONTENT) (CONCATENATE 'STRING "<H3>" CONTENT "</H3>"))
>>>        (DEFUN H4 (CONTENT) (CONCATENATE 'STRING "<H4>" CONTENT "</H4>"))
>>>        (DEFUN H5 (CONTENT) (CONCATENATE 'STRING "<H5>" CONTENT "</H5>"))
>>>        (DEFUN H6 (CONTENT) (CONCATENATE 'STRING "<H6>" CONTENT "</H6>"))
>>>        (DEFUN H7 (CONTENT) (CONCATENATE 'STRING "<H7>" CONTENT "</H7>"))
>>>        (DEFUN H8 (CONTENT) (CONCATENATE 'STRING "<H8>" CONTENT "</H8>"))
>>>        (DEFUN H9 (CONTENT) (CONCATENATE 'STRING "<H9>" CONTENT 
>>> "</H9>")))
>>>
>>
>> collecting instead of eval : You just gain in rapidity using more space ?
> 
>> (defun def-balises ()
>>  ;; definir toutes les balises simples de H1 � H9
>>  (loop for i from 1 to 9
>>    as balise-name = (format nil "H~d" i)
>>    do (eval (def-simple-balise balise-name)) ))
>>
> 
> But the (negligible) space is used at compile-time, not run-time.

is this right :

If you compile your file, the '(def-balises)' will be expanded once during this compilation and so each loading of this compiled file won't need to call the 'def-simple-balise', saving loading time. For this to work, i think we should add an 'eval-when compile' around the defmacro ?

In that case, i understand your view and macro benefit.


ctu.
From: Kenny Tilton
Subject: Re: design incertitude
Date: 
Message-ID: <86fFc.15474$4h7.1793652@twister.nyc.rr.com>
Christophe Turle wrote:

>>>> (defmacro def-balises ()
>>>>   ; definir toutes les balises simples de H1 � H9
>>>>   `(progn
>>>>      ,@(loop for i from 1 to 9
>>>>            as balise-name = (format nil "H~d" i)
>>>>            collecting (def-simple-balise balise-name) )))
>>>>
>>>>
>>>> (def-balises)
>>>>
>>>> #test
>>>> (macroexpand-1 '(def-balises))
>>>> =>(PROGN (DEFUN H1 (CONTENT) (CONCATENATE 'STRING "<H1>" CONTENT 
>>>> "</H1>"))
>>>>        (DEFUN H2 (CONTENT) (CONCATENATE 'STRING "<H2>" CONTENT 
>>>> "</H2>"))
>>>>        (DEFUN H3 (CONTENT) (CONCATENATE 'STRING "<H3>" CONTENT 
>>>> "</H3>"))
>>>>        (DEFUN H4 (CONTENT) (CONCATENATE 'STRING "<H4>" CONTENT 
>>>> "</H4>"))
>>>>        (DEFUN H5 (CONTENT) (CONCATENATE 'STRING "<H5>" CONTENT 
>>>> "</H5>"))
>>>>        (DEFUN H6 (CONTENT) (CONCATENATE 'STRING "<H6>" CONTENT 
>>>> "</H6>"))
>>>>        (DEFUN H7 (CONTENT) (CONCATENATE 'STRING "<H7>" CONTENT 
>>>> "</H7>"))
>>>>        (DEFUN H8 (CONTENT) (CONCATENATE 'STRING "<H8>" CONTENT 
>>>> "</H8>"))
>>>>        (DEFUN H9 (CONTENT) (CONCATENATE 'STRING "<H9>" CONTENT 
>>>> "</H9>")))
>>>>
>>>
>>> collecting instead of eval : You just gain in rapidity using more 
>>> space ?
>>
>>
>>> (defun def-balises ()
>>>  ;; definir toutes les balises simples de H1 � H9
>>>  (loop for i from 1 to 9
>>>    as balise-name = (format nil "H~d" i)
>>>    do (eval (def-simple-balise balise-name)) ))
>>>
>>
>> But the (negligible) space is used at compile-time, not run-time.
> 
> 
> is this right :
> 
> If you compile your file, the '(def-balises)' will be expanded once 
> during this compilation and so each loading of this compiled file won't 
> need to call the 'def-simple-balise', saving loading time.

Yes. Not that I am worried about the load time, more that Good Things 
tend to follow when one uses language features such as macros instead of 
reinventing them.

  For this to
> work, i think we should add an 'eval-when compile' around the defmacro ?

No eval-when is needed for this to work. The CL spec says that macros 
defined earlier in a source file must be available for use later in the 
same source file (if I understand your concern correctly).

Aside/rant: This is a good example of Common Lisp almost always working 
the way you would like it to work, I think because it is almost fifty 
years old and for the first almost thirty years there was no spec and 
folks were free to tweak various Lisps to DWIM.

kt

-- 
Home? http://tilton-technology.com
Cells? http://www.common-lisp.net/project/cells/
Cello? http://www.common-lisp.net/project/cello/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
Your Project Here! http://alu.cliki.net/Industry%20Application
From: Pascal Bourguignon
Subject: Re: design incertitude
Date: 
Message-ID: <873c4dc7u8.fsf@thalassa.informatimago.com>
Kenny Tilton <·······@nyc.rr.com> writes:
> Viola! :)

Thanks for trying.  But  it's:  Voil�!  <=>  There!
                          not:  Viola!  <=>  Raped!

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

There is no worse tyranny than to force a man to pay for what he does not
want merely because you think it would be good for him. -- Robert Heinlein
From: Kenny Tilton
Subject: Re: design incertitude
Date: 
Message-ID: <VkCEc.13783$4h7.1315042@twister.nyc.rr.com>
Pascal Bourguignon wrote:
> Kenny Tilton <·······@nyc.rr.com> writes:
> 
>>Viola! :)
> 
> 
> Thanks for trying.  But  it's:  Voil�!  <=>  There!
>                           not:  Viola!  <=>  Raped!

Oy. Actually, the viola misspelling seems to be an inside joke here on 
c.l.l., perhaps done in good faith originally, but then repeated (by 
moi, at least) out of affection for the gaffe. But I did not know the 
translation, which kinda dampens the amusement value.

Merci. kt

-- 
Home? http://tilton-technology.com
Cells? http://www.common-lisp.net/project/cells/
Cello? http://www.common-lisp.net/project/cello/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
Your Project Here! http://alu.cliki.net/Industry%20Application
From: Alex McGuire
Subject: Re: design incertitude
Date: 
Message-ID: <ccdlss$5uk$1@news-reader2.wanadoo.fr>
Pascal Bourguignon wrote:
> Kenny Tilton <·······@nyc.rr.com> writes:
> 
>>Viola! :)
> 
> 
> Thanks for trying.  But  it's:  Voil�!  <=>  There!
>                           not:  Viola!  <=>  Raped!
> 
Not quite, it's   Viol�	<=>  Raped
From: Alex McGuire
Subject: Re: design incertitude
Date: 
Message-ID: <ccdm8c$qat$1@news-reader1.wanadoo.fr>
Alex McGuire wrote:
> Pascal Bourguignon wrote:
> 
>> Kenny Tilton <·······@nyc.rr.com> writes:
>>
>>> Viola! :)
>>
>>
>>
>> Thanks for trying.  But  it's:  Voil�!  <=>  There!
>>                           not:  Viola!  <=>  Raped!
>>
> Not quite, it's   Viol�    <=>  Raped

Then again, judging by your name Pascal, you are actually french, and 
I'm talking nonsense. Assuming this is the case, can you tell me what 
tense 'viola' is.

cheers,

Alex
From: Pascal Bourguignon
Subject: Re: design incertitude
Date: 
Message-ID: <874qol1486.fsf@thalassa.informatimago.com>
Alex McGuire <····@-ignoreme-alexmcguire.com> writes:
> >> Thanks for trying.  But  it's:  Voil�!  <=>  There!
> >>                           not:  Viola!  <=>  Raped!
> >>
> > Not quite, it's   Viol�    <=>  Raped
> 
> Then again, judging by your name Pascal, you are actually french, and
> I'm talking nonsense. Assuming this is the case, can you tell me what
> tense 'viola' is.

Indeed, as said in the other thread, it's "pass� simple" past perfect:

    He raped.
    Il viola.


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

There is no worse tyranny than to force a man to pay for what he does not
want merely because you think it would be good for him. -- Robert Heinlein
From: Alain Picard
Subject: OT French conjugations [was Re: design incertitude]
Date: 
Message-ID: <87brit49ep.fsf_-_@memetrics.com>
Alex McGuire <····@-ignoreme-alexmcguire.com> writes:

> Then again, judging by your name Pascal, you are actually french, and
> I'm talking nonsense. Assuming this is the case, can you tell me what
> tense 'viola' is.

It's a tense called past definite (pass� simple), more common in writing
than in speech.

  Je viola
  Tu violas
  Il viola
  Nous violons... (yes, like the violins. :-)
  ...
From: Pascal Bourguignon
Subject: Re: OT French conjugations [was Re: design incertitude]
Date: 
Message-ID: <87hdsl197i.fsf@thalassa.informatimago.com>
Alain Picard <············@memetrics.com> writes:

> Alex McGuire <····@-ignoreme-alexmcguire.com> writes:
> 
> > Then again, judging by your name Pascal, you are actually french, and
> > I'm talking nonsense. Assuming this is the case, can you tell me what
> > tense 'viola' is.
> 
> It's a tense called past definite (pass� simple), more common in writing
> than in speech.
> 
>   Je viola

Actually:  Je violai
not to be mixed for the imperfect: Je violais

Use for example: http://bach.arts.kuleuven.ac.be/~piet/morlex/conjug.html
(infinitive: violer)


>   Tu violas
>   Il viola
>   Nous violons... (yes, like the violins. :-)

This is present. 

    Nous viol�mes
    Vous viol�tes
    Ils  viol�rent

>   ...
> 


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

There is no worse tyranny than to force a man to pay for what he does not
want merely because you think it would be good for him. -- Robert Heinlein
From: Mark McConnell
Subject: Re: OT French conjugations [was Re: design incertitude]
Date: 
Message-ID: <d3aed052.0407061446.78c6802f@posting.google.com>
Pascal Bourguignon <····@thalassa.informatimago.com> wrote in message news:<··············@thalassa.informatimago.com>...
> Actually:  Je violai
> not to be mixed for the imperfect: Je violais
> 
>     Nous viol�mes
>     Vous viol�tes
>     Ils  viol�rent

Last summer I read (a bit slowly) through Andre Gide's _La Porte
Etroite_.  It was wonderful, but every third word ended in �mes,
�rent, or aient.  The book is about conflicts between earthly and
spiritual love, with enough religious overtones that I sometimes
connected "fu^mes" with smoke.
From: Alain Picard
Subject: Re: OT French conjugations [was Re: design incertitude]
Date: 
Message-ID: <87vfh0xjdo.fsf@memetrics.com>
Pascal Bourguignon <····@thalassa.informatimago.com> writes:
>
> Actually:  Je violai
> not to be mixed for the imperfect: Je violais

Ugh.  I hang my head in shame, and hope my old high
school french teacher doesn't read CLL.  :-)
From: Marco Baringer
Subject: Re: design incertitude
Date: 
Message-ID: <m2r7rxypjm.fsf@convey.it>
Christophe Turle <······@nospam.fr> writes:

> hi,
>
> i'm not sure this is well designed, a suggestion ?
>
> (defun def-simple-balise ( balise )
>   (let ((fn-name      (intern balise))
> 	(balise-debut (format nil "<~a>" balise))
> 	(balise-fin   (format nil "</~a>" balise)) )
>     (eval `(defun ,fn-name ( content )
> 	     (concatenate 'string ,balise-debut content ,balise-fin) ))))
>
> (defun def-balises ()
>   ;; definir toutes les balises simples de H1 � H9
>   (loop for i from 1 to 9
>         as balise-name = (format nil "H~d" i)
> 	do (def-simple-balise balise-name) ))

unless you have hundreds of things to define i'd suggest writing out
the def-balise forms explictly. 

since you'll probably have other places were you'll need (<tag>
SOMETHING </tag>) i'd wrap that in a macro, leaving you with something
like this:

(defmacro wrap-in-tag (tag-name content)
  `(concatenate 'string
     ,(format nil "<~a>" tag-name)
     ,content
     ,(format nil "</~a>" tag-name)))

(defmacro def-simple-balise (balise)
  `(defun ,balise (content)
     (wrap-in-tag ,(string balise)
       content)))

;;;; use an emacs keyboard macro for this:

(def-simple-balise H1)
(def-simple-balise H2)
(def-simple-balise H3)
(def-simple-balise H4)
(def-simple-balise H5)
(def-simple-balise H6)
(def-simple-balise H7)
(def-simple-balise H8)
(def-simple-balise H9)

-- 
-Marco
Ring the bells that still can ring.
Forget your perfect offering.
There is a crack in everything.
That's how the light gets in.
     -Leonard Cohen