Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 


Quelle  deprecation.v   Sprache: Coq

 
Require Import Ltac2.Ltac2.

Set Warnings "+deprecated".

Ltac2 Type foo := [
  | #[deprecated(since="bar")] Bar
  | #[deprecated(since="baz")] Baz
  ].

(* can still use foo even if its constructors are deprecated *)
Ltac2 diagonal (x:foo) := (x, x).

(* deprecated constructors warn when using them to construct values *)
Fail Ltac2 nobuild := Bar.

(* deprecated constructors also warn when matching on them *)
Fail Ltac2 nomatch x :=
  match x with
  | Bar => 0
  | _ => 1
  end.

(* warnings are per constructor so we can disable one and not the other
   (because this test uses difference "since" annotations) *)

Set Warnings "-deprecated-since-bar".

Fail Ltac2 nobuild := Baz.

Ltac2 build_warn_bar_disabled := Bar.

(* warnings are per constructor, so we still can't match on Baz *)
Fail Ltac2 nomatch x :=
  match x with
  | Baz => 0
  | _ => 1
  end.

(* but we can match on Bar with its warning disabled *)
Ltac2 match_warn_bar_disabled x :=
  match x with
  | Bar => 0
  | _ => 1
  end.

(* the warning is at intern time *)
Ltac2 Notation bar_nota := Bar.

Ltac2 Notation "isBar_nota" x(tactic) := match x with Bar => true | _ => false end.

Set Warnings "+deprecated-since-bar".

(* sanity check *)
Fail Ltac2 nobuild := Bar.

Ltac2 bar_def := bar_nota.

Ltac2 isBar_def x := isBar_nota x.

Ltac2 Eval Control.assert_true (isBar_def bar_def).

#[warnings="-deprecated-since-baz"]
  Ltac2 Eval Control.assert_false (isBar_def Baz).

Messung V0.5
C=92 H=99 G=95

¤ Dauer der Verarbeitung: 0.13 Sekunden  (vorverarbeitet)  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Produkte
     Quellcodebibliothek

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....

Besucherstatistik

Besucherstatistik

Monitoring

Montastic status badge