Discussion
Loading...

Discussion

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
alcinnz
alcinnz
@alcinnz@floss.social  ·  activity timestamp last week

A loop prelude for-each loops computes, derefs, & dealiases the given initializer, possibly allocs space for the named-binding, deconstructs the tuples & generates a binding, & saves an initial index. The loop-header for such loops meanwhile branches out when we reach the end of the array, generates a store & possibly load for the loop variable, & increments the index. The "afterthought" also does an increment.

As for iterator-loops...

3/5?

  • Copy link
  • Flag this post
  • Block
alcinnz
alcinnz
@alcinnz@floss.social replied  ·  activity timestamp last week

The iterator-loop header computes the given initializer, dealiases it, reads the tag, checks that there's "done" member of the tagged-union type, branches on whether we've reached it, determines variable-type, & constructs the loop-variables.

Or normal for-loops lets you, the developer, specify the loop condition for it to branch upon.

For the free() builtin it recursively compiles the arg (dealiased), adds an extra deref for slices & strings, & outputs that call.

4/5 This morning!

  • Copy link
  • Flag this comment
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.1-alpha.21 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login