[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Should Emacs provide a uuid function?
From: |
Eli Zaretskii |
Subject: |
Re: Should Emacs provide a uuid function? |
Date: |
Mon, 09 May 2011 17:51:16 +0300 |
> From: Stefan Monnier <address@hidden>
> Cc: Leo <address@hidden>, address@hidden, address@hidden, address@hidden
> Date: Mon, 09 May 2011 11:38:08 -0300
>
> >> (defun secure-random-bytes (n)
> >> (let ((file (cond
> >> ((file-exists-p "/dev/random") "/dev/random")
> >> ((file-exists-p "/dev/urandom") "/dev/urandom")
> >> (t (error "Secure random device not available")))))
>
> > Feh. Using platform-dependent interfaces in Lisp is not the Emacs
> > way, in my book. How about a primitive which would read from
> > /dev/random or /dev/urandom if they are available, or use other
> > methods if they are not?
>
> FWIW, I don't think there's anything wrong with writing the
> platform-dependent code in Elisp rather than in C. I generally prefer
> code to be written in Elisp when possible and when it's not introducing
> a performance problem.
Suit yourself, but then there will be immediately a test of
system-type and a call to a primitive on w32 (because there's no
similar device there). IMO, it's ugly, but that's me.
- Re: Should Emacs provide a uuid function?, Stephen J. Turnbull, 2011/05/01
- Re: Should Emacs provide a uuid function?, Leo, 2011/05/09
- Re: Should Emacs provide a uuid function?, Eli Zaretskii, 2011/05/09
- Re: Should Emacs provide a uuid function?, Stefan Monnier, 2011/05/09
- Re: Should Emacs provide a uuid function?,
Eli Zaretskii <=
- Re: Should Emacs provide a uuid function?, Stefan Monnier, 2011/05/09
- Re: Should Emacs provide a uuid function?, Eli Zaretskii, 2011/05/09
- Re: Should Emacs provide a uuid function?, Stefan Monnier, 2011/05/09
- Re: Should Emacs provide a uuid function?, Eli Zaretskii, 2011/05/09
- Re: Should Emacs provide a uuid function?, Chong Yidong, 2011/05/09
- Re: Should Emacs provide a uuid function?, Eli Zaretskii, 2011/05/09
- Re: Should Emacs provide a uuid function?, Ted Zlatanov, 2011/05/09
- Re: Should Emacs provide a uuid function?, Eli Zaretskii, 2011/05/09
- Re: Should Emacs provide a uuid function?, Ted Zlatanov, 2011/05/09
- Re: Should Emacs provide a uuid function?, Lars Magne Ingebrigtsen, 2011/05/09