OCaml - List - Creating A List
Maybe your like
Skip to main content
BadproG.com Programming with C, C++, Java SE, Java EE, Android, UNIX and GNU/Linux, PHP, MySQL, Symfony, Zend and much more!
‹ OCaml - List up OCaml - List - Iterating through a list and displaying all elements inside ›
BadproG.com Programming with C, C++, Java SE, Java EE, Android, UNIX and GNU/Linux, PHP, MySQL, Symfony, Zend and much more! Navigation
- About
Main menu
You are here
Home » OCaml » List OCaml - List - Creating a list Submitted by Mi-K on Wednesday, February 29, 2012 - 10:04amAs all programming languages, it is possible to create lists in OCaml.
So, let's see this, right now with new examples. We will indeed create two functions, one of ints and another of strings.
For the ints:
#let number = [1; 2; 3; 4];;For the strings: #let fruits = ["apricot"; "raspberry"; "cherry"; "tomato"];;As you can see, there is no need to tell to the interpreter the type of elements in the list. It's automatic!Add new comment
Your name Comment *More information about text formats
Plain text
- No HTML tags allowed.
- Lines and paragraphs break automatically.
Reveal your desire
SearchMake your choice
- Android
- API Framework
- Activities w/ Intent
- Activity
- Activity life cycle
- CharSequence
- GridView
- ListView
- Method name
- Spinner and colors
- API Google Maps
- T2 MapView
- T5 MapType
- T6 GMapsAPIv2
- Android Studio
- Unsign release apk
- Application
- T0 Hello World
- T1 Google Maps
- Error
- ActivityManager
- DeviceMonitor
- Installation
- 32-bit ADT
- Windows
- MediaPlayer
- T4 Playing sounds
- SQLite
- T7 SQLite Basics
- Tips'n Tricks
- Hide/Show Notif
- T3 Adding Buttons
- API Framework
- Apache
- Ant
- Errors
- Installation
- Archiva
- Installation
- Continuum
- Configuration
- Installation
- HTTP
- Errors
- Installation
- Maven
- Installation
- What is Maven?
- Tomcat
- Installation
- Ant
- Assembly
- GNU/Linux
- Hello World!
- objdump
- -p command
- GNU/Linux
- C
- Binary
- Binary decimals
- Bitwise operation
- Bit shift decimal
- Char manipulation
- Alloc memory
- Displaying a char
- char into int
- Eclipse
- Installation of C
- Errors / Warnings
- After compiling
- Handling errors
- General Prog
- Beep function
- If statement
- Keyword
- extern
- Lib functions
- daemon()
- free()
- inet_ntoa()
- srand() / rand()
- strcmp()
- Linked lists
- Head and End
- Simple example
- Mathematics
- Fraction simplifier
- Luhn algorithm
- Prime numbers
- Pointers
- Some examples
- Recursion
- Classical factorial
- Displaying string
- Finding a number
- SDL
- Errors
- Hello World!
- Moving shapes
- Multicolored
- TCP/IP
- In/Out on socket
- Tips'n Tricks
- Clock w/ 6 numb
- Degree of devices
- Type
- uint16 into uint8
- uint[8,16,32,64]_t
- Unary operators
- sizeof()
- Binary
- C#
- Visual Studio
- Add ICO file
- Visual Studio
- C++
- Algorithm
- for_each()
- min max minmax
- Boost
- Building Numpy
- DLL for Python
- Setup Windows 10
- from_data()
- vector to ndarray
- CMake
- Setup Cygwin
- Design pattern
- Command
- Decorator
- Factory method
- Mediator
- Memento
- Observer
- Prototype
- Proxy
- Singleton
- Strategy
- Eclipse
- Installation
- Errors / Warnings
- After compiling
- static linkage
- Google Test
- Makefile CLI
- Setup by hand
- Setup for gtest lib
- VS, gtest Adapter
- Keyword
- virtual
- Makefile
- Adding flags
- NVIDIA CUDA
- compute / sm
- OpenCV
- Hello world
- Seting up VS
- OpenGL
- Equilateral shape
- Hello World!
- Installation
- OR & << operators
- OpenGL version
- Set Visual Studio
- glRotatef basics
- glRotatef to anim
- icon to exe file
- Qt Framework
- 1 array pos/color
- Delegate CheckBox
- Hello World
- Jenkins and Qt
- Lighting & normal
- Native OpenGL/Qt
- QAbs.ItemModel
- QDataStream
- QOpenGLWidget
- Shape arrow keys
- Texture index
- VAO and VBO
- STL
- queue container
- vector container
- Standard library
- move
- pair container
- Tips'n Tricks
- Interface abstract
- List of pairs
- Stack & heap
- std:string into int
- Visual Studio IDE
- Props
- Windows
- Creating a DLL
- HelloWorld
- Algorithm
- Eclipse
- Arduino
- Installation
- C/C++
- Installation
- CppUnit
- Installation
- Debugger
- An easy example
- Errors
- While coding
- Explorer
- Hiding svn folder
- Indigo
- Install PHP
- JUnit
- Installation
- Java
- SRC attachment
- Python
- Installation
- Qt
- Installation
- SDL
- Installation
- SWT
- Installation
- Subversion
- SVN on Windows
- Tips'n tricks
- Adding flags GCC
- Code Style
- Getter and setter
- Open Element
- Open Type
- Arduino
- Electronics
- Atollic
- Completion
- Eagle
- Schematics basics
- IAR Systems
- Download bin file
- EWARM Install
- Errors
- IAR & STM32L
- Keil
- Creating a project
- uVision4 errors
- MSP430
- Default software
- Pins-LEDs-binary
- Register bit shift
- Registers & LEDs
- Switch on a LED
- Temp demo GUI
- Timer 1 sec
- Quartus II
- Install ModelSim
- Intro ModelSim
- Qsys SoPC basics
- Setting up CLI
- Using CLI
- Using ModelSim
- STM32
- ADC & potentio
- LEDs, LCD, buzzer
- Nucleo with IAR
- Pins init & enable
- PushButton LED
- STM32F3 GPIO
- User button & LCD
- Windows' install
- SystemVerilog
- Numbers
- VHDL
- Hello World
- Verilog
- Blink LED GPIOs
- Blinking a LED
- Instantiate module
- Struct. description
- Turn off 7-seg
- Atollic
- Java
- JUnit
- Hello World!
- SE
- Hello World
- HelloWorld.jar
- SWT
- HelloWorld tuto
- Tips'n Tricks
- Printing patterns
- Sorting & writing
- Source attachment
- Variable
- Casting
- Declaration
- JUnit
- JavaScript
- Closure
- Three Examples
- Node
- childElemCount
- childNodes
- Tips'n Tricks
- Parent to child
- Window
- alert()
- Closure
- MySQL
- Commands
- Pager
- Installation
- Windows
- Commands
- OCaml
- Function
- Creating functions
- Using recursions
- getter of tuples
- List
- Creating a list
- Showing elements
- OCaml - Utilities
- rlwrap
- Variable
- Creating variables
- Function
- Objective-C
- Design pattern
- Delegation
- MVC
- Design pattern
- Oracle
- GlassFish OSE
- Installation
- VirtualBox
- Installation
- Resolution guest
- GlassFish OSE
- PHP 5
- Installation
- Windows
- PEAR
- Installation
- array()
- is_array()
- Installation
- Perl
- Native functions
- print()
- Perl - OOP
- Class & method
- Native functions
- PhpMyAdmin
- Installation
- Windows
- Installation
- PostgreSQL
- Setting up
- Linux Ubuntu
- Setting up
- Python 3
- Data types
- Dictionary
- List
- Set
- Tuple
- Eclipse
- Installation
- Function
- Declaration
- General prog
- Get & set for C++
- Statements
- Installing
- Eclipse and PyDev
- On Windows 10
- On Windows 7
- PySide2
- Setup & Designer
- Data types
- Ruby on Rails 3
- Console options
- Create a project
- Display version
- Server
- Start the server
- Console options
- Rust
- Crate
- Grcov demo
- Exploration
- Vec Mem & perf
- Python binding
- PyO3 with Maturin
- Crate
- Security
- Checksum
- MD5
- Checksum
- Symfony 1
- Doctrine
- Set up Database
- Error
- SQL / Doctrine
- Helper
- UrlHelper
- MVC
- Explanation
- Routing
- Easy basic one
- URL dash hand
- Security
- Authentication
- Set up
- A new project
- Test unit
- Doctrine db
- Doctrine
- Symfony 2
- Installation
- Windows
- Installation
- UML
- Diagram Class
- Relationships
- Diagram Class
- UNIX & GNU/Linux
- Emacs
- Auto-complete
- Moon's phases
- Number lines
- Gentoo
- Setting it up
- Kernel
- Compiling 1st time
- LAMP
- Installation
- Raspberry Pi
- Set up
- SSH
- Client and server
- Pub & priv keys
- System calls
- accept()
- bind()
- execve()
- fork()
- fork() ≠ vfork()
- getenv()
- gettimeofday()
- listen()
- open()
- opendir()
- read()
- readdir()
- semget()
- socket()
- stat()
- tgetent()
- tgetflag()
- tgetnum()
- time()
- wait()
- Tips and tricks
- G Chrome Ubuntu
- Keyboard lang
- More workspaces
- Screen resolution
- User commands
- fs
- grep
- info
- man
- wc
- awk
- Average marks
- FILENAME
- Find a pattern
- NR
- Words in a file
- getline from user
- bash
- .profile Git bash
- Colour prompt PS1
- gcc
- -v command
- Option -I
- Option -L and -l
- gdb
- With Emacs
- make
- Makefile
- tar
- xvf command
- tcsh
- Country flags
- source
- Emacs
- Zend
- Framework 1.11
- Command line
- New project
- Zend_Controller
- Framework 1.11
Check for news
© Badprog - I want to change the world. And I will.
Tag » How To Create N Number Of Lists In Ocaml
-
Lists · OCaml Tutorials
-
OCaml Library : List
-
OCaml : How To Create A List Of N 1's In - Stack Overflow
-
Lists - Cornell CS
-
Lists And Patterns - Real World OCaml
-
[PDF] List Processing In Ocaml - Wellesley College
-
[PDF] OCaml Introduction: Tuples And Lists - UCSD CSE
-
[PDF] Ocaml.pdf - Computer Science, Columbia University
-
[PDF] Chapter 5 - Lists - The Caml Language
-
3.1. Generating Arrays — YSC2229 2021 - Ilya Sergey
-
[PDF] Lecture 5: Lists
-
Linked Lists And Structural Recursion - OCaml From The Ground Up
-
OCaml For The Skeptical: Built-In Data Types
-
OCaml Lecture Notes