Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syntax: functions require return type. remove -> #720

Merged
merged 1 commit into from Jan 25, 2018

Conversation

andrewrk
Copy link
Member

@andrewrk andrewrk commented Jan 25, 2018

The purpose of this is:

  • Only one way to do things
  • Changing a function with void return type to return a possible
    error becomes a 1 character change, subtly encouraging
    people to use errors.

See #632

Here are some imperfect sed commands for performing this update:

remove arrow:

sed -i 's/\(\bfn\b.*\)-> /\1/g' $(find . -name "*.zig")

add void:

sed -i 's/\(\bfn\b.*\))\s*{/\1) void {/g' $(find . -name "*.zig")

Some cleanup may be necessary, but this should do the bulk of the work.


Any objections before I pull the trigger on this?

The purpose of this is:

 * Only one way to do things
 * Changing a function with void return type to return a possible
   error becomes a 1 character change, subtly encouraging
   people to use errors.

See #632

Here are some imperfect sed commands for performing this update:

remove arrow:

```
sed -i 's/\(\bfn\b.*\)-> /\1/g' $(find . -name "*.zig")
```

add void:

```
sed -i 's/\(\bfn\b.*\))\s*{/\1) void {/g' $(find ../ -name "*.zig")
```

Some cleanup may be necessary, but this should do the bulk of the work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant