Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Cyborg)
  • No Skin
Collapse
Brand Logo

CIRCLE WITH A DOT

  1. Home
  2. Uncategorized
  3. #RocketLang update:I implemented some additional library functions, namely:- `dynamic_type(x)`: returns the actual runtime type of the object.

#RocketLang update:I implemented some additional library functions, namely:- `dynamic_type(x)`: returns the actual runtime type of the object.

Scheduled Pinned Locked Moved Uncategorized
rocketlang
1 Posts 1 Posters 0 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • oots@infosec.exchangeO This user is from outside of this forum
    oots@infosec.exchangeO This user is from outside of this forum
    oots@infosec.exchange
    wrote last edited by
    #1

    #RocketLang update:
    I implemented some additional library functions, namely:
    - `dynamic_type(x)`: returns the actual runtime type of the object. E.g., if the variable x is declared as `SomeProtocol` but you assign an instance of a structure implementing that protocol, it will give you the structure type.
    - `is_subtype(T1, T2)` tests if T1 is a subtype of T2, similar to Python's `issubclass()`
    - `os.scandir()` for getting the contents of a directory

    I also added a generic iterator that works with `ArrayList`s and array `Slice`s. All it needs is that the underlying container can be queried by `container[index]` and can be queried for its length.
    (I actually already had this implemented for ArrayLists, just made it more generic to make it work for Slices, too.)

    This actually required fixing a "bug" in checking whether a type implements a protocol. Implemented naively, that lead into an infinite recursion. (I was aware of that and had a FIXME in my code.) Now I accidentally triggered that and figured it was a good time to actually fix that.

    1 Reply Last reply
    1
    0
    • R relay@relay.infosec.exchange shared this topic
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups