2017-11-04 10 views
0

私が読んで見ることができるようにRedのアクションの完全なソースコードを取得するには?

>> native? :read 
== false 

ネイティブではないですが、私は

write-clipboard mold :read 

とソースコードを入手しようとしたとき、私は読み取り専用

make action! [[ 
     "Reads from a file, URL, or other port" 
     source [file! url!] 
     /part {Partial read a given number of units (source relative)} 
     length [number!] 
     /seek "Read from a specific position (source relative)" 
     index [number!] 
     /binary "Preserves contents exactly" 
     /lines "Convert to block of strings" 
     /info 
     /as {Read with the specified encoding, default is 'UTF-8} 
     encoding [word!] 
    ]] 

のヘッダを持って、私は得ることができます何とか残りの部分?

+0

@rebolekは、git(hub)ソースから読み取る関数を書きました –

+0

また、ソースコードを取得するのに 'source'を使うことができますし、' write-clipboard mold'何もする必要はありません。 –

+0

https ://gist.github.com/rebolek/dc1bb8c17f0c97e4dbf918126fcab6f1 –

答えて

3

native!action!のソースコードは、Red/Systemと低レベルランタイムライブラリコードの一部に書かれています。パフォーマンスのため、またはRedレベルでは利用できない低レベルの機能にアクセスする必要があるため、Red自体では実装されていません。ネイティブのソースコードには、runtime/natives.redsファイルにある単一のエントリポイントがあります。アクションの場合は、delegateの各データ型への実装がより複雑です。アクションは基本的にデータ型クラスのメソッドです。

関連する問題