• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

abs-lang / abs / 1409 / 1
76%
master: 63%

Build:
Build:
LAST BUILD BRANCH: 2.8.x
DEFAULT BRANCH: master
Ran 13 May 2020 09:36PM UTC
Files 9
Run time 2s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

13 May 2020 09:34PM UTC coverage: 74.606%. Remained the same
GO111MODULE=on CONTEXT=abs

push

travis-ci-com

odino
Default values for function parameters, closes #368

This PR adds the ability to specify default values for function
arguments.

Optional parameters need to come right after mandatory ones:

```
⧐  f test(x = 1, y){}
 parser errors:
	found mandatory parameter after optional one
	[1:15]	f test(x = 1, y){}
```

and they can use any kind of expression:

```
⧐  f test(x = 1){ x }; test()
1
⧐  f test(x = []){ x }; test()
[]
⧐  f test(x = {}){ x }; test()
{}
⧐  f test(x = 1..10){ x }; test()
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
```

If a mandatory argument is not passed, ABS will now give you a more
detailed message:

```
⧐  f test(x){ x }; test()
ERROR: argument x to function f test(x) {x} is missing, and doesn't have a default value
	[1:1]	f test(x){ x }; test()
```

3552 of 4761 relevant lines covered (74.61%)

81.12 hits per line

Source Files on job 1409.1 (GO111MODULE=on CONTEXT=abs)
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 1083
  • Travis Job 1409.1
  • b793e47c on github
  • Prev Job for GO111MODULE=on CONTEXT=abs on default-args-for-functions (#1407.1)
  • Next Job for GO111MODULE=on CONTEXT=abs on default-args-for-functions (#1410.2)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc