How to resolve the algorithm Send an unknown method call step by step in the Forth programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Send an unknown method call step by step in the Forth programming language

Table of Contents

Problem Statement

Invoke an object method where the name of the method to be invoked can be generated at run time.

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Send an unknown method call step by step in the Forth programming language

Source code in the forth programming language

include FMS-SI.f
include FMS-SILib.f

var x  \ instantiate a class var object named x

\ Use a standard Forth string and evaluate it.
\ This is equivalent to sending the !: message to object x
42 x  s" !:"  evaluate  

x p: 42     \ send the print message ( p: ) to x to verify the contents


  

You may also check:How to resolve the algorithm First power of 2 that has leading decimal digits of 12 step by step in the BASIC256 programming language
You may also check:How to resolve the algorithm Primes: n*2^m+1 step by step in the PL/M programming language
You may also check:How to resolve the algorithm Ackermann function step by step in the Rust programming language
You may also check:How to resolve the algorithm Voronoi diagram step by step in the R programming language
You may also check:How to resolve the algorithm Get system command output step by step in the REXX programming language