Hatena::Groupocaml-nagoya

Happy OCaml!!

2009-09-27

_xを使えば、unused variable警告を抑制できるよ

| はてなブックマーク - _xを使えば、unused variable警告を抑制できるよ - Happy OCaml!!

みなさん、コンパイルするときに"-w A -warn-error A"つけてますか? わりと適切な警告がでて便利ですよ。

例えば、こんなコード書くと警告してくれます。

# let f x = ();;
Warning Z: unused variable x.
val f : 'a -> unit = <fun>

うん、うん、xを使ってないことを教えてくれたんだね、ありがとう。

で、普段はなんの問題もないんだけど、コードを自動生成したときとかは、この警告がうざいこともある。

そんなときは、先頭に_をつければ、警告を抑制できるよ。

# let f _x = ();;
val f : 'a -> unit = <fun>

ワイルドカード・パターン(_)とは違うから、ちゃんと変数を使うこともできる。

# let f _x = _x +1;;
val f : int -> int = <fun>

JeffJeff 2012/04/10 00:02 Deep thought! Thanks for contbriutnig.

suhixtsuhixt 2012/04/11 03:54 BSueQK , [url=http://julmwqvgqxbd.com/]julmwqvgqxbd[/url], [link=http://ojovhfygosjw.com/]ojovhfygosjw[/link], http://ebsqzkhxclfi.com/

pyaavdpyaavd 2012/04/14 00:41 1XqumQ , [url=http://vinxudtgwvnq.com/]vinxudtgwvnq[/url], [link=http://prbmlajygpsu.com/]prbmlajygpsu[/link], http://udmahctyaqoo.com/

MatSaloMatSalo 2018/06/12 11:43 Medicament Generique Du Viagra Cialis Original Comprar <a href=http://cialicheap.com>generic 5mg cialis best price</a> Low Cost Sildenfil Citrate

MatSaloMatSalo 2018/08/26 02:39 Priligy Dapoxetina Precio <a href=http://ciali5mg.com>cheapest cialis</a> Acheter Kamagra Medicament Topimax Without A Prescription Canada

JospehunumbJospehunumb 2019/02/02 02:51 generic cialis no prescription mastercard
cialis negative reviews
cialise
www.cialiscanada.ca

cost of cialis in mexico
cialis billig
cialis online lloyds
cialis and canadian pharmacy
https://stowe365.com/#Buy-Cialis

WilliamhannaWilliamhanna 2019/02/02 09:54 sildenafil vs cialis
generic cialis with mastercard
<a href=https://greatwinesgrandhouses.com>Cialis 20 mg</a>
buy cialis with discover card
20 mg cialis reviews
https://kellyannehulme.com
does cialis require a prescription in canada
average cost of cialis daily use
<a href=https://kellyannehulme.com>cialis</a>
female cialis 20mg
best place to buy cialis online yahoo
https://kellyannehulme.com

WilliamhannaWilliamhanna 2019/02/02 09:55 cialis softgel
buy cialis soft fast shipping
<a href=https://greatwinesgrandhouses.com>Cialis 20 mg cheap price</a>
buy cialis online melbourne
buy cialis over the counter
https://greatwinesgrandhouses.com
free samples of cialis sold in the usa
us made cialis
<a href=https://greatwinesgrandhouses.com>buy Cialis 20 mg</a>
cost of cialis in manitoba
cialis online offer
https://kellyannehulme.com

WilliamhannaWilliamhanna 2019/02/02 09:56 best online cialis site
best cialis online
<a href=https://greatwinesgrandhouses.com>cialis</a>
order cialis pills
wholesale cialis
https://kellyannehulme.com
phone number for cialis
cialis mit ec karte kaufen
<a href=https://greatwinesgrandhouses.com>20 mg cialis buy</a>
cialis cialis cialis
cialis drug
https://kellyannehulme.com

ArnoldPoumnArnoldPoumn 2019/02/05 17:59 sudafed and cialis
buy cialis canada yahoo answers
<a href="http://xcialisxx.com">Buy Cialis Online</a>
vendita cialis originale on line
original cialis price
<a href="http://cialisfurr.com">Buy Cheap Cialis Online</a>
low cost daily cialis
cialis tyskland
<a href="http://cialistlm.com">Buy Cheap Cialis Online</a>

ArnoldPoumnArnoldPoumn 2019/02/05 18:00 cialis 10mg online bestellen
cialis for bph reviews
<a href="http://xcialisxx.com">buy cialis</a>
cialis online without rx
best price cialis canadian pharmacy
<a href="http://cialistlm.com">Cheap Cialis buy</a>
buy cialis 10mg australia
generic cialis from usa
<a href="http://xcialisxx.com">Buy Cheap Cialis Online</a>

ArnoldPoumnArnoldPoumn 2019/02/05 18:01 cialis sales rayh health care
generic cialis t20
<a href="http://cialistlm.com">Buy Cheap Cialis</a>
cialis probe kostenlos
best online store for cialis
<a href="http://cialistlm.com">buy cialis</a>
cost of cialis in singapore
cialis direct mexico
<a href="http://cialistlm.com">Cheap Cialis buy</a>

olaestixmaolaestixma 2019/02/21 02:13 **97653985320493959 <a href="http://lookevision.org/forums/topic/ciprofloxacin-500mg-sale">ciprofloxacin 500mg sale</a> 52220652415 &&

ゲスト



トラックバック - http://ocaml-nagoya.g.hatena.ne.jp/mzp/20090927