Help us understand the problem. What is going on with this article?

HSPでポリモーフィズムっぽい何か

More than 1 year has passed since last update.

偶然見つけたHSPの怪しい動作。

#runtime "hsp3cl"

#module A fn
    #modinit
        fn=*pf
    return

    #modfunc pfn
        gosub fn
    return

    *pf
        mes "Aです。"
    return
#global

#module B fn
    #modinit
        fn=*pf
    return

    *pf
        mes "Bです。"
    return
#global

newmod afn,A
newmod bfn,B
pfn afn
pfn bfn
yosgspec
JavaScript(Node.js,TypeScript),VB.NET,C#,CommonLisp,HSP,Python3,D,C++,VBA 等。 適当な言語マニアです。最近オブジェクト指向を覚えてから下手に多用することが多くなった。 その他に若干読み書きできる言語: Ruby,Lua,Java,Tcl,Scala,Scheme,Clojure,Go,Perl,Matlab,R 他
http://yosgspec.blog103.fc2.com/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away