当前位置:网站首页>spicy (1) basic definition
spicy (1) basic definition
2022-07-30 03:43:00 【a tobey】
unit
spicy parses data units through the unit type, which is similar to the well-known struct or record type.It defines a series of sequential fields, each of which has a name and a type, and stores the corresponding value at runtime.Units can be instantiated, assigned values to various fields, and those field values can be retrieved.
module Test;public type Foo = unit {# define a 32-bit integerversion: uint32 &default=56; # You can add the &default attribute to add a default value, otherwise the default value will not be set};# instantiate as fglobal f:Foo;# You can assign a value to override the default value of 56# f.version=60;print f; # Note that if the field inside is not assigned a value, the default value will not be read even if there is a default value.shows not setprint "version is %s" % f.version; # Note that when accessing the field, if there is no assignment, but there is a default value, the default value will be read

A unit is the starting point or entry for parsing data.If you want to make the unit outside the current module (that is, other files want to use the unit defined by the file), you need to declare it as public, and you can only write it for internal access.
By default, spicy is in network byte order.Can
边栏推荐
- Three years of experience will only be a little bit (functional testing), and you may not even be able to find a job after resigning.
- 监控页面部署
- CDH/CDP 是什么?
- 2022-07-29 第四小组 修身课 学习笔记(every day)
- 小程序毕设作品之微信二手交易小程序毕业设计成品(6)开题答辩PPT
- Tcp编程
- FreeRTOS个人笔记-内存管理
- SQLSERVER将子查询数据合并拼接成一个字段
- JUC (six): synchronized
- Nacos service registration and discovery
猜你喜欢

Software testing interview questions and answer analysis, the strongest version in 2022

答对这3个面试问题,薪资直涨20K

Transformation of traditional projects

护网行动基本介绍

Overview of Federated Learning (2) - Classification, Framework and Future Research Directions of Federated Learning

NLP Natural Language Processing (2)

(六)《数电》——二极管与CMOS门电路(入门)

星光不问赶路人!武汉校区小姐姐三个月成功转行软件测试,收获9k+13薪!

sqlmap使用教程大全命令大全(图文)

vscode 调试和远程
随机推荐
HCIP OSPF
Ansible introduction (detailed) features + advantages + design concept + application field + system architecture + working principle + task execution process
route filter
un7.29: How to install and configure redis in Linux-centos?
Answer these 3 interview questions correctly, and the salary will go up by 20K
SQLSERVER将子查询数据合并拼接成一个字段
3.nodejs--modularization
计划处理链的很多种情况
小程序毕设作品之微信二手交易小程序毕业设计成品(3)后台功能
OPENSQL
OpenFeign实现降级
朴素贝叶斯分类
Ansible简介(详细)特性+优点+设计理念+应用领域+系统架构+工作原理+任务执行流程
What is the difference between mission, vision and values?
运行时间监控:如何确保网络设备运行时间
Nacos service registration and discovery
List获取差集产生的问题
JUC (four): five/six states of shorthand thread
数据湖:数据集成工具DataX
小程序毕设作品之微信积分商城小程序毕业设计成品(4)开题报告