Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/GAP/pkg/toolsforhomalg/gap/   (GAP Algebra Version 4.15.1©)  Datei vom 2.4.2025 mit Größe 3 kB image not shown  

SSL ListsWithAttributes.gi   Sprache: Shell

 

# SPDX-License-Identifier: GPL-2.0-or-later
# ToolsForHomalg: Special methods and knowledge propagation tools
#
# Implementations
#

DeclareRepresentation( "IsListWithAttributesRep",
        IsListWithAttributes,
        [ ] );

BindGlobal( "TheFamilyOfListsWithAttributes",
        NewFamily( "TheFamilyOfListsWithAttributes" ) );

BindGlobal( "TheTypeListWithAttributesRep",
        NewType( TheFamilyOfListsWithAttributes,
                IsListWithAttributesRep ) );

##
InstallGlobalFunction( TypedListWithAttributes,
  function( L, type, arg... )
    
    arg := Immutable( arg );
    
    return CallFuncList( ObjectifyWithAttributes,
                   Concatenation( [ rec( list := L, type := type, attributes := arg ), type ], arg ) );
    
end );

##
InstallGlobalFunction( ListWithAttributes,
  function( L, arg... )
    
    return CallFuncList( TypedListWithAttributes,
                   Concatenation( [ L, TheTypeListWithAttributesRep ], arg ) );
    
end );

##
InstallMethod( Length,
        [ IsListWithAttributesRep ],
        
  function( L )
    
    return Length( L!.list );
    
end );

##
InstallMethod( \=,
        [ IsListWithAttributesRep, IsListWithAttributesRep ],
        
  function( L1, L2 )
    
    return L1!.list = L2!.list and L1!.attributes = L2!.attributes;
    
end );

##
InstallMethod( ShallowCopy,
        [ IsListWithAttributesRep ], 100001,
        
  function( L )
    
    return CallFuncList( TypedListWithAttributes,
                   Concatenation( [ ShallowCopy( L!.list ), L!.type ], L!.attributes ) );
    
end );

##
InstallMethod( IsBound\[\],
        [ IsListWithAttributesRep, IsPosInt ],
        
  function( L, i )
    
    return IsBound( L!.list[i] );
    
end );

##
InstallOtherMethod( Unbind\[\],
        [ IsListWithAttributesRep, IsPosInt ],
        
  function( L, i )
    
    Unbind( L!.list[i] );
    
end );

##
InstallMethod( Position,
        [ IsListWithAttributesRep, IsObject ],
        
  function( L, o )
    
    return Position( L!.list, o );
    
end );

##
InstallMethod( \[\],
        [ IsListWithAttributesRep, IsPosInt ],
        
  function( L, i )
    
    return L!.list[i];
    
end );

##
InstallOtherMethod( \[\]\:\=,
        [ IsListWithAttributesRep, IsPosInt, IsObject ],
        
  function( L, i, o )

    L!.list[i] := o;
    
    return L;
    
end );

##
InstallMethod( \{\},
        [ IsListWithAttributesRep, IsList ], 100001,
        
  function( L, l )
    
    return CallFuncList( TypedListWithAttributes,
                   Concatenation( [ L!.list{l}, L!.type ], L!.attributes ) );
    
end );

##
InstallOtherMethod( \{\}\:\=,
        [ IsListWithAttributesRep, IsList, IsList ],
        
  function( L, l, o )

    L!.list{l} := o;
    
    return L;
    
end );

##
InstallOtherMethod( Add,
        [ IsListWithAttributesRep, IsObject ],
        
  function( L, o )
    
    Add( L!.list, o );
    
end );

##
InstallOtherMethod( Append,
        [ IsListWithAttributesRep, IsList ],
        
  function( L, l )
    
    Append( L!.list, l );
    
end );

##
InstallOtherMethod( Append,
        [ IsListWithAttributesRep, IsListWithAttributesRep ],
        
  function( L1, L2 )
    
    Append( L1, L2!.list );
    
end );

##
InstallMethod( FilteredOp,
        [ IsListWithAttributesRep, IsFunction ], 100001,
        
  function( L, f )
    
    return CallFuncList( TypedListWithAttributes,
                   Concatenation( [ Filtered( L!.list, f ), L!.type ], L!.attributes ) );
    
end );

##
InstallMethod( ForAllOp,
        [ IsListWithAttributesRep, IsFunction ],
        
  function( L, f )
    
    return ForAllOp( L!.list, f );
    
end );

##
InstallMethod( ForAnyOp,
        [ IsListWithAttributesRep, IsFunction ],
        
  function( L, f )
    
    return ForAnyOp( L!.list, f );
    
end );

##
InstallMethod( ViewObj,
        [ IsListWithAttributesRep ],
        
  function( L )
    
    ViewObj( L!.list );
    
end );

Messung V0.5 in Prozent
C=89 H=100 G=94

¤ Dauer der Verarbeitung: 0.21 Sekunden  (vorverarbeitet am  2026-10-12) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

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.