Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #489 in progress (first step ...)
- Loading branch information
1 parent
3b63b26
commit 3b26ac3
Showing
14 changed files
with
200 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
modules/elementary_functions/builtin/cpp/displayBuiltin.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
//============================================================================= | ||
// Copyright (c) 2016-present Allan CORNET (Nelson) | ||
//============================================================================= | ||
// This file is part of the Nelson. | ||
//============================================================================= | ||
// LICENCE_BLOCK_BEGIN | ||
// This program is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU Lesser General Public | ||
// License as published by the Free Software Foundation; either | ||
// version 2.1 of the License, or (at your option) any later version. | ||
// | ||
// Alternatively, you can redistribute it and/or | ||
// modify it under the terms of the GNU General Public License as | ||
// published by the Free Software Foundation; either version 2 of | ||
// the License, or (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public | ||
// License along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
// LICENCE_BLOCK_END | ||
//============================================================================= | ||
#include "displayBuiltin.hpp" | ||
#include "Error.hpp" | ||
#include "OverloadDisplay.hpp" | ||
//============================================================================= | ||
using namespace Nelson; | ||
//============================================================================= | ||
ArrayOfVector | ||
Nelson::ElementaryFunctionsGateway::displayBuiltin( | ||
Evaluator* eval, int nLhs, const ArrayOfVector& argIn) | ||
{ | ||
ArrayOfVector retval; | ||
nargincheck(argIn, 1, 2); | ||
nargoutcheck(nLhs, 0, 0); | ||
|
||
ArrayOf variable = argIn[0]; | ||
std::string variableName = variable.name(); | ||
if (argIn.size() == 2) { | ||
variableName = argIn[1].getContentAsCString(); | ||
variable.name(variableName); | ||
} | ||
OverloadDisplay(eval, variable, true); | ||
|
||
/* | ||
std::wstring variableName; | ||
ArrayOf variableValue; | ||
Interface* io = eval->getInterface(); | ||
switch (argIn.size()) { | ||
case 1: { | ||
variableName = argIn[0].name(); | ||
io->outputMessage(variableName + " = \n\n"); | ||
OverloadDisplay(eval, argIn[0], true); | ||
} break; | ||
case 2: { | ||
std::wstring variableName = argIn[1].getContentAsWideString(); | ||
io->outputMessage(variableName + L" =\n\n"); | ||
OverloadDisplay(eval, argIn[0], true); | ||
} | ||
} break; | ||
} | ||
if (!variableName.empty()) { | ||
io->outputMessage(variableName + L" =\n\n"); | ||
} | ||
*/ | ||
return retval; | ||
} | ||
//============================================================================= |
40 changes: 40 additions & 0 deletions
40
modules/elementary_functions/builtin/include/displayBuiltin.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
//============================================================================= | ||
// Copyright (c) 2016-present Allan CORNET (Nelson) | ||
//============================================================================= | ||
// This file is part of the Nelson. | ||
//============================================================================= | ||
// LICENCE_BLOCK_BEGIN | ||
// This program is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU Lesser General Public | ||
// License as published by the Free Software Foundation; either | ||
// version 2.1 of the License, or (at your option) any later version. | ||
// | ||
// Alternatively, you can redistribute it and/or | ||
// modify it under the terms of the GNU General Public License as | ||
// published by the Free Software Foundation; either version 2 of | ||
// the License, or (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Lesser General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Lesser General Public | ||
// License along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
// LICENCE_BLOCK_END | ||
//============================================================================= | ||
#pragma once | ||
//============================================================================= | ||
#include "ArrayOf.hpp" | ||
#include "Evaluator.hpp" | ||
//============================================================================= | ||
namespace Nelson { | ||
namespace ElementaryFunctionsGateway { | ||
//============================================================================= | ||
ArrayOfVector | ||
displayBuiltin(Evaluator* eval, int nLhs, const ArrayOfVector& argIn); | ||
//============================================================================= | ||
} | ||
//============================================================================= | ||
} // namespace Nelson | ||
//============================================================================= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
%============================================================================= | ||
% Copyright (c) 2016-present Allan CORNET (Nelson) | ||
%============================================================================= | ||
% This file is part of the Nelson. | ||
%============================================================================= | ||
% LICENCE_BLOCK_BEGIN | ||
% This program is free software; you can redistribute it and/or | ||
% modify it under the terms of the GNU Lesser General Public | ||
% License as published by the Free Software Foundation; either | ||
% version 2.1 of the License, or (at your option) any later version. | ||
% | ||
% Alternatively, you can redistribute it and/or | ||
% modify it under the terms of the GNU General Public License as | ||
% published by the Free Software Foundation; either version 2 of | ||
% the License, or (at your option) any later version. | ||
% | ||
% This program is distributed in the hope that it will be useful, | ||
% but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
% GNU Lesser General Public License for more details. | ||
% | ||
% You should have received a copy of the GNU Lesser General Public | ||
% License along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
% LICENCE_BLOCK_END | ||
%============================================================================= | ||
assert_isequal(nargin('display'), 2) | ||
assert_isequal(nargout('display'), 0) | ||
%============================================================================= | ||
X = 'Alice will be 12 this year.'; | ||
R = evalc('display(X, ''YYY'')') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.