Unimplemeted feature message

Paolo Redaelli <[email protected]>
Newsgroups gmane.comp.lang.eiffel.gobo.general
Message-ID <1108625302.24829.25.camel@barnard>
I'm doing some work on the GTK wrappers, part of the Eiffel Wrapper
Generator (http://ewg.sf.net). I would like to insert some features in
the GTK2 wrap without implementation, for those unlikely to be used,
that I want to implement later or leave to other people.

The naive way to do is
feature foo is 
        do
                -- TODO: unimplemented
        end

This way you have to grep the sources to find it must be implemented.
Then we do:
feature foo is 
        do
                check todo: False end
        end

This way with DbC activated (i.e.: not in boost mode just to use a
SmartEiffelism 8) you catch it and the user is informed. 

I've seen a nice (hidden) feature in SE 2.1 (in general.e):
  not_yet_implemented is
    do
      sedb_breakpoint
      std_error.put_string("Some message like: Sorry, unimplemented!")
      crash
    end

This will be highly desiderable, since it always works. What's the
portable way to write it? It should be raise from EXCEPTIONS, but it is
not acceptable, since it doesn't work with DbC disabled (boost mode/
production code); see the following program:
class EXTEST
inherit EXCEPTIONS
creation make
feature make is do raise ("Unimplemented!") end
end

Compiled in boost mode (with SE 2.1) gets:
Eiffel program crash at run time.
No trace when using option "-boost"

That doesn't fit the need to clearly show that there's an unimplemented
feature.

The question is: do ISE and Visual Eiffel has some "crash" feature? Can
"die" be a reasonable, portable solution? For example:

feature unimplemented is 
  do
    print ("unimplemented feature")
    die(5)
  end 

-- 5 is "random"; otherwise 
feature unimplemented (a_message: STRING) is 
  do
    print ("unimplemented feature: ") print (a_message)
    die(5)
  end 


Cheers
        Paolo




To Post a message, send it to:   [email protected]
To Unsubscribe, send a blank message to: [email protected] 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/gobo-eiffel/

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.