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

abs-lang / abs / 1414 / 3
76%
master: 63%

Build:
Build:
LAST BUILD BRANCH: 2.8.x
DEFAULT BRANCH: master
Ran 13 May 2020 09:43PM UTC
Files 9
Run time 1s
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:37PM UTC coverage: 75.535% (+0.9%) from 74.606%
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()
```

3600 of 4766 relevant lines covered (75.54%)

81.55 hits per line

Source Files on job 1414.3 (GO111MODULE=on CONTEXT=abs)
  • Tree
  • List 0
  • Changed 9
  • Source Changed 9
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 1088
  • Travis Job 1414.3
  • f0bb2722 on github
  • Prev Job for GO111MODULE=on CONTEXT=abs on default-args-for-functions (#1410.1)
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

© 2026 Coveralls, Inc