From 1880f7a2fed157220dd485f9e8ccd9f546996978 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Mon, 5 Jul 2021 00:06:15 +0530 Subject: doc: Add python named arguments example. * doc/ccwl.skb (Tutorial)[Important concepts]: Add python named arguments example. --- doc/ccwl.skb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'doc/ccwl.skb') diff --git a/doc/ccwl.skb b/doc/ccwl.skb index b15f861..80ed7c1 100644 --- a/doc/ccwl.skb +++ b/doc/ccwl.skb @@ -56,11 +56,14 @@ function is significant. The position of each argument determines which formal argument it gets mapped to. For example, passing positional arguments in Scheme looks like]) (prog :line #f [(foo 1 2)]) - (p [In a language that supports named arguments, the order of -arguments is not significant. Each argument explicitly names the -formal argument it gets mapped to. For example, in Scheme, passing -named arguments may look like] - (prog :line #f [(foo #:bar 1 #:baz 2)]))) + (p [However, in a language that supports named arguments (say, +Scheme or Python), the order of arguments is not significant. Each +argument explicitly names the formal argument it gets mapped to. For +example, in Scheme, passing named arguments may look like ,(code "(foo +#:bar 1 #:baz 2)") and is equivalent to ,(code "(foo #:baz 2 #:bar +1)"). Likewise, in Python, passing named arguments looks like +,(code "foo(bar=1, baz=2)") and is equivalent to ,(code "foo(baz=2, +bar=1)").])) (subsection :title [Multiple function arguments and return values] (p [In most languages, functions accept multiple input arguments but only return a single output value. However, in CWL, a -- cgit v1.2.3