[Slackers] Sort-of Slang 1.2 is on the page

Jaymz Julian jaymz at artificial-stupidity.net
Sun Feb 19 00:21:38 CST 2006


> Pointers: Slang v1.2 now features pointers:
> 
> 	ubyte ^byteptr		;create a 16-bit pointer to a ubyte
> 	int ^test2(20,30)	;create a 16-bit pointer to an array of ints
> 	ubyte ^^longptr		;create a 24-bit pointer to a ubyte

Great!  One bug report, though - the following code works as expected:

ubyte ^screen
uint j
screen=$0400
for j=0:1024
        ^screen=1
        screen=screen+1
next
waitchar

However, the more readable (and less percarious, and probably
more performant) version of:

ubyte ^screen(1024)
uint j
screen=$0400
for j=0:1024
        ^screen(j)=1
next
waitchar

Fails it with an error on the 'screen=$0400' demanding a dimension.  And if you 
give it one, then it fails on "^screen(j)=1" with a "uhm, that's not a pointer"
error.

	--jj

-- 
--
Jaymz Julian - Coder, Visionary, Fat Ass.
"Hannibal is a serial killer. He only likes to kill and eat people. 
 Very few people have `I want to be killed and eaten' on their cards, 
 so Hannibal is out of a job." - http://cards.sf.net


More information about the Slackers mailing list