- Julia 1.0 Programming Complete Reference Guide
- Ivo Balbaert Adrian Salceanu
- 178字
- 2021-06-24 14:21:51
Metaprogramming in Julia
Everything in Julia is an expression that returns a value when executed. Every piece of the program code is internally represented as an ordinary Julia data structure, also called an expression. In this chapter, we will see how, by working on expressions, a Julia program can transform and even generate new code. This is a very powerful characteristic, also called homoiconicity. It inherits this property from Lisp, where code and data are just lists, and where it is commonly referred to with the phrase: Code is data and data is code
.
In homoiconic languages, code can be expressed in terms of the language syntax. This is the case for the Lisp-like family of languages: Lisp, Scheme and, more recently, Clojure, which use s-expressions. Julia is homoiconic, as are others such as Prolog, IO, Rebol, and Red. As such, these are able to generate code during runtime, which can be subsequently executed.
We will explore this metaprogramming power by covering the following topics:
- Expressions and symbols
- Evaluation and interpolation
- Defining macros
- Built-in macros
- Reflection capabilities
- Mastering Ext JS(Second Edition)
- C語(yǔ)言程序設(shè)計(jì)實(shí)踐教程(第2版)
- Boost程序庫(kù)完全開發(fā)指南:深入C++”準(zhǔn)”標(biāo)準(zhǔn)庫(kù)(第5版)
- Getting started with Google Guava
- Web開發(fā)的貴族:ASP.NET 3.5+SQL Server 2008
- Java:Data Science Made Easy
- Windows Presentation Foundation Development Cookbook
- Hands-On C++ Game Animation Programming
- WordPress Plugin Development Cookbook(Second Edition)
- Mastering openFrameworks:Creative Coding Demystified
- 執(zhí)劍而舞:用代碼創(chuàng)作藝術(shù)
- Unity Android Game Development by Example Beginner's Guide
- Neo4j 3.x入門經(jīng)典
- Java服務(wù)端研發(fā)知識(shí)圖譜
- 數(shù)據(jù)庫(kù)技術(shù)及應(yīng)用教程上機(jī)指導(dǎo)與習(xí)題(第2版)