Alexander Burger <a...@software-lab.de> writes:

Hi Alex,

> isn't this what you mean?
>
>    (de replaceUrlWildcard (U W)
>       (let Y (split (chop U) "*")
>          (glue " "
>             (mapcar
>                '((X) (pack (car Y) X (cadr Y)))
>                W ) ) ) )
>
>    (replaceUrlWildcard
>       "http://software-lab.de/doc/ref*.html";
>       '("A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" "O" "P"
>          "Q" "R" "S" "T" "U" "V" "W" "X" "Y" "Z" ) )
>
>    -> "http://software-lab.de/doc/refA.html 
> http://software-lab.de/doc/refB.html ...
>
> Side note: Though the result of 'pack' is the same, I would recommend
> (cadr Y) instead of (cdr Y), to reflect the result of 'split'.
>
>
>> An external program reads the URL's like this:
>> 
>> ,------------------------------------------------------------------------------
>> | (setq UrlStrings_ref (prin "\"" (replaceUrlWildcard U_ref W_ref) "\""))
>
> If you use 'print' instead of 'prin' here, you don't need to supply the
> double quotes yourself:
>
>    : (print "abc")         
>    "abc"-> "abc"
>
> gives the same _output_ as
>
>    : (prin "\"" "abc" "\"")
>    "abc"-> "\""
>
>
>> Yes, I don't where these 4 """" quotes come from - do they have a
>> special
>> meaning in Picolisp? I don't remember ... 
>
> If the reader sees two double quotes in sequence, it returns NIL
> (representing the empty string)
>
>    : (list "a" "" "b")
>    -> ("a" NIL "b")
>
> Therefore, """" read as two NILs
>
>    : (list "a" """" "b")
>    -> ("a" NIL NIL "b")
>
> which in turn disappear in the 'pack'
>
>    (pack '("a" NIL NIL "b"))
>    -> "ab"


just for the record, this from your PM:

   ,------------------------------------------
   | (de replaceUrlWildcard (U W)
   |    (let Y (split (chop U) "*")
   |       (mapcar
   |          '((X) (pack "\"" (car Y) X (cadr Y) "\""))
   |          W ) ) )
   `------------------------------------------

and then: 

   ,-----------------------------------------------------------
   | (apply call
   |    (replaceUrlWildcard Uxxx Wyyy)
   |    "pandoc"  "-s" "-S"  "-o" "/home/tj/picolisp-ref.org" )
   `-----------------------------------------------------------

did the job perfectly - thanks.

-- 
cheers,
Thorsten

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to