Skip to content

Commit

Permalink
fix #488 new overloading
Browse files Browse the repository at this point in the history
allows to overload all types including basic types (as double :p)
  • Loading branch information
Nelson-numerical-software committed Sep 6, 2023
1 parent 1ad7d79 commit 8615ad8
Show file tree
Hide file tree
Showing 820 changed files with 5,115 additions and 7,967 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,6 @@ jobs:
needs: Jammy

steps:
- name: Trust repo directory
run: |
pacman -Sy --noconfirm
pacman -S git --noconfirm
git config --global --add safe.directory /__w/nelson/nelson
- name: Checkout repository
uses: actions/checkout@v3
- name: Install dependencies
run: |
pacman -Syu --noconfirm
Expand Down Expand Up @@ -429,6 +422,13 @@ jobs:
pacman -S eigen --noconfirm
pacman -S hdf5 --noconfirm
pacman -S libmatio --noconfirm
- name: Checkout repository
uses: actions/checkout@v3

- name: Trust repo directory
run: |
git config --global --add safe.directory /__w/nelson/nelson
- name: Get package version
uses: myrotvorets/info-from-package-json-action@1.2.0
id: json_version
Expand Down
26 changes: 15 additions & 11 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Changed

- all operators were reworked to support compatible overload.
- Boost 1.82 used on Windows.
- [#488](http://github.com/Nelson-numerical-software/nelson/issues/488) overloading functions:

- all types including basic types can be overloaded.
- overload is now fully compatible using '@' syntax and precedence.
- all operators were reworked to support compatible overload.

- Internals:
- `class`, `function_handle` types reworked.
Expand All @@ -18,6 +21,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- functions finder reworked.
- file watcher reworked.
- operators reworked.
- Boost 1.82 used on Windows.

## 0.7.5 (2023-05-27)

Expand All @@ -36,7 +40,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Added

- Qt 6.5 support.
- [802](http://github.com/Nelson-numerical-software/nelson/issues/802): `bitand`, `bitor`, `bitxor` functions.
- [#802](http://github.com/Nelson-numerical-software/nelson/issues/802): `bitand`, `bitor`, `bitxor` functions.
- `issorted` Determine if array is sorted.
- `num2cell` Convert array to cell array with consistently sized cells.
- `hggroup` Create group object.
Expand Down Expand Up @@ -68,7 +72,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

- `weboptions` did not manage HeaderFields as expected.
- update `cacert.pem`.
- [895](http://github.com/Nelson-numerical-software/nelson/issues/895): Micromamba linux build fails after packages updates.
- [#895](http://github.com/Nelson-numerical-software/nelson/issues/895): Micromamba linux build fails after packages updates.

## 0.7.3 (2023-03-28)

Expand All @@ -78,7 +82,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- `ancestor` Ancestor of graphics object.
- hexadecimal color code managed example: '#DDFF00'.
- `validatecolor` Validate color values.
- [851](http://github.com/Nelson-numerical-software/nelson/issues/851): Build with micromamba environment (linux and macOS)
- [#851](http://github.com/Nelson-numerical-software/nelson/issues/851): Build with micromamba environment (linux and macOS)

### Changed

Expand All @@ -89,10 +93,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

### Fixed

- [866](http://github.com/Nelson-numerical-software/nelson/issues/866): Close menu on figure can crash on linux.
- [#866](http://github.com/Nelson-numerical-software/nelson/issues/866): Close menu on figure can crash on linux.
- graphic hierarchy was not fully destroyed after `close` or `delete`.
- labels were not displayed correctly when the logarithmic scale was enabled.
- [869](http://github.com/Nelson-numerical-software/nelson/issues/869): missing help files in linux package.
- [#869](http://github.com/Nelson-numerical-software/nelson/issues/869): missing help files in linux package.

## 0.7.2 (2023-02-27)

Expand Down Expand Up @@ -122,9 +126,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- `drawnow`: Update figures and process callbacks.
- `DrawLater` property added to `figure` graphics object.
- `interp1` linear interpolation 1D.
- [736](http://github.com/Nelson-numerical-software/nelson/issues/736): `bone`, `cool`, `copper`, `hot`, `jet`, `pink`, `turbo`, `viridis`, `white` colormaps.
- [#736](http://github.com/Nelson-numerical-software/nelson/issues/736): `bone`, `cool`, `copper`, `hot`, `jet`, `pink`, `turbo`, `viridis`, `white` colormaps.
- `Visible` property to `figure` graphics object.
- [809](http://github.com/Nelson-numerical-software/nelson/issues/809): `NumberTitle` property to `figure` graphics object.
- [#809](http://github.com/Nelson-numerical-software/nelson/issues/809): `NumberTitle` property to `figure` graphics object.
- `AlphaMap` and `Colormap` properties added to `Axes` graphics object.
- `LineStyleOrder` property of 'axes' used for `plot` and `plot3`.
- `ColorOrderIndex` and `LineStyleOrderIndex` properties added to `axes` graphics object.
Expand All @@ -135,10 +139,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- `imwrite` Write image to graphics file.
- `imshow` Display image.
- `surface` Primitive surface plot.
- [808](http://github.com/Nelson-numerical-software/nelson/issues/808): `pcolor` Pseudocolor plot.
- [#808](http://github.com/Nelson-numerical-software/nelson/issues/808): `pcolor` Pseudocolor plot.
- `mesh` Mesh surface plot.
- `meshz` Mesh surface plot with curtain.
- [807](http://github.com/Nelson-numerical-software/nelson/issues/807): `loglog` Log-log scale plot.
- [#807](http://github.com/Nelson-numerical-software/nelson/issues/807): `loglog` Log-log scale plot.
- `CHANGELOG` 0.7.x family.

### Changed
Expand Down
22 changes: 0 additions & 22 deletions NelSon.sln
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NelSon-cli", "modules\main\
{6729833E-6451-4A37-9646-7C6BD9181819} = {6729833E-6451-4A37-9646-7C6BD9181819}
{67F9B402-4466-4FC8-9728-12A4AC61E8FA} = {67F9B402-4466-4FC8-9728-12A4AC61E8FA}
{6980295E-7B0B-48FF-9D4A-317455813471} = {6980295E-7B0B-48FF-9D4A-317455813471}
{6A3E0DBE-D2F9-41CA-9192-D3EE4570DE25} = {6A3E0DBE-D2F9-41CA-9192-D3EE4570DE25}
{6AEF4600-4B33-4148-A7CD-88A57A190ACB} = {6AEF4600-4B33-4148-A7CD-88A57A190ACB}
{6BB14A04-3507-4123-8263-4BCAF3B0ED4D} = {6BB14A04-3507-4123-8263-4BCAF3B0ED4D}
{74CC7C51-0768-41E6-A973-6159633DCFBC} = {74CC7C51-0768-41E6-A973-6159633DCFBC}
Expand All @@ -102,7 +101,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NelSon-cli", "modules\main\
{88FE1B78-3774-48C1-A925-A11C87ABBEDD} = {88FE1B78-3774-48C1-A925-A11C87ABBEDD}
{8BDE7AF5-8C8E-4B96-9D91-AD5B913569C7} = {8BDE7AF5-8C8E-4B96-9D91-AD5B913569C7}
{9067DFA1-CE20-4CAA-97E2-34D3C6A2AD7D} = {9067DFA1-CE20-4CAA-97E2-34D3C6A2AD7D}
{937BEE8B-E934-45F1-98EF-33AAF951E5E9} = {937BEE8B-E934-45F1-98EF-33AAF951E5E9}
{964FF907-D58A-48B6-A03B-3F6CF48CBE41} = {964FF907-D58A-48B6-A03B-3F6CF48CBE41}
{9858F707-35E8-4A44-ACE7-7CCDDFEE26AA} = {9858F707-35E8-4A44-ACE7-7CCDDFEE26AA}
{9AC8560A-9E4C-4430-9938-63D6377890EB} = {9AC8560A-9E4C-4430-9938-63D6377890EB}
Expand Down Expand Up @@ -246,8 +244,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nlsStream_manager_builtin",
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nlsError_manager_builtin", "modules\error_manager\builtin\c\nlsError_manager_builtin.vcxproj", "{34B4A66D-9703-400E-9F00-B595F8C72808}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nlsOverload", "modules\overload\src\c\nlsOverload.vcxproj", "{937BEE8B-E934-45F1-98EF-33AAF951E5E9}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nlsInterpreter_builtin", "modules\interpreter\builtin\c\nlsInterpreter_builtin.vcxproj", "{ADF7A34A-5D81-4F48-B972-B583210352B3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{466EA3E9-98B2-41C2-AADC-C4C798F2CDCA}"
Expand Down Expand Up @@ -288,8 +284,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nlsModules_manager", "modul
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nlsModules_manager_builtin", "modules\modules_manager\builtin\c\nlsModules_manager_builtin.vcxproj", "{EF054E75-90E8-46B3-AA42-F1C424F0DC3C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nlsOverload_builtin", "modules\overload\builtin\c\nlsOverload_builtin.vcxproj", "{6A3E0DBE-D2F9-41CA-9192-D3EE4570DE25}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nlsFunction_handle_builtin", "modules\function_handle\builtin\c\nlsFunction_handle_builtin.vcxproj", "{4AF4C1F4-4C63-4CFE-BA45-8BEC3FC2A7B8}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nlsFunction_handle", "modules\function_handle\src\c\nlsFunction_handle.vcxproj", "{B59306BA-6564-4625-98A4-B0D6492DE972}"
Expand Down Expand Up @@ -883,14 +877,6 @@ Global
{34B4A66D-9703-400E-9F00-B595F8C72808}.Release|Win32.Build.0 = Release|Win32
{34B4A66D-9703-400E-9F00-B595F8C72808}.Release|x64.ActiveCfg = Release|x64
{34B4A66D-9703-400E-9F00-B595F8C72808}.Release|x64.Build.0 = Release|x64
{937BEE8B-E934-45F1-98EF-33AAF951E5E9}.Debug|Win32.ActiveCfg = Debug|Win32
{937BEE8B-E934-45F1-98EF-33AAF951E5E9}.Debug|Win32.Build.0 = Debug|Win32
{937BEE8B-E934-45F1-98EF-33AAF951E5E9}.Debug|x64.ActiveCfg = Debug|x64
{937BEE8B-E934-45F1-98EF-33AAF951E5E9}.Debug|x64.Build.0 = Debug|x64
{937BEE8B-E934-45F1-98EF-33AAF951E5E9}.Release|Win32.ActiveCfg = Release|Win32
{937BEE8B-E934-45F1-98EF-33AAF951E5E9}.Release|Win32.Build.0 = Release|Win32
{937BEE8B-E934-45F1-98EF-33AAF951E5E9}.Release|x64.ActiveCfg = Release|x64
{937BEE8B-E934-45F1-98EF-33AAF951E5E9}.Release|x64.Build.0 = Release|x64
{ADF7A34A-5D81-4F48-B972-B583210352B3}.Debug|Win32.ActiveCfg = Debug|Win32
{ADF7A34A-5D81-4F48-B972-B583210352B3}.Debug|Win32.Build.0 = Debug|Win32
{ADF7A34A-5D81-4F48-B972-B583210352B3}.Debug|x64.ActiveCfg = Debug|x64
Expand Down Expand Up @@ -931,14 +917,6 @@ Global
{EF054E75-90E8-46B3-AA42-F1C424F0DC3C}.Release|Win32.Build.0 = Release|Win32
{EF054E75-90E8-46B3-AA42-F1C424F0DC3C}.Release|x64.ActiveCfg = Release|x64
{EF054E75-90E8-46B3-AA42-F1C424F0DC3C}.Release|x64.Build.0 = Release|x64
{6A3E0DBE-D2F9-41CA-9192-D3EE4570DE25}.Debug|Win32.ActiveCfg = Debug|Win32
{6A3E0DBE-D2F9-41CA-9192-D3EE4570DE25}.Debug|Win32.Build.0 = Debug|Win32
{6A3E0DBE-D2F9-41CA-9192-D3EE4570DE25}.Debug|x64.ActiveCfg = Debug|x64
{6A3E0DBE-D2F9-41CA-9192-D3EE4570DE25}.Debug|x64.Build.0 = Debug|x64
{6A3E0DBE-D2F9-41CA-9192-D3EE4570DE25}.Release|Win32.ActiveCfg = Release|Win32
{6A3E0DBE-D2F9-41CA-9192-D3EE4570DE25}.Release|Win32.Build.0 = Release|Win32
{6A3E0DBE-D2F9-41CA-9192-D3EE4570DE25}.Release|x64.ActiveCfg = Release|x64
{6A3E0DBE-D2F9-41CA-9192-D3EE4570DE25}.Release|x64.Build.0 = Release|x64
{4AF4C1F4-4C63-4CFE-BA45-8BEC3FC2A7B8}.Debug|Win32.ActiveCfg = Debug|Win32
{4AF4C1F4-4C63-4CFE-BA45-8BEC3FC2A7B8}.Debug|Win32.Build.0 = Debug|Win32
{4AF4C1F4-4C63-4CFE-BA45-8BEC3FC2A7B8}.Debug|x64.ActiveCfg = Debug|x64
Expand Down
9 changes: 3 additions & 6 deletions modules/assert_functions/builtin/cpp/Gateway.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,9 @@ using namespace Nelson;
const std::wstring gatewayName = L"assert_functions";
//=============================================================================
static const nlsGateway gateway[] = {
{ "assert_istrue", (ptrBuiltin)Nelson::AssertFunctionsGateway::assert_istrueBuiltin, 2, 1,
CPP_BUILTIN_WITH_EVALUATOR },
{ "assert", (ptrBuiltin)Nelson::AssertFunctionsGateway::assert_istrueBuiltin, 2, 1,
CPP_BUILTIN_WITH_EVALUATOR },
{ "assert_isfalse", (ptrBuiltin)Nelson::AssertFunctionsGateway::assert_isfalseBuiltin, 2, 1,
CPP_BUILTIN_WITH_EVALUATOR },
{ "assert_istrue", (ptrBuiltin)Nelson::AssertFunctionsGateway::assert_istrueBuiltin, 2, 1 },
{ "assert_isfalse", (ptrBuiltin)Nelson::AssertFunctionsGateway::assert_isfalseBuiltin, 2, 1 },
{ "assert", (ptrBuiltin)Nelson::AssertFunctionsGateway::assert_istrueBuiltin, 2, 1 },
{ "assert_checkerror", (ptrBuiltin)Nelson::AssertFunctionsGateway::assert_checkerrorBuiltin, 2,
-2, CPP_BUILTIN_WITH_EVALUATOR },
{ "assert_isequal", (ptrBuiltin)Nelson::AssertFunctionsGateway::assert_isequalBuiltin, 2, 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
using namespace Nelson;
//=============================================================================
ArrayOfVector
Nelson::AssertFunctionsGateway::assert_isfalseBuiltin(
Evaluator* eval, int nLhs, const ArrayOfVector& argIn)
Nelson::AssertFunctionsGateway::assert_isfalseBuiltin(int nLhs, const ArrayOfVector& argIn)
{
nargincheck(argIn, 1, 2);
nargoutcheck(nLhs, 0, 2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
using namespace Nelson;
//=============================================================================
ArrayOfVector
Nelson::AssertFunctionsGateway::assert_istrueBuiltin(
Evaluator* eval, int nLhs, const ArrayOfVector& argIn)
Nelson::AssertFunctionsGateway::assert_istrueBuiltin(int nLhs, const ArrayOfVector& argIn)
{
nargincheck(argIn, 1, 2);
nargoutcheck(nLhs, 0, 2);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
#pragma once
//=============================================================================
#include "ArrayOf.hpp"
#include "Evaluator.hpp"
//=============================================================================
namespace Nelson::AssertFunctionsGateway {
//=============================================================================
ArrayOfVector
assert_isfalseBuiltin(Evaluator* eval, int nLhs, const ArrayOfVector& argIn);
assert_isfalseBuiltin(int nLhs, const ArrayOfVector& argIn);
//=============================================================================
} // namespace Nelson
//=============================================================================
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@
#pragma once
//=============================================================================
#include "ArrayOf.hpp"
#include "Evaluator.hpp"
//=============================================================================
namespace Nelson::AssertFunctionsGateway {
//=============================================================================
ArrayOfVector
assert_istrueBuiltin(Evaluator* eval, int nLhs, const ArrayOfVector& argIn);
assert_istrueBuiltin(int nLhs, const ArrayOfVector& argIn);
//=============================================================================
} // namespace Nelson
//=============================================================================
1 change: 0 additions & 1 deletion modules/audio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ target_link_libraries(
nlsI18n
nlsInterpreter
nlsNelson_manager
nlsOverload
nlsStream_manager
nlsTypes)
# ==============================================================================
Expand Down
3 changes: 0 additions & 3 deletions modules/audio/builtin/c/nlsAudio_builtin.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,6 @@
<ProjectReference Include="..\..\..\nelson_manager\src\c\nlsNelson_manager.vcxproj">
<Project>{e467b14f-0d56-4237-b649-eb5572b5e731}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\overload\src\c\nlsOverload.vcxproj">
<Project>{937bee8b-e934-45f1-98ef-33aaf951e5e9}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\stream_manager\src\c\nlsStream_manager.vcxproj">
<Project>{1b461db6-82ea-4436-a674-d2975f184b90}</Project>
</ProjectReference>
Expand Down

0 comments on commit 8615ad8

Please sign in to comment.