Historical Deprecated40, Revision 3

Deprecated Items in 4.0

Include Files

This may sound drastic, but all include/*.e are deprecated. With 4.0 comes a newly organized standard library that is located in include/std. To use, you simply:

include std/sequence.e
include std/datetime.e as dt
include std/map.e as map

for example.

platform()

Platform has not been deprecated however it's use will slowly dwindle as we have a better construct now that does platform checks as well as conditional compilation. ifdef is superior to platform(). An example replacement of platform():

include misc.e

if platform() = LINUX then
    puts(1, "Linux\n")
elsif platform() = WIN32 then
    puts(1, "Windows\n")
elsif platform() = DOS32 then
    puts(1, "DOS\n")
else
    puts(1, "Unknown OS\n")
end if

New code:

include misc.e

ifdef LINUX then
    puts(1, "Linux\n")
elsifdef WIN32 then
    puts(1, "Windows\n")
elsifdef DOS32 then
    puts(1, "DOS\n")
else
    puts(1, "Unknown OS\n")
end ifdef

For all the benefits of ifdef please see the new 4.0 Manual.

db_fatal_id

This was made available by database.e in order to set the fatal error handler. If well behaved, it should present user with the error message it received, clean up as much as possible, and then abort. But nothing was enforcing good behavior.

Old code:

procedure db_handler(sequence error_msg)
   puts(2, error_msg)
   flush(db_current())
   close(db_current())
   abort(1)
end procedure

db_fatal_id = routine_id("db_handler")

New code:

procedure db_handler(sequence error_msg)
   puts(2, error_msg)
   flush(db_current())
   close(db_current())
   abort(1)
end procedure

include std/error.e
crash_routine(routine_id("db_handler"))

Search



Quick Links

User menu

Not signed in.

Misc Menu