GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing tutorial.xgo.dev — XGo by Tutorials: Errors ErrorsIn XGo it’s idiomatic to communicate errors via an explicit, separate return value. This contrasts with the exceptions used in languages like Java and Ruby and the overloaded single result / error value sometimes used in C. XGo’s approach makes it easy to see which functions return errors and to handle them using the same language constructs employed for any other, non-error tasks. By convention, errors are the last return value and
have type
A It’s possible to use custom types as In this case we use The two loops below test out each of our
error-returning functions. Note that the use of an
inline error check on the If you want to programmatically use the data in a custom error, you’ll need to get the error as an instance of the custom error type via type assertion. Next example: Function Values |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |