Erlang Mailing Lists

Author Message

<  Yaws mailing list  ~  new function - yaws_api:binding_exists/1

Guest
Posted: Wed Sep 20, 2006 9:13 am Reply with quote
Guest
I introduced a new function in yaws_api in order to work around the
error handling in binding/1.

binding(Key) ->
case get({binding, Key}) of
undefined -> erlang:fault({unknown_binding, Key});
Value -> Value
end.

I added another function to test for a binding which allows me to
write code to work around this:

binding_exists(Key) ->
case get({binding, Key}) of
undefined -> false;
_ -> true
end.

Claes, If this function or some other way to achieve the same goal
suits you, please add it.

thanks, ke han

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post recived from mailinglist
Guest
Posted: Wed Sep 20, 2006 12:34 pm Reply with quote
Guest
Jon Hancock wrote:
> I introduced a new function in yaws_api in order to work around the
> error handling in binding/1.
.....
> Claes, If this function or some other way to achieve the same goal
> suits you, please add it.
>


added


/klacke


--
Claes Wikstrom -- Caps lock is nowhere and
http://www.tail-f.com -- everything is under control
cellphone: +46 70 2097763

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post recived from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum