Alan Shields | 17 Jun 2005 02:35
Favicon

Araneida DARCS repository patches

I folded all my (read: 3) patches to araneida into a repository that's
publicly accessible so as to make my patches easier to find/apply. I
hear it's what the cool kids are doing.

http://code.microarray.omrf.org/darcs/alan-araneida/

With the happy-fun CGI:

http://code.microarray.omrf.org/cgi-bin/darcs.cgi/alan-araneida/?c=browse

If you act now, you'll get the following patches:

Thu Jun 16 19:17:56 CDT 2005  Alan-Shields <at> omrf.ouhsc.edu
  * Eliminate implicit generic style warnings by adding generics - also includes some extra documentation
  Moved docstrings from methods to generics, added necessary generics, etc, etc, etc. Documentation
  should exist for all the generics I added...though maybe not.

Thu Jun 16 19:08:49 CDT 2005  Alan-Shields <at> omrf.ouhsc.edu
  * Include the request-url for errors
  404 errors were difficult to track down, as they only showed up as "404". So I
  altered error reporting to include the URL requested.

Thu Jun 16 17:55:41 CDT 2005  Alan-Shields <at> omrf.ouhsc.edu
  * araneida-repl-create
  Create the araneida-repl directory, and include the first functions that
  are designed to be used from the repl to get information about araneida.

  I suppose that these could be useful outside of the repl, but I didn't think
  cluttering up araneida proper was such a great idea.

(Continue reading)

Stefan Scholl | 20 Jun 2005 15:55
Picon
Favicon
Gravatar

New release CL-EMB 0.4.0 (API CHANGES!)

New release CL-EMB 0.4.0

CL-EMB is a library to embed Common Lisp and special template
tags into normal text files. Can be used for dynamically
generated HTML pages.

You can download it from
http://common-lisp.net/project/cl-emb/
or install with ASDF-Install.

CL-USER> (asdf:operate 'asdf:load-op :asdf-install)
CL-USER> (asdf-install:install :cl-emb)

Changes:
- Extended way to access environment (the supplied plist)
  with template tags.

  E.g.:  <%  <at> var foo/bar %> 
         --> Like accessing (GETF (GETF ENV :FOO) :BAR)

  When your're inside a nested loop you can access the
  elements of the toplevel by starting the parameter with
  a slash.

CL-USER> (emb:register-emb "test11" "<%  <at> loop bands %>Band: <%  <at> var band %> (Genre: <%  <at> var /genre
%>)<br><%  <at> endloop %>")
#<CL-EMB::EMB-FUNCTION {58ADB12D}>
CL-USER> (emb:execute-emb "test11" :env '(:genre "Rock" :bands ((:band "Queen") (:band "The Rolling
Stones") (:band "ZZ Top"))))
"Band: Queen (Genre: Rock)<br>Band: The Rolling Stones (Genre: Rock)<br>Band: ZZ Top (Genre: Rock)<br>"
(Continue reading)

Alan Shields | 27 Jun 2005 22:31
Favicon

DARCS [heart] Araneida

I'm no Araneida expert, but I've received a patch or two concerning it
since I've set up my public archive.

If anyone else has patches, I'm willing to take a look at them - even
apply them if I can understand them.

Please submit all patches in writing to:
Alan-Shields <at> omrf.ouhsc.edu

I'd prefer patches based off of either the official Araneida DARCS
repository or my repository.

Official:
http://verisons.telent.net/araneida

Alan:
http://code.microarray.omrf.org/darcs/alan-araneida

Thanks,
Alan
Frédéric Gobry | 28 Jun 2005 11:11
Picon
Picon
Favicon

utf-8 manipulations

Hi,

I'm working on my 1st lisp-based web application (I'm a lisp newcomer
too :-)). It's based on Araneida, and runs in sbcl (0.8.16 from debian
sarge, no unicode support).

In my app, users can provide names for certain pages, say:

 Page accentuée

which should give birth to an url that matches the name as
much as possible but remains readable, say:

 page-accentuee

I get the user input as an utf-8 string. Is there a library to help me
processing the raw name into the url-clean version, or should I write
both an utf-8 parser and the equivalent of python's translate () method?

Any general advice on that topic is welcome, as I don't have much
experience with lisp.

Frédéric
Pascal Bourguignon | 28 Jun 2005 17:31
X-Face
Favicon

Re: utf-8 manipulations

Frédéric Gobry writes:
> Hi,
> 
> I'm working on my 1st lisp-based web application (I'm a lisp newcomer
> too :-)). It's based on Araneida, and runs in sbcl (0.8.16 from debian
> sarge, no unicode support).
> 
> In my app, users can provide names for certain pages, say:
> 
>  Page accentuée
>  
> which should give birth to an url that matches the name as
> much as possible but remains readable, say:
> 
>  page-accentuee
> 
> I get the user input as an utf-8 string. Is there a library to help me
> processing the raw name into the url-clean version, or should I write
> both an utf-8 parser and the equivalent of python's translate () method?
> 
> Any general advice on that topic is welcome, as I don't have much
> experience with lisp.

Well, trivial ad-hoc algorithms rarely end in libraries...

But if you're asking for url clean, then instead of reading python
docs you'd better read standards:

http://www.w3.org/International/O-URL-code.html

(Continue reading)

Frédéric Gobry | 28 Jun 2005 20:42
Picon
Picon
Favicon

Re: utf-8 manipulations

(please tell me if this is the wrong mailing list, I don't feel like my
question was welcome)

> Well, trivial ad-hoc algorithms rarely end in libraries...

For my information, which of general charset conversion or generic
string substitution is trivial ad-hoc?

> But if you're asking for url clean, then instead of reading python
> docs you'd better read standards:

I did not have to read python docs, I mostly develop in python these
days.

> http://www.w3.org/International/O-URL-code.html

Thanks, but I don't wish to end up with "Fran%C3%A7ois" but with
"francois".  The aim is to generate a first version of an url from a
string, which can then be manually tweaked by the (non technical) user.

> 
> (defun encode-for-uri (string)
>   (flet ((hex (nibble) (+ nibble (if (< nibble 10) 48 55))))
>     (let ((bytes (make-array (list (length string)) 
>                              :element-type '(unsigned-byte 8)
>                              :adjustable t :fill-pointer 0)))
>       (loop for byte across (encode-string-to-utf-8 string) 
>             do (if (< byte 128)
>                  (vector-push-extend byte bytes)
>                  (progn
(Continue reading)

Frédéric Gobry | 28 Jun 2005 21:50
Picon
Picon
Favicon

Re: utf-8 manipulations

> Do you think it would be wiser to move to another CL implementation?
> I've not yet built strong affective links with any of them, having tried
> a bit cmucl and a bit more sbcl. So, clisp would be a better choice?

I installed clisp and tried to load my current code, but it uses clsql,
which seems to be a problem currently worked on. (UFFI wrappers, if I
understood correctly)

I think I won't be able to stick to sarge after all.

Frédéric
Alan Shields | 28 Jun 2005 23:51
Favicon

Quick test suite for araneida

I wrote a basic "yes, but does it compile" test script for Araneida.

I fear it might only work with SBCL, and welcome patches to have it be
otherwise.

The patch is, if you want to pull it from my repository.

I've set it up so that darcs check will do a compile check.

Tue Jun 28 16:19:18 CDT 2005  Alan-Shields <at> omrf.ouhsc.edu
  * Basic "does-it-compile" testing, with error counting

Any other tests would be equally great!

Alan Shields
Pascal Bourguignon | 29 Jun 2005 00:19
X-Face
Favicon

Re: utf-8 manipulations

Frédéric Gobry writes:
> (please tell me if this is the wrong mailing list, I don't feel like my
> question was welcome)
> 
> > Well, trivial ad-hoc algorithms rarely end in libraries...
> 
> For my information, which of general charset conversion or generic
> string substitution is trivial ad-hoc?
> 
> > But if you're asking for url clean, then instead of reading python
> > docs you'd better read standards:
> 
> I did not have to read python docs, I mostly develop in python these
> days.
> 
> > http://www.w3.org/International/O-URL-code.html
> 
> Thanks, but I don't wish to end up with "Fran%C3%A7ois" but with
> "francois".  The aim is to generate a first version of an url from a
> string, which can then be manually tweaked by the (non technical) user.
> 
> > 
> > (defun encode-for-uri (string)
> >   (flet ((hex (nibble) (+ nibble (if (< nibble 10) 48 55))))
> >     (let ((bytes (make-array (list (length string)) 
> >                              :element-type '(unsigned-byte 8)
> >                              :adjustable t :fill-pointer 0)))
> >       (loop for byte across (encode-string-to-utf-8 string) 
> >             do (if (< byte 128)
> >                  (vector-push-extend byte bytes)
(Continue reading)

Frédéric Gobry | 29 Jun 2005 08:07
Picon
Picon
Favicon

Re: utf-8 manipulations

> To read UTF-8, there's a lot of lisp code to do it, you could use the
> entrails of sbcl-0.9 or of clisp, and use them at user-code level in
> non-unicode Common Lisp.

You're right, I would be stupid not upgrading to sbcl-0.9 and using its
native support.

> You can also see an example of generating simplier names in my
> ~/bin/clean-path clisp script.
> 
> cvs -z3 -d :pserver:anonymous <at> cvs.informatimago.com:/usr/local/cvs/public/chrooted-cvs/cvs co  bin

I'll check that.

Thanks for your help,

Frédéric

Gmane