0

As I can see read is not native

>> native? :read
== false

but when I tried to get the source code with

write-clipboard mold :read

I only got header of 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!]
  ]]

Can I get the rest body somehow ?

user310291
  • 36,946
  • 82
  • 271
  • 487

1 Answers1

3

The source code of native! and action! values is written in Red/System and part of the low-level runtime library code. They are not implemented in Red itself for sake of performance or because they require access to low-level features not available at Red level. Natives source code have a single entry point which you can find in the runtime/natives.reds file. For actions, it is more complex as they delegate their implementation to each datatype. Actions are basically methods for the datatype classes.

DocKimbel
  • 3,127
  • 16
  • 27