Rob Donnelly
Rob Donnelly

Reputation: 2326

Does Julia have something equivalent to Ans (Matlab) or Last.value (R)

Matlab and R both have variables that are automatically assigned to the (Ans and Last.value respectively).

Is there an equivalent for Julia?

e.g.

function myBigSlowFunc()
    sleep(10)
    return(5)
end
myBigSlowFunc()
# Can I get the value that was returned without rerunning the function?

Upvotes: 2

Views: 204

Answers (1)

Reza Afzalan
Reza Afzalan

Reputation: 5746

If you are at the repl you can use ans (just like matlab)

Upvotes: 4

Related Questions