[MOO-Cows] Re: Cogito ergo sum

2005-01-18 Thread Sean Davis
On Tue, Jan 18, 2005 at 07:18:04PM -0800, H. Peter Anvin wrote:
 Sean Davis wrote:
 On Wed, Jan 19, 2005 at 02:44:49AM +0100, Daniel Jung wrote:
 
 Hi all
 
 [LambdaMOO 1.8.0r5]
 
 Please do this:
 
   eval me:tell(me ? I exist | I don't exist)
 
 MOO objects don't seem to be true, and I cannot see why. Could anyone 
 enlighten me please. Both banana, 14, {1,2,3} and #1 should exist.
 
 Then do this
 
   eval me:tell(OBJ ? Objects exist | Objects don't exist)
 
 Type and example are returned true when it is a string (STR and 
 `banana'), an integer (INT and `14') and a list (LIST and `{1,2,3}'). 
 But in OBJ, only the type is returned true; the example (be it valid or 
 not) is returned false. I find this inconsistent, but maybe this is so 
 by design?
 
 Last example:
 
   eval me:tell(ERR ? Errors exist | Errors don't exist)
   eval me:tell(E_TYPE ? Mismatch exists | Mismatch doesn't exist)
 
 
 
 All I can say is... weird. My results seem to confirm yours, running
 1.8.1+foo2.7.4:
 I don't exist
 Objects exist
 Errors exist
 Mismatch doesn't exist
 
 
 RTFM.  Type names are actually integers.

Yes, they are. I was merely running the suggested evals. No need to RTFM
at me. I'm quite aware that type names are integers. I merely found the
results of those tests... curious... for lack of a better word.

-Sean

#
This message is sent to you because you are subscribed to
  the mailing list moo-cows@the-b.org.
To unsubscribe, E-mail to: [EMAIL PROTECTED]
To switch to the DIGEST mode, E-mail to [EMAIL PROTECTED]
To switch to the INDEX mode, E-mail to [EMAIL PROTECTED]
Send administrative queries to  [EMAIL PROTECTED]



[MOO-Cows] Re: How random is 'random()'? And can I seed it?

2005-02-15 Thread Sean Davis
On Tue, Feb 15, 2005 at 09:00:45AM -0500, Sean Davis wrote:
 On Tue, Feb 15, 2005 at 12:38:59PM +, Dr Robert Sanderson wrote:
  
  asked before. I wonder if anyone who is familiar with the source code 
  and randomisation techniques can tell me how it stacks up against other 
  mathematical 'random' number generator in simulating unpredictable 
  reuslts.
  
  AFAIK, it just calls out to the operating system's rand() function.
  So it's as good as your operating system's implementation.
 
 What's surprising to me is that the MOO server is written to prefer
 {l,s}rand48(3) over {,s}random(3), even though autoconf sets HAVE_RANDOM.
 the {,s}random(3) functions are only used if {l,s}rand48(3) are unavailable,
 for some reason. My suspicion is that this dates back to the Heydey of
 LambdaMOO on old Unices - for example, the same reason that LambdaMOO still
 had code for /dev/tcp on Solaris in it. I'll be fixing this in LambdaMOO
 1.8.1+foo as soon as I finish sending this mail. We're not quite caught up
 to LambdaMOO CVS as far as things like WROGUE go - I haven't even started
 merging that in - but the network code, at least, has been almost totally
 redone. No reason that the random code shouldn't be brought out of the stone
 age as well :-)

(Replying to myself here)

Fixing it so that it used random(3) with a 256-byte state was rather easy.
Unfortunately, though it compiles, the Lambda+foo MOO server doesn't work on
Solaris (this is a known problem, it's been this way ever since I rewrote
most of network.c to POSIXify things). If the problem is what I think it is,
it shouldn't be too much of a pain to fix. The only issue is that the only
Solaris-running machines I have access to are the ungodly slow sourceforge
compile farm servers, so I haven't had the motivation to sit down and fix it
yet.

Tested to compile/work with no warnings on Linux, NetBSD/i386, and
NetBSD/sparc64, so far. I'll toss a new release of the codebase out the door
as soon as I get it working on Solaris again.

- Sean

--
 _
( ) ASCII Ribbon Campaign
 X
/ \ For Plain Text Email

#
This message is sent to you because you are subscribed to
  the mailing list moo-cows@the-b.org.
To unsubscribe, E-mail to: [EMAIL PROTECTED]
To switch to the DIGEST mode, E-mail to [EMAIL PROTECTED]
To switch to the INDEX mode, E-mail to [EMAIL PROTECTED]
Send administrative queries to  [EMAIL PROTECTED]