Author Topic: alias key word  (Read 4966 times)

0 Members and 1 Guest are viewing this topic.

Emil_halim

  • Guest
alias key word
« on: April 26, 2013, 09:13:01 AM »
Hi Charles,

can you please allow this
Code: [Select]
! Init  "_Init@4" (char* Titel)

instead of this
Code: [Select]
! Init alias "_Init@4" (char* Titel)

so alias will be optional to write or not.

thanks

Emil_halim

  • Guest
Re: alias key word
« Reply #1 on: April 26, 2013, 10:49:00 AM »
Hi Peter,

with only one line there is no problem.

but with my MagicPro library i want it.

Aurel

  • Guest
Re: alias key word
« Reply #2 on: April 26, 2013, 01:26:11 PM »
I don't see what is wrong with Alias, and alias exists because of difference. ::)

Emil_halim

  • Guest
Re: alias key word
« Reply #3 on: April 26, 2013, 09:43:26 PM »
Aurel,

it is ' better for the sake of simplicity , easy & fast to allow things to be shorter without repeating.

SO see this
Code: [Select]
! _Init@4 Lib "magicPro.dll" (char* Titel)
! _........@4 Lib "magicPro.dll" (char* Titel)
! _........@4 Lib "magicPro.dll" (char* Titel)
! _........@4 Lib "magicPro.dll" (char* Titel)
.............
.............
.............
 
is it better than this
Code: [Select]
extern lib "magicPro.dll"
! Init = "_Init@4" (char* Titel)
or
! Init  "_Init@4" (char* Titel)
!......
!......
end extern

all things that l want to make alias to be optional or can be replaced with "=" or  " "

thanks.
 

Charles Pegge

  • Guest
Re: alias key word
« Reply #4 on: April 27, 2013, 01:35:41 AM »
Hi Emil, I like the idea, and I think it can be implemented quite easily, without interfering with the existing alias syntax.

Aurel

  • Guest
Re: alias key word
« Reply #5 on: April 27, 2013, 02:53:45 AM »
I know that is simplier without alias and i when is possible don't use alias.
But in some cases alias is fine , and for the sake Allias is used in many source codes around.
I prefer tipycal BASIC syntax over other things . 

Emil_halim

  • Guest
Re: alias key word
« Reply #6 on: April 27, 2013, 07:33:12 AM »
Hi Chrales ,

thanks you for your responding.

Hi Aurel,

it will be optional , so you can use it as you prefer.   

Charles Pegge

  • Guest
Re: alias key word
« Reply #7 on: April 27, 2013, 08:03:59 AM »
The main risk is turning OxygenBasic into a honey-trap. Simplified syntax, but harder to export to other, more pedantic languages.

Emil_halim

  • Guest
Re: alias key word
« Reply #8 on: April 27, 2013, 08:10:03 AM »
yes there may be a risk.

BUT , it is optional which means that Oxygen can be customized as any one want , and that is the power
of Oxygen.

so optional also means you can use it as the usual using. 

JRS

  • Guest
Re: alias key word
« Reply #9 on: April 27, 2013, 09:59:10 AM »
Quote
The main risk is turning OxygenBasic into a honey-trap.

THEN as an optional keyword makes porting to ScriptBasic for example an extra inclusion step.

Talking about flexibility and options, do you think O2 should care if it references an array element as a function and assumes the programmer was just being a dummy? How about not requiring any further concatenation operators once the intension is made? ( PRINT a + b c   )

Thankfully when trying to load these homomorphic examples of BASIC, SB just drops to the prompt and laughs.

Aurel

  • Guest
Re: alias key word
« Reply #10 on: April 27, 2013, 12:32:05 PM »
Some syntax options which Charles create i like very much BUT tend to create
some sort of C / basic mutant I simply don't like.. >:(
especialy when we comes to this {} mambo-jambo...
I think that Charles use right combination with liberal syntax
and to many options many times will confuse other people,right?

What i would like is to remove () with array like arr(n) I would like to see
only arr[n] and that myArr(n) be used only for functions.

Emil_halim

  • Guest
Re: alias key word
« Reply #11 on: April 29, 2013, 07:26:26 AM »
Hi Charles,

Quote
I like the idea, and I think it can be implemented quite easily

have you made any progress here?

Charles Pegge

  • Guest
Re: alias key word
« Reply #12 on: April 29, 2013, 09:38:39 AM »
Yes, nearly ready. I have a few more tests to do.

from MinWin.inc:

Code: OxygenBasic
  1.   '=========================
  2.  'UNPROTOTYPED DECLARATIONS
  3.  '=========================
  4.  
  5.   extern lib "Kernel32.dll"
  6.   ! QueryPerformanceCounter                 '1
  7.  ! QueryPerformanceFrequency                     '1
  8.  ! AllocConsole                                  '0
  9.  ! AttachConsole                                 '1
  10.  ! FreeConsole                                   '0
  11.  ! SetConsoleTitle    "SetConsoleTitleA"         '1
  12.  ! GetConsoleMode                                '2
  13.  ! SetConsoleMode                                '2
  14.  ! ReadConsoleInput   "ReadConsoleInputA"        '4
  15.  ! GetCommandLine     "GetCommandLineA"          '0
  16.  ! GetModuleHandle    "GetModuleHandleA"         '1
  17.  ! GetModuleFileName  "GetModuleFileNameA"       '3
  18.  ! GetStdHandle                                  '1
  19.  ! GetLastError                                  '0
  20.  ! SetLastError                                  '1
  21.  ! CreateProcess      "CreateProcessA"           '10
  22.  ! ExitProcess                                   '1
  23.  ! Sleep                                         '1
  24.  ! CreatePipe                                    '4
  25.  ! CreateThread                                  '6
  26.  ! WaitForMultipleObjects                        '4
  27.  ! CloseHandle                                   '1
  28.  ! GlobalAlloc                                   '2
  29.  ! GlobalReAlloc                                 '3
  30.  ! GlobalLock                                    '1
  31.  ! GlobalUnlock                                  '1
  32.  ! GlobalFree                                    '1
  33.  ! FindFirstFile       "FindFirstFileA"          '2
  34.  ! FindNextFile        "FindNextFileA"           '2
  35.  ! FindClose                                     '1
  36.  ! CreateFile          "CreateFileA"             '7
  37.  ! ReadFile                                      '5
  38.  ! WriteFile                                     '5
  39.  ! DeleteFile          "DeleteFileA"             '1
  40.  ! CreateDirectory     "CreateDirectoryA"        '1
  41.  ! RemoveDirectory     "RemoveDirectoryA"        '1
  42.  ! SetHandleInformation                          '3
  43.  ! GetFullPathName     "GetFullPathNameA"        '4
  44.  ! GetCurrentDirectory "GetCurrentDirectoryA"    '2
  45.  ! SetCurrentDirectory "SetCurrentDirectoryA"    '1
  46.  ! BeginUpdateResource "BeginUpdateResourceA"    '2
  47.  ! UpdateResource      "UpdateResourceA"         '6
  48.  ! EndUpdateResource   "EndUpdateResourceA"      '2
  49.  end extern
  50.  
« Last Edit: April 29, 2013, 09:53:02 AM by Charles Pegge »