Eiffel: are the convert methods working in case of agent call arguments?
I'm calling a procedure with an argument which is an integer_64. I implemented a WATT class which can create it from an INTEGER_64 and it seems the execution stops when reached this point, where am I wrong?
Catcall detected for argument#1
args': expected TUPLE [!WATT] but got TUPLE [INTEGER_64]`
Attached case (Update)
Actually when checking with syntax
attached {INTEGER_64} my_watt_object as l_int
it doesn't pass either... is it the expected behaviour?
Actually it seems for me that the semantic cases are the same which have to validate the conformity step... for me (but seems not to be the case for the definition of the language between conformance/conformity) which says
Conformance and convertibility are exclusive of each other,
p.87
Is the conformance rule valid for a type which defines as convert
a type to another which is my case from WATT to INTEGER_64?
type-conversion agent createprocess eiffel
add a comment |
I'm calling a procedure with an argument which is an integer_64. I implemented a WATT class which can create it from an INTEGER_64 and it seems the execution stops when reached this point, where am I wrong?
Catcall detected for argument#1
args': expected TUPLE [!WATT] but got TUPLE [INTEGER_64]`
Attached case (Update)
Actually when checking with syntax
attached {INTEGER_64} my_watt_object as l_int
it doesn't pass either... is it the expected behaviour?
Actually it seems for me that the semantic cases are the same which have to validate the conformity step... for me (but seems not to be the case for the definition of the language between conformance/conformity) which says
Conformance and convertibility are exclusive of each other,
p.87
Is the conformance rule valid for a type which defines as convert
a type to another which is my case from WATT to INTEGER_64?
type-conversion agent createprocess eiffel
Can you show the signature of set_from_json_object? Also resize the grid columns, so feature names are fully displayed.
– Jocelyn
Nov 21 at 11:02
@Jocelyn thx, hope this time you got all informations
– Pipo
Nov 21 at 12:47
I forgot about this post, but in your first screenshot you call a routine agentset_charge
that accepts WATT with an INTEGER_64 arguments. So the catcall message is expected. For your "update", the implicit conversion is not applied for object test local (otherwise it would be impossible to doif attached {INTEGER_64} ... elseif attached {WATT} ...
).
– Jocelyn
Dec 3 at 9:35
add a comment |
I'm calling a procedure with an argument which is an integer_64. I implemented a WATT class which can create it from an INTEGER_64 and it seems the execution stops when reached this point, where am I wrong?
Catcall detected for argument#1
args': expected TUPLE [!WATT] but got TUPLE [INTEGER_64]`
Attached case (Update)
Actually when checking with syntax
attached {INTEGER_64} my_watt_object as l_int
it doesn't pass either... is it the expected behaviour?
Actually it seems for me that the semantic cases are the same which have to validate the conformity step... for me (but seems not to be the case for the definition of the language between conformance/conformity) which says
Conformance and convertibility are exclusive of each other,
p.87
Is the conformance rule valid for a type which defines as convert
a type to another which is my case from WATT to INTEGER_64?
type-conversion agent createprocess eiffel
I'm calling a procedure with an argument which is an integer_64. I implemented a WATT class which can create it from an INTEGER_64 and it seems the execution stops when reached this point, where am I wrong?
Catcall detected for argument#1
args': expected TUPLE [!WATT] but got TUPLE [INTEGER_64]`
Attached case (Update)
Actually when checking with syntax
attached {INTEGER_64} my_watt_object as l_int
it doesn't pass either... is it the expected behaviour?
Actually it seems for me that the semantic cases are the same which have to validate the conformity step... for me (but seems not to be the case for the definition of the language between conformance/conformity) which says
Conformance and convertibility are exclusive of each other,
p.87
Is the conformance rule valid for a type which defines as convert
a type to another which is my case from WATT to INTEGER_64?
type-conversion agent createprocess eiffel
type-conversion agent createprocess eiffel
edited Nov 21 at 15:41
asked Nov 20 at 17:12
Pipo
1,4261526
1,4261526
Can you show the signature of set_from_json_object? Also resize the grid columns, so feature names are fully displayed.
– Jocelyn
Nov 21 at 11:02
@Jocelyn thx, hope this time you got all informations
– Pipo
Nov 21 at 12:47
I forgot about this post, but in your first screenshot you call a routine agentset_charge
that accepts WATT with an INTEGER_64 arguments. So the catcall message is expected. For your "update", the implicit conversion is not applied for object test local (otherwise it would be impossible to doif attached {INTEGER_64} ... elseif attached {WATT} ...
).
– Jocelyn
Dec 3 at 9:35
add a comment |
Can you show the signature of set_from_json_object? Also resize the grid columns, so feature names are fully displayed.
– Jocelyn
Nov 21 at 11:02
@Jocelyn thx, hope this time you got all informations
– Pipo
Nov 21 at 12:47
I forgot about this post, but in your first screenshot you call a routine agentset_charge
that accepts WATT with an INTEGER_64 arguments. So the catcall message is expected. For your "update", the implicit conversion is not applied for object test local (otherwise it would be impossible to doif attached {INTEGER_64} ... elseif attached {WATT} ...
).
– Jocelyn
Dec 3 at 9:35
Can you show the signature of set_from_json_object? Also resize the grid columns, so feature names are fully displayed.
– Jocelyn
Nov 21 at 11:02
Can you show the signature of set_from_json_object? Also resize the grid columns, so feature names are fully displayed.
– Jocelyn
Nov 21 at 11:02
@Jocelyn thx, hope this time you got all informations
– Pipo
Nov 21 at 12:47
@Jocelyn thx, hope this time you got all informations
– Pipo
Nov 21 at 12:47
I forgot about this post, but in your first screenshot you call a routine agent
set_charge
that accepts WATT with an INTEGER_64 arguments. So the catcall message is expected. For your "update", the implicit conversion is not applied for object test local (otherwise it would be impossible to do if attached {INTEGER_64} ... elseif attached {WATT} ...
).– Jocelyn
Dec 3 at 9:35
I forgot about this post, but in your first screenshot you call a routine agent
set_charge
that accepts WATT with an INTEGER_64 arguments. So the catcall message is expected. For your "update", the implicit conversion is not applied for object test local (otherwise it would be impossible to do if attached {INTEGER_64} ... elseif attached {WATT} ...
).– Jocelyn
Dec 3 at 9:35
add a comment |
1 Answer
1
active
oldest
votes
In Eiffel, the conversion specified by the language works only at compile time. It applies if the source of a reattachment does not conform to the target of the reattachment at compile time and there is the corresponding conversion feature.
No automatic conversion is performed at run-time. If you need this functionality, you need to implement it yourself. In your example, if the argument type is WATT
, you need to call the conversion from INTEGER_64
to WATT
explicitly, and pass the object of type WATT
, not INTEGER_64
.
thx thats what I finally did is there a reason why?
– Pipo
Dec 3 at 11:26
1
Eiffel is a compiled language, there is no interpreter that evaluates types, performs checks and conversions at run-time dynamically.
– Alexander Kogtenkov
Dec 3 at 11:54
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53398143%2feiffel-are-the-convert-methods-working-in-case-of-agent-call-arguments%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
In Eiffel, the conversion specified by the language works only at compile time. It applies if the source of a reattachment does not conform to the target of the reattachment at compile time and there is the corresponding conversion feature.
No automatic conversion is performed at run-time. If you need this functionality, you need to implement it yourself. In your example, if the argument type is WATT
, you need to call the conversion from INTEGER_64
to WATT
explicitly, and pass the object of type WATT
, not INTEGER_64
.
thx thats what I finally did is there a reason why?
– Pipo
Dec 3 at 11:26
1
Eiffel is a compiled language, there is no interpreter that evaluates types, performs checks and conversions at run-time dynamically.
– Alexander Kogtenkov
Dec 3 at 11:54
add a comment |
In Eiffel, the conversion specified by the language works only at compile time. It applies if the source of a reattachment does not conform to the target of the reattachment at compile time and there is the corresponding conversion feature.
No automatic conversion is performed at run-time. If you need this functionality, you need to implement it yourself. In your example, if the argument type is WATT
, you need to call the conversion from INTEGER_64
to WATT
explicitly, and pass the object of type WATT
, not INTEGER_64
.
thx thats what I finally did is there a reason why?
– Pipo
Dec 3 at 11:26
1
Eiffel is a compiled language, there is no interpreter that evaluates types, performs checks and conversions at run-time dynamically.
– Alexander Kogtenkov
Dec 3 at 11:54
add a comment |
In Eiffel, the conversion specified by the language works only at compile time. It applies if the source of a reattachment does not conform to the target of the reattachment at compile time and there is the corresponding conversion feature.
No automatic conversion is performed at run-time. If you need this functionality, you need to implement it yourself. In your example, if the argument type is WATT
, you need to call the conversion from INTEGER_64
to WATT
explicitly, and pass the object of type WATT
, not INTEGER_64
.
In Eiffel, the conversion specified by the language works only at compile time. It applies if the source of a reattachment does not conform to the target of the reattachment at compile time and there is the corresponding conversion feature.
No automatic conversion is performed at run-time. If you need this functionality, you need to implement it yourself. In your example, if the argument type is WATT
, you need to call the conversion from INTEGER_64
to WATT
explicitly, and pass the object of type WATT
, not INTEGER_64
.
answered Dec 3 at 10:58
Alexander Kogtenkov
3,52011526
3,52011526
thx thats what I finally did is there a reason why?
– Pipo
Dec 3 at 11:26
1
Eiffel is a compiled language, there is no interpreter that evaluates types, performs checks and conversions at run-time dynamically.
– Alexander Kogtenkov
Dec 3 at 11:54
add a comment |
thx thats what I finally did is there a reason why?
– Pipo
Dec 3 at 11:26
1
Eiffel is a compiled language, there is no interpreter that evaluates types, performs checks and conversions at run-time dynamically.
– Alexander Kogtenkov
Dec 3 at 11:54
thx thats what I finally did is there a reason why?
– Pipo
Dec 3 at 11:26
thx thats what I finally did is there a reason why?
– Pipo
Dec 3 at 11:26
1
1
Eiffel is a compiled language, there is no interpreter that evaluates types, performs checks and conversions at run-time dynamically.
– Alexander Kogtenkov
Dec 3 at 11:54
Eiffel is a compiled language, there is no interpreter that evaluates types, performs checks and conversions at run-time dynamically.
– Alexander Kogtenkov
Dec 3 at 11:54
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53398143%2feiffel-are-the-convert-methods-working-in-case-of-agent-call-arguments%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Can you show the signature of set_from_json_object? Also resize the grid columns, so feature names are fully displayed.
– Jocelyn
Nov 21 at 11:02
@Jocelyn thx, hope this time you got all informations
– Pipo
Nov 21 at 12:47
I forgot about this post, but in your first screenshot you call a routine agent
set_charge
that accepts WATT with an INTEGER_64 arguments. So the catcall message is expected. For your "update", the implicit conversion is not applied for object test local (otherwise it would be impossible to doif attached {INTEGER_64} ... elseif attached {WATT} ...
).– Jocelyn
Dec 3 at 9:35