Movatterモバイル変換


[0]ホーム

URL:


Scala 3
3.7.4
LearnInstallPlaygroundFind A LibraryCommunityBlog
Scala 3
LearnInstallPlaygroundFind A LibraryCommunityBlog
DocsAPI
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL
Scala 3/scala/scala.quoted/Quotes/reflectModule/ValDefModule

ValDefModule

scala.quoted.Quotes.reflectModule.ValDefModule

Methods of the module objectval ValDef

Attributes

Source
Quotes.scala
Graph
Supertypes
classObject
traitMatchable
classAny
Self type
Quotes.this.reflectModule.this.ValDef.type

Members list

Value members

Abstract methods

defapply(symbol:Quotes.this.reflectModule.this.Symbol,rhs:Option[Quotes.this.reflectModule.this.Term]):Quotes.this.reflectModule.this.ValDef

Create a value definitionval x,var x orlazy val x with the signature defined in the symbol.

Create a value definitionval x,var x orlazy val x with the signature defined in the symbol.

Therhs should returnSome containing the implementation of the method, orNone if the method has no implementation. Any definition directly inside the implementation should havesymbol as owner.

UseSymbol.asQuotes to create the rhs using quoted code.

See also:Tree.changeOwner

Attributes

Source
Quotes.scala
defcopy(original:Quotes.this.reflectModule.this.Tree)(name:String,tpt:Quotes.this.reflectModule.this.TypeTree,rhs:Option[Quotes.this.reflectModule.this.Term]):Quotes.this.reflectModule.this.ValDef

Attributes

Source
Quotes.scala
deflet(owner:Quotes.this.reflectModule.this.Symbol,name:String,rhs:Quotes.this.reflectModule.this.Term)(body:Quotes.this.reflectModule.this.Ref=>Quotes.this.reflectModule.this.Term):Quotes.this.reflectModule.this.Term

Creates a block{ val <name> = <rhs: Term>; <body(x): Term> }

Creates a block{ val <name> = <rhs: Term>; <body(x): Term> }

Usage:

ValDef.let(owner, "x", rhs1) { x =>  ValDef.let(x.symbol.owner, "y", rhs2) { y =>    // use `x` and `y`  }}

Attributes

Source
Quotes.scala
deflet(owner:Quotes.this.reflectModule.this.Symbol,terms:List[Quotes.this.reflectModule.this.Term])(body:List[Quotes.this.reflectModule.this.Ref]=>Quotes.this.reflectModule.this.Term):Quotes.this.reflectModule.this.Term

Creates a block{ val x1 = <terms(0): Term>; ...; val xn = <terms(n-1): Term>; <body(List(x1, ..., xn)): Term> }

Creates a block{ val x1 = <terms(0): Term>; ...; val xn = <terms(n-1): Term>; <body(List(x1, ..., xn)): Term> }

Usage:

ValDef.let(owner, rhsList) { xs =>   ...}

Attributes

Source
Quotes.scala

Attributes

Source
Quotes.scala

Concrete methods

deflet(owner:Quotes.this.reflectModule.this.Symbol,rhs:Quotes.this.reflectModule.this.Term)(body:Quotes.this.reflectModule.this.Ref=>Quotes.this.reflectModule.this.Term):Quotes.this.reflectModule.this.Term

Creates a block{ val x = <rhs: Term>; <body(x): Term> }

Creates a block{ val x = <rhs: Term>; <body(x): Term> }

Usage:

ValDef.let(owner, rhs1) { x =>  ValDef.let(owner, rhs2) { y =>    // use `x` and `y`  }}

Attributes

Source
Quotes.scala
In this article
Generated with
Copyright (c) 2002-2025, LAMP/EPFL
Copyright (c) 2002-2025, LAMP/EPFL

[8]ページ先頭

©2009-2025 Movatter.jp