Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Lisp > Re: Why wasn't ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 24 of 30 Topic 12448 of 13603
Post > Topic >>

Re: Why wasn't I told about logbitp?!

by Espen Vestre <espen@[EMAIL PROTECTED] > May 9, 2008 at 12:41 PM

Ken Tilton <kennytilton@[EMAIL PROTECTED]
> writes:

> The real problem, it seems from a few searches of my code, is that I
> do not write a lot of bit manipulating code, that's how I learn
> stuff. Use it or lose it.

Agreed, I prefer reading newspapers or fiction when commuting...

> Now why the hell isn't logbitp an accessor?!!

That would have been nice...

Not sure about the efficiency of that, but (setf (ldb (byte 1 pos) x) 1)
will do the same as your suggested (setf (logbitp pos x) t).

So:

> (let ((x 40))
>   (setf (logbitp 1 x) t)
>   x)
> -> 42

translates into (and this is real cut & paste):

CAPI-E 42 > (let ((x 40))
              (setf (ldb (byte 1 1) x) 1)
              x)
42

-- 
  (espen)
 




 30 Posts in Topic:
Why wasn't I told about logbitp?!
Ken Tilton <kennytilto  2008-05-08 15:48:59 
Re: Why wasn't I told about logbitp?!
"j.oke" <jav  2008-05-08 13:14:05 
Re: Why wasn't I told about logbitp?!
Brian <quickbasicguru@  2008-05-08 18:52:57 
Re: Why wasn't I told about logbitp?!
Ken Tilton <kennytilto  2008-05-08 23:23:22 
Re: Why wasn't I told about logbitp?!
Kent M Pitman <pitman@  2008-05-09 01:00:53 
Re: Why wasn't I told about logbitp?!
Ken Tilton <kennytilto  2008-05-09 06:18:16 
Re: Why wasn't I told about logbitp?!
learninglisp <learning  2008-05-09 16:39:00 
Re: Why wasn't I told about logbitp?!
Ken Tilton <kennytilto  2008-05-09 11:28:28 
Re: Why wasn't I told about logbitp?!
GP lisper <spambait@[E  2008-05-10 22:28:55 
Re: Why wasn't I told about logbitp?!
Duane Rettig <duane@[E  2008-05-08 23:40:06 
Re: Why wasn't I told about logbitp?!
usenet1.3.CalRobert@[EMAI  2008-05-09 00:37:19 
Re: Why wasn't I told about logbitp?!
"Thomas F. Burdick&q  2008-05-09 01:41:12 
Re: Why wasn't I told about logbitp?!
Ken Tilton <kennytilto  2008-05-09 07:12:14 
Re: Why wasn't I told about logbitp?!
"Thomas F. Burdick&q  2008-05-12 11:31:31 
Re: Why wasn't I told about logbitp?!
Ken Tilton <kennytilto  2008-05-12 14:56:53 
Re: Why wasn't I told about logbitp?!
Leandro Rios <leandrop  2008-05-12 20:58:14 
Re: Why wasn't I told about logbitp?!
Ken Tilton <kennytilto  2008-05-12 21:25:58 
Re: Why wasn't I told about logbitp?!
Leandro Rios <leandrop  2008-05-12 23:11:15 
Re: Why wasn't I told about logbitp?!
Pascal Costanza <pc@[E  2008-05-13 10:13:47 
Re: Why wasn't I told about logbitp?!
GP lisper <spambait@[E  2008-05-13 15:52:29 
Re: Why wasn't I told about logbitp?!
Espen Vestre <espen@[E  2008-05-09 08:01:27 
Re: Why wasn't I told about logbitp?!
Slobodan Blazeski <slo  2008-05-09 00:42:00 
Re: Why wasn't I told about logbitp?!
Ken Tilton <kennytilto  2008-05-09 06:24:44 
Re: Why wasn't I told about logbitp?!
Espen Vestre <espen@[E  2008-05-09 12:41:43 
Re: Why wasn't I told about logbitp?!
Espen Vestre <espen@[E  2008-05-09 13:49:07 
Re: Why wasn't I told about logbitp?!
"Frank \"frgo\&  2008-05-09 22:50:10 
Re: Why wasn't I told about logbitp?!
=?UTF-8?Q?Stanis=C5=82aw?  2008-05-10 21:13:18 
Re: Why wasn't I told about logbitp?!
Kent M Pitman <pitman@  2008-05-11 00:48:31 
Re: Why wasn't I told about logbitp?!
Tayssir John Gabbour <  2008-05-16 15:12:37 
Re: Why wasn't I told about logbitp?!
usenet1.3.CalRobert@[EMAI  2008-05-08 23:52:20 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Oct 11 2:04:54 CDT 2008.