emacs-devel
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]