Generating runtime type information.
  [Thread Prev] | [Thread Next]
 
 
- Subject: Generating runtime type information.
- From: Ori Bernstein <ori@xxxxxxxxxxxxxx>
- Date: Thu, 26 Mar 2015 23:19:24 -0700
- To: myrddin-dev@xxxxxxxxxxxxxx
Congratulations everyone! you get to rebuild as we break ABI
again!
We now generate type descriptions for variadic types, and push
a pointer to the variadic arguments on to the stack when we call.
The valist code currently ignores this, and does nothing useful
with it -- this should be fixed.
In other words, if you have a variadic function f:
	const f : (a : int, b : byte[:], ... -> void)
and you call it like this:
	f(1, "asdf", 'c', "blah", false)
you will get, on the stack:
	[
	1	: int,
	"asdf"	: byte[:], 
	argtype	: byte#
	'c'	: char,
	"blah"	: byte[:],
	false	: bool
	]
The argtype will be a binary encoded description of the types
of the tuple (char, byte[:], bool)
This means that you can write (admittedly, slightly hairy) code
to parse out the types passed in for variadics, and write code
that looks like:
	const pack : (vals : ... -> byte[:])
One goal that I would like to support is making std.fmt()
callable as such:
	std.fmt("%: list contains %\n", 1, [1,2,3][:])
-- 
Ori Bernstein <ori@xxxxxxxxxxxxxx>
| Re: Generating runtime type information. | Ryan Gonzalez <rymg19@xxxxxxxxx> | 
| Re: Generating runtime type information. | Ryan Gonzalez <rymg19@xxxxxxxxx> | 
- Prev by Date: Re: Iterator APIs?
- Next by Date: Re: Generating runtime type information.
- Previous by thread: Re: Iterator APIs?
- Next by thread: Re: Generating runtime type information.
- Index(es):