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 > Basic General > Re: Rewrite BAS...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 5 Topic 668 of 684
Post > Topic >>

Re: Rewrite BASIC language today?

by Adam <no@[EMAIL PROTECTED] > Apr 28, 2008 at 11:29 AM

On Mon, 28 Apr 2008 10:06:31 -0400, Tom Lake wrote:
><news@[EMAIL PROTECTED]
> wrote in message 
>news:31393d52-f8e6-4148-9a79-2ec48a9188f2@[EMAIL PROTECTED]
>On Apr 28, 1:38 pm, ArarghMail804NOS...@[EMAIL PROTECTED]
 wrote:
>> I presume that the %'s refer to 32-bit things, not 16-bit.
>> I also presume that the "get_Width" entry point is 24 bytes past
>> "IPicture" or thereabouts.
>
>Yes, correct on both counts.
>
>> BTW, what does
>> !(^IPicture{}+4) = !gpPicture%
>> mean?
>
>The ! is equivalent to C's * (indirection) operator, and ^ is
>equivalent to C's & (address-of) operator.  What it is doing is
>modifying the address of the IPicture structure, so that instead of
>pointing to memory allocated by BASIC it's pointing to the COM
>interface's Vtable.  It's really only a cheat that allows you to use
>IPicture.get_Width rather than IPicture!24, so not fundamental to
>accessing the COM interface.
>
>
>Now THAT syntax is definitely not keeping with the spirit of BASIC!

Amen!

Address-of and indirection are "system functions", like VARPTR.  Why
not use words instead of single-character symbols for these functions?

It saves keystrokes when typing statements, but it seems to sacrifice
readability for the reduction in typing.

It allows the statement to be shorter, but brevity doesn't seem to be
a major goal in dialects which specify subroutines with the syntax:

	SUB name(byref x as int, byref y as int,  byref x as int)

Maybe OBJ32_ADDR for "object address"?  That would give three clues
economically (both when composing the program and when reading it):
1.  The argument must be an object
2.  The result is a 32-bit (unsigned?) integer
3.  The function returns a memory address

Having OBJ16_, OBJ32_, and OBJ64_ forms could nip some foreseeable
platform-incompatibility problems in the bud.

If a BASIC dialect has integers of various lengths, the programmer may
have to know (and specify) what kind of variable to use with the
"^"=address-of operator.  Providing a clue in the keyword could save a
lot of debugging time.

IIRC, ANSI BASIC uses single-character symbols only for math
operators, string concatenation, certain logical operators, and a
REMark prefix.

I don't recall whether "?"="print" is part of ANSI BASIC.

Adam
** Posted from http://www.teranews.com
**
 




 5 Posts in Topic:
Re: Rewrite BASIC language today?
"news@[EMAIL PROTECT  2008-04-28 06:21:10 
Re: Rewrite BASIC language today?
"Tom Lake" <  2008-04-28 10:06:31 
Re: Rewrite BASIC language today?
Adam <no@[EMAIL PROTEC  2008-04-28 11:29:28 
Re: Rewrite BASIC language today?
"Gordon Rahman"  2008-04-28 18:02:00 
Re: Rewrite BASIC language today?
ArarghMail804NOSPAM@[EMAI  2008-04-28 17:03:30 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Tue Oct 7 12:46:00 CDT 2008.