Page 1 of 1

a wishlist

Posted: Sun Apr 01, 2007 10:55 am
by Leonhard
1. Virtual Pointer:

Code: Select all

Define (*)Pointer.String = AllocateMemory(SizeOf(String))

Pointer\s = "Hello, World!"

Debug Pointer
2. expression-pointer with datatype:

Code: Select all

DataSection 
  label:
    Data.l ?label_2
  label_2:
    Data.s "Hello, World!"
EndDataSection

Debug (?label).String\s ;/ Give "Hello, World!"
3. complex macros:

Code: Select all

MacroX List "NewXArray" name.StructureName(Elements) ;/ Create a list of Elements
  Code: ;/ the intern Macro-Code
    Macro name(useElements)
      (name+(SizeOf(StructureName)*useElements)).StructureName
    EndMacro
  
  Free: ;/ by 'End' call
    FreeMemory(name)
  
  Return: ;/ return of the Macro
    (*)name.StructureName = AllocateMemory(SizeOf(StructureName)*(Elements + 1))
EndMacroX

Define NewXArray MyArray.String(1) ;Define (*)MyArray.String = AllocateMemory(SizeOf(String)*(1 + 1))

MyArray(0)\s = "Hello" ; (MyArray+(SizeOf(String)*0)).String
MyArray(1)\s = "World" ; (MyArray+(SizeOf(String)*1)).String

End 1 ; FreeMemory(MyArray)

Posted: Mon Apr 02, 2007 8:22 am
by Chrono Syndrome
Interesting ideas...

Posted: Wed Apr 04, 2007 4:16 pm
by Leonhard
Comments?

Posted: Wed Apr 04, 2007 5:10 pm
by Rescator
3. complex macros:
is very close to how a procedure works (esp. the return part)

Posted: Sat Apr 14, 2007 12:33 pm
by Leonhard
Whis this macros can you create new keywords!

Procedures are not so optimized.

Posted: Sat Apr 14, 2007 2:09 pm
by Trond
Procedures are not so optimized.
What do you mean?

Posted: Sat Apr 14, 2007 8:29 pm
by Leonhard
Procedures must you write the Parameters in the steak. At Macros is it not so.