You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Putting the above lines to the package will open up z, and those lines act as a pass-through. <SPLITINLINE><SCHEME><SCHEMEINLINE>apply-generic</SCHEMEINLINE></SCHEME><JAVASCRIPT><JAVASCRIPTINLINE>apply_generic</JAVASCRIPTINLINE></JAVASCRIPT></SPLITINLINE> ill be invoked twice. We shall trace with substitution model how the program evaluates.
470
+
<SNIPPETEVAL="no">
471
+
<JAVASCRIPT>
472
+
magnitude(z);
473
+
apply_generic("magnitude", list(z));
474
+
// In this case:
475
+
// type_tags = map(type_tag, list(z))
476
+
// Which evaluates to:
477
+
// type_tags = list("complex");
478
+
// and
479
+
// fun = get("magnitude", list("complex"));
480
+
// which, due to the addition of the put("magnitude", list("complex"), magnitude);
0 commit comments