Changes between Version 13 and Version 14 of BitwiseCowan
 Timestamp:
 08/29/16 17:26:50 (12 months ago)
Legend:
 Unmodified
 Added
 Removed
 Modified

BitwiseCowan
v13 v14 12 12 consistent, portable set of ''names'' and ''parameter conventions'', however, is. 13 13 14 Hence this SRFI, which is based mainly on [http://srfi.schemers.org/srfi33/srfi33.html SRFI 33], with some changes and additions from [http://srfi.schemers.org/srfi33/mailarchive/msg00023.html Olin's late revisions to SRFI 33] (which were never consummated) and a few procedures from [http://srfi.schemers.org/srfi60/srfi60.html SRFI 60] and 14 Hence this SRFI, which is based mainly on [http://srfi.schemers.org/srfi33/srfi33.html SRFI 33], with some changes and additions from [http://srfi.schemers.org/srfi33/mailarchive/msg00023.html Olin's late revisions to SRFI 33] (which were never consummated). 15 SRFI 33 was never finalized, but is a reasonably comprehensive proposal. 16 A few procedures have been added from [http://srfi.schemers.org/srfi60/srfi60.html SRFI 60] and 15 17 the general vector [http://srfi.schemers.org/srfi133/srfi133.html SRFI 133]. 16 SRFI 33 was never finalized, but is a reasonably comprehensive proposal.17 18 SRFI 60 (based on SLIB) is smaller but has a few procedures of its own; 18 19 some of its procedures have both native (often CL) and SRFI 33 names. … … 147 148 * The procedures `copybit`, `integer>list` and `list>integer` are incorporated into this SRFI unchanged. 148 149 149 * The procedure `booleans>integer` is a convenient way to specify a bitwise integer in the absence of datum syntax: it accepts an arbitrary number of boolean arguments and returns a nonnegative integer. So in this SRFI it has the short name `bits`, roughly analogous to `list`, `string`, and `vector`.150 * The procedure `booleans>integer` is a convenient way to specify a bitwise integer: it accepts an arbitrary number of boolean arguments and returns a nonnegative integer. So in this SRFI it has the short name `bits`, roughly analogous to `list`, `string`, and `vector`. 150 151 151 152 === Other sources === … … 432 433 Returns ''i'' with the order of the bits in the selected field reversed. 433 434 434 `(bitfieldappend ` { ''i start end '' }`)`435 436 The number of arguments must bea multiple of three. The field specified437 by each triple of (''i, start, end'')arguments is extracted, and the435 `(bitfieldappend `''i start end'' ...`)` 436 437 It is an error if the number of arguments is not a multiple of three. The field specified 438 by each triple of ''i start end'' arguments is extracted, and the 438 439 fields are concatenated in lefttoright order and returned as an integer. 439 440 440 441 === Bits as booleans === 441 442 442 `(integer>list `''i'' [ ''len'' ]`)` 443 444 Returns a list of ''len'' booleans corresponding to each bit of the nonnegative integer ''i''. 443 `(integer>list `''i'' [ ''len'' ]`)`[[BR]] 444 `(integer>vector `''i'' [ ''len'' ]`)` 445 446 Returns a list/vector of ''len'' booleans corresponding to each bit of the nonnegative integer ''i''. 445 447 `#t` is returned for each 1; `#f` for 0. The len argument defaults to `(integerlength `''i''`)`. 446 448 449 `(list>integer `''list''`)`[[BR]] 447 450 `(list>integer `''list''`)` 448 451 449 Returns an integer formed from the booleans in ''list '';450 it is an error if ''list '' contains nonbooleans.452 Returns an integer formed from the booleans in ''list/vector''; 453 it is an error if ''list/vector'' contains nonbooleans. 451 454 A 1 bit is coded for each `#t`; a 0 bit for `#f`. 452 455 Note that the result is never a negative integer. 453 `integer>list` and `list>integer` are inverses in the sense of `equal?`. 456 `integer>list` and `list>integer` are inverses in the sense of `equal?`, 457 and so are `integer>vector` and `vector>integer`. 454 458 455 459 `(bits `''bool'' ...`)` … … 523 527 Replace bit field`dpb``replacebitfield``bitfieldreplace``copybitfield``bitwisecopybitfield``bitfieldreplace` 524 528 Replace corresponding bit field`depositfield``depositfield``copybitfield``bitfieldcopysame` 525 Fill bit field bitfieldfill529 Fill bit field`bitfieldfill` 526 530 Rotate bit field`rotatebitfield``bitwiserotatebitfield``bitfieldrotate` 527 531 Reverse bit field`reversebitfield``bitwisereversebitfield``bitfieldreverse` 528 532 Append bit fields`bitfieldappend` 529 533 Integer to boolean list`integer>list``integer>list` 534 Integer to boolean vector`integer>vector` 530 535 Boolean list to integer`list>integer``list>integer` 536 Boolean vector to integer`vector>integer` 531 537 Booleans to integer`booleans>integer``bits` 532 Bitwise fold`bitwisefold` 538 Bitwise fold`bitwisefold` 533 539 Bitwise foreach`bitwiseforeach` 534 540 Bitwise unfold`bitwiseunfold`