Return values for open() and define_c_*()

new topic     » topic index » view thread      » older message » newer message

I have a suggestion,
how if open() returns the C file handle (on windows and linux),
define_c_*() and routine_id() returns the memory address (as it is now
with call_back()).

But still return -1 when there is a failure.

Why?
- Won't break existing code

  (we usually write
     fn = open(...)
     if fn = -1 then error -- or if fn < 0 then error
     
     something = define_c_func(...)
     if something = -1 then error
  don't we?)

- Easier interface with windows API that requires a file handle or
  callback function (we dont have to open() the file using Windows
  API)

- Faster execution (eu interpreter don't have to translate the
  routineid/filenumber into an internal representation)

- call_back() can be replaced easily with:
  function call_back(object x) return x end function

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu