On 10/11/2013 07:01 AM, Sergey Mironov wrote:
Can't you implement it as an FFI library, so that folks know when they're
explicitly including it?  I consider it a feature, not a bug, to make this
functionality a little hard to implement or include. ;)
OK, l'll rewrite it as a blessScript function. Looks like it is really
the best solution for the moment.

Thanks. I'm much happier with any option that programmers need to enable explicitly in .urp files.

And here I have a question about
nested libraries. Does Ur/Web handle situation where several libraries
(A,B,C) uses same library D (all three have `library D' directive) and
the master project includes them all (A,B,C and D)?
For example, when I make BlessScript.urp, I will want to use it in
both uru library (currently, uru is not a library, but a set of *urs,
but I plan to turn it into libray) and in master project. Will I be
able to do it by simply listing BlessScript in both Uru.urp and
App.urp?

I think this should work. The compiler contains some logic for merging together .urp directives in a smart way, including by not duplicating .urs or .ur files in the combined list. Said logic hasn't necessarily been tested thoroughly in many different scenarios, but I think it's worth trying, and submitting bug reports about anything that goes wrong.

Do you have a suggestion of good places to link to publicize such tools on
the Ur project site?
Sure, I think it would be nice to place the link under the
http://www.impredicative.com/wiki/index.php/Libraries_and_FFI_bindings
(I plan to turn uru into a library) but wiki also has
http://www.impredicative.com/wiki/index.php/Ur-based_Projects which
also match. Since both pages contains not too much items, what do you
think about merging them into one page? Also, since it is one of the
first thing user wants from wiki (at least , it was so for me), what
do you think about moving all the links from both pages to the main
wiki page to a separate section below others?

All of those changes sound reasonable, and I encourage you to implement them yourself! If you don't yet have a wiki account with write privileges, please create an account and let me know its name, so I can grant privileges. (Writing is off by default, because we don't have nearly a large enough community to do the spam policing that Wikipedia has.)

Also, I have a problem with NivoSlider control, since it requires
$(window).load() event handler, and<body onload=..>  happens too
early. Authors suggest using
<script>
$(window).load(function() { ... nivo_slider_init(); .. });
</script>
So I used an ugly hack. I can wrap it in FFI together with
blessScript, but just in case I miss something: Do we have a better
way of calling things like this right now?

This is a jQuery-specific event hook? I wouldn't want to include such things with Ur/Web, but I would suggest adding library FFI code following the model of, e.g., [onClick] that you can see in basis.urs now.

PS
Just noticed that blessScript is not the best name, because the
function wouldn't have corresponding compiler-side blesser. But what
do you think about introducing `allow script' directive? I probably
can handle it if it is not that hard.

Maybe you could elaborate a bit on the functionality that you have in mind? I'm not sure I understand the proposal at a high level.

_______________________________________________
Ur mailing list
[email protected]
http://www.impredicative.com/cgi-bin/mailman/listinfo/ur

Reply via email to