[GAP Forum] Is it possible to obtain the size of a dictionary?

Alexander Konovalov alexander.konovalov at st-andrews.ac.uk
Tue Apr 14 22:14:20 BST 2020


Hello William,

Please provide more details - which kind of dictionary do you have?

For example, it works here on the example from the reference manual:

gap> d:=NewDictionary((1,2,3),true);;
gap> AddDictionary(d,(1,2),1);
gap> AddDictionary(d,(5,6),9);
gap> AddDictionary(d,(4,7),2);
gap> LookupDictionary(d,(5,6));
9
gap> Size(d);
3


Thanks
Alexander


> On 14 Apr 2020, at 21:42, Will Chen <oxeimon at gmail.com> wrote:
> 
> Size(...) doesn't seem to work for dictionaries.
> 
> Is there a way to return its size? (or do we have to track it separately as
> we add to it?)
> 
> -- 
> 
> William Chen
> NSF Postdoctoral Fellow, Department of Mathematics
> Columbia University,
> New York, NY, 10025
> oxeimon at gmail.com
> _______________________________________________
> Forum mailing list
> Forum at gap-system.org
> https://mail.gap-system.org/mailman/listinfo/forum

--
Dr. Alexander Konovalov, Lecturer
School of Computer Science, University of St Andrews
Software Sustainability Institute Fellow
https://alex-konovalov.github.io/
--
The University of St Andrews is a charity registered in Scotland:No.SC013532






More information about the Forum mailing list