Eiffel: are the convert methods working in case of agent call arguments?












0














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#1args': expected TUPLE [!WATT] but got TUPLE [INTEGER_64]`



code_and_situation



Attached case (Update)



Actually when checking with syntax



attached {INTEGER_64} my_watt_object as l_int


enter image description here



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?










share|improve this question
























  • 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 do if attached {INTEGER_64} ... elseif attached {WATT} ... ).
    – Jocelyn
    Dec 3 at 9:35
















0














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#1args': expected TUPLE [!WATT] but got TUPLE [INTEGER_64]`



code_and_situation



Attached case (Update)



Actually when checking with syntax



attached {INTEGER_64} my_watt_object as l_int


enter image description here



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?










share|improve this question
























  • 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 do if attached {INTEGER_64} ... elseif attached {WATT} ... ).
    – Jocelyn
    Dec 3 at 9:35














0












0








0


1





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#1args': expected TUPLE [!WATT] but got TUPLE [INTEGER_64]`



code_and_situation



Attached case (Update)



Actually when checking with syntax



attached {INTEGER_64} my_watt_object as l_int


enter image description here



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?










share|improve this question















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#1args': expected TUPLE [!WATT] but got TUPLE [INTEGER_64]`



code_and_situation



Attached case (Update)



Actually when checking with syntax



attached {INTEGER_64} my_watt_object as l_int


enter image description here



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






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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 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


















  • 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 do if 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












1 Answer
1






active

oldest

votes


















2














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.






share|improve this answer





















  • 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











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
});


}
});














draft saved

draft discarded


















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









2














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.






share|improve this answer





















  • 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
















2














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.






share|improve this answer





















  • 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














2












2








2






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.






share|improve this answer












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.







share|improve this answer












share|improve this answer



share|improve this answer










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


















  • 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


















draft saved

draft discarded




















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

Wiesbaden

Marschland

Dieringhausen