On Tue, 2006-09-12 at 11:34 +1000, skaller wrote:
[]
Just to be clear where the problem in the code is:
In lpsrc/flx_bbind.ipk, src/flx_bbind.ml:
| `SYMDEF_function (ps,rt,props,exes) ->
let bps = bindps ps in
let ts = typeofbps_traint bps in
let brt = bt rt in
let brt',bbexes = bexes env exes brt i bvs in
let bbdcl =
match brt' with
| `BTYP_void ->
`BBDCL_procedure (props,bvs,bps,bbexes)
| _ ->
`BBDCL_function (props,bvs,bps,brt',bbexes)
in
Hashtbl.add bbdfns i (name,true_parent,sr,bbdcl);
Here ps are the unbound parameters, bps the bound parameters.
The key routine is bexes, which binds the executable
instruction list 'exes' in environment 'env' (which is the
environment the function provides, namely its own
environment PLUS parameters and everything define inside
the function).
What needs to be done is to check the function's type variable
spec, discover the typeclasses needed, and push them onto
the environment stack, specialised to the arguments given.
It's quite easy to push the typeclass onto the environment
stack .. the problem is the 'specialised' bit.
The problem is the environment does not map names to terms,
it maps names to the index of the 'term' in the symbol table.
Lookup automatically performs and records specialisations
(that is, substitutions, unifiers, whatever) in bound terms,
but only by matching signatures against entries in the symbol
table.
The entries we want to lookup against are not in the symbol
table: the typeclass is in the symbol table, but it has
the wrong type variables in it.
--
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Felix-language mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language