[Ur] Bug Report

James Parker jp at jamesparker.me
Sat Dec 17 20:07:03 EST 2011


Thanks for the tips and quick fix!

I'm still trying to wrap my head around the concepts of monads and was wondering if you could help me with one more thing. In my getUser function, I am trying to return an option record of a user's name, email, id, etc if they're logged in. Unfortunately I'm having trouble understanding what the compiler is looking for. I think it may have something to do with escaping the transaction monad? The code is available here:

https://github.com/jprider63/UMDTalks/blob/master/umdtalks.ur

Thanks,

JP

On Dec 17, 2011, at 9:25 AM, Adam Chlipala wrote:

> James Parker wrote:
>> I believe I have found a bug. Here is the error message:
>> 
>> $ urweb umdtalks -debug
>> gcc  -pthread -Wimplicit -Werror -Wno-unused-value -I /usr/local/include/urweb  -c /tmp/webapp.c -o /tmp/webapp.o -g
>> cc1: warnings being treated as errors
>> /tmp/webapp.c: In function ‘uw_handle’:
>> /tmp/webapp.c:2187: error: initialization from incompatible pointer type
>> 
>> The code is available at:
>> 
>> https://github.com/jprider63/UMDTalks
>> 
>> The errors seem to go away if I change the first parameter from inputError to (). Relevant lines are umdtalks.ur:312,318,343.
>>   
> 
> You're right; it was a compiler bug.  I've fixed it now.  Thanks for the report!
> 
> A few bits of advice, based on looking through your code:
> 
> I see your Makefile has an extra 'mv' from $(EXE).exe to $(EXE).  You can output to the latter file in the first place, using the 'exe' .urp directive.
> 
> All Ur/Web applications have OpenSSL linked in, so you might consider using OpenSSL crypto functions in place of mhash's.  Examples of using such functions are in the openid library.
> 
> 
> _______________________________________________
> Ur mailing list
> Ur at impredicative.com
> http://www.impredicative.com/cgi-bin/mailman/listinfo/ur




More information about the Ur mailing list