home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / lisp / mcl / 1666 < prev    next >
Encoding:
Internet Message Format  |  1992-11-23  |  1.0 KB

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!ames!data.nas.nasa.gov!taligent!apple!cambridge.apple.com!jbk@world.std.com
  2. From: jbk@world.std.com (Jeffrey B Kane)
  3. Newsgroups: comp.lang.lisp.mcl
  4. Subject: Binary manipulation
  5. Message-ID: <199211231630.AA27869@world.std.com>
  6. Date: 23 Nov 92 16:30:46 GMT
  7. Sender: info-mcl-request@cambridge.apple.com
  8. Lines: 29
  9. Approved: comp.lang.lisp.mcl@Cambridge.Apple.C0M
  10.  
  11.  
  12. What is the best way to do binary manipulation of data within MCL?
  13. I need to do the equivalent of shifts, ands, nors, ors, etc., but the problem
  14. I'm having is doing these with integers and fixnums  How would you convert the following
  15. to mcl:
  16.  
  17. {
  18.     short var1 47;
  19.     unsigned long var2 0x322459;
  20.  
  21.     *((var1 & 0x7 << 3) + var2)
  22. }
  23.  
  24. going back and forth between MCL fixnum and bit-arrays (without losing data)?
  25.  
  26.     Jeffrey
  27.  
  28.  
  29. ======================================
  30. Jeffrey Kane, MD
  31. Kane Biomedical Systems
  32. Boston, MA
  33.  
  34. Internet    jbk@world.std.com
  35. Compuserve  74206,640
  36. AppleLink   D0738
  37.  
  38. [Don't take life too seriously... it's not like anyone gets out of it alive.]
  39.     
  40.