Hi,

Is there an idiom for ignoring possible multiple values? For example, if
I have a function foo() that may or may not return multiple values where
values after the first one provide some extra information (eg a
condition number on an operation, etc), but I am not necessarily
interested in it -- however, if I do

x = foo()

the whole tuple is retained in x. I find I can do

x, = foo()

which works, but I will need to remember the comma.

I am looking for something similar to Common Lisp's default behavior, eg

(defun foo ()
  (values 1 2))

(let ((x (foo)))                ; don't care if foo return multiple values
  x)                            ; => 1

but I could not find anything similar in Julia.

best,

Tamas

Reply via email to