# How Can I Create Permanently-Stored Lookup Tables?

**URL:** <https://discourse.julialang.org/t/how-can-i-create-permanently-stored-lookup-tables/59755>\
**Category:** General Usage\
**Tags:** question\
**Created:** [April 21, 2021, 8:55pm UTC](https://discourse.julialang.org/t/how-can-i-create-permanently-stored-lookup-tables/59755 "2021-04-21T20:55:53Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [April 21, 2021, 9:20pm UTC](https://discourse.julialang.org/t/how-can-i-create-permanently-stored-lookup-tables/59755/2 "2021-04-21T21:20:24Z")

</div>

Use a functor:

> [@Define data-dependent function, various ways](https://discourse.julialang.org/t/define-data-dependent-function-various-ways/48988/4):
>
> I think [function-like objects](https://docs.julialang.org/en/v1/manual/methods/#Function-like-objects) (sometimes called “functors”) would be yet another option to achieve the same kind of things. (AFAIU, this is what’s internally used to implement closures, and I think it requires a bit less work for the compiler to optimize. Maybe someone more knowledgeable will chime in and confirm or correct this) struct Fun data :: Vector{Int} end function (f::Fun)(x) s = 0. for i in 1:length(x) s += (x[i]-f.data[i])^2 end s end println(" Functor: ") functor …

Ps: of course you can read the tables into arrays, using CSV.jl

---

_[View the full topic](https://discourse.julialang.org/t/how-can-i-create-permanently-stored-lookup-tables/59755)._
