# HG changeset patch # User wenzelm # Date 1727811331 -7200 # Node ID 9b11062b62c6b2d7608ef4cdc6a12795feb2bbf8 # Parent c92efbf32bfea1cf28e26267457d3320a591f99f more robust 'no_syntax' via bundles; diff -r c92efbf32bfe -r 9b11062b62c6 src/Doc/Datatypes/Datatypes.thy --- a/src/Doc/Datatypes/Datatypes.thy Tue Oct 01 21:30:59 2024 +0200 +++ b/src/Doc/Datatypes/Datatypes.thy Tue Oct 01 21:35:31 2024 +0200 @@ -453,8 +453,7 @@ Incidentally, this is how the traditional syntax can be set up: \ (*<*) -no_syntax - "_list" :: "args => 'a list" (\(\indent=1 notation=\mixfix list enumeration\\[_])\) +unbundle no_list_syntax (*>*) syntax "_list" :: "args \ 'a list" (\[(_)]\) diff -r c92efbf32bfe -r 9b11062b62c6 src/HOL/List.thy --- a/src/HOL/List.thy Tue Oct 01 21:30:59 2024 +0200 +++ b/src/HOL/List.thy Tue Oct 01 21:35:31 2024 +0200 @@ -46,10 +46,16 @@ text \List enumeration\ syntax - "_list" :: "args => 'a list" (\(\indent=1 notation=\mixfix list enumeration\\[_])\) + "_list" :: "args \ 'a list" (\(\indent=1 notation=\mixfix list enumeration\\[_])\) translations - "[x, xs]" == "x#[xs]" - "[x]" == "x#[]" + "[x, xs]" \ "x#[xs]" + "[x]" \ "x#[]" + +bundle no_list_syntax +begin +no_syntax + "_list" :: "args \ 'a list" (\(\indent=1 notation=\mixfix list enumeration\\[_])\) +end subsection \Basic list processing functions\ @@ -451,6 +457,13 @@ syntax (ASCII) "_lc_gen" :: "'a \ 'a list \ lc_qual" (\_ <- _\) +bundle no_listcompr_syntax +begin +no_syntax + "_listcompr" :: "'a \ lc_qual \ lc_quals \ 'a list" (\[_ . __\) + "_lc_end" :: "lc_quals" (\]\) +end + parse_translation \ let val NilC = Syntax.const \<^const_syntax>\Nil\;