REBOL3 tracker
  0.9.12 beta
Ticket #0001562 User: anonymous

Project:



rss
TypeBug Statusbuilt Date11-Apr-2010 14:57
Versionalpha 97 CategoryExtensions Submitted bymeijeru
PlatformAll Severityminor Prioritynormal

Summary date! value not correctly passed to extension
Description I have written an extension with a command which does nothing but return the value it is passed, as an integer. This should allow me to verify some of the bit-level encodings that to-binary will not show me. It works for pair!, time!, tuple!. When I pass it a date! value the result is 0 (zero) for a date literal or evaluated word, and an arbitrary number (not reproducible) for a function result like NOW/DATE.
Example code
(init-block)
REBOL [
    title: {Caster extension}
    name: caster
    type: extension
    exports: [int-cast]
]
int-cast: command [{Cast any value to integer} v]
(RX_Call)
RXIEXT int RX_Call(int cmd, RXIFRM *frm) {
	RXA_TYPE(frm,1) = RXT_INTEGER;
	return RXR_VALUE;
}
(application)
>>probe to-binary int-cast now/date
== ;; arbitrary number

Assigned ton/a Fixed inalpha 108 Last Update21-Sep-2010 18:38


Comments
(0002289)
Carl
1-May-2010 04:41

Sorry, you must wait until it's been defined. Pending.
(0002291)
meijeru
1-May-2010 11:17

Strange... The documentation says it is usable! Moreover, when I pass a date value inside a block, it works perfectly! That is how I discovered the encoding: 2 bits free, 14 bits year, 4 bits month, 5 bits day, 7 bits time zone (adds up to 32).

Date User Field Action Change
21-Sep-2010 18:38 carl Fixedin Modified => alpha 108
21-Sep-2010 18:38 carl Status Modified deferred => built
1-May-2010 11:17 meijeru Comment : 0002291 Added -
1-May-2010 04:41 carl Comment : 0002289 Added -
1-May-2010 04:41 carl Status Modified submitted => deferred
18-Apr-2010 19:55 BrianH Category Modified Unspecified => Extensions
13-Apr-2010 09:54 meijeru Description Modified -
11-Apr-2010 15:36 meijeru Code Modified -
11-Apr-2010 14:57 meijeru Ticket Added -