[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #65275] The anonymous functions ignore the env
From: |
vasiliy |
Subject: |
[Octave-bug-tracker] [bug #65275] The anonymous functions ignore the environment |
Date: |
Thu, 8 Feb 2024 12:10:24 -0500 (EST) |
URL:
<https://savannah.gnu.org/bugs/?65275>
Summary: The anonymous functions ignore the environment
Group: GNU Octave
Submitter: vasiliy22
Submitted: Чт 08 фев 2024 17:10:24
Category: Interpreter
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: WTF, Matlab?!?
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Release: 5.2.0
Discussion Lock: Any
Operating System: GNU/Linux
Fixed Release: None
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Чт 08 фев 2024 17:10:24 By: vasiliy <vasiliy22>
The anonymous functions don't have a behaviour they was created for.
For example, they inherit the environment only at the moment of creation:
k = 2;
f = @(x) k*x;
f(2) # 4
k = 3;
f(2) # 4
but the second result should be 6. The desired behaviour is the essenstial for
the lambda functions in that sense. This behaviour have python, Go, etc.
Yes, MATLAB has this bad stuff. But it would be cool if octave would have an
option not to inherit all of uglies from MATLAB.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?65275>
_______________________________________________
Сообщение отправлено по Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #65275] The anonymous functions ignore the environment,
vasiliy <=